diff options
531 files changed, 35045 insertions, 22053 deletions
@@ -1,29 +1,69 @@ +Alexander Holland <alexander.holland@live.de> +Alexander Holland <alexander.holland@live.de> <alexander.holland@haw-hamburg.de> +Alexander Holland <alexander.holland@live.de> <AlexHolly> Andrea Catania <info@andreacatania.com> Andreas Haas <liu.gam3@gmail.com> -Andreas Haas <Hinsbart@users.noreply.github.com> -Andreas Haas <entenflugstuhl@gmail.com> +Andreas Haas <liu.gam3@gmail.com> <hinsbart@gmail.com> +Andreas Haas <liu.gam3@gmail.com> <hinsbart@users.noreply.github.com> +Andreas Haas <liu.gam3@gmail.com> <entenflugstuhl@gmail.com> Ariel Manzur <ariel@godotengine.org> -Ariel Manzur <ariel@okamstudio.com> +Ariel Manzur <ariel@godotengine.org> <punto@godotengine.org> +Ariel Manzur <ariel@godotengine.org> <ariel@okamstudio.com> +Ariel Manzur <ariel@godotengine.org> <punto@Ariels-Mac-mini.local> +Ariel Manzur <ariel@godotengine.org> <punto@Ariels-Mac-mini-2.local> Bastiaan Olij <mux213@gmail.com> -Bernhard Liebl <poke1024@gmx.de> -Bernhard Liebl <poke1024@gmx.org> +Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.de> +Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.org> +Chris Bradfield <chris@kidscancode.org> <cb@scribe.net> +Clay John <claynjohn@gmail.com> +Clay John <claynjohn@gmail.com> <clayjohn@shaw.ca> +Dana Olson <dana@shineuponthee.com> <adolson@gmail.com> +Daniel J. Ramirez <djrmuv@gmail.com> +Ferenc Arn <tagcup@yahoo.com> +Ferenc Arn <tagcup@yahoo.com> <tagcup@users.noreply.github.com> Geequlim <geequlim@gmail.com> -Hugo Locurcio <hugo.locurcio@hugo.pro> +Gilles Roudiere <gilles.roudiere@gmail.com> +Gilles Roudiere <gilles.roudiere@gmail.com> <gilles.roudiere@laas.fr> +Guilherme Felipe <guilhermefelipecgs@gmail.com> Hugo Locurcio <hugo.locurcio@hugo.pro> <hugo.l@openmailbox.org> Hugo Locurcio <hugo.locurcio@hugo.pro> <Calinou@users.noreply.github.com> +Hugo Locurcio <hugo.locurcio@hugo.pro> Calinou <calinou@opmbx.org> +Ian Bishop <ianb96@gmail.com> Ignacio Etcheverry <ignalfonsore@gmail.com> +Ignacio Etcheverry <ignalfonsore@gmail.com> <neikeq@users.noreply.github.com> Indah Sylvia <ISylvox@yahoo.com> +J08nY <johny@neuromancer.sk> <jancar.jj@gmail.com> +J08nY <johny@neuromancer.sk> <J08nY@users.noreply.github.com> Jakub Grzesik <kubecz3k@gmail.com> +Jérôme Gully <jerome.gully0@gmail.com> Juan Linietsky <reduzio@gmail.com> -Juan Linietsky <juan@okamstudio.com> -Juan Linietsky <reduz@Juans-MBP.fibertel.com.ar> +Juan Linietsky <reduzio@gmail.com> <juan@godotengine.org> +Juan Linietsky <reduzio@gmail.com> <juan@okamstudio.com> +Juan Linietsky <reduzio@gmail.com> <reduz@Juans-MBP.fibertel.com.ar> +Juan Linietsky <reduzio@gmail.com> <red@kyoko> Julian Murgia <the.straton@gmail.com> -Leon Krause <eska@eska.me> -Leon Krause <eska@eska.me> <eska014@users.noreply.github.com> +Kelly Thomas <kelly.thomas@hotmail.com.au> +Leon Krause <lk@leonkrause.com> <eska@eska.me> +Leon Krause <lk@leonkrause.com> <eska014@users.noreply.github.com> Marcelo Fernandez <marcelofg55@gmail.com> +Marcin Zawiejski <dragmz@gmail.com> Mariano Javier Suligoy <marianognu.easyrpg@gmail.com> +Mario Schlack <m4r10.5ch14ck@gmail.com> +Max Hilbrunner <m.hilbrunner@gmail.com> +Max Hilbrunner <m.hilbrunner@gmail.com> <mhilbrunner@users.noreply.github.com> +Nathan Warden <nathan@nathanwarden.com> <nathanwardenlee@icloud.com> +Nuno Donato <nunodonato@gmail.com> <n.donato@estrelasustentavel.pt> +Pedro J. Estébanez <pedrojrulez@gmail.com> <RandomShaper@users.noreply.github.com> Paul Batty <p_batty@hotmail.co.uk> +Paul Batty <p_batty@hotmail.co.uk> <Paulb23@users.noreply.github.com> +Pieter-Jan Briers <pieterjan.briers+git@gmail.com> +Pieter-Jan Briers <pieterjan.briers+git@gmail.com> <pieterjan.briers@gmail.com> Poommetee Ketson <poommetee@protonmail.com> +Rémi Verschelde <rverschelde@gmail.com> <remi@verschelde.fr> +Ruslan Mustakov <r.mustakov@gmail.com> <ruslan.mustakov@xored.com> Saracen <SaracenOne@gmail.com> +Theo Hallenius <redsymbzone@hotmail.com> Thomas Herzog <therzog@mail.de> +Thomas Herzog <therzog@mail.de> <thomas.herzog@mail.com> +Thomas Herzog <therzog@mail.de> <thomas.herzog@simedis.com> Zher Huei Lee <lee.zh.92@gmail.com> diff --git a/AUTHORS.md b/AUTHORS.md index 7859a3cd37..b7eca2d9b1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -25,16 +25,16 @@ name is available. ## Developers -(in alphabetical order, with 10 commits or more excluding merges) +(in alphabetical order, with over 10 commits excluding merges) Aaron Franke (aaronfranke) Alexander Holland (AlexHolly) - Alexey Velikiy (jonyrock) Alket Rexhepi (alketii) Andrea Catania (AndreaCatania) Andreas Haas (Hinsbart) Andrii Doroshenko (Xrayez) Andy Moss (MillionOstrich) + Anish Bhobe (KidRigger) Anton Yabchinskiy (a12n) Aren Villanueva (kurikaesu) Ariel Manzur (punto-) @@ -46,6 +46,7 @@ name is available. Bojidar Marinov (bojidar-bg) bruvzg Carl Olsson (not-surt) + Carter Anderson (cart) Chris Bradfield (cbscribe) Clay John (clayjohn) Dana Olson (adolson) @@ -61,13 +62,13 @@ name is available. Ferenc Arn (tagcup) Franklin Sobrinho (TheHX) Geequlim - Gen (dbsGen) George Marques (vnen) Gerrit Großkopf (Grosskopf) Gilles Roudiere (groud) Guilherme Felipe de C. G. da Silva (guilhermefelipecgs) Hein-Pieter van Braam (hpvb) Hiroshi Ogawa (hi-ogawa) + homer666 Hubert Jarosz (Marqin) Hugo Locurcio (Calinou) Ian Bishop (ianb96) @@ -76,7 +77,7 @@ name is available. Indah Sylvia (ISylvox) J08nY Jakub Grzesik (kubecz3k) - Jérôme GULLY (Nutriz) + Jérôme Gully (Nutriz) Joan Fons Sanchez (JFonS) Johan Manuel (29jm) Joshua Grams (JoshuaGrams) @@ -94,6 +95,7 @@ name is available. Mariano Javier Suligoy (MarianoGnu) Mario Schlack (hurikhan) Martin Capitanio (capnm) + Martin LiÅ¡ka (marxin) Martin Sjursen (binbitten) marynate Masoud BH (masoudbh3) @@ -124,6 +126,7 @@ name is available. Saniko (sanikoyes) SaracenOne sersoong + Simon Wenner (swenner) Theo Hallenius (TheoXD) Thomas Herzog (karroffel) Timo (toger5) diff --git a/CHANGELOG.md b/CHANGELOG.md index b111eca07d..060a270426 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [3.1] - 2019-03-13 ### Added @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Support for RayCast shapes in kinematic bodies. - Support for synchronizing kinematic movement to physics, avoiding an one-frame delay. - WebSockets support using [libwebsockets](https://libwebsockets.org/). +- UPnP support using [MiniUPnP](http://miniupnp.free.fr). - [Revamped inspector.](https://godotengine.org/article/godot-gets-new-inspector) - Improved visualization and editing of numeric properties. - Vector and matrix types can now be edited directly (no pop-ups). @@ -128,6 +129,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Universal translation of touch input to mouse input. - AudioStreamPlayer, AudioStreamPlayer2D, and AudioStreamPlayer3D now have a pitch scale property. - Support for MIDI input. +- Support for audio capture from microphones. - `GROW_DIRECTION_BOTH` for Controls. - Selected tiles can be moved in the tile map editor. - The editor can now be configured to display the project window on the previous or next monitor (relative to the editor). @@ -165,6 +167,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [Built-in vector types now use copy-on-write mode as originally intended](https://godotengine.org/article/why-we-broke-your-pr), resulting in increased engine performance. - The [mbedtls](https://tls.mbed.org/) library is now used instead of OpenSSL. +- [Renamed several core files](https://github.com/godotengine/godot/pull/25821). + - Third-party modules may have to be updated to reflect this. - SSL certificates are now bundled in exported projects unless a custom bundle is specified. - Improved buffer writing performance on Windows and Linux. - Removed many debugging prints in the console. @@ -183,10 +187,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Text editor themes are now sorted alphabetically in the selection dropdown. - The 3D manipulator gizmo now has a smoother, more detailed appearance. - The 3D viewport menu button now has a background to make it easier to read. +- QuadMeshes are now built using two triangles (6 vertices) instead of one quad (4 vertices). + - This was done because quads are deprecated in OpenGL. - Controls inside containers are no longer movable or resizable but can still be selected. - The `is` GDScript keyword can now be used to compare a value against built-in types. +- Exported variables with type hints are now always initialized. + - For example, `export(int) var a` will be initialized to `0`. - Named enums in GDScript no longer create script constants. - This means `enum Name { VALUE }` must now be accessed with `Name.VALUE` instead of `VALUE`. +- Cyclic references to other scripts with `preload()` are no longer allowed. + - `load()` should be used in at least one of the scripts instead. +- `switch`, `case` and `do` are no longer reserved identifiers in GDScript. - Shadowing variables from parent scopes is no longer allowed in GDScript. - Function parameters' default values can no longer depend on other parameters in GDScript. - Indentation guides are now displayed in a more subtle way in the script editor. @@ -209,6 +220,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Removed +- Removed the RtAudio backend on Windows in favor of WASAPI, which is the default since 3.0. - **macOS:** Support for 32-bit and fat binaries. ### Fixed @@ -220,6 +232,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - The animation editor time offset indicator no longer "walks" when resizing the editor. - Allow creation of a built-in GDScript file even if the filename suggested already exists. - Show tooltips in the editor when physics object picking is disabled. +- Button shortcuts can now be triggered by gamepad buttons. - Fix a serialization bug that could cause TSCN files to grow very large. - Gizmos are now properly hidden on scene load if the object they control is hidden. - Camera gizmos in the 3D viewport no longer look twice as wide as they actually are. @@ -231,6 +244,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - The Visual Studio Code external editor option now recognizes more binary names such as `code-oss`, making detection more reliable. - The `-ffast-math` flag is no longer used when compiling Godot, resulting in increased floating-point determinism. - Fix spelling of `apply_torque_impulse()` and deprecate the misspelled method. +- Escape sequences like `\n` and `\t` are now recognized in CSV translation files. - Remove spurious errors when using a PanoramaSky without textures. - The lightmap baker will now use all available cores on Windows. - Bullet physics now correctly calculates effective gravity on KinematicBodies. diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index be03fb44c5..8b263a2d2c 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -44,7 +44,7 @@ Source: https://github.com/godotengine/godot Files: * Comment: Godot Engine Copyright: 2007-2019, Juan Linietsky, Ariel Manzur. - 2014-2019, Godot Engine contributors. + 2014-2019, Godot Engine contributors. License: Expat Files: ./icon.png @@ -77,8 +77,8 @@ Files: ./platform/android/power_android.cpp ./platform/x11/power_x11.cpp Comment: Simple DirectMedia Layer Copyright: 1997-2017, Sam Lantinga - 2007-2019, Juan Linietsky, Ariel Manzur. - 2014-2019, Godot Engine contributors. + 2007-2019, Juan Linietsky, Ariel Manzur. + 2014-2019, Godot Engine contributors. License: Expat and Zlib Files: ./scene/animation/tween_interpolaters.cpp @@ -98,27 +98,27 @@ Files: ./servers/physics/gjk_epa.cpp ./servers/physics/joints/slider_joint_sw.h Comment: Bullet Continuous Collision Detection and Physics Library Copyright: 2003-2008, Erwin Coumans - 2007-2019, Juan Linietsky, Ariel Manzur. - 2014-2019, Godot Engine contributors. + 2007-2019, Juan Linietsky, Ariel Manzur. + 2014-2019, Godot Engine contributors. License: Expat and Zlib Files: ./servers/physics/joints/cone_twist_joint_sw.cpp ./servers/physics/joints/cone_twist_joint_sw.h Comment: Bullet Continuous Collision Detection and Physics Library Copyright: 2007, Starbreeze Studios - 2007-2019, Juan Linietsky, Ariel Manzur. - 2014-2019, Godot Engine contributors. + 2007-2019, Juan Linietsky, Ariel Manzur. + 2014-2019, Godot Engine contributors. License: Expat and Zlib Files: ./thirdparty/b2d_convexdecomp/ Comment: Box2D (ConvexDecomp) Copyright: 2007, Eric Jordan - 2006-2009, Erin Catto + 2006-2009, Erin Catto License: Zlib Files: ./thirdparty/bullet/ Comment: Bullet Continuous Collision Detection and Physics Library -Copyright: 2003-2008, Erwin Coumans +Copyright: 2003-2013, Erwin Coumans License: Zlib Files: ./thirdparty/certs/ca-certificates.crt @@ -129,7 +129,7 @@ License: MPL-2.0 Files: ./thirdparty/cvtt/ Comment: Convection Texture Tools Stand-Alone Kernels Copyright: 2018, Eric Lasota - 2018, Microsoft Corp. + 2018, Microsoft Corp. License: Expat Files: ./thirdparty/enet/ @@ -160,12 +160,12 @@ License: Expat and Bitstream Vera Fonts Copyright Files: ./thirdparty/freetype/ Comment: The FreeType Project -Copyright: 1996-2017, David Turner, Robert Wilhelm, and Werner Lemberg. +Copyright: 1996-2018, David Turner, Robert Wilhelm, and Werner Lemberg. License: FTL Files: ./thirdparty/glad/ Comment: glad -Copyright: 2013, David Herberth +Copyright: 2013-2018, David Herberth License: Expat Files: ./thirdparty/jpeg_compressor/ @@ -180,9 +180,11 @@ License: BSD-3-clause Files: ./thirdparty/libpng/ Comment: libpng -Copyright: 1995-1996, Guy Eric Schalnat, Group 42, Inc. - 1996-1997, Andreas Dilger - 1998-2018, Glenn Randers-Pehrson +Copyright: 1995-2018, The PNG Reference Library Authors. + 2018, Cosmin Truta. + 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + 1996-1997, Andreas Dilger. + 1995-1996, Guy Eric Schalnat, Group 42, Inc. License: Zlib Files: ./thirdparty/libsimplewebm/ @@ -223,24 +225,24 @@ License: BSD-3-clause Files: ./thirdparty/libwebsockets/ Comment: libwebsockets -Copyright: 2010-2017, Andy Green +Copyright: 2010-2018, Andy Green License: LGPL-2.1+SLE (libwebsockets) Files: ./thirdparty/mbedtls/ Comment: Mbed TLS -Copyright: 2006-2015, ARM Limited +Copyright: 2006-2018, Arm Limited (or its affiliates) License: Apache-2.0 Files: ./thirdparty/miniupnpc/ Comment: MiniUPnPc -Copyright: 2005-2016, Thomas Bernard +Copyright: 2005-2018, Thomas Bernard License: BSD-3-clause Files: ./thirdparty/minizip/ Comment: MiniZip Copyright: 1998-2010, Gilles Vollant - 2007-2008, Even Rouault - 2009-2010, Mathias Svensson + 2007-2008, Even Rouault + 2009-2010, Mathias Svensson License: Zlib Files: ./thirdparty/misc/aes256.cpp @@ -348,8 +350,8 @@ License: BSD-3-clause Files: ./thirdparty/pcre2/ Comment: PCRE2 -Copyright: 1997-2017, University of Cambridge, - 2009-2017, Zoltan Herczeg +Copyright: 1997-2018, University of Cambridge, + 2009-2018, Zoltan Herczeg License: BSD-3-clause Files: ./thirdparty/pvrtccompressor/ @@ -385,7 +387,7 @@ License: Zlib Files: ./thirdparty/zstd/ Comment: Zstandard -Copyright: 2016-2018, Facebook, Inc. +Copyright: 2016-2019, Facebook, Inc. License: BSD-3-clause @@ -18,10 +18,12 @@ generous deed immortalized in the next stable release of Godot Engine. Gamblify <https://www.gamblify.com> Image Campus <https://www.imagecampus.edu.ar> + Yakaz.com <https://yakaz.com> ## Mini sponsors Alan Beauchamp + Anandarup Mallik Andrew Dunai Arda Erol Brandon Lamb @@ -36,7 +38,6 @@ generous deed immortalized in the next stable release of Godot Engine. Jay Sistar Justin Arnold Kyle Szklenski - Leona Eden Leonard Meagher Ludosity AB Matthieu Huvé @@ -45,7 +46,6 @@ generous deed immortalized in the next stable release of Godot Engine. Nathan Warden Neal Gompa (Conan Kudo) Patrick Aarstad - Pers "Rainway " Ruslan Mustakov Slobodan Milnovic @@ -54,6 +54,7 @@ generous deed immortalized in the next stable release of Godot Engine. Stoney Meyerhoeffer thechris VilliHaukka + Zashi ## Gold donors @@ -61,17 +62,15 @@ generous deed immortalized in the next stable release of Godot Engine. Brandon Waite cheese65536 David Gehrig - Edward E Florian Krick + Jakub Grzesik K9Kraken Manuele Finocchiaro Nathanael Beisiegel Officine Pixel S.n.c. Retro Village - Zashi Zaven Muradyan - 13MHz Allen Schade Andreas Schüle Asher Glick @@ -79,6 +78,7 @@ generous deed immortalized in the next stable release of Godot Engine. Daniel James Daniel Lynn David Giardi + Edward E Florian Breisch Gary Oberbrunner Gero @@ -113,10 +113,9 @@ generous deed immortalized in the next stable release of Godot Engine. Dean Harmon Ivan Trombley Joan Fons - John Krzysztof Jankowski + Lord Bloodhound Lucas Ferreira Franca - Markus Wiesner Nathan Lundquist Pascal Grüter Petr Malac @@ -128,10 +127,10 @@ generous deed immortalized in the next stable release of Godot Engine. Thomas Bjarnelöf Wojciech Chojnacki Xavier PATRICELLI - Zaq Poi Alessandra Pereyra Alexey Dyadchenko + Andrew Bowen Benjamin W Flint Chau Siu Hung Chris Goddard @@ -159,10 +158,12 @@ generous deed immortalized in the next stable release of Godot Engine. Jose Malheiro Juan T Chen Juraj Móza + Kasper Jeppesen Klavdij Voncina Leandro Voltolino Lukáš Rendvanský Marius Kamm + Markus Wiesner Martin Eigel Marvin Matt Eunson @@ -170,6 +171,8 @@ generous deed immortalized in the next stable release of Godot Engine. Nick Nikitin Oliver Dick oziatek + Paul Hocker + Paul Von Zimmerman Pete Goodwin Ranoller ray-tracer @@ -199,16 +202,17 @@ generous deed immortalized in the next stable release of Godot Engine. Anthony Bongiovanni Arbor Interactive Arthur S. Muszynski - Artur Barichello Aubrey Falconer Avencherus Bailey + Balázs Batári Bastian Böhm Benedikt Ben Vercammen Bernd Jänichen Blair Allen Brandon + Brandon Schaffer Bryan Stevenson Carl Winder Carwyn Edwards @@ -226,7 +230,7 @@ generous deed immortalized in the next stable release of Godot Engine. David Cravens David May Dominik Wetzel - DOXA + Duobix Edward Herbert Egon Elbre Elmeri '- Duy Kevin Nguyen @@ -238,13 +242,13 @@ generous deed immortalized in the next stable release of Godot Engine. fengjiongmax Foomf G3Dev sà rl - George Lesica Gerrit Großkopf Grant Clarke Greg Olson Guldoman Haley Aycock Heribert Hirth + Hiroshi Naruo Hunter Jones ialex32x Igor Buzatovic @@ -254,13 +258,11 @@ generous deed immortalized in the next stable release of Godot Engine. Jeff Hungerford Jeremy Kahn Jesse Dubay - Joao Senerchia Joel Fivat Johannes Wuensch Jonas Rudlang Jonas Yamazaki Jonathan G - Jonathan Martin Jonathan Nieto Jonathon Jon Bonazza @@ -270,6 +272,7 @@ generous deed immortalized in the next stable release of Godot Engine. Juan Negrier Judd Julian Murgia + Kajornthep Piyanun KC Chan Kevin Boyer Kiyohiro Kawamura (kyorohiro) @@ -278,6 +281,7 @@ generous deed immortalized in the next stable release of Godot Engine. KsyTek Games Kuan Cheang kycho + Levi Lindsey Linus Lind Lundgren Luis Moraes Macil @@ -288,21 +292,26 @@ generous deed immortalized in the next stable release of Godot Engine. Matthias Grandis Matt Welke Maxwell + medecau Mertcan Mermerkaya + mhilbrunner Michael Dürwald Michael Gringauz Michael Labbe Mikael Olsson + Mikayla Hutchinson MoM Moritz Laass Moritz Weissenberger Natrim nee Neil Blakey-Milner + Nerdforge Nick Pavlica Niclas Eriksen Nicolás Montaña Nicolas SAN AGUSTIN + Oscar Norlander Pan Ip Patrick Nafarrete Paul Gieske @@ -331,7 +340,6 @@ generous deed immortalized in the next stable release of Godot Engine. Simon Wenner Sootstone Theo Cranmore - Théo Hay Thibault Barbaroux Thomas Bell Thomas Holmes diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index f6828ea76a..f5dbacd62d 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1093,6 +1093,11 @@ void _OS::alert(const String &p_alert, const String &p_title) { OS::get_singleton()->alert(p_alert, p_title); } +bool _OS::request_permission(const String &p_name) { + + return OS::get_singleton()->request_permission(p_name); +} + _OS *_OS::singleton = NULL; void _OS::_bind_methods() { @@ -1265,6 +1270,8 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_power_seconds_left"), &_OS::get_power_seconds_left); ClassDB::bind_method(D_METHOD("get_power_percent_left"), &_OS::get_power_percent_left); + ClassDB::bind_method(D_METHOD("request_permission", "name"), &_OS::request_permission); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "clipboard"), "set_clipboard", "get_clipboard"); ADD_PROPERTY(PropertyInfo(Variant::INT, "current_screen"), "set_current_screen", "get_current_screen"); ADD_PROPERTY(PropertyInfo(Variant::INT, "exit_code"), "set_exit_code", "get_exit_code"); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index f3bc4644d8..803743bc93 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -356,6 +356,8 @@ public: bool has_feature(const String &p_feature) const; + bool request_permission(const String &p_name); + static _OS *get_singleton() { return singleton; } _OS(); diff --git a/core/image.cpp b/core/image.cpp index 5a287ca50e..f547d7e973 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -735,6 +735,10 @@ static void _overlay(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, } } +bool Image::is_size_po2() const { + return uint32_t(width) == next_power_of_2(width) && uint32_t(height) == next_power_of_2(height); +} + void Image::resize_to_po2(bool p_square) { if (!_can_modify(format)) { diff --git a/core/image.h b/core/image.h index 872b84d565..69a42f169a 100644 --- a/core/image.h +++ b/core/image.h @@ -223,6 +223,7 @@ public: void resize(int p_width, int p_height, Interpolation p_interpolation = INTERPOLATE_BILINEAR); void shrink_x2(); void expand_x2_hq2x(); + bool is_size_po2() const; /** * Crop the image to a specific size, if larger, then the image is filled by black */ diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp index 69907a710a..b5fa412576 100644 --- a/core/io/resource_importer.cpp +++ b/core/io/resource_importer.cpp @@ -183,6 +183,11 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_ } } +bool ResourceFormatImporter::exists(const String &p_path) const { + + return FileAccess::exists(p_path + ".import"); +} + bool ResourceFormatImporter::recognize_path(const String &p_path, const String &p_for_type) const { return FileAccess::exists(p_path + ".import"); diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index 1d27d4dec3..1c146c33d7 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -68,6 +68,8 @@ public: virtual Variant get_resource_metadata(const String &p_path) const; virtual bool is_import_valid(const String &p_path) const; virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false); + virtual bool is_imported(const String &p_path) const { return recognize_path(p_path); } + virtual bool exists(const String &p_path) const; virtual bool can_be_imported(const String &p_path) const; virtual int get_import_order(const String &p_path) const; diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 98309048bb..e4b694b64f 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -633,6 +633,31 @@ bool ResourceLoader::is_import_valid(const String &p_path) { return false; //not found } +bool ResourceLoader::is_imported(const String &p_path) { + + String path = _path_remap(p_path); + + String local_path; + if (path.is_rel_path()) + local_path = "res://" + path; + else + local_path = ProjectSettings::get_singleton()->localize_path(path); + + for (int i = 0; i < loader_count; i++) { + + if (!loader[i]->recognize_path(local_path)) + continue; + /* + if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) + continue; + */ + + return loader[i]->is_imported(p_path); + } + + return false; //not found +} + void ResourceLoader::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) { String path = _path_remap(p_path); @@ -921,7 +946,7 @@ void ResourceLoader::add_custom_loaders() { for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) { StringName class_name = E->get(); - StringName base_class = ScriptServer::get_global_class_base(class_name); + StringName base_class = ScriptServer::get_global_class_native_base(class_name); if (base_class == custom_loader_base_class) { String path = ScriptServer::get_global_class_path(class_name); diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index 70eb1a3de0..ca7610a0d2 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -79,6 +79,7 @@ public: virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false); virtual Error rename_dependencies(const String &p_path, const Map<String, String> &p_map); virtual bool is_import_valid(const String &p_path) const { return true; } + virtual bool is_imported(const String &p_path) const { return false; } virtual int get_import_order(const String &p_path) const { return 0; } virtual ~ResourceFormatLoader() {} @@ -154,6 +155,7 @@ public: static void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false); static Error rename_dependencies(const String &p_path, const Map<String, String> &p_map); static bool is_import_valid(const String &p_path); + static bool is_imported(const String &p_path); static int get_import_order(const String &p_path); static void set_timestamp_on_load(bool p_timestamp) { timestamp_on_load = p_timestamp; } diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index c992e2bf94..0cecca904d 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -249,7 +249,7 @@ void ResourceSaver::add_custom_savers() { for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) { StringName class_name = E->get(); - StringName base_class = ScriptServer::get_global_class_base(class_name); + StringName base_class = ScriptServer::get_global_class_native_base(class_name); if (base_class == custom_saver_base_class) { String path = ScriptServer::get_global_class_path(class_name); diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp index 12c88f43b3..194a6f6352 100644 --- a/core/math/geometry.cpp +++ b/core/math/geometry.cpp @@ -31,6 +31,7 @@ #include "geometry.h" #include "core/print_string.h" +#include "thirdparty/misc/triangulator.h" /* this implementation is very inefficient, commenting unless bugs happen. See the other one. bool Geometry::is_point_in_polygon(const Vector2 &p_point, const Vector<Vector2> &p_polygon) { @@ -737,6 +738,40 @@ PoolVector<Face3> Geometry::wrap_geometry(PoolVector<Face3> p_array, real_t *p_e return wrapped_faces; } +Vector<Vector<Vector2> > Geometry::decompose_polygon_in_convex(Vector<Point2> polygon) { + Vector<Vector<Vector2> > decomp; + List<TriangulatorPoly> in_poly, out_poly; + + TriangulatorPoly inp; + inp.Init(polygon.size()); + for (int i = 0; i < polygon.size(); i++) { + inp.GetPoint(i) = polygon[i]; + } + inp.SetOrientation(TRIANGULATOR_CCW); + in_poly.push_back(inp); + TriangulatorPartition tpart; + if (tpart.ConvexPartition_HM(&in_poly, &out_poly) == 0) { //failed! + ERR_PRINT("Convex decomposing failed!"); + return decomp; + } + + decomp.resize(out_poly.size()); + int idx = 0; + for (List<TriangulatorPoly>::Element *I = out_poly.front(); I; I = I->next()) { + TriangulatorPoly &tp = I->get(); + + decomp.write[idx].resize(tp.GetNumPoints()); + + for (int i = 0; i < tp.GetNumPoints(); i++) { + decomp.write[idx].write[i] = tp.GetPoint(i); + } + + idx++; + } + + return decomp; +} + Geometry::MeshData Geometry::build_convex_mesh(const PoolVector<Plane> &p_planes) { MeshData mesh; diff --git a/core/math/geometry.h b/core/math/geometry.h index f927a63ed5..4b478b6b16 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -950,6 +950,8 @@ public: return H; } + static Vector<Vector<Vector2> > decompose_polygon_in_convex(Vector<Point2> polygon); + static MeshData build_convex_mesh(const PoolVector<Plane> &p_planes); static PoolVector<Plane> build_sphere_planes(real_t p_radius, int p_lats, int p_lons, Vector3::Axis p_axis = Vector3::AXIS_Z); static PoolVector<Plane> build_box_planes(const Vector3 &p_extents); diff --git a/core/math/random_pcg.cpp b/core/math/random_pcg.cpp index 8bbcca88fe..45467b32b2 100644 --- a/core/math/random_pcg.cpp +++ b/core/math/random_pcg.cpp @@ -32,24 +32,25 @@ #include "core/os/os.h" -RandomPCG::RandomPCG(uint64_t seed, uint64_t inc) : - pcg() { - pcg.state = seed; - pcg.inc = inc; +RandomPCG::RandomPCG(uint64_t p_seed, uint64_t p_inc) : + pcg(), + current_seed(DEFAULT_SEED) { + pcg.inc = p_inc; + seed(p_seed); } void RandomPCG::randomize() { seed(OS::get_singleton()->get_ticks_usec() * pcg.state + PCG_DEFAULT_INC_64); } -double RandomPCG::random(double from, double to) { +double RandomPCG::random(double p_from, double p_to) { unsigned int r = rand(); double ret = (double)r / (double)RANDOM_MAX; - return (ret) * (to - from) + from; + return (ret) * (p_to - p_from) + p_from; } -float RandomPCG::random(float from, float to) { +float RandomPCG::random(float p_from, float p_to) { unsigned int r = rand(); float ret = (float)r / (float)RANDOM_MAX; - return (ret) * (to - from) + from; + return (ret) * (p_to - p_from) + p_from; } diff --git a/core/math/random_pcg.h b/core/math/random_pcg.h index 2a69d43904..230eb9a11b 100644 --- a/core/math/random_pcg.h +++ b/core/math/random_pcg.h @@ -37,28 +37,33 @@ class RandomPCG { pcg32_random_t pcg; + uint64_t current_seed; // seed with this to get the same state public: static const uint64_t DEFAULT_SEED = 12047754176567800795U; static const uint64_t DEFAULT_INC = PCG_DEFAULT_INC_64; static const uint64_t RANDOM_MAX = 0xFFFFFFFF; - RandomPCG(uint64_t seed = DEFAULT_SEED, uint64_t inc = PCG_DEFAULT_INC_64); + RandomPCG(uint64_t p_seed = DEFAULT_SEED, uint64_t p_inc = PCG_DEFAULT_INC_64); - _FORCE_INLINE_ void seed(uint64_t seed) { - pcg.state = seed; + _FORCE_INLINE_ void seed(uint64_t p_seed) { + current_seed = p_seed; + pcg.state = p_seed; pcg32_random_r(&pcg); // Force changing internal state to avoid initial 0 } - _FORCE_INLINE_ uint64_t get_seed() { return pcg.state; } + _FORCE_INLINE_ uint64_t get_seed() { return current_seed; } void randomize(); - _FORCE_INLINE_ uint32_t rand() { return pcg32_random_r(&pcg); } + _FORCE_INLINE_ uint32_t rand() { + current_seed = pcg.state; + return pcg32_random_r(&pcg); + } _FORCE_INLINE_ double randd() { return (double)rand() / (double)RANDOM_MAX; } _FORCE_INLINE_ float randf() { return (float)rand() / (float)RANDOM_MAX; } - double random(double from, double to); - float random(float from, float to); - real_t random(int from, int to) { return (real_t)random((real_t)from, (real_t)to); } + double random(double p_from, double p_to); + float random(float p_from, float p_to); + real_t random(int p_from, int p_to) { return (real_t)random((real_t)p_from, (real_t)p_to); } }; #endif // RANDOM_PCG_H diff --git a/core/object.cpp b/core/object.cpp index c46ecc5193..8b693f039c 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -832,23 +832,22 @@ void Object::setvar(const Variant &p_key, const Variant &p_value, bool *r_valid) } Variant Object::callv(const StringName &p_method, const Array &p_args) { + const Variant **argptrs = NULL; - if (p_args.size() == 0) { - return call(p_method); - } - - Vector<Variant> args; - args.resize(p_args.size()); - Vector<const Variant *> argptrs; - argptrs.resize(p_args.size()); - - for (int i = 0; i < p_args.size(); i++) { - args.write[i] = p_args[i]; - argptrs.write[i] = &args[i]; + if (p_args.size() > 0) { + argptrs = (const Variant **)alloca(sizeof(Variant *) * p_args.size()); + for (int i = 0; i < p_args.size(); i++) { + argptrs[i] = &p_args[i]; + } } Variant::CallError ce; - return call(p_method, (const Variant **)argptrs.ptr(), p_args.size(), ce); + Variant ret = call(p_method, argptrs, p_args.size(), ce); + if (ce.error != Variant::CallError::CALL_OK) { + ERR_EXPLAIN("Error calling method from 'callv': " + Variant::get_call_error_text(this, p_method, argptrs, p_args.size(), ce)); + ERR_FAIL_V(Variant()); + } + return ret; } Variant Object::call(const StringName &p_name, VARIANT_ARG_DECLARE) { diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index d1f8236898..39d9f45bd7 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -409,6 +409,23 @@ int FileAccess::get_buffer(uint8_t *p_dst, int p_length) const { return i; } +String FileAccess::get_as_utf8_string() const { + PoolVector<uint8_t> sourcef; + int len = get_len(); + sourcef.resize(len + 1); + + PoolVector<uint8_t>::Write w = sourcef.write(); + int r = get_buffer(w.ptr(), len); + ERR_FAIL_COND_V(r != len, String()); + w[len] = 0; + + String s; + if (s.parse_utf8((const char *)w.ptr())) { + return String(); + } + return s; +} + void FileAccess::store_16(uint16_t p_dest) { uint8_t a, b; diff --git a/core/os/file_access.h b/core/os/file_access.h index 7bfbf6e7f0..c65b75369c 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -113,6 +113,7 @@ public: virtual String get_line() const; virtual String get_token() const; virtual Vector<String> get_csv_line(const String &p_delim = ",") const; + virtual String get_as_utf8_string() const; /**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac) * It's not about the current CPU type but file formats. diff --git a/core/os/input.cpp b/core/os/input.cpp index cf11ba3c6d..caa9fb1493 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -91,6 +91,7 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("set_default_cursor_shape", "shape"), &Input::set_default_cursor_shape, DEFVAL(CURSOR_ARROW)); ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor", "image", "shape", "hotspot"), &Input::set_custom_mouse_cursor, DEFVAL(CURSOR_ARROW), DEFVAL(Vector2())); ClassDB::bind_method(D_METHOD("parse_input_event", "event"), &Input::parse_input_event); + ClassDB::bind_method(D_METHOD("set_use_accumulated_input", "enable"), &Input::set_use_accumulated_input); BIND_ENUM_CONSTANT(MOUSE_MODE_VISIBLE); BIND_ENUM_CONSTANT(MOUSE_MODE_HIDDEN); diff --git a/core/os/input.h b/core/os/input.h index b354acd961..c8b80b28d0 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -132,6 +132,9 @@ public: virtual int get_joy_axis_index_from_string(String p_axis) = 0; virtual void parse_input_event(const Ref<InputEvent> &p_event) = 0; + virtual void accumulate_input_event(const Ref<InputEvent> &p_event) = 0; + virtual void flush_accumulated_events() = 0; + virtual void set_use_accumulated_input(bool p_enable) = 0; Input(); }; diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 24ec8a1963..25a5c2afeb 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -33,6 +33,9 @@ #include "core/input_map.h" #include "core/os/keyboard.h" +const int InputEvent::DEVICE_ID_TOUCH_MOUSE = -1; +const int InputEvent::DEVICE_ID_INTERNAL = -2; + void InputEvent::set_device(int p_device) { device = p_device; } @@ -122,6 +125,8 @@ void InputEvent::_bind_methods() { ClassDB::bind_method(D_METHOD("is_action_type"), &InputEvent::is_action_type); + ClassDB::bind_method(D_METHOD("accumulate", "with_event"), &InputEvent::accumulate); + ClassDB::bind_method(D_METHOD("xformed_by", "xform", "local_ofs"), &InputEvent::xformed_by, DEFVAL(Vector2())); ADD_PROPERTY(PropertyInfo(Variant::INT, "device"), "set_device", "get_device"); @@ -620,6 +625,44 @@ String InputEventMouseMotion::as_text() const { return "InputEventMouseMotion : button_mask=" + button_mask_string + ", position=(" + String(get_position()) + "), relative=(" + String(get_relative()) + "), speed=(" + String(get_speed()) + ")"; } +bool InputEventMouseMotion::accumulate(const Ref<InputEvent> &p_event) { + + Ref<InputEventMouseMotion> motion = p_event; + if (motion.is_null()) + return false; + + if (is_pressed() != motion->is_pressed()) { + return false; + } + + if (get_button_mask() != motion->get_button_mask()) { + return false; + } + + if (get_shift() != motion->get_shift()) { + return false; + } + + if (get_control() != motion->get_control()) { + return false; + } + + if (get_alt() != motion->get_alt()) { + return false; + } + + if (get_metakey() != motion->get_metakey()) { + return false; + } + + set_position(motion->get_position()); + set_global_position(motion->get_global_position()); + set_speed(motion->get_speed()); + relative += motion->get_relative(); + + return true; +} + void InputEventMouseMotion::_bind_methods() { ClassDB::bind_method(D_METHOD("set_relative", "relative"), &InputEventMouseMotion::set_relative); diff --git a/core/os/input_event.h b/core/os/input_event.h index a6a7012298..ba01516519 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -165,6 +165,9 @@ protected: static void _bind_methods(); public: + static const int DEVICE_ID_TOUCH_MOUSE; + static const int DEVICE_ID_INTERNAL; + void set_device(int p_device); int get_device() const; @@ -186,6 +189,7 @@ public: virtual bool shortcut_match(const Ref<InputEvent> &p_event) const; virtual bool is_action_type() const; + virtual bool accumulate(const Ref<InputEvent> &p_event) { return false; } InputEvent(); }; @@ -351,6 +355,8 @@ public: virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const; virtual String as_text() const; + virtual bool accumulate(const Ref<InputEvent> &p_event); + InputEventMouseMotion(); }; diff --git a/core/os/os.h b/core/os/os.h index d6541034fd..d02d5a2c84 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -518,6 +518,9 @@ public: bool is_restart_on_exit_set() const; List<String> get_restart_on_exit_arguments() const; + virtual bool request_permission(const String &p_name) { return true; } + + virtual void process_and_drop_events() {} OS(); virtual ~OS(); }; diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 6b4895d688..02c7c9e029 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -1185,6 +1185,9 @@ ProjectSettings::ProjectSettings() { Compression::gzip_level = GLOBAL_DEF("compression/formats/gzip/compression_level", Z_DEFAULT_COMPRESSION); custom_prop_info["compression/formats/gzip/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/gzip/compression_level", PROPERTY_HINT_RANGE, "-1,9,1"); + // Would ideally be defined in an Android-specific file, but then it doesn't appear in the docs + GLOBAL_DEF("android/modules", ""); + using_datapack = false; } diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 3ed25f118d..e7ff7a3aef 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -311,6 +311,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue) } else { OS::get_singleton()->delay_usec(10000); + OS::get_singleton()->process_and_drop_events(); } } diff --git a/core/script_language.cpp b/core/script_language.cpp index f0310ffc31..4a6f904f9d 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -190,6 +190,14 @@ StringName ScriptServer::get_global_class_base(const String &p_class) { ERR_FAIL_COND_V(!global_classes.has(p_class), String()); return global_classes[p_class].base; } +StringName ScriptServer::get_global_class_native_base(const String &p_class) { + ERR_FAIL_COND_V(!global_classes.has(p_class), String()); + String base = global_classes[p_class].base; + while (global_classes.has(base)) { + base = global_classes[base].base; + } + return base; +} void ScriptServer::get_global_class_list(List<StringName> *r_global_classes) { const StringName *K = NULL; List<StringName> classes; @@ -409,6 +417,11 @@ bool PlaceHolderScriptInstance::get(const StringName &p_name, Variant &r_ret) co return true; } + if (constants.has(p_name)) { + r_ret = constants[p_name]; + return true; + } + if (!script->is_placeholder_fallback_enabled()) { Variant defval; if (script->get_property_default_value(p_name, defval)) { @@ -444,6 +457,13 @@ Variant::Type PlaceHolderScriptInstance::get_property_type(const StringName &p_n *r_is_valid = true; return values[p_name].get_type(); } + + if (constants.has(p_name)) { + if (r_is_valid) + *r_is_valid = true; + return constants[p_name].get_type(); + } + if (r_is_valid) *r_is_valid = false; @@ -513,6 +533,9 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c owner->_change_notify(); } //change notify + + constants.clear(); + script->get_constants(&constants); } void PlaceHolderScriptInstance::property_set_fallback(const StringName &p_name, const Variant &p_value, bool *r_valid) { @@ -552,6 +575,13 @@ Variant PlaceHolderScriptInstance::property_get_fallback(const StringName &p_nam *r_valid = true; return E->value(); } + + E = constants.find(p_name); + if (E) { + if (r_valid) + *r_valid = true; + return E->value(); + } } if (r_valid) diff --git a/core/script_language.h b/core/script_language.h index 2d35097692..b6d7bea9c7 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -87,6 +87,7 @@ public: static StringName get_global_class_language(const StringName &p_class); static String get_global_class_path(const String &p_class); static StringName get_global_class_base(const String &p_class); + static StringName get_global_class_native_base(const String &p_class); static void get_global_class_list(List<StringName> *r_global_classes); static void save_global_classes(); @@ -336,6 +337,7 @@ class PlaceHolderScriptInstance : public ScriptInstance { Object *owner; List<PropertyInfo> properties; Map<StringName, Variant> values; + Map<StringName, Variant> constants; ScriptLanguage *language; Ref<Script> script; diff --git a/core/typedefs.h b/core/typedefs.h index 966360d4f2..03514466c0 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -250,21 +250,34 @@ static inline int get_shift_from_power_of_2(unsigned int p_pixel) { } /** Swap 16 bits value for endianness */ +#if defined(__GNUC__) || _llvm_has_builtin(__builtin_bswap16) +#define BSWAP16(x) __builtin_bswap16(x) +#else static inline uint16_t BSWAP16(uint16_t x) { return (x >> 8) | (x << 8); } +#endif + /** Swap 32 bits value for endianness */ +#if defined(__GNUC__) || _llvm_has_builtin(__builtin_bswap32) +#define BSWAP32(x) __builtin_bswap32(x) +#else static inline uint32_t BSWAP32(uint32_t x) { return ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | (x >> 24)); } -/** Swap 64 bits value for endianness */ +#endif +/** Swap 64 bits value for endianness */ +#if defined(__GNUC__) || _llvm_has_builtin(__builtin_bswap64) +#define BSWAP64(x) __builtin_bswap64(x) +#else static inline uint64_t BSWAP64(uint64_t x) { x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32; x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16; x = (x & 0x00FF00FF00FF00FF) << 8 | (x & 0xFF00FF00FF00FF00) >> 8; return x; } +#endif /** When compiling with RTTI, we can add an "extra" * layer of safeness in many operations, so dynamic_cast diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index 00894b41d8..e13164d50f 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -239,6 +239,10 @@ void UndoRedo::_pop_history_tail() { } } +bool UndoRedo::is_commiting_action() const { + return commiting > 0; +} + void UndoRedo::commit_action() { ERR_FAIL_COND(action_level <= 0); @@ -246,8 +250,9 @@ void UndoRedo::commit_action() { if (action_level > 0) return; //still nested + commiting++; redo(); // perform action - + commiting--; if (callback && actions.size() > 0) { callback(callback_ud, actions[actions.size() - 1].name); } @@ -321,6 +326,7 @@ bool UndoRedo::redo() { if ((current_action + 1) >= actions.size()) return false; //nothing to redo + current_action++; _process_operation_list(actions.write[current_action].do_ops.front()); @@ -337,7 +343,6 @@ bool UndoRedo::undo() { _process_operation_list(actions.write[current_action].undo_ops.front()); current_action--; version--; - return true; } @@ -386,6 +391,7 @@ void UndoRedo::set_property_notify_callback(PropertyNotifyCallback p_property_ca UndoRedo::UndoRedo() { + commiting = 0; version = 1; action_level = 0; current_action = -1; @@ -484,6 +490,7 @@ void UndoRedo::_bind_methods() { ClassDB::bind_method(D_METHOD("create_action", "name", "merge_mode"), &UndoRedo::create_action, DEFVAL(MERGE_DISABLE)); ClassDB::bind_method(D_METHOD("commit_action"), &UndoRedo::commit_action); + ClassDB::bind_method(D_METHOD("is_commiting_action"), &UndoRedo::is_commiting_action); //ClassDB::bind_method(D_METHOD("add_do_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_do_method); //ClassDB::bind_method(D_METHOD("add_undo_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_undo_method); diff --git a/core/undo_redo.h b/core/undo_redo.h index 4ee64dbfcf..b626149ce6 100644 --- a/core/undo_redo.h +++ b/core/undo_redo.h @@ -94,6 +94,8 @@ private: MethodNotifyCallback method_callback; PropertyNotifyCallback property_callback; + int commiting; + protected: static void _bind_methods(); @@ -107,6 +109,7 @@ public: void add_do_reference(Object *p_object); void add_undo_reference(Object *p_object); + bool is_commiting_action() const; void commit_action(); bool redo(); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 26851e4c23..b40b6ce4a6 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3656,11 +3656,55 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & } return; case POOL_INT_ARRAY: { - r_dst = a; + const PoolVector<int> *arr_a = reinterpret_cast<const PoolVector<int> *>(a._data._mem); + const PoolVector<int> *arr_b = reinterpret_cast<const PoolVector<int> *>(b._data._mem); + int sz = arr_a->size(); + if (sz == 0 || arr_b->size() != sz) { + + r_dst = a; + } else { + + PoolVector<int> v; + v.resize(sz); + { + PoolVector<int>::Write vw = v.write(); + PoolVector<int>::Read ar = arr_a->read(); + PoolVector<int>::Read br = arr_b->read(); + + Variant va; + for (int i = 0; i < sz; i++) { + Variant::interpolate(ar[i], br[i], c, va); + vw[i] = va; + } + } + r_dst = v; + } } return; case POOL_REAL_ARRAY: { - r_dst = a; + const PoolVector<real_t> *arr_a = reinterpret_cast<const PoolVector<real_t> *>(a._data._mem); + const PoolVector<real_t> *arr_b = reinterpret_cast<const PoolVector<real_t> *>(b._data._mem); + int sz = arr_a->size(); + if (sz == 0 || arr_b->size() != sz) { + + r_dst = a; + } else { + + PoolVector<real_t> v; + v.resize(sz); + { + PoolVector<real_t>::Write vw = v.write(); + PoolVector<real_t>::Read ar = arr_a->read(); + PoolVector<real_t>::Read br = arr_b->read(); + + Variant va; + for (int i = 0; i < sz; i++) { + Variant::interpolate(ar[i], br[i], c, va); + vw[i] = va; + } + } + r_dst = v; + } } return; case POOL_STRING_ARRAY: { @@ -3717,7 +3761,27 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & } return; case POOL_COLOR_ARRAY: { - r_dst = a; + const PoolVector<Color> *arr_a = reinterpret_cast<const PoolVector<Color> *>(a._data._mem); + const PoolVector<Color> *arr_b = reinterpret_cast<const PoolVector<Color> *>(b._data._mem); + int sz = arr_a->size(); + if (sz == 0 || arr_b->size() != sz) { + + r_dst = a; + } else { + + PoolVector<Color> v; + v.resize(sz); + { + PoolVector<Color>::Write vw = v.write(); + PoolVector<Color>::Read ar = arr_a->read(); + PoolVector<Color>::Read br = arr_b->read(); + + for (int i = 0; i < sz; i++) { + vw[i] = ar[i].linear_interpolate(br[i], c); + } + } + r_dst = v; + } } return; default: { diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index bcb9b4f6da..fd66777997 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -53,13 +53,6 @@ Godot uses clockwise winding order for front faces of triangle primitive modes. </description> </method> - <method name="center_geometry"> - <return type="void"> - </return> - <description> - Centers the geometry. - </description> - </method> <method name="clear_blend_shapes"> <return type="void"> </return> diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index 77d5f14ab7..fdaa942018 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -12,11 +12,13 @@ </demos> <methods> <method name="save_to_wav"> - <return type="void"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> <description> + Saves the AudioStreamSample as a WAV file to [code]path[/code]. Samples with IMA ADPCM format can't be saved. + Note that a [code].wav[/code] extension is automatically appended to [code]path[/code] if it is missing. </description> </method> </methods> diff --git a/doc/classes/EditorSpatialGizmoPlugin.xml b/doc/classes/EditorSpatialGizmoPlugin.xml index a6c0413c19..d49a50893d 100644 --- a/doc/classes/EditorSpatialGizmoPlugin.xml +++ b/doc/classes/EditorSpatialGizmoPlugin.xml @@ -137,6 +137,12 @@ Override this method to provide the name that will appear in the gizmo visibility menu. </description> </method> + <method name="get_priority" qualifiers="virtual"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="has_gizmo" qualifiers="virtual"> <return type="bool"> </return> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 3e47b167ef..6cb5e0b17a 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -4,7 +4,7 @@ Internationalized font and text drawing support. </brief_description> <description> - Font contains a unicode compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. TODO check wikipedia for graph of ascent/baseline/descent/height/etc. + Font contains a unicode compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. </description> <tutorials> </tutorials> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 724e6a078d..29c60f902e 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -325,6 +325,15 @@ Set the mouse mode. See the constants for more information. </description> </method> + <method name="set_use_accumulated_input"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Whether to accumulate similar input events sent by the operating system. Defaults to [code]true[/code]. + </description> + </method> <method name="start_joy_vibration"> <return type="void"> </return> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index c880823aee..cd08cd4fe7 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -13,6 +13,14 @@ <demos> </demos> <methods> + <method name="accumulate"> + <return type="bool"> + </return> + <argument index="0" name="with_event" type="InputEvent"> + </argument> + <description> + </description> + </method> <method name="as_text" qualifiers="const"> <return type="String"> </return> diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index a4fade6ab2..4aec75d89f 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -65,7 +65,9 @@ </argument> <argument index="1" name="infinite_inertia" type="bool" default="true"> </argument> - <argument index="2" name="test_only" type="bool" default="false"> + <argument index="2" name="exclude_raycast_shapes" type="bool" default="true"> + </argument> + <argument index="3" name="test_only" type="bool" default="false"> </argument> <description> Moves the body along the vector [code]rel_vec[/code]. The body will stop if it collides. Returns a [KinematicCollision], which contains information about the collision. @@ -91,7 +93,7 @@ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [code]KinematicBody[/code] or [RigidBody], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity. [code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. - [i]TODO: Update for new stop_on_slode argument.[/i] If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes. + If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes. If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops. [code]floor_max_angle[/code] is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. Returns the movement that remained when the body stopped. To get more detailed information about collisions that occurred, use [method get_slide_collision]. diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index b94304b9a8..d5bfc91f66 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -91,7 +91,7 @@ Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [code]KinematicBody2D[/code] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes. [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity. [code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. - [i]TODO: Update for stop_on_slope argument.[/i] If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes. + If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes. If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops. [code]floor_max_angle[/code] is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. Returns the [code]linear_velocity[/code] vector, rotated and/or scaled if a slide collision occurred. To get more detailed information about collisions that occurred, use [method get_slide_collision]. @@ -138,7 +138,7 @@ If the body is at least this close to another body, this body will consider them to be colliding. </member> <member name="motion/sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled"> - If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. + If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method move_and_slide] or [method move_and_collide] functions. </member> </members> <constants> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 0d754f1d4e..3cb785e7b8 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -7,6 +7,7 @@ Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). Note that Light2D can be used as a mask. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml index 38b9054411..c7dfe9606b 100644 --- a/doc/classes/LightOccluder2D.xml +++ b/doc/classes/LightOccluder2D.xml @@ -7,6 +7,7 @@ Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an [OccluderPolygon2D] in order for the shadow to be computed. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/2d/2d_lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml index 7f0136bf77..c26665b6b5 100644 --- a/doc/classes/MeshInstance2D.xml +++ b/doc/classes/MeshInstance2D.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/2d/2d_meshes.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 0cc9764e36..9bee8e2100 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -10,6 +10,7 @@ Since instances may have any behavior, the AABB used for visibility must be provided by the user. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/MultiMeshInstance.xml b/doc/classes/MultiMeshInstance.xml index 5e021dfe9b..866ffffb5f 100644 --- a/doc/classes/MultiMeshInstance.xml +++ b/doc/classes/MultiMeshInstance.xml @@ -8,6 +8,8 @@ This is useful to optimize the rendering of a high amount of instances of a given mesh (for example tree in a forest or grass strands). </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html</link> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/using_multi_mesh_instance.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 5e71ed094e..edf8f507f0 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -684,6 +684,15 @@ Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX. </description> </method> + <method name="request_permission"> + <return type="bool"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + At the moment this function is only used by [code]AudioDriverOpenSL[/code] to request permission for [code]RECORD_AUDIO[/code] on Android. + </description> + </method> <method name="set_icon"> <return type="void"> </return> diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml index b6e31d3576..5d80f32bc2 100644 --- a/doc/classes/Particles.xml +++ b/doc/classes/Particles.xml @@ -8,6 +8,7 @@ Use the [code]process_material[/code] property to add a [ParticlesMaterial] to configure particle appearance and behavior. Alternatively, you can add a [ShaderMaterial] which will be applied to all particles. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/3d/vertex_animation/controlling_thousands_of_fish.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index aa7339445f..77a695d070 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -163,7 +163,11 @@ </method> </methods> <members> + <member name="android/modules" type="String" setter="" getter=""> + Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. [code]org/godotengine/org/GodotPaymentV3,org/godotengine/godot/MyCustomSingleton"[/code]. + </member> <member name="application/boot_splash/bg_color" type="Color" setter="" getter=""> + Background color for the boot splash. </member> <member name="application/boot_splash/fullsize" type="bool" setter="" getter=""> Scale the boot splash image to the full window length when engine starts (will leave it as default pixel size otherwise). @@ -691,10 +695,13 @@ </member> <member name="rendering/quality/directional_shadow/size.mobile" type="int" setter="" getter=""> </member> - <member name="rendering/quality/driver/driver_fallback" type="String" setter="" getter=""> - Whether to allow falling back to other graphics drivers if the preferred driver is not available. Best means use the best working driver (this is the default). Never means never fall back to another driver even if it does not work. This means the project will not run if the preferred driver does not function. - </member> <member name="rendering/quality/driver/driver_name" type="String" setter="" getter=""> + Name of the configured video driver ("GLES2" or "GLES3"). + Note that the backend in use can be overridden at runtime via the [code]--video-driver[/code] command line argument, or by the [member rendering/quality/driver/fallback_to_gles2] option if the target system does not support GLES3 and falls back to GLES2. In such cases, this property is not updated, so use [method OS.get_current_video_driver] to query it at runtime. + </member> + <member name="rendering/quality/driver/fallback_to_gles2" type="bool" setter="" getter=""> + Whether to allow falling back to the GLES2 driver if the GLES3 driver is not supported. Default value: [code]false[/code]. + Note that the two video drivers are not drop-in replacements for each other, so a game designed for GLES3 might not work properly when falling back to GLES2. In particular, some features of the GLES3 backend are not available in GLES2. Enabling this setting also means that both ETC and ETC2 VRAM-compressed textures will be exported on Android and iOS, increasing the size of the game data pack. </member> <member name="rendering/quality/filters/anisotropic_filter_level" type="int" setter="" getter=""> Maximum Anisotropic filter level used for textures when anisotropy enabled. diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml index 7491d22479..9b15c6e8b4 100644 --- a/doc/classes/ShaderMaterial.xml +++ b/doc/classes/ShaderMaterial.xml @@ -7,6 +7,7 @@ A material that uses a custom [Shader] program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader. </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/shading/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index 233df28255..f07329f31f 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -259,6 +259,10 @@ </description> </method> </methods> + <members> + <member name="bones_in_world_transform" type="bool" setter="set_use_bones_in_world_transform" getter="is_using_bones_in_world_transform"> + </member> + </members> <constants> <constant name="NOTIFICATION_UPDATE_SKELETON" value="50"> </constant> diff --git a/doc/classes/Skeleton2D.xml b/doc/classes/Skeleton2D.xml index d40b8a2fc7..258525c396 100644 --- a/doc/classes/Skeleton2D.xml +++ b/doc/classes/Skeleton2D.xml @@ -5,6 +5,7 @@ <description> </description> <tutorials> + <link>http://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/SpotLight.xml b/doc/classes/SpotLight.xml index 11f914aac2..56ba2fc5b9 100644 --- a/doc/classes/SpotLight.xml +++ b/doc/classes/SpotLight.xml @@ -4,7 +4,7 @@ Spotlight [Light], such as a reflector spotlight or a lantern. </brief_description> <description> - A SpotLight light is a type of [Light] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of a spotlight. + A SpotLight light is a type of [Light] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index c3af586b21..f5f50a75b1 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -13,7 +13,7 @@ Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) tween.start() [/codeblock] - Many methods require a property name, such as "position" above. You can find the correct property name by hovering over the property in the Inspector. + Many methods require a property name, such as "position" above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using "property:component" (eg. [code]position:x[/code]), where it would only apply to that particular component. Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [code]http://easings.net/[/code] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [code]EASE_IN_OUT[/code], and use the one that looks best. </description> <tutorials> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 8d98bcfdb0..f0980f6414 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -143,6 +143,12 @@ This is useful mostly to check if something changed from a saved version. </description> </method> + <method name="is_commiting_action" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="redo"> <return type="bool"> </return> diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 22c0b5d1fd..40dde48432 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -950,6 +950,12 @@ def make_method_signature(class_def, method_def, make_ref, state): # type: (Cla if arg.default_value is not None: out += '=' + arg.default_value + if isinstance(method_def, MethodDef) and method_def.qualifiers is not None and 'vararg' in method_def.qualifiers: + if len(method_def.parameters) > 0: + out += ', ...' + else: + out += ' ...' + out += ' **)**' if isinstance(method_def, MethodDef) and method_def.qualifiers is not None: diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h index 214da82819..ddf4d1d85c 100644 --- a/drivers/dummy/rasterizer_dummy.h +++ b/drivers/dummy/rasterizer_dummy.h @@ -461,6 +461,7 @@ public: RID skeleton_create() { return RID(); } void skeleton_allocate(RID p_skeleton, int p_bones, bool p_2d_skeleton = false) {} void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) {} + void skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_world_transform) {} int skeleton_get_bone_count(RID p_skeleton) const { return 0; } void skeleton_bone_set_transform(RID p_skeleton, int p_bone, const Transform &p_transform) {} Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone) const { return Transform(); } diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index bf0da5feb1..3671679b49 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -202,12 +202,12 @@ RasterizerStorageGLES2::Texture *RasterizerCanvasGLES2::_bind_canvas_texture(con } else { - texture = texture->get_ptr(); - if (texture->redraw_if_visible) { VisualServerRaster::redraw_request(); } + texture = texture->get_ptr(); + if (texture->render_target) { texture->render_target->used_in_frame = true; } @@ -244,12 +244,12 @@ RasterizerStorageGLES2::Texture *RasterizerCanvasGLES2::_bind_canvas_texture(con } else { - normal_map = normal_map->get_ptr(); - if (normal_map->redraw_if_visible) { //check before proxy, because this is usually used with proxies VisualServerRaster::redraw_request(); } + normal_map = normal_map->get_ptr(); + glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 2); glBindTexture(GL_TEXTURE_2D, normal_map->tex_id); state.current_normal = p_normal_map; @@ -1412,6 +1412,10 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons continue; } + if (t->redraw_if_visible) { + VisualServerRaster::redraw_request(); + } + t = t->get_ptr(); #ifdef TOOLS_ENABLED @@ -1422,10 +1426,6 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons if (t->render_target) t->render_target->used_in_frame = true; - if (t->redraw_if_visible) { - VisualServerRaster::redraw_request(); - } - glBindTexture(t->target, t->tex_id); } diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index e0eec74700..2ffc0d7463 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -635,7 +635,7 @@ bool RasterizerSceneGLES2::reflection_probe_instance_postprocess_step(RID p_inst for (int i = 0; i < 6; i++) { glBindFramebuffer(GL_FRAMEBUFFER, rpi->fbo[i]); glViewport(0, 0, size, size); - glCopyTexImage2D(_cube_side_enum[i], 0, GL_RGB, 0, 0, size, size, 0); + glCopyTexSubImage2D(_cube_side_enum[i], 0, 0, 0, 0, 0, size, size); } //do filtering //vdc cache @@ -672,7 +672,7 @@ bool RasterizerSceneGLES2::reflection_probe_instance_postprocess_step(RID p_inst storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES2::Z_FLIP, false); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - glCopyTexImage2D(_cube_side_enum[i], lod, GL_RGB, 0, 0, size, size, 0); + glCopyTexSubImage2D(_cube_side_enum[i], lod, 0, 0, 0, 0, size, size); } size >>= 1; @@ -1312,12 +1312,12 @@ bool RasterizerSceneGLES2::_setup_material(RasterizerStorageGLES2::Material *p_m continue; } - t = t->get_ptr(); - if (t->redraw_if_visible) { //must check before proxy because this is often used with proxies VisualServerRaster::redraw_request(); } + t = t->get_ptr(); + #ifdef TOOLS_ENABLED if (t->detect_3d) { t->detect_3d(t->detect_3d_ud); @@ -1671,11 +1671,10 @@ void RasterizerSceneGLES2::_render_geometry(RenderList::Element *p_element) { if (c.texture.is_valid() && storage->texture_owner.owns(c.texture)) { RasterizerStorageGLES2::Texture *t = storage->texture_owner.get(c.texture); - t = t->get_ptr(); - if (t->redraw_if_visible) { VisualServerRaster::redraw_request(); } + t = t->get_ptr(); #ifdef TOOLS_ENABLED if (t->detect_3d) { @@ -2487,6 +2486,12 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, state.scene_shader.set_uniform(SceneShaderGLES2::WORLD_TRANSFORM, e->instance->transform); + if (skeleton) { + state.scene_shader.set_uniform(SceneShaderGLES2::SKELETON_IN_WORLD_COORDS, skeleton->use_world_transform); + state.scene_shader.set_uniform(SceneShaderGLES2::SKELETON_TRANSFORM, skeleton->world_transform); + state.scene_shader.set_uniform(SceneShaderGLES2::SKELETON_TRANSFORM_INVERSE, skeleton->world_transform_inverse); + } + if (use_lightmap_capture) { //this is per instance, must be set always if present glUniform4fv(state.scene_shader.get_uniform_location(SceneShaderGLES2::LIGHTMAP_CAPTURES), 12, (const GLfloat *)e->instance->lightmap_capture_data.ptr()); state.scene_shader.set_uniform(SceneShaderGLES2::LIGHTMAP_CAPTURE_SKY, false); diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index d5965bba4f..206679dda3 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -120,9 +120,13 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ } break; case Image::FORMAT_RG8: { - - ERR_EXPLAIN("RG texture not supported"); - ERR_FAIL_V(image); + ERR_PRINT("RG texture not supported, converting to RGB8."); + if (image.is_valid()) + image->convert(Image::FORMAT_RGB8); + r_real_format = Image::FORMAT_RGB8; + r_gl_internal_format = GL_RGB; + r_gl_format = GL_RGB; + r_gl_type = GL_UNSIGNED_BYTE; } break; case Image::FORMAT_RGB8: { @@ -155,42 +159,57 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ } break; case Image::FORMAT_RF: { if (!config.float_texture_supported) { - ERR_EXPLAIN("R float texture not supported"); - ERR_FAIL_V(image); + ERR_PRINT("R float texture not supported, converting to RGB8."); + if (image.is_valid()) + image->convert(Image::FORMAT_RGB8); + r_real_format = Image::FORMAT_RGB8; + r_gl_internal_format = GL_RGB; + r_gl_format = GL_RGB; + r_gl_type = GL_UNSIGNED_BYTE; + } else { + r_gl_internal_format = GL_ALPHA; + r_gl_format = GL_ALPHA; + r_gl_type = GL_FLOAT; } - - r_gl_internal_format = GL_ALPHA; - r_gl_format = GL_ALPHA; - r_gl_type = GL_FLOAT; } break; case Image::FORMAT_RGF: { - ERR_EXPLAIN("RG float texture not supported"); - ERR_FAIL_V(image); - + ERR_PRINT("RG float texture not supported, converting to RGB8."); + if (image.is_valid()) + image->convert(Image::FORMAT_RGB8); + r_real_format = Image::FORMAT_RGB8; + r_gl_internal_format = GL_RGB; + r_gl_format = GL_RGB; + r_gl_type = GL_UNSIGNED_BYTE; } break; case Image::FORMAT_RGBF: { if (!config.float_texture_supported) { - - ERR_EXPLAIN("RGB float texture not supported"); - ERR_FAIL_V(image); + ERR_PRINT("RGB float texture not supported, converting to RGB8."); + if (image.is_valid()) + image->convert(Image::FORMAT_RGB8); + r_real_format = Image::FORMAT_RGB8; + r_gl_internal_format = GL_RGB; + r_gl_format = GL_RGB; + r_gl_type = GL_UNSIGNED_BYTE; + } else { + r_gl_internal_format = GL_RGB; + r_gl_format = GL_RGB; + r_gl_type = GL_FLOAT; } - - r_gl_internal_format = GL_RGB; - r_gl_format = GL_RGB; - r_gl_type = GL_FLOAT; - } break; case Image::FORMAT_RGBAF: { if (!config.float_texture_supported) { - - ERR_EXPLAIN("RGBA float texture not supported"); - ERR_FAIL_V(image); + ERR_PRINT("RGBA float texture not supported, converting to RGBA8."); + if (image.is_valid()) + image->convert(Image::FORMAT_RGBA8); + r_real_format = Image::FORMAT_RGBA8; + r_gl_internal_format = GL_RGBA; + r_gl_format = GL_RGBA; + r_gl_type = GL_UNSIGNED_BYTE; + } else { + r_gl_internal_format = GL_RGBA; + r_gl_format = GL_RGBA; + r_gl_type = GL_FLOAT; } - - r_gl_internal_format = GL_RGBA; - r_gl_format = GL_RGBA; - r_gl_type = GL_FLOAT; - } break; case Image::FORMAT_RH: { need_decompress = true; @@ -429,7 +448,6 @@ Ref<Image> RasterizerStorageGLES2::_get_gl_image_and_format(const Ref<Image> &p_ if (!image.is_null()) { image = image->duplicate(); - print_line("decompressing..."); image->decompress(); ERR_FAIL_COND_V(image->is_compressed(), image); switch (image->get_format()) { @@ -1138,7 +1156,7 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glGenTextures(1, &sky->radiance); glBindTexture(GL_TEXTURE_CUBE_MAP, sky->radiance); - int size = p_radiance_size / 4; //divide by four because its a cubemap (this is an approximation because GLES3 uses a dual paraboloid) + int size = p_radiance_size / 2; //divide by two because its a cubemap (this is an approximation because GLES3 uses a dual paraboloid) GLenum internal_format = GL_RGB; GLenum format = GL_RGB; @@ -1177,18 +1195,20 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra int mipmaps = 6; int lod = 0; int mm_level = mipmaps; - size = p_radiance_size; + size = p_radiance_size / 2; shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES2::USE_SOURCE_PANORAMA, true); shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES2::USE_DIRECT_WRITE, true); shaders.cubemap_filter.bind(); // third, render to the framebuffer using separate textures, then copy to mipmaps while (size >= 1) { + //make framebuffer size the texture size, need to use a separate texture for compatibility glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, resources.mipmap_blur_color); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, size, size, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, resources.mipmap_blur_color, 0); + if (lod == 1) { //bind panorama for smaller lods @@ -1214,7 +1234,7 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - glCopyTexImage2D(_cube_side_enum[i], lod, GL_RGB, 0, 0, size, size, 0); + glCopyTexSubImage2D(_cube_side_enum[i], lod, 0, 0, 0, 0, size, size); } size >>= 1; @@ -2380,7 +2400,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS: surface->total_data_size += surface->array_byte_size + surface->index_array_byte_size; for (int i = 0; i < surface->skeleton_bone_used.size(); i++) { - surface->skeleton_bone_used.write[i] = surface->skeleton_bone_aabb[i].size.x < 0 || surface->skeleton_bone_aabb[i].size.y < 0 || surface->skeleton_bone_aabb[i].size.z < 0; + surface->skeleton_bone_used.write[i] = !(surface->skeleton_bone_aabb[i].size.x < 0 || surface->skeleton_bone_aabb[i].size.y < 0 || surface->skeleton_bone_aabb[i].size.z < 0); } for (int i = 0; i < VS::ARRAY_MAX; i++) { @@ -2688,7 +2708,7 @@ AABB RasterizerStorageGLES2::mesh_get_aabb(RID p_mesh, RID p_skeleton) const { mtx.basis[0].x = texture[base_ofs + 0]; mtx.basis[0].y = texture[base_ofs + 1]; mtx.origin.x = texture[base_ofs + 3]; - base_ofs += 256 * 4; + base_ofs += 4; mtx.basis[1].x = texture[base_ofs + 0]; mtx.basis[1].y = texture[base_ofs + 1]; mtx.origin.y = texture[base_ofs + 3]; @@ -2716,12 +2736,12 @@ AABB RasterizerStorageGLES2::mesh_get_aabb(RID p_mesh, RID p_skeleton) const { mtx.basis[0].y = texture[base_ofs + 1]; mtx.basis[0].z = texture[base_ofs + 2]; mtx.origin.x = texture[base_ofs + 3]; - base_ofs += 256 * 4; + base_ofs += 4; mtx.basis[1].x = texture[base_ofs + 0]; mtx.basis[1].y = texture[base_ofs + 1]; mtx.basis[1].z = texture[base_ofs + 2]; mtx.origin.y = texture[base_ofs + 3]; - base_ofs += 256 * 4; + base_ofs += 4; mtx.basis[2].x = texture[base_ofs + 0]; mtx.basis[2].y = texture[base_ofs + 1]; mtx.basis[2].z = texture[base_ofs + 2]; @@ -3599,6 +3619,23 @@ void RasterizerStorageGLES2::skeleton_set_base_transform_2d(RID p_skeleton, cons skeleton->base_transform_2d = p_base_transform; } +void RasterizerStorageGLES2::skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_world_transform) { + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + + ERR_FAIL_COND(skeleton->use_2d); + + skeleton->world_transform = p_world_transform; + skeleton->use_world_transform = p_enable; + if (p_enable) { + skeleton->world_transform_inverse = skeleton->world_transform.affine_inverse(); + } + + if (!skeleton->update_list.in_list()) { + skeleton_update_list.add(&skeleton->update_list); + } +} + void RasterizerStorageGLES2::_update_skeleton_transform_buffer(const PoolVector<float> &p_data, size_t p_size) { glBindBuffer(GL_ARRAY_BUFFER, resources.skeleton_transform_buffer); @@ -4715,6 +4752,7 @@ void RasterizerStorageGLES2::render_target_set_flag(RID p_render_target, RenderT rt->flags[p_flag] = p_value; switch (p_flag) { + case RENDER_TARGET_TRANSPARENT: case RENDER_TARGET_HDR: case RENDER_TARGET_NO_3D: case RENDER_TARGET_NO_SAMPLING: @@ -5450,7 +5488,9 @@ void RasterizerStorageGLES2::initialize() { #ifdef GLES_OVER_GL //this needs to be enabled manually in OpenGL 2.1 - glEnable(_EXT_TEXTURE_CUBE_MAP_SEAMLESS); + if (config.extensions.has("GL_ARB_seamless_cube_map")) { + glEnable(_EXT_TEXTURE_CUBE_MAP_SEAMLESS); + } glEnable(GL_POINT_SPRITE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index e6c23716a5..361f304a17 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -94,6 +94,7 @@ public: GLuint depth_internalformat; GLuint depth_type; + } config; struct Resources { @@ -864,12 +865,16 @@ public: Set<RasterizerScene::InstanceBase *> instances; Transform2D base_transform_2d; + Transform world_transform; + Transform world_transform_inverse; + bool use_world_transform; Skeleton() : use_2d(false), size(0), tex_id(0), - update_list(this) { + update_list(this), + use_world_transform(false) { } }; @@ -887,6 +892,7 @@ public: virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform); virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const; virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform); + virtual void skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_world_transform); void _update_skeleton_transform_buffer(const PoolVector<float> &p_data, size_t p_size); diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index b13801946f..7ba2856216 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -162,6 +162,9 @@ VERTEX_SHADER_CODE #ifdef USE_PIXEL_SNAP outvec.xy = floor(outvec + 0.5).xy; + // precision issue on some hardware creates artifacts within texture + // offset uv by a small amount to avoid + uv += 1e-5; #endif #ifdef USE_SKELETON @@ -217,29 +220,25 @@ VERTEX_SHADER_CODE /* clang-format off */ [fragment] +// texture2DLodEXT and textureCubeLodEXT are fragment shader specific. +// Do not copy these defines in the vertex section. #ifndef USE_GLES_OVER_GL - #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod) #endif - -#endif +#endif // !USE_GLES_OVER_GL #ifdef GL_ARB_shader_texture_lod #extension GL_ARB_shader_texture_lod : enable #endif - #if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod) #define texture2DLod(img, coord, lod) texture2D(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCube(img, coord, lod) #endif - - - #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl index a6902836ed..db3d8b3a1b 100644 --- a/drivers/gles2/shaders/cubemap_filter.glsl +++ b/drivers/gles2/shaders/cubemap_filter.glsl @@ -25,15 +25,15 @@ void main() { /* clang-format off */ [fragment] +// texture2DLodEXT and textureCubeLodEXT are fragment shader specific. +// Do not copy these defines in the vertex section. #ifndef USE_GLES_OVER_GL - #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod) #endif - -#endif +#endif // !USE_GLES_OVER_GL #ifdef GL_ARB_shader_texture_lod #extension GL_ARB_shader_texture_lod : enable @@ -44,8 +44,6 @@ void main() { #define textureCubeLod(img, coord, lod) textureCube(img, coord, lod) #endif - - #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 371ea8498a..7e59b63935 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -59,6 +59,10 @@ uniform ivec2 skeleton_texture_size; #endif +uniform highp mat4 skeleton_transform; +uniform highp mat4 skeleton_transform_inverse; +uniform bool skeleton_in_world_coords; + #endif #ifdef USE_INSTANCING @@ -404,7 +408,13 @@ void main() { #endif - world_matrix = bone_transform * world_matrix; + if (skeleton_in_world_coords) { + bone_transform = skeleton_transform * (bone_transform * skeleton_transform_inverse); + world_matrix = bone_transform * world_matrix; + } else { + world_matrix = world_matrix * bone_transform; + } + #endif #ifdef USE_INSTANCING @@ -665,15 +675,15 @@ VERTEX_SHADER_CODE /* clang-format off */ [fragment] +// texture2DLodEXT and textureCubeLodEXT are fragment shader specific. +// Do not copy these defines in the vertex section. #ifndef USE_GLES_OVER_GL - #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod) #endif - -#endif +#endif // !USE_GLES_OVER_GL #ifdef GL_ARB_shader_texture_lod #extension GL_ARB_shader_texture_lod : enable @@ -684,9 +694,6 @@ VERTEX_SHADER_CODE #define textureCubeLod(img, coord, lod) textureCube(img, coord, lod) #endif - - - #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 227445ae5b..4817a524f4 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -222,12 +222,12 @@ RasterizerStorageGLES3::Texture *RasterizerCanvasGLES3::_bind_canvas_texture(con } else { - texture = texture->get_ptr(); - if (texture->redraw_if_visible) { //check before proxy, because this is usually used with proxies VisualServerRaster::redraw_request(); } + texture = texture->get_ptr(); + if (texture->render_target) texture->render_target->used_in_frame = true; @@ -263,12 +263,12 @@ RasterizerStorageGLES3::Texture *RasterizerCanvasGLES3::_bind_canvas_texture(con } else { - normal_map = normal_map->get_ptr(); - if (normal_map->redraw_if_visible) { //check before proxy, because this is usually used with proxies VisualServerRaster::redraw_request(); } + normal_map = normal_map->get_ptr(); + glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, normal_map->tex_id); state.current_normal = p_normal_map; @@ -834,6 +834,8 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur // materials are ignored in 2D meshes, could be added but many things (ie, lighting mode, reading from screen, etc) would break as they are not meant be set up at this point of drawing glBindVertexArray(s->array_id); + glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1); + if (s->index_array_len) { glDrawElements(gl_primitive[s->primitive], s->index_array_len, (s->array_len >= (1 << 16)) ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, 0); } else { @@ -1402,12 +1404,12 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons continue; } - t = t->get_ptr(); - if (t->redraw_if_visible) { //check before proxy, because this is usually used with proxies VisualServerRaster::redraw_request(); } + t = t->get_ptr(); + if (storage->config.srgb_decode_supported && t->using_srgb) { //no srgb in 2D glTexParameteri(t->target, _TEXTURE_SRGB_DECODE_EXT, _SKIP_DECODE_EXT); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index e645e39f3f..309f8b506c 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1199,12 +1199,12 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m if (t) { - t = t->get_ptr(); //resolve for proxies - if (t->redraw_if_visible) { //must check before proxy because this is often used with proxies VisualServerRaster::redraw_request(); } + t = t->get_ptr(); //resolve for proxies + #ifdef TOOLS_ENABLED if (t->detect_3d) { t->detect_3d(t->detect_3d_ud); @@ -1629,11 +1629,10 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) { RasterizerStorageGLES3::Texture *t = storage->texture_owner.get(c.texture); - t = t->get_ptr(); //resolve for proxies - if (t->redraw_if_visible) { VisualServerRaster::redraw_request(); } + t = t->get_ptr(); //resolve for proxies #ifdef TOOLS_ENABLED if (t->detect_3d) { @@ -2044,7 +2043,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ int current_blend_mode = -1; int prev_shading = -1; - RID prev_skeleton; + RasterizerStorageGLES3::Skeleton *prev_skeleton = NULL; state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS, true); //by default unshaded (easier to set) @@ -2058,7 +2057,10 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ RenderList::Element *e = p_elements[i]; RasterizerStorageGLES3::Material *material = e->material; - RID skeleton = e->instance->skeleton; + RasterizerStorageGLES3::Skeleton *skeleton = NULL; + if (e->instance->skeleton.is_valid()) { + skeleton = storage->skeleton_owner.getornull(e->instance->skeleton); + } bool rebind = first; @@ -2205,15 +2207,14 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ } if (prev_skeleton != skeleton) { - if (prev_skeleton.is_valid() != skeleton.is_valid()) { - state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON, skeleton.is_valid()); + if ((prev_skeleton == NULL) != (skeleton == NULL)) { + state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON, skeleton != NULL); rebind = true; } - if (skeleton.is_valid()) { - RasterizerStorageGLES3::Skeleton *sk = storage->skeleton_owner.getornull(skeleton); + if (skeleton) { glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 1); - glBindTexture(GL_TEXTURE_2D, sk->texture); + glBindTexture(GL_TEXTURE_2D, skeleton->texture); } } @@ -2240,6 +2241,11 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ _set_cull(e->sort_key & RenderList::SORT_KEY_MIRROR_FLAG, e->sort_key & RenderList::SORT_KEY_CULL_DISABLED_FLAG, p_reverse_cull); + if (skeleton) { + state.scene_shader.set_uniform(SceneShaderGLES3::SKELETON_TRANSFORM, skeleton->world_transform); + state.scene_shader.set_uniform(SceneShaderGLES3::SKELETON_IN_WORLD_COORDS, skeleton->use_world_transform); + } + state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, e->instance->transform); _render_geometry(e); @@ -2343,10 +2349,6 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G state.used_screen_texture = true; } - if (p_material->shader->spatial.uses_depth_texture) { - state.used_depth_texture = true; - } - if (p_depth_pass) { if (has_blend_alpha || p_material->shader->spatial.uses_depth_texture || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) || p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER || p_material->shader->spatial.no_depth_test) @@ -3163,7 +3165,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p current_material_index = 0; state.used_sss = false; state.used_screen_texture = false; - state.used_depth_texture = false; + //fill list for (int i = 0; i < p_cull_count; i++) { @@ -3628,7 +3630,6 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p if (storage->frame.current_rt->buffers.active) { //transfer to effect buffer if using buffers, also resolve MSAA - glReadBuffer(GL_COLOR_ATTACHMENT0); glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST); @@ -4185,7 +4186,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const glColorMask(1, 1, 1, 1); - if (state.used_contact_shadows || state.used_depth_texture) { + if (state.used_contact_shadows) { glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); glReadBuffer(GL_COLOR_ATTACHMENT0); @@ -4250,7 +4251,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const } else { - use_mrt = env && (state.used_sss || env->ssao_enabled || env->ssr_enabled); //only enable MRT rendering if any of these is enabled + use_mrt = env && (state.used_sss || env->ssao_enabled || env->ssr_enabled || env->dof_blur_far_enabled || env->dof_blur_near_enabled); //only enable MRT rendering if any of these is enabled //effects disabled and transparency also prevent using MRTs use_mrt = use_mrt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]; use_mrt = use_mrt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_NO_3D_EFFECTS]; diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 3ac5ade721..56e378d7fa 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -204,7 +204,7 @@ public: bool cull_disabled; bool used_sss; bool used_screen_texture; - bool used_depth_texture; + bool used_depth_prepass; bool used_depth_prepass_and_resolved; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index fdfa4a72e4..1fa4eacd95 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -702,14 +702,18 @@ void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_ int mipmaps = 0; - while (width != 1 && height != 1) { - glTexImage3D(texture->target, 0, internal_format, width, height, depth, 0, format, type, NULL); + while (width > 0 || height > 0 || (p_type == VS::TEXTURE_TYPE_3D && depth > 0)) { + width = MAX(1, width); + height = MAX(1, height); + depth = MAX(1, depth); - width = MAX(1, width / 2); - height = MAX(1, height / 2); + glTexImage3D(texture->target, mipmaps, internal_format, width, height, depth, 0, format, type, NULL); + + width /= 2; + height /= 2; if (p_type == VS::TEXTURE_TYPE_3D) { - depth = MAX(1, depth / 2); + depth /= 2; } mipmaps++; @@ -748,7 +752,11 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p if (config.keep_original_textures && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) { texture->images.write[p_layer] = p_image; } - +#ifndef GLES_OVER_GL + if (p_image->is_compressed() && p_image->has_mipmaps() && !p_image->is_size_po2()) { + ERR_PRINTS("Texuture '" + texture->path + "' is compressed, has mipmaps but is not of powerf-of-2 size. This does not work on OpenGL ES 3.0."); + } +#endif Image::Format real_format; Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), texture->flags, real_format, format, internal_format, type, compressed, srgb); @@ -926,6 +934,9 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p h = MAX(1, h >> 1); } + // Handle array and 3D textures, as those set their data per layer. + tsize *= MAX(texture->alloc_depth, 1); + info.texture_mem -= texture->total_data_size; texture->total_data_size = tsize; info.texture_mem += texture->total_data_size; @@ -1496,7 +1507,7 @@ void RasterizerStorageGLES3::texture_debug_usage(List<VS::TextureInfo> *r_info) tinfo.format = t->format; tinfo.width = t->alloc_width; tinfo.height = t->alloc_height; - tinfo.depth = 0; + tinfo.depth = t->alloc_depth; tinfo.bytes = t->total_data_size; r_info->push_back(tinfo); } @@ -5135,6 +5146,20 @@ void RasterizerStorageGLES3::skeleton_set_base_transform_2d(RID p_skeleton, cons skeleton->base_transform_2d = p_base_transform; } +void RasterizerStorageGLES3::skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_world_transform) { + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + + ERR_FAIL_COND(skeleton->use_2d); + + skeleton->world_transform = p_world_transform; + skeleton->use_world_transform = p_enable; + + if (!skeleton->update_list.in_list()) { + skeleton_update_list.add(&skeleton->update_list); + } +} + void RasterizerStorageGLES3::update_dirty_skeletons() { glActiveTexture(GL_TEXTURE0); @@ -5439,6 +5464,8 @@ RID RasterizerStorageGLES3::reflection_probe_create() { reflection_probe->intensity = 1.0; reflection_probe->interior_ambient = Color(); reflection_probe->interior_ambient_energy = 1.0; + reflection_probe->interior_ambient_probe_contrib = 0.0; + reflection_probe->max_distance = 0; reflection_probe->extents = Vector3(1, 1, 1); reflection_probe->origin_offset = Vector3(0, 0, 0); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index d1e02e25d6..2994bfb074 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -890,12 +890,15 @@ public: SelfList<Skeleton> update_list; Set<RasterizerScene::InstanceBase *> instances; //instances using skeleton Transform2D base_transform_2d; + bool use_world_transform; + Transform world_transform; Skeleton() : use_2d(false), size(0), texture(0), - update_list(this) { + update_list(this), + use_world_transform(false) { } }; @@ -913,6 +916,7 @@ public: virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform); virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const; virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform); + virtual void skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_world_transform); /* Light API */ diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index 6c1806a657..0d1e7ee4a1 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -173,6 +173,9 @@ VERTEX_SHADER_CODE #ifdef USE_PIXEL_SNAP outvec.xy = floor(outvec + 0.5).xy; + // precision issue on some hardware creates artifacts within texture + // offset uv by a small amount to avoid + uv_interp += 1e-5; #endif #ifdef USE_SKELETON diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 3b06b08dec..630e1c2089 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -302,6 +302,8 @@ out highp float dp_clip; #ifdef USE_SKELETON uniform highp sampler2D skeleton_texture; // texunit:-1 +uniform highp mat4 skeleton_transform; +uniform bool skeleton_in_world_coords; #endif out highp vec4 position_interp; @@ -430,7 +432,14 @@ void main() { vec4(0.0, 0.0, 0.0, 1.0)) * bone_weights.w; - world_matrix = transpose(m) * world_matrix; + if (skeleton_in_world_coords) { + highp mat4 bone_matrix = skeleton_transform * (transpose(m) * inverse(skeleton_transform)); + world_matrix = bone_matrix * world_matrix; + + } else { + + world_matrix = world_matrix * transpose(m); + } } #endif diff --git a/drivers/png/SCsub b/drivers/png/SCsub index 22fb1817d1..97ba1de3db 100644 --- a/drivers/png/SCsub +++ b/drivers/png/SCsub @@ -50,6 +50,7 @@ if env['builtin_libpng']: neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c")) neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon_intrinsics.c")) neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S")) + neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.c")) env.drivers_sources += neon_sources # Godot source files diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index 6d8185cdd8..0bf432c78a 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -63,7 +63,11 @@ static void _png_error_function(png_structp, png_const_charp text) { } static void _png_warn_function(png_structp, png_const_charp text) { - +#ifdef TOOLS_ENABLED + if (Engine::get_singleton()->is_editor_hint()) { + if (String(text).begins_with("iCCP")) return; // silences annoying spam emitted to output every time the user opened assetlib + } +#endif WARN_PRINT(text); } diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 499bb4f34b..2f705ec87d 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -348,11 +348,10 @@ size_t DirAccessWindows::get_space_left() { String DirAccessWindows::get_filesystem_type() const { String path = fix_path(const_cast<DirAccessWindows *>(this)->get_current_dir()); - print_line("fixed path: " + path); + int unit_end = path.find(":"); ERR_FAIL_COND_V(unit_end == -1, String()); String unit = path.substr(0, unit_end + 1) + "\\"; - print_line("unit: " + unit); WCHAR szVolumeName[100]; WCHAR szFileSystemName[10]; diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 6b45ca2cae..8807a01f64 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -692,12 +692,10 @@ void AnimationTimelineEdit::_anim_length_changed(double p_new_len) { p_new_len = MAX(0.001, p_new_len); editing = true; - *block_animation_update_ptr = true; undo_redo->create_action(TTR("Change Animation Length")); undo_redo->add_do_method(animation.ptr(), "set_length", p_new_len); undo_redo->add_undo_method(animation.ptr(), "set_length", animation->get_length()); undo_redo->commit_action(); - *block_animation_update_ptr = false; editing = false; update(); @@ -706,12 +704,10 @@ void AnimationTimelineEdit::_anim_length_changed(double p_new_len) { void AnimationTimelineEdit::_anim_loop_pressed() { - *block_animation_update_ptr = true; undo_redo->create_action(TTR("Change Animation Loop")); undo_redo->add_do_method(animation.ptr(), "set_loop", loop->is_pressed()); undo_redo->add_undo_method(animation.ptr(), "set_loop", animation->has_loop()); undo_redo->commit_action(); - *block_animation_update_ptr = false; } int AnimationTimelineEdit::get_buttons_width() const { @@ -936,10 +932,6 @@ Size2 AnimationTimelineEdit::get_minimum_size() const { return ms; } -void AnimationTimelineEdit::set_block_animation_update_ptr(bool *p_block_ptr) { - block_animation_update_ptr = p_block_ptr; -} - void AnimationTimelineEdit::set_undo_redo(UndoRedo *p_undo_redo) { undo_redo = p_undo_redo; } @@ -1080,7 +1072,6 @@ void AnimationTimelineEdit::_bind_methods() { AnimationTimelineEdit::AnimationTimelineEdit() { - block_animation_update_ptr = NULL; editing = false; name_limit = 150; zoom = NULL; @@ -1630,10 +1621,15 @@ void AnimationTrackEdit::set_animation_and_track(const Ref<Animation> &p_animati ERR_FAIL_INDEX(track, animation->get_track_count()); + node_path = animation->track_get_path(p_track); type_icon = type_icons[animation->track_get_type(track)]; selected_icon = get_icon("KeySelected", "EditorIcons"); } +NodePath AnimationTrackEdit::get_path() const { + return node_path; +} + Size2 AnimationTrackEdit::get_minimum_size() const { Ref<Texture> texture = get_icon("Object", "EditorIcons"); @@ -1884,12 +1880,10 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { Point2 pos = mb->get_position(); if (check_rect.has_point(pos)) { - *block_animation_update_ptr = true; undo_redo->create_action(TTR("Toggle Track Enabled")); undo_redo->add_do_method(animation.ptr(), "track_set_enabled", track, !animation->track_is_enabled(track)); undo_redo->add_undo_method(animation.ptr(), "track_set_enabled", track, animation->track_is_enabled(track)); undo_redo->commit_action(); - *block_animation_update_ptr = false; update(); accept_event(); } @@ -1956,6 +1950,7 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { if (remove_rect.has_point(pos)) { emit_signal("remove_request", track); accept_event(); + return; } if (bezier_edit_rect.has_point(pos)) { @@ -2186,12 +2181,10 @@ void AnimationTrackEdit::_menu_selected(int p_index) { case MENU_CALL_MODE_CAPTURE: { Animation::UpdateMode update_mode = Animation::UpdateMode(p_index); - *block_animation_update_ptr = true; undo_redo->create_action(TTR("Change Animation Update Mode")); undo_redo->add_do_method(animation.ptr(), "value_track_set_update_mode", track, update_mode); undo_redo->add_undo_method(animation.ptr(), "value_track_set_update_mode", track, animation->value_track_get_update_mode(track)); undo_redo->commit_action(); - *block_animation_update_ptr = false; update(); } break; @@ -2200,24 +2193,20 @@ void AnimationTrackEdit::_menu_selected(int p_index) { case MENU_INTERPOLATION_CUBIC: { Animation::InterpolationType interp_mode = Animation::InterpolationType(p_index - MENU_INTERPOLATION_NEAREST); - *block_animation_update_ptr = true; undo_redo->create_action(TTR("Change Animation Interpolation Mode")); undo_redo->add_do_method(animation.ptr(), "track_set_interpolation_type", track, interp_mode); undo_redo->add_undo_method(animation.ptr(), "track_set_interpolation_type", track, animation->track_get_interpolation_type(track)); undo_redo->commit_action(); - *block_animation_update_ptr = false; update(); } break; case MENU_LOOP_WRAP: case MENU_LOOP_CLAMP: { bool loop_wrap = p_index == MENU_LOOP_WRAP; - *block_animation_update_ptr = true; undo_redo->create_action(TTR("Change Animation Loop Mode")); undo_redo->add_do_method(animation.ptr(), "track_set_interpolation_loop_wrap", track, loop_wrap); undo_redo->add_undo_method(animation.ptr(), "track_set_interpolation_loop_wrap", track, animation->track_get_interpolation_loop_wrap(track)); undo_redo->commit_action(); - *block_animation_update_ptr = false; update(); } break; @@ -2235,10 +2224,6 @@ void AnimationTrackEdit::_menu_selected(int p_index) { } } -void AnimationTrackEdit::set_block_animation_update_ptr(bool *p_block_ptr) { - block_animation_update_ptr = p_block_ptr; -} - void AnimationTrackEdit::cancel_drop() { if (dropping_at != 0) { dropping_at = 0; @@ -2301,7 +2286,6 @@ AnimationTrackEdit::AnimationTrackEdit() { root = NULL; path = NULL; menu = NULL; - block_animation_update_ptr = NULL; clicking_on_name = false; dropping_at = 0; @@ -2555,7 +2539,10 @@ void AnimationTrackEditor::_track_remove_request(int p_track) { int idx = p_track; if (idx >= 0 && idx < animation->get_track_count()) { - _clear_selection(); + selection.clear(); + _clear_key_edit(); + //all will be updated after remove anyway, and triggering update here raises error on tracks already removed + undo_redo->create_action(TTR("Remove Anim Track")); undo_redo->add_do_method(animation.ptr(), "remove_track", idx); undo_redo->add_undo_method(animation.ptr(), "add_track", animation->track_get_type(idx), idx); @@ -3384,7 +3371,6 @@ void AnimationTrackEditor::_update_tracks() { track_edit->set_undo_redo(undo_redo); track_edit->set_timeline(timeline); - track_edit->set_block_animation_update_ptr(&block_animation_update); track_edit->set_root(root); track_edit->set_animation_and_track(animation, i); track_edit->set_play_position(timeline->get_play_position()); @@ -3415,6 +3401,10 @@ void AnimationTrackEditor::_update_tracks() { void AnimationTrackEditor::_animation_changed() { + if (animation_changing_awaiting_update) { + return; //all will be updated, dont bother with anything + } + if (key_edit && key_edit->setting) { //if editing a key, just update the edited track, makes refresh less costly if (key_edit->track < track_edits.size()) { @@ -3423,9 +3413,35 @@ void AnimationTrackEditor::_animation_changed() { return; } + animation_changing_awaiting_update = true; + call_deferred("_animation_update"); +} + +void AnimationTrackEditor::_animation_update() { + timeline->update(); timeline->update_values(); - if (block_animation_update) { + + bool same = true; + + if (animation.is_null()) { + return; + } + + if (track_edits.size() == animation->get_track_count()) { + //check tracks are the same + + for (int i = 0; i < track_edits.size(); i++) { + if (track_edits[i]->get_path() != animation->track_get_path(i)) { + same = false; + break; + } + } + } else { + same = false; + } + + if (same) { for (int i = 0; i < track_edits.size(); i++) { track_edits[i]->update(); } @@ -3441,6 +3457,8 @@ void AnimationTrackEditor::_animation_changed() { step->set_block_signals(true); step->set_value(animation->get_step()); step->set_block_signals(false); + + animation_changing_awaiting_update = false; } MenuButton *AnimationTrackEditor::get_edit_menu() { @@ -4075,9 +4093,7 @@ void AnimationTrackEditor::_move_selection_commit() { undo_redo->add_undo_method(this, "_select_at_anim", animation, E->key().track, oldpos); } - block_animation_update = true; //animation will change and this is triggered from a signal, so block updates undo_redo->commit_action(); - block_animation_update = false; moving_selection = false; for (int i = 0; i < track_edits.size(); i++) { @@ -4737,10 +4753,12 @@ float AnimationTrackEditor::snap_time(float p_value) { void AnimationTrackEditor::_bind_methods() { ClassDB::bind_method("_animation_changed", &AnimationTrackEditor::_animation_changed); + ClassDB::bind_method("_animation_update", &AnimationTrackEditor::_animation_update); ClassDB::bind_method("_timeline_changed", &AnimationTrackEditor::_timeline_changed); ClassDB::bind_method("_track_remove_request", &AnimationTrackEditor::_track_remove_request); ClassDB::bind_method("_name_limit_changed", &AnimationTrackEditor::_name_limit_changed); ClassDB::bind_method("_update_scroll", &AnimationTrackEditor::_update_scroll); + ClassDB::bind_method("_update_tracks", &AnimationTrackEditor::_update_tracks); ClassDB::bind_method("_update_step", &AnimationTrackEditor::_update_step); ClassDB::bind_method("_update_length", &AnimationTrackEditor::_update_length); ClassDB::bind_method("_dropped_track", &AnimationTrackEditor::_dropped_track); @@ -4778,7 +4796,6 @@ void AnimationTrackEditor::_bind_methods() { AnimationTrackEditor::AnimationTrackEditor() { root = NULL; - block_animation_update = false; undo_redo = EditorNode::get_singleton()->get_undo_redo(); @@ -4796,7 +4813,6 @@ AnimationTrackEditor::AnimationTrackEditor() { timeline_vbox->add_constant_override("separation", 0); timeline = memnew(AnimationTimelineEdit); - timeline->set_block_animation_update_ptr(&block_animation_update); timeline->set_undo_redo(undo_redo); timeline_vbox->add_child(timeline); timeline->connect("timeline_changed", this, "_timeline_changed"); @@ -4815,7 +4831,6 @@ AnimationTrackEditor::AnimationTrackEditor() { bezier_edit = memnew(AnimationBezierTrackEdit); timeline_vbox->add_child(bezier_edit); - bezier_edit->set_block_animation_update_ptr(&block_animation_update); bezier_edit->set_undo_redo(undo_redo); bezier_edit->set_editor(this); bezier_edit->set_timeline(timeline); @@ -5045,6 +5060,7 @@ AnimationTrackEditor::AnimationTrackEditor() { track_copy_select->set_hide_root(true); track_copy_dialog->add_child(track_copy_select); track_copy_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM)); + animation_changing_awaiting_update = false; } AnimationTrackEditor::~AnimationTrackEditor() { diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 47058839ba..29ce4f189e 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -76,7 +76,6 @@ class AnimationTimelineEdit : public Range { Rect2 hsize_rect; bool editing; - bool *block_animation_update_ptr; //used to block all tracks re-gen (speed up) bool panning_timeline; float panning_timeline_from; @@ -104,7 +103,6 @@ public: void set_zoom(Range *p_zoom); Range *get_zoom() const { return zoom; } void set_undo_redo(UndoRedo *p_undo_redo); - void set_block_animation_update_ptr(bool *p_block_ptr); void set_play_position(float p_pos); float get_play_position() const; @@ -143,6 +141,7 @@ class AnimationTrackEdit : public Control { Node *root; Control *play_position; //separate control used to draw so updates for only position changed are much faster float play_position_pos; + NodePath node_path; Ref<Animation> animation; int track; @@ -170,8 +169,6 @@ class AnimationTrackEdit : public Control { void _menu_selected(int p_index); - bool *block_animation_update_ptr; //used to block all tracks re-gen (speed up) - void _path_entered(const String &p_text); void _play_position_draw(); mutable int dropping_at; @@ -216,8 +213,7 @@ public: AnimationTimelineEdit *get_timeline() const { return timeline; } AnimationTrackEditor *get_editor() const { return editor; } UndoRedo *get_undo_redo() const { return undo_redo; } - bool *get_block_animation_update_ptr() { return block_animation_update_ptr; } - + NodePath get_path() const; void set_animation_and_track(const Ref<Animation> &p_animation, int p_track); virtual Size2 get_minimum_size() const; @@ -226,8 +222,6 @@ public: void set_editor(AnimationTrackEditor *p_editor); void set_root(Node *p_root); - void set_block_animation_update_ptr(bool *p_block_ptr); - void set_play_position(float p_pos); void update_play_position(); void cancel_drop(); @@ -313,8 +307,8 @@ class AnimationTrackEditor : public VBoxContainer { Vector<AnimationTrackEdit *> track_edits; Vector<AnimationTrackEditGroup *> groups; - bool block_animation_update; - + bool animation_changing_awaiting_update; + void _animation_update(); int _get_track_selected(); void _animation_changed(); void _update_tracks(); diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 399d561e28..baf417fed7 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -1004,12 +1004,10 @@ void AnimationTrackEditTypeAudio::drop_data(const Point2 &p_point, const Variant ofs += 0.001; } - *get_block_animation_update_ptr() = true; get_undo_redo()->create_action(TTR("Add Audio Track Clip")); get_undo_redo()->add_do_method(get_animation().ptr(), "audio_track_insert_key", get_track(), ofs, stream); get_undo_redo()->add_undo_method(get_animation().ptr(), "track_remove_key_at_position", get_track(), ofs); get_undo_redo()->commit_action(); - *get_block_animation_update_ptr() = false; update(); return; @@ -1098,21 +1096,17 @@ void AnimationTrackEditTypeAudio::_gui_input(const Ref<InputEvent> &p_event) { float ofs_local = -len_resizing_rel / get_timeline()->get_zoom_scale(); if (len_resizing_start) { float prev_ofs = get_animation()->audio_track_get_key_start_offset(get_track(), len_resizing_index); - *get_block_animation_update_ptr() = true; get_undo_redo()->create_action(TTR("Change Audio Track Clip Start Offset")); get_undo_redo()->add_do_method(get_animation().ptr(), "audio_track_set_key_start_offset", get_track(), len_resizing_index, prev_ofs + ofs_local); get_undo_redo()->add_undo_method(get_animation().ptr(), "audio_track_set_key_start_offset", get_track(), len_resizing_index, prev_ofs); get_undo_redo()->commit_action(); - *get_block_animation_update_ptr() = false; } else { float prev_ofs = get_animation()->audio_track_get_key_end_offset(get_track(), len_resizing_index); - *get_block_animation_update_ptr() = true; get_undo_redo()->create_action(TTR("Change Audio Track Clip End Offset")); get_undo_redo()->add_do_method(get_animation().ptr(), "audio_track_set_key_end_offset", get_track(), len_resizing_index, prev_ofs + ofs_local); get_undo_redo()->add_undo_method(get_animation().ptr(), "audio_track_set_key_end_offset", get_track(), len_resizing_index, prev_ofs); get_undo_redo()->commit_action(); - *get_block_animation_update_ptr() = false; } len_resizing = false; diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index fbc23aa8e2..364c5126d7 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -113,18 +113,6 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) { _update_search(); - bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); - - if (enable_rl) { - search_options->add_constant_override("draw_relationship_lines", 1); - search_options->add_color_override("relationship_line_color", rl_color); - search_options->add_constant_override("draw_guides", 0); - } else { - search_options->add_constant_override("draw_relationship_lines", 0); - search_options->add_constant_override("draw_guides", 1); - } - is_replace_mode = p_replace_mode; if (p_replace_mode) { @@ -216,7 +204,7 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p if (cpp_type) { String cpp_to_select_type = to_select_type; if (ScriptServer::is_global_class(to_select_type)) - cpp_to_select_type = ScriptServer::get_global_class_base(to_select_type); + cpp_to_select_type = ScriptServer::get_global_class_native_base(to_select_type); current_item_is_preferred = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(cpp_to_select_type, preferred_search_result_type); } else { current_item_is_preferred = ed.script_class_is_parent(p_type, preferred_search_result_type) && !ed.script_class_is_parent(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type; diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index b87b80dafd..f61a831015 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -895,7 +895,7 @@ StringName EditorData::script_class_get_base(const String &p_class) const { Object *EditorData::script_class_instance(const String &p_class) { if (ScriptServer::is_global_class(p_class)) { - Object *obj = ClassDB::instance(ScriptServer::get_global_class_base(p_class)); + Object *obj = ClassDB::instance(ScriptServer::get_global_class_native_base(p_class)); if (obj) { RES script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class)); if (script.is_valid()) diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 2b9007de04..dc43faeff1 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1163,10 +1163,23 @@ void EditorExport::add_export_preset(const Ref<EditorExportPreset> &p_preset, in String EditorExportPlatform::test_etc2() const { String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name"); - bool etc2_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc"); - - if (driver == "GLES2" && !etc2_supported) { - return TTR("Target platform requires 'ETC' texture compression for GLES2. Enable support in Project Settings."); + bool driver_fallback = ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2"); + bool etc_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc"); + bool etc2_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2"); + + if (driver == "GLES2" && !etc_supported) { + return TTR("Target platform requires 'ETC' texture compression for GLES2. Enable 'Import Etc' in Project Settings."); + } else if (driver == "GLES3") { + String err; + if (!etc2_supported) { + err += TTR("Target platform requires 'ETC2' texture compression for GLES3. Enable 'Import Etc 2' in Project Settings."); + } + if (driver_fallback && !etc_supported) { + if (err != String()) + err += "\n"; + err += TTR("Target platform requires 'ETC' texture compression for the driver fallback to GLES2.\nEnable 'Import Etc' in Project Settings, or disable 'Driver Fallback Enabled'."); + } + return err; } return String(); } @@ -1453,6 +1466,10 @@ List<String> EditorExportPlatformPC::get_binary_extensions(const Ref<EditorExpor Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) { ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + if (!DirAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + String custom_debug = p_preset->get("custom_template/debug"); String custom_release = p_preset->get("custom_template/release"); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 765a330aaf..4c9f58f312 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -75,7 +75,7 @@ void EditorFileDialog::_notification(int p_what) { preview_wheel_index++; if (preview_wheel_index >= 8) preview_wheel_index = 0; - Ref<Texture> frame = get_icon("WaitPreview" + itos(preview_wheel_index + 1), "EditorIcons"); + Ref<Texture> frame = get_icon("Progress" + itos(preview_wheel_index + 1), "EditorIcons"); preview->set_texture(frame); preview_wheel_timeout = 0.1; } @@ -323,11 +323,10 @@ void EditorFileDialog::_request_single_thumbnail(const String &p_path) { if (!FileAccess::exists(p_path)) return; - EditorResourcePreview::get_singleton()->queue_resource_preview(p_path, this, "_thumbnail_done", p_path); - set_process(true); preview_waiting = true; preview_wheel_timeout = 0; + EditorResourcePreview::get_singleton()->queue_resource_preview(p_path, this, "_thumbnail_done", p_path); } void EditorFileDialog::_action_pressed() { @@ -853,7 +852,7 @@ void EditorFileDialog::update_file_list() { fav_down->set_disabled(true); get_ok()->set_disabled(_is_open_should_be_disabled()); for (int i = 0; i < favorites->get_item_count(); i++) { - if (favorites->get_item_metadata(i) == cdir) { + if (favorites->get_item_metadata(i) == cdir || favorites->get_item_metadata(i) == cdir + "/") { favorites->select(i); favorite->set_pressed(true); if (i > 0) { @@ -1206,8 +1205,10 @@ void EditorFileDialog::_update_favorites() { if (name == current) setthis = true; name = "/"; + + favorites->add_item(name, folder_icon); } else if (name.ends_with("/")) { - if (name == current) + if (name == current || name == current + "/") setthis = true; name = name.substr(0, name.length() - 1); name = name.get_file(); @@ -1230,6 +1231,8 @@ void EditorFileDialog::_favorite_toggled(bool p_toggle) { bool res = access == ACCESS_RESOURCES; String cd = get_current_dir(); + if (!cd.ends_with("/")) + cd += "/"; Vector<String> favorited = EditorSettings::get_singleton()->get_favorites(); @@ -1245,13 +1248,10 @@ void EditorFileDialog::_favorite_toggled(bool p_toggle) { } } - if (found) { + if (found) favorited.erase(cd); - favorite->set_pressed(false); - } else { + else favorited.push_back(cd); - favorite->set_pressed(true); - } EditorSettings::get_singleton()->set_favorites(favorited); @@ -1495,7 +1495,9 @@ EditorFileDialog::EditorFileDialog() { HBoxContainer *pathhb = memnew(HBoxContainer); dir_prev = memnew(ToolButton); + dir_prev->set_tooltip(TTR("Previous Folder")); dir_next = memnew(ToolButton); + dir_next->set_tooltip(TTR("Next Folder")); dir_up = memnew(ToolButton); dir_up->set_tooltip(TTR("Go to parent folder")); @@ -1514,12 +1516,14 @@ EditorFileDialog::EditorFileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); + refresh->set_tooltip(TTR("Refresh")); refresh->connect("pressed", this, "_update_file_list"); pathhb->add_child(refresh); favorite = memnew(ToolButton); favorite->set_flat(true); favorite->set_toggle_mode(true); + favorite->set_tooltip(TTR("(Un)favorite current folder.")); favorite->connect("toggled", this, "_favorite_toggled"); pathhb->add_child(favorite); @@ -1533,6 +1537,7 @@ EditorFileDialog::EditorFileDialog() { mode_thumbnails->set_toggle_mode(true); mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS); mode_thumbnails->set_button_group(view_mode_group); + mode_thumbnails->set_tooltip(TTR("View items as a grid of thumbnails.")); pathhb->add_child(mode_thumbnails); mode_list = memnew(ToolButton); @@ -1540,6 +1545,7 @@ EditorFileDialog::EditorFileDialog() { mode_list->set_toggle_mode(true); mode_list->set_pressed(display_mode == DISPLAY_LIST); mode_list->set_button_group(view_mode_group); + mode_list->set_tooltip(TTR("View items as a list.")); pathhb->add_child(mode_list); drives = memnew(OptionButton); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 21cddc8ca4..616a52e25b 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -45,21 +45,6 @@ void EditorHelpSearch::_update_icons() { _update_results(); } -void EditorHelpSearch::_load_settings() { - - bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); - - if (enable_rl) { - results_tree->add_constant_override("draw_relationship_lines", 1); - results_tree->add_color_override("relationship_line_color", rl_color); - results_tree->add_constant_override("draw_guides", 0); - } else { - results_tree->add_constant_override("draw_relationship_lines", 0); - results_tree->add_constant_override("draw_guides", 1); - } -} - void EditorHelpSearch::_update_results() { String term = search_box->get_text(); @@ -120,7 +105,6 @@ void EditorHelpSearch::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - _load_settings(); _update_icons(); } break; case NOTIFICATION_ENTER_TREE: { @@ -264,8 +248,6 @@ EditorHelpSearch::EditorHelpSearch() { results_tree->connect("item_activated", this, "_confirmed"); results_tree->connect("item_selected", get_ok(), "set_disabled", varray(false)); vbox->add_child(results_tree, true); - - _load_settings(); } bool EditorHelpSearch::Runner::_slice() { diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index e74bfdc5b6..93cf66a0dd 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -64,7 +64,6 @@ class EditorHelpSearch : public ConfirmationDialog { Ref<Runner> search; void _update_icons(); - void _load_settings(); void _update_results(); void _search_box_gui_input(const Ref<InputEvent> &p_event); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e8ee5069a5..60fa5ff16f 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -82,7 +82,10 @@ Size2 EditorProperty::get_minimum_size() const { void EditorProperty::emit_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field, bool p_changing) { - emit_signal("property_changed", p_property, p_value, p_field, p_changing); + Variant args[4] = { p_property, p_value, p_field, p_changing }; + const Variant *argptrs[4] = { &args[0], &args[1], &args[2], &args[3] }; + + emit_signal("property_changed", (const Variant **)argptrs, 4); } void EditorProperty::_notification(int p_what) { @@ -1233,6 +1236,7 @@ EditorInspectorSection::EditorInspectorSection() { } EditorInspectorSection::~EditorInspectorSection() { + if (!vbox_added) { memdelete(vbox); } @@ -1294,6 +1298,10 @@ void EditorInspector::remove_inspector_plugin(const Ref<EditorInspectorPlugin> & for (int i = idx; i < inspector_plugin_count - 1; i++) { inspector_plugins[i] = inspector_plugins[i + 1]; } + + if (idx == inspector_plugin_count - 1) + inspector_plugins[idx] = Ref<EditorInspectorPlugin>(); + inspector_plugin_count--; } @@ -2133,6 +2141,9 @@ void EditorInspector::_notification(int p_what) { get_tree()->connect("node_removed", this, "_node_removed"); } } + if (p_what == NOTIFICATION_PREDELETE) { + edit(NULL); //just in case + } if (p_what == NOTIFICATION_EXIT_TREE) { if (!sub_inspector) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b36afaef88..1e03adc219 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -619,7 +619,11 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); if (err != OK) { - show_accept(TTR("Error saving resource!"), TTR("OK")); + if (ResourceLoader::is_imported(p_resource->get_path())) { + show_accept(TTR("Imported resources can't be saved."), TTR("OK")); + } else { + show_accept(TTR("Error saving resource!"), TTR("OK")); + } return; } @@ -639,6 +643,18 @@ void EditorNode::save_resource(const Ref<Resource> &p_resource) { void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String &p_at_path) { + { + String path = p_resource->get_path(); + int srpos = path.find("::"); + if (srpos != -1) { + String base = path.substr(0, srpos); + if (!get_edited_scene() || get_edited_scene()->get_filename() != base) { + show_warning(TTR("This resource can't be saved because it does not belong to the edited scene. Make it unique first.")); + return; + } + } + } + file->set_mode(EditorFileDialog::MODE_SAVE_FILE); saving_resource = p_resource; @@ -1438,13 +1454,25 @@ void EditorNode::edit_item(Object *p_object) { } if (!sub_plugins.empty()) { - _display_top_editors(false); - _set_top_editors(sub_plugins); + bool same = true; + if (sub_plugins.size() == editor_plugins_over->get_plugins_list().size()) { + for (int i = 0; i < sub_plugins.size(); i++) { + if (sub_plugins[i] != editor_plugins_over->get_plugins_list()[i]) { + same = false; + } + } + } else { + same = false; + } + if (!same) { + _display_top_editors(false); + _set_top_editors(sub_plugins); + } _set_editing_top_editors(p_object); _display_top_editors(true); } else { - _hide_top_editors(); + hide_top_editors(); } } @@ -1482,7 +1510,7 @@ void EditorNode::_save_default_environment() { } } -void EditorNode::_hide_top_editors() { +void EditorNode::hide_top_editors() { _display_top_editors(false); @@ -1659,7 +1687,7 @@ void EditorNode::_edit_current() { } else if (!editor_plugins_over->get_plugins_list().empty()) { - _hide_top_editors(); + hide_top_editors(); } } @@ -3326,7 +3354,7 @@ Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_f icon = ResourceLoader::load(icon_path); } if (!icon.is_valid()) { - icon = gui_base->get_icon(ScriptServer::get_global_class_base(p_class), "EditorIcons"); + icon = gui_base->get_icon(ScriptServer::get_global_class_native_base(p_class), "EditorIcons"); } return icon; } @@ -4850,6 +4878,7 @@ void EditorNode::_print_handler(void *p_this, const String &p_string, bool p_err EditorNode::EditorNode() { + Input::get_singleton()->set_use_accumulated_input(true); Resource::_get_local_scene_func = _resource_get_edited_scene; VisualServer::get_singleton()->textures_keep_original(true); @@ -5056,7 +5085,7 @@ EditorNode::EditorNode() { EDITOR_DEF("interface/inspector/horizontal_vector2_editing", false); EDITOR_DEF("interface/inspector/horizontal_vector_types_editing", true); EDITOR_DEF("interface/inspector/open_resources_in_current_inspector", true); - EDITOR_DEF("interface/inspector/resources_types_to_open_in_new_inspector", "SpatialMaterial,Script"); + EDITOR_DEF("interface/inspector/resources_to_open_in_new_inspector", "SpatialMaterial,Script,MeshLibrary,TileSet"); EDITOR_DEF("run/auto_save/save_before_running", true); theme_base = memnew(Control); @@ -5659,7 +5688,6 @@ EditorNode::EditorNode() { filesystem_dock = memnew(FileSystemDock(this)); filesystem_dock->connect("open", this, "open_request"); - filesystem_dock->set_file_list_display_mode(FileSystemDock::FILE_LIST_DISPLAY_LIST); filesystem_dock->connect("instance", this, "_instance_request"); filesystem_dock->connect("display_mode_changed", this, "_save_docks"); @@ -5888,6 +5916,8 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(SkeletonEditorPlugin(this))); add_editor_plugin(memnew(SkeletonIKEditorPlugin(this))); add_editor_plugin(memnew(PhysicalBonePlugin(this))); + add_editor_plugin(memnew(MeshEditorPlugin(this))); + add_editor_plugin(memnew(MaterialEditorPlugin(this))); for (int i = 0; i < EditorPlugins::get_plugin_count(); i++) add_editor_plugin(EditorPlugins::create(i, this)); diff --git a/editor/editor_node.h b/editor/editor_node.h index 192dc649e9..267c70c773 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -452,7 +452,6 @@ private: void _instance_request(const Vector<String> &p_files); - void _hide_top_editors(); void _display_top_editors(bool p_display); void _set_top_editors(Vector<EditorPlugin *> p_editor_plugins_over); void _set_editing_top_editors(Object *p_current_object); @@ -677,6 +676,7 @@ public: void edit_item(Object *p_object); void edit_item_resource(RES p_resource); bool item_has_editor(Object *p_object); + void hide_top_editors(); void open_request(const String &p_path); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index a07cffb078..d7faa44441 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2190,7 +2190,7 @@ void EditorPropertyResource::_menu_option(int p_which) { Object *obj = NULL; if (ScriptServer::is_global_class(intype)) { - obj = ClassDB::instance(ScriptServer::get_global_class_base(intype)); + obj = ClassDB::instance(ScriptServer::get_global_class_native_base(intype)); if (obj) { Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(intype)); if (script.is_valid()) { @@ -2443,6 +2443,38 @@ void EditorPropertyResource::_open_editor_pressed() { } } +void EditorPropertyResource::_fold_other_editors(Object *p_self) { + + if (this == p_self) { + return; + } + + RES res = get_edited_object()->get(get_edited_property()); + + if (!res.is_valid()) + return; + bool use_editor = false; + for (int i = 0; i < EditorNode::get_singleton()->get_editor_data().get_editor_plugin_count(); i++) { + EditorPlugin *ep = EditorNode::get_singleton()->get_editor_data().get_editor_plugin(i); + if (ep->handles(res.ptr())) { + use_editor = true; + } + } + + if (!use_editor) + return; + bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); + + opened_editor = false; + + if (unfolded) { + //refold + assign->set_pressed(false); + get_edited_object()->editor_set_section_unfold(get_edited_property(), false); + update_property(); + } +} + void EditorPropertyResource::update_property() { RES res = get_edited_object()->get(get_edited_property()); @@ -2487,12 +2519,20 @@ void EditorPropertyResource::update_property() { } if (use_editor) { + //open editor directly and hide other open of these + _open_editor_pressed(); + if (is_inside_tree()) { + get_tree()->call_deferred("call_group", "_editor_resource_properties", "_fold_other_editors", this); + } + opened_editor = true; + /* Button *open_in_editor = memnew(Button); open_in_editor->set_text(TTR("Open Editor")); open_in_editor->set_icon(get_icon("Edit", "EditorIcons")); sub_inspector_vbox->add_child(open_in_editor); open_in_editor->connect("pressed", this, "_open_editor_pressed"); open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER); + */ } } @@ -2506,6 +2546,10 @@ void EditorPropertyResource::update_property() { memdelete(sub_inspector_vbox); sub_inspector = NULL; sub_inspector_vbox = NULL; + if (opened_editor) { + EditorNode::get_singleton()->hide_top_editors(); + opened_editor = false; + } } } #endif @@ -2547,7 +2591,8 @@ void EditorPropertyResource::_resource_selected() { if (use_sub_inspector) { - get_edited_object()->editor_set_section_unfold(get_edited_property(), assign->is_pressed()); + bool unfold = !get_edited_object()->editor_is_section_unfolded(get_edited_property()); + get_edited_object()->editor_set_section_unfold(get_edited_property(), unfold); update_property(); } else { @@ -2726,10 +2771,12 @@ void EditorPropertyResource::_bind_methods() { ClassDB::bind_method(D_METHOD("_button_draw"), &EditorPropertyResource::_button_draw); ClassDB::bind_method(D_METHOD("_open_editor_pressed"), &EditorPropertyResource::_open_editor_pressed); ClassDB::bind_method(D_METHOD("_button_input"), &EditorPropertyResource::_button_input); + ClassDB::bind_method(D_METHOD("_fold_other_editors"), &EditorPropertyResource::_fold_other_editors); } EditorPropertyResource::EditorPropertyResource() { + opened_editor = false; sub_inspector = NULL; sub_inspector_vbox = NULL; use_sub_inspector = bool(EDITOR_GET("interface/inspector/open_resources_in_current_inspector")); @@ -2766,6 +2813,8 @@ EditorPropertyResource::EditorPropertyResource() { file = NULL; scene_tree = NULL; dropping = false; + + add_to_group("_editor_resource_properties"); } ////////////// DEFAULT PLUGIN ////////////////////// @@ -3162,12 +3211,11 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ editor->setup(p_hint == PROPERTY_HINT_RESOURCE_TYPE ? p_hint_text : "Resource"); if (p_hint == PROPERTY_HINT_RESOURCE_TYPE) { - String open_in_new = EDITOR_GET("interface/inspector/resources_types_to_open_in_new_inspector"); + String open_in_new = EDITOR_GET("interface/inspector/resources_to_open_in_new_inspector"); for (int i = 0; i < open_in_new.get_slice_count(","); i++) { String type = open_in_new.get_slicec(',', i).strip_edges(); for (int j = 0; j < p_hint_text.get_slice_count(","); j++) { String inherits = p_hint_text.get_slicec(',', j); - if (ClassDB::is_parent_class(inherits, type)) { editor->set_use_sub_inspector(false); diff --git a/editor/editor_properties.h b/editor/editor_properties.h index df01ee83b5..574767890c 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -581,6 +581,9 @@ class EditorPropertyResource : public EditorProperty { void _button_input(const Ref<InputEvent> &p_event); void _open_editor_pressed(); + void _fold_other_editors(Object *p_self); + + bool opened_editor; protected: static void _bind_methods(); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 9345ea6b6f..173333dac9 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -188,6 +188,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref< void EditorResourcePreview::_thread() { +#ifndef SERVER_ENABLED while (!exit) { preview_sem->wait(); @@ -313,7 +314,7 @@ void EditorResourcePreview::_thread() { preview_mutex->unlock(); } } - +#endif exited = true; } diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index 703ba34e43..9b9223a818 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -36,24 +36,6 @@ #include "scene/main/node.h" #include "scene/resources/texture.h" -/* make previews for: -*packdscene -*wav -*image -*mesh --font -*script -*material --shader --shader graph? --navigation mesh --collision? --occluder polygon --navigation polygon --tileset --curve and curve2D -*/ - class EditorResourcePreviewGenerator : public Reference { GDCLASS(EditorResourcePreviewGenerator, Reference); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 741a210950..8d590e5268 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -190,6 +190,11 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const { vc.order = v->order; vc.type = v->variant.get_type(); vc.save = v->save; + /*if (vc.save) { this should be implemented, but lets do after 3.1 is out. + if (v->initial.get_type() != Variant::NIL && v->initial == v->variant) { + vc.save = false; + } + }*/ vc.restart_if_changed = v->restart_if_changed; vclist.insert(vc); @@ -327,23 +332,25 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Theme _initial_set("interface/theme/preset", "Default"); - hints["interface/theme/preset"] = PropertyInfo(Variant::STRING, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Alien,Arc,Godot 2,Grey,Light,Solarized (Dark),Solarized (Light),Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/theme/preset"] = PropertyInfo(Variant::STRING, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Alien,Arc,Godot 2,Grey,Light,Solarized (Dark),Solarized (Light),Custom", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/icon_and_font_color", 0); - hints["interface/theme/icon_and_font_color"] = PropertyInfo(Variant::INT, "interface/theme/icon_and_font_color", PROPERTY_HINT_ENUM, "Auto,Dark,Light", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/theme/icon_and_font_color"] = PropertyInfo(Variant::INT, "interface/theme/icon_and_font_color", PROPERTY_HINT_ENUM, "Auto,Dark,Light", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/base_color", Color::html("#323b4f")); - hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/accent_color", Color::html("#699ce8")); - hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/contrast", 0.25); hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); + _initial_set("interface/theme/relationship_line_opacity", 0.1); + hints["interface/theme/relationship_line_opacity"] = PropertyInfo(Variant::REAL, "interface/theme/relationship_line_opacity", PROPERTY_HINT_RANGE, "0.00, 1, 0.01"); _initial_set("interface/theme/highlight_tabs", false); _initial_set("interface/theme/border_size", 1); _initial_set("interface/theme/use_graph_node_headers", false); - hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/additional_spacing", 0); - hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::REAL, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/theme/additional_spacing"] = PropertyInfo(Variant::REAL, "interface/theme/additional_spacing", PROPERTY_HINT_RANGE, "0,5,0.1", PROPERTY_USAGE_DEFAULT); _initial_set("interface/theme/custom_theme", ""); - hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT); // Scene tabs _initial_set("interface/scene_tabs/show_extension", false); @@ -385,8 +392,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // SceneTree _initial_set("docks/scene_tree/start_create_dialog_fully_expanded", false); - _initial_set("docks/scene_tree/draw_relationship_lines", true); - _initial_set("docks/scene_tree/relationship_line_color", Color::html("464646")); // FileSystem _initial_set("docks/filesystem/thumbnail_size", 64); @@ -780,12 +785,6 @@ void EditorSettings::create() { // Validate/create data dir and subdirectories dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - if (dir->change_dir(data_path) != OK) { - ERR_PRINT("Cannot find path for data directory!"); - memdelete(dir); - goto fail; - } - if (dir->change_dir(data_dir) != OK) { dir->make_dir_recursive(data_dir); if (dir->change_dir(data_dir) != OK) { diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 3fe19c0b31..c05db2571b 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -238,16 +238,17 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const float default_contrast = 0.25; //Theme settings - Color accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#699ce8")); - Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#323b4f")); - float contrast = EDITOR_DEF("interface/theme/contrast", default_contrast); + Color accent_color = EDITOR_GET("interface/theme/accent_color"); + Color base_color = EDITOR_GET("interface/theme/base_color"); + float contrast = EDITOR_GET("interface/theme/contrast"); + float relationship_line_opacity = EDITOR_GET("interface/theme/relationship_line_opacity"); - String preset = EDITOR_DEF("interface/theme/preset", "Default"); + String preset = EDITOR_GET("interface/theme/preset"); - bool highlight_tabs = EDITOR_DEF("interface/theme/highlight_tabs", false); - int border_size = EDITOR_DEF("interface/theme/border_size", 1); + bool highlight_tabs = EDITOR_GET("interface/theme/highlight_tabs"); + int border_size = EDITOR_GET("interface/theme/border_size"); - bool use_gn_headers = EDITOR_DEF("interface/theme/use_graph_node_headers", false); + bool use_gn_headers = EDITOR_GET("interface/theme/use_graph_node_headers"); Color preset_accent_color; Color preset_base_color; @@ -260,9 +261,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { preset_base_color = Color::html("#323b4f"); preset_contrast = default_contrast; } else if (preset == "Custom") { - accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#699ce8")); - base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#323b4f")); - contrast = EDITOR_DEF("interface/theme/contrast", default_contrast); + accent_color = EDITOR_GET("interface/theme/accent_color"); + base_color = EDITOR_GET("interface/theme/base_color"); + contrast = EDITOR_GET("interface/theme/contrast"); } else if (preset == "Alien") { preset_accent_color = Color::html("#1bfe99"); preset_base_color = Color::html("#2f373f"); @@ -368,7 +369,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("error_color", "Editor", error_color); theme->set_color("property_color", "Editor", property_color); - const int thumb_size = EDITOR_DEF("filesystem/file_dialog/thumbnail_size", 64); + const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); theme->set_constant("scale", "Editor", EDSCALE); theme->set_constant("thumb_size", "Editor", thumb_size); theme->set_constant("dark_theme", "Editor", dark_theme); @@ -641,9 +642,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_icon("visibility_xray", "PopupMenu", theme->get_icon("GuiVisibilityXray", "EditorIcons")); theme->set_constant("vseparation", "PopupMenu", (extra_spacing + default_margin_size + 1) * EDSCALE); - Ref<StyleBoxFlat> sub_inspector_bg = make_flat_stylebox(dark_color_1, 2, 0, 0, 0); + Ref<StyleBoxFlat> sub_inspector_bg = make_flat_stylebox(dark_color_1.linear_interpolate(accent_color, 0.08), 2, 0, 2, 2); sub_inspector_bg->set_border_width(MARGIN_LEFT, 2); sub_inspector_bg->set_border_color(MARGIN_LEFT, accent_color * Color(1, 1, 1, 0.3)); + sub_inspector_bg->set_border_width(MARGIN_RIGHT, 2); + sub_inspector_bg->set_border_color(MARGIN_RIGHT, accent_color * Color(1, 1, 1, 0.3)); + sub_inspector_bg->set_border_width(MARGIN_BOTTOM, 2); + sub_inspector_bg->set_border_color(MARGIN_BOTTOM, accent_color * Color(1, 1, 1, 0.3)); sub_inspector_bg->set_draw_center(true); theme->set_stylebox("sub_inspector_bg", "Editor", sub_inspector_bg); @@ -656,6 +661,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("bg", "Tree", style_tree_bg); const Color guide_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.05); + Color relationship_line_color = Color(mono_color.r, mono_color.g, mono_color.b, relationship_line_opacity); // Tree theme->set_icon("checked", "Tree", theme->get_icon("GuiChecked", "EditorIcons")); theme->set_icon("unchecked", "Tree", theme->get_icon("GuiUnchecked", "EditorIcons")); @@ -674,13 +680,15 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color_selected", "Tree", mono_color); theme->set_color("title_button_color", "Tree", font_color); theme->set_color("guide_color", "Tree", guide_color); + theme->set_color("relationship_line_color", "Tree", relationship_line_color); theme->set_color("drop_position_color", "Tree", accent_color); theme->set_constant("vseparation", "Tree", (extra_spacing + default_margin_size) * EDSCALE); theme->set_constant("hseparation", "Tree", (extra_spacing + default_margin_size) * EDSCALE); theme->set_constant("guide_width", "Tree", border_width); theme->set_constant("item_margin", "Tree", 3 * default_margin_size * EDSCALE); theme->set_constant("button_margin", "Tree", default_margin_size * EDSCALE); - theme->set_constant("draw_relationship_lines", "Tree", 0); + theme->set_constant("draw_relationship_lines", "Tree", relationship_line_opacity >= 0.01); + theme->set_constant("draw_guides", "Tree", relationship_line_opacity < 0.01); theme->set_constant("scroll_border", "Tree", default_margin_size * EDSCALE); theme->set_constant("scroll_speed", "Tree", 12); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 9bd6063a71..c99786bb07 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -283,7 +283,7 @@ void FileSystemDock::_notification(int p_what) { String ei = "EditorIcons"; button_reload->set_icon(get_icon("Reload", ei)); button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); - button_file_list_display_mode->connect("toggled", this, "_toggle_file_display"); + button_file_list_display_mode->connect("pressed", this, "_toggle_file_display"); files->connect("item_activated", this, "_file_list_activate_file"); button_hist_next->connect("pressed", this, "_fw_history"); @@ -302,6 +302,8 @@ void FileSystemDock::_notification(int p_what) { always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders")); + set_file_list_display_mode(FileSystemDock::FILE_LIST_DISPLAY_LIST); + _update_display_mode(); if (EditorFileSystem::get_singleton()->is_scanning()) { @@ -348,7 +350,7 @@ void FileSystemDock::_notification(int p_what) { button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); button_hist_next->set_icon(get_icon("Forward", ei)); button_hist_prev->set_icon(get_icon("Back", ei)); - if (button_file_list_display_mode->is_pressed()) { + if (file_list_display_mode == FILE_LIST_DISPLAY_LIST) { button_file_list_display_mode->set_icon(get_icon("FileThumbnail", "EditorIcons")); } else { button_file_list_display_mode->set_icon(get_icon("FileList", "EditorIcons")); @@ -499,8 +501,8 @@ void FileSystemDock::_tree_thumbnail_done(const String &p_path, const Ref<Textur } } -void FileSystemDock::_toggle_file_display(bool p_active) { - _set_file_display(p_active); +void FileSystemDock::_toggle_file_display() { + _set_file_display(file_list_display_mode != FILE_LIST_DISPLAY_LIST); emit_signal("display_mode_changed"); } @@ -1690,8 +1692,7 @@ void FileSystemDock::set_file_list_display_mode(FileListDisplayMode p_mode) { if (p_mode == file_list_display_mode) return; - button_file_list_display_mode->set_pressed(p_mode == FILE_LIST_DISPLAY_LIST); - _toggle_file_display(p_mode == FILE_LIST_DISPLAY_LIST); + _toggle_file_display(); } Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) { @@ -2279,7 +2280,7 @@ void FileSystemDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_file_list_activate_file"), &FileSystemDock::_file_list_activate_file); ClassDB::bind_method(D_METHOD("_tree_activate_file"), &FileSystemDock::_tree_activate_file); ClassDB::bind_method(D_METHOD("_select_file"), &FileSystemDock::_select_file); - ClassDB::bind_method(D_METHOD("_navigate_to_path"), &FileSystemDock::_navigate_to_path); + ClassDB::bind_method(D_METHOD("_navigate_to_path"), &FileSystemDock::_navigate_to_path, DEFVAL(false)); ClassDB::bind_method(D_METHOD("_toggle_file_display"), &FileSystemDock::_toggle_file_display); ClassDB::bind_method(D_METHOD("_fw_history"), &FileSystemDock::_fw_history); ClassDB::bind_method(D_METHOD("_bw_history"), &FileSystemDock::_bw_history); @@ -2375,29 +2376,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { tree_search_box->connect("text_changed", this, "_search_changed", varray(tree_search_box)); toolbar2_hbc->add_child(tree_search_box); - //toolbar_hbc->add_spacer(); - - //Control *spacer = memnew( Control); - - /* - button_open = memnew( Button ); - button_open->set_flat(true); - button_open->connect("pressed",this,"_tree_toggle_collapsed"); - toolbar_hbc->add_child(button_open); - button_open->hide(); - button_open->set_focus_mode(FOCUS_NONE); - button_open->set_tooltip("Open the selected file.\nOpen as scene if a scene, or as resource otherwise."); - - - button_instance = memnew( Button ); - button_instance->set_flat(true); - button_instance->connect("pressed",this,"_instance_pressed"); - toolbar_hbc->add_child(button_instance); - button_instance->hide(); - button_instance->set_focus_mode(FOCUS_NONE); - button_instance->set_tooltip(TTR("Instance the selected scene(s) as child of the selected node.")); - -*/ file_list_popup = memnew(PopupMenu); file_list_popup->set_hide_on_window_lose_focus(true); add_child(file_list_popup); @@ -2439,7 +2417,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { path_hb->add_child(file_list_search_box); button_file_list_display_mode = memnew(ToolButton); - button_file_list_display_mode->set_toggle_mode(true); path_hb->add_child(button_file_list_display_mode); files = memnew(ItemList); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 7cf37a7634..cd052f9700 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -181,7 +181,7 @@ private: void _tree_gui_input(Ref<InputEvent> p_event); void _update_file_list(bool p_keep_selection); - void _toggle_file_display(bool p_active); + void _toggle_file_display(); void _set_file_display(bool p_active); void _fs_changed(); diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 652f1ebac9..44eaf3d9ef 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -176,7 +176,7 @@ Error ColladaImport::_create_scene_skeletons(Collada::Node *p_node) { Skeleton *sk = memnew(Skeleton); int bone = 0; - + sk->set_use_bones_in_world_transform(true); // This improves compatibility in Collada for (int i = 0; i < p_node->children.size(); i++) { _populate_skeleton(sk, p_node->children[i], bone, -1); diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 3909d437e5..7032146229 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -2121,6 +2121,7 @@ Spatial *EditorSceneImporterGLTF::_generate_scene(GLTFState &state, int p_bake_f Vector<Skeleton *> skeletons; for (int i = 0; i < state.skins.size(); i++) { Skeleton *s = memnew(Skeleton); + s->set_use_bones_in_world_transform(false); //GLTF does not need this since meshes are always local String name = state.skins[i].name; if (name == "") { name = _gen_unique_name(state, "Skeleton"); diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index b4b3e0e551..cfcdbc8de4 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -119,7 +119,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const if (key != "") { for (int i = 1; i < line.size(); i++) { - translations.write[i - 1]->add_message(key, line[i]); + translations.write[i - 1]->add_message(key, line[i].c_unescape()); } } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 76552575da..5eb1d2ec6c 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1240,7 +1240,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p String root_type = p_options["nodes/root_type"]; - if (scene->get_class() != root_type) { + if (root_type != "Spatial") { Node *base_node = Object::cast_to<Node>(ClassDB::instance(root_type)); if (base_node) { diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 631b2359c5..d72de3de48 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -505,7 +505,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2")) { - _save_stex(image, p_save_path + ".etc2.stex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, false); + _save_stex(image, p_save_path + ".etc2.stex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, true); r_platform_variants->push_back("etc2"); formats_imported.push_back("etc2"); } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index ab3936407b..a9e9607bc5 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -177,6 +177,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const thumbnail = thumbnail->duplicate(); Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2); + // Overlay and thumbnail need the same format for `blend_rect` to work. + thumbnail->convert(Image::FORMAT_RGBA8); thumbnail->lock(); thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos); thumbnail->unlock(); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index ce8cc77802..ebacccb03c 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -32,6 +32,210 @@ #include "scene/resources/particles_material.h" +void MaterialEditor::_notification(int p_what) { + + if (p_what == NOTIFICATION_PHYSICS_PROCESS) { + } + + if (p_what == NOTIFICATION_READY) { + + //get_scene()->connect("node_removed",this,"_node_removed"); + + if (first_enter) { + //it's in propertyeditor so.. could be moved around + + light_1_switch->set_normal_texture(get_icon("MaterialPreviewLight1", "EditorIcons")); + light_1_switch->set_pressed_texture(get_icon("MaterialPreviewLight1Off", "EditorIcons")); + light_2_switch->set_normal_texture(get_icon("MaterialPreviewLight2", "EditorIcons")); + light_2_switch->set_pressed_texture(get_icon("MaterialPreviewLight2Off", "EditorIcons")); + + sphere_switch->set_normal_texture(get_icon("MaterialPreviewSphereOff", "EditorIcons")); + sphere_switch->set_pressed_texture(get_icon("MaterialPreviewSphere", "EditorIcons")); + box_switch->set_normal_texture(get_icon("MaterialPreviewCubeOff", "EditorIcons")); + box_switch->set_pressed_texture(get_icon("MaterialPreviewCube", "EditorIcons")); + + first_enter = false; + } + } + + if (p_what == NOTIFICATION_DRAW) { + + Ref<Texture> checkerboard = get_icon("Checkerboard", "EditorIcons"); + Size2 size = get_size(); + + draw_texture_rect(checkerboard, Rect2(Point2(), size), true); + } +} + +void MaterialEditor::edit(Ref<Material> p_material, const Ref<Environment> &p_env) { + + material = p_material; + camera->set_environment(p_env); + if (!material.is_null()) { + sphere_instance->set_material_override(material); + box_instance->set_material_override(material); + } else { + + hide(); + } +} + +void MaterialEditor::_button_pressed(Node *p_button) { + + if (p_button == light_1_switch) { + light1->set_visible(!light_1_switch->is_pressed()); + } + + if (p_button == light_2_switch) { + light2->set_visible(!light_2_switch->is_pressed()); + } + + if (p_button == box_switch) { + box_instance->show(); + sphere_instance->hide(); + box_switch->set_pressed(true); + sphere_switch->set_pressed(false); + } + + if (p_button == sphere_switch) { + box_instance->hide(); + sphere_instance->show(); + box_switch->set_pressed(false); + sphere_switch->set_pressed(true); + } +} + +void MaterialEditor::_bind_methods() { + + ClassDB::bind_method(D_METHOD("_button_pressed"), &MaterialEditor::_button_pressed); +} + +MaterialEditor::MaterialEditor() { + + vc = memnew(ViewportContainer); + vc->set_stretch(true); + add_child(vc); + vc->set_anchors_and_margins_preset(PRESET_WIDE); + viewport = memnew(Viewport); + Ref<World> world; + world.instance(); + viewport->set_world(world); //use own world + vc->add_child(viewport); + viewport->set_disable_input(true); + viewport->set_transparent_background(true); + viewport->set_msaa(Viewport::MSAA_4X); + + camera = memnew(Camera); + camera->set_transform(Transform(Basis(), Vector3(0, 0, 3))); + camera->set_perspective(45, 0.1, 10); + camera->make_current(); + viewport->add_child(camera); + + light1 = memnew(DirectionalLight); + light1->set_transform(Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0))); + viewport->add_child(light1); + + light2 = memnew(DirectionalLight); + light2->set_transform(Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1))); + light2->set_color(Color(0.7, 0.7, 0.7)); + viewport->add_child(light2); + + sphere_instance = memnew(MeshInstance); + viewport->add_child(sphere_instance); + + box_instance = memnew(MeshInstance); + viewport->add_child(box_instance); + + Transform box_xform; + box_xform.basis.rotate(Vector3(1, 0, 0), Math::deg2rad(25.0)); + box_xform.basis = box_xform.basis * Basis().rotated(Vector3(0, 1, 0), Math::deg2rad(-25.0)); + box_xform.basis.scale(Vector3(0.8, 0.8, 0.8)); + box_xform.origin.y = 0.2; + box_instance->set_transform(box_xform); + + sphere_mesh.instance(); + sphere_instance->set_mesh(sphere_mesh); + box_mesh.instance(); + box_instance->set_mesh(box_mesh); + box_instance->hide(); + + set_custom_minimum_size(Size2(1, 150) * EDSCALE); + + HBoxContainer *hb = memnew(HBoxContainer); + add_child(hb); + hb->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 2); + + VBoxContainer *vb_shape = memnew(VBoxContainer); + hb->add_child(vb_shape); + + sphere_switch = memnew(TextureButton); + sphere_switch->set_toggle_mode(true); + sphere_switch->set_pressed(true); + vb_shape->add_child(sphere_switch); + sphere_switch->connect("pressed", this, "_button_pressed", varray(sphere_switch)); + + box_switch = memnew(TextureButton); + box_switch->set_toggle_mode(true); + box_switch->set_pressed(false); + vb_shape->add_child(box_switch); + box_switch->connect("pressed", this, "_button_pressed", varray(box_switch)); + + hb->add_spacer(); + + VBoxContainer *vb_light = memnew(VBoxContainer); + hb->add_child(vb_light); + + light_1_switch = memnew(TextureButton); + light_1_switch->set_toggle_mode(true); + vb_light->add_child(light_1_switch); + light_1_switch->connect("pressed", this, "_button_pressed", varray(light_1_switch)); + + light_2_switch = memnew(TextureButton); + light_2_switch->set_toggle_mode(true); + vb_light->add_child(light_2_switch); + light_2_switch->connect("pressed", this, "_button_pressed", varray(light_2_switch)); + + first_enter = true; +} + +/////////////////////// + +bool EditorInspectorPluginMaterial::can_handle(Object *p_object) { + + Material *material = Object::cast_to<Material>(p_object); + if (!material) + return false; + + return material->get_shader_mode() == Shader::MODE_SPATIAL; +} + +void EditorInspectorPluginMaterial::parse_begin(Object *p_object) { + + Material *material = Object::cast_to<Material>(p_object); + if (!material) { + return; + } + Ref<Material> m(material); + + MaterialEditor *editor = memnew(MaterialEditor); + editor->edit(m, env); + add_custom_control(editor); +} + +EditorInspectorPluginMaterial::EditorInspectorPluginMaterial() { + env.instance(); + Ref<ProceduralSky> proc_sky = memnew(ProceduralSky(true)); + env->set_sky(proc_sky); + env->set_background(Environment::BG_COLOR_SKY); +} + +MaterialEditorPlugin::MaterialEditorPlugin(EditorNode *p_node) { + + Ref<EditorInspectorPluginMaterial> plugin; + plugin.instance(); + add_inspector_plugin(plugin); +} + String SpatialMaterialConversionPlugin::converts_to() const { return "ShaderMaterial"; diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h index 39935d3e12..c3f14c27e5 100644 --- a/editor/plugins/material_editor_plugin.h +++ b/editor/plugins/material_editor_plugin.h @@ -32,6 +32,71 @@ #define MATERIAL_EDITOR_PLUGIN_H #include "editor/property_editor.h" +#include "scene/resources/primitive_meshes.h" + +#include "editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "scene/3d/camera.h" +#include "scene/3d/light.h" +#include "scene/3d/mesh_instance.h" +#include "scene/resources/material.h" + +class MaterialEditor : public Control { + + GDCLASS(MaterialEditor, Control); + + ViewportContainer *vc; + Viewport *viewport; + MeshInstance *sphere_instance; + MeshInstance *box_instance; + DirectionalLight *light1; + DirectionalLight *light2; + Camera *camera; + + Ref<SphereMesh> sphere_mesh; + Ref<CubeMesh> box_mesh; + + TextureButton *sphere_switch; + TextureButton *box_switch; + + TextureButton *light_1_switch; + TextureButton *light_2_switch; + + Ref<Material> material; + + void _button_pressed(Node *p_button); + bool first_enter; + +protected: + void _notification(int p_what); + + static void _bind_methods(); + +public: + void edit(Ref<Material> p_material, const Ref<Environment> &p_env); + MaterialEditor(); +}; + +class EditorInspectorPluginMaterial : public EditorInspectorPlugin { + GDCLASS(EditorInspectorPluginMaterial, EditorInspectorPlugin) + Ref<Environment> env; + +public: + virtual bool can_handle(Object *p_object); + virtual void parse_begin(Object *p_object); + + EditorInspectorPluginMaterial(); +}; + +class MaterialEditorPlugin : public EditorPlugin { + + GDCLASS(MaterialEditorPlugin, EditorPlugin); + +public: + virtual String get_name() const { return "Material"; } + + MaterialEditorPlugin(EditorNode *p_node); +}; class SpatialMaterialConversionPlugin : public EditorResourceConversionPlugin { GDCLASS(SpatialMaterialConversionPlugin, EditorResourceConversionPlugin) diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index fcf515e3fc..6203035e25 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -80,26 +80,21 @@ void MeshEditor::edit(Ref<Mesh> p_mesh) { mesh = p_mesh; mesh_instance->set_mesh(mesh); - if (mesh.is_null()) { - - hide(); - } else { - rot_x = 0; - rot_y = 0; - _update_rotation(); - - AABB aabb = mesh->get_aabb(); - Vector3 ofs = aabb.position + aabb.size * 0.5; - float m = aabb.get_longest_axis_size(); - if (m != 0) { - m = 1.0 / m; - m *= 0.5; - Transform xform; - xform.basis.scale(Vector3(m, m, m)); - xform.origin = -xform.basis.xform(ofs); //-ofs*m; - //xform.origin.z -= aabb.get_longest_axis_size() * 2; - mesh_instance->set_transform(xform); - } + rot_x = Math::deg2rad(-15.0); + rot_y = Math::deg2rad(30.0); + _update_rotation(); + + AABB aabb = mesh->get_aabb(); + Vector3 ofs = aabb.position + aabb.size * 0.5; + float m = aabb.get_longest_axis_size(); + if (m != 0) { + m = 1.0 / m; + m *= 0.5; + Transform xform; + xform.basis.scale(Vector3(m, m, m)); + xform.origin = -xform.basis.xform(ofs); //-ofs*m; + //xform.origin.z -= aabb.get_longest_axis_size() * 2; + mesh_instance->set_transform(xform); } } @@ -128,8 +123,8 @@ MeshEditor::MeshEditor() { viewport->set_world(world); //use own world add_child(viewport); viewport->set_disable_input(true); + viewport->set_msaa(Viewport::MSAA_2X); set_stretch(true); - camera = memnew(Camera); camera->set_transform(Transform(Basis(), Vector3(0, 0, 1.1))); camera->set_perspective(45, 0.1, 10); @@ -176,39 +171,29 @@ MeshEditor::MeshEditor() { rot_y = 0; } -void MeshEditorPlugin::edit(Object *p_object) { - - Mesh *s = Object::cast_to<Mesh>(p_object); - if (!s) - return; - - mesh_editor->edit(Ref<Mesh>(s)); -} +/////////////////////// -bool MeshEditorPlugin::handles(Object *p_object) const { +bool EditorInspectorPluginMesh::can_handle(Object *p_object) { - return p_object->is_class("Mesh"); + return Object::cast_to<Mesh>(p_object) != NULL; } -void MeshEditorPlugin::make_visible(bool p_visible) { +void EditorInspectorPluginMesh::parse_begin(Object *p_object) { - if (p_visible) { - mesh_editor->show(); - //mesh_editor->set_process(true); - } else { - - mesh_editor->hide(); - //mesh_editor->set_process(false); + Mesh *mesh = Object::cast_to<Mesh>(p_object); + if (!mesh) { + return; } + Ref<Mesh> m(mesh); + + MeshEditor *editor = memnew(MeshEditor); + editor->edit(m); + add_custom_control(editor); } MeshEditorPlugin::MeshEditorPlugin(EditorNode *p_node) { - editor = p_node; - mesh_editor = memnew(MeshEditor); - add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM, mesh_editor); - mesh_editor->hide(); -} - -MeshEditorPlugin::~MeshEditorPlugin() { + Ref<EditorInspectorPluginMesh> plugin; + plugin.instance(); + add_inspector_plugin(plugin); } diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h index 0275f45be9..8ada2dac90 100644 --- a/editor/plugins/mesh_editor_plugin.h +++ b/editor/plugins/mesh_editor_plugin.h @@ -72,22 +72,21 @@ public: MeshEditor(); }; +class EditorInspectorPluginMesh : public EditorInspectorPlugin { + GDCLASS(EditorInspectorPluginMesh, EditorInspectorPlugin) +public: + virtual bool can_handle(Object *p_object); + virtual void parse_begin(Object *p_object); +}; + class MeshEditorPlugin : public EditorPlugin { GDCLASS(MeshEditorPlugin, EditorPlugin); - MeshEditor *mesh_editor; - EditorNode *editor; - public: virtual String get_name() const { return "Mesh"; } - bool has_main_screen() const { return false; } - virtual void edit(Object *p_object); - virtual bool handles(Object *p_object) const; - virtual void make_visible(bool p_visible); MeshEditorPlugin(EditorNode *p_node); - ~MeshEditorPlugin(); }; #endif diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index bb7d50a9c1..d00687f7ea 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -133,7 +133,10 @@ void Particles2DEditorPlugin::_generate_visibility_rect() { particles->set_emitting(false); } - particles->set_visibility_rect(rect); + undo_redo->create_action(TTR("Generate Visibility Rect")); + undo_redo->add_do_method(particles, "set_visibility_rect", rect); + undo_redo->add_undo_method(particles, "set_visibility_rect", particles->get_visibility_rect()); + undo_redo->commit_action(); } void Particles2DEditorPlugin::_generate_emission_mask() { diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 95828064ac..0032850535 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -353,7 +353,11 @@ void ParticlesEditor::_generate_aabb() { node->set_emitting(false); } - node->set_visibility_aabb(rect); + UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); + ur->create_action(TTR("Generate Visibility AABB")); + ur->add_do_method(node, "set_visibility_aabb", rect); + ur->add_undo_method(node, "set_visibility_aabb", node->get_visibility_aabb()); + ur->commit_action(); } void ParticlesEditor::edit(Particles *p_particles) { diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index 6efa76ef80..88dc258c5f 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_editor_plugin.cpp @@ -638,6 +638,10 @@ String PathSpatialGizmoPlugin::get_name() const { return "Path"; } +int PathSpatialGizmoPlugin::get_priority() const { + return -1; +} + PathSpatialGizmoPlugin::PathSpatialGizmoPlugin() { Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8)); diff --git a/editor/plugins/path_editor_plugin.h b/editor/plugins/path_editor_plugin.h index ce3d3799d4..5482d09377 100644 --- a/editor/plugins/path_editor_plugin.h +++ b/editor/plugins/path_editor_plugin.h @@ -62,6 +62,7 @@ protected: public: String get_name() const; + int get_priority() const; PathSpatialGizmoPlugin(); }; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9e65d9de10..e648fa0820 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2206,6 +2206,9 @@ void ScriptEditor::_script_split_dragged(float) { Variant ScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { + if (tab_container->get_child_count() == 0) + return Variant(); + Node *cur_node = tab_container->get_child(tab_container->get_current_tab()); HBoxContainer *drag_preview = memnew(HBoxContainer); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 020a68a7ed..2b6ceac8e2 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -47,6 +47,9 @@ Ref<Shader> ShaderTextEditor::get_edited_shader() const { } void ShaderTextEditor::set_edited_shader(const Ref<Shader> &p_shader) { + if (shader == p_shader) { + return; + } shader = p_shader; _load_theme_settings(); @@ -352,8 +355,8 @@ void ShaderEditor::_menu_option(int p_option) { void ShaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (is_visible_in_tree()) - shader_editor->get_text_edit()->grab_focus(); + //if (is_visible_in_tree()) + // shader_editor->get_text_edit()->grab_focus(); } } @@ -415,6 +418,9 @@ void ShaderEditor::edit(const Ref<Shader> &p_shader) { if (p_shader.is_null() || !p_shader->is_text_shader()) return; + if (shader == p_shader) + return; + shader = p_shader; shader_editor->set_edited_shader(p_shader); @@ -438,8 +444,12 @@ void ShaderEditor::save_external_data() { void ShaderEditor::apply_shaders() { if (shader.is_valid()) { - shader->set_code(shader_editor->get_text_edit()->get_text()); - shader->set_edited(true); + String shader_code = shader->get_code(); + String editor_code = shader_editor->get_text_edit()->get_text(); + if (shader_code != editor_code) { + shader->set_code(editor_code); + shader->set_edited(true); + } } } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 1e9ff87fd3..ad945d7916 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2108,9 +2108,11 @@ void SpatialEditorViewport::_notification(int p_what) { set_process(visible); - if (visible) + if (visible) { _update_camera(0); - + } else { + set_freelook_active(false); + } call_deferred("update_transform_gizmo_view"); } @@ -4115,10 +4117,10 @@ Dictionary SpatialEditor::get_state() const { d["zfar"] = get_zfar(); Dictionary gizmos_status; - for (int i = 0; i < gizmo_plugins.size(); i++) { - if (!gizmo_plugins[i]->can_be_hidden()) continue; + for (int i = 0; i < gizmo_plugins_by_name.size(); i++) { + if (!gizmo_plugins_by_name[i]->can_be_hidden()) continue; int state = gizmos_menu->get_item_state(gizmos_menu->get_item_index(i)); - String name = gizmo_plugins[i]->get_name(); + String name = gizmo_plugins_by_name[i]->get_name(); gizmos_status[name] = state; } @@ -4168,9 +4170,13 @@ void SpatialEditor::set_state(const Dictionary &p_state) { if (d.has("viewports")) { Array vp = d["viewports"]; - ERR_FAIL_COND(vp.size() > 4); + uint32_t vp_size = static_cast<uint32_t>(vp.size()); + if (vp_size > VIEWPORTS_COUNT) { + WARN_PRINT("Ignoring superfluous viewport settings from spatial editor state.") + vp_size = VIEWPORTS_COUNT; + } - for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { + for (uint32_t i = 0; i < vp_size; i++) { viewports[i]->set_state(vp[i]); } } @@ -4203,32 +4209,19 @@ void SpatialEditor::set_state(const Dictionary &p_state) { List<Variant> keys; gizmos_status.get_key_list(&keys); - for (int j = 0; j < gizmo_plugins.size(); ++j) { - if (!gizmo_plugins[j]->can_be_hidden()) continue; - int state = EditorSpatialGizmoPlugin::ON_TOP; + for (int j = 0; j < gizmo_plugins_by_name.size(); ++j) { + if (!gizmo_plugins_by_name[j]->can_be_hidden()) continue; + int state = EditorSpatialGizmoPlugin::VISIBLE; for (int i = 0; i < keys.size(); i++) { - if (gizmo_plugins.write[j]->get_name() == keys[i]) { + if (gizmo_plugins_by_name.write[j]->get_name() == keys[i]) { state = gizmos_status[keys[i]]; + break; } } - const int idx = gizmos_menu->get_item_index(j); - - gizmos_menu->set_item_multistate(idx, state); - gizmo_plugins.write[j]->set_state(state); - - switch (state) { - case EditorSpatialGizmoPlugin::VISIBLE: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_visible")); - break; - case EditorSpatialGizmoPlugin::ON_TOP: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_xray")); - break; - case EditorSpatialGizmoPlugin::HIDDEN: - gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_hidden")); - break; - } + gizmo_plugins_by_name.write[j]->set_state(state); } + _update_gizmos_menu(); } } @@ -4342,7 +4335,7 @@ void SpatialEditor::_menu_gizmo_toggled(int p_option) { break; } - gizmo_plugins.write[p_option]->set_state(state); + gizmo_plugins_by_name.write[p_option]->set_state(state); update_all_gizmos(); } @@ -4838,30 +4831,46 @@ void SpatialEditor::_init_indicators() { _generate_selection_box(); } -struct _GizmoPluginComparator { - - bool operator()(const Ref<EditorSpatialGizmoPlugin> &p_a, const Ref<EditorSpatialGizmoPlugin> &p_b) const { - return p_a->get_name() < p_b->get_name(); - } -}; - void SpatialEditor::_update_gizmos_menu() { gizmos_menu->clear(); - gizmo_plugins.sort_custom<_GizmoPluginComparator>(); - for (int i = 0; i < gizmo_plugins.size(); ++i) { - if (!gizmo_plugins[i]->can_be_hidden()) continue; - String plugin_name = gizmo_plugins[i]->get_name(); - gizmos_menu->add_multistate_item(TTR(plugin_name), 3, EditorSpatialGizmoPlugin::VISIBLE, i); - gizmos_menu->set_item_icon(gizmos_menu->get_item_index(i), gizmos_menu->get_icon("visibility_visible")); + for (int i = 0; i < gizmo_plugins_by_name.size(); ++i) { + if (!gizmo_plugins_by_name[i]->can_be_hidden()) continue; + String plugin_name = gizmo_plugins_by_name[i]->get_name(); + const int plugin_state = gizmo_plugins_by_name[i]->get_state(); + gizmos_menu->add_multistate_item(TTR(plugin_name), 3, plugin_state, i); + const int idx = gizmos_menu->get_item_index(i); + switch (plugin_state) { + case EditorSpatialGizmoPlugin::VISIBLE: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_visible")); + break; + case EditorSpatialGizmoPlugin::ON_TOP: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_xray")); + break; + case EditorSpatialGizmoPlugin::HIDDEN: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_hidden")); + break; + } } } void SpatialEditor::_update_gizmos_menu_theme() { - for (int i = 0; i < gizmo_plugins.size(); ++i) { - if (!gizmo_plugins[i]->can_be_hidden()) continue; - gizmos_menu->set_item_icon(gizmos_menu->get_item_index(i), gizmos_menu->get_icon("visibility_visible")); + for (int i = 0; i < gizmo_plugins_by_name.size(); ++i) { + if (!gizmo_plugins_by_name[i]->can_be_hidden()) continue; + const int plugin_state = gizmo_plugins_by_name[i]->get_state(); + const int idx = gizmos_menu->get_item_index(i); + switch (plugin_state) { + case EditorSpatialGizmoPlugin::VISIBLE: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_visible")); + break; + case EditorSpatialGizmoPlugin::ON_TOP: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_xray")); + break; + case EditorSpatialGizmoPlugin::HIDDEN: + gizmos_menu->set_item_icon(idx, gizmos_menu->get_icon("visibility_hidden")); + break; + } } } @@ -5223,8 +5232,8 @@ void SpatialEditor::_request_gizmo(Object *p_obj) { Ref<EditorSpatialGizmo> seg; - for (int i = 0; i < gizmo_plugins.size(); ++i) { - seg = gizmo_plugins.write[i]->get_gizmo(sp); + for (int i = 0; i < gizmo_plugins_by_priority.size(); ++i) { + seg = gizmo_plugins_by_priority.write[i]->get_gizmo(sp); if (seg.is_valid()) { sp->set_gizmo(seg); @@ -5749,15 +5758,39 @@ void SpatialEditorPlugin::snap_cursor_to_plane(const Plane &p_plane) { spatial_editor->snap_cursor_to_plane(p_plane); } +struct _GizmoPluginPriorityComparator { + + bool operator()(const Ref<EditorSpatialGizmoPlugin> &p_a, const Ref<EditorSpatialGizmoPlugin> &p_b) const { + if (p_a->get_priority() == p_b->get_priority()) { + return p_a->get_name() < p_b->get_name(); + } + return p_a->get_priority() > p_b->get_priority(); + } +}; + +struct _GizmoPluginNameComparator { + + bool operator()(const Ref<EditorSpatialGizmoPlugin> &p_a, const Ref<EditorSpatialGizmoPlugin> &p_b) const { + return p_a->get_name() < p_b->get_name(); + } +}; + void SpatialEditor::add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) { ERR_FAIL_NULL(p_plugin.ptr()); - gizmo_plugins.push_back(p_plugin); + + gizmo_plugins_by_priority.push_back(p_plugin); + gizmo_plugins_by_priority.sort_custom<_GizmoPluginPriorityComparator>(); + + gizmo_plugins_by_name.push_back(p_plugin); + gizmo_plugins_by_name.sort_custom<_GizmoPluginNameComparator>(); + _update_gizmos_menu(); SpatialEditor::get_singleton()->update_all_gizmos(); } void SpatialEditor::remove_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) { - gizmo_plugins.erase(p_plugin); + gizmo_plugins_by_priority.erase(p_plugin); + gizmo_plugins_by_name.erase(p_plugin); _update_gizmos_menu(); } @@ -5910,6 +5943,13 @@ String EditorSpatialGizmoPlugin::get_name() const { return TTR("Nameless gizmo"); } +int EditorSpatialGizmoPlugin::get_priority() const { + if (get_script_instance() && get_script_instance()->has_method("get_priority")) { + return get_script_instance()->call("get_priority"); + } + return 0; +} + Ref<EditorSpatialGizmo> EditorSpatialGizmoPlugin::get_gizmo(Spatial *p_spatial) { if (get_script_instance() && get_script_instance()->has_method("get_gizmo")) { @@ -5942,6 +5982,7 @@ void EditorSpatialGizmoPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("get_material", "name", "gizmo"), &EditorSpatialGizmoPlugin::get_material); //, DEFVAL(Ref<EditorSpatialGizmo>())); BIND_VMETHOD(MethodInfo(Variant::STRING, "get_name")); + BIND_VMETHOD(MethodInfo(Variant::STRING, "get_priority")); BIND_VMETHOD(MethodInfo(Variant::BOOL, "can_be_hidden")); BIND_VMETHOD(MethodInfo(Variant::BOOL, "is_selectable_when_hidden")); @@ -6041,6 +6082,10 @@ void EditorSpatialGizmoPlugin::set_state(int p_state) { } } +int EditorSpatialGizmoPlugin::get_state() const { + return current_state; +} + void EditorSpatialGizmoPlugin::unregister_gizmo(EditorSpatialGizmo *p_gizmo) { current_gizmos.erase(p_gizmo); } diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 6256b8b055..4a9d34a7f7 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -639,7 +639,8 @@ private: static SpatialEditor *singleton; void _node_removed(Node *p_node); - Vector<Ref<EditorSpatialGizmoPlugin> > gizmo_plugins; + Vector<Ref<EditorSpatialGizmoPlugin> > gizmo_plugins_by_priority; + Vector<Ref<EditorSpatialGizmoPlugin> > gizmo_plugins_by_name; void _register_all_gizmos(); @@ -782,6 +783,7 @@ public: Ref<SpatialMaterial> get_material(const String &p_name, const Ref<EditorSpatialGizmo> &p_gizmo = Ref<EditorSpatialGizmo>()); virtual String get_name() const; + virtual int get_priority() const; virtual bool can_be_hidden() const; virtual bool is_selectable_when_hidden() const; @@ -794,6 +796,7 @@ public: Ref<EditorSpatialGizmo> get_gizmo(Spatial *p_spatial); void set_state(int p_state); + int get_state() const; void unregister_gizmo(EditorSpatialGizmo *p_gizmo); EditorSpatialGizmoPlugin(); diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp index c1718dd8bf..3854d27567 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_editor_plugin.cpp @@ -91,6 +91,8 @@ Vector<Vector2> expand(const Vector<Vector2> &points, const Rect2i &rect, float Vector<Vector2> outPoints; ClipperLib::PolyNode *p2 = out.GetFirst(); + ERR_FAIL_COND_V(!p2, points); + while (p2->IsHole()) { p2 = p2->GetNext(); } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 0482ae86f3..0aa4a7662c 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -138,39 +138,33 @@ TextureEditor::TextureEditor() { set_custom_minimum_size(Size2(1, 150)); } -void TextureEditorPlugin::edit(Object *p_object) { - - Texture *s = Object::cast_to<Texture>(p_object); - if (!s) - return; - - texture_editor->edit(Ref<Texture>(s)); +TextureEditor::~TextureEditor() { + if (!texture.is_null()) { + texture->remove_change_receptor(this); + } } +// +bool EditorInspectorPluginTexture::can_handle(Object *p_object) { -bool TextureEditorPlugin::handles(Object *p_object) const { - - return p_object->is_class("Texture"); + return Object::cast_to<ImageTexture>(p_object) != NULL || Object::cast_to<AtlasTexture>(p_object) != NULL || Object::cast_to<StreamTexture>(p_object) != NULL || Object::cast_to<LargeTexture>(p_object) != NULL || Object::cast_to<AnimatedTexture>(p_object) != NULL; } -void TextureEditorPlugin::make_visible(bool p_visible) { +void EditorInspectorPluginTexture::parse_begin(Object *p_object) { - if (p_visible) { - texture_editor->show(); - //texture_editor->set_process(true); - } else { - - texture_editor->hide(); - //texture_editor->set_process(false); + Texture *texture = Object::cast_to<Texture>(p_object); + if (!texture) { + return; } + Ref<Texture> m(texture); + + TextureEditor *editor = memnew(TextureEditor); + editor->edit(m); + add_custom_control(editor); } TextureEditorPlugin::TextureEditorPlugin(EditorNode *p_node) { - editor = p_node; - texture_editor = memnew(TextureEditor); - add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM, texture_editor); - texture_editor->hide(); -} - -TextureEditorPlugin::~TextureEditorPlugin() { + Ref<EditorInspectorPluginTexture> plugin; + plugin.instance(); + add_inspector_plugin(plugin); } diff --git a/editor/plugins/texture_editor_plugin.h b/editor/plugins/texture_editor_plugin.h index 80ff4d6416..bcbda1fbd7 100644 --- a/editor/plugins/texture_editor_plugin.h +++ b/editor/plugins/texture_editor_plugin.h @@ -50,24 +50,24 @@ protected: public: void edit(Ref<Texture> p_texture); TextureEditor(); + ~TextureEditor(); +}; + +class EditorInspectorPluginTexture : public EditorInspectorPlugin { + GDCLASS(EditorInspectorPluginTexture, EditorInspectorPlugin) +public: + virtual bool can_handle(Object *p_object); + virtual void parse_begin(Object *p_object); }; class TextureEditorPlugin : public EditorPlugin { GDCLASS(TextureEditorPlugin, EditorPlugin); - TextureEditor *texture_editor; - EditorNode *editor; - public: virtual String get_name() const { return "Texture"; } - bool has_main_screen() const { return false; } - virtual void edit(Object *p_object); - virtual bool handles(Object *p_object) const; - virtual void make_visible(bool p_visible); TextureEditorPlugin(EditorNode *p_node); - ~TextureEditorPlugin(); }; #endif // TEXTURE_EDITOR_PLUGIN_H diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 5b34aaa92a..dc099b84a7 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -201,6 +201,7 @@ void TileSetEditor::_bind_methods() { ClassDB::bind_method("_zoom_out", &TileSetEditor::_zoom_out); ClassDB::bind_method("_zoom_reset", &TileSetEditor::_zoom_reset); ClassDB::bind_method("_select_edited_shape_coord", &TileSetEditor::_select_edited_shape_coord); + ClassDB::bind_method("_sort_tiles", &TileSetEditor::_sort_tiles); ClassDB::bind_method("edit", &TileSetEditor::edit); ClassDB::bind_method("add_texture", &TileSetEditor::add_texture); @@ -234,6 +235,8 @@ void TileSetEditor::_notification(int p_what) { tools[BITMASK_CLEAR]->set_icon(get_icon("Clear", "EditorIcons")); tools[SHAPE_NEW_POLYGON]->set_icon(get_icon("CollisionPolygon2D", "EditorIcons")); tools[SHAPE_NEW_RECTANGLE]->set_icon(get_icon("CollisionShape2D", "EditorIcons")); + tools[SELECT_PREVIOUS]->set_icon(get_icon("ArrowLeft", "EditorIcons")); + tools[SELECT_NEXT]->set_icon(get_icon("ArrowRight", "EditorIcons")); tools[SHAPE_DELETE]->set_icon(get_icon("Remove", "EditorIcons")); tools[SHAPE_KEEP_INSIDE_TILE]->set_icon(get_icon("Snap", "EditorIcons")); tools[TOOL_GRID_SNAP]->set_icon(get_icon("SnapGrid", "EditorIcons")); @@ -241,6 +244,7 @@ void TileSetEditor::_notification(int p_what) { tools[ZOOM_1]->set_icon(get_icon("ZoomReset", "EditorIcons")); tools[ZOOM_IN]->set_icon(get_icon("ZoomMore", "EditorIcons")); tools[VISIBLE_INFO]->set_icon(get_icon("InformationSign", "EditorIcons")); + _update_toggle_shape_button(); tool_editmode[EDITMODE_REGION]->set_icon(get_icon("RegionEdit", "EditorIcons")); tool_editmode[EDITMODE_COLLISION]->set_icon(get_icon("StaticBody2D", "EditorIcons")); @@ -324,11 +328,29 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tool_workspacemode[i]->connect("pressed", this, "_on_workspace_mode_changed", varray(i)); tool_hb->add_child(tool_workspacemode[i]); } + Control *spacer = memnew(Control); spacer->set_h_size_flags(Control::SIZE_EXPAND_FILL); tool_hb->add_child(spacer); tool_hb->move_child(spacer, WORKSPACE_CREATE_SINGLE); + tools[SELECT_NEXT] = memnew(ToolButton); + tool_hb->add_child(tools[SELECT_NEXT]); + tool_hb->move_child(tools[SELECT_NEXT], WORKSPACE_CREATE_SINGLE); + tools[SELECT_NEXT]->set_shortcut(ED_SHORTCUT("tileset_editor/next_shape", TTR("Next Coordinate"), KEY_PAGEDOWN)); + tools[SELECT_NEXT]->connect("pressed", this, "_on_tool_clicked", varray(SELECT_NEXT)); + tools[SELECT_NEXT]->set_tooltip(TTR("Select the next shape, subtile, or Tile.")); + tools[SELECT_PREVIOUS] = memnew(ToolButton); + tool_hb->add_child(tools[SELECT_PREVIOUS]); + tool_hb->move_child(tools[SELECT_PREVIOUS], WORKSPACE_CREATE_SINGLE); + tools[SELECT_PREVIOUS]->set_shortcut(ED_SHORTCUT("tileset_editor/previous_shape", TTR("Previous Coordinate"), KEY_PAGEUP)); + tools[SELECT_PREVIOUS]->set_tooltip(TTR("Select the previous shape, subtile, or Tile.")); + tools[SELECT_PREVIOUS]->connect("pressed", this, "_on_tool_clicked", varray(SELECT_PREVIOUS)); + + VSeparator *separator_shape_selection = memnew(VSeparator); + tool_hb->add_child(separator_shape_selection); + tool_hb->move_child(separator_shape_selection, WORKSPACE_CREATE_SINGLE); + tool_workspacemode[WORKSPACE_EDIT]->set_pressed(true); workspace_mode = WORKSPACE_EDIT; @@ -391,6 +413,12 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tools[SHAPE_NEW_POLYGON]->set_button_group(tg); tools[SHAPE_NEW_POLYGON]->set_tooltip(TTR("Create a new polygon.")); + separator_shape_toggle = memnew(VSeparator); + toolbar->add_child(separator_shape_toggle); + tools[SHAPE_TOGGLE_TYPE] = memnew(ToolButton); + tools[SHAPE_TOGGLE_TYPE]->connect("pressed", this, "_on_tool_clicked", varray(SHAPE_TOGGLE_TYPE)); + toolbar->add_child(tools[SHAPE_TOGGLE_TYPE]); + separator_delete = memnew(VSeparator); toolbar->add_child(separator_delete); tools[SHAPE_DELETE] = memnew(ToolButton); @@ -744,6 +772,7 @@ void TileSetEditor::_on_edit_mode_changed(int p_edit_mode) { } break; default: {} } + _update_toggle_shape_button(); workspace->update(); } @@ -1375,8 +1404,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { } undo_redo->create_action(TTR("Edit Collision Polygon")); - undo_redo->add_do_method(edited_collision_shape.ptr(), "set_points", points); - undo_redo->add_undo_method(edited_collision_shape.ptr(), "set_points", edited_collision_shape->get_points()); + _set_edited_shape_points(points); undo_redo->add_do_method(this, "_select_edited_shape_coord"); undo_redo->add_undo_method(this, "_select_edited_shape_coord"); undo_redo->commit_action(); @@ -1454,7 +1482,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { workspace->update(); } else { creating_shape = true; - edited_collision_shape = Ref<ConvexPolygonShape2D>(); + _set_edited_collision_shape(Ref<ConvexPolygonShape2D>()); current_shape.resize(0); current_shape.push_back(snap_point(pos)); workspace->update(); @@ -1474,7 +1502,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { } else if (tools[SHAPE_NEW_RECTANGLE]->is_pressed()) { if (mb.is_valid()) { if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { - edited_collision_shape = Ref<ConvexPolygonShape2D>(); + _set_edited_collision_shape(Ref<ConvexPolygonShape2D>()); current_shape.resize(0); current_shape.push_back(snap_point(shape_anchor)); current_shape.push_back(snap_point(shape_anchor + Vector2(current_tile_region.size.x, 0))); @@ -1519,6 +1547,49 @@ void TileSetEditor::_on_tool_clicked(int p_tool) { undo_redo->add_do_method(workspace, "update"); undo_redo->add_undo_method(workspace, "update"); undo_redo->commit_action(); + } else if (p_tool == SHAPE_TOGGLE_TYPE) { + if (edited_collision_shape.is_valid()) { + Ref<ConvexPolygonShape2D> convex = edited_collision_shape; + Ref<ConcavePolygonShape2D> concave = edited_collision_shape; + Ref<Shape2D> previous_shape = edited_collision_shape; + Array sd = tileset->call("tile_get_shapes", get_current_tile()); + + if (convex.is_valid()) { + // Make concave + undo_redo->create_action(TTR("Make Polygon Concave")); + Ref<ConcavePolygonShape2D> _concave = memnew(ConcavePolygonShape2D); + edited_collision_shape = _concave; + _set_edited_shape_points(_get_collision_shape_points(convex)); + } else if (concave.is_valid()) { + // Make convex + undo_redo->create_action(TTR("Make Polygon Convex")); + Ref<ConvexPolygonShape2D> _convex = memnew(ConvexPolygonShape2D); + edited_collision_shape = _convex; + _set_edited_shape_points(_get_collision_shape_points(concave)); + } else { + // Shoudn't haphen + } + for (int i = 0; i < sd.size(); i++) { + if (sd[i].get("shape") == previous_shape) { + undo_redo->add_undo_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd.duplicate()); + sd.remove(i); + sd.insert(i, edited_collision_shape); + undo_redo->add_do_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd); + undo_redo->add_do_method(this, "_select_edited_shape_coord"); + undo_redo->add_undo_method(this, "_select_edited_shape_coord"); + undo_redo->commit_action(); + break; + } + } + _update_toggle_shape_button(); + workspace->update(); + workspace_container->update(); + helper->_change_notify(""); + } + } else if (p_tool == SELECT_NEXT) { + _select_next_shape(); + } else if (p_tool == SELECT_PREVIOUS) { + _select_previous_shape(); } else if (p_tool == SHAPE_DELETE) { if (creating_shape) { creating_shape = false; @@ -1641,6 +1712,378 @@ void TileSetEditor::_on_grid_snap_toggled(bool p_val) { workspace->update(); } +Vector<Vector2> TileSetEditor::_get_collision_shape_points(const Ref<Shape2D> &p_shape) { + Ref<ConvexPolygonShape2D> convex = p_shape; + Ref<ConcavePolygonShape2D> concave = p_shape; + if (convex.is_valid()) { + return convex->get_points(); + } else if (concave.is_valid()) { + Vector<Vector2> points; + for (int i = 0; i < concave->get_segments().size(); i += 2) { + points.push_back(concave->get_segments()[i]); + } + return points; + } else { + return Vector<Vector2>(); + } +} + +Vector<Vector2> TileSetEditor::_get_edited_shape_points() { + return _get_collision_shape_points(edited_collision_shape); +} + +void TileSetEditor::_set_edited_shape_points(const Vector<Vector2> points) { + Ref<ConvexPolygonShape2D> convex = edited_collision_shape; + Ref<ConcavePolygonShape2D> concave = edited_collision_shape; + if (convex.is_valid()) { + undo_redo->add_do_method(convex.ptr(), "set_points", points); + undo_redo->add_undo_method(convex.ptr(), "set_points", _get_edited_shape_points()); + } else if (concave.is_valid()) { + PoolVector2Array segments; + for (int i = 0; i < points.size() - 1; i++) { + segments.push_back(points[i]); + segments.push_back(points[i + 1]); + } + segments.push_back(points[points.size() - 1]); + segments.push_back(points[0]); + concave->set_segments(segments); + undo_redo->add_do_method(concave.ptr(), "set_segments", segments); + undo_redo->add_undo_method(concave.ptr(), "set_segments", concave->get_segments()); + } else { + // Invalid shape + } +} + +void TileSetEditor::_update_tile_data() { + current_tile_data.clear(); + if (get_current_tile() < 0) + return; + + Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(get_current_tile()); + if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) { + SubtileData data; + for (int i = 0; i < sd.size(); i++) { + data.collisions.push_back(sd[i].shape); + } + data.navigation_shape = tileset->tile_get_navigation_polygon(get_current_tile()); + data.occlusion_shape = tileset->tile_get_light_occluder(get_current_tile()); + current_tile_data[Vector2i()] = data; + } else { + int spacing = tileset->autotile_get_spacing(get_current_tile()); + Vector2 size = tileset->tile_get_region(get_current_tile()).size; + Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + for (int y = 0; y < cell_count.y; y++) { + for (int x = 0; x < cell_count.x; x++) { + SubtileData data; + Vector2i coord(x, y); + for (int i = 0; i < sd.size(); i++) { + if (sd[i].autotile_coord == coord) { + data.collisions.push_back(sd[i].shape); + } + } + data.navigation_shape = tileset->autotile_get_navigation_polygon(get_current_tile(), coord); + data.occlusion_shape = tileset->tile_get_light_occluder(get_current_tile()); + current_tile_data[coord] = data; + } + } + } +} + +void TileSetEditor::_update_toggle_shape_button() { + Ref<ConvexPolygonShape2D> convex = edited_collision_shape; + Ref<ConcavePolygonShape2D> concave = edited_collision_shape; + separator_shape_toggle->show(); + tools[SHAPE_TOGGLE_TYPE]->show(); + if (edit_mode != EDITMODE_COLLISION || !edited_collision_shape.is_valid()) { + separator_shape_toggle->hide(); + tools[SHAPE_TOGGLE_TYPE]->hide(); + } else if (concave.is_valid()) { + tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConvexPolygonShape2D", "EditorIcons")); + tools[SHAPE_TOGGLE_TYPE]->set_text("Make Convex"); + } else if (convex.is_valid()) { + tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConcavePolygonShape2D", "EditorIcons")); + tools[SHAPE_TOGGLE_TYPE]->set_text("Make Concave"); + } else { + // Shoudn't happen + separator_shape_toggle->hide(); + tools[SHAPE_TOGGLE_TYPE]->hide(); + } +} + +void TileSetEditor::_select_next_tile() { + Array tiles = _get_tiles_in_current_texture(true); + if (tiles.size() == 0) { + set_current_tile(-1); + } else if (get_current_tile() == -1) { + set_current_tile(tiles[0]); + } else { + int index = tiles.find(get_current_tile()); + if (index < 0) { + set_current_tile(tiles[0]); + } else if (index == tiles.size() - 1) { + set_current_tile(tiles[0]); + } else { + set_current_tile(tiles[index + 1]); + } + } + if (get_current_tile() == -1) { + return; + } else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) { + return; + } else { + switch (edit_mode) { + case EDITMODE_COLLISION: + case EDITMODE_OCCLUSION: + case EDITMODE_NAVIGATION: + case EDITMODE_PRIORITY: + case EDITMODE_Z_INDEX: { + edited_shape_coord = Vector2(); + _select_edited_shape_coord(); + } break; + default: {} + } + } +} + +void TileSetEditor::_select_previous_tile() { + Array tiles = _get_tiles_in_current_texture(true); + if (tiles.size() == 0) { + set_current_tile(-1); + } else if (get_current_tile() == -1) { + set_current_tile(tiles[tiles.size() - 1]); + } else { + int index = tiles.find(get_current_tile()); + if (index <= 0) { + set_current_tile(tiles[tiles.size() - 1]); + } else { + set_current_tile(tiles[index - 1]); + } + } + if (get_current_tile() == -1) { + return; + } else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) { + return; + } else { + switch (edit_mode) { + case EDITMODE_COLLISION: + case EDITMODE_OCCLUSION: + case EDITMODE_NAVIGATION: + case EDITMODE_PRIORITY: + case EDITMODE_Z_INDEX: { + int spacing = tileset->autotile_get_spacing(get_current_tile()); + Vector2 size = tileset->tile_get_region(get_current_tile()).size; + Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + cell_count -= Vector2(1, 1); + edited_shape_coord = cell_count; + _select_edited_shape_coord(); + } break; + default: {} + } + } +} + +Array TileSetEditor::_get_tiles_in_current_texture(bool sorted) { + Array a; + List<int> all_tiles; + if (!get_current_texture().is_valid()) { + return a; + } + tileset->get_tile_list(&all_tiles); + for (int i = 0; i < all_tiles.size(); i++) { + if (tileset->tile_get_texture(all_tiles[i]) == get_current_texture()) { + a.push_back(all_tiles[i]); + } + } + if (sorted) { + a.sort_custom(this, "_sort_tiles"); + } + return a; +} + +bool TileSetEditor::_sort_tiles(Variant p_a, Variant p_b) { + int a = p_a; + int b = p_b; + + Vector2 pos_a = tileset->tile_get_region(a).position; + Vector2 pos_b = tileset->tile_get_region(b).position; + if (pos_a.y < pos_b.y) { + return true; + + } else if (pos_a.y == pos_b.y) { + if (pos_a.x < pos_b.x) { + return true; + } else { + return false; + } + } else { + return false; + } +} + +void TileSetEditor::_select_next_subtile() { + if (get_current_tile() == -1) { + _select_next_tile(); + return; + } + if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) { + _select_next_tile(); + } else if (edit_mode == EDITMODE_REGION || edit_mode == EDITMODE_BITMASK || edit_mode == EDITMODE_ICON) { + _select_next_tile(); + } else { + int spacing = tileset->autotile_get_spacing(get_current_tile()); + Vector2 size = tileset->tile_get_region(get_current_tile()).size; + Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + if (edited_shape_coord.x >= cell_count.x - 1 && edited_shape_coord.y >= cell_count.y - 1) { + _select_next_tile(); + } else { + edited_shape_coord.x++; + if (edited_shape_coord.x >= cell_count.x) { + edited_shape_coord.x = 0; + edited_shape_coord.y++; + } + _select_edited_shape_coord(); + } + } +} + +void TileSetEditor::_select_previous_subtile() { + if (get_current_tile() == -1) { + _select_previous_tile(); + return; + } + if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) { + _select_previous_tile(); + } else if (edit_mode == EDITMODE_REGION || edit_mode == EDITMODE_BITMASK || edit_mode == EDITMODE_ICON) { + _select_previous_tile(); + } else { + int spacing = tileset->autotile_get_spacing(get_current_tile()); + Vector2 size = tileset->tile_get_region(get_current_tile()).size; + Vector2i cell_count = size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing)); + if (edited_shape_coord.x <= 0 && edited_shape_coord.y <= 0) { + _select_previous_tile(); + } else { + edited_shape_coord.x--; + if (edited_shape_coord.x == -1) { + edited_shape_coord.x = cell_count.x - 1; + edited_shape_coord.y--; + } + _select_edited_shape_coord(); + } + } +} + +void TileSetEditor::_select_next_shape() { + if (get_current_tile() == -1) { + _select_next_subtile(); + } else if (edit_mode != EDITMODE_COLLISION) { + _select_next_subtile(); + } else { + Vector2i edited_coord = Vector2(); + if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) { + edited_coord = edited_shape_coord; + } + SubtileData data = current_tile_data[edited_coord]; + if (data.collisions.size() == 0) { + _select_next_subtile(); + } else { + int index = data.collisions.find(edited_collision_shape); + if (index < 0) { + _set_edited_collision_shape(data.collisions[0]); + } else if (index == data.collisions.size() - 1) { + _select_next_subtile(); + } else { + _set_edited_collision_shape(data.collisions[index + 1]); + } + } + current_shape.resize(0); + Rect2 current_tile_region = tileset->tile_get_region(get_current_tile()); + current_tile_region.position += WORKSPACE_MARGIN; + + int spacing = tileset->autotile_get_spacing(get_current_tile()); + Vector2 size = tileset->autotile_get_size(get_current_tile()); + Vector2 shape_anchor = edited_shape_coord; + shape_anchor.x *= (size.x + spacing); + shape_anchor.y *= (size.y + spacing); + current_tile_region.position += shape_anchor; + + if (edited_collision_shape.is_valid()) { + for (int i = 0; i < _get_edited_shape_points().size(); i++) { + current_shape.push_back(_get_edited_shape_points()[i] + current_tile_region.position); + } + } + workspace->update(); + workspace_container->update(); + helper->_change_notify(""); + } +} + +void TileSetEditor::_select_previous_shape() { + if (get_current_tile() == -1) { + _select_previous_subtile(); + if (get_current_tile() != -1 && edit_mode == EDITMODE_COLLISION) { + SubtileData data = current_tile_data[Vector2i(edited_shape_coord)]; + if (data.collisions.size() > 1) { + _set_edited_collision_shape(data.collisions[data.collisions.size() - 1]); + } + } else { + return; + } + } else if (edit_mode != EDITMODE_COLLISION) { + _select_previous_subtile(); + } else { + Vector2i edited_coord = Vector2(); + if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) { + edited_coord = edited_shape_coord; + } + SubtileData data = current_tile_data[edited_coord]; + if (data.collisions.size() == 0) { + _select_previous_subtile(); + data = current_tile_data[Vector2i(edited_shape_coord)]; + if (data.collisions.size() > 1) { + _set_edited_collision_shape(data.collisions[data.collisions.size() - 1]); + } + } else { + int index = data.collisions.find(edited_collision_shape); + if (index < 0) { + _set_edited_collision_shape(data.collisions[data.collisions.size() - 1]); + } else if (index == 0) { + _select_previous_subtile(); + data = current_tile_data[Vector2i(edited_shape_coord)]; + if (data.collisions.size() > 1) { + _set_edited_collision_shape(data.collisions[data.collisions.size() - 1]); + } + } else { + _set_edited_collision_shape(data.collisions[index - 1]); + } + } + + current_shape.resize(0); + Rect2 current_tile_region = tileset->tile_get_region(get_current_tile()); + current_tile_region.position += WORKSPACE_MARGIN; + + int spacing = tileset->autotile_get_spacing(get_current_tile()); + Vector2 size = tileset->autotile_get_size(get_current_tile()); + Vector2 shape_anchor = edited_shape_coord; + shape_anchor.x *= (size.x + spacing); + shape_anchor.y *= (size.y + spacing); + current_tile_region.position += shape_anchor; + + if (edited_collision_shape.is_valid()) { + for (int i = 0; i < _get_edited_shape_points().size(); i++) { + current_shape.push_back(_get_edited_shape_points()[i] + current_tile_region.position); + } + } + workspace->update(); + workspace_container->update(); + helper->_change_notify(""); + } +} + +void TileSetEditor::_set_edited_collision_shape(const Ref<Shape2D> &p_shape) { + edited_collision_shape = p_shape; + _update_toggle_shape_button(); +} + void TileSetEditor::_set_snap_step(Vector2 p_val) { snap_step.x = CLAMP(p_val.x, 0, 256); snap_step.y = CLAMP(p_val.y, 0, 256); @@ -1937,16 +2380,29 @@ void TileSetEditor::draw_polygon_shapes() { } anchor += WORKSPACE_MARGIN; anchor += tileset->tile_get_region(t_id).position; - Ref<ConvexPolygonShape2D> shape = sd[i].shape; + Ref<Shape2D> shape = sd[i].shape; if (shape.is_valid()) { Color c_bg; Color c_border; + Ref<ConvexPolygonShape2D> convex = shape; + bool is_convex = convex.is_valid(); if ((tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE || coord == edited_shape_coord) && sd[i].shape == edited_collision_shape) { - c_bg = Color(0, 1, 1, 0.5); - c_border = Color(0, 1, 1); + if (is_convex) { + c_bg = Color(0, 1, 1, 0.5); + c_border = Color(0, 1, 1); + } else { + c_bg = Color(0.8, 0, 1, 0.5); + c_border = Color(0.8, 0, 1); + } } else { - c_bg = Color(0.9, 0.7, 0.07, 0.5); - c_border = Color(0.9, 0.7, 0.07, 1); + if (is_convex) { + c_bg = Color(0.9, 0.7, 0.07, 0.5); + c_border = Color(0.9, 0.7, 0.07, 1); + + } else { + c_bg = Color(0.9, 0.45, 0.075, 0.5); + c_border = Color(0.9, 0.45, 0.075); + } } Vector<Vector2> polygon; Vector<Color> colors; @@ -1956,8 +2412,8 @@ void TileSetEditor::draw_polygon_shapes() { colors.push_back(c_bg); } } else { - for (int j = 0; j < shape->get_points().size(); j++) { - polygon.push_back(shape->get_points()[j] + anchor); + for (int j = 0; j < _get_collision_shape_points(shape).size(); j++) { + polygon.push_back(_get_collision_shape_points(shape)[j] + anchor); colors.push_back(c_bg); } } @@ -2004,10 +2460,12 @@ void TileSetEditor::draw_polygon_shapes() { workspace->draw_polygon(polygon, colors); if (!creating_shape) { - for (int j = 0; j < polygon.size() - 1; j++) { - workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true); + if (polygon.size() > 1) { + for (int j = 0; j < polygon.size() - 1; j++) { + workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true); + } + workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true); } - workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true); } if (shape == edited_occlusion_shape) { draw_handles = true; @@ -2174,11 +2632,11 @@ void TileSetEditor::close_shape(const Vector2 &shape_anchor) { if (current_shape.size() >= 3) { Ref<ConvexPolygonShape2D> shape = memnew(ConvexPolygonShape2D); - Vector<Vector2> segments; + Vector<Vector2> points; float p_total = 0; for (int i = 0; i < current_shape.size(); i++) { - segments.push_back(current_shape[i] - shape_anchor); + points.push_back(current_shape[i] - shape_anchor); if (i != current_shape.size() - 1) p_total += ((current_shape[i + 1].x - current_shape[i].x) * (-current_shape[i + 1].y + (-current_shape[i].y))); @@ -2187,9 +2645,9 @@ void TileSetEditor::close_shape(const Vector2 &shape_anchor) { } if (p_total < 0) - segments.invert(); + points.invert(); - shape->set_points(segments); + shape->set_points(points); undo_redo->create_action(TTR("Create Collision Polygon")); // Necessary to get the version that returns a Array instead of a Vector. @@ -2274,6 +2732,7 @@ void TileSetEditor::close_shape(const Vector2 &shape_anchor) { } void TileSetEditor::select_coord(const Vector2 &coord) { + _update_tile_data(); current_shape = PoolVector2Array(); if (get_current_tile() == -1) return; @@ -2281,7 +2740,7 @@ void TileSetEditor::select_coord(const Vector2 &coord) { current_tile_region.position += WORKSPACE_MARGIN; if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) { if (edited_collision_shape != tileset->tile_get_shape(get_current_tile(), 0)) - edited_collision_shape = tileset->tile_get_shape(get_current_tile(), 0); + _set_edited_collision_shape(tileset->tile_get_shape(get_current_tile(), 0)); if (edited_occlusion_shape != tileset->tile_get_light_occluder(get_current_tile())) edited_occlusion_shape = tileset->tile_get_light_occluder(get_current_tile()); if (edited_navigation_shape != tileset->tile_get_navigation_polygon(get_current_tile())) @@ -2290,8 +2749,8 @@ void TileSetEditor::select_coord(const Vector2 &coord) { if (edit_mode == EDITMODE_COLLISION) { current_shape.resize(0); if (edited_collision_shape.is_valid()) { - for (int i = 0; i < edited_collision_shape->get_points().size(); i++) { - current_shape.push_back(edited_collision_shape->get_points()[i] + current_tile_region.position); + for (int i = 0; i < _get_edited_shape_points().size(); i++) { + current_shape.push_back(_get_edited_shape_points()[i] + current_tile_region.position); } } } else if (edit_mode == EDITMODE_OCCLUSION) { @@ -2318,13 +2777,13 @@ void TileSetEditor::select_coord(const Vector2 &coord) { for (int i = 0; i < sd.size(); i++) { if (sd[i].autotile_coord == coord) { if (edited_collision_shape != sd[i].shape) - edited_collision_shape = sd[i].shape; + _set_edited_collision_shape(sd[i].shape); found_collision_shape = true; break; } } if (!found_collision_shape) - edited_collision_shape = Ref<ConvexPolygonShape2D>(NULL); + _set_edited_collision_shape(Ref<ConvexPolygonShape2D>(NULL)); if (edited_occlusion_shape != tileset->autotile_get_light_occluder(get_current_tile(), coord)) edited_occlusion_shape = tileset->autotile_get_light_occluder(get_current_tile(), coord); if (edited_navigation_shape != tileset->autotile_get_navigation_polygon(get_current_tile(), coord)) @@ -2339,8 +2798,8 @@ void TileSetEditor::select_coord(const Vector2 &coord) { if (edit_mode == EDITMODE_COLLISION) { current_shape.resize(0); if (edited_collision_shape.is_valid()) { - for (int j = 0; j < edited_collision_shape->get_points().size(); j++) { - current_shape.push_back(edited_collision_shape->get_points()[j] + shape_anchor); + for (int j = 0; j < _get_edited_shape_points().size(); j++) { + current_shape.push_back(_get_edited_shape_points()[j] + shape_anchor); } } } else if (edit_mode == EDITMODE_OCCLUSION) { @@ -2461,7 +2920,8 @@ void TileSetEditor::update_texture_list_icon() { for (int current_idx = 0; current_idx < texture_list->get_item_count(); current_idx++) { RID rid = texture_list->get_item_metadata(current_idx); texture_list->set_item_icon(current_idx, texture_map[rid]); - texture_list->set_item_icon_region(current_idx, Rect2(0, 0, 150, 100)); + Size2 texture_size = texture_map[rid]->get_size(); + texture_list->set_item_icon_region(current_idx, Rect2(0, 0, MIN(texture_size.x, 150), MIN(texture_size.y, 100))); } texture_list->update(); } @@ -2474,10 +2934,14 @@ void TileSetEditor::update_workspace_tile_mode() { for (int i = 1; i < WORKSPACE_MODE_MAX; i++) { tool_workspacemode[i]->set_disabled(true); } + tools[SELECT_NEXT]->set_disabled(true); + tools[SELECT_PREVIOUS]->set_disabled(true); } else { for (int i = 1; i < WORKSPACE_MODE_MAX; i++) { tool_workspacemode[i]->set_disabled(false); } + tools[SELECT_NEXT]->set_disabled(false); + tools[SELECT_PREVIOUS]->set_disabled(false); } if (workspace_mode != WORKSPACE_EDIT) { @@ -2495,7 +2959,7 @@ void TileSetEditor::update_workspace_tile_mode() { for (int i = 0; i < EDITMODE_MAX; i++) { tool_editmode[i]->hide(); } - for (int i = 0; i < ZOOM_OUT; i++) { + for (int i = TOOL_SELECT; i < ZOOM_OUT; i++) { tools[i]->hide(); } @@ -2661,6 +3125,24 @@ bool TilesetEditorContext::_set(const StringName &p_name, const Variant &p_value } else if (name == "tileset_script") { tileset->set_script(p_value); return true; + } else if (name == "selected_collision_one_way") { + Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile()); + for (int index = 0; index < sd.size(); index++) { + if (sd[index].shape == tileset_editor->edited_collision_shape) { + tileset->tile_set_shape_one_way(tileset_editor->get_current_tile(), index, p_value); + return true; + } + } + return false; + } else if (name == "selected_collision_one_way_margin") { + Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile()); + for (int index = 0; index < sd.size(); index++) { + if (sd[index].shape == tileset_editor->edited_collision_shape) { + tileset->tile_set_shape_one_way_margin(tileset_editor->get_current_tile(), index, p_value); + return true; + } + } + return false; } tileset_editor->err_dialog->set_text(TTR("This property can't be changed.")); @@ -2703,6 +3185,24 @@ bool TilesetEditorContext::_get(const StringName &p_name, Variant &r_ret) const } else if (name == "selected_collision") { r_ret = tileset_editor->edited_collision_shape; v = true; + } else if (name == "selected_collision_one_way") { + Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile()); + for (int index = 0; index < sd.size(); index++) { + if (sd[index].shape == tileset_editor->edited_collision_shape) { + r_ret = sd[index].one_way_collision; + v = true; + break; + } + } + } else if (name == "selected_collision_one_way_margin") { + Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile()); + for (int index = 0; index < sd.size(); index++) { + if (sd[index].shape == tileset_editor->edited_collision_shape) { + r_ret = sd[index].one_way_collision_margin; + v = true; + break; + } + } } else if (name == "selected_navigation") { r_ret = tileset_editor->edited_navigation_shape; v = true; @@ -2749,6 +3249,10 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const } if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_COLLISION && tileset_editor->edited_collision_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class())); + if (tileset_editor->edited_collision_shape.is_valid()) { + p_list->push_back(PropertyInfo(Variant::BOOL, "selected_collision_one_way", PROPERTY_HINT_NONE)); + p_list->push_back(PropertyInfo(Variant::REAL, "selected_collision_one_way_margin", PROPERTY_HINT_NONE)); + } } if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_NAVIGATION && tileset_editor->edited_navigation_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_navigation", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_navigation_shape->get_class())); diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index 9c4aa80dcb..2827964592 100644 --- a/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -34,6 +34,7 @@ #include "editor/editor_name_dialog.h" #include "editor/editor_node.h" #include "scene/2d/sprite.h" +#include "scene/resources/concave_polygon_shape_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" #include "scene/resources/tile_set.h" @@ -76,12 +77,15 @@ class TileSetEditor : public HSplitContainer { }; enum TileSetTools { + SELECT_PREVIOUS, + SELECT_NEXT, TOOL_SELECT, BITMASK_COPY, BITMASK_PASTE, BITMASK_CLEAR, SHAPE_NEW_POLYGON, SHAPE_NEW_RECTANGLE, + SHAPE_TOGGLE_TYPE, SHAPE_DELETE, SHAPE_KEEP_INSIDE_TILE, TOOL_GRID_SNAP, @@ -92,6 +96,12 @@ class TileSetEditor : public HSplitContainer { TOOL_MAX }; + struct SubtileData { + Array collisions; + Ref<OccluderPolygon2D> occlusion_shape; + Ref<NavigationPolygon> navigation_shape; + }; + Ref<TileSet> tileset; TilesetEditorContext *helper; EditorNode *editor; @@ -115,13 +125,14 @@ class TileSetEditor : public HSplitContainer { bool draw_edited_region; Vector2 edited_shape_coord; PoolVector2Array current_shape; + Map<Vector2i, SubtileData> current_tile_data; Map<Vector2, uint16_t> bitmask_map_copy; Vector2 snap_step; Vector2 snap_offset; Vector2 snap_separation; - Ref<ConvexPolygonShape2D> edited_collision_shape; + Ref<Shape2D> edited_collision_shape; Ref<OccluderPolygon2D> edited_occlusion_shape; Ref<NavigationPolygon> edited_navigation_shape; @@ -137,6 +148,7 @@ class TileSetEditor : public HSplitContainer { HSeparator *separator_editmode; HBoxContainer *toolbar; ToolButton *tools[TOOL_MAX]; + VSeparator *separator_shape_toggle; VSeparator *separator_bitmask; VSeparator *separator_delete; VSeparator *separator_grid; @@ -188,6 +200,20 @@ private: void _on_priority_changed(float val); void _on_z_index_changed(float val); void _on_grid_snap_toggled(bool p_val); + Vector<Vector2> _get_collision_shape_points(const Ref<Shape2D> &p_shape); + Vector<Vector2> _get_edited_shape_points(); + void _set_edited_shape_points(const Vector<Vector2> points); + void _update_tile_data(); + void _update_toggle_shape_button(); + void _select_next_tile(); + void _select_previous_tile(); + Array _get_tiles_in_current_texture(bool sorted = false); + bool _sort_tiles(Variant p_a, Variant p_b); + void _select_next_subtile(); + void _select_previous_subtile(); + void _select_next_shape(); + void _select_previous_shape(); + void _set_edited_collision_shape(const Ref<Shape2D> &p_shape); void _set_snap_step(Vector2 p_val); void _set_snap_off(Vector2 p_val); void _set_snap_sep(Vector2 p_val); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 831ebde3a6..82a6a07805 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -1012,7 +1012,11 @@ void ProjectExportDialog::_export_all(bool p_debug) { Error err = platform->export_project(preset, p_debug, preset->get_export_path(), 0); if (err != OK) { - error_dialog->set_text(TTR("Export templates for this platform are missing/corrupted:") + " " + platform->get_name()); + if (err == ERR_FILE_BAD_PATH) { + error_dialog->set_text(TTR("The given export path doesn't exist:") + "\n" + preset->get_export_path().get_base_dir()); + } else { + error_dialog->set_text(TTR("Export templates for this platform are missing/corrupted:") + " " + platform->get_name()); + } error_dialog->show(); error_dialog->popup_centered_minsize(Size2(300, 80)); ERR_PRINT("Failed to export project"); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index d931d5bb37..66163d7e0a 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -336,9 +336,13 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_ATTACH_SCRIPT: { + List<Node *> selection = editor_selection->get_selected_node_list(); + if (selection.empty()) + break; + Node *selected = scene_tree->get_selected(); if (!selected) - break; + selected = selection.front()->get(); Ref<Script> existing = selected->get_script(); @@ -823,7 +827,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (TOOL_CREATE_FAVORITE == p_tool) { String name = selected_favorite_root.get_slicec(' ', 0); if (ScriptServer::is_global_class(name)) { - new_node = Object::cast_to<Node>(ClassDB::instance(ScriptServer::get_global_class_base(name))); + new_node = Object::cast_to<Node>(ClassDB::instance(ScriptServer::get_global_class_native_base(name))); Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(name), "Script"); if (new_node && script.is_valid()) { new_node->set_script(script.get_ref_ptr()); @@ -2290,7 +2294,7 @@ void SceneTreeDock::_update_create_root_dialog() { button->set_text(TTR(l)); String name = l.get_slicec(' ', 0); if (ScriptServer::is_global_class(name)) - name = ScriptServer::get_global_class_base(name); + name = ScriptServer::get_global_class_native_base(name); button->set_icon(EditorNode::get_singleton()->get_class_icon(name)); button->connect("pressed", this, "_favorite_root_selected", make_binds(l)); } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 6602d2974f..8cfc6d4e8e 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -549,32 +549,28 @@ void SceneTreeEditor::_cell_multi_selected(Object *p_object, int p_cell, bool p_ void SceneTreeEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - - get_tree()->connect("tree_changed", this, "_tree_changed"); - get_tree()->connect("node_removed", this, "_node_removed"); - get_tree()->connect("node_configuration_warning_changed", this, "_warning_changed"); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { - tree->connect("item_collapsed", this, "_cell_collapsed"); + get_tree()->connect("tree_changed", this, "_tree_changed"); + get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect("node_configuration_warning_changed", this, "_warning_changed"); - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); - _editor_settings_changed(); + tree->connect("item_collapsed", this, "_cell_collapsed"); - //get_scene()->connect("tree_changed",this,"_tree_changed",Vector<Variant>(),CONNECT_DEFERRED); - //get_scene()->connect("node_removed",this,"_node_removed",Vector<Variant>(),CONNECT_DEFERRED); - _update_tree(); - } - if (p_what == NOTIFICATION_EXIT_TREE) { + _update_tree(); + } break; + case NOTIFICATION_EXIT_TREE: { - get_tree()->disconnect("tree_changed", this, "_tree_changed"); - get_tree()->disconnect("node_removed", this, "_node_removed"); - tree->disconnect("item_collapsed", this, "_cell_collapsed"); - get_tree()->disconnect("node_configuration_warning_changed", this, "_warning_changed"); - EditorSettings::get_singleton()->disconnect("settings_changed", this, "_editor_settings_changed"); - } - if (p_what == NOTIFICATION_THEME_CHANGED) { + get_tree()->disconnect("tree_changed", this, "_tree_changed"); + get_tree()->disconnect("node_removed", this, "_node_removed"); + tree->disconnect("item_collapsed", this, "_cell_collapsed"); + get_tree()->disconnect("node_configuration_warning_changed", this, "_warning_changed"); + } break; + case NOTIFICATION_THEME_CHANGED: { - _update_tree(); + _update_tree(); + } break; } } @@ -978,20 +974,6 @@ void SceneTreeEditor::_warning_changed(Node *p_for_node) { update_timer->start(); } -void SceneTreeEditor::_editor_settings_changed() { - bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); - - if (enable_rl) { - tree->add_constant_override("draw_relationship_lines", 1); - tree->add_color_override("relationship_line_color", rl_color); - tree->add_constant_override("draw_guides", 0); - } else { - tree->add_constant_override("draw_relationship_lines", 0); - tree->add_constant_override("draw_guides", 1); - } -} - void SceneTreeEditor::_bind_methods() { ClassDB::bind_method("_tree_changed", &SceneTreeEditor::_tree_changed); @@ -1012,8 +994,6 @@ void SceneTreeEditor::_bind_methods() { ClassDB::bind_method("_node_script_changed", &SceneTreeEditor::_node_script_changed); ClassDB::bind_method("_node_visibility_changed", &SceneTreeEditor::_node_visibility_changed); - ClassDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed); - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); ClassDB::bind_method(D_METHOD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 9b87c0981d..aa4d4dd58a 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -124,8 +124,6 @@ class SceneTreeEditor : public Control { void _warning_changed(Node *p_for_node); - void _editor_settings_changed(); - Timer *update_timer; List<StringName> *script_types; diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 6b7c4781dd..dda46d2414 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1040,17 +1040,6 @@ void ScriptEditorDebugger::_notification(int p_what) { reason->add_color_override("font_color", get_color("error_color", "Editor")); - bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); - - if (enable_rl) { - inspect_scene_tree->add_constant_override("draw_relationship_lines", 1); - inspect_scene_tree->add_color_override("relationship_line_color", rl_color); - inspect_scene_tree->add_constant_override("draw_guides", 0); - } else { - inspect_scene_tree->add_constant_override("draw_relationship_lines", 0); - inspect_scene_tree->add_constant_override("draw_guides", 1); - } } break; case NOTIFICATION_PROCESS: { @@ -1226,24 +1215,15 @@ void ScriptEditorDebugger::_notification(int p_what) { if (OS::get_singleton()->get_ticks_msec() > until) break; } - } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { + tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); tabs->set_margin(MARGIN_LEFT, -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); tabs->set_margin(MARGIN_RIGHT, EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); - bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); - - if (enable_rl) { - inspect_scene_tree->add_constant_override("draw_relationship_lines", 1); - inspect_scene_tree->add_color_override("relationship_line_color", rl_color); - } else - inspect_scene_tree->add_constant_override("draw_relationship_lines", 0); - copy->set_icon(get_icon("ActionCopy", "EditorIcons")); step->set_icon(get_icon("DebugStep", "EditorIcons")); next->set_icon(get_icon("DebugNext", "EditorIcons")); @@ -1252,7 +1232,6 @@ void ScriptEditorDebugger::_notification(int p_what) { dobreak->set_icon(get_icon("Pause", "EditorIcons")); docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); - } break; } } diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 0a8e7ea779..2e06a903aa 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -805,6 +805,10 @@ String LightSpatialGizmoPlugin::get_name() const { return "Lights"; } +int LightSpatialGizmoPlugin::get_priority() const { + return -1; +} + String LightSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { if (p_idx == 0) @@ -1062,6 +1066,10 @@ String AudioStreamPlayer3DSpatialGizmoPlugin::get_name() const { return "AudioStreamPlayer3D"; } +int AudioStreamPlayer3DSpatialGizmoPlugin::get_priority() const { + return -1; +} + String AudioStreamPlayer3DSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { return "Emission Radius"; @@ -1202,6 +1210,10 @@ String CameraSpatialGizmoPlugin::get_name() const { return "Camera"; } +int CameraSpatialGizmoPlugin::get_priority() const { + return -1; +} + String CameraSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node()); @@ -1425,6 +1437,10 @@ String MeshInstanceSpatialGizmoPlugin::get_name() const { return "MeshInstance"; } +int MeshInstanceSpatialGizmoPlugin::get_priority() const { + return -1; +} + bool MeshInstanceSpatialGizmoPlugin::can_be_hidden() const { return false; } @@ -1458,6 +1474,10 @@ String Sprite3DSpatialGizmoPlugin::get_name() const { return "Sprite3D"; } +int Sprite3DSpatialGizmoPlugin::get_priority() const { + return -1; +} + bool Sprite3DSpatialGizmoPlugin::can_be_hidden() const { return false; } @@ -1517,6 +1537,10 @@ String Position3DSpatialGizmoPlugin::get_name() const { return "Position3D"; } +int Position3DSpatialGizmoPlugin::get_priority() const { + return -1; +} + void Position3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->clear(); @@ -1540,6 +1564,10 @@ String SkeletonSpatialGizmoPlugin::get_name() const { return "Skeleton"; } +int SkeletonSpatialGizmoPlugin::get_priority() const { + return -1; +} + void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Skeleton *skel = Object::cast_to<Skeleton>(p_gizmo->get_spatial_node()); @@ -1743,6 +1771,10 @@ String PhysicalBoneSpatialGizmoPlugin::get_name() const { return "PhysicalBones"; } +int PhysicalBoneSpatialGizmoPlugin::get_priority() const { + return -1; +} + void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->clear(); @@ -1982,6 +2014,10 @@ String RayCastSpatialGizmoPlugin::get_name() const { return "RayCast"; } +int RayCastSpatialGizmoPlugin::get_priority() const { + return -1; +} + void RayCastSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { RayCast *raycast = Object::cast_to<RayCast>(p_gizmo->get_spatial_node()); @@ -2031,6 +2067,10 @@ String SpringArmSpatialGizmoPlugin::get_name() const { return "SpringArm"; } +int SpringArmSpatialGizmoPlugin::get_priority() const { + return -1; +} + ///// VehicleWheelSpatialGizmoPlugin::VehicleWheelSpatialGizmoPlugin() { @@ -2047,6 +2087,10 @@ String VehicleWheelSpatialGizmoPlugin::get_name() const { return "VehicleWheel"; } +int VehicleWheelSpatialGizmoPlugin::get_priority() const { + return -1; +} + void VehicleWheelSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { VehicleWheel *car_wheel = Object::cast_to<VehicleWheel>(p_gizmo->get_spatial_node()); @@ -2117,6 +2161,10 @@ String SoftBodySpatialGizmoPlugin::get_name() const { return "SoftBody"; } +int SoftBodySpatialGizmoPlugin::get_priority() const { + return -1; +} + bool SoftBodySpatialGizmoPlugin::is_selectable_when_hidden() const { return true; } @@ -2189,6 +2237,10 @@ String VisibilityNotifierGizmoPlugin::get_name() const { return "VisibilityNotifier"; } +int VisibilityNotifierGizmoPlugin::get_priority() const { + return -1; +} + String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { switch (p_idx) { @@ -2339,6 +2391,10 @@ String ParticlesGizmoPlugin::get_name() const { return "Particles"; } +int ParticlesGizmoPlugin::get_priority() const { + return -1; +} + bool ParticlesGizmoPlugin::is_selectable_when_hidden() const { return true; } @@ -2498,6 +2554,10 @@ String ReflectionProbeGizmoPlugin::get_name() const { return "ReflectionProbe"; } +int ReflectionProbeGizmoPlugin::get_priority() const { + return -1; +} + String ReflectionProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { switch (p_idx) { @@ -2674,6 +2734,10 @@ String GIProbeGizmoPlugin::get_name() const { return "GIProbe"; } +int GIProbeGizmoPlugin::get_priority() const { + return -1; +} + String GIProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { switch (p_idx) { @@ -2908,6 +2972,10 @@ String BakedIndirectLightGizmoPlugin::get_name() const { return "BakedLightmap"; } +int BakedIndirectLightGizmoPlugin::get_priority() const { + return -1; +} + void BakedIndirectLightGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node()); @@ -2965,6 +3033,10 @@ String CollisionShapeSpatialGizmoPlugin::get_name() const { return "CollisionShape"; } +int CollisionShapeSpatialGizmoPlugin::get_priority() const { + return -1; +} + String CollisionShapeSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { const CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node()); @@ -3557,6 +3629,10 @@ String CollisionPolygonSpatialGizmoPlugin::get_name() const { return "CollisionPolygon"; } +int CollisionPolygonSpatialGizmoPlugin::get_priority() const { + return -1; +} + void CollisionPolygonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { CollisionPolygon *polygon = Object::cast_to<CollisionPolygon>(p_gizmo->get_spatial_node()); @@ -3601,6 +3677,10 @@ String NavigationMeshSpatialGizmoPlugin::get_name() const { return "NavigationMeshInstance"; } +int NavigationMeshSpatialGizmoPlugin::get_priority() const { + return -1; +} + void NavigationMeshSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { NavigationMeshInstance *navmesh = Object::cast_to<NavigationMeshInstance>(p_gizmo->get_spatial_node()); @@ -3961,6 +4041,10 @@ String JointSpatialGizmoPlugin::get_name() const { return "Joints"; } +int JointSpatialGizmoPlugin::get_priority() const { + return -1; +} + void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Joint *joint = Object::cast_to<Joint>(p_gizmo->get_spatial_node()); diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h index 0d89fb0f03..3661df4bad 100644 --- a/editor/spatial_editor_gizmos.h +++ b/editor/spatial_editor_gizmos.h @@ -43,6 +43,7 @@ class LightSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -60,6 +61,7 @@ class AudioStreamPlayer3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -77,6 +79,7 @@ class CameraSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -94,6 +97,7 @@ class MeshInstanceSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; bool can_be_hidden() const; void redraw(EditorSpatialGizmo *p_gizmo); @@ -107,6 +111,7 @@ class Sprite3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; bool can_be_hidden() const; void redraw(EditorSpatialGizmo *p_gizmo); @@ -123,6 +128,7 @@ class Position3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); Position3DSpatialGizmoPlugin(); @@ -135,6 +141,7 @@ class SkeletonSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); SkeletonSpatialGizmoPlugin(); @@ -147,6 +154,7 @@ class PhysicalBoneSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); PhysicalBoneSpatialGizmoPlugin(); @@ -172,6 +180,7 @@ class RayCastSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); RayCastSpatialGizmoPlugin(); @@ -184,6 +193,7 @@ class SpringArmSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); SpringArmSpatialGizmoPlugin(); @@ -196,6 +206,7 @@ class VehicleWheelSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); VehicleWheelSpatialGizmoPlugin(); @@ -208,6 +219,7 @@ class SoftBodySpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; bool is_selectable_when_hidden() const; void redraw(EditorSpatialGizmo *p_gizmo); @@ -226,6 +238,7 @@ class VisibilityNotifierGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -243,6 +256,7 @@ class ParticlesGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; bool is_selectable_when_hidden() const; void redraw(EditorSpatialGizmo *p_gizmo); @@ -261,6 +275,7 @@ class ReflectionProbeGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -278,6 +293,7 @@ class GIProbeGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -295,6 +311,7 @@ class BakedIndirectLightGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -312,6 +329,7 @@ class CollisionShapeSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const; @@ -328,6 +346,7 @@ class CollisionPolygonSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); CollisionPolygonSpatialGizmoPlugin(); }; @@ -347,6 +366,7 @@ class NavigationMeshSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); NavigationMeshSpatialGizmoPlugin(); @@ -374,6 +394,7 @@ class JointSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; void redraw(EditorSpatialGizmo *p_gizmo); static void CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points); diff --git a/editor/translations/af.po b/editor/translations/af.po index 249e68ff53..f548d9067c 100644 --- a/editor/translations/af.po +++ b/editor/translations/af.po @@ -1398,8 +1398,22 @@ msgstr "Verpak" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1453,7 +1467,7 @@ msgstr "Open 'n Lêer" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Verfris" @@ -1528,10 +1542,33 @@ msgstr "Skuif Gunsteling Op" msgid "Move Favorite Down" msgstr "Skuif Gunsteling Af" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Voorskou:" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Skep Vouer" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Gaan na ouer vouer" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Kon nie vouer skep nie." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Gidse & Lêers:" @@ -1772,9 +1809,9 @@ msgstr "Afvoer:" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Fout tydens storing van hulpbron!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1782,6 +1819,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Fout tydens storing van hulpbron!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Stoor Hulpbron As..." @@ -3024,14 +3071,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3179,10 +3218,6 @@ msgid "Search files" msgstr "Deursoek Klasse" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5170,19 +5205,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5273,11 +5308,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6954,6 +6989,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7105,6 +7156,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Skep Intekening" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Verwyder" @@ -7226,6 +7286,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9811,6 +9875,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9825,6 +9895,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9972,6 +10048,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9980,6 +10064,11 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Gaan na ouer vouer" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/ar.po b/editor/translations/ar.po index ce40d0bdfa..c1ceebcedc 100644 --- a/editor/translations/ar.po +++ b/editor/translations/ar.po @@ -1406,8 +1406,22 @@ msgstr "ÙŠÙŽØزم\"ينتج المل٠المضغوط\"" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1459,7 +1473,7 @@ msgstr "أظهر ÙÙŠ مدير الملÙات" msgid "New Folder..." msgstr "مجلد جديد..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "تØديث" @@ -1534,10 +1548,35 @@ msgstr "Øرك المÙÙضلة للأعلي" msgid "Move Favorite Down" msgstr "Øرك المÙÙضلة للأسÙÙ„" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "التبويب السابق" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "أنشئ مجلد" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "إذهب إلي المجلد السابق" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "لا يمكن إنشاء المجلد." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "أظهر العناصر كشبكة من الصور المصغرة" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "أظهر العناصر كقائمة" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "الوجهات والملÙات:" @@ -1778,9 +1817,9 @@ msgstr "أخلاء الخرج" msgid "Project export failed with error code %d." msgstr "تصدير المشروع Ùشل, رمز الخطأ % d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "خطأ ÙÙŠ ØÙظ المورد!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1788,6 +1827,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "خطأ ÙÙŠ ØÙظ المورد!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "ØÙظ المورد باسم..." @@ -3099,16 +3148,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "لا يمكن التنقل إلي '%s' Øيث لم يتم العثور عليها ÙÙŠ نظام الملÙات!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "أظهر العناصر كشبكة من الصور المصغرة" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "أظهر العناصر كقائمة" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "الØالة: إستيراد المل٠Ùشل. من Ùضلك Ø£ØµÙ„Ø Ø§Ù„Ù…Ù„Ù Ùˆ أعد إستيراده يدوياً." @@ -3252,10 +3291,6 @@ msgid "Search files" msgstr "إبØØ« ÙÙŠ الأصناÙ" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "نمذج المشهد(المشاهد) المØددة كطÙÙ„ للعقدة المØددة." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5292,6 +5327,10 @@ msgid "Generating Visibility Rect" msgstr "توليد Rect الرؤية" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "توليد Rect الرؤية" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "لا يمكن إنشاء سوى نقطة ÙˆØيدة داخل ParticlesMaterial معالج المواد" @@ -5304,10 +5343,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "لا بيكسل بشÙاÙية > 128 ÙÙŠ الصورة..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "توليد Rect الرؤية" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Øمل قناع الانبعاث" @@ -5396,13 +5431,13 @@ msgid "Generating AABB" msgstr "توليد AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "ولد AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "ولد رؤية AABB" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "ولد AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "إزالة نقطة من المنØنى" @@ -7113,6 +7148,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "التبويب السابق" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7268,6 +7320,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "إنشاء بولي" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Ù…Ø³Ø Ø§Ù„Ù‚Ø§Ù„Ø¨" @@ -7399,6 +7460,11 @@ msgid "Exporting All" msgstr "التصدير كـ %s" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "هذا المسار غير موجود." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10012,6 +10078,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10026,6 +10098,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10175,6 +10253,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "أض٠اللون الØالي كإعداد مسبق" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "تنبيه!" @@ -10183,6 +10269,11 @@ msgstr "تنبيه!" msgid "Please Confirm..." msgstr "يرجى التاكيد..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "إذهب إلي المجلد السابق" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10257,6 +10348,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "نمذج المشهد(المشاهد) المØددة كطÙÙ„ للعقدة المØددة." + #, fuzzy #~ msgid "Font Size:" #~ msgstr "Øجم الخطوط:" diff --git a/editor/translations/bg.po b/editor/translations/bg.po index a629e78a9c..c4f1718ebb 100644 --- a/editor/translations/bg.po +++ b/editor/translations/bg.po @@ -1373,8 +1373,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1425,7 +1439,7 @@ msgstr "Покажи във Файлов Мениджър" msgid "New Folder..." msgstr "Ðова папка..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1500,10 +1514,33 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Предишен подпрозорец" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Създаване на папка" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Към горната папка" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "ÐеуÑпешно Ñъздаване на папка." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Папки и файлове:" @@ -1736,8 +1773,8 @@ msgstr "Ðова Ñцена" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1746,6 +1783,16 @@ msgid "OK" msgstr "Добре" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -3011,14 +3058,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3167,10 +3206,6 @@ msgid "Search files" msgstr "ТърÑене" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5191,19 +5226,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5294,11 +5329,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6981,6 +7016,24 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Следващ Ñкрипт" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Предишен подпрозорец" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7138,6 +7191,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "ПремеÑтване на Полигон" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "ПремеÑтване на Полигон" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "ЗатварÑне на вÑичко" @@ -7266,6 +7329,10 @@ msgid "Exporting All" msgstr "ИзнаÑÑне за %s" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9938,6 +10005,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9952,6 +10025,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10099,6 +10178,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Тревога!" @@ -10107,6 +10194,11 @@ msgstr "Тревога!" msgid "Please Confirm..." msgstr "МолÑ, потвърдете..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Към горната папка" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/bn.po b/editor/translations/bn.po index 845cceaf35..e397b1648d 100644 --- a/editor/translations/bn.po +++ b/editor/translations/bn.po @@ -1428,8 +1428,22 @@ msgstr "পà§à¦¯à¦¾à¦•/গà§à¦šà§à¦›à¦¿à¦¤ করা" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1485,7 +1499,7 @@ msgstr "ফাইল-মà§à¦¯à¦¾à¦¨à§‡à¦œà¦¾à¦°à§‡ দেখà§à¦¨" msgid "New Folder..." msgstr "ফোলà§à¦¡à¦¾à¦° তৈরি করà§à¦¨" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "রিফà§à¦°à§‡à¦¸ করà§à¦¨" @@ -1560,11 +1574,36 @@ msgstr "ফেবরিট/পà§à¦°à¦¿à¦¯à¦¼à¦•à§‡ উপরের দিকে msgid "Move Favorite Down" msgstr "ফেবরিট/পà§à¦°à¦¿à¦¯à¦¼à¦•à§‡ নিচের দিকে নামান" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "পূরà§à¦¬à§‡à¦° টà§à¦¯à¦¾à¦¬" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "ফোলà§à¦¡à¦¾à¦° তৈরি করà§à¦¨" + +#: editor/editor_file_dialog.cpp #, fuzzy msgid "Go to parent folder" msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "থামà§à¦¬à¦¨à§‡à¦‡à¦² গà§à¦°à¦¿à¦¡ হিসাবে আইটেম দেখà§à¦¨" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "লিসà§à¦Ÿ হিসেবে আইটেম দেখà§à¦¨" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "পথ à¦à¦¬à¦‚ ফাইল:" @@ -1817,9 +1856,9 @@ msgstr "আউটপà§à¦Ÿ/ফলাফল" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "রিসোরà§à¦¸ সংরকà§à¦·à¦£à§‡ সমসà§à¦¯à¦¾ হয়েছে!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1827,6 +1866,16 @@ msgid "OK" msgstr "সঠিক" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "রিসোরà§à¦¸ সংরকà§à¦·à¦£à§‡ সমসà§à¦¯à¦¾ হয়েছে!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "রিসোরà§à¦¸ à¦à¦‡à¦°à§‚পে সংরকà§à¦·à¦£ করà§à¦¨..." @@ -3215,16 +3264,6 @@ msgstr "'% s' তে নেà¦à¦¿à¦—েট করা যাবে না কাà #: editor/filesystem_dock.cpp #, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "থামà§à¦¬à¦¨à§‡à¦‡à¦² গà§à¦°à¦¿à¦¡ হিসাবে আইটেম দেখà§à¦¨" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "লিসà§à¦Ÿ হিসেবে আইটেম দেখà§à¦¨" - -#: editor/filesystem_dock.cpp -#, fuzzy msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "\n" @@ -3386,10 +3425,6 @@ msgid "Search files" msgstr "কà§à¦²à¦¾à¦¸à§‡à¦° অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "নিরà§à¦¬à¦¾à¦šà¦¿à¦¤ দৃশà§à¦¯(সমূহ)-কে নিরà§à¦¬à¦¾à¦šà¦¿à¦¤ নোডের অংশ হিসেবে ইনসà§à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করà§à¦¨à¥¤" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5485,6 +5520,10 @@ msgid "Generating Visibility Rect" msgstr "à¦à¦¿à¦œà¦¿à¦¬à¦¿à¦²à¦¿à¦Ÿà¦¿ রেকà§à¦Ÿ তৈরি করà§à¦¨" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "à¦à¦¿à¦œà¦¿à¦¬à¦¿à¦²à¦¿à¦Ÿà¦¿ রেকà§à¦Ÿ তৈরি করà§à¦¨" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "শà§à¦§à§à¦®à¦¾à¦¤à§à¦° ParticlesMaterial পà§à¦°à¦¸à§‡à¦¸ মà§à¦¯à¦¾à¦Ÿà§‡à¦°à¦¿à§Ÿà¦¾à¦²à§‡ বিনà§à¦¦à§ সà§à¦¥à¦¾à¦ªà¦¨ সমà§à¦à¦¬" @@ -5497,10 +5536,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "সà§à¦¬à¦šà§à¦›à¦¤à¦¾à¦¸à¦¹ কোনো পিকà§à¦¸à§‡à¦² নেই > ছবিতে ১২৮..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "à¦à¦¿à¦œà¦¿à¦¬à¦¿à¦²à¦¿à¦Ÿà¦¿ রেকà§à¦Ÿ তৈরি করà§à¦¨" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Emission Mask লোড করà§à¦¨" @@ -5598,12 +5633,12 @@ msgid "Generating AABB" msgstr "AABB উৎপনà§à¦¨ করà§à¦¨" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +#, fuzzy +msgid "Generate Visibility AABB" msgstr "AABB উৎপনà§à¦¨ করà§à¦¨" #: editor/plugins/particles_editor_plugin.cpp -#, fuzzy -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "AABB উৎপনà§à¦¨ করà§à¦¨" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7379,6 +7414,24 @@ msgid "Merge from Scene" msgstr "দৃশà§à¦¯ হতে à¦à¦•à¦¤à§à¦°à¦¿à¦¤ করবেন" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "পরবরà§à¦¤à§€ সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "পূরà§à¦¬à§‡à¦° টà§à¦¯à¦¾à¦¬" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7536,6 +7589,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "পলিগন সরান" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "পলিগন সরান" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "বসà§à¦¤à§ অপসারণ করà§à¦¨" @@ -7674,6 +7737,11 @@ msgid "Exporting All" msgstr "%s à¦à¦° জনà§à¦¯ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ (export) হচà§à¦›à§‡" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "ফাইলটি বিদà§à¦¯à¦®à¦¾à¦¨ নয়।" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "à¦à¦‡ পà§à¦²à§à¦¯à¦¾à¦Ÿà¦«à¦°à§à¦®à§‡à¦° জনà§à¦¯ দরকারি à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ টেমপà§à¦²à§‡à¦Ÿà¦—à§à¦²à¦¿ কà§à¦·à¦¤à¦¿à¦—à§à¦°à¦¸à§à¦¥ হয়েছে অথবা খà§à¦à¦œà§‡ পাওয়া " @@ -10497,6 +10565,12 @@ msgstr "" "সফলà§à¦à¦¾à¦¬à§‡ কাজ করতে CollisionShape à¦à¦° à¦à¦•à¦Ÿà¦¿ আকৃতি পà§à¦°à§Ÿà§‹à¦œà¦¨à¥¤ অনà§à¦—à§à¦°à¦¹ করে তার জনà§à¦¯ à¦à¦•à¦Ÿà¦¿ " "আকৃতি তৈরি করà§à¦¨!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10512,6 +10586,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "ছবিসমূহ বà§à¦²à¦¿à¦Ÿà¦¿à¦‚ (Blitting) করা হচà§à¦›à§‡" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10671,6 +10751,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "সতরà§à¦•à¦¤à¦¾!" @@ -10679,6 +10767,11 @@ msgstr "সতরà§à¦•à¦¤à¦¾!" msgid "Please Confirm..." msgstr "অনà§à¦—à§à¦°à¦¹ করে নিশà§à¦šà¦¿à¦¤ করà§à¦¨..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "ফোলà§à¦¡à¦¾à¦° তৈরী করা সমà§à¦à¦¬ হয়নি।" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10760,6 +10853,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "নিরà§à¦¬à¦¾à¦šà¦¿à¦¤ দৃশà§à¦¯(সমূহ)-কে নিরà§à¦¬à¦¾à¦šà¦¿à¦¤ নোডের অংশ হিসেবে ইনসà§à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করà§à¦¨à¥¤" + #~ msgid "FPS" #~ msgstr "à¦à¦« পি à¦à¦¸" diff --git a/editor/translations/ca.po b/editor/translations/ca.po index e8642ec86f..57d80a8342 100644 --- a/editor/translations/ca.po +++ b/editor/translations/ca.po @@ -1391,8 +1391,22 @@ msgstr "Compressió" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1445,7 +1459,7 @@ msgstr "Mostra en el Gestor de Fitxers" msgid "New Folder..." msgstr "Nou Directori..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Refresca" @@ -1520,10 +1534,33 @@ msgstr "Mou Favorit Amunt" msgid "Move Favorite Down" msgstr "Mou Favorit Avall" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Planta Anterior" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Planta Següent" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Vés al directori principal" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "No s'ha pogut crear el directori." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Visualitza en una graella de miniatures." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Mostra'ls en una llista." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Directoris i Fitxers:" @@ -1764,9 +1801,9 @@ msgstr "Buida la Sortida" msgid "Project export failed with error code %d." msgstr "L'exportació del projecte ha fallat amb el codi d'error %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Error en desar recurs!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1774,6 +1811,16 @@ msgid "OK" msgstr "D'acord" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Error en desar recurs!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Anomena i Desa el Recurs..." @@ -3088,14 +3135,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "No es pot accedir a '%s'. No es troba en el sistema de fitxers!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Visualitza en una graella de miniatures." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Mostra'ls en una llista." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "Estat: No s'ha pogut importar. Corregiu el fitxer i torneu a importar." @@ -3236,10 +3275,6 @@ msgid "Search files" msgstr "Cerca Fitxers" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Instancia les escenes seleccionades com a filles del node seleccionat." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5271,6 +5306,10 @@ msgid "Generating Visibility Rect" msgstr "Genera un Rectangle de Visibilitat" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Genera un Rectangle de Visibilitat" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "Només es poden establir punts en materials de procés ParticlesMaterial" @@ -5283,10 +5322,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Cap pÃxel amb transparència > 128 en la imatge..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Genera un Rectangle de Visibilitat" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Carrega una Mà scara d'Emissió" @@ -5375,13 +5410,13 @@ msgid "Generating AABB" msgstr "Generant AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Genera AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Genera un AABB de Visibilitat" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Genera AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Elimina un Punt de la Corba" @@ -7100,6 +7135,24 @@ msgid "Merge from Scene" msgstr "Combina-ho a partir de l'Escena" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Planta Següent" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Planta Anterior" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7263,6 +7316,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Mou el PolÃgon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Mou el PolÃgon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Elimina la Plantilla" @@ -7399,6 +7462,11 @@ msgid "Exporting All" msgstr "Exportació per a %s" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "El camà no existeix." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Manquen d'exportació per aquesta plataforma o s'han malmès:" @@ -10134,6 +10202,12 @@ msgstr "" "Cal proveir una forma perquè CollisionShape funcioni. Creeu-li un recurs de " "forma!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp #, fuzzy msgid "Nothing is visible because no mesh has been assigned." @@ -10149,6 +10223,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "S'està n traçant les Malles" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10321,6 +10401,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Afegeix el Color actual com a predeterminat" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Ep!" @@ -10329,6 +10417,11 @@ msgstr "Ep!" msgid "Please Confirm..." msgstr "Confirmeu..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Vés al directori principal" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10415,6 +10508,10 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Instancia les escenes seleccionades com a filles del node seleccionat." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/cs.po b/editor/translations/cs.po index b8c1040589..a9834cd05f 100644 --- a/editor/translations/cs.po +++ b/editor/translations/cs.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-21 21:18+0000\n" +"PO-Revision-Date: 2019-03-12 15:25+0000\n" "Last-Translator: VojtÄ›ch Å amla <auzkok@seznam.cz>\n" "Language-Team: Czech <https://hosted.weblate.org/projects/godot-engine/godot/" "cs/>\n" @@ -24,7 +24,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -131,9 +131,8 @@ msgid "Anim Change Call" msgstr "Animace: zmÄ›na volánÃ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "ZmÄ›nit smyÄku animace" +msgstr "ZmÄ›nit délku animace" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -190,9 +189,8 @@ msgid "Anim Clips:" msgstr "AnimaÄnà klipy:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "ZmÄ›nit hodnotu pole" +msgstr "ZmÄ›nit cestu stopy" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -274,14 +272,12 @@ msgid "Delete Key(s)" msgstr "Odstranit klÃÄ(e)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "ZmÄ›nit název animace:" +msgstr "ZmÄ›nit režim aktualizace animace" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "InterpolaÄnà režim" +msgstr "ZmÄ›nit režim interpolace animace" #: editor/animation_track_editor.cpp #, fuzzy @@ -330,14 +326,12 @@ msgid "Anim Insert Key" msgstr "Animace: vložit klÃÄ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "ZmÄ›nit FPS animace" +msgstr "ZmÄ›nit krok animace" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "PÅ™eskupit Autoloady" +msgstr "PÅ™eskupit stopy" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -368,9 +362,8 @@ msgid "Not possible to add a new track without a root" msgstr "Nenà možné pÅ™idat novou stopu bez koÅ™enového uzlu" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "PÅ™idat stopu" +msgstr "PÅ™idat Bézierovu stopu" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -1382,8 +1375,26 @@ msgstr "BalÃm" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"CÃlová platforma vyžaduje kompresi textur 'ETC' pro GLES2. Povolte 'Import " +"Etc' v nastavenÃch projektu." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"CÃlová platforma vyžaduje kompresi textur 'ETC2' pro GLES3. Povolte 'Import " +"Etc 2' v nastavenÃch projektu." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1431,7 +1442,7 @@ msgstr "Zobrazit ve správci souborů" msgid "New Folder..." msgstr "Nová složka..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Obnovit" @@ -1506,10 +1517,31 @@ msgstr "PÅ™esunout oblÃbenou položku nahoru" msgid "Move Favorite Down" msgstr "PÅ™esunout oblÃbenou položku dolů" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "PÅ™edchozà složka" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "DalÅ¡Ã složka" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "JÃt na nadÅ™azenou složku" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Nelze vytvoÅ™it složku." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Zobrazit položky jako mřÞku náhledů." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Zobrazit položky jako seznam." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Složky a soubory:" @@ -1733,9 +1765,9 @@ msgstr "Vymazat výstup" msgid "Project export failed with error code %d." msgstr "Export projektu selhal s chybovým kódem %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Chyba pÅ™i ukládánà zdrojů!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "Nelze uložit importované zdroje." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1743,6 +1775,16 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Chyba pÅ™i ukládánà zdrojů!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Uložit zdroj jako..." @@ -1956,7 +1998,7 @@ msgstr "Selhalo nahránà zdroje." #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "" +msgstr "Pro uloženà scény je vyžadován koÅ™enový uzel." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -2697,6 +2739,8 @@ msgid "" "The selected resource (%s) does not match any type expected for this " "property (%s)." msgstr "" +"Vybraný zdroj (%s) neodpovÃdá žádnému oÄekávanému typu pro tuto vlastnost " +"(%s)." #: editor/editor_properties.cpp msgid "" @@ -3035,14 +3079,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "Nelze pÅ™ejÃt k '%s', protože nebylo nalezeno v souborovém systému!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Zobrazit položky jako mřÞku náhledů." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Zobrazit položky jako seznam." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Status: import souboru selhal. Opravte, prosÃm, soubor a naimportujte ho " @@ -3181,10 +3217,6 @@ msgid "Search files" msgstr "Hledat soubory" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3372,11 +3404,11 @@ msgstr "UkládánÃ..." #: editor/import_dock.cpp msgid "Set as Default for '%s'" -msgstr "" +msgstr "Nastavit jako výchozà pro '%s'" #: editor/import_dock.cpp msgid "Clear Default for '%s'" -msgstr "" +msgstr "VyÄistit výchozà pro '%s'" #: editor/import_dock.cpp msgid " Files" @@ -3463,9 +3495,8 @@ msgid "Load an existing resource from disk and edit it." msgstr "Nahrát existujÃcà zdroj z disku a editovat ho." #: editor/inspector_dock.cpp -#, fuzzy msgid "Save the currently edited resource." -msgstr "Uložit vybranou animaci" +msgstr "Uložit právÄ› editovaný zdroj." #: editor/inspector_dock.cpp msgid "Go to the previous edited object in history." @@ -3539,16 +3570,14 @@ msgid "Create points." msgstr "VytvoÅ™it body." #: editor/plugins/abstract_polygon_2d_editor.cpp -#, fuzzy msgid "" "Edit points.\n" "LMB: Move Point\n" "RMB: Erase Point" msgstr "" -"Upravit existujÃcà polygon:\n" -"LMB: PÅ™esunout bod.\n" -"Ctrl+LMB: RozdÄ›lit segment.\n" -"RMB: Vymazat bod." +"Upravit body.\n" +"LMB: PÅ™esunout bod\n" +"RMB: Vymazat bod" #: editor/plugins/abstract_polygon_2d_editor.cpp #: editor/plugins/animation_blend_space_1d_editor.cpp @@ -3649,7 +3678,7 @@ msgstr "Zvolte a pÅ™esuňte body. Nové uzly vytvoÅ™te pomocà RMB." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp scene/gui/graph_edit.cpp msgid "Enable snap and show grid." -msgstr "" +msgstr "Aktivovat pÅ™ichytávánà a zobrazit mřÞku." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3668,9 +3697,8 @@ msgid "Triangle already exists" msgstr "TrojúhelnÃk již existuje" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "PÅ™idat promÄ›nnou" +msgstr "PÅ™idat trojúhelnÃk" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Change BlendSpace2D Limits" @@ -3705,11 +3733,11 @@ msgstr "Zobrazit oblÃbené" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." -msgstr "" +msgstr "VytvoÅ™it trojúhelnÃky spojovánÃm bodů." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Erase points and triangles." -msgstr "" +msgstr "Odstranit body a trojúhelnÃky." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Generate blend triangles automatically (instead of manually)" @@ -3721,9 +3749,8 @@ msgid "Blend:" msgstr "ProlÃnánÃ:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "ZmÄ›ny materiálu" +msgstr "Parametr zmÄ›nÄ›n" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3735,43 +3762,37 @@ msgid "Output node can't be added to the blend tree." msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "PÅ™idat uzel(y) ze stromu" +msgstr "PÅ™idat uzel do BlendTree" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Režim pÅ™esouvánÃ" +msgstr "Uzel pÅ™esunut" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Unable to connect, port may be in use or connection may be invalid." -msgstr "" +msgstr "Nelze se pÅ™ipojit, port může být použÃván nebo pÅ™ipojenà nenà platné." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "PÅ™ipojeno" +msgstr "PÅ™ipojené uzly" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Odpojeno" +msgstr "Odpojené uzly" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Nová animace" +msgstr "Nastavit animaci" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Odstranit uzel/uzly" +msgstr "Smazat uzel" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #, fuzzy @@ -3779,9 +3800,8 @@ msgid "Toggle Filter On/Off" msgstr "Aktivovat/Deaktivovat tuto stopu." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "ZmÄ›nit typ hodnot pole" +msgstr "ZmÄ›nit filtr" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3800,9 +3820,8 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Název uzlu" +msgstr "Uzel pÅ™ejmenován" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4031,9 +4050,8 @@ msgid "Cross-Animation Blend Times" msgstr "" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Režim pÅ™esouvánÃ" +msgstr "PÅ™esunout uzel" #: editor/plugins/animation_state_machine_editor.cpp #, fuzzy @@ -4055,7 +4073,7 @@ msgstr "" #: editor/plugins/animation_state_machine_editor.cpp msgid "Sync" -msgstr "" +msgstr "Synchronizovat" #: editor/plugins/animation_state_machine_editor.cpp msgid "At End" @@ -4075,14 +4093,12 @@ msgid "No playback resource set at path: %s." msgstr "Nenà v cestÄ› ke zdroji." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Odebrat" +msgstr "Uzel odebrán" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "PÅ™echod: " +msgstr "PÅ™echod odebrán" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" @@ -4212,39 +4228,39 @@ msgstr "Strom animace je neplatný." #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Animation Node" -msgstr "Uzel animace" +msgstr "Uzel Animation" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "OneShot Node" -msgstr "" +msgstr "Uzel OneShot" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Mix Node" -msgstr "" +msgstr "Uzel Mix" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend2 Node" -msgstr "" +msgstr "Uzel Blend2" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend3 Node" -msgstr "" +msgstr "Uzel Blend3" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend4 Node" -msgstr "" +msgstr "Uzel Blend4" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "TimeScale Node" -msgstr "" +msgstr "Uzel TimeScale" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "TimeSeek Node" -msgstr "" +msgstr "Uzel TimeSeek" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Transition Node" -msgstr "" +msgstr "Uzel Transition" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Import Animations..." @@ -5155,6 +5171,10 @@ msgid "Generating Visibility Rect" msgstr "Generovánà C# projektu..." #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" @@ -5167,16 +5187,12 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Žádný pixel s průhlednostà > 128 v obrázku..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" -msgstr "" +msgstr "NaÄÃst emisnà masku" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Clear Emission Mask" -msgstr "" +msgstr "VyÄistit emisnà masku" #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp @@ -5199,7 +5215,7 @@ msgstr "ÄŒas generovánà (sec):" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Emission Mask" -msgstr "" +msgstr "Emisnà maska" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Capture from Pixel" @@ -5258,13 +5274,13 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Vygenerovat AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Vygenerovat AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Odstranit bod z kÅ™ivky" @@ -6924,6 +6940,24 @@ msgid "Merge from Scene" msgstr "SlouÄit ze scény" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "DalÅ¡Ã skript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "PÅ™edchozà skript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "KopÃrovat bitovou masku." @@ -7073,6 +7107,16 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Concave" +msgstr "PÅ™esunout polygon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "PÅ™esunout polygon" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Odstranit dlaždici" @@ -7201,6 +7245,11 @@ msgid "Exporting All" msgstr "Exportovánà vÅ¡eho" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "Cesta neexistuje." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Exportnà šablony pro tuto platformu chybà nebo jsou poÅ¡kozené:" @@ -8238,9 +8287,8 @@ msgid "Make Local" msgstr "MÃstnÃ" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Dává smysl!" +msgstr "Nový koÅ™en scény" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -9859,6 +9907,12 @@ msgstr "" "Aby CollisionShape mohl fungovat, musà mu být poskytnut tvar. VytvoÅ™te mu " "prosÃm zdroj tvar!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9873,6 +9927,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10035,6 +10095,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "PÅ™idat aktuálnà barvu jako pÅ™edvolbu" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Pozor!" @@ -10043,6 +10111,11 @@ msgstr "Pozor!" msgid "Please Confirm..." msgstr "PotvrÄte prosÃm..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "JÃt na nadÅ™azenou složku" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/da.po b/editor/translations/da.po index fe271a62a6..e803f4826f 100644 --- a/editor/translations/da.po +++ b/editor/translations/da.po @@ -1384,8 +1384,22 @@ msgstr "Pakker" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1434,7 +1448,7 @@ msgstr "Vis i FilhÃ¥ndtering" msgid "New Folder..." msgstr "Opret mappe..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Opdater" @@ -1509,10 +1523,35 @@ msgstr "Flyt Favorit Op" msgid "Move Favorite Down" msgstr "Flyt Favorit Ned" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Forrige fane" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Opret Mappe" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "GÃ¥ til overliggende mappe" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Kunne ikke oprette mappe." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Vis emner som et gitter af miniaturebilleder" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Vis emner som en liste" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Mapper & Filer:" @@ -1736,9 +1775,9 @@ msgstr "Ryd Output" msgid "Project export failed with error code %d." msgstr "Projekt eksport fejlede med fejlkode %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Fejl, kan ikke gemme ressource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1746,6 +1785,16 @@ msgid "OK" msgstr "Ok" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Fejl, kan ikke gemme ressource!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Gem Ressource Som..." @@ -3046,16 +3095,6 @@ msgstr "Kan ikke navigere til '%s' da det ikke blev fundet i filsystemet!" #: editor/filesystem_dock.cpp #, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Vis emner som et gitter af miniaturebilleder" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Vis emner som en liste" - -#: editor/filesystem_dock.cpp -#, fuzzy msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "\n" @@ -3210,10 +3249,6 @@ msgid "Search files" msgstr "Søg Classes" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5234,19 +5269,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5338,11 +5373,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7042,6 +7077,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Forrige fane" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7197,6 +7249,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Opret Poly" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Fjern Template" @@ -7329,6 +7390,10 @@ msgid "Exporting All" msgstr "Eksporter" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9999,6 +10064,12 @@ msgstr "" "En figur skal gives for at CollisionShape fungerer. Opret en figur ressource " "til det!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10013,6 +10084,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10171,6 +10248,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Advarsel!" @@ -10179,6 +10264,11 @@ msgstr "Advarsel!" msgid "Please Confirm..." msgstr "Bekræft venligst..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "GÃ¥ til overliggende mappe" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/de.po b/editor/translations/de.po index 9cf2dc4a85..81a69d2add 100644 --- a/editor/translations/de.po +++ b/editor/translations/de.po @@ -38,12 +38,13 @@ # Rémi Verschelde <akien@godotengine.org>, 2019. # Martin <martinreininger@gmx.net>, 2019. # Andreas During <anduring@web.de>, 2019. +# Arthur S. Muszynski <artism90@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-03-01 11:59+0000\n" -"Last-Translator: Andreas During <anduring@web.de>\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" +"Last-Translator: So Wieso <sowieso@dukun.de>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/" "godot/de/>\n" "Language: de\n" @@ -51,7 +52,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -120,14 +121,12 @@ msgid "Delete Selected Key(s)" msgstr "Ausgewählte Schlüssel löschen" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Punkt hinzufügen" +msgstr "Bezierpunkt hinzufügen" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Punkte Verschieben" +msgstr "Bezierpunkt verschieben" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -158,9 +157,8 @@ msgid "Anim Change Call" msgstr "Aufruf ändern" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Bearbeite Animationsschleife" +msgstr "Animationslänge ändern" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -217,9 +215,8 @@ msgid "Anim Clips:" msgstr "Animationsschnipsel:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Array-Wert ändern" +msgstr "Spurpfad ändern" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -246,9 +243,8 @@ msgid "Time (s): " msgstr "Zeit (s): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Dopplereffekt aktivieren" +msgstr "Spur ein-/ausschalten" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -301,19 +297,16 @@ msgid "Delete Key(s)" msgstr "Schlüsselbilder entfernen" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Animationsname ändern:" +msgstr "Animationsaktualisierungsmoduls ändern" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Interpolationsmodus" +msgstr "Animationsinterpolationsmodus ändern" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Bearbeite Animationsschleife" +msgstr "Animationswiederholungsmodus ändern" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -357,14 +350,12 @@ msgid "Anim Insert Key" msgstr "Schlüsselbild einfügen" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Ändere FPS-Wert der Animation" +msgstr "Animationsschrittweite ändern" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Autoloads neu anordnen" +msgstr "Spuren neu anordnen" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -396,9 +387,8 @@ msgid "Not possible to add a new track without a root" msgstr "Ohne eine Wurzel kann keine neue Spur hinzugefügt werden" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Spur hinzufügen" +msgstr "Bezierspur hinzufügen" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -410,14 +400,12 @@ msgstr "" "Spur ist nicht vom Typ Spatial, Schlüssel kann nicht hinzugefügt werden" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "3D-Transformspur" +msgstr "Transformationsspurschlüssel hinzufügen" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Spur hinzufügen" +msgstr "Spurschlüssel hinzufügen" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." @@ -425,9 +413,8 @@ msgstr "" "Spurpfad ist ungültig, Methoden-Schlüssel kann nicht hinzugefügt werden." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Methodenaufrufsspur" +msgstr "Methodenaufrufsspurschlüssel hinzufügen" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -590,17 +577,16 @@ msgid "Copy" msgstr "Kopieren" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Audioschnipsel:" +msgstr "Tonspurclip hinzufügen" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Tonspurclip-Startversatz ändern" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Tonspurclip-Endversatz ändern" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -676,15 +662,15 @@ msgstr "Zeilen- und Spaltennummern." #: editor/connections_dialog.cpp msgid "Method in target Node must be specified!" -msgstr "In der Ziel-Node muss eine Methode angegeben werden!" +msgstr "Im Ziel-Node muss eine Methode angegeben werden!" #: editor/connections_dialog.cpp msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" -"Zielmethode nicht gefunden! Bitte geben Sie eine gültige Methode an oder " -"fügen Sie ein Skript zur Ziel-Node hinzu." +"Zielmethode nicht gefunden! Bitte eine gültige Methode angeben oder ein " +"Skript dem Ziel-Node anhängen." #: editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1419,9 +1405,30 @@ msgstr "Packe" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"Die Zielplattform benötigt ‚ETC‘-Texturkompression für GLES2. Bitte in den " +"Projekteinstellungen ‚Import Etc‘ aktivieren." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." msgstr "" +"Die Zielplattform benötigt ‚ETC2‘-Texturkompression für GLES2. Bitte in den " +"Projekteinstellungen aktivieren." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." +msgstr "" +"Die Zielplattform benötigt ‚ETC‘-Texturkompression für den Treiber-Fallback " +"auf GLES2. Bitte ‚Import Etc‘ in den Projekteinstellungen aktivieren oder ‚" +"Driver Fallback Enabled‘ ausschalten." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1468,7 +1475,7 @@ msgstr "Im Dateimanager anzeigen" msgid "New Folder..." msgstr "Neuer Ordner..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Aktualisieren" @@ -1543,10 +1550,30 @@ msgstr "Favorit nach oben schieben" msgid "Move Favorite Down" msgstr "Favorit nach unten schieben" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "Vorheriger Ordner" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "Nächster Ordner" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Gehe zu übergeordnetem Ordner" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "Gegenwärtigen Ordner (de)favorisieren." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Einträge in Vorschaugitter anzeigen." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Einträge als Liste anzeigen." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Verzeichnisse & Dateien:" @@ -1769,9 +1796,9 @@ msgstr "Ausgabe löschen" msgid "Project export failed with error code %d." msgstr "Projekt-Export ist fehlgeschlagen mit Fehlercode %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Fehler beim speichern der Ressource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "Importierte Ressourcen können nicht abgespeichert werden." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1779,6 +1806,18 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Fehler beim speichern der Ressource!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" +"Diese Ressource kann nicht abgespeichert werden, da sie nicht Teil der " +"bearbeiteten Szene ist. Ressource muss vorher einzigartig gemacht werden." + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Speichere Ressource als..." @@ -2002,14 +2041,12 @@ msgid "Save changes to '%s' before closing?" msgstr "Änderungen in ‚%s‘ vor dem Schließen speichern?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Laden der Ressource gescheitert." +msgstr "%s veränderte Ressource(n) gespeichert." #: editor/editor_node.cpp -#, fuzzy msgid "A root node is required to save the scene." -msgstr "Es ist nur eine Datei für eine große Textur erforderlich." +msgstr "Ein Wurzel-Node wird benötigt um diese Szene zu speichern." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -3109,14 +3146,6 @@ msgstr "" "wurde!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Einträge in Vorschaugitter anzeigen." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Einträge als Liste anzeigen." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Status: Dateiimport fehlgeschlagen. Manuelle Reparatur und Neuimport nötig." @@ -3253,10 +3282,6 @@ msgid "Search files" msgstr "Dateien suchen" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Instantiiere gewählte Szene(n) als Unterobjekt des ausgewählten Nodes." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3661,47 +3686,41 @@ msgstr "Lade..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "Punkte Verschieben" +msgstr "Node-Punkt verschieben" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Ãœberblendungszeit ändern" +msgstr "BlendSpace1D-Grenzwerte ändern" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Ãœberblendungszeit ändern" +msgstr "BlendSpace1D-Beschriftungen ändern" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "This type of node can't be used. Only root nodes are allowed." msgstr "" -"Dieser Node-Type kann nicht verwendet werden. Nur Wurzel-Nodes sind möglich." +"Dieser Node-Typ kann nicht verwendet werden. Nur Wurzel-Nodes sind möglich." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Node hinzufügen" +msgstr "Node-Punkt hinzufügen" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Animation hinzufügen" +msgstr "Animationspunkt hinzufügen" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Pfadpunkt entfernen" +msgstr "BlendSpace1D-Punkt entfernen" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "BlendSpace1D-Node-Punkt verschieben" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3747,29 +3766,24 @@ msgid "Triangle already exists" msgstr "Dreieck existiert bereits" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Variable hinzufügen" +msgstr "Dreieck hinzufügen" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Ãœberblendungszeit ändern" +msgstr "BlendSpace2D-Grenzwerte ändern" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Ãœberblendungszeit ändern" +msgstr "BlendSpace2D-Beschriftungen ändern" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Pfadpunkt entfernen" +msgstr "BlendSpace2D-Punkt entfernen" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Variable entfernen" +msgstr "BlendSpace2D-Dreieck entfernen" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3780,9 +3794,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "Es existieren keine Dreiecke, Vermischen nicht möglich." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Autoload-Globals umschalten" +msgstr "Automatische Dreiecke umschalten" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3802,9 +3815,8 @@ msgid "Blend:" msgstr "Blende:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Materialänderungen" +msgstr "Parameter geändert" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3816,15 +3828,13 @@ msgid "Output node can't be added to the blend tree." msgstr "Ausgabe-Node kann nicht zum Mischungsbaum hinzugefügt werden." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Node(s) aus Szenenbaum hinzufügen" +msgstr "Node zu BlendTree hinzufügen" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Bewegungsmodus" +msgstr "Node verschoben" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3835,36 +3845,30 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Verbunden" +msgstr "Nodes verbunden" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Getrennt" +msgstr "Nodes getrennt" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Neue Animation" +msgstr "Animation setzen" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Node(s) löschen" +msgstr "Node löschen" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Diese Spur an-/abschalten." +msgstr "Filter ein-/ausschalten" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Sprachfilter geändert" +msgstr "Filter ändern" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3887,14 +3891,13 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Node-Name" +msgstr "Node umbenannt" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Add Node..." -msgstr "Knoten hinzufügen....." +msgstr "Knoten hinzufügen..." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/root_motion_editor_plugin.cpp @@ -4005,7 +4008,7 @@ msgstr "Position der Animation (in Sekunden)." #: editor/plugins/animation_player_editor_plugin.cpp msgid "Scale animation playback globally for the node." -msgstr "Animationsablauf für dieses Node global skalieren." +msgstr "Animationsablauf für diesen Node global skalieren." #: editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Tools" @@ -4117,14 +4120,12 @@ msgid "Cross-Animation Blend Times" msgstr "Ãœbergangszeiten kreuzender Animationen" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Bewegungsmodus" +msgstr "Node verschieben" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Ãœbersetzung hinzufügen" +msgstr "Ãœbergang hinzufügen" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4160,18 +4161,16 @@ msgid "No playback resource set at path: %s." msgstr "Keine Abspiel-Ressource festgelegt im Pfad: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Entfernt:" +msgstr "Node entfernt" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Ãœbergangs-Node" +msgstr "Ãœbergang entfernt" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Start-Node setzen (Automatisches Abspielen)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4193,7 +4192,7 @@ msgstr "Nodes verbinden." #: editor/plugins/animation_state_machine_editor.cpp msgid "Remove selected node or transition." -msgstr "Ausgewähltes Node oder Ãœbergang entfernen." +msgstr "Ausgewählten Node oder Ãœbergang entfernen." #: editor/plugins/animation_state_machine_editor.cpp msgid "Toggle autoplay this animation on start, restart or seek to zero." @@ -4314,15 +4313,15 @@ msgstr "Misch-Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend2 Node" -msgstr "Blende2-Node" +msgstr "Blend2-Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend3 Node" -msgstr "Blende3-Node" +msgstr "Blend3-Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend4 Node" -msgstr "Blende4-Node" +msgstr "Blend4-Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "TimeScale Node" @@ -4334,7 +4333,7 @@ msgstr "Zeitsuch-Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Transition Node" -msgstr "Ãœbergangs-Node" +msgstr "Ãœbergang-Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Import Animations..." @@ -4897,7 +4896,7 @@ msgid "" "Drag & drop + Alt : Change node type" msgstr "" "Ziehen + Umschalt: Node auf gleicher Ebene einfügen\n" -"Ziehen + Alt: Nodetyp ändern" +"Ziehen + Alt: Node-Typ ändern" #: editor/plugins/collision_polygon_editor_plugin.cpp msgid "Create Polygon3D" @@ -4999,7 +4998,7 @@ msgstr "GI Sonde vorrendern" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Gradient bearbeitet" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5259,6 +5258,10 @@ msgid "Generating Visibility Rect" msgstr "Generiere Sichtbarkeits-Rechteck" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Generiere Sichtbarkeits-Rechteck" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Punkt kann nur in ein Prozessmaterial des Typs ParticlesMaterial gesetzt " @@ -5273,10 +5276,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Keine Pixel mit einer Transparenz > 128 im Bild..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Generiere Sichtbarkeits-Rechteck" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Emissionsmaske laden" @@ -5364,13 +5363,13 @@ msgid "Generating AABB" msgstr "Erzeuge AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Erzeuge AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Erzeuge Sichtbarkeits-AABB" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Erzeuge AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Punkt von Kurve entfernen" @@ -5507,7 +5506,7 @@ msgstr "Gelenk verschieben" msgid "" "The skeleton property of the Polygon2D does not point to a Skeleton2D node" msgstr "" -"Die Skeleton-Eigenschaft des Polygon2Ds zeigt nicht auf ein Skeleton2D-Node" +"Die Skeleton-Eigenschaft des Polygon2D zeigt nicht auf ein Skeleton2D-Node" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Sync Bones" @@ -6154,14 +6153,12 @@ msgstr "" "hinzugefügt werden." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "Ruhe-Pose erstellen (aus Knochen)" +msgstr "Ruhe-Pose aus Knochen erstellen" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "Ruhe-Pose erstellen (aus Knochen)" +msgstr "Knochen in Ruhe-Pose setzen" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6316,17 +6313,17 @@ msgid "Rear" msgstr "Hinten" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" -msgstr "Auf Sicht ausrichten" +msgstr "Mit Sicht ausrichten" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." -msgstr "Kein Node unter dem Unterobjekt instantiiert werden könnte vorhanden." +msgstr "" +"Kein Node, unter dem Unterobjekt instantiiert werden könnte, vorhanden." #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "This operation requires a single selected node." -msgstr "Diese Aktion benötigt ein einzelnes ausgewähltes Node." +msgstr "Diese Aktion benötigt einen einzelnen ausgewählten Node." #: editor/plugins/spatial_editor_plugin.cpp msgid "Lock View Rotation" @@ -6413,6 +6410,8 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"Hinweis: Die FPS-Anzeige stellt die Editor-Framerate dar.\n" +"Sie ist kein zuverlässiger Vergleichswert für die In-Spiel-Leistung." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6423,9 +6422,8 @@ msgid "XForm Dialog" msgstr "Transformationsdialog" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Am Boden einrasten" +msgstr "Nodes am Boden einrasten" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -7022,6 +7020,22 @@ msgid "Merge from Scene" msgstr "Aus Szene zusammenführen" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "Nächste Koordinate" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "Die nächste Form oder Kachel auswählen." + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "Vorherige Koordinate" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "Die vorherige Form oder Kachel auswählen." + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Bitmaske kopieren." @@ -7034,9 +7048,8 @@ msgid "Erase bitmask." msgstr "Bitmaske löschen." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Neue Nodes erstellen." +msgstr "Neues Rechteck erstellen." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7179,6 +7192,14 @@ msgid "Clear Tile Bitmask" msgstr "Kachel Bitmaske löschen" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "Polygon konkav machen" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "Polygon konvex machen" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Kachel entfernen" @@ -7220,26 +7241,23 @@ msgstr "TileSet" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "Uniform-Name festlegen" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Als Standard für ‚%s‘ setzen" +msgstr "Eingabestandardport festlegen" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "VisualShader" +msgstr "Visual Shader-Node hinzufügen" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" -msgstr "Dupliziere Node(s)" +msgstr "Nodes duplizieren" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "Visual-Shader-Eingabetyp geändert" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" @@ -7258,14 +7276,12 @@ msgid "VisualShader" msgstr "VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Kachelpriorität bearbeiten" +msgstr "Visuelle Eigenschaft bearbeiten" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Shader-Änderungen" +msgstr "Visual-Shader-Modus geändert" #: editor/project_export.cpp msgid "Runnable" @@ -7284,6 +7300,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"Export des Projekts für die Plattform ‚%s‘ fehlgeschlagen.\n" +"Exportvorlagen scheinen zu fehlen oder ungültig zu sein." #: editor/project_export.cpp msgid "" @@ -7291,6 +7309,9 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"Export des Projekts für die Plattform ‚%s‘ fehlgeschlagen.\n" +"Es könnte an einen fehlerhaften Einstellung in den Voreinstellungen oder den " +"individuellen Exporteinstellugen liegen." #: editor/project_export.cpp msgid "Release" @@ -7301,6 +7322,10 @@ msgid "Exporting All" msgstr "Exportiere alles" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "Der angegebene Export-Pfad existiert nicht:" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Export-Vorlagen für dieses Systeme fehlen / sind fehlerhaft:" @@ -8345,9 +8370,8 @@ msgid "Instantiated scenes can't become root" msgstr "Instantiierte Szenen können keine Wurzel werden" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "Szenen-Wurzel erstellen" +msgstr "Node zur Szenenwurzel machen" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8386,9 +8410,8 @@ msgid "Make Local" msgstr "Lokal machen" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Szenen-Wurzel erstellen" +msgstr "Neue Szenenwurzel" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8820,19 +8843,16 @@ msgid "Set From Tree" msgstr "Nach Szenenbaum einstellen" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Ausspannen" +msgstr "Tastenkürzel entfernen" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Tastenkürzel" +msgstr "Tastenkürzel wiederherstellen" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Ankerpunkte ändern" +msgstr "Tastenkürzel ändern" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -9431,9 +9451,8 @@ msgid "Change Input Value" msgstr "Eingabewert ändern" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "CanvasItem in Größe anpassen" +msgstr "Kommentargröße ändern" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -9872,8 +9891,8 @@ msgid "" "CPUParticles\" option for this purpose." msgstr "" "GPU-basierte Partikel werden vom GLES2-Grafiktreiber nicht unterstützt.\n" -"Verwenden Sie stattdessen den CPUParticles2D Node. Sie können dazu die " -"Option \"In CPUPartikel konvertieren\" verwenden." +"Stattdessen bitte CPUParticles2D-Nodes verwenden. Die „In CPU-Partikel " +"konvertieren“-Funktion kann dazu verwendet werden." #: scene/2d/particles_2d.cpp scene/3d/particles.cpp msgid "" @@ -10038,6 +10057,14 @@ msgstr "" "Damit CollisionShape funktionieren kann, muss eine Form vorhanden sein. " "Bitte erzeuge eine shape Ressource dafür!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" +"Plane-Shapes funktionieren nicht gut und werden in einer zukünftigen Version " +"entfernt. Von der Nutzung wird abgeraten." + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Nichts ist sichtbar da kein Mesh zugewiesen wurden." @@ -10054,6 +10081,14 @@ msgstr "" msgid "Plotting Meshes" msgstr "Plotte Mesh" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" +"GIProbes werden vom GLES2-Videotreiber nicht unterstützt.\n" +"BakedLightmaps können als Alternative verwendet werden." + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10075,8 +10110,8 @@ msgid "" "\" option for this purpose." msgstr "" "GPU-basierte Partikel werden vom GLES2-Grafiktreiber nicht unterstützt.\n" -"Verwenden Sie stattdessen den CPUParticles Knoten. Sie können dazu die " -"Option \"In CPUPartikel konvertieren\" verwenden." +"Stattdessen bitte CPUParticles-Nodes verwenden. Die „In CPU-Partikel " +"konvertieren“-Funktion kann dazu verwendet werden." #: scene/3d/particles.cpp msgid "" @@ -10235,6 +10270,18 @@ msgstr "Wechselt zwischen Hexadezimal- und Zahlenwerten." msgid "Add current color as a preset." msgstr "Aktuelle Farbe als Vorlage hinzufügen." +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" +"Einfache Container sind unnötig solange ihnen kein Skript angehängt ist das " +"die Platzierung der Inhalte vornimmt.\n" +"Falls kein Skript angehängt werden soll wird empfohlen ein einfaches " +"‚Control‘-Node zu verwenden." + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Warnung!" @@ -10243,6 +10290,10 @@ msgstr "Warnung!" msgid "Please Confirm..." msgstr "Bitte bestätigen..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "Gehe zu übergeordnetem Ordner." + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10331,6 +10382,10 @@ msgstr "Zuweisung an Uniform." msgid "Varyings can only be assigned in vertex function." msgstr "Varyings können nur in Vertex-Funktion zugewiesen werden." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Instantiiere gewählte Szene(n) als Unterobjekt des ausgewählten Nodes." + #~ msgid "FPS" #~ msgstr "FPS" @@ -11866,9 +11921,6 @@ msgstr "Varyings können nur in Vertex-Funktion zugewiesen werden." #~ msgid "Cannot go into subdir:" #~ msgstr "Unterordner kann nicht geöffnet werden:" -#~ msgid "Imported Resources" -#~ msgstr "Importierte Ressourcen" - #~ msgid "Insert Keys (Ins)" #~ msgstr "Schlüsselbilder einfügen (Einfg)" diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po index 74fd313a4a..4e1936ff60 100644 --- a/editor/translations/de_CH.po +++ b/editor/translations/de_CH.po @@ -1378,8 +1378,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1431,7 +1445,7 @@ msgstr "Datei öffnen" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1506,10 +1520,32 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Node(s) löschen" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Node erstellen" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1734,8 +1770,8 @@ msgstr "Script hinzufügen" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1744,6 +1780,16 @@ msgid "OK" msgstr "Okay" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -3016,14 +3062,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3169,10 +3207,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5183,19 +5217,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5292,11 +5326,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6983,6 +7017,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7139,6 +7189,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Node erstellen" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Ungültige Bilder löschen" @@ -7266,6 +7325,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9929,6 +9992,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9943,6 +10012,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10092,6 +10167,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Alert!" @@ -10100,6 +10183,11 @@ msgstr "Alert!" msgid "Please Confirm..." msgstr "Bitte bestätigen..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Node erstellen" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot index efb591227c..e4f8311ba2 100644 --- a/editor/translations/editor.pot +++ b/editor/translations/editor.pot @@ -1329,8 +1329,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1378,7 +1392,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1453,10 +1467,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1672,8 +1706,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1682,6 +1716,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2916,14 +2960,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3059,10 +3095,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -4991,19 +5023,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5094,11 +5126,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6731,6 +6763,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6869,6 +6917,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -6986,6 +7042,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9537,6 +9597,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9551,6 +9617,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9694,6 +9766,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9702,6 +9782,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/el.po b/editor/translations/el.po index e5e0a8a5a3..8feb019a6f 100644 --- a/editor/translations/el.po +++ b/editor/translations/el.po @@ -3,12 +3,13 @@ # Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) # This file is distributed under the same license as the Godot source code. # George Tsiamasiotis <gtsiam@windowslive.com>, 2017-2018. +# Georgios Katsanakis <geo.elgeo@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2018-12-13 14:39+0100\n" -"Last-Translator: George Tsiamasiotis <gtsiam@windowslive.com>\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" +"Last-Translator: Georgios Katsanakis <geo.elgeo@gmail.com>\n" "Language-Team: Greek <https://hosted.weblate.org/projects/godot-engine/godot/" "el/>\n" "Language: el\n" @@ -16,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Poedit 2.2\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -86,14 +87,12 @@ msgid "Delete Selected Key(s)" msgstr "ΔιαγÏαφή επιλογής" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Î Ïοσθήκη σημείου" +msgstr "Î Ïοσθήκη σημείου Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Μετακίνηση σημείου" +msgstr "Μετακίνηση σημείου Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -1388,8 +1387,22 @@ msgstr "ΠακετάÏισμα" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1442,7 +1455,7 @@ msgstr "Εμφάνιση στη διαχείÏιση αÏχείων" msgid "New Folder..." msgstr "ÎÎος φάκελος..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Αναναίωση" @@ -1517,10 +1530,33 @@ msgstr "Μετακίνηση αγαπημÎνου πάνω" msgid "Move Favorite Down" msgstr "Μετακίνηση αγαπημÎνου κάτω" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Î ÏοηγοÏμενο πάτωμα" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Επόμενο πάτωμα" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Πήγαινε στον γονικό φάκελο" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "ΑδÏνατη η δημιουÏγία φακÎλου." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Εμφάνιση αντικειμÎνων σε πλÎγμα μικÏγÏαφιών." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Εμφάνιση αντικειμÎνων σε λίστα." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Φάκελοι & ΑÏχεία:" @@ -1761,9 +1797,9 @@ msgstr "ΕκκαθάÏιση εξόδου" msgid "Project export failed with error code %d." msgstr "Η εξαγωγή του ÎÏγου απÎτυχε με κωδικό %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Σφάλμα κατά την αποθήκευση πόÏου!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1771,6 +1807,16 @@ msgid "OK" msgstr "Εντάξει" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Σφάλμα κατά την αποθήκευση πόÏου!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Αποθήκευση πόÏου ως..." @@ -3099,14 +3145,6 @@ msgstr "" "Δεν ήταν δυνατή η πλοήγηση στο '%s', καθώς δεν βÏÎθηκε στο σÏστημα αÏχείων!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Εμφάνιση αντικειμÎνων σε πλÎγμα μικÏγÏαφιών." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Εμφάνιση αντικειμÎνων σε λίστα." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Κατάσταση: Η εισαγωγή απÎτυχε. ΠαÏακαλοÏμε διοÏθώστε το αÏχείο και " @@ -3249,12 +3287,6 @@ msgid "Search files" msgstr "Αναζήτηση αÏχείων" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" -"ΔημιουÏγία στιγμιοτÏπων των επιλεγμÎνων σκηνών ως παιδιά του επιλεγμÎνου " -"κόμβου." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5272,6 +5304,10 @@ msgid "Generating Visibility Rect" msgstr "ΔημιουÏγία οÏθογωνίου οÏατότητας" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "ΔημιουÏγία οÏθογωνίου οÏατότητας" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Ο οÏισμός σημείου είναι δυνατός μόνο σε Îνα υλικό επεξεÏγασίας " @@ -5286,10 +5322,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Δεν υπάÏχουν εικονοστοιχεία με διαφάνεια >128 στην εικόνα..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "ΔημιουÏγία οÏθογωνίου οÏατότητας" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "ΦόÏτωση μάσκας εκπομπής" @@ -5377,13 +5409,13 @@ msgid "Generating AABB" msgstr "ΔημιουÏία AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "ΔημιουÏία AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "ΔημιουÏία AABB οÏατότητας" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "ΔημιουÏία AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "ΑφαίÏεση σημείου από την καμπÏλη" @@ -7104,6 +7136,24 @@ msgid "Merge from Scene" msgstr "Συγχώνευση από σκηνή" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Επόμενο πάτωμα" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Î ÏοηγοÏμενο πάτωμα" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7267,6 +7317,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Μετακίνηση πολυγώνου" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Μετακίνηση πολυγώνου" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "ΑφαίÏεση Ï€ÏοτÏπου" @@ -7403,6 +7463,11 @@ msgid "Exporting All" msgstr "Εξαγωγή για %s" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "Η διαδÏομή δεν υπάÏχει." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "Τα Ï€Ïότυπα εξαγωγής για αυτή την πλατφόÏτμα λείπουν ή είναι κατεστÏαμμÎνα:" @@ -10153,6 +10218,12 @@ msgstr "" "Ένα σχήμα Ï€ÏÎπει να δοθεί στο CollisionShape για να λειτουÏγήσει. " "ΔημιουÏγήστε Îνα πόÏο σχήματος για αυτό!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp #, fuzzy msgid "Nothing is visible because no mesh has been assigned." @@ -10169,6 +10240,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "ΤοποθÎτηση πλεγμάτων" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10343,6 +10420,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Î Ïοσθήκη του Ï„ÏÎχοντος χÏώματος ως Ï€ÏοκαθοÏισμÎνο" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Ειδοποίηση!" @@ -10351,6 +10436,11 @@ msgstr "Ειδοποίηση!" msgid "Please Confirm..." msgstr "ΠαÏακαλώ επιβεβαιώστε..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Πήγαινε στον γονικό φάκελο" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10438,6 +10528,11 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "ΔημιουÏγία στιγμιοτÏπων των επιλεγμÎνων σκηνών ως παιδιά του επιλεγμÎνου " +#~ "κόμβου." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/es.po b/editor/translations/es.po index b6bed3ee52..cfa46ff602 100644 --- a/editor/translations/es.po +++ b/editor/translations/es.po @@ -5,7 +5,7 @@ # Addiel Lucena Perez <addiell2017@gmail.com>, 2017. # Aleix Sanchis <aleixsanchis@hotmail.com>, 2017, 2018. # Alejandro Alvarez <eliluminado00@gmail.com>, 2017. -# Avocado <avocadosan42@gmail.com>, 2018. +# Avocado <avocadosan42@gmail.com>, 2018, 2019. # BLaDoM GUY <simplybladom@gmail.com>, 2017. # Carlos López <genetita@gmail.com>, 2016. # David Arranz <davarrcal@hotmail.com>, 2018. @@ -42,8 +42,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-21 21:18+0000\n" -"Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" +"PO-Revision-Date: 2019-03-06 00:10+0000\n" +"Last-Translator: eon-s <emanuel.segretin@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot/es/>\n" "Language: es\n" @@ -51,7 +51,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -120,14 +120,12 @@ msgid "Delete Selected Key(s)" msgstr "Eliminar Clave(s) Seleccionada(s)" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Añadir punto" +msgstr "Añadir Punto Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Mover Puntos" +msgstr "Mover Puntos Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -158,9 +156,8 @@ msgid "Anim Change Call" msgstr "Cambiar llamada de animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Cambiar repetición de animación" +msgstr "Cambiar duración de la animación" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -217,9 +214,8 @@ msgid "Anim Clips:" msgstr "Clips de Anim:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Cambiar valor del array" +msgstr "Cambiar ruta de la pista" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -246,9 +242,8 @@ msgid "Time (s): " msgstr "Tiempo (s): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Activar Doppler" +msgstr "Pista de Conmutación Activada" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -301,19 +296,16 @@ msgid "Delete Key(s)" msgstr "Eliminar Clave(s)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Cambiar nombre de animación:" +msgstr "Cambiar Modo de Actualización de Animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Modo de Interpolación" +msgstr "Cambiar Modo de Interpolación de Animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Cambiar repetición de animación" +msgstr "Cambiar Modo Loop de Animación" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -357,14 +349,12 @@ msgid "Anim Insert Key" msgstr "Insertar clave de animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Cambiar FPS de animación" +msgstr "Cambiar Step de Animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Reordenar Autoloads" +msgstr "Reordenar Pistas" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -397,9 +387,8 @@ msgid "Not possible to add a new track without a root" msgstr "No es posible agregar una nueva pista sin una raÃz" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Agregar Pista" +msgstr "Añadir Pista Bezier" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -411,25 +400,22 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "La pista no es de tipo Spatial, no se puede insertar la clave" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Pista de Transformación 3D" +msgstr "Añadir Clave de Pista de Transformación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Agregar Pista" +msgstr "Añadir Clave de Pista" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." msgstr "" -"La ruta de la pista es inválida, por ende no se pueden agregar claves de " -"métodos." +"La ruta de la pista es inválida, por lo que no se puede añadir una clave de " +"método." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Pista de Llamada a Métodos" +msgstr "Añadir Clave de Pista de Método" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -592,17 +578,16 @@ msgid "Copy" msgstr "Copiar" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Clips de Audio:" +msgstr "Añadir Clip de Pista de Audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Cambiar Desplazamiento de Inicio de Clip de Pista de Audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Cambiar Desplazamiento Final del Clip de Pista de Audio" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -936,7 +921,7 @@ msgstr "Error al cargar:" #: editor/dependency_editor.cpp msgid "Load failed due to missing dependencies:" -msgstr "Fallo la carga debido a dependencias faltantes:" +msgstr "Falló la carga debido a dependencias faltantes:" #: editor/dependency_editor.cpp editor/editor_node.cpp msgid "Open Anyway" @@ -1088,7 +1073,7 @@ msgstr "Descomprimiendo assets" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Package installed successfully!" -msgstr "¡Paquete instalado exitosamente!" +msgstr "¡Paquete instalado con éxito!" #: editor/editor_asset_installer.cpp #: editor/plugins/asset_library_editor_plugin.cpp @@ -1418,10 +1403,33 @@ msgid "Packing" msgstr "Empaquetando" #: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"La plataforma de destino requiere compresión de texturas 'ETC' para GLES2. " +"Activa el soporte en Ajustes del Proyecto." + +#: editor/editor_export.cpp +#, fuzzy msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." msgstr "" +"La plataforma de destino requiere compresión de texturas 'ETC' para GLES2. " +"Activa el soporte en Ajustes del Proyecto." + +#: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." +msgstr "" +"La plataforma de destino requiere compresión de texturas 'ETC' para GLES2. " +"Activa el soporte en Ajustes del Proyecto." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1468,7 +1476,7 @@ msgstr "Mostrar en Explorador de Archivos" msgid "New Folder..." msgstr "Nueva carpeta..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Recargar" @@ -1529,7 +1537,7 @@ msgstr "Añadir/quitar favorito" #: editor/editor_file_dialog.cpp msgid "Toggle Mode" -msgstr "Cambiar modo" +msgstr "Cambiar Modo" #: editor/editor_file_dialog.cpp msgid "Focus Path" @@ -1543,10 +1551,33 @@ msgstr "Subir Favorito" msgid "Move Favorite Down" msgstr "Bajar Favorito" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Suelo anterior" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Siguiente suelo" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Ir a la carpeta principal" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "No se pudo crear la carpeta." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Ver Ãtems como una cuadrÃcula de miniaturas." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Ver Ãtems como una lista." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Directorios y archivos:" @@ -1642,7 +1673,7 @@ msgstr "Constantes:" #: editor/editor_help.cpp msgid "Class Description" -msgstr "Descripción de Clase" +msgstr "Descripción de la Clase" #: editor/editor_help.cpp msgid "Class Description:" @@ -1769,9 +1800,10 @@ msgstr "Borrar salida" msgid "Project export failed with error code %d." msgstr "La exportación del proyecto falló con el código de error %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "¡Error al guardar el recurso!" +#: editor/editor_node.cpp +#, fuzzy +msgid "Imported resources can't be saved." +msgstr "Importar Recursos" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1779,6 +1811,16 @@ msgid "OK" msgstr "Aceptar" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "¡Error al guardar el recurso!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Guardar recurso como..." @@ -2002,14 +2044,12 @@ msgid "Save changes to '%s' before closing?" msgstr "¿Guardar cambios de '%s' antes de cerrar?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Error al cargar el recurso." +msgstr "Guardado %s recurso(s) modificado(s)." #: editor/editor_node.cpp -#, fuzzy msgid "A root node is required to save the scene." -msgstr "Solo se requiere un archivo para textura grande." +msgstr "Se necesita un nodo raÃz para guardar la escena." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -2440,7 +2480,7 @@ msgstr "Ajustes de diseño del editor" #: editor/editor_node.cpp msgid "Toggle Fullscreen" -msgstr "Act/desact. pantalla completa" +msgstr "Act/desact. Pantalla Completa" #: editor/editor_node.cpp msgid "Open Editor Data/Settings Folder" @@ -3109,14 +3149,6 @@ msgstr "" "archivos!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Ver Ãtems como una cuadrÃcula de miniaturas." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Ver Ãtems como una lista." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Estado: No se pudo importar el archivo. Por favor, arregla el archivo y " @@ -3247,18 +3279,13 @@ msgstr "Re-escanear sistema de archivos" #: editor/filesystem_dock.cpp msgid "Toggle split mode" -msgstr "Act/Desact. Modo Partido" +msgstr "Act/Desact. Modo Dividido" #: editor/filesystem_dock.cpp msgid "Search files" msgstr "Buscar archivos" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" -"Instanciar la(s) escena(s) seleccionadas como hijas del nodo seleccionado." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3660,19 +3687,16 @@ msgstr "Cargar..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "Mover Puntos" +msgstr "Mover Punto de Nodo" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Cambiar tiempo de mezcla" +msgstr "Cambiar LÃmites de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Cambiar tiempo de mezcla" +msgstr "Cambiar Etiquetas de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3683,24 +3707,21 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Añadir nodo" +msgstr "Añadir Punto de Nodo" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Añadir animación" +msgstr "Añadir Punto de Animación" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Quitar punto de ruta" +msgstr "Eliminar Punto BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "Mover Punto de Nodo de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3746,29 +3767,24 @@ msgid "Triangle already exists" msgstr "El triángulo ya existe" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Añadir variable" +msgstr "Añadir Triángulo" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Cambiar tiempo de mezcla" +msgstr "Cambiar LÃmites de BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Cambiar tiempo de mezcla" +msgstr "Cambiar Etiquetas de BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Quitar punto de ruta" +msgstr "Eliminar Punto BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Quitar variable" +msgstr "Eliminar Triángulo BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3779,9 +3795,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "No hay ningún triángulo, asà que no se puede hacer blending." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Act/desact. globales de Autoload" +msgstr "Act/desact. Auto Triángulos" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3801,9 +3816,8 @@ msgid "Blend:" msgstr "Mezcla:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Cambios del material" +msgstr "Parámetro Modificado" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3815,15 +3829,13 @@ msgid "Output node can't be added to the blend tree." msgstr "El nodo de salida no puede ser agregado al blend tree." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Añadir nodo(s) desde árbol" +msgstr "Añadir Nodo a BlendTree" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Modo movimiento" +msgstr "Nodo Movido" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3834,36 +3846,30 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Conectado" +msgstr "Nodos Conectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Desconectado" +msgstr "Nodos Desconectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Nueva Animación" +msgstr "Establecer Animación" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Eliminar nodo(s)" +msgstr "Eliminar Nodo" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Act./Desact. esta pista." +msgstr "Act./Desact. Filtro On/Off" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Cambiar filtro de localización" +msgstr "Cambiar Filtro" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3888,9 +3894,8 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Nombre del nodo" +msgstr "Nodo Renombrado" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3908,7 +3913,7 @@ msgstr "Habilitar filtrado" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Toggle Autoplay" -msgstr "Act/desact. reproducción automática" +msgstr "Act/desact. Reproducción Automática" #: editor/plugins/animation_player_editor_plugin.cpp msgid "New Animation Name:" @@ -4120,14 +4125,12 @@ msgid "Cross-Animation Blend Times" msgstr "Cross-Animation Blend Times" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Modo movimiento" +msgstr "Mover Nodo" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Añadir traducción" +msgstr "Añadir Transición" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4163,18 +4166,16 @@ msgid "No playback resource set at path: %s." msgstr "Ningún recurso de reproducción asignado en la ruta: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Eliminado:" +msgstr "Nodo Eliminado" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Nodo Transition" +msgstr "Transición Eliminada" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Establecer Nodo de Inicio (Reproducción Automática)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4533,7 +4534,7 @@ msgstr "Configurar Snap" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Grid Offset:" -msgstr "Desplazamiento de cuadrÃcula:" +msgstr "Desplazamiento de CuadrÃcula:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Grid Step:" @@ -4541,7 +4542,7 @@ msgstr "Step de cuadrÃcula:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Offset:" -msgstr "Desplazamiento de rotación:" +msgstr "Desplazamiento de Rotación:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Step:" @@ -5000,7 +5001,7 @@ msgstr "Precalcular GI Probe" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Degradado Editado" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5264,6 +5265,10 @@ msgid "Generating Visibility Rect" msgstr "Generando Rect. de Visibilidad" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Generar rectángulo de visibilidad" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Solo se puede asignar un punto a un material de procesado ParticlesMaterial" @@ -5277,10 +5282,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "No hay pÃxeles con transparencia > 128 en la imagen..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Generar rectángulo de visibilidad" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Cargar máscara de emisión" @@ -5368,13 +5369,13 @@ msgid "Generating AABB" msgstr "Generando AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Generar AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Generar AABB de visibilidad" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Generar AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Borrar punto de la curva" @@ -5685,11 +5686,11 @@ msgstr "Configurar cuadrÃcula:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Offset X:" -msgstr "Desplazamiento de cuadrÃcula en X:" +msgstr "Desplazamiento de CuadrÃcula en X:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Offset Y:" -msgstr "Desplazamiento de cuadrÃcula en Y:" +msgstr "Desplazamiento de CuadrÃcula en Y:" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Step X:" @@ -6156,14 +6157,12 @@ msgid "This skeleton has no bones, create some children Bone2D nodes." msgstr "Este esqueleto no tiene huesos, crea algunos nodos Bone2D hijos." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "Crear Pose de Descanso (De los Huesos)" +msgstr "Crear Pose de Descanso a partir de los Huesos" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "Crear Pose de Descanso (De los Huesos)" +msgstr "Establecer Pose de Descanso en los Huesos" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6227,7 +6226,7 @@ msgstr "Escalado: " #: editor/plugins/spatial_editor_plugin.cpp msgid "Translating: " -msgstr "Traduciendo: " +msgstr "Trasladando: " #: editor/plugins/spatial_editor_plugin.cpp msgid "Rotating %s degrees." @@ -6318,9 +6317,8 @@ msgid "Rear" msgstr "Detrás" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" -msgstr "Alinear con vista" +msgstr "Alinear con Vista" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." @@ -6415,6 +6413,8 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"Nota: El valor FPS que se muestra es la velocidad de fotogramas del editor.\n" +"No se puede utilizar como un indicador fiable del rendimiento en el juego." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6425,9 +6425,8 @@ msgid "XForm Dialog" msgstr "Diálogo XForm" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Ajustar al suelo" +msgstr "Ajustar Nodos al Suelo" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -7022,6 +7021,24 @@ msgid "Merge from Scene" msgstr "Unir desde escena" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Siguiente suelo" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Suelo anterior" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Copiar bitmask." @@ -7034,9 +7051,8 @@ msgid "Erase bitmask." msgstr "Borrar bitmask." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Crear nuevos nodos." +msgstr "Cree un nuevo rectángulo." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7177,6 +7193,16 @@ msgid "Clear Tile Bitmask" msgstr "Reestablecer Máscara de Bits de Tile" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Concave" +msgstr "Mover polÃgono" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Mover polÃgono" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Eliminar Tile" @@ -7218,26 +7244,23 @@ msgstr "TileSet" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "Establecer Nombre Uniforme" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Configurar por defecto para '%s'" +msgstr "Establecer Puerto Predeterminado de Entrada" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "VisualShader" +msgstr "Añadir Nodo al Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" -msgstr "Duplicar nodo(s)" +msgstr "Duplicar Nodos" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "Cambiar Tipo de Entrada del Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" @@ -7256,14 +7279,12 @@ msgid "VisualShader" msgstr "VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Editar Prioridad del Tile" +msgstr "Editar Propiedad Visual" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Cambios del shader" +msgstr "Se ha cambiado el Modo de Visual Shader" #: editor/project_export.cpp msgid "Runnable" @@ -7282,6 +7303,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"No se pudo exportar el proyecto para la plataforma '%s'.\n" +"Las plantillas de exportación parecen faltar o ser inválidas." #: editor/project_export.cpp msgid "" @@ -7289,6 +7312,9 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"No se pudo exportar el proyecto para la plataforma '%s'.\n" +"Esto puede ser debido a un problema de configuración en el preset de " +"exportación o en los ajustes de exportación." #: editor/project_export.cpp msgid "Release" @@ -7299,6 +7325,11 @@ msgid "Exporting All" msgstr "Exportar Todo" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "La ruta no existe." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "Las plantillas de exportación para esta plataforma faltan/están corruptas:" @@ -8344,9 +8375,8 @@ msgid "Instantiated scenes can't become root" msgstr "Las escenas instanciadas no pueden ser raÃz" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "Convertir en raÃz de escena" +msgstr "Convertir nodo como RaÃz" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8385,9 +8415,8 @@ msgid "Make Local" msgstr "Crear local" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Convertir en raÃz de escena" +msgstr "Nueva RaÃz de Escena" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8819,19 +8848,16 @@ msgid "Set From Tree" msgstr "Establecer desde árbol" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Transición de salida" +msgstr "Eliminar Atajo" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Atajos" +msgstr "Restaurar Atajo" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Cambiar anclas" +msgstr "Cambiar Atajo" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -9042,9 +9068,8 @@ msgid "GridMap Duplicate Selection" msgstr "GridMap Duplicar selección" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paint" -msgstr "Coloreado de GridMap" +msgstr "Pintar GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Grid Map" @@ -9433,9 +9458,8 @@ msgid "Change Input Value" msgstr "Cambiar valor de entrada" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "Redimensionar CanvasItem" +msgstr "Redimensionar Comentario" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -10046,6 +10070,12 @@ msgstr "" "Se debe proveer de una forma a CollisionShape para que funcione. Por favor, " "¡crea un recurso \"shape\"!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Nada visible ya que no se asignó ningún mesh." @@ -10062,6 +10092,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "Trazando mallas" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10237,6 +10273,14 @@ msgstr "Cambiar entre valores hexadecimales y de código." msgid "Add current color as a preset." msgstr "Añadir el color actual como preset." +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "¡Alerta!" @@ -10245,6 +10289,11 @@ msgstr "¡Alerta!" msgid "Please Confirm..." msgstr "Por favor, confirma..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Ir a la carpeta principal" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10329,6 +10378,10 @@ msgstr "Asignación a uniform." msgid "Varyings can only be assigned in vertex function." msgstr "Solo se pueden asignar variaciones en funciones de vértice." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Instanciar la(s) escena(s) seleccionadas como hijas del nodo seleccionado." + #~ msgid "FPS" #~ msgstr "FPS" @@ -11904,9 +11957,6 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." #~ msgid "Cannot go into subdir:" #~ msgstr "No se puede acceder al subdir:" -#~ msgid "Imported Resources" -#~ msgstr "Importar Recursos" - #~ msgid "Insert Keys (Ins)" #~ msgstr "Insertar Claves (Ins)" diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po index 94950398af..cf5679d972 100644 --- a/editor/translations/es_AR.po +++ b/editor/translations/es_AR.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-18 08:54+0000\n" +"PO-Revision-Date: 2019-03-08 15:04+0000\n" "Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n" "Language-Team: Spanish (Argentina) <https://hosted.weblate.org/projects/" "godot-engine/godot/es_AR/>\n" @@ -23,7 +23,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -91,14 +91,12 @@ msgid "Delete Selected Key(s)" msgstr "Eliminar Clave(s) Seleccionada(s)" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Agregar punto" +msgstr "Agregar Punto Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Mover Puntos" +msgstr "Mover Puntos Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -129,9 +127,8 @@ msgid "Anim Change Call" msgstr "Cambiar Call de Anim" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Cambiar Loop de Animación" +msgstr "Cambiar Duración de la Animación" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -188,9 +185,8 @@ msgid "Anim Clips:" msgstr "Clips de Anim:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Cambiar Valor del Array" +msgstr "Cambiar Ruta de la Pista" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -217,9 +213,8 @@ msgid "Time (s): " msgstr "Tiempo (s): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Activar Doppler" +msgstr "Activar/Desactivar Pista" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -272,19 +267,16 @@ msgid "Delete Key(s)" msgstr "Eliminar Clave(s)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Cambiar Nombre de Animación:" +msgstr "Cambiar Modo de Actualización de Animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Modo de Interpolación" +msgstr "Cambiar Modo de Interpolación de Animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Cambiar Loop de Animación" +msgstr "Cambiar Modo de Bucle de Animación" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -328,14 +320,12 @@ msgid "Anim Insert Key" msgstr "Insertar Clave de Animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Cambiar FPS de Animación" +msgstr "Cambiar Step de Animación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Reordenar Autoloads" +msgstr "Reordenar Pistas" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -368,9 +358,8 @@ msgid "Not possible to add a new track without a root" msgstr "No es posible agregar una nueva pista sin una raÃz" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Agregar Pista" +msgstr "Agregar Pista Bezier" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -381,14 +370,12 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "La pista no es de tipo Spatial, no se puede insertar la clave" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Pista de Transformación 3D" +msgstr "Añadir Clave de Pista de Transformación" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Agregar Pista" +msgstr "Añadir Clave de Pista" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." @@ -397,9 +384,8 @@ msgstr "" "métodos." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Pista de Llamada a Métodos" +msgstr "Agregar Clave de Pista de Método" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -562,17 +548,16 @@ msgid "Copy" msgstr "Copiar" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Clips de Audio:" +msgstr "Agregar Clip de Pista de Audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Cambiar Offset Inicial de Clip de Pista de Audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Cambiar Offset Final de Clip de Pista de Audio" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -643,9 +628,8 @@ msgid "Warnings" msgstr "Advertencias" #: editor/code_editor.cpp -#, fuzzy msgid "Line and column numbers." -msgstr "Números de lÃnea y columna" +msgstr "Números de lÃnea y columna." #: editor/connections_dialog.cpp msgid "Method in target Node must be specified!" @@ -1203,9 +1187,8 @@ msgid "Add Bus" msgstr "Agregar Bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add a new Audio Bus to this layout." -msgstr "Guardar Layout de Bus de Audio Como..." +msgstr "Agregar un nuevo Bus de Audio a este layout." #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp @@ -1387,10 +1370,33 @@ msgid "Packing" msgstr "Empaquetando" #: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"La plataforma de destino requiere compresión de texturas 'ETC' para GLES2. " +"Activá el soporte en Ajustes del Proyecto." + +#: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"La plataforma de destino requiere compresión de texturas 'ETC' para GLES2. " +"Activá el soporte en Ajustes del Proyecto." + +#: editor/editor_export.cpp +#, fuzzy msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" +"La plataforma de destino requiere compresión de texturas 'ETC' para GLES2. " +"Activá el soporte en Ajustes del Proyecto." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1437,7 +1443,7 @@ msgstr "Mostrar en Explorador de Archivos" msgid "New Folder..." msgstr "Nueva Carpeta..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Refrescar" @@ -1512,10 +1518,33 @@ msgstr "Subir Favorito" msgid "Move Favorite Down" msgstr "Bajar Favorito" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Piso Anterior" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Piso Siguiente" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Ir a carpeta padre" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "No se pudo crear la carpeta." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Ver Ãtems como una grilla de miniaturas." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Ver Ãtems como una lista." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Directorios y Archivos:" @@ -1738,9 +1767,10 @@ msgstr "Limpiar Salida" msgid "Project export failed with error code %d." msgstr "La exportación del proyecto falló con el código de error %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Error al guardar el recurso!" +#: editor/editor_node.cpp +#, fuzzy +msgid "Imported resources can't be saved." +msgstr "Importar Recursos" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1748,6 +1778,16 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Error al guardar el recurso!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Guardar Recurso Como..." @@ -1972,14 +2012,12 @@ msgid "Save changes to '%s' before closing?" msgstr "Guardar cambios a '%s' antes de cerrar?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Fallo al cargar recurso." +msgstr "Se guardaron %s recurso(s) modificado(s)." #: editor/editor_node.cpp -#, fuzzy msgid "A root node is required to save the scene." -msgstr "Solo se requiere un archivo para textura grande." +msgstr "Se necesita un nodo raÃz para guardar la escena." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -2509,9 +2547,8 @@ msgid "Save & Restart" msgstr "Guardar y Reiniciar" #: editor/editor_node.cpp -#, fuzzy msgid "Spins when the editor window redraws." -msgstr "Gira cuando la ventana del editor repinta!" +msgstr "Gira cuando la ventana del editor se redibuja." #: editor/editor_node.cpp msgid "Update Always" @@ -3077,14 +3114,6 @@ msgstr "" "No se puede navegar a '%s' ya que no se encontro en el sistema de archivos!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Ver Ãtems como una grilla de miniaturas." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Ver Ãtems como una lista." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Estado: Falló la importación del archivo. Por favor arreglá el archivo y " @@ -3222,11 +3251,6 @@ msgid "Search files" msgstr "Buscar archivos" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" -"Instanciar la(s) escena(s) seleccionadas como hijas del nodo seleccionado." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3629,19 +3653,16 @@ msgstr "Cargar..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "Mover Puntos" +msgstr "Mover Punto de Nodo" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Cambiar Tiempo de Blend" +msgstr "Cambiar LÃmites de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Cambiar Tiempo de Blend" +msgstr "Cambiar Etiquetas de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3652,24 +3673,21 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Agregar Nodo" +msgstr "Agregar Punto de Nodo" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Agregar Animación" +msgstr "Añadir Punto de Animación" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Quitar Punto del Path" +msgstr "Eliminar Punto BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "Mover Punto de Nodo de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3715,29 +3733,24 @@ msgid "Triangle already exists" msgstr "El triángulo ya existe" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Agregar Variable" +msgstr "Agregar Triángulo" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Cambiar Tiempo de Blend" +msgstr "Cambiar LÃmites de BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Cambiar Tiempo de Blend" +msgstr "Cambiar Etiquetas de BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Quitar Punto del Path" +msgstr "Quitar Punto BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Quitar Variable" +msgstr "Quitar Triángulo BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3748,9 +3761,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "No hay ningún triángulo, asà que no se puede hacer blending." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Act/Desact. AutoLoad Globals" +msgstr "Act/Desact. Auto Triángulos" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3770,9 +3782,8 @@ msgid "Blend:" msgstr "Blend:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Cambios de Material" +msgstr "Parámetro Modificado" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3784,15 +3795,13 @@ msgid "Output node can't be added to the blend tree." msgstr "El nodo de salida no puede ser agregado al blend tree." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Agregar Nodo(s) Desde Arbol" +msgstr "Agregar Nodo al BlendTree" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Modo Mover" +msgstr "Nodo Movido" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3803,36 +3812,30 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Conectado" +msgstr "Nodos Conectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Desconectado" +msgstr "Nodos Desconectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Nueva Animación" +msgstr "Establecer Animación" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Eliminar Nodo(s)" +msgstr "Eliminar Nodo" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Act./Desact. esta pista." +msgstr "Act./Desact. Filtro On/Off" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Cambiar Filtro de Locale" +msgstr "Cambiar Filtro" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3857,9 +3860,8 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Nombre del Nodo" +msgstr "Nodo Renombrado" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4089,14 +4091,12 @@ msgid "Cross-Animation Blend Times" msgstr "Cross-Animation Blend Times" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Modo Mover" +msgstr "Mover Nodo" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Agregar Traducción" +msgstr "Agregar Transición" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4132,18 +4132,16 @@ msgid "No playback resource set at path: %s." msgstr "Ningún recurso de reproducción asignado en la ruta: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Removido:" +msgstr "Nodo Eliminado" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Nodo Transición" +msgstr "Transición Eliminada" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Establecer Nodo de Inicio (Reproducción Automática)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4968,7 +4966,7 @@ msgstr "Hacer Bake de GI Probe" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Degradado Editado" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5227,6 +5225,10 @@ msgid "Generating Visibility Rect" msgstr "Generando Rect. de Visibilidad" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Generar Rect. de Visibilidad" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Solo se puede setear un punto en un material de proceso ParticlesMaterial" @@ -5240,10 +5242,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Sin pixeles con transparencia > 128 en imagen..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Generar Rect. de Visibilidad" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Cargar Máscara de Emisión" @@ -5331,13 +5329,13 @@ msgid "Generating AABB" msgstr "Generando AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Generar AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Generar AABB de Visibilidad" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Generar AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Remover Punto de Curva" @@ -5496,6 +5494,8 @@ msgid "" "Polygon 2D has internal vertices, so it can no longer be edited in the " "viewport." msgstr "" +"El polÃgono 2D tiene vértices internos, por lo que ya no se puede editar en " +"el viewport." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create Polygon & UV" @@ -6117,14 +6117,12 @@ msgid "This skeleton has no bones, create some children Bone2D nodes." msgstr "Este esqueleto no tiene huesos, crea algunos nodos Bone2D hijos." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "Crear Pose de Descanso" +msgstr "Crear Pose de Descanso a partir de Huesos" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "Crear Pose de Descanso" +msgstr "Asignar Pose de Descanso a Huesos" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6279,9 +6277,8 @@ msgid "Rear" msgstr "Detrás" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" -msgstr "Alinear con vista" +msgstr "Alinear con Vista" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." @@ -6376,6 +6373,8 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"Nota: El valor FPS que se muestra es la velocidad de fotogramas del editor.\n" +"No se puede utilizar como un indicador fiable del rendimiento en el juego." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6386,9 +6385,8 @@ msgid "XForm Dialog" msgstr "Dialogo XForm" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Ajustar al suelo" +msgstr "Ajustar Nodos al Suelo" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -6983,6 +6981,24 @@ msgid "Merge from Scene" msgstr "Mergear desde Escena" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Piso Siguiente" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Piso Anterior" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Copiar bitmask." @@ -6995,9 +7011,8 @@ msgid "Erase bitmask." msgstr "Borrar bitmask." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Crear nuevos nodos." +msgstr "Crear un rectángulo nuevo." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7137,6 +7152,16 @@ msgid "Clear Tile Bitmask" msgstr "Reestablecer Máscara de Bits de Tile" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Concave" +msgstr "Mover PolÃgono" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Mover PolÃgono" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Remover Tile" @@ -7178,26 +7203,23 @@ msgstr "TileSet" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "Asignar Nombre a Uniform" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Asignar como Predeterminado para '%s'" +msgstr "Establecer Puerto Predeterminado de Entrada" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "VisualShader" +msgstr "Agregar Nodo al Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" -msgstr "Duplicar Nodo(s)" +msgstr "Duplicar Nodos" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "Se cambió el Tipo de Entrada de Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" @@ -7216,14 +7238,12 @@ msgid "VisualShader" msgstr "VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Editar Prioridad de Tile" +msgstr "Editar Propiedad Visual" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Cambios de Shader" +msgstr "Se cambió el Modo de Visual Shader" #: editor/project_export.cpp msgid "Runnable" @@ -7242,6 +7262,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"No se pudo exportar el proyecto para la plataforma '%s'.\n" +"Las plantillas de exportación parecen faltar o ser inválidas." #: editor/project_export.cpp msgid "" @@ -7249,6 +7271,9 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"No se pudo exportar el proyecto para la plataforma '%s'.\n" +"Esto puede ser debido a un problema de configuración en el preset de " +"exportación o en los ajustes de exportación." #: editor/project_export.cpp msgid "Release" @@ -7259,6 +7284,11 @@ msgid "Exporting All" msgstr "Exportar Todo" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "La ruta no existe." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "Las plantillas de exportación para esta plataforma están faltando o " @@ -8305,9 +8335,8 @@ msgid "Instantiated scenes can't become root" msgstr "Las escenas instanciadas no pueden convertirse en raÃz" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "Convertir en RaÃz de Escena" +msgstr "Convertir nodo en RaÃz" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8346,9 +8375,8 @@ msgid "Make Local" msgstr "Crear Local" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Convertir en RaÃz de Escena" +msgstr "Nueva RaÃz de Escena" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8781,19 +8809,16 @@ msgid "Set From Tree" msgstr "Setear Desde Arbol" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Ease out" +msgstr "Eliminar Atajo" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Atajos" +msgstr "Restaurar Atajo" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Cambiar Anclas" +msgstr "Cambiar Atajo" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -9392,9 +9417,8 @@ msgid "Change Input Value" msgstr "Cambiar Valor de Entrada" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "Redimensionar CanvasItem" +msgstr "Redimensionar Comentario" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -10000,6 +10024,12 @@ msgstr "" "Se debe proveer un shape para que CollisionShape funcione. Creale un recurso " "shape!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Nada visible ya que no se asignó ningún mesh." @@ -10016,6 +10046,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "Ploteando Meshes" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10186,9 +10222,16 @@ msgid "Switch between hexadecimal and code values." msgstr "Cambiar entre valores hexadecimales y de código." #: scene/gui/color_picker.cpp -#, fuzzy msgid "Add current color as a preset." -msgstr "Agregar color actual como preset" +msgstr "Agregar color actual como preset." + +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" #: scene/gui/dialogs.cpp msgid "Alert!" @@ -10198,6 +10241,11 @@ msgstr "Alerta!" msgid "Please Confirm..." msgstr "Confirmá, por favor..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Ir a carpeta padre" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10282,6 +10330,10 @@ msgstr "Asignación a uniform." msgid "Varyings can only be assigned in vertex function." msgstr "Solo se pueden asignar variaciones en funciones de vértice." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Instanciar la(s) escena(s) seleccionadas como hijas del nodo seleccionado." + #~ msgid "FPS" #~ msgstr "FPS" @@ -11833,9 +11885,6 @@ msgstr "Solo se pueden asignar variaciones en funciones de vértice." #~ msgid "Cannot go into subdir:" #~ msgstr "No se puede acceder al subdir:" -#~ msgid "Imported Resources" -#~ msgstr "Importar Recursos" - #~ msgid "Insert Keys (Ins)" #~ msgstr "Insertar Claves (Ins)" diff --git a/editor/translations/et.po b/editor/translations/et.po index f5edac889e..092ddb5568 100644 --- a/editor/translations/et.po +++ b/editor/translations/et.po @@ -1329,8 +1329,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1378,7 +1392,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1453,10 +1467,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1672,8 +1706,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1682,6 +1716,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2916,14 +2960,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3059,10 +3095,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -4991,19 +5023,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5094,11 +5126,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6731,6 +6763,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6869,6 +6917,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -6986,6 +7042,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9537,6 +9597,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9551,6 +9617,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9694,6 +9766,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9702,6 +9782,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/fa.po b/editor/translations/fa.po index 3b5cce13db..2e54086c17 100644 --- a/editor/translations/fa.po +++ b/editor/translations/fa.po @@ -1401,8 +1401,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1454,7 +1468,7 @@ msgstr "باز شدن مدیر پروژه؟" msgid "New Folder..." msgstr "ساختن پوشه..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1529,10 +1543,33 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "زبانه قبلی" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "ساختن پوشه" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "رÙتن به پوشه والد" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "ناتوان در ساختن پوشه." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "پوشه‌ها Ùˆ پرونده‌ها:" @@ -1766,8 +1803,8 @@ msgstr "خروجی" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1776,6 +1813,16 @@ msgid "OK" msgstr "مواÙقت" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "ذخیره منبع از ..." @@ -3037,14 +3084,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3195,10 +3234,6 @@ msgid "Search files" msgstr "جستجوی کلاسها" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5211,19 +5246,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5315,11 +5350,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7036,6 +7071,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "زبانه قبلی" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7191,6 +7243,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "انتخاب شده را تغییر مقیاس بده" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Øذ٠قالب" @@ -7323,6 +7384,11 @@ msgid "Exporting All" msgstr "صدور" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "پرونده موجود نیست." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10040,6 +10106,12 @@ msgstr "" "باید یک Ø´Ú©Ù„ برای CollisionShape Ùراهم شده باشد تا عمل کند. لطÙا یک منبع Ø´Ú©Ù„ " "برای آن ایجاد کنید!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10054,6 +10126,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "یک منبع NavigationMesh باید برای یک گره تنظیم یا ایجاد شود تا کار کند." @@ -10212,6 +10290,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "هشدار!" @@ -10220,6 +10306,11 @@ msgstr "هشدار!" msgid "Please Confirm..." msgstr "لطÙاً تأیید کنید…" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "رÙتن به پوشه والد" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/fi.po b/editor/translations/fi.po index 531b9fb95c..b956ffac52 100644 --- a/editor/translations/fi.po +++ b/editor/translations/fi.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-21 21:18+0000\n" +"PO-Revision-Date: 2019-03-12 15:25+0000\n" "Last-Translator: Tapani Niemi <tapani.niemi@kapsi.fi>\n" "Language-Team: Finnish <https://hosted.weblate.org/projects/godot-engine/" "godot/fi/>\n" @@ -22,7 +22,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -90,14 +90,12 @@ msgid "Delete Selected Key(s)" msgstr "Poista valitut avaimet" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Lisää piste" +msgstr "Lisää Bezier-piste" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Siirrä pisteitä" +msgstr "Siirrä Bezier-pisteitä" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -128,9 +126,8 @@ msgid "Anim Change Call" msgstr "Animaatio: muuta kutsua" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Vaihda animaation luuppia" +msgstr "Muuta animaation pituutta" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -187,13 +184,12 @@ msgid "Anim Clips:" msgstr "Animaatioleikkeet:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Vaihda taulukon arvoa" +msgstr "Muuta raidan polkua" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." -msgstr "Käytä tämä raita päälle/pois." +msgstr "Kytke tämä raita päälle/pois." #: editor/animation_track_editor.cpp msgid "Update Mode (How this property is set)" @@ -216,9 +212,8 @@ msgid "Time (s): " msgstr "Aika (s): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Doppler käytössä" +msgstr "Aseta raita päälle" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -271,19 +266,16 @@ msgid "Delete Key(s)" msgstr "Poista avainruudut" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Vaihda animaation nimi:" +msgstr "Vaihda animaation päivitystilaa" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Interpolaatiotila" +msgstr "Vaihda animaation interpolaatiotilaa" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Vaihda animaation luuppia" +msgstr "Vaihda animaation toistotilaa" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -327,14 +319,12 @@ msgid "Anim Insert Key" msgstr "Animaatio: Lisää avain" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Vaihda animaation nopeutta" +msgstr "Vaihda animaation askelta" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Järjestele uudelleen automaattiset lataukset" +msgstr "Järjestele uudelleen raidat" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -365,9 +355,8 @@ msgid "Not possible to add a new track without a root" msgstr "Uutta raitaa ei voida lisätä ilman juurta" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Lisää raita" +msgstr "Lisää Bezier-raita" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -378,23 +367,20 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "Raita ei ole Spatial-tyyppinen, joten ei voida lisätä avainruutua" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "3D-muunnosraita" +msgstr "Lisää muunnosraidan avainruutu" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Lisää raita" +msgstr "Lisää raidan avainruutu" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." msgstr "Raidan polku on virheellinen, joten ei voida lisätä metodin avainta." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Metodikutsuraita" +msgstr "Lisää metodikutsuraidan avainruutu" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -555,17 +541,16 @@ msgid "Copy" msgstr "Kopioi" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Äänileikkeet:" +msgstr "Lisää ääniraidan leike" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Muuta ääniraidan leikkeen alkusiirrosta" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Muuta ääniraidan leikkeen loppusiirrosta" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -1380,9 +1365,30 @@ msgstr "Pakataan" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"GLES2 tarvitsee kohdealustalla 'ETC' tekstuuripakkausta. Kytke 'Import Etc' " +"päälle projektin asetuksista." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." msgstr "" +"GLES3 tarvitsee kohdealustalla 'ETC' tekstuuripakkausta. Kytke 'Import Etc " +"2' päälle projektin asetuksista." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." +msgstr "" +"GLES2 vara-ajuri tarvitsee kohdealustalla 'ETC' tekstuuripakkausta. Kytke " +"'Import Etc' päälle projektin asetuksista tai poista 'Driver Fallback " +"Enabled' asetus." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1429,7 +1435,7 @@ msgstr "Näytä tiedostonhallinnassa" msgid "New Folder..." msgstr "Uusi kansio..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Päivitä" @@ -1504,10 +1510,30 @@ msgstr "Siirrä suosikkia ylös" msgid "Move Favorite Down" msgstr "Siirrä suosikkia alas" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "Edellinen kansio" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "Seuraava kansio" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Siirry yläkansioon" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "Kansio suosikkeihin." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Ruudukkonäkymä esikatselukuvilla." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Listanäkymä." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Hakemistot ja tiedostot:" @@ -1730,9 +1756,9 @@ msgstr "Tyhjennä tuloste" msgid "Project export failed with error code %d." msgstr "Projektin vienti epäonnistui virhekoodilla %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Virhe tallennettaessa resurssia!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "Tuotuja resursseja ei voida tallentaa." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1740,6 +1766,18 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Virhe tallennettaessa resurssia!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" +"Resurssia ei voida tallentaa, koska se ei kuulu muokattavana olevaan " +"skeneen. Tee siitä ensin yksilöllinen." + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Tallenna resurssi nimellä..." @@ -1957,14 +1995,12 @@ msgid "Save changes to '%s' before closing?" msgstr "Tallennetaanko muutokset tiedostoon '%s' ennen sulkemista?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Resurssin lataaminen epäonnistui." +msgstr "Tallennettiin %s muokattua resurssia." #: editor/editor_node.cpp -#, fuzzy msgid "A root node is required to save the scene." -msgstr "Vain yksi tiedosto vaaditaan suurikokoiselle tekstuurille." +msgstr "Skenen tallentaminen edellyttää, että sillä on juurisolmu." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -3050,14 +3086,6 @@ msgstr "" "tiedostojärjestelmästäsi!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Ruudukkonäkymä esikatselukuvilla." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Listanäkymä." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Tila: Tuonti epäonnistui. Ole hyvä, korjaa tiedosto ja tuo se uudelleen." @@ -3194,10 +3222,6 @@ msgid "Search files" msgstr "Etsi tiedostoista" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Luo valituista skeneistä ilmentymä valitun solmun alle." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3601,19 +3625,16 @@ msgstr "Lataa..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "Siirrä pisteitä" +msgstr "Siirrä solmupistettä" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Muuta sulautusaikaa" +msgstr "Muuta BlendSpace1D rajoja" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Muuta sulautusaikaa" +msgstr "Muuta BlendSpace1D nimikkeitä" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3624,24 +3645,21 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Lisää solmu" +msgstr "Lisää solmupiste" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Lisää animaatio" +msgstr "Lisää animaatiopiste" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Poista polun piste" +msgstr "Poista BlendSpace1D piste" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "Siirrä BlendSpace1D solmupistettä" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3687,29 +3705,24 @@ msgid "Triangle already exists" msgstr "Kolmio on jo olemassa" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Lisää muuttuja" +msgstr "Lisää kolmio" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Muuta sulautusaikaa" +msgstr "Muuta BlendSpace2D rajoja" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Muuta sulautusaikaa" +msgstr "Muuta BlendSpace2D nimikkeitä" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Poista polun piste" +msgstr "Poista BlendSpace2D piste" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Poista muuttuja" +msgstr "Poista BlendSpace2D kolmio" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3720,9 +3733,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "Kolmioita ei ole olemassa, joten mitään sulautusta ei tapahdu." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Aseta globaalien automaattilataus" +msgstr "Aseta automaattiset kolmiot" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3742,9 +3754,8 @@ msgid "Blend:" msgstr "Sulautus:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Materiaalimuutokset" +msgstr "Parametri muutettu" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3756,15 +3767,13 @@ msgid "Output node can't be added to the blend tree." msgstr "Lähtösolmua ei voida lisätä sulautuspuuhun." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Lisää solmut puusta" +msgstr "Lisää BlendTree solmu" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Siirtotila" +msgstr "Solmu siirretty" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3774,36 +3783,30 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Yhdistetty" +msgstr "Solmuja yhdistetty" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Yhteys katkaistu" +msgstr "Solmujen yhteyksiä katkaistu" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Uusi animaatio" +msgstr "Aseta animaatio" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Poista solmu(t)" +msgstr "Poista solmu" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Käytä tämä raita päälle/pois." +msgstr "Kytke suodin päälle/pois" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Vaihdettu kielisuodatin" +msgstr "Muuta suodinta" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3826,9 +3829,8 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Solmun nimi" +msgstr "Solmu uudelleennimetty" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4056,14 +4058,12 @@ msgid "Cross-Animation Blend Times" msgstr "Lomittautuvien animaatioiden sulautusajat" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Siirtotila" +msgstr "Siirrä solmua" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Lisää käännös" +msgstr "Lisää siirtymä" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4099,18 +4099,16 @@ msgid "No playback resource set at path: %s." msgstr "Polulle ei ole asetettu toistoresurssia: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Poistettu:" +msgstr "Solmu poistettu" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Siirtymäsolmu" +msgstr "Siirtymä poistettu" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Aseta alkusolmu (automaattitoisto)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4936,7 +4934,7 @@ msgstr "Kehitä GI Probe" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Liukuväriä muokattu" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5196,6 +5194,10 @@ msgid "Generating Visibility Rect" msgstr "Kartoitetaan näkyvää aluetta" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Kartoita näkyvä alue" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Piste voidaan asettaa ainoastaan ParticlesMaterial käsittelyn materiaaliin" @@ -5209,10 +5211,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Kuvassa ei ole pikseleitä, joiden läpinäkyvyys on enemmän kuin 128…" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Kartoita näkyvä alue" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Lataa emissiomaski" @@ -5300,13 +5298,13 @@ msgid "Generating AABB" msgstr "Luodaan AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Luo AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Kartoita näkyvä alue" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Luo AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Poista pisteet käyrästä" @@ -6087,14 +6085,12 @@ msgid "This skeleton has no bones, create some children Bone2D nodes." msgstr "Tällä luurangolla ei ole luita, luo joitakin Bone2D alisolmuja." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "Tee lepoasento (luista)" +msgstr "Luo lepoasento luista" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "Tee lepoasento (luista)" +msgstr "Aseta lepoasento luille" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6249,7 +6245,6 @@ msgid "Rear" msgstr "Taka" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" msgstr "Kohdista näkymään" @@ -6346,6 +6341,8 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"Huom: näytetty FPS-lukema on editorin kuvataajuus.\n" +"Sitä ei voi käyttää luotettavana pelin sisäisenä tehokkuuden ilmaisimena." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6356,9 +6353,8 @@ msgid "XForm Dialog" msgstr "XForm-ikkuna" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Tartu lattiaan" +msgstr "Tarraa solmut lattiaan" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -6953,6 +6949,22 @@ msgid "Merge from Scene" msgstr "Yhdistä skenestä" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "Seuraava koordinaatti" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "Valitse seuraava muoto, aliruutu tai ruutu." + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "Edellinen koordinaatti" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "Valitse edellinen muoto, aliruutu tai ruutu." + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Kopioi bittimaski." @@ -6965,9 +6977,8 @@ msgid "Erase bitmask." msgstr "Pyyhi bittimaski." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Luo uusia solmuja." +msgstr "Luo uusi suorakulmio." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7107,6 +7118,14 @@ msgid "Clear Tile Bitmask" msgstr "Tyhjennä ruudun bittimaski" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "Tee polygonista konkaavi" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "Tee polygonista konveksi" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Poista ruutu" @@ -7148,34 +7167,31 @@ msgstr "Ruutuvalikoima" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "Aseta uniformin nimi" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Aseta oletus valinnalle '%s'" +msgstr "Aseta syötteen oletusportti" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "VisualShader" +msgstr "Lisää solmu Visual Shaderiin" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" -msgstr "Kahdenna solmu(t)" +msgstr "Kahdenna solmut" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "Visual Shaderin syötteen tyyppi vaihdettu" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" -msgstr "Vertex" +msgstr "Kärkipiste" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Fragment" -msgstr "Fragment" +msgstr "Fragmentti" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Light" @@ -7186,14 +7202,12 @@ msgid "VisualShader" msgstr "VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Muokkaa ruudun prioriteettia" +msgstr "Muokkaa visuaalista ominaisuutta" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Sävytinmuutokset" +msgstr "Visual Shaderin tila vaihdettu" #: editor/project_export.cpp msgid "Runnable" @@ -7212,6 +7226,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"Projektin vienti alustalle '%s' epäonnistui.\n" +"Vientimallit näyttävät puuttuvan tai olevan virheellisiä." #: editor/project_export.cpp msgid "" @@ -7219,6 +7235,9 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"Projektin vienti alustalle '%s' epäonnistui.\n" +"Tämä saattaa johtua asetusongelmista viennin esiasetuksissa tai vientisi " +"asetuksissa." #: editor/project_export.cpp msgid "Release" @@ -7229,6 +7248,10 @@ msgid "Exporting All" msgstr "Viedään kaikki" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "Annettu vientipolku ei ole olemassa:" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Vientimallit tälle alustalle puuttuvat tai ovat viallisia:" @@ -8267,9 +8290,8 @@ msgid "Instantiated scenes can't become root" msgstr "Skenejen ilmentymiä ei voi asettaa juureksi" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "Tee skenen juuri" +msgstr "Tee solmusta juurisolmu" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8308,9 +8330,8 @@ msgid "Make Local" msgstr "Tee paikallinen" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Tee skenen juuri" +msgstr "Uusi skenen juuri" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8662,7 +8683,7 @@ msgstr "Aliprosessi yhdistetty" #: editor/script_editor_debugger.cpp msgid "Copy Error" -msgstr "Kopiointivirhe" +msgstr "Kopioi virhe" #: editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" @@ -8741,19 +8762,16 @@ msgid "Set From Tree" msgstr "Aseta puusta" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Hidasta lopussa" +msgstr "Poista pikanäppäin" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Pikanäppäimet" +msgstr "Palauta pikanäppäin" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Muuta ankkureita" +msgstr "Muuta pikanäppäintä" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -8964,9 +8982,8 @@ msgid "GridMap Duplicate Selection" msgstr "Kahdenna valinta" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paint" -msgstr "Ruudukon asetukset" +msgstr "Ruudukon maalaus" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Grid Map" @@ -9354,9 +9371,8 @@ msgid "Change Input Value" msgstr "Vaihda syötteen arvo" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "Muokkaa CanvasItemin kokoa" +msgstr "Muokkaa kommentin kokoa" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -9944,6 +9960,14 @@ msgstr "" "CollisionShape solmulle täytyy antaa muoto, jotta se toimisi. Ole hyvä ja " "luo sille muotoresurssi!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" +"Tasomuodot eivät toimi hyvin ja ne tullaan poistaamaan tulevissa versioissa. " +"Ole hyvä ja älä käytä niitä." + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Mitään ei näy, koska meshiä ei ole asetettu." @@ -9960,6 +9984,14 @@ msgstr "" msgid "Plotting Meshes" msgstr "Piirretään meshejä" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" +"GIProbe ei ole tuettu GLES2 näyttöajurissa.\n" +"Käytä sen sijaan BakedLightmap resurssia." + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10104,8 +10136,7 @@ msgstr "Polku animaatiot sisältävään AnimationPlayer solmuun on asettamatta. #: scene/animation/animation_tree.cpp msgid "Path set for AnimationPlayer does not lead to an AnimationPlayer node." -msgstr "" -"AnimationPlayer solmulle asetettu polku ei johda AnimationPlayer solmuun." +msgstr "AnimationPlayerille asetettu polku ei johda AnimationPlayer solmuun." #: scene/animation/animation_tree.cpp msgid "AnimationPlayer root is not a valid node." @@ -10132,6 +10163,18 @@ msgstr "Vaihda heksadesimaali- ja koodiarvojen välillä." msgid "Add current color as a preset." msgstr "Lisää nykyinen väri esiasetukseksi." +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" +"Säilöllä ei ole itsessään mitään merkitystä ellei jokin skripti säädä sen " +"alisolmujen sijoitustapaa.\n" +"Jos et aio lisätä skriptiä, ole hyvä ja käytä sen sijaan tavallista " +"'Control' solmua." + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Huomio!" @@ -10140,6 +10183,10 @@ msgstr "Huomio!" msgid "Please Confirm..." msgstr "Ole hyvä ja vahvista..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "Siirry yläkansioon." + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10224,6 +10271,9 @@ msgstr "Sijoitus uniformille." msgid "Varyings can only be assigned in vertex function." msgstr "Varying tyypin voi sijoittaa vain vertex-funktiossa." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Luo valituista skeneistä ilmentymä valitun solmun alle." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/fr.po b/editor/translations/fr.po index 08837ca582..b1bb5be97a 100644 --- a/editor/translations/fr.po +++ b/editor/translations/fr.po @@ -54,12 +54,13 @@ # Sylvain Corsini <sylvain.corsini@gmail.com>, 2018. # Caye Pierre <pierrecaye@laposte.net>, 2019. # Peter Kent <0.peter.kent@gmail.com>, 2019. +# jef dered <themen098s@vivaldi.net>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-21 21:18+0000\n" -"Last-Translator: Peter Kent <0.peter.kent@gmail.com>\n" +"PO-Revision-Date: 2019-03-12 15:25+0000\n" +"Last-Translator: Caye Pierre <pierrecaye@laposte.net>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" "Language: fr\n" @@ -67,7 +68,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -103,11 +104,11 @@ msgstr "Index nommé %s invalide pour le type de base %s" #: core/math/expression.cpp msgid "Invalid arguments to construct '%s'" -msgstr "Arguments invalides pour construire '%s'" +msgstr "Arguments invalides pour construire « %s »" #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "Sur appel à '%s' :" +msgstr "Sur appel à « %s » :" #: editor/animation_bezier_editor.cpp #: editor/plugins/asset_library_editor_plugin.cpp @@ -135,14 +136,12 @@ msgid "Delete Selected Key(s)" msgstr "Supprimer les clé(s) sélectionnée(s)" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Ajouter un point" +msgstr "Ajouter un point de Bézier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Déplacer de points" +msgstr "Déplacer des points de Bézier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -158,7 +157,7 @@ msgstr "Modifier le temps d'image-clé" #: editor/animation_track_editor.cpp msgid "Anim Change Transition" -msgstr "Changement du transition de l'animation" +msgstr "Changement de transition de l'animation" #: editor/animation_track_editor.cpp msgid "Anim Change Transform" @@ -173,9 +172,8 @@ msgid "Anim Change Call" msgstr "Anim: Change l'Appel" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Modifier la boucle d'animation" +msgstr "Modifier la longueur de l'animation" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -232,9 +230,8 @@ msgid "Anim Clips:" msgstr "Clips d'animation :" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Modifier la valeur du tableau" +msgstr "Modifier le chemin de la piste" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -261,9 +258,8 @@ msgid "Time (s): " msgstr "Temps (s) : " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Activer Doppler" +msgstr "Activer le basculement de piste" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -316,19 +312,16 @@ msgid "Delete Key(s)" msgstr "Supprimer clé(s)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Modifier le nom de l'animation :" +msgstr "Modifier le mode de mise à jour de l'animation" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Mode d'interpolation" +msgstr "Modifier le mode d'interpolation de l'animation" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Modifier la boucle d'animation" +msgstr "Modifier le mode de boucle d'animation" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -373,14 +366,12 @@ msgid "Anim Insert Key" msgstr "Insérer une clé d'animation" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Modifier le taux d'IPS de l'animation" +msgstr "Modifier l'étape d'animation" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Ré-organiser les AutoLoads" +msgstr "Réorganiser les pistes" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -415,9 +406,8 @@ msgid "Not possible to add a new track without a root" msgstr "Impossible d'ajouter une nouvelle piste sans racine" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Ajouter une piste" +msgstr "Ajouter une piste de Bézier" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -428,14 +418,12 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "La piste n'est pas de type Spatial, impossible d'insérer une clé" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Piste de transformation 3D" +msgstr "Ajouter une clé de transformation" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Ajouter une piste" +msgstr "Ajoutez une clé de piste" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." @@ -444,9 +432,8 @@ msgstr "" "méthode." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Piste d'appel de méthode" +msgstr "Ajouter une clé de méthode" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -556,7 +543,7 @@ msgstr "Utiliser les courbes de Bézier" #: editor/animation_track_editor.cpp msgid "Anim. Optimizer" -msgstr "Optimiser de l'animation" +msgstr "Optimiser l'animation" #: editor/animation_track_editor.cpp msgid "Max. Linear Error:" @@ -611,17 +598,16 @@ msgid "Copy" msgstr "Copier" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Clips audio :" +msgstr "Ajouter un clip audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Modifier Le Décalage De Début De Clip De Piste Audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Modifier Le Décalage De Fin De Clip De Piste Audio" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -778,7 +764,7 @@ msgstr "Déconnecter « %s » de « %s »" #: editor/connections_dialog.cpp msgid "Disconnect all from signal: '%s'" -msgstr "Tout déconnecter au signal : '%s'" +msgstr "Tout déconnecter du signal : « %s »" #: editor/connections_dialog.cpp msgid "Connect..." @@ -906,7 +892,7 @@ msgstr "Dépendances :" #: editor/dependency_editor.cpp msgid "Fix Broken" -msgstr "Corriger les dép. cassées" +msgstr "Corriger les dépendances cassées" #: editor/dependency_editor.cpp msgid "Dependency Editor" @@ -1080,10 +1066,10 @@ msgid "" "is an exhaustive list of all such thirdparty components with their " "respective copyright statements and license terms." msgstr "" -"Le moteur Godot s'appuie sur un certain nombre de bibliothèques gratuites et " -"open source tierce parties, toutes compatibles avec les termes de sa licence " -"MIT. Voici une liste exhaustive de tous ces composants tiers avec leurs " -"énoncés de droits d'auteur respectifs ainsi que les termes de leurs licences." +"Le moteur Godot s'appuie sur un certain nombre de bibliothèques libres et " +"open source tierces, toutes compatibles avec les termes de sa licence MIT. " +"Voici une liste exhaustive de ces composants tiers avec leurs énoncés de " +"droits d'auteur respectifs ainsi que les termes de leurs licences." #: editor/editor_about.cpp msgid "All Components" @@ -1242,7 +1228,7 @@ msgstr "Ouvrir une disposition de bus audio" #: editor/editor_audio_buses.cpp msgid "There is no 'res://default_bus_layout.tres' file." -msgstr "Il n'existe aucun 'res://default_bus_layout.tres'." +msgstr "Il n'existe aucun fichier « res://default_bus_layout.tres »." #: editor/editor_audio_buses.cpp msgid "Invalid file, not an audio bus layout." @@ -1429,7 +1415,7 @@ msgstr "Stockage du fichier :" #: editor/editor_export.cpp msgid "No export template found at the expected path:" -msgstr "Aucun modèle d'exportation n'a été trouvé au chemin prévu :" +msgstr "Aucun modèle d'exportation n'a été trouvé au chemin prévu :" #: editor/editor_export.cpp msgid "Packing" @@ -1437,9 +1423,31 @@ msgstr "Empaquetage" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"La plate-forme cible nécessite une compression de texture 'ETC' pour GLES2. " +"Activez 'Import Etc' dans les paramètres du projet." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"La plate-forme cible nécessite une compression de texture 'ETC2' pour GLES3. " +"Activez 'Import Etc 2' dans les Paramètres du projet." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" +"La plate-forme cible nécessite une compression de texture ' ETC ' pour le " +"fallback pilote de GLES2.\n" +"Activez 'Import Etc' dans les paramètres du projet, ou désactivez 'Driver " +"Fallback Enabled'." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1486,7 +1494,7 @@ msgstr "Montrer dans le gestionnaire de fichiers" msgid "New Folder..." msgstr "Nouveau dossier..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Rafraîchir" @@ -1561,10 +1569,30 @@ msgstr "Déplacer le favori vers le haut" msgid "Move Favorite Down" msgstr "Déplacer le favori vers le bas" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "Dossier précédent" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "Dossier suivant" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Aller au dossier parent" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "Ajouter ou supprimer des favoris le dossier courant." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Afficher les éléments sous forme de grille de vignettes." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Afficher les éléments sous forme de liste." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Répertoires et fichiers :" @@ -1787,9 +1815,9 @@ msgstr "Effacer la sortie" msgid "Project export failed with error code %d." msgstr "L'export du projet a échoué avec le code erreur %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Erreur d'enregistrement de la ressource !" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "Les ressources importés ne peuvent pas être sauvegarder." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1797,6 +1825,18 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Erreur d'enregistrement de la ressource !" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" +"Cette ressource ne peut pas être sauvegardée parce qu’elle n'appartient pas " +"à la scène éditer. Soyez sûr qu'elle soit unique." + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Enregistrer la ressource sous…" @@ -1814,23 +1854,23 @@ msgstr "Erreur lors de l'enregistrement." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp msgid "Can't open '%s'. The file could have been moved or deleted." -msgstr "Impossible d'ouvrir '%s'. Le fichier a pu être déplacé ou supprimé." +msgstr "Impossible d'ouvrir « %s ». Le fichier a pu être déplacé ou supprimé." #: editor/editor_node.cpp msgid "Error while parsing '%s'." -msgstr "Erreur lors de l'analyse syntaxique de '%s'." +msgstr "Erreur lors de l'analyse syntaxique de « %s »." #: editor/editor_node.cpp msgid "Unexpected end of file '%s'." -msgstr "Fin de fichier inattendue '%s'." +msgstr "Fin de fichier inattendue « %s »." #: editor/editor_node.cpp msgid "Missing '%s' or its dependencies." -msgstr "La scène '%s' ou ses dépendances sont introuvables." +msgstr "La scène « %s » ou ses dépendances sont introuvables." #: editor/editor_node.cpp msgid "Error while loading '%s'." -msgstr "Erreur lors du chargement de '%s'." +msgstr "Erreur lors du chargement de « %s »." #: editor/editor_node.cpp msgid "Saving Scene" @@ -1925,8 +1965,8 @@ msgid "" "This resource was imported, so it's not editable. Change its settings in the " "import panel and then re-import." msgstr "" -"Cette ressource a été importée, elle n'est donc pas éditable. Modifiez ses " -"paramètres dans le panneau d'importation et, ensuite, réimportez-la." +"Cette ressource a été importée, elle n'est donc pas modifiable. Modifiez ses " +"paramètres dans le panneau d'importation et réimportez-la ensuite." #: editor/editor_node.cpp msgid "" @@ -1935,8 +1975,9 @@ msgid "" "Please read the documentation relevant to importing scenes to better " "understand this workflow." msgstr "" -"Cette scène a été importée, les changements ne seront donc pas conservés.\n" -"L'instancier ou l'hériter permettra de faire ces changements.\n" +"Cette scène a été importée, les modifications ne seront donc pas " +"conservées.\n" +"L'instancier ou l'hériter permettra de conserver les modifications.\n" "Veuillez lire la documentation concernant l'importation des scènes afin de " "mieux comprendre ce processus." @@ -2018,16 +2059,15 @@ msgstr "Enregistrer & fermer" #: editor/editor_node.cpp msgid "Save changes to '%s' before closing?" -msgstr "Sauvegarder modifications de '%s' avant de quitter ?" +msgstr "Sauvegarder les modifications effectuées à « %s » avant de quitter ?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Impossible de charger la ressource." +msgstr "Sauvegardé %s des ressources modifiées." #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "" +msgstr "Un nÅ“ud racine est nécessaire pour sauvegarder la scène." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -2044,7 +2084,7 @@ msgstr "Oui" #: editor/editor_node.cpp msgid "This scene has never been saved. Save before running?" msgstr "" -"Cette scène n'a jamais été enregistrée. L'enregistrer avant de la lancer ?" +"Cette scène n'a jamais été enregistrée. L'enregistrer avant de la lancer ?" #: editor/editor_node.cpp editor/scene_tree_dock.cpp msgid "This operation can't be done without a scene." @@ -2130,39 +2170,39 @@ msgstr "Choisir une scène principale" #: editor/editor_node.cpp msgid "Unable to enable addon plugin at: '%s' parsing of config failed." msgstr "" -"Impossible d'activer le greffon depuis : '%s' l’analyse syntaxique de la " +"Impossible d'activer le greffon depuis : « %s », l’analyse syntaxique de la " "configuration a échoué." #: editor/editor_node.cpp msgid "Unable to find script field for addon plugin at: 'res://addons/%s'." msgstr "" -"Impossible de trouver le champ de script pour le plugin dans : 'res://addons/" -"%s'." +"Impossible de trouver le champ de script pour le plugin dans : « res://" +"addons/%s »." #: editor/editor_node.cpp msgid "Unable to load addon script from path: '%s'." msgstr "" -"Impossible de charger le script de l’extension depuis le chemin : '%s'." +"Impossible de charger le script de l’extension depuis le chemin : « %s »." #: editor/editor_node.cpp msgid "" "Unable to load addon script from path: '%s' There seems to be an error in " "the code, please check the syntax." msgstr "" -"Impossible de charger le script de l’extension depuis le chemin : '%s' Il " +"Impossible de charger le script de l’extension depuis le chemin : « %s ». Il " "semble y avoir une erreur dans le code, merci de vérifier la syntaxe." #: editor/editor_node.cpp msgid "" "Unable to load addon script from path: '%s' Base type is not EditorPlugin." msgstr "" -"Impossible de charger le script de l'addon depuis le chemin : '%s' Le type " -"de base n'est pas EditorPlugin." +"Impossible de charger le script de l'addon depuis le chemin : « %s ». Le " +"type de base n'est pas EditorPlugin." #: editor/editor_node.cpp msgid "Unable to load addon script from path: '%s' Script is not in tool mode." msgstr "" -"Impossible de charger le script de l’extension depuis le chemin : '%s' Le " +"Impossible de charger le script de l’extension depuis le chemin : « %s ». Le " "script n'est pas en mode outil." #: editor/editor_node.cpp @@ -2189,7 +2229,7 @@ msgstr "La scène « %s » a des dépendences cassées :" #: editor/editor_node.cpp msgid "Clear Recent Scenes" -msgstr "Vider la liste des scènes récentes" +msgstr "Effacer la liste des scènes récentes" #: editor/editor_node.cpp msgid "Save Layout" @@ -2419,7 +2459,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "Synchroniser les changements de scène" +msgstr "Synchroniser les modifications des scènes" #: editor/editor_node.cpp msgid "" @@ -2430,12 +2470,12 @@ msgid "" msgstr "" "Lorsque cette option est activée, toutes les modifications apportées à la " "scène dans l'éditeur seront reproduites en jeu.\n" -"Lorsqu'elle est utilisée à distance sur un périphérique, l'efficacité est " -"meilleure avec le système de fichiers réseau." +"Lorsqu'elle est utilisée à distance sur un périphérique, cette option est " +"plus efficace avec le système de fichiers réseau." #: editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "Synchroniser les modifications de script" +msgstr "Synchroniser les modifications des scripts" #: editor/editor_node.cpp msgid "" @@ -2560,7 +2600,7 @@ msgstr "Changer le pilote vidéo nécessite le redémarrage de l'éditeur." #: editor/editor_node.cpp editor/project_settings_editor.cpp #: editor/settings_config_dialog.cpp msgid "Save & Restart" -msgstr "Enregistrer et Redémarrer" +msgstr "Enregistrer et redémarrer" #: editor/editor_node.cpp msgid "Spins when the editor window redraws." @@ -2702,7 +2742,7 @@ msgstr "État :" #: editor/editor_plugin_settings.cpp msgid "Edit:" -msgstr "Éditer :" +msgstr "Modifier :" #: editor/editor_profiler.cpp editor/plugins/animation_state_machine_editor.cpp #: editor/rename_dialog.cpp @@ -2803,7 +2843,7 @@ msgid "" msgstr "" "Impossible de créer un ViewportTexture sur cette ressource car elle n'est " "pas définie comme locale à la scène.\n" -"Merci de changer la propriété \"Local To Scene\" de cette ressource (et des " +"Merci de changer la propriété « Local To Scene » de cette ressource (et des " "ressources intermédiaires la contenant, jusqu'au nÅ“ud qui l'utilise)." #: editor/editor_properties.cpp editor/property_editor.cpp @@ -2955,11 +2995,12 @@ msgstr "Récupération des miroirs, veuillez patienter..." #: editor/export_template_manager.cpp msgid "Remove template version '%s'?" -msgstr "Supprimer la version '%s' du modèle ?" +msgstr "Supprimer la version « %s » du modèle ?" #: editor/export_template_manager.cpp msgid "Can't open export templates zip." -msgstr "Impossible d'ouvrir le ZIP de modèles d'exportation." +msgstr "" +"Impossible d'ouvrir le fichier ZIP contenant les modèles d'exportation." #: editor/export_template_manager.cpp msgid "Invalid version.txt format inside templates: %s." @@ -3017,7 +3058,7 @@ msgstr "Boucle de Redirection." #: editor/export_template_manager.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Failed:" -msgstr "Échec:" +msgstr "Échec :" #: editor/export_template_manager.cpp msgid "Download Complete." @@ -3028,8 +3069,8 @@ msgid "" "Templates installation failed. The problematic templates archives can be " "found at '%s'." msgstr "" -"L'installation des modèles à échoué. Les archives des modèles posant " -"problème peuvent être trouvées ici : '%s'." +"L'installation des modèles a échoué. Les archives des modèles posant " +"problème peuvent être trouvées à « %s »." #: editor/export_template_manager.cpp msgid "Error requesting url: " @@ -3128,16 +3169,8 @@ msgstr "Favoris" #: editor/filesystem_dock.cpp msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" -"Impossible d'accédez à '%s' car celui-ci n'existe pas dans le système de " -"fichiers !" - -#: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Afficher les éléments sous forme de grille de vignettes." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Afficher les éléments sous forme de liste." +"Impossible d'accéder à « %s » car celui-ci n'existe pas dans le système de " +"fichiers !" #: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." @@ -3235,11 +3268,11 @@ msgstr "Déplacer vers…" #: editor/filesystem_dock.cpp editor/plugins/script_editor_plugin.cpp msgid "New Script..." -msgstr "Nouveau Script..." +msgstr "Nouveau script…" #: editor/filesystem_dock.cpp msgid "New Resource..." -msgstr "Nouvelle Ressource…" +msgstr "Nouvelle ressource…" #: editor/filesystem_dock.cpp editor/script_editor_debugger.cpp msgid "Expand All" @@ -3277,12 +3310,6 @@ msgid "Search files" msgstr "Rechercher des fichiers" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" -"Instancie la(les) scène(s) sélectionnée(s) en tant qu'enfant(s) du nÅ“ud " -"sélectionné." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3309,11 +3336,11 @@ msgstr "Créer un script" #: editor/find_in_files.cpp msgid "Find in Files" -msgstr "Trouver dans les fichiers" +msgstr "Rechercher dans les fichiers" #: editor/find_in_files.cpp msgid "Find:" -msgstr "Trouver :" +msgstr "Rechercher :" #: editor/find_in_files.cpp msgid "Folder:" @@ -3326,7 +3353,7 @@ msgstr "Filtres :" #: editor/find_in_files.cpp editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp msgid "Find..." -msgstr "Trouver…" +msgstr "Rechercher…" #: editor/find_in_files.cpp editor/plugins/script_text_editor.cpp msgid "Replace..." @@ -3338,7 +3365,7 @@ msgstr "Annuler" #: editor/find_in_files.cpp msgid "Find: " -msgstr "Trouver : " +msgstr "Rechercher : " #: editor/find_in_files.cpp msgid "Replace: " @@ -3472,11 +3499,11 @@ msgstr "Enregistrement…" #: editor/import_dock.cpp msgid "Set as Default for '%s'" -msgstr "Définir comme défaut pour '%s'" +msgstr "Définir comme défaut pour « %s »" #: editor/import_dock.cpp msgid "Clear Default for '%s'" -msgstr "Effacer défaut pour '%s'" +msgstr "Effacer le préréglage par défaut pour « %s »" #: editor/import_dock.cpp msgid " Files" @@ -3492,7 +3519,7 @@ msgstr "Pré-réglage…" #: editor/import_dock.cpp msgid "Reimport" -msgstr "Ré-importer" +msgstr "Réimporter" #: editor/import_dock.cpp msgid "Save scenes, re-import and restart" @@ -3501,13 +3528,13 @@ msgstr "Sauvegarde des scènes, réimportation et redémarrage" #: editor/import_dock.cpp msgid "Changing the type of an imported file requires editor restart." msgstr "" -"Changer le type d'un fichier importé nécessite un redémarrage de l'éditeur." +"Modifier le type d'un fichier importé nécessite un redémarrage de l'éditeur." #: editor/import_dock.cpp msgid "" "WARNING: Assets exist that use this resource, they may stop loading properly." msgstr "" -"AVERTISSEMENT : Il existe des éléments qui utilisent cette ressource, ils " +"AVERTISSEMENT : Il existe des atout qui utilisent cette ressource, elles " "pourraient cesser de charger correctement." #: editor/inspector_dock.cpp @@ -3597,7 +3624,7 @@ msgstr "Ensemble multi-nÅ“ud" #: editor/node_dock.cpp msgid "Select a Node to edit Signals and Groups." -msgstr "Sélectionnez un nÅ“ud pour editer des signaux et des groupes." +msgstr "Sélectionnez un nÅ“ud pour modifier les signaux et groupes." #: editor/plugin_config_dialog.cpp msgid "Edit a Plugin" @@ -3644,7 +3671,7 @@ msgid "" "LMB: Move Point\n" "RMB: Erase Point" msgstr "" -"Éditer les points.\n" +"Modifier les points.\n" "Bouton gauche : Déplacer le point\n" "Bouton droit : Effacer le point" @@ -3686,19 +3713,16 @@ msgstr "Charger..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "Déplacer de points" +msgstr "Déplacer le point de nÅ“ud" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Changer le temps de mélange" +msgstr "Modifier les limites de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Changer le temps de mélange" +msgstr "Modifier les étiquettes de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3710,24 +3734,21 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Ajouter un nÅ“ud" +msgstr "Ajouter point de nÅ“ud" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Ajouter une animation" +msgstr "Ajouter un point d'animation" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Supprimer le point du chemin" +msgstr "Supprimer le point BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "Bouger le nÅ“ud BlendSpace1d" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3738,7 +3759,7 @@ msgid "" "Activate to enable playback, check node warnings if activation fails." msgstr "" "AnimationTree est inactif.\n" -"Activez le pour permettre la lecture, vérifier les avertissements des nÅ“uds " +"Activez-le pour permettre la lecture, vérifier les avertissements des nÅ“uds " "en cas d'échec de l'activation." #: editor/plugins/animation_blend_space_1d_editor.cpp @@ -3774,29 +3795,24 @@ msgid "Triangle already exists" msgstr "Le triangle existe déjà " #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Ajouter une variable" +msgstr "Ajouter un triangle" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Changer le temps de mélange" +msgstr "Modifier les limites de BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Changer le temps de mélange" +msgstr "Modifier les étiquettes de BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Supprimer le point du chemin" +msgstr "Supprimer le point BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Supprimer la variable" +msgstr "Supprimer le triangle BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3807,9 +3823,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "Il n'existe pas de triangles, donc aucun mélange ne peut avoir lieu." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Activer les variables globales AutoLoad" +msgstr "Commutation automatique des triangles" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3830,29 +3845,26 @@ msgid "Blend:" msgstr "Mélange :" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Modifications de materiau" +msgstr "Paramètre modifié" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Edit Filters" -msgstr "Editer les filtres" +msgstr "Modifier les filtres" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Output node can't be added to the blend tree." msgstr "Un nÅ“ud de sortie ne peut être ajouté à l'arborescence du mélange." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Ajouter un nÅ“ud à partir de l'arbre" +msgstr "Ajouter un nÅ“ud au BlendTree" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Mode déplacement" +msgstr "NÅ“ud déplacé" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3863,42 +3875,36 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Connecté" +msgstr "NÅ“uds connectés" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Déconnecté" +msgstr "NÅ“uds déconnectés" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Nouvelle animation" +msgstr "Définir l'animation" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Supprimer nÅ“ud(s)" +msgstr "Supprimer un nÅ“ud" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Activer/désactiver cette piste." +msgstr "Activer/désactiver le filtre" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Filtre de langue modifié" +msgstr "Changer le filtre" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." msgstr "" -"Aucun lecteur d'animation défini, dès lors impossible de retrouver les noms " -"des pistes." +"Aucun lecteur d'animation défini, il est donc impossible de retrouver les " +"noms des pistes." #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Player path set is invalid, so unable to retrieve track names." @@ -3912,14 +3918,13 @@ msgid "" "Animation player has no valid root node path, so unable to retrieve track " "names." msgstr "" -"Le lecteur d'animation n'a pas un chemin de nÅ“ud racine valide, dès lors " +"Le lecteur d'animation n'a pas un chemin de nÅ“ud racine valide, il est donc " "impossible de récupérer les noms des pistes." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Nom de nÅ“ud" +msgstr "NÅ“ud renommé" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3929,7 +3934,7 @@ msgstr "Ajouter un nÅ“ud..." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/root_motion_editor_plugin.cpp msgid "Edit Filtered Tracks:" -msgstr "Éditer Pistes Filtrées :" +msgstr "Modifier les pistes filtrées :" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Enable filtering" @@ -4073,7 +4078,7 @@ msgstr "Effet pelure d'oignon" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Enable Onion Skinning" -msgstr "Activer l'effet pelure d'oignon" +msgstr "Activer l'effet « pelure d'oignon »" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Directions" @@ -4148,14 +4153,12 @@ msgid "Cross-Animation Blend Times" msgstr "Temps de mélange des entre animations" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Mode déplacement" +msgstr "Déplacer le nÅ“ud" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Ajouter une traduction" +msgstr "Ajouter une transition" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4192,18 +4195,16 @@ msgid "No playback resource set at path: %s." msgstr "Aucune ressource de lecture définie sur le chemin : %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Supprimer" +msgstr "NÅ“ud supprimé" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "NÅ“ud Transition" +msgstr "Transition supprimée" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Définir le nÅ“ud de démarrage (Lecture automatique)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4382,7 +4383,7 @@ msgstr "Filtres…" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Contents:" -msgstr "Contenu:" +msgstr "Contenu :" #: editor/plugins/asset_library_editor_plugin.cpp msgid "View Files" @@ -4390,7 +4391,7 @@ msgstr "Voir Fichiers" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't resolve hostname:" -msgstr "Impossible de résoudre le nom de l'hôte:" +msgstr "Impossible de résoudre le nom de l'hôte :" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Connection error, please try again." @@ -4398,15 +4399,15 @@ msgstr "Erreur de connection, veuillez essayer à nouveau." #: editor/plugins/asset_library_editor_plugin.cpp msgid "Can't connect to host:" -msgstr "Connection à l'hôte impossible:" +msgstr "Connexion à l'hôte impossible :" #: editor/plugins/asset_library_editor_plugin.cpp msgid "No response from host:" -msgstr "Pas de réponse de l'hôte:" +msgstr "Pas de réponse de l'hôte :" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Request failed, return code:" -msgstr "La requête a échoué, code retourné:" +msgstr "La requête a échoué, code retourné :" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Request failed, too many redirects" @@ -4418,7 +4419,7 @@ msgstr "Vérification du téléchargement échouée, le fichier a été altéré #: editor/plugins/asset_library_editor_plugin.cpp msgid "Expected:" -msgstr "Attendu:" +msgstr "Attendu :" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Got:" @@ -4430,7 +4431,7 @@ msgstr "Vérification de brouillage sha256 échouée" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Asset Download Error:" -msgstr "Erreur dans le téléchargement d'une ressource:" +msgstr "Erreur dans le téléchargement d'une ressource :" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Downloading (%s / %s)..." @@ -4462,7 +4463,7 @@ msgstr "Erreur de téléchargement" #: editor/plugins/asset_library_editor_plugin.cpp msgid "Download for this asset is already in progress!" -msgstr "Le téléchargement de cette ressource est déjà en cours!" +msgstr "Le téléchargement de cette ressource est déjà en cours !" #: editor/plugins/asset_library_editor_plugin.cpp msgid "First" @@ -4539,8 +4540,8 @@ msgid "" "No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " "Light' flag is on." msgstr "" -"Aucun mesh à transférer. Assurez-vous qu'ils contiennent un canal UV2 et que " -"l'indicateur \"Bake Light\" est activé." +"Aucun maillage à transférer. Assurez-vous qu'ils contiennent un canal UV2 et " +"que l'indicateur « Bake Light » est activé." #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "Failed creating lightmap images, make sure path is writable." @@ -5021,7 +5022,7 @@ msgstr "Basculer vers tangente linéaire de courbe" #: editor/plugins/curve_editor_plugin.cpp msgid "Hold Shift to edit tangents individually" -msgstr "Maintenez l'appui sur Maj pour éditer les tangentes individuellement" +msgstr "Maintenez Maj. appuyée pour modifier les tangentes individuellement" #: editor/plugins/gi_probe_editor_plugin.cpp msgid "Bake GI Probe" @@ -5029,7 +5030,7 @@ msgstr "Créer sonde IG (Illumination Globale)" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Dégradé édité" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5081,7 +5082,9 @@ msgstr "Le maillage contenu n'est pas de type ArrayMesh." #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "UV Unwrap failed, mesh may not be manifold?" -msgstr "L'ouverture du UV a échoué, le maillage n'est peut-être pas multiple ?" +msgstr "" +"Le dépliage UV a échoué, le maillage n'est peut-être pas multiple " +"(« manifold ») ?" #: editor/plugins/mesh_instance_editor_plugin.cpp msgid "No mesh to debug." @@ -5229,11 +5232,11 @@ msgstr "Impossible de cartographier la zone." #: editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Source Mesh:" -msgstr "Sélectionner un maillage source :" +msgstr "Sélectionnez un maillage source :" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Target Surface:" -msgstr "Sélectionner une surface cible :" +msgstr "Sélectionnez une surface cible :" #: editor/plugins/multimesh_editor_plugin.cpp msgid "Populate Surface" @@ -5293,6 +5296,10 @@ msgid "Generating Visibility Rect" msgstr "Génération du rectangle de visibilité" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Générer Rect de Visibilité" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Ne peut définir qu'un point dans un matériau de processus ParticlesMaterial" @@ -5306,10 +5313,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Pas de pixels avec transparence > 128 dans l'image..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Générer Rect de Visibilité" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Charger Masque d'Émission" @@ -5334,7 +5337,7 @@ msgstr "Compte de Points Générés :" #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp msgid "Generation Time (sec):" -msgstr "Temps de Génération (sec):" +msgstr "Temps de Génération (sec) :" #: editor/plugins/particles_2d_editor_plugin.cpp msgid "Emission Mask" @@ -5354,7 +5357,7 @@ msgstr "Des faces ne contiennent pas de zone !" #: editor/plugins/particles_editor_plugin.cpp msgid "No faces!" -msgstr "Pas de faces!" +msgstr "Pas de faces !" #: editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry." @@ -5370,7 +5373,7 @@ msgstr "Créer Émetteur" #: editor/plugins/particles_editor_plugin.cpp msgid "Emission Points:" -msgstr "Points d'Émission:" +msgstr "Points d'Émission :" #: editor/plugins/particles_editor_plugin.cpp msgid "Surface Points" @@ -5390,20 +5393,20 @@ msgstr "Source d'Émission: " #: editor/plugins/particles_editor_plugin.cpp msgid "A processor material of type 'ParticlesMaterial' is required." -msgstr "Un matériel processeur de type 'ParticlesMaterial' est requis." +msgstr "Un matériel processeur de type « ParticlesMaterial » est nécessaire." #: editor/plugins/particles_editor_plugin.cpp msgid "Generating AABB" msgstr "Générer AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Générer AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Générer AABB de Visibilité" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Générer AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Supprimer Point de la Courbe" @@ -5552,7 +5555,7 @@ msgid "" "Set a texture to be able to edit UV." msgstr "" "Pas de texture dans ce polygone.\n" -"Sélectionnez une texture pour pouvoir éditer les UV." +"Sélectionnez une texture afin de pouvoir modifier les coordonnées UV." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create UV Map" @@ -5958,7 +5961,7 @@ msgstr "Afficher/Cacher le panneau des scripts" #: editor/plugins/script_editor_plugin.cpp #: editor/plugins/script_text_editor.cpp msgid "Find Next" -msgstr "Trouver le suivant" +msgstr "Correspondance suivante" #: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp msgid "Step Over" @@ -6063,19 +6066,19 @@ msgstr "Modifier la casse" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Uppercase" -msgstr "Majuscule" +msgstr "Tout en majuscule" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Lowercase" -msgstr "Minuscule" +msgstr "Tout en minuscule" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Capitalize" -msgstr "Capitaliser" +msgstr "Majuscule à chaque mot" #: editor/plugins/script_text_editor.cpp editor/plugins/text_editor.cpp msgid "Syntax Highlighter" -msgstr "Surligneur de syntaxe" +msgstr "Coloration syntaxique" #: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp #: scene/gui/text_edit.cpp @@ -6158,11 +6161,11 @@ msgstr "Aller au point d'arrêt précédent" #: editor/plugins/script_text_editor.cpp msgid "Find Previous" -msgstr "Trouver le précédent" +msgstr "Correspondance précédente" #: editor/plugins/script_text_editor.cpp msgid "Find in Files..." -msgstr "Trouver dans les fichiers..." +msgstr "Rechercher dans les fichiers…" #: editor/plugins/script_text_editor.cpp msgid "Go to Function..." @@ -6185,14 +6188,12 @@ msgid "This skeleton has no bones, create some children Bone2D nodes." msgstr "Ce squelette n'a pas d'os, créez des nÅ“uds Bone2D enfants." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "Créer la position de repos (d'après les os)" +msgstr "Créer la position de repos d'après les os" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "Créer la position de repos (d'après les os)" +msgstr "Régler la position de repos sur les os" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6347,7 +6348,6 @@ msgid "Rear" msgstr "Arrière" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" msgstr "Aligner avec la vue" @@ -6446,6 +6446,9 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"Note : La valeur FPS affichée est la fréquence d'images de l'éditeur.\n" +"Il ne doit pas être utilisé comme un indicateur fiable de la performance en " +"jeu." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6456,9 +6459,8 @@ msgid "XForm Dialog" msgstr "Dialogue XForm" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Aligner l'objet sur le sol" +msgstr "Aligner les nÅ“uds au sol" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -6856,7 +6858,7 @@ msgstr "Supprimer tout" #: editor/plugins/theme_editor_plugin.cpp msgid "Edit theme..." -msgstr "Éditer le thème..." +msgstr "Modifier le thème…" #: editor/plugins/theme_editor_plugin.cpp msgid "Theme editing menu." @@ -6992,7 +6994,7 @@ msgstr "Supprimer la TileMap" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Find Tile" -msgstr "Trouver une tuile" +msgstr "Rechercher une tuile" #: editor/plugins/tile_map_editor_plugin.cpp msgid "Transpose" @@ -7055,6 +7057,22 @@ msgid "Merge from Scene" msgstr "Fusionner depuis la scène" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "Coordonnée suivante" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "Sélectionnez la forme suivante, sous-tuile, ou tuile." + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "Coordonnée précédente" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "Sélectionner la forme précédente, sous-tuile, ou tuile." + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Copier le masque de bit." @@ -7067,9 +7085,8 @@ msgid "Erase bitmask." msgstr "Effacer le masque de bit." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Créer de nouveaux nÅ“uds." +msgstr "Créer un nouveau rectangle." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7132,7 +7149,7 @@ msgid "" "Click on another Tile to edit it." msgstr "" "Sélectionner la sous-tuile en cours d'édition.\n" -"Cliquer sur une autre tuile pour l'éditer." +"Cliquez sur une autre tuile pour la modifier." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Delete polygon." @@ -7146,7 +7163,7 @@ msgid "" msgstr "" "Bouton gauche : Activer le bit.\n" "Bouton droit : Désactiver le bit.\n" -"Cliquer sur une autre tuile pour l'éditer." +"Cliquez sur une autre tuile pour la modifier." #: editor/plugins/tile_set_editor_plugin.cpp msgid "" @@ -7163,16 +7180,16 @@ msgid "" "Select sub-tile to change its priority.\n" "Click on another Tile to edit it." msgstr "" -"Sélectionner une sous-tuile pour changer sa priorité.\n" -"Cliquer sur une autre tuile pour l'éditer." +"Sélectionnez une sous-tuile pour changer sa priorité.\n" +"Cliquez sur une autre tuile pour la modifier." #: editor/plugins/tile_set_editor_plugin.cpp msgid "" "Select sub-tile to change its z index.\n" "Click on another Tile to edit it." msgstr "" -"Sélectionner une sous-tuile pour changer son index Z.\n" -"Cliquer sur une autre tuile pour l'éditer." +"Sélectionnez une sous-tuile pour changer son index Z.\n" +"Cliquez sur une autre tuile pour la modifier." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Set Tile Region" @@ -7211,6 +7228,14 @@ msgid "Clear Tile Bitmask" msgstr "Supprimer le masque de bit de la tuile" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "Rendre le polygone concave" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "Rendre le polygon Convex" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Supprimer la tuile" @@ -7252,26 +7277,23 @@ msgstr "TileSet" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "Définir le nom de l'uniforme" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Définir comme défaut pour '%s'" +msgstr "Définir le port d'entrée par défaut" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "VisualShader" +msgstr "Ajouter un nÅ“ud au Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" msgstr "Dupliquer le(s) nÅ“ud(s)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "Type d’entrée Visual Shader changée" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" @@ -7290,14 +7312,12 @@ msgid "VisualShader" msgstr "VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Modifier la priorité de la tuile" +msgstr "Modifier la propriété visuelle" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Modification de shader" +msgstr "Mode Visual Shader changé" #: editor/project_export.cpp msgid "Runnable" @@ -7305,17 +7325,19 @@ msgstr "Exécutable" #: editor/project_export.cpp msgid "Delete patch '%s' from list?" -msgstr "Supprimer le patch '%s' de la liste ?" +msgstr "Supprimer le patch « %s » de la liste ?" #: editor/project_export.cpp msgid "Delete preset '%s'?" -msgstr "Supprimer pré-réglage '%s' ?" +msgstr "Supprimer le pré-réglage « %s » ?" #: editor/project_export.cpp msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"Échec de l'exportation du projet pour la plate-forme « %s ».\n" +"Les modèles d'exportation semblent être manquants ou invalides." #: editor/project_export.cpp msgid "" @@ -7323,6 +7345,9 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"Échec de l'exportation du projet pour la plate-forme « %s ».\n" +"Cela peut être dû à un problème de configuration dans le préréglage " +"d'exportation ou dans vos paramètres d'exportation." #: editor/project_export.cpp msgid "Release" @@ -7333,6 +7358,10 @@ msgid "Exporting All" msgstr "Tout exporter" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "Le chemin de l'exportation donné n'existe pas :" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Modèles d'exportation manquants ou corrompus pour cette plateforme :" @@ -7440,7 +7469,7 @@ msgstr "Exporter le PCK/ZIP" #: editor/project_export.cpp msgid "Export mode?" -msgstr "Mode d'exportation?" +msgstr "Mode d'exportation ?" #: editor/project_export.cpp msgid "Export All" @@ -7461,8 +7490,8 @@ msgstr "Le chemin vers ce fichier n'existe pas." #: editor/project_manager.cpp msgid "Invalid '.zip' project file, does not contain a 'project.godot' file." msgstr "" -"Fichier de projet '.zip' invalide, il ne contient pas de fichier 'project." -"godot'." +"Fichier de projet « .zip » invalide, il ne contient pas de fichier « project." +"godot »." #: editor/project_manager.cpp msgid "Please choose an empty folder." @@ -7470,7 +7499,7 @@ msgstr "Veuillez choisir un dossier vide." #: editor/project_manager.cpp msgid "Please choose a 'project.godot' or '.zip' file." -msgstr "Veuillez choisir un fichier 'project.godot' ou '.zip'." +msgstr "Veuillez choisir un fichier « project.godot » ou « .zip »." #: editor/project_manager.cpp msgid "Directory already contains a Godot project." @@ -7547,7 +7576,7 @@ msgstr "Créer et ouvrir" #: editor/project_manager.cpp msgid "Install Project:" -msgstr "Installer projet :" +msgstr "Installer le projet :" #: editor/project_manager.cpp msgid "Install & Edit" @@ -7575,7 +7604,7 @@ msgstr "Parcourir" #: editor/project_manager.cpp msgid "Renderer:" -msgstr "Moteur de rendre :" +msgstr "Moteur de rendu :" #: editor/project_manager.cpp msgid "OpenGL ES 3.0" @@ -7661,7 +7690,7 @@ msgid "" "the engine anymore." msgstr "" "Le fichier de configuration de projet ci-dessous a été généré par une " -"précédente version du moteur, et doit être mis à nouveau pour cette " +"précédente version du moteur, et doit être mis à niveau pour cette " "version :\n" "\n" "%s\n" @@ -7684,17 +7713,17 @@ msgid "" "Please edit the project and set the main scene in \"Project Settings\" under " "the \"Application\" category." msgstr "" -"Impossible de lancer le projet : Pas de scène principale définie\n" -"Veuillez éditer le projet et définir la scène principale dans \"Paramètres " -"du projet\" sous la catégorie \"Application\"." +"Impossible de lancer le projet : pas de scène principale définie.\n" +"Veuillez modifier le projet et définir la scène principale dans « Paramètres " +"du projet » sous la catégorie « Application »." #: editor/project_manager.cpp msgid "" "Can't run project: Assets need to be imported.\n" "Please edit the project to trigger the initial import." msgstr "" -"Impossible d'exécuter le projet: Des ressources doivent être importées. \n" -"Veuillez éditer le projet pour déclencher l'importation initiale." +"Impossible d'exécuter le projet : des ressources doivent être importées. \n" +"Veuillez cliquer sur « Édition » pour déclencher l'importation initiale." #: editor/project_manager.cpp msgid "Are you sure to run more than one project?" @@ -7710,7 +7739,7 @@ msgid "" "Language changed.\n" "The UI will update next time the editor or project manager starts." msgstr "" -"La langue à été modifiée.\n" +"La langue a été modifiée.\n" "L'interface utilisateur sera mise à jour au prochain démarrage de l'éditeur " "ou du gestionnaire de projets." @@ -7763,9 +7792,8 @@ msgid "" "You don't currently have any projects.\n" "Would you like to explore the official example projects in the Asset Library?" msgstr "" -"Vous n'avez pour l'instant aucun projets.\n" -"Aimeriez-vous explorer les exemples de projets officiels dans l'Asset " -"Library ?" +"Vous n'avez pour l'instant aucun projet.\n" +"Voulez-vous explorer les exemples de projets officiels dans l'Asset Library ?" #: editor/project_settings_editor.cpp msgid "Key " @@ -7788,8 +7816,8 @@ msgid "" "Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or " "'\"'" msgstr "" -"Nom d'action invalide. Il ne peux être vide ni contenir '/', ':', '=', '\\' " -"ou '\"'" +"Nom d'action invalide. Il ne peut être vide ni contenir « / », « : », « = », " +"« \\ » ou « \" »" #: editor/project_settings_editor.cpp msgid "Action '%s' already exists!" @@ -7929,11 +7957,11 @@ msgstr "Sélectionnez d'abord un élément à configurer !" #: editor/project_settings_editor.cpp msgid "No property '%s' exists." -msgstr "Il n'y a pas de propriété '%s'." +msgstr "Il n'y a pas de propriété « %s »." #: editor/project_settings_editor.cpp msgid "Setting '%s' is internal, and it can't be deleted." -msgstr "Le paramètre '%s' est interne et ne peut être effacé." +msgstr "Le paramètre « %s » est interne et ne peut être effacé." #: editor/project_settings_editor.cpp msgid "Delete Item" @@ -7944,8 +7972,8 @@ msgid "" "Invalid action name. It cannot be empty nor contain '/', ':', '=', '\\' or " "'\"'." msgstr "" -"Nom d'action invalide. Il ne peux être vide ou contenir '/', ':', '=', '\\' " -"ou '\"'." +"Nom d'action invalide. Il ne peut être vide ou contenir « / », « : », « = », " +"« \\ » ou « \" »." #: editor/project_settings_editor.cpp msgid "Already existing" @@ -8157,12 +8185,12 @@ msgstr "Sélectionner une méthode" #: editor/pvrtc_compress.cpp msgid "Could not execute PVRTC tool:" -msgstr "Impossible d'exécuter l'outil PVRTC :" +msgstr "Impossible d'exécuter l'outil PVRTC :" #: editor/pvrtc_compress.cpp msgid "Can't load back converted image using PVRTC tool:" msgstr "" -"L'image convertie n'a pas pu être rechargée en utilisant l'outil PVRTC :" +"L'image convertie n'a pas pu être rechargée en utilisant l'outil PVRTC :" #: editor/rename_dialog.cpp editor/scene_tree_dock.cpp msgid "Batch Rename" @@ -8379,9 +8407,8 @@ msgid "Instantiated scenes can't become root" msgstr "Les scènes instanciées ne peuvent pas devenir la racine" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "Choisir comme racine de scène" +msgstr "Choisir le nÅ“ud comme racine de scène" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8420,9 +8447,8 @@ msgid "Make Local" msgstr "Rendre local" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Choisir comme racine de scène" +msgstr "Nouvelle racine de scène" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8539,7 +8565,7 @@ msgstr "" #: editor/scene_tree_dock.cpp msgid "Attach a new or existing script for the selected node." msgstr "" -"Attacher un nouveau script ou un script existant pour le nÅ“ud sélectionné ." +"Attacher un nouveau script ou un script existant pour le nÅ“ud sélectionné." #: editor/scene_tree_dock.cpp msgid "Clear a script for the selected node." @@ -8643,7 +8669,7 @@ msgstr "Sélectionner un nÅ“ud" #: editor/script_create_dialog.cpp msgid "Error loading template '%s'" -msgstr "Erreur de chargement de modèle '%s'" +msgstr "Erreur lors du chargement du modèle « %s »" #: editor/script_create_dialog.cpp msgid "Error - Could not create script in filesystem." @@ -8855,19 +8881,16 @@ msgid "Set From Tree" msgstr "Définir depuis l'arbre" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Lent sur la fin" +msgstr "Effacer le raccourci" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Raccourcis" +msgstr "Restaurer le raccourci" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Modifier les ancres" +msgstr "Modifier le raccourci" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -8911,11 +8934,11 @@ msgstr "Changer le rayon d'une forme en sphère" #: editor/spatial_editor_gizmos.cpp modules/csg/csg_gizmos.cpp msgid "Change Box Shape Extents" -msgstr "Changer les extents d'une forme en boîte" +msgstr "Changer l'étendue de la forme rectangulaire" #: editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Radius" -msgstr "Changer le rayon d'une forme en capsule" +msgstr "Changer le rayon de la forme capsule" #: editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Height" @@ -9078,9 +9101,8 @@ msgid "GridMap Duplicate Selection" msgstr "Sélection de la duplication de GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paint" -msgstr "Paramètres GridMap" +msgstr "Peinture GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Grid Map" @@ -9104,15 +9126,15 @@ msgstr "Agrafe ci-dessous" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Edit X Axis" -msgstr "Editer axe X" +msgstr "Modifier l'axe X" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Edit Y Axis" -msgstr "Editer axe Y" +msgstr "Modifier l'axe Y" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Edit Z Axis" -msgstr "Editer axe Z" +msgstr "Modifier l'axe Z" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Cursor Rotate X" @@ -9462,16 +9484,15 @@ msgstr "Séquence de connexion du nÅ“ud" #: modules/visual_script/visual_script_editor.cpp msgid "Script already has function '%s'" -msgstr "Le script a déjà une fonction '%s'" +msgstr "Le script a déjà une fonction « %s »" #: modules/visual_script/visual_script_editor.cpp msgid "Change Input Value" msgstr "Changer nom de l'entrée" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "Redimensionner l'élément de canevas" +msgstr "Redimensionner le commentaire" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -9519,7 +9540,7 @@ msgstr "NÅ“uds disponibles :" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit graph" -msgstr "Sélectionner ou créer une fonction pour éditer le graphe" +msgstr "Sélectionnez ou créez une fonction pour modifier le graphe" #: modules/visual_script/visual_script_editor.cpp msgid "Edit Signal Arguments:" @@ -9535,7 +9556,7 @@ msgstr "Supprimer la selection" #: modules/visual_script/visual_script_editor.cpp msgid "Find Node Type" -msgstr "Trouver le type du nÅ“ud" +msgstr "Rechercher le type de nÅ“ud" #: modules/visual_script/visual_script_editor.cpp msgid "Copy Nodes" @@ -9571,7 +9592,7 @@ msgstr "Indice de nom de propriété invalide." #: modules/visual_script/visual_script_func_nodes.cpp msgid "Base object is not a Node!" -msgstr "L'objet de base n'est pas un nÅ“ud !" +msgstr "L'objet de base n'est pas un nÅ“ud !" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Path does not lead Node!" @@ -9579,7 +9600,7 @@ msgstr "Le chemin ne mène pas au nÅ“ud !" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." -msgstr "Nom de propriété invalide '%s' dans le nÅ“ud %s." +msgstr "Nom de propriété invalide « %s » dans le nÅ“ud %s." #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid argument of type: " @@ -9634,8 +9655,8 @@ msgstr "Les segments du paquet doivent être de longueur non nulle." #: platform/android/export/export.cpp msgid "The character '%s' is not allowed in Android application package names." msgstr "" -"Le caractère '%s' n'est pas autorisé dans les noms de paquet d'applications " -"Android." +"Le caractère « %s » n'est pas autorisé dans les noms de paquet " +"d'applications Android." #: platform/android/export/export.cpp msgid "A digit cannot be the first character in a package segment." @@ -9650,22 +9671,22 @@ msgstr "" #: platform/android/export/export.cpp msgid "The package must have at least one '.' separator." -msgstr "Le paquet doit comporter au moins un séparateur '.'." +msgstr "Le paquet doit comporter au moins un séparateur « . »." #: platform/android/export/export.cpp msgid "ADB executable not configured in the Editor Settings." -msgstr "L'exécutable ADB n'est pas configuré dans les paramètres de l'éditeur." +msgstr "L'exécutable ADB n'est pas configuré dans les Paramètres de l'éditeur." #: platform/android/export/export.cpp msgid "OpenJDK jarsigner not configured in the Editor Settings." msgstr "" -"OpenJDK jarsigner n'est pas configuré dans les paramètres de l'éditeur." +"Le jarsigner OpenJDK n'est pas configuré dans les Paramètres de l'éditeur." #: platform/android/export/export.cpp msgid "Debug keystore not configured in the Editor Settings nor in the preset." msgstr "" -"Debug keystore n'est pas configuré dans les paramètres de l'éditeur ni dans " -"le préréglage." +"Le Debug keystore n'est pas configuré dans les Paramètres de l'éditeur, ni " +"dans le préréglage." #: platform/android/export/export.cpp msgid "Invalid public key for APK expansion." @@ -9682,11 +9703,11 @@ msgstr "L'identifiant est manquant." #: platform/iphone/export/export.cpp msgid "Identifier segments must be of non-zero length." msgstr "" -"Les segments de l'identifiant doivent être d'une longueur différente de zéro." +"Les segments de l'identifiant doivent être d'une longueur supérieure à zéro." #: platform/iphone/export/export.cpp msgid "The character '%s' is not allowed in Identifier." -msgstr "Le caractère'%s' n'est pas autorisé dans l'identifiant." +msgstr "Le caractère « %s » n'est pas autorisé dans l'identifiant." #: platform/iphone/export/export.cpp msgid "A digit cannot be the first character in a Identifier segment." @@ -9697,12 +9718,12 @@ msgstr "" msgid "" "The character '%s' cannot be the first character in a Identifier segment." msgstr "" -"Le caractère'%s' ne peut pas être le premier caractère d'un segment " +"Le caractère « %s » ne peut pas être le premier caractère d'un segment " "d'identifiant." #: platform/iphone/export/export.cpp msgid "The Identifier must have at least one '.' separator." -msgstr "L'identifiant doit avoir au moins un séparateur '.'." +msgstr "L'identifiant doit avoir au moins un séparateur « . »." #: platform/iphone/export/export.cpp msgid "App Store Team ID not specified - cannot configure the project." @@ -9870,7 +9891,7 @@ msgid "" "\"Particles Animation\" enabled." msgstr "" "L'animation de CPUParticles2D a besoin d'un CanvasItemMaterial avec " -"\"Particles Animation\" activé." +"« Particles Animation » activé." #: scene/2d/light_2d.cpp msgid "" @@ -9934,15 +9955,15 @@ msgid "" "imprinted." msgstr "" "Un matériau de traitement des particules n'est pas assigné, aucun " -"comportement n'est donc imprimé." +"comportement n'est donc visible." #: scene/2d/particles_2d.cpp msgid "" "Particles2D animation requires the usage of a CanvasItemMaterial with " "\"Particles Animation\" enabled." msgstr "" -"L'animation de Particles2D a besoin d'un CanvasItemMaterial avec \"Animation " -"de Particules\" activé." +"L'animation de Particles2D a besoin d'un CanvasItemMaterial avec « Particles " +"Animation » activé." #: scene/2d/path_2d.cpp msgid "PathFollow2D only works when set as a child of a Path2D node." @@ -10088,6 +10109,14 @@ msgstr "" "Une CollisionShape nécessite une forme pour fonctionner. Créez une ressource " "de forme pour cette CollisionShape !" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" +"Les formes planes ne fonctionnent pas bien et seront supprimées dans les " +"versions futures. S'il vous plaît, ne les utilisez pas." + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Rien n'est visible car aucun maillage n'a été assigné." @@ -10097,13 +10126,21 @@ msgid "" "CPUParticles animation requires the usage of a SpatialMaterial with " "\"Billboard Particles\" enabled." msgstr "" -"L'animation de CPUParticles a besoin d'un SpatialMaterial avec \"Billboard " -"Particles\" activé." +"L'animation de CPUParticles a besoin d'un SpatialMaterial avec « Billboard " +"Particles » activé." #: scene/3d/gi_probe.cpp msgid "Plotting Meshes" msgstr "Tracer les maillages" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" +"Les GIProps ne sont pas supporter par le pilote de vidéos GLES2.\n" +"A la place utilisez une BakedLightMap." + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10141,8 +10178,8 @@ msgid "" "Particles animation requires the usage of a SpatialMaterial with \"Billboard " "Particles\" enabled." msgstr "" -"L'animation de Particles a besoin d'un SpatialMaterial avec \"Billboard " -"Particles\" activé." +"L'animation de Particles a besoin d'un SpatialMaterial avec « Billboard " +"Particles » activé." #: scene/3d/path.cpp msgid "PathFollow only works when set as a child of a Path node." @@ -10155,8 +10192,8 @@ msgid "" "PathFollow ROTATION_ORIENTED requires \"Up Vector\" enabled in its parent " "Path's Curve resource." msgstr "" -"PathFollow ROTATION_ORIENTED nécessite l'activation de \"Up Vector\" dans la " -"ressource Path's Curve de son parent." +"L'option ROTATION_ORIENTED de PathFollow nécessite l'activation de « Up " +"Vector » dans la ressource Curve de son parent Path." #: scene/3d/physics_body.cpp msgid "" @@ -10225,23 +10262,23 @@ msgstr "" #: scene/animation/animation_blend_tree.cpp msgid "On BlendTree node '%s', animation not found: '%s'" -msgstr "Sur le nÅ“ud BlendTree '%s', animation introuvable : '%s'" +msgstr "Sur le nÅ“ud BlendTree « %s », animation introuvable : « %s »" #: scene/animation/animation_blend_tree.cpp msgid "Animation not found: '%s'" -msgstr "Animation introuvable : '%s'" +msgstr "Animation introuvable : « %s »" #: scene/animation/animation_tree.cpp msgid "In node '%s', invalid animation: '%s'." -msgstr "Dans le nÅ“ud '%s', animation non valide : '%s'." +msgstr "Dans le nÅ“ud « %s », animation non valide : « %s »." #: scene/animation/animation_tree.cpp msgid "Invalid animation: '%s'." -msgstr "Animation invalide : '%s'." +msgstr "Animation invalide : « %s »." #: scene/animation/animation_tree.cpp msgid "Nothing connected to input '%s' of node '%s'." -msgstr "Rien n'est connecté à l'entrée '%s' du nÅ“ud '%s'." +msgstr "Rien n'est connecté à l'entrée « %s » du nÅ“ud « %s »." #: scene/animation/animation_tree.cpp msgid "A root AnimationNode for the graph is not set." @@ -10282,6 +10319,18 @@ msgstr "Alterner entre les valeurs hexadécimales ou brutes." msgid "Add current color as a preset." msgstr "Ajouter la couleur courante comme pré-réglage." +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" +"Le conteneur en lui-même ne sert à rien à moins qu'un script ne configure " +"son comportement de placement de ses enfants.\n" +"Si vous n'avez pas l'intention d'ajouter un script, utilisez plutôt un nÅ“ud " +"'Control'." + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Alerte !" @@ -10290,6 +10339,10 @@ msgstr "Alerte !" msgid "Please Confirm..." msgstr "Veuillez confirmer…" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "Aller au dossier parent." + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10376,6 +10429,11 @@ msgstr "Affectation à l'uniforme." msgid "Varyings can only be assigned in vertex function." msgstr "Les variations ne peuvent être affectées que dans la fonction vertex." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Instancie la(les) scène(s) sélectionnée(s) en tant qu'enfant(s) du nÅ“ud " +#~ "sélectionné." + #~ msgid "FPS" #~ msgstr "IPS" diff --git a/editor/translations/he.po b/editor/translations/he.po index ce4aa15431..6883709a0d 100644 --- a/editor/translations/he.po +++ b/editor/translations/he.po @@ -1385,8 +1385,22 @@ msgstr "×ריזה" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1438,7 +1452,7 @@ msgstr "הצגה ×‘×ž× ×”×œ הקבצי×" msgid "New Folder..." msgstr "תיקייה חדשה…" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "×¨×¢× ×•×Ÿ" @@ -1513,10 +1527,35 @@ msgstr "העברת מועדף למעלה" msgid "Move Favorite Down" msgstr "העברת מועדף למטה" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "המישור הקוד×" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "יצירת תיקייה" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "מעבר לתיקייה שמעל" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "×œ× × ×™×ª×Ÿ ליצור תיקייה." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "צפייה ×‘×¤×¨×™×˜×™× ×›×¨×©×ª של ×ª×ž×•× ×•×ª ממוזערות" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "הצגת ×¤×¨×™×˜×™× ×›×¨×©×™×ž×”" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "תיקיות וקבצי×:" @@ -1750,9 +1789,9 @@ msgstr "מחיקת הפלט" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "שגי××” בשמירת המש×ב!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1760,6 +1799,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "שגי××” בשמירת המש×ב!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "שמירת המש×ב בתור…" @@ -3021,16 +3070,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "×œ× × ×™×ª×Ÿ ×œ× ×•×•×˜ ×ל ‚%s’ כיוון ×©×œ× × ×ž×¦× ×‘×ž×¢×¨×›×ª הקבצי×!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "צפייה ×‘×¤×¨×™×˜×™× ×›×¨×©×ª של ×ª×ž×•× ×•×ª ממוזערות" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "הצגת ×¤×¨×™×˜×™× ×›×¨×©×™×ž×”" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "מצב: ×™×™×‘×•× ×”×§×•×‘×¥ × ×›×©×œ. × × ×œ×ª×§×Ÿ ×ת הקובץ ×•×œ×™×™×‘× ×ž×—×“×© ×™×“× ×™×ª." @@ -3174,10 +3213,6 @@ msgid "Search files" msgstr "חיפוש במחלקות" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5185,19 +5220,19 @@ msgid "Generating Visibility Rect" msgstr "× ×•×¦×¨ ×ž×™×–× C#‎…" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5289,11 +5324,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6992,6 +7027,24 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "הסקריפט הב×" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "הסקריפט הקוד×" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7144,6 +7197,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "הזזת מצולע" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "הזזת מצולע" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "הסרת ×ª×‘× ×™×ª" @@ -7273,6 +7336,10 @@ msgid "Exporting All" msgstr "ייצו×" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9877,6 +9944,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9891,6 +9964,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10038,6 +10117,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "הוספת הצבע ×”× ×•×›×—×™ כערכה" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -10046,6 +10133,11 @@ msgstr "" msgid "Please Confirm..." msgstr "× × ×œ×מת…" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "מעבר לתיקייה שמעל" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/hi.po b/editor/translations/hi.po index 21993c701c..7f0bba57d7 100644 --- a/editor/translations/hi.po +++ b/editor/translations/hi.po @@ -1396,8 +1396,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1446,7 +1460,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1521,10 +1535,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1747,8 +1781,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1757,6 +1791,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2997,14 +3041,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3149,10 +3185,6 @@ msgid "Search files" msgstr "खोज कर:" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5106,19 +5138,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5209,11 +5241,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6870,6 +6902,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7018,6 +7066,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "सदसà¥à¤¯à¤¤à¤¾ बनाà¤à¤‚" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "मिटाना" @@ -7139,6 +7196,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9706,6 +9767,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9720,6 +9787,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9865,6 +9938,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9873,6 +9954,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/hr.po b/editor/translations/hr.po index bb303f6e71..82c9382625 100644 --- a/editor/translations/hr.po +++ b/editor/translations/hr.po @@ -1334,8 +1334,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1383,7 +1397,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1458,10 +1472,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1677,8 +1711,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1687,6 +1721,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2921,14 +2965,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3064,10 +3100,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -4996,19 +5028,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5099,11 +5131,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6736,6 +6768,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6874,6 +6922,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -6991,6 +7047,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9542,6 +9602,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9556,6 +9622,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9699,6 +9771,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9707,6 +9787,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/hu.po b/editor/translations/hu.po index 273ad21282..7d61ceec08 100644 --- a/editor/translations/hu.po +++ b/editor/translations/hu.po @@ -1405,8 +1405,22 @@ msgstr "Csomagolás" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1458,7 +1472,7 @@ msgstr "Mutat FájlkezelÅ‘ben" msgid "New Folder..." msgstr "Új Mappa..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "FrissÃtés" @@ -1533,10 +1547,35 @@ msgstr "Kedvenc Felfelé Mozgatása" msgid "Move Favorite Down" msgstr "Kedvenc Lefelé Mozgatása" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "ElÅ‘zÅ‘ SÃk" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Mappa Létrehozása" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Ugrás a szülÅ‘mappába" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Nem sikerült létrehozni a mappát." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Elemek kirajzolása indexképek rácsába" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Elemek listázása" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Könyvtárak és Fájlok:" @@ -1777,9 +1816,9 @@ msgstr "Kimenet Törlése" msgid "Project export failed with error code %d." msgstr "Projekt export nem sikerült, hibakód %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Hiba történt az erÅ‘forrás mentésekor!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1787,6 +1826,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Hiba történt az erÅ‘forrás mentésekor!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "ErÅ‘forrás Mentése Másként..." @@ -3120,16 +3169,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "Nem lehet '%s'-t elérni, mivel nem létezik a fájlrendszerben!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Elemek kirajzolása indexképek rácsába" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Elemek listázása" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Ãllapot: Fájl importálása sikertelen. JavÃtsa a fájlt majd importálja be " @@ -3275,10 +3314,6 @@ msgid "Search files" msgstr "Osztályok Keresése" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Kiválasztott Scene(k) példányosÃtása a kiválasztott Node gyermekeként." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5326,6 +5361,10 @@ msgid "Generating Visibility Rect" msgstr "Láthatósági Téglalap Generálása" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Láthatósági Téglalap Generálása" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "Csak egy ParticlesMaterial feldolgozó anyagba állÃthat pontot" @@ -5338,10 +5377,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Nem létezik egyetlen pixel sem >128-as átlátszósággal a képben..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Láthatósági Téglalap Generálása" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Kibocsátási Maszk Betöltése" @@ -5430,13 +5465,13 @@ msgid "Generating AABB" msgstr "AABB Generálása" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "AABB Generálása" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Láthatósági AABB Generálása" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "AABB Generálása" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Pont EltávolÃtása GörbérÅ‘l" @@ -7142,6 +7177,24 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "KövetkezÅ‘ Szkript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "ElÅ‘zÅ‘ Szkript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7295,6 +7348,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Sokszög Mozgatása" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Sokszög Mozgatása" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Sablon EltávolÃtása" @@ -7427,6 +7490,10 @@ msgid "Exporting All" msgstr "Exportálás" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10035,6 +10102,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10049,6 +10122,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10199,6 +10278,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Figyelem!" @@ -10207,6 +10294,11 @@ msgstr "Figyelem!" msgid "Please Confirm..." msgstr "Kérem ErÅ‘sÃtse Meg..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Ugrás a szülÅ‘mappába" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10285,6 +10377,10 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Kiválasztott Scene(k) példányosÃtása a kiválasztott Node gyermekeként." + #, fuzzy #~ msgid "Font Size:" #~ msgstr "Körvonal Mérete:" diff --git a/editor/translations/id.po b/editor/translations/id.po index 08c16c0a34..8635cf10a7 100644 --- a/editor/translations/id.po +++ b/editor/translations/id.po @@ -22,8 +22,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-03-01 11:59+0000\n" -"Last-Translator: Alphin Albukhari <alphinalbukhari5@gmail.com>\n" +"PO-Revision-Date: 2019-03-08 15:04+0000\n" +"Last-Translator: Evan Hyacinth <muhammad.ivan669@gmail.com>\n" "Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/" "godot/id/>\n" "Language: id\n" @@ -31,7 +31,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -100,14 +100,12 @@ msgid "Delete Selected Key(s)" msgstr "Hapus Key Terpilih" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Tambahkan Sinyal" +msgstr "Tambahkan Titik Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Hapus Sinyal" +msgstr "Pindah Titik-titik Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -138,14 +136,13 @@ msgid "Anim Change Call" msgstr "Ubah Panggilan Anim" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Ubah Nama Animasi:" +msgstr "Ubah Panjang Animasi" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "Ubah Perulangan Animasi" #: editor/animation_track_editor.cpp msgid "Property Track" @@ -197,9 +194,8 @@ msgid "Anim Clips:" msgstr "Klip-klip Animasi:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Ubah Nilai Array" +msgstr "Ubah Jalan Trek" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -226,9 +222,8 @@ msgid "Time (s): " msgstr "Waktu (d): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Aktifkan" +msgstr "Aktifkan Trek Beralih" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -281,19 +276,16 @@ msgid "Delete Key(s)" msgstr "Hapus Key" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Ubah Nama Animasi:" +msgstr "Ubah Mode Pembaruan Animasi" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Mode Interpolasi" +msgstr "Ubah Mode Interpolasi Animasi" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Ubah Perulangan Animasi" +msgstr "Ubah Mode Perulangan Animasi" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -338,14 +330,12 @@ msgid "Anim Insert Key" msgstr "Sisipkan Key Anim" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Ubah Nama Animasi:" +msgstr "Ubah Langkah Animasi" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Mengatur kembali Autoload-autoload" +msgstr "Susun ulang Trek-trek" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -377,9 +367,8 @@ msgid "Not possible to add a new track without a root" msgstr "Tidak memungkinkan untuk menambah track baru tanpa akar" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Tambah Track" +msgstr "Tambah Track Bezier" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -390,14 +379,12 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "Track bukan tipe Spatial, tidak bisa menambahkan key" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Track Transformasi 3D" +msgstr "Tambah Kunci Trek Transformasi" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Tambah Track" +msgstr "Tambah Kunci Track" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." @@ -405,9 +392,8 @@ msgstr "" "Tidak bisa menambahkan key untuk metode karena path pada track tidak sah." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Track Pemanggil Metode" +msgstr "Tambah Kunci Track Metode" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -422,9 +408,8 @@ msgid "Clipboard is empty" msgstr "Papan klip kosong" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Paste Tracks" -msgstr "Tempel Parameter" +msgstr "Tempel Trek-trek" #: editor/animation_track_editor.cpp msgid "Anim Scale Keys" @@ -461,14 +446,12 @@ msgid "Edit" msgstr "Sunting" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation properties." -msgstr "PohonAnimasi" +msgstr "Properti Animasi." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Copy Tracks" -msgstr "Salin Parameter" +msgstr "Salin Trek-trek" #: editor/animation_track_editor.cpp msgid "Scale Selection" @@ -487,19 +470,16 @@ msgid "Duplicate Transposed" msgstr "Duplikat Dialihkan" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Delete Selection" -msgstr "Hapus yang Dipilih" +msgstr "Hapus Pilihan" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Next Step" -msgstr "Lanjut ke Langkah Berikutnya" +msgstr "Menuju Langkah Berikutnya" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Go to Previous Step" -msgstr "Lanjut ke Langkah Sebelumnya" +msgstr "Menuju Langkah Sebelumnya" #: editor/animation_track_editor.cpp msgid "Optimize Animation" @@ -574,17 +554,16 @@ msgid "Copy" msgstr "Kopy" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Klip-klip Suara:" +msgstr "Tambah Clip Trek Audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Seimbangkan Awalan Klip Trek Audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Seimbangkan Akhiran Klip Trek Audio" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -656,7 +635,7 @@ msgstr "Peringatan" #: editor/code_editor.cpp msgid "Line and column numbers." -msgstr "Nomor Baris dan Kolom" +msgstr "Nomor baris dan kolom." #: editor/connections_dialog.cpp msgid "Method in target Node must be specified!" @@ -917,9 +896,8 @@ msgid "Error loading:" msgstr "Error saat memuat:" #: editor/dependency_editor.cpp -#, fuzzy msgid "Load failed due to missing dependencies:" -msgstr "Scene gagal dimuat disebabkan oleh dependensi yang hilang:" +msgstr "Gagal dimuat disebabkan oleh dependensi yang hilang:" #: editor/dependency_editor.cpp editor/editor_node.cpp msgid "Open Anyway" @@ -1070,7 +1048,6 @@ msgid "Uncompressing Assets" msgstr "Membuka Aset Terkompresi" #: editor/editor_asset_installer.cpp editor/project_manager.cpp -#, fuzzy msgid "Package installed successfully!" msgstr "Paket Sukses Terpasang!" @@ -1178,7 +1155,6 @@ msgid "Master bus can't be deleted!" msgstr "Master Bus tidak dapat dihapus!" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Delete Audio Bus" msgstr "Hapus Bus Audio" @@ -1219,9 +1195,8 @@ msgid "Add Bus" msgstr "Tambahkan Bus" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add a new Audio Bus to this layout." -msgstr "Simpan Layout Suara Bus Ke..." +msgstr "Tambah Bus Audio baru ke layout ini." #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp @@ -1392,30 +1367,52 @@ msgstr "Menyimpan File:" #: editor/editor_export.cpp msgid "No export template found at the expected path:" -msgstr "" +msgstr "Templat ekspor tidak ditemukan di tempat yg diharapkan:" #: editor/editor_export.cpp msgid "Packing" msgstr "Mengemas" #: editor/editor_export.cpp +#, fuzzy msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." msgstr "" +"Platform target membutuhkan kompressi tekstur 'ETC' untuk GLES2. Aktifkan " +"dukungan di Pengaturan Proyek." + +#: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"Platform target membutuhkan kompressi tekstur 'ETC' untuk GLES2. Aktifkan " +"dukungan di Pengaturan Proyek." + +#: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." +msgstr "" +"Platform target membutuhkan kompressi tekstur 'ETC' untuk GLES2. Aktifkan " +"dukungan di Pengaturan Proyek." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp -#, fuzzy msgid "Custom debug template not found." -msgstr "Templat berkas tidak ditemukan:" +msgstr "Debug template kustom tidak ditemukan." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp #: platform/osx/export/export.cpp platform/uwp/export/export.cpp msgid "Custom release template not found." -msgstr "" +msgstr "Templat rilis kustom tidak ditemukan." #: editor/editor_export.cpp platform/javascript/export/export.cpp msgid "Template file not found:" @@ -1430,9 +1427,8 @@ msgid "File Exists, Overwrite?" msgstr "File telah ada, Overwrite?" #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp -#, fuzzy msgid "Select This Folder" -msgstr "Pilih Folder ini" +msgstr "Pilih Folder Ini" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp msgid "Copy Path" @@ -1444,7 +1440,6 @@ msgstr "Tampilkan di Pengelola Berkas" #: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp #: editor/project_manager.cpp -#, fuzzy msgid "Show in File Manager" msgstr "Tampilkan di Manajer Berkas" @@ -1452,7 +1447,7 @@ msgstr "Tampilkan di Manajer Berkas" msgid "New Folder..." msgstr "Buat Direktori..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Segarkan" @@ -1527,10 +1522,35 @@ msgstr "Pindahkan Favorit Keatas" msgid "Move Favorite Down" msgstr "Pindahkan Favorit Kebawah" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Tab sebelumnya" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Buat Folder" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Pergi ke direktori induk" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Tidak dapat membuat folder." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Tampilkan item sebagai grid thumbnail" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Tampilkan item sebagai daftar" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Direktori-direktori & File-file:" @@ -1589,19 +1609,16 @@ msgid "Methods" msgstr "Fungsi" #: editor/editor_help.cpp -#, fuzzy msgid "Methods:" -msgstr "Fungsi" +msgstr "Metode-metode:" #: editor/editor_help.cpp -#, fuzzy msgid "Theme Properties" -msgstr "Properti Objek" +msgstr "Properti-properti Tema" #: editor/editor_help.cpp -#, fuzzy msgid "Theme Properties:" -msgstr "Properti Objek" +msgstr "Properti-properti Tema:" #: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp msgid "Signals:" @@ -1628,14 +1645,12 @@ msgid "Constants:" msgstr "Konstanta:" #: editor/editor_help.cpp -#, fuzzy msgid "Class Description" -msgstr "Deskripsi" +msgstr "Deskripsi Kelas" #: editor/editor_help.cpp -#, fuzzy msgid "Class Description:" -msgstr "Deskripsi:" +msgstr "Deskripsi Kelas:" #: editor/editor_help.cpp msgid "Online Tutorials:" @@ -1652,14 +1667,12 @@ msgstr "" "$url2]memberikan usulan[/url][/color]." #: editor/editor_help.cpp -#, fuzzy msgid "Property Descriptions" -msgstr "Deskripsi Properti Objek:" +msgstr "Deskripsi Properti" #: editor/editor_help.cpp -#, fuzzy msgid "Property Descriptions:" -msgstr "Deskripsi Properti Objek:" +msgstr "Deskripsi Properti:" #: editor/editor_help.cpp msgid "" @@ -1670,12 +1683,10 @@ msgstr "" "dengan[color=$color][url=$url]kontribusi[/url][/color]!" #: editor/editor_help.cpp -#, fuzzy msgid "Method Descriptions" -msgstr "Deskripsi Metode:" +msgstr "Deskripsi Metode" #: editor/editor_help.cpp -#, fuzzy msgid "Method Descriptions:" msgstr "Deskripsi Metode:" @@ -1693,24 +1704,20 @@ msgid "Search Help" msgstr "Mencari Bantuan" #: editor/editor_help_search.cpp -#, fuzzy msgid "Display All" -msgstr "Ganti Semua" +msgstr "Tampilkan Semua" #: editor/editor_help_search.cpp -#, fuzzy msgid "Classes Only" -msgstr "Kelas" +msgstr "Hanya Kelas" #: editor/editor_help_search.cpp -#, fuzzy msgid "Methods Only" -msgstr "Fungsi" +msgstr "Hanya Fungsi" #: editor/editor_help_search.cpp -#, fuzzy msgid "Signals Only" -msgstr "Sinyal-sinyal" +msgstr "Hanya Sinyal" #: editor/editor_help_search.cpp msgid "Constants Only" @@ -1766,9 +1773,9 @@ msgstr "Bersihkan Luaran" msgid "Project export failed with error code %d." msgstr "Ekspor proyek gagal dengan kode kesalahan% d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Error menyimpan resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1776,6 +1783,16 @@ msgid "OK" msgstr "Oke" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Error menyimpan resource!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Simpan Resource Sebagai..." @@ -1998,13 +2015,12 @@ msgid "Save changes to '%s' before closing?" msgstr "Simpan perubahan '%s' sebelum tutup?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Gagal memuat resource." +msgstr "Tersimpan %s resource berubah." #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "" +msgstr "Node akar diperlukan untuk menyimpan scene." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -2114,12 +2130,12 @@ msgid "Unable to load addon script from path: '%s'." msgstr "Tidak bisa memuat script addon dari lokasi: '%s'." #: editor/editor_node.cpp -#, fuzzy msgid "" "Unable to load addon script from path: '%s' There seems to be an error in " "the code, please check the syntax." msgstr "" -"Tidak dapat memuat addon script dari jalur: '%s' Script tidak pada mode tool." +"Tidak dapat memuat script addon dari path: '%s' Mungkin ada kesalahan dalam " +"kode, mohon periksa sintaks." #: editor/editor_node.cpp msgid "" @@ -2172,19 +2188,16 @@ msgstr "Bawaan" #: editor/editor_node.cpp editor/editor_properties.cpp #: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp -#, fuzzy msgid "Show in FileSystem" -msgstr "Tampilkan dalam Manajer Berkas" +msgstr "Tampilkan dalam FileSystem" #: editor/editor_node.cpp -#, fuzzy msgid "Play This Scene" -msgstr "Mainkan Scene" +msgstr "Mainkan Scene Ini" #: editor/editor_node.cpp -#, fuzzy msgid "Close Tab" -msgstr "Tutup" +msgstr "Tutup Tab" #: editor/editor_node.cpp msgid "Switch Scene Tab" @@ -2211,9 +2224,8 @@ msgid "Distraction Free Mode" msgstr "Mode Tanpa Gangguan" #: editor/editor_node.cpp -#, fuzzy msgid "Toggle distraction-free mode." -msgstr "Mode Tanpa Gangguan" +msgstr "Toggle mode tanpa gangguan." #: editor/editor_node.cpp msgid "Add a new scene." @@ -2260,9 +2272,8 @@ msgid "Save Scene" msgstr "Simpan Scene" #: editor/editor_node.cpp -#, fuzzy msgid "Save All Scenes" -msgstr "Simpan semua Scene" +msgstr "Simpan Semua Scene" #: editor/editor_node.cpp msgid "Close Scene" @@ -2316,7 +2327,7 @@ msgstr "Ekspor" #: editor/editor_node.cpp editor/plugins/tile_set_editor_plugin.cpp msgid "Tools" -msgstr "Alat" +msgstr "Alat-alat" #: editor/editor_node.cpp #, fuzzy @@ -2346,7 +2357,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Small Deploy with Network FS" -msgstr "Deploy kecil dengan jaringan FS" +msgstr "Deploy Kecil dengan Jaringan FS" #: editor/editor_node.cpp msgid "" @@ -2365,7 +2376,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Visible Collision Shapes" -msgstr "Collision Shapes terlihat" +msgstr "Collision Shapes Terlihat" #: editor/editor_node.cpp msgid "" @@ -2377,7 +2388,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Visible Navigation" -msgstr "Navigasi terlihat" +msgstr "Navigasi Terlihat" #: editor/editor_node.cpp msgid "" @@ -2389,7 +2400,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "Sinkronasi Perubahan Scene" +msgstr "Sinkronkan Perubahan Scene" #: editor/editor_node.cpp msgid "" @@ -2405,7 +2416,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "Sinkronasi Perubahan Script" +msgstr "Sinkronkan Perubahan Script" #: editor/editor_node.cpp msgid "" @@ -2648,7 +2659,7 @@ msgstr "Buat Pratinjau Mesh" #: editor/editor_plugin.cpp msgid "Thumbnail..." -msgstr "Thumbnail..." +msgstr "Gambar Kecil..." #: editor/editor_plugin_settings.cpp #, fuzzy @@ -2782,6 +2793,10 @@ msgid "" "Please switch on the 'local to scene' property on it (and all resources " "containing it up to a node)." msgstr "" +"Tidak dapat membuat ViewportTexture karena resource ini tidak dibuat lokal " +"untuk scene.\n" +"Mohon ubah properti 'lokal untuk scene' resource ini (dan semua resource " +"yang memuatnya sampai satu node ke atas)." #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Pick a Viewport" @@ -3116,16 +3131,6 @@ msgstr "" "'%s' tidak bisa ditelusuri karena tidak bisa ditemukan dalam berkas sistem!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Tampilkan item sebagai grid thumbnail" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Tampilkan item sebagai daftar" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Status: Gagal mengimpor berkas. Mohon perbaiki berkas dan impor ulang secara " @@ -3189,7 +3194,7 @@ msgstr "Buka Scene" #: editor/filesystem_dock.cpp msgid "Instance" -msgstr "Instance" +msgstr "Instansi" #: editor/filesystem_dock.cpp #, fuzzy @@ -3271,10 +3276,6 @@ msgid "Search files" msgstr "Cari Kelas" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Instance scene terpilih sebagai anak node saat ini." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3369,7 +3370,7 @@ msgstr "Nama tidak sah." #: editor/groups_editor.cpp editor/node_dock.cpp msgid "Groups" -msgstr "Grup" +msgstr "Kelompok" #: editor/groups_editor.cpp #, fuzzy @@ -3454,7 +3455,7 @@ msgstr "Membuat Pemetaan Cahaya" #: editor/import/resource_importer_scene.cpp msgid "Generating for Mesh: " -msgstr "Menghasilkan untuk Mesh:" +msgstr "Menghasilkan untuk Mesh: " #: editor/import/resource_importer_scene.cpp msgid "Running Custom Script..." @@ -3502,7 +3503,7 @@ msgstr "Impor ulang" #: editor/import_dock.cpp msgid "Save scenes, re-import and restart" -msgstr "" +msgstr "Simpan scene-scene, impor ulang dan mulai ulang" #: editor/import_dock.cpp #, fuzzy @@ -3513,6 +3514,8 @@ msgstr "Mengubah driver video harus memulai ulang editor." msgid "" "WARNING: Assets exist that use this resource, they may stop loading properly." msgstr "" +"PERINGATAN: Ada aset-aset yang menggunakan resource ini, mereka mungkin akan " +"berhenti untuk termuat secara sempurna." #: editor/inspector_dock.cpp msgid "Failed to load resource." @@ -3746,7 +3749,7 @@ msgstr "Hapus Bidang dan Titik" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "Pindahkan Titik Node BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3846,7 +3849,7 @@ msgstr "Buat segi tiga pembauran secara otomatis (sebagai ganti cara manual)" #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend:" -msgstr "" +msgstr "Campur:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #, fuzzy @@ -3861,7 +3864,7 @@ msgstr "Sunting Filter" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Output node can't be added to the blend tree." -msgstr "" +msgstr "Node keluaran tidak bisa ditambahkan ke pohon campur." #: editor/plugins/animation_blend_tree_editor_plugin.cpp #, fuzzy @@ -4120,11 +4123,11 @@ msgstr "Tempel" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Future" -msgstr "" +msgstr "Masa depan" #: editor/plugins/animation_player_editor_plugin.cpp msgid "Depth" -msgstr "" +msgstr "Kedalaman" #: editor/plugins/animation_player_editor_plugin.cpp msgid "1 step" @@ -4238,7 +4241,7 @@ msgstr "Node Transisi" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Tetapkan Node Awalan (Mulai sendiri)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4379,19 +4382,19 @@ msgstr "Node sekali tembak" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Mix Node" -msgstr "" +msgstr "Aduk Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend2 Node" -msgstr "" +msgstr "Campur 2 Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend3 Node" -msgstr "" +msgstr "Campur 3 Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Blend4 Node" -msgstr "" +msgstr "Campur 4 Node" #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "TimeScale Node" @@ -4583,10 +4586,12 @@ msgid "" "No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " "Light' flag is on." msgstr "" +"Tidak ada mesh-mesh untuk di bake. Pastikan mereka punya kanal UV2 dan 'Bake " +"Cahaya' menyala." #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "Failed creating lightmap images, make sure path is writable." -msgstr "" +msgstr "Gagal membuat gambar lightmap, pastikan path dapat ditulis." #: editor/plugins/baked_lightmap_editor_plugin.cpp #, fuzzy @@ -4604,23 +4609,23 @@ msgstr "Atur Snap" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Grid Offset:" -msgstr "" +msgstr "Offset Kotak-kotak:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Grid Step:" -msgstr "" +msgstr "Jangkah Kotak-kotak:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Offset:" -msgstr "" +msgstr "Offset Perputaran:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Step:" -msgstr "" +msgstr "Jangkah Perputaran:" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move vertical guide" -msgstr "" +msgstr "Pindahkan garis-bantu vertikal" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4634,7 +4639,7 @@ msgstr "Hapus Variabel" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move horizontal guide" -msgstr "" +msgstr "Pindahkan garis-bantu horisontal" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4648,7 +4653,7 @@ msgstr "Hapus Tombol-tombol yang tidak sah" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Create new horizontal and vertical guides" -msgstr "" +msgstr "Buat garis-bantu vertikal dan horisontal baru" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4662,7 +4667,7 @@ msgstr "Sunting CanvasItem" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move anchor" -msgstr "" +msgstr "Pindahkan jangkar" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4681,35 +4686,39 @@ msgstr "Sunting CanvasItem" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Presets for the anchors and margins values of a Control node." -msgstr "" +msgstr "Preset-preset untuk nilai jangkar dan pinggiran node Control." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "" "Children of containers have their anchors and margins values overridden by " "their parent." msgstr "" +"Nilai jangkar dan pinggiran milik anak dari sebuah kontainer akan di timpa " +"dengan milik orang-tua nya." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchors only" -msgstr "" +msgstr "Hanya jangkar-jangkar" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Change Anchors and Margins" -msgstr "" +msgstr "Ubah jangkar-jangkar dan pinggiran" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Change Anchors" -msgstr "" +msgstr "Ubah Jangkar-jangkar" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Paste Pose" -msgstr "" +msgstr "Tempel Pose" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "" "Warning: Children of a container get their position and size determined only " "by their parent." msgstr "" +"Peringatan: Posisi milik anak dari sebuah kontainer ditentukan oleh orang-" +"tua nya." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/texture_region_editor_plugin.cpp @@ -4720,31 +4729,32 @@ msgstr "Perkecil Pandangan" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Select Mode" -msgstr "" +msgstr "Mode Seleksi" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Drag: Rotate" -msgstr "" +msgstr "Geser: Putar" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Alt+Drag: Move" -msgstr "" +msgstr "Alt+Geser: Pindah" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)." msgstr "" +"Tekan 'v' untuk Ganti Pivot, 'Shift+v' untuk Geser Pivot (ketika bergerak)." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Alt+RMB: Depth list selection" -msgstr "" +msgstr "Alt+Klik kanan: Daftar seleksi kedalaman" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Move Mode" -msgstr "" +msgstr "Mode Pindah" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotate Mode" -msgstr "" +msgstr "Mode Putar" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4757,14 +4767,16 @@ msgid "" "Show a list of all objects at the position clicked\n" "(same as Alt+RMB in select mode)." msgstr "" +"Tampilkan semua objek dalam posisi klik ke sebuah daftar\n" +"(sama seperti Alt+Klik kanan dalam mode seleksi)." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Click to change object's rotation pivot." -msgstr "" +msgstr "Klik untuk mengubah pivot perputaran objek." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Pan Mode" -msgstr "" +msgstr "Mode Geser Pandangan" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4773,78 +4785,78 @@ msgstr "Beralih Breakpoint" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Snap" -msgstr "" +msgstr "Gunakan Snap" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snapping Options" -msgstr "" +msgstr "Opsi-opsi Snap" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to grid" -msgstr "" +msgstr "Snap ke kotak-kotak" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" -msgstr "" +msgstr "Gunakan Snap Rotasi" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Configure Snap..." -msgstr "" +msgstr "Atur Snap..." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap Relative" -msgstr "" +msgstr "Snap Relatif" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Pixel Snap" -msgstr "" +msgstr "Gunakan Snap Piksel" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Smart snapping" -msgstr "" +msgstr "Snap pintar" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to parent" -msgstr "" +msgstr "Snap ke orang-tua" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to node anchor" -msgstr "" +msgstr "Snap ke jangkar node" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to node sides" -msgstr "" +msgstr "Snap ke sisi-sisi node" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to node center" -msgstr "" +msgstr "Snap ke tengah node" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to other nodes" -msgstr "" +msgstr "Snape ke node-node lain" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap to guides" -msgstr "" +msgstr "Snape ke garis-bantu" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Lock the selected object in place (can't be moved)." -msgstr "" +msgstr "Kunci objek terpilih di tempat (tidak dapat di pindah)." #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "Unlock the selected object (can be moved)." -msgstr "" +msgstr "Buka kunci objek terpilih (dapat di pindah)." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Makes sure the object's children are not selectable." -msgstr "" +msgstr "Pastikan anak-anak objek tidak dapat diseleksi." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Restores the object's children's ability to be selected." -msgstr "" +msgstr "Jadikan anak-anak object dapat di seleksi kembali." #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4853,19 +4865,19 @@ msgstr "Singleton" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Bones" -msgstr "" +msgstr "Tampilkan Tulang-tulang" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" -msgstr "" +msgstr "Buat Rantai IK" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear IK Chain" -msgstr "" +msgstr "Bersihkan Rantai IK" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Make Custom Bone(s) from Node(s)" -msgstr "" +msgstr "Buat Tulang Kustom(satu/lebih) dari Node(satu/lebih)" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4875,36 +4887,36 @@ msgstr "Mainkan Custom Scene" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/spatial_editor_plugin.cpp msgid "View" -msgstr "" +msgstr "Pandangan" #: editor/plugins/canvas_item_editor_plugin.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Show Grid" -msgstr "" +msgstr "Tampilkan Kotak-kotak" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Helpers" -msgstr "" +msgstr "Tampilkan Bantuan-bantuan" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Rulers" -msgstr "" +msgstr "Tampilkan Penggaris-penggaris" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Guides" -msgstr "" +msgstr "Tampilkan Garis-bantu" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Origin" -msgstr "" +msgstr "Tampilkan Pangkal" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Viewport" -msgstr "" +msgstr "Tampilkan Viewport" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Group And Lock Icons" -msgstr "" +msgstr "Tampilkan Ikon Kunci Dan Grup" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Center Selection" @@ -5347,6 +5359,10 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" @@ -5359,10 +5375,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "" @@ -5451,11 +5463,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7185,6 +7197,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Tab sebelumnya" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7341,6 +7370,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Buat Bidang" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Hapus Templat" @@ -7477,6 +7515,11 @@ msgid "Exporting All" msgstr "Mengekspor untuk %s" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "File tidak ada." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10231,6 +10274,12 @@ msgstr "" "Sebuah bentuk harus disediakan untuk CollisionShape untuk fungsi. Mohon " "ciptakan sebuah resource bentuk untuk itu!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10245,6 +10294,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10407,6 +10462,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Tambahkan warna yang sekarang sebagai preset" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Peringatan!" @@ -10415,6 +10478,11 @@ msgstr "Peringatan!" msgid "Please Confirm..." msgstr "Mohon konfirmasi..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Pergi ke direktori induk" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10500,6 +10568,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Instance scene terpilih sebagai anak node saat ini." + #~ msgid "Warnings:" #~ msgstr "Peringatan:" diff --git a/editor/translations/is.po b/editor/translations/is.po index 01875778cf..1bc85f8a2f 100644 --- a/editor/translations/is.po +++ b/editor/translations/is.po @@ -1361,8 +1361,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1411,7 +1425,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1486,10 +1500,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1705,8 +1739,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1715,6 +1749,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2950,14 +2994,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3094,10 +3130,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5037,19 +5069,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5140,11 +5172,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6785,6 +6817,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6930,6 +6978,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Fjarlægja val" @@ -7049,6 +7105,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9606,6 +9666,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9620,6 +9686,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9763,6 +9835,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9771,6 +9851,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/it.po b/editor/translations/it.po index a859a8b3be..a3b8481d30 100644 --- a/editor/translations/it.po +++ b/editor/translations/it.po @@ -1432,8 +1432,22 @@ msgstr "Impacchettando" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1484,7 +1498,7 @@ msgstr "Mostra nel File Manager" msgid "New Folder..." msgstr "Nuova Cartella..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Aggiorna" @@ -1559,10 +1573,35 @@ msgstr "Sposta Preferito Su" msgid "Move Favorite Down" msgstr "Sposta Preferito Giù" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Scheda precedente" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Prossimo Piano" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Vai nella cartella padre" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Impossibile creare cartella." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Visualizza elementi come una griglia di miniature" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Visualizza elementi come una lista" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Directory e File:" @@ -1786,9 +1825,10 @@ msgstr "Svuota output" msgid "Project export failed with error code %d." msgstr "Esportazione progetto fallita con codice di errore %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Errore salvando la Risorsa!" +#: editor/editor_node.cpp +#, fuzzy +msgid "Imported resources can't be saved." +msgstr "Risorse Importate" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1796,6 +1836,16 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Errore salvando la Risorsa!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Salva Risorsa Come..." @@ -3130,16 +3180,6 @@ msgstr "" "Impossibile navigare a '%s' perché non è stato trovato nel file system!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Visualizza elementi come una griglia di miniature" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Visualizza elementi come una lista" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Stato: Importazione file fallita. Si prega di riparare il file e " @@ -3285,10 +3325,6 @@ msgid "Search files" msgstr "Cerca Classi" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Istanzia le scene selezionate come figlie del nodo selezionato." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5349,6 +5385,10 @@ msgid "Generating Visibility Rect" msgstr "Genera Rect Visibilità " #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Genera Rect Visibilità " + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "É solamente possibile impostare il punto in un materiale di processo " @@ -5363,10 +5403,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Nessun pixel con trasparenza >128 nell'immagine..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Genera Rect Visibilità " - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Carica Maschera Emissione" @@ -5455,13 +5491,13 @@ msgid "Generating AABB" msgstr "Generando AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Genera AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Genera Visibilità AABB" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Genera AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Rimuovi Punto da Curva" @@ -7189,6 +7225,24 @@ msgid "Merge from Scene" msgstr "Unisci da Scena" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Prossimo Piano" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Scheda precedente" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7346,6 +7400,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Sposta Poligono" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Sposta Poligono" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Rimuovi Template" @@ -7483,6 +7547,11 @@ msgstr "Esportando per %s" #: editor/project_export.cpp #, fuzzy +msgid "The given export path doesn't exist:" +msgstr "File non esistente." + +#: editor/project_export.cpp +#, fuzzy msgid "Export templates for this platform are missing/corrupted:" msgstr "Le export templates per questa piattaforma sono mancanti:" @@ -10321,6 +10390,12 @@ msgstr "" "Perché CollisionShape funzioni deve essere fornita una forma. Si prega di " "creare una risorsa forma (shape)!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp #, fuzzy msgid "Nothing is visible because no mesh has been assigned." @@ -10337,6 +10412,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "Bliting Immagini" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10510,6 +10591,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Aggiungi colore attuale come preset" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Attenzione!" @@ -10518,6 +10607,11 @@ msgstr "Attenzione!" msgid "Please Confirm..." msgstr "Per Favore Conferma..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Vai nella cartella padre" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10605,6 +10699,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Istanzia le scene selezionate come figlie del nodo selezionato." + #~ msgid "FPS" #~ msgstr "FPS" @@ -12154,9 +12251,6 @@ msgstr "" #~ msgid "Cannot go into subdir:" #~ msgstr "Impossibile accedere alla subdirectory:" -#~ msgid "Imported Resources" -#~ msgstr "Risorse Importate" - #~ msgid "Insert Keys (Ins)" #~ msgstr "Inserisci Keys (Ins)" diff --git a/editor/translations/ja.po b/editor/translations/ja.po index 93e7d244a4..63b562f74c 100644 --- a/editor/translations/ja.po +++ b/editor/translations/ja.po @@ -21,12 +21,13 @@ # nitenook <admin@alterbaum.net>, 2018, 2019. # Rob Matych <robertsmatych@gmail.com>, 2018. # Hidetsugu Takahashi <manzyun@gmail.com>, 2019. +# Wataru Onuki <watonu@magadou.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-03-01 11:59+0000\n" -"Last-Translator: nitenook <admin@alterbaum.net>\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" +"Last-Translator: Wataru Onuki <watonu@magadou.com>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot/ja/>\n" "Language: ja\n" @@ -34,7 +35,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -101,14 +102,12 @@ msgid "Delete Selected Key(s)" msgstr "é¸æŠžä¸ã®ã‚ーを削除" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "ç‚¹ã‚’è¿½åŠ " +msgstr "ベジェãƒã‚¤ãƒ³ãƒˆã‚’è¿½åŠ " #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "ãƒã‚¤ãƒ³ãƒˆã‚’移動" +msgstr "ベジェãƒã‚¤ãƒ³ãƒˆã‚’移動" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -139,9 +138,8 @@ msgid "Anim Change Call" msgstr "アニメーション呼出ã—ã®å¤‰æ›´" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "アニメーションã®ãƒ«ãƒ¼ãƒ—を変更" +msgstr "アニメーションã®é•·ã•ã‚’変更" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -1388,10 +1386,33 @@ msgid "Packing" msgstr "パックã™ã‚‹" #: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"対象プラットフォームã§ã¯GLES2ã®ãŸã‚ã«'ETC'テクスãƒãƒ£åœ§ç¸®ãŒå¿…è¦ã§ã™ã€‚プãƒã‚¸ã‚§" +"クトè¨å®šã‚ˆã‚Šæœ‰åŠ¹ã«ã—ã¦ãã ã•ã„。" + +#: editor/editor_export.cpp +#, fuzzy +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"対象プラットフォームã§ã¯GLES2ã®ãŸã‚ã«'ETC'テクスãƒãƒ£åœ§ç¸®ãŒå¿…è¦ã§ã™ã€‚プãƒã‚¸ã‚§" +"クトè¨å®šã‚ˆã‚Šæœ‰åŠ¹ã«ã—ã¦ãã ã•ã„。" + +#: editor/editor_export.cpp +#, fuzzy msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" +"対象プラットフォームã§ã¯GLES2ã®ãŸã‚ã«'ETC'テクスãƒãƒ£åœ§ç¸®ãŒå¿…è¦ã§ã™ã€‚プãƒã‚¸ã‚§" +"クトè¨å®šã‚ˆã‚Šæœ‰åŠ¹ã«ã—ã¦ãã ã•ã„。" #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1438,7 +1459,7 @@ msgstr "ファイルマãƒãƒ¼ã‚¸ãƒ£ãƒ¼ã§è¡¨ç¤º" msgid "New Folder..." msgstr "æ–°è¦ãƒ•ã‚©ãƒ«ãƒ€..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "å†èªè¾¼" @@ -1513,10 +1534,33 @@ msgstr "ãŠæ°—ã«å…¥ã‚Šã‚’上ã¸" msgid "Move Favorite Down" msgstr "ãŠæ°—ã«å…¥ã‚Šã‚’下ã¸" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "å‰ã®åºŠé¢" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "次ã®åºŠé¢" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "親フォルダã¸" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "フォルダを作æˆã§ãã¾ã›ã‚“ã§ã—ãŸã€‚" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "アイテムをサムãƒã‚¤ãƒ«ã§ã‚°ãƒªãƒƒãƒ‰è¡¨ç¤ºã™ã‚‹ã€‚" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "アイテムを一覧ã§è¡¨ç¤ºã™ã‚‹ã€‚" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "ディレクトリã¨ãƒ•ã‚¡ã‚¤ãƒ«:" @@ -1739,9 +1783,9 @@ msgstr "出力をクリア" msgid "Project export failed with error code %d." msgstr "プãƒã‚¸ã‚§ã‚¯ãƒˆã®ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆãŒã‚¨ãƒ©ãƒ¼ã‚³ãƒ¼ãƒ‰ %d ã§å¤±æ•—ã—ã¾ã—ãŸã€‚" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "リソースä¿å˜ä¸ã®ã‚¨ãƒ©ãƒ¼ï¼" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1749,6 +1793,16 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "リソースä¿å˜ä¸ã®ã‚¨ãƒ©ãƒ¼ï¼" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "リソースを別åã§ä¿å˜..." @@ -1806,6 +1860,8 @@ msgid "" "This scene can't be saved because there is a cyclic instancing inclusion.\n" "Please resolve it and then attempt to save again." msgstr "" +"ã“ã®ã‚·ãƒ¼ãƒ³ã«ã¯ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã®å¾ªç’°å‚ç…§ãŒå«ã¾ã‚Œã¦ã„ã‚‹ãŸã‚ä¿å˜ã§ãã¾ã›ã‚“。\n" +"ãれをã¾ãšè§£æ¶ˆã—ã¦ã‹ã‚‰ã€ã¾ãŸä¿å˜ã—ã¦ã¿ã¦ãã ã•ã„。" #: editor/editor_node.cpp msgid "" @@ -2715,6 +2771,8 @@ msgid "" "The selected resource (%s) does not match any type expected for this " "property (%s)." msgstr "" +"é¸æŠžã•ã‚ŒãŸãƒªã‚½ãƒ¼ã‚¹ (%s) ã¯ã€ã“ã®ãƒ—ãƒãƒ‘ティ (%s) ãŒæ±‚ã‚ã‚‹åž‹ã«ä¸€è‡´ã—ã¦ã„ã¾ã›" +"ん。" #: editor/editor_properties.cpp msgid "" @@ -3056,14 +3114,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "ファイルシステム上㧠'%s' を見ã¤ã‘られãªã„ãŸã‚移動ã§ãã¾ã›ã‚“ï¼" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "アイテムをサムãƒã‚¤ãƒ«ã§ã‚°ãƒªãƒƒãƒ‰è¡¨ç¤ºã™ã‚‹ã€‚" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "アイテムを一覧ã§è¡¨ç¤ºã™ã‚‹ã€‚" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "ステータス: ファイルã®ã‚¤ãƒ³ãƒãƒ¼ãƒˆã«å¤±æ•—ã—ã¾ã—ãŸã€‚ファイルを修æ£ã—ã¦æ‰‹å‹•ã§å†ã‚¤" @@ -3143,7 +3193,7 @@ msgstr "ä¾å˜é–¢ä¿‚ã®ç·¨é›†..." #: editor/filesystem_dock.cpp msgid "View Owners..." -msgstr "所有者を見る..." +msgstr "オーナーを見る..." #: editor/filesystem_dock.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Rename..." @@ -3201,10 +3251,6 @@ msgid "Search files" msgstr "ファイル検索" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "é¸æŠžã—ãŸã‚·ãƒ¼ãƒ³ã‚’é¸æŠžã—ãŸãƒŽãƒ¼ãƒ‰ã®åã¨ã—ã¦ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹åŒ–ã—ã¾ã™ã€‚" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -4626,9 +4672,8 @@ msgid "Click to change object's rotation pivot." msgstr "クリックã§ã‚ªãƒ–ジェクトã®å›žè»¢ãƒ”ボットを変更ã™ã‚‹ã€‚" #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Pan Mode" -msgstr "パン・モード" +msgstr "パンモード" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Toggle snapping." @@ -5227,6 +5272,11 @@ msgid "Generating Visibility Rect" msgstr "å¯è¦–性ã®çŸ©å½¢ã‚’生æˆ" #: editor/plugins/particles_2d_editor_plugin.cpp +#, fuzzy +msgid "Generate Visibility Rect" +msgstr "å¯è¦–性ã®çŸ©å½¢ã‚’生æˆ" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" @@ -5240,11 +5290,6 @@ msgstr "ç”»åƒå†…ã«é€æ˜Žåº¦ãŒ128以上ã®ãƒ”クセルãŒã‚ã‚Šã¾ã›ã‚“..." #: editor/plugins/particles_2d_editor_plugin.cpp #, fuzzy -msgid "Generate Visibility Rect" -msgstr "å¯è¦–性ã®çŸ©å½¢ã‚’生æˆ" - -#: editor/plugins/particles_2d_editor_plugin.cpp -#, fuzzy msgid "Load Emission Mask" msgstr "発光(Emission)マスクをèªã¿è¾¼ã‚€" @@ -5338,14 +5383,14 @@ msgid "Generating AABB" msgstr "AABBを生æˆä¸" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "軸平行境界ボックス(AABB)を生æˆ" - -#: editor/plugins/particles_editor_plugin.cpp #, fuzzy msgid "Generate Visibility AABB" msgstr "å¯è¦–性ã®è»¸å¹³è¡Œå¢ƒç•Œãƒœãƒƒã‚¯ã‚¹ã‚’生æˆ" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "軸平行境界ボックス(AABB)を生æˆ" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "曲線ã‹ã‚‰ãƒã‚¤ãƒ³ãƒˆã‚’除去" @@ -5968,9 +6013,8 @@ msgid "Go to next edited document." msgstr "次ã®ç·¨é›†ã—ãŸãƒ‰ã‚ュメントã¸ç§»å‹•ã€‚" #: editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Discard" -msgstr "離散" +msgstr "ç ´æ£„" #: editor/plugins/script_editor_plugin.cpp #, fuzzy @@ -6202,7 +6246,7 @@ msgstr "平行投影" #: editor/plugins/spatial_editor_plugin.cpp msgid "Perspective" -msgstr "é€è¦–投影(é 近法)" +msgstr "é€è¦–投影" #: editor/plugins/spatial_editor_plugin.cpp #, fuzzy @@ -7070,6 +7114,24 @@ msgid "Merge from Scene" msgstr "シーンã‹ã‚‰ãƒžãƒ¼ã‚¸" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "次ã®åºŠé¢" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "å‰ã®åºŠé¢" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7220,6 +7282,16 @@ msgid "Clear Tile Bitmask" msgstr "タイル ビットマスクをクリア" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Concave" +msgstr "ãƒãƒªã‚´ãƒ³ã‚’移動" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "ãƒãƒªã‚´ãƒ³ã‚’移動" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "タイルを除去" @@ -7349,6 +7421,11 @@ msgid "Exporting All" msgstr "%sã«ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆä¸" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "å˜åœ¨ã—ãªã„パスã§ã™ã€‚" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "ã“ã®ãƒ—ラットフォームã«å¯¾ã™ã‚‹ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆ テンプレートãŒè¦‹ã¤ã‹ã‚‰ãªã„ã‹ã€ç ´æã—" @@ -10165,6 +10242,12 @@ msgstr "" "関数㮠CollisionShape ã®å½¢çŠ¶ã‚’指定ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ãã‚Œã®ãŸã‚ã®ã‚·ã‚§ã‚¤ãƒ—リ" "ソースを作æˆã—ã¦ãã ã•ã„!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp #, fuzzy msgid "Nothing is visible because no mesh has been assigned." @@ -10181,6 +10264,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "イメージをé…ç½®(Blit)" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10346,6 +10435,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "ç¾åœ¨ã®è‰²ã‚’プリセットã¨ã—ã¦è¿½åŠ " +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "è¦å‘Š!" @@ -10354,6 +10451,11 @@ msgstr "è¦å‘Š!" msgid "Please Confirm..." msgstr "確èª..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "親フォルダã¸" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10366,7 +10468,7 @@ msgstr "" #: scene/gui/range.cpp msgid "If exp_edit is true min_value must be > 0." -msgstr "" +msgstr "exp_edit ãŒtrueã®å ´åˆã€min_value ã¯0より大ãã„å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" #: scene/gui/scroll_container.cpp msgid "" @@ -10392,6 +10494,7 @@ msgstr "" "ã„る環境(Environment)ã¯èªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸ." #: scene/main/viewport.cpp +#, fuzzy msgid "" "This viewport is not set as render target. If you intend for it to display " "its contents directly to the screen, make it a child of a Control so it can " @@ -10440,6 +10543,9 @@ msgstr "uniform ã¸ã®å‰²ã‚Šå½“ã¦ã€‚" msgid "Varyings can only be assigned in vertex function." msgstr "Varyingã¯é ‚点関数ã«ã®ã¿å‰²ã‚Šå½“ã¦ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "é¸æŠžã—ãŸã‚·ãƒ¼ãƒ³ã‚’é¸æŠžã—ãŸãƒŽãƒ¼ãƒ‰ã®åã¨ã—ã¦ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹åŒ–ã—ã¾ã™ã€‚" + #~ msgid "FPS" #~ msgstr "フレームレート" diff --git a/editor/translations/ka.po b/editor/translations/ka.po index 0ef5840a20..e7fbffc52a 100644 --- a/editor/translations/ka.po +++ b/editor/translations/ka.po @@ -5,12 +5,13 @@ # Giorgi Beriashvili <giorgi.beriashvili@outlook.com>, 2018. # George Dzavashvili <dzavashviligeorge@gmail.com>, 2018. # დემეტრე შáƒáƒœáƒ˜áƒ <blender.animation.maker@gmail.com>, 2019. +# Rati Nikolaishvili <rati.nikolaishvili@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-10 12:01+0000\n" -"Last-Translator: დემეტრე შáƒáƒœáƒ˜áƒ <blender.animation.maker@gmail.com>\n" +"PO-Revision-Date: 2019-03-10 09:58+0000\n" +"Last-Translator: Rati Nikolaishvili <rati.nikolaishvili@gmail.com>\n" "Language-Team: Georgian <https://hosted.weblate.org/projects/godot-engine/" "godot/ka/>\n" "Language: ka\n" @@ -18,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -62,11 +63,11 @@ msgstr "" #: editor/animation_bezier_editor.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Free" -msgstr "" +msgstr "თáƒáƒ•áƒ˜áƒ¡áƒ£áƒ¤áƒáƒšáƒ˜" #: editor/animation_bezier_editor.cpp msgid "Balanced" -msgstr "" +msgstr "დáƒáƒ‘áƒáƒšáƒáƒœáƒ¡áƒ”ბული" #: editor/animation_bezier_editor.cpp msgid "Mirror" @@ -75,7 +76,7 @@ msgstr "სáƒáƒ კე" #: editor/animation_bezier_editor.cpp #, fuzzy msgid "Insert Key Here" -msgstr "áƒáƒœáƒ˜áƒ› გáƒáƒ¡áƒáƒ¦áƒ”ბის ჩáƒáƒ§áƒ”ნებáƒ" +msgstr "áƒáƒ¥ ჩáƒáƒ¡áƒ•áƒ˜áƒ— გáƒáƒ¡áƒáƒ¦áƒ”ბი" #: editor/animation_bezier_editor.cpp #, fuzzy @@ -1392,8 +1393,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1442,7 +1457,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1517,10 +1532,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1746,8 +1781,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1756,6 +1791,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2995,14 +3040,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3142,10 +3179,6 @@ msgid "Search files" msgstr "ძებნáƒ:" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5105,19 +5138,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5208,11 +5241,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6872,6 +6905,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7020,6 +7069,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "შექმნáƒ" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "მáƒáƒ¨áƒáƒ ებáƒ" @@ -7141,6 +7199,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9707,6 +9769,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9721,6 +9789,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9868,6 +9942,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9876,6 +9958,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/ko.po b/editor/translations/ko.po index 817407e30a..79597943ab 100644 --- a/editor/translations/ko.po +++ b/editor/translations/ko.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-03-01 11:59+0000\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" "Last-Translator: ì†¡íƒœì„ <xotjq237@gmail.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/" "godot/ko/>\n" @@ -25,7 +25,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -93,14 +93,12 @@ msgid "Delete Selected Key(s)" msgstr "ì„ íƒí•œ 키를 ì‚ì œ" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "í¬ì¸íŠ¸ 추가" +msgstr "ë² ì§€ì–´ í¬ì¸íŠ¸ 추가" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "í¬ì¸íŠ¸ ì´ë™" +msgstr "ë² ì§€ì–´ í¬ì¸íŠ¸ ì´ë™" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -131,9 +129,8 @@ msgid "Anim Change Call" msgstr "ì• ë‹ˆë©”ì´ì…˜ 호출 변경" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "ì• ë‹ˆë©”ì´ì…˜ 루프 변경" +msgstr "ì• ë‹ˆë©”ì´ì…˜ ê¸¸ì´ ë³€ê²½" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -190,9 +187,8 @@ msgid "Anim Clips:" msgstr "ì• ë‹ˆë©”ì´ì…˜ í´ë¦½:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "ë°°ì—´ ê°’ 변경" +msgstr "트랙 경로 변경" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -219,9 +215,8 @@ msgid "Time (s): " msgstr "시간 (ì´ˆ): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "ë„플러 활성화" +msgstr "트랙 활성화 í† ê¸€" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -274,19 +269,16 @@ msgid "Delete Key(s)" msgstr "키 ì‚ì œ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "ì• ë‹ˆë©”ì´ì…˜ ì´ë¦„ 변경:" +msgstr "ì• ë‹ˆë©”ì´ì…˜ ì—…ë°ì´íŠ¸ 모드 변경" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "ë³´ê°„ 모드" +msgstr "ì• ë‹ˆë©”ì´ì…˜ ë³´ê°„ 모드 변경" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "ì• ë‹ˆë©”ì´ì…˜ 루프 변경" +msgstr "ì• ë‹ˆë©”ì´ì…˜ 루프 모드 변경" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -331,14 +323,12 @@ msgid "Anim Insert Key" msgstr "ì• ë‹ˆë©”ì´ì…˜ 키 삽입" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "ì• ë‹ˆë©”ì´ì…˜ FPS 변경" +msgstr "ì• ë‹ˆë©”ì´ì…˜ ìŠ¤í… ë³€ê²½" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "ì˜¤í† ë¡œë“œ ìž¬ì •ë ¬" +msgstr "트랙 ìž¬ì •ë ¬" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -370,9 +360,8 @@ msgid "Not possible to add a new track without a root" msgstr "루트 ì—†ì´ ìƒˆ íŠ¸ëž™ì„ ì¶”ê°€í• ìˆ˜ ì—†ìŒ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "트랙 추가" +msgstr "ë² ì§€ì–´ 트랙 추가" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -383,23 +372,20 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "íŠ¸ëž™ì´ Spatial íƒ€ìž…ì´ ì•„ë‹™ë‹ˆë‹¤, 키를 삽입하실 수 없습니다" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "3D 변형 트랙" +msgstr "변형 트랙 키 추가" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "트랙 추가" +msgstr "트랙 키 추가" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." msgstr "트랙 경로가 ìœ íš¨í•˜ì§€ 않습니다, 메서드 키를 추가하실 수 없습니다." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "호출 메서드 트랙" +msgstr "메서드 트랙 키 추가" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -560,17 +546,16 @@ msgid "Copy" msgstr "복사하기" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "오디오 í´ë¦½:" +msgstr "오디오 트랙 í´ë¦½ 추가" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "오디오 트랙 í´ë¦½ 시작 오프셋 변경" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "오디오 트랙 í´ë¦½ 종료 오프셋 변경" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -1379,9 +1364,26 @@ msgstr "패킹 중" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "ëŒ€ìƒ í”Œëž«í¼ì€ GLES2를 위해 'ETC' í…ìŠ¤ì³ ì••ì¶•ì´ í•„ìš”í•©ë‹ˆë‹¤. 프로ì 트 ì„¤ì •ì—ì„œ 'Import Etc'ì„ ì‚¬ìš©í•˜ì„¸ìš”." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"ëŒ€ìƒ í”Œëž«í¼ì€ GLES3를 위해 'ETC2' í…ìŠ¤ì³ ì••ì¶•ì´ í•„ìš”í•©ë‹ˆë‹¤. 프로ì 트 ì„¤ì •ì—ì„œ 'Import Etc 2'를 사용하세요." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" +"ëŒ€ìƒ í”Œëž«í¼ì€ ë“œë¼ì´ë²„ê°€ GLES2ë¡œ í´ë°±í•˜ê¸° 위해 'ETC' í…ìŠ¤ì³ ì••ì¶•ì´ í•„ìš”í•©ë‹ˆë‹¤.\n" +"프로ì 트 ì„¤ì •ì—ì„œ 'Import Etc'ì„ í‚¤ê±°ë‚˜, 'Driver Fallback Enabled'를 비활성화하세요." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1428,7 +1430,7 @@ msgstr "íŒŒì¼ íƒìƒ‰ê¸°ì—ì„œ 보기" msgid "New Folder..." msgstr "새 í´ë”..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "ìƒˆë¡œê³ ì¹¨" @@ -1503,10 +1505,30 @@ msgstr "ì¦ê²¨ì°¾ê¸° 위로 ì´ë™" msgid "Move Favorite Down" msgstr "ì¦ê²¨ì°¾ê¸° 아래로 ì´ë™" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "ì´ì „ í´ë”" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "ë‹¤ìŒ í´ë”" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "부모 í´ë”ë¡œ ì´ë™" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "현재 í´ë”를 ì¦ê²¨ì°¾ê¸° (안) 합니다." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "ì¸ë„¤ì¼ 바둑íŒìœ¼ë¡œ 보기." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "리스트로 보기." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "ë””ë ‰í† ë¦¬ì™€ 파ì¼:" @@ -1729,9 +1751,9 @@ msgstr "ì¶œë ¥ 지우기" msgid "Project export failed with error code %d." msgstr "프로ì 트 내보내기가 오류 코드 %d ë¡œ 실패했습니다." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "리소스 ì €ìž¥ 중 오류!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "ê°€ì ¸ì˜¨ 리소스를 ì €ìž¥í• ìˆ˜ 없습니다." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1739,6 +1761,16 @@ msgid "OK" msgstr "확ì¸" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "리소스 ì €ìž¥ 중 오류!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "ì´ ë¦¬ì†ŒìŠ¤ëŠ” íŽ¸ì§‘ëœ ì”¬ì— ì†í•´ìžˆì§€ 않기 ë•Œë¬¸ì— ì €ìž¥í• ìˆ˜ 없습니다. ë¨¼ì € 리소스를 ìœ ì¼í•˜ê²Œ 만드세요." + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "리소스를 다른 ì´ë¦„으로 ì €ìž¥..." @@ -1954,14 +1986,12 @@ msgid "Save changes to '%s' before closing?" msgstr "닫기 ì „ì— '%s'ì— ë³€ê²½ì‚¬í•ì„ ì €ìž¥í•˜ì‹œê² ìŠµë‹ˆê¹Œ?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "리소스 불러오기 실패." +msgstr "%s ìˆ˜ì •ëœ ë¦¬ì†ŒìŠ¤ê°€ ì €ìž¥ë˜ì—ˆìŠµë‹ˆë‹¤." #: editor/editor_node.cpp -#, fuzzy msgid "A root node is required to save the scene." -msgstr "í° í…스ì³ë¥¼ 위해서는 단 í•˜ë‚˜ì˜ íŒŒì¼ë§Œ 요구ë©ë‹ˆë‹¤." +msgstr "ì”¬ì„ ì €ìž¥í•˜ê¸° 위해 루트 노드가 필요합니다." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -3043,14 +3073,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "íŒŒì¼ ì‹œìŠ¤í…œì—ì„œ '%s'ì„(를) ì°¾ì„ ìˆ˜ 없습니다!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "ì¸ë„¤ì¼ 바둑íŒìœ¼ë¡œ 보기." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "리스트로 보기." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "ìƒíƒœ: íŒŒì¼ ê°€ì ¸ì˜¤ê¸° 실패. 파ì¼ì„ ìˆ˜ì •í•˜ê³ \"다시 ê°€ì ¸ì˜¤ê¸°\"를 수행하세요." @@ -3187,10 +3209,6 @@ msgid "Search files" msgstr "íŒŒì¼ ê²€ìƒ‰" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "ì„ íƒëœ ì”¬ì„ ì„ íƒëœ ë…¸ë“œì˜ ìžì‹ìœ¼ë¡œ ì¸ìŠ¤í„´ìŠ¤ 합니다." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3592,19 +3610,16 @@ msgstr "불러오기..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "í¬ì¸íŠ¸ ì´ë™" +msgstr "노드 í¬ì¸íŠ¸ ì´ë™" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "ë¸”ë Œë“œ 시간 변경" +msgstr "BlendSpace1D ì œí•œ 변경" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "ë¸”ë Œë“œ 시간 변경" +msgstr "BlendSpace1D ë¼ë²¨ 변경" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3614,24 +3629,21 @@ msgstr "ì´ íƒ€ìž…ì˜ ë…¸ë“œë¥¼ ì‚¬ìš©í• ìˆ˜ 없습니다. ì˜¤ì§ ë£¨íŠ¸ 노드 #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "노드 추가" +msgstr "노드 í¬ì¸íŠ¸ 추가" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "ì• ë‹ˆë©”ì´ì…˜ 추가하기" +msgstr "ì• ë‹ˆë©”ì´ì…˜ í¬ì¸íŠ¸ 추가" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "경로 í¬ì¸íŠ¸ ì‚ì œ" +msgstr "BlendSpace1D í¬ì¸íŠ¸ ì‚ì œ" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "BlendSpace1D 노드 í¬ì¸íŠ¸ ì´ë™" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3677,29 +3689,24 @@ msgid "Triangle already exists" msgstr "삼ê°í˜•ì´ ì´ë¯¸ 존재함" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "변수 추가" +msgstr "삼ê°í˜• 추가" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "ë¸”ë Œë“œ 시간 변경" +msgstr "BlendSpace2D ì œí•œ 변경" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "ë¸”ë Œë“œ 시간 변경" +msgstr "BlendSpace2D ë¼ë²¨ 변경" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "경로 í¬ì¸íŠ¸ ì‚ì œ" +msgstr "BlendSpace2D í¬ì¸íŠ¸ ì‚ì œ" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "변수 ì‚ì œ" +msgstr "BlendSpace2D 삼ê°í˜• ì‚ì œ" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3710,9 +3717,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "삼ê°í˜•ì´ 존재하지 않습니다, ë¸”ëžœë”©ì´ ì¼ì–´ë‚˜ì§€ 않습니다." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "ì˜¤í† ë¡œë“œ 글로벌 í† ê¸€" +msgstr "ìžë™ 삼ê°í˜• í† ê¸€" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3732,9 +3738,8 @@ msgid "Blend:" msgstr "ë¸”ë Œë“œ:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "머티리얼 변경" +msgstr "매개변수 변경ë¨" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3746,15 +3751,13 @@ msgid "Output node can't be added to the blend tree." msgstr "ì¶œë ¥ 노드를 ë¸”ë Œë“œ íŠ¸ë¦¬ì— ì¶”ê°€í• ìˆ˜ 없습니다." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "트리ì—ì„œ 노드 추가" +msgstr "BlendTreeì— ë…¸ë“œ 추가" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "ì´ë™ 모드" +msgstr "노드 ì´ë™ë¨" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3763,36 +3766,30 @@ msgstr "ì—°ê²°í• ìˆ˜ 없습니다, í¬íŠ¸ê°€ 사용 중ì´ê±°ë‚˜ ìœ íš¨í•˜ì§€ ì #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "ì—°ê²°ë¨" +msgstr "노드 ì—°ê²°ë¨" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "ì—°ê²° í•´ì œë¨" +msgstr "노드 ì—°ê²° í•´ì œë¨" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "새로운 ì• ë‹ˆë©”ì´ì…˜" +msgstr "ì• ë‹ˆë©”ì´ì…˜ ì„¤ì •" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" msgstr "노드 ì‚ì œ" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "ì´ íŠ¸ëž™ì„ í‚¤ê±°ë‚˜ ë•ë‹ˆë‹¤." +msgstr "í•„í„° 켜기/ë„기 í† ê¸€" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "ë¡œì¼€ì¼ í•„í„° 변경ë¨" +msgstr "í•„í„° 변경" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3814,9 +3811,8 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "노드 ì´ë¦„" +msgstr "노드 ì´ë¦„ 변경ë¨" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4044,14 +4040,12 @@ msgid "Cross-Animation Blend Times" msgstr "êµì°¨-ì• ë‹ˆë©”ì´ì…˜ ë¸”ë Œë“œ 시간" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "ì´ë™ 모드" +msgstr "노드 ì´ë™" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "ë²ˆì— ì¶”ê°€" +msgstr "ì „í™˜ 추가" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4087,18 +4081,16 @@ msgid "No playback resource set at path: %s." msgstr "ë‹¤ìŒ ê²½ë¡œì— ì„¤ì •ëœ ìž¬ìƒ ë¦¬ì†ŒìŠ¤ê°€ 없습니다: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "ì œê±°ë¨:" +msgstr "노드 ì‚ì œë¨" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "ì „í™˜ 노드" +msgstr "ì „í™˜ ì‚ì œë¨" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "시작 노드 ì„¤ì • (ìžë™ 재ìƒ)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4597,8 +4589,8 @@ msgid "" "Show a list of all objects at the position clicked\n" "(same as Alt+RMB in select mode)." msgstr "" -"í´ë¦í•œ ìœ„ì¹˜ì— ìžˆëŠ” ëª¨ë“ ì˜¤ë¸Œì íŠ¸ë“¤ì˜ ëª©ë¡ì„ ë³´ì—¬ì¤ë‹ˆë‹¤.\n" -"(ì„ íƒëª¨ë“œì—ì„œ 알트+ìš°í´ë¦ê³¼ 같습니다.)" +"í´ë¦í•œ ìœ„ì¹˜ì— ìžˆëŠ” ëª¨ë“ ì˜¤ë¸Œì íŠ¸ë“¤ì˜ ëª©ë¡ì„ ë³´ì—¬ì¤ë‹ˆë‹¤\n" +"(ì„ íƒëª¨ë“œì—ì„œ Alt+ìš°í´ë¦ê³¼ 같습니다)." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Click to change object's rotation pivot." @@ -4915,7 +4907,7 @@ msgstr "GI 프로브 굽기" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "기울기 편집ë¨" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5173,6 +5165,10 @@ msgid "Generating Visibility Rect" msgstr "가시성 ì§ì‚¬ê°í˜• 만들기" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "가시성 ì§ì‚¬ê°í˜•ì„ 만들기" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "ì˜¤ì§ ParticlesMaterial 프로세스 메테리얼 ì•ˆì˜ í¬ì¸íŠ¸ë§Œ ì„¤ì • 가능" @@ -5185,10 +5181,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "ì´ë¯¸ì§€ì— 투명ë„ê°€ 128보다 í° í”½ì…€ì´ ì—†ìŠµë‹ˆë‹¤..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "가시성 ì§ì‚¬ê°í˜•ì„ 만들기" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "ì—미션 ë§ˆìŠ¤í¬ ë¶ˆëŸ¬ì˜¤ê¸°" @@ -5276,13 +5268,13 @@ msgid "Generating AABB" msgstr "AABB ìƒì„± 중" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "AABB 만들기" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "가시성 AABB 만들기" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "AABB 만들기" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "커브ì—ì„œ í¬ì¸íŠ¸ ì‚ì œ" @@ -6063,14 +6055,12 @@ msgstr "" "ì´ ìŠ¤ì¼ˆë ˆí†¤ì€ ë³¸ì„ ê°€ì§€ê³ ìžˆì§€ 않습니다, ìžì‹ìœ¼ë¡œ Bone2D 노드를 추가하세요." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "(본으로부터) íœ´ì‹ í¬ì¦ˆ 만들기" +msgstr "본으로부터 íœ´ì‹ í¬ì¦ˆ 만들기" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "(본으로부터) íœ´ì‹ í¬ì¦ˆ 만들기" +msgstr "ë³¸ì— íœ´ì‹ í¬ì¦ˆ ì„¤ì •" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6225,9 +6215,8 @@ msgid "Rear" msgstr "ë’·ë©´" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" -msgstr "ë·°ì— ì •ë ¬" +msgstr "뷰와 ì •ë ¬" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." @@ -6322,6 +6311,8 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"ì°¸ê³ : FPS ê°’ì€ ì—ë””í„°ì˜ í”„ë ˆìž„ ì†ë„입니다.\n" +"게임 ë‚´ ì„±ëŠ¥ì„ ë³´ì¦í•˜ëŠ” 표시로 ë³¼ 수 없습니다." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6332,9 +6323,8 @@ msgid "XForm Dialog" msgstr "XForm 대화 ìƒìž" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "ë°”ë‹¥ì— ìŠ¤ëƒ…" +msgstr "노드를 ë°”ë‹¥ì— ìŠ¤ëƒ…" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -6929,6 +6919,22 @@ msgid "Merge from Scene" msgstr "씬으로부터 병합하기" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "ë‹¤ìŒ ì¢Œí‘œ" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "ë‹¤ìŒ ëª¨ì–‘, 하위 타ì¼, í˜¹ì€ íƒ€ì¼ì„ ì„ íƒí•˜ì„¸ìš”." + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "ì´ì „ 좌표" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "ì´ì „ 모양, 하위 타ì¼, í˜¹ì€ íƒ€ì¼ì„ ì„ íƒí•˜ì„¸ìš”." + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "비트 ë§ˆìŠ¤í¬ ë³µì‚¬í•˜ê¸°." @@ -6941,9 +6947,8 @@ msgid "Erase bitmask." msgstr "비트 ë§ˆìŠ¤í¬ ì§€ìš°ê¸°." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "새 노드 만들기." +msgstr "새 사ê°í˜• 만들기." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7084,6 +7089,14 @@ msgid "Clear Tile Bitmask" msgstr "íƒ€ì¼ ë¹„íŠ¸ ë§ˆìŠ¤í¬ ì§€ìš°ê¸°" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "오목한 í´ë¦¬ê³¤ 만들기" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "ë³¼ë¡í•œ í´ë¦¬ê³¤ 만들기" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "íƒ€ì¼ ì‚ì œ" @@ -7125,26 +7138,23 @@ msgstr "TileSet(íƒ€ì¼ ì…‹)" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "í†µì¼ ì´ë¦„ ì„¤ì •" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "'%s'ì„(를) 기본으로 ì§€ì •" +msgstr "ìž…ë ¥ 기본 í¬íŠ¸ ì„¤ì •" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "비주얼 ì…°ì´ë”" +msgstr "노드를 비주얼 ì…°ì´ë”ì— ì¶”ê°€" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" msgstr "노드 ë³µì œ" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "비주얼 ì…°ì´ë” ìž…ë ¥ 타입 변경ë¨" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" @@ -7163,14 +7173,12 @@ msgid "VisualShader" msgstr "비주얼 ì…°ì´ë”" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "í•„í„° ìš°ì„ ìˆœìœ„ 편집" +msgstr "비주얼 ì†ì„± 편집ë¨" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "ì…°ì´ë” 변경" +msgstr "비주얼 ì…°ì´ë” 모드 변경ë¨" #: editor/project_export.cpp msgid "Runnable" @@ -7189,6 +7197,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"'%s' 플랫í¼ì— 프로ì 트를 내보낼 수 없습니다.\n" +"내보내기 í…œí”Œë¦¿ì´ ì—†ê±°ë‚˜ 올바르지 않습니다." #: editor/project_export.cpp msgid "" @@ -7196,6 +7206,8 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"'%s' 플랫í¼ì— 프로ì 트를 내보낼 수 없습니다.\n" +"내보내기 프리셋ì´ë‚˜ 내보내기 ì„¤ì •ì˜ êµ¬ì„± ë¬¸ì œê°€ ì›ì¸ìœ¼ë¡œ 보입니다." #: editor/project_export.cpp msgid "Release" @@ -7206,6 +7218,10 @@ msgid "Exporting All" msgstr "ëª¨ë‘ ë‚´ë³´ë‚´ê¸°" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "주어진 내보내기 경로가 존재하지 않습니다:" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "ì´ í”Œëž«í¼ì— 대한 내보내기 í…œí”Œë¦¿ì´ ì—†ê±°ë‚˜ ì†ìƒë¨:" @@ -8233,9 +8249,8 @@ msgid "Instantiated scenes can't become root" msgstr "ì¸ìŠ¤í„´íŠ¸í™”ëœ ì”¬ì€ ë£¨íŠ¸ê°€ ë 수 없습니다" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "씬 루트 만들기" +msgstr "노드를 루트로 만들기" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8274,9 +8289,8 @@ msgid "Make Local" msgstr "로컬로 만들기" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "씬 루트 만들기" +msgstr "새 씬 루트" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8705,19 +8719,16 @@ msgid "Set From Tree" msgstr "트리로부터 ì„¤ì •" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "완화 out" +msgstr "단축키 지우기" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "단축키" +msgstr "단축키 ë³µì›" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "앵커 변경" +msgstr "단축키 변경" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -8926,9 +8937,8 @@ msgid "GridMap Duplicate Selection" msgstr "그리드맵 ì„ íƒ ë³µì œ" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paint" -msgstr "그리드맵 ì„¤ì •" +msgstr "그리드맵 ì¹ í•˜ê¸°" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Grid Map" @@ -9316,9 +9326,8 @@ msgid "Change Input Value" msgstr "ìž…ë ¥ ê°’ 변경" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "CanvasItem í¬ê¸° ì¡°ì ˆ" +msgstr "ì£¼ì„ í¬ê¸° ì¡°ì ˆ" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -9895,6 +9904,12 @@ msgstr "" "CollisionShapeê°€ ê¸°ëŠ¥ì„ í•˜ê¸° 위해서는 ëª¨ì–‘ì´ ì œê³µë˜ì–´ì•¼ 합니다. 모양 리소스" "를 만드세요!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "í‰ë©´ ëª¨ì–‘ì€ ìž˜ ìž‘ë™í•˜ì§€ 않으며 ì´í›„ ë²„ì „ì—ì„œ ì œê±°ë ì˜ˆì •ìž…ë‹ˆë‹¤. 사용하지 ë§ì•„주세요." + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "ì§€ì •ëœ ë©”ì‹œê°€ 없으므로 메시를 ë³¼ 수 없습니다." @@ -9911,6 +9926,14 @@ msgstr "" msgid "Plotting Meshes" msgstr "메시 구분중" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" +"GIProbe는 GLES2 비디오 ë“œë¼ì´ë²„ì—ì„œ 지ì›í•˜ì§€ 않습니다.\n" +"BakedLightmapì„ ì‚¬ìš©í•˜ì„¸ìš”." + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10080,6 +10103,16 @@ msgstr "16 진수나 코드 값으로 ì „í™˜í•©ë‹ˆë‹¤." msgid "Add current color as a preset." msgstr "현재 색ìƒì„ 프리셋으로 추가합니다." +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" +"컨테ì´ë„ˆ ìžì²´ëŠ” ìžì‹ 배치 í–‰ë™ì„ 구성하지 않는 í•œ ìš©ë„ê°€ 없습니다.\n" +"스í¬ë¦½íŠ¸ë¥¼ 추가하지 않는 경우, 순수한 'Control' 노드를 사용해주세요." + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "ê²½ê³ !" @@ -10088,6 +10121,10 @@ msgstr "ê²½ê³ !" msgid "Please Confirm..." msgstr "확ì¸í•´ì£¼ì„¸ìš”..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "부모 í´ë”ë¡œ ì´ë™í•©ë‹ˆë‹¤." + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10171,6 +10208,9 @@ msgstr "ê· ì¼í•˜ê²Œ 배치함." msgid "Varyings can only be assigned in vertex function." msgstr "Varyings는 ì˜¤ì§ ë²„í…스 함수ì—서만 ì§€ì •í• ìˆ˜ 있습니다." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "ì„ íƒëœ ì”¬ì„ ì„ íƒëœ ë…¸ë“œì˜ ìžì‹ìœ¼ë¡œ ì¸ìŠ¤í„´ìŠ¤ 합니다." + #~ msgid "FPS" #~ msgstr "초당 í”„ë ˆìž„" @@ -11651,9 +11691,6 @@ msgstr "Varyings는 ì˜¤ì§ ë²„í…스 함수ì—서만 ì§€ì •í• ìˆ˜ 있습니다. #~ msgid "Cannot go into subdir:" #~ msgstr "하위 ë””ë ‰í† ë¦¬ë¡œ ì´ë™í• 수 없습니다:" -#~ msgid "Imported Resources" -#~ msgstr "ê°€ì ¸ì˜¨ 리소스" - #~ msgid "Insert Keys (Ins)" #~ msgstr "키 삽입 (Ins 키)" diff --git a/editor/translations/lt.po b/editor/translations/lt.po index cf5799620e..2a3162abce 100644 --- a/editor/translations/lt.po +++ b/editor/translations/lt.po @@ -1366,8 +1366,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1417,7 +1431,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1492,10 +1506,32 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Pasirinkite Nodus, kuriuos norite importuoti" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Pasirinkite Nodus, kuriuos norite importuoti" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1719,8 +1755,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1729,6 +1765,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2975,14 +3021,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3124,10 +3162,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5095,19 +5129,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5198,11 +5232,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6864,6 +6898,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7014,6 +7064,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Keisti Poligono SkalÄ™" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Keisti Poligono SkalÄ™" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Panaikinti" @@ -7136,6 +7196,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9715,6 +9779,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9729,6 +9799,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9879,6 +9955,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Ä®spÄ—jimas!" @@ -9887,6 +9971,10 @@ msgstr "Ä®spÄ—jimas!" msgid "Please Confirm..." msgstr "PraÅ¡ome Patvirtinti..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/lv.po b/editor/translations/lv.po index 8cf29d32cb..4b11ba6dcc 100644 --- a/editor/translations/lv.po +++ b/editor/translations/lv.po @@ -1372,8 +1372,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1423,7 +1437,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1498,10 +1512,32 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "IzvÄ“lÄ“ties Å¡o Mapi" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "IzvÄ“lÄ“ties Å¡o Mapi" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1724,8 +1760,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1734,6 +1770,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2973,14 +3019,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3119,10 +3157,6 @@ msgid "Search files" msgstr "MeklÄ“t:" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5077,19 +5111,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5180,11 +5214,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6844,6 +6878,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6994,6 +7044,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Izveidot" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Noņemt" @@ -7115,6 +7174,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9679,6 +9742,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9693,6 +9762,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9840,6 +9915,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Pievienot paÅ¡reizÄ“jo krÄsu kÄ iepriekÅ¡noteiktu krÄsu" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "BrÄ«dinÄjums!" @@ -9848,6 +9931,10 @@ msgstr "BrÄ«dinÄjums!" msgid "Please Confirm..." msgstr "LÅ«dzu Apstipriniet..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/ml.po b/editor/translations/ml.po index 1521d0a841..b26dceb41c 100644 --- a/editor/translations/ml.po +++ b/editor/translations/ml.po @@ -1335,8 +1335,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1384,7 +1398,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1459,10 +1473,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1678,8 +1712,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1688,6 +1722,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2922,14 +2966,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3065,10 +3101,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -4997,19 +5029,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5100,11 +5132,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6737,6 +6769,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6875,6 +6923,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -6992,6 +7048,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9543,6 +9603,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9557,6 +9623,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9700,6 +9772,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9708,6 +9788,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/ms.po b/editor/translations/ms.po index 70640a39da..36b3746a3d 100644 --- a/editor/translations/ms.po +++ b/editor/translations/ms.po @@ -1349,8 +1349,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1398,7 +1412,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1473,10 +1487,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1692,8 +1726,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1702,6 +1736,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2936,14 +2980,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3079,10 +3115,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5019,19 +5051,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5122,11 +5154,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6763,6 +6795,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6903,6 +6951,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -7021,6 +7077,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9576,6 +9636,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9590,6 +9656,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9733,6 +9805,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9741,6 +9821,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/nb.po b/editor/translations/nb.po index d5ed37e58c..b9fa882811 100644 --- a/editor/translations/nb.po +++ b/editor/translations/nb.po @@ -1434,8 +1434,22 @@ msgstr "Pakking" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1488,7 +1502,7 @@ msgstr "Vis I Filutforsker" msgid "New Folder..." msgstr "Ny Mappe..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Oppdater" @@ -1563,10 +1577,35 @@ msgstr "Flytt Favoritt Oppover" msgid "Move Favorite Down" msgstr "Flytt Favoritt Nedover" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Forrige fane" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Lag mappe" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "GÃ¥ til overnevnt mappe" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Kunne ikke opprette mappe." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Vis elementer som et rutenett av miniatyrbilder" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Vis elementer som liste" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Mapper og Filer:" @@ -1808,9 +1847,9 @@ msgstr "Nullstill resultat" msgid "Project export failed with error code %d." msgstr "Eksport av prosjektet mislyktes med feilkode %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Feil ved lagring av ressurs!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1818,6 +1857,16 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Feil ved lagring av ressurs!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Lagre Ressurs Som..." @@ -3170,16 +3219,6 @@ msgstr "Kan ikke navigere til '%s' for den ble ikke funnet pÃ¥ filsystemet!" #: editor/filesystem_dock.cpp #, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Vis elementer som et rutenett av miniatyrbilder" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Vis elementer som liste" - -#: editor/filesystem_dock.cpp -#, fuzzy msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "\n" @@ -3335,11 +3374,6 @@ msgid "Search files" msgstr "Søk i klasser" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Instanser den valgte scene(r) som barn av den valgte noden." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5404,6 +5438,10 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" @@ -5416,10 +5454,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Ingen piksler med gjennomsiktighet > 128 i bilde..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "" @@ -5508,11 +5542,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7240,6 +7274,24 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Neste skript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Forrige skript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7396,6 +7448,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Flytt Polygon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Flytt Polygon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Fjern Mal" @@ -7527,6 +7589,10 @@ msgid "Exporting All" msgstr "Eksporter" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10184,6 +10250,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10198,6 +10270,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10346,6 +10424,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -10354,6 +10440,11 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "GÃ¥ til overnevnt mappe" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10428,6 +10519,10 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#, fuzzy +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Instanser den valgte scene(r) som barn av den valgte noden." + #~ msgid "Warnings:" #~ msgstr "Advarsler:" diff --git a/editor/translations/nl.po b/editor/translations/nl.po index 541763f376..b5ac4c3fd5 100644 --- a/editor/translations/nl.po +++ b/editor/translations/nl.po @@ -29,12 +29,13 @@ # Peter Goelst <muis24@gmail.com>, 2019. # Wouter Buckens <wou.buc@gmail.com>, 2019. # Stijn Hinlopen <f.a.hinlopen@gmail.com>, 2019. +# jef dered <themen098s@vivaldi.net>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-01-26 21:22+0000\n" -"Last-Translator: Stijn Hinlopen <f.a.hinlopen@gmail.com>\n" +"PO-Revision-Date: 2019-03-08 15:03+0000\n" +"Last-Translator: jef dered <themen098s@vivaldi.net>\n" "Language-Team: Dutch <https://hosted.weblate.org/projects/godot-engine/godot/" "nl/>\n" "Language: nl\n" @@ -42,11 +43,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp -#, fuzzy msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "Ongeldig argumenttype aan convert(), gebruik TYPE_* constanten." @@ -111,14 +111,12 @@ msgid "Delete Selected Key(s)" msgstr "Geselecteerde Key(s) Verwijderen" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Punt toevoegen" +msgstr "Bézierpunt toevoegen" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Beweeg Punt" +msgstr "Beweeg Bézierpunten" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -149,9 +147,8 @@ msgid "Anim Change Call" msgstr "Anim Wijzig Aanroep" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Verander Animatie Lus" +msgstr "Verander Animatielengte" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -240,7 +237,7 @@ msgstr "Tijd (s): " #: editor/animation_track_editor.cpp #, fuzzy msgid "Toggle Track Enabled" -msgstr "Inschakelen Doppler" +msgstr "Verander de ingeschakelde track" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -293,19 +290,16 @@ msgid "Delete Key(s)" msgstr "Verwijder Key(s)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Verander Animatie Naam:" +msgstr "Verander animatie update modus" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Interpolatiemodus" +msgstr "Verander Animatie Interpolatiemodus" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Verander Animatie Lus" +msgstr "Verander Animatie lus Modus" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -349,14 +343,13 @@ msgid "Anim Insert Key" msgstr "Anim Key Invoegen" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Verander Animatie FPS" +msgstr "Verander Animatiestappen" #: editor/animation_track_editor.cpp #, fuzzy msgid "Rearrange Tracks" -msgstr "Herschik Autoloads" +msgstr "Herschik Tracks" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -389,9 +382,8 @@ msgid "Not possible to add a new track without a root" msgstr "Niet mogelijk om een nieuwe track toe te voegen zonder een root" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Track Toevoegen" +msgstr "Voeg Bézierbaan Toe" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -1414,8 +1406,22 @@ msgstr "Inpakken" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1466,7 +1472,7 @@ msgstr "Weergeven in Bestandsbeheer" msgid "New Folder..." msgstr "Nieuwe Map..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Verversen" @@ -1541,10 +1547,34 @@ msgstr "Verplaats Favoriet Naar Boven" msgid "Move Favorite Down" msgstr "Verplaats Favoriet Naar Beneden" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Vorig tabblad" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Map Maken" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Ga naar bovenliggende folder" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Map kon niet gemaakt worden." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Toon items in een miniatuurraster." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Bekijk objecten als een lijst" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Mappen & Bestanden:" @@ -1773,9 +1803,9 @@ msgstr "Maak Uitvoer Leeg" msgid "Project export failed with error code %d." msgstr "Project exporteren faalt door foutcode %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Error bij het opslaan van resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1783,6 +1813,16 @@ msgid "OK" msgstr "Oké" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Error bij het opslaan van resource!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Resource Opslaan Als..." @@ -3105,15 +3145,6 @@ msgstr "" "is!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Toon items in een miniatuurraster." - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Bekijk objecten als een lijst" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Status: Importeren van bestand mislukt. Repareer het bestand en importeer " @@ -3251,12 +3282,6 @@ msgid "Search files" msgstr "Zoek bestanden" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" -"Maak een nieuwe kopie van de geselecteerde scene(s) als kind van de " -"geselecteerde knoop." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5277,6 +5302,10 @@ msgid "Generating Visibility Rect" msgstr "Genereer Zichtbaarheid Rechthoek" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Genereer Zichtbaarheid Rechthoek" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "Kan punt alleen plaatsen in een PartikelsMateriaal proces materiaal" @@ -5289,10 +5318,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Geen pixels met transparantie > 128 in afbeelding..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Genereer Zichtbaarheid Rechthoek" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Laad Emissie Masker" @@ -5381,13 +5406,13 @@ msgid "Generating AABB" msgstr "AABB Genereren" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Genereer AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Genereer Zichtbaarheid AABB" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Genereer AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Verwijder Punt van Curve" @@ -7104,6 +7129,24 @@ msgid "Merge from Scene" msgstr "Vervoeg vanuit Scene" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Volgend script" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Vorig tabblad" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Bitmasker kopiëren." @@ -7263,6 +7306,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Beweeg Polygon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Beweeg Polygon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Verwijder Sjabloon" @@ -7399,6 +7452,11 @@ msgid "Exporting All" msgstr "Aan het exporteren voor %s" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "Dit pad bestaat niet." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10123,6 +10181,12 @@ msgstr "" "Een vorm moet gegeven worden om CollisionShape te laten werken. Maak " "alsjeblieft een vorm resource voor deze!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10137,6 +10201,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10297,6 +10367,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Huidige kleur als een preset toevoegen" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Alarm!" @@ -10305,6 +10383,11 @@ msgstr "Alarm!" msgid "Please Confirm..." msgstr "Bevestig Alsjeblieft..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Ga naar bovenliggende folder" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10387,6 +10470,11 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Maak een nieuwe kopie van de geselecteerde scene(s) als kind van de " +#~ "geselecteerde knoop." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/pl.po b/editor/translations/pl.po index a211de63b7..b575899626 100644 --- a/editor/translations/pl.po +++ b/editor/translations/pl.po @@ -35,7 +35,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-03-01 11:59+0000\n" +"PO-Revision-Date: 2019-03-12 15:36+0000\n" "Last-Translator: Tomek <kobewi4e@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" @@ -45,7 +45,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -114,14 +114,12 @@ msgid "Delete Selected Key(s)" msgstr "UsuÅ„ klucz(e)" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Dodaj punkt" +msgstr "Dodaj punkt krzywej Beziera" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "PrzesuÅ„ punkty" +msgstr "PrzesuÅ„ punkty krzywej Beziera" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -152,9 +150,8 @@ msgid "Anim Change Call" msgstr "Animacja - wywoÅ‚anie funkcji" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "ZmieÅ„ pÄ™tle animacji" +msgstr "ZmieÅ„ dÅ‚ugość animacji" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -211,9 +208,8 @@ msgid "Anim Clips:" msgstr "Klipy animacji:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "ZmieÅ„ Wartość Tablicy" +msgstr "ZmieÅ„ adres Å›cieżki" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -240,9 +236,8 @@ msgid "Time (s): " msgstr "Czas (s): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Efekt Dopplera" +msgstr "PrzeÅ‚Ä…cz aktywność Å›cieżki" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -295,19 +290,16 @@ msgid "Delete Key(s)" msgstr "UsuÅ„ klucz(e)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "ZmieÅ„ nazwÄ™ animacji:" +msgstr "ZmieÅ„ tryb zmiany animacji" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Sposób interpolacji" +msgstr "ZmieÅ„ sposób interpolacji animacji" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "ZmieÅ„ pÄ™tle animacji" +msgstr "ZmieÅ„ sposób zapÄ™tlania animacji" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -352,14 +344,12 @@ msgid "Anim Insert Key" msgstr "Wstaw klatkÄ™ kluczowÄ…" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "ZmieÅ„ FPS animacji" +msgstr "ZmieÅ„ krok animacji" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Przestaw Autoloady" +msgstr "Przestaw Å›cieżki" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -391,9 +381,8 @@ msgid "Not possible to add a new track without a root" msgstr "Nie da siÄ™ dodać nowej Å›cieżki bez korzenia" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Dodaj Å›cieżkÄ™" +msgstr "Dodaj Å›cieżkÄ™ krzywej Beziera" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -404,23 +393,20 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "Åšcieżka nie jest typu Spatial, nie można wstawić klucza" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Åšcieżka przeksztaÅ‚cenia 3D" +msgstr "Dodaj klucz Å›cieżki transformacji" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Dodaj Å›cieżkÄ™" +msgstr "Dodaj klucz Å›cieżki" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." msgstr "Åšcieżka jest nieprawidÅ‚owa, wiÄ™c nie można wstawić klucza metody." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Åšcieżka wywoÅ‚ania metody" +msgstr "Dodaj klucz Å›cieżki metody" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -582,17 +568,16 @@ msgid "Copy" msgstr "Kopiuj" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Klipy dźwiÄ™kowe:" +msgstr "Dodaj klip Å›cieżki audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "ZmieÅ„ poczÄ…tkowe przesuniÄ™cie klipu Å›cieżki audio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "ZmieÅ„ koÅ„cowe przesuniÄ™cie klipu Å›cieżki audio" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -663,9 +648,8 @@ msgid "Warnings" msgstr "Ostrzeżenia" #: editor/code_editor.cpp -#, fuzzy msgid "Line and column numbers." -msgstr "Numery linii i kolumn" +msgstr "Numery linii i kolumn." #: editor/connections_dialog.cpp msgid "Method in target Node must be specified!" @@ -1223,9 +1207,8 @@ msgid "Add Bus" msgstr "Dodaj magistralÄ™" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add a new Audio Bus to this layout." -msgstr "Zapisz ukÅ‚ad magistrali audio jako..." +msgstr "Dodaj nowÄ… SzynÄ™ Audio do tego ukÅ‚adu." #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp @@ -1403,8 +1386,26 @@ msgstr "Pakowanie" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"Platforma docelowa wymaga dla GLES2 kompresji tekstur 'ETC'. WÅ‚Ä…cz 'Import " +"Etc' w Ustawieniach Projektu." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"Platforma docelowa wymaga dla GLES3 kompresji tekstur 'ETC2'. WÅ‚Ä…cz 'Import " +"Etc 2' w Ustawieniach Projektu." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1452,7 +1453,7 @@ msgstr "Pokaż w menedżerze plików" msgid "New Folder..." msgstr "Utwórz katalog..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "OdÅ›wież" @@ -1527,10 +1528,33 @@ msgstr "PrzesuÅ„ Ulubiony w górÄ™" msgid "Move Favorite Down" msgstr "PrzesuÅ„ Ulubiony w dół" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Poprzedni poziom" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "NastÄ™pny poziom" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Przejdź folder wyżej" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Nie można utworzyć katalogu." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "WyÅ›wietl elementy jako siatkÄ™ miniatur." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "WyÅ›wietl elementy jako listÄ™." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Katalogi i pliki:" @@ -1753,9 +1777,9 @@ msgstr "Wyczyść dane wyjÅ›ciowe" msgid "Project export failed with error code %d." msgstr "Eksport projektu nie powiódÅ‚ siÄ™, kod bÅ‚Ä™du to %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "BÅ‚Ä…d podczas zapisu zasobu!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1763,6 +1787,16 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "BÅ‚Ä…d podczas zapisu zasobu!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Zapisz zasób jako..." @@ -3077,14 +3111,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "Nie można przejść do '%s' - nie znaleziono w tym systemie plików!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "WyÅ›wietl elementy jako siatkÄ™ miniatur." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "WyÅ›wietl elementy jako listÄ™." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Status: Importowanie pliku nie powiodÅ‚o siÄ™. ProszÄ™ naprawić plik i ponownie " @@ -3222,10 +3248,6 @@ msgid "Search files" msgstr "Przeszukaj pliki" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Utwórz instancjÄ™ wybranej sceny/scen jako dziecko wybranego wÄ™zÅ‚a." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5225,6 +5247,10 @@ msgid "Generating Visibility Rect" msgstr "Generowanie prostokÄ…ta widzialnoÅ›ci" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Wygeneruj prostokÄ…t widocznoÅ›ci" + +#: editor/plugins/particles_2d_editor_plugin.cpp #, fuzzy msgid "Can only set point into a ParticlesMaterial process material" msgstr "Punkt można wstawić tylko w materiaÅ‚ obróbki ParticlesMaterial" @@ -5238,10 +5264,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Brak pikseli z przeźroczystoÅ›ciÄ… > 128 w obrazie..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Wygeneruj prostokÄ…ta widzialnoÅ›ci" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Wczytaj maskÄ™ emisji" @@ -5330,13 +5352,13 @@ msgid "Generating AABB" msgstr "Generowanie AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Generuj AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Generuj AABB widocznoÅ›ci" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Generuj AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "UsuÅ„ punkt z krzywej" @@ -6986,14 +7008,12 @@ msgid "Clear transform" msgstr "Wyczyść przeksztaÅ‚cenie" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Add Texture(s) to TileSet." -msgstr "Dodaj teksturÄ™/tekstury do TileSet." +msgstr "Dodaj teksturÄ™/y do TileSetu." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Remove selected Texture from TileSet." -msgstr "UsuÅ„ zaznaczonÄ… teksturÄ™ z TileSet." +msgstr "UsuÅ„ zaznaczonÄ… TeksturÄ™ z TileSetu." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create from Scene" @@ -7004,6 +7024,22 @@ msgid "Merge from Scene" msgstr "PoÅ‚Ä…cz ze sceny" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "NastÄ™pny koordynat" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "Wybierz nastÄ™pny ksztaÅ‚t, podkafelek lub Kafelek." + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "Poprzedni koordynat" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "Wybierz poprzedni ksztaÅ‚t, podkafelek lub Kafelek." + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Kopiuj maskÄ™ bitowÄ…." @@ -7170,6 +7206,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "PrzesuÅ„ WielokÄ…t" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "PrzesuÅ„ WielokÄ…t" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "UsuÅ„ szablon" @@ -7225,14 +7271,12 @@ msgid "Set Input Default Port" msgstr "Ustaw jako domyÅ›lne dla '%s'" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "Shader wizualny" +msgstr "Dodaj WÄ™zeÅ‚ do Wizualnego Shadera" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" -msgstr "Duplikuj wÄ™zeÅ‚(y)" +msgstr "Duplikuj wÄ™zÅ‚y" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" @@ -7255,14 +7299,12 @@ msgid "VisualShader" msgstr "Shader wizualny" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Edytuj filtry" +msgstr "Edytuj WizualnÄ… WÅ‚aÅ›ciwość" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Zmiany Shadera" +msgstr "Zmiana Trybu Wizualnego Shadera" #: editor/project_export.cpp msgid "Runnable" @@ -7298,6 +7340,10 @@ msgid "Exporting All" msgstr "Eksportowanie wszystkiego" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "Podana Å›cieżka eksportu nie istnieje:" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Brakuje szablonów eksportu dla tej platformy lub sÄ… uszkodzone:" @@ -7538,11 +7584,11 @@ msgstr "Szukaj" #: editor/project_manager.cpp msgid "Renderer:" -msgstr "" +msgstr "Renderer:" #: editor/project_manager.cpp msgid "OpenGL ES 3.0" -msgstr "" +msgstr "OpenGL ES 3.0" #: editor/project_manager.cpp msgid "" @@ -7551,10 +7597,14 @@ msgid "" "Incompatible with older hardware\n" "Not recommended for web games" msgstr "" +"Wyższa jakość wizualna\n" +"Wszystkie funkcjonalnoÅ›ci dostÄ™pne\n" +"Niekompatybilne ze starszym sprzÄ™tem\n" +"Niezalecane dla gier przeglÄ…darkowych" #: editor/project_manager.cpp msgid "OpenGL ES 2.0" -msgstr "" +msgstr "OpenGL ES 2.0" #: editor/project_manager.cpp msgid "" @@ -7563,17 +7613,22 @@ msgid "" "Works on most hardware\n" "Recommended for web games" msgstr "" +"Mniejsza jakość wizualna\n" +"Niektóre funkcjonalnoÅ›ci niedostÄ™pne\n" +"DziaÅ‚a na wiÄ™kszoÅ›ci sprzÄ™tu\n" +"Rekomendowane dla gier przeglÄ…darkowych" #: editor/project_manager.cpp msgid "Renderer can be changed later, but scenes may need to be adjusted." msgstr "" +"Renderer może zostać później zmieniony, ale sceny mogÄ… potrzebować " +"dostosowania." #: editor/project_manager.cpp msgid "Unnamed Project" msgstr "Projekt bez nazwy" #: editor/project_manager.cpp -#, fuzzy msgid "Can't open project at '%s'." msgstr "Nie można otworzyć projektu w '%s'." @@ -9996,6 +10051,12 @@ msgstr "" "KsztaÅ‚t musi być okreÅ›lony dla CollisionShape, aby speÅ‚niaÅ‚ swoje zadanie. " "Utwórz zasób typu CollisionShape w odpowiednim polu obiektu!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp #, fuzzy msgid "Nothing is visible because no mesh has been assigned." @@ -10013,6 +10074,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10183,6 +10250,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Dodaj bieżący kolor jako domyÅ›lne" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Alarm!" @@ -10191,6 +10266,11 @@ msgstr "Alarm!" msgid "Please Confirm..." msgstr "ProszÄ™ potwierdzić..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Przejdź folder wyżej" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10276,6 +10356,9 @@ msgstr "Przypisanie do uniformu." msgid "Varyings can only be assigned in vertex function." msgstr "Varying może być przypisane tylko w funkcji wierzchoÅ‚ków." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Utwórz instancjÄ™ wybranej sceny/scen jako dziecko wybranego wÄ™zÅ‚a." + #~ msgid "FPS" #~ msgstr "Klatki na sekundÄ™" diff --git a/editor/translations/pr.po b/editor/translations/pr.po index a48c2fac95..253d11a41f 100644 --- a/editor/translations/pr.po +++ b/editor/translations/pr.po @@ -1370,8 +1370,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1423,7 +1437,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1498,10 +1512,32 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Slit th' Node" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Slit th' Node" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1725,8 +1761,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1735,6 +1771,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2987,14 +3033,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3136,10 +3174,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5112,19 +5146,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5215,11 +5249,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6893,6 +6927,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7048,6 +7098,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Discharge ye' Variable" @@ -7175,6 +7233,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9792,6 +9854,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9806,6 +9874,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9950,6 +10024,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9958,6 +10040,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index 9e9ead344e..224b378e8c 100644 --- a/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po @@ -53,12 +53,13 @@ # Thiago Amendola <amendolathiago@gmail.com>, 2019. # Raphael Nogueira Campos <raphaelncampos@gmail.com>, 2019. # Dimenicius <vinicius.costa.92@gmail.com>, 2019. +# Davi <wokep.ma.wavid@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: 2016-05-30\n" -"PO-Revision-Date: 2019-02-21 21:18+0000\n" -"Last-Translator: Julio Yagami <juliohenrique31501234@hotmail.com>\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" +"Last-Translator: Davi <wokep.ma.wavid@gmail.com>\n" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_BR/>\n" "Language: pt_BR\n" @@ -66,7 +67,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -133,14 +134,12 @@ msgid "Delete Selected Key(s)" msgstr "Excluir Chave(s) Selecionada(s)" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Adicionar ponto" +msgstr "Adicionar um Ponto Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Mover pontos" +msgstr "Mover pontos Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -314,19 +313,16 @@ msgid "Delete Key(s)" msgstr "Deletar Chave(s)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Alterar Nome da Animação:" +msgstr "Alterar Modo de Atualização da Animação:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Modo de Interpolação" +msgstr "Alterar Modo de Interpolação da Animação" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Alterar Repetição da Animação" +msgstr "Alterar Modo Repetição da Animação" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -1424,8 +1420,24 @@ msgstr "Empacotando" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"A plataforma alvo requer compressão de texturas 'ETC' para GLES2. Habilite " +"'Import Etc' nas Configurações de Projeto." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1473,7 +1485,7 @@ msgstr "Mostrar no Gerenciador de Arquivos" msgid "New Folder..." msgstr "Nova Pasta..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Atualizar" @@ -1548,10 +1560,33 @@ msgstr "Mover Favorito Acima" msgid "Move Favorite Down" msgstr "Mover Favorito Abaixo" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Chão Anterior" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Próximo Chão" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Ir para pasta pai" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Não foi possÃvel criar a pasta." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Visualizar itens como uma grade de miniaturas." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Visualizar itens como uma lista." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Diretórios & Arquivos:" @@ -1774,9 +1809,10 @@ msgstr "Limpar SaÃda" msgid "Project export failed with error code %d." msgstr "Falha na exportação do projeto com código de erro %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Erro ao salvar Recurso!" +#: editor/editor_node.cpp +#, fuzzy +msgid "Imported resources can't be saved." +msgstr "Recursos Importados" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1784,6 +1820,18 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Erro ao salvar Recurso!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" +"O recurso não pode ser salvo porque não pertence à cena editada. Faça-o " +"único primeiro." + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Salvar Recurso como..." @@ -2004,14 +2052,12 @@ msgid "Save changes to '%s' before closing?" msgstr "Salvar alterações em '%s' antes de fechar?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Falha ao carregar recurso." +msgstr "Foram salvos %s recurso(s) modificado(s)." #: editor/editor_node.cpp -#, fuzzy msgid "A root node is required to save the scene." -msgstr "Apenas um arquivo é requerido para textura grande." +msgstr "Um nó raiz é requerido para salvar a cena." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -3104,14 +3150,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "ImpossÃvel navegar até '%s' pois não existe no sistema de arquivos!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Visualizar itens como uma grade de miniaturas." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Visualizar itens como uma lista." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Estado: Falha na importação do arquivo. Por favor, conserte o arquivo e " @@ -3249,10 +3287,6 @@ msgid "Search files" msgstr "Pesquisar arquivos" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Instanciar a(s) cena(s) selecionada como filho do nó selecionado." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3659,9 +3693,8 @@ msgid "Move Node Point" msgstr "Mover pontos" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Alterar Tempo de Mistura" +msgstr "Alterar limites do BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #, fuzzy @@ -3795,9 +3828,8 @@ msgid "Blend:" msgstr "Misturar:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Alterações de Material" +msgstr "Parâmetro Modificado" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3815,9 +3847,8 @@ msgstr "Adicionar Nó(s) a Partir da Ãrvore" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Modo Mover" +msgstr "Nó Movido" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3827,15 +3858,13 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Conectado" +msgstr "Nós Conectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Desconectado" +msgstr "Nós Desconectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #, fuzzy @@ -3844,9 +3873,8 @@ msgstr "Nova animação" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Excluir Nó(s)" +msgstr "Excluir Nó" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #, fuzzy @@ -4162,13 +4190,12 @@ msgid "Node Removed" msgstr "Removido:" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Nó Transition" +msgstr "Transição Removida" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Configurar Nó de InÃcio (Autoplay)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4993,7 +5020,7 @@ msgstr "Cozinhar Sonda GI" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Gradiente Editado" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5253,6 +5280,10 @@ msgid "Generating Visibility Rect" msgstr "Gerar Retângulo de Visibilidade" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Gerar Retângulo de Visibilidade" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Só é permitido colocar um ponto em um material processador ParticlesMaterial" @@ -5266,10 +5297,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Nenhum pixel com transparência > 128 na imagem." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Gerar Retângulo de Visibilidade" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Carregar Máscara de Emissão" @@ -5357,13 +5384,13 @@ msgid "Generating AABB" msgstr "Gerando AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Gerar AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Gerar AABB de Visibilidade" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Gerar AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Remover Ponto da Curva" @@ -6404,6 +6431,8 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"Nota: O valor de FPS mostrado é da taxa de quadros do editor\n" +"Ele não deve ser usado como indicação confiável de desempenho do jogo." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -7012,6 +7041,23 @@ msgid "Merge from Scene" msgstr "Fundir a partir de Cena" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Próximo Chão" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "Coordenada Anterior" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Copie o bitmask." @@ -7024,9 +7070,8 @@ msgid "Erase bitmask." msgstr "Apagar o bitmask." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Criar novos nós." +msgstr "Criar um novo retângulo." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7165,6 +7210,14 @@ msgid "Clear Tile Bitmask" msgstr "Limpar o Bitmask da telha" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "Tornar o PolÃgono Côncavo" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "Tornar o PolÃgono Convexo" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Remover Telha" @@ -7272,11 +7325,15 @@ msgid "" msgstr "" #: editor/project_export.cpp +#, fuzzy msgid "" "Failed to export the project for platform '%s'.\n" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"Falha ao exportar o projeto para a plataforma '%s'.\n" +"Isto pode ser devido a um problema de configuração nas pré-configurações de " +"exportação ou nas configurações de exportação." #: editor/project_export.cpp msgid "Release" @@ -7287,6 +7344,10 @@ msgid "Exporting All" msgstr "Exportando tudo" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "O caminho de exportação informado não existe." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "Modelos de exportação para esta plataforma não foram encontrados/estão " @@ -8327,9 +8388,8 @@ msgid "Instantiated scenes can't become root" msgstr "Cenas instanciadas não podem se tornar raiz" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "Fazer Raiz de Cena" +msgstr "Tornar Raiz o Nó" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8368,9 +8428,8 @@ msgid "Make Local" msgstr "Tornar Local" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Fazer Raiz de Cena" +msgstr "Nova Raiz de Cena" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8801,19 +8860,16 @@ msgid "Set From Tree" msgstr "Definir a partir da árvore" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Suavizar final" +msgstr "Apagar Atalho" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Atalhos" +msgstr "Restaurar Atalho" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Alterar Âncoras" +msgstr "Modificar Atalho" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -9410,9 +9466,8 @@ msgid "Change Input Value" msgstr "Alterar Valor da Entrada" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "Redimensionar o CanvasItem" +msgstr "Redimensionar Comentário" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -10009,6 +10064,14 @@ msgstr "" "Uma forma deve ser fornecida para que o nó CollisionShape funcione. Por " "favor, crie um recurso de forma a ele!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" +"Formas planas não funcionam bem e serão removidas em versões futuras. Por " +"favor não as use." + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Nada é visÃvel porque nenhuma malha foi atribuÃda." @@ -10025,6 +10088,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "Planejando Malhas" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10197,6 +10266,14 @@ msgstr "Alterne entre valores haxadecimais e de código." msgid "Add current color as a preset." msgstr "Adicionar cor atual como uma predefinição." +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Alerta!" @@ -10205,6 +10282,10 @@ msgstr "Alerta!" msgid "Please Confirm..." msgstr "Confirme Por Favor..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "Ir para diretório pai" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10289,6 +10370,9 @@ msgstr "Atribuição à uniforme." msgid "Varyings can only be assigned in vertex function." msgstr "Variáveis só podem ser atribuÃdas na função de vértice." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Instanciar a(s) cena(s) selecionada como filho do nó selecionado." + #~ msgid "FPS" #~ msgstr "FPS" @@ -11809,9 +11893,6 @@ msgstr "Variáveis só podem ser atribuÃdas na função de vértice." #~ msgid "Cannot go into subdir:" #~ msgstr "Não é possÃvel ir ao subdiretório:" -#~ msgid "Imported Resources" -#~ msgstr "Recursos Importados" - #~ msgid "Insert Keys (Ins)" #~ msgstr "Inserir Chaves (Ins)" diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po index 4a80776647..f69bf41c42 100644 --- a/editor/translations/pt_PT.po +++ b/editor/translations/pt_PT.po @@ -18,7 +18,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-01 12:09+0000\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" "Last-Translator: João Lopes <linux-man@hotmail.com>\n" "Language-Team: Portuguese (Portugal) <https://hosted.weblate.org/projects/" "godot-engine/godot/pt_PT/>\n" @@ -27,7 +27,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -95,14 +95,12 @@ msgid "Delete Selected Key(s)" msgstr "Apagar Chave(s) Selecionada(s)" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Adicionar Ponto" +msgstr "Adicionar Ponto Bezier" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "Mover Ponto" +msgstr "Mover Ponto Bezier" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -133,9 +131,8 @@ msgid "Anim Change Call" msgstr "Anim Mudar Chamada" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Mudar Ciclo da Animação" +msgstr "Mudar Duração da Animação" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -192,9 +189,8 @@ msgid "Anim Clips:" msgstr "Clips Anim:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Mudar valor do Array" +msgstr "Mudar Caminho da Pista" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -221,9 +217,8 @@ msgid "Time (s): " msgstr "Tempo (s): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Doppler Ativo" +msgstr "Alternar Pista Ativada" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -276,19 +271,16 @@ msgid "Delete Key(s)" msgstr "Apagar Chave(s)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Mudar o Nome da Animação:" +msgstr "Mudar o Modo de Atualização da Animação" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Modo de Interpolação" +msgstr "Mudar o Modo de Interpolação da Animação" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Mudar Ciclo da Animação" +msgstr "Mudar Modo do Loop da Animação" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -334,14 +326,12 @@ msgid "Anim Insert Key" msgstr "Anim Inserir Chave" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Mudar FPS da Animação" +msgstr "Mudar Passo da Animação" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Reorganizar Carregamentos Automáticos" +msgstr "Reorganizar Pistas" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -374,9 +364,8 @@ msgid "Not possible to add a new track without a root" msgstr "Não é possÃvel adicionar nova pista sem uma raÃz" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Adicionar Pista" +msgstr "Adicionar Pista Bezier" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -387,14 +376,12 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "Pista não do tipo Spatial, não se consegue inserir chave" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Pista de Transformação 3D" +msgstr "Adicionar Chave da Pista de Transformação" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Adicionar Pista" +msgstr "Adicionar Chave da Pista" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." @@ -402,9 +389,8 @@ msgstr "" "Caminho da pista é inválido, não se consegue adicionar uma chave método." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Chamar Pista Método" +msgstr "Adicionar Chave da Pista Método" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -566,17 +552,16 @@ msgid "Copy" msgstr "Copiar" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Clips Ãudio:" +msgstr "Adicionar Clip da Pista Ãudio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Alterar Compensação do InÃcio do Clip da Pista Ãudio" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Alterar Compensação do Fim do Clip da Pista Ãudio" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -648,7 +633,7 @@ msgstr "Avisos" #: editor/code_editor.cpp msgid "Line and column numbers." -msgstr "" +msgstr "Números de Linha e Coluna." #: editor/connections_dialog.cpp msgid "Method in target Node must be specified!" @@ -1207,9 +1192,8 @@ msgid "Add Bus" msgstr "Adicionar Barramento" #: editor/editor_audio_buses.cpp -#, fuzzy msgid "Add a new Audio Bus to this layout." -msgstr "Guardar Modelo do barramento de áudio como..." +msgstr "Adicionar novo Barramento de Ãudio a este modelo." #: editor/editor_audio_buses.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp @@ -1392,9 +1376,31 @@ msgstr "Empacotamento" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" +"Plataforma Alvo exige compressão de textura 'ETC' para GLES2. Ative " +"'Importar Etc' nas Configurações do Projeto." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"Plataforma Alvo exige compressão de textura 'ETC2' para GLES3. Ative " +"'Importar Etc 2' nas Configurações do Projeto." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" +"Plataforma Alvo exige compressão de textura 'ETC' para o driver de recurso " +"em GLES2.\n" +"Ative 'Importar Etc' nas Configurações do Projeto, ou desative 'Driver de " +"Recurso ativo'." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1441,7 +1447,7 @@ msgstr "Mostrar no Gestor de Ficheiros" msgid "New Folder..." msgstr "Nova Diretoria..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Atualizar" @@ -1516,10 +1522,30 @@ msgstr "Mover Favorito para Cima" msgid "Move Favorite Down" msgstr "Mover Favorito para Baixo" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "Pasta Anterior" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "Próxima Pasta" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Ir para a pasta acima" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "(Não) tornar favorita atual pasta." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "Visualizar itens como grelha de miniaturas." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "Visualizar itens como lista." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Diretorias e Ficheiros:" @@ -1742,9 +1768,9 @@ msgstr "Limpar SaÃda" msgid "Project export failed with error code %d." msgstr "Exportação do projeto falhou com código de erro %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Erro ao guardar recurso!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1752,6 +1778,16 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Erro ao guardar recurso!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Guardar Recurso Como..." @@ -1975,13 +2011,12 @@ msgid "Save changes to '%s' before closing?" msgstr "Guardar alterações a '%s' antes de fechar?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Falha ao carregar recurso." +msgstr "Guardado(s) %s recurso(s) modificado(s)." #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "" +msgstr "É necessário um Nó Raiz para guardar a cena." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -2503,9 +2538,8 @@ msgid "Save & Restart" msgstr "Guardar & Reiniciar" #: editor/editor_node.cpp -#, fuzzy msgid "Spins when the editor window redraws." -msgstr "Roda quando a janela do Editor atualiza!" +msgstr "Roda quando a janela do editor atualiza." #: editor/editor_node.cpp msgid "Update Always" @@ -3068,14 +3102,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "'%s' não foi encontrado no Sistema de Ficheiros!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "Visualizar itens como grelha de miniaturas." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "Visualizar itens como lista." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Estado: A importação do Ficheiro falhou. Corrija o Ficheiro e importe " @@ -3213,10 +3239,6 @@ msgid "Search files" msgstr "Procurar ficheiros" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Instancie a(s) Cena(s) selecionada(s) como filha(s) do Nó selecionado." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3617,19 +3639,16 @@ msgstr "Carregar..." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "Mover Ponto" +msgstr "Mover Ponto Nó" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Mudar tempo de Mistura" +msgstr "Mudar Limites do BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Mudar tempo de Mistura" +msgstr "Mudar Legendas do BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3639,24 +3658,21 @@ msgstr "Este tipo de nó não pode ser usado. Apenas nós raiz são permitidos." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Adicionar Nó" +msgstr "Adicionar Ponto Nó" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Adicionar Animação" +msgstr "Adicionar Ponto Animação" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Remover Ponto de Caminho" +msgstr "Remover Ponto de BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "Mover Ponto Nó em BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3702,29 +3718,24 @@ msgid "Triangle already exists" msgstr "Já existe triângulo" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Adicionar Variável" +msgstr "Adicionar Triângulo" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Mudar tempo de Mistura" +msgstr "Mudar Limites do BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Mudar tempo de Mistura" +msgstr "Mudar Legendas do BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Remover Ponto de Caminho" +msgstr "Remover Ponto do BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Remover Variável" +msgstr "Remover Triângulo do BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3735,9 +3746,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "Não existem triângulos, nenhuma mistura pode ocorrer." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Alternar Globals de carregamento automático" +msgstr "Alternar Triângulos Auto" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3757,9 +3767,8 @@ msgid "Blend:" msgstr "Mistura:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Mudanças de Material" +msgstr "Mudança de Parâmetro" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3771,15 +3780,13 @@ msgid "Output node can't be added to the blend tree." msgstr "SaÃda do nó não pode ser adicionada à árvore de mistura." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Adicionar Nó da Ãrvore" +msgstr "Adicionar Nó a BlendTree" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Modo mover" +msgstr "Nó Movido" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3789,36 +3796,30 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "Ligado" +msgstr "Nós Conectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Desconectado" +msgstr "Nós Desconectados" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Animação" +msgstr "Definir Animação" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Apagar Nó(s)" +msgstr "Apagar Nó" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Alternar esta pista on/off." +msgstr "Alternar Filtro On/Off" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Filtro de localização alterado" +msgstr "Alterar Filtro" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3842,9 +3843,8 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Nome do Nó" +msgstr "Nó Renomeado" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4073,14 +4073,12 @@ msgid "Cross-Animation Blend Times" msgstr "Tempos de Mistura de Animação cruzada" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Modo mover" +msgstr "Mover Nó" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Adicionar tradução" +msgstr "Adicionar Transição" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4116,18 +4114,16 @@ msgid "No playback resource set at path: %s." msgstr "Nenhum recurso de playback definido no caminho: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Remover" +msgstr "Nó Removido" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Nó Transition" +msgstr "Transição Removida" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Definir Nó de InÃcio (Reprodução Automática)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4551,16 +4547,15 @@ msgstr "Mover CanvasItem" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Presets for the anchors and margins values of a Control node." -msgstr "" +msgstr "Pré-definições para âncoras e margens de um Nó Control." #: editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "" "Children of containers have their anchors and margins values overridden by " "their parent." msgstr "" -"Atenção: as crianças de um contentor obtêm a sua posição e tamanho " -"determinados apenas pelos seus pais." +"As âncoras e margens de filhos de um contentores são sobrescritas pelo seu " +"pai." #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchors only" @@ -4867,7 +4862,7 @@ msgstr "Definir Manipulador" #: editor/plugins/cpu_particles_editor_plugin.cpp msgid "CPUParticles" -msgstr "CPUPartÃculas" +msgstr "CPUParticles" #: editor/plugins/cpu_particles_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp @@ -4949,7 +4944,7 @@ msgstr "Consolidar Sonda GI" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Gradiente Editado" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5207,6 +5202,10 @@ msgid "Generating Visibility Rect" msgstr "A Gerar Visibilidade Rect" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Gerar Visibilidade do Rect" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "Só pode definir um Ponto num Material ParticlesMaterial" @@ -5219,10 +5218,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Sem pixeis com transparência > 128 na imagem..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Gerar Visibilidade do Rect" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Carregar máscara de emissão" @@ -5233,7 +5228,7 @@ msgstr "Limpar máscara de emissão" #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp msgid "Convert to CPUParticles" -msgstr "Converter em CPUPartÃculas" +msgstr "Converter em CPUParticles" #: editor/plugins/particles_2d_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp @@ -5310,13 +5305,13 @@ msgid "Generating AABB" msgstr "A gerar AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Gerar AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Gerar visibilidade AABB" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Gerar AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Remover Ponto da curva" @@ -5474,7 +5469,7 @@ msgstr "Criar mapa UV" msgid "" "Polygon 2D has internal vertices, so it can no longer be edited in the " "viewport." -msgstr "" +msgstr "Polygon 2D tem vértices internos, não podendo ser editado no viewport." #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create Polygon & UV" @@ -6096,14 +6091,12 @@ msgid "This skeleton has no bones, create some children Bone2D nodes." msgstr "Este esqueleto não tem ossos, crie alguns nós Bone2D filhos." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "Criar Pose de Descanso (a partir de Ossos)" +msgstr "Criar Pose de Descanso a partir de Ossos" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "Criar Pose de Descanso (a partir de Ossos)" +msgstr "Definir Pose de Descanso para Ossos" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6258,9 +6251,8 @@ msgid "Rear" msgstr "Trás" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" -msgstr "Alinhar com a vista" +msgstr "Alinhar com a Vista" #: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "No parent to instance a child at." @@ -6355,6 +6347,8 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"Nota: O FPS mostrado é a taxa de frames do editor.\n" +"Não é uma indicação fiável do desempenho do jogo." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6365,9 +6359,8 @@ msgid "XForm Dialog" msgstr "Diálogo XForm" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Ajustar ao Fundo" +msgstr "Ajustar Nós ao Fundo" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -6585,9 +6578,8 @@ msgid "Post" msgstr "Pós" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Nameless gizmo" -msgstr "Bugiganga sem nome" +msgstr "Bugiganga sem Nome" #: editor/plugins/sprite_editor_plugin.cpp msgid "Sprite is empty!" @@ -6658,14 +6650,12 @@ msgid "(empty)" msgstr "(vazio)" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Animations:" -msgstr "Animações" +msgstr "Animações:" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "New Animation" -msgstr "Animação" +msgstr "Nova Animação" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Speed (FPS):" @@ -6676,9 +6666,8 @@ msgid "Loop" msgstr "Ciclo" #: editor/plugins/sprite_frames_editor_plugin.cpp -#, fuzzy msgid "Animation Frames:" -msgstr "Frames da Animação" +msgstr "Frames da Animação:" #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" @@ -6966,6 +6955,22 @@ msgid "Merge from Scene" msgstr "Fundir a partir da Cena" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "Próxima Coordenada" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "Coordenada Anterior" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Copiar bitmask." @@ -6978,9 +6983,8 @@ msgid "Erase bitmask." msgstr "Apagar bitmask." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Criar novos nós." +msgstr "Criar novo retângulo." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7120,6 +7124,14 @@ msgid "Clear Tile Bitmask" msgstr "Limpar Bitmask de Tile" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "Fazer PolÃgono Côncavo" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "Fazer PolÃgono Convexo" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Remover Tile" @@ -7161,26 +7173,23 @@ msgstr "TileSet" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "Definir Nome do Uniform" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Definir como Padrão para '%s'" +msgstr "Definir Porta de Entrada por Defeito" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "VIsualShader" +msgstr "Adicionar Nó ao Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" -msgstr "Duplicar Nó(s)" +msgstr "Duplicar Nós" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "Alterado Tipo de Entrada do Visual Shader" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" @@ -7199,14 +7208,12 @@ msgid "VisualShader" msgstr "VIsualShader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Editar Prioridade de Tile" +msgstr "Editar Propriedade Visual" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Alterações do Shader" +msgstr "Modo do Visual Shader Alterado" #: editor/project_export.cpp msgid "Runnable" @@ -7225,6 +7232,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"Falhou a exportação do projeto para a plataforma '%s'.\n" +"O Modelo de exportação está ausente ou é inválido." #: editor/project_export.cpp msgid "" @@ -7232,6 +7241,9 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"Falhou a exportação do projeto para a plataforma '%s'.\n" +"Pode ser provocado por um problema na predefinição ou configuração da " +"exportação." #: editor/project_export.cpp msgid "Release" @@ -7242,6 +7254,10 @@ msgid "Exporting All" msgstr "A Exportar Tudo" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "O caminho de exportação não existe:" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "Modelos de exportação para esta plataforma estão ausentes/corrompidos :" @@ -7536,7 +7552,6 @@ msgid "Are you sure to open more than one project?" msgstr "Está seguro que quer abrir mais do que um Projeto?" #: editor/project_manager.cpp -#, fuzzy msgid "" "The following project settings file does not specify the version of Godot " "through which it was created.\n" @@ -7548,12 +7563,13 @@ msgid "" "Warning: You will not be able to open the project with previous versions of " "the engine anymore." msgstr "" -"A seguinte configuração do projeto foi gerada por um motor mais antigo, e " -"precisa de ser convertida para esta versão.\n" +"A seguinte configuração do projeto não especifica a versão do Godot em que " +"foi criada.\n" "\n" "%s\n" "\n" -"Deseja convertê-la?\n" +"Se continuar com a abertura, será convertida para o formato da versão " +"atual.\n" "Aviso: Não conseguirá mais abrir o projeto em versões anteriores à deste " "motor." @@ -8280,7 +8296,6 @@ msgid "Instantiated scenes can't become root" msgstr "Cenas instantâneas não se podem tornar root" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" msgstr "Tornar Nó Raiz" @@ -8321,9 +8336,8 @@ msgid "Make Local" msgstr "Tornar Local" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Tornar Nó Raiz" +msgstr "Nova Raiz de Cena" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8754,19 +8768,16 @@ msgid "Set From Tree" msgstr "Definir a partir da árvore" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Ease out" +msgstr "Apagar Atalho" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Atalhos" +msgstr "Restaurar Atalho" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Mudar âncoras" +msgstr "Alterar Atalho" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -8975,9 +8986,8 @@ msgid "GridMap Duplicate Selection" msgstr "Seleção duplicada de GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paint" -msgstr "Configurações do GridMap" +msgstr "Pintura do GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Grid Map" @@ -9364,9 +9374,8 @@ msgid "Change Input Value" msgstr "Mudar valor de entrada" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "Redimensionar CanvasItem" +msgstr "Redimensionar Comentário" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -9803,6 +9812,9 @@ msgid "" "Use the CPUParticles2D node instead. You can use the \"Convert to " "CPUParticles\" option for this purpose." msgstr "" +"PartÃculas baseadas em GPU não são suportadas pelo driver de vÃdeo GLES2.\n" +"Use o Nó CPUParticles2D. Pode usar a opção \"Converter em CPUParticles\" " +"para este efeito." #: scene/2d/particles_2d.cpp scene/3d/particles.cpp msgid "" @@ -9961,6 +9973,12 @@ msgstr "" "Uma forma tem de ser fornecida para CollisionShape funcionar. Crie um " "recurso forma!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Nada é visÃvel porque nenhuma Malha foi atribuÃda." @@ -9977,6 +9995,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "A desenhar Meshes" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9997,6 +10021,9 @@ msgid "" "Use the CPUParticles node instead. You can use the \"Convert to CPUParticles" "\" option for this purpose." msgstr "" +"PartÃculas baseadas em GPU não são suportadas pelo driver de vÃdeo GLES2.\n" +"Use o Nó CPUParticles. Pode usar a opção \"Converter em CPUParticles\" para " +"este efeito." #: scene/3d/particles.cpp msgid "" @@ -10133,7 +10160,7 @@ msgstr "Este nó foi depreciado. Use AnimationTree em vez disso." #: scene/gui/color_picker.cpp msgid "Pick a color from the screen." -msgstr "" +msgstr "Escolha uma cor do ecrã." #: scene/gui/color_picker.cpp msgid "Raw Mode" @@ -10141,12 +10168,19 @@ msgstr "Modo Raw" #: scene/gui/color_picker.cpp msgid "Switch between hexadecimal and code values." -msgstr "" +msgstr "Alternar valores entre hexadecimal e código." #: scene/gui/color_picker.cpp -#, fuzzy msgid "Add current color as a preset." -msgstr "Adicionar cor atual como predefinição" +msgstr "Adicionar cor atual como predefinição." + +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" #: scene/gui/dialogs.cpp msgid "Alert!" @@ -10156,6 +10190,10 @@ msgstr "Alerta!" msgid "Please Confirm..." msgstr "Confirme por favor..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "Ir para a pasta acima." + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10240,6 +10278,10 @@ msgstr "Atribuição a uniforme." msgid "Varyings can only be assigned in vertex function." msgstr "Variações só podem ser atribuÃdas na função vértice." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Instancie a(s) Cena(s) selecionada(s) como filha(s) do Nó selecionado." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/ro.po b/editor/translations/ro.po index 7e471609e7..c9a2f59192 100644 --- a/editor/translations/ro.po +++ b/editor/translations/ro.po @@ -1404,8 +1404,22 @@ msgstr "Ambalare" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1457,7 +1471,7 @@ msgstr "ArătaÈ›i în Administratorul de FiÈ™iere" msgid "New Folder..." msgstr "Director Nou..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "ReîmprospătaÈ›i" @@ -1532,10 +1546,35 @@ msgstr "DeplasaÈ›i Favorit Sus" msgid "Move Favorite Down" msgstr "DeplasaÈ›i Favorit Jos" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Fila anterioară" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "CreaÈ›i Director" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "AccesaÈ›i Directorul Părinte" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Directorul nu a putut fi creat." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Vizualizează articolele ca È™i o grilă de miniaturi" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Vizualizează articolele ca È™i o listă" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Directoare È™i FiÅŸiere:" @@ -1777,9 +1816,9 @@ msgstr "Curăță AfiÈ™area" msgid "Project export failed with error code %d." msgstr "Exportul de proiect nu a reuÅŸit cu un cod de eroare %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Eroare la salvarea resursei!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1787,6 +1826,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Eroare la salvarea resursei!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "SalvaÈ›i Resursa Ca..." @@ -3114,16 +3163,6 @@ msgstr "" "fiÈ™iere!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Vizualizează articolele ca È™i o grilă de miniaturi" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Vizualizează articolele ca È™i o listă" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Stare: Importarea fiÈ™ierului eÈ™uată. Te rog repară fiÈ™ierul È™i reimportă " @@ -3269,10 +3308,6 @@ msgid "Search files" msgstr "Căutare Clase" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "InstanÈ›iază scena(ele) selectată ca un copil al nodului selectat." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5314,6 +5349,10 @@ msgid "Generating Visibility Rect" msgstr "Generare Dreptunghi de Vizibilitate" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Generare Dreptunghi de Vizibilitate" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "Definirea unui punct este posibilă doar într-un material de proces " @@ -5328,10 +5367,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Nici un pixel cu transparenÈ›a > 128 în imagine..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Generare Dreptunghi de Vizibilitate" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "ÃŽncărcare Mască de Emisie" @@ -5419,13 +5454,13 @@ msgid "Generating AABB" msgstr "Generare AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Generare AABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Generare Vizibilitate AABB" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Generare AABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Ștergere Punt din Curbă" @@ -7127,6 +7162,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Fila anterioară" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7280,6 +7332,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Deplasare poligon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Deplasare poligon" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Elimină Șablon" @@ -7409,6 +7471,10 @@ msgid "Exporting All" msgstr "Exportare" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10017,6 +10083,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10031,6 +10103,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10179,6 +10257,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -10187,6 +10273,11 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "AccesaÈ›i Directorul Părinte" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10260,6 +10351,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "InstanÈ›iază scena(ele) selectată ca un copil al nodului selectat." + #, fuzzy #~ msgid "Font Size:" #~ msgstr "Dimensiunea Conturului:" diff --git a/editor/translations/ru.po b/editor/translations/ru.po index 0964776b0f..701938c785 100644 --- a/editor/translations/ru.po +++ b/editor/translations/ru.po @@ -1413,8 +1413,22 @@ msgstr "Упаковывание" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1463,7 +1477,7 @@ msgstr "ПроÑмотреть в проводнике" msgid "New Folder..." msgstr "ÐÐ¾Ð²Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Обновить" @@ -1538,10 +1552,33 @@ msgstr "ПеремеÑтить избранное вверх" msgid "Move Favorite Down" msgstr "ПеремеÑтить избранное вниз" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Предыдущий Ñтаж" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Следующий Ñтаж" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Перейти к родительÑкой папке" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Ðевозможно Ñоздать папку." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "ПроÑмотр Ñлементов в виде миниатюр." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "ПроÑмотр Ñлементов в виде ÑпиÑка." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Каталоги и файлы:" @@ -1764,9 +1801,10 @@ msgstr "ОчиÑтить вывод" msgid "Project export failed with error code %d." msgstr "ÐкÑпорт проекта не удалÑÑ, код %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Ошибка при Ñохранении реÑурÑа!" +#: editor/editor_node.cpp +#, fuzzy +msgid "Imported resources can't be saved." +msgstr "Импортированные реÑурÑÑ‹" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1774,6 +1812,16 @@ msgid "OK" msgstr "Ок" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Ошибка при Ñохранении реÑурÑа!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Сохранить реÑÑƒÑ€Ñ ÐºÐ°Ðº..." @@ -3091,14 +3139,6 @@ msgstr "" "Ðе удаетÑÑ Ð¿ÐµÑ€ÐµÐ¹Ñ‚Ð¸ к '%s', так как он не был найден в файловой ÑиÑтеме!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "ПроÑмотр Ñлементов в виде миниатюр." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "ПроÑмотр Ñлементов в виде ÑпиÑка." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "СтатуÑ: Импорт файла не удалÑÑ. ПожалуйÑта, иÑправьте файл и " @@ -3236,10 +3276,6 @@ msgid "Search files" msgstr "ПоиÑк файлов" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Добавить выбранную Ñцену(Ñ‹), в качеÑтве потомка выбранного узла." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5233,6 +5269,10 @@ msgid "Generating Visibility Rect" msgstr "Создать облаÑÑ‚ÑŒ видимоÑти" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Создать облаÑÑ‚ÑŒ видимоÑти" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "Возможно уÑтановить точку только в ParticlesMaterial материал" @@ -5245,10 +5285,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Ðикаких пикÑелей Ñ Ð¿Ñ€Ð¾Ð·Ñ€Ð°Ñ‡Ð½Ð¾Ñтью > 128 в изображении..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Создать облаÑÑ‚ÑŒ видимоÑти" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "МаÑка выброÑа загружена" @@ -5336,11 +5372,11 @@ msgid "Generating AABB" msgstr "Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "Генерировать AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "Генерировать AABB" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6992,6 +7028,24 @@ msgid "Merge from Scene" msgstr "СлиÑние из Ñцены" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Следующий Ñтаж" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Предыдущий Ñтаж" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Копировать битовую маÑку." @@ -7146,6 +7200,16 @@ msgid "Clear Tile Bitmask" msgstr "ОчиÑтить Битовую МаÑку Плитки" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Concave" +msgstr "Передвинуть полигон" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Передвинуть полигон" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Удалить тайл" @@ -7268,6 +7332,11 @@ msgid "Exporting All" msgstr "ÐкÑпорт вÑех" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "Путь не ÑущеÑтвует." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Шаблоны ÑкÑпорта Ð´Ð»Ñ Ñтой платформы отÑутÑтвуют/повреждены:" @@ -9974,6 +10043,12 @@ msgstr "" "Shape должен быть предуÑмотрен Ð´Ð»Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ð¹ CollisionShape. ПожалуйÑта, " "Ñоздайте shape-реÑÑƒÑ€Ñ Ð´Ð»Ñ Ñтого!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Ðичто не видно, потому что не назначена Ñетка." @@ -9990,6 +10065,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "ПоÑтроение полиÑетки" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10156,6 +10237,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Добавить текущий цвет как преÑет" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Внимание!" @@ -10164,6 +10253,11 @@ msgstr "Внимание!" msgid "Please Confirm..." msgstr "Подтверждение..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Перейти к родительÑкой папке" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10253,6 +10347,9 @@ msgstr "Ðазначить форму" msgid "Varyings can only be assigned in vertex function." msgstr "Переменные могут быть назначены только в функции вершин." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Добавить выбранную Ñцену(Ñ‹), в качеÑтве потомка выбранного узла." + #~ msgid "FPS" #~ msgstr "FPS" @@ -11795,9 +11892,6 @@ msgstr "Переменные могут быть назначены только #~ msgid "Cannot go into subdir:" #~ msgstr "Ðевозможно перейти в подпапку:" -#~ msgid "Imported Resources" -#~ msgstr "Импортированные реÑурÑÑ‹" - #~ msgid "Insert Keys (Ins)" #~ msgstr "Ð’Ñтавить ключи (Ins)" diff --git a/editor/translations/si.po b/editor/translations/si.po index d792087871..f5590dda40 100644 --- a/editor/translations/si.po +++ b/editor/translations/si.po @@ -1348,8 +1348,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1397,7 +1411,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1472,10 +1486,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1691,8 +1725,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1701,6 +1735,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2935,14 +2979,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3078,10 +3114,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5016,19 +5048,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5119,11 +5151,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6760,6 +6792,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6900,6 +6948,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -7018,6 +7074,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9569,6 +9629,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9583,6 +9649,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9726,6 +9798,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9734,6 +9814,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/sk.po b/editor/translations/sk.po index af5966a37d..304755970c 100644 --- a/editor/translations/sk.po +++ b/editor/translations/sk.po @@ -5,12 +5,13 @@ # J08nY <johnenter@gmail.com>, 2016. # MineGame 159 <minegame459@gmail.com>, 2018. # Zuzana Palenikova <sousana.is@gmail.com>, 2019. +# MineGame159 <petulko08@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-01 12:10+0000\n" -"Last-Translator: Zuzana Palenikova <sousana.is@gmail.com>\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" +"Last-Translator: MineGame159 <petulko08@gmail.com>\n" "Language-Team: Slovak <https://hosted.weblate.org/projects/godot-engine/" "godot/sk/>\n" "Language: sk\n" @@ -18,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -63,7 +64,7 @@ msgstr "Pri volanà '%s':" #: editor/animation_bezier_editor.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Free" -msgstr "" +msgstr "Voľné" #: editor/animation_bezier_editor.cpp msgid "Balanced" @@ -91,17 +92,16 @@ msgid "Add Bezier Point" msgstr "Signály:" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "VÅ¡etky vybrané" +msgstr "Presunúť Vybraté Body" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" -msgstr "" +msgstr "Animácia DuplikovaÅ¥ KľúÄe" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Delete Keys" -msgstr "" +msgstr "Animácia VymazaÅ¥ KľúÄe" #: editor/animation_track_editor.cpp msgid "Anim Change Keyframe Time" @@ -126,12 +126,12 @@ msgstr "Animácia ZmeniÅ¥ Hovor" #: editor/animation_track_editor.cpp msgid "Change Animation Length" -msgstr "" +msgstr "ZmeniÅ¥ Dĺžku Animácie" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "ZmeniÅ¥ Dĺžku Animácie" #: editor/animation_track_editor.cpp msgid "Property Track" @@ -163,7 +163,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Animation Length Time (seconds)" -msgstr "" +msgstr "Dĺžka ÄŒasu Animácie (v sekundách)" #: editor/animation_track_editor.cpp msgid "Animation Looping" @@ -172,15 +172,15 @@ msgstr "" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Functions:" -msgstr "" +msgstr "Funkcie:" #: editor/animation_track_editor.cpp msgid "Audio Clips:" -msgstr "" +msgstr "Zvukové Klipy:" #: editor/animation_track_editor.cpp msgid "Anim Clips:" -msgstr "" +msgstr "Klipy Animácie:" #: editor/animation_track_editor.cpp msgid "Change Track Path" @@ -196,7 +196,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Interpolation Mode" -msgstr "" +msgstr "Režim Interpolácie" #: editor/animation_track_editor.cpp msgid "Loop Wrap Mode (Interpolate end with beginning on loop)" @@ -209,7 +209,7 @@ msgstr "VÅ¡etky vybrané" #: editor/animation_track_editor.cpp msgid "Time (s): " -msgstr "" +msgstr "ÄŒas (s): " #: editor/animation_track_editor.cpp msgid "Toggle Track Enabled" @@ -221,28 +221,28 @@ msgstr "Priebežný" #: editor/animation_track_editor.cpp msgid "Discrete" -msgstr "" +msgstr "Diskrétne" #: editor/animation_track_editor.cpp msgid "Trigger" -msgstr "" +msgstr "Spúšť" #: editor/animation_track_editor.cpp msgid "Capture" -msgstr "" +msgstr "ZachytiÅ¥" #: editor/animation_track_editor.cpp msgid "Nearest" -msgstr "" +msgstr "NajbližšÃ" #: editor/animation_track_editor.cpp editor/plugins/curve_editor_plugin.cpp #: editor/property_editor.cpp msgid "Linear" -msgstr "" +msgstr "Lineárne" #: editor/animation_track_editor.cpp msgid "Cubic" -msgstr "" +msgstr "Kubický" #: editor/animation_track_editor.cpp msgid "Clamp Loop Interp" @@ -255,7 +255,7 @@ msgstr "" #: editor/animation_track_editor.cpp #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key" -msgstr "" +msgstr "VložiÅ¥ KľúÄ" #: editor/animation_track_editor.cpp #, fuzzy @@ -298,19 +298,19 @@ msgstr "" #: editor/plugins/mesh_instance_editor_plugin.cpp #: editor/plugins/particles_editor_plugin.cpp editor/script_create_dialog.cpp msgid "Create" -msgstr "" +msgstr "VytvoriÅ¥" #: editor/animation_track_editor.cpp msgid "Anim Insert" -msgstr "" +msgstr "Animácia VložiÅ¥" #: editor/animation_track_editor.cpp msgid "AnimationPlayer can't animate itself, only other players." -msgstr "" +msgstr "AnimationPlayer nemôže animovaÅ¥ sám seba, iba ostatný hráÄi." #: editor/animation_track_editor.cpp msgid "Anim Create & Insert" -msgstr "" +msgstr "Animácia VytvoriÅ¥ & VložiÅ¥" #: editor/animation_track_editor.cpp msgid "Anim Insert Track & Key" @@ -318,7 +318,7 @@ msgstr "" #: editor/animation_track_editor.cpp msgid "Anim Insert Key" -msgstr "" +msgstr "Animácia VložiÅ¥ KľúÄ" #: editor/animation_track_editor.cpp #, fuzzy @@ -341,6 +341,10 @@ msgid "" "-AudioStreamPlayer2D\n" "-AudioStreamPlayer3D" msgstr "" +"Audio stopy môžu ukazovaÅ¥ len na nodes typu:\n" +"-AudioStreamPlayer\n" +"-AudioStreamPlayer2D\n" +"-AudioStreamPlayer3D" #: editor/animation_track_editor.cpp msgid "Animation tracks can only point to AnimationPlayer nodes." @@ -640,13 +644,13 @@ msgstr "" #: editor/connections_dialog.cpp msgid "Connect To Node:" -msgstr "" +msgstr "PripojiÅ¥ k Node:" #: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp #: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp #: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp msgid "Add" -msgstr "" +msgstr "PridaÅ¥" #: editor/connections_dialog.cpp editor/dependency_editor.cpp #: editor/groups_editor.cpp editor/plugins/animation_player_editor_plugin.cpp @@ -655,7 +659,7 @@ msgstr "" #: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp #: editor/project_settings_editor.cpp msgid "Remove" -msgstr "" +msgstr "OdstrániÅ¥" #: editor/connections_dialog.cpp msgid "Add Extra Call Argument:" @@ -667,7 +671,7 @@ msgstr "" #: editor/connections_dialog.cpp msgid "Path to Node:" -msgstr "" +msgstr "Cesta k Node:" #: editor/connections_dialog.cpp msgid "Make Function" @@ -693,102 +697,99 @@ msgstr "" #: editor/run_settings_dialog.cpp editor/settings_config_dialog.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Close" -msgstr "" +msgstr "ZatvoriÅ¥" #: editor/connections_dialog.cpp msgid "Connect" -msgstr "" +msgstr "PripojiÅ¥" #: editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" -msgstr "" +msgstr "PripojiÅ¥ '%s' k '%s'" #: editor/connections_dialog.cpp msgid "Disconnect '%s' from '%s'" -msgstr "" +msgstr "OdpojiÅ¥ '%s' z '%s'" #: editor/connections_dialog.cpp msgid "Disconnect all from signal: '%s'" -msgstr "" +msgstr "OpojiÅ¥ vÅ¡etky z signálu: '%s'" #: editor/connections_dialog.cpp msgid "Connect..." -msgstr "" +msgstr "PripojiÅ¥..." #: editor/connections_dialog.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp msgid "Disconnect" -msgstr "" +msgstr "OdpojiÅ¥" #: editor/connections_dialog.cpp -#, fuzzy msgid "Connect Signal: " -msgstr "VÅ¡etky vybrané" +msgstr "PripojiÅ¥ Signál: " #: editor/connections_dialog.cpp -#, fuzzy msgid "Edit Connection: " -msgstr "UpraviÅ¥ výber krivky" +msgstr "UpraviÅ¥ Pripojenie: " #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from the \"%s\" signal?" -msgstr "" +msgstr "Naozaj chcete odstrániÅ¥ vÅ¡etky pripojenia z \"%s\" signálu?" #: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp msgid "Signals" -msgstr "" +msgstr "Signály" #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from this signal?" -msgstr "" +msgstr "Naozaj chcete odstrániÅ¥ vÅ¡etky pripojenia z tohto signálu?" #: editor/connections_dialog.cpp msgid "Disconnect All" -msgstr "" +msgstr "OpojiÅ¥ VÅ¡etko" #: editor/connections_dialog.cpp msgid "Edit..." -msgstr "" +msgstr "UpraviÅ¥..." #: editor/connections_dialog.cpp msgid "Go To Method" -msgstr "" +msgstr "Prejdite na Metódu" #: editor/create_dialog.cpp msgid "Change %s Type" -msgstr "" +msgstr "ZmeniÅ¥ %s Typ" #: editor/create_dialog.cpp editor/project_settings_editor.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Change" -msgstr "" +msgstr "ZmeniÅ¥" #: editor/create_dialog.cpp -#, fuzzy msgid "Create New %s" -msgstr "VytvoriÅ¥ adresár" +msgstr "VytvoriÅ¥ Nový %s" #: editor/create_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp msgid "Favorites:" -msgstr "" +msgstr "Obľúbené:" #: editor/create_dialog.cpp editor/editor_file_dialog.cpp msgid "Recent:" -msgstr "" +msgstr "Nedávne:" #: editor/create_dialog.cpp editor/plugins/asset_library_editor_plugin.cpp #: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp #: editor/property_selector.cpp editor/quick_open.cpp #: modules/visual_script/visual_script_property_selector.cpp msgid "Search:" -msgstr "" +msgstr "HľadaÅ¥:" #: editor/create_dialog.cpp editor/plugins/script_editor_plugin.cpp #: editor/property_selector.cpp editor/quick_open.cpp #: modules/visual_script/visual_script_property_selector.cpp msgid "Matches:" -msgstr "" +msgstr "Zhody:" #: editor/create_dialog.cpp editor/plugin_config_dialog.cpp #: editor/plugins/asset_library_editor_plugin.cpp editor/property_selector.cpp @@ -798,17 +799,19 @@ msgstr "Popis:" #: editor/dependency_editor.cpp msgid "Search Replacement For:" -msgstr "" +msgstr "HľadaÅ¥ Náhradu pre:" #: editor/dependency_editor.cpp msgid "Dependencies For:" -msgstr "" +msgstr "Závislosti pre:" #: editor/dependency_editor.cpp msgid "" "Scene '%s' is currently being edited.\n" "Changes will not take effect unless reloaded." msgstr "" +"Scéna '%s' sa práve upravuje.\n" +"Zmeny sa neprejavia, pokiaľ znovu naÄÃtané." #: editor/dependency_editor.cpp msgid "" @@ -819,32 +822,32 @@ msgstr "" #: editor/dependency_editor.cpp #: modules/gdnative/gdnative_library_editor_plugin.cpp msgid "Dependencies" -msgstr "" +msgstr "ZávislostÃ" #: editor/dependency_editor.cpp msgid "Resource" -msgstr "" +msgstr "Prostriedok" #: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp #: editor/project_settings_editor.cpp editor/script_create_dialog.cpp msgid "Path" -msgstr "" +msgstr "Cesta" #: editor/dependency_editor.cpp msgid "Dependencies:" -msgstr "" +msgstr "ZávislostÃ:" #: editor/dependency_editor.cpp msgid "Fix Broken" -msgstr "" +msgstr "OpraviÅ¥ Rozbité" #: editor/dependency_editor.cpp msgid "Dependency Editor" -msgstr "" +msgstr "Editor ZávislostÃ" #: editor/dependency_editor.cpp msgid "Search Replacement Resource:" -msgstr "" +msgstr "HľadaÅ¥ Náhradný Zdroj:" #: editor/dependency_editor.cpp editor/editor_file_dialog.cpp #: editor/editor_help_search.cpp editor/editor_node.cpp @@ -858,11 +861,11 @@ msgstr "OtvoriÅ¥" #: editor/dependency_editor.cpp msgid "Owners Of:" -msgstr "" +msgstr "Majitelia:" #: editor/dependency_editor.cpp msgid "Remove selected files from the project? (no undo)" -msgstr "" +msgstr "OdstrániÅ¥ vybraté súbory z projektu? (nedá sa vrátiÅ¥ späť)" #: editor/dependency_editor.cpp msgid "" @@ -870,46 +873,48 @@ msgid "" "work.\n" "Remove them anyway? (no undo)" msgstr "" +"Súbory ktoré budú odstránené vyžadujú ÄalÅ¡ie zdroje, aby mohli pracovaÅ¥.\n" +"OdstrániÅ¥ aj napriek tomu? (nedá sa vrátiÅ¥ späť)" #: editor/dependency_editor.cpp editor/export_template_manager.cpp msgid "Cannot remove:" -msgstr "" +msgstr "Nemôžete odstrániÅ¥:" #: editor/dependency_editor.cpp msgid "Error loading:" -msgstr "" +msgstr "Chyba pri naÄÃtanÃ:" #: editor/dependency_editor.cpp msgid "Load failed due to missing dependencies:" -msgstr "" +msgstr "NaÄÃtanie zlyhalo z dôvodu chýbajúcich závislostÃ:" #: editor/dependency_editor.cpp editor/editor_node.cpp msgid "Open Anyway" -msgstr "" +msgstr "OtvoriÅ¥ aj napriek tomu" #: editor/dependency_editor.cpp msgid "Which action should be taken?" -msgstr "" +msgstr "Ktorá akcia by sa mala prijaÅ¥?" #: editor/dependency_editor.cpp msgid "Fix Dependencies" -msgstr "" +msgstr "OpraviÅ¥ Závislosti" #: editor/dependency_editor.cpp msgid "Errors loading!" -msgstr "" +msgstr "Chyby pri naÄÃtanÃ!" #: editor/dependency_editor.cpp msgid "Permanently delete %d item(s)? (No undo!)" -msgstr "" +msgstr "Natrvalo odstrániÅ¥ %d položky? (Nedá sa vrátiÅ¥ späť!)" #: editor/dependency_editor.cpp msgid "Owns" -msgstr "" +msgstr "VlastnÃ" #: editor/dependency_editor.cpp msgid "Resources Without Explicit Ownership:" -msgstr "" +msgstr "Zdroje Bez Výslovného VlastnÃctva:" #: editor/dependency_editor.cpp editor/editor_node.cpp msgid "Orphan Resource Explorer" @@ -917,7 +922,7 @@ msgstr "" #: editor/dependency_editor.cpp msgid "Delete selected files?" -msgstr "" +msgstr "OdstrániÅ¥ vybraté súbory?" #: editor/dependency_editor.cpp editor/editor_audio_buses.cpp #: editor/editor_file_dialog.cpp editor/editor_node.cpp @@ -925,79 +930,79 @@ msgstr "" #: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_export.cpp #: editor/project_settings_editor.cpp editor/scene_tree_dock.cpp msgid "Delete" -msgstr "" +msgstr "VymazaÅ¥" #: editor/dictionary_property_edit.cpp msgid "Change Dictionary Key" -msgstr "" +msgstr "ZmeniÅ¥ KÄ¾ÃºÄ v SlovnÃku" #: editor/dictionary_property_edit.cpp msgid "Change Dictionary Value" -msgstr "" +msgstr "ZmeniÅ¥ Hodnotu v SlovnÃku" #: editor/editor_about.cpp msgid "Thanks from the Godot community!" -msgstr "" +msgstr "VÄaka z Godot komunity!" #: editor/editor_about.cpp msgid "Godot Engine contributors" -msgstr "" +msgstr "Godot Engine prispievatelia" #: editor/editor_about.cpp msgid "Project Founders" -msgstr "" +msgstr "Zakladatelia Projektu" #: editor/editor_about.cpp msgid "Lead Developer" -msgstr "" +msgstr "Vedúci Vývojár" #: editor/editor_about.cpp msgid "Project Manager " -msgstr "" +msgstr "Manažér Projektu " #: editor/editor_about.cpp msgid "Developers" -msgstr "" +msgstr "Vývojári" #: editor/editor_about.cpp msgid "Authors" -msgstr "" +msgstr "Autori" #: editor/editor_about.cpp msgid "Platinum Sponsors" -msgstr "" +msgstr "Platinový Sponzori" #: editor/editor_about.cpp msgid "Gold Sponsors" -msgstr "" +msgstr "Zlatý Sponzori" #: editor/editor_about.cpp msgid "Mini Sponsors" -msgstr "" +msgstr "Malý Sponzori" #: editor/editor_about.cpp msgid "Gold Donors" -msgstr "" +msgstr "Zlatý Darcovia" #: editor/editor_about.cpp msgid "Silver Donors" -msgstr "" +msgstr "Strieborný Darcovia" #: editor/editor_about.cpp msgid "Bronze Donors" -msgstr "" +msgstr "Bronzový Darcovia" #: editor/editor_about.cpp msgid "Donors" -msgstr "" +msgstr "Darcovia" #: editor/editor_about.cpp msgid "License" -msgstr "" +msgstr "Licencia" #: editor/editor_about.cpp msgid "Thirdparty License" -msgstr "" +msgstr "Thirdparty Licencie" #: editor/editor_about.cpp msgid "" @@ -1008,22 +1013,21 @@ msgid "" msgstr "" #: editor/editor_about.cpp -#, fuzzy msgid "All Components" -msgstr "KonÅ¡tanty:" +msgstr "VÅ¡etky Komponenty" #: editor/editor_about.cpp #, fuzzy msgid "Components" -msgstr "KonÅ¡tanty:" +msgstr "Komponenty" #: editor/editor_about.cpp msgid "Licenses" -msgstr "" +msgstr "Licencie" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Error opening package file, not in zip format." -msgstr "" +msgstr "Chyba pri otváranà súboru balÃka, nie je vo formáte zip." #: editor/editor_asset_installer.cpp msgid "Uncompressing Assets" @@ -1031,29 +1035,29 @@ msgstr "" #: editor/editor_asset_installer.cpp editor/project_manager.cpp msgid "Package installed successfully!" -msgstr "" +msgstr "BalÃk bol úspeÅ¡ne nainÅ¡talovaný!" #: editor/editor_asset_installer.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Success!" -msgstr "" +msgstr "Úspech!" #: editor/editor_asset_installer.cpp #: editor/plugins/asset_library_editor_plugin.cpp msgid "Install" -msgstr "" +msgstr "InÅ¡talovaÅ¥" #: editor/editor_asset_installer.cpp msgid "Package Installer" -msgstr "" +msgstr "InÅ¡talátor BalÃkov" #: editor/editor_audio_buses.cpp msgid "Speakers" -msgstr "" +msgstr "Reproduktory" #: editor/editor_audio_buses.cpp msgid "Add Effect" -msgstr "" +msgstr "PridaÅ¥ Efekt" #: editor/editor_audio_buses.cpp #, fuzzy @@ -1099,15 +1103,15 @@ msgstr "" #: editor/editor_audio_buses.cpp msgid "Solo" -msgstr "" +msgstr "Sólo" #: editor/editor_audio_buses.cpp msgid "Mute" -msgstr "" +msgstr "StlmiÅ¥" #: editor/editor_audio_buses.cpp msgid "Bypass" -msgstr "" +msgstr "ObÃsÅ¥" #: editor/editor_audio_buses.cpp msgid "Bus options" @@ -1116,19 +1120,19 @@ msgstr "" #: editor/editor_audio_buses.cpp editor/filesystem_dock.cpp #: editor/plugins/animation_player_editor_plugin.cpp editor/scene_tree_dock.cpp msgid "Duplicate" -msgstr "" +msgstr "DuplikovaÅ¥" #: editor/editor_audio_buses.cpp msgid "Reset Volume" -msgstr "" +msgstr "ObnoviÅ¥ HlasitosÅ¥" #: editor/editor_audio_buses.cpp msgid "Delete Effect" -msgstr "" +msgstr "OdstrániÅ¥ Efekt" #: editor/editor_audio_buses.cpp msgid "Audio" -msgstr "" +msgstr "Audio" #: editor/editor_audio_buses.cpp msgid "Add Audio Bus" @@ -1168,7 +1172,7 @@ msgstr "" #: editor/editor_audio_buses.cpp msgid "There is no 'res://default_bus_layout.tres' file." -msgstr "" +msgstr "Neexistuje žiadny súbor \"res://default_bus_layout.tres\"." #: editor/editor_audio_buses.cpp msgid "Invalid file, not an audio bus layout." @@ -1186,7 +1190,7 @@ msgstr "" #: editor/plugins/animation_player_editor_plugin.cpp editor/property_editor.cpp #: editor/script_create_dialog.cpp msgid "Load" -msgstr "" +msgstr "NaÄÃtaÅ¥" #: editor/editor_audio_buses.cpp #, fuzzy @@ -1195,7 +1199,7 @@ msgstr "Popis:" #: editor/editor_audio_buses.cpp msgid "Save As" -msgstr "" +msgstr "UložiÅ¥ Ako" #: editor/editor_audio_buses.cpp msgid "Save this Bus Layout to a file." @@ -1203,7 +1207,7 @@ msgstr "" #: editor/editor_audio_buses.cpp editor/import_dock.cpp msgid "Load Default" -msgstr "" +msgstr "NaÄÃtaÅ¥ predvolené" #: editor/editor_audio_buses.cpp msgid "Load the default Bus Layout." @@ -1215,7 +1219,7 @@ msgstr "" #: editor/editor_autoload_settings.cpp msgid "Invalid name." -msgstr "" +msgstr "Neplatný Názov." #: editor/editor_autoload_settings.cpp msgid "Valid characters:" @@ -1358,8 +1362,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1412,7 +1430,7 @@ msgstr "OtvoriÅ¥ súbor" msgid "New Folder..." msgstr "VytvoriÅ¥ adresár" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1487,10 +1505,32 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "VytvoriÅ¥ adresár" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "VytvoriÅ¥ adresár" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "PrieÄinky a Súbory:" @@ -1721,8 +1761,8 @@ msgstr "Popis:" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1731,6 +1771,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2979,14 +3029,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3126,10 +3168,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5106,19 +5144,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5209,11 +5247,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6884,6 +6922,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Popis:" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7039,6 +7094,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "VytvoriÅ¥ adresár" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "VÅ¡etky vybrané" @@ -7165,6 +7229,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9775,6 +9843,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9789,6 +9863,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9933,6 +10013,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9941,6 +10029,11 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "VytvoriÅ¥ adresár" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/sl.po b/editor/translations/sl.po index 3af3c9d835..0902f872bb 100644 --- a/editor/translations/sl.po +++ b/editor/translations/sl.po @@ -1401,8 +1401,22 @@ msgstr "Pakiranje" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1454,7 +1468,7 @@ msgstr "Pokaži V Upravitelju Datotek" msgid "New Folder..." msgstr "Nova Mapa..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Osveži" @@ -1529,10 +1543,35 @@ msgstr "Premakni Priljubljeno Navzgor" msgid "Move Favorite Down" msgstr "Premakni Priljubljeno Navzdol" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "PrejÅ¡nji zavihek" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Ustvarite Mapo" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Pojdi v nadrejeno mapo" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Mape ni mogoÄe ustvariti." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Oglejte si elemente, kot mrežo sliÄic" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Oglejte si elemente v seznamu" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Mape & Datoteke:" @@ -1772,9 +1811,9 @@ msgstr "PoÄisti Izhod" msgid "Project export failed with error code %d." msgstr "Izvoz projekta ni uspelo s kodno napako %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Napaka pri shranjevanju virov!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1782,6 +1821,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Napaka pri shranjevanju virov!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Shrani Vire Kot..." @@ -3099,16 +3148,6 @@ msgstr "" "sistemu!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Oglejte si elemente, kot mrežo sliÄic" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Oglejte si elemente v seznamu" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Stanje: Uvoz datoteke ni uspel. Popravi datoteko in ponovno roÄno uvozi." @@ -3253,11 +3292,6 @@ msgid "Search files" msgstr "IÅ¡Äi Razrede" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" -"Naredi primer iz izbranih prizorov, ki bo naslednik izbranega gradnika." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5296,19 +5330,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5399,11 +5433,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7103,6 +7137,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "PrejÅ¡nji zavihek" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7258,6 +7309,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Ustvarite Poligon" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Odstrani Predlogo" @@ -7389,6 +7449,10 @@ msgid "Exporting All" msgstr "Izvozi" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10015,6 +10079,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10029,6 +10099,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10179,6 +10255,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Dodaj trenutno barvo kot prednastavljeno" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Opozorilo!" @@ -10187,6 +10271,11 @@ msgstr "Opozorilo!" msgid "Please Confirm..." msgstr "Prosimo Potrdite..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Pojdi v nadrejeno mapo" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10263,6 +10352,10 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "" +#~ "Naredi primer iz izbranih prizorov, ki bo naslednik izbranega gradnika." + #~ msgid "Line:" #~ msgstr "Vrstica:" diff --git a/editor/translations/sq.po b/editor/translations/sq.po index 23c2f02d7a..cc41a13b65 100644 --- a/editor/translations/sq.po +++ b/editor/translations/sq.po @@ -1338,8 +1338,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1387,7 +1401,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1462,10 +1476,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1681,8 +1715,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1691,6 +1725,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2925,14 +2969,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3068,10 +3104,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5003,19 +5035,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5106,11 +5138,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6746,6 +6778,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6885,6 +6933,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Fshi keys të gabuar" @@ -7004,6 +7060,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9555,6 +9615,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9569,6 +9635,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9712,6 +9784,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9720,6 +9800,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po index fd45d7d072..f6bb6401b3 100644 --- a/editor/translations/sr_Cyrl.po +++ b/editor/translations/sr_Cyrl.po @@ -1407,8 +1407,22 @@ msgstr "Паковање" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1461,7 +1475,7 @@ msgstr "Покажи у менаџеру датотека" msgid "New Folder..." msgstr "Ðови директоријум..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "ОÑвежи" @@ -1536,10 +1550,35 @@ msgstr "Помери нагоре омиљену" msgid "Move Favorite Down" msgstr "Помери надоле омиљену" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Претодни Ñпрат" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Ðаправи директоријум" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Иди у родитељÑки директоријум" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "ÐеуÑпех при прављењу директоријума." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Прикажи Ñтвари као мрежа Ñличица" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Прикажи Ñтвари као лиÑта" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Директоријуми и датотеке:" @@ -1782,9 +1821,9 @@ msgstr "Излаз" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Грешка при чувању реÑурÑа!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1792,6 +1831,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Грешка при чувању реÑурÑа!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Сачувај реÑÑƒÑ€Ñ ÐºÐ°Ð¾..." @@ -3117,16 +3166,6 @@ msgstr "ÐеуÑпех навигације у „%s“ пошто није пр #: editor/filesystem_dock.cpp #, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Прикажи Ñтвари као мрежа Ñличица" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Прикажи Ñтвари као лиÑта" - -#: editor/filesystem_dock.cpp -#, fuzzy msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "\n" @@ -3281,10 +3320,6 @@ msgid "Search files" msgstr "Потражи клаÑе" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Ðаправи Ñледећу Ñцену/е као дете одабраног чвора." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5323,6 +5358,10 @@ msgid "Generating Visibility Rect" msgstr "Генериши правоугаоник видљивоÑти" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Генериши правоугаоник видљивоÑти" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "Тачка Ñе Ñамо може поÑтавити у ParticlesMaterial процеÑни материјал" @@ -5335,10 +5374,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "У Ñлици нема пикÑела Ñа транÑпарентношћу већом од 128..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Генериши правоугаоник видљивоÑти" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Учитај маÑку емиÑије" @@ -5427,13 +5462,13 @@ msgid "Generating AABB" msgstr "ГенериÑање оÑног поравнаног граничниог оквира (AABB)" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "Генериши оÑно поравнан гранични оквир (AABB)" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Генериши оÑно поравнан гранични оквир (AABB) видљивоÑти" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "Генериши оÑно поравнан гранични оквир (AABB)" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Обриши тачку из криве" @@ -7171,6 +7206,24 @@ msgid "Merge from Scene" msgstr "Споји од Ñцене" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Следећа Ñкриптица" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Претодни Ñпрат" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7329,6 +7382,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Помери полигон" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Помери полигон" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Обриши шаблон" @@ -7464,6 +7527,11 @@ msgid "Exporting All" msgstr "Извоз" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "Путања не поÑтоји." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Извозни шаблони за ову платформу или ниÑу пронађени или Ñу иÑкварене:" @@ -10097,6 +10165,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10111,6 +10185,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10259,6 +10339,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -10267,6 +10355,11 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Иди у родитељÑки директоријум" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10341,6 +10434,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Ðаправи Ñледећу Ñцену/е као дете одабраног чвора." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po index 1a75fd637d..8f0bf93d79 100644 --- a/editor/translations/sr_Latn.po +++ b/editor/translations/sr_Latn.po @@ -1358,8 +1358,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1407,7 +1421,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1482,10 +1496,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1702,8 +1736,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1712,6 +1746,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2946,14 +2990,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3089,10 +3125,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5036,19 +5068,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5139,11 +5171,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6792,6 +6824,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6940,6 +6988,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Napravi" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "ObriÅ¡i Selekciju" @@ -7061,6 +7118,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9617,6 +9678,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9631,6 +9698,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9774,6 +9847,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9782,6 +9863,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/sv.po b/editor/translations/sv.po index 4de14cba75..ce12b4215c 100644 --- a/editor/translations/sv.po +++ b/editor/translations/sv.po @@ -1531,8 +1531,22 @@ msgstr "Packar" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1588,7 +1602,7 @@ msgstr "Visa I Filhanteraren" msgid "New Folder..." msgstr "Ny Mapp..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Uppdatera" @@ -1668,10 +1682,33 @@ msgstr "Flytta Favorit Upp" msgid "Move Favorite Down" msgstr "Flytta Favorit Ner" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "FöregÃ¥ende flik" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Skapa Mapp" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "GÃ¥ till överordnad mapp" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Kunde inte skapa mapp." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp #, fuzzy msgid "Directories & Files:" @@ -1930,10 +1967,9 @@ msgstr "Output:" msgid "Project export failed with error code %d." msgstr "Projekt exporten misslyckades med följande felmeddelande %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy -msgid "Error saving resource!" -msgstr "Fel vid sparande av resurs!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1941,6 +1977,17 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +#, fuzzy +msgid "Error saving resource!" +msgstr "Fel vid sparande av resurs!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Spara Resurs Som..." @@ -3339,14 +3386,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3504,11 +3543,6 @@ msgid "Search files" msgstr "Sök Klasser" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Instansiera valda scen(er) som barn till vald Node." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5572,19 +5606,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5678,11 +5712,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7447,6 +7481,24 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Nästa Skript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "FöregÃ¥ende Skript" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7602,6 +7654,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Skapa Prenumeration" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Ta Bort Mall" @@ -7731,6 +7792,11 @@ msgid "Exporting All" msgstr "Exportera" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "Sökvägen finns inte." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10498,6 +10564,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10512,6 +10584,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10663,6 +10741,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Lägg till nuvarande färg som en förinställning" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp #, fuzzy msgid "Alert!" @@ -10673,6 +10759,11 @@ msgstr "Varning!" msgid "Please Confirm..." msgstr "Vänligen Bekräfta..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "GÃ¥ till överordnad mapp" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10750,6 +10841,10 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#, fuzzy +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Instansiera valda scen(er) som barn till vald Node." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/ta.po b/editor/translations/ta.po index ef56649851..71a637295f 100644 --- a/editor/translations/ta.po +++ b/editor/translations/ta.po @@ -1351,8 +1351,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1400,7 +1414,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1475,10 +1489,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1694,8 +1728,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1704,6 +1738,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2938,14 +2982,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3082,10 +3118,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5023,19 +5055,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5126,11 +5158,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6768,6 +6800,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6908,6 +6956,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -7026,6 +7082,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9581,6 +9641,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9595,6 +9661,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9738,6 +9810,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9746,6 +9826,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/te.po b/editor/translations/te.po index c0b3ef05a8..936452190c 100644 --- a/editor/translations/te.po +++ b/editor/translations/te.po @@ -1335,8 +1335,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1384,7 +1398,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1459,10 +1473,30 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1678,8 +1712,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1688,6 +1722,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2922,14 +2966,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3065,10 +3101,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -4997,19 +5029,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5100,11 +5132,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6737,6 +6769,22 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6875,6 +6923,14 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "" @@ -6992,6 +7048,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9543,6 +9603,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9557,6 +9623,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9700,6 +9772,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9708,6 +9788,10 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/th.po b/editor/translations/th.po index 9637545869..e61a6675b2 100644 --- a/editor/translations/th.po +++ b/editor/translations/th.po @@ -1407,8 +1407,22 @@ msgstr "à¸à¸³à¸¥à¸±à¸‡à¸£à¸§à¸šà¸£à¸§à¸¡" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1461,7 +1475,7 @@ msgstr "à¹à¸ªà¸”งในตัวจัดà¸à¸²à¸£à¹„ฟล์" msgid "New Folder..." msgstr "สร้างโฟลเดà¸à¸£à¹Œ..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "รีเฟรช" @@ -1536,10 +1550,35 @@ msgstr "เลื่à¸à¸™à¹‚ฟลเดà¸à¸£à¹Œà¸—ี่ชà¸à¸šà¸‚ึ้น msgid "Move Favorite Down" msgstr "เลื่à¸à¸™à¹‚ฟลเดà¸à¸£à¹Œà¸—ี่ชà¸à¸šà¸¥à¸‡" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "ไปชั้นล่าง" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "ไปชั้นบน" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "ไปยังโฟลเดà¸à¸£à¹Œà¸«à¸¥à¸±à¸" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "ไม่สามารถสร้างโฟลเดà¸à¸£à¹Œ" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "à¹à¸ªà¸”งเป็นภาพตัวà¸à¸¢à¹ˆà¸²à¸‡" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "à¹à¸ªà¸”งเป็นรายชื่à¸à¹„ฟล์" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "ไฟล์à¹à¸¥à¸°à¹‚ฟลเดà¸à¸£à¹Œ:" @@ -1775,9 +1814,9 @@ msgstr "ลบข้à¸à¸„วาม" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "บันทึà¸à¸£à¸µà¸‹à¸à¸£à¹Œà¸ªà¸œà¸´à¸”พลาด!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1785,6 +1824,16 @@ msgid "OK" msgstr "ตà¸à¸¥à¸‡" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "บันทึà¸à¸£à¸µà¸‹à¸à¸£à¹Œà¸ªà¸œà¸´à¸”พลาด!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "บันทึà¸à¸£à¸µà¸‹à¸à¸£à¹Œà¸ªà¹€à¸›à¹‡à¸™..." @@ -3074,16 +3123,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "ไม่สามารถไปยัง '%s' เนื่à¸à¸‡à¸ˆà¸²à¸à¹„ม่พบในระบบ!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "à¹à¸ªà¸”งเป็นภาพตัวà¸à¸¢à¹ˆà¸²à¸‡" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "à¹à¸ªà¸”งเป็นรายชื่à¸à¹„ฟล์" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "สถานะ: นำเข้าไฟล์ล้มเหลว à¸à¸£à¸¸à¸“าà¹à¸à¹‰à¹„ขไฟล์à¹à¸¥à¸°à¸™à¸³à¹€à¸‚้าใหม่" @@ -3227,10 +3266,6 @@ msgid "Search files" msgstr "ค้นหาคลาส" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "à¸à¸´à¸™à¸ªà¹à¸•à¸™à¸‹à¹Œà¸‰à¸²à¸à¸—ี่เลืà¸à¸à¹ƒà¸«à¹‰à¹€à¸›à¹‡à¸™à¹‚หนดลูà¸à¸‚à¸à¸‡à¹‚หนดที่เลืà¸à¸" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5274,6 +5309,10 @@ msgid "Generating Visibility Rect" msgstr "สร้างà¸à¸£à¸à¸šà¸à¸²à¸£à¸¡à¸à¸‡à¹€à¸«à¹‡à¸™" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "สร้างà¸à¸£à¸à¸šà¸à¸²à¸£à¸¡à¸à¸‡à¹€à¸«à¹‡à¸™" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "สามารถà¸à¸³à¸«à¸™à¸”จุดให้à¹à¸à¹ˆ ParticlesMaterial เท่านั้น" @@ -5286,10 +5325,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "รูปไม่มีพิà¸à¹€à¸‹à¸¥à¹ƒà¸”ที่ความโปร่งà¹à¸ªà¸‡ > 128 ..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "สร้างà¸à¸£à¸à¸šà¸à¸²à¸£à¸¡à¸à¸‡à¹€à¸«à¹‡à¸™" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "โหลด Mask à¸à¸²à¸£à¸›à¸°à¸—ุ" @@ -5378,13 +5413,13 @@ msgid "Generating AABB" msgstr "สร้างเส้นà¸à¸£à¸à¸š" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "สร้างเส้นà¸à¸£à¸à¸š" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "สร้างเส้นà¸à¸£à¸à¸šà¸à¸²à¸£à¸¡à¸à¸‡à¹€à¸«à¹‡à¸™" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "สร้างเส้นà¸à¸£à¸à¸š" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "ลบจุดในเส้นโค้ง" @@ -7106,6 +7141,24 @@ msgid "Merge from Scene" msgstr "รวมจาà¸à¸‰à¸²à¸" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "ไปชั้นบน" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "ไปชั้นล่าง" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7267,6 +7320,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "ย้ายรูปหลายเหลี่ยม" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "ย้ายรูปหลายเหลี่ยม" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "ลบà¹à¸¡à¹ˆà¹à¸šà¸š" @@ -7403,6 +7466,11 @@ msgid "Exporting All" msgstr "ส่งà¸à¸à¸à¸ªà¸³à¸«à¸£à¸±à¸š %s" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "ไม่พบไฟล์" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "à¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸à¸à¸à¸ªà¸³à¸«à¸£à¸±à¸šà¹à¸žà¸¥à¸•à¸Ÿà¸à¸£à¹Œà¸¡à¸™à¸µà¹‰à¸ªà¸¹à¸à¸«à¸²à¸¢/เสียหาย:" @@ -10067,6 +10135,12 @@ msgid "" "shape resource for it!" msgstr "ต้à¸à¸‡à¸¡à¸µà¸£à¸¹à¸›à¸—รงเพื่à¸à¹ƒà¸«à¹‰ CollisionShape ทำงานได้ à¸à¸£à¸¸à¸“าสร้างรูปทรง!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp #, fuzzy msgid "Nothing is visible because no mesh has been assigned." @@ -10082,6 +10156,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "วางà¹à¸™à¸§ meshes" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "ต้à¸à¸‡à¸¡à¸µ NavigationMesh เพื่à¸à¹ƒà¸«à¹‰à¹‚หนดนี้ทำงานได้" @@ -10239,6 +10319,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "เพิ่มสีที่เลืà¸à¸à¹ƒà¸™à¸£à¸²à¸¢à¸à¸²à¸£à¹‚ปรด" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "à¹à¸ˆà¹‰à¸‡à¹€à¸•à¸·à¸à¸™!" @@ -10247,6 +10335,11 @@ msgstr "à¹à¸ˆà¹‰à¸‡à¹€à¸•à¸·à¸à¸™!" msgid "Please Confirm..." msgstr "à¸à¸£à¸¸à¸“ายืนยัน..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "ไปยังโฟลเดà¸à¸£à¹Œà¸«à¸¥à¸±à¸" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10331,6 +10424,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "à¸à¸´à¸™à¸ªà¹à¸•à¸™à¸‹à¹Œà¸‰à¸²à¸à¸—ี่เลืà¸à¸à¹ƒà¸«à¹‰à¹€à¸›à¹‡à¸™à¹‚หนดลูà¸à¸‚à¸à¸‡à¹‚หนดที่เลืà¸à¸" + #~ msgid "FPS" #~ msgstr "เฟรมต่à¸à¸§à¸´à¸™à¸²à¸—ี" diff --git a/editor/translations/tr.po b/editor/translations/tr.po index 8111bff345..9ce4725e9a 100644 --- a/editor/translations/tr.po +++ b/editor/translations/tr.po @@ -21,12 +21,13 @@ # OÄŸuzhan Özdemir <ozdemiroguzhan0@gmail.com>, 2018. # Alper Çitmen <alper.citmen@gmail.com>, 2019. # ege1212 <owlphp@gmail.com>, 2019. +# Ömer YAZICIOÄžLU <oyazicioglu@gmail.com>, 2019. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-13 07:10+0000\n" -"Last-Translator: ege1212 <owlphp@gmail.com>\n" +"PO-Revision-Date: 2019-03-08 15:04+0000\n" +"Last-Translator: Ömer YAZICIOÄžLU <oyazicioglu@gmail.com>\n" "Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/" "godot/tr/>\n" "Language: tr\n" @@ -34,7 +35,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.5-dev\n" +"X-Generator: Weblate 3.5.1-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -63,22 +64,20 @@ msgid "Invalid operands to operator %s, %s and %s." msgstr "%s düğümünde geçersiz indeks özelliÄŸi ismi '%s'." #: core/math/expression.cpp -#, fuzzy msgid "Invalid index of type %s for base type %s" -msgstr "%s düğümünde geçersiz indeks özelliÄŸi ismi '%s'." +msgstr "%s temel tipi için, %s tipinde geçersiz index." #: core/math/expression.cpp msgid "Invalid named index '%s' for base type %s" -msgstr "" +msgstr "%s temel tipi için, geçersiz isimlendirilmiÅŸ index %s" #: core/math/expression.cpp -#, fuzzy msgid "Invalid arguments to construct '%s'" -msgstr ": Åžu tür için geçersiz deÄŸiÅŸtirgen: " +msgstr "'%s' oluÅŸturulurken geçersiz argümanlar atandı." #: core/math/expression.cpp msgid "On call to '%s':" -msgstr "" +msgstr "'%s': çaÄŸrıldığında." #: editor/animation_bezier_editor.cpp #: editor/plugins/asset_library_editor_plugin.cpp @@ -147,9 +146,8 @@ msgid "Anim Change Call" msgstr "Animasyon DeÄŸiÅŸikliÄŸi ÇaÄŸrısı" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Animasyon Döngüsünü DeÄŸiÅŸtir" +msgstr "Animasyon UzunluÄŸunu DeÄŸiÅŸtir" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -162,41 +160,36 @@ msgid "Property Track" msgstr "Özellik:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "3D Transform Track" -msgstr "Dönüştürme Türü" +msgstr "3D Dönüştürücü Ä°zi" #: editor/animation_track_editor.cpp msgid "Call Method Track" -msgstr "" +msgstr "Yöntem Çağırma Ä°zi" #: editor/animation_track_editor.cpp msgid "Bezier Curve Track" -msgstr "" +msgstr "Bezier EÄŸri Ä°zi" #: editor/animation_track_editor.cpp msgid "Audio Playback Track" -msgstr "" +msgstr "Ses Oynatıcı Ä°zi" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation Playback Track" -msgstr "Animasyonu oynatmayı durdur. (S)" +msgstr "Animasyon Oynatıcı Ä°zi" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track" -msgstr "Animasyon Ä°z Ekle" +msgstr "Ä°z Ekle" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation Length Time (seconds)" -msgstr "Animasyon uzunluÄŸu (saniye)." +msgstr "Animasyon UzunluÄŸu (saniye)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation Looping" -msgstr "Animasyon yaklaÅŸ." +msgstr "Animasyon Döngüsü" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -204,52 +197,44 @@ msgid "Functions:" msgstr "Ä°ÅŸlevler:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Audio Clips:" -msgstr "Ses Dinleyici" +msgstr "Ses Klipsi:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Anim Clips:" -msgstr "Parçalar" +msgstr "Animasyon Klipsleri:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Dizi DeÄŸerini DeÄŸiÅŸtir" +msgstr "Ä°z Yolunu DeÄŸiÅŸtir" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle this track on/off." -msgstr "Dikkat-Dağıtmayan Kipine geç." +msgstr "Bu izi Aç/Kapat." #: editor/animation_track_editor.cpp msgid "Update Mode (How this property is set)" -msgstr "" +msgstr "Güncelleme Kipi (Bu özellik nasıl belirlenir)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Interpolation Mode" -msgstr "Animasyon Düğümü" +msgstr "AradeÄŸerleme Kipi" #: editor/animation_track_editor.cpp msgid "Loop Wrap Mode (Interpolate end with beginning on loop)" -msgstr "" +msgstr "Döngü Örtü Kipi (Döngünün baÅŸlangıcını sonu ile aradeÄŸerle)" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Remove this track." -msgstr "Seçilen izleri sil." +msgstr "Bu izi sil." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Time (s): " -msgstr "X-Sönülme Süresi (sn):" +msgstr "Süresi (sn): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "ÇoÄŸaltıcı Aktif" +msgstr "Ä°z Dönüştürücü Etkin" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -264,13 +249,12 @@ msgid "Trigger" msgstr "Tetikleyici" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Capture" -msgstr "Özellikler" +msgstr "Yakala" #: editor/animation_track_editor.cpp msgid "Nearest" -msgstr "" +msgstr "En Yakın" #: editor/animation_track_editor.cpp editor/plugins/curve_editor_plugin.cpp #: editor/property_editor.cpp @@ -279,15 +263,15 @@ msgstr "DoÄŸrusal" #: editor/animation_track_editor.cpp msgid "Cubic" -msgstr "" +msgstr "Kübik" #: editor/animation_track_editor.cpp msgid "Clamp Loop Interp" -msgstr "" +msgstr "Döngü AradeÄŸerlemesini Kıskaçla" #: editor/animation_track_editor.cpp msgid "Wrap Loop Interp" -msgstr "" +msgstr "Döngü AradeÄŸerlemesin Sar" #: editor/animation_track_editor.cpp #: editor/plugins/canvas_item_editor_plugin.cpp @@ -305,19 +289,16 @@ msgid "Delete Key(s)" msgstr "Düğümleri Sil" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Animasyonun Adını DeÄŸiÅŸtir:" +msgstr "Animasyonun Güncelleme Kipini DeÄŸiÅŸtir" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Animasyon Düğümü" +msgstr "Animasyon AradeÄŸerleme Kipini DeÄŸiÅŸtir" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Animasyon Döngüsünü DeÄŸiÅŸtir" +msgstr "Animasyon Döngü Kipini DeÄŸiÅŸtir" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -347,6 +328,7 @@ msgstr "Animasyon Gir" #: editor/animation_track_editor.cpp msgid "AnimationPlayer can't animate itself, only other players." msgstr "" +"Animasyon Oynatıcısı kendisini oynatamaz, sadece diÄŸer oynatıcılar yapabilir." #: editor/animation_track_editor.cpp msgid "Anim Create & Insert" @@ -366,9 +348,8 @@ msgid "Change Animation Step" msgstr "Animasyon FPS'sini DeÄŸiÅŸtir" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "KendindenYüklenme'leri Yeniden Sırala" +msgstr "Ä°zleri Yeniden Sırala" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -381,69 +362,68 @@ msgid "" "-AudioStreamPlayer2D\n" "-AudioStreamPlayer3D" msgstr "" +"Ses izleri sadece ÅŸu düğüm tiplerini iÅŸaret edebilir:\n" +"-SesAkışOynatıcı\n" +"-SesAkışOynatıcı2D\n" +"-SesAkışOynatıcı3D" #: editor/animation_track_editor.cpp msgid "Animation tracks can only point to AnimationPlayer nodes." -msgstr "" +msgstr "Animasyon izleri sadece AnimasyonOynatıcı düğümlerini iÅŸaret edebilir." #: editor/animation_track_editor.cpp msgid "An animation player can't animate itself, only other players." msgstr "" +"Bir animasyon oynatıcı kendisini oynamataz, sadece diÄŸer oynatıcılar " +"yapaibilir." #: editor/animation_track_editor.cpp msgid "Not possible to add a new track without a root" -msgstr "" +msgstr "Bir kök olmadan yeni bir iz eklemek mümkün deÄŸildir" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Animasyon Ä°z Ekle" +msgstr "Bezier Ä°z Ekle" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." -msgstr "" +msgstr "Bu yol geçersizdir, dolayısı ile anahtar eklenemez." #: editor/animation_track_editor.cpp msgid "Track is not of type Spatial, can't insert key" -msgstr "" +msgstr "Ä°z, Spatial tipinde deÄŸildir, anahtar eklenemez" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Dönüştürme Türü" +msgstr "Dönüştürme Ä°z Anahtarı Ekle" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Animasyon Ä°z Ekle" +msgstr "Ä°z Anahtarı Ekle" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." -msgstr "" +msgstr "Ä°z yolu geçersizdir, dolayısı ile yöntem anahtarı eklenemez." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Animasyon Ä°z & Anahtar Gir" +msgstr "Yöntem Ä°z Anahtarı Ekle" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Method not found in object: " -msgstr "VariableGet betikte bulunamadı: " +msgstr "Yöntem, nesne içinde bulunamadı " #: editor/animation_track_editor.cpp msgid "Anim Move Keys" msgstr "Animasyon Anahtarları Taşı" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Clipboard is empty" -msgstr "Pano boÅŸ!" +msgstr "Pano boÅŸ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Paste Tracks" -msgstr "Parametreleri Yapıştır" +msgstr "Ä°zleri Yapıştır" #: editor/animation_track_editor.cpp msgid "Anim Scale Keys" @@ -453,14 +433,15 @@ msgstr "Animasyon Anahtarı Ölçekle" msgid "" "This option does not work for Bezier editing, as it's only a single track." msgstr "" +"Bu seçenek yalnızca tek izli olduÄŸundan, Bezier düzenlemede iÅŸe yaramaz." #: editor/animation_track_editor.cpp msgid "Only show tracks from nodes selected in tree." -msgstr "" +msgstr "sadece aÄŸaç'ta seçili düğümlerdeki izleri göster." #: editor/animation_track_editor.cpp msgid "Group tracks by node or display them as plain list." -msgstr "" +msgstr "Ä°zleri düğüme göre grupla veya onları düz liste olarak göster." #: editor/animation_track_editor.cpp #, fuzzy @@ -468,9 +449,8 @@ msgid "Snap (s): " msgstr "Yapış (Noktalara):" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation step value." -msgstr "Animasyon aÄŸacı geçerlidir." +msgstr "Animasyon adım deÄŸeri." #: editor/animation_track_editor.cpp editor/editor_properties.cpp #: editor/plugins/polygon_2d_editor_plugin.cpp @@ -482,14 +462,12 @@ msgid "Edit" msgstr "Düzenle" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Animation properties." -msgstr "AnimasyonAÄŸacı" +msgstr "Animasyon özellikleri." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Copy Tracks" -msgstr "DeÄŸiÅŸkenleri Tıpkıla" +msgstr "Ä°zleri Kopyala" #: editor/animation_track_editor.cpp msgid "Scale Selection" @@ -532,11 +510,11 @@ msgstr "Animasyonda temizlik yap" #: editor/animation_track_editor.cpp msgid "Pick the node that will be animated:" -msgstr "" +msgstr "Anime edilecek düğümü seç:" #: editor/animation_track_editor.cpp msgid "Use Bezier Curves" -msgstr "" +msgstr "Bezier EÄŸrileri Kullan" #: editor/animation_track_editor.cpp msgid "Anim. Optimizer" @@ -584,7 +562,7 @@ msgstr "Ölçek Oranı:" #: editor/animation_track_editor.cpp msgid "Select tracks to copy:" -msgstr "" +msgstr "Kopyalanacak izleri seç:" #: editor/animation_track_editor.cpp editor/editor_properties.cpp #: editor/plugins/animation_player_editor_plugin.cpp @@ -595,17 +573,16 @@ msgid "Copy" msgstr "Tıpkıla" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Ses Dinleyici" +msgstr "Ses Ä°z Klipsi Ekle" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Ses Ä°z Klipsi BaÅŸlangıç Kaymasını DeÄŸiÅŸtir" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Ses Ä°z Klipsi BitiÅŸ Kaymasını DeÄŸiÅŸtir" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -677,7 +654,7 @@ msgstr "Uyarılar" #: editor/code_editor.cpp msgid "Line and column numbers." -msgstr "" +msgstr "Satır ve sütun numaraları." #: editor/connections_dialog.cpp msgid "Method in target Node must be specified!" @@ -761,9 +738,8 @@ msgid "Disconnect '%s' from '%s'" msgstr "Åžunun: '%s' ÅŸununla: '%s' baÄŸlantısını kes" #: editor/connections_dialog.cpp -#, fuzzy msgid "Disconnect all from signal: '%s'" -msgstr "Åžunun: '%s' ÅŸununla: '%s' baÄŸlantısını kes" +msgstr "'%s' sinyali ile tüm baÄŸlantıları kes" #: editor/connections_dialog.cpp msgid "Connect..." @@ -777,17 +753,17 @@ msgstr "BaÄŸlantıyı kes" #: editor/connections_dialog.cpp #, fuzzy msgid "Connect Signal: " -msgstr "BaÄŸlantı Sinyali:" +msgstr "BaÄŸlantı Sinyali: " #: editor/connections_dialog.cpp #, fuzzy msgid "Edit Connection: " -msgstr "BaÄŸlantıları Düzenle" +msgstr "BaÄŸlantıları Düzenle " #: editor/connections_dialog.cpp -#, fuzzy msgid "Are you sure you want to remove all connections from the \"%s\" signal?" -msgstr "Birden fazla projeyi çalıştırmaya kararlı mısınız?" +msgstr "" +"\"%s\" sinyalinden tüm baÄŸlantıları kaldırmak istediÄŸinizden emin misiniz?" #: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp msgid "Signals" @@ -795,12 +771,11 @@ msgstr "Sinyaller" #: editor/connections_dialog.cpp msgid "Are you sure you want to remove all connections from this signal?" -msgstr "" +msgstr "Bu sinyalden, tüm baÄŸlantıları kaldırmak istediÄŸinizden emin misiniz?" #: editor/connections_dialog.cpp -#, fuzzy msgid "Disconnect All" -msgstr "BaÄŸlantıyı kes" +msgstr "Tüm BaÄŸlantıları Kes" #: editor/connections_dialog.cpp #, fuzzy @@ -808,13 +783,12 @@ msgid "Edit..." msgstr "Düzenle" #: editor/connections_dialog.cpp -#, fuzzy msgid "Go To Method" -msgstr "Metotlar" +msgstr "Yönteme Git" #: editor/create_dialog.cpp msgid "Change %s Type" -msgstr "%s Tipini deÄŸiÅŸtir" +msgstr "%s Tipini DeÄŸiÅŸtir" #: editor/create_dialog.cpp editor/project_settings_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -823,7 +797,7 @@ msgstr "DeÄŸiÅŸtir" #: editor/create_dialog.cpp msgid "Create New %s" -msgstr "Yeni %s oluÅŸtur" +msgstr "Yeni %s OluÅŸtur" #: editor/create_dialog.cpp editor/editor_file_dialog.cpp #: editor/filesystem_dock.cpp @@ -957,7 +931,7 @@ msgstr "Hangi eylem alınmalı?" #: editor/dependency_editor.cpp msgid "Fix Dependencies" -msgstr "Bağımlılıkları düzelt" +msgstr "Bağımlılıkları Düzelt" #: editor/dependency_editor.cpp msgid "Errors loading!" @@ -1096,7 +1070,6 @@ msgid "Uncompressing Assets" msgstr "Varlıklar Çıkartılıyor" #: editor/editor_asset_installer.cpp editor/project_manager.cpp -#, fuzzy msgid "Package installed successfully!" msgstr "Paket BaÅŸarı ile Kuruldu!" @@ -1426,8 +1399,22 @@ msgstr "Çıkınla" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1480,7 +1467,7 @@ msgstr "Dosya Yöneticisinde Göster" msgid "New Folder..." msgstr "Yeni Klasör..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Yenile" @@ -1555,10 +1542,35 @@ msgstr "BeÄŸenileni Yukarı Taşı" msgid "Move Favorite Down" msgstr "BeÄŸenileni AÅŸağı Taşı" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "Önceki Zemin" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Sonraki Zemin" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Ãœst klasöre git" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Klasör oluÅŸturulamadı." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a grid of thumbnails." +msgstr "Öğeleri küçük resim ızgarası ÅŸeklinde göster" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +#, fuzzy +msgid "View items as a list." +msgstr "Öğeleri liste olarak göster" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Dizinler & Dosyalar:" @@ -1799,9 +1811,9 @@ msgstr "Çıktıyı Temizle" msgid "Project export failed with error code %d." msgstr "Proje dışa aktarımı %d hata koduyla baÅŸarısız." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Kaynak kaydedilirken hata!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1809,6 +1821,16 @@ msgid "OK" msgstr "Tamam" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Kaynak kaydedilirken hata!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Kaynağı Farklı Kaydet..." @@ -3132,16 +3154,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "Gidilemiyor. '%s' bu dosya sisteminde bulunamadı!" #: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a grid of thumbnails." -msgstr "Öğeleri küçük resim ızgarası ÅŸeklinde göster" - -#: editor/filesystem_dock.cpp -#, fuzzy -msgid "View items as a list." -msgstr "Öğeleri liste olarak göster" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "Durum: Dosya içe aktarma baÅŸarısız oldu. Lütfen dosyayı onarın ve tekrar içe " @@ -3287,10 +3299,6 @@ msgid "Search files" msgstr "Sınıfları Ara" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Seçilen sahneyi/sahneleri seçilen düğüme çocuk olarak örneklendir." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5340,6 +5348,10 @@ msgid "Generating Visibility Rect" msgstr "Görünebilirlik Dikdörtgeni Ãœret" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Görünebilirlik Dikdörtgeni Ãœret" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "Nokta sadece ParçacıkMateryal iÅŸlem materyalinin içinde ayarlanabilir" @@ -5352,10 +5364,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Saydamlığı olan nokta yok > 128 bedizde..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Görünebilirlik Dikdörtgeni Ãœret" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Yayma Maskesini Yükle" @@ -5444,13 +5452,13 @@ msgid "Generating AABB" msgstr "AABB Ãœretimi" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "AABB Ãœret" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "Görünebilirlik AABB'si Ãœret" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "AABB Ãœret" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "Noktayı EÄŸriden Kaldır" @@ -7169,6 +7177,24 @@ msgid "Merge from Scene" msgstr "Sahneden BirleÅŸtir" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "Sonraki Zemin" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "Önceki Zemin" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7332,6 +7358,16 @@ msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy +msgid "Make Polygon Concave" +msgstr "Çokgeni Taşı" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Çokgeni Taşı" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy msgid "Remove Tile" msgstr "Åžablonu Kaldır" @@ -7467,6 +7503,11 @@ msgid "Exporting All" msgstr "%s için Dışa Aktarım" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "Yol mevcut deÄŸil." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "Bu platform için dışa aktarma ÅŸablonu eksik/bozuk:" @@ -10186,6 +10227,12 @@ msgstr "" "CollisionShape'in çalışması için bir ÅŸekil verilmelidir. Lütfen bunun için " "bir ÅŸekil kaynağı oluÅŸturun!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp #, fuzzy msgid "Nothing is visible because no mesh has been assigned." @@ -10202,6 +10249,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "Örüntüler Haritalanıyor" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10376,6 +10429,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "Åžuanki rengi bir önayar olarak kaydet" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Uyarı!" @@ -10384,6 +10445,11 @@ msgstr "Uyarı!" msgid "Please Confirm..." msgstr "Lütfen DoÄŸrulayın..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Ãœst klasöre git" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10470,6 +10536,9 @@ msgstr "" msgid "Varyings can only be assigned in vertex function." msgstr "" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Seçilen sahneyi/sahneleri seçilen düğüme çocuk olarak örneklendir." + #~ msgid "FPS" #~ msgstr "FPS" diff --git a/editor/translations/uk.po b/editor/translations/uk.po index 944fa20e28..93f72238a2 100644 --- a/editor/translations/uk.po +++ b/editor/translations/uk.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-02-21 21:18+0000\n" +"PO-Revision-Date: 2019-03-12 15:26+0000\n" "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot/uk/>\n" @@ -23,9 +23,9 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 3.5-dev\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=" +"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.5.1\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -94,14 +94,12 @@ msgid "Delete Selected Key(s)" msgstr "Вилучити позначені ключі" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Add Bezier Point" -msgstr "Додати точку" +msgstr "Додати точку Безьє" #: editor/animation_bezier_editor.cpp -#, fuzzy msgid "Move Bezier Points" -msgstr "ПереміÑтити точки" +msgstr "ПереміÑтити точки Безьє" #: editor/animation_bezier_editor.cpp editor/animation_track_editor.cpp msgid "Anim Duplicate Keys" @@ -132,9 +130,8 @@ msgid "Anim Change Call" msgstr "Змінити виклик анімації" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Length" -msgstr "Змінити цикл анімації" +msgstr "Змінити триваліÑÑ‚ÑŒ анімації" #: editor/animation_track_editor.cpp #: editor/plugins/sprite_frames_editor_plugin.cpp @@ -191,9 +188,8 @@ msgid "Anim Clips:" msgstr "Кліпи анімації:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Track Path" -msgstr "Змінити Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñиву" +msgstr "Змінити шлÑÑ… доріжки" #: editor/animation_track_editor.cpp msgid "Toggle this track on/off." @@ -220,9 +216,8 @@ msgid "Time (s): " msgstr "Ð§Ð°Ñ (Ñ): " #: editor/animation_track_editor.cpp -#, fuzzy msgid "Toggle Track Enabled" -msgstr "Ефект Доплера" +msgstr "Увімкнути/Вимкнути доріжку" #: editor/animation_track_editor.cpp msgid "Continuous" @@ -275,19 +270,16 @@ msgid "Delete Key(s)" msgstr "Вилучити ключі" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Update Mode" -msgstr "Змінити ім'Ñ Ð°Ð½Ñ–Ð¼Ð°Ñ†Ñ–Ñ—:" +msgstr "Змінити режим Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ Ð°Ð½Ñ–Ð¼Ð°Ñ†Ñ–Ñ—" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Interpolation Mode" -msgstr "Режим інтерполÑції" +msgstr "Змінити режим інтерполÑції анімації" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Loop Mode" -msgstr "Змінити цикл анімації" +msgstr "Змінити режим циклу анімації" #: editor/animation_track_editor.cpp msgid "Remove Anim Track" @@ -331,14 +323,12 @@ msgid "Anim Insert Key" msgstr "Ð’Ñтавити ключ анімації" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Change Animation Step" -msgstr "Змінити чаÑтоту кадрів анімації" +msgstr "Змінити крок анімації" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rearrange Tracks" -msgstr "Змінити порÑдок автозавантажень" +msgstr "ПеревпорÑдкувати доріжки" #: editor/animation_track_editor.cpp msgid "Transform tracks only apply to Spatial-based nodes." @@ -371,9 +361,8 @@ msgid "Not possible to add a new track without a root" msgstr "Ðе можна додавати нові доріжки без кореневого запиÑу" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Bezier Track" -msgstr "Додати доріжку" +msgstr "Додати доріжку Безьє" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a key." @@ -384,23 +373,20 @@ msgid "Track is not of type Spatial, can't insert key" msgstr "Доріжка не належить до типу Spatial, не можна вÑтавлÑти ключ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Transform Track Key" -msgstr "Доріжка проÑторового перетвореннÑ" +msgstr "Додати ключ доріжки перетвореннÑ" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Track Key" -msgstr "Додати доріжку" +msgstr "Додати ключ доріжки" #: editor/animation_track_editor.cpp msgid "Track path is invalid, so can't add a method key." msgstr "ШлÑÑ… доріжки Ñ” некоректним, отже не можна додавати ключ методу." #: editor/animation_track_editor.cpp -#, fuzzy msgid "Add Method Track Key" -msgstr "Доріжка виклику методів" +msgstr "Додати ключ доріжки методів" #: editor/animation_track_editor.cpp msgid "Method not found in object: " @@ -564,17 +550,16 @@ msgid "Copy" msgstr "Копіювати" #: editor/animation_track_editor_plugins.cpp -#, fuzzy msgid "Add Audio Track Clip" -msgstr "Звукові кліпи:" +msgstr "Додати кліп звукової доріжки" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip Start Offset" -msgstr "" +msgstr "Змінити зÑув початку кліпу звукової доріжки" #: editor/animation_track_editor_plugins.cpp msgid "Change Audio Track Clip End Offset" -msgstr "" +msgstr "Змінити зÑув ÐºÑ–Ð½Ñ†Ñ ÐºÐ»Ñ–Ð¿Ñƒ звукової доріжки" #: editor/array_property_edit.cpp msgid "Resize Array" @@ -1387,9 +1372,30 @@ msgstr "ПакуваннÑ" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." msgstr "" +"Платформа Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ‚Ñ€ÐµÐ±ÑƒÑ” ÑтиÑÐºÐ°Ð½Ð½Ñ Ñ‚ÐµÐºÑтур «ETC» Ð´Ð»Ñ GLES2. Увімкніть " +"пункт «Імпортувати ETC» у параметрах проекту." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" +"Платформа Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ‚Ñ€ÐµÐ±ÑƒÑ” ÑтиÑÐºÐ°Ð½Ð½Ñ Ñ‚ÐµÐºÑтур «ETC2» Ð´Ð»Ñ GLES3. Увімкніть " +"пункт «Імпортувати ETC 2» у параметрах проекту." + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." +msgstr "" +"Платформа Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ñ‚Ñ€ÐµÐ±ÑƒÑ” ÑтиÑÐºÐ°Ð½Ð½Ñ Ñ‚ÐµÐºÑтур «ETC» Ð´Ð»Ñ GLES2.\n" +"Увімкніть пункт «Імпортувати ETC» у параметрах проекту або вимкніть пункт «" +"Увімкнено резервні драйвери»." #: editor/editor_export.cpp platform/android/export/export.cpp #: platform/iphone/export/export.cpp platform/javascript/export/export.cpp @@ -1436,7 +1442,7 @@ msgstr "Показати у менеджері файлів" msgid "New Folder..." msgstr "Створити теку..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Оновити" @@ -1511,10 +1517,30 @@ msgstr "ПереміÑтити вибране вгору" msgid "Move Favorite Down" msgstr "ПереміÑтити вибране вниз" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð½Ñ Ñ‚ÐµÐºÐ°" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "ÐаÑтупна тека" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "Перейти до батьківÑької теки" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "Перемкнути Ñтан вибраноÑÑ‚Ñ– Ð´Ð»Ñ Ð¿Ð¾Ñ‚Ð¾Ñ‡Ð½Ð¾Ñ— теки." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "ПереглÑд елементів у виглÑді Ñітки еÑкізів." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "ПереглÑд елементів Ñк ÑпиÑок." + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Каталоги та файли:" @@ -1737,9 +1763,9 @@ msgstr "ОчиÑтити вивід" msgid "Project export failed with error code %d." msgstr "Ðе вдалоÑÑ ÐµÐºÑпортувати проект, код помилки — %d." -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "Помилка Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ñ€ÐµÑурÑу!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "Ðеможливо зберегти імпортовані реÑурÑи." #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1747,6 +1773,18 @@ msgid "OK" msgstr "Гаразд" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "Помилка Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ñ€ÐµÑурÑу!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" +"Цей реÑÑƒÑ€Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ð¾ зберегти, оÑкільки він не належить до редагованої " +"Ñцени. Спочатку, зробіть його унікальним." + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "Зберегти реÑÑƒÑ€Ñ Ñк..." @@ -1967,13 +2005,12 @@ msgid "Save changes to '%s' before closing?" msgstr "Зберегти зміни, внеÑені до '%s' перед закриттÑм?" #: editor/editor_node.cpp -#, fuzzy msgid "Saved %s modified resource(s)." -msgstr "Ðе вдалоÑÑ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶Ð¸Ñ‚Ð¸ реÑурÑ." +msgstr "Збережено змінених реÑурÑів: %s." #: editor/editor_node.cpp msgid "A root node is required to save the scene." -msgstr "" +msgstr "Ð”Ð»Ñ Ñ‚Ð¾Ð³Ð¾, щоб можна було зберегти Ñцену, потрібен кореневий вузол." #: editor/editor_node.cpp msgid "Save Scene As..." @@ -3065,14 +3102,6 @@ msgstr "" "Ðеможливо перейти до '%s' , оÑкільки він не був знайдений в файловій ÑиÑтемі!" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "ПереглÑд елементів у виглÑді Ñітки еÑкізів." - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "ПереглÑд елементів Ñк ÑпиÑок." - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" "СтатуÑ: не вдалоÑÑ Ñ–Ð¼Ð¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ñ‚Ð¸ файл. Будь лаÑка, виправте файл та повторно " @@ -3210,10 +3239,6 @@ msgid "Search files" msgstr "Шукати файли" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "Додати вибрану Ñцену(и), Ñк нащадка вибраного вузла." - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -3614,19 +3639,16 @@ msgstr "Завантажити…" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Move Node Point" -msgstr "ПереміÑтити точки" +msgstr "ПереÑунути вузлову точку" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Limits" -msgstr "Змінити Ñ‡Ð°Ñ Ð·Ð¼Ñ–ÑˆÑƒÐ²Ð°Ð½Ð½Ñ" +msgstr "Змінити Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Change BlendSpace1D Labels" -msgstr "Змінити Ñ‡Ð°Ñ Ð·Ð¼Ñ–ÑˆÑƒÐ²Ð°Ð½Ð½Ñ" +msgstr "Змінити мітки BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3638,24 +3660,21 @@ msgstr "" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Node Point" -msgstr "Додати вузол" +msgstr "Додати вузлову точку" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Animation Point" -msgstr "Ð”Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð°Ð½Ñ–Ð¼Ð°Ñ†Ñ–Ñ—" +msgstr "Додати точку анімації" #: editor/plugins/animation_blend_space_1d_editor.cpp -#, fuzzy msgid "Remove BlendSpace1D Point" -msgstr "Видалити точку шлÑху" +msgstr "Вилучити точку BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp msgid "Move BlendSpace1D Node Point" -msgstr "" +msgstr "ПереÑунути вузлову точку BlendSpace1D" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp @@ -3703,29 +3722,24 @@ msgid "Triangle already exists" msgstr "Трикутник вже Ñ–Ñнує" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Add Triangle" -msgstr "Додати змінну" +msgstr "Додати трикутник" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Limits" -msgstr "Змінити Ñ‡Ð°Ñ Ð·Ð¼Ñ–ÑˆÑƒÐ²Ð°Ð½Ð½Ñ" +msgstr "Змінити Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Change BlendSpace2D Labels" -msgstr "Змінити Ñ‡Ð°Ñ Ð·Ð¼Ñ–ÑˆÑƒÐ²Ð°Ð½Ð½Ñ" +msgstr "Змінити мітки BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Point" -msgstr "Видалити точку шлÑху" +msgstr "Вилучити точку BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Remove BlendSpace2D Triangle" -msgstr "Вилучити змінну" +msgstr "Вилучити трикутник BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." @@ -3736,9 +3750,8 @@ msgid "No triangles exist, so no blending can take place." msgstr "Трикутників не Ñ–Ñнує, отже Ð·Ð»Ð¸Ñ‚Ñ‚Ñ Ð½Ðµ Ñ” можливим." #: editor/plugins/animation_blend_space_2d_editor.cpp -#, fuzzy msgid "Toggle Auto Triangles" -msgstr "Увімкнути Ð°Ð²Ñ‚Ð¾Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð³Ð»Ð¾Ð±Ð°Ð»ÑŒÐ½Ð¸Ñ… Ñкриптів" +msgstr "Увімкнути або вимкнути автоматичні трикутники" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." @@ -3758,9 +3771,8 @@ msgid "Blend:" msgstr "Змішувати:" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Parameter Changed" -msgstr "Зміни матеріалу" +msgstr "Змінено параметр" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -3772,15 +3784,13 @@ msgid "Output node can't be added to the blend tree." msgstr "Вузол Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð½Ðµ можна додавати до дерева злиттÑ." #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Add Node to BlendTree" -msgstr "Додати вузли з дерева" +msgstr "Додати вузол до BlendTree" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Node Moved" -msgstr "Режим переміщеннÑ" +msgstr "ПереÑунуто вузол" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -3791,36 +3801,30 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Connected" -msgstr "З’єднано" +msgstr "З’єднано вузли" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Nodes Disconnected" -msgstr "Роз'єднано" +msgstr "Роз'єднано вузли" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Set Animation" -msgstr "Ðова анімаціÑ" +msgstr "Ð’Ñтановити анімацію" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Delete Node" -msgstr "Вилучити вузли" +msgstr "Вилучити вузол" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Toggle Filter On/Off" -msgstr "Увімкнути або вимкнути цю доріжку." +msgstr "Увімкнути або вимкнути фільтр" #: editor/plugins/animation_blend_tree_editor_plugin.cpp -#, fuzzy msgid "Change Filter" -msgstr "Змінено фільтр локалі" +msgstr "Змінити фільтр" #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "No animation player set, so unable to retrieve track names." @@ -3844,9 +3848,8 @@ msgstr "" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Renamed" -msgstr "Ðазва вузла" +msgstr "Перейменовано вузол" #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/visual_shader_editor_plugin.cpp @@ -4075,14 +4078,12 @@ msgid "Cross-Animation Blend Times" msgstr "Ð§Ð°Ñ Ð¼Ñ–Ð¶ анімаціÑми" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Move Node" -msgstr "Режим переміщеннÑ" +msgstr "ПереÑунути вузол" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Add Transition" -msgstr "Додати переклад" +msgstr "Додати перехід" #: editor/plugins/animation_state_machine_editor.cpp #: modules/visual_script/visual_script_editor.cpp @@ -4118,18 +4119,16 @@ msgid "No playback resource set at path: %s." msgstr "Ðе вÑтановлено реÑурÑу Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñƒ шлÑху: %s." #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Node Removed" -msgstr "Вилучити" +msgstr "Вилучено вузол" #: editor/plugins/animation_state_machine_editor.cpp -#, fuzzy msgid "Transition Removed" -msgstr "Вузол переходу" +msgstr "Вилучено перехід" #: editor/plugins/animation_state_machine_editor.cpp msgid "Set Start Node (Autoplay)" -msgstr "" +msgstr "Ð’Ñтановити початковий вузол (автовідтвореннÑ)" #: editor/plugins/animation_state_machine_editor.cpp msgid "" @@ -4955,7 +4954,7 @@ msgstr "Запекти пробу GI" #: editor/plugins/gradient_editor_plugin.cpp msgid "Gradient Edited" -msgstr "" +msgstr "Змінено градієнт" #: editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" @@ -5213,6 +5212,10 @@ msgid "Generating Visibility Rect" msgstr "Ð¡Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð¾Ð±Ð»Ð°ÑÑ‚Ñ– видимоÑÑ‚Ñ–" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "Створити облаÑÑ‚ÑŒ видимоÑÑ‚Ñ–" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "" "ПоÑтавити точку можна тільки в процедурному матеріалі ParticlesMaterial" @@ -5226,10 +5229,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "Ð’ зображенні немає пікÑелів з прозоріÑÑ‚ÑŽ > 128..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "Створити облаÑÑ‚ÑŒ видимоÑÑ‚Ñ–" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "Завантажити маÑку випромінюваннÑ" @@ -5317,11 +5316,11 @@ msgid "Generating AABB" msgstr "Ð¡Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "Генерувати AABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "Генерувати AABB" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6104,14 +6103,12 @@ msgid "This skeleton has no bones, create some children Bone2D nodes." msgstr "У цього каркаÑа немає кіÑток, Ñтворіть хоч ÑкіÑÑŒ дочірні вузли Bone2D." #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Create Rest Pose from Bones" -msgstr "Створити вільну позу (з кіÑток)" +msgstr "Створити вільну позу з кіÑток" #: editor/plugins/skeleton_2d_editor_plugin.cpp -#, fuzzy msgid "Set Rest Pose to Bones" -msgstr "Створити вільну позу (з кіÑток)" +msgstr "Створити вільну позу Ð´Ð»Ñ ÐºÑ–Ñток" #: editor/plugins/skeleton_2d_editor_plugin.cpp msgid "Skeleton2D" @@ -6266,7 +6263,6 @@ msgid "Rear" msgstr "Ззаду" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align with View" msgstr "ВирівнÑти з переглÑдом" @@ -6363,6 +6359,9 @@ msgid "" "Note: The FPS value displayed is the editor's framerate.\n" "It cannot be used as a reliable indication of in-game performance." msgstr "" +"ЗауваженнÑ: показана чаÑтота кадрів Ñ” чаÑтотою кадрів у редакторі.\n" +"Її не можна викориÑтовувати Ñк надійне джерело даних щодо чаÑтоти кадрів у " +"грі." #: editor/plugins/spatial_editor_plugin.cpp msgid "View Rotation Locked" @@ -6373,9 +6372,8 @@ msgid "XForm Dialog" msgstr "Вікно XForm" #: editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Snap Nodes To Floor" -msgstr "Приліпити до підлоги" +msgstr "Приліпити вузли до підлоги" #: editor/plugins/spatial_editor_plugin.cpp msgid "Select Mode (Q)" @@ -6972,6 +6970,22 @@ msgid "Merge from Scene" msgstr "Об'єднати зі Ñцени" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "ÐаÑтупна координата" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "Вибір наÑтупної форми, підплитки або плитки." + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð½Ñ ÐºÐ¾Ð¾Ñ€Ð´Ð¸Ð½Ð°Ñ‚Ð°" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "Вибір попередньої форми, підплитки або плитки." + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "Копіювати бітову маÑку." @@ -6984,9 +6998,8 @@ msgid "Erase bitmask." msgstr "Витерти бітову маÑку." #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Create a new rectangle." -msgstr "Створити вузли." +msgstr "Створити прÑмокутник." #: editor/plugins/tile_set_editor_plugin.cpp msgid "Create a new polygon." @@ -7130,6 +7143,14 @@ msgid "Clear Tile Bitmask" msgstr "Спорожнити бітову маÑку плитки" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "Зробити полігон увігнутим" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Convex" +msgstr "Зробити полігон опуклим" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "Вилучити плитку" @@ -7171,26 +7192,23 @@ msgstr "Ðабір плиток" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Set Uniform Name" -msgstr "" +msgstr "Ð’Ñтановити однорідну назву" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Set Input Default Port" -msgstr "Ð’Ñтановити Ñк типове Ð´Ð»Ñ '%s'" +msgstr "Ð’Ñтановити типовий порт введеннÑ" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Add Node to Visual Shader" -msgstr "VisualShader" +msgstr "Додати вузол до візуального шейдера" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Duplicate Nodes" msgstr "Дублювати вузли" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Visual Shader Input Type Changed" -msgstr "" +msgstr "Змінено тип Ð²Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ð²Ñ–Ð·ÑƒÐ°Ð»ÑŒÐ½Ð¾Ð³Ð¾ шейдера" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Vertex" @@ -7209,14 +7227,12 @@ msgid "VisualShader" msgstr "VisualShader" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Edit Visual Property" -msgstr "Редагувати пріоритетніÑÑ‚ÑŒ плитки" +msgstr "Змінити візуальну влаÑтивіÑÑ‚ÑŒ" #: editor/plugins/visual_shader_editor_plugin.cpp -#, fuzzy msgid "Visual Shader Mode Changed" -msgstr "Зміни шейдерів" +msgstr "Змінено режим візуального шейдерів" #: editor/project_export.cpp msgid "Runnable" @@ -7235,6 +7251,8 @@ msgid "" "Failed to export the project for platform '%s'.\n" "Export templates seem to be missing or invalid." msgstr "" +"Ðе вдалоÑÑ ÐµÐºÑпортувати проект Ð´Ð»Ñ Ð¿Ð»Ð°Ñ‚Ñ„Ð¾Ñ€Ð¼Ð¸ «%s».\n" +"ЗдаєтьÑÑ, шаблони екÑÐ¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¾Ð¿ÑƒÑ‰ÐµÐ½Ð¾ або вони Ñ” некоректними." #: editor/project_export.cpp msgid "" @@ -7242,6 +7260,9 @@ msgid "" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" +"Ðе вдалоÑÑ ÐµÐºÑпортувати проект Ð´Ð»Ñ Ð¿Ð»Ð°Ñ‚Ñ„Ð¾Ñ€Ð¼Ð¸ «%s».\n" +"Причиною може бути помилка у налаштуваннÑÑ… у наборі налаштувань Ð´Ð»Ñ " +"екÑÐ¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð°Ð±Ð¾ параметрах екÑпортуваннÑ." #: editor/project_export.cpp msgid "Release" @@ -7252,6 +7273,10 @@ msgid "Exporting All" msgstr "ЕкÑÐ¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ ÑƒÑього" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "Вказаного шлÑху Ð´Ð»Ñ ÐµÐºÑÐ¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ðµ Ñ–Ñнує:" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" "Ðе виÑтачає шаблонів екÑÐ¿Ð¾Ñ€Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð¿Ð»Ð°Ñ‚Ñ„Ð¾Ñ€Ð¼Ð¸ або шаблони пошкоджено:" @@ -7703,7 +7728,7 @@ msgid "" "'\"'" msgstr "" "Ðекоректна назва дії. Ðазва не може бути порожньою Ñ– не може міÑтити " -"Ñимволів «/», «:», «=», «\\» та «\"»." +"Ñимволів «/», «:», «=», «\\» та «\"»" #: editor/project_settings_editor.cpp msgid "Action '%s' already exists!" @@ -8295,9 +8320,8 @@ msgid "Instantiated scenes can't become root" msgstr "Сцени зі Ñтвореними екземплÑрами не можуть Ñтавати кореневими" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "Make node as Root" -msgstr "Зробити кореневим Ð´Ð»Ñ Ñцени" +msgstr "Зробити вузол кореневим" #: editor/scene_tree_dock.cpp msgid "Delete Node(s)?" @@ -8336,9 +8360,8 @@ msgid "Make Local" msgstr "Зробити локальним" #: editor/scene_tree_dock.cpp -#, fuzzy msgid "New Scene Root" -msgstr "Зробити кореневим Ð´Ð»Ñ Ñцени" +msgstr "Ðовий корінь Ñцени" #: editor/scene_tree_dock.cpp msgid "Create Root Node:" @@ -8769,19 +8792,16 @@ msgid "Set From Tree" msgstr "Ð’Ñтановити з дерева" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Erase Shortcut" -msgstr "Перейти з" +msgstr "Витерти ÑкороченнÑ" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Restore Shortcut" -msgstr "Клавіатурні ÑкороченнÑ" +msgstr "Відновити ÑкороченнÑ" #: editor/settings_config_dialog.cpp -#, fuzzy msgid "Change Shortcut" -msgstr "Змінити прив'Ñзки" +msgstr "Змінити ÑкороченнÑ" #: editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -8990,9 +9010,8 @@ msgid "GridMap Duplicate Selection" msgstr "Ð”ÑƒÐ±Ð»ÑŽÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¾Ð³Ð¾ GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp -#, fuzzy msgid "GridMap Paint" -msgstr "Параметри GridMap" +msgstr "Малюнок GridMap" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Grid Map" @@ -9379,9 +9398,8 @@ msgid "Change Input Value" msgstr "Зміна вхідного значеннÑ" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Resize Comment" -msgstr "Змінити розмір CanvasItem" +msgstr "Змінити розміри коментарÑ" #: modules/visual_script/visual_script_editor.cpp msgid "Can't copy the function node." @@ -9985,6 +10003,14 @@ msgstr "" "Ð”Ð»Ñ Ð·Ð°Ð±ÐµÐ·Ð¿ÐµÑ‡ÐµÐ½Ð½Ñ Ð¿Ñ€Ð°Ñ†ÐµÐ·Ð´Ð°Ñ‚Ð½Ð¾ÑÑ‚Ñ– CollisionShape Ñлід надати форму. Будь " "лаÑка, Ñтворіть реÑÑƒÑ€Ñ Ñ„Ð¾Ñ€Ð¼Ð¸ Ð´Ð»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ елемента!" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" +"Форми площин не працюють Ñк Ñлід, Ñ—Ñ… буде вилучено у наÑтупних верÑÑ–ÑÑ…. Будь " +"лаÑка, не викориÑтовуйте Ñ—Ñ…." + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "Ðічого не видно, оÑкільки не призначено Ñітки." @@ -10001,6 +10027,14 @@ msgstr "" msgid "Plotting Meshes" msgstr "Побудова Ñітки" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" +"У драйвері GLES2 не передбачено підтримки GIProbes.\n" +"СкориÑтайтеÑÑ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ них BakedLightmap." + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10175,6 +10209,18 @@ msgstr "ÐŸÐµÑ€ÐµÐ¼Ð¸ÐºÐ°Ð½Ð½Ñ Ð¼Ñ–Ð¶ шіÑтнадцÑтковими значРmsgid "Add current color as a preset." msgstr "Додати поточний колір Ñк шаблон." +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" +"Сам контейнер не має призначеннÑ, Ñкщо Ñкрипт не налаштовує поведінку щодо " +"Ñ€Ð¾Ð·Ñ‚Ð°ÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ð¹Ð¾Ð³Ð¾ дочірніх об'єктів.\n" +"Якщо ви не маєте наміру додавати Ñкрипт, будь лаÑка, ÑкориÑтайтеÑÑ Ð·Ð°Ð¼Ñ–ÑÑ‚ÑŒ " +"контейнера звичайним вузлом «Control»." + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Увага!" @@ -10183,6 +10229,10 @@ msgstr "Увага!" msgid "Please Confirm..." msgstr "Будь лаÑка, підтвердьте..." +#: scene/gui/file_dialog.cpp +msgid "Go to parent folder." +msgstr "Перейти до батьківÑької теки." + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10268,6 +10318,9 @@ msgstr "ÐŸÑ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¾Ð´Ð½Ð¾Ñ€Ñ–Ð´Ð½Ð¾Ð³Ð¾." msgid "Varyings can only be assigned in vertex function." msgstr "Змінні величини можна пов'Ñзувати лише із функцією вузлів." +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "Додати вибрану Ñцену(и), Ñк нащадка вибраного вузла." + #~ msgid "FPS" #~ msgstr "Кадри за Ñекунду" diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index f3367675ef..b2eec50780 100644 --- a/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po @@ -1351,8 +1351,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1401,7 +1415,7 @@ msgstr "" msgid "New Folder..." msgstr "" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "" @@ -1478,10 +1492,30 @@ msgstr "Ù¾Ø³Ù†Ø¯ÛŒØ¯Û Ø§ÙˆÙ¾Ø± منتقل کریں" msgid "Move Favorite Down" msgstr "Ù¾Ø³Ù†Ø¯ÛŒØ¯Û Ù†ÛŒÚ†Û’ منتقل کریں" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +msgid "Previous Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp +msgid "Next Folder" +msgstr "" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "" +#: editor/editor_file_dialog.cpp +msgid "(Un)favorite current folder." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "" @@ -1705,8 +1739,8 @@ msgstr "سب سکریپشن بنائیں" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1715,6 +1749,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -2957,14 +3001,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3102,10 +3138,6 @@ msgid "Search files" msgstr "" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5065,19 +5097,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5168,11 +5200,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6836,6 +6868,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "سب سکریپشن بنائیں" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Previous Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -6986,6 +7035,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "سب سکریپشن بنائیں" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr ".تمام کا انتخاب" @@ -7108,6 +7166,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9693,6 +9755,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9707,6 +9775,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9850,6 +9924,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "" @@ -9858,6 +9940,11 @@ msgstr "" msgid "Please Confirm..." msgstr "" +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "سب سکریپشن بنائیں" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/vi.po b/editor/translations/vi.po index f51007b85c..1bbec938f2 100644 --- a/editor/translations/vi.po +++ b/editor/translations/vi.po @@ -1385,8 +1385,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1437,7 +1451,7 @@ msgstr "Hiển thị trong Trình quản là file" msgid "New Folder..." msgstr "Folder Má»›i..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "Là m má»›i" @@ -1514,11 +1528,34 @@ msgstr "Di chuyển Ưa thÃch lên" msgid "Move Favorite Down" msgstr "Di chuyển Ưa thÃch xuống" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "ThÆ° mục trÆ°á»›c" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "Tạo Folder" + +#: editor/editor_file_dialog.cpp #, fuzzy msgid "Go to parent folder" msgstr "Äến folder parent" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "Không thể tạo folder." + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "Những địa chỉ & File:" @@ -1748,8 +1785,8 @@ msgstr "" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp @@ -1758,6 +1795,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "" @@ -3006,14 +3053,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3156,10 +3195,6 @@ msgid "Search files" msgstr "Tìm kiếm:" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5157,19 +5192,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5260,11 +5295,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -6934,6 +6969,23 @@ msgid "Merge from Scene" msgstr "Gá»™p từ Scene" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "ThÆ° mục trÆ°á»›c" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7085,6 +7137,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "Tạo" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "Xóa Template" @@ -7208,6 +7269,10 @@ msgid "Exporting All" msgstr "" #: editor/project_export.cpp +msgid "The given export path doesn't exist:" +msgstr "" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9791,6 +9856,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -9805,6 +9876,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -9949,6 +10026,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "Cảnh báo!" @@ -9957,6 +10042,11 @@ msgstr "Cảnh báo!" msgid "Please Confirm..." msgstr "Xin hãy xác nháºn..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "Äến folder parent" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index f4fa330de9..0a074c24e5 100644 --- a/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po @@ -1394,8 +1394,22 @@ msgstr "打包ä¸" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1443,7 +1457,7 @@ msgstr "在文件管ç†å™¨ä¸æ˜¾ç¤º" msgid "New Folder..." msgstr "新建文件夹 ..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "刷新" @@ -1518,10 +1532,33 @@ msgstr "å‘上移动收è—" msgid "Move Favorite Down" msgstr "å‘下移动收è—" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "上一个层" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "下一层" + +#: editor/editor_file_dialog.cpp msgid "Go to parent folder" msgstr "转到上层文件夹" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "æ— æ³•åˆ›å»ºç›®å½•ã€‚" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "ä»¥ç½‘æ ¼ç¼©ç•¥å›¾å½¢å¼æŸ¥çœ‹æ‰€æœ‰é¡¹ã€‚" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "以列表的形å¼æŸ¥çœ‹æ‰€æœ‰é¡¹ã€‚" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "目录|文件:" @@ -1743,9 +1780,10 @@ msgstr "清空输出" msgid "Project export failed with error code %d." msgstr "项目导出失败,错误代ç %d。" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "ä¿å˜èµ„æºå‡ºé”™ï¼" +#: editor/editor_node.cpp +#, fuzzy +msgid "Imported resources can't be saved." +msgstr "已导入的资æº" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1753,6 +1791,16 @@ msgid "OK" msgstr "好的" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "ä¿å˜èµ„æºå‡ºé”™ï¼" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "资æºå¦å˜ä¸º..." @@ -3025,14 +3073,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "å› ä¸ºæ–‡ä»¶ç³»ç»Ÿæ²¡æ‰¾åˆ°æ–‡ä»¶ï¼Œä¸èƒ½å®šä½åˆ°'%s'ï¼" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "ä»¥ç½‘æ ¼ç¼©ç•¥å›¾å½¢å¼æŸ¥çœ‹æ‰€æœ‰é¡¹ã€‚" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "以列表的形å¼æŸ¥çœ‹æ‰€æœ‰é¡¹ã€‚" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "状æ€: 导入文件失败。请手动修å¤æ–‡ä»¶åŽé‡æ–°å¯¼å…¥ã€‚" @@ -3168,10 +3208,6 @@ msgid "Search files" msgstr "æœç´¢æ–‡ä»¶" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "将选ä¸çš„场景实例为选ä¸èŠ‚点的å节点。" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5141,6 +5177,10 @@ msgid "Generating Visibility Rect" msgstr "生æˆå¯è§†åŒ–区域" #: editor/plugins/particles_2d_editor_plugin.cpp +msgid "Generate Visibility Rect" +msgstr "生æˆå¯è§†åŒ–区域" + +#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Can only set point into a ParticlesMaterial process material" msgstr "å¯ä»¥è®¾ç½®ParticlesMaterial 点的æè´¨" @@ -5153,10 +5193,6 @@ msgid "No pixels with transparency > 128 in image..." msgstr "图片ä¸æ²¡æœ‰é€æ˜Žåº¦> 128çš„åƒç´ ..." #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" -msgstr "生æˆå¯è§†åŒ–区域" - -#: editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" msgstr "åŠ è½½Emission Mask(å‘å°„å±è”½ï¼‰" @@ -5244,13 +5280,13 @@ msgid "Generating AABB" msgstr "æ£åœ¨ç”ŸæˆAABB" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" -msgstr "生æˆAABB" - -#: editor/plugins/particles_editor_plugin.cpp msgid "Generate Visibility AABB" msgstr "生æˆå¯è§çš„AABB" +#: editor/plugins/particles_editor_plugin.cpp +msgid "Generate AABB" +msgstr "生æˆAABB" + #: editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" msgstr "从曲线ä¸ç§»é™¤é¡¶ç‚¹" @@ -6890,6 +6926,24 @@ msgid "Merge from Scene" msgstr "从场景ä¸åˆå¹¶" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "下一层" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "上一个层" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "å¤åˆ¶ä½æŽ©ç 。" @@ -7044,6 +7098,16 @@ msgid "Clear Tile Bitmask" msgstr "清除ä½æŽ©ç " #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Concave" +msgstr "移动多边形" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "移动多边形" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Tile" msgstr "移除ç£è´´" @@ -7166,6 +7230,11 @@ msgid "Exporting All" msgstr "全部导出" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "路径ä¸å˜åœ¨ã€‚" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "没有æ¤å¹³å°çš„导出模æ¿:" @@ -9797,6 +9866,12 @@ msgstr "" "CollisionShape节点必须拥有一个形状æ‰èƒ½è¿›è¡Œç¢°æ’žæ£€æµ‹å·¥ä½œï¼Œè¯·ä¸ºå®ƒåˆ›å»ºä¸€ä¸ªå½¢çŠ¶èµ„" "æºï¼" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "æ— ç‰©å¯è§ï¼Œå› ä¸ºæ²¡æœ‰æŒ‡å®šç½‘æ ¼ã€‚" @@ -9811,6 +9886,12 @@ msgstr "CPUParticles动画需è¦ä½¿ç”¨å¯åŠ¨äº†â€œBillboard Particlesâ€çš„Spati msgid "Plotting Meshes" msgstr "æ£åœ¨ç»˜åˆ¶ç½‘æ ¼" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "æ¤èŠ‚点需è¦è®¾ç½®NavigationMesh资æºæ‰èƒ½æ£å¸¸å·¥ä½œã€‚" @@ -9969,6 +10050,14 @@ msgstr "在åå…进制值和代ç 值之间切æ¢ã€‚" msgid "Add current color as a preset." msgstr "将当å‰é¢œè‰²æ·»åŠ 为预设。" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "æ示ï¼" @@ -9977,6 +10066,11 @@ msgstr "æ示ï¼" msgid "Please Confirm..." msgstr "请确认..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "转到上层文件夹" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " @@ -10056,6 +10150,9 @@ msgstr "对uniform的赋值。" msgid "Varyings can only be assigned in vertex function." msgstr "å˜é‡åªèƒ½åœ¨é¡¶ç‚¹å‡½æ•°ä¸æŒ‡å®šã€‚" +#~ msgid "Instance the selected scene(s) as child of the selected node." +#~ msgstr "将选ä¸çš„场景实例为选ä¸èŠ‚点的å节点。" + #~ msgid "FPS" #~ msgstr "帧数" @@ -11582,9 +11679,6 @@ msgstr "å˜é‡åªèƒ½åœ¨é¡¶ç‚¹å‡½æ•°ä¸æŒ‡å®šã€‚" #~ msgid "Cannot go into subdir:" #~ msgstr "æ— æ³•æ‰“å¼€ç›®å½•:" -#~ msgid "Imported Resources" -#~ msgstr "已导入的资æº" - #~ msgid "Insert Keys (Ins)" #~ msgstr "æ’入关键帧( 创建轨é“)" diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index 662dbaddf2..d6ce30ea5d 100644 --- a/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po @@ -1446,8 +1446,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1502,7 +1516,7 @@ msgstr "é–‹å•Ÿ Project Manager?" msgid "New Folder..." msgstr "新增資料夾" -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "é‡æ–°æ•´ç†" @@ -1579,11 +1593,34 @@ msgstr "上移最愛" msgid "Move Favorite Down" msgstr "下移最愛" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "上一個tab" + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "新增資料夾" + +#: editor/editor_file_dialog.cpp #, fuzzy msgid "Go to parent folder" msgstr "無法新增資料夾" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "無法新增資料夾" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "資料夾和檔案:" @@ -1824,10 +1861,9 @@ msgstr "下一個腳本" msgid "Project export failed with error code %d." msgstr "" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy -msgid "Error saving resource!" -msgstr "儲å˜è³‡æºæ™‚出ç¾éŒ¯èª¤ï¼" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1835,6 +1871,17 @@ msgid "OK" msgstr "OK" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +#, fuzzy +msgid "Error saving resource!" +msgstr "儲å˜è³‡æºæ™‚出ç¾éŒ¯èª¤ï¼" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "把資æºå¦å˜ç‚º..." @@ -3151,14 +3198,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3311,10 +3350,6 @@ msgid "Search files" msgstr "在幫助檔æœå°‹" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5349,19 +5384,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5453,11 +5488,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7178,6 +7213,24 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Next Coordinate" +msgstr "下一個腳本" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "上一個tab" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7333,6 +7386,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "縮放selection" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "移除é¸é …" @@ -7466,6 +7528,11 @@ msgid "Exporting All" msgstr "匯出" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "檔案ä¸å˜åœ¨." + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -10141,6 +10208,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10155,6 +10228,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10302,6 +10381,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "è¦å‘Š!" @@ -10310,6 +10397,11 @@ msgstr "è¦å‘Š!" msgid "Please Confirm..." msgstr "請確èª..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "無法新增資料夾" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index e267264d11..10f9bd4a55 100644 --- a/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po @@ -1413,8 +1413,22 @@ msgstr "" #: editor/editor_export.cpp msgid "" -"Target platform requires 'ETC' texture compression for GLES2. Enable support " -"in Project Settings." +"Target platform requires 'ETC' texture compression for GLES2. Enable 'Import " +"Etc' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC2' texture compression for GLES3. Enable " +"'Import Etc 2' in Project Settings." +msgstr "" + +#: editor/editor_export.cpp +msgid "" +"Target platform requires 'ETC' texture compression for the driver fallback " +"to GLES2.\n" +"Enable 'Import Etc' in Project Settings, or disable 'Driver Fallback " +"Enabled'." msgstr "" #: editor/editor_export.cpp platform/android/export/export.cpp @@ -1465,7 +1479,7 @@ msgstr "在檔案管ç†å“¡å…§é¡¯ç¤º" msgid "New Folder..." msgstr "新增資料夾..." -#: editor/editor_file_dialog.cpp +#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Refresh" msgstr "é‡æ–°æ•´ç†" @@ -1541,11 +1555,34 @@ msgstr "" msgid "Move Favorite Down" msgstr "" -#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Previous Folder" +msgstr "上個分é " + +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "Next Folder" +msgstr "新增資料夾" + +#: editor/editor_file_dialog.cpp #, fuzzy msgid "Go to parent folder" msgstr "無法新增資料夾" +#: editor/editor_file_dialog.cpp +#, fuzzy +msgid "(Un)favorite current folder." +msgstr "無法新增資料夾" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a grid of thumbnails." +msgstr "" + +#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp +msgid "View items as a list." +msgstr "" + #: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp msgid "Directories & Files:" msgstr "資料夾 & 檔案:" @@ -1784,9 +1821,9 @@ msgstr "輸出:" msgid "Project export failed with error code %d." msgstr "專案輸出失敗,錯誤代碼是 %d。" -#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp -msgid "Error saving resource!" -msgstr "儲å˜è³‡æºéŒ¯èª¤!" +#: editor/editor_node.cpp +msgid "Imported resources can't be saved." +msgstr "" #: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp #: scene/gui/dialogs.cpp @@ -1794,6 +1831,16 @@ msgid "OK" msgstr "" #: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp +msgid "Error saving resource!" +msgstr "儲å˜è³‡æºéŒ¯èª¤!" + +#: editor/editor_node.cpp +msgid "" +"This resource can't be saved because it does not belong to the edited scene. " +"Make it unique first." +msgstr "" + +#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp msgid "Save Resource As..." msgstr "å¦å˜è³‡æºç‚º..." @@ -3068,14 +3115,6 @@ msgid "Cannot navigate to '%s' as it has not been found in the file system!" msgstr "" #: editor/filesystem_dock.cpp -msgid "View items as a grid of thumbnails." -msgstr "" - -#: editor/filesystem_dock.cpp -msgid "View items as a list." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "Status: Import of file failed. Please fix file and reimport manually." msgstr "" @@ -3225,10 +3264,6 @@ msgid "Search files" msgstr "æœå°‹ Class" #: editor/filesystem_dock.cpp -msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" - -#: editor/filesystem_dock.cpp msgid "" "Scanning Files,\n" "Please Wait..." @@ -5236,19 +5271,19 @@ msgid "Generating Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Can only set point into a ParticlesMaterial process material" +msgid "Generate Visibility Rect" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Error loading image:" +msgid "Can only set point into a ParticlesMaterial process material" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "No pixels with transparency > 128 in image..." +msgid "Error loading image:" msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp -msgid "Generate Visibility Rect" +msgid "No pixels with transparency > 128 in image..." msgstr "" #: editor/plugins/particles_2d_editor_plugin.cpp @@ -5340,11 +5375,11 @@ msgid "Generating AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate AABB" +msgid "Generate Visibility AABB" msgstr "" #: editor/plugins/particles_editor_plugin.cpp -msgid "Generate Visibility AABB" +msgid "Generate AABB" msgstr "" #: editor/plugins/path_2d_editor_plugin.cpp @@ -7045,6 +7080,23 @@ msgid "Merge from Scene" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Next Coordinate" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the next shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Previous Coordinate" +msgstr "上個分é " + +#: editor/plugins/tile_set_editor_plugin.cpp +msgid "Select the previous shape, subtile, or Tile." +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp msgid "Copy bitmask." msgstr "" @@ -7200,6 +7252,15 @@ msgid "Clear Tile Bitmask" msgstr "" #: editor/plugins/tile_set_editor_plugin.cpp +msgid "Make Polygon Concave" +msgstr "" + +#: editor/plugins/tile_set_editor_plugin.cpp +#, fuzzy +msgid "Make Polygon Convex" +msgstr "新增資料夾" + +#: editor/plugins/tile_set_editor_plugin.cpp #, fuzzy msgid "Remove Tile" msgstr "移除" @@ -7327,6 +7388,11 @@ msgid "Exporting All" msgstr "輸出" #: editor/project_export.cpp +#, fuzzy +msgid "The given export path doesn't exist:" +msgstr "檔案ä¸å˜åœ¨" + +#: editor/project_export.cpp msgid "Export templates for this platform are missing/corrupted:" msgstr "" @@ -9988,6 +10054,12 @@ msgid "" "shape resource for it!" msgstr "" +#: scene/3d/collision_shape.cpp +msgid "" +"Plane shapes don't work well and will be removed in future versions. Please " +"don't use them." +msgstr "" + #: scene/3d/cpu_particles.cpp msgid "Nothing is visible because no mesh has been assigned." msgstr "" @@ -10002,6 +10074,12 @@ msgstr "" msgid "Plotting Meshes" msgstr "" +#: scene/3d/gi_probe.cpp +msgid "" +"GIProbes are not supported by the GLES2 video driver.\n" +"Use a BakedLightmap instead." +msgstr "" + #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" @@ -10150,6 +10228,14 @@ msgstr "" msgid "Add current color as a preset." msgstr "將目å‰é¡è‰²è¨ç‚ºé è¨" +#: scene/gui/container.cpp +msgid "" +"Container by itself serves no purpose unless a script configures it's " +"children placement behavior.\n" +"If you dont't intend to add a script, then please use a plain 'Control' node " +"instead." +msgstr "" + #: scene/gui/dialogs.cpp msgid "Alert!" msgstr "è¦å‘Š!" @@ -10158,6 +10244,11 @@ msgstr "è¦å‘Š!" msgid "Please Confirm..." msgstr "請確èª..." +#: scene/gui/file_dialog.cpp +#, fuzzy +msgid "Go to parent folder." +msgstr "無法新增資料夾" + #: scene/gui/popup.cpp msgid "" "Popups will hide by default unless you call popup() or any of the popup*() " diff --git a/main/gamecontrollerdb.txt b/main/gamecontrollerdb.txt index cb32b4209f..440c0a8621 100644 --- a/main/gamecontrollerdb.txt +++ b/main/gamecontrollerdb.txt @@ -96,11 +96,13 @@ 030000006f0e00002401000000000000,INJUSTICE FightStick PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, 03000000ac0500002c02000000000000,IPEGA,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, 03000000491900000204000000000000,Ipega PG-9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +030000006e0500000a20000000000000,JC-DUX60 ELECOM MMO Gamepad,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows, 030000006e0500000520000000000000,JC-P301U,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, 030000006e0500000320000000000000,JC-U3613M (DInput),a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, 030000006e0500000720000000000000,JC-W01U,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, 030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows, 030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +03000000bd12000003c0000000000000,JY-P70UR,a:b1,b:b0,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b11,righttrigger:b9,rightx:a3,righty:a2,start:b4,x:b3,y:b2,platform:Windows, 03000000790000000200000000000000,King PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, 030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000006d040000d2ca000000000000,Logitech Cordless Precision,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, @@ -137,6 +139,7 @@ 03000000bd12000015d0000000000000,Nintendo Retrolink USB Super SNES Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows, 030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, 030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows, +03000000550900001472000000000000,NVIDIA Controller v01.04,a:b11,b:b10,x:b9,y:b8,back:b13,guide:b12,start:b3,leftstick:b5,rightstick:b4,leftshoulder:b7,rightshoulder:b6,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a6,lefttrigger:a4,righttrigger:a5,platform:Windows, 030000004b120000014d000000000000,NYKO AIRFLO,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a3,leftstick:a0,lefttrigger:b6,rightshoulder:b5,rightstick:a2,righttrigger:b7,start:b9,x:b2,y:b3,platform:Windows, 03000000782300000a10000000000000,Onlive Wireless Controller,a:b15,b:b14,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b11,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b13,y:b12,platform:Windows, 03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, @@ -190,6 +193,7 @@ 0300000000f000000300000000000000,RetroUSB.com RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, 0300000000f00000f100000000000000,RetroUSB.com Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, 030000006b140000010d000000000000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006b140000020d000000000000,Revolution Pro Controller 2(1/2),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, 030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, @@ -217,6 +221,7 @@ 03000000ff1100003133000000000000,SVEN X-PAD,a:b2,b:b3,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a4,start:b5,x:b0,y:b1,platform:Windows, 03000000d620000011a7000000000000,Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000004f04000007d0000000000000,T Mini Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f0400000ab1000000000000,T.16000M,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b10,x:b2,y:b3,platform:Windows, 03000000fa1900000706000000000000,Team 5,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, 03000000b50700001203000000000000,Techmobility X6-38V,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, 030000004f04000015b3000000000000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, @@ -227,6 +232,7 @@ 03000000d62000006000000000000000,Tournament PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, 030000005f140000c501000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, 03000000b80500000210000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000004f04000087b6000000000000,TWCS Throttle,dpdown:b8,dpleft:b9,dpright:b7,dpup:b6,leftstick:b5,lefttrigger:-a5,leftx:a0,lefty:a1,righttrigger:+a5,platform:Windows, 03000000d90400000200000000000000,TwinShock PS2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, 03000000101c0000171c000000000000,uRage Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, 03000000300f00000701000000000000,USB 4-Axis 12-Button Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, @@ -253,6 +259,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000102800000900000000000000,8Bitdo SFC30 GamePad Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, 03000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, 03000000a00500003232000009010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,x:b2,y:b3,back:b10,start:b9,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Mac OS X, 030000008305000031b0000000000000,Cideko AK08b,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, 03000000260900008888000088020000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Mac OS X, 03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Mac OS X, @@ -289,6 +296,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Mac OS X, 03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X, 03000000d8140000cecf000000000000,MC Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,x:b2,y:b3,back:b9,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Mac OS X, 030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Mac OS X, 030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, 030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X, @@ -303,6 +311,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000321500000204000000010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, 03000000321500000104000000010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, 03000000321500000010000000010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000009000000020000,Razer Serval,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Mac OS X, +030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Mac OS X, 0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, 03000000790000001100000000000000,Retrolink Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a3,lefty:a4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, 03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, @@ -352,7 +362,9 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 030000006f0e00003901000020060000,Afterglow Controller for Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, 030000006f0e00003901000000430000,Afterglow Prismatic Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, 03000000100000008200000011010000,Akishop Customs PS360+ v1.66,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +05000000491900000204000021000000,Amazon Fire Game Controller,a:b0,b:b1,x:b3,y:b4,back:b10,guide:b12,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Linux, 05000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, +05000000050b00000045000040000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, 03000000120c00000500000010010000,AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux, 03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Linux, 03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, @@ -365,6 +377,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 03000000bc2000000055000011010000,GameSir G3w,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, 0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, 030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008f0e00000800000010010000,Gasia Co. Ltd PS(R) Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, 030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:a0,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:a3,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, 03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, 0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, @@ -437,7 +450,9 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 030000005e040000d102000003020000,Microsoft X-Box One pad v2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, 030000005e0400008502000000010000,Microsoft X-Box pad (Japan),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, 030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +05000000d6200000e589000001000000,Moga 2 HID,a:b0,b:b1,x:b2,y:b3,back:b9,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Linux, 05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +05000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,x:b2,y:b3,back:b9,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,platform:Linux, 03000000250900006688000000010000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, 030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, 030000001008000001e5000010010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Linux, @@ -446,6 +461,8 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2, 05000000010000000100000003000000,Nintendo Wiimote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, 030000000d0500000308000010010000,Nostromo n45 Dual Analog Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux, 03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +05000000550900001472000001000000,NVIDIA Controller v01.04,a:b0,b:b1,x:b2,y:b3,back:b14,guide:b16,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Linux, +03000000550900001472000011010000,NVIDIA Controller v01.04,a:b0,b:b1,x:b2,y:b3,back:b14,guide:b16,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3,righttrigger:a4,platform:Linux, 03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, 030000005e0400000202000000010000,Old Xbox pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, 05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux, diff --git a/main/input_default.cpp b/main/input_default.cpp index 18b4649f4d..e9f1eeff6a 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -355,6 +355,7 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool Ref<InputEventMouseButton> button_event; button_event.instance(); + button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(st->get_position()); button_event->set_global_position(st->get_position()); button_event->set_pressed(st->is_pressed()); @@ -383,6 +384,7 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool Ref<InputEventMouseMotion> motion_event; motion_event.instance(); + motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); motion_event->set_position(sd->get_position()); motion_event->set_global_position(sd->get_position()); motion_event->set_relative(sd->get_relative()); @@ -600,6 +602,7 @@ void InputDefault::ensure_touch_mouse_raised() { Ref<InputEventMouseButton> button_event; button_event.instance(); + button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(mouse_pos); button_event->set_global_position(mouse_pos); button_event->set_pressed(false); @@ -657,8 +660,35 @@ void InputDefault::set_mouse_in_window(bool p_in_window) { */ } +void InputDefault::accumulate_input_event(const Ref<InputEvent> &p_event) { + ERR_FAIL_COND(p_event.is_null()); + + if (!use_accumulated_input) { + parse_input_event(p_event); + return; + } + if (!accumulated_events.empty() && accumulated_events.back()->get()->accumulate(p_event)) { + return; //event was accumulated, exit + } + + accumulated_events.push_back(p_event); +} +void InputDefault::flush_accumulated_events() { + + while (accumulated_events.front()) { + parse_input_event(accumulated_events.front()->get()); + accumulated_events.pop_front(); + } +} + +void InputDefault::set_use_accumulated_input(bool p_enable) { + + use_accumulated_input = p_enable; +} + InputDefault::InputDefault() { + use_accumulated_input = true; mouse_button_mask = 0; emulate_touch_from_mouse = false; emulate_mouse_from_touch = false; diff --git a/main/input_default.h b/main/input_default.h index 75dd1e67f6..79a90cc4a4 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -183,6 +183,9 @@ private: void _parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_emulated); + List<Ref<InputEvent> > accumulated_events; + bool use_accumulated_input; + public: virtual bool is_key_pressed(int p_scancode) const; virtual bool is_mouse_button_pressed(int p_button) const; @@ -264,6 +267,11 @@ public: bool is_joy_mapped(int p_device); String get_joy_guid_remapped(int p_device) const; void set_fallback_mapping(String p_guid); + + virtual void accumulate_input_event(const Ref<InputEvent> &p_event); + virtual void flush_accumulated_events(); + virtual void set_use_accumulated_input(bool p_enable); + InputDefault(); }; diff --git a/main/main.cpp b/main/main.cpp index 96117cdc97..0871b12338 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -856,6 +856,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } if (editor || project_manager) { + Engine::get_singleton()->set_editor_hint(true); use_custom_res = false; input_map->load_default(); //keys for editor } else { @@ -880,8 +881,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph video_driver = GLOBAL_GET("rendering/quality/driver/driver_name"); } - GLOBAL_DEF("rendering/quality/driver/driver_fallback", "Best"); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_fallback", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_fallback", PROPERTY_HINT_ENUM, "Best,Never")); + GLOBAL_DEF("rendering/quality/driver/fallback_to_gles2", false); // Assigning here even though it's GLES2-specific, to be sure that it appears in docs GLOBAL_DEF("rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround", false); diff --git a/methods.py b/methods.py index 2d4dc4921f..7465962187 100644 --- a/methods.py +++ b/methods.py @@ -55,7 +55,7 @@ def update_version(module_version_string=""): f.write("#define VERSION_STATUS \"" + str(version.status) + "\"\n") f.write("#define VERSION_BUILD \"" + str(build_name) + "\"\n") f.write("#define VERSION_MODULE_CONFIG \"" + str(version.module_config) + module_version_string + "\"\n") - f.write("#define VERSION_YEAR " + str(2018) + "\n") + f.write("#define VERSION_YEAR " + str(version.year) + "\n") f.close() # NOTE: It is safe to generate this file here, since this is still executed serially diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist index 1c68c72385..b7cd94e3d5 100644 --- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist +++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist @@ -34,8 +34,6 @@ </array> <key>NSCameraUsageDescription</key> <string>$camera_usage_description</string> - <key>NSMicrophoneUsageDescription</key> - <string>$microphone_usage_description</string> <key>NSPhotoLibraryUsageDescription</key> <string>$photolibrary_usage_description</string> <key>UIRequiresFullScreen</key> diff --git a/misc/dist/linux/godot.6 b/misc/dist/linux/godot.6 index 078f8bcf91..4860c7b5a8 100644 --- a/misc/dist/linux/godot.6 +++ b/misc/dist/linux/godot.6 @@ -1,4 +1,4 @@ -.TH GODOT "6" "January 2019" "godot 3.1" "Games" +.TH GODOT "6" "March 2019" "godot 3.2" "Games" .SH NAME godot \- multi\-platform 2D and 3D game engine with a feature\-rich editor .SH SYNOPSIS diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index 2d6fa4d059..1a116527bb 100755 --- a/misc/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist @@ -19,11 +19,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>3.1</string> + <string>3.2</string> <key>CFBundleSignature</key> <string>godot</string> <key>CFBundleVersion</key> - <string>3.1</string> + <string>3.2</string> <key>NSHumanReadableCopyright</key> <string>© 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>LSMinimumSystemVersion</key> diff --git a/modules/csg/csg_gizmos.cpp b/modules/csg/csg_gizmos.cpp index 3044887ef5..d4069b901f 100644 --- a/modules/csg/csg_gizmos.cpp +++ b/modules/csg/csg_gizmos.cpp @@ -283,6 +283,10 @@ String CSGShapeSpatialGizmoPlugin::get_name() const { return "CSGShapes"; } +int CSGShapeSpatialGizmoPlugin::get_priority() const { + return -1; +} + bool CSGShapeSpatialGizmoPlugin::is_selectable_when_hidden() const { return true; } diff --git a/modules/csg/csg_gizmos.h b/modules/csg/csg_gizmos.h index b208c39938..0915d05111 100644 --- a/modules/csg/csg_gizmos.h +++ b/modules/csg/csg_gizmos.h @@ -42,6 +42,7 @@ class CSGShapeSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { public: bool has_gizmo(Spatial *p_spatial); String get_name() const; + int get_priority() const; bool is_selectable_when_hidden() const; void redraw(EditorSpatialGizmo *p_gizmo); diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 34325db9fd..e8278825bc 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -414,6 +414,7 @@ bool GDNative::terminate() { if (error || !library_terminate) { OS::get_singleton()->close_dynamic_library(native_handle); native_handle = NULL; + initialized = false; return true; } diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index c2b772df85..2da9d6bfdc 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1036,8 +1036,16 @@ NativeScriptLanguage::~NativeScriptLanguage() { for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { - if (L->get().is_valid()) - L->get()->terminate(); + Ref<GDNative> lib = L->get(); + // only shut down valid libs, duh! + if (lib.is_valid()) { + + // If it's a singleton-library then the gdnative module + // manages the destruction at engine shutdown, not NativeScript. + if (!lib->get_library()->is_singleton()) { + lib->terminate(); + } + } } NSL->library_classes.clear(); @@ -1641,10 +1649,19 @@ void NativeReloadNode::_notification(int p_what) { continue; } + // Don't unload what should not be reloaded! if (!gdn->get_library()->is_reloadable()) { continue; } + // singleton libraries might have alive pointers living inside the + // editor. Also reloading a singleton library would mean that + // the singleton entry will not be called again, as this only + // happens at engine startup. + if (gdn->get_library()->is_singleton()) { + continue; + } + gdn->terminate(); } @@ -1672,6 +1689,12 @@ void NativeReloadNode::_notification(int p_what) { continue; } + // since singleton libraries are not unloaded there is no point + // in loading them again. + if (!gdn->get_library()->is_singleton()) { + continue; + } + if (!gdn->initialize()) { libs_to_remove.insert(L->key()); continue; diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index d1794b6c36..8fcebe7855 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -117,18 +117,20 @@ bool VideoStreamPlaybackGDNative::open_file(const String &p_file) { file = FileAccess::open(p_file, FileAccess::READ); bool file_opened = interface->open_file(data_struct, file); - num_channels = interface->get_channels(data_struct); - mix_rate = interface->get_mix_rate(data_struct); + if (file_opened) { + num_channels = interface->get_channels(data_struct); + mix_rate = interface->get_mix_rate(data_struct); - godot_vector2 vec = interface->get_texture_size(data_struct); - texture_size = *(Vector2 *)&vec; + godot_vector2 vec = interface->get_texture_size(data_struct); + texture_size = *(Vector2 *)&vec; - pcm = (float *)memalloc(num_channels * AUX_BUFFER_SIZE * sizeof(float)); - memset(pcm, 0, num_channels * AUX_BUFFER_SIZE * sizeof(float)); - pcm_write_idx = -1; - samples_decoded = 0; + pcm = (float *)memalloc(num_channels * AUX_BUFFER_SIZE * sizeof(float)); + memset(pcm, 0, num_channels * AUX_BUFFER_SIZE * sizeof(float)); + pcm_write_idx = -1; + samples_decoded = 0; - texture->create((int)texture_size.width, (int)texture_size.height, Image::FORMAT_RGBA8, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE); + texture->create((int)texture_size.width, (int)texture_size.height, Image::FORMAT_RGBA8, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE); + } return file_opened; } @@ -355,9 +357,9 @@ RES ResourceFormatLoaderVideoStreamGDNative::load(const String &p_path, const St if (r_error) { *r_error = ERR_CANT_OPEN; } - memdelete(f); return RES(); } + memdelete(f); VideoStreamGDNative *stream = memnew(VideoStreamGDNative); stream->set_file(p_path); Ref<VideoStreamGDNative> ogv_stream = Ref<VideoStreamGDNative>(stream); diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index e07911fa44..4385cf12ad 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1835,73 +1835,92 @@ String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_b PoolVector<uint8_t> sourcef; Error err; - FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); + FileAccessRef f = FileAccess::open(p_path, FileAccess::READ, &err); if (err) { return String(); } - int len = f->get_len(); - sourcef.resize(len + 1); - PoolVector<uint8_t>::Write w = sourcef.write(); - int r = f->get_buffer(w.ptr(), len); - f->close(); - memdelete(f); - ERR_FAIL_COND_V(r != len, String()); - w[len] = 0; - - String s; - if (s.parse_utf8((const char *)w.ptr())) { - return String(); - } + String source = f->get_as_utf8_string(); GDScriptParser parser; - - parser.parse(s, p_path.get_base_dir(), true, p_path); + parser.parse(source, p_path.get_base_dir(), true, p_path, false, NULL, true); if (parser.get_parse_tree() && parser.get_parse_tree()->type == GDScriptParser::Node::TYPE_CLASS) { const GDScriptParser::ClassNode *c = static_cast<const GDScriptParser::ClassNode *>(parser.get_parse_tree()); + if (r_icon_path) { + if (c->icon_path.empty() || c->icon_path.is_abs_path()) + *r_icon_path = c->icon_path; + else if (c->icon_path.is_rel_path()) + *r_icon_path = p_path.get_base_dir().plus_file(c->icon_path).simplify_path(); + } if (r_base_type) { - GDScriptParser::DataType base_type; - if (c->base_type.has_type) { - base_type = c->base_type; - while (base_type.has_type && base_type.kind != GDScriptParser::DataType::NATIVE) { - switch (base_type.kind) { - case GDScriptParser::DataType::CLASS: { - base_type = base_type.class_type->base_type; - } break; - case GDScriptParser::DataType::GDSCRIPT: { - Ref<GDScript> gds = base_type.script_type; - if (gds.is_valid()) { - base_type.kind = GDScriptParser::DataType::NATIVE; - base_type.native_type = gds->get_instance_base_type(); - } else { - base_type = GDScriptParser::DataType(); + + const GDScriptParser::ClassNode *subclass = c; + String path = p_path; + GDScriptParser subparser; + while (subclass) { + if (subclass->extends_used) { + if (subclass->extends_file) { + if (subclass->extends_class.size() == 0) { + get_global_class_name(subclass->extends_file, r_base_type); + subclass = NULL; + break; + } else { + Vector<StringName> extend_classes = subclass->extends_class; + + FileAccessRef subfile = FileAccess::open(subclass->extends_file, FileAccess::READ); + if (!subfile) { + break; + } + String subsource = subfile->get_as_utf8_string(); + + if (subsource.empty()) { + break; + } + String subpath = subclass->extends_file; + if (subpath.is_rel_path()) { + subpath = path.get_base_dir().plus_file(subpath).simplify_path(); + } + + if (OK != subparser.parse(subsource, subpath.get_base_dir(), true, subpath, false, NULL, true)) { + break; + } + path = subpath; + if (!subparser.get_parse_tree() || subparser.get_parse_tree()->type != GDScriptParser::Node::TYPE_CLASS) { + break; } - } break; - default: { - base_type = GDScriptParser::DataType(); - } break; + subclass = static_cast<const GDScriptParser::ClassNode *>(subparser.get_parse_tree()); + + while (extend_classes.size() > 0) { + bool found = false; + for (int i = 0; i < subclass->subclasses.size(); i++) { + const GDScriptParser::ClassNode *inner_class = subclass->subclasses[i]; + if (inner_class->name == extend_classes[0]) { + extend_classes.remove(0); + found = true; + subclass = inner_class; + break; + } + } + if (!found) { + subclass = NULL; + break; + } + } + } + } else if (subclass->extends_class.size() == 1) { + *r_base_type = subclass->extends_class[0]; + subclass = NULL; + } else { + break; } - } - } - if (base_type.has_type) { - *r_base_type = base_type.native_type; - } else { - // Fallback - if (c->extends_used && c->extends_class.size() == 1) { - *r_base_type = c->extends_class[0]; - } else if (!c->extends_used) { + } else { *r_base_type = "Reference"; + subclass = NULL; } } } - if (r_icon_path) { - if (c->icon_path.empty() || c->icon_path.is_abs_path()) - *r_icon_path = c->icon_path; - else if (c->icon_path.is_rel_path()) - *r_icon_path = p_path.get_base_dir().plus_file(c->icon_path).simplify_path(); - } return c->name; } @@ -1946,7 +1965,7 @@ String GDScriptWarning::get_message() const { return "Assignment operation, but the function '" + symbols[0] + "()' returns void."; } break; case NARROWING_CONVERSION: { - return "Narrowing coversion (float is converted to int and lose precision)."; + return "Narrowing conversion (float is converted to int and loses precision)."; } break; case FUNCTION_MAY_YIELD: { CHECK_SYMBOLS(1); @@ -2183,6 +2202,26 @@ String ResourceFormatLoaderGDScript::get_resource_type(const String &p_path) con return ""; } +void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) { + + FileAccessRef file = FileAccess::open(p_path, FileAccess::READ); + ERR_FAIL_COND(!file); + + String source = file->get_as_utf8_string(); + if (source.empty()) { + return; + } + + GDScriptParser parser; + if (OK != parser.parse(source, p_path.get_base_dir(), true, p_path, false, NULL, true)) { + return; + } + + for (const List<String>::Element *E = parser.get_dependencies().front(); E; E = E->next()) { + p_dependencies->push_back(E->get()); + } +} + Error ResourceFormatSaverGDScript::save(const String &p_path, const RES &p_resource, uint32_t p_flags) { Ref<GDScript> sqscr = p_resource; diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 86c00c0b59..ded873c7d3 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -511,6 +511,7 @@ public: virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; + virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false); }; class ResourceFormatSaverGDScript : public ResourceFormatSaver { diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 98871ddec3..cff9ba55b8 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -329,10 +329,15 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a } if (!argument_types[i].is_type(*p_args[i], true)) { - r_err.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; - r_err.argument = i; - r_err.expected = argument_types[i].kind == GDScriptDataType::BUILTIN ? argument_types[i].builtin_type : Variant::OBJECT; - return Variant(); + if (argument_types[i].is_type(Variant(), true)) { + memnew_placement(&stack[i], Variant); + continue; + } else { + r_err.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_err.argument = i; + r_err.expected = argument_types[i].kind == GDScriptDataType::BUILTIN ? argument_types[i].builtin_type : Variant::OBJECT; + return Variant(); + } } if (argument_types[i].kind == GDScriptDataType::BUILTIN) { Variant arg = Variant::construct(argument_types[i].builtin_type, &p_args[i], 1, r_err); diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 5ebf68177d..f005f88d2e 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -473,29 +473,31 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s } Ref<Resource> res; - if (!validating) { + dependencies.push_back(path); + if (!dependencies_only) { + if (!validating) { - //this can be too slow for just validating code - if (for_completion && ScriptCodeCompletionCache::get_singleton() && FileAccess::exists(path)) { - res = ScriptCodeCompletionCache::get_singleton()->get_cached_resource(path); - } else if (!for_completion || FileAccess::exists(path)) { - res = ResourceLoader::load(path); - } - } else { + //this can be too slow for just validating code + if (for_completion && ScriptCodeCompletionCache::get_singleton() && FileAccess::exists(path)) { + res = ScriptCodeCompletionCache::get_singleton()->get_cached_resource(path); + } else if (!for_completion || FileAccess::exists(path)) { + res = ResourceLoader::load(path); + } + } else { - if (!FileAccess::exists(path)) { + if (!FileAccess::exists(path)) { + _set_error("Can't preload resource at path: " + path); + return NULL; + } else if (ScriptCodeCompletionCache::get_singleton()) { + res = ScriptCodeCompletionCache::get_singleton()->get_cached_resource(path); + } + } + if (!res.is_valid()) { _set_error("Can't preload resource at path: " + path); return NULL; - } else if (ScriptCodeCompletionCache::get_singleton()) { - res = ScriptCodeCompletionCache::get_singleton()->get_cached_resource(path); } } - if (!res.is_valid()) { - _set_error("Can't preload resource at path: " + path); - return NULL; - } - if (tokenizer->get_token() != GDScriptTokenizer::TK_PARENTHESIS_CLOSE) { _set_error("Expected ')' after 'preload' path"); return NULL; @@ -812,19 +814,31 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s bfn = true; } - // Check parents for the constant - if (!bfn && cln->extends_file != StringName()) { - Ref<GDScript> parent = ResourceLoader::load(cln->extends_file); - if (parent.is_valid() && parent->is_valid()) { - Map<StringName, Variant> parent_constants; - parent->get_constants(&parent_constants); - if (parent_constants.has(identifier)) { + if (!dependencies_only) { + if (!bfn && ScriptServer::is_global_class(identifier)) { + Ref<Script> scr = ResourceLoader::load(ScriptServer::get_global_class_path(identifier)); + if (scr.is_valid() && scr->is_valid()) { ConstantNode *constant = alloc_node<ConstantNode>(); - constant->value = parent_constants[identifier]; + constant->value = scr; expr = constant; bfn = true; } } + + // Check parents for the constant + if (!bfn && cln->extends_file != StringName()) { + Ref<GDScript> parent = ResourceLoader::load(cln->extends_file); + if (parent.is_valid() && parent->is_valid()) { + Map<StringName, Variant> parent_constants; + parent->get_constants(&parent_constants); + if (parent_constants.has(identifier)) { + ConstantNode *constant = alloc_node<ConstantNode>(); + constant->value = parent_constants[identifier]; + expr = constant; + bfn = true; + } + } + } } } @@ -2082,7 +2096,7 @@ GDScriptParser::PatternNode *GDScriptParser::_parse_pattern(bool p_static) { return NULL; } pattern->pt_type = GDScriptParser::PatternNode::PT_BIND; - pattern->bind = tokenizer->get_token_identifier(); + pattern->bind = tokenizer->get_token_literal(); // Check if variable name is already used BlockNode *bl = current_block; while (bl) { @@ -3053,7 +3067,6 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { } DataType iter_type; - iter_type.is_constant = true; if (container->type == Node::TYPE_OPERATOR) { @@ -3378,6 +3391,13 @@ void GDScriptParser::_parse_extends(ClassNode *p_class) { p_class->extends_file = constant; tokenizer->advance(); + // Add parent script as a dependency + String parent = constant; + if (parent.is_rel_path()) { + parent = base_path.plus_file(parent).simplify_path(); + } + dependencies.push_back(parent); + if (tokenizer->get_token() != GDScriptTokenizer::TK_PERIOD) { return; } else @@ -5434,7 +5454,7 @@ GDScriptParser::DataType GDScriptParser::_resolve_type(const DataType &p_source, String script_path = ScriptServer::get_global_class_path(id); if (script_path == self_path) { result.kind = DataType::CLASS; - result.class_type = current_class; + result.class_type = static_cast<ClassNode *>(head); } else { Ref<Script> script = ResourceLoader::load(script_path); Ref<GDScript> gds = script; @@ -7237,6 +7257,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_identifier_type(const DataType DataType result; result.has_type = true; result.script_type = scr; + result.is_constant = true; result.is_meta_type = true; Ref<GDScript> gds = scr; if (gds.is_valid()) { @@ -7287,6 +7308,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_identifier_type(const DataType if (singleton.is_valid()) { DataType result; result.has_type = true; + result.is_constant = true; result.script_type = singleton; Ref<GDScript> gds = singleton; @@ -7842,13 +7864,16 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) { return; } - if (!lh_type.has_type && check_types) { - if (op->arguments[0]->type == Node::TYPE_OPERATOR) { - _mark_line_as_unsafe(op->line); + if (check_types) { + if (!lh_type.has_type) { + if (op->arguments[0]->type == Node::TYPE_OPERATOR) { + _mark_line_as_unsafe(op->line); + } + } + if (lh_type.is_constant) { + _set_error("Cannot assign a new value to a constant.", op->line); + return; } - } else if (lh_type.is_constant) { - _set_error("Cannot assign a new value to a constant.", op->line); - return; } DataType rh_type; @@ -8149,6 +8174,10 @@ Error GDScriptParser::_parse(const String &p_base_path) { return ERR_PARSE_ERROR; } + if (dependencies_only) { + return OK; + } + _determine_inheritance(main_class); if (error_set) { @@ -8227,7 +8256,7 @@ Error GDScriptParser::parse_bytecode(const Vector<uint8_t> &p_bytecode, const St return ret; } -Error GDScriptParser::parse(const String &p_code, const String &p_base_path, bool p_just_validate, const String &p_self_path, bool p_for_completion, Set<int> *r_safe_lines) { +Error GDScriptParser::parse(const String &p_code, const String &p_base_path, bool p_just_validate, const String &p_self_path, bool p_for_completion, Set<int> *r_safe_lines, bool p_dependencies_only) { clear(); @@ -8237,6 +8266,7 @@ Error GDScriptParser::parse(const String &p_code, const String &p_base_path, boo validating = p_just_validate; for_completion = p_for_completion; + dependencies_only = p_dependencies_only; #ifdef DEBUG_ENABLED safe_lines = r_safe_lines; #endif // DEBUG_ENABLED @@ -8293,6 +8323,8 @@ void GDScriptParser::clear() { parenthesis = 0; current_export.type = Variant::NIL; check_types = true; + dependencies_only = false; + dependencies.clear(); error = ""; #ifdef DEBUG_ENABLED safe_lines = NULL; diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 9c1ea1c7e4..809bff8f20 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -533,6 +533,8 @@ private: int error_line; int error_column; bool check_types; + bool dependencies_only; + List<String> dependencies; #ifdef DEBUG_ENABLED Set<int> *safe_lines; #endif // DEBUG_ENABLED @@ -634,7 +636,7 @@ public: #ifdef DEBUG_ENABLED const List<GDScriptWarning> &get_warnings() const { return warnings; } #endif // DEBUG_ENABLED - Error parse(const String &p_code, const String &p_base_path = "", bool p_just_validate = false, const String &p_self_path = "", bool p_for_completion = false, Set<int> *r_safe_lines = NULL); + Error parse(const String &p_code, const String &p_base_path = "", bool p_just_validate = false, const String &p_self_path = "", bool p_for_completion = false, Set<int> *r_safe_lines = NULL, bool p_dependencies_only = false); Error parse_bytecode(const Vector<uint8_t> &p_bytecode, const String &p_base_path = "", const String &p_self_path = ""); bool is_tool_script() const; @@ -653,6 +655,8 @@ public: int get_completion_argument_index(); int get_completion_identifier_is_function(); + const List<String> &get_dependencies() const { return dependencies; } + void clear(); GDScriptParser(); ~GDScriptParser(); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 47be3a9959..e33b238f45 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -499,6 +499,47 @@ String CSharpLanguage::_get_indentation() const { return "\t"; } +String CSharpLanguage::debug_get_error() const { + + return _debug_error; +} + +int CSharpLanguage::debug_get_stack_level_count() const { + + if (_debug_parse_err_line >= 0) + return 1; + + // TODO: StackTrace + return 1; +} + +int CSharpLanguage::debug_get_stack_level_line(int p_level) const { + + if (_debug_parse_err_line >= 0) + return _debug_parse_err_line; + + // TODO: StackTrace + return 1; +} + +String CSharpLanguage::debug_get_stack_level_function(int p_level) const { + + if (_debug_parse_err_line >= 0) + return String(); + + // TODO: StackTrace + return String(); +} + +String CSharpLanguage::debug_get_stack_level_source(int p_level) const { + + if (_debug_parse_err_line >= 0) + return _debug_parse_err_file; + + // TODO: StackTrace + return String(); +} + Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info() { #ifdef DEBUG_ENABLED @@ -958,12 +999,11 @@ void CSharpLanguage::thread_exit() { bool CSharpLanguage::debug_break_parse(const String &p_file, int p_line, const String &p_error) { - // Break because of parse error + // Not a parser error in our case, but it's still used for other type of errors if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) { - // TODO - //_debug_parse_err_line = p_line; - //_debug_parse_err_file = p_file; - //_debug_error = p_error; + _debug_parse_err_line = p_line; + _debug_parse_err_file = p_file; + _debug_error = p_error; ScriptDebugger::get_singleton()->debug(this, false); return true; } else { @@ -974,10 +1014,9 @@ bool CSharpLanguage::debug_break_parse(const String &p_file, int p_line, const S bool CSharpLanguage::debug_break(const String &p_error, bool p_allow_continue) { if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) { - // TODO - //_debug_parse_err_line = -1; - //_debug_parse_err_file = ""; - //_debug_error = p_error; + _debug_parse_err_line = -1; + _debug_parse_err_file = ""; + _debug_error = p_error; ScriptDebugger::get_singleton()->debug(this, p_allow_continue); return true; } else { @@ -985,6 +1024,13 @@ bool CSharpLanguage::debug_break(const String &p_error, bool p_allow_continue) { } } +void CSharpLanguage::_uninitialize_script_bindings() { + for (Map<Object *, CSharpScriptBinding>::Element *E = script_bindings.front(); E; E = E->next()) { + CSharpScriptBinding &script_binding = E->value(); + script_binding.inited = false; + } +} + void CSharpLanguage::set_language_index(int p_idx) { ERR_FAIL_COND(lang_idx != -1); @@ -1269,14 +1315,14 @@ bool CSharpInstance::set(const StringName &p_name, const Variant &p_value) { GDMonoClass *top = script->script_class; while (top && top != script->native) { - GDMonoField *field = script->script_class->get_field(p_name); + GDMonoField *field = top->get_field(p_name); if (field) { field->set_value_from_variant(mono_object, p_value); return true; } - GDMonoProperty *property = script->script_class->get_property(p_name); + GDMonoProperty *property = top->get_property(p_name); if (property) { property->set_value(mono_object, GDMonoMarshal::variant_to_mono_object(p_value, property->get_type())); @@ -1887,6 +1933,9 @@ void CSharpScript::_update_exports_values(Map<StringName, Variant> &values, List bool CSharpScript::_update_exports() { #ifdef TOOLS_ENABLED + if (!Engine::get_singleton()->is_editor_hint()) + return false; + placeholder_fallback_enabled = true; // until proven otherwise if (!valid) @@ -2203,8 +2252,11 @@ bool CSharpScript::_get_member_export(GDMonoClass *p_class, IMonoClassMember *p_ hint_string = name_only_hint_string; } } else if (variant_type == Variant::OBJECT && CACHED_CLASS(GodotReference)->is_assignable_from(type.type_class)) { + GDMonoClass *field_native_class = GDMonoUtils::get_class_native_base(type.type_class); + CRASH_COND(field_native_class == NULL); + hint = PROPERTY_HINT_RESOURCE_TYPE; - hint_string = NATIVE_GDMONOCLASS_NAME(type.type_class); + hint_string = NATIVE_GDMONOCLASS_NAME(field_native_class); } else { hint = PropertyHint(CACHED_FIELD(ExportAttribute, hint)->get_int_value(attr)); hint_string = CACHED_FIELD(ExportAttribute, hintString)->get_string_value(attr); @@ -2699,6 +2751,7 @@ Error CSharpScript::reload(bool p_keep_state) { } load_script_signals(script_class, native); + _update_exports(); } return OK; diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 8b1a4b5f7e..99877a4379 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -162,7 +162,7 @@ public: virtual bool has_script_signal(const StringName &p_signal) const; virtual void get_script_signal_list(List<MethodInfo> *r_signals) const; - /* TODO */ virtual bool get_property_default_value(const StringName &p_property, Variant &r_value) const; + virtual bool get_property_default_value(const StringName &p_property, Variant &r_value) const; virtual void get_script_property_list(List<PropertyInfo> *p_list) const; virtual void update_exports(); @@ -309,6 +309,14 @@ class CSharpLanguage : public ScriptLanguage { Dictionary scripts_metadata; + // For debug_break and debug_break_parse + int _debug_parse_err_line; + String _debug_parse_err_file; + String _debug_error; + + friend class GDMono; + void _uninitialize_script_bindings(); + public: StringNameCache string_names; @@ -365,11 +373,11 @@ public: /* TODO */ virtual void add_global_constant(const StringName &p_variable, const Variant &p_value) {} /* DEBUGGER FUNCTIONS */ - /* TODO */ virtual String debug_get_error() const { return ""; } - /* TODO */ virtual int debug_get_stack_level_count() const { return 1; } - /* TODO */ virtual int debug_get_stack_level_line(int p_level) const { return 1; } - /* TODO */ virtual String debug_get_stack_level_function(int p_level) const { return ""; } - /* TODO */ virtual String debug_get_stack_level_source(int p_level) const { return ""; } + virtual String debug_get_error() const; + virtual int debug_get_stack_level_count() const; + virtual int debug_get_stack_level_line(int p_level) const; + virtual String debug_get_stack_level_function(int p_level) const; + virtual String debug_get_stack_level_source(int p_level) const; /* TODO */ virtual void debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {} /* TODO */ virtual void debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {} /* TODO */ virtual void debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {} diff --git a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs index e7d0486c76..967e3bcc19 100644 --- a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs +++ b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs @@ -21,6 +21,8 @@ namespace GodotSharpTools.Build private extern static string godot_icall_BuildInstance_get_MonoWindowsBinDir(); [MethodImpl(MethodImplOptions.InternalCall)] private extern static bool godot_icall_BuildInstance_get_UsingMonoMSBuildOnWindows(); + [MethodImpl(MethodImplOptions.InternalCall)] + private extern static bool godot_icall_BuildInstance_get_PrintBuildOutput(); private static string GetMSBuildPath() { @@ -53,6 +55,14 @@ namespace GodotSharpTools.Build } } + private static bool PrintBuildOutput + { + get + { + return godot_icall_BuildInstance_get_PrintBuildOutput(); + } + } + private string solution; private string config; @@ -71,8 +81,6 @@ namespace GodotSharpTools.Build public bool Build(string loggerAssemblyPath, string loggerOutputDir, string[] customProperties = null) { - bool debugMSBuild = IsDebugMSBuildRequested(); - List<string> customPropertiesList = new List<string>(); if (customProperties != null) @@ -82,7 +90,10 @@ namespace GodotSharpTools.Build ProcessStartInfo startInfo = new ProcessStartInfo(GetMSBuildPath(), compilerArgs); - bool redirectOutput = !debugMSBuild; + bool redirectOutput = !IsDebugMSBuildRequested() && !PrintBuildOutput; + + if (!redirectOutput) // TODO: or if stdout verbose + Console.WriteLine($"Running: \"{startInfo.FileName}\" {startInfo.Arguments}"); startInfo.RedirectStandardOutput = redirectOutput; startInfo.RedirectStandardError = redirectOutput; @@ -123,8 +134,6 @@ namespace GodotSharpTools.Build public bool BuildAsync(string loggerAssemblyPath, string loggerOutputDir, string[] customProperties = null) { - bool debugMSBuild = IsDebugMSBuildRequested(); - if (process != null) throw new InvalidOperationException("Already in use"); @@ -137,7 +146,10 @@ namespace GodotSharpTools.Build ProcessStartInfo startInfo = new ProcessStartInfo(GetMSBuildPath(), compilerArgs); - bool redirectOutput = !debugMSBuild; + bool redirectOutput = !IsDebugMSBuildRequested() && !PrintBuildOutput; + + if (!redirectOutput) // TODO: or if stdout verbose + Console.WriteLine($"Running: \"{startInfo.FileName}\" {startInfo.Arguments}"); startInfo.RedirectStandardOutput = redirectOutput; startInfo.RedirectStandardError = redirectOutput; diff --git a/modules/mono/editor/godotsharp_builds.cpp b/modules/mono/editor/godotsharp_builds.cpp index 5e1c9875f0..00c780d1b7 100644 --- a/modules/mono/editor/godotsharp_builds.cpp +++ b/modules/mono/editor/godotsharp_builds.cpp @@ -195,6 +195,11 @@ MonoBoolean godot_icall_BuildInstance_get_UsingMonoMSBuildOnWindows() { #endif } +MonoBoolean godot_icall_BuildInstance_get_PrintBuildOutput() { + + return (bool)EDITOR_GET("mono/builds/print_build_output"); +} + void GodotSharpBuilds::register_internal_calls() { static bool registered = false; @@ -205,6 +210,7 @@ void GodotSharpBuilds::register_internal_calls() { mono_add_internal_call("GodotSharpTools.Build.BuildInstance::godot_icall_BuildInstance_get_MSBuildPath", (void *)godot_icall_BuildInstance_get_MSBuildPath); mono_add_internal_call("GodotSharpTools.Build.BuildInstance::godot_icall_BuildInstance_get_MonoWindowsBinDir", (void *)godot_icall_BuildInstance_get_MonoWindowsBinDir); mono_add_internal_call("GodotSharpTools.Build.BuildInstance::godot_icall_BuildInstance_get_UsingMonoMSBuildOnWindows", (void *)godot_icall_BuildInstance_get_UsingMonoMSBuildOnWindows); + mono_add_internal_call("GodotSharpTools.Build.BuildInstance::godot_icall_BuildInstance_get_PrintBuildOutput", (void *)godot_icall_BuildInstance_get_PrintBuildOutput); } void GodotSharpBuilds::show_build_error_dialog(const String &p_message) { @@ -457,6 +463,8 @@ GodotSharpBuilds::GodotSharpBuilds() { "," PROP_NAME_MSBUILD_VS #endif "," PROP_NAME_XBUILD)); + + EDITOR_DEF("mono/builds/print_build_output", false); } GodotSharpBuilds::~GodotSharpBuilds() { diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index 5b68810017..921b9f987b 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -185,6 +185,16 @@ void GodotSharpEditor::_toggle_about_dialog_on_start(bool p_enabled) { } } +void GodotSharpEditor::_build_solution_pressed() { + + if (!FileAccess::exists(GodotSharpDirs::get_project_sln_path())) { + if (!_create_project_solution()) + return; // Failed to create solution + } + + MonoBottomPanel::get_singleton()->call("_build_project_pressed"); +} + void GodotSharpEditor::_menu_option_pressed(int p_id) { switch (p_id) { @@ -220,6 +230,7 @@ void GodotSharpEditor::_notification(int p_notification) { void GodotSharpEditor::_bind_methods() { + ClassDB::bind_method(D_METHOD("_build_solution_pressed"), &GodotSharpEditor::_build_solution_pressed); ClassDB::bind_method(D_METHOD("_create_project_solution"), &GodotSharpEditor::_create_project_solution); ClassDB::bind_method(D_METHOD("_make_api_solutions_if_needed"), &GodotSharpEditor::_make_api_solutions_if_needed); ClassDB::bind_method(D_METHOD("_remove_create_sln_menu_option"), &GodotSharpEditor::_remove_create_sln_menu_option); @@ -446,12 +457,12 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) { about_label->set_v_size_flags(Control::SIZE_EXPAND_FILL); about_label->set_autowrap(true); String about_text = - String("C# support in Godot Engine is a brand new feature and a work in progress.\n") + - "It is currently in an alpha stage and is not suitable for use in production.\n\n" + - "As of Godot 3.1, C# support is not feature-complete and may crash in some situations. " + - "Bugs and usability issues will be addressed gradually over future 3.x releases, " + - "including compatibility breaking changes as new features are implemented for a better overall C# experience.\n\n" + - "If you experience issues with this Mono build, please report them on Godot's issue tracker with details about your system, Mono version, IDE, etc:\n\n" + + String("C# support in Godot Engine is in late alpha stage and, while already usable, ") + + "it is not meant for use in production.\n\n" + + "Projects can be exported to Linux, macOS and Windows, but not yet to mobile or web platforms. " + + "Bugs and usability issues will be addressed gradually over future releases, " + + "potentially including compatibility breaking changes as new features are implemented for a better overall C# experience.\n\n" + + "If you experience issues with this Mono build, please report them on Godot's issue tracker with details about your system, MSBuild version, IDE, etc.:\n\n" + " https://github.com/godotengine/godot/issues\n\n" + "Your critical feedback at this stage will play a great role in shaping the C# support in future releases, so thank you!"; about_label->set_text(about_text); @@ -482,7 +493,7 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) { build_button->set_text("Build"); build_button->set_tooltip("Build solution"); build_button->set_focus_mode(Control::FOCUS_NONE); - build_button->connect("pressed", MonoBottomPanel::get_singleton(), "_build_project_pressed"); + build_button->connect("pressed", this, "_build_solution_pressed"); editor->get_menu_hb()->add_child(build_button); // External editor settings diff --git a/modules/mono/editor/godotsharp_editor.h b/modules/mono/editor/godotsharp_editor.h index c9744a9eed..cf0d2aec84 100644 --- a/modules/mono/editor/godotsharp_editor.h +++ b/modules/mono/editor/godotsharp_editor.h @@ -65,6 +65,8 @@ class GodotSharpEditor : public Node { void _menu_option_pressed(int p_id); + void _build_solution_pressed(); + static GodotSharpEditor *singleton; protected: diff --git a/modules/mono/glue/Managed/Files/DebuggingUtils.cs b/modules/mono/glue/Managed/Files/DebuggingUtils.cs index b27816084e..edfe3464ec 100644 --- a/modules/mono/glue/Managed/Files/DebuggingUtils.cs +++ b/modules/mono/glue/Managed/Files/DebuggingUtils.cs @@ -19,6 +19,12 @@ namespace Godot sb.Append(" "); } + public static void InstallTraceListener() + { + Trace.Listeners.Clear(); + Trace.Listeners.Add(new GodotTraceListener()); + } + public static void GetStackFrameInfo(StackFrame frame, out string fileName, out int fileLineNumber, out string methodDecl) { fileName = frame.GetFileName(); diff --git a/modules/mono/glue/Managed/Files/GodotTraceListener.cs b/modules/mono/glue/Managed/Files/GodotTraceListener.cs new file mode 100644 index 0000000000..f1a00ae0fa --- /dev/null +++ b/modules/mono/glue/Managed/Files/GodotTraceListener.cs @@ -0,0 +1,37 @@ +using System; +using System.Diagnostics; + +namespace Godot +{ + internal class GodotTraceListener : TraceListener + { + public override void Write(string message) + { + GD.PrintRaw(message); + } + + public override void WriteLine(string message) + { + GD.Print(message); + } + + public override void Fail(string message, string detailMessage) + { + GD.PrintErr("Assertion failed: ", message); + if (detailMessage != null) + { + GD.PrintErr(" Details: ", detailMessage); + } + + try + { + var stackTrace = new StackTrace(true).ToString(); + GD.PrintErr(stackTrace); + } + catch + { + // ignored + } + } + } +} diff --git a/modules/mono/glue/Managed/Files/Mathf.cs b/modules/mono/glue/Managed/Files/Mathf.cs index dcab3c1ffc..5f5de12959 100644 --- a/modules/mono/glue/Managed/Files/Mathf.cs +++ b/modules/mono/glue/Managed/Files/Mathf.cs @@ -289,13 +289,13 @@ namespace Godot public static int Wrap(int value, int min, int max) { int rng = max - min; - return min + ((value - min) % rng + rng) % rng; + return rng != 0 ? min + ((value - min) % rng + rng) % rng : min; } public static real_t Wrap(real_t value, real_t min, real_t max) { real_t rng = max - min; - return min + ((value - min) % rng + rng) % rng; + return !IsEqualApprox(rng, default(real_t)) ? min + ((value - min) % rng + rng) % rng : min; } } } diff --git a/modules/mono/glue/Managed/Files/MathfEx.cs b/modules/mono/glue/Managed/Files/MathfEx.cs index 2ef02cc288..414762f7b1 100644 --- a/modules/mono/glue/Managed/Files/MathfEx.cs +++ b/modules/mono/glue/Managed/Files/MathfEx.cs @@ -35,5 +35,10 @@ namespace Godot { return (int)Math.Round(s); } + + public static bool IsEqualApprox(real_t a, real_t b, real_t ratio = Mathf.Epsilon) + { + return Abs(a - b) < ratio; + } } }
\ No newline at end of file diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index dfabfddd64..bba7df2c6a 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -34,6 +34,7 @@ #include <mono/metadata/mono-config.h> #include <mono/metadata/mono-debug.h> #include <mono/metadata/mono-gc.h> +#include <mono/metadata/profiler.h> #include "core/os/dir_access.h" #include "core/os/file_access.h" @@ -54,6 +55,10 @@ #include "main/main.h" #endif +#define OUT_OF_SYNC_ERR_MESSAGE(m_assembly_name) "The assembly '" m_assembly_name "' is out of sync. " \ + "This error is expected if you just upgraded to a newer Godot version. " \ + "Building the project will update the assembly to the correct version." + GDMono *GDMono::singleton = NULL; namespace { @@ -79,6 +84,14 @@ void setup_runtime_main_args() { mono_runtime_set_main_args(main_args.size(), main_args.ptrw()); } +void gdmono_profiler_init() { + String profiler_args = GLOBAL_DEF("mono/profiler/args", "log:calls,alloc,sample,output=output.mlpd"); + bool profiler_enabled = GLOBAL_DEF("mono/profiler/enabled", false); + if (profiler_enabled) { + mono_profiler_load(profiler_args.utf8()); + } +} + #ifdef DEBUG_ENABLED static bool _wait_for_debugger_msecs(uint32_t p_msecs) { @@ -265,6 +278,8 @@ void GDMono::initialize() { GDMonoAssembly::initialize(); + gdmono_profiler_init(); + #ifdef DEBUG_ENABLED gdmono_debug_init(); #endif @@ -273,7 +288,7 @@ void GDMono::initialize() { mono_install_unhandled_exception_hook(&unhandled_exception_hook, NULL); -#ifdef TOOLS_ENABLED +#ifndef TOOLS_ENABLED if (!DirAccess::exists("res://.mono")) { // 'res://.mono/' is missing so there is nothing to load. We don't need to initialize mono, but // we still do so unless mscorlib is missing (which is the case for projects that don't use C#). @@ -353,15 +368,15 @@ void GDMono::initialize() { // metadata, so we invalidate the version in the metadata and unload the script domain. if (core_api_assembly_out_of_sync) { - ERR_PRINT("The loaded Core API assembly is out of sync"); + ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(CORE_API_ASSEMBLY_NAME)); metadata_set_api_assembly_invalidated(APIAssembly::API_CORE, true); } else if (!GDMonoUtils::mono_cache.godot_api_cache_updated) { - ERR_PRINT("The loaded Core API assembly is in sync, but the cache update failed"); + ERR_PRINT("The loaded assembly '" CORE_API_ASSEMBLY_NAME "' is in sync, but the cache update failed"); metadata_set_api_assembly_invalidated(APIAssembly::API_CORE, true); } if (editor_api_assembly_out_of_sync) { - ERR_PRINT("The loaded Editor API assembly is out of sync"); + ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(EDITOR_API_ASSEMBLY_NAME)); metadata_set_api_assembly_invalidated(APIAssembly::API_EDITOR, true); } @@ -572,6 +587,8 @@ bool GDMono::_load_core_api_assembly() { CS_GLUE_VERSION != api_assembly_ver.cs_glue_version; if (!core_api_assembly_out_of_sync) { GDMonoUtils::update_godot_api_cache(); + + _install_trace_listener(); } #else GDMonoUtils::update_godot_api_cache(); @@ -675,6 +692,23 @@ bool GDMono::_load_api_assemblies() { return true; } +void GDMono::_install_trace_listener() { + +#ifdef DEBUG_ENABLED + // Install the trace listener now before the project assembly is loaded + typedef void (*DebuggingUtils_InstallTraceListener)(MonoObject **); + MonoException *exc = NULL; + GDMonoClass *debug_utils = core_api_assembly->get_class(BINDINGS_NAMESPACE, "DebuggingUtils"); + DebuggingUtils_InstallTraceListener install_func = + (DebuggingUtils_InstallTraceListener)debug_utils->get_method_thunk("InstallTraceListener"); + install_func((MonoObject **)&exc); + if (exc) { + ERR_PRINT("Failed to install System.Diagnostics.Trace listener"); + GDMonoUtils::debug_print_unhandled_exception(exc); + } +#endif +} + #ifdef TOOLS_ENABLED String GDMono::_get_api_assembly_metadata_path() { @@ -764,8 +798,6 @@ Error GDMono::_unload_scripts_domain() { if (mono_domain_get() != root_domain) mono_domain_set(root_domain, true); - mono_gc_collect(mono_gc_max_generation()); - finalizing_scripts_domain = true; if (!mono_domain_finalize(scripts_domain, 2000)) { @@ -833,6 +865,8 @@ Error GDMono::reload_scripts_domain() { } } + CSharpLanguage::get_singleton()->_uninitialize_script_bindings(); + Error err = _load_scripts_domain(); if (err != OK) { ERR_PRINT("Mono: Failed to load scripts domain"); @@ -852,7 +886,7 @@ Error GDMono::reload_scripts_domain() { // metadata, so we invalidate the version in the metadata and unload the script domain. if (core_api_assembly_out_of_sync) { - ERR_PRINT("The loaded Core API assembly is out of sync"); + ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(CORE_API_ASSEMBLY_NAME)); metadata_set_api_assembly_invalidated(APIAssembly::API_CORE, true); } else if (!GDMonoUtils::mono_cache.godot_api_cache_updated) { ERR_PRINT("The loaded Core API assembly is in sync, but the cache update failed"); @@ -860,7 +894,7 @@ Error GDMono::reload_scripts_domain() { } if (editor_api_assembly_out_of_sync) { - ERR_PRINT("The loaded Editor API assembly is out of sync"); + ERR_PRINT(OUT_OF_SYNC_ERR_MESSAGE(EDITOR_API_ASSEMBLY_NAME)); metadata_set_api_assembly_invalidated(APIAssembly::API_EDITOR, true); } @@ -901,14 +935,20 @@ Error GDMono::finalize_and_unload_domain(MonoDomain *p_domain) { if (mono_domain_get() == p_domain) mono_domain_set(root_domain, true); - mono_gc_collect(mono_gc_max_generation()); if (!mono_domain_finalize(p_domain, 2000)) { ERR_PRINT("Mono: Domain finalization timeout"); } + mono_gc_collect(mono_gc_max_generation()); _domain_assemblies_cleanup(mono_domain_get_id(p_domain)); +#ifdef TOOLS_ENABLED + if (p_domain == tools_domain) { + editor_tools_assembly = NULL; + } +#endif + MonoException *exc = NULL; mono_domain_try_unload(p_domain, (MonoObject **)&exc); @@ -1010,11 +1050,19 @@ GDMono::~GDMono() { if (is_runtime_initialized()) { - if (scripts_domain) { +#ifdef TOOLS_ENABLED + if (tools_domain) { + Error err = finalize_and_unload_domain(tools_domain); + if (err != OK) { + ERR_PRINT("Mono: Failed to unload tools domain"); + } + } +#endif + if (scripts_domain) { Error err = _unload_scripts_domain(); if (err != OK) { - WARN_PRINT("Mono: Failed to unload scripts domain"); + ERR_PRINT("Mono: Failed to unload scripts domain"); } } @@ -1035,6 +1083,8 @@ GDMono::~GDMono() { mono_jit_cleanup(root_domain); + print_verbose("Mono: Finalized"); + runtime_initialized = false; } diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h index 785b65ce13..216c96a612 100644 --- a/modules/mono/mono_gd/gd_mono.h +++ b/modules/mono/mono_gd/gd_mono.h @@ -125,6 +125,8 @@ class GDMono { String _get_api_assembly_metadata_path(); #endif + void _install_trace_listener(); + void _register_internal_calls(); Error _load_scripts_domain(); diff --git a/modules/mono/mono_gd/gd_mono_assembly.cpp b/modules/mono/mono_gd/gd_mono_assembly.cpp index 85273bfdb4..8fec28b186 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.cpp +++ b/modules/mono/mono_gd/gd_mono_assembly.cpp @@ -50,7 +50,7 @@ void GDMonoAssembly::fill_search_dirs(Vector<String> &r_search_dirs, const Strin const char *rootdir = mono_assembly_getrootdir(); if (rootdir) { - String framework_dir = String(rootdir).plus_file("mono").plus_file("4.5"); + String framework_dir = String::utf8(rootdir).plus_file("mono").plus_file("4.5"); r_search_dirs.push_back(framework_dir); r_search_dirs.push_back(framework_dir.plus_file("Facades")); } @@ -277,6 +277,7 @@ Error GDMonoAssembly::load(bool p_refonly) { ERR_FAIL_NULL_V(image, ERR_FILE_CANT_OPEN); #ifdef DEBUG_ENABLED + Vector<uint8_t> pdb_data; String pdb_path(path + ".pdb"); if (!FileAccess::exists(pdb_path)) { @@ -286,8 +287,9 @@ Error GDMonoAssembly::load(bool p_refonly) { goto no_pdb; } - pdb_data.clear(); pdb_data = FileAccess::get_file_as_array(pdb_path); + + // mono_debug_close_image doesn't seem to be needed mono_debug_open_image_from_memory(image, &pdb_data[0], pdb_data.size()); no_pdb: @@ -306,6 +308,9 @@ no_pdb: ERR_FAIL_COND_V(status != MONO_IMAGE_OK || assembly == NULL, ERR_FILE_CANT_OPEN); + // Decrement refcount which was previously incremented by mono_image_open_from_data_with_name + mono_image_close(image); + loaded = true; modified_time = last_modified_time; @@ -321,8 +326,6 @@ Error GDMonoAssembly::wrapper_for_image(MonoImage *p_image) { image = p_image; - mono_image_addref(image); - loaded = true; return OK; @@ -332,13 +335,6 @@ void GDMonoAssembly::unload() { ERR_FAIL_COND(!loaded); -#ifdef DEBUG_ENABLED - if (pdb_data.size()) { - mono_debug_close_image(image); - pdb_data.clear(); - } -#endif - for (Map<MonoClass *, GDMonoClass *>::Element *E = cached_raw.front(); E; E = E->next()) { memdelete(E->value()); } @@ -346,8 +342,6 @@ void GDMonoAssembly::unload() { cached_classes.clear(); cached_raw.clear(); - mono_image_close(image); - assembly = NULL; image = NULL; loaded = false; diff --git a/modules/mono/mono_gd/gd_mono_assembly.h b/modules/mono/mono_gd/gd_mono_assembly.h index 8f47ee26f8..32432af37d 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.h +++ b/modules/mono/mono_gd/gd_mono_assembly.h @@ -84,10 +84,6 @@ class GDMonoAssembly { bool gdobject_class_cache_updated; Map<StringName, GDMonoClass *> gdobject_class_cache; -#ifdef DEBUG_ENABLED - Vector<uint8_t> pdb_data; -#endif - static bool no_search; static bool in_preload; static Vector<String> search_dirs; diff --git a/modules/mono/mono_gd/gd_mono_field.cpp b/modules/mono/mono_gd/gd_mono_field.cpp index 48fa380456..5e9d4db122 100644 --- a/modules/mono/mono_gd/gd_mono_field.cpp +++ b/modules/mono/mono_gd/gd_mono_field.cpp @@ -49,7 +49,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ #define SET_FROM_ARRAY(m_type) \ { \ MonoArray *managed = GDMonoMarshal::m_type##_to_mono_array(p_value.operator ::m_type()); \ - mono_field_set_value(p_object, mono_field, &managed); \ + mono_field_set_value(p_object, mono_field, managed); \ } switch (type.type_encoding) { diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml index ba54160a90..a91114b2f7 100644 --- a/modules/opensimplex/doc_classes/NoiseTexture.xml +++ b/modules/opensimplex/doc_classes/NoiseTexture.xml @@ -17,6 +17,8 @@ <member name="as_normalmap" type="bool" setter="set_as_normalmap" getter="is_normalmap"> If true, the resulting texture contains a normal map created from the original noise interpreted as a bump map. </member> + <member name="bump_strength" type="float" setter="set_bump_strength" getter="get_bump_strength"> + </member> <member name="height" type="int" setter="set_height" getter="get_height"> Height of the generated texture. </member> diff --git a/modules/opensimplex/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp index b8126ab775..9240183265 100644 --- a/modules/opensimplex/noise_texture.cpp +++ b/modules/opensimplex/noise_texture.cpp @@ -41,6 +41,7 @@ NoiseTexture::NoiseTexture() { size = Vector2i(512, 512); seamless = false; as_normalmap = false; + bump_strength = 8.0; flags = FLAGS_DEFAULT; noise = Ref<OpenSimplexNoise>(); @@ -68,6 +69,9 @@ void NoiseTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("set_as_normalmap", "as_normalmap"), &NoiseTexture::set_as_normalmap); ClassDB::bind_method(D_METHOD("is_normalmap"), &NoiseTexture::is_normalmap); + ClassDB::bind_method(D_METHOD("set_bump_strength", "bump_strength"), &NoiseTexture::set_bump_strength); + ClassDB::bind_method(D_METHOD("get_bump_strength"), &NoiseTexture::get_bump_strength); + ClassDB::bind_method(D_METHOD("_update_texture"), &NoiseTexture::_update_texture); ClassDB::bind_method(D_METHOD("_generate_texture"), &NoiseTexture::_generate_texture); ClassDB::bind_method(D_METHOD("_thread_done", "image"), &NoiseTexture::_thread_done); @@ -76,9 +80,19 @@ void NoiseTexture::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "height", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "seamless"), "set_seamless", "get_seamless"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "as_normalmap"), "set_as_normalmap", "is_normalmap"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "bump_strength", PROPERTY_HINT_RANGE, "0,32,0.1,or_greater"), "set_bump_strength", "get_bump_strength"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "OpenSimplexNoise"), "set_noise", "get_noise"); } +void NoiseTexture::_validate_property(PropertyInfo &property) const { + + if (property.name == "bump_strength") { + if (!as_normalmap) { + property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL; + } + } +} + void NoiseTexture::_set_texture_data(const Ref<Image> &p_image) { data = p_image; if (data.is_valid()) { @@ -129,7 +143,7 @@ Ref<Image> NoiseTexture::_generate_texture() { } if (as_normalmap) { - image->bumpmap_to_normalmap(); + image->bumpmap_to_normalmap(bump_strength); } return image; @@ -202,12 +216,26 @@ void NoiseTexture::set_as_normalmap(bool p_as_normalmap) { if (p_as_normalmap == as_normalmap) return; as_normalmap = p_as_normalmap; _queue_update(); + _change_notify(); } bool NoiseTexture::is_normalmap() { return as_normalmap; } +void NoiseTexture::set_bump_strength(float p_bump_strength) { + + if (p_bump_strength == bump_strength) return; + bump_strength = p_bump_strength; + if (as_normalmap) + _queue_update(); +} + +float NoiseTexture::get_bump_strength() { + + return bump_strength; +} + int NoiseTexture::get_width() const { return size.x; diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h index d1705f4070..0d00ee154d 100644 --- a/modules/opensimplex/noise_texture.h +++ b/modules/opensimplex/noise_texture.h @@ -58,6 +58,7 @@ private: Vector2i size; bool seamless; bool as_normalmap; + float bump_strength; void _thread_done(const Ref<Image> &p_image); static void _thread_function(void *p_ud); @@ -69,6 +70,7 @@ private: protected: static void _bind_methods(); + virtual void _validate_property(PropertyInfo &property) const; public: void set_noise(Ref<OpenSimplexNoise> p_noise); @@ -83,6 +85,9 @@ public: void set_as_normalmap(bool p_seamless); bool is_normalmap(); + void set_bump_strength(float p_bump_strength); + float get_bump_strength(); + int get_width() const; int get_height() const; diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 2c89e5a35c..581809fec9 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -48,22 +48,12 @@ bool VisualScriptNode::is_breakpoint() const { void VisualScriptNode::_notification(int p_what) { if (p_what == NOTIFICATION_POSTINITIALIZE) { - _update_input_ports(); - } -} - -void VisualScriptNode::_update_input_ports() { - default_input_values.resize(MAX(default_input_values.size(), get_input_value_port_count())); //let it grow as big as possible, we don't want to lose values on resize - int port_count = get_input_value_port_count(); - for (int i = 0; i < port_count; i++) { - Variant::Type expected = get_input_value_port_info(i).type; - Variant::CallError ce; - set_default_input_value(i, Variant::construct(expected, NULL, 0, ce, false)); + validate_input_default_values(); } } void VisualScriptNode::ports_changed_notify() { - _update_input_ports(); + validate_input_default_values(); emit_signal("ports_changed"); } @@ -92,8 +82,7 @@ void VisualScriptNode::_set_default_input_values(Array p_values) { } void VisualScriptNode::validate_input_default_values() { - - default_input_values.resize(get_input_value_port_count()); + default_input_values.resize(MAX(default_input_values.size(), get_input_value_port_count())); //let it grow as big as possible, we don't want to lose values on resize //actually validate on save for (int i = 0; i < get_input_value_port_count(); i++) { @@ -119,8 +108,10 @@ void VisualScriptNode::validate_input_default_values() { Array VisualScriptNode::_get_default_input_values() const { //validate on save, since on load there is little info about this + Array values = default_input_values; + values.resize(get_input_value_port_count()); - return default_input_values; + return values; } String VisualScriptNode::get_text() const { diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 0768ff61f7..0171b8e6f1 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -52,7 +52,6 @@ class VisualScriptNode : public Resource { Array _get_default_input_values() const; void validate_input_default_values(); - void _update_input_ports(); protected: void _notification(int p_what); diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 7dba8fd488..bb0435a679 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -129,9 +129,8 @@ StringName VisualScriptFunctionCall::_get_base_type() const { int VisualScriptFunctionCall::get_input_value_port_count() const { if (call_mode == CALL_MODE_BASIC_TYPE) { - - Vector<StringName> names = Variant::get_method_argument_names(basic_type, function); - return names.size() + (rpc_call_mode >= RPC_RELIABLE_TO_ID ? 1 : 0) + 1; + Vector<Variant::Type> types = Variant::get_method_argument_types(basic_type, function); + return types.size() + (rpc_call_mode >= RPC_RELIABLE_TO_ID ? 1 : 0) + 1; } else { diff --git a/modules/webp/SCsub b/modules/webp/SCsub index d215f19cef..fa3896c457 100644 --- a/modules/webp/SCsub +++ b/modules/webp/SCsub @@ -29,13 +29,11 @@ if env['builtin_libwebp']: "dsp/cost.c", "dsp/cost_mips32.c", "dsp/cost_mips_dsp_r2.c", + "dsp/cost_neon.c", "dsp/cost_sse2.c", "dsp/cpu.c", "dsp/dec.c", "dsp/dec_clip_tables.c", - "dsp/ssim.c", - "dsp/ssim_sse2.c", - "dsp/yuv_neon.c", "dsp/dec_mips32.c", "dsp/dec_mips_dsp_r2.c", "dsp/dec_msa.c", @@ -72,6 +70,8 @@ if env['builtin_libwebp']: "dsp/rescaler_msa.c", "dsp/rescaler_neon.c", "dsp/rescaler_sse2.c", + "dsp/ssim.c", + "dsp/ssim_sse2.c", "dsp/upsampling.c", "dsp/upsampling_mips_dsp_r2.c", "dsp/upsampling_msa.c", @@ -81,6 +81,7 @@ if env['builtin_libwebp']: "dsp/yuv.c", "dsp/yuv_mips32.c", "dsp/yuv_mips_dsp_r2.c", + "dsp/yuv_neon.c", "dsp/yuv_sse2.c", "dsp/yuv_sse41.c", "enc/alpha_enc.c", diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub index b67a836fe8..0345e533bc 100644 --- a/modules/websocket/SCsub +++ b/modules/websocket/SCsub @@ -9,85 +9,90 @@ env_lws = env_modules.Clone() if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # already builtin for javascript thirdparty_dir = "#thirdparty/libwebsockets/" - helper_dir = "win32helpers/" + helper_dir = "#thirdparty/libwebsockets/win32helpers/" thirdparty_sources = [ - "core/alloc.c", - "core/context.c", - "core/libwebsockets.c", - "core/output.c", - "core/pollfd.c", - "core/service.c", - - "event-libs/poll/poll.c", - - "misc/base64-decode.c", - "misc/lejp.c", - "misc/sha-1.c", - - "roles/h1/ops-h1.c", - "roles/http/header.c", - "roles/http/client/client.c", - "roles/http/client/client-handshake.c", - "roles/http/server/fops-zip.c", - "roles/http/server/lejp-conf.c", - "roles/http/server/parsers.c", - "roles/http/server/server.c", - "roles/listen/ops-listen.c", - "roles/pipe/ops-pipe.c", - "roles/raw/ops-raw.c", - - "roles/ws/client-ws.c", - "roles/ws/client-parser-ws.c", - "roles/ws/ops-ws.c", - "roles/ws/server-ws.c", - - "tls/tls.c", - "tls/tls-client.c", - "tls/tls-server.c", - - "tls/mbedtls/wrapper/library/ssl_cert.c", - "tls/mbedtls/wrapper/library/ssl_pkey.c", - "tls/mbedtls/wrapper/library/ssl_stack.c", - "tls/mbedtls/wrapper/library/ssl_methods.c", - "tls/mbedtls/wrapper/library/ssl_lib.c", - "tls/mbedtls/wrapper/library/ssl_x509.c", - "tls/mbedtls/wrapper/platform/ssl_port.c", - "tls/mbedtls/wrapper/platform/ssl_pm.c", - "tls/mbedtls/lws-genhash.c", - "tls/mbedtls/mbedtls-client.c", - "tls/mbedtls/lws-genrsa.c", - "tls/mbedtls/ssl.c", - "tls/mbedtls/mbedtls-server.c" + "lib/core/adopt.c", + "lib/core/alloc.c", + "lib/core/connect.c", + "lib/core/context.c", + "lib/core/dummy-callback.c", + "lib/core/libwebsockets.c", + "lib/core/output.c", + "lib/core/pollfd.c", + "lib/core/service.c", + + "lib/event-libs/poll/poll.c", + + "lib/misc/base64-decode.c", + "lib/misc/lejp.c", + "lib/misc/sha-1.c", + + "lib/roles/h1/ops-h1.c", + "lib/roles/http/header.c", + "lib/roles/http/client/client.c", + "lib/roles/http/client/client-handshake.c", + "lib/roles/http/server/fops-zip.c", + "lib/roles/http/server/lejp-conf.c", + "lib/roles/http/server/parsers.c", + "lib/roles/http/server/server.c", + "lib/roles/listen/ops-listen.c", + "lib/roles/pipe/ops-pipe.c", + "lib/roles/raw-skt/ops-raw-skt.c", + "lib/roles/raw-file/ops-raw-file.c", + + "lib/roles/ws/client-ws.c", + "lib/roles/ws/client-parser-ws.c", + "lib/roles/ws/ops-ws.c", + "lib/roles/ws/server-ws.c", + + "lib/tls/tls.c", + "lib/tls/tls-client.c", + "lib/tls/tls-server.c", + + "lib/tls/mbedtls/wrapper/library/ssl_cert.c", + "lib/tls/mbedtls/wrapper/library/ssl_pkey.c", + "lib/tls/mbedtls/wrapper/library/ssl_stack.c", + "lib/tls/mbedtls/wrapper/library/ssl_methods.c", + "lib/tls/mbedtls/wrapper/library/ssl_lib.c", + "lib/tls/mbedtls/wrapper/library/ssl_x509.c", + "lib/tls/mbedtls/wrapper/platform/ssl_port.c", + "lib/tls/mbedtls/wrapper/platform/ssl_pm.c", + "lib/tls/mbedtls/lws-genhash.c", + "lib/tls/mbedtls/mbedtls-client.c", + "lib/tls/mbedtls/lws-genrsa.c", + "lib/tls/mbedtls/ssl.c", + "lib/tls/mbedtls/mbedtls-server.c" ] if env["platform"] == "android": # Builtin getifaddrs - thirdparty_sources += ["misc/getifaddrs.c"] + thirdparty_sources += ["lib/misc/getifaddrs.c"] + + thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] if env["platform"] == "windows" or env["platform"] == "uwp": # Winsock - thirdparty_sources += ["plat/lws-plat-win.c", helper_dir + "getopt.c", helper_dir + "getopt_long.c", helper_dir + "gettimeofday.c"] + thirdparty_sources += Glob(thirdparty_dir + "lib/plat/windows/*.c") + [helper_dir + src for src in ["getopt.c", "getopt_long.c", "gettimeofday.c"]] else: # Unix socket - thirdparty_sources += ["plat/lws-plat-unix.c"] - - thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] + thirdparty_sources += Glob(thirdparty_dir + "lib/plat/unix/*.c") - env_lws.Append(CPPPATH=[thirdparty_dir]) + env_lws.Append(CPPPATH=[thirdparty_dir + 'include/']) if env['builtin_mbedtls']: mbedtls_includes = "#thirdparty/mbedtls/include" env_lws.Prepend(CPPPATH=[mbedtls_includes]) - wrapper_includes = ["#thirdparty/libwebsockets/tls/mbedtls/wrapper/include/" + inc for inc in ["internal", "openssl", "platform", ""]] + wrapper_includes = ["#thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/" + inc for inc in ["internal", "openssl", "platform", ""]] env_lws.Prepend(CPPPATH=wrapper_includes) if env["platform"] == "windows" or env["platform"] == "uwp": - env_lws.Append(CPPPATH=[thirdparty_dir + helper_dir]) + env_lws.Append(CPPPATH=[helper_dir]) if env["platform"] == "uwp": env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"]) env_thirdparty = env_lws.Clone() env_thirdparty.disable_warnings() + env_thirdparty.Append(CPPPATH=[thirdparty_dir + 'lib/']) env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_lws.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/websocket/lws_client.cpp b/modules/websocket/lws_client.cpp index 2dce0ed1f5..d09558ab22 100644 --- a/modules/websocket/lws_client.cpp +++ b/modules/websocket/lws_client.cpp @@ -34,7 +34,10 @@ #include "core/io/ip.h" #include "core/io/stream_peer_ssl.h" #include "core/project_settings.h" -#include "tls/mbedtls/wrapper/include/openssl/ssl.h" +#if defined(LWS_OPENSSL_SUPPORT) +// Not openssl, just the mbedtls wrapper +#include "openssl/ssl.h" +#endif Error LWSClient::connect_to_host(String p_host, String p_path, uint16_t p_port, bool p_ssl, PoolVector<String> p_protocols) { @@ -121,6 +124,7 @@ int LWSClient::_handle_cb(struct lws *wsi, enum lws_callback_reasons reason, voi LWSPeer::PeerData *peer_data = (LWSPeer::PeerData *)user; switch (reason) { +#if defined(LWS_OPENSSL_SUPPORT) case LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: { PoolByteArray arr = StreamPeerSSL::get_project_cert_array(); if (arr.size() > 0) @@ -128,7 +132,7 @@ int LWSClient::_handle_cb(struct lws *wsi, enum lws_callback_reasons reason, voi else if (verify_ssl) WARN_PRINTS("No CA cert specified in project settings, SSL will not work"); } break; - +#endif case LWS_CALLBACK_CLIENT_ESTABLISHED: peer->set_wsi(wsi, _in_buf_size, _in_pkt_size, _out_buf_size, _out_pkt_size); peer_data->peer_id = 0; diff --git a/platform/android/AndroidManifest.xml.template b/platform/android/AndroidManifest.xml.template index d8fb9326ea..daaf847f11 100644 --- a/platform/android/AndroidManifest.xml.template +++ b/platform/android/AndroidManifest.xml.template @@ -36,4 +36,9 @@ $$ADD_APPLICATION_CHUNKS$$ </application> + <instrumentation android:icon="@drawable/icon" + android:label="@string/godot_project_name_string" + android:name="org.godotengine.godot.GodotInstrumentation" + android:targetPackage="com.godot.game" /> + </manifest> diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp index 0d62b242a8..8913950fac 100644 --- a/platform/android/audio_driver_opensl.cpp +++ b/platform/android/audio_driver_opensl.cpp @@ -230,7 +230,7 @@ void AudioDriverOpenSL::_record_buffer_callbacks(SLAndroidSimpleBufferQueueItf q ad->_record_buffer_callback(queueItf); } -Error AudioDriverOpenSL::capture_start() { +Error AudioDriverOpenSL::capture_init_device() { SLDataLocator_IODevice loc_dev = { SL_DATALOCATOR_IODEVICE, @@ -298,6 +298,15 @@ Error AudioDriverOpenSL::capture_start() { return OK; } +Error AudioDriverOpenSL::capture_start() { + + if (OS::get_singleton()->request_permission("RECORD_AUDIO")) { + return capture_init_device(); + } + + return OK; +} + Error AudioDriverOpenSL::capture_stop() { SLuint32 state; diff --git a/platform/android/audio_driver_opensl.h b/platform/android/audio_driver_opensl.h index 9bd0d5e999..2981073cec 100644 --- a/platform/android/audio_driver_opensl.h +++ b/platform/android/audio_driver_opensl.h @@ -88,6 +88,8 @@ class AudioDriverOpenSL : public AudioDriver { SLAndroidSimpleBufferQueueItf queueItf, void *pContext); + virtual Error capture_init_device(); + public: void set_singleton(); diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 8d9d9c697e..e489bce3f8 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -658,6 +658,8 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { int orientation = p_preset->get("screen/orientation"); + bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES3" && + !ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2"); bool screen_support_small = p_preset->get("screen/support_small"); bool screen_support_normal = p_preset->get("screen/support_normal"); bool screen_support_large = p_preset->get("screen/support_large"); @@ -815,6 +817,11 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { } } + if (tname == "uses-feature" && attrname == "glEsVersion") { + + encode_uint32(min_gles3 ? 0x00030000 : 0x00020000, &p_manifest.write[iofs + 16]); + } + iofs += 20; } @@ -1114,17 +1121,14 @@ public: public: virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { - // Re-enable when a GLES 2.0 backend is read - /*int api = p_preset->get("graphics/api"); - if (api == 0) - r_features->push_back("etc"); - else*/ String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name"); - if (driver == "GLES2" || driver == "GLES3") { + if (driver == "GLES2") { r_features->push_back("etc"); - } - if (driver == "GLES3") { + } else if (driver == "GLES3") { r_features->push_back("etc2"); + if (ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2")) { + r_features->push_back("etc"); + } } Vector<String> abis = get_enabled_abis(p_preset); @@ -1495,6 +1499,10 @@ public: } } + if (!DirAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + FileAccess *src_f = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index a10d7876f4..e42099ba0b 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -38,12 +38,14 @@ import android.app.AlertDialog; import android.app.PendingIntent; import android.content.ClipData; import android.content.ClipboardManager; +import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content.pm.ConfigurationInfo; +import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.graphics.Point; import android.graphics.Rect; @@ -51,11 +53,13 @@ import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; +import android.Manifest; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.os.Messenger; import android.provider.Settings.Secure; +import android.support.v4.content.ContextCompat; import android.util.Log; import android.view.Display; import android.view.KeyEvent; @@ -98,6 +102,7 @@ import javax.microedition.khronos.opengles.GL10; public class Godot extends Activity implements SensorEventListener, IDownloaderClient { static final int MAX_SINGLETONS = 64; + static final int REQUEST_RECORD_AUDIO_PERMISSION = 1; private IStub mDownloaderClientStub; private IDownloaderService mRemoteService; private TextView mStatusText; @@ -258,6 +263,10 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC for (int i = 0; i < singleton_count; i++) { singletons[i].onMainRequestPermissionsResult(requestCode, permissions, grantResults); } + + for (int i = 0; i < permissions.length; i++) { + GodotLib.requestPermissionResult(permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED); + } }; public void onVideoInit() { @@ -318,6 +327,23 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC }); } + public void restart() { + // HACK: + // + // Currently it's very hard to properly deinitialize Godot on Android to restart the game + // from scratch. Therefore, we need to kill the whole app process and relaunch it. + // + // Restarting only the activity, wouldn't be enough unless it did proper cleanup (including + // releasing and reloading native libs or resetting their state somehow and clearing statics). + // + // Using instrumentation is a way of making the whole app process restart, because Android + // will kill any process of the same package which was already running. + // + Bundle args = new Bundle(); + args.putParcelable("intent", mCurrentIntent); + startInstrumentation(new ComponentName(Godot.this, GodotInstrumentation.class), null, args); + } + public void alert(final String message, final String title) { final Activity activity = this; runOnUiThread(new Runnable() { @@ -415,7 +441,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC mGyroscope = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE); mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME); - GodotLib.initialize(this, io.needsReloadHooks(), getAssets(), use_apk_expansion); + GodotLib.initialize(this, getAssets(), use_apk_expansion); result_callback = null; @@ -918,13 +944,27 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC } */ - // Audio + public boolean requestPermission(String p_name) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + // Not necessary, asked on install already + return true; + } + + if (p_name.equals("RECORD_AUDIO")) { + if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) { + requestPermissions(new String[] { Manifest.permission.RECORD_AUDIO }, REQUEST_RECORD_AUDIO_PERMISSION); + return false; + } + } + + return true; + } /** - * The download state should trigger changes in the UI --- it may be useful - * to show the state as being indeterminate at times. This sample can be - * considered a guideline. - */ + * The download state should trigger changes in the UI --- it may be useful + * to show the state as being indeterminate at times. This sample can be + * considered a guideline. + */ @Override public void onDownloadStateChanged(int newState) { setState(newState); diff --git a/platform/android/java/src/org/godotengine/godot/GodotIO.java b/platform/android/java/src/org/godotengine/godot/GodotIO.java index 85bba8bb4c..1b2ff61314 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/src/org/godotengine/godot/GodotIO.java @@ -500,11 +500,6 @@ public class GodotIO { return (int)(metrics.density * 160f); } - public boolean needsReloadHooks() { - - return false; - } - public void showKeyboard(String p_existing_text) { if (edit != null) edit.showKeyboard(p_existing_text); diff --git a/platform/android/java/src/org/godotengine/godot/GodotInstrumentation.java b/platform/android/java/src/org/godotengine/godot/GodotInstrumentation.java new file mode 100644 index 0000000000..0466f380e8 --- /dev/null +++ b/platform/android/java/src/org/godotengine/godot/GodotInstrumentation.java @@ -0,0 +1,50 @@ +/*************************************************************************/ +/* GodotInstrumentation.java */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +package org.godotengine.godot; + +import android.app.Instrumentation; +import android.content.Intent; +import android.os.Bundle; + +public class GodotInstrumentation extends Instrumentation { + private Intent intent; + + @Override + public void onCreate(Bundle arguments) { + intent = arguments.getParcelable("intent"); + start(); + } + + @Override + public void onStart() { + startActivitySync(intent); + } +} diff --git a/platform/android/java/src/org/godotengine/godot/GodotLib.java b/platform/android/java/src/org/godotengine/godot/GodotLib.java index 29e7918645..6e6b398a5d 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotLib.java +++ b/platform/android/java/src/org/godotengine/godot/GodotLib.java @@ -45,9 +45,9 @@ public class GodotLib { * @param height the current view height */ - public static native void initialize(Godot p_instance, boolean need_reload_hook, Object p_asset_manager, boolean use_apk_expansion); + public static native void initialize(Godot p_instance, Object p_asset_manager, boolean use_apk_expansion); public static native void setup(String[] p_cmdline); - public static native void resize(int width, int height, boolean reload); + public static native void resize(int width, int height); public static native void newcontext(boolean p_32_bits); public static native void back(); public static native void step(); @@ -69,6 +69,7 @@ public class GodotLib { public static native String getGlobal(String p_key); public static native void callobject(int p_ID, String p_method, Object[] p_params); public static native void calldeferred(int p_ID, String p_method, Object[] p_params); + public static native void requestPermissionResult(String p_permission, boolean p_result); public static native void setVirtualKeyboardHeight(int p_height); } diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index ba8e8bd07b..ccf78f26f3 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -79,7 +79,6 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { private Context ctx; private GodotIO io; - private static boolean firsttime = true; private static boolean use_gl3 = false; private static boolean use_32 = false; private static boolean use_debug_opengl = false; @@ -97,10 +96,8 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { activity = p_activity; - if (!p_io.needsReloadHooks()) { - //will only work on SDK 11+!! - setPreserveEGLContextOnPause(true); - } + setPreserveEGLContextOnPause(true); + mInputManager = InputManagerCompat.Factory.getInputManager(this.getContext()); mInputManager.registerInputDeviceListener(this, null); init(false, 16, 0); @@ -718,8 +715,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { public void onSurfaceChanged(GL10 gl, int width, int height) { - GodotLib.resize(width, height, !firsttime); - firsttime = false; + GodotLib.resize(width, height); for (int i = 0; i < Godot.singleton_count; i++) { Godot.singletons[i].onGLSurfaceChanged(gl, width, height); } diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 53c909da88..e9c0e5564f 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -599,6 +599,7 @@ static jobject godot_io; typedef void (*GFXInitFunc)(void *ud, bool gl2); static jmethodID _on_video_init = 0; +static jmethodID _restart = 0; static jobject _godot_instance; static jmethodID _openURI = 0; @@ -620,6 +621,7 @@ static jmethodID _pauseVideo = 0; static jmethodID _stopVideo = 0; static jmethodID _setKeepScreenOn = 0; static jmethodID _alertDialog = 0; +static jmethodID _requestPermission = 0; static void _gfx_init_func(void *ud, bool gl2) { } @@ -745,6 +747,12 @@ static void _alert(const String &p_message, const String &p_title) { env->CallVoidMethod(_godot_instance, _alertDialog, jStrMessage, jStrTitle); } +static bool _request_permission(const String &p_name) { + JNIEnv *env = ThreadAndroid::get_env(); + jstring jStrName = env->NewStringUTF(p_name.utf8().get_data()); + return env->CallBooleanMethod(_godot_instance, _requestPermission, jStrName); +} + // volatile because it can be changed from non-main thread and we need to // ensure the change is immediately visible to other threads. static volatile int virtual_keyboard_height; @@ -757,7 +765,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setVirtualKeyboardHei virtual_keyboard_height = p_height; } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jobject obj, jobject activity, jboolean p_need_reload_hook, jobject p_asset_manager, jboolean p_use_apk_expansion) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jobject obj, jobject activity, jobject p_asset_manager, jboolean p_use_apk_expansion) { initialized = true; @@ -783,11 +791,13 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en godot_io = gob; _on_video_init = env->GetMethodID(cls, "onVideoInit", "()V"); + _restart = env->GetMethodID(cls, "restart", "()V"); _setKeepScreenOn = env->GetMethodID(cls, "setKeepScreenOn", "(Z)V"); _alertDialog = env->GetMethodID(cls, "alert", "(Ljava/lang/String;Ljava/lang/String;)V"); _getGLESVersionCode = env->GetMethodID(cls, "getGLESVersionCode", "()I"); _getClipboard = env->GetMethodID(cls, "getClipboard", "()Ljava/lang/String;"); _setClipboard = env->GetMethodID(cls, "setClipboard", "(Ljava/lang/String;)V"); + _requestPermission = env->GetMethodID(cls, "requestPermission", "(Ljava/lang/String;)Z"); if (cls) { jclass c = env->GetObjectClass(gob); @@ -820,8 +830,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en AudioDriverAndroid::setup(gob); } - os_android = new OS_Android(_gfx_init_func, env, _open_uri, _get_user_data_dir, _get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk, _get_vk_height, _set_screen_orient, _get_unique_id, _get_system_dir, _get_gles_version_code, _play_video, _is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, _alert, _set_clipboard, _get_clipboard, p_use_apk_expansion); - os_android->set_need_reload_hooks(p_need_reload_hook); + os_android = new OS_Android(_gfx_init_func, env, _open_uri, _get_user_data_dir, _get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk, _get_vk_height, _set_screen_orient, _get_unique_id, _get_system_dir, _get_gles_version_code, _play_video, _is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, _alert, _set_clipboard, _get_clipboard, _request_permission, p_use_apk_expansion); char wd[500]; getcwd(wd, 500); @@ -832,7 +841,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en static void _initialize_java_modules() { if (!ProjectSettings::get_singleton()->has_setting("android/modules")) { - print_line("Android modules: Nothing to load, aborting"); return; } @@ -852,19 +860,16 @@ static void _initialize_java_modules() { jmethodID getClassLoader = env->GetMethodID(activityClass, "getClassLoader", "()Ljava/lang/ClassLoader;"); jobject cls = env->CallObjectMethod(_godot_instance, getClassLoader); - //cls=env->NewGlobalRef(cls); jclass classLoader = env->FindClass("java/lang/ClassLoader"); - //classLoader=(jclass)env->NewGlobalRef(classLoader); jmethodID findClass = env->GetMethodID(classLoader, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;"); for (int i = 0; i < mods.size(); i++) { String m = mods[i]; - //jclass singletonClass = env->FindClass(m.utf8().get_data()); - print_line("Loading module: " + m); + print_line("Loading Android module: " + m); jstring strClassName = env->NewStringUTF(m.utf8().get_data()); jclass singletonClass = (jclass)env->CallObjectMethod(cls, findClass, strClassName); @@ -873,7 +878,6 @@ static void _initialize_java_modules() { ERR_EXPLAIN("Couldn't find singleton for class: " + m); ERR_CONTINUE(!singletonClass); } - //singletonClass=(jclass)env->NewGlobalRef(singletonClass); jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lorg/godotengine/godot/Godot$SingletonBase;"); @@ -932,7 +936,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jo _initialize_java_modules(); } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jobject obj, jint width, jint height, jboolean reload) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jobject obj, jint width, jint height) { if (os_android) os_android->set_display_size(Size2(width, height)); @@ -941,12 +945,15 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, j JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jobject obj, bool p_32_bits) { if (os_android) { - os_android->set_context_is_16_bits(!p_32_bits); - } - - if (os_android && step > 0) { - - os_android->reload_gfx(); + if (step == 0) { + // During startup + os_android->set_context_is_16_bits(!p_32_bits); + } else { + // GL context recreated because it was lost; restart app to let it reload everything + os_android->main_loop_end(); + env->CallVoidMethod(_godot_instance, _restart); + step = -1; // Ensure no further steps are attempted + } } } @@ -958,6 +965,9 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, job } JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, jobject obj) { + if (step == -1) + return; + if (step == 0) { // Since Godot is initialized on the UI thread, _main_thread_id was set to that thread's id, @@ -1571,6 +1581,9 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * env->PopLocalFrame(NULL); } -//Main::cleanup(); - -//return os.get_exit_code(); +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResult(JNIEnv *env, jobject p_obj, jstring p_permission, jboolean p_result) { + String permission = jstring_to_string(p_permission, env); + if (permission == "android.permission.RECORD_AUDIO" && p_result) { + AudioDriver::get_singleton()->capture_start(); + } +} diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h index e8d0d55bb3..3b93c9b42a 100644 --- a/platform/android/java_glue.h +++ b/platform/android/java_glue.h @@ -35,9 +35,9 @@ #include <jni.h> extern "C" { -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jobject obj, jobject activity, jboolean p_need_reload_hook, jobject p_asset_manager, jboolean p_use_apk_expansion); +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jobject obj, jobject activity, jobject p_asset_manager, jboolean p_use_apk_expansion); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jobject obj, jobjectArray p_cmdline); -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jobject obj, jint width, jint height, jboolean reload); +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jobject obj, jint width, jint height); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jobject obj, bool p_32_bits); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, jobject obj); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, jobject obj); @@ -60,6 +60,7 @@ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv * JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *env, jobject p_obj, jint ID, jstring method, jobjectArray params); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv *env, jobject p_obj, jint ID, jstring method, jobjectArray params); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setVirtualKeyboardHeight(JNIEnv *env, jobject obj, jint p_height); +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResult(JNIEnv *env, jobject p_obj, jstring p_permission, jboolean p_result); } #endif // JAVA_GLUE_H diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index b86976843c..837713f9c9 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -131,7 +131,7 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int RasterizerGLES3::make_current(); break; } else { - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best") { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2")) { p_video_driver = VIDEO_DRIVER_GLES2; use_gl3 = false; continue; @@ -202,6 +202,12 @@ void OS_Android::alert(const String &p_alert, const String &p_title) { alert_func(p_alert, p_title); } +bool OS_Android::request_permission(const String &p_name) { + if (request_permission_func) + return request_permission_func(p_name); + return false; +} + Error OS_Android::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { p_library_handle = dlopen(p_path.utf8().get_data(), RTLD_NOW); if (!p_library_handle) { @@ -548,14 +554,6 @@ void OS_Android::set_display_size(Size2 p_size) { default_videomode.height = p_size.y; } -void OS_Android::reload_gfx() { - - if (gfx_init_func) - gfx_init_func(gfx_init_ud, use_gl2); - //if (rasterizer) - // rasterizer->reload_vram(); -} - Error OS_Android::shell_open(String p_uri) { if (open_uri_func) @@ -607,11 +605,6 @@ int OS_Android::get_screen_dpi(int p_screen) const { return 160; } -void OS_Android::set_need_reload_hooks(bool p_needs_them) { - - use_reload_hooks = p_needs_them; -} - String OS_Android::get_user_data_dir() const { if (data_dir_cache != String()) @@ -726,7 +719,7 @@ bool OS_Android::_check_internal_feature_support(const String &p_feature) { return false; } -OS_Android::OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetUserDataDirFunc p_get_user_data_dir_func, GetLocaleFunc p_get_locale_func, GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, VirtualKeyboardHeightFunc p_vk_height_func, SetScreenOrientationFunc p_screen_orient, GetUniqueIDFunc p_get_unique_id, GetSystemDirFunc p_get_sdir_func, GetGLVersionCodeFunc p_get_gl_version_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, SetClipboardFunc p_set_clipboard_func, GetClipboardFunc p_get_clipboard_func, bool p_use_apk_expansion) { +OS_Android::OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetUserDataDirFunc p_get_user_data_dir_func, GetLocaleFunc p_get_locale_func, GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, VirtualKeyboardHeightFunc p_vk_height_func, SetScreenOrientationFunc p_screen_orient, GetUniqueIDFunc p_get_unique_id, GetSystemDirFunc p_get_sdir_func, GetGLVersionCodeFunc p_get_gl_version_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, SetClipboardFunc p_set_clipboard_func, GetClipboardFunc p_get_clipboard_func, RequestPermissionFunc p_request_permission, bool p_use_apk_expansion) { use_apk_expansion = p_use_apk_expansion; default_videomode.width = 800; @@ -765,7 +758,7 @@ OS_Android::OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURI set_screen_orientation_func = p_screen_orient; set_keep_screen_on_func = p_set_keep_screen_on_func; alert_func = p_alert_func; - use_reload_hooks = false; + request_permission_func = p_request_permission; Vector<Logger *> loggers; loggers.push_back(memnew(AndroidLogger)); diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 1e5b89e24d..44c5a206d4 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -63,6 +63,7 @@ typedef void (*VideoStopFunc)(); typedef void (*SetKeepScreenOnFunc)(bool p_enabled); typedef void (*AlertFunc)(const String &, const String &); typedef int (*VirtualKeyboardHeightFunc)(); +typedef bool (*RequestPermissionFunc)(const String &); class OS_Android : public OS_Unix { public: @@ -94,7 +95,6 @@ private: void *gfx_init_ud; bool use_gl2; - bool use_reload_hooks; bool use_apk_expansion; bool use_16bits_fbo; @@ -133,6 +133,7 @@ private: VideoStopFunc video_stop_func; SetKeepScreenOnFunc set_keep_screen_on_func; AlertFunc alert_func; + RequestPermissionFunc request_permission_func; //PowerAndroid *power_manager; int video_driver_index; @@ -160,6 +161,7 @@ public: static OS *get_singleton(); virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); + virtual bool request_permission(const String &p_name); virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false); @@ -203,10 +205,8 @@ public: void set_opengl_extensions(const char *p_gl_extensions); void set_display_size(Size2 p_size); - void reload_gfx(); void set_context_is_16_bits(bool p_is_16); - void set_need_reload_hooks(bool p_needs_them); virtual void set_screen_orientation(ScreenOrientation p_orientation); virtual Error shell_open(String p_uri); @@ -241,7 +241,7 @@ public: void joy_connection_changed(int p_device, bool p_connected, String p_name); virtual bool _check_internal_feature_support(const String &p_feature); - OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetUserDataDirFunc p_get_user_data_dir_func, GetLocaleFunc p_get_locale_func, GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, VirtualKeyboardHeightFunc p_vk_height_func, SetScreenOrientationFunc p_screen_orient, GetUniqueIDFunc p_get_unique_id, GetSystemDirFunc p_get_sdir_func, GetGLVersionCodeFunc p_get_gl_version_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, SetClipboardFunc p_set_clipboard, GetClipboardFunc p_get_clipboard, bool p_use_apk_expansion); + OS_Android(GFXInitFunc p_gfx_init_func, void *p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetUserDataDirFunc p_get_user_data_dir_func, GetLocaleFunc p_get_locale_func, GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, VirtualKeyboardHeightFunc p_vk_height_func, SetScreenOrientationFunc p_screen_orient, GetUniqueIDFunc p_get_unique_id, GetSystemDirFunc p_get_sdir_func, GetGLVersionCodeFunc p_get_gl_version_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, SetClipboardFunc p_set_clipboard, GetClipboardFunc p_get_clipboard, RequestPermissionFunc p_request_permission, bool p_use_apk_expansion); ~OS_Android(); }; diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 09ded63e96..85d4b9e847 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -196,15 +196,16 @@ public: void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { - if (p_preset->get("texture_format/s3tc")) { - r_features->push_back("s3tc"); - } - if (p_preset->get("texture_format/etc")) { + String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name"); + if (driver == "GLES2") { r_features->push_back("etc"); - } - if (p_preset->get("texture_format/etc2")) { + } else if (driver == "GLES3") { r_features->push_back("etc2"); + if (ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2")) { + r_features->push_back("etc"); + } } + Vector<String> architectures = _get_preset_architectures(p_preset); for (int i = 0; i < architectures.size(); ++i) { r_features->push_back(architectures[i]); @@ -268,7 +269,6 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/push_notifications"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/camera_usage_description"), "Godot would like to use your camera")); - r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/microphone_usage_description"), "Godot would like to use your microphone")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/photolibrary_usage_description"), "Godot would like to use your photos")); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait"), true)); @@ -290,10 +290,6 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, loading_screen_infos[i].preset_key, PROPERTY_HINT_FILE, "*.png"), "")); } - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), false)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), true)); - Vector<ExportArchitecture> architectures = _get_supported_architectures(); for (int i = 0; i < architectures.size(); ++i) { r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "architectures/" + architectures[i].name), architectures[i].is_default)); @@ -402,9 +398,6 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_ } else if (lines[i].find("$camera_usage_description") != -1) { String description = p_preset->get("privacy/camera_usage_description"); strnew += lines[i].replace("$camera_usage_description", description) + "\n"; - } else if (lines[i].find("$microphone_usage_description") != -1) { - String description = p_preset->get("privacy/microphone_usage_description"); - strnew += lines[i].replace("$microphone_usage_description", description) + "\n"; } else if (lines[i].find("$photolibrary_usage_description") != -1) { String description = p_preset->get("privacy/photolibrary_usage_description"); strnew += lines[i].replace("$photolibrary_usage_description", description) + "\n"; @@ -846,6 +839,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p } } + if (!DirAccess::exists(dest_dir)) { + return ERR_FILE_BAD_PATH; + } + DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); if (da) { String current_dir = da->get_current_dir(); diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index b44b3127c7..7d0fdd2078 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -120,7 +120,7 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p RasterizerGLES3::make_current(); break; } else { - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best") { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2")) { p_video_driver = VIDEO_DRIVER_GLES2; use_gl3 = false; continue; diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 2da6ea6670..487da77b10 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -104,22 +104,27 @@ void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Re void EditorExportPlatformJavaScript::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { - if (p_preset->get("texture_format/s3tc")) { + if (p_preset->get("vram_texture_compression/for_desktop")) { r_features->push_back("s3tc"); } - if (p_preset->get("texture_format/etc")) { - r_features->push_back("etc"); - } - if (p_preset->get("texture_format/etc2")) { - r_features->push_back("etc2"); + + if (p_preset->get("vram_texture_compression/for_mobile")) { + String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name"); + if (driver == "GLES2") { + r_features->push_back("etc"); + } else if (driver == "GLES3") { + r_features->push_back("etc2"); + if (ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2")) { + r_features->push_back("etc"); + } + } } } void EditorExportPlatformJavaScript::get_export_options(List<ExportOption> *r_options) { - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), true)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_desktop"), true)); // S3TC + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "vram_texture_compression/for_mobile"), false)); // ETC or ETC2, depending on renderer r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/custom_html_shell", PROPERTY_HINT_FILE, "*.html"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/head_include", PROPERTY_HINT_MULTILINE_TEXT), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); @@ -167,16 +172,19 @@ bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p } } - String etc_error = test_etc2(); - if (etc_error != String()) { - valid = false; - err += etc_error; + r_missing_templates = !valid; + + if (p_preset->get("vram_texture_compression/for_mobile")) { + String etc_error = test_etc2(); + if (etc_error != String()) { + valid = false; + err += etc_error; + } } if (!err.empty()) r_error = err; - r_missing_templates = !valid; return valid; } @@ -206,6 +214,10 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE); } + if (!DirAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + if (template_path != String() && !FileAccess::exists(template_path)) { EditorNode::get_singleton()->show_warning(TTR("Template file not found:") + "\n" + template_path); return ERR_FILE_NOT_FOUND; @@ -355,7 +367,7 @@ Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_prese if (err) { return err; } - OS::get_singleton()->shell_open(path); + OS::get_singleton()->shell_open(String("file://") + path); return OK; } diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 57ae1b6e26..34781ce365 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -829,7 +829,7 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, RasterizerGLES3::make_current(); break; } else { - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best") { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2")) { p_video_driver = VIDEO_DRIVER_GLES2; gles3 = false; continue; diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index b8f6977b39..5e94bc457b 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -425,6 +425,10 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p } } + if (!DirAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + FileAccess *src_f = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 5206dc13b6..b45d0d80e6 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -102,8 +102,6 @@ static void push_to_key_event_buffer(const OS_OSX::KeyEvent &p_event) { static int mouse_x = 0; static int mouse_y = 0; -static int prev_mouse_x = 0; -static int prev_mouse_y = 0; static int button_mask = 0; static bool mouse_down_control = false; @@ -601,12 +599,13 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { Ref<InputEventMouseButton> mb; mb.instance(); - + const CGFloat backingScaleFactor = [[event window] backingScaleFactor]; + const Vector2 pos = get_mouse_pos([event locationInWindow], backingScaleFactor); get_key_modifier_state([event modifierFlags], mb); mb->set_button_index(index); mb->set_pressed(pressed); - mb->set_position(Vector2(mouse_x, mouse_y)); - mb->set_global_position(Vector2(mouse_x, mouse_y)); + mb->set_position(pos); + mb->set_global_position(pos); mb->set_button_mask(button_mask); if (index == BUTTON_LEFT && pressed) { mb->set_doubleclick([event clickCount] == 2); @@ -642,8 +641,6 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { mm.instance(); mm->set_button_mask(button_mask); - prev_mouse_x = mouse_x; - prev_mouse_y = mouse_y; const CGFloat backingScaleFactor = [[event window] backingScaleFactor]; const Vector2 pos = get_mouse_pos([event locationInWindow], backingScaleFactor); mm->set_position(pos); @@ -765,9 +762,41 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { [super updateTrackingAreas]; } +static bool isNumpadKey(unsigned int key) { + + static const unsigned int table[] = { + 0x41, /* kVK_ANSI_KeypadDecimal */ + 0x43, /* kVK_ANSI_KeypadMultiply */ + 0x45, /* kVK_ANSI_KeypadPlus */ + 0x47, /* kVK_ANSI_KeypadClear */ + 0x4b, /* kVK_ANSI_KeypadDivide */ + 0x4c, /* kVK_ANSI_KeypadEnter */ + 0x4e, /* kVK_ANSI_KeypadMinus */ + 0x51, /* kVK_ANSI_KeypadEquals */ + 0x52, /* kVK_ANSI_Keypad0 */ + 0x53, /* kVK_ANSI_Keypad1 */ + 0x54, /* kVK_ANSI_Keypad2 */ + 0x55, /* kVK_ANSI_Keypad3 */ + 0x56, /* kVK_ANSI_Keypad4 */ + 0x57, /* kVK_ANSI_Keypad5 */ + 0x58, /* kVK_ANSI_Keypad6 */ + 0x59, /* kVK_ANSI_Keypad7 */ + 0x5b, /* kVK_ANSI_Keypad8 */ + 0x5c, /* kVK_ANSI_Keypad9 */ + 0x5f, /* kVK_JIS_KeypadComma */ + 0x00 + }; + for (int i = 0; table[i] != 0; i++) { + if (key == table[i]) + return true; + } + return false; +} + // Translates a OS X keycode to a Godot keycode // static int translateKey(unsigned int key) { + // Keyboard symbol translation table static const unsigned int table[128] = { /* 00 */ KEY_A, @@ -780,7 +809,7 @@ static int translateKey(unsigned int key) { /* 07 */ KEY_X, /* 08 */ KEY_C, /* 09 */ KEY_V, - /* 0a */ KEY_UNKNOWN, + /* 0a */ KEY_SECTION, /* ISO Section */ /* 0b */ KEY_B, /* 0c */ KEY_Q, /* 0d */ KEY_W, @@ -834,7 +863,7 @@ static int translateKey(unsigned int key) { /* 3d */ KEY_ALT, /* 3e */ KEY_CONTROL, /* 3f */ KEY_UNKNOWN, /* Function */ - /* 40 */ KEY_UNKNOWN, + /* 40 */ KEY_UNKNOWN, /* F17 */ /* 41 */ KEY_KP_PERIOD, /* 42 */ KEY_UNKNOWN, /* 43 */ KEY_KP_MULTIPLY, @@ -842,16 +871,16 @@ static int translateKey(unsigned int key) { /* 45 */ KEY_KP_ADD, /* 46 */ KEY_UNKNOWN, /* 47 */ KEY_NUMLOCK, /* Really KeypadClear... */ - /* 48 */ KEY_UNKNOWN, /* VolumeUp */ - /* 49 */ KEY_UNKNOWN, /* VolumeDown */ - /* 4a */ KEY_UNKNOWN, /* Mute */ + /* 48 */ KEY_VOLUMEUP, /* VolumeUp */ + /* 49 */ KEY_VOLUMEDOWN, /* VolumeDown */ + /* 4a */ KEY_VOLUMEMUTE, /* Mute */ /* 4b */ KEY_KP_DIVIDE, /* 4c */ KEY_KP_ENTER, /* 4d */ KEY_UNKNOWN, /* 4e */ KEY_KP_SUBTRACT, - /* 4f */ KEY_UNKNOWN, - /* 50 */ KEY_UNKNOWN, - /* 51 */ KEY_EQUAL, //wtf equal? + /* 4f */ KEY_UNKNOWN, /* F18 */ + /* 50 */ KEY_UNKNOWN, /* F19 */ + /* 51 */ KEY_EQUAL, /* KeypadEqual */ /* 52 */ KEY_KP_0, /* 53 */ KEY_KP_1, /* 54 */ KEY_KP_2, @@ -860,27 +889,27 @@ static int translateKey(unsigned int key) { /* 57 */ KEY_KP_5, /* 58 */ KEY_KP_6, /* 59 */ KEY_KP_7, - /* 5a */ KEY_UNKNOWN, + /* 5a */ KEY_UNKNOWN, /* F20 */ /* 5b */ KEY_KP_8, /* 5c */ KEY_KP_9, - /* 5d */ KEY_UNKNOWN, - /* 5e */ KEY_UNKNOWN, - /* 5f */ KEY_UNKNOWN, + /* 5d */ KEY_YEN, /* JIS Yen */ + /* 5e */ KEY_UNDERSCORE, /* JIS Underscore */ + /* 5f */ KEY_COMMA, /* JIS KeypadComma */ /* 60 */ KEY_F5, /* 61 */ KEY_F6, /* 62 */ KEY_F7, /* 63 */ KEY_F3, /* 64 */ KEY_F8, /* 65 */ KEY_F9, - /* 66 */ KEY_UNKNOWN, + /* 66 */ KEY_UNKNOWN, /* JIS Eisu */ /* 67 */ KEY_F11, - /* 68 */ KEY_UNKNOWN, + /* 68 */ KEY_UNKNOWN, /* JIS Kana */ /* 69 */ KEY_F13, /* 6a */ KEY_F16, /* 6b */ KEY_F14, /* 6c */ KEY_UNKNOWN, /* 6d */ KEY_F10, - /* 6e */ KEY_UNKNOWN, + /* 6e */ KEY_MENU, /* 6f */ KEY_F12, /* 70 */ KEY_UNKNOWN, /* 71 */ KEY_F15, @@ -971,6 +1000,9 @@ static const _KeyCodeMap _keycodes[55] = { static int remapKey(unsigned int key) { + if (isNumpadKey(key)) + return translateKey(key); + TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); if (!currentKeyboard) return translateKey(key); @@ -1096,6 +1128,7 @@ static int remapKey(unsigned int key) { inline void sendScrollEvent(int button, double factor, int modifierFlags) { unsigned int mask = 1 << (button - 1); + Vector2 mouse_pos = Vector2(mouse_x, mouse_y); Ref<InputEventMouseButton> sc; sc.instance(); @@ -1104,14 +1137,18 @@ inline void sendScrollEvent(int button, double factor, int modifierFlags) { sc->set_button_index(button); sc->set_factor(factor); sc->set_pressed(true); - Vector2 mouse_pos = Vector2(mouse_x, mouse_y); sc->set_position(mouse_pos); sc->set_global_position(mouse_pos); button_mask |= mask; sc->set_button_mask(button_mask); OS_OSX::singleton->push_input(sc); + sc.instance(); + sc->set_button_index(button); + sc->set_factor(factor); sc->set_pressed(false); + sc->set_position(mouse_pos); + sc->set_global_position(mouse_pos); button_mask &= ~mask; sc->set_button_mask(button_mask); OS_OSX::singleton->push_input(sc); @@ -1420,7 +1457,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a RasterizerGLES3::make_current(); break; } else { - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best" || editor) { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) { p_video_driver = VIDEO_DRIVER_GLES2; gles3 = false; continue; @@ -2529,6 +2566,8 @@ void OS_OSX::process_events() { [autoreleasePool drain]; autoreleasePool = [[NSAutoreleasePool alloc] init]; + + input->flush_accumulated_events(); } void OS_OSX::process_key_events() { @@ -2571,7 +2610,7 @@ void OS_OSX::process_key_events() { void OS_OSX::push_input(const Ref<InputEvent> &p_event) { Ref<InputEvent> ev = p_event; - input->parse_input_event(ev); + input->accumulate_input_event(ev); } void OS_OSX::force_process_input() { diff --git a/platform/server/detect.py b/platform/server/detect.py index 392a987ee9..90a4092412 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -1,7 +1,10 @@ import os import platform import sys +from methods import get_compiler_version, use_gcc +# This file is mostly based on platform/x11/detect.py. +# If editing this file, make sure to apply relevant changes here too. def is_active(): return True @@ -26,10 +29,16 @@ def can_build(): def get_opts(): - from SCons.Variables import BoolVariable + from SCons.Variables import BoolVariable, EnumVariable return [ BoolVariable('use_llvm', 'Use the LLVM compiler', False), BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False), + BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), + BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), + BoolVariable('use_lsan', 'Use LLVM/GCC compiler leak sanitizer (LSAN))', False), + EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')), + BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False), + BoolVariable('execinfo', 'Use libexecinfo on systems where glibc is not available', False), ] @@ -43,13 +52,30 @@ def configure(env): ## Build type if (env["target"] == "release"): - env.Append(CCFLAGS=['-O2', '-fomit-frame-pointer']) + if (env["optimize"] == "speed"): #optimize for speed (default) + env.Prepend(CCFLAGS=['-O3']) + else: #optimize for size + env.Prepend(CCFLAGS=['-Os']) + + if (env["debug_symbols"] == "yes"): + env.Prepend(CCFLAGS=['-g1']) + if (env["debug_symbols"] == "full"): + env.Prepend(CCFLAGS=['-g2']) elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED']) + if (env["optimize"] == "speed"): #optimize for speed (default) + env.Prepend(CCFLAGS=['-O2', '-DDEBUG_ENABLED']) + else: #optimize for size + env.Prepend(CCFLAGS=['-Os', '-DDEBUG_ENABLED']) + + if (env["debug_symbols"] == "yes"): + env.Prepend(CCFLAGS=['-g1']) + if (env["debug_symbols"] == "full"): + env.Prepend(CCFLAGS=['-g2']) elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Prepend(CCFLAGS=['-g3', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + env.Append(LINKFLAGS=['-rdynamic']) ## Architecture @@ -59,6 +85,10 @@ def configure(env): ## Compiler configuration + if 'CXX' in env and 'clang' in os.path.basename(env['CXX']): + # Convenience check to enforce the use_llvm overrides when CXX is clang(++) + env['use_llvm'] = True + if env['use_llvm']: if ('clang++' not in os.path.basename(env['CXX'])): env["CC"] = "clang" @@ -67,6 +97,35 @@ def configure(env): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env.extra_suffix = ".llvm" + env.extra_suffix + + if env['use_ubsan'] or env['use_asan'] or env['use_lsan']: + env.extra_suffix += "s" + + if env['use_ubsan']: + env.Append(CCFLAGS=['-fsanitize=undefined']) + env.Append(LINKFLAGS=['-fsanitize=undefined']) + + if env['use_asan']: + env.Append(CCFLAGS=['-fsanitize=address']) + env.Append(LINKFLAGS=['-fsanitize=address']) + + if env['use_lsan']: + env.Append(CCFLAGS=['-fsanitize=leak']) + env.Append(LINKFLAGS=['-fsanitize=leak']) + + if env['use_lto']: + env.Append(CCFLAGS=['-flto']) + if not env['use_llvm'] and env.GetOption("num_jobs") > 1: + env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))]) + else: + env.Append(LINKFLAGS=['-flto']) + if not env['use_llvm']: + env['RANLIB'] = 'gcc-ranlib' + env['AR'] = 'gcc-ar' + + env.Append(CCFLAGS=['-pipe']) + env.Append(LINKFLAGS=['-pipe']) + ## Dependencies # FIXME: Check for existence of the libs before parsing their flags with pkg-config @@ -110,6 +169,10 @@ def configure(env): env['builtin_libogg'] = False # Needed to link against system libtheora env['builtin_libvorbis'] = False # Needed to link against system libtheora env.ParseConfig('pkg-config theora theoradec --cflags --libs') + else: + list_of_x86 = ['x86_64', 'x86', 'i386', 'i586'] + if any(platform.machine() in s for s in list_of_x86): + env["x86_libtheora_opt_gcc"] = True if not env['builtin_libvpx']: env.ParseConfig('pkg-config vpx --cflags --libs') @@ -163,6 +226,9 @@ def configure(env): env.Append(LIBS=['dl']) if (platform.system().find("BSD") >= 0): + env["execinfo"] = True + + if env["execinfo"]: env.Append(LIBS=['execinfo']) # Link those statically for portability diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index a4655117a7..8ccf122d9f 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1265,6 +1265,10 @@ public: } } + if (!DirAccess::exists(p_path.get_base_dir())) { + return ERR_FILE_BAD_PATH; + } + Error err = OK; FileAccess *fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err); diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 637ef5aaef..bc74da8a1b 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -202,7 +202,7 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a memdelete(gl_context); gl_context = NULL; - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best") { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2")) { if (p_video_driver == VIDEO_DRIVER_GLES2) { gl_initialization_error = true; break; @@ -224,7 +224,7 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a RasterizerGLES3::make_current(); break; } else { - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best") { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2")) { p_video_driver = VIDEO_DRIVER_GLES2; opengl_api_type = ContextEGL_UWP::GLES_2_0; continue; diff --git a/platform/windows/godot.natvis b/platform/windows/godot.natvis index 01963035a1..55c83c3f3c 100644 --- a/platform/windows/godot.natvis +++ b/platform/windows/godot.natvis @@ -2,92 +2,109 @@ <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> <Type Name="Vector<*>"> <Expand> - <Item Name="size">(_cowdata && _cowdata->_ptr) ? (((const unsigned int *)(_cowdata->_ptr))[-1]) : 0</Item> + <Item Name="[size]">_cowdata._ptr ? (((const unsigned int *)(_cowdata._ptr))[-1]) : 0</Item> <ArrayItems> - <Size>(_cowdata && _cowdata->_ptr) ? (((const unsigned int *)(_cowdata->_ptr))[-1]) : 0</Size> - <ValuePointer>(_cowdata) ? (_cowdata->_ptr) : 0</ValuePointer> + <Size>_cowdata._ptr ? (((const unsigned int *)(_cowdata._ptr))[-1]) : 0</Size> + <ValuePointer>_cowdata._ptr</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name="PoolVector<*>"> <Expand> - <Item Name="size">alloc ? (alloc->size / sizeof($T1)) : 0</Item> + <Item Name="[size]">alloc ? (alloc->size / sizeof($T1)) : 0</Item> <ArrayItems> <Size>alloc ? (alloc->size / sizeof($T1)) : 0</Size> <ValuePointer>alloc ? (($T1 *)alloc->mem) : 0</ValuePointer> </ArrayItems> </Expand> </Type> + + <Type Name="List<*>"> + <Expand> + <Item Name="[size]">_data ? (_data->size_cache) : 0</Item> + <LinkedListItems> + <Size>_data ? (_data->size_cache) : 0</Size> + <HeadPointer>_data->first</HeadPointer> + <NextPointer>next_ptr</NextPointer> + <ValueNode>value</ValueNode> + </LinkedListItems> + </Expand> + </Type> <Type Name="Variant"> - <DisplayString Condition="this->type == Variant::NIL">nil</DisplayString> - <DisplayString Condition="this->type == Variant::BOOL">{_data._bool}</DisplayString> - <DisplayString Condition="this->type == Variant::INT">{_data._int}</DisplayString> - <DisplayString Condition="this->type == Variant::REAL">{_data._real}</DisplayString> - <DisplayString Condition="this->type == Variant::TRANSFORM2D">{_data._transform2d}</DisplayString> - <DisplayString Condition="this->type == Variant::AABB">{_data._aabb}</DisplayString> - <DisplayString Condition="this->type == Variant::BASIS">{_data._basis}</DisplayString> - <DisplayString Condition="this->type == Variant::TRANSFORM">{_data._transform}</DisplayString> - <DisplayString Condition="this->type == Variant::ARRAY">{*(Array *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::STRING && ((String *)(&_data._mem[0]))->_cowdata._ptr == 0">""</DisplayString> - <DisplayString Condition="this->type == Variant::STRING && ((String *)(&_data._mem[0]))->_cowdata._ptr != 0">{((String *)(&_data._mem[0]))->_cowdata._ptr,su}</DisplayString> - <DisplayString Condition="this->type == Variant::VECTOR2">{*(Vector2 *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::RECT2">{*(Rect2 *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::VECTOR3">{*(Vector3 *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::PLANE">{*(Plane *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::QUAT">{*(Quat *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::COLOR">{*(Color *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::NODE_PATH">{*(NodePath *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::_RID">{*(RID *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::OBJECT">{*(Object *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::DICTIONARY">{*(Dictionary *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::ARRAY">{*(Array *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::POOL_BYTE_ARRAY">{*(PoolByteArray *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::POOL_INT_ARRAY">{*(PoolIntArray *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::POOL_REAL_ARRAY">{*(PoolRealArray *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::POOL_STRING_ARRAY">{*(PoolStringArray *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::POOL_VECTOR2_ARRAY">{*(PoolVector2Array *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::POOL_VECTOR3_ARRAY">{*(PoolVector3Array *)_data._mem}</DisplayString> - <DisplayString Condition="this->type == Variant::POOL_COLOR_ARRAY">{*(PoolColorArray *)_data._mem}</DisplayString> - - <StringView Condition="this->type == Variant::STRING && ((String *)(&_data._mem[0]))->_cowdata._ptr != 0">((String *)(&_data._mem[0]))->_cowdata._ptr,su</StringView> + <DisplayString Condition="type == Variant::NIL">nil</DisplayString> + <DisplayString Condition="type == Variant::BOOL">{_data._bool}</DisplayString> + <DisplayString Condition="type == Variant::INT">{_data._int}</DisplayString> + <DisplayString Condition="type == Variant::REAL">{_data._real}</DisplayString> + <DisplayString Condition="type == Variant::TRANSFORM2D">{_data._transform2d}</DisplayString> + <DisplayString Condition="type == Variant::AABB">{_data._aabb}</DisplayString> + <DisplayString Condition="type == Variant::BASIS">{_data._basis}</DisplayString> + <DisplayString Condition="type == Variant::TRANSFORM">{_data._transform}</DisplayString> + <DisplayString Condition="type == Variant::STRING">{*(String *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::VECTOR2">{*(Vector2 *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::RECT2">{*(Rect2 *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::VECTOR3">{*(Vector3 *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::PLANE">{*(Plane *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::QUAT">{*(Quat *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::COLOR">{*(Color *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::NODE_PATH">{*(NodePath *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::_RID">{*(RID *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::OBJECT">{*(Object *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::DICTIONARY">{*(Dictionary *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::ARRAY">{*(Array *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::POOL_BYTE_ARRAY">{*(PoolByteArray *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::POOL_INT_ARRAY">{*(PoolIntArray *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::POOL_REAL_ARRAY">{*(PoolRealArray *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::POOL_STRING_ARRAY">{*(PoolStringArray *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::POOL_VECTOR2_ARRAY">{*(PoolVector2Array *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::POOL_VECTOR3_ARRAY">{*(PoolVector3Array *)_data._mem}</DisplayString> + <DisplayString Condition="type == Variant::POOL_COLOR_ARRAY">{*(PoolColorArray *)_data._mem}</DisplayString> + <StringView Condition="type == Variant::STRING && ((String *)(_data._mem))->_cowdata._ptr">((String *)(_data._mem))->_cowdata._ptr,su</StringView> + <Expand> - <Item Name="value" Condition="this->type == Variant::BOOL">_data._bool</Item> - <Item Name="value" Condition="this->type == Variant::INT">_data._int</Item> - <Item Name="value" Condition="this->type == Variant::REAL">_data._real</Item> - <Item Name="value" Condition="this->type == Variant::TRANSFORM2D">_data._transform2d</Item> - <Item Name="value" Condition="this->type == Variant::AABB">_data._aabb</Item> - <Item Name="value" Condition="this->type == Variant::BASIS">_data._basis</Item> - <Item Name="value" Condition="this->type == Variant::TRANSFORM">_data._transform</Item> - <Item Name="value" Condition="this->type == Variant::ARRAY">*(Array *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::STRING">*(String *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::VECTOR2">*(Vector2 *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::RECT2">*(Rect2 *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::VECTOR3">*(Vector3 *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::PLANE">*(Plane *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::QUAT">*(Quat *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::COLOR">*(Color *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::NODE_PATH">*(NodePath *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::_RID">*(RID *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::OBJECT">*(Object *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::DICTIONARY">*(Dictionary *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::ARRAY">*(Array *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::POOL_BYTE_ARRAY">*(PoolByteArray *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::POOL_INT_ARRAY">*(PoolIntArray *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::POOL_REAL_ARRAY">*(PoolRealArray *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::POOL_STRING_ARRAY">*(PoolStringArray *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::POOL_VECTOR2_ARRAY">*(PoolVector2Array *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::POOL_VECTOR3_ARRAY">*(PoolVector3Array *)_data._mem</Item> - <Item Name="value" Condition="this->type == Variant::POOL_COLOR_ARRAY">*(PoolColorArray *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::BOOL">_data._bool</Item> + <Item Name="[value]" Condition="type == Variant::INT">_data._int</Item> + <Item Name="[value]" Condition="type == Variant::REAL">_data._real</Item> + <Item Name="[value]" Condition="type == Variant::TRANSFORM2D">_data._transform2d</Item> + <Item Name="[value]" Condition="type == Variant::AABB">_data._aabb</Item> + <Item Name="[value]" Condition="type == Variant::BASIS">_data._basis</Item> + <Item Name="[value]" Condition="type == Variant::TRANSFORM">_data._transform</Item> + <Item Name="[value]" Condition="type == Variant::STRING">*(String *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::VECTOR2">*(Vector2 *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::RECT2">*(Rect2 *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::VECTOR3">*(Vector3 *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::PLANE">*(Plane *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::QUAT">*(Quat *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::COLOR">*(Color *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::NODE_PATH">*(NodePath *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::_RID">*(RID *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::OBJECT">*(Object *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::DICTIONARY">*(Dictionary *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::ARRAY">*(Array *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::POOL_BYTE_ARRAY">*(PoolByteArray *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::POOL_INT_ARRAY">*(PoolIntArray *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::POOL_REAL_ARRAY">*(PoolRealArray *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::POOL_STRING_ARRAY">*(PoolStringArray *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::POOL_VECTOR2_ARRAY">*(PoolVector2Array *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::POOL_VECTOR3_ARRAY">*(PoolVector3Array *)_data._mem</Item> + <Item Name="[value]" Condition="type == Variant::POOL_COLOR_ARRAY">*(PoolColorArray *)_data._mem</Item> </Expand> </Type> <Type Name="String"> - <DisplayString Condition="this->_cowdata._ptr == 0">empty</DisplayString> - <DisplayString Condition="this->_cowdata._ptr != 0">{this->_cowdata._ptr,su}</DisplayString> - <StringView Condition="this->_cowdata._ptr != 0">this->_cowdata._ptr,su</StringView> + <DisplayString Condition="_cowdata._ptr == 0">[empty]</DisplayString> + <DisplayString Condition="_cowdata._ptr != 0">{_cowdata._ptr,su}</DisplayString> + <StringView Condition="_cowdata._ptr != 0">_cowdata._ptr,su</StringView> + </Type> + + <Type Name="StringName"> + <DisplayString Condition="_data && _data->cname">{_data->cname}</DisplayString> + <DisplayString Condition="_data && !_data->cname">{_data->name,su}</DisplayString> + <DisplayString Condition="!_data">[empty]</DisplayString> + <StringView Condition="_data && _data->cname">_data->cname</StringView> + <StringView Condition="_data && !_data->cname">_data->name,su</StringView> </Type> <Type Name="Vector2"> diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 61aeb3ec93..6125455e74 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -271,7 +271,7 @@ void OS_Windows::_touch_event(bool p_pressed, float p_x, float p_y, int idx) { event->set_position(Vector2(p_x, p_y)); if (main_loop) { - input->parse_input_event(event); + input->accumulate_input_event(event); } }; @@ -293,11 +293,21 @@ void OS_Windows::_drag_event(float p_x, float p_y, int idx) { event->set_position(Vector2(p_x, p_y)); if (main_loop) - input->parse_input_event(event); + input->accumulate_input_event(event); }; LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + if (drop_events) { + + if (user_proc) { + + return CallWindowProcW(user_proc, hWnd, uMsg, wParam, lParam); + } else { + return DefWindowProcW(hWnd, uMsg, wParam, lParam); + } + }; + switch (uMsg) // Check For Windows Messages { case WM_SETFOCUS: { @@ -448,7 +458,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } if (window_has_focus && main_loop && mm->get_relative() != Vector2()) - input->parse_input_event(mm); + input->accumulate_input_event(mm); } delete[] lpb; } break; @@ -535,7 +545,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) old_x = mm->get_position().x; old_y = mm->get_position().y; if (window_has_focus && main_loop) - input->parse_input_event(mm); + input->accumulate_input_event(mm); } break; case WM_LBUTTONDOWN: @@ -708,14 +718,14 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) mb->set_global_position(mb->get_position()); if (main_loop) { - input->parse_input_event(mb); + input->accumulate_input_event(mb); if (mb->is_pressed() && mb->get_button_index() > 3 && mb->get_button_index() < 8) { //send release for mouse wheel Ref<InputEventMouseButton> mbd = mb->duplicate(); last_button_state &= ~(1 << (mbd->get_button_index() - 1)); mbd->set_button_mask(last_button_state); mbd->set_pressed(false); - input->parse_input_event(mbd); + input->accumulate_input_event(mbd); } } } break; @@ -978,7 +988,7 @@ void OS_Windows::process_key_events() { if (k->get_unicode() < 32) k->set_unicode(0); - input->parse_input_event(k); + input->accumulate_input_event(k); } //do nothing @@ -1016,7 +1026,7 @@ void OS_Windows::process_key_events() { k->set_echo((ke.uMsg == WM_KEYDOWN && (ke.lParam & (1 << 30)))); - input->parse_input_event(k); + input->accumulate_input_event(k); } break; } @@ -1280,7 +1290,7 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int memdelete(gl_context); gl_context = NULL; - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best" || editor) { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) { if (p_video_driver == VIDEO_DRIVER_GLES2) { gl_initialization_error = true; break; @@ -1302,7 +1312,7 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int RasterizerGLES3::make_current(); break; } else { - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best" || editor) { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) { p_video_driver = VIDEO_DRIVER_GLES2; gles3_context = false; continue; @@ -2230,7 +2240,9 @@ void OS_Windows::process_events() { MSG msg; - joypad->process_joypads(); + if (!drop_events) { + joypad->process_joypads(); + } while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { @@ -2238,7 +2250,10 @@ void OS_Windows::process_events() { DispatchMessageW(&msg); } - process_key_events(); + if (!drop_events) { + process_key_events(); + input->flush_accumulated_events(); + } } void OS_Windows::set_cursor_shape(CursorShape p_shape) { @@ -2987,6 +3002,13 @@ bool OS_Windows::is_disable_crash_handler() const { return crash_handler.is_disabled(); } +void OS_Windows::process_and_drop_events() { + + drop_events = true; + process_events(); + drop_events = false; +} + Error OS_Windows::move_to_trash(const String &p_path) { SHFILEOPSTRUCTW sf; WCHAR *from = new WCHAR[p_path.length() + 2]; @@ -3015,6 +3037,7 @@ Error OS_Windows::move_to_trash(const String &p_path) { OS_Windows::OS_Windows(HINSTANCE _hInstance) { + drop_events = false; key_event_pos = 0; layered_window = false; hBitmap = NULL; diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 6c257016ec..2d03532c69 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -127,6 +127,7 @@ class OS_Windows : public OS { bool window_has_focus; uint32_t last_button_state; bool use_raw_input; + bool drop_events; HCURSOR cursors[CURSOR_MAX] = { NULL }; CursorShape cursor_shape; @@ -330,6 +331,8 @@ public: virtual Error move_to_trash(const String &p_path); + virtual void process_and_drop_events(); + OS_Windows(HINSTANCE _hInstance); ~OS_Windows(); }; diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index 7cf0a1ef1e..c4dd8fe0e0 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -367,12 +367,12 @@ void JoypadLinux::open_joypad(const char *p_path) { joy.fd = fd; joy.devpath = String(p_path); setup_joypad_properties(joy_num); - sprintf(uid, "%04x%04x", __bswap_16(inpid.bustype), 0); + sprintf(uid, "%04x%04x", BSWAP16(inpid.bustype), 0); if (inpid.vendor && inpid.product && inpid.version) { - uint16_t vendor = __bswap_16(inpid.vendor); - uint16_t product = __bswap_16(inpid.product); - uint16_t version = __bswap_16(inpid.version); + uint16_t vendor = BSWAP16(inpid.vendor); + uint16_t product = BSWAP16(inpid.product); + uint16_t version = BSWAP16(inpid.version); sprintf(uid + String(uid).length(), "%04x%04x%04x%04x%04x%04x", vendor, 0, product, 0, version, 0); input->joy_connection_changed(joy_num, true, name, uid); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index b7fbb89edf..0fe91f3d00 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -299,7 +299,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a memdelete(context_gl); context_gl = NULL; - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best" || editor) { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) { if (p_video_driver == VIDEO_DRIVER_GLES2) { gl_initialization_error = true; break; @@ -321,7 +321,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a RasterizerGLES3::make_current(); break; } else { - if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best" || editor) { + if (GLOBAL_GET("rendering/quality/driver/fallback_to_gles2") || editor) { p_video_driver = VIDEO_DRIVER_GLES2; opengl_api_type = ContextGL_X11::GLES_2_0_COMPATIBLE; continue; @@ -1660,7 +1660,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { k->set_shift(true); } - input->parse_input_event(k); + input->accumulate_input_event(k); } return; } @@ -1804,7 +1804,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { } //printf("key: %x\n",k->get_scancode()); - input->parse_input_event(k); + input->accumulate_input_event(k); } struct Property { @@ -1991,12 +1991,12 @@ void OS_X11::process_xevents() { // in a spurious mouse motion event being sent to Godot; remember it to be able to filter it out xi.mouse_pos_to_filter = pos; } - input->parse_input_event(st); + input->accumulate_input_event(st); } else { if (!xi.state.has(index)) // Defensive break; xi.state.erase(index); - input->parse_input_event(st); + input->accumulate_input_event(st); } } break; @@ -2014,7 +2014,7 @@ void OS_X11::process_xevents() { sd->set_index(index); sd->set_position(pos); sd->set_relative(pos - curr_pos_elem->value()); - input->parse_input_event(sd); + input->accumulate_input_event(sd); curr_pos_elem->value() = pos; } @@ -2102,7 +2102,7 @@ void OS_X11::process_xevents() { st.instance(); st->set_index(E->key()); st->set_position(E->get()); - input->parse_input_event(st); + input->accumulate_input_event(st); } xi.state.clear(); #endif @@ -2163,7 +2163,7 @@ void OS_X11::process_xevents() { } } - input->parse_input_event(mb); + input->accumulate_input_event(mb); } break; case MotionNotify: { @@ -2273,7 +2273,7 @@ void OS_X11::process_xevents() { // this is so that the relative motion doesn't get messed up // after we regain focus. if (window_has_focus || !mouse_mode_grab) - input->parse_input_event(mm); + input->accumulate_input_event(mm); } break; case KeyPress: @@ -2457,6 +2457,8 @@ void OS_X11::process_xevents() { printf("Win: %d,%d\n", win_x, win_y); */ } + + input->flush_accumulated_events(); } MainLoop *OS_X11::get_main_loop() const { @@ -3046,11 +3048,12 @@ void OS_X11::set_context(int p_context) { if (p_context == CONTEXT_ENGINE) { classHint->res_name = (char *)"Godot_Engine"; - char *config_name_tmp = (char *)((String)GLOBAL_GET("application/config/name")).utf8().ptrw(); - if (config_name_tmp) - config_name = strdup(config_name_tmp); - else + String config_name_tmp = GLOBAL_GET("application/config/name"); + if (config_name_tmp.length() > 0) { + config_name = strdup(config_name_tmp.utf8().get_data()); + } else { config_name = strdup("Godot Engine"); + } wm_class = config_name; } diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 3d7ff5f1fd..f8384bd1e4 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -93,7 +93,7 @@ Rect2 AnimatedSprite::_get_rect() const { Point2 ofs = offset; if (centered) - ofs -= s / 2; + ofs -= Size2(s) / 2; if (s == Size2(0, 0)) s = Size2(1, 1); diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 9e8bf62fc5..2a225e5797 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -428,8 +428,8 @@ void Area2D::set_monitorable(bool p_enable) { if (locked || (is_inside_tree() && Physics2DServer::get_singleton()->is_flushing_queries())) { ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitorable\",true/false)"); + ERR_FAIL(); } - ERR_FAIL_COND(locked || Physics2DServer::get_singleton()->is_flushing_queries()); if (p_enable == monitorable) return; diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 5edd49b3a3..ef7644fcab 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -78,40 +78,7 @@ void CollisionPolygon2D::_build_polygon() { } Vector<Vector<Vector2> > CollisionPolygon2D::_decompose_in_convex() { - - Vector<Vector<Vector2> > decomp; - List<TriangulatorPoly> in_poly, out_poly; - - TriangulatorPoly inp; - inp.Init(polygon.size()); - for (int i = 0; i < polygon.size(); i++) { - inp.GetPoint(i) = polygon[i]; - } - inp.SetOrientation(TRIANGULATOR_CCW); - in_poly.push_back(inp); - TriangulatorPartition tpart; - if (tpart.ConvexPartition_HM(&in_poly, &out_poly) == 0) { //failed! - ERR_PRINT("Convex decomposing failed!"); - return decomp; - } - - decomp.resize(out_poly.size()); - int idx = 0; - - for (List<TriangulatorPoly>::Element *I = out_poly.front(); I; I = I->next()) { - - TriangulatorPoly &tp = I->get(); - - decomp.write[idx].resize(tp.GetNumPoints()); - - for (int i = 0; i < tp.GetNumPoints(); i++) { - - decomp.write[idx].write[i] = tp.GetPoint(i); - } - - idx++; - } - + Vector<Vector<Vector2> > decomp = Geometry::decompose_polygon_in_convex(polygon); return decomp; } diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index c50a8d4a1a..05c2253a5b 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -37,20 +37,7 @@ void CPUParticles2D::set_emitting(bool p_emitting) { emitting = p_emitting; - if (!is_processing_internal()) { - set_process_internal(true); - if (is_inside_tree()) { -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true); - -#ifndef NO_THREADS - update_mutex->unlock(); -#endif - } - } + set_process_internal(true); } void CPUParticles2D::set_amount(int p_amount) { @@ -365,7 +352,8 @@ void CPUParticles2D::set_param_curve(Parameter p_param, const Ref<Curve> &p_curv } break; case PARAM_ANIM_OFFSET: { } break; - default: {} + default: { + } } } Ref<Curve> CPUParticles2D::get_param_curve(Parameter p_param) const { @@ -586,7 +574,7 @@ void CPUParticles2D::_particles_process(float p_delta) { if (restart_time >= prev_time && restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } @@ -594,13 +582,13 @@ void CPUParticles2D::_particles_process(float p_delta) { if (restart_time >= prev_time) { restart = true; if (fractional_delta) { - local_delta = (lifetime - restart_time + time) * lifetime; + local_delta = lifetime - restart_time + time; } } else if (restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } } @@ -941,6 +929,26 @@ void CPUParticles2D::_update_particle_data_buffer() { #endif } +void CPUParticles2D::_set_redraw(bool p_redraw) { + if (redraw == p_redraw) + return; + redraw = p_redraw; +#ifndef NO_THREADS + update_mutex->lock(); +#endif + if (redraw) { + VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); + VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true); + } else { + VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false); + } +#ifndef NO_THREADS + update_mutex->unlock(); +#endif + update(); // redraw to update render list +} + void CPUParticles2D::_update_render_thread() { #ifndef NO_THREADS @@ -957,38 +965,19 @@ void CPUParticles2D::_update_render_thread() { void CPUParticles2D::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - if (is_processing_internal()) { - -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true); - -#ifndef NO_THREADS - update_mutex->unlock(); -#endif - } + _set_redraw(true); } if (p_what == NOTIFICATION_EXIT_TREE) { - if (is_processing_internal()) { - -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false); -#ifndef NO_THREADS - update_mutex->unlock(); -#endif - } + _set_redraw(false); } if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) { } if (p_what == NOTIFICATION_DRAW) { + if (!redraw) + return; // dont add to render list RID texrid; if (texture.is_valid()) { @@ -1005,26 +994,21 @@ void CPUParticles2D::_notification(int p_what) { if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - if (particles.size() == 0 || !is_visible_in_tree()) + if (particles.size() == 0 || !is_visible_in_tree()) { + _set_redraw(false); return; + } float delta = get_process_delta_time(); if (emitting) { - + _set_redraw(true); inactive_time = 0; } else { inactive_time += delta; if (inactive_time > lifetime * 1.2) { set_process_internal(false); -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false); + _set_redraw(false); -#ifndef NO_THREADS - update_mutex->unlock(); -#endif //reset variables time = 0; inactive_time = 0; @@ -1354,6 +1338,7 @@ CPUParticles2D::CPUParticles2D() { inactive_time = 0; frame_remainder = 0; cycle = 0; + redraw = false; mesh = VisualServer::get_singleton()->mesh_create(); multimesh = VisualServer::get_singleton()->multimesh_create(); diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h index b1adf62980..23d2586331 100644 --- a/scene/2d/cpu_particles_2d.h +++ b/scene/2d/cpu_particles_2d.h @@ -103,6 +103,7 @@ private: float inactive_time; float frame_remainder; int cycle; + bool redraw; RID mesh; RID multimesh; @@ -179,6 +180,8 @@ private: void _update_mesh_texture(); + void _set_redraw(bool p_redraw); + protected: static void _bind_methods(); void _notification(int p_what); diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index eeabe15b08..1b7e1a6b8b 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -1198,6 +1198,9 @@ bool KinematicBody2D::separate_raycast_shapes(bool p_infinite_inertia, Collision bool KinematicBody2D::move_and_collide(const Vector2 &p_motion, bool p_infinite_inertia, Collision &r_collision, bool p_exclude_raycast_shapes, bool p_test_only) { + if (sync_to_physics) { + ERR_PRINT("Functions move_and_slide and move_and_collide do not work together with 'sync to physics' option. Please read the documentation."); + } Transform2D gt = get_global_transform(); Physics2DServer::MotionResult result; bool colliding = Physics2DServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, margin, &result, p_exclude_raycast_shapes); diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 1c58073f1d..f6f1bad581 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -307,7 +307,9 @@ void Polygon2D::_notification(int p_what) { if (invert || polygons.size() == 0) { Vector<int> indices = Geometry::triangulate_polygon(points); - VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID()); + if (indices.size()) { + VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID()); + } } else { //draw individual polygons Vector<int> total_indices; diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index ba103a8bf0..a8c7622828 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -363,7 +363,7 @@ Rect2 Sprite::get_rect() const { Point2 ofs = offset; if (centered) - ofs -= s / 2; + ofs -= Size2(s) / 2; if (s == Size2(0, 0)) s = Size2(1, 1); diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 91e4f061cb..ed0a9c4915 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -479,10 +479,28 @@ void TileMap::update_dirty_quadrants() { vs->canvas_item_add_set_transform(debug_canvas_item, xform); shape->draw(debug_canvas_item, debug_collision_color); } - ps->body_add_shape(q.body, shape->get_rid(), xform); - ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y)); - ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[j].one_way_collision, shapes[j].one_way_collision_margin); - shape_idx++; + + if (shape->has_meta("decomposed")) { + Array _shapes = shape->get_meta("decomposed"); + for (int k = 0; k < _shapes.size(); k++) { + Ref<ConvexPolygonShape2D> convex = _shapes[k]; + if (convex.is_valid()) { + ps->body_add_shape(q.body, convex->get_rid(), xform); + ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y)); + ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[j].one_way_collision, shapes[j].one_way_collision_margin); + shape_idx++; +#ifdef DEBUG_ENABLED + } else { + print_error("The TileSet asigned to the TileMap " + get_name() + " has an invalid convex shape."); +#endif + } + } + } else { + ps->body_add_shape(q.body, shape->get_rid(), xform); + ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y)); + ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[j].one_way_collision, shapes[j].one_way_collision_margin); + shape_idx++; + } } } } diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 9e15a416b2..e58e26d2d1 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -441,8 +441,8 @@ void Area::set_monitorable(bool p_enable) { if (locked || (is_inside_tree() && PhysicsServer::get_singleton()->is_flushing_queries())) { ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitorable\",true/false)"); + ERR_FAIL(); } - ERR_FAIL_COND(locked || PhysicsServer::get_singleton()->is_flushing_queries()); if (p_enable == monitorable) return; diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index daee291ba3..ac33e2b714 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -124,6 +124,10 @@ String CollisionShape::get_configuration_warning() const { return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it!"); } + if (shape->is_class("PlaneShape")) { + return TTR("Plane shapes don't work well and will be removed in future versions. Please don't use them."); + } + return String(); } diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 11dfbdb1f9..85bc2dd529 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -47,20 +47,7 @@ PoolVector<Face3> CPUParticles::get_faces(uint32_t p_usage_flags) const { void CPUParticles::set_emitting(bool p_emitting) { emitting = p_emitting; - if (!is_processing_internal()) { - set_process_internal(true); - if (is_inside_tree()) { -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true); - -#ifndef NO_THREADS - update_mutex->unlock(); -#endif - } - } + set_process_internal(true); } void CPUParticles::set_amount(int p_amount) { @@ -343,7 +330,8 @@ void CPUParticles::set_param_curve(Parameter p_param, const Ref<Curve> &p_curve) } break; case PARAM_ANIM_OFFSET: { } break; - default: {} + default: { + } } } Ref<Curve> CPUParticles::get_param_curve(Parameter p_param) const { @@ -556,7 +544,7 @@ void CPUParticles::_particles_process(float p_delta) { if (restart_time >= prev_time && restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } @@ -564,13 +552,13 @@ void CPUParticles::_particles_process(float p_delta) { if (restart_time >= prev_time) { restart = true; if (fractional_delta) { - local_delta = (1.0 - restart_time + time) * lifetime; + local_delta = lifetime - restart_time + time; } } else if (restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } } @@ -1004,6 +992,25 @@ void CPUParticles::_update_particle_data_buffer() { #endif } +void CPUParticles::_set_redraw(bool p_redraw) { + if (redraw == p_redraw) + return; + redraw = p_redraw; +#ifndef NO_THREADS + update_mutex->lock(); +#endif + if (redraw) { + VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); + VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true); + } else { + VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); + VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false); + } +#ifndef NO_THREADS + update_mutex->unlock(); +#endif +} + void CPUParticles::_update_render_thread() { #ifndef NO_THREADS @@ -1022,31 +1029,11 @@ void CPUParticles::_update_render_thread() { void CPUParticles::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - if (is_processing_internal()) { - -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true); -#ifndef NO_THREADS - update_mutex->unlock(); -#endif - } + _set_redraw(true); } if (p_what == NOTIFICATION_EXIT_TREE) { - if (is_processing_internal()) { - -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false); -#ifndef NO_THREADS - update_mutex->unlock(); -#endif - } + _set_redraw(false); } if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) { @@ -1054,26 +1041,22 @@ void CPUParticles::_notification(int p_what) { if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - if (particles.size() == 0 || !is_visible_in_tree()) + if (particles.size() == 0 || !is_visible_in_tree()) { + _set_redraw(false); return; + } float delta = get_process_delta_time(); if (emitting) { + _set_redraw(true); inactive_time = 0; } else { inactive_time += delta; if (inactive_time > lifetime * 1.2) { set_process_internal(false); -#ifndef NO_THREADS - update_mutex->lock(); -#endif - VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); - VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false); + _set_redraw(false); -#ifndef NO_THREADS - update_mutex->unlock(); -#endif //reset variables time = 0; inactive_time = 0; @@ -1406,6 +1389,7 @@ CPUParticles::CPUParticles() { inactive_time = 0; frame_remainder = 0; cycle = 0; + redraw = false; multimesh = VisualServer::get_singleton()->multimesh_create(); set_base(multimesh); diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h index b50befe7be..b863a3cb3f 100644 --- a/scene/3d/cpu_particles.h +++ b/scene/3d/cpu_particles.h @@ -104,6 +104,7 @@ private: float inactive_time; float frame_remainder; int cycle; + bool redraw; RID multimesh; @@ -178,6 +179,8 @@ private: void _update_render_thread(); + void _set_redraw(bool p_redraw); + protected: static void _bind_methods(); void _notification(int p_what); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 5b08ea7790..c491275f00 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -30,6 +30,8 @@ #include "gi_probe.h" +#include "core/os/os.h" + #include "mesh_instance.h" #include "voxel_light_baker.h" @@ -490,6 +492,14 @@ PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { return PoolVector<Face3>(); } +String GIProbe::get_configuration_warning() const { + + if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) { + return TTR("GIProbes are not supported by the GLES2 video driver.\nUse a BakedLightmap instead."); + } + return String(); +} + void GIProbe::_bind_methods() { ClassDB::bind_method(D_METHOD("set_probe_data", "data"), &GIProbe::set_probe_data); diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 87664e06b8..4badabbadf 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -168,6 +168,8 @@ public: virtual AABB get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual String get_configuration_warning() const; + GIProbe(); ~GIProbe(); }; diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 3b514dab8c..cf1af918f7 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -210,6 +210,13 @@ bool Light::is_editor_only() const { return editor_only; } +void Light::_validate_property(PropertyInfo &property) const { + + if (VisualServer::get_singleton()->is_low_end() && property.name == "shadow_contact") { + property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL; + } +} + void Light::_bind_methods() { ClassDB::bind_method(D_METHOD("set_editor_only", "editor_only"), &Light::set_editor_only); diff --git a/scene/3d/light.h b/scene/3d/light.h index 85e0ce3c24..ddd5bc6b3a 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -92,6 +92,7 @@ protected: static void _bind_methods(); void _notification(int p_what); + virtual void _validate_property(PropertyInfo &property) const; Light(VisualServer::LightType p_type); diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index ab1eed0859..05214ed669 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -1104,10 +1104,10 @@ void RigidBody::_reload_physics_characteristics() { ////////////////////////////////////////////////////// ////////////////////////// -Ref<KinematicCollision> KinematicBody::_move(const Vector3 &p_motion, bool p_infinite_inertia, bool p_test_only) { +Ref<KinematicCollision> KinematicBody::_move(const Vector3 &p_motion, bool p_infinite_inertia, bool p_exclude_raycast_shapes, bool p_test_only) { Collision col; - if (move_and_collide(p_motion, p_infinite_inertia, col, p_test_only)) { + if (move_and_collide(p_motion, p_infinite_inertia, col, p_exclude_raycast_shapes, p_test_only)) { if (motion_cache.is_null()) { motion_cache.instance(); motion_cache->owner = this; @@ -1121,11 +1121,11 @@ Ref<KinematicCollision> KinematicBody::_move(const Vector3 &p_motion, bool p_inf return Ref<KinematicCollision>(); } -bool KinematicBody::move_and_collide(const Vector3 &p_motion, bool p_infinite_inertia, Collision &r_collision, bool p_test_only) { +bool KinematicBody::move_and_collide(const Vector3 &p_motion, bool p_infinite_inertia, Collision &r_collision, bool p_exclude_raycast_shapes, bool p_test_only) { Transform gt = get_global_transform(); PhysicsServer::MotionResult result; - bool colliding = PhysicsServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, &result); + bool colliding = PhysicsServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, &result, p_exclude_raycast_shapes); if (colliding) { r_collision.collider_metadata = result.collider_metadata; @@ -1280,7 +1280,7 @@ Vector3 KinematicBody::move_and_slide_with_snap(const Vector3 &p_linear_velocity Collision col; Transform gt = get_global_transform(); - if (move_and_collide(p_snap, p_infinite_inertia, col, true)) { + if (move_and_collide(p_snap, p_infinite_inertia, col, false, true)) { bool apply = true; if (p_floor_direction != Vector3()) { @@ -1415,7 +1415,7 @@ Ref<KinematicCollision> KinematicBody::_get_slide_collision(int p_bounce) { void KinematicBody::_bind_methods() { - ClassDB::bind_method(D_METHOD("move_and_collide", "rel_vec", "infinite_inertia", "test_only"), &KinematicBody::_move, DEFVAL(true), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("move_and_collide", "rel_vec", "infinite_inertia", "exclude_raycast_shapes", "test_only"), &KinematicBody::_move, DEFVAL(true), DEFVAL(true), DEFVAL(false)); ClassDB::bind_method(D_METHOD("move_and_slide", "linear_velocity", "floor_normal", "stop_on_slope", "max_slides", "floor_max_angle", "infinite_inertia"), &KinematicBody::move_and_slide, DEFVAL(Vector3(0, 0, 0)), DEFVAL(false), DEFVAL(4), DEFVAL(Math::deg2rad((float)45)), DEFVAL(true)); ClassDB::bind_method(D_METHOD("move_and_slide_with_snap", "linear_velocity", "snap", "floor_normal", "stop_on_slope", "max_slides", "floor_max_angle", "infinite_inertia"), &KinematicBody::move_and_slide_with_snap, DEFVAL(Vector3(0, 0, 0)), DEFVAL(false), DEFVAL(4), DEFVAL(Math::deg2rad((float)45)), DEFVAL(true)); diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index 5570d0c86b..589af98062 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -310,14 +310,14 @@ private: _FORCE_INLINE_ bool _ignores_mode(PhysicsServer::BodyMode) const; - Ref<KinematicCollision> _move(const Vector3 &p_motion, bool p_infinite_inertia = true, bool p_test_only = false); + Ref<KinematicCollision> _move(const Vector3 &p_motion, bool p_infinite_inertia = true, bool p_exclude_raycast_shapes = true, bool p_test_only = false); Ref<KinematicCollision> _get_slide_collision(int p_bounce); protected: static void _bind_methods(); public: - bool move_and_collide(const Vector3 &p_motion, bool p_infinite_inertia, Collision &r_collisionz, bool p_test_only = false); + bool move_and_collide(const Vector3 &p_motion, bool p_infinite_inertia, Collision &r_collisionz, bool p_exclude_raycast_shapes = true, bool p_test_only = false); bool test_move(const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia); bool separate_raycast_shapes(bool p_infinite_inertia, Collision &r_collision); diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index ceea50f74a..b7279e4d4f 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -198,11 +198,7 @@ void Skeleton::_notification(int p_what) { case NOTIFICATION_ENTER_WORLD: { - if (dirty) { - - dirty = false; - _make_dirty(); // property make it dirty - } + VS::get_singleton()->skeleton_set_world_transform(skeleton, use_bones_in_world_transform, get_global_transform()); } break; case NOTIFICATION_EXIT_WORLD: { @@ -210,21 +206,7 @@ void Skeleton::_notification(int p_what) { } break; case NOTIFICATION_TRANSFORM_CHANGED: { - if (dirty) - break; //will be eventually updated - - //if moved, just update transforms - VisualServer *vs = VisualServer::get_singleton(); - const Bone *bonesptr = bones.ptr(); - int len = bones.size(); - Transform global_transform = get_global_transform(); - Transform global_transform_inverse = global_transform.affine_inverse(); - - for (int i = 0; i < len; i++) { - - const Bone &b = bonesptr[i]; - vs->skeleton_bone_set_transform(skeleton, i, global_transform * (b.transform_final * global_transform_inverse)); - } + VS::get_singleton()->skeleton_set_world_transform(skeleton, use_bones_in_world_transform, get_global_transform()); } break; case NOTIFICATION_UPDATE_SKELETON: { @@ -257,9 +239,6 @@ void Skeleton::_notification(int p_what) { rest_global_inverse_dirty = false; } - Transform global_transform = get_global_transform(); - Transform global_transform_inverse = global_transform.affine_inverse(); - for (int i = 0; i < len; i++) { Bone &b = bonesptr[order[i]]; @@ -320,7 +299,7 @@ void Skeleton::_notification(int p_what) { } b.transform_final = b.pose_global * b.rest_global_inverse; - vs->skeleton_bone_set_transform(skeleton, order[i], global_transform * (b.transform_final * global_transform_inverse)); + vs->skeleton_bone_set_transform(skeleton, order[i], b.transform_final); for (List<uint32_t>::Element *E = b.nodes_bound.front(); E; E = E->next()) { @@ -594,10 +573,6 @@ void Skeleton::_make_dirty() { if (dirty) return; - if (!is_inside_tree()) { - dirty = true; - return; - } MessageQueue::get_singleton()->push_notification(this, NOTIFICATION_UPDATE_SKELETON); dirty = true; } @@ -771,6 +746,16 @@ void Skeleton::physical_bones_remove_collision_exception(RID p_exception) { #endif // _3D_DISABLED +void Skeleton::set_use_bones_in_world_transform(bool p_enable) { + use_bones_in_world_transform = p_enable; + if (is_inside_tree()) { + VS::get_singleton()->skeleton_set_world_transform(skeleton, use_bones_in_world_transform, get_global_transform()); + } +} +bool Skeleton::is_using_bones_in_world_transform() const { + return use_bones_in_world_transform; +} + void Skeleton::_bind_methods() { ClassDB::bind_method(D_METHOD("add_bone", "name"), &Skeleton::add_bone); @@ -807,6 +792,9 @@ void Skeleton::_bind_methods() { ClassDB::bind_method(D_METHOD("get_bone_transform", "bone_idx"), &Skeleton::get_bone_transform); + ClassDB::bind_method(D_METHOD("set_use_bones_in_world_transform", "enable"), &Skeleton::set_use_bones_in_world_transform); + ClassDB::bind_method(D_METHOD("is_using_bones_in_world_transform"), &Skeleton::is_using_bones_in_world_transform); + #ifndef _3D_DISABLED ClassDB::bind_method(D_METHOD("physical_bones_stop_simulation"), &Skeleton::physical_bones_stop_simulation); @@ -818,6 +806,7 @@ void Skeleton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bone_ignore_animation", "bone", "ignore"), &Skeleton::set_bone_ignore_animation); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "bones_in_world_transform"), "set_use_bones_in_world_transform", "is_using_bones_in_world_transform"); BIND_CONSTANT(NOTIFICATION_UPDATE_SKELETON); } @@ -828,6 +817,7 @@ Skeleton::Skeleton() { process_order_dirty = true; skeleton = VisualServer::get_singleton()->skeleton_create(); set_notify_transform(true); + use_bones_in_world_transform = false; } Skeleton::~Skeleton() { diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index 0f463c9ea7..5f43b3c6c3 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -100,6 +100,7 @@ class Skeleton : public Spatial { void _make_dirty(); bool dirty; + bool use_bones_in_world_transform; // bind helpers Array _get_bound_child_nodes_to_bone(int p_bone) const { @@ -179,6 +180,9 @@ public: void localize_rests(); // used for loaders and tools int get_process_order(int p_idx); + void set_use_bones_in_world_transform(bool p_enable); + bool is_using_bones_in_world_transform() const; + #ifndef _3D_DISABLED // Physical bone API diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index d6544c39da..83f99a2e3c 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -178,7 +178,7 @@ void Spatial::_notification(int p_what) { get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_enter_world, NULL, 0); } #ifdef TOOLS_ENABLED - if (Engine::get_singleton()->is_editor_hint()) { + if (Engine::get_singleton()->is_editor_hint() && get_tree()->is_node_being_edited(this)) { //get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this); get_tree()->call_group_flags(0, SceneStringNames::get_singleton()->_spatial_editor_group, SceneStringNames::get_singleton()->_request_gizmo, this); diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 43ec8cebb0..016db15b73 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -287,7 +287,6 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) { // broken track (nonexistent bone) p_anim->node_cache[i]->skeleton = NULL; p_anim->node_cache[i]->spatial = NULL; - printf("bone is %ls\n", String(bone_name).c_str()); ERR_CONTINUE(p_anim->node_cache[i]->bone_idx < 0); } } else { @@ -1133,8 +1132,6 @@ void AnimationPlayer::play_backwards(const StringName &p_name, float p_custom_bl void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float p_custom_scale, bool p_from_end) { - //printf("animation is %ls\n", String(p_name).c_str()); - //ERR_FAIL_COND(!is_inside_scene()); StringName name = p_name; if (String(name) == "") diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 5c95cf4279..2688041d18 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -91,8 +91,10 @@ void AudioStreamPlayer::_mix_internal(bool p_fadeout) { void AudioStreamPlayer::_mix_audio() { - if (!stream_playback.is_valid() || !active) + if (!stream_playback.is_valid() || !active || + (stream_paused && !stream_fade)) { return; + } if (stream_fade) { _mix_internal(true); diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 2579321773..7f1ca58d58 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -169,6 +169,19 @@ void Container::_notification(int p_what) { } } +String Container::get_configuration_warning() const { + + String warning = Control::get_configuration_warning(); + + if (get_class() == "Container" && get_script().is_null()) { + if (warning != String()) { + warning += "\n"; + } + warning += TTR("Container by itself serves no purpose unless a script configures it's children placement behavior.\nIf you dont't intend to add a script, then please use a plain 'Control' node instead."); + } + return warning; +} + void Container::_bind_methods() { ClassDB::bind_method(D_METHOD("_sort_children"), &Container::_sort_children); diff --git a/scene/gui/container.h b/scene/gui/container.h index 0b014137f4..80d3f6ee5d 100644 --- a/scene/gui/container.h +++ b/scene/gui/container.h @@ -57,6 +57,8 @@ public: void fit_child_in_rect(Control *p_child, const Rect2 &p_rect); + virtual String get_configuration_warning() const; + Container(); }; diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 5599c64daa..059e59ea21 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -861,7 +861,7 @@ FileDialog::FileDialog() { HBoxContainer *hbc = memnew(HBoxContainer); dir_up = memnew(ToolButton); - dir_up->set_tooltip(RTR("Go to parent folder")); + dir_up->set_tooltip(RTR("Go to parent folder.")); hbc->add_child(dir_up); dir_up->connect("pressed", this, "_go_up"); @@ -871,6 +871,7 @@ FileDialog::FileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); + refresh->set_tooltip(RTR("Refresh")); refresh->connect("pressed", this, "_update_file_list"); hbc->add_child(refresh); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 8c588109d6..e8692d56d2 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -164,7 +164,6 @@ void GraphNode::_resort() { vofs += size.y; } - _change_notify(); update(); connpos_dirty = true; } @@ -409,9 +408,12 @@ Size2 GraphNode::get_minimum_size() const { void GraphNode::set_title(const String &p_title) { + if (title == p_title) + return; title = p_title; - minimum_size_changed(); update(); + _change_notify("title"); + minimum_size_changed(); } String GraphNode::get_title() const { diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 28292309b9..e50a71b0ff 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -368,8 +368,10 @@ void ScrollContainer::update_scrollbars() { Ref<StyleBox> sb = get_stylebox("bg"); size -= sb->get_minimum_size(); - Size2 hmin = h_scroll->get_combined_minimum_size(); - Size2 vmin = v_scroll->get_combined_minimum_size(); + Size2 hmin; + Size2 vmin; + if (scroll_h) hmin = h_scroll->get_combined_minimum_size(); + if (scroll_v) vmin = v_scroll->get_combined_minimum_size(); Size2 min = child_max_size; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f38bc62a3c..2bf2364873 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -666,7 +666,7 @@ void TextEdit::_notification(int p_what) { bool brace_close_matching = false; bool brace_close_mismatch = false; - if (brace_matching_enabled) { + if (brace_matching_enabled && cursor.line >= 0 && cursor.line < text.size() && cursor.column >= 0) { if (cursor.column < text[cursor.line].length()) { //check for open diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 236c4dbe63..49cad6fccf 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1416,12 +1416,15 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 TreeItem *c = p_item->children; + int prev_ofs = children_pos.y - cache.offset.y + p_draw_ofs.y; + while (c) { if (cache.draw_relationship_lines > 0 && (!hide_root || c->parent != root)) { int root_ofs = children_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin); int parent_ofs = p_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin); Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h / 2) - cache.offset + p_draw_ofs; + if (c->get_children() != NULL) root_pos -= Point2i(cache.arrow->get_width(), 0); @@ -1434,12 +1437,13 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 if (root_pos.y + line_width >= 0) { VisualServer::get_singleton()->canvas_item_add_line(ci, root_pos, Point2i(parent_pos.x - Math::floor(line_width / 2), root_pos.y), cache.relationship_line_color, line_width); - VisualServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y), parent_pos, cache.relationship_line_color, line_width); + VisualServer::get_singleton()->canvas_item_add_line(ci, Point2i(parent_pos.x, root_pos.y), Point2i(parent_pos.x, prev_ofs), cache.relationship_line_color, line_width); } if (htotal < 0) { return -1; } + prev_ofs = root_pos.y; } if (htotal >= 0) { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 0fa36cc308..a5d86c3e1a 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -232,16 +232,16 @@ void Viewport::update_worlds() { find_world()->_update(get_tree()->get_frame()); } -void Viewport::_collision_object_input_event(CollisionObject *p_object, Camera *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape, bool p_discard_empty_motion) { +void Viewport::_collision_object_input_event(CollisionObject *p_object, Camera *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) { Transform object_transform = p_object->get_global_transform(); Transform camera_transform = p_camera->get_global_transform(); ObjectID id = p_object->get_instance_id(); - if (p_discard_empty_motion) { - //avoid sending the event unnecessarily if nothing really changed in the context + //avoid sending the fake event unnecessarily if nothing really changed in the context + if (object_transform == physics_last_object_transform && camera_transform == physics_last_camera_transform && physics_last_id == id) { Ref<InputEventMouseMotion> mm = p_input_event; - if (mm.is_valid() && object_transform == physics_last_object_transform && camera_transform == physics_last_camera_transform && physics_last_id == id) { + if (mm.is_valid() && mm->get_device() == InputEvent::DEVICE_ID_INTERNAL) { return; //discarded } } @@ -251,31 +251,6 @@ void Viewport::_collision_object_input_event(CollisionObject *p_object, Camera * physics_last_id = id; } -void Viewport::_test_new_mouseover(ObjectID new_collider) { -#ifndef _3D_DISABLED - if (new_collider != physics_object_over) { - - if (physics_object_over) { - - CollisionObject *co = Object::cast_to<CollisionObject>(ObjectDB::get_instance(physics_object_over)); - if (co) { - co->_mouse_exit(); - } - } - - if (new_collider) { - - CollisionObject *co = Object::cast_to<CollisionObject>(ObjectDB::get_instance(new_collider)); - if (co) { - co->_mouse_enter(); - } - } - - physics_object_over = new_collider; - } -#endif -} - void Viewport::_notification(int p_what) { switch (p_what) { @@ -422,22 +397,22 @@ void Viewport::_notification(int p_what) { PhysicsDirectSpaceState::RayResult result; Physics2DDirectSpaceState *ss2d = Physics2DServer::get_singleton()->space_get_direct_state(find_world_2d()->get_space()); - bool discard_empty_motion = false; - - { // if no motion event exists, create a new one. This is necessary because objects or camera may have moved. + if (physics_has_last_mousepos) { + // if no mouse event exists, create a motion one. This is necessary because objects or camera may have moved. // while this extra event is sent, it is checked if both camera and last object and last ID did not move. If nothing changed, the event is discarded to avoid flooding with unnecessary motion events every frame - bool has_mouse_motion = false; + bool has_mouse_event = false; for (List<Ref<InputEvent> >::Element *E = physics_picking_events.front(); E; E = E->next()) { - Ref<InputEventMouseMotion> mm = E->get(); - if (mm.is_valid()) { - has_mouse_motion = true; + Ref<InputEventMouse> m = E->get(); + if (m.is_valid()) { + has_mouse_event = true; break; } } - if (!has_mouse_motion && physics_has_last_mousepos) { + if (!has_mouse_event) { Ref<InputEventMouseMotion> mm; mm.instance(); + mm->set_device(InputEvent::DEVICE_ID_INTERNAL); mm->set_global_position(physics_last_mousepos); mm->set_position(physics_last_mousepos); mm->set_alt(physics_last_mouse_state.alt); @@ -446,25 +421,24 @@ void Viewport::_notification(int p_what) { mm->set_metakey(physics_last_mouse_state.meta); mm->set_button_mask(physics_last_mouse_state.mouse_mask); physics_picking_events.push_back(mm); - discard_empty_motion = true; } } - bool motion_tested = false; - while (physics_picking_events.size()) { Ref<InputEvent> ev = physics_picking_events.front()->get(); physics_picking_events.pop_front(); Vector2 pos; + bool is_mouse = false; Ref<InputEventMouseMotion> mm = ev; if (mm.is_valid()) { pos = mm->get_position(); - motion_tested = true; + is_mouse = true; + physics_has_last_mousepos = true; physics_last_mousepos = pos; physics_last_mouse_state.alt = mm->get_alt(); @@ -477,7 +451,12 @@ void Viewport::_notification(int p_what) { Ref<InputEventMouseButton> mb = ev; if (mb.is_valid()) { + pos = mb->get_position(); + is_mouse = true; + + physics_has_last_mousepos = true; + physics_last_mousepos = pos; physics_last_mouse_state.alt = mb->get_alt(); physics_last_mouse_state.shift = mb->get_shift(); physics_last_mouse_state.control = mb->get_control(); @@ -487,6 +466,11 @@ void Viewport::_notification(int p_what) { physics_last_mouse_state.mouse_mask |= (1 << (mb->get_button_index() - 1)); } else { physics_last_mouse_state.mouse_mask &= ~(1 << (mb->get_button_index() - 1)); + + // If touch mouse raised, assume we don't know last mouse pos until new events come + if (mb->get_device() == InputEvent::DEVICE_ID_TOUCH_MOUSE) { + physics_has_last_mousepos = false; + } } } @@ -539,40 +523,51 @@ void Viewport::_notification(int p_what) { if (res[i].collider_id && res[i].collider) { CollisionObject2D *co = Object::cast_to<CollisionObject2D>(res[i].collider); if (co) { - - Map<ObjectID, uint64_t>::Element *F = physics_2d_mouseover.find(res[i].collider_id); - if (!F) { - F = physics_2d_mouseover.insert(res[i].collider_id, frame); - co->_mouse_enter(); - } else { - F->get() = frame; + bool send_event = true; + if (is_mouse) { + Map<ObjectID, uint64_t>::Element *F = physics_2d_mouseover.find(res[i].collider_id); + + if (!F) { + F = physics_2d_mouseover.insert(res[i].collider_id, frame); + co->_mouse_enter(); + } else { + F->get() = frame; + // It was already hovered, so don't send the event if it's faked + if (mm.is_valid() && mm->get_device() == InputEvent::DEVICE_ID_INTERNAL) { + send_event = false; + } + } } - co->_input_event(this, ev, res[i].shape); + if (send_event) { + co->_input_event(this, ev, res[i].shape); + } } } } } - List<Map<ObjectID, uint64_t>::Element *> to_erase; + if (is_mouse) { + List<Map<ObjectID, uint64_t>::Element *> to_erase; - for (Map<ObjectID, uint64_t>::Element *E = physics_2d_mouseover.front(); E; E = E->next()) { - if (E->get() != frame) { - Object *o = ObjectDB::get_instance(E->key()); - if (o) { + for (Map<ObjectID, uint64_t>::Element *E = physics_2d_mouseover.front(); E; E = E->next()) { + if (E->get() != frame) { + Object *o = ObjectDB::get_instance(E->key()); + if (o) { - CollisionObject2D *co = Object::cast_to<CollisionObject2D>(o); - if (co) { - co->_mouse_exit(); + CollisionObject2D *co = Object::cast_to<CollisionObject2D>(o); + if (co) { + co->_mouse_exit(); + } } + to_erase.push_back(E); } - to_erase.push_back(E); } - } - while (to_erase.size()) { - physics_2d_mouseover.erase(to_erase.front()->get()); - to_erase.pop_front(); + while (to_erase.size()) { + physics_2d_mouseover.erase(to_erase.front()->get()); + to_erase.pop_front(); + } } } @@ -583,7 +578,7 @@ void Viewport::_notification(int p_what) { CollisionObject *co = Object::cast_to<CollisionObject>(ObjectDB::get_instance(physics_object_capture)); if (co) { - _collision_object_input_event(co, camera, ev, Vector3(), Vector3(), 0, discard_empty_motion); + _collision_object_input_event(co, camera, ev, Vector3(), Vector3(), 0); captured = true; if (mb.is_valid() && mb->get_button_index() == 1 && !mb->is_pressed()) { physics_object_capture = 0; @@ -601,7 +596,7 @@ void Viewport::_notification(int p_what) { if (last_id) { if (ObjectDB::get_instance(last_id) && last_object) { //good, exists - _collision_object_input_event(last_object, camera, ev, result.position, result.normal, result.shape, discard_empty_motion); + _collision_object_input_event(last_object, camera, ev, result.position, result.normal, result.shape); if (last_object->get_capture_input_on_drag() && mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) { physics_object_capture = last_id; } @@ -624,7 +619,7 @@ void Viewport::_notification(int p_what) { CollisionObject *co = Object::cast_to<CollisionObject>(result.collider); if (co) { - _collision_object_input_event(co, camera, ev, result.position, result.normal, result.shape, discard_empty_motion); + _collision_object_input_event(co, camera, ev, result.position, result.normal, result.shape); last_object = co; last_id = result.collider_id; new_collider = last_id; @@ -634,35 +629,30 @@ void Viewport::_notification(int p_what) { } } - if (mm.is_valid()) { - _test_new_mouseover(new_collider); - } - } + if (is_mouse && new_collider != physics_object_over) { - last_pos = pos; - } - } - } + if (physics_object_over) { - if (!motion_tested && camera && physics_has_last_mousepos) { + CollisionObject *co = Object::cast_to<CollisionObject>(ObjectDB::get_instance(physics_object_over)); + if (co) { + co->_mouse_exit(); + } + } - //test anyway for mouseenter/exit because objects might move - Vector3 from = camera->project_ray_origin(physics_last_mousepos); - Vector3 dir = camera->project_ray_normal(physics_last_mousepos); + if (new_collider) { - PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space()); - if (space) { + CollisionObject *co = Object::cast_to<CollisionObject>(ObjectDB::get_instance(new_collider)); + if (co) { + co->_mouse_enter(); + } + } - bool col = space->intersect_ray(from, from + dir * 10000, result, Set<RID>(), 0xFFFFFFFF, true, true, true); - ObjectID new_collider = 0; - if (col) { - CollisionObject *co = Object::cast_to<CollisionObject>(result.collider); - if (co) { - new_collider = result.collider_id; + physics_object_over = new_collider; + } } - } - _test_new_mouseover(new_collider); + last_pos = pos; + } } #endif } @@ -1784,13 +1774,15 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { */ gui.mouse_focus = _gui_find_control(pos); - gui.mouse_focus_mask = 1 << (mb->get_button_index() - 1); gui.last_mouse_focus = gui.mouse_focus; if (!gui.mouse_focus) { + gui.mouse_focus_mask = 0; return; } + gui.mouse_focus_mask = 1 << (mb->get_button_index() - 1); + if (mb->get_button_index() == BUTTON_LEFT) { gui.drag_accum = Vector2(); gui.drag_attempted = false; @@ -2304,32 +2296,32 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { if (from && p_event->is_pressed()) { Control *next = NULL; - if (p_event->is_action("ui_focus_next")) { + if (p_event->is_action_pressed("ui_focus_next")) { next = from->find_next_valid_focus(); } - if (p_event->is_action("ui_focus_prev")) { + if (p_event->is_action_pressed("ui_focus_prev")) { next = from->find_prev_valid_focus(); } - if (!mods && p_event->is_action("ui_up")) { + if (!mods && p_event->is_action_pressed("ui_up")) { next = from->_get_focus_neighbour(MARGIN_TOP); } - if (!mods && p_event->is_action("ui_left")) { + if (!mods && p_event->is_action_pressed("ui_left")) { next = from->_get_focus_neighbour(MARGIN_LEFT); } - if (!mods && p_event->is_action("ui_right")) { + if (!mods && p_event->is_action_pressed("ui_right")) { next = from->_get_focus_neighbour(MARGIN_RIGHT); } - if (!mods && p_event->is_action("ui_down")) { + if (!mods && p_event->is_action_pressed("ui_down")) { next = from->_get_focus_neighbour(MARGIN_BOTTOM); } @@ -2924,6 +2916,13 @@ bool Viewport::is_handling_input_locally() const { return handle_input_locally; } +void Viewport::_validate_property(PropertyInfo &property) const { + + if (VisualServer::get_singleton()->is_low_end() && property.name == "hdr") { + property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL; + } +} + void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_arvr", "use"), &Viewport::set_use_arvr); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 4d0a4e8c87..831c285517 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -221,12 +221,11 @@ private: } physics_last_mouse_state; - void _collision_object_input_event(CollisionObject *p_object, Camera *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape, bool p_discard_empty_motion); + void _collision_object_input_event(CollisionObject *p_object, Camera *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape); bool handle_input_locally; bool local_input_handled; - void _test_new_mouseover(ObjectID new_collider); Map<ObjectID, uint64_t> physics_2d_mouseover; Ref<World2D> world_2d; @@ -390,6 +389,7 @@ private: protected: void _notification(int p_what); static void _bind_methods(); + virtual void _validate_property(PropertyInfo &property) const; public: Listener *get_listener() const; diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 2af92a788e..3eb16c544c 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1836,9 +1836,14 @@ Variant Animation::value_track_interpolate(int p_track, float p_time) const { void Animation::_value_track_get_key_indices_in_range(const ValueTrack *vt, float from_time, float to_time, List<int> *p_indices) const { if (from_time != length && to_time == length) - to_time = length * 1.01; //include a little more if at the end + to_time = length * 1.001; //include a little more if at the end int to = _find(vt->values, to_time); + if (to >= 0 && from_time == to_time && vt->values[to].time == from_time) { + //find exact (0 delta), return if found + p_indices->push_back(to); + return; + } // can't really send the events == time, will be sent in the next frame. // if event>=len then it will probably never be requested by the anim player. @@ -1884,7 +1889,7 @@ void Animation::value_track_get_key_indices(int p_track, float p_time, float p_d if (from_time > to_time) { // handle loop by splitting - _value_track_get_key_indices_in_range(vt, length - from_time, length, p_indices); + _value_track_get_key_indices_in_range(vt, from_time, length, p_indices); _value_track_get_key_indices_in_range(vt, 0, to_time, p_indices); return; } diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index a89cf108bc..4b3e392013 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -515,10 +515,10 @@ PoolVector<uint8_t> AudioStreamSample::get_data() const { return pv; } -void AudioStreamSample::save_to_wav(String p_path) { +Error AudioStreamSample::save_to_wav(const String &p_path) { if (format == AudioStreamSample::FORMAT_IMA_ADPCM) { WARN_PRINTS("Saving IMA_ADPC samples are not supported yet"); - return; + return ERR_UNAVAILABLE; } int sub_chunk_2_size = data_bytes; //Subchunk2Size = Size of data in bytes @@ -544,8 +544,9 @@ void AudioStreamSample::save_to_wav(String p_path) { file_path += ".wav"; } - Error err; - FileAccess *file = FileAccess::open(file_path, FileAccess::WRITE, &err); //Overrides existing file if present + FileAccessRef file = FileAccess::open(file_path, FileAccess::WRITE); //Overrides existing file if present + + ERR_FAIL_COND_V(!file, ERR_FILE_CANT_WRITE); // Create WAV Header file->store_string("RIFF"); //ChunkID @@ -583,6 +584,8 @@ void AudioStreamSample::save_to_wav(String p_path) { } file->close(); + + return OK; } Ref<AudioStreamPlayback> AudioStreamSample::instance_playback() { diff --git a/scene/resources/audio_stream_sample.h b/scene/resources/audio_stream_sample.h index bd701ddd12..d4c5511f34 100644 --- a/scene/resources/audio_stream_sample.h +++ b/scene/resources/audio_stream_sample.h @@ -141,7 +141,7 @@ public: void set_data(const PoolVector<uint8_t> &p_data); PoolVector<uint8_t> get_data() const; - void save_to_wav(String p_path); + Error save_to_wav(const String &p_path); virtual Ref<AudioStreamPlayback> instance_playback(); virtual String get_stream_name() const; diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 99440ff202..626ed9f5b4 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -177,8 +177,8 @@ Node *SceneState::instance(GenEditState p_edit_state) const { node = Object::cast_to<Node>(obj); } else { - print_line("Class is disabled for: " + itos(n.type)); - print_line("name: " + String(snames[n.type])); + //print_line("Class is disabled for: " + itos(n.type)); + //print_line("name: " + String(snames[n.type])); } if (node) { diff --git a/scene/resources/sky.cpp b/scene/resources/sky.cpp index dfbf619c01..f9f8ff19e4 100644 --- a/scene/resources/sky.cpp +++ b/scene/resources/sky.cpp @@ -536,7 +536,7 @@ void ProceduralSky::_bind_methods() { BIND_ENUM_CONSTANT(TEXTURE_SIZE_MAX); } -ProceduralSky::ProceduralSky() { +ProceduralSky::ProceduralSky(bool p_desaturate) { sky = VS::get_singleton()->sky_create(); texture = VS::get_singleton()->texture_create(); @@ -552,6 +552,12 @@ ProceduralSky::ProceduralSky() { ground_curve = 0.02; ground_energy = 1; + if (p_desaturate) { + sky_top_color.set_hsv(sky_top_color.get_h(),0,sky_top_color.get_v()); + sky_horizon_color.set_hsv(sky_horizon_color.get_h(),0,sky_horizon_color.get_v()); + ground_bottom_color.set_hsv(ground_bottom_color.get_h(),0,ground_bottom_color.get_v()); + ground_horizon_color.set_hsv(ground_horizon_color.get_h(),0,ground_horizon_color.get_v()); + } sun_color = Color(1, 1, 1); sun_latitude = 35; sun_longitude = 0; diff --git a/scene/resources/sky.h b/scene/resources/sky.h index 3b410396e0..7327b2a627 100644 --- a/scene/resources/sky.h +++ b/scene/resources/sky.h @@ -191,7 +191,7 @@ public: virtual RID get_rid() const; - ProceduralSky(); + ProceduralSky(bool p_desaturate=false); ~ProceduralSky(); }; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 08b2a05d43..3ca2b56d08 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -842,6 +842,12 @@ void StreamTexture::reload_from_file() { load(path); } +void StreamTexture::_validate_property(PropertyInfo &property) const { + if (property.name == "flags") { + property.usage = PROPERTY_USAGE_NOEDITOR; + } +} + void StreamTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("load", "path"), &StreamTexture::load); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 21d3782897..281a33929c 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -203,6 +203,7 @@ private: protected: static void _bind_methods(); + void _validate_property(PropertyInfo &property) const; public: typedef void (*TextureFormatRequestCallback)(const Ref<StreamTexture> &); diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 3c83de91fd..4ddfc0331b 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -30,6 +30,7 @@ #include "tile_set.h" #include "core/array.h" +#include "core/engine.h" bool TileSet::_set(const StringName &p_name, const Variant &p_value) { @@ -662,6 +663,7 @@ void TileSet::tile_set_shape(int p_id, int p_shape_id, const Ref<Shape2D> &p_sha if (tile_map[p_id].shapes_data.size() <= p_shape_id) tile_map[p_id].shapes_data.resize(p_shape_id + 1); tile_map[p_id].shapes_data.write[p_shape_id].shape = p_shape; + _decompose_convex_shape(p_shape); emit_changed(); } @@ -844,6 +846,9 @@ void TileSet::tile_set_shapes(int p_id, const Vector<ShapeData> &p_shapes) { ERR_FAIL_COND(!tile_map.has(p_id)); tile_map[p_id].shapes_data = p_shapes; + for (int i = 0; i < p_shapes.size(); i++) { + _decompose_convex_shape(p_shapes[i].shape); + } emit_changed(); } @@ -888,9 +893,10 @@ void TileSet::_tile_set_shapes(int p_id, const Array &p_shapes) { } else if (p_shapes[i].get_type() == Variant::DICTIONARY) { Dictionary d = p_shapes[i]; - if (d.has("shape") && d["shape"].get_type() == Variant::OBJECT) + if (d.has("shape") && d["shape"].get_type() == Variant::OBJECT) { s.shape = d["shape"]; - else + _decompose_convex_shape(s.shape); + } else continue; if (d.has("shape_transform") && d["shape_transform"].get_type() == Variant::TRANSFORM2D) @@ -956,6 +962,26 @@ Array TileSet::_get_tiles_ids() const { return arr; } +void TileSet::_decompose_convex_shape(Ref<Shape2D> p_shape) { + if (Engine::get_singleton()->is_editor_hint()) + return; + Ref<ConvexPolygonShape2D> convex = p_shape; + if (!convex.is_valid()) + return; + Vector<Vector<Vector2> > decomp = Geometry::decompose_polygon_in_convex(convex->get_points()); + if (decomp.size() > 1) { + Array sub_shapes; + for (int i = 0; i < decomp.size(); i++) { + Ref<ConvexPolygonShape2D> _convex = memnew(ConvexPolygonShape2D); + _convex->set_points(decomp[i]); + sub_shapes.append(_convex); + } + convex->set_meta("decomposed", sub_shapes); + } else { + convex->set_meta("decomposed", Variant()); + } +} + void TileSet::get_tile_list(List<int> *p_tiles) const { for (Map<int, TileData>::Element *E = tile_map.front(); E; E = E->next()) { diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 4800371d3c..fac48243d0 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -35,6 +35,7 @@ #include "core/resource.h" #include "scene/2d/light_occluder_2d.h" #include "scene/2d/navigation_polygon.h" +#include "scene/resources/convex_polygon_shape_2d.h" #include "scene/resources/shape_2d.h" #include "scene/resources/texture.h" @@ -134,6 +135,7 @@ protected: void _tile_set_shapes(int p_id, const Array &p_shapes); Array _tile_get_shapes(int p_id) const; Array _get_tiles_ids() const; + void _decompose_convex_shape(Ref<Shape2D> p_shape); static void _bind_methods(); diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index a6c262d10f..1a6430c499 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -150,7 +150,7 @@ void AudioStreamPlaybackMicrophone::_mix_internal(AudioFrame *p_buffer, int p_fr input_ofs = 0; } else { for (int i = 0; i < p_frames; i++) { - if (input_size > input_ofs) { + if (input_size > input_ofs && (int)input_ofs < buf.size()) { float l = (buf[input_ofs++] >> 16) / 32768.f; if ((int)input_ofs >= buf.size()) { input_ofs = 0; diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index df6218ac79..8c092a02a2 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -90,12 +90,16 @@ void AudioDriver::input_buffer_init(int driver_buffer_frames) { void AudioDriver::input_buffer_write(int32_t sample) { - input_buffer.write[input_position++] = sample; - if ((int)input_position >= input_buffer.size()) { - input_position = 0; - } - if ((int)input_size < input_buffer.size()) { - input_size++; + if ((int)input_position < input_buffer.size()) { + input_buffer.write[input_position++] = sample; + if ((int)input_position >= input_buffer.size()) { + input_position = 0; + } + if ((int)input_size < input_buffer.size()) { + input_size++; + } + } else { + WARN_PRINTS("input_buffer_write: Invalid input_position=" + itos(input_position) + " input_buffer.size()=" + itos(input_buffer.size())); } } @@ -145,6 +149,8 @@ AudioDriver::AudioDriver() { _last_mix_time = 0; _mix_amount = 0; + input_position = 0; + input_size = 0; #ifdef DEBUG_ENABLED prof_time = 0; @@ -253,11 +259,13 @@ void AudioServer::_driver_process(int p_frames, int32_t *p_buffer) { float l = CLAMP(buf[from + j].l, -1.0, 1.0); int32_t vl = l * ((1 << 20) - 1); - p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 0] = vl << 11; + int32_t vl2 = (vl < 0 ? -1 : 1) * (ABS(vl) << 11); + p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 0] = vl2; float r = CLAMP(buf[from + j].r, -1.0, 1.0); int32_t vr = r * ((1 << 20) - 1); - p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 1] = vr << 11; + int32_t vr2 = (vr < 0 ? -1 : 1) * (ABS(vr) << 11); + p_buffer[(from_buf + j) * (cs * 2) + k * 2 + 1] = vr2; } } else { diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 2975ae9453..36d18e8901 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -40,10 +40,10 @@ #include "joints/pin_joint_sw.h" #include "joints/slider_joint_sw.h" -#define FLUSH_QUERY_CHECK \ - if (flushing_queries) { \ - ERR_EXPLAIN("Can't change this state while flushing queries. Use call_deferred()/set_deferred() to change monitoring state instead"); \ - ERR_FAIL(); \ +#define FLUSH_QUERY_CHECK(m_object) \ + if (m_object->get_space() && flushing_queries) { \ + ERR_EXPLAIN("Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead"); \ + ERR_FAIL(); \ } RID PhysicsServerSW::shape_create(ShapeType p_shape) { @@ -358,11 +358,10 @@ void PhysicsServerSW::area_clear_shapes(RID p_area) { void PhysicsServerSW::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) { - FLUSH_QUERY_CHECK - AreaSW *area = area_owner.get(p_area); ERR_FAIL_COND(!area); ERR_FAIL_INDEX(p_shape_idx, area->get_shape_count()); + FLUSH_QUERY_CHECK(area); area->set_shape_as_disabled(p_shape_idx, p_disabled); } @@ -443,10 +442,9 @@ void PhysicsServerSW::area_set_collision_mask(RID p_area, uint32_t p_mask) { void PhysicsServerSW::area_set_monitorable(RID p_area, bool p_monitorable) { - FLUSH_QUERY_CHECK - AreaSW *area = area_owner.get(p_area); ERR_FAIL_COND(!area); + FLUSH_QUERY_CHECK(area); area->set_monitorable(p_monitorable); } @@ -592,11 +590,11 @@ RID PhysicsServerSW::body_get_shape(RID p_body, int p_shape_idx) const { void PhysicsServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) { - FLUSH_QUERY_CHECK - BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count()); + FLUSH_QUERY_CHECK(body); + body->set_shape_as_disabled(p_shape_idx, p_disabled); } diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index 4d1c56b843..283d20876d 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -36,8 +36,8 @@ #include "core/project_settings.h" #include "core/script_language.h" -#define FLUSH_QUERY_CHECK \ - if (flushing_queries) { \ +#define FLUSH_QUERY_CHECK(m_object) \ + if (m_object->get_space() && flushing_queries) { \ ERR_EXPLAIN("Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead"); \ ERR_FAIL(); \ } @@ -410,12 +410,11 @@ void Physics2DServerSW::area_set_shape_transform(RID p_area, int p_shape_idx, co void Physics2DServerSW::area_set_shape_disabled(RID p_area, int p_shape, bool p_disabled) { - FLUSH_QUERY_CHECK - Area2DSW *area = area_owner.get(p_area); ERR_FAIL_COND(!area); - ERR_FAIL_INDEX(p_shape, area->get_shape_count()); + FLUSH_QUERY_CHECK(area); + area->set_shape_as_disabled(p_shape, p_disabled); } @@ -550,10 +549,9 @@ void Physics2DServerSW::area_set_pickable(RID p_area, bool p_pickable) { void Physics2DServerSW::area_set_monitorable(RID p_area, bool p_monitorable) { - FLUSH_QUERY_CHECK - Area2DSW *area = area_owner.get(p_area); ERR_FAIL_COND(!area); + FLUSH_QUERY_CHECK(area); area->set_monitorable(p_monitorable); } @@ -630,10 +628,9 @@ RID Physics2DServerSW::body_get_space(RID p_body) const { void Physics2DServerSW::body_set_mode(RID p_body, BodyMode p_mode) { - FLUSH_QUERY_CHECK - Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); + FLUSH_QUERY_CHECK(body); body->set_mode(p_mode); }; @@ -734,12 +731,10 @@ void Physics2DServerSW::body_clear_shapes(RID p_body) { void Physics2DServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) { - FLUSH_QUERY_CHECK - Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); - ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count()); + FLUSH_QUERY_CHECK(body); body->set_shape_as_disabled(p_shape_idx, p_disabled); } @@ -747,8 +742,8 @@ void Physics2DServerSW::body_set_shape_as_one_way_collision(RID p_body, int p_sh Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); - ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count()); + FLUSH_QUERY_CHECK(body); body->set_shape_as_one_way_collision(p_shape_idx, p_enable, p_margin); } diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 922f017d0b..0cc1cc119c 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -73,7 +73,11 @@ static void _debugger_get_resource_usage(List<ScriptDebuggerRemote::ResourceUsag usage.vram = E->get().bytes; usage.id = E->get().texture; usage.type = "Texture"; - usage.format = itos(E->get().width) + "x" + itos(E->get().height) + " " + Image::get_format_name(E->get().format); + if (E->get().depth == 0) { + usage.format = itos(E->get().width) + "x" + itos(E->get().height) + " " + Image::get_format_name(E->get().format); + } else { + usage.format = itos(E->get().width) + "x" + itos(E->get().height) + "x" + itos(E->get().depth) + " " + Image::get_format_name(E->get().format); + } r_usage->push_back(usage); } } diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 8502ef5bf7..dd54698471 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -355,6 +355,7 @@ public: virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) = 0; virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const = 0; virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) = 0; + virtual void skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_world_transform) = 0; /* Light API */ diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index fb57de5a7b..85dcaa6b03 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -758,11 +758,12 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector Item *canvas_item = canvas_item_owner.getornull(p_item); ERR_FAIL_COND(!canvas_item); - int ps = p_points.size(); - ERR_FAIL_COND(!p_colors.empty() && p_colors.size() != ps && p_colors.size() != 1); - ERR_FAIL_COND(!p_uvs.empty() && p_uvs.size() != ps); - ERR_FAIL_COND(!p_bones.empty() && p_bones.size() != ps * 4); - ERR_FAIL_COND(!p_weights.empty() && p_weights.size() != ps * 4); + int vertex_count = p_points.size(); + ERR_FAIL_COND(vertex_count == 0); + ERR_FAIL_COND(!p_colors.empty() && p_colors.size() != vertex_count && p_colors.size() != 1); + ERR_FAIL_COND(!p_uvs.empty() && p_uvs.size() != vertex_count); + ERR_FAIL_COND(!p_bones.empty() && p_bones.size() != vertex_count * 4); + ERR_FAIL_COND(!p_weights.empty() && p_weights.size() != vertex_count * 4); Vector<int> indices = p_indices; @@ -770,9 +771,9 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector if (indices.empty()) { - ERR_FAIL_COND(ps % 3 != 0); + ERR_FAIL_COND(vertex_count % 3 != 0); if (p_count == -1) - count = ps; + count = vertex_count; } else { ERR_FAIL_COND(indices.size() % 3 != 0); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 6622433b17..a9ca920178 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -123,7 +123,6 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) { frame_drawn_callbacks.pop_front(); } - VS::get_singleton()->emit_signal("frame_post_draw"); } void VisualServerRaster::sync() { diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 89a759b963..a1204c7573 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -296,6 +296,7 @@ public: BIND3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &) BIND2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int) BIND2(skeleton_set_base_transform_2d, RID, const Transform2D &) + BIND3(skeleton_set_world_transform, RID, bool, const Transform &) /* Light API */ diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h index 4e3015c020..5176551540 100644 --- a/servers/visual/visual_server_viewport.h +++ b/servers/visual/visual_server_viewport.h @@ -90,7 +90,8 @@ public: } CanvasKey(const RID &p_canvas, int p_layer, int p_sublayer) { canvas = p_canvas; - stacking = ((int64_t)p_layer << 32) + p_sublayer; + int64_t sign = p_layer < 0 ? -1 : 1; + stacking = sign * (((int64_t)ABS(p_layer)) << 32) + p_sublayer; } int get_layer() const { return stacking >> 32; } }; diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index a6f0bd9d16..c6da6799a5 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -232,6 +232,7 @@ public: FUNC3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &) FUNC2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int) FUNC2(skeleton_set_base_transform_2d, RID, const Transform2D &) + FUNC3(skeleton_set_world_transform, RID, bool, const Transform &) /* Light API */ diff --git a/servers/visual_server.h b/servers/visual_server.h index 96a5d19efd..63ddc3328a 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -393,6 +393,7 @@ public: virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) = 0; virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const = 0; virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) = 0; + virtual void skeleton_set_world_transform(RID p_skeleton, bool p_enable, const Transform &p_base_transform) = 0; /* Light API */ diff --git a/thirdparty/README.md b/thirdparty/README.md index 994a320122..4fb4786d67 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -19,7 +19,7 @@ comments. ## bullet - Upstream: https://github.com/bulletphysics/bullet3 -- Version: git (126b676, 2018-12-31) +- Version: 2.88 - License: zlib Files extracted from upstream source: @@ -128,7 +128,7 @@ Files extracted from upstream source: ## glad - Upstream: https://github.com/Dav1dde/glad -- Version: 0.1.28 +- Version: 0.1.29 - License: MIT The files we package are automatically generated. @@ -239,7 +239,7 @@ from the Android NDK r18. ## libwebp - Upstream: https://chromium.googlesource.com/webm/libwebp/ -- Version: 1.0.1 +- Version: 1.0.2 - License: BSD-3-Clause Files extracted from upstream source: @@ -255,23 +255,25 @@ changes are marked with `// -- GODOT --` comments. ## libwebsockets - Upstream: https://github.com/warmcat/libwebsockets -- Version: 3.0.0 +- Version: 3.1.0 - License: LGPLv2.1 + static linking exception File extracted from upstream source: -- From `lib/` into `thirdparty/libwebsockets`: +- From `lib/` into `thirdparty/libwebsockets/lib`: - Everything from `core` - - From `event-libs` only the `poll` subfolder - - From `misc` only `base64-decode.c`, `getifaddrs.c`, `getifaddrs.h`, `lejp.c`, and `sha-1.c` - - From `plat` only `lws-plat-unix.c` and `lws-plat-win.c` + - From `event-libs` only the `poll` subfolder and the `private.h` header + - From `misc` only `base64-decode.c`, `getifaddrs.c`, `getifaddrs.h`, `lejp.c`, and `sha-1.c` (and the `private.h` header) + - From `plat` everything from `unix` and `windows` (and the `private.h` header) - From `roles` only `private.h`, `h1`, `http`, `listen`, `pipe`, `raw`, `ws` - - From `roles/http` exclude `minilex.c` + - From `roles/http` exclude `minilex.c` and the `compression` subfolder - From `roles/http/server` exclude `access-log.c`, `lws-spa.c`, `ranges.c`, and `rewrite.c` - From `roles/ws` exclude `ext` folder. - From `tls` exclude `openssl` folder. - Also copy `win32helpers/` from `win32port/` inside `thirdparty/libwebsockets` - A fix has been added to allow building for 32-bits UWP, replacing `GetFileSize[Ex]` and `CreateFileW` with supported functions. There is a diff for this change in `thirdparty/libwebsockets/uwp_fixes.diff` +- A fix to disable V6ONLY flag from IPv6 sockets (on by default on some systems) has been also applied. + The diff for this change can be found in `thirdparty/libwebsockets/ipv6_fixes.diff` Important: `lws_config.h` and `lws_config_private.h` contains custom Godot build configurations, check them out when updating. @@ -292,10 +294,11 @@ File extracted from upstream release tarball `mbedtls-2.16.0-apache.tgz`: ## miniupnpc - Upstream: https://github.com/miniupnp/miniupnp/tree/master/miniupnpc -- Version: 2.1 (git 25615e0, 2018-05-08) with modifications +- Version: git (25615e0, 2018) - License: BSD-3-Clause -The only modified file is miniupnpcstrings.h, which was created for Godot (is usually autogenerated by cmake). +The only modified file is miniupnpcstrings.h, which was created for Godot +(it is usually autogenerated by cmake). ## minizip @@ -380,7 +383,7 @@ Collection of single-file libraries used in Godot components. - `ifaddrs-android.{cc,h}` * Upstream: https://chromium.googlesource.com/external/webrtc/stable/talk/+/master/base/ifaddrs-android.h - * Version: 5976650 (2013) + * Version: git (5976650, 2013) * License: BSD-3-Clause ### scene @@ -395,18 +398,18 @@ Collection of single-file libraries used in Godot components. * License: zlib - `stb_truetype.h` * Upstream: https://github.com/nothings/stb - * Version: 1.19 + * Version: 1.21 * License: Public Domain (Unlicense) or MIT - `stb_vorbis.c` * Upstream: https://github.com/nothings/stb - * Version: 1.14 + * Version: 1.15 * License: Public Domain (Unlicense) or MIT ## nanosvg - Upstream: https://github.com/memononen/nanosvg -- Version: 9a74da4 (git) +- Version: git (c1f6e20, 2018) - License: zlib Files extracted from the upstream source: @@ -435,16 +438,16 @@ Files extracted from upstream source: ## pcre2 - Upstream: http://www.pcre.org/ -- Version: 10.31 +- Version: 10.32 - License: BSD-3-Clause Files extracted from upstream source: - Files listed in the file NON-AUTOTOOLS-BUILD steps 1-4 -- All .h files in src/ +- All .h files in src/ apart from pcre2posix.h +- src/pcre2_jit_compile.c - src/pcre2_jit_match.c - src/pcre2_jit_misc.c -- src/pcre2_jit_maketables.c - src/sljit/* - AUTHORS and LICENCE @@ -506,7 +509,7 @@ changes are marked with `// -- GODOT --` comments. ## tinyexr - Upstream: https://github.com/syoyo/tinyexr -- Version: git (5ae30aa, 2018) +- Version: git (65f9859, 2018) - License: BSD-3-Clause Files extracted from upstream source: diff --git a/thirdparty/glad/LICENSE b/thirdparty/glad/LICENSE new file mode 100644 index 0000000000..b6e2ca25b0 --- /dev/null +++ b/thirdparty/glad/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013-2018 David Herberth + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c index 8cc09e46e1..e7c64a7e17 100644 --- a/thirdparty/glad/glad.c +++ b/thirdparty/glad/glad.c @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.28 on Thu Nov 22 16:50:04 2018. + OpenGL loader generated by glad 0.1.29 on Mon Mar 4 12:47:22 2019. Language/Generator: C/C++ Specification: gl @@ -180,11 +180,7 @@ static int get_exts(void) { num_exts_i = 0; glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); if (num_exts_i > 0) { - char **tmp_exts_i = (char **)realloc((void *)exts_i, (size_t)num_exts_i * (sizeof *exts_i)); - if (tmp_exts_i == NULL) { - return 0; - } - exts_i = tmp_exts_i; + exts_i = (char **)malloc((size_t)num_exts_i * (sizeof *exts_i)); } if (exts_i == NULL) { diff --git a/thirdparty/glad/glad/glad.h b/thirdparty/glad/glad/glad.h index 52b05e0ae6..6345de6f7a 100644 --- a/thirdparty/glad/glad/glad.h +++ b/thirdparty/glad/glad/glad.h @@ -1,6 +1,6 @@ /* - OpenGL loader generated by glad 0.1.28 on Thu Nov 22 16:50:04 2018. + OpenGL loader generated by glad 0.1.29 on Mon Mar 4 12:47:22 2019. Language/Generator: C/C++ Specification: gl diff --git a/thirdparty/libpng/LICENSE b/thirdparty/libpng/LICENSE index 6ee9c8f554..62ab8e48dc 100644 --- a/thirdparty/libpng/LICENSE +++ b/thirdparty/libpng/LICENSE @@ -1,14 +1,43 @@ +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= -This copy of the libpng notices is provided for your convenience. In case of -any discrepancy between this copy and the notices in the file png.h that is -included in the libpng distribution, the latter shall prevail. +PNG Reference Library License version 2 +--------------------------------------- -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + * Copyright (c) 1995-2018 The PNG Reference Library Authors. + * Copyright (c) 2018 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. -If you modify libpng you may insert additional notices immediately following -this sentence. +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no even shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. -This code is released under the libpng license. +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are @@ -16,38 +45,38 @@ derived from libpng-1.0.6, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: - Simon-Pierre Cadieux - Eric S. Raymond - Mans Rullgard - Cosmin Truta - Gilles Vollant - James Yu - Mandar Sahastrabuddhe - Google Inc. - Vadim Barkov + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov and with the following additions to the disclaimer: - There is no warranty against interference with your enjoyment of the - library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes - or needs. This library is provided with all faults, and the entire - risk of satisfactory quality, performance, accuracy, and effort is with - the user. + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. Some files in the "contrib" directory and some configure-generated -files that are distributed with libpng have other copyright owners and +files that are distributed with libpng have other copyright owners, and are released under other open source licenses. libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from libpng-0.96, and are distributed according to the same disclaimer and -license as libpng-0.96, with the following individuals added to the list -of Contributing Authors: +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik libpng versions 0.89, June 1996, through 0.96, May 1997, are Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, @@ -55,14 +84,14 @@ and are distributed according to the same disclaimer and license as libpng-0.88, with the following individuals added to the list of Contributing Authors: - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner -Some files in the "scripts" directory have other copyright owners +Some files in the "scripts" directory have other copyright owners, but are released under this license. libpng versions 0.5, May 1995, through 0.88, January 1996, are @@ -71,63 +100,35 @@ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. For the purposes of this copyright and license, "Contributing Authors" is defined as the following set of individuals: - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner - -The PNG Reference Library is supplied "AS IS". The Contributing Authors -and Group 42, Inc. disclaim all warranties, expressed or implied, -including, without limitation, the warranties of merchantability and of -fitness for any purpose. The Contributing Authors and Group 42, Inc. -assume no liability for direct, indirect, incidental, special, exemplary, -or consequential damages, which may result from the use of the PNG -Reference Library, even if advised of the possibility of such damage. + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, for any purpose, without fee, subject to the following restrictions: - 1. The origin of this source code must not be misrepresented. - - 2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. - - 3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - -The Contributing Authors and Group 42, Inc. specifically permit, without -fee, and encourage the use of this source code as a component to -supporting the PNG file format in commercial products. If you use this -source code in a product, acknowledgment is not required but would be -appreciated. - -END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. - -TRADEMARK: - -The name "libpng" has not been registered by the Copyright owner -as a trademark in any jurisdiction. However, because libpng has -been distributed and maintained world-wide, continually since 1995, -the Copyright owner claims "common-law trademark protection" in any -jurisdiction where common-law trademark is recognized. - -OSI CERTIFICATION: - -Libpng is OSI Certified Open Source Software. OSI Certified Open Source is -a certification mark of the Open Source Initiative. OSI has not addressed -the additional disclaimers inserted at version 1.0.7. + 1. The origin of this source code must not be misrepresented. -EXPORT CONTROL: + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. -The Copyright owner believes that the Export Control Classification -Number (ECCN) for libpng is EAR99, which means not subject to export -controls or International Traffic in Arms Regulations (ITAR) because -it is open source, publicly available software, that does not contain -any encryption software. See the EAR, paragraphs 734.3(b)(3) and -734.7(b). + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. -Glenn Randers-Pehrson -glennrp at users.sourceforge.net -July 15, 2018 +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. diff --git a/thirdparty/libpng/arm/arm_init.c b/thirdparty/libpng/arm/arm_init.c index 02df812e77..a34ecdbef7 100644 --- a/thirdparty/libpng/arm/arm_init.c +++ b/thirdparty/libpng/arm/arm_init.c @@ -1,14 +1,15 @@ /* arm_init.c - NEON optimised filter functions * + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 2014,2016 Glenn Randers-Pehrson * Written by Mans Rullgard, 2011. - * Last changed in libpng 1.6.22 [May 26, 2016] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ + /* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are * called. */ diff --git a/thirdparty/libpng/arm/filter_neon.S b/thirdparty/libpng/arm/filter_neon.S index 000764cd21..2308aad13e 100644 --- a/thirdparty/libpng/arm/filter_neon.S +++ b/thirdparty/libpng/arm/filter_neon.S @@ -1,9 +1,9 @@ /* filter_neon.S - NEON optimised filter functions * + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 2014,2017 Glenn Randers-Pehrson * Written by Mans Rullgard, 2011. - * Last changed in libpng 1.6.31 [July 27, 2017] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/thirdparty/libpng/arm/filter_neon_intrinsics.c b/thirdparty/libpng/arm/filter_neon_intrinsics.c index ea7e356bcc..553c0be21c 100644 --- a/thirdparty/libpng/arm/filter_neon_intrinsics.c +++ b/thirdparty/libpng/arm/filter_neon_intrinsics.c @@ -1,12 +1,11 @@ /* filter_neon_intrinsics.c - NEON optimised filter functions * + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 2014,2016 Glenn Randers-Pehrson * Written by James Yu <james.yu at linaro.org>, October 2013. * Based on filter_neon.S, written by Mans Rullgard, 2011. * - * Last changed in libpng 1.6.22 [May 26, 2016] - * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h @@ -19,7 +18,11 @@ /* This code requires -mfpu=neon on the command line: */ #if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */ -#include <arm_neon.h> +#if defined(_MSC_VER) && defined(_M_ARM64) +# include <arm64_neon.h> +#else +# include <arm_neon.h> +#endif /* libpng row pointers are not necessarily aligned to any particular boundary, * however this code will only work with appropriate alignment. arm/arm_init.c @@ -33,6 +36,11 @@ * 'type'. This is written this way just to hide the GCC strict aliasing * warning; note that the code is safe because there never is an alias between * the input and output pointers. + * + * When compiling with MSVC ARM64, the png_ldr macro can't be passed directly + * to vst4_lane_u32, because of an internal compiler error inside MSVC. + * To avoid this compiler bug, we use a temporary variable (vdest_val) to store + * the result of png_ldr. */ #define png_ldr(type,pointer)\ (temp_pointer = png_ptr(type,pointer), *temp_pointer) @@ -125,12 +133,15 @@ png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row, uint8x8x4_t *vrpt = png_ptr(uint8x8x4_t,&vtmp); uint8x8x4_t vrp = *vrpt; uint32x2x4_t *temp_pointer; + uint32x2x4_t vdest_val; vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]); vdest.val[1] = vadd_u8(vdest.val[0], vrp.val[1]); vdest.val[2] = vadd_u8(vdest.val[1], vrp.val[2]); vdest.val[3] = vadd_u8(vdest.val[2], vrp.val[3]); - vst4_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2x4_t,&vdest), 0); + + vdest_val = png_ldr(uint32x2x4_t, &vdest); + vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0); } PNG_UNUSED(prev_row) @@ -223,6 +234,7 @@ png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row, uint8x8x4_t *vrpt, *vppt; uint8x8x4_t vrp, vpp; uint32x2x4_t *temp_pointer; + uint32x2x4_t vdest_val; vtmp = vld4_u32(png_ptr(uint32_t,rp)); vrpt = png_ptr(uint8x8x4_t,&vtmp); @@ -240,7 +252,8 @@ png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row, vdest.val[3] = vhadd_u8(vdest.val[2], vpp.val[3]); vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]); - vst4_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2x4_t,&vdest), 0); + vdest_val = png_ldr(uint32x2x4_t, &vdest); + vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0); } } @@ -359,6 +372,7 @@ png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row, uint8x8x4_t *vrpt, *vppt; uint8x8x4_t vrp, vpp; uint32x2x4_t *temp_pointer; + uint32x2x4_t vdest_val; vtmp = vld4_u32(png_ptr(uint32_t,rp)); vrpt = png_ptr(uint8x8x4_t,&vtmp); @@ -378,7 +392,8 @@ png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row, vlast = vpp.val[3]; - vst4_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2x4_t,&vdest), 0); + vdest_val = png_ldr(uint32x2x4_t, &vdest); + vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0); } } diff --git a/thirdparty/libpng/arm/palette_neon_intrinsics.c b/thirdparty/libpng/arm/palette_neon_intrinsics.c new file mode 100644 index 0000000000..fa02d6a8b3 --- /dev/null +++ b/thirdparty/libpng/arm/palette_neon_intrinsics.c @@ -0,0 +1,149 @@ + +/* palette_neon_intrinsics.c - NEON optimised palette expansion functions + * + * Copyright (c) 2018 Cosmin Truta + * Copyright (c) 2017-2018 Arm Holdings. All rights reserved. + * Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#include "../pngpriv.h" + +#if PNG_ARM_NEON_IMPLEMENTATION == 1 + +#if defined(_MSC_VER) && defined(_M_ARM64) +# include <arm64_neon.h> +#else +# include <arm_neon.h> +#endif + +/* Build an RGBA palette from the RGB and separate alpha palettes. */ +void +png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info) +{ + png_const_colorp palette = png_ptr->palette; + png_bytep riffled_palette = png_ptr->riffled_palette; + png_const_bytep trans_alpha = png_ptr->trans_alpha; + int num_trans = png_ptr->num_trans; + int i; + + /* Initially black, opaque. */ + uint8x16x4_t w = {{ + vdupq_n_u8(0x00), + vdupq_n_u8(0x00), + vdupq_n_u8(0x00), + vdupq_n_u8(0xff), + }}; + + if (row_info->bit_depth != 8) + { + png_error(png_ptr, "bit_depth must be 8 for png_riffle_palette_rgba"); + return; + } + + /* First, riffle the RGB colours into a RGBA palette, the A value is + * set to opaque for now. + */ + for (i = 0; i < (1 << row_info->bit_depth); i += 16) + { + uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i)); + w.val[0] = v.val[0]; + w.val[1] = v.val[1]; + w.val[2] = v.val[2]; + vst4q_u8(riffled_palette + (i << 2), w); + } + + /* Fix up the missing transparency values. */ + for (i = 0; i < num_trans; i++) + riffled_palette[(i << 2) + 3] = trans_alpha[i]; +} + +/* Expands a palettized row into RGBA. */ +int +png_do_expand_palette_neon_rgba(png_structrp png_ptr, png_row_infop row_info, + png_const_bytep row, png_bytepp ssp, png_bytepp ddp) +{ + png_uint_32 row_width = row_info->width; + const png_uint_32 *riffled_palette = + (const png_uint_32 *)png_ptr->riffled_palette; + const png_int_32 pixels_per_chunk = 4; + int i; + + if (row_width < pixels_per_chunk) + return 0; + + /* This function originally gets the last byte of the output row. + * The NEON part writes forward from a given position, so we have + * to seek this back by 4 pixels x 4 bytes. + */ + *ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1); + + for (i = 0; i < row_width; i += pixels_per_chunk) + { + uint32x4_t cur; + png_bytep sp = *ssp - i, dp = *ddp - (i << 2); + cur = vld1q_dup_u32 (riffled_palette + *(sp - 3)); + cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1); + cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2); + cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3); + vst1q_u32((void *)dp, cur); + } + if (i != row_width) + { + /* Remove the amount that wasn't processed. */ + i -= pixels_per_chunk; + } + + /* Decrement output pointers. */ + *ssp = *ssp - i; + *ddp = *ddp - (i << 2); + return i; +} + +/* Expands a palettized row into RGB format. */ +int +png_do_expand_palette_neon_rgb(png_structrp png_ptr, png_row_infop row_info, + png_const_bytep row, png_bytepp ssp, png_bytepp ddp) +{ + png_uint_32 row_width = row_info->width; + png_const_bytep palette = (png_const_bytep)png_ptr->palette; + const png_uint_32 pixels_per_chunk = 8; + int i; + + if (row_width <= pixels_per_chunk) + return 0; + + /* Seeking this back by 8 pixels x 3 bytes. */ + *ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1); + + for (i = 0; i < row_width; i += pixels_per_chunk) + { + uint8x8x3_t cur; + png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i); + cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7))); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6); + cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7); + vst3_u8((void *)dp, cur); + } + + if (i != row_width) + { + /* Remove the amount that wasn't processed. */ + i -= pixels_per_chunk; + } + + /* Decrement output pointers. */ + *ssp = *ssp - i; + *ddp = *ddp - ((i << 1) + i); + return i; +} + +#endif /* PNG_ARM_NEON_IMPLEMENTATION */ diff --git a/thirdparty/libpng/png.c b/thirdparty/libpng/png.c index a25afebcc8..3dce191d17 100644 --- a/thirdparty/libpng/png.c +++ b/thirdparty/libpng/png.c @@ -1,10 +1,10 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_35 Your_png_h_is_not_version_1_6_35; +typedef png_libpng_version_1_6_36 Your_png_h_is_not_version_1_6_36; #ifdef __GNUC__ /* The version tests may need to be added to, but the problem warning has @@ -736,7 +736,7 @@ png_save_int_32(png_bytep buf, png_int_32 i) int PNGAPI png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime) { - static PNG_CONST char short_months[12][4] = + static const char short_months[12][4] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; @@ -814,20 +814,14 @@ png_get_copyright(png_const_structrp png_ptr) #ifdef PNG_STRING_COPYRIGHT return PNG_STRING_COPYRIGHT #else -# ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.35 - July 15, 2018" PNG_STRING_NEWLINE \ + "libpng version 1.6.36" PNG_STRING_NEWLINE \ + "Copyright (c) 2018 Cosmin Truta" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \ PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; -# else - return "libpng version 1.6.35 - July 15, 2018\ - Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson\ - Copyright (c) 1996-1997 Andreas Dilger\ - Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; -# endif #endif } @@ -1121,7 +1115,7 @@ png_colorspace_set_gamma(png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA) { /* Changed in libpng-1.5.4 to limit the values to ensure overflow can't - * occur. Since the fixed point representation is asymetrical it is + * occur. Since the fixed point representation is asymmetrical it is * possible for 1/gamma to overflow the limit of 21474 and this means the * gamma value must be at least 5/100000 and hence at most 20000.0. For * safety the limits here are a little narrower. The values are 0.00016 to @@ -3134,11 +3128,11 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, size_t size, /* The total output count (max) is now 4+precision */ /* Check for an exponent, if we don't need one we are - * done and just need to terminate the string. At - * this point exp_b10==(-1) is effectively a flag - it got - * to '-1' because of the decrement after outputting - * the decimal point above (the exponent required is - * *not* -1!) + * done and just need to terminate the string. At this + * point, exp_b10==(-1) is effectively a flag: it got + * to '-1' because of the decrement, after outputting + * the decimal point above. (The exponent required is + * *not* -1.) */ if (exp_b10 >= (-1) && exp_b10 <= 2) { @@ -3976,18 +3970,18 @@ png_gamma_correct(png_structrp png_ptr, unsigned int value, */ static void png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable, - PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) + unsigned int shift, png_fixed_point gamma_val) { /* Various values derived from 'shift': */ - PNG_CONST unsigned int num = 1U << (8U - shift); + unsigned int num = 1U << (8U - shift); #ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED /* CSE the division and work round wacky GCC warnings (see the comments * in png_gamma_8bit_correct for where these come from.) */ - PNG_CONST double fmax = 1./(((png_int_32)1 << (16U - shift))-1); + double fmax = 1.0 / (((png_int_32)1 << (16U - shift)) - 1); #endif - PNG_CONST unsigned int max = (1U << (16U - shift))-1U; - PNG_CONST unsigned int max_by_2 = 1U << (15U-shift); + unsigned int max = (1U << (16U - shift)) - 1U; + unsigned int max_by_2 = 1U << (15U - shift); unsigned int i; png_uint_16pp table = *ptable = @@ -4053,10 +4047,10 @@ png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable, */ static void png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable, - PNG_CONST unsigned int shift, PNG_CONST png_fixed_point gamma_val) + unsigned int shift, png_fixed_point gamma_val) { - PNG_CONST unsigned int num = 1U << (8U - shift); - PNG_CONST unsigned int max = (1U << (16U - shift))-1U; + unsigned int num = 1U << (8U - shift); + unsigned int max = (1U << (16U - shift))-1U; unsigned int i; png_uint_32 last; @@ -4121,7 +4115,7 @@ png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable, */ static void png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable, - PNG_CONST png_fixed_point gamma_val) + png_fixed_point gamma_val) { unsigned int i; png_bytep table = *ptable = (png_bytep)png_malloc(png_ptr, 256); diff --git a/thirdparty/libpng/png.h b/thirdparty/libpng/png.h index 19e464cc17..8e272a0553 100644 --- a/thirdparty/libpng/png.h +++ b/thirdparty/libpng/png.h @@ -1,29 +1,65 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.35, July 15, 2018 + * libpng version 1.6.36 - December 1, 2018 * + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * - * This code is released under the libpng license (See LICENSE, below) + * This code is released under the libpng license. (See LICENSE, below.) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.35, July 15, 2018: + * libpng versions 0.97, January 1998, through 1.6.35, July 2018: * Glenn Randers-Pehrson. + * libpng version 1.6.36, December 1, 2018: Cosmin Truta * See also "Contributing Authors", below. */ /* - * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE + * ========================================= + * + * PNG Reference Library License version 2 + * --------------------------------------- + * + * * Copyright (c) 1995-2018 The PNG Reference Library Authors. + * * Copyright (c) 2018 Cosmin Truta. + * * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * * Copyright (c) 1996-1997 Andreas Dilger. + * * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + * + * The software is supplied "as is", without warranty of any kind, + * express or implied, including, without limitation, the warranties + * of merchantability, fitness for a particular purpose, title, and + * non-infringement. In no even shall the Copyright owners, or + * anyone distributing the software, be liable for any damages or + * other liability, whether in contract, tort or otherwise, arising + * from, out of, or in connection with the software, or the use or + * other dealings in the software, even if advised of the possibility + * of such damage. + * + * Permission is hereby granted to use, copy, modify, and distribute + * this software, or portions hereof, for any purpose, without fee, + * subject to the following restrictions: * - * If you modify libpng you may insert additional notices immediately following - * this sentence. + * 1. The origin of this software must not be misrepresented; you + * must not claim that you wrote the original software. If you + * use this software in a product, an acknowledgment in the product + * documentation would be appreciated, but is not required. * - * This code is released under the libpng license. + * 2. Altered source versions must be plainly marked as such, and must + * not be misrepresented as being the original software. + * + * 3. This Copyright notice may not be removed or altered from any + * source or altered source distribution. + * + * + * PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) + * ----------------------------------------------------------------------- * * libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are @@ -31,38 +67,38 @@ * disclaimer and license as libpng-1.0.6 with the following individuals * added to the list of Contributing Authors: * - * Simon-Pierre Cadieux - * Eric S. Raymond - * Mans Rullgard - * Cosmin Truta - * Gilles Vollant - * James Yu - * Mandar Sahastrabuddhe - * Google Inc. - * Vadim Barkov + * Simon-Pierre Cadieux + * Eric S. Raymond + * Mans Rullgard + * Cosmin Truta + * Gilles Vollant + * James Yu + * Mandar Sahastrabuddhe + * Google Inc. + * Vadim Barkov * * and with the following additions to the disclaimer: * - * There is no warranty against interference with your enjoyment of the - * library or against infringement. There is no warranty that our - * efforts or the library will fulfill any of your particular purposes - * or needs. This library is provided with all faults, and the entire - * risk of satisfactory quality, performance, accuracy, and effort is with - * the user. + * There is no warranty against interference with your enjoyment of + * the library or against infringement. There is no warranty that our + * efforts or the library will fulfill any of your particular purposes + * or needs. This library is provided with all faults, and the entire + * risk of satisfactory quality, performance, accuracy, and effort is + * with the user. * * Some files in the "contrib" directory and some configure-generated - * files that are distributed with libpng have other copyright owners and + * files that are distributed with libpng have other copyright owners, and * are released under other open source licenses. * * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from * libpng-0.96, and are distributed according to the same disclaimer and - * license as libpng-0.96, with the following individuals added to the list - * of Contributing Authors: + * license as libpng-0.96, with the following individuals added to the + * list of Contributing Authors: * - * Tom Lane - * Glenn Randers-Pehrson - * Willem van Schaik + * Tom Lane + * Glenn Randers-Pehrson + * Willem van Schaik * * libpng versions 0.89, June 1996, through 0.96, May 1997, are * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, @@ -70,14 +106,14 @@ * libpng-0.88, with the following individuals added to the list of * Contributing Authors: * - * John Bowler - * Kevin Bracey - * Sam Bushell - * Magnus Holmgren - * Greg Roelofs - * Tom Tanner + * John Bowler + * Kevin Bracey + * Sam Bushell + * Magnus Holmgren + * Greg Roelofs + * Tom Tanner * - * Some files in the "scripts" directory have other copyright owners + * Some files in the "scripts" directory have other copyright owners, * but are released under this license. * * libpng versions 0.5, May 1995, through 0.88, January 1996, are @@ -86,62 +122,49 @@ * For the purposes of this copyright and license, "Contributing Authors" * is defined as the following set of individuals: * - * Andreas Dilger - * Dave Martindale - * Guy Eric Schalnat - * Paul Schmidt - * Tim Wegner - * - * The PNG Reference Library is supplied "AS IS". The Contributing Authors - * and Group 42, Inc. disclaim all warranties, expressed or implied, - * including, without limitation, the warranties of merchantability and of - * fitness for any purpose. The Contributing Authors and Group 42, Inc. - * assume no liability for direct, indirect, incidental, special, exemplary, - * or consequential damages, which may result from the use of the PNG - * Reference Library, even if advised of the possibility of such damage. + * Andreas Dilger + * Dave Martindale + * Guy Eric Schalnat + * Paul Schmidt + * Tim Wegner + * + * The PNG Reference Library is supplied "AS IS". The Contributing + * Authors and Group 42, Inc. disclaim all warranties, expressed or + * implied, including, without limitation, the warranties of + * merchantability and of fitness for any purpose. The Contributing + * Authors and Group 42, Inc. assume no liability for direct, indirect, + * incidental, special, exemplary, or consequential damages, which may + * result from the use of the PNG Reference Library, even if advised of + * the possibility of such damage. * * Permission is hereby granted to use, copy, modify, and distribute this * source code, or portions hereof, for any purpose, without fee, subject * to the following restrictions: * - * 1. The origin of this source code must not be misrepresented. + * 1. The origin of this source code must not be misrepresented. * - * 2. Altered versions must be plainly marked as such and must not - * be misrepresented as being the original source. + * 2. Altered versions must be plainly marked as such and must not + * be misrepresented as being the original source. * - * 3. This Copyright notice may not be removed or altered from any - * source or altered source distribution. + * 3. This Copyright notice may not be removed or altered from any + * source or altered source distribution. * - * The Contributing Authors and Group 42, Inc. specifically permit, without - * fee, and encourage the use of this source code as a component to - * supporting the PNG file format in commercial products. If you use this - * source code in a product, acknowledgment is not required but would be - * appreciated. + * The Contributing Authors and Group 42, Inc. specifically permit, + * without fee, and encourage the use of this source code as a component + * to supporting the PNG file format in commercial products. If you use + * this source code in a product, acknowledgment is not required but would + * be appreciated. * * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. * - * TRADEMARK: + * TRADEMARK + * ========= * - * The name "libpng" has not been registered by the Copyright owner + * The name "libpng" has not been registered by the Copyright owners * as a trademark in any jurisdiction. However, because libpng has * been distributed and maintained world-wide, continually since 1995, - * the Copyright owner claims "common-law trademark protection" in any + * the Copyright owners claim "common-law trademark protection" in any * jurisdiction where common-law trademark is recognized. - * - * OSI CERTIFICATION: - * - * Libpng is OSI Certified Open Source Software. OSI Certified Open Source is - * a certification mark of the Open Source Initiative. OSI has not addressed - * the additional disclaimers inserted at version 1.0.7. - * - * EXPORT CONTROL: - * - * The Copyright owner believes that the Export Control Classification - * Number (ECCN) for libpng is EAR99, which means not subject to export - * controls or International Traffic in Arms Regulations (ITAR) because - * it is open source, publicly available software, that does not contain - * any encryption software. See the EAR, paragraphs 734.3(b)(3) and - * 734.7(b). */ /* @@ -207,23 +230,25 @@ * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) * 1.0.7 1 10007 (still compatible) * ... - * 1.0.19 10 10019 10.so.0.19[.0] + * 1.0.69 10 10069 10.so.0.69[.0] * ... - * 1.2.59 13 10257 12.so.0.59[.0] + * 1.2.59 13 10259 12.so.0.59[.0] * ... - * 1.5.30 15 10527 15.so.15.30[.0] + * 1.4.20 14 10420 14.so.0.20[.0] * ... - * 1.6.35 16 10635 16.so.16.35[.0] - * - * Henceforth the source version will match the shared-library major - * and minor numbers; the shared-library major version number will be - * used for changes in backward compatibility, as it is intended. The - * PNG_LIBPNG_VER macro, which is not used within libpng but is available - * for applications, is an unsigned integer of the form xyyzz corresponding - * to the source version x.y.z (leading zeros in y and z). Beta versions - * were given the previous public release number plus a letter, until - * version 1.0.6j; from then on they were given the upcoming public - * release number plus "betaNN" or "rcNN". + * 1.5.30 15 10530 15.so.15.30[.0] + * ... + * 1.6.36 16 10636 16.so.16.36[.0] + * + * Henceforth the source version will match the shared-library major and + * minor numbers; the shared-library major version number will be used for + * changes in backward compatibility, as it is intended. + * The PNG_LIBPNG_VER macro, which is not used within libpng but is + * available for applications, is an unsigned integer of the form XYYZZ + * corresponding to the source version X.Y.Z (leading zeros in Y and Z). + * Beta versions were given the previous public release number plus a + * letter, until version 1.0.6j; from then on they were given the upcoming + * public release number plus "betaNN" or "rcNN". * * Binary incompatibility exists only when applications make direct access * to the info_ptr or png_ptr members through png.h, and the compiled @@ -233,65 +258,8 @@ * in binary compatibility (e.g., when a new feature is added). * * See libpng.txt or libpng.3 for more information. The PNG specification - * is available as a W3C Recommendation and as an ISO Specification, - * <https://www.w3.org/TR/2003/REC-PNG-20031110/ - */ - -/* - * Y2K compliance in libpng: - * ========================= - * - * July 15, 2018 - * - * Since the PNG Development group is an ad-hoc body, we can't make - * an official declaration. - * - * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.6.35 are Y2K compliant. It is my belief that - * earlier versions were also Y2K compliant. - * - * Libpng only has two year fields. One is a 2-byte unsigned integer - * that will hold years up to 65535. The other, which is deprecated, - * holds the date in text format, and will hold years up to 9999. - * - * The integer is - * "png_uint_16 year" in png_time_struct. - * - * The string is - * "char time_buffer[29]" in png_struct. This is no longer used - * in libpng-1.6.x and will be removed from libpng-1.7.0. - * - * There are seven time-related functions: - * png.c: png_convert_to_rfc_1123_buffer() in png.c - * (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and - * png_convert_to_rfc_1152() in error prior to libpng-0.98) - * png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c - * png_convert_from_time_t() in pngwrite.c - * png_get_tIME() in pngget.c - * png_handle_tIME() in pngrutil.c, called in pngread.c - * png_set_tIME() in pngset.c - * png_write_tIME() in pngwutil.c, called in pngwrite.c - * - * All handle dates properly in a Y2K environment. The - * png_convert_from_time_t() function calls gmtime() to convert from system - * clock time, which returns (year - 1900), which we properly convert to - * the full 4-digit year. There is a possibility that libpng applications - * are not passing 4-digit years into the png_convert_to_rfc_1123_buffer() - * function, or that they are incorrectly passing only a 2-digit year - * instead of "year - 1900" into the png_convert_from_struct_tm() function, - * but this is not under our control. The libpng documentation has always - * stated that it works with 4-digit years, and the APIs have been - * documented as such. - * - * The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned - * integer to hold the year, and can hold years as large as 65535. - * - * zlib, upon which libpng depends, is also Y2K compliant. It contains - * no date-related code. - * - * Glenn Randers-Pehrson - * libpng maintainer - * PNG Development Group + * is available as a W3C Recommendation and as an ISO/IEC Standard; see + * <https://www.w3.org/TR/2003/REC-PNG-20031110/> */ #ifndef PNG_H @@ -309,8 +277,8 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.35" -#define PNG_HEADER_VERSION_STRING " libpng version 1.6.35 - July 15, 2018\n" +#define PNG_LIBPNG_VER_STRING "1.6.36" +#define PNG_HEADER_VERSION_STRING " libpng version 1.6.36 - December 1, 2018\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 @@ -318,13 +286,13 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 6 -#define PNG_LIBPNG_VER_RELEASE 35 +#define PNG_LIBPNG_VER_RELEASE 36 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ -#define PNG_LIBPNG_VER_BUILD 02 +#define PNG_LIBPNG_VER_BUILD 0 /* Release Status */ #define PNG_LIBPNG_BUILD_ALPHA 1 @@ -341,15 +309,16 @@ #define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with PNG_LIBPNG_BUILD_PRIVATE */ -#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA +#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE -/* Careful here. At one time, Guy wanted to use 082, but that would be octal. - * We must not include leading zeros. - * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only - * version 1.0.0 was mis-numbered 100 instead of 10000). From - * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release +/* Careful here. At one time, Guy wanted to use 082, but that + * would be octal. We must not include leading zeros. + * Versions 0.7 through 1.0.0 were in the range 0 to 100 here + * (only version 1.0.0 was mis-numbered 100 instead of 10000). + * From version 1.0.1 it is: + * XXYYZZ, where XX=major, YY=minor, ZZ=release */ -#define PNG_LIBPNG_VER 10635 /* 1.6.35 */ +#define PNG_LIBPNG_VER 10636 /* 1.6.36 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -459,7 +428,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_6_35; +typedef char* png_libpng_version_1_6_36; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * @@ -2013,12 +1982,12 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *exif)); PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr, - png_inforp info_ptr, const png_bytep exif)); + png_inforp info_ptr, png_bytep exif)); PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif)); PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr, - png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif)); + png_inforp info_ptr, png_uint_32 num_exif, png_bytep exif)); #endif #ifdef PNG_gAMA_SUPPORTED @@ -2764,7 +2733,7 @@ typedef struct * * When the simplified API needs to convert between sRGB and linear colorspaces, * the actual sRGB transfer curve defined in the sRGB specification (see the - * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 + * article at <https://en.wikipedia.org/wiki/SRGB>) is used, not the gamma=1/2.2 * approximation used elsewhere in libpng. * * When an alpha channel is present it is expected to denote pixel coverage @@ -2967,7 +2936,7 @@ typedef struct * 'flags' field of png_image. */ #define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 - /* This indicates the the RGB values of the in-memory bitmap do not + /* This indicates that the RGB values of the in-memory bitmap do not * correspond to the red, green and blue end-points defined by sRGB. */ diff --git a/thirdparty/libpng/pngconf.h b/thirdparty/libpng/pngconf.h index a4646bab85..5e641b2509 100644 --- a/thirdparty/libpng/pngconf.h +++ b/thirdparty/libpng/pngconf.h @@ -1,11 +1,12 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.35, July 15, 2018 + * libpng version 1.6.36 * + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -57,14 +58,13 @@ #endif /* PNG_BUILDING_SYMBOL_TABLE */ -/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using - * PNG_NO_CONST; this is no longer supported except for data declarations which - * apparently still cause problems in 2011 on some compilers. +/* Prior to 1.6.0, it was possible to turn off 'const' in declarations, + * using PNG_NO_CONST. This is no longer supported. */ #define PNG_CONST const /* backward compatibility only */ -/* This controls optimization of the reading of 16-bit and 32-bit values - * from PNG files. It can be set on a per-app-file basis - it +/* This controls optimization of the reading of 16-bit and 32-bit + * values from PNG files. It can be set on a per-app-file basis: it * just changes whether a macro is used when the function is called. * The library builder sets the default; if read functions are not * built into the library the macro implementation is forced on. diff --git a/thirdparty/libpng/pngdebug.h b/thirdparty/libpng/pngdebug.h index 15a7ed0c95..00d5a4569e 100644 --- a/thirdparty/libpng/pngdebug.h +++ b/thirdparty/libpng/pngdebug.h @@ -1,10 +1,10 @@ /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c * - * Last changed in libpng 1.6.8 [December 19, 2013] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/thirdparty/libpng/pngerror.c b/thirdparty/libpng/pngerror.c index ad48bfb986..ec3a709b9d 100644 --- a/thirdparty/libpng/pngerror.c +++ b/thirdparty/libpng/pngerror.c @@ -1,10 +1,10 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.6.31 [July 27, 2017] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -425,7 +425,7 @@ png_app_error(png_const_structrp png_ptr, png_const_charp error_message) * if the character is invalid. */ #define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) -static PNG_CONST char png_digit[16] = { +static const char png_digit[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; @@ -885,7 +885,7 @@ PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message), PNG_NORETURN) { - const png_const_structrp png_ptr = png_nonconst_ptr; + png_const_structrp png_ptr = png_nonconst_ptr; png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr); /* An error is always logged here, overwriting anything (typically a warning) @@ -920,7 +920,7 @@ png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message), void /* PRIVATE */ PNGCBAPI png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message) { - const png_const_structrp png_ptr = png_nonconst_ptr; + png_const_structrp png_ptr = png_nonconst_ptr; png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr); /* A warning is only logged if there is no prior warning or error. */ diff --git a/thirdparty/libpng/pngget.c b/thirdparty/libpng/pngget.c index 2325508f1d..5abf1efd9f 100644 --- a/thirdparty/libpng/pngget.c +++ b/thirdparty/libpng/pngget.c @@ -1,10 +1,10 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/thirdparty/libpng/pnginfo.h b/thirdparty/libpng/pnginfo.h index 2fcf868dac..1f98dedc42 100644 --- a/thirdparty/libpng/pnginfo.h +++ b/thirdparty/libpng/pnginfo.h @@ -1,10 +1,10 @@ /* pnginfo.h - header file for PNG reference library * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/thirdparty/libpng/pnglibconf.h b/thirdparty/libpng/pnglibconf.h index 00acecc69b..00340c678b 100644 --- a/thirdparty/libpng/pnglibconf.h +++ b/thirdparty/libpng/pnglibconf.h @@ -1,10 +1,9 @@ -/* libpng 1.6.35 STANDARD API DEFINITION */ - /* pnglibconf.h - library build configuration */ -/* Libpng version 1.6.35 - July 15, 2018 */ +/* libpng version 1.6.36 */ -/* Copyright (c) 1998-2018 Glenn Randers-Pehrson */ +/* Copyright (c) 2018 Cosmin Truta */ +/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */ /* This code is released under the libpng license. */ /* For conditions of distribution and use, see the disclaimer */ @@ -20,8 +19,6 @@ #define PNG_ALIGNED_MEMORY_SUPPORTED /*#undef PNG_ARM_NEON_API_SUPPORTED*/ /*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ -/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/ -/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/ #define PNG_BENIGN_ERRORS_SUPPORTED #define PNG_BENIGN_READ_ERRORS_SUPPORTED /*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ @@ -46,6 +43,8 @@ #define PNG_IO_STATE_SUPPORTED #define PNG_MNG_FEATURES_SUPPORTED #define PNG_POINTER_INDEXING_SUPPORTED +/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/ +/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/ #define PNG_PROGRESSIVE_READ_SUPPORTED #define PNG_READ_16BIT_SUPPORTED #define PNG_READ_ALPHA_MODE_SUPPORTED diff --git a/thirdparty/libpng/pngmem.c b/thirdparty/libpng/pngmem.c index ff3ef7e88c..09ed9c1c99 100644 --- a/thirdparty/libpng/pngmem.c +++ b/thirdparty/libpng/pngmem.c @@ -1,10 +1,10 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.6.26 [October 20, 2016] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/thirdparty/libpng/pngpread.c b/thirdparty/libpng/pngpread.c index c4ba51c4d4..e283627b77 100644 --- a/thirdparty/libpng/pngpread.c +++ b/thirdparty/libpng/pngpread.c @@ -1,10 +1,10 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -972,20 +972,20 @@ png_read_push_finish_row(png_structrp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; + static const png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; + static const png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; + static const png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; + static const png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; /* Height of interlace block. This is not currently used - if you need * it, uncomment it here and in png.h - static PNG_CONST png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; + static const png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; */ #endif diff --git a/thirdparty/libpng/pngpriv.h b/thirdparty/libpng/pngpriv.h index 3581f67919..973c3eac1f 100644 --- a/thirdparty/libpng/pngpriv.h +++ b/thirdparty/libpng/pngpriv.h @@ -1,10 +1,10 @@ /* pngpriv.h - private declarations for use inside libpng * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -174,7 +174,10 @@ # else /* !defined __ARM_NEON__ */ /* The 'intrinsics' code simply won't compile without this -mfpu=neon: */ -# define PNG_ARM_NEON_IMPLEMENTATION 2 +# if !defined(__aarch64__) + /* The assembler code currently does not work on ARM64 */ +# define PNG_ARM_NEON_IMPLEMENTATION 2 +# endif /* __aarch64__ */ # endif /* __ARM_NEON__ */ # endif /* !PNG_ARM_NEON_IMPLEMENTATION */ @@ -1534,10 +1537,10 @@ PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr, #endif PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr, - const png_uint_32 chunk_name),PNG_EMPTY); + png_uint_32 chunk_name),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr, - const png_uint_32 chunk_length),PNG_EMPTY); + png_uint_32 chunk_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY); @@ -2114,6 +2117,29 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2, PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr, png_const_charp key, png_bytep new_key), PNG_EMPTY); +#if PNG_ARM_NEON_IMPLEMENTATION == 1 +PNG_INTERNAL_FUNCTION(void, + png_riffle_palette_rgba, + (png_structrp, png_row_infop), + PNG_EMPTY); +PNG_INTERNAL_FUNCTION(int, + png_do_expand_palette_neon_rgba, + (png_structrp, + png_row_infop, + png_const_bytep, + const png_bytepp, + const png_bytepp), + PNG_EMPTY); +PNG_INTERNAL_FUNCTION(int, + png_do_expand_palette_neon_rgb, + (png_structrp, + png_row_infop, + png_const_bytep, + const png_bytepp, + const png_bytepp), + PNG_EMPTY); +#endif + /* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" diff --git a/thirdparty/libpng/pngread.c b/thirdparty/libpng/pngread.c index bff7503ee3..f8e762196e 100644 --- a/thirdparty/libpng/pngread.c +++ b/thirdparty/libpng/pngread.c @@ -1,10 +1,10 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -1621,7 +1621,7 @@ png_image_skip_unused_chunks(png_structrp png_ptr) * errors (which are unfortunately quite common.) */ { - static PNG_CONST png_byte chunks_to_process[] = { + static const png_byte chunks_to_process[] = { 98, 75, 71, 68, '\0', /* bKGD */ 99, 72, 82, 77, '\0', /* cHRM */ 103, 65, 77, 65, '\0', /* gAMA */ @@ -1758,9 +1758,9 @@ png_create_colormap_entry(png_image_read_control *display, png_uint_32 alpha, int encoding) { png_imagep image = display->image; - const int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ? + int output_encoding = (image->format & PNG_FORMAT_FLAG_LINEAR) != 0 ? P_LINEAR : P_sRGB; - const int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 && + int convert_to_Y = (image->format & PNG_FORMAT_FLAG_COLOR) == 0 && (red != green || green != blue); if (ip > 255) @@ -1869,13 +1869,13 @@ png_create_colormap_entry(png_image_read_control *display, /* Store the value. */ { # ifdef PNG_FORMAT_AFIRST_SUPPORTED - const int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 && + int afirst = (image->format & PNG_FORMAT_FLAG_AFIRST) != 0 && (image->format & PNG_FORMAT_FLAG_ALPHA) != 0; # else # define afirst 0 # endif # ifdef PNG_FORMAT_BGR_SUPPORTED - const int bgr = (image->format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0; + int bgr = (image->format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0; # else # define bgr 0 # endif @@ -2085,11 +2085,11 @@ png_image_read_colormap(png_voidp argument) { png_image_read_control *display = png_voidcast(png_image_read_control*, argument); - const png_imagep image = display->image; + png_imagep image = display->image; - const png_structrp png_ptr = image->opaque->png_ptr; - const png_uint_32 output_format = image->format; - const int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) != 0 ? + png_structrp png_ptr = image->opaque->png_ptr; + png_uint_32 output_format = image->format; + int output_encoding = (output_format & PNG_FORMAT_FLAG_LINEAR) != 0 ? P_LINEAR : P_sRGB; unsigned int cmap_entries; @@ -2802,7 +2802,7 @@ png_image_read_colormap(png_voidp argument) unsigned int num_trans = png_ptr->num_trans; png_const_bytep trans = num_trans > 0 ? png_ptr->trans_alpha : NULL; png_const_colorp colormap = png_ptr->palette; - const int do_background = trans != NULL && + int do_background = trans != NULL && (output_format & PNG_FORMAT_FLAG_ALPHA) == 0; unsigned int i; @@ -3946,7 +3946,7 @@ png_image_read_direct(png_voidp argument) */ if (linear != 0) { - PNG_CONST png_uint_16 le = 0x0001; + png_uint_16 le = 0x0001; if ((*(png_const_bytep) & le) != 0) png_set_swap(png_ptr); @@ -4108,7 +4108,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background, * original PNG format because it may not occur in the output PNG format * and libpng deals with the issues of reading the original. */ - const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); + unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); /* The following checks just the 'row_stride' calculation to ensure it * fits in a signed 32-bit value. Because channels/components can be @@ -4119,7 +4119,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background, if (image->width <= 0x7fffffffU/channels) /* no overflow */ { png_uint_32 check; - const png_uint_32 png_row_stride = image->width * channels; + png_uint_32 png_row_stride = image->width * channels; if (row_stride == 0) row_stride = (png_int_32)/*SAFE*/png_row_stride; diff --git a/thirdparty/libpng/pngrio.c b/thirdparty/libpng/pngrio.c index 372221483f..7946358101 100644 --- a/thirdparty/libpng/pngrio.c +++ b/thirdparty/libpng/pngrio.c @@ -1,10 +1,10 @@ /* pngrio.c - functions for data input * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/thirdparty/libpng/pngrtran.c b/thirdparty/libpng/pngrtran.c index 67d1f249a6..ccc58ce6f1 100644 --- a/thirdparty/libpng/pngrtran.c +++ b/thirdparty/libpng/pngrtran.c @@ -1,10 +1,10 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -18,6 +18,17 @@ #include "pngpriv.h" +#ifdef PNG_ARM_NEON_IMPLEMENTATION +# if PNG_ARM_NEON_IMPLEMENTATION == 1 +# define PNG_ARM_NEON_INTRINSICS_AVAILABLE +# if defined(_MSC_VER) && defined(_M_ARM64) +# include <arm64_neon.h> +# else +# include <arm_neon.h> +# endif +# endif +#endif + #ifdef PNG_READ_SUPPORTED /* Set the action on getting a CRC error for an ancillary or critical chunk. */ @@ -2986,7 +2997,6 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) */ static int png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) - { int rgb_error = 0; @@ -2995,12 +3005,11 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) if ((row_info->color_type & PNG_COLOR_MASK_PALETTE) == 0 && (row_info->color_type & PNG_COLOR_MASK_COLOR) != 0) { - PNG_CONST png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; - PNG_CONST png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; - PNG_CONST png_uint_32 bc = 32768 - rc - gc; - PNG_CONST png_uint_32 row_width = row_info->width; - PNG_CONST int have_alpha = - (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0; + png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; + png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; + png_uint_32 bc = 32768 - rc - gc; + png_uint_32 row_width = row_info->width; + int have_alpha = (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0; if (row_info->bit_depth == 8) { @@ -4143,12 +4152,11 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr) { if (row_info->bit_depth == 8) { - PNG_CONST png_bytep table = png_ptr->gamma_from_1; + png_bytep table = png_ptr->gamma_from_1; if (table != NULL) { - PNG_CONST int step = - (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2; + int step = (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 4 : 2; /* The alpha channel is the last component: */ row += step - 1; @@ -4162,13 +4170,12 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr) else if (row_info->bit_depth == 16) { - PNG_CONST png_uint_16pp table = png_ptr->gamma_16_from_1; - PNG_CONST int gamma_shift = png_ptr->gamma_shift; + png_uint_16pp table = png_ptr->gamma_16_from_1; + int gamma_shift = png_ptr->gamma_shift; if (table != NULL) { - PNG_CONST int step = - (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4; + int step = (row_info->color_type & PNG_COLOR_MASK_COLOR) ? 8 : 4; /* The alpha channel is the last component: */ row += step - 2; @@ -4199,8 +4206,9 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr) * upon whether you supply trans and num_trans. */ static void -png_do_expand_palette(png_row_infop row_info, png_bytep row, - png_const_colorp palette, png_const_bytep trans_alpha, int num_trans) +png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info, + png_bytep row, png_const_colorp palette, png_const_bytep trans_alpha, + int num_trans) { int shift, value; png_bytep sp, dp; @@ -4304,14 +4312,25 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row, sp = row + (size_t)row_width - 1; dp = row + ((size_t)row_width << 2) - 1; - for (i = 0; i < row_width; i++) + i = 0; +#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE + if (png_ptr->riffled_palette != NULL) + { + /* The RGBA optimization works with png_ptr->bit_depth == 8 + * but sometimes row_info->bit_depth has been changed to 8. + * In these cases, the palette hasn't been riffled. + */ + i = png_do_expand_palette_neon_rgba(png_ptr, row_info, row, + &sp, &dp); + } +#endif + + for (; i < row_width; i++) { if ((int)(*sp) >= num_trans) *dp-- = 0xff; - else *dp-- = trans_alpha[*sp]; - *dp-- = palette[*sp].blue; *dp-- = palette[*sp].green; *dp-- = palette[*sp].red; @@ -4328,8 +4347,13 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row, { sp = row + (size_t)row_width - 1; dp = row + (size_t)(row_width * 3) - 1; + i = 0; +#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE + i = png_do_expand_palette_neon_rgb(png_ptr, row_info, row, + &sp, &dp); +#endif - for (i = 0; i < row_width; i++) + for (; i < row_width; i++) { *dp-- = palette[*sp].blue; *dp-- = palette[*sp].green; @@ -4743,8 +4767,22 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info) { if (row_info->color_type == PNG_COLOR_TYPE_PALETTE) { - png_do_expand_palette(row_info, png_ptr->row_buf + 1, - png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans); +#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE + if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8)) + { + /* Allocate space for the decompressed full palette. */ + if (png_ptr->riffled_palette == NULL) + { + png_ptr->riffled_palette = png_malloc(png_ptr, 256*4); + if (png_ptr->riffled_palette == NULL) + png_error(png_ptr, "NULL row buffer"); + /* Build the RGBA palette. */ + png_riffle_palette_rgba(png_ptr, row_info); + } + } +#endif + png_do_expand_palette(png_ptr, row_info, png_ptr->row_buf + 1, + png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans); } else diff --git a/thirdparty/libpng/pngrutil.c b/thirdparty/libpng/pngrutil.c index 7001f1976e..d5fa08c397 100644 --- a/thirdparty/libpng/pngrutil.c +++ b/thirdparty/libpng/pngrutil.c @@ -1,10 +1,10 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -1461,8 +1461,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) { /* We have the ICC profile header; do the basic header checks. */ - const png_uint_32 profile_length = - png_get_uint_32(profile_header); + png_uint_32 profile_length = png_get_uint_32(profile_header); if (png_icc_check_length(png_ptr, &png_ptr->colorspace, keyword, profile_length) != 0) @@ -1479,8 +1478,8 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) * profile. The header check has already validated * that none of this stuff will overflow. */ - const png_uint_32 tag_count = png_get_uint_32( - profile_header+128); + png_uint_32 tag_count = + png_get_uint_32(profile_header + 128); png_bytep profile = png_read_buffer(png_ptr, profile_length, 2/*silent*/); @@ -3132,7 +3131,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, */ void /* PRIVATE */ -png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name) +png_check_chunk_name(png_const_structrp png_ptr, png_uint_32 chunk_name) { int i; png_uint_32 cn=chunk_name; @@ -3151,7 +3150,7 @@ png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name) } void /* PRIVATE */ -png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length) +png_check_chunk_length(png_const_structrp png_ptr, png_uint_32 length) { png_alloc_size_t limit = PNG_UINT_31_MAX; @@ -3363,7 +3362,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) /* Hence the pre-compiled masks indexed by PACKSWAP (or not), depth and * then pass: */ - static PNG_CONST png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] = + static const png_uint_32 row_mask[2/*PACKSWAP*/][3/*depth*/][6] = { /* Little-endian byte masks for PACKSWAP */ { S_MASKS(1,0), S_MASKS(2,0), S_MASKS(4,0) }, @@ -3374,7 +3373,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) /* display_mask has only three entries for the odd passes, so index by * pass>>1. */ - static PNG_CONST png_uint_32 display_mask[2][3][3] = + static const png_uint_32 display_mask[2][3][3] = { /* Little-endian byte masks for PACKSWAP */ { B_MASKS(1,0), B_MASKS(2,0), B_MASKS(4,0) }, @@ -3687,7 +3686,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, { /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Offset to next interlace block */ - static PNG_CONST unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static const unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; png_debug(1, "in png_do_read_interlace"); if (row != NULL && row_info != NULL) @@ -4329,16 +4328,16 @@ png_read_finish_row(png_structrp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; png_debug(1, "in png_read_finish_row"); png_ptr->row_number++; @@ -4394,16 +4393,16 @@ png_read_start_row(png_structrp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; unsigned int max_pixel_depth; size_t row_bytes; diff --git a/thirdparty/libpng/pngset.c b/thirdparty/libpng/pngset.c index 7cf54d9248..ec75dbe369 100644 --- a/thirdparty/libpng/pngset.c +++ b/thirdparty/libpng/pngset.c @@ -1,10 +1,10 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -137,7 +137,7 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X, #ifdef PNG_eXIf_SUPPORTED void PNGAPI png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr, - const png_bytep eXIf_buf) + png_bytep eXIf_buf) { png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1"); PNG_UNUSED(info_ptr) @@ -146,7 +146,7 @@ png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr, void PNGAPI png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr, - const png_uint_32 num_exif, const png_bytep eXIf_buf) + png_uint_32 num_exif, png_bytep eXIf_buf) { int i; @@ -1399,7 +1399,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, /* Ignore all unknown chunks and all chunks recognized by * libpng except for IHDR, PLTE, tRNS, IDAT, and IEND */ - static PNG_CONST png_byte chunks_to_ignore[] = { + static const png_byte chunks_to_ignore[] = { 98, 75, 71, 68, '\0', /* bKGD */ 99, 72, 82, 77, '\0', /* cHRM */ 101, 88, 73, 102, '\0', /* eXIf */ diff --git a/thirdparty/libpng/pngstruct.h b/thirdparty/libpng/pngstruct.h index 699e8ac68a..94a6d041ff 100644 --- a/thirdparty/libpng/pngstruct.h +++ b/thirdparty/libpng/pngstruct.h @@ -1,10 +1,10 @@ /* pngstruct.h - header file for PNG reference library * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -228,6 +228,10 @@ struct png_struct_def * big_row_buf; while writing it is separately * allocated. */ +#ifdef PNG_READ_EXPAND_SUPPORTED + /* Buffer to accelerate palette transformations. */ + png_bytep riffled_palette; +#endif #ifdef PNG_WRITE_FILTER_SUPPORTED png_bytep try_row; /* buffer to save trial row when filtering */ png_bytep tst_row; /* buffer to save best trial row when filtering */ diff --git a/thirdparty/libpng/pngtrans.c b/thirdparty/libpng/pngtrans.c index de84aa6d6b..1100f46ebe 100644 --- a/thirdparty/libpng/pngtrans.c +++ b/thirdparty/libpng/pngtrans.c @@ -1,10 +1,10 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -345,7 +345,7 @@ png_do_swap(png_row_infop row_info, png_bytep row) #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -static PNG_CONST png_byte onebppswaptable[256] = { +static const png_byte onebppswaptable[256] = { 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, @@ -380,7 +380,7 @@ static PNG_CONST png_byte onebppswaptable[256] = { 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF }; -static PNG_CONST png_byte twobppswaptable[256] = { +static const png_byte twobppswaptable[256] = { 0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0, 0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0, 0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4, @@ -415,7 +415,7 @@ static PNG_CONST png_byte twobppswaptable[256] = { 0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF }; -static PNG_CONST png_byte fourbppswaptable[256] = { +static const png_byte fourbppswaptable[256] = { 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, 0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, diff --git a/thirdparty/libpng/pngwio.c b/thirdparty/libpng/pngwio.c index e5391687a2..10e919dd03 100644 --- a/thirdparty/libpng/pngwio.c +++ b/thirdparty/libpng/pngwio.c @@ -1,10 +1,10 @@ /* pngwio.c - functions for data output * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/thirdparty/libpng/pngwrite.c b/thirdparty/libpng/pngwrite.c index 5bd87f373e..160c877d38 100644 --- a/thirdparty/libpng/pngwrite.c +++ b/thirdparty/libpng/pngwrite.c @@ -1,10 +1,10 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -469,7 +469,7 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_CONVERT_tIME_SUPPORTED void PNGAPI -png_convert_from_struct_tm(png_timep ptime, PNG_CONST struct tm * ttime) +png_convert_from_struct_tm(png_timep ptime, const struct tm * ttime) { png_debug(1, "in png_convert_from_struct_tm"); @@ -948,6 +948,10 @@ png_write_destroy(png_structrp png_ptr) png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list); png_free(png_ptr, png_ptr->row_buf); png_ptr->row_buf = NULL; +#ifdef PNG_READ_EXPANDED_SUPPORTED + png_free(png_ptr, png_ptr->riffled_palette); + png_ptr->riffled_palette = NULL; +#endif #ifdef PNG_WRITE_FILTER_SUPPORTED png_free(png_ptr, png_ptr->prev_row); png_free(png_ptr, png_ptr->try_row); @@ -1536,7 +1540,7 @@ png_write_image_16bit(png_voidp argument) display->first_row); png_uint_16p output_row = png_voidcast(png_uint_16p, display->local_row); png_uint_16p row_end; - const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? + unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; int aindex = 0; png_uint_32 y = image->height; @@ -1573,7 +1577,7 @@ png_write_image_16bit(png_voidp argument) while (out_ptr < row_end) { - const png_uint_16 alpha = in_ptr[aindex]; + png_uint_16 alpha = in_ptr[aindex]; png_uint_32 reciprocal = 0; int c; @@ -1695,7 +1699,7 @@ png_write_image_8bit(png_voidp argument) display->first_row); png_bytep output_row = png_voidcast(png_bytep, display->local_row); png_uint_32 y = image->height; - const unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? + unsigned int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0) @@ -1783,25 +1787,25 @@ png_write_image_8bit(png_voidp argument) static void png_image_set_PLTE(png_image_write_control *display) { - const png_imagep image = display->image; + png_imagep image = display->image; const void *cmap = display->colormap; - const int entries = image->colormap_entries > 256 ? 256 : + int entries = image->colormap_entries > 256 ? 256 : (int)image->colormap_entries; /* NOTE: the caller must check for cmap != NULL and entries != 0 */ - const png_uint_32 format = image->format; - const unsigned int channels = PNG_IMAGE_SAMPLE_CHANNELS(format); + png_uint_32 format = image->format; + unsigned int channels = PNG_IMAGE_SAMPLE_CHANNELS(format); # if defined(PNG_FORMAT_BGR_SUPPORTED) &&\ defined(PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED) - const int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 && + int afirst = (format & PNG_FORMAT_FLAG_AFIRST) != 0 && (format & PNG_FORMAT_FLAG_ALPHA) != 0; # else # define afirst 0 # endif # ifdef PNG_FORMAT_BGR_SUPPORTED - const int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0; + int bgr = (format & PNG_FORMAT_FLAG_BGR) != 0 ? 2 : 0; # else # define bgr 0 # endif @@ -1951,12 +1955,12 @@ png_image_write_main(png_voidp argument) * and total image size to ensure that they are within the system limits. */ { - const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); + unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); if (image->width <= 0x7fffffffU/channels) /* no overflow */ { png_uint_32 check; - const png_uint_32 png_row_stride = image->width * channels; + png_uint_32 png_row_stride = image->width * channels; if (display->row_stride == 0) display->row_stride = (png_int_32)/*SAFE*/png_row_stride; @@ -2052,7 +2056,7 @@ png_image_write_main(png_voidp argument) */ if (write_16bit != 0) { - PNG_CONST png_uint_16 le = 0x0001; + png_uint_16 le = 0x0001; if ((*(png_const_bytep) & le) != 0) png_set_swap(png_ptr); @@ -2166,7 +2170,7 @@ image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data, size_t size) { png_image_write_control *display = png_voidcast(png_image_write_control*, png_ptr->io_ptr/*backdoor: png_get_io_ptr(png_ptr)*/); - const png_alloc_size_t ob = display->output_bytes; + png_alloc_size_t ob = display->output_bytes; /* Check for overflow; this should never happen: */ if (size <= ((png_alloc_size_t)-1) - ob) diff --git a/thirdparty/libpng/pngwtran.c b/thirdparty/libpng/pngwtran.c index 3a1e0a21d2..49a13c1e98 100644 --- a/thirdparty/libpng/pngwtran.c +++ b/thirdparty/libpng/pngwtran.c @@ -1,10 +1,10 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -254,8 +254,7 @@ png_do_shift(png_row_infop row_info, png_bytep row, for (i = 0; i < istop; i++, bp++) { - - const unsigned int c = i%channels; + unsigned int c = i%channels; int j; unsigned int v, out; @@ -283,7 +282,7 @@ png_do_shift(png_row_infop row_info, png_bytep row, for (bp = row, i = 0; i < istop; i++) { - const unsigned int c = i%channels; + unsigned int c = i%channels; int j; unsigned int value, v; diff --git a/thirdparty/libpng/pngwutil.c b/thirdparty/libpng/pngwutil.c index ab431e712c..16345e4c0b 100644 --- a/thirdparty/libpng/pngwutil.c +++ b/thirdparty/libpng/pngwutil.c @@ -1,10 +1,10 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.6.35 [July 15, 2018] + * Copyright (c) 2018 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -1893,16 +1893,16 @@ png_write_start_row(png_structrp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif png_alloc_size_t buf_size; @@ -2008,16 +2008,16 @@ png_write_finish_row(png_structrp png_ptr) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; /* Start of interlace block in the y direction */ - static PNG_CONST png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; + static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; /* Offset to next interlace block in the y direction */ - static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; #endif png_debug(1, "in png_write_finish_row"); @@ -2098,10 +2098,10 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ - static PNG_CONST png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; + static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; /* Offset to next interlace block */ - static PNG_CONST png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; + static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; png_debug(1, "in png_do_write_interlace"); @@ -2276,7 +2276,7 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row, #ifdef PNG_WRITE_FILTER_SUPPORTED static size_t /* PRIVATE */ -png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp, +png_setup_sub_row(png_structrp png_ptr, png_uint_32 bpp, size_t row_bytes, size_t lmins) { png_bytep rp, dp, lp; @@ -2315,7 +2315,7 @@ png_setup_sub_row(png_structrp png_ptr, const png_uint_32 bpp, } static void /* PRIVATE */ -png_setup_sub_row_only(png_structrp png_ptr, const png_uint_32 bpp, +png_setup_sub_row_only(png_structrp png_ptr, png_uint_32 bpp, size_t row_bytes) { png_bytep rp, dp, lp; @@ -2380,7 +2380,7 @@ png_setup_up_row_only(png_structrp png_ptr, size_t row_bytes) } static size_t /* PRIVATE */ -png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, +png_setup_avg_row(png_structrp png_ptr, png_uint_32 bpp, size_t row_bytes, size_t lmins) { png_bytep rp, dp, pp, lp; @@ -2420,7 +2420,7 @@ png_setup_avg_row(png_structrp png_ptr, const png_uint_32 bpp, return (sum); } static void /* PRIVATE */ -png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp, +png_setup_avg_row_only(png_structrp png_ptr, png_uint_32 bpp, size_t row_bytes) { png_bytep rp, dp, pp, lp; @@ -2442,7 +2442,7 @@ png_setup_avg_row_only(png_structrp png_ptr, const png_uint_32 bpp, } static size_t /* PRIVATE */ -png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, +png_setup_paeth_row(png_structrp png_ptr, png_uint_32 bpp, size_t row_bytes, size_t lmins) { png_bytep rp, dp, pp, cp, lp; @@ -2503,7 +2503,7 @@ png_setup_paeth_row(png_structrp png_ptr, const png_uint_32 bpp, return (sum); } static void /* PRIVATE */ -png_setup_paeth_row_only(png_structrp png_ptr, const png_uint_32 bpp, +png_setup_paeth_row_only(png_structrp png_ptr, png_uint_32 bpp, size_t row_bytes) { png_bytep rp, dp, pp, cp, lp; diff --git a/thirdparty/libwebp/AUTHORS b/thirdparty/libwebp/AUTHORS index 83c7b9c5eb..0d70b7fb2a 100644 --- a/thirdparty/libwebp/AUTHORS +++ b/thirdparty/libwebp/AUTHORS @@ -1,4 +1,5 @@ Contributors: +- Alan Browning (browning at google dot com) - Charles Munger (clm at google dot com) - Christian Duvivier (cduvivier at google dot com) - Djordje Pesut (djordje dot pesut at imgtec dot com) @@ -6,9 +7,10 @@ Contributors: - James Zern (jzern at google dot com) - Jan Engelhardt (jengelh at medozas dot de) - Jehan (jehan at girinstud dot io) -- Johann (johann dot koenig at duck dot com) +- Johann Koenig (johann dot koenig at duck dot com) - Jovan Zelincevic (jovan dot zelincevic at imgtec dot com) - Jyrki Alakuijala (jyrki at google dot com) +- Konstantin Ivlev (tomskside at gmail dot com) - Lode Vandevenne (lode at google dot com) - Lou Quillio (louquillio at google dot com) - Mans Rullgard (mans at mansr dot com) @@ -37,3 +39,4 @@ Contributors: - Vincent Rabaud (vrabaud at google dot com) - Vlad Tsyrklevich (vtsyrklevich at chromium dot org) - Yang Zhang (yang dot zhang at arm dot com) +- Yannis Guyon (yguyon at google dot com) diff --git a/thirdparty/libwebp/src/dec/vp8i_dec.h b/thirdparty/libwebp/src/dec/vp8i_dec.h index e5e89df57d..2d7900aae1 100644 --- a/thirdparty/libwebp/src/dec/vp8i_dec.h +++ b/thirdparty/libwebp/src/dec/vp8i_dec.h @@ -32,7 +32,7 @@ extern "C" { // version numbers #define DEC_MAJ_VERSION 1 #define DEC_MIN_VERSION 0 -#define DEC_REV_VERSION 1 +#define DEC_REV_VERSION 2 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). // Constraints are: We need to store one 16x16 block of luma samples (y), diff --git a/thirdparty/libwebp/src/demux/demux.c b/thirdparty/libwebp/src/demux/demux.c index a69c65b7cf..d8f7a40a56 100644 --- a/thirdparty/libwebp/src/demux/demux.c +++ b/thirdparty/libwebp/src/demux/demux.c @@ -25,7 +25,7 @@ #define DMUX_MAJ_VERSION 1 #define DMUX_MIN_VERSION 0 -#define DMUX_REV_VERSION 1 +#define DMUX_REV_VERSION 2 typedef struct { size_t start_; // start location of the data diff --git a/thirdparty/libwebp/src/dsp/cost.c b/thirdparty/libwebp/src/dsp/cost.c index 634ccc2085..cc681cdd4b 100644 --- a/thirdparty/libwebp/src/dsp/cost.c +++ b/thirdparty/libwebp/src/dsp/cost.c @@ -377,6 +377,7 @@ VP8SetResidualCoeffsFunc VP8SetResidualCoeffs; extern void VP8EncDspCostInitMIPS32(void); extern void VP8EncDspCostInitMIPSdspR2(void); extern void VP8EncDspCostInitSSE2(void); +extern void VP8EncDspCostInitNEON(void); WEBP_DSP_INIT_FUNC(VP8EncDspCostInit) { VP8GetResidualCost = GetResidualCost_C; @@ -399,6 +400,11 @@ WEBP_DSP_INIT_FUNC(VP8EncDspCostInit) { VP8EncDspCostInitSSE2(); } #endif +#if defined(WEBP_USE_NEON) + if (VP8GetCPUInfo(kNEON)) { + VP8EncDspCostInitNEON(); + } +#endif } } diff --git a/thirdparty/libwebp/src/dsp/cost_neon.c b/thirdparty/libwebp/src/dsp/cost_neon.c new file mode 100644 index 0000000000..8cc8ce58aa --- /dev/null +++ b/thirdparty/libwebp/src/dsp/cost_neon.c @@ -0,0 +1,122 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// ARM NEON version of cost functions + +#include "src/dsp/dsp.h" + +#if defined(WEBP_USE_NEON) + +#include "src/dsp/neon.h" +#include "src/enc/cost_enc.h" + +static const uint8_t position[16] = { 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16 }; + +static void SetResidualCoeffs_NEON(const int16_t* const coeffs, + VP8Residual* const res) { + const int16x8_t minus_one = vdupq_n_s16(-1); + const int16x8_t coeffs_0 = vld1q_s16(coeffs); + const int16x8_t coeffs_1 = vld1q_s16(coeffs + 8); + const uint16x8_t eob_0 = vtstq_s16(coeffs_0, minus_one); + const uint16x8_t eob_1 = vtstq_s16(coeffs_1, minus_one); + const uint8x16_t eob = vcombine_u8(vqmovn_u16(eob_0), vqmovn_u16(eob_1)); + const uint8x16_t masked = vandq_u8(eob, vld1q_u8(position)); + +#ifdef __aarch64__ + res->last = vmaxvq_u8(masked) - 1; +#else + const uint8x8_t eob_8x8 = vmax_u8(vget_low_u8(masked), vget_high_u8(masked)); + const uint16x8_t eob_16x8 = vmovl_u8(eob_8x8); + const uint16x4_t eob_16x4 = + vmax_u16(vget_low_u16(eob_16x8), vget_high_u16(eob_16x8)); + const uint32x4_t eob_32x4 = vmovl_u16(eob_16x4); + uint32x2_t eob_32x2 = + vmax_u32(vget_low_u32(eob_32x4), vget_high_u32(eob_32x4)); + eob_32x2 = vpmax_u32(eob_32x2, eob_32x2); + + vst1_lane_s32(&res->last, vreinterpret_s32_u32(eob_32x2), 0); + --res->last; +#endif // __aarch64__ + + res->coeffs = coeffs; +} + +static int GetResidualCost_NEON(int ctx0, const VP8Residual* const res) { + uint8_t levels[16], ctxs[16]; + uint16_t abs_levels[16]; + int n = res->first; + // should be prob[VP8EncBands[n]], but it's equivalent for n=0 or 1 + const int p0 = res->prob[n][ctx0][0]; + CostArrayPtr const costs = res->costs; + const uint16_t* t = costs[n][ctx0]; + // bit_cost(1, p0) is already incorporated in t[] tables, but only if ctx != 0 + // (as required by the syntax). For ctx0 == 0, we need to add it here or it'll + // be missing during the loop. + int cost = (ctx0 == 0) ? VP8BitCost(1, p0) : 0; + + if (res->last < 0) { + return VP8BitCost(0, p0); + } + + { // precompute clamped levels and contexts, packed to 8b. + const uint8x16_t kCst2 = vdupq_n_u8(2); + const uint8x16_t kCst67 = vdupq_n_u8(MAX_VARIABLE_LEVEL); + const int16x8_t c0 = vld1q_s16(res->coeffs); + const int16x8_t c1 = vld1q_s16(res->coeffs + 8); + const uint16x8_t E0 = vreinterpretq_u16_s16(vabsq_s16(c0)); + const uint16x8_t E1 = vreinterpretq_u16_s16(vabsq_s16(c1)); + const uint8x16_t F = vcombine_u8(vqmovn_u16(E0), vqmovn_u16(E1)); + const uint8x16_t G = vminq_u8(F, kCst2); // context = 0,1,2 + const uint8x16_t H = vminq_u8(F, kCst67); // clamp_level in [0..67] + + vst1q_u8(ctxs, G); + vst1q_u8(levels, H); + + vst1q_u16(abs_levels, E0); + vst1q_u16(abs_levels + 8, E1); + } + for (; n < res->last; ++n) { + const int ctx = ctxs[n]; + const int level = levels[n]; + const int flevel = abs_levels[n]; // full level + cost += VP8LevelFixedCosts[flevel] + t[level]; // simplified VP8LevelCost() + t = costs[n + 1][ctx]; + } + // Last coefficient is always non-zero + { + const int level = levels[n]; + const int flevel = abs_levels[n]; + assert(flevel != 0); + cost += VP8LevelFixedCosts[flevel] + t[level]; + if (n < 15) { + const int b = VP8EncBands[n + 1]; + const int ctx = ctxs[n]; + const int last_p0 = res->prob[b][ctx][0]; + cost += VP8BitCost(0, last_p0); + } + } + return cost; +} + +//------------------------------------------------------------------------------ +// Entry point + +extern void VP8EncDspCostInitNEON(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitNEON(void) { + VP8SetResidualCoeffs = SetResidualCoeffs_NEON; + VP8GetResidualCost = GetResidualCost_NEON; +} + +#else // !WEBP_USE_NEON + +WEBP_DSP_INIT_STUB(VP8EncDspCostInitNEON) + +#endif // WEBP_USE_NEON diff --git a/thirdparty/libwebp/src/dsp/quant.h b/thirdparty/libwebp/src/dsp/quant.h new file mode 100644 index 0000000000..5ba6f9c377 --- /dev/null +++ b/thirdparty/libwebp/src/dsp/quant.h @@ -0,0 +1,70 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- + +#ifndef WEBP_DSP_QUANT_H_ +#define WEBP_DSP_QUANT_H_ + +#include "src/dsp/dsp.h" +#include "src/webp/types.h" + +#if defined(WEBP_USE_NEON) && !defined(WEBP_ANDROID_NEON) && \ + !defined(WEBP_HAVE_NEON_RTCD) +#include <arm_neon.h> + +#define IsFlat IsFlat_NEON + +static uint32x2_t horizontal_add_uint32x4(const uint32x4_t a) { + const uint64x2_t b = vpaddlq_u32(a); + return vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)), + vreinterpret_u32_u64(vget_high_u64(b))); +} + +static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks, + int thresh) { + const int16x8_t tst_ones = vdupq_n_s16(-1); + uint32x4_t sum = vdupq_n_u32(0); + + for (int i = 0; i < num_blocks; ++i) { + // Set DC to zero. + const int16x8_t a_0 = vsetq_lane_s16(0, vld1q_s16(levels), 0); + const int16x8_t a_1 = vld1q_s16(levels + 8); + + const uint16x8_t b_0 = vshrq_n_u16(vtstq_s16(a_0, tst_ones), 15); + const uint16x8_t b_1 = vshrq_n_u16(vtstq_s16(a_1, tst_ones), 15); + + sum = vpadalq_u16(sum, b_0); + sum = vpadalq_u16(sum, b_1); + + levels += 16; + } + return thresh >= (int32_t)vget_lane_u32(horizontal_add_uint32x4(sum), 0); +} + +#else + +#define IsFlat IsFlat_C + +static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks, + int thresh) { + int score = 0; + while (num_blocks-- > 0) { // TODO(skal): refine positional scoring? + int i; + for (i = 1; i < 16; ++i) { // omit DC, we're only interested in AC + score += (levels[i] != 0); + if (score > thresh) return 0; + } + levels += 16; + } + return 1; +} + +#endif // defined(WEBP_USE_NEON) && !defined(WEBP_ANDROID_NEON) && + // !defined(WEBP_HAVE_NEON_RTCD) + +#endif // WEBP_DSP_QUANT_H_ diff --git a/thirdparty/libwebp/src/enc/histogram_enc.c b/thirdparty/libwebp/src/enc/histogram_enc.c index 4e49e0a201..8ac6fa8e02 100644 --- a/thirdparty/libwebp/src/enc/histogram_enc.c +++ b/thirdparty/libwebp/src/enc/histogram_enc.c @@ -165,7 +165,7 @@ VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits) { void VP8LHistogramSetClear(VP8LHistogramSet* const set) { int i; const int cache_bits = set->histograms[0]->palette_code_bits_; - const int size = set->size; + const int size = set->max_size; const size_t total_size = HistogramSetTotalSize(size, cache_bits); uint8_t* memory = (uint8_t*)set; @@ -180,6 +180,20 @@ void VP8LHistogramSetClear(VP8LHistogramSet* const set) { } } +// Removes the histogram 'i' from 'set' by setting it to NULL. +static void HistogramSetRemoveHistogram(VP8LHistogramSet* const set, int i, + int* const num_used) { + assert(set->histograms[i] != NULL); + set->histograms[i] = NULL; + --*num_used; + // If we remove the last valid one, shrink until the next valid one. + if (i == set->size - 1) { + while (set->size >= 1 && set->histograms[set->size - 1] == NULL) { + --set->size; + } + } +} + // ----------------------------------------------------------------------------- void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo, @@ -447,7 +461,9 @@ static double HistogramAddEval(const VP8LHistogram* const a, static double HistogramAddThresh(const VP8LHistogram* const a, const VP8LHistogram* const b, double cost_threshold) { - double cost = -a->bit_cost_; + double cost; + assert(a != NULL && b != NULL); + cost = -a->bit_cost_; GetCombinedHistogramEntropy(a, b, cost_threshold, &cost); return cost; } @@ -561,14 +577,17 @@ static void HistogramBuild( } // Copies the histograms and computes its bit_cost. -static void HistogramCopyAndAnalyze( - VP8LHistogramSet* const orig_histo, VP8LHistogramSet* const image_histo) { - int i; - const int histo_size = orig_histo->size; +static const uint16_t kInvalidHistogramSymbol = (uint16_t)(-1); +static void HistogramCopyAndAnalyze(VP8LHistogramSet* const orig_histo, + VP8LHistogramSet* const image_histo, + int* const num_used, + uint16_t* const histogram_symbols) { + int i, cluster_id; + int num_used_orig = *num_used; VP8LHistogram** const orig_histograms = orig_histo->histograms; VP8LHistogram** const histograms = image_histo->histograms; - image_histo->size = 0; - for (i = 0; i < histo_size; ++i) { + assert(image_histo->max_size == orig_histo->max_size); + for (cluster_id = 0, i = 0; i < orig_histo->max_size; ++i) { VP8LHistogram* const histo = orig_histograms[i]; UpdateHistogramCost(histo); @@ -576,10 +595,19 @@ static void HistogramCopyAndAnalyze( // with no information (when they are skipped because of LZ77). if (!histo->is_used_[0] && !histo->is_used_[1] && !histo->is_used_[2] && !histo->is_used_[3] && !histo->is_used_[4]) { - continue; + // The first histogram is always used. If an histogram is empty, we set + // its id to be the same as the previous one: this will improve + // compressibility for later LZ77. + assert(i > 0); + HistogramSetRemoveHistogram(image_histo, i, num_used); + HistogramSetRemoveHistogram(orig_histo, i, &num_used_orig); + histogram_symbols[i] = kInvalidHistogramSymbol; + } else { + // Copy histograms from orig_histo[] to image_histo[]. + HistogramCopy(histo, histograms[i]); + histogram_symbols[i] = cluster_id++; + assert(cluster_id <= image_histo->max_size); } - // Copy histograms from orig_histo[] to image_histo[]. - HistogramCopy(histo, histograms[image_histo->size++]); } } @@ -596,29 +624,33 @@ static void HistogramAnalyzeEntropyBin(VP8LHistogramSet* const image_histo, // Analyze the dominant (literal, red and blue) entropy costs. for (i = 0; i < histo_size; ++i) { + if (histograms[i] == NULL) continue; UpdateDominantCostRange(histograms[i], &cost_range); } // bin-hash histograms on three of the dominant (literal, red and blue) // symbol costs and store the resulting bin_id for each histogram. for (i = 0; i < histo_size; ++i) { + // bin_map[i] is not set to a special value as its use will later be guarded + // by another (histograms[i] == NULL). + if (histograms[i] == NULL) continue; bin_map[i] = GetHistoBinIndex(histograms[i], &cost_range, low_effort); } } -// Compact image_histo[] by merging some histograms with same bin_id together if -// it's advantageous. +// Merges some histograms with same bin_id together if it's advantageous. +// Sets the remaining histograms to NULL. static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo, + int *num_used, + const uint16_t* const clusters, + uint16_t* const cluster_mappings, VP8LHistogram* cur_combo, const uint16_t* const bin_map, - int bin_map_size, int num_bins, + int num_bins, double combine_cost_factor, int low_effort) { VP8LHistogram** const histograms = image_histo->histograms; int idx; - // Work in-place: processed histograms are put at the beginning of - // image_histo[]. At the end, we just have to truncate the array. - int size = 0; struct { int16_t first; // position of the histogram that accumulates all // histograms with the same bin_id @@ -631,16 +663,19 @@ static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo, bin_info[idx].num_combine_failures = 0; } - for (idx = 0; idx < bin_map_size; ++idx) { - const int bin_id = bin_map[idx]; - const int first = bin_info[bin_id].first; - assert(size <= idx); + // By default, a cluster matches itself. + for (idx = 0; idx < *num_used; ++idx) cluster_mappings[idx] = idx; + for (idx = 0; idx < image_histo->size; ++idx) { + int bin_id, first; + if (histograms[idx] == NULL) continue; + bin_id = bin_map[idx]; + first = bin_info[bin_id].first; if (first == -1) { - // just move histogram #idx to its final position - histograms[size] = histograms[idx]; - bin_info[bin_id].first = size++; + bin_info[bin_id].first = idx; } else if (low_effort) { HistogramAdd(histograms[idx], histograms[first], histograms[first]); + HistogramSetRemoveHistogram(image_histo, idx, num_used); + cluster_mappings[clusters[idx]] = clusters[first]; } else { // try to merge #idx into #first (both share the same bin_id) const double bit_cost = histograms[idx]->bit_cost_; @@ -663,19 +698,18 @@ static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo, bin_info[bin_id].num_combine_failures >= max_combine_failures) { // move the (better) merged histogram to its final slot HistogramSwap(&cur_combo, &histograms[first]); + HistogramSetRemoveHistogram(image_histo, idx, num_used); + cluster_mappings[clusters[idx]] = clusters[first]; } else { - histograms[size++] = histograms[idx]; ++bin_info[bin_id].num_combine_failures; } - } else { - histograms[size++] = histograms[idx]; } } } - image_histo->size = size; if (low_effort) { // for low_effort case, update the final cost when everything is merged - for (idx = 0; idx < size; ++idx) { + for (idx = 0; idx < image_histo->size; ++idx) { + if (histograms[idx] == NULL) continue; UpdateHistogramCost(histograms[idx]); } } @@ -706,16 +740,9 @@ typedef struct { int max_size; } HistoQueue; -static int HistoQueueInit(HistoQueue* const histo_queue, const int max_index) { +static int HistoQueueInit(HistoQueue* const histo_queue, const int max_size) { histo_queue->size = 0; - // max_index^2 for the queue size is safe. If you look at - // HistogramCombineGreedy, and imagine that UpdateQueueFront always pushes - // data to the queue, you insert at most: - // - max_index*(max_index-1)/2 (the first two for loops) - // - max_index - 1 in the last for loop at the first iteration of the while - // loop, max_index - 2 at the second iteration ... therefore - // max_index*(max_index-1)/2 overall too - histo_queue->max_size = max_index * max_index; + histo_queue->max_size = max_size; // We allocate max_size + 1 because the last element at index "size" is // used as temporary data (and it could be up to max_size). histo_queue->queue = (HistogramPair*)WebPSafeMalloc( @@ -778,6 +805,8 @@ static double HistoQueuePush(HistoQueue* const histo_queue, const VP8LHistogram* h2; HistogramPair pair; + // Stop here if the queue is full. + if (histo_queue->size == histo_queue->max_size) return 0.; assert(threshold <= 0.); if (idx1 > idx2) { const int tmp = idx2; @@ -794,8 +823,6 @@ static double HistoQueuePush(HistoQueue* const histo_queue, // Do not even consider the pair if it does not improve the entropy. if (pair.cost_diff >= threshold) return 0.; - // We cannot add more elements than the capacity. - assert(histo_queue->size < histo_queue->max_size); histo_queue->queue[histo_queue->size++] = pair; HistoQueueUpdateHead(histo_queue, &histo_queue->queue[histo_queue->size - 1]); @@ -806,42 +833,43 @@ static double HistoQueuePush(HistoQueue* const histo_queue, // Combines histograms by continuously choosing the one with the highest cost // reduction. -static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) { +static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo, + int* const num_used) { int ok = 0; - int image_histo_size = image_histo->size; + const int image_histo_size = image_histo->size; int i, j; VP8LHistogram** const histograms = image_histo->histograms; - // Indexes of remaining histograms. - int* const clusters = - (int*)WebPSafeMalloc(image_histo_size, sizeof(*clusters)); // Priority queue of histogram pairs. HistoQueue histo_queue; - if (!HistoQueueInit(&histo_queue, image_histo_size) || clusters == NULL) { + // image_histo_size^2 for the queue size is safe. If you look at + // HistogramCombineGreedy, and imagine that UpdateQueueFront always pushes + // data to the queue, you insert at most: + // - image_histo_size*(image_histo_size-1)/2 (the first two for loops) + // - image_histo_size - 1 in the last for loop at the first iteration of + // the while loop, image_histo_size - 2 at the second iteration ... + // therefore image_histo_size*(image_histo_size-1)/2 overall too + if (!HistoQueueInit(&histo_queue, image_histo_size * image_histo_size)) { goto End; } for (i = 0; i < image_histo_size; ++i) { - // Initialize clusters indexes. - clusters[i] = i; + if (image_histo->histograms[i] == NULL) continue; for (j = i + 1; j < image_histo_size; ++j) { - // Initialize positions array. + // Initialize queue. + if (image_histo->histograms[j] == NULL) continue; HistoQueuePush(&histo_queue, histograms, i, j, 0.); } } - while (image_histo_size > 1 && histo_queue.size > 0) { + while (histo_queue.size > 0) { const int idx1 = histo_queue.queue[0].idx1; const int idx2 = histo_queue.queue[0].idx2; HistogramAdd(histograms[idx2], histograms[idx1], histograms[idx1]); histograms[idx1]->bit_cost_ = histo_queue.queue[0].cost_combo; + // Remove merged histogram. - for (i = 0; i + 1 < image_histo_size; ++i) { - if (clusters[i] >= idx2) { - clusters[i] = clusters[i + 1]; - } - } - --image_histo_size; + HistogramSetRemoveHistogram(image_histo, idx2, num_used); // Remove pairs intersecting the just combined best pair. for (i = 0; i < histo_queue.size;) { @@ -856,24 +884,15 @@ static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) { } // Push new pairs formed with combined histogram to the queue. - for (i = 0; i < image_histo_size; ++i) { - if (clusters[i] != idx1) { - HistoQueuePush(&histo_queue, histograms, idx1, clusters[i], 0.); - } - } - } - // Move remaining histograms to the beginning of the array. - for (i = 0; i < image_histo_size; ++i) { - if (i != clusters[i]) { // swap the two histograms - HistogramSwap(&histograms[i], &histograms[clusters[i]]); + for (i = 0; i < image_histo->size; ++i) { + if (i == idx1 || image_histo->histograms[i] == NULL) continue; + HistoQueuePush(&histo_queue, image_histo->histograms, idx1, i, 0.); } } - image_histo->size = image_histo_size; ok = 1; End: - WebPSafeFree(clusters); HistoQueueClear(&histo_queue); return ok; } @@ -881,47 +900,69 @@ static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) { // Perform histogram aggregation using a stochastic approach. // 'do_greedy' is set to 1 if a greedy approach needs to be performed // afterwards, 0 otherwise. +static int PairComparison(const void* idx1, const void* idx2) { + // To be used with bsearch: <0 when *idx1<*idx2, >0 if >, 0 when ==. + return (*(int*) idx1 - *(int*) idx2); +} static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo, - int min_cluster_size, + int* const num_used, int min_cluster_size, int* const do_greedy) { - int iter; + int j, iter; uint32_t seed = 1; int tries_with_no_success = 0; - int image_histo_size = image_histo->size; - const int outer_iters = image_histo_size; + const int outer_iters = *num_used; const int num_tries_no_success = outer_iters / 2; VP8LHistogram** const histograms = image_histo->histograms; - // Priority queue of histogram pairs. Its size of "kCostHeapSizeSqrt"^2 + // Priority queue of histogram pairs. Its size of 'kHistoQueueSize' // impacts the quality of the compression and the speed: the smaller the // faster but the worse for the compression. HistoQueue histo_queue; - const int kHistoQueueSizeSqrt = 3; + const int kHistoQueueSize = 9; int ok = 0; + // mapping from an index in image_histo with no NULL histogram to the full + // blown image_histo. + int* mappings; - if (!HistoQueueInit(&histo_queue, kHistoQueueSizeSqrt)) { + if (*num_used < min_cluster_size) { + *do_greedy = 1; + return 1; + } + + mappings = (int*) WebPSafeMalloc(*num_used, sizeof(*mappings)); + if (mappings == NULL || !HistoQueueInit(&histo_queue, kHistoQueueSize)) { goto End; } + // Fill the initial mapping. + for (j = 0, iter = 0; iter < image_histo->size; ++iter) { + if (histograms[iter] == NULL) continue; + mappings[j++] = iter; + } + assert(j == *num_used); + // Collapse similar histograms in 'image_histo'. - ++min_cluster_size; - for (iter = 0; iter < outer_iters && image_histo_size >= min_cluster_size && - ++tries_with_no_success < num_tries_no_success; + for (iter = 0; + iter < outer_iters && *num_used >= min_cluster_size && + ++tries_with_no_success < num_tries_no_success; ++iter) { + int* mapping_index; double best_cost = (histo_queue.size == 0) ? 0. : histo_queue.queue[0].cost_diff; int best_idx1 = -1, best_idx2 = 1; - int j; - const uint32_t rand_range = (image_histo_size - 1) * image_histo_size; - // image_histo_size / 2 was chosen empirically. Less means faster but worse + const uint32_t rand_range = (*num_used - 1) * (*num_used); + // (*num_used) / 2 was chosen empirically. Less means faster but worse // compression. - const int num_tries = image_histo_size / 2; + const int num_tries = (*num_used) / 2; - for (j = 0; j < num_tries; ++j) { + // Pick random samples. + for (j = 0; *num_used >= 2 && j < num_tries; ++j) { double curr_cost; // Choose two different histograms at random and try to combine them. const uint32_t tmp = MyRand(&seed) % rand_range; - const uint32_t idx1 = tmp / (image_histo_size - 1); - uint32_t idx2 = tmp % (image_histo_size - 1); + uint32_t idx1 = tmp / (*num_used - 1); + uint32_t idx2 = tmp % (*num_used - 1); if (idx2 >= idx1) ++idx2; + idx1 = mappings[idx1]; + idx2 = mappings[idx2]; // Calculate cost reduction on combination. curr_cost = @@ -934,18 +975,21 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo, } if (histo_queue.size == 0) continue; - // Merge the two best histograms. + // Get the best histograms. best_idx1 = histo_queue.queue[0].idx1; best_idx2 = histo_queue.queue[0].idx2; assert(best_idx1 < best_idx2); - HistogramAddEval(histograms[best_idx1], histograms[best_idx2], - histograms[best_idx1], 0); - // Swap the best_idx2 histogram with the last one (which is now unused). - --image_histo_size; - if (best_idx2 != image_histo_size) { - HistogramSwap(&histograms[image_histo_size], &histograms[best_idx2]); - } - histograms[image_histo_size] = NULL; + // Pop best_idx2 from mappings. + mapping_index = (int*) bsearch(&best_idx2, mappings, *num_used, + sizeof(best_idx2), &PairComparison); + assert(mapping_index != NULL); + memmove(mapping_index, mapping_index + 1, sizeof(*mapping_index) * + ((*num_used) - (mapping_index - mappings) - 1)); + // Merge the histograms and remove best_idx2 from the queue. + HistogramAdd(histograms[best_idx2], histograms[best_idx1], + histograms[best_idx1]); + histograms[best_idx1]->bit_cost_ = histo_queue.queue[0].cost_combo; + HistogramSetRemoveHistogram(image_histo, best_idx2, num_used); // Parse the queue and update each pair that deals with best_idx1, // best_idx2 or image_histo_size. for (j = 0; j < histo_queue.size;) { @@ -968,12 +1012,6 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo, p->idx2 = best_idx1; do_eval = 1; } - if (p->idx2 == image_histo_size) { - // No need to re-evaluate here as it does not involve a pair - // containing best_idx1 or best_idx2. - p->idx2 = best_idx2; - } - assert(p->idx2 < image_histo_size); // Make sure the index order is respected. if (p->idx1 > p->idx2) { const int tmp = p->idx2; @@ -991,15 +1029,14 @@ static int HistogramCombineStochastic(VP8LHistogramSet* const image_histo, HistoQueueUpdateHead(&histo_queue, p); ++j; } - tries_with_no_success = 0; } - image_histo->size = image_histo_size; - *do_greedy = (image_histo->size <= min_cluster_size); + *do_greedy = (*num_used <= min_cluster_size); ok = 1; End: HistoQueueClear(&histo_queue); + WebPSafeFree(mappings); return ok; } @@ -1007,23 +1044,29 @@ End: // Histogram refinement // Find the best 'out' histogram for each of the 'in' histograms. +// At call-time, 'out' contains the histograms of the clusters. // Note: we assume that out[]->bit_cost_ is already up-to-date. static void HistogramRemap(const VP8LHistogramSet* const in, - const VP8LHistogramSet* const out, + VP8LHistogramSet* const out, uint16_t* const symbols) { int i; VP8LHistogram** const in_histo = in->histograms; VP8LHistogram** const out_histo = out->histograms; - const int in_size = in->size; + const int in_size = out->max_size; const int out_size = out->size; if (out_size > 1) { for (i = 0; i < in_size; ++i) { int best_out = 0; double best_bits = MAX_COST; int k; + if (in_histo[i] == NULL) { + // Arbitrarily set to the previous value if unused to help future LZ77. + symbols[i] = symbols[i - 1]; + continue; + } for (k = 0; k < out_size; ++k) { - const double cur_bits = - HistogramAddThresh(out_histo[k], in_histo[i], best_bits); + double cur_bits; + cur_bits = HistogramAddThresh(out_histo[k], in_histo[i], best_bits); if (k == 0 || cur_bits < best_bits) { best_bits = cur_bits; best_out = k; @@ -1039,12 +1082,13 @@ static void HistogramRemap(const VP8LHistogramSet* const in, } // Recompute each out based on raw and symbols. - for (i = 0; i < out_size; ++i) { - HistogramClear(out_histo[i]); - } + VP8LHistogramSetClear(out); + out->size = out_size; for (i = 0; i < in_size; ++i) { - const int idx = symbols[i]; + int idx; + if (in_histo[i] == NULL) continue; + idx = symbols[i]; HistogramAdd(in_histo[i], out_histo[idx], out_histo[idx]); } } @@ -1060,6 +1104,70 @@ static double GetCombineCostFactor(int histo_size, int quality) { return combine_cost_factor; } +// Given a HistogramSet 'set', the mapping of clusters 'cluster_mapping' and the +// current assignment of the cells in 'symbols', merge the clusters and +// assign the smallest possible clusters values. +static void OptimizeHistogramSymbols(const VP8LHistogramSet* const set, + uint16_t* const cluster_mappings, + int num_clusters, + uint16_t* const cluster_mappings_tmp, + uint16_t* const symbols) { + int i, cluster_max; + int do_continue = 1; + // First, assign the lowest cluster to each pixel. + while (do_continue) { + do_continue = 0; + for (i = 0; i < num_clusters; ++i) { + int k; + k = cluster_mappings[i]; + while (k != cluster_mappings[k]) { + cluster_mappings[k] = cluster_mappings[cluster_mappings[k]]; + k = cluster_mappings[k]; + } + if (k != cluster_mappings[i]) { + do_continue = 1; + cluster_mappings[i] = k; + } + } + } + // Create a mapping from a cluster id to its minimal version. + cluster_max = 0; + memset(cluster_mappings_tmp, 0, + set->max_size * sizeof(*cluster_mappings_tmp)); + assert(cluster_mappings[0] == 0); + // Re-map the ids. + for (i = 0; i < set->max_size; ++i) { + int cluster; + if (symbols[i] == kInvalidHistogramSymbol) continue; + cluster = cluster_mappings[symbols[i]]; + assert(symbols[i] < num_clusters); + if (cluster > 0 && cluster_mappings_tmp[cluster] == 0) { + ++cluster_max; + cluster_mappings_tmp[cluster] = cluster_max; + } + symbols[i] = cluster_mappings_tmp[cluster]; + } + + // Make sure all cluster values are used. + cluster_max = 0; + for (i = 0; i < set->max_size; ++i) { + if (symbols[i] == kInvalidHistogramSymbol) continue; + if (symbols[i] <= cluster_max) continue; + ++cluster_max; + assert(symbols[i] == cluster_max); + } +} + +static void RemoveEmptyHistograms(VP8LHistogramSet* const image_histo) { + uint32_t size; + int i; + for (i = 0, size = 0; i < image_histo->size; ++i) { + if (image_histo->histograms[i] == NULL) continue; + image_histo->histograms[size++] = image_histo->histograms[i]; + } + image_histo->size = size; +} + int VP8LGetHistoImageSymbols(int xsize, int ysize, const VP8LBackwardRefs* const refs, int quality, int low_effort, @@ -1078,27 +1186,36 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize, // maximum quality q==100 (to preserve the compression gains at that level). const int entropy_combine_num_bins = low_effort ? NUM_PARTITIONS : BIN_SIZE; int entropy_combine; - - if (orig_histo == NULL) goto Error; + uint16_t* const map_tmp = + WebPSafeMalloc(2 * image_histo_raw_size, sizeof(map_tmp)); + uint16_t* const cluster_mappings = map_tmp + image_histo_raw_size; + int num_used = image_histo_raw_size; + if (orig_histo == NULL || map_tmp == NULL) goto Error; // Construct the histograms from backward references. HistogramBuild(xsize, histo_bits, refs, orig_histo); // Copies the histograms and computes its bit_cost. - HistogramCopyAndAnalyze(orig_histo, image_histo); + // histogram_symbols is optimized + HistogramCopyAndAnalyze(orig_histo, image_histo, &num_used, + histogram_symbols); + entropy_combine = - (image_histo->size > entropy_combine_num_bins * 2) && (quality < 100); + (num_used > entropy_combine_num_bins * 2) && (quality < 100); + if (entropy_combine) { - const int bin_map_size = image_histo->size; - // Reuse histogram_symbols storage. By definition, it's guaranteed to be ok. - uint16_t* const bin_map = histogram_symbols; + uint16_t* const bin_map = map_tmp; const double combine_cost_factor = GetCombineCostFactor(image_histo_raw_size, quality); + const uint32_t num_clusters = num_used; HistogramAnalyzeEntropyBin(image_histo, bin_map, low_effort); // Collapse histograms with similar entropy. - HistogramCombineEntropyBin(image_histo, tmp_histo, bin_map, bin_map_size, + HistogramCombineEntropyBin(image_histo, &num_used, histogram_symbols, + cluster_mappings, tmp_histo, bin_map, entropy_combine_num_bins, combine_cost_factor, low_effort); + OptimizeHistogramSymbols(image_histo, cluster_mappings, num_clusters, + map_tmp, histogram_symbols); } // Don't combine the histograms using stochastic and greedy heuristics for @@ -1108,21 +1225,26 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize, // cubic ramp between 1 and MAX_HISTO_GREEDY: const int threshold_size = (int)(1 + (x * x * x) * (MAX_HISTO_GREEDY - 1)); int do_greedy; - if (!HistogramCombineStochastic(image_histo, threshold_size, &do_greedy)) { + if (!HistogramCombineStochastic(image_histo, &num_used, threshold_size, + &do_greedy)) { goto Error; } - if (do_greedy && !HistogramCombineGreedy(image_histo)) { - goto Error; + if (do_greedy) { + RemoveEmptyHistograms(image_histo); + if (!HistogramCombineGreedy(image_histo, &num_used)) { + goto Error; + } } } - // TODO(vrabaud): Optimize HistogramRemap for low-effort compression mode. // Find the optimal map from original histograms to the final ones. + RemoveEmptyHistograms(image_histo); HistogramRemap(orig_histo, image_histo, histogram_symbols); ok = 1; Error: VP8LFreeHistogramSet(orig_histo); + WebPSafeFree(map_tmp); return ok; } diff --git a/thirdparty/libwebp/src/enc/predictor_enc.c b/thirdparty/libwebp/src/enc/predictor_enc.c index f3715f515e..802e89693e 100644 --- a/thirdparty/libwebp/src/enc/predictor_enc.c +++ b/thirdparty/libwebp/src/enc/predictor_enc.c @@ -177,12 +177,15 @@ static uint8_t NearLosslessComponent(uint8_t value, uint8_t predict, } } +static WEBP_INLINE uint8_t NearLosslessDiff(uint8_t a, uint8_t b) { + return (uint8_t)((((int)(a) - (int)(b))) & 0xff); +} + // Quantize every component of the difference between the actual pixel value and // its prediction to a multiple of a quantization (a power of 2, not larger than // max_quantization which is a power of 2, smaller than max_diff). Take care if // value and predict have undergone subtract green, which means that red and // blue are represented as offsets from green. -#define NEAR_LOSSLESS_DIFF(a, b) (uint8_t)((((int)(a) - (int)(b))) & 0xff) static uint32_t NearLossless(uint32_t value, uint32_t predict, int max_quantization, int max_diff, int used_subtract_green) { @@ -199,7 +202,7 @@ static uint32_t NearLossless(uint32_t value, uint32_t predict, } if ((value >> 24) == 0 || (value >> 24) == 0xff) { // Preserve transparency of fully transparent or fully opaque pixels. - a = NEAR_LOSSLESS_DIFF(value >> 24, predict >> 24); + a = NearLosslessDiff(value >> 24, predict >> 24); } else { a = NearLosslessComponent(value >> 24, predict >> 24, 0xff, quantization); } @@ -212,16 +215,15 @@ static uint32_t NearLossless(uint32_t value, uint32_t predict, // The amount by which green has been adjusted during quantization. It is // subtracted from red and blue for compensation, to avoid accumulating two // quantization errors in them. - green_diff = NEAR_LOSSLESS_DIFF(new_green, value >> 8); + green_diff = NearLosslessDiff(new_green, value >> 8); } - r = NearLosslessComponent(NEAR_LOSSLESS_DIFF(value >> 16, green_diff), + r = NearLosslessComponent(NearLosslessDiff(value >> 16, green_diff), (predict >> 16) & 0xff, 0xff - new_green, quantization); - b = NearLosslessComponent(NEAR_LOSSLESS_DIFF(value, green_diff), + b = NearLosslessComponent(NearLosslessDiff(value, green_diff), predict & 0xff, 0xff - new_green, quantization); return ((uint32_t)a << 24) | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b; } -#undef NEAR_LOSSLESS_DIFF #endif // (WEBP_NEAR_LOSSLESS == 1) // Stores the difference between the pixel and its prediction in "out". diff --git a/thirdparty/libwebp/src/enc/quant_enc.c b/thirdparty/libwebp/src/enc/quant_enc.c index 35bfaf21ef..03c682e3ae 100644 --- a/thirdparty/libwebp/src/enc/quant_enc.c +++ b/thirdparty/libwebp/src/enc/quant_enc.c @@ -15,6 +15,7 @@ #include <math.h> #include <stdlib.h> // for abs() +#include "src/dsp/quant.h" #include "src/enc/vp8i_enc.h" #include "src/enc/cost_enc.h" @@ -977,19 +978,6 @@ static void SwapOut(VP8EncIterator* const it) { SwapPtr(&it->yuv_out_, &it->yuv_out2_); } -static score_t IsFlat(const int16_t* levels, int num_blocks, score_t thresh) { - score_t score = 0; - while (num_blocks-- > 0) { // TODO(skal): refine positional scoring? - int i; - for (i = 1; i < 16; ++i) { // omit DC, we're only interested in AC - score += (levels[i] != 0); - if (score > thresh) return 0; - } - levels += 16; - } - return 1; -} - static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* rd) { const int kNumBlocks = 16; VP8SegmentInfo* const dqm = &it->enc_->dqm_[it->mb_->segment_]; diff --git a/thirdparty/libwebp/src/enc/vp8i_enc.h b/thirdparty/libwebp/src/enc/vp8i_enc.h index 92439febb8..3a1967da88 100644 --- a/thirdparty/libwebp/src/enc/vp8i_enc.h +++ b/thirdparty/libwebp/src/enc/vp8i_enc.h @@ -32,7 +32,7 @@ extern "C" { // version numbers #define ENC_MAJ_VERSION 1 #define ENC_MIN_VERSION 0 -#define ENC_REV_VERSION 1 +#define ENC_REV_VERSION 2 enum { MAX_LF_LEVELS = 64, // Maximum loop filter level MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost diff --git a/thirdparty/libwebp/src/enc/vp8l_enc.c b/thirdparty/libwebp/src/enc/vp8l_enc.c index 2713edcd95..2efd403f77 100644 --- a/thirdparty/libwebp/src/enc/vp8l_enc.c +++ b/thirdparty/libwebp/src/enc/vp8l_enc.c @@ -462,6 +462,7 @@ static int GetHuffBitLengthsAndCodes( for (i = 0; i < histogram_image_size; ++i) { const VP8LHistogram* const histo = histogram_image->histograms[i]; HuffmanTreeCode* const codes = &huffman_codes[5 * i]; + assert(histo != NULL); for (k = 0; k < 5; ++k) { const int num_symbols = (k == 0) ? VP8LHistogramNumCodes(histo->palette_code_bits_) : diff --git a/thirdparty/libwebp/src/mux/muxi.h b/thirdparty/libwebp/src/mux/muxi.h index df9f74c63c..3e9d8c48d8 100644 --- a/thirdparty/libwebp/src/mux/muxi.h +++ b/thirdparty/libwebp/src/mux/muxi.h @@ -29,7 +29,7 @@ extern "C" { #define MUX_MAJ_VERSION 1 #define MUX_MIN_VERSION 0 -#define MUX_REV_VERSION 1 +#define MUX_REV_VERSION 2 // Chunk object. typedef struct WebPChunk WebPChunk; diff --git a/thirdparty/libwebp/src/utils/bit_writer_utils.c b/thirdparty/libwebp/src/utils/bit_writer_utils.c index f4f476ce3f..7f83b4c8a2 100644 --- a/thirdparty/libwebp/src/utils/bit_writer_utils.c +++ b/thirdparty/libwebp/src/utils/bit_writer_utils.c @@ -248,6 +248,7 @@ int VP8LBitWriterClone(const VP8LBitWriter* const src, dst->bits_ = src->bits_; dst->used_ = src->used_; dst->error_ = src->error_; + dst->cur_ = dst->buf_ + current_size; return 1; } diff --git a/thirdparty/libwebp/src/utils/utils.h b/thirdparty/libwebp/src/utils/utils.h index da97b5d38f..c7620f91ec 100644 --- a/thirdparty/libwebp/src/utils/utils.h +++ b/thirdparty/libwebp/src/utils/utils.h @@ -107,19 +107,6 @@ static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) { PutLE16(data + 2, (int)(val >> 16)); } -// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either -// based on table or not. Can be used as fallback if clz() is not available. -#define WEBP_NEED_LOG_TABLE_8BIT -extern const uint8_t WebPLogTable8bit[256]; -static WEBP_INLINE int WebPLog2FloorC(uint32_t n) { - int log_value = 0; - while (n >= 256) { - log_value += 8; - n >>= 8; - } - return log_value + WebPLogTable8bit[n]; -} - // Returns (int)floor(log2(n)). n must be > 0. // use GNU builtins where available. #if defined(__GNUC__) && \ @@ -138,6 +125,19 @@ static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return first_set_bit; } #else // default: use the C-version. +// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either +// based on table or not. Can be used as fallback if clz() is not available. +#define WEBP_NEED_LOG_TABLE_8BIT +extern const uint8_t WebPLogTable8bit[256]; +static WEBP_INLINE int WebPLog2FloorC(uint32_t n) { + int log_value = 0; + while (n >= 256) { + log_value += 8; + n >>= 8; + } + return log_value + WebPLogTable8bit[n]; +} + static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return WebPLog2FloorC(n); } #endif diff --git a/thirdparty/libwebp/src/webp/decode.h b/thirdparty/libwebp/src/webp/decode.h index 95d31e7619..ae8bfe840e 100644 --- a/thirdparty/libwebp/src/webp/decode.h +++ b/thirdparty/libwebp/src/webp/decode.h @@ -42,6 +42,12 @@ WEBP_EXTERN int WebPGetDecoderVersion(void); // This function will also validate the header, returning true on success, // false otherwise. '*width' and '*height' are only valid on successful return. // Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size, int* width, int* height); @@ -425,6 +431,12 @@ WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal( // Returns VP8_STATUS_OK when the features are successfully retrieved. Returns // VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the // features from headers. Returns error in other cases. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. static WEBP_INLINE VP8StatusCode WebPGetFeatures( const uint8_t* data, size_t data_size, WebPBitstreamFeatures* features) { diff --git a/thirdparty/libwebsockets/include/libwebsockets.h b/thirdparty/libwebsockets/include/libwebsockets.h new file mode 100644 index 0000000000..7cc5c28b78 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets.h @@ -0,0 +1,435 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +/** @file */ + +#ifndef LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C +#define LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C + +#ifdef __cplusplus +#include <cstddef> +#include <cstdarg> + +extern "C" { +#else +#include <stdarg.h> +#endif + +#include <string.h> +#include <stdlib.h> + +#include "lws_config.h" + +/* + * CARE: everything using cmake defines needs to be below here + */ + +#if defined(LWS_HAS_INTPTR_T) +#include <stdint.h> +#define lws_intptr_t intptr_t +#else +typedef unsigned long long lws_intptr_t; +#endif + +#if defined(WIN32) || defined(_WIN32) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include <winsock2.h> +#include <ws2tcpip.h> +#include <stddef.h> +#include <basetsd.h> +#include <io.h> +#ifndef _WIN32_WCE +#include <fcntl.h> +#else +#define _O_RDONLY 0x0000 +#define O_RDONLY _O_RDONLY +#endif + +#define LWS_INLINE __inline +#define LWS_VISIBLE +#define LWS_WARN_UNUSED_RESULT +#define LWS_WARN_DEPRECATED +#define LWS_FORMAT(string_index) + +#if !defined(LWS_EXTERN) +#ifdef LWS_DLL +#ifdef LWS_INTERNAL +#define LWS_EXTERN extern __declspec(dllexport) +#else +#define LWS_EXTERN extern __declspec(dllimport) +#endif +#else +#define LWS_EXTERN +#endif +#endif + +#define LWS_INVALID_FILE INVALID_HANDLE_VALUE +#define LWS_O_RDONLY _O_RDONLY +#define LWS_O_WRONLY _O_WRONLY +#define LWS_O_CREAT _O_CREAT +#define LWS_O_TRUNC _O_TRUNC + +#ifndef __func__ +#define __func__ __FUNCTION__ +#endif + +#else /* NOT WIN32 */ +#include <unistd.h> +#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) +#include <sys/capability.h> +#endif + +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__QNX__) || defined(__OpenBSD__) +#include <sys/socket.h> +#include <netinet/in.h> +#endif + +#define LWS_INLINE inline +#define LWS_O_RDONLY O_RDONLY +#define LWS_O_WRONLY O_WRONLY +#define LWS_O_CREAT O_CREAT +#define LWS_O_TRUNC O_TRUNC + +#if !defined(LWS_PLAT_OPTEE) && !defined(OPTEE_TA) && !defined(LWS_WITH_ESP32) +#include <poll.h> +#include <netdb.h> +#define LWS_INVALID_FILE -1 +#else +#define getdtablesize() (30) +#if defined(LWS_WITH_ESP32) +#define LWS_INVALID_FILE NULL +#else +#define LWS_INVALID_FILE NULL +#endif +#endif + +#if defined(__GNUC__) + +/* warn_unused_result attribute only supported by GCC 3.4 or later */ +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#define LWS_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define LWS_WARN_UNUSED_RESULT +#endif + +#define LWS_VISIBLE __attribute__((visibility("default"))) +#define LWS_WARN_DEPRECATED __attribute__ ((deprecated)) +#define LWS_FORMAT(string_index) __attribute__ ((format(printf, string_index, string_index+1))) +#else +#define LWS_VISIBLE +#define LWS_WARN_UNUSED_RESULT +#define LWS_WARN_DEPRECATED +#define LWS_FORMAT(string_index) +#endif + +#if defined(__ANDROID__) +#include <netinet/in.h> +#include <unistd.h> +#define getdtablesize() sysconf(_SC_OPEN_MAX) +#endif + +#endif + +#if defined(LWS_WITH_LIBEV) +#include <ev.h> +#endif /* LWS_WITH_LIBEV */ +#ifdef LWS_WITH_LIBUV +#include <uv.h> +#ifdef LWS_HAVE_UV_VERSION_H +#include <uv-version.h> +#endif +#ifdef LWS_HAVE_NEW_UV_VERSION_H +#include <uv/version.h> +#endif +#endif /* LWS_WITH_LIBUV */ +#if defined(LWS_WITH_LIBEVENT) +#include <event2/event.h> +#endif /* LWS_WITH_LIBEVENT */ + +#ifndef LWS_EXTERN +#define LWS_EXTERN extern +#endif + +#ifdef _WIN32 +#define random rand +#else +#if !defined(OPTEE_TA) +#include <sys/time.h> +#include <unistd.h> +#endif +#endif + +#if defined(LWS_WITH_TLS) + +#ifdef USE_WOLFSSL +#ifdef USE_OLD_CYASSL +#ifdef _WIN32 +/* + * Include user-controlled settings for windows from + * <wolfssl-root>/IDE/WIN/user_settings.h + */ +#include <IDE/WIN/user_settings.h> +#include <cyassl/ctaocrypt/settings.h> +#else +#include <cyassl/options.h> +#endif +#include <cyassl/openssl/ssl.h> +#include <cyassl/error-ssl.h> + +#else +#ifdef _WIN32 +/* + * Include user-controlled settings for windows from + * <wolfssl-root>/IDE/WIN/user_settings.h + */ +#include <IDE/WIN/user_settings.h> +#include <wolfssl/wolfcrypt/settings.h> +#else +#include <wolfssl/options.h> +#endif +#include <wolfssl/openssl/ssl.h> +#include <wolfssl/error-ssl.h> +#endif /* not USE_OLD_CYASSL */ +#else +#if defined(LWS_WITH_MBEDTLS) +#if defined(LWS_WITH_ESP32) +/* this filepath is passed to us but without quotes or <> */ +#undef MBEDTLS_CONFIG_FILE +#define MBEDTLS_CONFIG_FILE <mbedtls/esp_config.h> +#endif +#include <mbedtls/ssl.h> +#else +#include <openssl/ssl.h> +#if !defined(LWS_WITH_MBEDTLS) +#include <openssl/err.h> +#endif +#endif +#endif /* not USE_WOLFSSL */ +#endif + +/* + * Helpers for pthread mutex in user code... if lws is built for + * multiple service threads, these resolve to pthread mutex + * operations. In the case LWS_MAX_SMP is 1 (the default), they + * are all NOPs and no pthread type or api is referenced. + */ + +#if LWS_MAX_SMP > 1 + +#include <pthread.h> + +#define lws_pthread_mutex(name) pthread_mutex_t name; + +static LWS_INLINE void +lws_pthread_mutex_init(pthread_mutex_t *lock) +{ + pthread_mutex_init(lock, NULL); +} + +static LWS_INLINE void +lws_pthread_mutex_destroy(pthread_mutex_t *lock) +{ + pthread_mutex_destroy(lock); +} + +static LWS_INLINE void +lws_pthread_mutex_lock(pthread_mutex_t *lock) +{ + pthread_mutex_lock(lock); +} + +static LWS_INLINE void +lws_pthread_mutex_unlock(pthread_mutex_t *lock) +{ + pthread_mutex_unlock(lock); +} + +#else +#define lws_pthread_mutex(name) +#define lws_pthread_mutex_init(_a) +#define lws_pthread_mutex_destroy(_a) +#define lws_pthread_mutex_lock(_a) +#define lws_pthread_mutex_unlock(_a) +#endif + + +#define CONTEXT_PORT_NO_LISTEN -1 +#define CONTEXT_PORT_NO_LISTEN_SERVER -2 + +#include <libwebsockets/lws-logs.h> + + +#include <stddef.h> + +#ifndef lws_container_of +#define lws_container_of(P,T,M) ((T *)((char *)(P) - offsetof(T, M))) +#endif + +struct lws; + +typedef int64_t lws_usec_t; + +/* api change list for user code to test against */ + +#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_ARG + +/* the struct lws_protocols has the id field present */ +#define LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD + +/* you can call lws_get_peer_write_allowance */ +#define LWS_FEATURE_PROTOCOLS_HAS_PEER_WRITE_ALLOWANCE + +/* extra parameter introduced in 917f43ab821 */ +#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_LEN + +/* File operations stuff exists */ +#define LWS_FEATURE_FOPS + + +#if defined(_WIN32) +#if !defined(LWS_WIN32_HANDLE_TYPES) +typedef SOCKET lws_sockfd_type; +typedef HANDLE lws_filefd_type; +#endif + +struct lws_pollfd { + lws_sockfd_type fd; /**< file descriptor */ + SHORT events; /**< which events to respond to */ + SHORT revents; /**< which events happened */ +}; +#define LWS_POLLHUP (FD_CLOSE) +#define LWS_POLLIN (FD_READ | FD_ACCEPT) +#define LWS_POLLOUT (FD_WRITE) +#else + + +#if defined(LWS_WITH_ESP32) +#include <libwebsockets/lws-esp32.h> +#else +typedef int lws_sockfd_type; +typedef int lws_filefd_type; +#endif + +#define lws_pollfd pollfd +#define LWS_POLLHUP (POLLHUP|POLLERR) +#define LWS_POLLIN (POLLIN) +#define LWS_POLLOUT (POLLOUT) +#endif + + +#if (defined(WIN32) || defined(_WIN32)) && !defined(__MINGW32__) +/* ... */ +#define ssize_t SSIZE_T +#endif + +#if defined(WIN32) && defined(LWS_HAVE__STAT32I64) +#include <sys/types.h> +#include <sys/stat.h> +#endif + +#if defined(LWS_HAVE_STDINT_H) +#include <stdint.h> +#else +#if defined(WIN32) || defined(_WIN32) +/* !!! >:-[ */ +typedef unsigned __int32 uint32_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int8 uint8_t; +#else +typedef unsigned int uint32_t; +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; +#endif +#endif + +typedef unsigned long long lws_filepos_t; +typedef long long lws_fileofs_t; +typedef uint32_t lws_fop_flags_t; + +/** struct lws_pollargs - argument structure for all external poll related calls + * passed in via 'in' */ +struct lws_pollargs { + lws_sockfd_type fd; /**< applicable socket descriptor */ + int events; /**< the new event mask */ + int prev_events; /**< the previous event mask */ +}; + +struct lws_extension; /* needed even with ws exts disabled for create context */ +struct lws_token_limits; +struct lws_context; +struct lws_tokens; +struct lws_vhost; +struct lws; + +#include <libwebsockets/lws-ws-close.h> +#include <libwebsockets/lws-callbacks.h> +#include <libwebsockets/lws-ws-state.h> +#include <libwebsockets/lws-ws-ext.h> +#include <libwebsockets/lws-protocols-plugins.h> +#include <libwebsockets/lws-plugin-generic-sessions.h> +#include <libwebsockets/lws-context-vhost.h> +#include <libwebsockets/lws-client.h> +#include <libwebsockets/lws-http.h> +#include <libwebsockets/lws-spa.h> +#include <libwebsockets/lws-purify.h> +#include <libwebsockets/lws-timeout-timer.h> +#include <libwebsockets/lws-service.h> +#include <libwebsockets/lws-write.h> +#include <libwebsockets/lws-writeable.h> +#include <libwebsockets/lws-adopt.h> +#include <libwebsockets/lws-network-helper.h> +#include <libwebsockets/lws-misc.h> +#include <libwebsockets/lws-ring.h> +#include <libwebsockets/lws-sha1-base64.h> +#include <libwebsockets/lws-x509.h> +#include <libwebsockets/lws-cgi.h> +#include <libwebsockets/lws-vfs.h> +#include <libwebsockets/lws-lejp.h> +#include <libwebsockets/lws-stats.h> +#include <libwebsockets/lws-threadpool.h> +#include <libwebsockets/lws-tokenize.h> +#include <libwebsockets/lws-lwsac.h> +#include <libwebsockets/lws-fts.h> +#include <libwebsockets/lws-diskcache.h> + +#if defined(LWS_WITH_TLS) + +#if defined(LWS_WITH_MBEDTLS) +#include <mbedtls/sha1.h> +#include <mbedtls/sha256.h> +#include <mbedtls/sha512.h> +#endif + +#include <libwebsockets/lws-genhash.h> +#include <libwebsockets/lws-genrsa.h> +#include <libwebsockets/lws-jwk.h> +#include <libwebsockets/lws-jws.h> + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-adopt.h b/thirdparty/libwebsockets/include/libwebsockets/lws-adopt.h new file mode 100644 index 0000000000..256e3f9fdf --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-adopt.h @@ -0,0 +1,185 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup sock-adopt Socket adoption helpers + * ##Socket adoption helpers + * + * When integrating with an external app with its own event loop, these can + * be used to accept connections from someone else's listening socket. + * + * When using lws own event loop, these are not needed. + */ +///@{ + +/** + * lws_adopt_socket() - adopt foreign socket as if listen socket accepted it + * for the default vhost of context. + * + * \param context: lws context + * \param accept_fd: fd of already-accepted socket to adopt + * + * Either returns new wsi bound to accept_fd, or closes accept_fd and + * returns NULL, having cleaned up any new wsi pieces. + * + * LWS adopts the socket in http serving mode, it's ready to accept an upgrade + * to ws or just serve http. + */ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_adopt_socket(struct lws_context *context, lws_sockfd_type accept_fd); +/** + * lws_adopt_socket_vhost() - adopt foreign socket as if listen socket accepted + * it for vhost + * + * \param vh: lws vhost + * \param accept_fd: fd of already-accepted socket to adopt + * + * Either returns new wsi bound to accept_fd, or closes accept_fd and + * returns NULL, having cleaned up any new wsi pieces. + * + * LWS adopts the socket in http serving mode, it's ready to accept an upgrade + * to ws or just serve http. + */ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_adopt_socket_vhost(struct lws_vhost *vh, lws_sockfd_type accept_fd); + +typedef enum { + LWS_ADOPT_RAW_FILE_DESC = 0, /* convenience constant */ + LWS_ADOPT_HTTP = 1, /* flag: absent implies RAW */ + LWS_ADOPT_SOCKET = 2, /* flag: absent implies file descr */ + LWS_ADOPT_ALLOW_SSL = 4, /* flag: if set requires LWS_ADOPT_SOCKET */ + LWS_ADOPT_FLAG_UDP = 16, /* flag: socket is UDP */ + + LWS_ADOPT_RAW_SOCKET_UDP = LWS_ADOPT_SOCKET | LWS_ADOPT_FLAG_UDP, +} lws_adoption_type; + +typedef union { + lws_sockfd_type sockfd; + lws_filefd_type filefd; +} lws_sock_file_fd_type; + +#if !defined(LWS_WITH_ESP32) +struct lws_udp { + struct sockaddr sa; + socklen_t salen; + + struct sockaddr sa_pending; + socklen_t salen_pending; +}; +#endif + +/* +* lws_adopt_descriptor_vhost() - adopt foreign socket or file descriptor +* if socket descriptor, should already have been accepted from listen socket +* +* \param vhost: lws vhost +* \param type: OR-ed combinations of lws_adoption_type flags +* \param fd: union with either .sockfd or .filefd set +* \param vh_prot_name: NULL or vh protocol name to bind raw connection to +* \param parent: NULL or struct lws to attach new_wsi to as a child +* +* Either returns new wsi bound to accept_fd, or closes accept_fd and +* returns NULL, having cleaned up any new wsi pieces. +* +* If LWS_ADOPT_SOCKET is set, LWS adopts the socket in http serving mode, it's +* ready to accept an upgrade to ws or just serve http. +* +* parent may be NULL, if given it should be an existing wsi that will become the +* parent of the new wsi created by this call. +*/ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_adopt_descriptor_vhost(struct lws_vhost *vh, lws_adoption_type type, + lws_sock_file_fd_type fd, const char *vh_prot_name, + struct lws *parent); + +/** + * lws_adopt_socket_readbuf() - adopt foreign socket and first rx as if listen socket accepted it + * for the default vhost of context. + * \param context: lws context + * \param accept_fd: fd of already-accepted socket to adopt + * \param readbuf: NULL or pointer to data that must be drained before reading from + * accept_fd + * \param len: The length of the data held at \param readbuf + * + * Either returns new wsi bound to accept_fd, or closes accept_fd and + * returns NULL, having cleaned up any new wsi pieces. + * + * LWS adopts the socket in http serving mode, it's ready to accept an upgrade + * to ws or just serve http. + * + * If your external code did not already read from the socket, you can use + * lws_adopt_socket() instead. + * + * This api is guaranteed to use the data at \param readbuf first, before reading from + * the socket. + * + * readbuf is limited to the size of the ah rx buf, currently 2048 bytes. + */ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_adopt_socket_readbuf(struct lws_context *context, lws_sockfd_type accept_fd, + const char *readbuf, size_t len); +/** + * lws_adopt_socket_vhost_readbuf() - adopt foreign socket and first rx as if listen socket + * accepted it for vhost. + * \param vhost: lws vhost + * \param accept_fd: fd of already-accepted socket to adopt + * \param readbuf: NULL or pointer to data that must be drained before + * reading from accept_fd + * \param len: The length of the data held at \param readbuf + * + * Either returns new wsi bound to accept_fd, or closes accept_fd and + * returns NULL, having cleaned up any new wsi pieces. + * + * LWS adopts the socket in http serving mode, it's ready to accept an upgrade + * to ws or just serve http. + * + * If your external code did not already read from the socket, you can use + * lws_adopt_socket() instead. + * + * This api is guaranteed to use the data at \param readbuf first, before reading from + * the socket. + * + * readbuf is limited to the size of the ah rx buf, currently 2048 bytes. + */ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_adopt_socket_vhost_readbuf(struct lws_vhost *vhost, + lws_sockfd_type accept_fd, const char *readbuf, + size_t len); + +#define LWS_CAUDP_BIND 1 + +/** + * lws_create_adopt_udp() - create, bind and adopt a UDP socket + * + * \param vhost: lws vhost + * \param port: UDP port to bind to, -1 means unbound + * \param flags: 0 or LWS_CAUDP_NO_BIND + * \param protocol_name: Name of protocol on vhost to bind wsi to + * \param parent_wsi: NULL or parent wsi new wsi will be a child of + * + * Either returns new wsi bound to accept_fd, or closes accept_fd and + * returns NULL, having cleaned up any new wsi pieces. + * */ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags, + const char *protocol_name, struct lws *parent_wsi); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-callbacks.h b/thirdparty/libwebsockets/include/libwebsockets/lws-callbacks.h new file mode 100644 index 0000000000..8b49218e9c --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-callbacks.h @@ -0,0 +1,807 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup usercb User Callback + * + * ##User protocol callback + * + * The protocol callback is the primary way lws interacts with + * user code. For one of a list of a few dozen reasons the callback gets + * called at some event to be handled. + * + * All of the events can be ignored, returning 0 is taken as "OK" and returning + * nonzero in most cases indicates that the connection should be closed. + */ +///@{ + +struct lws_ssl_info { + int where; + int ret; +}; + +enum lws_cert_update_state { + LWS_CUS_IDLE, + LWS_CUS_STARTING, + LWS_CUS_SUCCESS, + LWS_CUS_FAILED, + + LWS_CUS_CREATE_KEYS, + LWS_CUS_REG, + LWS_CUS_AUTH, + LWS_CUS_CHALLENGE, + LWS_CUS_CREATE_REQ, + LWS_CUS_REQ, + LWS_CUS_CONFIRM, + LWS_CUS_ISSUE, +}; + +enum { + LWS_TLS_REQ_ELEMENT_COUNTRY, + LWS_TLS_REQ_ELEMENT_STATE, + LWS_TLS_REQ_ELEMENT_LOCALITY, + LWS_TLS_REQ_ELEMENT_ORGANIZATION, + LWS_TLS_REQ_ELEMENT_COMMON_NAME, + LWS_TLS_REQ_ELEMENT_EMAIL, + + LWS_TLS_REQ_ELEMENT_COUNT, + + LWS_TLS_SET_DIR_URL = LWS_TLS_REQ_ELEMENT_COUNT, + LWS_TLS_SET_AUTH_PATH, + LWS_TLS_SET_CERT_PATH, + LWS_TLS_SET_KEY_PATH, + + LWS_TLS_TOTAL_COUNT +}; + +struct lws_acme_cert_aging_args { + struct lws_vhost *vh; + const char *element_overrides[LWS_TLS_TOTAL_COUNT]; /* NULL = use pvo */ +}; + +/* + * NOTE: These public enums are part of the abi. If you want to add one, + * add it at where specified so existing users are unaffected. + */ +/** enum lws_callback_reasons - reason you're getting a protocol callback */ +enum lws_callback_reasons { + + /* --------------------------------------------------------------------- + * ----- Callbacks related to wsi and protocol binding lifecycle ----- + */ + + LWS_CALLBACK_PROTOCOL_INIT = 27, + /**< One-time call per protocol, per-vhost using it, so it can + * do initial setup / allocations etc */ + + LWS_CALLBACK_PROTOCOL_DESTROY = 28, + /**< One-time call per protocol, per-vhost using it, indicating + * this protocol won't get used at all after this callback, the + * vhost is getting destroyed. Take the opportunity to + * deallocate everything that was allocated by the protocol. */ + + LWS_CALLBACK_WSI_CREATE = 29, + /**< outermost (earliest) wsi create notification to protocols[0] */ + + LWS_CALLBACK_WSI_DESTROY = 30, + /**< outermost (latest) wsi destroy notification to protocols[0] */ + + + /* --------------------------------------------------------------------- + * ----- Callbacks related to Server TLS ----- + */ + + LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS = 21, + /**< if configured for + * including OpenSSL support, this callback allows your user code + * to perform extra SSL_CTX_load_verify_locations() or similar + * calls to direct OpenSSL where to find certificates the client + * can use to confirm the remote server identity. user is the + * OpenSSL SSL_CTX* */ + + LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS = 22, + /**< if configured for + * including OpenSSL support, this callback allows your user code + * to load extra certificates into the server which allow it to + * verify the validity of certificates returned by clients. user + * is the server's OpenSSL SSL_CTX* and in is the lws_vhost */ + + LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION = 23, + /**< if the libwebsockets vhost was created with the option + * LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this + * callback is generated during OpenSSL verification of the cert + * sent from the client. It is sent to protocol[0] callback as + * no protocol has been negotiated on the connection yet. + * Notice that the libwebsockets context and wsi are both NULL + * during this callback. See + * http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html + * to understand more detail about the OpenSSL callback that + * generates this libwebsockets callback and the meanings of the + * arguments passed. In this callback, user is the x509_ctx, + * in is the ssl pointer and len is preverify_ok + * Notice that this callback maintains libwebsocket return + * conventions, return 0 to mean the cert is OK or 1 to fail it. + * This also means that if you don't handle this callback then + * the default callback action of returning 0 allows the client + * certificates. */ + + LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY = 37, + /**< if configured for including OpenSSL support but no private key + * file has been specified (ssl_private_key_filepath is NULL), this is + * called to allow the user to set the private key directly via + * libopenssl and perform further operations if required; this might be + * useful in situations where the private key is not directly accessible + * by the OS, for example if it is stored on a smartcard. + * user is the server's OpenSSL SSL_CTX* */ + + LWS_CALLBACK_SSL_INFO = 67, + /**< SSL connections only. An event you registered an + * interest in at the vhost has occurred on a connection + * using the vhost. in is a pointer to a + * struct lws_ssl_info containing information about the + * event*/ + + /* --------------------------------------------------------------------- + * ----- Callbacks related to Client TLS ----- + */ + + LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION = 58, + /**< Similar to LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION + * this callback is called during OpenSSL verification of the cert + * sent from the server to the client. It is sent to protocol[0] + * callback as no protocol has been negotiated on the connection yet. + * Notice that the wsi is set because lws_client_connect_via_info was + * successful. + * + * See http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html + * to understand more detail about the OpenSSL callback that + * generates this libwebsockets callback and the meanings of the + * arguments passed. In this callback, user is the x509_ctx, + * in is the ssl pointer and len is preverify_ok. + * + * THIS IS NOT RECOMMENDED BUT if a cert validation error shall be + * overruled and cert shall be accepted as ok, + * X509_STORE_CTX_set_error((X509_STORE_CTX*)user, X509_V_OK); must be + * called and return value must be 0 to mean the cert is OK; + * returning 1 will fail the cert in any case. + * + * This also means that if you don't handle this callback then + * the default callback action of returning 0 will not accept the + * certificate in case of a validation error decided by the SSL lib. + * + * This is expected and secure behaviour when validating certificates. + * + * Note: LCCSCF_ALLOW_SELFSIGNED and + * LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK still work without this + * callback being implemented. + */ + + /* --------------------------------------------------------------------- + * ----- Callbacks related to HTTP Server ----- + */ + + LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED = 19, + /**< A new client has been accepted by the ws server. This + * callback allows setting any relevant property to it. Because this + * happens immediately after the instantiation of a new client, + * there's no websocket protocol selected yet so this callback is + * issued only to protocol 0. Only wsi is defined, pointing to the + * new client, and the return value is ignored. */ + + LWS_CALLBACK_HTTP = 12, + /**< an http request has come from a client that is not + * asking to upgrade the connection to a websocket + * one. This is a chance to serve http content, + * for example, to send a script to the client + * which will then open the websockets connection. + * in points to the URI path requested and + * lws_serve_http_file() makes it very + * simple to send back a file to the client. + * Normally after sending the file you are done + * with the http connection, since the rest of the + * activity will come by websockets from the script + * that was delivered by http, so you will want to + * return 1; to close and free up the connection. */ + + LWS_CALLBACK_HTTP_BODY = 13, + /**< the next len bytes data from the http + * request body HTTP connection is now available in in. */ + + LWS_CALLBACK_HTTP_BODY_COMPLETION = 14, + /**< the expected amount of http request body has been delivered */ + + LWS_CALLBACK_HTTP_FILE_COMPLETION = 15, + /**< a file requested to be sent down http link has completed. */ + + LWS_CALLBACK_HTTP_WRITEABLE = 16, + /**< you can write more down the http protocol link now. */ + + LWS_CALLBACK_CLOSED_HTTP = 5, + /**< when a HTTP (non-websocket) session ends */ + + LWS_CALLBACK_FILTER_HTTP_CONNECTION = 18, + /**< called when the request has + * been received and parsed from the client, but the response is + * not sent yet. Return non-zero to disallow the connection. + * user is a pointer to the connection user space allocation, + * in is the URI, eg, "/" + * In your handler you can use the public APIs + * lws_hdr_total_length() / lws_hdr_copy() to access all of the + * headers using the header enums lws_token_indexes from + * libwebsockets.h to check for and read the supported header + * presence and content before deciding to allow the http + * connection to proceed or to kill the connection. */ + + LWS_CALLBACK_ADD_HEADERS = 53, + /**< This gives your user code a chance to add headers to a server + * transaction bound to your protocol. `in` points to a + * `struct lws_process_html_args` describing a buffer and length + * you can add headers into using the normal lws apis. + * + * (see LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER to add headers to + * a client transaction) + * + * Only `args->p` and `args->len` are valid, and `args->p` should + * be moved on by the amount of bytes written, if any. Eg + * + * case LWS_CALLBACK_ADD_HEADERS: + * + * struct lws_process_html_args *args = + * (struct lws_process_html_args *)in; + * + * if (lws_add_http_header_by_name(wsi, + * (unsigned char *)"set-cookie:", + * (unsigned char *)cookie, cookie_len, + * (unsigned char **)&args->p, + * (unsigned char *)args->p + args->max_len)) + * return 1; + * + * break; + */ + + LWS_CALLBACK_CHECK_ACCESS_RIGHTS = 51, + /**< This gives the user code a chance to forbid an http access. + * `in` points to a `struct lws_process_html_args`, which + * describes the URL, and a bit mask describing the type of + * authentication required. If the callback returns nonzero, + * the transaction ends with HTTP_STATUS_UNAUTHORIZED. */ + + LWS_CALLBACK_PROCESS_HTML = 52, + /**< This gives your user code a chance to mangle outgoing + * HTML. `in` points to a `struct lws_process_html_args` + * which describes the buffer containing outgoing HTML. + * The buffer may grow up to `.max_len` (currently +128 + * bytes per buffer). + */ + + LWS_CALLBACK_HTTP_BIND_PROTOCOL = 49, + /**< By default, all HTTP handling is done in protocols[0]. + * However you can bind different protocols (by name) to + * different parts of the URL space using callback mounts. This + * callback occurs in the new protocol when a wsi is bound + * to that protocol. Any protocol allocation related to the + * http transaction processing should be created then. + * These specific callbacks are necessary because with HTTP/1.1, + * a single connection may perform at series of different + * transactions at different URLs, thus the lifetime of the + * protocol bind is just for one transaction, not connection. */ + + LWS_CALLBACK_HTTP_DROP_PROTOCOL = 50, + /**< This is called when a transaction is unbound from a protocol. + * It indicates the connection completed its transaction and may + * do something different now. Any protocol allocation related + * to the http transaction processing should be destroyed. */ + + LWS_CALLBACK_HTTP_CONFIRM_UPGRADE = 86, + /**< This is your chance to reject an HTTP upgrade action. The + * name of the protocol being upgraded to is in 'in', and the ah + * is still bound to the wsi, so you can look at the headers. + * + * The default of returning 0 (ie, also if not handled) means the + * upgrade may proceed. Return <0 to just hang up the connection, + * or >0 if you have rejected the connection by returning http headers + * and response code yourself. + * + * There is no need for you to call transaction_completed() as the + * caller will take care of it when it sees you returned >0. + */ + + /* --------------------------------------------------------------------- + * ----- Callbacks related to HTTP Client ----- + */ + + LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP = 44, + /**< The HTTP client connection has succeeded, and is now + * connected to the server */ + + LWS_CALLBACK_CLOSED_CLIENT_HTTP = 45, + /**< The HTTP client connection is closing */ + + LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ = 48, + /**< This is generated by lws_http_client_read() used to drain + * incoming data. In the case the incoming data was chunked, it will + * be split into multiple smaller callbacks for each chunk block, + * removing the chunk headers. If not chunked, it will appear all in + * one callback. */ + + LWS_CALLBACK_RECEIVE_CLIENT_HTTP = 46, + /**< This simply indicates data was received on the HTTP client + * connection. It does NOT drain or provide the data. + * This exists to neatly allow a proxying type situation, + * where this incoming data will go out on another connection. + * If the outgoing connection stalls, we should stall processing + * the incoming data. So a handler for this in that case should + * simply set a flag to indicate there is incoming data ready + * and ask for a writeable callback on the outgoing connection. + * In the writable callback he can check the flag and then get + * and drain the waiting incoming data using lws_http_client_read(). + * This will use callbacks to LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ + * to get and drain the incoming data, where it should be sent + * back out on the outgoing connection. */ + LWS_CALLBACK_COMPLETED_CLIENT_HTTP = 47, + /**< The client transaction completed... at the moment this + * is the same as closing since transaction pipelining on + * client side is not yet supported. */ + + LWS_CALLBACK_CLIENT_HTTP_WRITEABLE = 57, + /**< when doing an HTTP type client connection, you can call + * lws_client_http_body_pending(wsi, 1) from + * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER to get these callbacks + * sending the HTTP headers. + * + * From this callback, when you have sent everything, you should let + * lws know by calling lws_client_http_body_pending(wsi, 0) + */ + + LWS_CALLBACK_CLIENT_HTTP_BIND_PROTOCOL = 85, + LWS_CALLBACK_CLIENT_HTTP_DROP_PROTOCOL = 76, + + /* --------------------------------------------------------------------- + * ----- Callbacks related to Websocket Server ----- + */ + + LWS_CALLBACK_ESTABLISHED = 0, + /**< (VH) after the server completes a handshake with an incoming + * client. If you built the library with ssl support, in is a + * pointer to the ssl struct associated with the connection or NULL. + * + * b0 of len is set if the connection was made using ws-over-h2 + */ + + LWS_CALLBACK_CLOSED = 4, + /**< when the websocket session ends */ + + LWS_CALLBACK_SERVER_WRITEABLE = 11, + /**< See LWS_CALLBACK_CLIENT_WRITEABLE */ + + LWS_CALLBACK_RECEIVE = 6, + /**< data has appeared for this server endpoint from a + * remote client, it can be found at *in and is + * len bytes long */ + + LWS_CALLBACK_RECEIVE_PONG = 7, + /**< servers receive PONG packets with this callback reason */ + + LWS_CALLBACK_WS_PEER_INITIATED_CLOSE = 38, + /**< The peer has sent an unsolicited Close WS packet. in and + * len are the optional close code (first 2 bytes, network + * order) and the optional additional information which is not + * defined in the standard, and may be a string or non human-readable + * data. + * If you return 0 lws will echo the close and then close the + * connection. If you return nonzero lws will just close the + * connection. */ + + LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION = 20, + /**< called when the handshake has + * been received and parsed from the client, but the response is + * not sent yet. Return non-zero to disallow the connection. + * user is a pointer to the connection user space allocation, + * in is the requested protocol name + * In your handler you can use the public APIs + * lws_hdr_total_length() / lws_hdr_copy() to access all of the + * headers using the header enums lws_token_indexes from + * libwebsockets.h to check for and read the supported header + * presence and content before deciding to allow the handshake + * to proceed or to kill the connection. */ + + LWS_CALLBACK_CONFIRM_EXTENSION_OKAY = 25, + /**< When the server handshake code + * sees that it does support a requested extension, before + * accepting the extension by additing to the list sent back to + * the client it gives this callback just to check that it's okay + * to use that extension. It calls back to the requested protocol + * and with in being the extension name, len is 0 and user is + * valid. Note though at this time the ESTABLISHED callback hasn't + * happened yet so if you initialize user content there, user + * content during this callback might not be useful for anything. */ + + LWS_CALLBACK_WS_SERVER_BIND_PROTOCOL = 77, + LWS_CALLBACK_WS_SERVER_DROP_PROTOCOL = 78, + + /* --------------------------------------------------------------------- + * ----- Callbacks related to Websocket Client ----- + */ + + LWS_CALLBACK_CLIENT_CONNECTION_ERROR = 1, + /**< the request client connection has been unable to complete a + * handshake with the remote server. If in is non-NULL, you can + * find an error string of length len where it points to + * + * Diagnostic strings that may be returned include + * + * "getaddrinfo (ipv6) failed" + * "unknown address family" + * "getaddrinfo (ipv4) failed" + * "set socket opts failed" + * "insert wsi failed" + * "lws_ssl_client_connect1 failed" + * "lws_ssl_client_connect2 failed" + * "Peer hung up" + * "read failed" + * "HS: URI missing" + * "HS: Redirect code but no Location" + * "HS: URI did not parse" + * "HS: Redirect failed" + * "HS: Server did not return 200" + * "HS: OOM" + * "HS: disallowed by client filter" + * "HS: disallowed at ESTABLISHED" + * "HS: ACCEPT missing" + * "HS: ws upgrade response not 101" + * "HS: UPGRADE missing" + * "HS: Upgrade to something other than websocket" + * "HS: CONNECTION missing" + * "HS: UPGRADE malformed" + * "HS: PROTOCOL malformed" + * "HS: Cannot match protocol" + * "HS: EXT: list too big" + * "HS: EXT: failed setting defaults" + * "HS: EXT: failed parsing defaults" + * "HS: EXT: failed parsing options" + * "HS: EXT: Rejects server options" + * "HS: EXT: unknown ext" + * "HS: Accept hash wrong" + * "HS: Rejected by filter cb" + * "HS: OOM" + * "HS: SO_SNDBUF failed" + * "HS: Rejected at CLIENT_ESTABLISHED" + */ + + LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH = 2, + /**< this is the last chance for the client user code to examine the + * http headers and decide to reject the connection. If the + * content in the headers is interesting to the + * client (url, etc) it needs to copy it out at + * this point since it will be destroyed before + * the CLIENT_ESTABLISHED call */ + + LWS_CALLBACK_CLIENT_ESTABLISHED = 3, + /**< after your client connection completed the websocket upgrade + * handshake with the remote server */ + + LWS_CALLBACK_CLIENT_CLOSED = 75, + /**< when a client websocket session ends */ + + LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER = 24, + /**< this callback happens + * when a client handshake is being compiled. user is NULL, + * in is a char **, it's pointing to a char * which holds the + * next location in the header buffer where you can add + * headers, and len is the remaining space in the header buffer, + * which is typically some hundreds of bytes. So, to add a canned + * cookie, your handler code might look similar to: + * + * char **p = (char **)in, *end = (*p) + len; + * + * if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_COOKIE, + * (unsigned char)"a=b", 3, p, end)) + * return -1; + * + * See LWS_CALLBACK_ADD_HEADERS for adding headers to server + * transactions. + */ + + LWS_CALLBACK_CLIENT_RECEIVE = 8, + /**< data has appeared from the server for the client connection, it + * can be found at *in and is len bytes long */ + + LWS_CALLBACK_CLIENT_RECEIVE_PONG = 9, + /**< clients receive PONG packets with this callback reason */ + + LWS_CALLBACK_CLIENT_WRITEABLE = 10, + /**< If you call lws_callback_on_writable() on a connection, you will + * get one of these callbacks coming when the connection socket + * is able to accept another write packet without blocking. + * If it already was able to take another packet without blocking, + * you'll get this callback at the next call to the service loop + * function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE + * and servers get LWS_CALLBACK_SERVER_WRITEABLE. */ + + LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED = 26, + /**< When a ws client + * connection is being prepared to start a handshake to a server, + * each supported extension is checked with protocols[0] callback + * with this reason, giving the user code a chance to suppress the + * claim to support that extension by returning non-zero. If + * unhandled, by default 0 will be returned and the extension + * support included in the header to the server. Notice this + * callback comes to protocols[0]. */ + + LWS_CALLBACK_WS_EXT_DEFAULTS = 39, + /**< Gives client connections an opportunity to adjust negotiated + * extension defaults. `user` is the extension name that was + * negotiated (eg, "permessage-deflate"). `in` points to a + * buffer and `len` is the buffer size. The user callback can + * set the buffer to a string describing options the extension + * should parse. Or just ignore for defaults. */ + + + LWS_CALLBACK_FILTER_NETWORK_CONNECTION = 17, + /**< called when a client connects to + * the server at network level; the connection is accepted but then + * passed to this callback to decide whether to hang up immediately + * or not, based on the client IP. in contains the connection + * socket's descriptor. Since the client connection information is + * not available yet, wsi still pointing to the main server socket. + * Return non-zero to terminate the connection before sending or + * receiving anything. Because this happens immediately after the + * network connection from the client, there's no websocket protocol + * selected yet so this callback is issued only to protocol 0. */ + + LWS_CALLBACK_WS_CLIENT_BIND_PROTOCOL = 79, + LWS_CALLBACK_WS_CLIENT_DROP_PROTOCOL = 80, + + /* --------------------------------------------------------------------- + * ----- Callbacks related to external poll loop integration ----- + */ + + LWS_CALLBACK_GET_THREAD_ID = 31, + /**< lws can accept callback when writable requests from other + * threads, if you implement this callback and return an opaque + * current thread ID integer. */ + + /* external poll() management support */ + LWS_CALLBACK_ADD_POLL_FD = 32, + /**< lws normally deals with its poll() or other event loop + * internally, but in the case you are integrating with another + * server you will need to have lws sockets share a + * polling array with the other server. This and the other + * POLL_FD related callbacks let you put your specialized + * poll array interface code in the callback for protocol 0, the + * first protocol you support, usually the HTTP protocol in the + * serving case. + * This callback happens when a socket needs to be + * added to the polling loop: in points to a struct + * lws_pollargs; the fd member of the struct is the file + * descriptor, and events contains the active events + * + * If you are using the internal lws polling / event loop + * you can just ignore these callbacks. */ + + LWS_CALLBACK_DEL_POLL_FD = 33, + /**< This callback happens when a socket descriptor + * needs to be removed from an external polling array. in is + * again the struct lws_pollargs containing the fd member + * to be removed. If you are using the internal polling + * loop, you can just ignore it. */ + + LWS_CALLBACK_CHANGE_MODE_POLL_FD = 34, + /**< This callback happens when lws wants to modify the events for + * a connection. + * in is the struct lws_pollargs with the fd to change. + * The new event mask is in events member and the old mask is in + * the prev_events member. + * If you are using the internal polling loop, you can just ignore + * it. */ + + LWS_CALLBACK_LOCK_POLL = 35, + /**< These allow the external poll changes driven + * by lws to participate in an external thread locking + * scheme around the changes, so the whole thing is threadsafe. + * These are called around three activities in the library, + * - inserting a new wsi in the wsi / fd table (len=1) + * - deleting a wsi from the wsi / fd table (len=1) + * - changing a wsi's POLLIN/OUT state (len=0) + * Locking and unlocking external synchronization objects when + * len == 1 allows external threads to be synchronized against + * wsi lifecycle changes if it acquires the same lock for the + * duration of wsi dereference from the other thread context. */ + + LWS_CALLBACK_UNLOCK_POLL = 36, + /**< See LWS_CALLBACK_LOCK_POLL, ignore if using lws internal poll */ + + /* --------------------------------------------------------------------- + * ----- Callbacks related to CGI serving ----- + */ + + LWS_CALLBACK_CGI = 40, + /**< CGI: CGI IO events on stdin / out / err are sent here on + * protocols[0]. The provided `lws_callback_http_dummy()` + * handles this and the callback should be directed there if + * you use CGI. */ + + LWS_CALLBACK_CGI_TERMINATED = 41, + /**< CGI: The related CGI process ended, this is called before + * the wsi is closed. Used to, eg, terminate chunking. + * The provided `lws_callback_http_dummy()` + * handles this and the callback should be directed there if + * you use CGI. The child PID that terminated is in len. */ + + LWS_CALLBACK_CGI_STDIN_DATA = 42, + /**< CGI: Data is, to be sent to the CGI process stdin, eg from + * a POST body. The provided `lws_callback_http_dummy()` + * handles this and the callback should be directed there if + * you use CGI. */ + + LWS_CALLBACK_CGI_STDIN_COMPLETED = 43, + /**< CGI: no more stdin is coming. The provided + * `lws_callback_http_dummy()` handles this and the callback + * should be directed there if you use CGI. */ + + LWS_CALLBACK_CGI_PROCESS_ATTACH = 70, + /**< CGI: Sent when the CGI process is spawned for the wsi. The + * len parameter is the PID of the child process */ + + /* --------------------------------------------------------------------- + * ----- Callbacks related to Generic Sessions ----- + */ + + LWS_CALLBACK_SESSION_INFO = 54, + /**< This is only generated by user code using generic sessions. + * It's used to get a `struct lws_session_info` filled in by + * generic sessions with information about the logged-in user. + * See the messageboard sample for an example of how to use. */ + + LWS_CALLBACK_GS_EVENT = 55, + /**< Indicates an event happened to the Generic Sessions session. + * `in` contains a `struct lws_gs_event_args` describing the event. */ + + LWS_CALLBACK_HTTP_PMO = 56, + /**< per-mount options for this connection, called before + * the normal LWS_CALLBACK_HTTP when the mount has per-mount + * options. + */ + + /* --------------------------------------------------------------------- + * ----- Callbacks related to RAW sockets ----- + */ + + LWS_CALLBACK_RAW_RX = 59, + /**< RAW mode connection RX */ + + LWS_CALLBACK_RAW_CLOSE = 60, + /**< RAW mode connection is closing */ + + LWS_CALLBACK_RAW_WRITEABLE = 61, + /**< RAW mode connection may be written */ + + LWS_CALLBACK_RAW_ADOPT = 62, + /**< RAW mode connection was adopted (equivalent to 'wsi created') */ + + LWS_CALLBACK_RAW_SKT_BIND_PROTOCOL = 81, + LWS_CALLBACK_RAW_SKT_DROP_PROTOCOL = 82, + + /* --------------------------------------------------------------------- + * ----- Callbacks related to RAW file handles ----- + */ + + LWS_CALLBACK_RAW_ADOPT_FILE = 63, + /**< RAW mode file was adopted (equivalent to 'wsi created') */ + + LWS_CALLBACK_RAW_RX_FILE = 64, + /**< This is the indication the RAW mode file has something to read. + * This doesn't actually do the read of the file and len is always + * 0... your code should do the read having been informed there is + * something to read now. */ + + LWS_CALLBACK_RAW_WRITEABLE_FILE = 65, + /**< RAW mode file is writeable */ + + LWS_CALLBACK_RAW_CLOSE_FILE = 66, + /**< RAW mode wsi that adopted a file is closing */ + + LWS_CALLBACK_RAW_FILE_BIND_PROTOCOL = 83, + LWS_CALLBACK_RAW_FILE_DROP_PROTOCOL = 84, + + /* --------------------------------------------------------------------- + * ----- Callbacks related to generic wsi events ----- + */ + + LWS_CALLBACK_TIMER = 73, + /**< When the time elapsed after a call to + * lws_set_timer_usecs(wsi, usecs) is up, the wsi will get one of + * these callbacks. The deadline can be continuously extended into the + * future by later calls to lws_set_timer_usecs() before the deadline + * expires, or cancelled by lws_set_timer_usecs(wsi, -1); + */ + + LWS_CALLBACK_EVENT_WAIT_CANCELLED = 71, + /**< This is sent to every protocol of every vhost in response + * to lws_cancel_service() or lws_cancel_service_pt(). This + * callback is serialized in the lws event loop normally, even + * if the lws_cancel_service[_pt]() call was from a different + * thread. */ + + LWS_CALLBACK_CHILD_CLOSING = 69, + /**< Sent to parent to notify them a child is closing / being + * destroyed. in is the child wsi. + */ + + /* --------------------------------------------------------------------- + * ----- Callbacks related to TLS certificate management ----- + */ + + LWS_CALLBACK_VHOST_CERT_AGING = 72, + /**< When a vhost TLS cert has its expiry checked, this callback + * is broadcast to every protocol of every vhost in case the + * protocol wants to take some action with this information. + * \p in is a pointer to a struct lws_acme_cert_aging_args, + * and \p len is the number of days left before it expires, as + * a (ssize_t). In the struct lws_acme_cert_aging_args, vh + * points to the vhost the cert aging information applies to, + * and element_overrides[] is an optional way to update information + * from the pvos... NULL in an index means use the information from + * from the pvo for the cert renewal, non-NULL in the array index + * means use that pointer instead for the index. */ + + LWS_CALLBACK_VHOST_CERT_UPDATE = 74, + /**< When a vhost TLS cert is being updated, progress is + * reported to the vhost in question here, including completion + * and failure. in points to optional JSON, and len represents the + * connection state using enum lws_cert_update_state */ + + + /****** add new things just above ---^ ******/ + + LWS_CALLBACK_USER = 1000, + /**< user code can use any including above without fear of clashes */ +}; + + + +/** + * typedef lws_callback_function() - User server actions + * \param wsi: Opaque websocket instance pointer + * \param reason: The reason for the call + * \param user: Pointer to per-session user data allocated by library + * \param in: Pointer used for some callback reasons + * \param len: Length set for some callback reasons + * + * This callback is the way the user controls what is served. All the + * protocol detail is hidden and handled by the library. + * + * For each connection / session there is user data allocated that is + * pointed to by "user". You set the size of this user data area when + * the library is initialized with lws_create_server. + */ +typedef int +lws_callback_function(struct lws *wsi, enum lws_callback_reasons reason, + void *user, void *in, size_t len); + +#define LWS_CB_REASON_AUX_BF__CGI 1 +#define LWS_CB_REASON_AUX_BF__PROXY 2 +#define LWS_CB_REASON_AUX_BF__CGI_CHUNK_END 4 +#define LWS_CB_REASON_AUX_BF__CGI_HEADERS 8 +#define LWS_CB_REASON_AUX_BF__PROXY_TRANS_END 16 +#define LWS_CB_REASON_AUX_BF__PROXY_HEADERS 32 +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-cgi.h b/thirdparty/libwebsockets/include/libwebsockets/lws-cgi.h new file mode 100644 index 0000000000..7a5eca2855 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-cgi.h @@ -0,0 +1,103 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup cgi cgi handling + * + * ##CGI handling + * + * These functions allow low-level control over stdin/out/err of the cgi. + * + * However for most cases, binding the cgi to http in and out, the default + * lws implementation already does the right thing. + */ + +enum lws_enum_stdinouterr { + LWS_STDIN = 0, + LWS_STDOUT = 1, + LWS_STDERR = 2, +}; + +enum lws_cgi_hdr_state { + LCHS_HEADER, + LCHS_CR1, + LCHS_LF1, + LCHS_CR2, + LCHS_LF2, + LHCS_RESPONSE, + LHCS_DUMP_HEADERS, + LHCS_PAYLOAD, + LCHS_SINGLE_0A, +}; + +struct lws_cgi_args { + struct lws **stdwsi; /**< get fd with lws_get_socket_fd() */ + enum lws_enum_stdinouterr ch; /**< channel index */ + unsigned char *data; /**< for messages with payload */ + enum lws_cgi_hdr_state hdr_state; /**< track where we are in cgi headers */ + int len; /**< length */ +}; + +#ifdef LWS_WITH_CGI +/** + * lws_cgi: spawn network-connected cgi process + * + * \param wsi: connection to own the process + * \param exec_array: array of "exec-name" "arg1" ... "argn" NULL + * \param script_uri_path_len: how many chars on the left of the uri are the + * path to the cgi, or -1 to spawn without URL-related env vars + * \param timeout_secs: seconds script should be allowed to run + * \param mp_cgienv: pvo list with per-vhost cgi options to put in env + */ +LWS_VISIBLE LWS_EXTERN int +lws_cgi(struct lws *wsi, const char * const *exec_array, + int script_uri_path_len, int timeout_secs, + const struct lws_protocol_vhost_options *mp_cgienv); + +/** + * lws_cgi_write_split_stdout_headers: write cgi output accounting for header part + * + * \param wsi: connection to own the process + */ +LWS_VISIBLE LWS_EXTERN int +lws_cgi_write_split_stdout_headers(struct lws *wsi); + +/** + * lws_cgi_kill: terminate cgi process associated with wsi + * + * \param wsi: connection to own the process + */ +LWS_VISIBLE LWS_EXTERN int +lws_cgi_kill(struct lws *wsi); + +/** + * lws_cgi_get_stdwsi: get wsi for stdin, stdout, or stderr + * + * \param wsi: parent wsi that has cgi + * \param ch: which of LWS_STDIN, LWS_STDOUT or LWS_STDERR + */ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_cgi_get_stdwsi(struct lws *wsi, enum lws_enum_stdinouterr ch); + +#endif +///@} + diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-client.h b/thirdparty/libwebsockets/include/libwebsockets/lws-client.h new file mode 100644 index 0000000000..a1661b0a9f --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-client.h @@ -0,0 +1,231 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup client Client related functions + * ##Client releated functions + * \ingroup lwsapi + * + * */ +///@{ + +/** enum lws_client_connect_ssl_connection_flags - flags that may be used + * with struct lws_client_connect_info ssl_connection member to control if + * and how SSL checks apply to the client connection being created + */ + +enum lws_client_connect_ssl_connection_flags { + LCCSCF_USE_SSL = (1 << 0), + LCCSCF_ALLOW_SELFSIGNED = (1 << 1), + LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK = (1 << 2), + LCCSCF_ALLOW_EXPIRED = (1 << 3), + + LCCSCF_PIPELINE = (1 << 16), + /**< Serialize / pipeline multiple client connections + * on a single connection where possible. + * + * HTTP/1.0: possible if Keep-Alive: yes sent by server + * HTTP/1.1: always possible... uses pipelining + * HTTP/2: always possible... uses parallel streams + * */ +}; + +/** struct lws_client_connect_info - parameters to connect with when using + * lws_client_connect_via_info() */ + +struct lws_client_connect_info { + struct lws_context *context; + /**< lws context to create connection in */ + const char *address; + /**< remote address to connect to */ + int port; + /**< remote port to connect to */ + int ssl_connection; + /**< 0, or a combination of LCCSCF_ flags */ + const char *path; + /**< uri path */ + const char *host; + /**< content of host header */ + const char *origin; + /**< content of origin header */ + const char *protocol; + /**< list of ws protocols we could accept */ + int ietf_version_or_minus_one; + /**< deprecated: currently leave at 0 or -1 */ + void *userdata; + /**< if non-NULL, use this as wsi user_data instead of malloc it */ + const void *client_exts; + /**< UNUSED... provide in info.extensions at context creation time */ + const char *method; + /**< if non-NULL, do this http method instead of ws[s] upgrade. + * use "GET" to be a simple http client connection. "RAW" gets + * you a connected socket that lws itself will leave alone once + * connected. */ + struct lws *parent_wsi; + /**< if another wsi is responsible for this connection, give it here. + * this is used to make sure if the parent closes so do any + * child connections first. */ + const char *uri_replace_from; + /**< if non-NULL, when this string is found in URIs in + * text/html content-encoding, it's replaced with uri_replace_to */ + const char *uri_replace_to; + /**< see uri_replace_from */ + struct lws_vhost *vhost; + /**< vhost to bind to (used to determine related SSL_CTX) */ + struct lws **pwsi; + /**< if not NULL, store the new wsi here early in the connection + * process. Although we return the new wsi, the call to create the + * client connection does progress the connection somewhat and may + * meet an error that will result in the connection being scrubbed and + * NULL returned. While the wsi exists though, he may process a + * callback like CLIENT_CONNECTION_ERROR with his wsi: this gives the + * user callback a way to identify which wsi it is that faced the error + * even before the new wsi is returned and even if ultimately no wsi + * is returned. + */ + const char *iface; + /**< NULL to allow routing on any interface, or interface name or IP + * to bind the socket to */ + const char *local_protocol_name; + /**< NULL: .protocol is used both to select the local protocol handler + * to bind to and as the list of remote ws protocols we could + * accept. + * non-NULL: this protocol name is used to bind the connection to + * the local protocol handler. .protocol is used for the + * list of remote ws protocols we could accept */ + const char *alpn; + /**< NULL: allow lws default ALPN list, from vhost if present or from + * list of roles built into lws + * non-NULL: require one from provided comma-separated list of alpn + * tokens + */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility + * + * The below is to ensure later library versions with new + * members added above will see 0 (default) even if the app + * was not built against the newer headers. + */ + + void *_unused[4]; /**< dummy */ +}; + +/** + * lws_client_connect_via_info() - Connect to another websocket server + * \param ccinfo: pointer to lws_client_connect_info struct + * + * This function creates a connection to a remote server using the + * information provided in ccinfo. + */ +LWS_VISIBLE LWS_EXTERN struct lws * +lws_client_connect_via_info(const struct lws_client_connect_info *ccinfo); + +/** + * lws_init_vhost_client_ssl() - also enable client SSL on an existing vhost + * + * \param info: client ssl related info + * \param vhost: which vhost to initialize client ssl operations on + * + * You only need to call this if you plan on using SSL client connections on + * the vhost. For non-SSL client connections, it's not necessary to call this. + * + * The following members of info are used during the call + * + * - options must have LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT set, + * otherwise the call does nothing + * - provided_client_ssl_ctx must be NULL to get a generated client + * ssl context, otherwise you can pass a prepared one in by setting it + * - ssl_cipher_list may be NULL or set to the client valid cipher list + * - ssl_ca_filepath may be NULL or client cert filepath + * - ssl_cert_filepath may be NULL or client cert filepath + * - ssl_private_key_filepath may be NULL or client cert private key + * + * You must create your vhost explicitly if you want to use this, so you have + * a pointer to the vhost. Create the context first with the option flag + * LWS_SERVER_OPTION_EXPLICIT_VHOSTS and then call lws_create_vhost() with + * the same info struct. + */ +LWS_VISIBLE LWS_EXTERN int +lws_init_vhost_client_ssl(const struct lws_context_creation_info *info, + struct lws_vhost *vhost); +/** + * lws_http_client_read() - consume waiting received http client data + * + * \param wsi: client connection + * \param buf: pointer to buffer pointer - fill with pointer to your buffer + * \param len: pointer to chunk length - fill with max length of buffer + * + * This is called when the user code is notified client http data has arrived. + * The user code may choose to delay calling it to consume the data, for example + * waiting until an onward connection is writeable. + * + * For non-chunked connections, up to len bytes of buf are filled with the + * received content. len is set to the actual amount filled before return. + * + * For chunked connections, the linear buffer content contains the chunking + * headers and it cannot be passed in one lump. Instead, this function will + * call back LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ with in pointing to the + * chunk start and len set to the chunk length. There will be as many calls + * as there are chunks or partial chunks in the buffer. + */ +LWS_VISIBLE LWS_EXTERN int +lws_http_client_read(struct lws *wsi, char **buf, int *len); + +/** + * lws_http_client_http_response() - get last HTTP response code + * + * \param wsi: client connection + * + * Returns the last server response code, eg, 200 for client http connections. + * + * You should capture this during the LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP + * callback, because after that the memory reserved for storing the related + * headers is freed and this value is lost. + */ +LWS_VISIBLE LWS_EXTERN unsigned int +lws_http_client_http_response(struct lws *wsi); + +LWS_VISIBLE LWS_EXTERN void +lws_client_http_body_pending(struct lws *wsi, int something_left_to_send); + +/** + * lws_client_http_body_pending() - control if client connection neeeds to send body + * + * \param wsi: client connection + * \param something_left_to_send: nonzero if need to send more body, 0 (default) + * if nothing more to send + * + * If you will send payload data with your HTTP client connection, eg, for POST, + * when you set the related http headers in + * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER callback you should also call + * this API with something_left_to_send nonzero, and call + * lws_callback_on_writable(wsi); + * + * After sending the headers, lws will call your callback with + * LWS_CALLBACK_CLIENT_HTTP_WRITEABLE reason when writable. You can send the + * next part of the http body payload, calling lws_callback_on_writable(wsi); + * if there is more to come, or lws_client_http_body_pending(wsi, 0); to + * let lws know the last part is sent and the connection can move on. + */ + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-context-vhost.h b/thirdparty/libwebsockets/include/libwebsockets/lws-context-vhost.h new file mode 100644 index 0000000000..a63d708629 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-context-vhost.h @@ -0,0 +1,927 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup context-and-vhost context and vhost related functions + * ##Context and Vhost releated functions + * \ingroup lwsapi + * + * + * LWS requires that there is one context, in which you may define multiple + * vhosts. Each vhost is a virtual host, with either its own listen port + * or sharing an existing one. Each vhost has its own SSL context that can + * be set up individually or left disabled. + * + * If you don't care about multiple "site" support, you can ignore it and + * lws will create a single default vhost at context creation time. + */ +///@{ + +/* + * NOTE: These public enums are part of the abi. If you want to add one, + * add it at where specified so existing users are unaffected. + */ + +/** enum lws_context_options - context and vhost options */ +enum lws_context_options { + LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = (1 << 1) | + (1 << 12), + /**< (VH) Don't allow the connection unless the client has a + * client cert that we recognize; provides + * LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT */ + LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = (1 << 2), + /**< (CTX) Don't try to get the server's hostname */ + LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT = (1 << 3) | + (1 << 12), + /**< (VH) Allow non-SSL (plaintext) connections on the same + * port as SSL is listening... undermines the security of SSL; + * provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT */ + LWS_SERVER_OPTION_LIBEV = (1 << 4), + /**< (CTX) Use libev event loop */ + LWS_SERVER_OPTION_DISABLE_IPV6 = (1 << 5), + /**< (VH) Disable IPV6 support */ + LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS = (1 << 6), + /**< (VH) Don't load OS CA certs, you will need to load your + * own CA cert(s) */ + LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED = (1 << 7), + /**< (VH) Accept connections with no valid Cert (eg, selfsigned) */ + LWS_SERVER_OPTION_VALIDATE_UTF8 = (1 << 8), + /**< (VH) Check UT-8 correctness */ + LWS_SERVER_OPTION_SSL_ECDH = (1 << 9) | + (1 << 12), + /**< (VH) initialize ECDH ciphers */ + LWS_SERVER_OPTION_LIBUV = (1 << 10), + /**< (CTX) Use libuv event loop */ + LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS = (1 << 11) | + (1 << 12), + /**< (VH) Use http redirect to force http to https + * (deprecated: use mount redirection) */ + LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT = (1 << 12), + /**< (CTX) Initialize the SSL library at all */ + LWS_SERVER_OPTION_EXPLICIT_VHOSTS = (1 << 13), + /**< (CTX) Only create the context when calling context + * create api, implies user code will create its own vhosts */ + LWS_SERVER_OPTION_UNIX_SOCK = (1 << 14), + /**< (VH) Use Unix socket */ + LWS_SERVER_OPTION_STS = (1 << 15), + /**< (VH) Send Strict Transport Security header, making + * clients subsequently go to https even if user asked for http */ + LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY = (1 << 16), + /**< (VH) Enable LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE to take effect */ + LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE = (1 << 17), + /**< (VH) if set, only ipv6 allowed on the vhost */ + LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN = (1 << 18), + /**< (CTX) Libuv only: Do not spin on SIGSEGV / SIGFPE. A segfault + * normally makes the lib spin so you can attach a debugger to it + * even if it happened without a debugger in place. You can disable + * that by giving this option. + */ + LWS_SERVER_OPTION_JUST_USE_RAW_ORIGIN = (1 << 19), + /**< For backwards-compatibility reasons, by default + * lws prepends "http://" to the origin you give in the client + * connection info struct. If you give this flag when you create + * the context, only the string you give in the client connect + * info for .origin (if any) will be used directly. + */ + LWS_SERVER_OPTION_FALLBACK_TO_RAW = (1 << 20), + /**< (VH) if invalid http is coming in the first line, */ + LWS_SERVER_OPTION_LIBEVENT = (1 << 21), + /**< (CTX) Use libevent event loop */ + LWS_SERVER_OPTION_ONLY_RAW = (1 << 22), + /**< (VH) All connections to this vhost / port are RAW as soon as + * the connection is accepted, no HTTP is going to be coming. + */ + LWS_SERVER_OPTION_ALLOW_LISTEN_SHARE = (1 << 23), + /**< (VH) Set to allow multiple listen sockets on one interface + + * address + port. The default is to strictly allow only one + * listen socket at a time. This is automatically selected if you + * have multiple service threads. + */ + LWS_SERVER_OPTION_CREATE_VHOST_SSL_CTX = (1 << 24), + /**< (VH) Force setting up the vhost SSL_CTX, even though the user + * code doesn't explicitly provide a cert in the info struct. It + * implies the user code is going to provide a cert at the + * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS callback, which + * provides the vhost SSL_CTX * in the user parameter. + */ + LWS_SERVER_OPTION_SKIP_PROTOCOL_INIT = (1 << 25), + /**< (VH) You probably don't want this. It forces this vhost to not + * call LWS_CALLBACK_PROTOCOL_INIT on its protocols. It's used in the + * special case of a temporary vhost bound to a single protocol. + */ + LWS_SERVER_OPTION_IGNORE_MISSING_CERT = (1 << 26), + /**< (VH) Don't fail if the vhost TLS cert or key are missing, just + * continue. The vhost won't be able to serve anything, but if for + * example the ACME plugin was configured to fetch a cert, this lets + * you bootstrap your vhost from having no cert to start with. + */ + LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK = (1 << 27), + /**< (VH) On this vhost, if the connection is being upgraded, insist + * that there's a Host: header and that the contents match the vhost + * name + port (443 / 80 are assumed if no :port given based on if the + * connection is using TLS). + * + * By default, without this flag, on upgrade lws just checks that the + * Host: header was given without checking the contents... this is to + * allow lax hostname mappings like localhost / 127.0.0.1, and CNAME + * mappings like www.mysite.com / mysite.com + */ + LWS_SERVER_OPTION_HTTP_HEADERS_SECURITY_BEST_PRACTICES_ENFORCE = (1 << 28), + /**< (VH) Send lws default HTTP headers recommended by Mozilla + * Observatory for security. This is a helper option that sends canned + * headers on each http response enabling a VERY strict Content Security + * Policy. The policy is so strict, for example it won't let the page + * run its own inline JS nor show images or take CSS from a different + * server. In many cases your JS only comes from your server as do the + * image sources and CSS, so that is what you want... attackers hoping + * to inject JS into your DOM are completely out of luck since even if + * they succeed, it will be rejected for execution by the browser + * according to the strict CSP. In other cases you have to deviate from + * the complete strictness, in which case don't use this flag: use the + * .headers member in the vhost init described in struct + * lws_context_creation_info instead to send the adapted headers + * yourself. + */ + + /****** add new things just above ---^ ******/ +}; + +#define lws_check_opt(c, f) (((c) & (f)) == (f)) + +struct lws_plat_file_ops; + +/** struct lws_context_creation_info - parameters to create context and /or vhost with + * + * This is also used to create vhosts.... if LWS_SERVER_OPTION_EXPLICIT_VHOSTS + * is not given, then for backwards compatibility one vhost is created at + * context-creation time using the info from this struct. + * + * If LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, then no vhosts are created + * at the same time as the context, they are expected to be created afterwards. + */ +struct lws_context_creation_info { + int port; + /**< VHOST: Port to listen on. Use CONTEXT_PORT_NO_LISTEN to suppress + * listening for a client. Use CONTEXT_PORT_NO_LISTEN_SERVER if you are + * writing a server but you are using \ref sock-adopt instead of the + * built-in listener. + * + * You can also set port to 0, in which case the kernel will pick + * a random port that is not already in use. You can find out what + * port the vhost is listening on using lws_get_vhost_listen_port() */ + const char *iface; + /**< VHOST: NULL to bind the listen socket to all interfaces, or the + * interface name, eg, "eth2" + * If options specifies LWS_SERVER_OPTION_UNIX_SOCK, this member is + * the pathname of a UNIX domain socket. you can use the UNIX domain + * sockets in abstract namespace, by prepending an at symbol to the + * socket name. */ + const struct lws_protocols *protocols; + /**< VHOST: Array of structures listing supported protocols and a + * protocol-specific callback for each one. The list is ended with an + * entry that has a NULL callback pointer. */ + const struct lws_extension *extensions; + /**< VHOST: NULL or array of lws_extension structs listing the + * extensions this context supports. */ + const struct lws_token_limits *token_limits; + /**< CONTEXT: NULL or struct lws_token_limits pointer which is + * initialized with a token length limit for each possible WSI_TOKEN_ */ + const char *ssl_private_key_password; + /**< VHOST: NULL or the passphrase needed for the private key. (For + * backwards compatibility, this can also be used to pass the client + * cert passphrase when setting up a vhost client SSL context, but it is + * preferred to use .client_ssl_private_key_password for that.) */ + const char *ssl_cert_filepath; + /**< VHOST: If libwebsockets was compiled to use ssl, and you want + * to listen using SSL, set to the filepath to fetch the + * server cert from, otherwise NULL for unencrypted. (For backwards + * compatibility, this can also be used to pass the client certificate + * when setting up a vhost client SSL context, but it is preferred to + * use .client_ssl_cert_filepath for that.) */ + const char *ssl_private_key_filepath; + /**< VHOST: filepath to private key if wanting SSL mode; + * if this is set to NULL but ssl_cert_filepath is set, the + * OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY callback is called + * to allow setting of the private key directly via openSSL + * library calls. (For backwards compatibility, this can also be used + * to pass the client cert private key filepath when setting up a + * vhost client SSL context, but it is preferred to use + * .client_ssl_private_key_filepath for that.) */ + const char *ssl_ca_filepath; + /**< VHOST: CA certificate filepath or NULL. (For backwards + * compatibility, this can also be used to pass the client CA + * filepath when setting up a vhost client SSL context, + * but it is preferred to use .client_ssl_ca_filepath for that.) */ + const char *ssl_cipher_list; + /**< VHOST: List of valid ciphers to use ON TLS1.2 AND LOWER ONLY (eg, + * "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" + * or you can leave it as NULL to get "DEFAULT" (For backwards + * compatibility, this can also be used to pass the client cipher + * list when setting up a vhost client SSL context, + * but it is preferred to use .client_ssl_cipher_list for that.) + * SEE .tls1_3_plus_cipher_list and .client_tls_1_3_plus_cipher_list + * for the equivalent for tls1.3. + */ + const char *http_proxy_address; + /**< VHOST: If non-NULL, attempts to proxy via the given address. + * If proxy auth is required, use format + * "username:password\@server:port" */ + unsigned int http_proxy_port; + /**< VHOST: If http_proxy_address was non-NULL, uses this port */ + int gid; + /**< CONTEXT: group id to change to after setting listen socket, + * or -1. */ + int uid; + /**< CONTEXT: user id to change to after setting listen socket, + * or -1. */ + unsigned int options; + /**< VHOST + CONTEXT: 0, or LWS_SERVER_OPTION_... bitfields */ + void *user; + /**< VHOST + CONTEXT: optional user pointer that will be associated + * with the context when creating the context (and can be retrieved by + * lws_context_user(context), or with the vhost when creating the vhost + * (and can be retrieved by lws_vhost_user(vhost)). You will need to + * use LWS_SERVER_OPTION_EXPLICIT_VHOSTS and create the vhost separately + * if you care about giving the context and vhost different user pointer + * values. + */ + int ka_time; + /**< CONTEXT: 0 for no TCP keepalive, otherwise apply this keepalive + * timeout to all libwebsocket sockets, client or server */ + int ka_probes; + /**< CONTEXT: if ka_time was nonzero, after the timeout expires how many + * times to try to get a response from the peer before giving up + * and killing the connection */ + int ka_interval; + /**< CONTEXT: if ka_time was nonzero, how long to wait before each ka_probes + * attempt */ +#if defined(LWS_WITH_TLS) && !defined(LWS_WITH_MBEDTLS) + SSL_CTX *provided_client_ssl_ctx; + /**< CONTEXT: If non-null, swap out libwebsockets ssl + * implementation for the one provided by provided_ssl_ctx. + * Libwebsockets no longer is responsible for freeing the context + * if this option is selected. */ +#else /* maintain structure layout either way */ + void *provided_client_ssl_ctx; /**< dummy if ssl disabled */ +#endif + + unsigned short max_http_header_data; + /**< CONTEXT: The max amount of header payload that can be handled + * in an http request (unrecognized header payload is dropped) */ + unsigned short max_http_header_pool; + /**< CONTEXT: The max number of connections with http headers that + * can be processed simultaneously (the corresponding memory is + * allocated and deallocated dynamically as needed). If the pool is + * fully busy new incoming connections must wait for accept until one + * becomes free. 0 = allow as many ah as number of availble fds for + * the process */ + + unsigned int count_threads; + /**< CONTEXT: how many contexts to create in an array, 0 = 1 */ + unsigned int fd_limit_per_thread; + /**< CONTEXT: nonzero means restrict each service thread to this + * many fds, 0 means the default which is divide the process fd + * limit by the number of threads. */ + unsigned int timeout_secs; + /**< VHOST: various processes involving network roundtrips in the + * library are protected from hanging forever by timeouts. If + * nonzero, this member lets you set the timeout used in seconds. + * Otherwise a default timeout is used. */ + const char *ecdh_curve; + /**< VHOST: if NULL, defaults to initializing server with + * "prime256v1" */ + const char *vhost_name; + /**< VHOST: name of vhost, must match external DNS name used to + * access the site, like "warmcat.com" as it's used to match + * Host: header and / or SNI name for SSL. */ + const char * const *plugin_dirs; + /**< CONTEXT: NULL, or NULL-terminated array of directories to + * scan for lws protocol plugins at context creation time */ + const struct lws_protocol_vhost_options *pvo; + /**< VHOST: pointer to optional linked list of per-vhost + * options made accessible to protocols */ + int keepalive_timeout; + /**< VHOST: (default = 0 = 5s) seconds to allow remote + * client to hold on to an idle HTTP/1.1 connection */ + const char *log_filepath; + /**< VHOST: filepath to append logs to... this is opened before + * any dropping of initial privileges */ + const struct lws_http_mount *mounts; + /**< VHOST: optional linked list of mounts for this vhost */ + const char *server_string; + /**< CONTEXT: string used in HTTP headers to identify server + * software, if NULL, "libwebsockets". */ + unsigned int pt_serv_buf_size; + /**< CONTEXT: 0 = default of 4096. This buffer is used by + * various service related features including file serving, it + * defines the max chunk of file that can be sent at once. + * At the risk of lws having to buffer failed large sends, it + * can be increased to, eg, 128KiB to improve throughput. */ + unsigned int max_http_header_data2; + /**< CONTEXT: if max_http_header_data is 0 and this + * is nonzero, this will be used in place of the default. It's + * like this for compatibility with the original short version, + * this is unsigned int length. */ + long ssl_options_set; + /**< VHOST: Any bits set here will be set as server SSL options */ + long ssl_options_clear; + /**< VHOST: Any bits set here will be cleared as server SSL options */ + unsigned short ws_ping_pong_interval; + /**< CONTEXT: 0 for none, else interval in seconds between sending + * PINGs on idle websocket connections. When the PING is sent, + * the PONG must come within the normal timeout_secs timeout period + * or the connection will be dropped. + * Any RX or TX traffic on the connection restarts the interval timer, + * so a connection which always sends or receives something at intervals + * less than the interval given here will never send PINGs / expect + * PONGs. Conversely as soon as the ws connection is established, an + * idle connection will do the PING / PONG roundtrip as soon as + * ws_ping_pong_interval seconds has passed without traffic + */ + const struct lws_protocol_vhost_options *headers; + /**< VHOST: pointer to optional linked list of per-vhost + * canned headers that are added to server responses */ + + const struct lws_protocol_vhost_options *reject_service_keywords; + /**< CONTEXT: Optional list of keywords and rejection codes + text. + * + * The keywords are checked for existing in the user agent string. + * + * Eg, "badrobot" "404 Not Found" + */ + void *external_baggage_free_on_destroy; + /**< CONTEXT: NULL, or pointer to something externally malloc'd, that + * should be freed when the context is destroyed. This allows you to + * automatically sync the freeing action to the context destruction + * action, so there is no need for an external free() if the context + * succeeded to create. + */ + + const char *client_ssl_private_key_password; + /**< VHOST: Client SSL context init: NULL or the passphrase needed + * for the private key */ + const char *client_ssl_cert_filepath; + /**< VHOST: Client SSL context init:T he certificate the client + * should present to the peer on connection */ + const char *client_ssl_private_key_filepath; + /**< VHOST: Client SSL context init: filepath to client private key + * if this is set to NULL but client_ssl_cert_filepath is set, you + * can handle the LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS + * callback of protocols[0] to allow setting of the private key directly + * via openSSL library calls */ + const char *client_ssl_ca_filepath; + /**< VHOST: Client SSL context init: CA certificate filepath or NULL */ + const void *client_ssl_ca_mem; + /**< VHOST: Client SSL context init: CA certificate memory buffer or + * NULL... use this to load CA cert from memory instead of file */ + unsigned int client_ssl_ca_mem_len; + /**< VHOST: Client SSL context init: length of client_ssl_ca_mem in + * bytes */ + + const char *client_ssl_cipher_list; + /**< VHOST: Client SSL context init: List of valid ciphers to use (eg, + * "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" + * or you can leave it as NULL to get "DEFAULT" */ + + const struct lws_plat_file_ops *fops; + /**< CONTEXT: NULL, or pointer to an array of fops structs, terminated + * by a sentinel with NULL .open. + * + * If NULL, lws provides just the platform file operations struct for + * backwards compatibility. + */ + int simultaneous_ssl_restriction; + /**< CONTEXT: 0 (no limit) or limit of simultaneous SSL sessions + * possible.*/ + const char *socks_proxy_address; + /**< VHOST: If non-NULL, attempts to proxy via the given address. + * If proxy auth is required, use format + * "username:password\@server:port" */ + unsigned int socks_proxy_port; + /**< VHOST: If socks_proxy_address was non-NULL, uses this port */ +#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) + cap_value_t caps[4]; + /**< CONTEXT: array holding Linux capabilities you want to + * continue to be available to the server after it transitions + * to a noprivileged user. Usually none are needed but for, eg, + * .bind_iface, CAP_NET_RAW is required. This gives you a way + * to still have the capability but drop root. + */ + char count_caps; + /**< CONTEXT: count of Linux capabilities in .caps[]. 0 means + * no capabilities will be inherited from root (the default) */ +#endif + int bind_iface; + /**< VHOST: nonzero to strictly bind sockets to the interface name in + * .iface (eg, "eth2"), using SO_BIND_TO_DEVICE. + * + * Requires SO_BINDTODEVICE support from your OS and CAP_NET_RAW + * capability. + * + * Notice that common things like access network interface IP from + * your local machine use your lo / loopback interface and will be + * disallowed by this. + */ + int ssl_info_event_mask; + /**< VHOST: mask of ssl events to be reported on LWS_CALLBACK_SSL_INFO + * callback for connections on this vhost. The mask values are of + * the form SSL_CB_ALERT, defined in openssl/ssl.h. The default of + * 0 means no info events will be reported. + */ + unsigned int timeout_secs_ah_idle; + /**< VHOST: seconds to allow a client to hold an ah without using it. + * 0 defaults to 10s. */ + unsigned short ip_limit_ah; + /**< CONTEXT: max number of ah a single IP may use simultaneously + * 0 is no limit. This is a soft limit: if the limit is + * reached, connections from that IP will wait in the ah + * waiting list and not be able to acquire an ah until + * a connection belonging to the IP relinquishes one it + * already has. + */ + unsigned short ip_limit_wsi; + /**< CONTEXT: max number of wsi a single IP may use simultaneously. + * 0 is no limit. This is a hard limit, connections from + * the same IP will simply be dropped once it acquires the + * amount of simultaneous wsi / accepted connections + * given here. + */ + uint32_t http2_settings[7]; + /**< VHOST: if http2_settings[0] is nonzero, the values given in + * http2_settings[1]..[6] are used instead of the lws + * platform default values. + * Just leave all at 0 if you don't care. + */ + const char *error_document_404; + /**< VHOST: If non-NULL, when asked to serve a non-existent file, + * lws attempts to server this url path instead. Eg, + * "/404.html" */ + const char *alpn; + /**< CONTEXT: If non-NULL, default list of advertised alpn, comma- + * separated + * + * VHOST: If non-NULL, per-vhost list of advertised alpn, comma- + * separated + */ + void **foreign_loops; + /**< CONTEXT: This is ignored if the context is not being started with + * an event loop, ie, .options has a flag like + * LWS_SERVER_OPTION_LIBUV. + * + * NULL indicates lws should start its own even loop for + * each service thread, and deal with closing the loops + * when the context is destroyed. + * + * Non-NULL means it points to an array of external + * ("foreign") event loops that are to be used in turn for + * each service thread. In the default case of 1 service + * thread, it can just point to one foreign event loop. + */ + void (*signal_cb)(void *event_lib_handle, int signum); + /**< CONTEXT: NULL: default signal handling. Otherwise this receives + * the signal handler callback. event_lib_handle is the + * native event library signal handle, eg uv_signal_t * + * for libuv. + */ + struct lws_context **pcontext; + /**< CONTEXT: if non-NULL, at the end of context destroy processing, + * the pointer pointed to by pcontext is written with NULL. You can + * use this to let foreign event loops know that lws context destruction + * is fully completed. + */ + void (*finalize)(struct lws_vhost *vh, void *arg); + /**< VHOST: NULL, or pointer to function that will be called back + * when the vhost is just about to be freed. The arg parameter + * will be set to whatever finalize_arg is below. + */ + void *finalize_arg; + /**< VHOST: opaque pointer lws ignores but passes to the finalize + * callback. If you don't care, leave it NULL. + */ + unsigned int max_http_header_pool2; + /**< CONTEXT: if max_http_header_pool is 0 and this + * is nonzero, this will be used in place of the default. It's + * like this for compatibility with the original short version: + * this is unsigned int length. */ + + long ssl_client_options_set; + /**< VHOST: Any bits set here will be set as CLIENT SSL options */ + long ssl_client_options_clear; + /**< VHOST: Any bits set here will be cleared as CLIENT SSL options */ + + const char *tls1_3_plus_cipher_list; + /**< VHOST: List of valid ciphers to use for incoming server connections + * ON TLS1.3 AND ABOVE (eg, "TLS_CHACHA20_POLY1305_SHA256" on this vhost + * or you can leave it as NULL to get "DEFAULT". + * SEE .client_tls_1_3_plus_cipher_list to do the same on the vhost + * client SSL_CTX. + */ + const char *client_tls_1_3_plus_cipher_list; + /**< VHOST: List of valid ciphers to use for outgoing client connections + * ON TLS1.3 AND ABOVE on this vhost (eg, + * "TLS_CHACHA20_POLY1305_SHA256") or you can leave it as NULL to get + * "DEFAULT". + */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility + * + * The below is to ensure later library versions with new + * members added above will see 0 (default) even if the app + * was not built against the newer headers. + */ + + void *_unused[4]; /**< dummy */ +}; + +/** + * lws_create_context() - Create the websocket handler + * \param info: pointer to struct with parameters + * + * This function creates the listening socket (if serving) and takes care + * of all initialization in one step. + * + * If option LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, no vhost is + * created; you're expected to create your own vhosts afterwards using + * lws_create_vhost(). Otherwise a vhost named "default" is also created + * using the information in the vhost-related members, for compatibility. + * + * After initialization, it returns a struct lws_context * that + * represents this server. After calling, user code needs to take care + * of calling lws_service() with the context pointer to get the + * server's sockets serviced. This must be done in the same process + * context as the initialization call. + * + * The protocol callback functions are called for a handful of events + * including http requests coming in, websocket connections becoming + * established, and data arriving; it's also called periodically to allow + * async transmission. + * + * HTTP requests are sent always to the FIRST protocol in protocol, since + * at that time websocket protocol has not been negotiated. Other + * protocols after the first one never see any HTTP callback activity. + * + * The server created is a simple http server by default; part of the + * websocket standard is upgrading this http connection to a websocket one. + * + * This allows the same server to provide files like scripts and favicon / + * images or whatever over http and dynamic data over websockets all in + * one place; they're all handled in the user callback. + */ +LWS_VISIBLE LWS_EXTERN struct lws_context * +lws_create_context(const struct lws_context_creation_info *info); + + +/** + * lws_context_destroy() - Destroy the websocket context + * \param context: Websocket context + * + * This function closes any active connections and then frees the + * context. After calling this, any further use of the context is + * undefined. + */ +LWS_VISIBLE LWS_EXTERN void +lws_context_destroy(struct lws_context *context); + +typedef int (*lws_reload_func)(void); + +/** + * lws_context_deprecate() - Deprecate the websocket context + * + * \param context: Websocket context + * \param cb: Callback notified when old context listen sockets are closed + * + * This function is used on an existing context before superceding it + * with a new context. + * + * It closes any listen sockets in the context, so new connections are + * not possible. + * + * And it marks the context to be deleted when the number of active + * connections into it falls to zero. + * + * This is aimed at allowing seamless configuration reloads. + * + * The callback cb will be called after the listen sockets are actually + * closed and may be reopened. In the callback the new context should be + * configured and created. (With libuv, socket close happens async after + * more loop events). + */ +LWS_VISIBLE LWS_EXTERN void +lws_context_deprecate(struct lws_context *context, lws_reload_func cb); + +LWS_VISIBLE LWS_EXTERN int +lws_context_is_deprecated(struct lws_context *context); + +/** + * lws_set_proxy() - Setups proxy to lws_context. + * \param vhost: pointer to struct lws_vhost you want set proxy for + * \param proxy: pointer to c string containing proxy in format address:port + * + * Returns 0 if proxy string was parsed and proxy was setup. + * Returns -1 if proxy is NULL or has incorrect format. + * + * This is only required if your OS does not provide the http_proxy + * environment variable (eg, OSX) + * + * IMPORTANT! You should call this function right after creation of the + * lws_context and before call to connect. If you call this + * function after connect behavior is undefined. + * This function will override proxy settings made on lws_context + * creation with genenv() call. + */ +LWS_VISIBLE LWS_EXTERN int +lws_set_proxy(struct lws_vhost *vhost, const char *proxy); + +/** + * lws_set_socks() - Setup socks to lws_context. + * \param vhost: pointer to struct lws_vhost you want set socks for + * \param socks: pointer to c string containing socks in format address:port + * + * Returns 0 if socks string was parsed and socks was setup. + * Returns -1 if socks is NULL or has incorrect format. + * + * This is only required if your OS does not provide the socks_proxy + * environment variable (eg, OSX) + * + * IMPORTANT! You should call this function right after creation of the + * lws_context and before call to connect. If you call this + * function after connect behavior is undefined. + * This function will override proxy settings made on lws_context + * creation with genenv() call. + */ +LWS_VISIBLE LWS_EXTERN int +lws_set_socks(struct lws_vhost *vhost, const char *socks); + +struct lws_vhost; + +/** + * lws_create_vhost() - Create a vhost (virtual server context) + * \param context: pointer to result of lws_create_context() + * \param info: pointer to struct with parameters + * + * This function creates a virtual server (vhost) using the vhost-related + * members of the info struct. You can create many vhosts inside one context + * if you created the context with the option LWS_SERVER_OPTION_EXPLICIT_VHOSTS + */ +LWS_VISIBLE LWS_EXTERN struct lws_vhost * +lws_create_vhost(struct lws_context *context, + const struct lws_context_creation_info *info); + +/** + * lws_vhost_destroy() - Destroy a vhost (virtual server context) + * + * \param vh: pointer to result of lws_create_vhost() + * + * This function destroys a vhost. Normally, if you just want to exit, + * then lws_destroy_context() will take care of everything. If you want + * to destroy an individual vhost and all connections and allocations, you + * can do it with this. + * + * If the vhost has a listen sockets shared by other vhosts, it will be given + * to one of the vhosts sharing it rather than closed. + * + * The vhost close is staged according to the needs of the event loop, and if + * there are multiple service threads. At the point the vhost itself if + * about to be freed, if you provided a finalize callback and optional arg at + * vhost creation time, it will be called just before the vhost is freed. + */ +LWS_VISIBLE LWS_EXTERN void +lws_vhost_destroy(struct lws_vhost *vh); + +/** + * lwsws_get_config_globals() - Parse a JSON server config file + * \param info: pointer to struct with parameters + * \param d: filepath of the config file + * \param config_strings: storage for the config strings extracted from JSON, + * the pointer is incremented as strings are stored + * \param len: pointer to the remaining length left in config_strings + * the value is decremented as strings are stored + * + * This function prepares a n lws_context_creation_info struct with global + * settings from a file d. + * + * Requires CMake option LWS_WITH_LEJP_CONF to have been enabled + */ +LWS_VISIBLE LWS_EXTERN int +lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d, + char **config_strings, int *len); + +/** + * lwsws_get_config_vhosts() - Create vhosts from a JSON server config file + * \param context: pointer to result of lws_create_context() + * \param info: pointer to struct with parameters + * \param d: filepath of the config file + * \param config_strings: storage for the config strings extracted from JSON, + * the pointer is incremented as strings are stored + * \param len: pointer to the remaining length left in config_strings + * the value is decremented as strings are stored + * + * This function creates vhosts into a context according to the settings in + *JSON files found in directory d. + * + * Requires CMake option LWS_WITH_LEJP_CONF to have been enabled + */ +LWS_VISIBLE LWS_EXTERN int +lwsws_get_config_vhosts(struct lws_context *context, + struct lws_context_creation_info *info, const char *d, + char **config_strings, int *len); + +/** lws_vhost_get() - \deprecated deprecated: use lws_get_vhost() */ +LWS_VISIBLE LWS_EXTERN struct lws_vhost * +lws_vhost_get(struct lws *wsi) LWS_WARN_DEPRECATED; + +/** + * lws_get_vhost() - return the vhost a wsi belongs to + * + * \param wsi: which connection + */ +LWS_VISIBLE LWS_EXTERN struct lws_vhost * +lws_get_vhost(struct lws *wsi); + +/** + * lws_get_vhost_name() - returns the name of a vhost + * + * \param vhost: which vhost + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_get_vhost_name(struct lws_vhost *vhost); + +/** + * lws_get_vhost_port() - returns the port a vhost listens on, or -1 + * + * \param vhost: which vhost + */ +LWS_VISIBLE LWS_EXTERN int +lws_get_vhost_port(struct lws_vhost *vhost); + +/** + * lws_get_vhost_user() - returns the user pointer for the vhost + * + * \param vhost: which vhost + */ +LWS_VISIBLE LWS_EXTERN void * +lws_get_vhost_user(struct lws_vhost *vhost); + +/** + * lws_get_vhost_iface() - returns the binding for the vhost listen socket + * + * \param vhost: which vhost + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_get_vhost_iface(struct lws_vhost *vhost); + +/** + * lws_json_dump_vhost() - describe vhost state and stats in JSON + * + * \param vh: the vhost + * \param buf: buffer to fill with JSON + * \param len: max length of buf + */ +LWS_VISIBLE LWS_EXTERN int +lws_json_dump_vhost(const struct lws_vhost *vh, char *buf, int len); + +/** + * lws_json_dump_context() - describe context state and stats in JSON + * + * \param context: the context + * \param buf: buffer to fill with JSON + * \param len: max length of buf + * \param hide_vhosts: nonzero to not provide per-vhost mount etc information + * + * Generates a JSON description of vhost state into buf + */ +LWS_VISIBLE LWS_EXTERN int +lws_json_dump_context(const struct lws_context *context, char *buf, int len, + int hide_vhosts); + +/** + * lws_vhost_user() - get the user data associated with the vhost + * \param vhost: Websocket vhost + * + * This returns the optional user pointer that can be attached to + * a vhost when it was created. Lws never dereferences this pointer, it only + * sets it when the vhost is created, and returns it using this api. + */ +LWS_VISIBLE LWS_EXTERN void * +lws_vhost_user(struct lws_vhost *vhost); + +/** + * lws_context_user() - get the user data associated with the context + * \param context: Websocket context + * + * This returns the optional user allocation that can be attached to + * the context the sockets live in at context_create time. It's a way + * to let all sockets serviced in the same context share data without + * using globals statics in the user code. + */ +LWS_VISIBLE LWS_EXTERN void * +lws_context_user(struct lws_context *context); + +/*! \defgroup vhost-mounts Vhost mounts and options + * \ingroup context-and-vhost-creation + * + * ##Vhost mounts and options + */ +///@{ +/** struct lws_protocol_vhost_options - linked list of per-vhost protocol + * name=value options + * + * This provides a general way to attach a linked-list of name=value pairs, + * which can also have an optional child link-list using the options member. + */ +struct lws_protocol_vhost_options { + const struct lws_protocol_vhost_options *next; /**< linked list */ + const struct lws_protocol_vhost_options *options; /**< child linked-list of more options for this node */ + const char *name; /**< name of name=value pair */ + const char *value; /**< value of name=value pair */ +}; + +/** enum lws_mount_protocols + * This specifies the mount protocol for a mountpoint, whether it is to be + * served from a filesystem, or it is a cgi etc. + */ +enum lws_mount_protocols { + LWSMPRO_HTTP = 0, /**< http reverse proxy */ + LWSMPRO_HTTPS = 1, /**< https reverse proxy */ + LWSMPRO_FILE = 2, /**< serve from filesystem directory */ + LWSMPRO_CGI = 3, /**< pass to CGI to handle */ + LWSMPRO_REDIR_HTTP = 4, /**< redirect to http:// url */ + LWSMPRO_REDIR_HTTPS = 5, /**< redirect to https:// url */ + LWSMPRO_CALLBACK = 6, /**< hand by named protocol's callback */ +}; + +/** struct lws_http_mount + * + * arguments for mounting something in a vhost's url namespace + */ +struct lws_http_mount { + const struct lws_http_mount *mount_next; + /**< pointer to next struct lws_http_mount */ + const char *mountpoint; + /**< mountpoint in http pathspace, eg, "/" */ + const char *origin; + /**< path to be mounted, eg, "/var/www/warmcat.com" */ + const char *def; + /**< default target, eg, "index.html" */ + const char *protocol; + /**<"protocol-name" to handle mount */ + + const struct lws_protocol_vhost_options *cgienv; + /**< optional linked-list of cgi options. These are created + * as environment variables for the cgi process + */ + const struct lws_protocol_vhost_options *extra_mimetypes; + /**< optional linked-list of mimetype mappings */ + const struct lws_protocol_vhost_options *interpret; + /**< optional linked-list of files to be interpreted */ + + int cgi_timeout; + /**< seconds cgi is allowed to live, if cgi://mount type */ + int cache_max_age; + /**< max-age for reuse of client cache of files, seconds */ + unsigned int auth_mask; + /**< bits set here must be set for authorized client session */ + + unsigned int cache_reusable:1; /**< set if client cache may reuse this */ + unsigned int cache_revalidate:1; /**< set if client cache should revalidate on use */ + unsigned int cache_intermediaries:1; /**< set if intermediaries are allowed to cache */ + + unsigned char origin_protocol; /**< one of enum lws_mount_protocols */ + unsigned char mountpoint_len; /**< length of mountpoint string */ + + const char *basic_auth_login_file; + /**<NULL, or filepath to use to check basic auth logins against */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility + * + * The below is to ensure later library versions with new + * members added above will see 0 (default) even if the app + * was not built against the newer headers. + */ + + void *_unused[2]; /**< dummy */ +}; + +///@} +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-dbus.h b/thirdparty/libwebsockets/include/libwebsockets/lws-dbus.h new file mode 100644 index 0000000000..63cfd15f18 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-dbus.h @@ -0,0 +1,90 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * must be included manually as + * + * #include <libwebsockets/lws-dbus.h> + * + * if dbus apis needed + */ + +#if !defined(__LWS_DBUS_H__) +#define __LWS_DBUS_H__ + +#include <dbus/dbus.h> + +/* helper type to simplify implementing methods as individual functions */ +typedef DBusHandlerResult (*lws_dbus_message_handler)(DBusConnection *conn, + DBusMessage *message, DBusMessage **reply, void *d); + +struct lws_dbus_ctx; +typedef void (*lws_dbus_closing_t)(struct lws_dbus_ctx *ctx); + +struct lws_dbus_ctx { + struct lws_dll next; /* dbusserver ctx: HEAD of accepted list */ + struct lws_vhost *vh; /* the vhost we logically bind to in lws */ + int tsi; /* the lws thread service index (0 if only one service + thread as is the default */ + DBusConnection *conn; + DBusServer *dbs; + DBusWatch *w[4]; + DBusPendingCall *pc; + + char hup; + char timeouts; + + /* cb_closing callback will be called after the connection and this + * related ctx struct have effectively gone out of scope. + * + * The callback should close and clean up the connection and free the + * ctx. + */ + lws_dbus_closing_t cb_closing; +}; + +/** + * lws_dbus_connection_setup() - bind dbus connection object to lws event loop + * + * \param ctx: additional information about the connection + * \param conn: the DBusConnection object to bind + * + * This configures a DBusConnection object to use lws for watchers and timeout + * operations. + */ +LWS_VISIBLE LWS_EXTERN int +lws_dbus_connection_setup(struct lws_dbus_ctx *ctx, DBusConnection *conn, + lws_dbus_closing_t cb_closing); + +/** + * lws_dbus_server_listen() - bind dbus connection object to lws event loop + * + * \param ctx: additional information about the connection + * \param ads: the DBUS address to listen on, eg, "unix:abstract=mysocket" + * \param err: a DBusError object to take any extra error information + * \param new_conn: a callback function to prepare new accepted connections + * + * This creates a DBusServer and binds it to the lws event loop, and your + * callback to accept new connections. + */ +LWS_VISIBLE LWS_EXTERN DBusServer * +lws_dbus_server_listen(struct lws_dbus_ctx *ctx, const char *ads, + DBusError *err, DBusNewConnectionFunction new_conn); + +#endif diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-diskcache.h b/thirdparty/libwebsockets/include/libwebsockets/lws-diskcache.h new file mode 100644 index 0000000000..eb63fdd855 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-diskcache.h @@ -0,0 +1,185 @@ +/* + * libwebsockets - disk cache helpers + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup diskcache LWS disk cache + * ## Disk cache API + * + * Lws provides helper apis useful if you need a disk cache containing hashed + * files and need to delete files from it on an LRU basis to keep it below some + * size limit. + * + * The API `lws_diskcache_prepare()` deals with creating the cache dir and + * 256 subdirs, which are used according to the first two chars of the hex + * hash of the cache file. + * + * `lws_diskcache_create()` and `lws_diskcache_destroy()` allocate and free + * an opaque struct that represents the disk cache. + * + * `lws_diskcache_trim()` should be called at eg, 1s intervals to perform the + * cache dir monitoring and LRU autodelete in the background lazily. It can + * be done in its own thread or on a timer... it monitors the directories in a + * stateful way that stats one or more file in the cache per call, and keeps + * a list of the oldest files as it goes. When it completes a scan, if the + * aggregate size is over the limit, it will delete oldest files first to try + * to keep it under the limit. + * + * The cache size monitoring is extremely efficient in time and memory even when + * the cache directory becomes huge. + * + * `lws_diskcache_query()` is used to determine if the file already exists in + * the cache, or if it must be created. If it must be created, then the file + * is opened using a temp name that must be converted to a findable name with + * `lws_diskcache_finalize_name()` when the generation of the file contents are + * complete. Aborted cached files that did not complete generation will be + * flushed by the LRU eventually. If the file already exists, it is 'touched' + * to make it new again and the fd returned. + * + */ +///@{ + +struct lws_diskcache_scan; + +/** + * lws_diskcache_create() - creates an opaque struct representing the disk cache + * + * \param cache_dir_base: The cache dir path, eg `/var/cache/mycache` + * \param cache_size_limit: maximum size on disk the cache is allowed to use + * + * This returns an opaque `struct lws_diskcache_scan *` which represents the + * disk cache, the trim scanning state and so on. You should use + * `lws_diskcache_destroy()` to free it to destroy it. + */ +LWS_VISIBLE LWS_EXTERN struct lws_diskcache_scan * +lws_diskcache_create(const char *cache_dir_base, uint64_t cache_size_limit); + +/** + * lws_diskcache_destroy() - destroys the pointer returned by ...create() + * + * \param lds: pointer to the pointer returned by lws_diskcache_create() + * + * Frees *lds and any allocations it did, and then sets *lds to NULL and + * returns. + */ +LWS_VISIBLE LWS_EXTERN void +lws_diskcache_destroy(struct lws_diskcache_scan **lds); + +/** + * lws_diskcache_prepare() - ensures the cache dir structure exists on disk + * + * \param cache_base_dir: The cache dir path, eg `/var/cache/mycache` + * \param mode: octal dir mode to enforce, like 0700 + * \param uid: uid the cache dir should belong to + * + * This should be called while your app is still privileged. It will create + * the cache directory structure on disk as necessary, enforce the given access + * mode on it and set the given uid as the owner. It won't make any trouble + * if the cache already exists. + * + * Typically the mode is 0700 and the owner is the user that your application + * will transition to use when it drops root privileges. + */ +LWS_VISIBLE LWS_EXTERN int +lws_diskcache_prepare(const char *cache_base_dir, int mode, int uid); + +#define LWS_DISKCACHE_QUERY_NO_CACHE 0 +#define LWS_DISKCACHE_QUERY_EXISTS 1 +#define LWS_DISKCACHE_QUERY_CREATING 2 +#define LWS_DISKCACHE_QUERY_ONGOING 3 /* something else is creating it */ + +/** + * lws_diskcache_query() - ensures the cache dir structure exists on disk + * + * \param lds: The opaque struct representing the disk cache + * \param is_bot: nonzero means the request is from a bot. Don't create new cache contents if so. + * \param hash_hex: hex string representation of the cache object hash + * \param _fd: pointer to the fd to be set + * \param cache: destination string to take the cache filepath + * \param cache_len: length of the buffer at `cache` + * \param extant_cache_len: pointer to a size_t to take any extant cached file size + * + * This function is called when you want to find if the hashed name already + * exists in the cache. The possibilities for the return value are + * + * - LWS_DISKCACHE_QUERY_NO_CACHE: It's not in the cache and you can't create + * it in the cache for whatever reason. + * - LWS_DISKCACHE_QUERY_EXISTS: It exists in the cache. It's open RDONLY and + * *_fd has been set to the file descriptor. *extant_cache_len has been set + * to the size of the cached file in bytes. cache has been set to the + * full filepath of the cached file. Closing _fd is your responsibility. + * - LWS_DISKCACHE_QUERY_CREATING: It didn't exist, but a temp file has been + * created in the cache and *_fd set to a file descriptor opened on it RDWR. + * You should create the contents, and call `lws_diskcache_finalize_name()` + * when it is done. Closing _fd is your responsibility. + * - LWS_DISKCACHE_QUERY_ONGOING: not returned by this api, but you may find it + * desirable to make a wrapper function which can handle another asynchronous + * process that is already creating the cached file. This can be used to + * indicate that situation externally... how to determine the same thing is + * already being generated is out of scope of this api. + */ +LWS_VISIBLE LWS_EXTERN int +lws_diskcache_query(struct lws_diskcache_scan *lds, int is_bot, + const char *hash_hex, int *_fd, char *cache, int cache_len, + size_t *extant_cache_len); + +/** + * lws_diskcache_query() - ensures the cache dir structure exists on disk + * + * \param cache: The cache file temp name returned with LWS_DISKCACHE_QUERY_CREATING + * + * This renames the cache file you are creating to its final name. It should + * be called on the temp name returned by `lws_diskcache_query()` if it gave a + * LWS_DISKCACHE_QUERY_CREATING return, after you have filled the cache file and + * closed it. + */ +LWS_VISIBLE LWS_EXTERN int +lws_diskcache_finalize_name(char *cache); + +/** + * lws_diskcache_trim() - performs one or more file checks in the cache for size management + * + * \param lds: The opaque object representing the cache + * + * This should be called periodically to statefully walk the cache on disk + * collecting the oldest files. When it has visited every file, if the cache + * is oversize it will delete the oldest files until it's back under size again. + * + * Each time it's called, it will look at one or more dir in the cache. If + * called when the cache is oversize, it increases the amount of work done each + * call until it is reduced again. Typically it will take 256 calls before it + * deletes anything, so if called once per second, it will delete files once + * every 4 minutes. Each call is very inexpensive both in memory and time. + */ +LWS_VISIBLE LWS_EXTERN int +lws_diskcache_trim(struct lws_diskcache_scan *lds); + + +/** + * lws_diskcache_secs_to_idle() - see how long to idle before calling trim + * + * \param lds: The opaque object representing the cache + * + * If the cache is undersize, there's no need to monitor it immediately. This + * suggests how long to "sleep" before calling `lws_diskcache_trim()` again. + */ +LWS_VISIBLE LWS_EXTERN int +lws_diskcache_secs_to_idle(struct lws_diskcache_scan *lds); diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-esp32.h b/thirdparty/libwebsockets/include/libwebsockets/lws-esp32.h new file mode 100644 index 0000000000..2d1c0f42bb --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-esp32.h @@ -0,0 +1,226 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +typedef int lws_sockfd_type; +typedef int lws_filefd_type; + +struct pollfd { + lws_sockfd_type fd; /**< fd related to */ + short events; /**< which POLL... events to respond to */ + short revents; /**< which POLL... events occurred */ +}; +#define POLLIN 0x0001 +#define POLLPRI 0x0002 +#define POLLOUT 0x0004 +#define POLLERR 0x0008 +#define POLLHUP 0x0010 +#define POLLNVAL 0x0020 + +#include <freertos/FreeRTOS.h> +#include <freertos/event_groups.h> +#include <string.h> +#include "esp_wifi.h" +#include "esp_system.h" +#include "esp_event.h" +#include "esp_event_loop.h" +#include "nvs.h" +#include "driver/gpio.h" +#include "esp_spi_flash.h" +#include "freertos/timers.h" + +#if !defined(CONFIG_FREERTOS_HZ) +#define CONFIG_FREERTOS_HZ 100 +#endif + +typedef TimerHandle_t uv_timer_t; +typedef void uv_cb_t(uv_timer_t *); +typedef void * uv_handle_t; + +struct timer_mapping { + uv_cb_t *cb; + uv_timer_t *t; +}; + +#define UV_VERSION_MAJOR 1 + +#define lws_uv_getloop(a, b) (NULL) + +static LWS_INLINE void uv_timer_init(void *l, uv_timer_t *t) +{ + (void)l; + *t = NULL; +} + +extern void esp32_uvtimer_cb(TimerHandle_t t); + +static LWS_INLINE void uv_timer_start(uv_timer_t *t, uv_cb_t *cb, int first, int rep) +{ + struct timer_mapping *tm = (struct timer_mapping *)malloc(sizeof(*tm)); + + if (!tm) + return; + + tm->t = t; + tm->cb = cb; + + *t = xTimerCreate("x", pdMS_TO_TICKS(first), !!rep, tm, + (TimerCallbackFunction_t)esp32_uvtimer_cb); + xTimerStart(*t, 0); +} + +static LWS_INLINE void uv_timer_stop(uv_timer_t *t) +{ + xTimerStop(*t, 0); +} + +static LWS_INLINE void uv_close(uv_handle_t *h, void *v) +{ + free(pvTimerGetTimerID((uv_timer_t)h)); + xTimerDelete(*(uv_timer_t *)h, 0); +} + +/* ESP32 helper declarations */ + +#include <mdns.h> +#include <esp_partition.h> + +#define LWS_PLUGIN_STATIC +#define LWS_MAGIC_REBOOT_TYPE_ADS 0x50001ffc +#define LWS_MAGIC_REBOOT_TYPE_REQ_FACTORY 0xb00bcafe +#define LWS_MAGIC_REBOOT_TYPE_FORCED_FACTORY 0xfaceb00b +#define LWS_MAGIC_REBOOT_TYPE_FORCED_FACTORY_BUTTON 0xf0cedfac +#define LWS_MAGIC_REBOOT_TYPE_REQ_FACTORY_ERASE_OTA 0xfac0eeee + +/* user code provides these */ + +extern void +lws_esp32_identify_physical_device(void); + +/* lws-plat-esp32 provides these */ + +typedef void (*lws_cb_scan_done)(uint16_t count, wifi_ap_record_t *recs, void *arg); + +enum genled_state { + LWSESP32_GENLED__INIT, + LWSESP32_GENLED__LOST_NETWORK, + LWSESP32_GENLED__NO_NETWORK, + LWSESP32_GENLED__CONN_AP, + LWSESP32_GENLED__GOT_IP, + LWSESP32_GENLED__OK, +}; + +struct lws_group_member { + struct lws_group_member *next; + uint64_t last_seen; + char model[16]; + char role[16]; + char host[32]; + char mac[20]; + int width, height; + struct ip4_addr addr; + struct ip6_addr addrv6; + uint8_t flags; +}; + +#define LWS_SYSTEM_GROUP_MEMBER_ADD 1 +#define LWS_SYSTEM_GROUP_MEMBER_CHANGE 2 +#define LWS_SYSTEM_GROUP_MEMBER_REMOVE 3 + +#define LWS_GROUP_FLAG_SELF 1 + +struct lws_esp32 { + char sta_ip[16]; + char sta_mask[16]; + char sta_gw[16]; + char serial[16]; + char opts[16]; + char model[16]; + char group[16]; + char role[16]; + char ssid[4][64]; + char password[4][64]; + char active_ssid[64]; + char access_pw[16]; + char hostname[32]; + char mac[20]; + char le_dns[64]; + char le_email[64]; + char region; + char inet; + char conn_ap; + + enum genled_state genled; + uint64_t genled_t; + + lws_cb_scan_done scan_consumer; + void *scan_consumer_arg; + struct lws_group_member *first; + int extant_group_members; + + char acme; + char upload; + + volatile char button_is_down; +}; + +struct lws_esp32_image { + uint32_t romfs; + uint32_t romfs_len; + uint32_t json; + uint32_t json_len; +}; + +extern struct lws_esp32 lws_esp32; +struct lws_vhost; + +extern esp_err_t +lws_esp32_event_passthru(void *ctx, system_event_t *event); +extern void +lws_esp32_wlan_config(void); +extern void +lws_esp32_wlan_start_ap(void); +extern void +lws_esp32_wlan_start_station(void); +struct lws_context_creation_info; +extern void +lws_esp32_set_creation_defaults(struct lws_context_creation_info *info); +extern struct lws_context * +lws_esp32_init(struct lws_context_creation_info *, struct lws_vhost **pvh); +extern int +lws_esp32_wlan_nvs_get(int retry); +extern esp_err_t +lws_nvs_set_str(nvs_handle handle, const char* key, const char* value); +extern void +lws_esp32_restart_guided(uint32_t type); +extern const esp_partition_t * +lws_esp_ota_get_boot_partition(void); +extern int +lws_esp32_get_image_info(const esp_partition_t *part, struct lws_esp32_image *i, char *json, int json_len); +extern int +lws_esp32_leds_network_indication(void); + +extern uint32_t lws_esp32_get_reboot_type(void); +extern uint16_t lws_esp32_sine_interp(int n); + +/* required in external code by esp32 plat (may just return if no leds) */ +extern void lws_esp32_leds_timer_cb(TimerHandle_t th); diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-fts.h b/thirdparty/libwebsockets/include/libwebsockets/lws-fts.h new file mode 100644 index 0000000000..29405bd6fd --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-fts.h @@ -0,0 +1,214 @@ +/* + * libwebsockets - fulltext search + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup search Search + * + * ##Full-text search + * + * Lws provides superfast indexing and fulltext searching from index files on + * storage. + */ +///@{ + +struct lws_fts; +struct lws_fts_file; + +/* + * Queries produce their results in an lwsac, using these public API types. + * The first thing in the lwsac is always a struct lws_fts_result (see below) + * containing heads for linked-lists of the other result types. + */ + +/* one filepath's results */ + +struct lws_fts_result_filepath { + struct lws_fts_result_filepath *next; + int matches; /* logical number of matches */ + int matches_length; /* bytes in length table (may be zero) */ + int lines_in_file; + int filepath_length; + + /* - uint32_t line table follows (first for alignment) */ + /* - filepath (of filepath_length) follows */ +}; + +/* autocomplete result */ + +struct lws_fts_result_autocomplete { + struct lws_fts_result_autocomplete *next; + int instances; + int agg_instances; + int ac_length; + char elided; /* children skipped in interest of antecedent children */ + char has_children; + + /* - autocomplete suggestion (of length ac_length) follows */ +}; + +/* + * The results lwsac always starts with this. If no results and / or no + * autocomplete the members may be NULL. This implies the symbol nor any + * suffix on it exists in the trie file. + */ +struct lws_fts_result { + struct lws_fts_result_filepath *filepath_head; + struct lws_fts_result_autocomplete *autocomplete_head; + int duration_ms; + int effective_flags; /* the search flags that were used */ +}; + +/* + * index creation functions + */ + +/** + * lws_fts_create() - Create a new index file + * + * \param fd: The fd opened for write + * + * Inits a new index file, returning a struct lws_fts to represent it + */ +LWS_VISIBLE LWS_EXTERN struct lws_fts * +lws_fts_create(int fd); + +/** + * lws_fts_destroy() - Finalize a new index file / destroy the trie lwsac + * + * \param trie: The previously opened index being finalized + * + * Finalizes an index file that was being created, and frees the memory involved + * *trie is set to NULL afterwards. + */ +LWS_VISIBLE LWS_EXTERN void +lws_fts_destroy(struct lws_fts **trie); + +/** + * lws_fts_file_index() - Create a new entry in the trie file for an input path + * + * \param t: The previously opened index being written + * \param filepath: The filepath (which may be virtual) associated with this file + * \param filepath_len: The number of chars in the filepath + * \param priority: not used yet + * + * Returns an ordinal that represents this new filepath in the index file. + */ +LWS_VISIBLE LWS_EXTERN int +lws_fts_file_index(struct lws_fts *t, const char *filepath, int filepath_len, + int priority); + +/** + * lws_fts_fill() - Process all or a bufferload of input file + * + * \param t: The previously opened index being written + * \param file_index: The ordinal representing this input filepath + * \param buf: A bufferload of data from the input file + * \param len: The number of bytes in buf + * + * Indexes a buffer of data from the input file. + */ +LWS_VISIBLE LWS_EXTERN int +lws_fts_fill(struct lws_fts *t, uint32_t file_index, const char *buf, + size_t len); + +/** + * lws_fts_serialize() - Store the in-memory trie into the index file + * + * \param t: The previously opened index being written + * + * The trie is held in memory where it can be added to... after all the input + * filepaths and data have been processed, this is called to serialize / + * write the trie data into the index file. + */ +LWS_VISIBLE LWS_EXTERN int +lws_fts_serialize(struct lws_fts *t); + +/* + * index search functions + */ + +/** + * lws_fts_open() - Open an existing index file to search it + * + * \param filepath: The filepath to the index file to open + * + * Opening the index file returns an opaque struct lws_fts_file * that is + * used to perform other operations on it, or NULL if it can't be opened. + */ +LWS_VISIBLE LWS_EXTERN struct lws_fts_file * +lws_fts_open(const char *filepath); + +#define LWSFTS_F_QUERY_AUTOCOMPLETE (1 << 0) +#define LWSFTS_F_QUERY_FILES (1 << 1) +#define LWSFTS_F_QUERY_FILE_LINES (1 << 2) +#define LWSFTS_F_QUERY_QUOTE_LINE (1 << 3) + +struct lws_fts_search_params { + /* the actual search term */ + const char *needle; + /* if non-NULL, FILE results for this filepath only */ + const char *only_filepath; + /* will be set to the results lwsac */ + struct lwsac *results_head; + /* combination of LWSFTS_F_QUERY_* flags */ + int flags; + /* maximum number of autocomplete suggestions to return */ + int max_autocomplete; + /* maximum number of filepaths to return */ + int max_files; + /* maximum number of line number results to return per filepath */ + int max_lines; +}; + +/** + * lws_fts_search() - Perform a search operation on an index + * + * \param jtf: The index file struct returned by lws_fts_open + * \param ftsp: The struct lws_fts_search_params filled in by the caller + * + * The caller should memset the ftsp struct to 0 to ensure members that may be + * introduced in later versions contain known values, then set the related + * members to describe the kind of search action required. + * + * ftsp->results_head is the results lwsac, or NULL. It should be freed with + * lwsac_free() when the results are finished with. + * + * Returns a pointer into the results lwsac that is a struct lws_fts_result + * containing the head pointers into linked-lists of results for autocomplete + * and filepath data, along with some sundry information. This does not need + * to be freed since freeing the lwsac will also remove this and everything it + * points to. + */ +LWS_VISIBLE LWS_EXTERN struct lws_fts_result * +lws_fts_search(struct lws_fts_file *jtf, struct lws_fts_search_params *ftsp); + +/** + * lws_fts_close() - Close a previously-opened index file + * + * \param jtf: The pointer returned from the open + * + * Closes the file handle on the index and frees any allocations + */ +LWS_VISIBLE LWS_EXTERN void +lws_fts_close(struct lws_fts_file *jtf); + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-genhash.h b/thirdparty/libwebsockets/include/libwebsockets/lws-genhash.h new file mode 100644 index 0000000000..a2e4f8ab6a --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-genhash.h @@ -0,0 +1,171 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup generic hash + * ## Generic Hash related functions + * + * Lws provides generic hash / digest accessors that abstract the ones + * provided by whatever OpenSSL library you are linking against. + * + * It lets you use the same code if you build against mbedtls or OpenSSL + * for example. + */ +///@{ + +enum lws_genhash_types { + LWS_GENHASH_TYPE_SHA1, + LWS_GENHASH_TYPE_SHA256, + LWS_GENHASH_TYPE_SHA384, + LWS_GENHASH_TYPE_SHA512, +}; + +enum lws_genhmac_types { + LWS_GENHMAC_TYPE_SHA256, + LWS_GENHMAC_TYPE_SHA384, + LWS_GENHMAC_TYPE_SHA512, +}; + +#define LWS_GENHASH_LARGEST 64 + +struct lws_genhash_ctx { + uint8_t type; +#if defined(LWS_WITH_MBEDTLS) + union { + mbedtls_sha1_context sha1; + mbedtls_sha256_context sha256; + mbedtls_sha512_context sha512; /* 384 also uses this */ + const mbedtls_md_info_t *hmac; + } u; +#else + const EVP_MD *evp_type; + EVP_MD_CTX *mdctx; +#endif +}; + +struct lws_genhmac_ctx { + uint8_t type; +#if defined(LWS_WITH_MBEDTLS) + const mbedtls_md_info_t *hmac; + mbedtls_md_context_t ctx; +#else + const EVP_MD *evp_type; + EVP_MD_CTX *ctx; +#endif +}; + +/** lws_genhash_size() - get hash size in bytes + * + * \param type: one of LWS_GENHASH_TYPE_... + * + * Returns number of bytes in this type of hash + */ +LWS_VISIBLE LWS_EXTERN size_t LWS_WARN_UNUSED_RESULT +lws_genhash_size(enum lws_genhash_types type); + +/** lws_genhmac_size() - get hash size in bytes + * + * \param type: one of LWS_GENHASH_TYPE_... + * + * Returns number of bytes in this type of hmac + */ +LWS_VISIBLE LWS_EXTERN size_t LWS_WARN_UNUSED_RESULT +lws_genhmac_size(enum lws_genhmac_types type); + +/** lws_genhash_init() - prepare your struct lws_genhash_ctx for use + * + * \param ctx: your struct lws_genhash_ctx + * \param type: one of LWS_GENHASH_TYPE_... + * + * Initializes the hash context for the type you requested + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_genhash_init(struct lws_genhash_ctx *ctx, enum lws_genhash_types type); + +/** lws_genhash_update() - digest len bytes of the buffer starting at in + * + * \param ctx: your struct lws_genhash_ctx + * \param in: start of the bytes to digest + * \param len: count of bytes to digest + * + * Updates the state of your hash context to reflect digesting len bytes from in + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_genhash_update(struct lws_genhash_ctx *ctx, const void *in, size_t len); + +/** lws_genhash_destroy() - copy out the result digest and destroy the ctx + * + * \param ctx: your struct lws_genhash_ctx + * \param result: NULL, or where to copy the result hash + * + * Finalizes the hash and copies out the digest. Destroys any allocations such + * that ctx can safely go out of scope after calling this. + * + * NULL result is supported so that you can destroy the ctx cleanly on error + * conditions, where there is no valid result. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genhash_destroy(struct lws_genhash_ctx *ctx, void *result); + +/** lws_genhmac_init() - prepare your struct lws_genhmac_ctx for use + * + * \param ctx: your struct lws_genhmac_ctx + * \param type: one of LWS_GENHMAC_TYPE_... + * \param key: pointer to the start of the HMAC key + * \param key_len: length of the HMAC key + * + * Initializes the hash context for the type you requested + * + * If the return is nonzero, it failed and there is nothing needing to be + * destroyed. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_genhmac_init(struct lws_genhmac_ctx *ctx, enum lws_genhmac_types type, + const uint8_t *key, size_t key_len); + +/** lws_genhmac_update() - digest len bytes of the buffer starting at in + * + * \param ctx: your struct lws_genhmac_ctx + * \param in: start of the bytes to digest + * \param len: count of bytes to digest + * + * Updates the state of your hash context to reflect digesting len bytes from in + * + * If the return is nonzero, it failed and needs destroying. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_genhmac_update(struct lws_genhmac_ctx *ctx, const void *in, size_t len); + +/** lws_genhmac_destroy() - copy out the result digest and destroy the ctx + * + * \param ctx: your struct lws_genhmac_ctx + * \param result: NULL, or where to copy the result hash + * + * Finalizes the hash and copies out the digest. Destroys any allocations such + * that ctx can safely go out of scope after calling this. + * + * NULL result is supported so that you can destroy the ctx cleanly on error + * conditions, where there is no valid result. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genhmac_destroy(struct lws_genhmac_ctx *ctx, void *result); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-genrsa.h b/thirdparty/libwebsockets/include/libwebsockets/lws-genrsa.h new file mode 100644 index 0000000000..3e427e2927 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-genrsa.h @@ -0,0 +1,190 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup generic RSA + * ## Generic RSA related functions + * + * Lws provides generic RSA functions that abstract the ones + * provided by whatever OpenSSL library you are linking against. + * + * It lets you use the same code if you build against mbedtls or OpenSSL + * for example. + */ +///@{ + +enum enum_jwk_tok { + JWK_KEY_E, + JWK_KEY_N, + JWK_KEY_D, + JWK_KEY_P, + JWK_KEY_Q, + JWK_KEY_DP, + JWK_KEY_DQ, + JWK_KEY_QI, + JWK_KTY, /* also serves as count of real elements */ + JWK_KEY, +}; + +#define LWS_COUNT_RSA_ELEMENTS JWK_KTY + +struct lws_genrsa_ctx { +#if defined(LWS_WITH_MBEDTLS) + mbedtls_rsa_context *ctx; +#else + BIGNUM *bn[LWS_COUNT_RSA_ELEMENTS]; + RSA *rsa; +#endif +}; + +struct lws_genrsa_element { + uint8_t *buf; + uint16_t len; +}; + +struct lws_genrsa_elements { + struct lws_genrsa_element e[LWS_COUNT_RSA_ELEMENTS]; +}; + +/** lws_jwk_destroy_genrsa_elements() - Free allocations in genrsa_elements + * + * \param el: your struct lws_genrsa_elements + * + * This is a helper for user code making use of struct lws_genrsa_elements + * where the elements are allocated on the heap, it frees any non-NULL + * buf element and sets the buf to NULL. + * + * NB: lws_genrsa_public_... apis do not need this as they take care of the key + * creation and destruction themselves. + */ +LWS_VISIBLE LWS_EXTERN void +lws_jwk_destroy_genrsa_elements(struct lws_genrsa_elements *el); + +/** lws_genrsa_public_decrypt_create() - Create RSA public decrypt context + * + * \param ctx: your struct lws_genrsa_ctx + * \param el: struct prepared with key element data + * + * Creates an RSA context with a public key associated with it, formed from + * the key elements in \p el. + * + * Returns 0 for OK or nonzero for error. + * + * This and related APIs operate identically with OpenSSL or mbedTLS backends. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genrsa_create(struct lws_genrsa_ctx *ctx, struct lws_genrsa_elements *el); + +/** lws_genrsa_new_keypair() - Create new RSA keypair + * + * \param context: your struct lws_context (may be used for RNG) + * \param ctx: your struct lws_genrsa_ctx + * \param el: struct to get the new key element data allocated into it + * \param bits: key size, eg, 4096 + * + * Creates a new RSA context and generates a new keypair into it, with \p bits + * bits. + * + * Returns 0 for OK or nonzero for error. + * + * This and related APIs operate identically with OpenSSL or mbedTLS backends. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genrsa_new_keypair(struct lws_context *context, struct lws_genrsa_ctx *ctx, + struct lws_genrsa_elements *el, int bits); + +/** lws_genrsa_public_decrypt() - Perform RSA public decryption + * + * \param ctx: your struct lws_genrsa_ctx + * \param in: encrypted input + * \param in_len: length of encrypted input + * \param out: decrypted output + * \param out_max: size of output buffer + * + * Performs the decryption. + * + * Returns <0 for error, or length of decrypted data. + * + * This and related APIs operate identically with OpenSSL or mbedTLS backends. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genrsa_public_decrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, + size_t in_len, uint8_t *out, size_t out_max); + +/** lws_genrsa_public_verify() - Perform RSA public verification + * + * \param ctx: your struct lws_genrsa_ctx + * \param in: unencrypted payload (usually a recomputed hash) + * \param hash_type: one of LWS_GENHASH_TYPE_ + * \param sig: pointer to the signature we received with the payload + * \param sig_len: length of the signature we are checking in bytes + * + * Returns <0 for error, or 0 if signature matches the payload + key. + * + * This and related APIs operate identically with OpenSSL or mbedTLS backends. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genrsa_public_verify(struct lws_genrsa_ctx *ctx, const uint8_t *in, + enum lws_genhash_types hash_type, + const uint8_t *sig, size_t sig_len); + +/** lws_genrsa_public_sign() - Create RSA signature + * + * \param ctx: your struct lws_genrsa_ctx + * \param in: precomputed hash + * \param hash_type: one of LWS_GENHASH_TYPE_ + * \param sig: pointer to buffer to take signature + * \param sig_len: length of the buffer (must be >= length of key N) + * + * Returns <0 for error, or 0 for success. + * + * This and related APIs operate identically with OpenSSL or mbedTLS backends. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genrsa_public_sign(struct lws_genrsa_ctx *ctx, const uint8_t *in, + enum lws_genhash_types hash_type, uint8_t *sig, + size_t sig_len); + +/** lws_genrsa_public_decrypt_destroy() - Destroy RSA public decrypt context + * + * \param ctx: your struct lws_genrsa_ctx + * + * Destroys any allocations related to \p ctx. + * + * This and related APIs operate identically with OpenSSL or mbedTLS backends. + */ +LWS_VISIBLE LWS_EXTERN void +lws_genrsa_destroy(struct lws_genrsa_ctx *ctx); + +/** lws_genrsa_render_pkey_asn1() - Exports public or private key to ASN1/DER + * + * \param ctx: your struct lws_genrsa_ctx + * \param _private: 0 = public part only, 1 = all parts of the key + * \param pkey_asn1: pointer to buffer to take the ASN1 + * \param pkey_asn1_len: max size of the pkey_asn1_len + * + * Returns length of pkey_asn1 written, or -1 for error. + */ +LWS_VISIBLE LWS_EXTERN int +lws_genrsa_render_pkey_asn1(struct lws_genrsa_ctx *ctx, int _private, + uint8_t *pkey_asn1, size_t pkey_asn1_len); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-http.h b/thirdparty/libwebsockets/include/libwebsockets/lws-http.h new file mode 100644 index 0000000000..eb3d826ebd --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-http.h @@ -0,0 +1,685 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/* minimal space for typical headers and CSP stuff */ + +#define LWS_RECOMMENDED_MIN_HEADER_SPACE 2048 + +/*! \defgroup http HTTP + + Modules related to handling HTTP +*/ +//@{ + +/*! \defgroup httpft HTTP File transfer + * \ingroup http + + APIs for sending local files in response to HTTP requests +*/ +//@{ + +/** + * lws_get_mimetype() - Determine mimetype to use from filename + * + * \param file: filename + * \param m: NULL, or mount context + * + * This uses a canned list of known filetypes first, if no match and m is + * non-NULL, then tries a list of per-mount file suffix to mimtype mappings. + * + * Returns either NULL or a pointer to the mimetype matching the file. + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_get_mimetype(const char *file, const struct lws_http_mount *m); + +/** + * lws_serve_http_file() - Send a file back to the client using http + * \param wsi: Websocket instance (available from user callback) + * \param file: The file to issue over http + * \param content_type: The http content type, eg, text/html + * \param other_headers: NULL or pointer to header string + * \param other_headers_len: length of the other headers if non-NULL + * + * This function is intended to be called from the callback in response + * to http requests from the client. It allows the callback to issue + * local files down the http link in a single step. + * + * Returning <0 indicates error and the wsi should be closed. Returning + * >0 indicates the file was completely sent and + * lws_http_transaction_completed() called on the wsi (and close if != 0) + * ==0 indicates the file transfer is started and needs more service later, + * the wsi should be left alone. + */ +LWS_VISIBLE LWS_EXTERN int +lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, + const char *other_headers, int other_headers_len); + +LWS_VISIBLE LWS_EXTERN int +lws_serve_http_file_fragment(struct lws *wsi); +//@} + + +enum http_status { + HTTP_STATUS_CONTINUE = 100, + + HTTP_STATUS_OK = 200, + HTTP_STATUS_NO_CONTENT = 204, + HTTP_STATUS_PARTIAL_CONTENT = 206, + + HTTP_STATUS_MOVED_PERMANENTLY = 301, + HTTP_STATUS_FOUND = 302, + HTTP_STATUS_SEE_OTHER = 303, + HTTP_STATUS_NOT_MODIFIED = 304, + + HTTP_STATUS_BAD_REQUEST = 400, + HTTP_STATUS_UNAUTHORIZED, + HTTP_STATUS_PAYMENT_REQUIRED, + HTTP_STATUS_FORBIDDEN, + HTTP_STATUS_NOT_FOUND, + HTTP_STATUS_METHOD_NOT_ALLOWED, + HTTP_STATUS_NOT_ACCEPTABLE, + HTTP_STATUS_PROXY_AUTH_REQUIRED, + HTTP_STATUS_REQUEST_TIMEOUT, + HTTP_STATUS_CONFLICT, + HTTP_STATUS_GONE, + HTTP_STATUS_LENGTH_REQUIRED, + HTTP_STATUS_PRECONDITION_FAILED, + HTTP_STATUS_REQ_ENTITY_TOO_LARGE, + HTTP_STATUS_REQ_URI_TOO_LONG, + HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE, + HTTP_STATUS_REQ_RANGE_NOT_SATISFIABLE, + HTTP_STATUS_EXPECTATION_FAILED, + + HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, + HTTP_STATUS_NOT_IMPLEMENTED, + HTTP_STATUS_BAD_GATEWAY, + HTTP_STATUS_SERVICE_UNAVAILABLE, + HTTP_STATUS_GATEWAY_TIMEOUT, + HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED, +}; +/*! \defgroup html-chunked-substitution HTML Chunked Substitution + * \ingroup http + * + * ##HTML chunked Substitution + * + * APIs for receiving chunks of text, replacing a set of variable names via + * a callback, and then prepending and appending HTML chunked encoding + * headers. + */ +//@{ + +struct lws_process_html_args { + char *p; /**< pointer to the buffer containing the data */ + int len; /**< length of the original data at p */ + int max_len; /**< maximum length we can grow the data to */ + int final; /**< set if this is the last chunk of the file */ + int chunked; /**< 0 == unchunked, 1 == produce chunk headers + (incompatible with HTTP/2) */ +}; + +typedef const char *(*lws_process_html_state_cb)(void *data, int index); + +struct lws_process_html_state { + char *start; /**< pointer to start of match */ + char swallow[16]; /**< matched character buffer */ + int pos; /**< position in match */ + void *data; /**< opaque pointer */ + const char * const *vars; /**< list of variable names */ + int count_vars; /**< count of variable names */ + + lws_process_html_state_cb replace; + /**< called on match to perform substitution */ +}; + +/*! lws_chunked_html_process() - generic chunked substitution + * \param args: buffer to process using chunked encoding + * \param s: current processing state + */ +LWS_VISIBLE LWS_EXTERN int +lws_chunked_html_process(struct lws_process_html_args *args, + struct lws_process_html_state *s); +//@} + +/** \defgroup HTTP-headers-read HTTP headers: read + * \ingroup http + * + * ##HTTP header releated functions + * + * In lws the client http headers are temporarily stored in a pool, only for the + * duration of the http part of the handshake. It's because in most cases, + * the header content is ignored for the whole rest of the connection lifetime + * and would then just be taking up space needlessly. + * + * During LWS_CALLBACK_HTTP when the URI path is delivered is the last time + * the http headers are still allocated, you can use these apis then to + * look at and copy out interesting header content (cookies, etc) + * + * Notice that the header total length reported does not include a terminating + * '\0', however you must allocate for it when using the _copy apis. So the + * length reported for a header containing "123" is 3, but you must provide + * a buffer of length 4 so that "123\0" may be copied into it, or the copy + * will fail with a nonzero return code. + * + * In the special case of URL arguments, like ?x=1&y=2, the arguments are + * stored in a token named for the method, eg, WSI_TOKEN_GET_URI if it + * was a GET or WSI_TOKEN_POST_URI if POST. You can check the total + * length to confirm the method. + * + * For URL arguments, each argument is stored urldecoded in a "fragment", so + * you can use the fragment-aware api lws_hdr_copy_fragment() to access each + * argument in turn: the fragments contain urldecoded strings like x=1 or y=2. + * + * As a convenience, lws has an api that will find the fragment with a + * given name= part, lws_get_urlarg_by_name(). + */ +///@{ + +/** struct lws_tokens + * you need these to look at headers that have been parsed if using the + * LWS_CALLBACK_FILTER_CONNECTION callback. If a header from the enum + * list below is absent, .token = NULL and len = 0. Otherwise .token + * points to .len chars containing that header content. + */ +struct lws_tokens { + char *token; /**< pointer to start of the token */ + int len; /**< length of the token's value */ +}; + +/* enum lws_token_indexes + * these have to be kept in sync with lextable.h / minilex.c + * + * NOTE: These public enums are part of the abi. If you want to add one, + * add it at where specified so existing users are unaffected. + */ +enum lws_token_indexes { + WSI_TOKEN_GET_URI = 0, + WSI_TOKEN_POST_URI = 1, + WSI_TOKEN_OPTIONS_URI = 2, + WSI_TOKEN_HOST = 3, + WSI_TOKEN_CONNECTION = 4, + WSI_TOKEN_UPGRADE = 5, + WSI_TOKEN_ORIGIN = 6, + WSI_TOKEN_DRAFT = 7, + WSI_TOKEN_CHALLENGE = 8, + WSI_TOKEN_EXTENSIONS = 9, + WSI_TOKEN_KEY1 = 10, + WSI_TOKEN_KEY2 = 11, + WSI_TOKEN_PROTOCOL = 12, + WSI_TOKEN_ACCEPT = 13, + WSI_TOKEN_NONCE = 14, + WSI_TOKEN_HTTP = 15, + WSI_TOKEN_HTTP2_SETTINGS = 16, + WSI_TOKEN_HTTP_ACCEPT = 17, + WSI_TOKEN_HTTP_AC_REQUEST_HEADERS = 18, + WSI_TOKEN_HTTP_IF_MODIFIED_SINCE = 19, + WSI_TOKEN_HTTP_IF_NONE_MATCH = 20, + WSI_TOKEN_HTTP_ACCEPT_ENCODING = 21, + WSI_TOKEN_HTTP_ACCEPT_LANGUAGE = 22, + WSI_TOKEN_HTTP_PRAGMA = 23, + WSI_TOKEN_HTTP_CACHE_CONTROL = 24, + WSI_TOKEN_HTTP_AUTHORIZATION = 25, + WSI_TOKEN_HTTP_COOKIE = 26, + WSI_TOKEN_HTTP_CONTENT_LENGTH = 27, + WSI_TOKEN_HTTP_CONTENT_TYPE = 28, + WSI_TOKEN_HTTP_DATE = 29, + WSI_TOKEN_HTTP_RANGE = 30, + WSI_TOKEN_HTTP_REFERER = 31, + WSI_TOKEN_KEY = 32, + WSI_TOKEN_VERSION = 33, + WSI_TOKEN_SWORIGIN = 34, + + WSI_TOKEN_HTTP_COLON_AUTHORITY = 35, + WSI_TOKEN_HTTP_COLON_METHOD = 36, + WSI_TOKEN_HTTP_COLON_PATH = 37, + WSI_TOKEN_HTTP_COLON_SCHEME = 38, + WSI_TOKEN_HTTP_COLON_STATUS = 39, + + WSI_TOKEN_HTTP_ACCEPT_CHARSET = 40, + WSI_TOKEN_HTTP_ACCEPT_RANGES = 41, + WSI_TOKEN_HTTP_ACCESS_CONTROL_ALLOW_ORIGIN = 42, + WSI_TOKEN_HTTP_AGE = 43, + WSI_TOKEN_HTTP_ALLOW = 44, + WSI_TOKEN_HTTP_CONTENT_DISPOSITION = 45, + WSI_TOKEN_HTTP_CONTENT_ENCODING = 46, + WSI_TOKEN_HTTP_CONTENT_LANGUAGE = 47, + WSI_TOKEN_HTTP_CONTENT_LOCATION = 48, + WSI_TOKEN_HTTP_CONTENT_RANGE = 49, + WSI_TOKEN_HTTP_ETAG = 50, + WSI_TOKEN_HTTP_EXPECT = 51, + WSI_TOKEN_HTTP_EXPIRES = 52, + WSI_TOKEN_HTTP_FROM = 53, + WSI_TOKEN_HTTP_IF_MATCH = 54, + WSI_TOKEN_HTTP_IF_RANGE = 55, + WSI_TOKEN_HTTP_IF_UNMODIFIED_SINCE = 56, + WSI_TOKEN_HTTP_LAST_MODIFIED = 57, + WSI_TOKEN_HTTP_LINK = 58, + WSI_TOKEN_HTTP_LOCATION = 59, + WSI_TOKEN_HTTP_MAX_FORWARDS = 60, + WSI_TOKEN_HTTP_PROXY_AUTHENTICATE = 61, + WSI_TOKEN_HTTP_PROXY_AUTHORIZATION = 62, + WSI_TOKEN_HTTP_REFRESH = 63, + WSI_TOKEN_HTTP_RETRY_AFTER = 64, + WSI_TOKEN_HTTP_SERVER = 65, + WSI_TOKEN_HTTP_SET_COOKIE = 66, + WSI_TOKEN_HTTP_STRICT_TRANSPORT_SECURITY = 67, + WSI_TOKEN_HTTP_TRANSFER_ENCODING = 68, + WSI_TOKEN_HTTP_USER_AGENT = 69, + WSI_TOKEN_HTTP_VARY = 70, + WSI_TOKEN_HTTP_VIA = 71, + WSI_TOKEN_HTTP_WWW_AUTHENTICATE = 72, + + WSI_TOKEN_PATCH_URI = 73, + WSI_TOKEN_PUT_URI = 74, + WSI_TOKEN_DELETE_URI = 75, + + WSI_TOKEN_HTTP_URI_ARGS = 76, + WSI_TOKEN_PROXY = 77, + WSI_TOKEN_HTTP_X_REAL_IP = 78, + WSI_TOKEN_HTTP1_0 = 79, + WSI_TOKEN_X_FORWARDED_FOR = 80, + WSI_TOKEN_CONNECT = 81, + WSI_TOKEN_HEAD_URI = 82, + WSI_TOKEN_TE = 83, + WSI_TOKEN_REPLAY_NONCE = 84, + WSI_TOKEN_COLON_PROTOCOL = 85, + WSI_TOKEN_X_AUTH_TOKEN = 86, + + /****** add new things just above ---^ ******/ + + /* use token storage to stash these internally, not for + * user use */ + + _WSI_TOKEN_CLIENT_SENT_PROTOCOLS, + _WSI_TOKEN_CLIENT_PEER_ADDRESS, + _WSI_TOKEN_CLIENT_URI, + _WSI_TOKEN_CLIENT_HOST, + _WSI_TOKEN_CLIENT_ORIGIN, + _WSI_TOKEN_CLIENT_METHOD, + _WSI_TOKEN_CLIENT_IFACE, + _WSI_TOKEN_CLIENT_ALPN, + + /* always last real token index*/ + WSI_TOKEN_COUNT, + + /* parser state additions, no storage associated */ + WSI_TOKEN_NAME_PART, + WSI_TOKEN_SKIPPING, + WSI_TOKEN_SKIPPING_SAW_CR, + WSI_PARSING_COMPLETE, + WSI_INIT_TOKEN_MUXURL, +}; + +struct lws_token_limits { + unsigned short token_limit[WSI_TOKEN_COUNT]; /**< max chars for this token */ +}; + +/** + * lws_token_to_string() - returns a textual representation of a hdr token index + * + * \param token: token index + */ +LWS_VISIBLE LWS_EXTERN const unsigned char * +lws_token_to_string(enum lws_token_indexes token); + +/** + * lws_hdr_total_length: report length of all fragments of a header totalled up + * The returned length does not include the space for a + * terminating '\0' + * + * \param wsi: websocket connection + * \param h: which header index we are interested in + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_hdr_total_length(struct lws *wsi, enum lws_token_indexes h); + +/** + * lws_hdr_fragment_length: report length of a single fragment of a header + * The returned length does not include the space for a + * terminating '\0' + * + * \param wsi: websocket connection + * \param h: which header index we are interested in + * \param frag_idx: which fragment of h we want to get the length of + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_hdr_fragment_length(struct lws *wsi, enum lws_token_indexes h, + int frag_idx); + +/** + * lws_hdr_copy() - copy all fragments of the given header to a buffer + * The buffer length len must include space for an additional + * terminating '\0', or it will fail returning -1. + * + * \param wsi: websocket connection + * \param dest: destination buffer + * \param len: length of destination buffer + * \param h: which header index we are interested in + * + * copies the whole, aggregated header, even if it was delivered in + * several actual headers piece by piece. Returns -1 or length of the whole + * header. + */ +LWS_VISIBLE LWS_EXTERN int +lws_hdr_copy(struct lws *wsi, char *dest, int len, enum lws_token_indexes h); + +/** + * lws_hdr_copy_fragment() - copy a single fragment of the given header to a buffer + * The buffer length len must include space for an additional + * terminating '\0', or it will fail returning -1. + * If the requested fragment index is not present, it fails + * returning -1. + * + * \param wsi: websocket connection + * \param dest: destination buffer + * \param len: length of destination buffer + * \param h: which header index we are interested in + * \param frag_idx: which fragment of h we want to copy + * + * Normally this is only useful + * to parse URI arguments like ?x=1&y=2, token index WSI_TOKEN_HTTP_URI_ARGS + * fragment 0 will contain "x=1" and fragment 1 "y=2" + */ +LWS_VISIBLE LWS_EXTERN int +lws_hdr_copy_fragment(struct lws *wsi, char *dest, int len, + enum lws_token_indexes h, int frag_idx); + +/** + * lws_get_urlarg_by_name() - return pointer to arg value if present + * \param wsi: the connection to check + * \param name: the arg name, like "token=" + * \param buf: the buffer to receive the urlarg (including the name= part) + * \param len: the length of the buffer to receive the urlarg + * + * Returns NULL if not found or a pointer inside buf to just after the + * name= part. + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_get_urlarg_by_name(struct lws *wsi, const char *name, char *buf, int len); +///@} + +/*! \defgroup HTTP-headers-create HTTP headers: create + * + * ## HTTP headers: Create + * + * These apis allow you to create HTTP response headers in a way compatible with + * both HTTP/1.x and HTTP/2. + * + * They each append to a buffer taking care about the buffer end, which is + * passed in as a pointer. When data is written to the buffer, the current + * position p is updated accordingly. + * + * All of these apis are LWS_WARN_UNUSED_RESULT as they can run out of space + * and fail with nonzero return. + */ +///@{ + +#define LWSAHH_CODE_MASK ((1 << 16) - 1) +#define LWSAHH_FLAG_NO_SERVER_NAME (1 << 30) + +/** + * lws_add_http_header_status() - add the HTTP response status code + * + * \param wsi: the connection to check + * \param code: an HTTP code like 200, 404 etc (see enum http_status) + * \param p: pointer to current position in buffer pointer + * \param end: pointer to end of buffer + * + * Adds the initial response code, so should be called first. + * + * Code may additionally take OR'd flags: + * + * LWSAHH_FLAG_NO_SERVER_NAME: don't apply server name header this time + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_add_http_header_status(struct lws *wsi, + unsigned int code, unsigned char **p, + unsigned char *end); +/** + * lws_add_http_header_by_name() - append named header and value + * + * \param wsi: the connection to check + * \param name: the hdr name, like "my-header" + * \param value: the value after the = for this header + * \param length: the length of the value + * \param p: pointer to current position in buffer pointer + * \param end: pointer to end of buffer + * + * Appends name: value to the headers + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_add_http_header_by_name(struct lws *wsi, const unsigned char *name, + const unsigned char *value, int length, + unsigned char **p, unsigned char *end); +/** + * lws_add_http_header_by_token() - append given header and value + * + * \param wsi: the connection to check + * \param token: the token index for the hdr + * \param value: the value after the = for this header + * \param length: the length of the value + * \param p: pointer to current position in buffer pointer + * \param end: pointer to end of buffer + * + * Appends name=value to the headers, but is able to take advantage of better + * HTTP/2 coding mechanisms where possible. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_add_http_header_by_token(struct lws *wsi, enum lws_token_indexes token, + const unsigned char *value, int length, + unsigned char **p, unsigned char *end); +/** + * lws_add_http_header_content_length() - append content-length helper + * + * \param wsi: the connection to check + * \param content_length: the content length to use + * \param p: pointer to current position in buffer pointer + * \param end: pointer to end of buffer + * + * Appends content-length: content_length to the headers + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_add_http_header_content_length(struct lws *wsi, + lws_filepos_t content_length, + unsigned char **p, unsigned char *end); +/** + * lws_finalize_http_header() - terminate header block + * + * \param wsi: the connection to check + * \param p: pointer to current position in buffer pointer + * \param end: pointer to end of buffer + * + * Indicates no more headers will be added + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_finalize_http_header(struct lws *wsi, unsigned char **p, + unsigned char *end); + +/** + * lws_finalize_write_http_header() - Helper finializing and writing http headers + * + * \param wsi: the connection to check + * \param start: pointer to the start of headers in the buffer, eg &buf[LWS_PRE] + * \param p: pointer to current position in buffer pointer + * \param end: pointer to end of buffer + * + * Terminates the headers correctly accoring to the protocol in use (h1 / h2) + * and writes the headers. Returns nonzero for error. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_finalize_write_http_header(struct lws *wsi, unsigned char *start, + unsigned char **p, unsigned char *end); + +#define LWS_ILLEGAL_HTTP_CONTENT_LEN ((lws_filepos_t)-1ll) + +/** + * lws_add_http_common_headers() - Helper preparing common http headers + * + * \param wsi: the connection to check + * \param code: an HTTP code like 200, 404 etc (see enum http_status) + * \param content_type: the content type, like "text/html" + * \param content_len: the content length, in bytes + * \param p: pointer to current position in buffer pointer + * \param end: pointer to end of buffer + * + * Adds the initial response code, so should be called first. + * + * Code may additionally take OR'd flags: + * + * LWSAHH_FLAG_NO_SERVER_NAME: don't apply server name header this time + * + * This helper just calls public apis to simplify adding headers that are + * commonly needed. If it doesn't fit your case, or you want to add additional + * headers just call the public apis directly yourself for what you want. + * + * You can miss out the content length header by providing the constant + * LWS_ILLEGAL_HTTP_CONTENT_LEN for the content_len. + * + * It does not call lws_finalize_http_header(), to allow you to add further + * headers after calling this. You will need to call that yourself at the end. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_add_http_common_headers(struct lws *wsi, unsigned int code, + const char *content_type, lws_filepos_t content_len, + unsigned char **p, unsigned char *end); + +///@} + +/*! \defgroup urlendec Urlencode and Urldecode + * \ingroup http + * + * ##HTML chunked Substitution + * + * APIs for receiving chunks of text, replacing a set of variable names via + * a callback, and then prepending and appending HTML chunked encoding + * headers. + */ +//@{ + +/** + * lws_urlencode() - like strncpy but with urlencoding + * + * \param escaped: output buffer + * \param string: input buffer ('/0' terminated) + * \param len: output buffer max length + * + * Because urlencoding expands the output string, it's not + * possible to do it in-place, ie, with escaped == string + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_urlencode(char *escaped, const char *string, int len); + +/* + * URLDECODE 1 / 2 + * + * This simple urldecode only operates until the first '\0' and requires the + * data to exist all at once + */ +/** + * lws_urldecode() - like strncpy but with urldecoding + * + * \param string: output buffer + * \param escaped: input buffer ('\0' terminated) + * \param len: output buffer max length + * + * This is only useful for '\0' terminated strings + * + * Since urldecoding only shrinks the output string, it is possible to + * do it in-place, ie, string == escaped + * + * Returns 0 if completed OK or nonzero for urldecode violation (non-hex chars + * where hex required, etc) + */ +LWS_VISIBLE LWS_EXTERN int +lws_urldecode(char *string, const char *escaped, int len); +///@} + +/** + * lws_return_http_status() - Return simple http status + * \param wsi: Websocket instance (available from user callback) + * \param code: Status index, eg, 404 + * \param html_body: User-readable HTML description < 1KB, or NULL + * + * Helper to report HTTP errors back to the client cleanly and + * consistently + */ +LWS_VISIBLE LWS_EXTERN int +lws_return_http_status(struct lws *wsi, unsigned int code, + const char *html_body); + +/** + * lws_http_redirect() - write http redirect out on wsi + * + * \param wsi: websocket connection + * \param code: HTTP response code (eg, 301) + * \param loc: where to redirect to + * \param len: length of loc + * \param p: pointer current position in buffer (updated as we write) + * \param end: pointer to end of buffer + * + * Returns amount written, or < 0 indicating fatal write failure. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_http_redirect(struct lws *wsi, int code, const unsigned char *loc, int len, + unsigned char **p, unsigned char *end); + +/** + * lws_http_transaction_completed() - wait for new http transaction or close + * \param wsi: websocket connection + * + * Returns 1 if the HTTP connection must close now + * Returns 0 and resets connection to wait for new HTTP header / + * transaction if possible + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_http_transaction_completed(struct lws *wsi); + +/** + * lws_http_compression_apply() - apply an http compression transform + * + * \param wsi: the wsi to apply the compression transform to + * \param name: NULL, or the name of the compression transform, eg, "deflate" + * \param p: pointer to pointer to headers buffer + * \param end: pointer to end of headers buffer + * \param decomp: 0 = add compressor to wsi, 1 = add decompressor + * + * This allows transparent compression of dynamically generated HTTP. The + * requested compression (eg, "deflate") is only applied if the client headers + * indicated it was supported (and it has support in lws), otherwise it's a NOP. + * + * If the requested compression method is NULL, then the supported compression + * formats are tried, and for non-decompression (server) mode the first that's + * found on the client's accept-encoding header is chosen. + * + * NOTE: the compression transform, same as h2 support, relies on the user + * code using LWS_WRITE_HTTP and then LWS_WRITE_HTTP_FINAL on the last part + * written. The internal lws fileserving code already does this. + * + * If the library was built without the cmake option + * LWS_WITH_HTTP_STREAM_COMPRESSION set, then a NOP is provided for this api, + * allowing user code to build either way and use compression if available. + */ +LWS_VISIBLE int +lws_http_compression_apply(struct lws *wsi, const char *name, + unsigned char **p, unsigned char *end, char decomp); +///@} + diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-jwk.h b/thirdparty/libwebsockets/include/libwebsockets/lws-jwk.h new file mode 100644 index 0000000000..2e2eabd73e --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-jwk.h @@ -0,0 +1,110 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + + +/*! \defgroup jwk JSON Web Keys + * ## JSON Web Keys API + * + * Lws provides an API to parse JSON Web Keys into a struct lws_genrsa_elements. + * + * "oct" and "RSA" type keys are supported. For "oct" keys, they are held in + * the "e" member of the struct lws_genrsa_elements. + * + * Keys elements are allocated on the heap. You must destroy the allocations + * in the struct lws_genrsa_elements by calling + * lws_jwk_destroy_genrsa_elements() when you are finished with it. + */ +///@{ + +struct lws_jwk { + char keytype[5]; /**< "oct" or "RSA" */ + struct lws_genrsa_elements el; /**< OCTet key is in el.e */ +}; + +/** lws_jwk_import() - Create a JSON Web key from the textual representation + * + * \param s: the JWK object to create + * \param in: a single JWK JSON stanza in utf-8 + * \param len: the length of the JWK JSON stanza in bytes + * + * Creates an lws_jwk struct filled with data from the JSON representation. + * "oct" and "rsa" key types are supported. + * + * For "oct" type keys, it is loaded into el.e. + */ +LWS_VISIBLE LWS_EXTERN int +lws_jwk_import(struct lws_jwk *s, const char *in, size_t len); + +/** lws_jwk_destroy() - Destroy a JSON Web key + * + * \param s: the JWK object to destroy + * + * All allocations in the lws_jwk are destroyed + */ +LWS_VISIBLE LWS_EXTERN void +lws_jwk_destroy(struct lws_jwk *s); + +/** lws_jwk_export() - Export a JSON Web key to a textual representation + * + * \param s: the JWK object to export + * \param _private: 0 = just export public parts, 1 = export everything + * \param p: the buffer to write the exported JWK to + * \param len: the length of the buffer \p p in bytes + * + * Returns length of the used part of the buffer if OK, or -1 for error. + * + * Serializes the content of the JWK into a char buffer. + */ +LWS_VISIBLE LWS_EXTERN int +lws_jwk_export(struct lws_jwk *s, int _private, char *p, size_t len); + +/** lws_jwk_load() - Import a JSON Web key from a file + * + * \param s: the JWK object to load into + * \param filename: filename to load from + * + * Returns 0 for OK or -1 for failure + */ +LWS_VISIBLE int +lws_jwk_load(struct lws_jwk *s, const char *filename); + +/** lws_jwk_save() - Export a JSON Web key to a file + * + * \param s: the JWK object to save from + * \param filename: filename to save to + * + * Returns 0 for OK or -1 for failure + */ +LWS_VISIBLE int +lws_jwk_save(struct lws_jwk *s, const char *filename); + +/** lws_jwk_rfc7638_fingerprint() - jwk to RFC7638 compliant fingerprint + * + * \param s: the JWK object to fingerprint + * \param digest32: buffer to take 32-byte digest + * + * Returns 0 for OK or -1 for failure + */ +LWS_VISIBLE int +lws_jwk_rfc7638_fingerprint(struct lws_jwk *s, char *digest32); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-jws.h b/thirdparty/libwebsockets/include/libwebsockets/lws-jws.h new file mode 100644 index 0000000000..7112fc3dba --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-jws.h @@ -0,0 +1,101 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup jws JSON Web Signature + * ## JSON Web Signature API + * + * Lws provides an API to check and create RFC7515 JSON Web Signatures + * + * SHA256/384/512 HMAC, and RSA 256/384/512 are supported. + * + * The API uses your TLS library crypto, but works exactly the same no matter + * what you TLS backend is. + */ +///@{ + +LWS_VISIBLE LWS_EXTERN int +lws_jws_confirm_sig(const char *in, size_t len, struct lws_jwk *jwk); + +/** + * lws_jws_sign_from_b64() - add b64 sig to b64 hdr + payload + * + * \param b64_hdr: protected header encoded in b64, may be NULL + * \param hdr_len: bytes in b64 coding of protected header + * \param b64_pay: payload encoded in b64 + * \param pay_len: bytes in b64 coding of payload + * \param b64_sig: buffer to write the b64 encoded signature into + * \param sig_len: max bytes we can write at b64_sig + * \param hash_type: one of LWS_GENHASH_TYPE_SHA[256|384|512] + * \param jwk: the struct lws_jwk containing the signing key + * + * This adds a b64-coded JWS signature of the b64-encoded protected header + * and b64-encoded payload, at \p b64_sig. The signature will be as large + * as the N element of the RSA key when the RSA key is used, eg, 512 bytes for + * a 4096-bit key, and then b64-encoding on top. + * + * In some special cases, there is only payload to sign and no header, in that + * case \p b64_hdr may be NULL, and only the payload will be hashed before + * signing. + * + * Returns the length of the encoded signature written to \p b64_sig, or -1. + */ +LWS_VISIBLE LWS_EXTERN int +lws_jws_sign_from_b64(const char *b64_hdr, size_t hdr_len, const char *b64_pay, + size_t pay_len, char *b64_sig, size_t sig_len, + enum lws_genhash_types hash_type, struct lws_jwk *jwk); + +/** + * lws_jws_create_packet() - add b64 sig to b64 hdr + payload + * + * \param jwk: the struct lws_jwk containing the signing key + * \param payload: unencoded payload JSON + * \param len: length of unencoded payload JSON + * \param nonce: Nonse string to include in protected header + * \param out: buffer to take signed packet + * \param out_len: size of \p out buffer + * + * This creates a "flattened" JWS packet from the jwk and the plaintext + * payload, and signs it. The packet is written into \p out. + * + * This does the whole packet assembly and signing, calling through to + * lws_jws_sign_from_b64() as part of the process. + * + * Returns the length written to \p out, or -1. + */ +LWS_VISIBLE LWS_EXTERN int +lws_jws_create_packet(struct lws_jwk *jwk, const char *payload, size_t len, + const char *nonce, char *out, size_t out_len); + +/** + * lws_jws_base64_enc() - encode input data into b64url data + * + * \param in: the incoming plaintext + * \param in_len: the length of the incoming plaintext in bytes + * \param out: the buffer to store the b64url encoded data to + * \param out_max: the length of \p out in bytes + * + * Returns either -1 if problems, or the number of bytes written to \p out. + */ +LWS_VISIBLE LWS_EXTERN int +lws_jws_base64_enc(const char *in, size_t in_len, char *out, size_t out_max); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-lejp.h b/thirdparty/libwebsockets/include/libwebsockets/lws-lejp.h new file mode 100644 index 0000000000..f3f7e59a64 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-lejp.h @@ -0,0 +1,262 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup lejp JSON parser + * ##JSON parsing related functions + * \ingroup lwsapi + * + * LEJP is an extremely lightweight JSON stream parser included in lws. + */ +//@{ +struct lejp_ctx; + +#if !defined(LWS_ARRAY_SIZE) +#define LWS_ARRAY_SIZE(_x) (sizeof(_x) / sizeof(_x[0])) +#endif +#define LEJP_FLAG_WS_KEEP 64 +#define LEJP_FLAG_WS_COMMENTLINE 32 + +enum lejp_states { + LEJP_IDLE = 0, + LEJP_MEMBERS = 1, + LEJP_M_P = 2, + LEJP_MP_STRING = LEJP_FLAG_WS_KEEP | 3, + LEJP_MP_STRING_ESC = LEJP_FLAG_WS_KEEP | 4, + LEJP_MP_STRING_ESC_U1 = LEJP_FLAG_WS_KEEP | 5, + LEJP_MP_STRING_ESC_U2 = LEJP_FLAG_WS_KEEP | 6, + LEJP_MP_STRING_ESC_U3 = LEJP_FLAG_WS_KEEP | 7, + LEJP_MP_STRING_ESC_U4 = LEJP_FLAG_WS_KEEP | 8, + LEJP_MP_DELIM = 9, + LEJP_MP_VALUE = 10, + LEJP_MP_VALUE_NUM_INT = LEJP_FLAG_WS_KEEP | 11, + LEJP_MP_VALUE_NUM_EXP = LEJP_FLAG_WS_KEEP | 12, + LEJP_MP_VALUE_TOK = LEJP_FLAG_WS_KEEP | 13, + LEJP_MP_COMMA_OR_END = 14, + LEJP_MP_ARRAY_END = 15, +}; + +enum lejp_reasons { + LEJP_CONTINUE = -1, + LEJP_REJECT_IDLE_NO_BRACE = -2, + LEJP_REJECT_MEMBERS_NO_CLOSE = -3, + LEJP_REJECT_MP_NO_OPEN_QUOTE = -4, + LEJP_REJECT_MP_STRING_UNDERRUN = -5, + LEJP_REJECT_MP_ILLEGAL_CTRL = -6, + LEJP_REJECT_MP_STRING_ESC_ILLEGAL_ESC = -7, + LEJP_REJECT_ILLEGAL_HEX = -8, + LEJP_REJECT_MP_DELIM_MISSING_COLON = -9, + LEJP_REJECT_MP_DELIM_BAD_VALUE_START = -10, + LEJP_REJECT_MP_VAL_NUM_INT_NO_FRAC = -11, + LEJP_REJECT_MP_VAL_NUM_FORMAT = -12, + LEJP_REJECT_MP_VAL_NUM_EXP_BAD_EXP = -13, + LEJP_REJECT_MP_VAL_TOK_UNKNOWN = -14, + LEJP_REJECT_MP_C_OR_E_UNDERF = -15, + LEJP_REJECT_MP_C_OR_E_NOTARRAY = -16, + LEJP_REJECT_MP_ARRAY_END_MISSING = -17, + LEJP_REJECT_STACK_OVERFLOW = -18, + LEJP_REJECT_MP_DELIM_ISTACK = -19, + LEJP_REJECT_NUM_TOO_LONG = -20, + LEJP_REJECT_MP_C_OR_E_NEITHER = -21, + LEJP_REJECT_UNKNOWN = -22, + LEJP_REJECT_CALLBACK = -23 +}; + +#define LEJP_FLAG_CB_IS_VALUE 64 + +enum lejp_callbacks { + LEJPCB_CONSTRUCTED = 0, + LEJPCB_DESTRUCTED = 1, + + LEJPCB_START = 2, + LEJPCB_COMPLETE = 3, + LEJPCB_FAILED = 4, + + LEJPCB_PAIR_NAME = 5, + + LEJPCB_VAL_TRUE = LEJP_FLAG_CB_IS_VALUE | 6, + LEJPCB_VAL_FALSE = LEJP_FLAG_CB_IS_VALUE | 7, + LEJPCB_VAL_NULL = LEJP_FLAG_CB_IS_VALUE | 8, + LEJPCB_VAL_NUM_INT = LEJP_FLAG_CB_IS_VALUE | 9, + LEJPCB_VAL_NUM_FLOAT = LEJP_FLAG_CB_IS_VALUE | 10, + LEJPCB_VAL_STR_START = 11, /* notice handle separately */ + LEJPCB_VAL_STR_CHUNK = LEJP_FLAG_CB_IS_VALUE | 12, + LEJPCB_VAL_STR_END = LEJP_FLAG_CB_IS_VALUE | 13, + + LEJPCB_ARRAY_START = 14, + LEJPCB_ARRAY_END = 15, + + LEJPCB_OBJECT_START = 16, + LEJPCB_OBJECT_END = 17 +}; + +/** + * _lejp_callback() - User parser actions + * \param ctx: LEJP context + * \param reason: Callback reason + * + * Your user callback is associated with the context at construction time, + * and receives calls as the parsing progresses. + * + * All of the callbacks may be ignored and just return 0. + * + * The reasons it might get called, found in @reason, are: + * + * LEJPCB_CONSTRUCTED: The context was just constructed... you might want to + * perform one-time allocation for the life of the context. + * + * LEJPCB_DESTRUCTED: The context is being destructed... if you made any + * allocations at construction-time, you can free them now + * + * LEJPCB_START: Parsing is beginning at the first byte of input + * + * LEJPCB_COMPLETE: Parsing has completed successfully. You'll get a 0 or + * positive return code from lejp_parse indicating the + * amount of unused bytes left in the input buffer + * + * LEJPCB_FAILED: Parsing failed. You'll get a negative error code + * returned from lejp_parse + * + * LEJPCB_PAIR_NAME: When a "name":"value" pair has had the name parsed, + * this callback occurs. You can find the new name at + * the end of ctx->path[] + * + * LEJPCB_VAL_TRUE: The "true" value appeared + * + * LEJPCB_VAL_FALSE: The "false" value appeared + * + * LEJPCB_VAL_NULL: The "null" value appeared + * + * LEJPCB_VAL_NUM_INT: A string representing an integer is in ctx->buf + * + * LEJPCB_VAL_NUM_FLOAT: A string representing a float is in ctx->buf + * + * LEJPCB_VAL_STR_START: We are starting to parse a string, no data yet + * + * LEJPCB_VAL_STR_CHUNK: We parsed LEJP_STRING_CHUNK -1 bytes of string data in + * ctx->buf, which is as much as we can buffer, so we are + * spilling it. If all your strings are less than + * LEJP_STRING_CHUNK - 1 bytes, you will never see this + * callback. + * + * LEJPCB_VAL_STR_END: String parsing has completed, the last chunk of the + * string is in ctx->buf. + * + * LEJPCB_ARRAY_START: An array started + * + * LEJPCB_ARRAY_END: An array ended + * + * LEJPCB_OBJECT_START: An object started + * + * LEJPCB_OBJECT_END: An object ended + */ +LWS_EXTERN signed char _lejp_callback(struct lejp_ctx *ctx, char reason); + +typedef signed char (*lejp_callback)(struct lejp_ctx *ctx, char reason); + +#ifndef LEJP_MAX_DEPTH +#define LEJP_MAX_DEPTH 12 +#endif +#ifndef LEJP_MAX_INDEX_DEPTH +#define LEJP_MAX_INDEX_DEPTH 5 +#endif +#ifndef LEJP_MAX_PATH +#define LEJP_MAX_PATH 128 +#endif +#ifndef LEJP_STRING_CHUNK +/* must be >= 30 to assemble floats */ +#define LEJP_STRING_CHUNK 254 +#endif + +enum num_flags { + LEJP_SEEN_MINUS = (1 << 0), + LEJP_SEEN_POINT = (1 << 1), + LEJP_SEEN_POST_POINT = (1 << 2), + LEJP_SEEN_EXP = (1 << 3) +}; + +struct _lejp_stack { + char s; /* lejp_state stack*/ + char p; /* path length */ + char i; /* index array length */ + char b; /* user bitfield */ +}; + +struct lejp_ctx { + + /* sorted by type for most compact alignment + * + * pointers + */ + + signed char (*callback)(struct lejp_ctx *ctx, char reason); + void *user; + const char * const *paths; + + /* arrays */ + + struct _lejp_stack st[LEJP_MAX_DEPTH]; + uint16_t i[LEJP_MAX_INDEX_DEPTH]; /* index array */ + uint16_t wild[LEJP_MAX_INDEX_DEPTH]; /* index array */ + char path[LEJP_MAX_PATH]; + char buf[LEJP_STRING_CHUNK + 1]; + + /* int */ + + uint32_t line; + + /* short */ + + uint16_t uni; + + /* char */ + + uint8_t npos; + uint8_t dcount; + uint8_t f; + uint8_t sp; /* stack head */ + uint8_t ipos; /* index stack depth */ + uint8_t ppos; + uint8_t count_paths; + uint8_t path_match; + uint8_t path_match_len; + uint8_t wildcount; +}; + +LWS_VISIBLE LWS_EXTERN void +lejp_construct(struct lejp_ctx *ctx, + signed char (*callback)(struct lejp_ctx *ctx, char reason), + void *user, const char * const *paths, unsigned char paths_count); + +LWS_VISIBLE LWS_EXTERN void +lejp_destruct(struct lejp_ctx *ctx); + +LWS_VISIBLE LWS_EXTERN int +lejp_parse(struct lejp_ctx *ctx, const unsigned char *json, int len); + +LWS_VISIBLE LWS_EXTERN void +lejp_change_callback(struct lejp_ctx *ctx, + signed char (*callback)(struct lejp_ctx *ctx, char reason)); + +LWS_VISIBLE LWS_EXTERN int +lejp_get_wildcard(struct lejp_ctx *ctx, int wildcard, char *dest, int len); +//@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-logs.h b/thirdparty/libwebsockets/include/libwebsockets/lws-logs.h new file mode 100644 index 0000000000..9317dcc70c --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-logs.h @@ -0,0 +1,224 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup log Logging + * + * ##Logging + * + * Lws provides flexible and filterable logging facilities, which can be + * used inside lws and in user code. + * + * Log categories may be individually filtered bitwise, and directed to built-in + * sinks for syslog-compatible logging, or a user-defined function. + */ +///@{ + +enum lws_log_levels { + LLL_ERR = 1 << 0, + LLL_WARN = 1 << 1, + LLL_NOTICE = 1 << 2, + LLL_INFO = 1 << 3, + LLL_DEBUG = 1 << 4, + LLL_PARSER = 1 << 5, + LLL_HEADER = 1 << 6, + LLL_EXT = 1 << 7, + LLL_CLIENT = 1 << 8, + LLL_LATENCY = 1 << 9, + LLL_USER = 1 << 10, + LLL_THREAD = 1 << 11, + + LLL_COUNT = 12 /* set to count of valid flags */ +}; + +LWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...) LWS_FORMAT(2); +LWS_VISIBLE LWS_EXTERN void _lws_logv(int filter, const char *format, va_list vl); +/** + * lwsl_timestamp: generate logging timestamp string + * + * \param level: logging level + * \param p: char * buffer to take timestamp + * \param len: length of p + * + * returns length written in p + */ +LWS_VISIBLE LWS_EXTERN int +lwsl_timestamp(int level, char *p, int len); + +/* these guys are unconditionally included */ + +#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__) +#define lwsl_user(...) _lws_log(LLL_USER, __VA_ARGS__) + +#if !defined(LWS_WITH_NO_LOGS) +/* notice and warn are usually included by being compiled in */ +#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__) +#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) +#endif +/* + * weaker logging can be deselected by telling CMake to build in RELEASE mode + * that gets rid of the overhead of checking while keeping _warn and _err + * active + */ + +#ifdef _DEBUG +#if defined(LWS_WITH_NO_LOGS) +/* notice, warn and log are always compiled in */ +#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__) +#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) +#endif +#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__) +#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__) +#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__) +#define lwsl_header(...) _lws_log(LLL_HEADER, __VA_ARGS__) +#define lwsl_ext(...) _lws_log(LLL_EXT, __VA_ARGS__) +#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__) +#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__) +#define lwsl_thread(...) _lws_log(LLL_THREAD, __VA_ARGS__) + +#else /* no debug */ +#if defined(LWS_WITH_NO_LOGS) +#define lwsl_warn(...) do {} while(0) +#define lwsl_notice(...) do {} while(0) +#endif +#define lwsl_info(...) do {} while(0) +#define lwsl_debug(...) do {} while(0) +#define lwsl_parser(...) do {} while(0) +#define lwsl_header(...) do {} while(0) +#define lwsl_ext(...) do {} while(0) +#define lwsl_client(...) do {} while(0) +#define lwsl_latency(...) do {} while(0) +#define lwsl_thread(...) do {} while(0) + +#endif + +#define lwsl_hexdump_err(...) lwsl_hexdump_level(LLL_ERR, __VA_ARGS__) +#define lwsl_hexdump_warn(...) lwsl_hexdump_level(LLL_WARN, __VA_ARGS__) +#define lwsl_hexdump_notice(...) lwsl_hexdump_level(LLL_NOTICE, __VA_ARGS__) +#define lwsl_hexdump_info(...) lwsl_hexdump_level(LLL_INFO, __VA_ARGS__) +#define lwsl_hexdump_debug(...) lwsl_hexdump_level(LLL_DEBUG, __VA_ARGS__) + +/** + * lwsl_hexdump_level() - helper to hexdump a buffer at a selected debug level + * + * \param level: one of LLL_ constants + * \param vbuf: buffer start to dump + * \param len: length of buffer to dump + * + * If \p level is visible, does a nice hexdump -C style dump of \p vbuf for + * \p len bytes. This can be extremely convenient while debugging. + */ +LWS_VISIBLE LWS_EXTERN void +lwsl_hexdump_level(int level, const void *vbuf, size_t len); + +/** + * lwsl_hexdump() - helper to hexdump a buffer (DEBUG builds only) + * + * \param buf: buffer start to dump + * \param len: length of buffer to dump + * + * Calls through to lwsl_hexdump_level(LLL_DEBUG, ... for compatability. + * It's better to use lwsl_hexdump_level(level, ... directly so you can control + * the visibility. + */ +LWS_VISIBLE LWS_EXTERN void +lwsl_hexdump(const void *buf, size_t len); + +/** + * lws_is_be() - returns nonzero if the platform is Big Endian + */ +static LWS_INLINE int lws_is_be(void) { + const int probe = ~0xff; + + return *(const char *)&probe; +} + +/** + * lws_set_log_level() - Set the logging bitfield + * \param level: OR together the LLL_ debug contexts you want output from + * \param log_emit_function: NULL to leave it as it is, or a user-supplied + * function to perform log string emission instead of + * the default stderr one. + * + * log level defaults to "err", "warn" and "notice" contexts enabled and + * emission on stderr. If stderr is a tty (according to isatty()) then + * the output is coloured according to the log level using ANSI escapes. + */ +LWS_VISIBLE LWS_EXTERN void +lws_set_log_level(int level, + void (*log_emit_function)(int level, const char *line)); + +/** + * lwsl_emit_syslog() - helper log emit function writes to system log + * + * \param level: one of LLL_ log level indexes + * \param line: log string + * + * You use this by passing the function pointer to lws_set_log_level(), to set + * it as the log emit function, it is not called directly. + */ +LWS_VISIBLE LWS_EXTERN void +lwsl_emit_syslog(int level, const char *line); + +/** + * lwsl_emit_stderr() - helper log emit function writes to stderr + * + * \param level: one of LLL_ log level indexes + * \param line: log string + * + * You use this by passing the function pointer to lws_set_log_level(), to set + * it as the log emit function, it is not called directly. + * + * It prepends a system timestamp like [2018/11/13 07:41:57:3989] + * + * If stderr is a tty, then ansi colour codes are added. + */ +LWS_VISIBLE LWS_EXTERN void +lwsl_emit_stderr(int level, const char *line); + +/** + * lwsl_emit_stderr_notimestamp() - helper log emit function writes to stderr + * + * \param level: one of LLL_ log level indexes + * \param line: log string + * + * You use this by passing the function pointer to lws_set_log_level(), to set + * it as the log emit function, it is not called directly. + * + * If stderr is a tty, then ansi colour codes are added. + */ +LWS_VISIBLE LWS_EXTERN void +lwsl_emit_stderr_notimestamp(int level, const char *line); + +/** + * lwsl_visible() - returns true if the log level should be printed + * + * \param level: one of LLL_ log level indexes + * + * This is useful if you have to do work to generate the log content, you + * can skip the work if the log level used to print it is not actually + * enabled at runtime. + */ +LWS_VISIBLE LWS_EXTERN int +lwsl_visible(int level); + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-lwsac.h b/thirdparty/libwebsockets/include/libwebsockets/lws-lwsac.h new file mode 100644 index 0000000000..1f914b66a6 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-lwsac.h @@ -0,0 +1,191 @@ +/* + * libwebsockets - lws alloc chunk + * + * Copyright (C) 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup log lwsac + * + * ##Allocated Chunks + * + * If you know you will be allocating a large, unknown number of same or + * differently sized objects, it's certainly possible to do it with libc + * malloc. However the allocation cost in time and memory overhead can + * add up, and deallocation means walking the structure of every object and + * freeing them in turn. + * + * lwsac (LWS Allocated Chunks) allocates chunks intended to be larger + * than your objects (4000 bytes by default) which you linearly allocate from + * using lwsac_use(). + * + * If your next request won't fit in the current chunk, a new chunk is added + * to the chain of chunks and the allocaton done from there. If the request + * is larger than the chunk size, an oversize chunk is created to satisfy it. + * + * When you are finished with the allocations, you call lwsac_free() and + * free all the *chunks*. So you may have thousands of objects in the chunks, + * but they are all destroyed with the chunks without having to deallocate them + * one by one pointlessly. + */ +///@{ + +struct lwsac; +typedef unsigned char * lwsac_cached_file_t; + + +#define lws_list_ptr_container(P,T,M) ((T *)((char *)(P) - offsetof(T, M))) + +/* + * linked-list helper that's commonly useful to manage lists of things + * allocated using lwsac. + * + * These lists point to their corresponding "next" member in the target, NOT + * the original containing struct. To get the containing struct, you must use + * lws_list_ptr_container() to convert. + * + * It's like that because it means we no longer have to have the next pointer + * at the start of the struct, and we can have the same struct on multiple + * linked-lists with everything held in the struct itself. + */ +typedef void * lws_list_ptr; + +/* + * optional sorting callback called by lws_list_ptr_insert() to sort the right + * things inside the opqaue struct being sorted / inserted on the list. + */ +typedef int (*lws_list_ptr_sort_func_t)(lws_list_ptr a, lws_list_ptr b); + +#define lws_list_ptr_advance(_lp) _lp = *((void **)_lp) + +/* sort may be NULL if you don't care about order */ +LWS_VISIBLE LWS_EXTERN void +lws_list_ptr_insert(lws_list_ptr *phead, lws_list_ptr *add, + lws_list_ptr_sort_func_t sort); + + +/** + * lwsac_use - allocate / use some memory from a lwsac + * + * \param head: pointer to the lwsac list object + * \param ensure: the number of bytes we want to use + * \param chunk_size: 0, or the size of the chunk to (over)allocate if + * what we want won't fit in the current tail chunk. If + * 0, the default value of 4000 is used. If ensure is + * larger, it is used instead. + * + * This also serves to init the lwsac if *head is NULL. Basically it does + * whatever is necessary to return you a pointer to ensure bytes of memory + * reserved for the caller. + * + * Returns NULL if OOM. + */ +LWS_VISIBLE LWS_EXTERN void * +lwsac_use(struct lwsac **head, size_t ensure, size_t chunk_size); + +/** + * lwsac_free - deallocate all chunks in the lwsac and set head NULL + * + * \param head: pointer to the lwsac list object + * + * This deallocates all chunks in the lwsac, then sets *head to NULL. All + * lwsac_use() pointers are invalidated in one hit without individual frees. + */ +LWS_VISIBLE LWS_EXTERN void +lwsac_free(struct lwsac **head); + +/* + * Optional helpers useful for where consumers may need to defer destruction + * until all consumers are finished with the lwsac + */ + +/** + * lwsac_detach() - destroy an lwsac unless somebody else is referencing it + * + * \param head: pointer to the lwsac list object + * + * The creator of the lwsac can all this instead of lwsac_free() when it itself + * has finished with the lwsac, but other code may be consuming it. + * + * If there are no other references, the lwsac is destroyed, *head is set to + * NULL and that's the end; however if something else has called + * lwsac_reference() on the lwsac, it simply returns. When lws_unreference() + * is called and no references are left, it will be destroyed then. + */ +LWS_VISIBLE LWS_EXTERN void +lwsac_detach(struct lwsac **head); + +/** + * lwsac_reference() - increase the lwsac reference count + * + * \param head: pointer to the lwsac list object + * + * Increment the reference count on the lwsac to defer destruction. + */ +LWS_VISIBLE LWS_EXTERN void +lwsac_reference(struct lwsac *head); + +/** + * lwsac_reference() - increase the lwsac reference count + * + * \param head: pointer to the lwsac list object + * + * Decrement the reference count on the lwsac... if it reached 0 on a detached + * lwsac then the lwsac is immediately destroyed and *head set to NULL. + */ +LWS_VISIBLE LWS_EXTERN void +lwsac_unreference(struct lwsac **head); + + +/* helpers to keep a file cached in memory */ + +LWS_VISIBLE LWS_EXTERN void +lwsac_use_cached_file_start(lwsac_cached_file_t cache); + +LWS_VISIBLE LWS_EXTERN void +lwsac_use_cached_file_end(lwsac_cached_file_t *cache); + +LWS_VISIBLE LWS_EXTERN void +lwsac_use_cached_file_detach(lwsac_cached_file_t *cache); + +LWS_VISIBLE LWS_EXTERN int +lwsac_cached_file(const char *filepath, lwsac_cached_file_t *cache, + size_t *len); + +/* more advanced helpers */ + +LWS_VISIBLE LWS_EXTERN size_t +lwsac_sizeof(void); + +LWS_VISIBLE LWS_EXTERN size_t +lwsac_get_tail_pos(struct lwsac *lac); + +LWS_VISIBLE LWS_EXTERN struct lwsac * +lwsac_get_next(struct lwsac *lac); + +LWS_VISIBLE LWS_EXTERN size_t +lwsac_align(size_t length); + +LWS_VISIBLE LWS_EXTERN void +lwsac_info(struct lwsac *head); + +LWS_VISIBLE LWS_EXTERN uint64_t +lwsac_total_alloc(struct lwsac *head); + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-misc.h b/thirdparty/libwebsockets/include/libwebsockets/lws-misc.h new file mode 100644 index 0000000000..02fe432d5b --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-misc.h @@ -0,0 +1,836 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup misc Miscellaneous APIs +* ##Miscellaneous APIs +* +* Various APIs outside of other categories +*/ +///@{ + +/** + * lws_start_foreach_ll(): linkedlist iterator helper start + * + * \param type: type of iteration, eg, struct xyz * + * \param it: iterator var name to create + * \param start: start of list + * + * This helper creates an iterator and starts a while (it) { + * loop. The iterator runs through the linked list starting at start and + * ends when it gets a NULL. + * The while loop should be terminated using lws_start_foreach_ll(). + */ +#define lws_start_foreach_ll(type, it, start)\ +{ \ + type it = start; \ + while (it) { + +/** + * lws_end_foreach_ll(): linkedlist iterator helper end + * + * \param it: same iterator var name given when starting + * \param nxt: member name in the iterator pointing to next list element + * + * This helper is the partner for lws_start_foreach_ll() that ends the + * while loop. + */ + +#define lws_end_foreach_ll(it, nxt) \ + it = it->nxt; \ + } \ +} + +/** + * lws_start_foreach_ll_safe(): linkedlist iterator helper start safe against delete + * + * \param type: type of iteration, eg, struct xyz * + * \param it: iterator var name to create + * \param start: start of list + * \param nxt: member name in the iterator pointing to next list element + * + * This helper creates an iterator and starts a while (it) { + * loop. The iterator runs through the linked list starting at start and + * ends when it gets a NULL. + * The while loop should be terminated using lws_end_foreach_ll_safe(). + * Performs storage of next increment for situations where iterator can become invalidated + * during iteration. + */ +#define lws_start_foreach_ll_safe(type, it, start, nxt)\ +{ \ + type it = start; \ + while (it) { \ + type next_##it = it->nxt; + +/** + * lws_end_foreach_ll_safe(): linkedlist iterator helper end (pre increment storage) + * + * \param it: same iterator var name given when starting + * + * This helper is the partner for lws_start_foreach_ll_safe() that ends the + * while loop. It uses the precreated next_ variable already stored during + * start. + */ + +#define lws_end_foreach_ll_safe(it) \ + it = next_##it; \ + } \ +} + +/** + * lws_start_foreach_llp(): linkedlist pointer iterator helper start + * + * \param type: type of iteration, eg, struct xyz ** + * \param it: iterator var name to create + * \param start: start of list + * + * This helper creates an iterator and starts a while (it) { + * loop. The iterator runs through the linked list starting at the + * address of start and ends when it gets a NULL. + * The while loop should be terminated using lws_start_foreach_llp(). + * + * This helper variant iterates using a pointer to the previous linked-list + * element. That allows you to easily delete list members by rewriting the + * previous pointer to the element's next pointer. + */ +#define lws_start_foreach_llp(type, it, start)\ +{ \ + type it = &(start); \ + while (*(it)) { + +#define lws_start_foreach_llp_safe(type, it, start, nxt)\ +{ \ + type it = &(start); \ + type next; \ + while (*(it)) { \ + next = &((*(it))->nxt); \ + +/** + * lws_end_foreach_llp(): linkedlist pointer iterator helper end + * + * \param it: same iterator var name given when starting + * \param nxt: member name in the iterator pointing to next list element + * + * This helper is the partner for lws_start_foreach_llp() that ends the + * while loop. + */ + +#define lws_end_foreach_llp(it, nxt) \ + it = &(*(it))->nxt; \ + } \ +} + +#define lws_end_foreach_llp_safe(it) \ + it = next; \ + } \ +} + +#define lws_ll_fwd_insert(\ + ___new_object, /* pointer to new object */ \ + ___m_list, /* member for next list object ptr */ \ + ___list_head /* list head */ \ + ) {\ + ___new_object->___m_list = ___list_head; \ + ___list_head = ___new_object; \ + } + +#define lws_ll_fwd_remove(\ + ___type, /* type of listed object */ \ + ___m_list, /* member for next list object ptr */ \ + ___target, /* object to remove from list */ \ + ___list_head /* list head */ \ + ) { \ + lws_start_foreach_llp(___type **, ___ppss, ___list_head) { \ + if (*___ppss == ___target) { \ + *___ppss = ___target->___m_list; \ + break; \ + } \ + } lws_end_foreach_llp(___ppss, ___m_list); \ + } + +/* + * doubly linked-list + */ + +struct lws_dll { /* abstract */ + struct lws_dll *prev; + struct lws_dll *next; +}; + +/* + * these all point to the composed list objects... you have to use the + * lws_container_of() helper to recover the start of the containing struct + */ + +LWS_VISIBLE LWS_EXTERN void +lws_dll_add_front(struct lws_dll *d, struct lws_dll *phead); + +LWS_VISIBLE LWS_EXTERN void +lws_dll_remove(struct lws_dll *d); + +struct lws_dll_lws { /* typed as struct lws * */ + struct lws_dll_lws *prev; + struct lws_dll_lws *next; +}; + +#define lws_dll_is_null(___dll) (!(___dll)->prev && !(___dll)->next) + +static LWS_INLINE void +lws_dll_lws_add_front(struct lws_dll_lws *_a, struct lws_dll_lws *_head) +{ + lws_dll_add_front((struct lws_dll *)_a, (struct lws_dll *)_head); +} + +static LWS_INLINE void +lws_dll_lws_remove(struct lws_dll_lws *_a) +{ + lws_dll_remove((struct lws_dll *)_a); +} + +/* + * these are safe against the current container object getting deleted, + * since the hold his next in a temp and go to that next. ___tmp is + * the temp. + */ + +#define lws_start_foreach_dll_safe(___type, ___it, ___tmp, ___start) \ +{ \ + ___type ___it = ___start; \ + while (___it) { \ + ___type ___tmp = (___it)->next; + +#define lws_end_foreach_dll_safe(___it, ___tmp) \ + ___it = ___tmp; \ + } \ +} + +#define lws_start_foreach_dll(___type, ___it, ___start) \ +{ \ + ___type ___it = ___start; \ + while (___it) { + +#define lws_end_foreach_dll(___it) \ + ___it = (___it)->next; \ + } \ +} + +struct lws_buflist; + +/** + * lws_buflist_append_segment(): add buffer to buflist at head + * + * \param head: list head + * \param buf: buffer to stash + * \param len: length of buffer to stash + * + * Returns -1 on OOM, 1 if this was the first segment on the list, and 0 if + * it was a subsequent segment. + */ +LWS_VISIBLE LWS_EXTERN int +lws_buflist_append_segment(struct lws_buflist **head, const uint8_t *buf, + size_t len); +/** + * lws_buflist_next_segment_len(): number of bytes left in current segment + * + * \param head: list head + * \param buf: if non-NULL, *buf is written with the address of the start of + * the remaining data in the segment + * + * Returns the number of bytes left in the current segment. 0 indicates + * that the buflist is empty (there are no segments on the buflist). + */ +LWS_VISIBLE LWS_EXTERN size_t +lws_buflist_next_segment_len(struct lws_buflist **head, uint8_t **buf); +/** + * lws_buflist_use_segment(): remove len bytes from the current segment + * + * \param head: list head + * \param len: number of bytes to mark as used + * + * If len is less than the remaining length of the current segment, the position + * in the current segment is simply advanced and it returns. + * + * If len uses up the remaining length of the current segment, then the segment + * is deleted and the list head moves to the next segment if any. + * + * Returns the number of bytes left in the current segment. 0 indicates + * that the buflist is empty (there are no segments on the buflist). + */ +LWS_VISIBLE LWS_EXTERN int +lws_buflist_use_segment(struct lws_buflist **head, size_t len); +/** + * lws_buflist_destroy_all_segments(): free all segments on the list + * + * \param head: list head + * + * This frees everything on the list unconditionally. *head is always + * NULL after this. + */ +LWS_VISIBLE LWS_EXTERN void +lws_buflist_destroy_all_segments(struct lws_buflist **head); + +void +lws_buflist_describe(struct lws_buflist **head, void *id); + +/** + * lws_ptr_diff(): helper to report distance between pointers as an int + * + * \param head: the pointer with the larger address + * \param tail: the pointer with the smaller address + * + * This helper gives you an int representing the number of bytes further + * forward the first pointer is compared to the second pointer. + */ +#define lws_ptr_diff(head, tail) \ + ((int)((char *)(head) - (char *)(tail))) + +/** + * lws_snprintf(): snprintf that truncates the returned length too + * + * \param str: destination buffer + * \param size: bytes left in destination buffer + * \param format: format string + * \param ...: args for format + * + * This lets you correctly truncate buffers by concatenating lengths, if you + * reach the limit the reported length doesn't exceed the limit. + */ +LWS_VISIBLE LWS_EXTERN int +lws_snprintf(char *str, size_t size, const char *format, ...) LWS_FORMAT(3); + +/** + * lws_strncpy(): strncpy that guarantees NUL on truncated copy + * + * \param dest: destination buffer + * \param src: source buffer + * \param size: bytes left in destination buffer + * + * This lets you correctly truncate buffers by concatenating lengths, if you + * reach the limit the reported length doesn't exceed the limit. + */ +LWS_VISIBLE LWS_EXTERN char * +lws_strncpy(char *dest, const char *src, size_t size); + +/** + * lws_get_random(): fill a buffer with platform random data + * + * \param context: the lws context + * \param buf: buffer to fill + * \param len: how much to fill + * + * This is intended to be called from the LWS_CALLBACK_RECEIVE callback if + * it's interested to see if the frame it's dealing with was sent in binary + * mode. + */ +LWS_VISIBLE LWS_EXTERN int +lws_get_random(struct lws_context *context, void *buf, int len); +/** + * lws_daemonize(): make current process run in the background + * + * \param _lock_path: the filepath to write the lock file + * + * Spawn lws as a background process, taking care of various things + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_daemonize(const char *_lock_path); +/** + * lws_get_library_version(): return string describing the version of lws + * + * On unix, also includes the git describe + */ +LWS_VISIBLE LWS_EXTERN const char * LWS_WARN_UNUSED_RESULT +lws_get_library_version(void); + +/** + * lws_wsi_user() - get the user data associated with the connection + * \param wsi: lws connection + * + * Not normally needed since it's passed into the callback + */ +LWS_VISIBLE LWS_EXTERN void * +lws_wsi_user(struct lws *wsi); + +/** + * lws_wsi_set_user() - set the user data associated with the client connection + * \param wsi: lws connection + * \param user: user data + * + * By default lws allocates this and it's not legal to externally set it + * yourself. However client connections may have it set externally when the + * connection is created... if so, this api can be used to modify it at + * runtime additionally. + */ +LWS_VISIBLE LWS_EXTERN void +lws_set_wsi_user(struct lws *wsi, void *user); + +/** + * lws_parse_uri: cut up prot:/ads:port/path into pieces + * Notice it does so by dropping '\0' into input string + * and the leading / on the path is consequently lost + * + * \param p: incoming uri string.. will get written to + * \param prot: result pointer for protocol part (https://) + * \param ads: result pointer for address part + * \param port: result pointer for port part + * \param path: result pointer for path part + * + * You may also refer to unix socket addresses, using a '+' at the start of + * the address. In this case, the address should end with ':', which is + * treated as the separator between the address and path (the normal separator + * '/' is a valid part of the socket path). Eg, + * + * http://+/var/run/mysocket:/my/path + * + * If the first character after the + is '@', it's interpreted by lws client + * processing as meaning to use linux abstract namespace sockets, the @ is + * replaced with a '\0' before use. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_parse_uri(char *p, const char **prot, const char **ads, int *port, + const char **path); +/** + * lws_cmdline_option(): simple commandline parser + * + * \param argc: count of argument strings + * \param argv: argument strings + * \param val: string to find + * + * Returns NULL if the string \p val is not found in the arguments. + * + * If it is found, then it returns a pointer to the next character after \p val. + * So if \p val is "-d", then for the commandlines "myapp -d15" and + * "myapp -d 15", in both cases the return will point to the "15". + * + * In the case there is no argument, like "myapp -d", the return will + * either point to the '\\0' at the end of -d, or to the start of the + * next argument, ie, will be non-NULL. + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_cmdline_option(int argc, const char **argv, const char *val); + +/** + * lws_now_secs(): return seconds since 1970-1-1 + */ +LWS_VISIBLE LWS_EXTERN unsigned long +lws_now_secs(void); + +/** + * lws_now_usecs(): return useconds since 1970-1-1 + */ +LWS_VISIBLE LWS_EXTERN lws_usec_t +lws_now_usecs(void); + +/** + * lws_compare_time_t(): return relationship between two time_t + * + * \param context: struct lws_context + * \param t1: time_t 1 + * \param t2: time_t 2 + * + * returns <0 if t2 > t1; >0 if t1 > t2; or == 0 if t1 == t2. + * + * This is aware of clock discontiguities that may have affected either t1 or + * t2 and adapts the comparison for them. + * + * For the discontiguity detection to work, you must avoid any arithmetic on + * the times being compared. For example to have a timeout that triggers + * 15s from when it was set, store the time it was set and compare like + * `if (lws_compare_time_t(context, now, set_time) > 15)` + */ +LWS_VISIBLE LWS_EXTERN int +lws_compare_time_t(struct lws_context *context, time_t t1, time_t t2); + +/** + * lws_get_context - Allow getting lws_context from a Websocket connection + * instance + * + * With this function, users can access context in the callback function. + * Otherwise users may have to declare context as a global variable. + * + * \param wsi: Websocket connection instance + */ +LWS_VISIBLE LWS_EXTERN struct lws_context * LWS_WARN_UNUSED_RESULT +lws_get_context(const struct lws *wsi); + +/** + * lws_get_vhost_listen_port - Find out the port number a vhost is listening on + * + * In the case you passed 0 for the port number at context creation time, you + * can discover the port number that was actually chosen for the vhost using + * this api. + * + * \param vhost: Vhost to get listen port from + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_get_vhost_listen_port(struct lws_vhost *vhost); + +/** + * lws_get_count_threads(): how many service threads the context uses + * + * \param context: the lws context + * + * By default this is always 1, if you asked for more than lws can handle it + * will clip the number of threads. So you can use this to find out how many + * threads are actually in use. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_get_count_threads(struct lws_context *context); + +/** + * lws_get_parent() - get parent wsi or NULL + * \param wsi: lws connection + * + * Specialized wsi like cgi stdin/out/err are associated to a parent wsi, + * this allows you to get their parent. + */ +LWS_VISIBLE LWS_EXTERN struct lws * LWS_WARN_UNUSED_RESULT +lws_get_parent(const struct lws *wsi); + +/** + * lws_get_child() - get child wsi or NULL + * \param wsi: lws connection + * + * Allows you to find a related wsi from the parent wsi. + */ +LWS_VISIBLE LWS_EXTERN struct lws * LWS_WARN_UNUSED_RESULT +lws_get_child(const struct lws *wsi); + +/** + * lws_get_effective_uid_gid() - find out eventual uid and gid while still root + * + * \param context: lws context + * \param uid: pointer to uid result + * \param gid: pointer to gid result + * + * This helper allows you to find out what the uid and gid for the process will + * be set to after the privileges are dropped, beforehand. So while still root, + * eg in LWS_CALLBACK_PROTOCOL_INIT, you can arrange things like cache dir + * and subdir creation / permissions down /var/cache dynamically. + */ +LWS_VISIBLE LWS_EXTERN void +lws_get_effective_uid_gid(struct lws_context *context, int *uid, int *gid); + +/** + * lws_get_udp() - get wsi's udp struct + * + * \param wsi: lws connection + * + * Returns NULL or pointer to the wsi's UDP-specific information + */ +LWS_VISIBLE LWS_EXTERN const struct lws_udp * LWS_WARN_UNUSED_RESULT +lws_get_udp(const struct lws *wsi); + +LWS_VISIBLE LWS_EXTERN void * +lws_get_opaque_parent_data(const struct lws *wsi); + +LWS_VISIBLE LWS_EXTERN void +lws_set_opaque_parent_data(struct lws *wsi, void *data); + +LWS_VISIBLE LWS_EXTERN int +lws_get_child_pending_on_writable(const struct lws *wsi); + +LWS_VISIBLE LWS_EXTERN void +lws_clear_child_pending_on_writable(struct lws *wsi); + +LWS_VISIBLE LWS_EXTERN int +lws_get_close_length(struct lws *wsi); + +LWS_VISIBLE LWS_EXTERN unsigned char * +lws_get_close_payload(struct lws *wsi); + +/** + * lws_get_network_wsi() - Returns wsi that has the tcp connection for this wsi + * + * \param wsi: wsi you have + * + * Returns wsi that has the tcp connection (which may be the incoming wsi) + * + * HTTP/1 connections will always return the incoming wsi + * HTTP/2 connections may return a different wsi that has the tcp connection + */ +LWS_VISIBLE LWS_EXTERN +struct lws *lws_get_network_wsi(struct lws *wsi); + +/** + * lws_set_allocator() - custom allocator support + * + * \param realloc + * + * Allows you to replace the allocator (and deallocator) used by lws + */ +LWS_VISIBLE LWS_EXTERN void +lws_set_allocator(void *(*realloc)(void *ptr, size_t size, const char *reason)); + +enum { + /* + * Flags for enable and disable rxflow with reason bitmap and with + * backwards-compatible single bool + */ + LWS_RXFLOW_REASON_USER_BOOL = (1 << 0), + LWS_RXFLOW_REASON_HTTP_RXBUFFER = (1 << 6), + LWS_RXFLOW_REASON_H2_PPS_PENDING = (1 << 7), + + LWS_RXFLOW_REASON_APPLIES = (1 << 14), + LWS_RXFLOW_REASON_APPLIES_ENABLE_BIT = (1 << 13), + LWS_RXFLOW_REASON_APPLIES_ENABLE = LWS_RXFLOW_REASON_APPLIES | + LWS_RXFLOW_REASON_APPLIES_ENABLE_BIT, + LWS_RXFLOW_REASON_APPLIES_DISABLE = LWS_RXFLOW_REASON_APPLIES, + LWS_RXFLOW_REASON_FLAG_PROCESS_NOW = (1 << 12), + +}; + +/** + * lws_rx_flow_control() - Enable and disable socket servicing for + * received packets. + * + * If the output side of a server process becomes choked, this allows flow + * control for the input side. + * + * \param wsi: Websocket connection instance to get callback for + * \param enable: 0 = disable read servicing for this connection, 1 = enable + * + * If you need more than one additive reason for rxflow control, you can give + * iLWS_RXFLOW_REASON_APPLIES_ENABLE or _DISABLE together with one or more of + * b5..b0 set to idicate which bits to enable or disable. If any bits are + * enabled, rx on the connection is suppressed. + * + * LWS_RXFLOW_REASON_FLAG_PROCESS_NOW flag may also be given to force any change + * in rxflowbstatus to benapplied immediately, this should be used when you are + * changing a wsi flow control state from outside a callback on that wsi. + */ +LWS_VISIBLE LWS_EXTERN int +lws_rx_flow_control(struct lws *wsi, int enable); + +/** + * lws_rx_flow_allow_all_protocol() - Allow all connections with this protocol to receive + * + * When the user server code realizes it can accept more input, it can + * call this to have the RX flow restriction removed from all connections using + * the given protocol. + * \param context: lws_context + * \param protocol: all connections using this protocol will be allowed to receive + */ +LWS_VISIBLE LWS_EXTERN void +lws_rx_flow_allow_all_protocol(const struct lws_context *context, + const struct lws_protocols *protocol); + +/** + * lws_remaining_packet_payload() - Bytes to come before "overall" + * rx fragment is complete + * \param wsi: Websocket instance (available from user callback) + * + * This tracks how many bytes are left in the current ws fragment, according + * to the ws length given in the fragment header. + * + * If the message was in a single fragment, and there is no compression, this + * is the same as "how much data is left to read for this message". + * + * However, if the message is being sent in multiple fragments, this will + * reflect the unread amount of the current **fragment**, not the message. With + * ws, it is legal to not know the length of the message before it completes. + * + * Additionally if the message is sent via the negotiated permessage-deflate + * extension, this number only tells the amount of **compressed** data left to + * be read, since that is the only information available at the ws layer. + */ +LWS_VISIBLE LWS_EXTERN size_t +lws_remaining_packet_payload(struct lws *wsi); + + + +/** + * lws_is_ssl() - Find out if connection is using SSL + * \param wsi: websocket connection to check + * + * Returns 0 if the connection is not using SSL, 1 if using SSL and + * using verified cert, and 2 if using SSL but the cert was not + * checked (appears for client wsi told to skip check on connection) + */ +LWS_VISIBLE LWS_EXTERN int +lws_is_ssl(struct lws *wsi); +/** + * lws_is_cgi() - find out if this wsi is running a cgi process + * \param wsi: lws connection + */ +LWS_VISIBLE LWS_EXTERN int +lws_is_cgi(struct lws *wsi); + +/** + * lws_open() - platform-specific wrapper for open that prepares the fd + * + * \param file: the filepath to open + * \param oflag: option flags + * \param mode: optional mode of any created file + * + * This is a wrapper around platform open() that sets options on the fd + * according to lws policy. Currently that is FD_CLOEXEC to stop the opened + * fd being available to any child process forked by user code. + */ +LWS_VISIBLE LWS_EXTERN int +lws_open(const char *__file, int __oflag, ...); + +struct lws_wifi_scan { /* generic wlan scan item */ + struct lws_wifi_scan *next; + char ssid[32]; + int32_t rssi; /* divide by .count to get db */ + uint8_t bssid[6]; + uint8_t count; + uint8_t channel; + uint8_t authmode; +}; + +#if defined(LWS_WITH_TLS) && !defined(LWS_WITH_MBEDTLS) +/** + * lws_get_ssl() - Return wsi's SSL context structure + * \param wsi: websocket connection + * + * Returns pointer to the SSL library's context structure + */ +LWS_VISIBLE LWS_EXTERN SSL* +lws_get_ssl(struct lws *wsi); +#endif + +/** \defgroup smtp SMTP related functions + * ##SMTP related functions + * \ingroup lwsapi + * + * These apis let you communicate with a local SMTP server to send email from + * lws. It handles all the SMTP sequencing and protocol actions. + * + * Your system should have postfix, sendmail or another MTA listening on port + * 25 and able to send email using the "mail" commandline app. Usually distro + * MTAs are configured for this by default. + * + * It runs via its own libuv events if initialized (which requires giving it + * a libuv loop to attach to). + * + * It operates using three callbacks, on_next() queries if there is a new email + * to send, on_get_body() asks for the body of the email, and on_sent() is + * called after the email is successfully sent. + * + * To use it + * + * - create an lws_email struct + * + * - initialize data, loop, the email_* strings, max_content_size and + * the callbacks + * + * - call lws_email_init() + * + * When you have at least one email to send, call lws_email_check() to + * schedule starting to send it. + */ +//@{ +#ifdef LWS_WITH_SMTP + +/** enum lwsgs_smtp_states - where we are in SMTP protocol sequence */ +enum lwsgs_smtp_states { + LGSSMTP_IDLE, /**< awaiting new email */ + LGSSMTP_CONNECTING, /**< opening tcp connection to MTA */ + LGSSMTP_CONNECTED, /**< tcp connection to MTA is connected */ + LGSSMTP_SENT_HELO, /**< sent the HELO */ + LGSSMTP_SENT_FROM, /**< sent FROM */ + LGSSMTP_SENT_TO, /**< sent TO */ + LGSSMTP_SENT_DATA, /**< sent DATA request */ + LGSSMTP_SENT_BODY, /**< sent the email body */ + LGSSMTP_SENT_QUIT, /**< sent the session quit */ +}; + +/** struct lws_email - abstract context for performing SMTP operations */ +struct lws_email { + void *data; + /**< opaque pointer set by user code and available to the callbacks */ + uv_loop_t *loop; + /**< the libuv loop we will work on */ + + char email_smtp_ip[32]; /**< Fill before init, eg, "127.0.0.1" */ + char email_helo[32]; /**< Fill before init, eg, "myserver.com" */ + char email_from[100]; /**< Fill before init or on_next */ + char email_to[100]; /**< Fill before init or on_next */ + + unsigned int max_content_size; + /**< largest possible email body size */ + + /* Fill all the callbacks before init */ + + int (*on_next)(struct lws_email *email); + /**< (Fill in before calling lws_email_init) + * called when idle, 0 = another email to send, nonzero is idle. + * If you return 0, all of the email_* char arrays must be set + * to something useful. */ + int (*on_sent)(struct lws_email *email); + /**< (Fill in before calling lws_email_init) + * called when transfer of the email to the SMTP server was + * successful, your callback would remove the current email + * from its queue */ + int (*on_get_body)(struct lws_email *email, char *buf, int len); + /**< (Fill in before calling lws_email_init) + * called when the body part of the queued email is about to be + * sent to the SMTP server. */ + + + /* private things */ + uv_timer_t timeout_email; /**< private */ + enum lwsgs_smtp_states estate; /**< private */ + uv_connect_t email_connect_req; /**< private */ + uv_tcp_t email_client; /**< private */ + time_t email_connect_started; /**< private */ + char email_buf[256]; /**< private */ + char *content; /**< private */ +}; + +/** + * lws_email_init() - Initialize a struct lws_email + * + * \param email: struct lws_email to init + * \param loop: libuv loop to use + * \param max_content: max email content size + * + * Prepares a struct lws_email for use ending SMTP + */ +LWS_VISIBLE LWS_EXTERN int +lws_email_init(struct lws_email *email, uv_loop_t *loop, int max_content); + +/** + * lws_email_check() - Request check for new email + * + * \param email: struct lws_email context to check + * + * Schedules a check for new emails in 1s... call this when you have queued an + * email for send. + */ +LWS_VISIBLE LWS_EXTERN void +lws_email_check(struct lws_email *email); +/** + * lws_email_destroy() - stop using the struct lws_email + * + * \param email: the struct lws_email context + * + * Stop sending email using email and free allocations + */ +LWS_VISIBLE LWS_EXTERN void +lws_email_destroy(struct lws_email *email); + +#endif +//@} + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-network-helper.h b/thirdparty/libwebsockets/include/libwebsockets/lws-network-helper.h new file mode 100644 index 0000000000..94ee8d9a5d --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-network-helper.h @@ -0,0 +1,105 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup net Network related helper APIs + * ##Network related helper APIs + * + * These wrap miscellaneous useful network-related functions + */ +///@{ + +/** + * lws_canonical_hostname() - returns this host's hostname + * + * This is typically used by client code to fill in the host parameter + * when making a client connection. You can only call it after the context + * has been created. + * + * \param context: Websocket context + */ +LWS_VISIBLE LWS_EXTERN const char * LWS_WARN_UNUSED_RESULT +lws_canonical_hostname(struct lws_context *context); + +/** + * lws_get_peer_addresses() - Get client address information + * \param wsi: Local struct lws associated with + * \param fd: Connection socket descriptor + * \param name: Buffer to take client address name + * \param name_len: Length of client address name buffer + * \param rip: Buffer to take client address IP dotted quad + * \param rip_len: Length of client address IP buffer + * + * This function fills in name and rip with the name and IP of + * the client connected with socket descriptor fd. Names may be + * truncated if there is not enough room. If either cannot be + * determined, they will be returned as valid zero-length strings. + */ +LWS_VISIBLE LWS_EXTERN void +lws_get_peer_addresses(struct lws *wsi, lws_sockfd_type fd, char *name, + int name_len, char *rip, int rip_len); + +/** + * lws_get_peer_simple() - Get client address information without RDNS + * + * \param wsi: Local struct lws associated with + * \param name: Buffer to take client address name + * \param namelen: Length of client address name buffer + * + * This provides a 123.123.123.123 type IP address in name from the + * peer that has connected to wsi + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_get_peer_simple(struct lws *wsi, char *name, int namelen); + +#define LWS_ITOSA_USABLE 0 +#define LWS_ITOSA_NOT_EXIST -1 +#define LWS_ITOSA_NOT_USABLE -2 +#define LWS_ITOSA_BUSY -3 /* only returned by lws_socket_bind() on + EADDRINUSE */ + +#if !defined(LWS_WITH_ESP32) +/** + * lws_interface_to_sa() - Convert interface name or IP to sockaddr struct + * + * \param ipv6: Allow IPV6 addresses + * \param ifname: Interface name or IP + * \param addr: struct sockaddr_in * to be written + * \param addrlen: Length of addr + * + * This converts a textual network interface name to a sockaddr usable by + * other network functions. + * + * If the network interface doesn't exist, it will return LWS_ITOSA_NOT_EXIST. + * + * If the network interface is not usable, eg ethernet cable is removed, it + * may logically exist but not have any IP address. As such it will return + * LWS_ITOSA_NOT_USABLE. + * + * If the network interface exists and is usable, it will return + * LWS_ITOSA_USABLE. + */ +LWS_VISIBLE LWS_EXTERN int +lws_interface_to_sa(int ipv6, const char *ifname, struct sockaddr_in *addr, + size_t addrlen); +#endif +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-plugin-generic-sessions.h b/thirdparty/libwebsockets/include/libwebsockets/lws-plugin-generic-sessions.h new file mode 100644 index 0000000000..7f46f854ec --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-plugin-generic-sessions.h @@ -0,0 +1,74 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup generic-sessions plugin: generic-sessions + * \ingroup Protocols-and-Plugins + * + * ##Plugin Generic-sessions related + * + * generic-sessions plugin provides a reusable, generic session and login / + * register / forgot password framework including email verification. + */ +///@{ + +#define LWSGS_EMAIL_CONTENT_SIZE 16384 +/**< Maximum size of email we might send */ + +/* SHA-1 binary and hexified versions */ +/** typedef struct lwsgw_hash_bin */ +typedef struct { unsigned char bin[20]; /**< binary representation of hash */} lwsgw_hash_bin; +/** typedef struct lwsgw_hash */ +typedef struct { char id[41]; /**< ascii hex representation of hash */ } lwsgw_hash; + +/** enum lwsgs_auth_bits */ +enum lwsgs_auth_bits { + LWSGS_AUTH_LOGGED_IN = 1, /**< user is logged in as somebody */ + LWSGS_AUTH_ADMIN = 2, /**< logged in as the admin user */ + LWSGS_AUTH_VERIFIED = 4, /**< user has verified his email */ + LWSGS_AUTH_FORGOT_FLOW = 8, /**< just completed "forgot password" */ +}; + +/** struct lws_session_info - information about user session status */ +struct lws_session_info { + char username[32]; /**< username logged in as, or empty string */ + char email[100]; /**< email address associated with login, or empty string */ + char ip[72]; /**< ip address session was started from */ + unsigned int mask; /**< access rights mask associated with session + * see enum lwsgs_auth_bits */ + char session[42]; /**< session id string, usable as opaque uid when not logged in */ +}; + +/** enum lws_gs_event */ +enum lws_gs_event { + LWSGSE_CREATED, /**< a new user was created */ + LWSGSE_DELETED /**< an existing user was deleted */ +}; + +/** struct lws_gs_event_args */ +struct lws_gs_event_args { + enum lws_gs_event event; /**< which event happened */ + const char *username; /**< which username the event happened to */ + const char *email; /**< the email address of that user */ +}; + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-protocols-plugins.h b/thirdparty/libwebsockets/include/libwebsockets/lws-protocols-plugins.h new file mode 100644 index 0000000000..b6cc44e27f --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-protocols-plugins.h @@ -0,0 +1,229 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup Protocols-and-Plugins Protocols and Plugins + * \ingroup lwsapi + * + * ##Protocol and protocol plugin -related apis + * + * Protocols bind ws protocol names to a custom callback specific to that + * protocol implementaion. + * + * A list of protocols can be passed in at context creation time, but it is + * also legal to leave that NULL and add the protocols and their callback code + * using plugins. + * + * Plugins are much preferable compared to cut and pasting code into an + * application each time, since they can be used standalone. + */ +///@{ +/** struct lws_protocols - List of protocols and handlers client or server + * supports. */ + +struct lws_protocols { + const char *name; + /**< Protocol name that must match the one given in the client + * Javascript new WebSocket(url, 'protocol') name. */ + lws_callback_function *callback; + /**< The service callback used for this protocol. It allows the + * service action for an entire protocol to be encapsulated in + * the protocol-specific callback */ + size_t per_session_data_size; + /**< Each new connection using this protocol gets + * this much memory allocated on connection establishment and + * freed on connection takedown. A pointer to this per-connection + * allocation is passed into the callback in the 'user' parameter */ + size_t rx_buffer_size; + /**< lws allocates this much space for rx data and informs callback + * when something came. Due to rx flow control, the callback may not + * be able to consume it all without having to return to the event + * loop. That is supported in lws. + * + * If .tx_packet_size is 0, this also controls how much may be sent at + * once for backwards compatibility. + */ + unsigned int id; + /**< ignored by lws, but useful to contain user information bound + * to the selected protocol. For example if this protocol was + * called "myprotocol-v2", you might set id to 2, and the user + * code that acts differently according to the version can do so by + * switch (wsi->protocol->id), user code might use some bits as + * capability flags based on selected protocol version, etc. */ + void *user; /**< ignored by lws, but user code can pass a pointer + here it can later access from the protocol callback */ + size_t tx_packet_size; + /**< 0 indicates restrict send() size to .rx_buffer_size for backwards- + * compatibility. + * If greater than zero, a single send() is restricted to this amount + * and any remainder is buffered by lws and sent afterwards also in + * these size chunks. Since that is expensive, it's preferable + * to restrict one fragment you are trying to send to match this + * size. + */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility */ +}; + +/** + * lws_vhost_name_to_protocol() - get vhost's protocol object from its name + * + * \param vh: vhost to search + * \param name: protocol name + * + * Returns NULL or a pointer to the vhost's protocol of the requested name + */ +LWS_VISIBLE LWS_EXTERN const struct lws_protocols * +lws_vhost_name_to_protocol(struct lws_vhost *vh, const char *name); + +/** + * lws_get_protocol() - Returns a protocol pointer from a websocket + * connection. + * \param wsi: pointer to struct websocket you want to know the protocol of + * + * + * Some apis can act on all live connections of a given protocol, + * this is how you can get a pointer to the active protocol if needed. + */ +LWS_VISIBLE LWS_EXTERN const struct lws_protocols * +lws_get_protocol(struct lws *wsi); + +/** lws_protocol_get() - deprecated: use lws_get_protocol */ +LWS_VISIBLE LWS_EXTERN const struct lws_protocols * +lws_protocol_get(struct lws *wsi) LWS_WARN_DEPRECATED; + +/** + * lws_protocol_vh_priv_zalloc() - Allocate and zero down a protocol's per-vhost + * storage + * \param vhost: vhost the instance is related to + * \param prot: protocol the instance is related to + * \param size: bytes to allocate + * + * Protocols often find it useful to allocate a per-vhost struct, this is a + * helper to be called in the per-vhost init LWS_CALLBACK_PROTOCOL_INIT + */ +LWS_VISIBLE LWS_EXTERN void * +lws_protocol_vh_priv_zalloc(struct lws_vhost *vhost, + const struct lws_protocols *prot, int size); + +/** + * lws_protocol_vh_priv_get() - retreive a protocol's per-vhost storage + * + * \param vhost: vhost the instance is related to + * \param prot: protocol the instance is related to + * + * Recover a pointer to the allocated per-vhost storage for the protocol created + * by lws_protocol_vh_priv_zalloc() earlier + */ +LWS_VISIBLE LWS_EXTERN void * +lws_protocol_vh_priv_get(struct lws_vhost *vhost, + const struct lws_protocols *prot); + +/** + * lws_adjust_protocol_psds - change a vhost protocol's per session data size + * + * \param wsi: a connection with the protocol to change + * \param new_size: the new size of the per session data size for the protocol + * + * Returns user_space for the wsi, after allocating + * + * This should not be used except to initalize a vhost protocol's per session + * data size one time, before any connections are accepted. + * + * Sometimes the protocol wraps another protocol and needs to discover and set + * its per session data size at runtime. + */ +LWS_VISIBLE LWS_EXTERN void * +lws_adjust_protocol_psds(struct lws *wsi, size_t new_size); + +/** + * lws_finalize_startup() - drop initial process privileges + * + * \param context: lws context + * + * This is called after the end of the vhost protocol initializations, but + * you may choose to call it earlier + */ +LWS_VISIBLE LWS_EXTERN int +lws_finalize_startup(struct lws_context *context); + +/** + * lws_pvo_search() - helper to find a named pvo in a linked-list + * + * \param pvo: the first pvo in the linked-list + * \param name: the name of the pvo to return if found + * + * Returns NULL, or a pointer to the name pvo in the linked-list + */ +LWS_VISIBLE LWS_EXTERN const struct lws_protocol_vhost_options * +lws_pvo_search(const struct lws_protocol_vhost_options *pvo, const char *name); + +/** + * lws_pvo_get_str() - retreive a string pvo value + * + * \param pvo: the first pvo in the linked-list + * \param name: the name of the pvo to return if found + * \param result: pointer to a const char * to get the result if any + * + * Returns 0 if found and *result set, or nonzero if not found + */ +LWS_VISIBLE LWS_EXTERN int +lws_pvo_get_str(void *in, const char *name, const char **result); + +LWS_VISIBLE LWS_EXTERN int +lws_protocol_init(struct lws_context *context); + +#ifdef LWS_WITH_PLUGINS + +/* PLUGINS implies LIBUV */ + +#define LWS_PLUGIN_API_MAGIC 180 + +/** struct lws_plugin_capability - how a plugin introduces itself to lws */ +struct lws_plugin_capability { + unsigned int api_magic; /**< caller fills this in, plugin fills rest */ + const struct lws_protocols *protocols; /**< array of supported protocols provided by plugin */ + int count_protocols; /**< how many protocols */ + const struct lws_extension *extensions; /**< array of extensions provided by plugin */ + int count_extensions; /**< how many extensions */ +}; + +typedef int (*lws_plugin_init_func)(struct lws_context *, + struct lws_plugin_capability *); +typedef int (*lws_plugin_destroy_func)(struct lws_context *); + +/** struct lws_plugin */ +struct lws_plugin { + struct lws_plugin *list; /**< linked list */ +#if (UV_VERSION_MAJOR > 0) + uv_lib_t lib; /**< shared library pointer */ +#else + void *l; /**< so we can compile on ancient libuv */ +#endif + char name[64]; /**< name of the plugin */ + struct lws_plugin_capability caps; /**< plugin capabilities */ +}; + +#endif + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-purify.h b/thirdparty/libwebsockets/include/libwebsockets/lws-purify.h new file mode 100644 index 0000000000..0ae35ce33c --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-purify.h @@ -0,0 +1,81 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + + +/*! \defgroup pur Sanitize / purify SQL and JSON helpers + * + * ##Sanitize / purify SQL and JSON helpers + * + * APIs for escaping untrusted JSON and SQL safely before use + */ +//@{ + +/** + * lws_sql_purify() - like strncpy but with escaping for sql quotes + * + * \param escaped: output buffer + * \param string: input buffer ('/0' terminated) + * \param len: output buffer max length + * + * Because escaping expands the output string, it's not + * possible to do it in-place, ie, with escaped == string + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_sql_purify(char *escaped, const char *string, int len); + +/** + * lws_json_purify() - like strncpy but with escaping for json chars + * + * \param escaped: output buffer + * \param string: input buffer ('/0' terminated) + * \param len: output buffer max length + * + * Because escaping expands the output string, it's not + * possible to do it in-place, ie, with escaped == string + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_json_purify(char *escaped, const char *string, int len); + +/** + * lws_filename_purify_inplace() - replace scary filename chars with underscore + * + * \param filename: filename to be purified + * + * Replace scary characters in the filename (it should not be a path) + * with underscore, so it's safe to use. + */ +LWS_VISIBLE LWS_EXTERN void +lws_filename_purify_inplace(char *filename); + +LWS_VISIBLE LWS_EXTERN int +lws_plat_write_cert(struct lws_vhost *vhost, int is_key, int fd, void *buf, + int len); +LWS_VISIBLE LWS_EXTERN int +lws_plat_write_file(const char *filename, void *buf, int len); + +LWS_VISIBLE LWS_EXTERN int +lws_plat_read_file(const char *filename, void *buf, int len); + +LWS_VISIBLE LWS_EXTERN int +lws_plat_recommended_rsa_bits(void); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-ring.h b/thirdparty/libwebsockets/include/libwebsockets/lws-ring.h new file mode 100644 index 0000000000..9a5ec2e10b --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-ring.h @@ -0,0 +1,305 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup lws_ring LWS Ringbuffer APIs + * ##lws_ring: generic ringbuffer struct + * + * Provides an abstract ringbuffer api supporting one head and one or an + * unlimited number of tails. + * + * All of the members are opaque and manipulated by lws_ring_...() apis. + * + * The lws_ring and its buffer is allocated at runtime on the heap, using + * + * - lws_ring_create() + * - lws_ring_destroy() + * + * It may contain any type, the size of the "element" stored in the ring + * buffer and the number of elements is given at creation time. + * + * When you create the ringbuffer, you can optionally provide an element + * destroy callback that frees any allocations inside the element. This is then + * automatically called for elements with no tail behind them, ie, elements + * which don't have any pending consumer are auto-freed. + * + * Whole elements may be inserted into the ringbuffer and removed from it, using + * + * - lws_ring_insert() + * - lws_ring_consume() + * + * You can find out how many whole elements are free or waiting using + * + * - lws_ring_get_count_free_elements() + * - lws_ring_get_count_waiting_elements() + * + * In addition there are special purpose optional byte-centric apis + * + * - lws_ring_next_linear_insert_range() + * - lws_ring_bump_head() + * + * which let you, eg, read() directly into the ringbuffer without needing + * an intermediate bounce buffer. + * + * The accessors understand that the ring wraps, and optimizes insertion and + * consumption into one or two memcpy()s depending on if the head or tail + * wraps. + * + * lws_ring only supports a single head, but optionally multiple tails with + * an API to inform it when the "oldest" tail has moved on. You can give + * NULL where-ever an api asks for a tail pointer, and it will use an internal + * single tail pointer for convenience. + * + * The "oldest tail", which is the only tail if you give it NULL instead of + * some other tail, is used to track which elements in the ringbuffer are + * still unread by anyone. + * + * - lws_ring_update_oldest_tail() + */ +///@{ +struct lws_ring; + +/** + * lws_ring_create(): create a new ringbuffer + * + * \param element_len: the size in bytes of one element in the ringbuffer + * \param count: the number of elements the ringbuffer can contain + * \param destroy_element: NULL, or callback to be called for each element + * that is removed from the ringbuffer due to the + * oldest tail moving beyond it + * + * Creates the ringbuffer and allocates the storage. Returns the new + * lws_ring *, or NULL if the allocation failed. + * + * If non-NULL, destroy_element will get called back for every element that is + * retired from the ringbuffer after the oldest tail has gone past it, and for + * any element still left in the ringbuffer when it is destroyed. It replaces + * all other element destruction code in your user code. + */ +LWS_VISIBLE LWS_EXTERN struct lws_ring * +lws_ring_create(size_t element_len, size_t count, + void (*destroy_element)(void *element)); + +/** + * lws_ring_destroy(): destroy a previously created ringbuffer + * + * \param ring: the struct lws_ring to destroy + * + * Destroys the ringbuffer allocation and the struct lws_ring itself. + */ +LWS_VISIBLE LWS_EXTERN void +lws_ring_destroy(struct lws_ring *ring); + +/** + * lws_ring_get_count_free_elements(): return how many elements can fit + * in the free space + * + * \param ring: the struct lws_ring to report on + * + * Returns how much room is left in the ringbuffer for whole element insertion. + */ +LWS_VISIBLE LWS_EXTERN size_t +lws_ring_get_count_free_elements(struct lws_ring *ring); + +/** + * lws_ring_get_count_waiting_elements(): return how many elements can be consumed + * + * \param ring: the struct lws_ring to report on + * \param tail: a pointer to the tail struct to use, or NULL for single tail + * + * Returns how many elements are waiting to be consumed from the perspective + * of the tail pointer given. + */ +LWS_VISIBLE LWS_EXTERN size_t +lws_ring_get_count_waiting_elements(struct lws_ring *ring, uint32_t *tail); + +/** + * lws_ring_insert(): attempt to insert up to max_count elements from src + * + * \param ring: the struct lws_ring to report on + * \param src: the array of elements to be inserted + * \param max_count: the number of available elements at src + * + * Attempts to insert as many of the elements at src as possible, up to the + * maximum max_count. Returns the number of elements actually inserted. + */ +LWS_VISIBLE LWS_EXTERN size_t +lws_ring_insert(struct lws_ring *ring, const void *src, size_t max_count); + +/** + * lws_ring_consume(): attempt to copy out and remove up to max_count elements + * to src + * + * \param ring: the struct lws_ring to report on + * \param tail: a pointer to the tail struct to use, or NULL for single tail + * \param dest: the array of elements to be inserted. or NULL for no copy + * \param max_count: the number of available elements at src + * + * Attempts to copy out as many waiting elements as possible into dest, from + * the perspective of the given tail, up to max_count. If dest is NULL, the + * copying out is not done but the elements are logically consumed as usual. + * NULL dest is useful in combination with lws_ring_get_element(), where you + * can use the element direct from the ringbuffer and then call this with NULL + * dest to logically consume it. + * + * Increments the tail position according to how many elements could be + * consumed. + * + * Returns the number of elements consumed. + */ +LWS_VISIBLE LWS_EXTERN size_t +lws_ring_consume(struct lws_ring *ring, uint32_t *tail, void *dest, + size_t max_count); + +/** + * lws_ring_get_element(): get a pointer to the next waiting element for tail + * + * \param ring: the struct lws_ring to report on + * \param tail: a pointer to the tail struct to use, or NULL for single tail + * + * Points to the next element that tail would consume, directly in the + * ringbuffer. This lets you write() or otherwise use the element without + * having to copy it out somewhere first. + * + * After calling this, you must call lws_ring_consume(ring, &tail, NULL, 1) + * which will logically consume the element you used up and increment your + * tail (tail may also be NULL there if you use a single tail). + * + * Returns NULL if no waiting element, or a const void * pointing to it. + */ +LWS_VISIBLE LWS_EXTERN const void * +lws_ring_get_element(struct lws_ring *ring, uint32_t *tail); + +/** + * lws_ring_update_oldest_tail(): free up elements older than tail for reuse + * + * \param ring: the struct lws_ring to report on + * \param tail: a pointer to the tail struct to use, or NULL for single tail + * + * If you are using multiple tails, you must use this API to inform the + * lws_ring when none of the tails still need elements in the fifo any more, + * by updating it when the "oldest" tail has moved on. + */ +LWS_VISIBLE LWS_EXTERN void +lws_ring_update_oldest_tail(struct lws_ring *ring, uint32_t tail); + +/** + * lws_ring_get_oldest_tail(): get current oldest available data index + * + * \param ring: the struct lws_ring to report on + * + * If you are initializing a new ringbuffer consumer, you can set its tail to + * this to start it from the oldest ringbuffer entry still available. + */ +LWS_VISIBLE LWS_EXTERN uint32_t +lws_ring_get_oldest_tail(struct lws_ring *ring); + +/** + * lws_ring_next_linear_insert_range(): used to write directly into the ring + * + * \param ring: the struct lws_ring to report on + * \param start: pointer to a void * set to the start of the next ringbuffer area + * \param bytes: pointer to a size_t set to the max length you may use from *start + * + * This provides a low-level, bytewise access directly into the ringbuffer + * allowing direct insertion of data without having to use a bounce buffer. + * + * The api reports the position and length of the next linear range that can + * be written in the ringbuffer, ie, up to the point it would wrap, and sets + * *start and *bytes accordingly. You can then, eg, directly read() into + * *start for up to *bytes, and use lws_ring_bump_head() to update the lws_ring + * with what you have done. + * + * Returns nonzero if no insertion is currently possible. + */ +LWS_VISIBLE LWS_EXTERN int +lws_ring_next_linear_insert_range(struct lws_ring *ring, void **start, + size_t *bytes); + +/** + * lws_ring_bump_head(): used to write directly into the ring + * + * \param ring: the struct lws_ring to operate on + * \param bytes: the number of bytes you inserted at the current head + */ +LWS_VISIBLE LWS_EXTERN void +lws_ring_bump_head(struct lws_ring *ring, size_t bytes); + +LWS_VISIBLE LWS_EXTERN void +lws_ring_dump(struct lws_ring *ring, uint32_t *tail); + +/* + * This is a helper that combines the common pattern of needing to consume + * some ringbuffer elements, move the consumer tail on, and check if that + * has moved any ringbuffer elements out of scope, because it was the last + * consumer that had not already consumed them. + * + * Elements that go out of scope because the oldest tail is now after them + * get garbage-collected by calling the destroy_element callback on them + * defined when the ringbuffer was created. + */ + +#define lws_ring_consume_and_update_oldest_tail(\ + ___ring, /* the lws_ring object */ \ + ___type, /* type of objects with tails */ \ + ___ptail, /* ptr to tail of obj with tail doing consuming */ \ + ___count, /* count of payload objects being consumed */ \ + ___list_head, /* head of list of objects with tails */ \ + ___mtail, /* member name of tail in ___type */ \ + ___mlist /* member name of next list member ptr in ___type */ \ + ) { \ + int ___n, ___m; \ + \ + ___n = lws_ring_get_oldest_tail(___ring) == *(___ptail); \ + lws_ring_consume(___ring, ___ptail, NULL, ___count); \ + if (___n) { \ + uint32_t ___oldest; \ + ___n = 0; \ + ___oldest = *(___ptail); \ + lws_start_foreach_llp(___type **, ___ppss, ___list_head) { \ + ___m = lws_ring_get_count_waiting_elements( \ + ___ring, &(*___ppss)->tail); \ + if (___m >= ___n) { \ + ___n = ___m; \ + ___oldest = (*___ppss)->tail; \ + } \ + } lws_end_foreach_llp(___ppss, ___mlist); \ + \ + lws_ring_update_oldest_tail(___ring, ___oldest); \ + } \ +} + +/* + * This does the same as the lws_ring_consume_and_update_oldest_tail() + * helper, but for the simpler case there is only one consumer, so one + * tail, and that tail is always the oldest tail. + */ + +#define lws_ring_consume_single_tail(\ + ___ring, /* the lws_ring object */ \ + ___ptail, /* ptr to tail of obj with tail doing consuming */ \ + ___count /* count of payload objects being consumed */ \ + ) { \ + lws_ring_consume(___ring, ___ptail, NULL, ___count); \ + lws_ring_update_oldest_tail(___ring, *(___ptail)); \ +} +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-service.h b/thirdparty/libwebsockets/include/libwebsockets/lws-service.h new file mode 100644 index 0000000000..f4109f0431 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-service.h @@ -0,0 +1,215 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup service Built-in service loop entry + * + * ##Built-in service loop entry + * + * If you're not using libev / libuv, these apis are needed to enter the poll() + * wait in lws and service any connections with pending events. + */ +///@{ + +/** + * lws_service() - Service any pending websocket activity + * \param context: Websocket context + * \param timeout_ms: Timeout for poll; 0 means return immediately if nothing needed + * service otherwise block and service immediately, returning + * after the timeout if nothing needed service. + * + * This function deals with any pending websocket traffic, for three + * kinds of event. It handles these events on both server and client + * types of connection the same. + * + * 1) Accept new connections to our context's server + * + * 2) Call the receive callback for incoming frame data received by + * server or client connections. + * + * You need to call this service function periodically to all the above + * functions to happen; if your application is single-threaded you can + * just call it in your main event loop. + * + * Alternatively you can fork a new process that asynchronously handles + * calling this service in a loop. In that case you are happy if this + * call blocks your thread until it needs to take care of something and + * would call it with a large nonzero timeout. Your loop then takes no + * CPU while there is nothing happening. + * + * If you are calling it in a single-threaded app, you don't want it to + * wait around blocking other things in your loop from happening, so you + * would call it with a timeout_ms of 0, so it returns immediately if + * nothing is pending, or as soon as it services whatever was pending. + */ +LWS_VISIBLE LWS_EXTERN int +lws_service(struct lws_context *context, int timeout_ms); + +/** + * lws_service_tsi() - Service any pending websocket activity + * + * \param context: Websocket context + * \param timeout_ms: Timeout for poll; 0 means return immediately if nothing needed + * service otherwise block and service immediately, returning + * after the timeout if nothing needed service. + * \param tsi: Thread service index, starting at 0 + * + * Same as lws_service(), but for a specific thread service index. Only needed + * if you are spawning multiple service threads. + */ +LWS_VISIBLE LWS_EXTERN int +lws_service_tsi(struct lws_context *context, int timeout_ms, int tsi); + +/** + * lws_cancel_service_pt() - Cancel servicing of pending socket activity + * on one thread + * \param wsi: Cancel service on the thread this wsi is serviced by + * + * Same as lws_cancel_service(), but targets a single service thread, the one + * the wsi belongs to. You probably want to use lws_cancel_service() instead. + */ +LWS_VISIBLE LWS_EXTERN void +lws_cancel_service_pt(struct lws *wsi); + +/** + * lws_cancel_service() - Cancel wait for new pending socket activity + * \param context: Websocket context + * + * This function creates an immediate "synchronous interrupt" to the lws poll() + * wait or event loop. As soon as possible in the serialzed service sequencing, + * a LWS_CALLBACK_EVENT_WAIT_CANCELLED callback is sent to every protocol on + * every vhost. + * + * lws_cancel_service() may be called from another thread while the context + * exists, and its effect will be immediately serialized. + */ +LWS_VISIBLE LWS_EXTERN void +lws_cancel_service(struct lws_context *context); + +/** + * lws_service_fd() - Service polled socket with something waiting + * \param context: Websocket context + * \param pollfd: The pollfd entry describing the socket fd and which events + * happened, or NULL to tell lws to do only timeout servicing. + * + * This function takes a pollfd that has POLLIN or POLLOUT activity and + * services it according to the state of the associated + * struct lws. + * + * The one call deals with all "service" that might happen on a socket + * including listen accepts, http files as well as websocket protocol. + * + * If a pollfd says it has something, you can just pass it to + * lws_service_fd() whether it is a socket handled by lws or not. + * If it sees it is a lws socket, the traffic will be handled and + * pollfd->revents will be zeroed now. + * + * If the socket is foreign to lws, it leaves revents alone. So you can + * see if you should service yourself by checking the pollfd revents + * after letting lws try to service it. + * + * You should also call this with pollfd = NULL to just allow the + * once-per-second global timeout checks; if less than a second since the last + * check it returns immediately then. + */ +LWS_VISIBLE LWS_EXTERN int +lws_service_fd(struct lws_context *context, struct lws_pollfd *pollfd); + +/** + * lws_service_fd_tsi() - Service polled socket in specific service thread + * \param context: Websocket context + * \param pollfd: The pollfd entry describing the socket fd and which events + * happened. + * \param tsi: thread service index + * + * Same as lws_service_fd() but used with multiple service threads + */ +LWS_VISIBLE LWS_EXTERN int +lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, + int tsi); + +/** + * lws_service_adjust_timeout() - Check for any connection needing forced service + * \param context: Websocket context + * \param timeout_ms: The original poll timeout value. You can just set this + * to 1 if you don't really have a poll timeout. + * \param tsi: thread service index + * + * Under some conditions connections may need service even though there is no + * pending network action on them, this is "forced service". For default + * poll() and libuv / libev, the library takes care of calling this and + * dealing with it for you. But for external poll() integration, you need + * access to the apis. + * + * If anybody needs "forced service", returned timeout is zero. In that case, + * you can call lws_service_tsi() with a timeout of -1 to only service + * guys who need forced service. + */ +LWS_VISIBLE LWS_EXTERN int +lws_service_adjust_timeout(struct lws_context *context, int timeout_ms, int tsi); + +/* Backwards compatibility */ +#define lws_plat_service_tsi lws_service_tsi + +LWS_VISIBLE LWS_EXTERN int +lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd); + +///@} + +/*! \defgroup uv libuv helpers + * + * ##libuv helpers + * + * APIs specific to libuv event loop itegration + */ +///@{ +#ifdef LWS_WITH_LIBUV +/* + * Any direct libuv allocations in lws protocol handlers must participate in the + * lws reference counting scheme. Two apis are provided: + * + * - lws_libuv_static_refcount_add(handle, context) to mark the handle with + * a pointer to the context and increment the global uv object counter + * + * - lws_libuv_static_refcount_del() which should be used as the close callback + * for your own libuv objects declared in the protocol scope. + * + * Using the apis allows lws to detach itself from a libuv loop completely + * cleanly and at the moment all of its libuv objects have completed close. + */ + +LWS_VISIBLE LWS_EXTERN uv_loop_t * +lws_uv_getloop(struct lws_context *context, int tsi); + +LWS_VISIBLE LWS_EXTERN void +lws_libuv_static_refcount_add(uv_handle_t *, struct lws_context *context); + +LWS_VISIBLE LWS_EXTERN void +lws_libuv_static_refcount_del(uv_handle_t *); + +#endif /* LWS_WITH_LIBUV */ + +#if defined(LWS_WITH_ESP32) +#define lws_libuv_static_refcount_add(_a, _b) +#define lws_libuv_static_refcount_del NULL +#endif +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-sha1-base64.h b/thirdparty/libwebsockets/include/libwebsockets/lws-sha1-base64.h new file mode 100644 index 0000000000..5a2bfdbbb0 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-sha1-base64.h @@ -0,0 +1,93 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup sha SHA and B64 helpers + * ##SHA and B64 helpers + * + * These provide SHA-1 and B64 helper apis + */ +///@{ +#ifdef LWS_SHA1_USE_OPENSSL_NAME +#define lws_SHA1 SHA1 +#else +/** + * lws_SHA1(): make a SHA-1 digest of a buffer + * + * \param d: incoming buffer + * \param n: length of incoming buffer + * \param md: buffer for message digest (must be >= 20 bytes) + * + * Reduces any size buffer into a 20-byte SHA-1 hash. + */ +LWS_VISIBLE LWS_EXTERN unsigned char * +lws_SHA1(const unsigned char *d, size_t n, unsigned char *md); +#endif +/** + * lws_b64_encode_string(): encode a string into base 64 + * + * \param in: incoming buffer + * \param in_len: length of incoming buffer + * \param out: result buffer + * \param out_size: length of result buffer + * + * Encodes a string using b64 + */ +LWS_VISIBLE LWS_EXTERN int +lws_b64_encode_string(const char *in, int in_len, char *out, int out_size); +/** + * lws_b64_encode_string_url(): encode a string into base 64 + * + * \param in: incoming buffer + * \param in_len: length of incoming buffer + * \param out: result buffer + * \param out_size: length of result buffer + * + * Encodes a string using b64 with the "URL" variant (+ -> -, and / -> _) + */ +LWS_VISIBLE LWS_EXTERN int +lws_b64_encode_string_url(const char *in, int in_len, char *out, int out_size); +/** + * lws_b64_decode_string(): decode a string from base 64 + * + * \param in: incoming buffer + * \param out: result buffer + * \param out_size: length of result buffer + * + * Decodes a NUL-terminated string using b64 + */ +LWS_VISIBLE LWS_EXTERN int +lws_b64_decode_string(const char *in, char *out, int out_size); +/** + * lws_b64_decode_string_len(): decode a string from base 64 + * + * \param in: incoming buffer + * \param in_len: length of incoming buffer + * \param out: result buffer + * \param out_size: length of result buffer + * + * Decodes a range of chars using b64 + */ +LWS_VISIBLE LWS_EXTERN int +lws_b64_decode_string_len(const char *in, int in_len, char *out, int out_size); +///@} + diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-spa.h b/thirdparty/libwebsockets/include/libwebsockets/lws-spa.h new file mode 100644 index 0000000000..fcaf3889f5 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-spa.h @@ -0,0 +1,140 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup form-parsing Form Parsing + * \ingroup http + * ##POSTed form parsing functions + * + * These lws_spa (stateful post arguments) apis let you parse and urldecode + * POSTed form arguments, both using simple urlencoded and multipart transfer + * encoding. + * + * It's capable of handling file uploads as well a named input parsing, + * and the apis are the same for both form upload styles. + * + * You feed it a list of parameter names and it creates pointers to the + * urldecoded arguments: file upload parameters pass the file data in chunks to + * a user-supplied callback as they come. + * + * Since it's stateful, it handles the incoming data needing more than one + * POST_BODY callback and has no limit on uploaded file size. + */ +///@{ + +/** enum lws_spa_fileupload_states */ +enum lws_spa_fileupload_states { + LWS_UFS_CONTENT, + /**< a chunk of file content has arrived */ + LWS_UFS_FINAL_CONTENT, + /**< the last chunk (possibly zero length) of file content has arrived */ + LWS_UFS_OPEN + /**< a new file is starting to arrive */ +}; + +/** + * lws_spa_fileupload_cb() - callback to receive file upload data + * + * \param data: opt_data pointer set in lws_spa_create + * \param name: name of the form field being uploaded + * \param filename: original filename from client + * \param buf: start of data to receive + * \param len: length of data to receive + * \param state: information about how this call relates to file + * + * Notice name and filename shouldn't be trusted, as they are passed from + * HTTP provided by the client. + */ +typedef int (*lws_spa_fileupload_cb)(void *data, const char *name, + const char *filename, char *buf, int len, + enum lws_spa_fileupload_states state); + +/** struct lws_spa - opaque urldecode parser capable of handling multipart + * and file uploads */ +struct lws_spa; + +/** + * lws_spa_create() - create urldecode parser + * + * \param wsi: lws connection (used to find Content Type) + * \param param_names: array of form parameter names, like "username" + * \param count_params: count of param_names + * \param max_storage: total amount of form parameter values we can store + * \param opt_cb: NULL, or callback to receive file upload data. + * \param opt_data: NULL, or user pointer provided to opt_cb. + * + * Creates a urldecode parser and initializes it. + * + * opt_cb can be NULL if you just want normal name=value parsing, however + * if one or more entries in your form are bulk data (file transfer), you + * can provide this callback and filter on the name callback parameter to + * treat that urldecoded data separately. The callback should return -1 + * in case of fatal error, and 0 if OK. + */ +LWS_VISIBLE LWS_EXTERN struct lws_spa * +lws_spa_create(struct lws *wsi, const char * const *param_names, + int count_params, int max_storage, lws_spa_fileupload_cb opt_cb, + void *opt_data); + +/** + * lws_spa_process() - parses a chunk of input data + * + * \param spa: the parser object previously created + * \param in: incoming, urlencoded data + * \param len: count of bytes valid at \param in + */ +LWS_VISIBLE LWS_EXTERN int +lws_spa_process(struct lws_spa *spa, const char *in, int len); + +/** + * lws_spa_finalize() - indicate incoming data completed + * + * \param spa: the parser object previously created + */ +LWS_VISIBLE LWS_EXTERN int +lws_spa_finalize(struct lws_spa *spa); + +/** + * lws_spa_get_length() - return length of parameter value + * + * \param spa: the parser object previously created + * \param n: parameter ordinal to return length of value for + */ +LWS_VISIBLE LWS_EXTERN int +lws_spa_get_length(struct lws_spa *spa, int n); + +/** + * lws_spa_get_string() - return pointer to parameter value + * \param spa: the parser object previously created + * \param n: parameter ordinal to return pointer to value for + */ +LWS_VISIBLE LWS_EXTERN const char * +lws_spa_get_string(struct lws_spa *spa, int n); + +/** + * lws_spa_destroy() - destroy parser object + * + * \param spa: the parser object previously created + */ +LWS_VISIBLE LWS_EXTERN int +lws_spa_destroy(struct lws_spa *spa); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-stats.h b/thirdparty/libwebsockets/include/libwebsockets/lws-stats.h new file mode 100644 index 0000000000..b0031ca3e5 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-stats.h @@ -0,0 +1,75 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/* + * Stats are all uint64_t numbers that start at 0. + * Index names here have the convention + * + * _C_ counter + * _B_ byte count + * _MS_ millisecond count + */ + +enum { + LWSSTATS_C_CONNECTIONS, /**< count incoming connections */ + LWSSTATS_C_API_CLOSE, /**< count calls to close api */ + LWSSTATS_C_API_READ, /**< count calls to read from socket api */ + LWSSTATS_C_API_LWS_WRITE, /**< count calls to lws_write API */ + LWSSTATS_C_API_WRITE, /**< count calls to write API */ + LWSSTATS_C_WRITE_PARTIALS, /**< count of partial writes */ + LWSSTATS_C_WRITEABLE_CB_REQ, /**< count of writable callback requests */ + LWSSTATS_C_WRITEABLE_CB_EFF_REQ, /**< count of effective writable callback requests */ + LWSSTATS_C_WRITEABLE_CB, /**< count of writable callbacks */ + LWSSTATS_C_SSL_CONNECTIONS_FAILED, /**< count of failed SSL connections */ + LWSSTATS_C_SSL_CONNECTIONS_ACCEPTED, /**< count of accepted SSL connections */ + LWSSTATS_C_SSL_CONNECTIONS_ACCEPT_SPIN, /**< count of SSL_accept() attempts */ + LWSSTATS_C_SSL_CONNS_HAD_RX, /**< count of accepted SSL conns that have had some RX */ + LWSSTATS_C_TIMEOUTS, /**< count of timed-out connections */ + LWSSTATS_C_SERVICE_ENTRY, /**< count of entries to lws service loop */ + LWSSTATS_B_READ, /**< aggregate bytes read */ + LWSSTATS_B_WRITE, /**< aggregate bytes written */ + LWSSTATS_B_PARTIALS_ACCEPTED_PARTS, /**< aggreate of size of accepted write data from new partials */ + LWSSTATS_MS_SSL_CONNECTIONS_ACCEPTED_DELAY, /**< aggregate delay in accepting connection */ + LWSSTATS_MS_WRITABLE_DELAY, /**< aggregate delay between asking for writable and getting cb */ + LWSSTATS_MS_WORST_WRITABLE_DELAY, /**< single worst delay between asking for writable and getting cb */ + LWSSTATS_MS_SSL_RX_DELAY, /**< aggregate delay between ssl accept complete and first RX */ + LWSSTATS_C_PEER_LIMIT_AH_DENIED, /**< number of times we would have given an ah but for the peer limit */ + LWSSTATS_C_PEER_LIMIT_WSI_DENIED, /**< number of times we would have given a wsi but for the peer limit */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility */ + LWSSTATS_SIZE +}; + +#if defined(LWS_WITH_STATS) + +LWS_VISIBLE LWS_EXTERN uint64_t +lws_stats_get(struct lws_context *context, int index); +LWS_VISIBLE LWS_EXTERN void +lws_stats_log_dump(struct lws_context *context); +#else +static LWS_INLINE uint64_t +lws_stats_get(struct lws_context *context, int index) { (void)context; (void)index; return 0; } +static LWS_INLINE void +lws_stats_log_dump(struct lws_context *context) { (void)context; } +#endif diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-threadpool.h b/thirdparty/libwebsockets/include/libwebsockets/lws-threadpool.h new file mode 100644 index 0000000000..eb6c6e1a16 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-threadpool.h @@ -0,0 +1,231 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup threadpool Threadpool related functions + * ##Threadpool + * \ingroup lwsapi + * + * This allows you to create one or more pool of threads which can run tasks + * associated with a wsi. If the pool is busy, tasks wait on a queue. + * + * Tasks don't have to be atomic, if they will take more than a few tens of ms + * they should return back to the threadpool worker with a return of 0. This + * will allow them to abort cleanly. + */ +//@{ + +struct lws_threadpool; +struct lws_threadpool_task; + +enum lws_threadpool_task_status { + LWS_TP_STATUS_QUEUED, + LWS_TP_STATUS_RUNNING, + LWS_TP_STATUS_SYNCING, + LWS_TP_STATUS_STOPPING, + LWS_TP_STATUS_FINISHED, /* lws_threadpool_task_status() frees task */ + LWS_TP_STATUS_STOPPED, /* lws_threadpool_task_status() frees task */ +}; + +enum lws_threadpool_task_return { + /** Still work to do, just confirming not being stopped */ + LWS_TP_RETURN_CHECKING_IN, + /** Still work to do, enter cond_wait until service thread syncs. This + * is used if you have filled your buffer(s) of data to the service + * thread and are blocked until the service thread completes sending at + * least one. + */ + LWS_TP_RETURN_SYNC, + /** No more work to do... */ + LWS_TP_RETURN_FINISHED, + /** Responding to request to stop */ + LWS_TP_RETURN_STOPPED, + + /* OR on to indicate this task wishes to outlive its wsi */ + LWS_TP_RETURN_FLAG_OUTLIVE = 64 +}; + +struct lws_threadpool_create_args { + int threads; + int max_queue_depth; +}; + +struct lws_threadpool_task_args { + struct lws *wsi; /**< user must set to wsi task is bound to */ + void *user; /**< user may set (user-private pointer) */ + const char *name; /**< user may set to describe task */ + char async_task; /**< set to allow the task to shrug off the loss + of the associated wsi and continue to + completion */ + enum lws_threadpool_task_return (*task)(void *user, + enum lws_threadpool_task_status s); + /**< user must set to actual task function */ + void (*cleanup)(struct lws *wsi, void *user); + /**< socket lifecycle may end while task is not stoppable, so the task + * must be able to detach from any wsi and clean itself up when it does + * stop. If NULL, no cleanup necessary, otherwise point to a user- + * supplied function that destroys the stuff in \p user. + * + * wsi may be NULL on entry, indicating the task got detached due to the + * wsi closing before. + */ +}; + +/** + * lws_threadpool_create() - create a pool of worker threads + * + * \param context: the lws_context the threadpool will exist inside + * \param args: argument struct prepared by caller + * \param format: printf-type format for the task name + * \param ...: printf type args for the task name format + * + * Creates a pool of worker threads with \p threads and a queue of up to + * \p max_queue_depth waiting tasks if all the threads are busy. + * + * Returns NULL if OOM, or a struct lws_threadpool pointer that must be + * destroyed by lws_threadpool_destroy(). + */ +LWS_VISIBLE LWS_EXTERN struct lws_threadpool * +lws_threadpool_create(struct lws_context *context, + const struct lws_threadpool_create_args *args, + const char *format, ...) LWS_FORMAT(3); + +/** + * lws_threadpool_finish() - Stop all pending and running tasks + * + * \param tp: the threadpool object + * + * Marks the threadpool as under destruction. Removes everything from the + * pending queue and completes those tasks as LWS_TP_STATUS_STOPPED. + * + * Running tasks will also get LWS_TP_STATUS_STOPPED as soon as they + * "resurface". + * + * This doesn't reap tasks or free the threadpool, the reaping is done by the + * lws_threadpool_task_status() on the done task. + */ +LWS_VISIBLE LWS_EXTERN void +lws_threadpool_finish(struct lws_threadpool *tp); + +/** + * lws_threadpool_destroy() - Destroy a threadpool + * + * \param tp: the threadpool object + * + * Waits for all worker threads to stop, ends the threads and frees the tp. + */ +LWS_VISIBLE LWS_EXTERN void +lws_threadpool_destroy(struct lws_threadpool *tp); + +/** + * lws_threadpool_enqueue() - Queue the task and run it on a worker thread when possible + * + * \param tp: the threadpool to queue / run on + * \param args: information about what to run + * \param format: printf-type format for the task name + * \param ...: printf type args for the task name format + * + * This asks for a task to run ASAP on a worker thread in threadpool \p tp. + * + * The args defines the wsi, a user-private pointer, a timeout in secs and + * a pointer to the task function. + * + * Returns NULL or an opaque pointer to the queued (or running, or completed) + * task. + * + * Once a task is created and enqueued, it can only be destroyed by calling + * lws_threadpool_task_status() on it after it has reached the state + * LWS_TP_STATUS_FINISHED or LWS_TP_STATUS_STOPPED. + */ +LWS_VISIBLE LWS_EXTERN struct lws_threadpool_task * +lws_threadpool_enqueue(struct lws_threadpool *tp, + const struct lws_threadpool_task_args *args, + const char *format, ...) LWS_FORMAT(3); + +/** + * lws_threadpool_dequeue() - Dequeue or try to stop a running task + * + * \param wsi: the wsi whose current task we want to eliminate + * + * Returns 0 is the task was dequeued or already compeleted, or 1 if the task + * has been asked to stop asynchronously. + * + * This doesn't free the task. It only shortcuts it to state + * LWS_TP_STATUS_STOPPED. lws_threadpool_task_status() must be performed on + * the task separately once it is in LWS_TP_STATUS_STOPPED to free the task. + */ +LWS_VISIBLE LWS_EXTERN int +lws_threadpool_dequeue(struct lws *wsi); + +/** + * lws_threadpool_task_status() - Dequeue or try to stop a running task + * + * \param wsi: the wsi to query the current task of + * \param task: receives a pointer to the opaque task + * \param user: receives a void * pointer to the task user data + * + * This is the equivalent of posix waitpid()... it returns the status of the + * task, and if the task is in state LWS_TP_STATUS_FINISHED or + * LWS_TP_STATUS_STOPPED, frees \p task. If in another state, the task + * continues to exist. + * + * This is designed to be called from the service thread. + * + * Its use is to make sure the service thread has seen the state of the task + * before deleting it. + */ +LWS_VISIBLE LWS_EXTERN enum lws_threadpool_task_status +lws_threadpool_task_status_wsi(struct lws *wsi, + struct lws_threadpool_task **task, void **user); + +/** + * lws_threadpool_task_sync() - Indicate to a stalled task it may continue + * + * \param task: the task to unblock + * \param stop: 0 = run after unblock, 1 = when he unblocks, stop him + * + * Inform the task that the service thread has finished with the shared data + * and that the task, if blocked in LWS_TP_RETURN_SYNC, may continue. + * + * If the lws service context determined that the task must be aborted, it + * should still call this but with stop = 1, causing the task to finish. + */ +LWS_VISIBLE LWS_EXTERN void +lws_threadpool_task_sync(struct lws_threadpool_task *task, int stop); + +/** + * lws_threadpool_dump() - dump the state of a threadpool to the log + * + * \param tp: The threadpool to dump + * + * This locks the threadpool and then dumps the pending queue, the worker + * threads and the done queue, together with time information for how long + * the tasks have been in their current state, how long they have occupied a + * thread, etc. + * + * This only does anything on lws builds with CMAKE_BUILD_TYPE=DEBUG, otherwise + * while it still exists, it's a NOP. + */ + +LWS_VISIBLE LWS_EXTERN void +lws_threadpool_dump(struct lws_threadpool *tp); +//@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-timeout-timer.h b/thirdparty/libwebsockets/include/libwebsockets/lws-timeout-timer.h new file mode 100644 index 0000000000..e715ba15a3 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-timeout-timer.h @@ -0,0 +1,164 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup timeout Connection timeouts + + APIs related to setting connection timeouts +*/ +//@{ + +/* + * NOTE: These public enums are part of the abi. If you want to add one, + * add it at where specified so existing users are unaffected. + */ +enum pending_timeout { + NO_PENDING_TIMEOUT = 0, + PENDING_TIMEOUT_AWAITING_PROXY_RESPONSE = 1, + PENDING_TIMEOUT_AWAITING_CONNECT_RESPONSE = 2, + PENDING_TIMEOUT_ESTABLISH_WITH_SERVER = 3, + PENDING_TIMEOUT_AWAITING_SERVER_RESPONSE = 4, + PENDING_TIMEOUT_AWAITING_PING = 5, + PENDING_TIMEOUT_CLOSE_ACK = 6, + PENDING_TIMEOUT_UNUSED1 = 7, + PENDING_TIMEOUT_SENT_CLIENT_HANDSHAKE = 8, + PENDING_TIMEOUT_SSL_ACCEPT = 9, + PENDING_TIMEOUT_HTTP_CONTENT = 10, + PENDING_TIMEOUT_AWAITING_CLIENT_HS_SEND = 11, + PENDING_FLUSH_STORED_SEND_BEFORE_CLOSE = 12, + PENDING_TIMEOUT_SHUTDOWN_FLUSH = 13, + PENDING_TIMEOUT_CGI = 14, + PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE = 15, + PENDING_TIMEOUT_WS_PONG_CHECK_SEND_PING = 16, + PENDING_TIMEOUT_WS_PONG_CHECK_GET_PONG = 17, + PENDING_TIMEOUT_CLIENT_ISSUE_PAYLOAD = 18, + PENDING_TIMEOUT_AWAITING_SOCKS_GREETING_REPLY = 19, + PENDING_TIMEOUT_AWAITING_SOCKS_CONNECT_REPLY = 20, + PENDING_TIMEOUT_AWAITING_SOCKS_AUTH_REPLY = 21, + PENDING_TIMEOUT_KILLED_BY_SSL_INFO = 22, + PENDING_TIMEOUT_KILLED_BY_PARENT = 23, + PENDING_TIMEOUT_CLOSE_SEND = 24, + PENDING_TIMEOUT_HOLDING_AH = 25, + PENDING_TIMEOUT_UDP_IDLE = 26, + PENDING_TIMEOUT_CLIENT_CONN_IDLE = 27, + PENDING_TIMEOUT_LAGGING = 28, + PENDING_TIMEOUT_THREADPOOL = 29, + PENDING_TIMEOUT_THREADPOOL_TASK = 30, + PENDING_TIMEOUT_KILLED_BY_PROXY_CLIENT_CLOSE = 31, + + /****** add new things just above ---^ ******/ + + PENDING_TIMEOUT_USER_REASON_BASE = 1000 +}; + +/** + * lws_time_in_microseconds() - Returns the unix time in microseconds + */ +LWS_VISIBLE LWS_EXTERN uint64_t +lws_time_in_microseconds(void); + +#define LWS_TO_KILL_ASYNC -1 +/**< If LWS_TO_KILL_ASYNC is given as the timeout sec in a lws_set_timeout() + * call, then the connection is marked to be killed at the next timeout + * check. This is how you should force-close the wsi being serviced if + * you are doing it outside the callback (where you should close by nonzero + * return). + */ +#define LWS_TO_KILL_SYNC -2 +/**< If LWS_TO_KILL_SYNC is given as the timeout sec in a lws_set_timeout() + * call, then the connection is closed before returning (which may delete + * the wsi). This should only be used where the wsi being closed is not the + * wsi currently being serviced. + */ +/** + * lws_set_timeout() - marks the wsi as subject to a timeout + * + * You will not need this unless you are doing something special + * + * \param wsi: Websocket connection instance + * \param reason: timeout reason + * \param secs: how many seconds. You may set to LWS_TO_KILL_ASYNC to + * force the connection to timeout at the next opportunity, or + * LWS_TO_KILL_SYNC to close it synchronously if you know the + * wsi is not the one currently being serviced. + */ +LWS_VISIBLE LWS_EXTERN void +lws_set_timeout(struct lws *wsi, enum pending_timeout reason, int secs); + +#define LWS_SET_TIMER_USEC_CANCEL ((lws_usec_t)-1ll) +#define LWS_USEC_PER_SEC (1000000ll) + +/** + * lws_set_timer_usecs() - schedules a callback on the wsi in the future + * + * \param wsi: Websocket connection instance + * \param usecs: LWS_SET_TIMER_USEC_CANCEL removes any existing scheduled + * callback, otherwise number of microseconds in the future + * the callback will occur at. + * + * NOTE: event loop support for this: + * + * default poll() loop: yes + * libuv event loop: yes + * libev: not implemented (patch welcome) + * libevent: not implemented (patch welcome) + * + * After the deadline expires, the wsi will get a callback of type + * LWS_CALLBACK_TIMER and the timer is exhausted. The deadline may be + * continuously deferred by further calls to lws_set_timer_usecs() with a later + * deadline, or cancelled by lws_set_timer_usecs(wsi, -1). + * + * If the timer should repeat, lws_set_timer_usecs() must be called again from + * LWS_CALLBACK_TIMER. + * + * Accuracy depends on the platform and the load on the event loop or system... + * all that's guaranteed is the callback will come after the requested wait + * period. + */ +LWS_VISIBLE LWS_EXTERN void +lws_set_timer_usecs(struct lws *wsi, lws_usec_t usecs); + +/* + * lws_timed_callback_vh_protocol() - calls back a protocol on a vhost after + * the specified delay + * + * \param vh: the vhost to call back + * \param protocol: the protocol to call back + * \param reason: callback reason + * \param secs: how many seconds in the future to do the callback. Set to + * -1 to cancel the timer callback. + * + * Callback the specified protocol with a fake wsi pointing to the specified + * vhost and protocol, with the specified reason, at the specified time in the + * future. + * + * Returns 0 if OK. + * + * In the multithreaded service case, the callback will occur in the same + * service thread context as the call to this api that requested it. If it is + * called from a non-service thread, tsi 0 will handle it. + */ +LWS_VISIBLE LWS_EXTERN int +lws_timed_callback_vh_protocol(struct lws_vhost *vh, + const struct lws_protocols *prot, + int reason, int secs); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-tokenize.h b/thirdparty/libwebsockets/include/libwebsockets/lws-tokenize.h new file mode 100644 index 0000000000..26a57dfbaf --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-tokenize.h @@ -0,0 +1,136 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/* Do not treat - as a terminal character, so "my-token" is one token */ +#define LWS_TOKENIZE_F_MINUS_NONTERM (1 << 0) +/* Separately report aggregate colon-delimited tokens */ +#define LWS_TOKENIZE_F_AGG_COLON (1 << 1) +/* Enforce sequencing for a simple token , token , token ... list */ +#define LWS_TOKENIZE_F_COMMA_SEP_LIST (1 << 2) +/* Allow more characters in the tokens and less delimiters... default is + * only alphanumeric + underscore in tokens */ +#define LWS_TOKENIZE_F_RFC7230_DELIMS (1 << 3) +/* Do not treat . as a terminal character, so "warmcat.com" is one token */ +#define LWS_TOKENIZE_F_DOT_NONTERM (1 << 4) +/* If something starts looking like a float, like 1.2, force to be string token. + * This lets you receive dotted-quads like 192.168.0.1 as string tokens, and + * avoids illegal float format detection like 1.myserver.com */ +#define LWS_TOKENIZE_F_NO_FLOATS (1 << 5) + +typedef enum { + + LWS_TOKZE_ERRS = 5, /* the number of errors defined */ + + LWS_TOKZE_ERR_BROKEN_UTF8 = -5, /* malformed or partial utf8 */ + LWS_TOKZE_ERR_UNTERM_STRING = -4, /* ended while we were in "" */ + LWS_TOKZE_ERR_MALFORMED_FLOAT = -3, /* like 0..1 or 0.1.1 */ + LWS_TOKZE_ERR_NUM_ON_LHS = -2, /* like 123= or 0.1= */ + LWS_TOKZE_ERR_COMMA_LIST = -1, /* like ",tok", or, "tok,," */ + + LWS_TOKZE_ENDED = 0, /* no more content */ + + /* Note: results have ordinal 1+, EOT is 0 and errors are < 0 */ + + LWS_TOKZE_DELIMITER, /* a delimiter appeared */ + LWS_TOKZE_TOKEN, /* a token appeared */ + LWS_TOKZE_INTEGER, /* an integer appeared */ + LWS_TOKZE_FLOAT, /* a float appeared */ + LWS_TOKZE_TOKEN_NAME_EQUALS, /* token [whitespace] = */ + LWS_TOKZE_TOKEN_NAME_COLON, /* token [whitespace] : (only with + LWS_TOKENIZE_F_AGG_COLON flag) */ + LWS_TOKZE_QUOTED_STRING, /* "*", where * may have any char */ + +} lws_tokenize_elem; + +/* + * helper enums to allow caller to enforce legal delimiter sequencing, eg + * disallow "token,,token", "token,", and ",token" + */ + +enum lws_tokenize_delimiter_tracking { + LWSTZ_DT_NEED_FIRST_CONTENT, + LWSTZ_DT_NEED_DELIM, + LWSTZ_DT_NEED_NEXT_CONTENT, +}; + +struct lws_tokenize { + const char *start; /**< set to the start of the string to tokenize */ + const char *token; /**< the start of an identified token or delimiter */ + int len; /**< set to the length of the string to tokenize */ + int token_len; /**< the length of the identied token or delimiter */ + + int flags; /**< optional LWS_TOKENIZE_F_ flags, or 0 */ + int delim; +}; + +/** + * lws_tokenize() - breaks down a string into tokens and delimiters in-place + * + * \param ts: the lws_tokenize struct to init + * \param start: the string to tokenize + * \param flags: LWS_TOKENIZE_F_ option flags + * + * This initializes the tokenize struct to point to the given string, and + * sets the length to 2GiB - 1 (so there must be a terminating NUL)... you can + * override this requirement by setting ts.len yourself before using it. + * + * .delim is also initialized to LWSTZ_DT_NEED_FIRST_CONTENT. + */ + +LWS_VISIBLE LWS_EXTERN void +lws_tokenize_init(struct lws_tokenize *ts, const char *start, int flags); + +/** + * lws_tokenize() - breaks down a string into tokens and delimiters in-place + * + * \param ts: the lws_tokenize struct with information and state on what to do + * + * The \p ts struct should have its start, len and flags members initialized to + * reflect the string to be tokenized and any options. + * + * Then `lws_tokenize()` may be called repeatedly on the struct, returning one + * of `lws_tokenize_elem` each time, and with the struct's `token` and + * `token_len` members set to describe the content of the delimiter or token + * payload each time. + * + * There are no allocations during the process. + * + * returns lws_tokenize_elem that was identified (LWS_TOKZE_ENDED means reached + * the end of the string). + */ + +LWS_VISIBLE LWS_EXTERN lws_tokenize_elem +lws_tokenize(struct lws_tokenize *ts); + +/** + * lws_tokenize_cstr() - copy token string to NUL-terminated buffer + * + * \param ts: pointer to lws_tokenize struct to operate on + * \param str: destination buffer + * \pparam max: bytes in destination buffer + * + * returns 0 if OK or nonzero if the string + NUL won't fit. + */ + +LWS_VISIBLE LWS_EXTERN int +lws_tokenize_cstr(struct lws_tokenize *ts, char *str, int max); diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-vfs.h b/thirdparty/libwebsockets/include/libwebsockets/lws-vfs.h new file mode 100644 index 0000000000..00e2fda5d3 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-vfs.h @@ -0,0 +1,269 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup fops file operation wrapping + * + * ##File operation wrapping + * + * Use these helper functions if you want to access a file from the perspective + * of a specific wsi, which is usually the case. If you just want contextless + * file access, use the fops callbacks directly with NULL wsi instead of these + * helpers. + * + * If so, then it calls the platform handler or user overrides where present + * (as defined in info->fops) + * + * The advantage from all this is user code can be portable for file operations + * without having to deal with differences between platforms. + */ +//@{ + +/** struct lws_plat_file_ops - Platform-specific file operations + * + * These provide platform-agnostic ways to deal with filesystem access in the + * library and in the user code. + */ + +#if defined(LWS_WITH_ESP32) +/* sdk preprocessor defs? compiler issue? gets confused with member names */ +#define LWS_FOP_OPEN _open +#define LWS_FOP_CLOSE _close +#define LWS_FOP_SEEK_CUR _seek_cur +#define LWS_FOP_READ _read +#define LWS_FOP_WRITE _write +#else +#define LWS_FOP_OPEN open +#define LWS_FOP_CLOSE close +#define LWS_FOP_SEEK_CUR seek_cur +#define LWS_FOP_READ read +#define LWS_FOP_WRITE write +#endif + +#define LWS_FOP_FLAGS_MASK ((1 << 23) - 1) +#define LWS_FOP_FLAG_COMPR_ACCEPTABLE_GZIP (1 << 24) +#define LWS_FOP_FLAG_COMPR_IS_GZIP (1 << 25) +#define LWS_FOP_FLAG_MOD_TIME_VALID (1 << 26) +#define LWS_FOP_FLAG_VIRTUAL (1 << 27) + +struct lws_plat_file_ops; + +struct lws_fop_fd { + lws_filefd_type fd; + /**< real file descriptor related to the file... */ + const struct lws_plat_file_ops *fops; + /**< fops that apply to this fop_fd */ + void *filesystem_priv; + /**< ignored by lws; owned by the fops handlers */ + lws_filepos_t pos; + /**< generic "position in file" */ + lws_filepos_t len; + /**< generic "length of file" */ + lws_fop_flags_t flags; + /**< copy of the returned flags */ + uint32_t mod_time; + /**< optional "modification time of file", only valid if .open() + * set the LWS_FOP_FLAG_MOD_TIME_VALID flag */ +}; +typedef struct lws_fop_fd *lws_fop_fd_t; + +struct lws_fops_index { + const char *sig; /* NULL or vfs signature, eg, ".zip/" */ + uint8_t len; /* length of above string */ +}; + +struct lws_plat_file_ops { + lws_fop_fd_t (*LWS_FOP_OPEN)(const struct lws_plat_file_ops *fops, + const char *filename, const char *vpath, + lws_fop_flags_t *flags); + /**< Open file (always binary access if plat supports it) + * vpath may be NULL, or if the fops understands it, the point at which + * the filename's virtual part starts. + * *flags & LWS_FOP_FLAGS_MASK should be set to O_RDONLY or O_RDWR. + * If the file may be gzip-compressed, + * LWS_FOP_FLAG_COMPR_ACCEPTABLE_GZIP is set. If it actually is + * gzip-compressed, then the open handler should OR + * LWS_FOP_FLAG_COMPR_IS_GZIP on to *flags before returning. + */ + int (*LWS_FOP_CLOSE)(lws_fop_fd_t *fop_fd); + /**< close file AND set the pointer to NULL */ + lws_fileofs_t (*LWS_FOP_SEEK_CUR)(lws_fop_fd_t fop_fd, + lws_fileofs_t offset_from_cur_pos); + /**< seek from current position */ + int (*LWS_FOP_READ)(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len); + /**< Read from file, on exit *amount is set to amount actually read */ + int (*LWS_FOP_WRITE)(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len); + /**< Write to file, on exit *amount is set to amount actually written */ + + struct lws_fops_index fi[3]; + /**< vfs path signatures implying use of this fops */ + + const struct lws_plat_file_ops *next; + /**< NULL or next fops in list */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility */ +}; + +/** + * lws_get_fops() - get current file ops + * + * \param context: context + */ +LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops * LWS_WARN_UNUSED_RESULT +lws_get_fops(struct lws_context *context); +LWS_VISIBLE LWS_EXTERN void +lws_set_fops(struct lws_context *context, const struct lws_plat_file_ops *fops); +/** + * lws_vfs_tell() - get current file position + * + * \param fop_fd: fop_fd we are asking about + */ +LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT +lws_vfs_tell(lws_fop_fd_t fop_fd); +/** + * lws_vfs_get_length() - get current file total length in bytes + * + * \param fop_fd: fop_fd we are asking about + */ +LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT +lws_vfs_get_length(lws_fop_fd_t fop_fd); +/** + * lws_vfs_get_mod_time() - get time file last modified + * + * \param fop_fd: fop_fd we are asking about + */ +LWS_VISIBLE LWS_EXTERN uint32_t LWS_WARN_UNUSED_RESULT +lws_vfs_get_mod_time(lws_fop_fd_t fop_fd); +/** + * lws_vfs_file_seek_set() - seek relative to start of file + * + * \param fop_fd: fop_fd we are seeking in + * \param offset: offset from start of file + */ +LWS_VISIBLE LWS_EXTERN lws_fileofs_t +lws_vfs_file_seek_set(lws_fop_fd_t fop_fd, lws_fileofs_t offset); +/** + * lws_vfs_file_seek_end() - seek relative to end of file + * + * \param fop_fd: fop_fd we are seeking in + * \param offset: offset from start of file + */ +LWS_VISIBLE LWS_EXTERN lws_fileofs_t +lws_vfs_file_seek_end(lws_fop_fd_t fop_fd, lws_fileofs_t offset); + +extern struct lws_plat_file_ops fops_zip; + +/** + * lws_plat_file_open() - open vfs filepath + * + * \param fops: file ops struct that applies to this descriptor + * \param vfs_path: filename to open + * \param flags: pointer to open flags + * + * The vfs_path is scanned for known fops signatures, and the open directed + * to any matching fops open. + * + * User code should use this api to perform vfs opens. + * + * returns semi-opaque handle + */ +LWS_VISIBLE LWS_EXTERN lws_fop_fd_t LWS_WARN_UNUSED_RESULT +lws_vfs_file_open(const struct lws_plat_file_ops *fops, const char *vfs_path, + lws_fop_flags_t *flags); + +/** + * lws_plat_file_close() - close file + * + * \param fop_fd: file handle to close + */ +static LWS_INLINE int +lws_vfs_file_close(lws_fop_fd_t *fop_fd) +{ + return (*fop_fd)->fops->LWS_FOP_CLOSE(fop_fd); +} + +/** + * lws_plat_file_seek_cur() - close file + * + * + * \param fop_fd: file handle + * \param offset: position to seek to + */ +static LWS_INLINE lws_fileofs_t +lws_vfs_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset) +{ + return fop_fd->fops->LWS_FOP_SEEK_CUR(fop_fd, offset); +} +/** + * lws_plat_file_read() - read from file + * + * \param fop_fd: file handle + * \param amount: how much to read (rewritten by call) + * \param buf: buffer to write to + * \param len: max length + */ +static LWS_INLINE int LWS_WARN_UNUSED_RESULT +lws_vfs_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len) +{ + return fop_fd->fops->LWS_FOP_READ(fop_fd, amount, buf, len); +} +/** + * lws_plat_file_write() - write from file + * + * \param fop_fd: file handle + * \param amount: how much to write (rewritten by call) + * \param buf: buffer to read from + * \param len: max length + */ +static LWS_INLINE int LWS_WARN_UNUSED_RESULT +lws_vfs_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len) +{ + return fop_fd->fops->LWS_FOP_WRITE(fop_fd, amount, buf, len); +} + +/* these are the platform file operations implementations... they can + * be called directly and used in fops arrays + */ + +LWS_VISIBLE LWS_EXTERN lws_fop_fd_t +_lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, + const char *vpath, lws_fop_flags_t *flags); +LWS_VISIBLE LWS_EXTERN int +_lws_plat_file_close(lws_fop_fd_t *fop_fd); +LWS_VISIBLE LWS_EXTERN lws_fileofs_t +_lws_plat_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset); +LWS_VISIBLE LWS_EXTERN int +_lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len); +LWS_VISIBLE LWS_EXTERN int +_lws_plat_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len); + +LWS_VISIBLE LWS_EXTERN int +lws_alloc_vfs_file(struct lws_context *context, const char *filename, + uint8_t **buf, lws_filepos_t *amount); +//@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-write.h b/thirdparty/libwebsockets/include/libwebsockets/lws-write.h new file mode 100644 index 0000000000..b73e51c789 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-write.h @@ -0,0 +1,235 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup sending-data Sending data + + APIs related to writing data on a connection +*/ +//@{ +#if !defined(LWS_SIZEOFPTR) +#define LWS_SIZEOFPTR ((int)sizeof (void *)) +#endif + +#if defined(__x86_64__) +#define _LWS_PAD_SIZE 16 /* Intel recommended for best performance */ +#else +#define _LWS_PAD_SIZE LWS_SIZEOFPTR /* Size of a pointer on the target arch */ +#endif +#define _LWS_PAD(n) (((n) % _LWS_PAD_SIZE) ? \ + ((n) + (_LWS_PAD_SIZE - ((n) % _LWS_PAD_SIZE))) : (n)) +/* last 2 is for lws-meta */ +#define LWS_PRE _LWS_PAD(4 + 10 + 2) +/* used prior to 1.7 and retained for backward compatibility */ +#define LWS_SEND_BUFFER_PRE_PADDING LWS_PRE +#define LWS_SEND_BUFFER_POST_PADDING 0 + +#define LWS_WRITE_RAW LWS_WRITE_HTTP + +/* + * NOTE: These public enums are part of the abi. If you want to add one, + * add it at where specified so existing users are unaffected. + */ +enum lws_write_protocol { + LWS_WRITE_TEXT = 0, + /**< Send a ws TEXT message,the pointer must have LWS_PRE valid + * memory behind it. + * + * The receiver expects only valid utf-8 in the payload */ + LWS_WRITE_BINARY = 1, + /**< Send a ws BINARY message, the pointer must have LWS_PRE valid + * memory behind it. + * + * Any sequence of bytes is valid */ + LWS_WRITE_CONTINUATION = 2, + /**< Continue a previous ws message, the pointer must have LWS_PRE valid + * memory behind it */ + LWS_WRITE_HTTP = 3, + /**< Send HTTP content */ + + /* LWS_WRITE_CLOSE is handled by lws_close_reason() */ + LWS_WRITE_PING = 5, + LWS_WRITE_PONG = 6, + + /* Same as write_http but we know this write ends the transaction */ + LWS_WRITE_HTTP_FINAL = 7, + + /* HTTP2 */ + + LWS_WRITE_HTTP_HEADERS = 8, + /**< Send http headers (http2 encodes this payload and LWS_WRITE_HTTP + * payload differently, http 1.x links also handle this correctly. so + * to be compatible with both in the future,header response part should + * be sent using this regardless of http version expected) + */ + LWS_WRITE_HTTP_HEADERS_CONTINUATION = 9, + /**< Continuation of http/2 headers + */ + + /****** add new things just above ---^ ******/ + + /* flags */ + + LWS_WRITE_BUFLIST = 0x20, + /**< Don't actually write it... stick it on the output buflist and + * write it as soon as possible. Useful if you learn you have to + * write something, have the data to write to hand but the timing is + * unrelated as to whether the connection is writable or not, and were + * otherwise going to have to allocate a temp buffer and write it + * later anyway */ + + LWS_WRITE_NO_FIN = 0x40, + /**< This part of the message is not the end of the message */ + + LWS_WRITE_H2_STREAM_END = 0x80, + /**< Flag indicates this packet should go out with STREAM_END if h2 + * STREAM_END is allowed on DATA or HEADERS. + */ + + LWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80 + /**< client packet payload goes out on wire unmunged + * only useful for security tests since normal servers cannot + * decode the content if used */ +}; + +/* used with LWS_CALLBACK_CHILD_WRITE_VIA_PARENT */ + +struct lws_write_passthru { + struct lws *wsi; + unsigned char *buf; + size_t len; + enum lws_write_protocol wp; +}; + + +/** + * lws_write() - Apply protocol then write data to client + * \param wsi: Websocket instance (available from user callback) + * \param buf: The data to send. For data being sent on a websocket + * connection (ie, not default http), this buffer MUST have + * LWS_PRE bytes valid BEFORE the pointer. + * This is so the protocol header data can be added in-situ. + * \param len: Count of the data bytes in the payload starting from buf + * \param protocol: Use LWS_WRITE_HTTP to reply to an http connection, and one + * of LWS_WRITE_BINARY or LWS_WRITE_TEXT to send appropriate + * data on a websockets connection. Remember to allow the extra + * bytes before and after buf if LWS_WRITE_BINARY or LWS_WRITE_TEXT + * are used. + * + * This function provides the way to issue data back to the client + * for both http and websocket protocols. + * + * IMPORTANT NOTICE! + * + * When sending with websocket protocol + * + * LWS_WRITE_TEXT, + * LWS_WRITE_BINARY, + * LWS_WRITE_CONTINUATION, + * LWS_WRITE_PING, + * LWS_WRITE_PONG, + * + * or sending on http/2, + * + * the send buffer has to have LWS_PRE bytes valid BEFORE the buffer pointer you + * pass to lws_write(). Since you'll probably want to use http/2 before too + * long, it's wise to just always do this with lws_write buffers... LWS_PRE is + * typically 16 bytes it's not going to hurt usually. + * + * start of alloc ptr passed to lws_write end of allocation + * | | | + * v <-- LWS_PRE bytes --> v v + * [---------------- allocated memory ---------------] + * (for lws use) [====== user buffer ======] + * + * This allows us to add protocol info before and after the data, and send as + * one packet on the network without payload copying, for maximum efficiency. + * + * So for example you need this kind of code to use lws_write with a + * 128-byte payload + * + * char buf[LWS_PRE + 128]; + * + * // fill your part of the buffer... for example here it's all zeros + * memset(&buf[LWS_PRE], 0, 128); + * + * lws_write(wsi, &buf[LWS_PRE], 128, LWS_WRITE_TEXT); + * + * LWS_PRE is at least the frame nonce + 2 header + 8 length + * LWS_SEND_BUFFER_POST_PADDING is deprecated, it's now 0 and can be left off. + * The example apps no longer use it. + * + * Pad LWS_PRE to the CPU word size, so that word references + * to the address immediately after the padding won't cause an unaligned access + * error. Sometimes for performance reasons the recommended padding is even + * larger than sizeof(void *). + * + * In the case of sending using websocket protocol, be sure to allocate + * valid storage before and after buf as explained above. This scheme + * allows maximum efficiency of sending data and protocol in a single + * packet while not burdening the user code with any protocol knowledge. + * + * Return may be -1 for a fatal error needing connection close, or the + * number of bytes sent. + * + * Truncated Writes + * ================ + * + * The OS may not accept everything you asked to write on the connection. + * + * Posix defines POLLOUT indication from poll() to show that the connection + * will accept more write data, but it doesn't specifiy how much. It may just + * accept one byte of whatever you wanted to send. + * + * LWS will buffer the remainder automatically, and send it out autonomously. + * + * During that time, WRITABLE callbacks will be suppressed. + * + * This is to handle corner cases where unexpectedly the OS refuses what we + * usually expect it to accept. You should try to send in chunks that are + * almost always accepted in order to avoid the inefficiency of the buffering. + */ +LWS_VISIBLE LWS_EXTERN int +lws_write(struct lws *wsi, unsigned char *buf, size_t len, + enum lws_write_protocol protocol); + +/* helper for case where buffer may be const */ +#define lws_write_http(wsi, buf, len) \ + lws_write(wsi, (unsigned char *)(buf), len, LWS_WRITE_HTTP) + +/* helper for multi-frame ws message flags */ +static LWS_INLINE int +lws_write_ws_flags(int initial, int is_start, int is_end) +{ + int r; + + if (is_start) + r = initial; + else + r = LWS_WRITE_CONTINUATION; + + if (!is_end) + r |= LWS_WRITE_NO_FIN; + + return r; +} +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-writeable.h b/thirdparty/libwebsockets/include/libwebsockets/lws-writeable.h new file mode 100644 index 0000000000..dd5659c3f0 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-writeable.h @@ -0,0 +1,225 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup callback-when-writeable Callback when writeable + * + * ##Callback When Writeable + * + * lws can only write data on a connection when it is able to accept more + * data without blocking. + * + * So a basic requirement is we should only use the lws_write() apis when the + * connection we want to write on says that he can accept more data. + * + * When lws cannot complete your send at the time, it will buffer the data + * and send it in the background, suppressing any further WRITEABLE callbacks + * on that connection until it completes. So it is important to write new + * things in a new writeable callback. + * + * These apis reflect the various ways we can indicate we would like to be + * called back when one or more connections is writeable. + */ +///@{ + +/** + * lws_callback_on_writable() - Request a callback when this socket + * becomes able to be written to without + * blocking + * + * \param wsi: Websocket connection instance to get callback for + * + * - Which: only this wsi + * - When: when the individual connection becomes writeable + * - What: LWS_CALLBACK_*_WRITEABLE + */ +LWS_VISIBLE LWS_EXTERN int +lws_callback_on_writable(struct lws *wsi); + +/** + * lws_callback_on_writable_all_protocol() - Request a callback for all + * connections using the given protocol when it + * becomes possible to write to each socket without + * blocking in turn. + * + * \param context: lws_context + * \param protocol: Protocol whose connections will get callbacks + * + * - Which: connections using this protocol on ANY VHOST + * - When: when the individual connection becomes writeable + * - What: LWS_CALLBACK_*_WRITEABLE + */ +LWS_VISIBLE LWS_EXTERN int +lws_callback_on_writable_all_protocol(const struct lws_context *context, + const struct lws_protocols *protocol); + +/** + * lws_callback_on_writable_all_protocol_vhost() - Request a callback for + * all connections on same vhost using the given protocol + * when it becomes possible to write to each socket without + * blocking in turn. + * + * \param vhost: Only consider connections on this lws_vhost + * \param protocol: Protocol whose connections will get callbacks + * + * - Which: connections using this protocol on GIVEN VHOST ONLY + * - When: when the individual connection becomes writeable + * - What: LWS_CALLBACK_*_WRITEABLE + */ +LWS_VISIBLE LWS_EXTERN int +lws_callback_on_writable_all_protocol_vhost(const struct lws_vhost *vhost, + const struct lws_protocols *protocol); + +/** + * lws_callback_all_protocol() - Callback all connections using + * the given protocol with the given reason + * + * \param context: lws_context + * \param protocol: Protocol whose connections will get callbacks + * \param reason: Callback reason index + * + * - Which: connections using this protocol on ALL VHOSTS + * - When: before returning + * - What: reason + * + * This isn't normally what you want... normally any update of connection- + * specific information can wait until a network-related callback like rx, + * writable, or close. + */ +LWS_VISIBLE LWS_EXTERN int +lws_callback_all_protocol(struct lws_context *context, + const struct lws_protocols *protocol, int reason); + +/** + * lws_callback_all_protocol_vhost() - Callback all connections using + * the given protocol with the given reason. This is + * deprecated since v2.4: use lws_callback_all_protocol_vhost_args + * + * \param vh: Vhost whose connections will get callbacks + * \param protocol: Which protocol to match. NULL means all. + * \param reason: Callback reason index + * + * - Which: connections using this protocol on GIVEN VHOST ONLY + * - When: now + * - What: reason + */ +LWS_VISIBLE LWS_EXTERN int +lws_callback_all_protocol_vhost(struct lws_vhost *vh, + const struct lws_protocols *protocol, + int reason) +LWS_WARN_DEPRECATED; + +/** + * lws_callback_all_protocol_vhost_args() - Callback all connections using + * the given protocol with the given reason and args + * + * \param vh: Vhost whose connections will get callbacks + * \param protocol: Which protocol to match. NULL means all. + * \param reason: Callback reason index + * \param argp: Callback "in" parameter + * \param len: Callback "len" parameter + * + * - Which: connections using this protocol on GIVEN VHOST ONLY + * - When: now + * - What: reason + */ +LWS_VISIBLE int +lws_callback_all_protocol_vhost_args(struct lws_vhost *vh, + const struct lws_protocols *protocol, + int reason, void *argp, size_t len); + +/** + * lws_callback_vhost_protocols() - Callback all protocols enabled on a vhost + * with the given reason + * + * \param wsi: wsi whose vhost will get callbacks + * \param reason: Callback reason index + * \param in: in argument to callback + * \param len: len argument to callback + * + * - Which: connections using this protocol on same VHOST as wsi ONLY + * - When: now + * - What: reason + * + * This is deprecated since v2.5, use lws_callback_vhost_protocols_vhost() + * which takes the pointer to the vhost directly without using or needing the + * wsi. + */ +LWS_VISIBLE LWS_EXTERN int +lws_callback_vhost_protocols(struct lws *wsi, int reason, void *in, int len) +LWS_WARN_DEPRECATED; + +/** + * lws_callback_vhost_protocols_vhost() - Callback all protocols enabled on a vhost + * with the given reason + * + * \param vh: vhost that will get callbacks + * \param reason: Callback reason index + * \param in: in argument to callback + * \param len: len argument to callback + * + * - Which: connections using this protocol on same VHOST as wsi ONLY + * - When: now + * - What: reason + */ +LWS_VISIBLE LWS_EXTERN int +lws_callback_vhost_protocols_vhost(struct lws_vhost *vh, int reason, void *in, + size_t len); + +LWS_VISIBLE LWS_EXTERN int +lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, + void *user, void *in, size_t len); + +/** + * lws_get_socket_fd() - returns the socket file descriptor + * + * This is needed to use sendto() on UDP raw sockets + * + * \param wsi: Websocket connection instance + */ +LWS_VISIBLE LWS_EXTERN lws_sockfd_type +lws_get_socket_fd(struct lws *wsi); + +/** + * lws_get_peer_write_allowance() - get the amount of data writeable to peer + * if known + * + * \param wsi: Websocket connection instance + * + * if the protocol does not have any guidance, returns -1. Currently only + * http2 connections get send window information from this API. But your code + * should use it so it can work properly with any protocol. + * + * If nonzero return is the amount of payload data the peer or intermediary has + * reported it has buffer space for. That has NO relationship with the amount + * of buffer space your OS can accept on this connection for a write action. + * + * This number represents the maximum you could send to the peer or intermediary + * on this connection right now without the protocol complaining. + * + * lws manages accounting for send window updates and payload writes + * automatically, so this number reflects the situation at the peer or + * intermediary dynamically. + */ +LWS_VISIBLE LWS_EXTERN lws_fileofs_t +lws_get_peer_write_allowance(struct lws *wsi); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-ws-close.h b/thirdparty/libwebsockets/include/libwebsockets/lws-ws-close.h new file mode 100644 index 0000000000..9721e29233 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-ws-close.h @@ -0,0 +1,124 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup wsclose Websocket Close + * + * ##Websocket close frame control + * + * When we close a ws connection, we can send a reason code and a short + * UTF-8 description back with the close packet. + */ +///@{ + +/* + * NOTE: These public enums are part of the abi. If you want to add one, + * add it at where specified so existing users are unaffected. + */ +/** enum lws_close_status - RFC6455 close status codes */ +enum lws_close_status { + LWS_CLOSE_STATUS_NOSTATUS = 0, + LWS_CLOSE_STATUS_NORMAL = 1000, + /**< 1000 indicates a normal closure, meaning that the purpose for + which the connection was established has been fulfilled. */ + LWS_CLOSE_STATUS_GOINGAWAY = 1001, + /**< 1001 indicates that an endpoint is "going away", such as a server + going down or a browser having navigated away from a page. */ + LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002, + /**< 1002 indicates that an endpoint is terminating the connection due + to a protocol error. */ + LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003, + /**< 1003 indicates that an endpoint is terminating the connection + because it has received a type of data it cannot accept (e.g., an + endpoint that understands only text data MAY send this if it + receives a binary message). */ + LWS_CLOSE_STATUS_RESERVED = 1004, + /**< Reserved. The specific meaning might be defined in the future. */ + LWS_CLOSE_STATUS_NO_STATUS = 1005, + /**< 1005 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. It is designated for use in + applications expecting a status code to indicate that no status + code was actually present. */ + LWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006, + /**< 1006 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. It is designated for use in + applications expecting a status code to indicate that the + connection was closed abnormally, e.g., without sending or + receiving a Close control frame. */ + LWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007, + /**< 1007 indicates that an endpoint is terminating the connection + because it has received data within a message that was not + consistent with the type of the message (e.g., non-UTF-8 [RFC3629] + data within a text message). */ + LWS_CLOSE_STATUS_POLICY_VIOLATION = 1008, + /**< 1008 indicates that an endpoint is terminating the connection + because it has received a message that violates its policy. This + is a generic status code that can be returned when there is no + other more suitable status code (e.g., 1003 or 1009) or if there + is a need to hide specific details about the policy. */ + LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009, + /**< 1009 indicates that an endpoint is terminating the connection + because it has received a message that is too big for it to + process. */ + LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010, + /**< 1010 indicates that an endpoint (client) is terminating the + connection because it has expected the server to negotiate one or + more extension, but the server didn't return them in the response + message of the WebSocket handshake. The list of extensions that + are needed SHOULD appear in the /reason/ part of the Close frame. + Note that this status code is not used by the server, because it + can fail the WebSocket handshake instead */ + LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011, + /**< 1011 indicates that a server is terminating the connection because + it encountered an unexpected condition that prevented it from + fulfilling the request. */ + LWS_CLOSE_STATUS_TLS_FAILURE = 1015, + /**< 1015 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. It is designated for use in + applications expecting a status code to indicate that the + connection was closed due to a failure to perform a TLS handshake + (e.g., the server certificate can't be verified). */ + + LWS_CLOSE_STATUS_CLIENT_TRANSACTION_DONE = 2000, + + /****** add new things just above ---^ ******/ + + LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY = 9999, +}; + +/** + * lws_close_reason - Set reason and aux data to send with Close packet + * If you are going to return nonzero from the callback + * requesting the connection to close, you can optionally + * call this to set the reason the peer will be told if + * possible. + * + * \param wsi: The websocket connection to set the close reason on + * \param status: A valid close status from websocket standard + * \param buf: NULL or buffer containing up to 124 bytes of auxiliary data + * \param len: Length of data in \param buf to send + */ +LWS_VISIBLE LWS_EXTERN void +lws_close_reason(struct lws *wsi, enum lws_close_status status, + unsigned char *buf, size_t len); + +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-ws-ext.h b/thirdparty/libwebsockets/include/libwebsockets/lws-ws-ext.h new file mode 100644 index 0000000000..3face4f344 --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-ws-ext.h @@ -0,0 +1,197 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/*! \defgroup extensions Extension related functions + * ##Extension releated functions + * + * Ws defines optional extensions, lws provides the ability to implement these + * in user code if so desired. + * + * We provide one extensions permessage-deflate. + */ +///@{ + +/* + * NOTE: These public enums are part of the abi. If you want to add one, + * add it at where specified so existing users are unaffected. + */ +enum lws_extension_callback_reasons { + LWS_EXT_CB_CONSTRUCT = 4, + LWS_EXT_CB_CLIENT_CONSTRUCT = 5, + LWS_EXT_CB_DESTROY = 8, + LWS_EXT_CB_PACKET_TX_PRESEND = 12, + LWS_EXT_CB_PAYLOAD_TX = 21, + LWS_EXT_CB_PAYLOAD_RX = 22, + LWS_EXT_CB_OPTION_DEFAULT = 23, + LWS_EXT_CB_OPTION_SET = 24, + LWS_EXT_CB_OPTION_CONFIRM = 25, + LWS_EXT_CB_NAMED_OPTION_SET = 26, + + /****** add new things just above ---^ ******/ +}; + +/** enum lws_ext_options_types */ +enum lws_ext_options_types { + EXTARG_NONE, /**< does not take an argument */ + EXTARG_DEC, /**< requires a decimal argument */ + EXTARG_OPT_DEC /**< may have an optional decimal argument */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility */ +}; + +/** struct lws_ext_options - Option arguments to the extension. These are + * used in the negotiation at ws upgrade time. + * The helper function lws_ext_parse_options() + * uses these to generate callbacks */ +struct lws_ext_options { + const char *name; /**< Option name, eg, "server_no_context_takeover" */ + enum lws_ext_options_types type; /**< What kind of args the option can take */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility */ +}; + +/** struct lws_ext_option_arg */ +struct lws_ext_option_arg { + const char *option_name; /**< may be NULL, option_index used then */ + int option_index; /**< argument ordinal to use if option_name missing */ + const char *start; /**< value */ + int len; /**< length of value */ +}; + +/** + * typedef lws_extension_callback_function() - Hooks to allow extensions to operate + * \param context: Websockets context + * \param ext: This extension + * \param wsi: Opaque websocket instance pointer + * \param reason: The reason for the call + * \param user: Pointer to ptr to per-session user data allocated by library + * \param in: Pointer used for some callback reasons + * \param len: Length set for some callback reasons + * + * Each extension that is active on a particular connection receives + * callbacks during the connection lifetime to allow the extension to + * operate on websocket data and manage itself. + * + * Libwebsockets takes care of allocating and freeing "user" memory for + * each active extension on each connection. That is what is pointed to + * by the user parameter. + * + * LWS_EXT_CB_CONSTRUCT: called when the server has decided to + * select this extension from the list provided by the client, + * just before the server will send back the handshake accepting + * the connection with this extension active. This gives the + * extension a chance to initialize its connection context found + * in user. + * + * LWS_EXT_CB_CLIENT_CONSTRUCT: same as LWS_EXT_CB_CONSTRUCT + * but called when client is instantiating this extension. Some + * extensions will work the same on client and server side and then + * you can just merge handlers for both CONSTRUCTS. + * + * LWS_EXT_CB_DESTROY: called when the connection the extension was + * being used on is about to be closed and deallocated. It's the + * last chance for the extension to deallocate anything it has + * allocated in the user data (pointed to by user) before the + * user data is deleted. This same callback is used whether you + * are in client or server instantiation context. + * + * LWS_EXT_CB_PACKET_TX_PRESEND: this works the same way as + * LWS_EXT_CB_PACKET_RX_PREPARSE above, except it gives the + * extension a chance to change websocket data just before it will + * be sent out. Using the same lws_token pointer scheme in in, + * the extension can change the buffer and the length to be + * transmitted how it likes. Again if it wants to grow the + * buffer safely, it should copy the data into its own buffer and + * set the lws_tokens token pointer to it. + * + * LWS_EXT_CB_ARGS_VALIDATE: + */ +typedef int +lws_extension_callback_function(struct lws_context *context, + const struct lws_extension *ext, struct lws *wsi, + enum lws_extension_callback_reasons reason, + void *user, void *in, size_t len); + +/** struct lws_extension - An extension we support */ +struct lws_extension { + const char *name; /**< Formal extension name, eg, "permessage-deflate" */ + lws_extension_callback_function *callback; /**< Service callback */ + const char *client_offer; /**< String containing exts and options client offers */ + + /* Add new things just above here ---^ + * This is part of the ABI, don't needlessly break compatibility */ +}; + +/** + * lws_set_extension_option(): set extension option if possible + * + * \param wsi: websocket connection + * \param ext_name: name of ext, like "permessage-deflate" + * \param opt_name: name of option, like "rx_buf_size" + * \param opt_val: value to set option to + */ +LWS_VISIBLE LWS_EXTERN int +lws_set_extension_option(struct lws *wsi, const char *ext_name, + const char *opt_name, const char *opt_val); + +/** + * lws_ext_parse_options() - deal with parsing negotiated extension options + * + * \param ext: related extension struct + * \param wsi: websocket connection + * \param ext_user: per-connection extension private data + * \param opts: list of supported options + * \param o: option string to parse + * \param len: length + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_ext_parse_options(const struct lws_extension *ext, struct lws *wsi, + void *ext_user, const struct lws_ext_options *opts, + const char *o, int len); + +/** lws_extension_callback_pm_deflate() - extension for RFC7692 + * + * \param context: lws context + * \param ext: related lws_extension struct + * \param wsi: websocket connection + * \param reason: incoming callback reason + * \param user: per-connection extension private data + * \param in: pointer parameter + * \param len: length parameter + * + * Built-in callback implementing RFC7692 permessage-deflate + */ +LWS_EXTERN int +lws_extension_callback_pm_deflate(struct lws_context *context, + const struct lws_extension *ext, + struct lws *wsi, + enum lws_extension_callback_reasons reason, + void *user, void *in, size_t len); + +/* + * The internal exts are part of the public abi + * If we add more extensions, publish the callback here ------v + */ +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-ws-state.h b/thirdparty/libwebsockets/include/libwebsockets/lws-ws-state.h new file mode 100644 index 0000000000..3f65724a7a --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-ws-state.h @@ -0,0 +1,92 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +/** \defgroup wsstatus Websocket status APIs + * ##Websocket connection status APIs + * + * These provide information about ws connection or message status + */ +///@{ +/** + * lws_send_pipe_choked() - tests if socket is writable or not + * \param wsi: lws connection + * + * Allows you to check if you can write more on the socket + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_send_pipe_choked(struct lws *wsi); + +/** + * lws_is_final_fragment() - tests if last part of ws message + * + * \param wsi: lws connection + */ +LWS_VISIBLE LWS_EXTERN int +lws_is_final_fragment(struct lws *wsi); + +/** + * lws_is_first_fragment() - tests if first part of ws message + * + * \param wsi: lws connection + */ +LWS_VISIBLE LWS_EXTERN int +lws_is_first_fragment(struct lws *wsi); + +/** + * lws_get_reserved_bits() - access reserved bits of ws frame + * \param wsi: lws connection + */ +LWS_VISIBLE LWS_EXTERN unsigned char +lws_get_reserved_bits(struct lws *wsi); + +/** + * lws_partial_buffered() - find out if lws buffered the last write + * \param wsi: websocket connection to check + * + * Returns 1 if you cannot use lws_write because the last + * write on this connection is still buffered, and can't be cleared without + * returning to the service loop and waiting for the connection to be + * writeable again. + * + * If you will try to do >1 lws_write call inside a single + * WRITEABLE callback, you must check this after every write and bail if + * set, ask for a new writeable callback and continue writing from there. + * + * This is never set at the start of a writeable callback, but any write + * may set it. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_partial_buffered(struct lws *wsi); + +/** + * lws_frame_is_binary(): true if the current frame was sent in binary mode + * + * \param wsi: the connection we are inquiring about + * + * This is intended to be called from the LWS_CALLBACK_RECEIVE callback if + * it's interested to see if the frame it's dealing with was sent in binary + * mode. + */ +LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT +lws_frame_is_binary(struct lws *wsi); +///@} diff --git a/thirdparty/libwebsockets/include/libwebsockets/lws-x509.h b/thirdparty/libwebsockets/include/libwebsockets/lws-x509.h new file mode 100644 index 0000000000..f8e5cb0fad --- /dev/null +++ b/thirdparty/libwebsockets/include/libwebsockets/lws-x509.h @@ -0,0 +1,177 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * included from libwebsockets.h + */ + +enum lws_tls_cert_info { + LWS_TLS_CERT_INFO_VALIDITY_FROM, + /**< fills .time with the time_t the cert validity started from */ + LWS_TLS_CERT_INFO_VALIDITY_TO, + /**< fills .time with the time_t the cert validity ends at */ + LWS_TLS_CERT_INFO_COMMON_NAME, + /**< fills up to len bytes of .ns.name with the cert common name */ + LWS_TLS_CERT_INFO_ISSUER_NAME, + /**< fills up to len bytes of .ns.name with the cert issuer name */ + LWS_TLS_CERT_INFO_USAGE, + /**< fills verified with a bitfield asserting the valid uses */ + LWS_TLS_CERT_INFO_VERIFIED, + /**< fills .verified with a bool representing peer cert validity, + * call returns -1 if no cert */ + LWS_TLS_CERT_INFO_OPAQUE_PUBLIC_KEY, + /**< the certificate's public key, as an opaque bytestream. These + * opaque bytestreams can only be compared with each other using the + * same tls backend, ie, OpenSSL or mbedTLS. The different backends + * produce different, incompatible representations for the same cert. + */ +}; + +union lws_tls_cert_info_results { + unsigned int verified; + time_t time; + unsigned int usage; + struct { + int len; + /* KEEP LAST... notice the [64] is only there because + * name[] is not allowed in a union. The actual length of + * name[] is arbitrary and is passed into the api using the + * len parameter. Eg + * + * char big[1024]; + * union lws_tls_cert_info_results *buf = + * (union lws_tls_cert_info_results *)big; + * + * lws_tls_peer_cert_info(wsi, type, buf, sizeof(big) - + * sizeof(*buf) + sizeof(buf->ns.name)); + */ + char name[64]; + } ns; +}; + +/** + * lws_tls_peer_cert_info() - get information from the peer's TLS cert + * + * \param wsi: the connection to query + * \param type: one of LWS_TLS_CERT_INFO_ + * \param buf: pointer to union to take result + * \param len: when result is a string, the true length of buf->ns.name[] + * + * lws_tls_peer_cert_info() lets you get hold of information from the peer + * certificate. + * + * Return 0 if there is a result in \p buf, or -1 indicating there was no cert + * or another problem. + * + * This function works the same no matter if the TLS backend is OpenSSL or + * mbedTLS. + */ +LWS_VISIBLE LWS_EXTERN int +lws_tls_peer_cert_info(struct lws *wsi, enum lws_tls_cert_info type, + union lws_tls_cert_info_results *buf, size_t len); + +/** + * lws_tls_vhost_cert_info() - get information from the vhost's own TLS cert + * + * \param vhost: the vhost to query + * \param type: one of LWS_TLS_CERT_INFO_ + * \param buf: pointer to union to take result + * \param len: when result is a string, the true length of buf->ns.name[] + * + * lws_tls_vhost_cert_info() lets you get hold of information from the vhost + * certificate. + * + * Return 0 if there is a result in \p buf, or -1 indicating there was no cert + * or another problem. + * + * This function works the same no matter if the TLS backend is OpenSSL or + * mbedTLS. + */ +LWS_VISIBLE LWS_EXTERN int +lws_tls_vhost_cert_info(struct lws_vhost *vhost, enum lws_tls_cert_info type, + union lws_tls_cert_info_results *buf, size_t len); + +/** + * lws_tls_acme_sni_cert_create() - creates a temp selfsigned cert + * and attaches to a vhost + * + * \param vhost: the vhost to acquire the selfsigned cert + * \param san_a: SAN written into the certificate + * \param san_b: second SAN written into the certificate + * + * + * Returns 0 if created and attached to the vhost. Returns -1 if problems and + * frees all allocations before returning. + * + * On success, any allocations are destroyed at vhost destruction automatically. + */ +LWS_VISIBLE LWS_EXTERN int +lws_tls_acme_sni_cert_create(struct lws_vhost *vhost, const char *san_a, + const char *san_b); + +/** + * lws_tls_acme_sni_csr_create() - creates a CSR and related private key PEM + * + * \param context: lws_context used for random + * \param elements: array of LWS_TLS_REQ_ELEMENT_COUNT const char * + * \param csr: buffer that will get the b64URL(ASN-1 CSR) + * \param csr_len: max length of the csr buffer + * \param privkey_pem: pointer to pointer allocated to hold the privkey_pem + * \param privkey_len: pointer to size_t set to the length of the privkey_pem + * + * Creates a CSR according to the information in \p elements, and a private + * RSA key used to sign the CSR. + * + * The outputs are the b64URL(ASN-1 CSR) into csr, and the PEM private key into + * privkey_pem. + * + * Notice that \p elements points to an array of const char *s pointing to the + * information listed in the enum above. If an entry is NULL or an empty + * string, the element is set to "none" in the CSR. + * + * Returns 0 on success or nonzero for failure. + */ +LWS_VISIBLE LWS_EXTERN int +lws_tls_acme_sni_csr_create(struct lws_context *context, const char *elements[], + uint8_t *csr, size_t csr_len, char **privkey_pem, + size_t *privkey_len); + +/** + * lws_tls_cert_updated() - update every vhost using the given cert path + * + * \param context: our lws_context + * \param certpath: the filepath to the certificate + * \param keypath: the filepath to the private key of the certificate + * \param mem_cert: copy of the cert in memory + * \param len_mem_cert: length of the copy of the cert in memory + * \param mem_privkey: copy of the private key in memory + * \param len_mem_privkey: length of the copy of the private key in memory + * + * Checks every vhost to see if it is the using certificate described by the + * the given filepaths. If so, it attempts to update the vhost ssl_ctx to use + * the new certificate. + * + * Returns 0 on success or nonzero for failure. + */ +LWS_VISIBLE LWS_EXTERN int +lws_tls_cert_updated(struct lws_context *context, const char *certpath, + const char *keypath, + const char *mem_cert, size_t len_mem_cert, + const char *mem_privkey, size_t len_mem_privkey); + diff --git a/thirdparty/libwebsockets/lws_config.h b/thirdparty/libwebsockets/include/lws_config.h index 6ec3eed139..fdf02157cc 100644 --- a/thirdparty/libwebsockets/lws_config.h +++ b/thirdparty/libwebsockets/include/lws_config.h @@ -77,8 +77,10 @@ /* #undef LWS_WITH_LIBEVENT */ /* Build with support for ipv6 */ -/* #undef LWS_WITH_IPV6 */ +/* Everywhere, except in OpenBSD which does not support dual stacking */ +#if !defined(__OpenBSD__) #define LWS_WITH_IPV6 +#endif /* Build with support for UNIX domain socket */ /* #undef LWS_WITH_UNIX_SOCK */ diff --git a/thirdparty/libwebsockets/ipv6_fixes.diff b/thirdparty/libwebsockets/ipv6_fixes.diff new file mode 100644 index 0000000000..5fa1e5c520 --- /dev/null +++ b/thirdparty/libwebsockets/ipv6_fixes.diff @@ -0,0 +1,32 @@ +diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-sockets.c b/thirdparty/libwebsockets/lib/plat/unix/unix-sockets.c +index 693efd28e..192dddee6 100644 +--- a/thirdparty/libwebsockets/lib/plat/unix/unix-sockets.c ++++ b/thirdparty/libwebsockets/lib/plat/unix/unix-sockets.c +@@ -73,6 +73,11 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd, int unix_skt) + int optval = 1; + socklen_t optlen = sizeof(optval); + ++#ifdef LWS_WITH_IPV6 ++ optval = 0; ++ setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen); ++#endif ++ + #if defined(__APPLE__) || \ + defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ + defined(__NetBSD__) || \ +diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-sockets.c b/thirdparty/libwebsockets/lib/plat/windows/windows-sockets.c +index bf0935057..62a0a4984 100644 +--- a/thirdparty/libwebsockets/lib/plat/windows/windows-sockets.c ++++ b/thirdparty/libwebsockets/lib/plat/windows/windows-sockets.c +@@ -56,6 +56,11 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd, + struct protoent *tcp_proto; + #endif + ++#ifdef LWS_WITH_IPV6 ++ optval = 0; ++ setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen); ++#endif ++ + if (vhost->ka_time) { + /* enable keepalive on this socket */ + optval = 1; diff --git a/thirdparty/libwebsockets/lib/core/adopt.c b/thirdparty/libwebsockets/lib/core/adopt.c new file mode 100644 index 0000000000..49ac5af161 --- /dev/null +++ b/thirdparty/libwebsockets/lib/core/adopt.c @@ -0,0 +1,414 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include "core/private.h" + + +static int +lws_get_idlest_tsi(struct lws_context *context) +{ + unsigned int lowest = ~0; + int n = 0, hit = -1; + + for (; n < context->count_threads; n++) { + if ((unsigned int)context->pt[n].fds_count != + context->fd_limit_per_thread - 1 && + (unsigned int)context->pt[n].fds_count < lowest) { + lowest = context->pt[n].fds_count; + hit = n; + } + } + + return hit; +} + +struct lws * +lws_create_new_server_wsi(struct lws_vhost *vhost, int fixed_tsi) +{ + struct lws *new_wsi; + int n = fixed_tsi; + + if (n < 0) + n = lws_get_idlest_tsi(vhost->context); + + if (n < 0) { + lwsl_err("no space for new conn\n"); + return NULL; + } + + new_wsi = lws_zalloc(sizeof(struct lws), "new server wsi"); + if (new_wsi == NULL) { + lwsl_err("Out of memory for new connection\n"); + return NULL; + } + + new_wsi->tsi = n; + lwsl_debug("new wsi %p joining vhost %s, tsi %d\n", new_wsi, + vhost->name, new_wsi->tsi); + + lws_vhost_bind_wsi(vhost, new_wsi); + new_wsi->context = vhost->context; + new_wsi->pending_timeout = NO_PENDING_TIMEOUT; + new_wsi->rxflow_change_to = LWS_RXFLOW_ALLOW; + + /* initialize the instance struct */ + + lwsi_set_state(new_wsi, LRS_UNCONNECTED); + new_wsi->hdr_parsing_completed = 0; + +#ifdef LWS_WITH_TLS + new_wsi->tls.use_ssl = LWS_SSL_ENABLED(vhost); +#endif + + /* + * these can only be set once the protocol is known + * we set an un-established connection's protocol pointer + * to the start of the supported list, so it can look + * for matching ones during the handshake + */ + new_wsi->protocol = vhost->protocols; + new_wsi->user_space = NULL; + new_wsi->desc.sockfd = LWS_SOCK_INVALID; + new_wsi->position_in_fds_table = LWS_NO_FDS_POS; + + vhost->context->count_wsi_allocated++; + + /* + * outermost create notification for wsi + * no user_space because no protocol selection + */ + vhost->protocols[0].callback(new_wsi, LWS_CALLBACK_WSI_CREATE, NULL, + NULL, 0); + + return new_wsi; +} + + +/* if not a socket, it's a raw, non-ssl file descriptor */ + +LWS_VISIBLE struct lws * +lws_adopt_descriptor_vhost(struct lws_vhost *vh, lws_adoption_type type, + lws_sock_file_fd_type fd, const char *vh_prot_name, + struct lws *parent) +{ + struct lws_context *context = vh->context; + struct lws *new_wsi; + struct lws_context_per_thread *pt; + int n; + +#if defined(LWS_WITH_PEER_LIMITS) + struct lws_peer *peer = NULL; + + if (type & LWS_ADOPT_SOCKET) { + peer = lws_get_or_create_peer(vh, fd.sockfd); + + if (peer && context->ip_limit_wsi && + peer->count_wsi >= context->ip_limit_wsi) { + lwsl_notice("Peer reached wsi limit %d\n", + context->ip_limit_wsi); + lws_stats_atomic_bump(context, &context->pt[0], + LWSSTATS_C_PEER_LIMIT_WSI_DENIED, + 1); + return NULL; + } + } +#endif + + n = -1; + if (parent) + n = parent->tsi; + new_wsi = lws_create_new_server_wsi(vh, n); + if (!new_wsi) { + if (type & LWS_ADOPT_SOCKET) + compatible_close(fd.sockfd); + return NULL; + } +#if defined(LWS_WITH_PEER_LIMITS) + if (peer) + lws_peer_add_wsi(context, peer, new_wsi); +#endif + pt = &context->pt[(int)new_wsi->tsi]; + lws_stats_atomic_bump(context, pt, LWSSTATS_C_CONNECTIONS, 1); + + if (parent) { + new_wsi->parent = parent; + new_wsi->sibling_list = parent->child_list; + parent->child_list = new_wsi; + } + + new_wsi->desc = fd; + + if (vh_prot_name) { + new_wsi->protocol = lws_vhost_name_to_protocol(new_wsi->vhost, + vh_prot_name); + if (!new_wsi->protocol) { + lwsl_err("Protocol %s not enabled on vhost %s\n", + vh_prot_name, new_wsi->vhost->name); + goto bail; + } + if (lws_ensure_user_space(new_wsi)) { + lwsl_notice("OOM trying to get user_space\n"); + goto bail; + } + } + + if (!LWS_SSL_ENABLED(new_wsi->vhost) || !(type & LWS_ADOPT_SOCKET)) + type &= ~LWS_ADOPT_ALLOW_SSL; + + if (lws_role_call_adoption_bind(new_wsi, type, vh_prot_name)) { + lwsl_err("Unable to find a role that can adopt descriptor\n"); + goto bail; + } + + /* + * A new connection was accepted. Give the user a chance to + * set properties of the newly created wsi. There's no protocol + * selected yet so we issue this to the vhosts's default protocol, + * itself by default protocols[0] + */ + n = LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED; + if (!(type & LWS_ADOPT_HTTP)) { + if (!(type & LWS_ADOPT_SOCKET)) + n = LWS_CALLBACK_RAW_ADOPT_FILE; + else + n = LWS_CALLBACK_RAW_ADOPT; + } + + lwsl_debug("new wsi wsistate 0x%x\n", new_wsi->wsistate); + + if (context->event_loop_ops->accept) + if (context->event_loop_ops->accept(new_wsi)) + goto fail; + + if (!(type & LWS_ADOPT_ALLOW_SSL)) { + lws_pt_lock(pt, __func__); + if (__insert_wsi_socket_into_fds(context, new_wsi)) { + lws_pt_unlock(pt); + lwsl_err("%s: fail inserting socket\n", __func__); + goto fail; + } + lws_pt_unlock(pt); + } else + if (lws_server_socket_service_ssl(new_wsi, fd.sockfd)) { + lwsl_info("%s: fail ssl negotiation\n", __func__); + goto fail; + } + + /* + * by deferring callback to this point, after insertion to fds, + * lws_callback_on_writable() can work from the callback + */ + if ((new_wsi->protocol->callback)(new_wsi, n, new_wsi->user_space, + NULL, 0)) + goto fail; + + /* role may need to do something after all adoption completed */ + + lws_role_call_adoption_bind(new_wsi, type | _LWS_ADOPT_FINISH, + vh_prot_name); + + lws_cancel_service_pt(new_wsi); + + return new_wsi; + +fail: + if (type & LWS_ADOPT_SOCKET) + lws_close_free_wsi(new_wsi, LWS_CLOSE_STATUS_NOSTATUS, + "adopt skt fail"); + + return NULL; + +bail: + lwsl_notice("%s: exiting on bail\n", __func__); + if (parent) + parent->child_list = new_wsi->sibling_list; + if (new_wsi->user_space) + lws_free(new_wsi->user_space); + + vh->context->count_wsi_allocated--; + + lws_vhost_unbind_wsi(new_wsi); + lws_free(new_wsi); + + compatible_close(fd.sockfd); + + return NULL; +} + +LWS_VISIBLE struct lws * +lws_adopt_socket_vhost(struct lws_vhost *vh, lws_sockfd_type accept_fd) +{ + lws_sock_file_fd_type fd; + + fd.sockfd = accept_fd; + return lws_adopt_descriptor_vhost(vh, LWS_ADOPT_SOCKET | + LWS_ADOPT_HTTP | LWS_ADOPT_ALLOW_SSL, fd, NULL, NULL); +} + +LWS_VISIBLE struct lws * +lws_adopt_socket(struct lws_context *context, lws_sockfd_type accept_fd) +{ + return lws_adopt_socket_vhost(context->vhost_list, accept_fd); +} + +/* Common read-buffer adoption for lws_adopt_*_readbuf */ +static struct lws* +adopt_socket_readbuf(struct lws *wsi, const char *readbuf, size_t len) +{ + struct lws_context_per_thread *pt; + struct lws_pollfd *pfd; + int n; + + if (!wsi) + return NULL; + + if (!readbuf || len == 0) + return wsi; + + if (wsi->position_in_fds_table == LWS_NO_FDS_POS) + return wsi; + + pt = &wsi->context->pt[(int)wsi->tsi]; + + n = lws_buflist_append_segment(&wsi->buflist, (const uint8_t *)readbuf, + len); + if (n < 0) + goto bail; + if (n) + lws_dll_lws_add_front(&wsi->dll_buflist, &pt->dll_head_buflist); + + /* + * we can't process the initial read data until we can attach an ah. + * + * if one is available, get it and place the data in his ah rxbuf... + * wsi with ah that have pending rxbuf get auto-POLLIN service. + * + * no autoservice because we didn't get a chance to attach the + * readbuf data to wsi or ah yet, and we will do it next if we get + * the ah. + */ + if (wsi->http.ah || !lws_header_table_attach(wsi, 0)) { + + lwsl_notice("%s: calling service on readbuf ah\n", __func__); + + /* + * unlike a normal connect, we have the headers already + * (or the first part of them anyway). + * libuv won't come back and service us without a network + * event, so we need to do the header service right here. + */ + pfd = &pt->fds[wsi->position_in_fds_table]; + pfd->revents |= LWS_POLLIN; + lwsl_err("%s: calling service\n", __func__); + if (lws_service_fd_tsi(wsi->context, pfd, wsi->tsi)) + /* service closed us */ + return NULL; + + return wsi; + } + lwsl_err("%s: deferring handling ah\n", __func__); + + return wsi; + +bail: + lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, + "adopt skt readbuf fail"); + + return NULL; +} + +LWS_EXTERN struct lws * +lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags, + const char *protocol_name, struct lws *parent_wsi) +{ + lws_sock_file_fd_type sock; + struct addrinfo h, *r, *rp; + struct lws *wsi = NULL; + char buf[16]; + int n; + + memset(&h, 0, sizeof(h)); + h.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + h.ai_socktype = SOCK_DGRAM; + h.ai_protocol = IPPROTO_UDP; + h.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; + + lws_snprintf(buf, sizeof(buf), "%u", port); + n = getaddrinfo(NULL, buf, &h, &r); + if (n) { + lwsl_info("%s: getaddrinfo error: %s\n", __func__, + gai_strerror(n)); + goto bail; + } + + for (rp = r; rp; rp = rp->ai_next) { + sock.sockfd = socket(rp->ai_family, rp->ai_socktype, + rp->ai_protocol); + if (sock.sockfd != LWS_SOCK_INVALID) + break; + } + if (!rp) { + lwsl_err("%s: unable to create INET socket\n", __func__); + goto bail1; + } + + if ((flags & LWS_CAUDP_BIND) && bind(sock.sockfd, rp->ai_addr, +#if defined(_WIN32) + (int)rp->ai_addrlen +#else + rp->ai_addrlen +#endif + ) == -1) { + lwsl_err("%s: bind failed\n", __func__); + goto bail2; + } + + wsi = lws_adopt_descriptor_vhost(vhost, LWS_ADOPT_RAW_SOCKET_UDP, sock, + protocol_name, parent_wsi); + if (!wsi) + lwsl_err("%s: udp adoption failed\n", __func__); + +bail2: + if (!wsi) + compatible_close((int)sock.sockfd); +bail1: + freeaddrinfo(r); + +bail: + return wsi; +} + +LWS_VISIBLE struct lws * +lws_adopt_socket_readbuf(struct lws_context *context, lws_sockfd_type accept_fd, + const char *readbuf, size_t len) +{ + return adopt_socket_readbuf(lws_adopt_socket(context, accept_fd), + readbuf, len); +} + +LWS_VISIBLE struct lws * +lws_adopt_socket_vhost_readbuf(struct lws_vhost *vhost, + lws_sockfd_type accept_fd, + const char *readbuf, size_t len) +{ + return adopt_socket_readbuf(lws_adopt_socket_vhost(vhost, accept_fd), + readbuf, len); +} diff --git a/thirdparty/libwebsockets/core/alloc.c b/thirdparty/libwebsockets/lib/core/alloc.c index f169fc3767..f169fc3767 100644 --- a/thirdparty/libwebsockets/core/alloc.c +++ b/thirdparty/libwebsockets/lib/core/alloc.c diff --git a/thirdparty/libwebsockets/lib/core/connect.c b/thirdparty/libwebsockets/lib/core/connect.c new file mode 100644 index 0000000000..daffc193c8 --- /dev/null +++ b/thirdparty/libwebsockets/lib/core/connect.c @@ -0,0 +1,287 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include "core/private.h" + +void +lws_client_stash_destroy(struct lws *wsi) +{ + if (!wsi || !wsi->stash) + return; + + lws_free_set_NULL(wsi->stash->address); + lws_free_set_NULL(wsi->stash->path); + lws_free_set_NULL(wsi->stash->host); + lws_free_set_NULL(wsi->stash->origin); + lws_free_set_NULL(wsi->stash->protocol); + lws_free_set_NULL(wsi->stash->method); + lws_free_set_NULL(wsi->stash->iface); + lws_free_set_NULL(wsi->stash->alpn); + + lws_free_set_NULL(wsi->stash); +} + +LWS_VISIBLE struct lws * +lws_client_connect_via_info(const struct lws_client_connect_info *i) +{ + struct lws *wsi, *safe = NULL; + const struct lws_protocols *p; + const char *local = i->protocol; +#if LWS_MAX_SMP > 1 + int n, tid; +#endif + + if (i->context->requested_kill) + return NULL; + + if (!i->context->protocol_init_done) + lws_protocol_init(i->context); + /* + * If we have .local_protocol_name, use it to select the local protocol + * handler to bind to. Otherwise use .protocol if http[s]. + */ + if (i->local_protocol_name) + local = i->local_protocol_name; + + /* PHASE 1: create a bare wsi */ + + wsi = lws_zalloc(sizeof(struct lws), "client wsi"); + if (wsi == NULL) + goto bail; + + wsi->context = i->context; + wsi->desc.sockfd = LWS_SOCK_INVALID; + + wsi->vhost = NULL; + if (!i->vhost) + lws_vhost_bind_wsi(i->context->vhost_list, wsi); + else + lws_vhost_bind_wsi(i->vhost, wsi); + + if (!wsi->vhost) { + lwsl_err("%s: No vhost in the context\n", __func__); + + goto bail; + } + + /* + * PHASE 2: if SMP, bind the client to whatever tsi the current thread + * represents + */ + +#if LWS_MAX_SMP > 1 + tid = wsi->vhost->protocols[0].callback(wsi, LWS_CALLBACK_GET_THREAD_ID, + NULL, NULL, 0); + + lws_context_lock(i->context, "client find tsi"); + + for (n = 0; n < i->context->count_threads; n++) + if (i->context->pt[n].service_tid == tid) { + lwsl_info("%s: client binds to caller tsi %d\n", + __func__, n); + wsi->tsi = n; + break; + } + + /* + * this binding is sort of provisional, since when we try to insert + * into the pt fds, there may be no space and it will fail + */ + + lws_context_unlock(i->context); +#endif + + /* + * PHASE 3: Choose an initial role for the wsi and do role-specific init + * + * Note the initial role may not reflect the final role, eg, + * we may want ws, but first we have to go through h1 to get that + */ + + lws_role_call_client_bind(wsi, i); + + /* + * PHASE 4: fill up the wsi with stuff from the connect_info as far as + * it can go. It's uncertain because not only is our connection + * going to complete asynchronously, we might have bound to h1 and not + * even be able to get ahold of an ah immediately. + */ + + wsi->user_space = NULL; + wsi->pending_timeout = NO_PENDING_TIMEOUT; + wsi->position_in_fds_table = LWS_NO_FDS_POS; + wsi->c_port = i->port; + + wsi->protocol = &wsi->vhost->protocols[0]; + wsi->client_pipeline = !!(i->ssl_connection & LCCSCF_PIPELINE); + + /* + * PHASE 5: handle external user_space now, generic alloc is done in + * role finalization + */ + + if (!wsi->user_space && i->userdata) { + wsi->user_space_externally_allocated = 1; + wsi->user_space = i->userdata; + } + + if (local) { + lwsl_info("%s: protocol binding to %s\n", __func__, local); + p = lws_vhost_name_to_protocol(wsi->vhost, local); + if (p) + lws_bind_protocol(wsi, p, __func__); + } + + /* + * PHASE 5: handle external user_space now, generic alloc is done in + * role finalization + */ + + if (!wsi->user_space && i->userdata) { + wsi->user_space_externally_allocated = 1; + wsi->user_space = i->userdata; + } + +#if defined(LWS_WITH_TLS) + wsi->tls.use_ssl = i->ssl_connection; +#else + if (i->ssl_connection & LCCSCF_USE_SSL) { + lwsl_err("%s: lws not configured for tls\n", __func__); + goto bail; + } +#endif + + /* + * PHASE 6: stash the things from connect_info that we can't process + * right now, eg, if http binding, without an ah. If h1 and no ah, we + * will go on the ah waiting list and process those things later (after + * the connect_info and maybe the things pointed to have gone out of + * scope) + * + * However these things are stashed in a generic way at this point, + * with no relationship to http or ah + */ + + wsi->stash = lws_zalloc(sizeof(*wsi->stash), "client stash"); + if (!wsi->stash) { + lwsl_err("%s: OOM\n", __func__); + goto bail1; + } + + wsi->stash->address = lws_strdup(i->address); + wsi->stash->path = lws_strdup(i->path); + wsi->stash->host = lws_strdup(i->host); + + if (!wsi->stash->address || !wsi->stash->path || !wsi->stash->host) + goto bail1; + + if (i->origin) { + wsi->stash->origin = lws_strdup(i->origin); + if (!wsi->stash->origin) + goto bail1; + } + if (i->protocol) { + wsi->stash->protocol = lws_strdup(i->protocol); + if (!wsi->stash->protocol) + goto bail1; + } + if (i->method) { + wsi->stash->method = lws_strdup(i->method); + if (!wsi->stash->method) + goto bail1; + } + if (i->iface) { + wsi->stash->iface = lws_strdup(i->iface); + if (!wsi->stash->iface) + goto bail1; + } + if (i->alpn) { + wsi->stash->alpn = lws_strdup(i->alpn); + if (!wsi->stash->alpn) + goto bail1; + } + + /* + * at this point user callbacks like + * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER will be interested to + * know the parent... eg for proxying we can grab extra headers from + * the parent's incoming ah and add them to the child client handshake + */ + + if (i->parent_wsi) { + lwsl_info("%s: created child %p of parent %p\n", __func__, + wsi, i->parent_wsi); + wsi->parent = i->parent_wsi; + safe = wsi->sibling_list = i->parent_wsi->child_list; + i->parent_wsi->child_list = wsi; + } + + /* + * PHASE 7: Do any role-specific finalization processing. We can still + * see important info things via wsi->stash + */ + + if (wsi->role_ops->client_bind) { + int n = wsi->role_ops->client_bind(wsi, NULL); + + if (n && i->parent_wsi) { + /* unpick from parent */ + + i->parent_wsi->child_list = safe; + } + + if (n < 0) + /* we didn't survive, wsi is freed */ + goto bail2; + + if (n) + /* something else failed, wsi needs freeing */ + goto bail; + } + + /* let the caller's optional wsi storage have the wsi we created */ + + if (i->pwsi) + *i->pwsi = wsi; + + +#if defined(LWS_WITH_HUBBUB) + if (i->uri_replace_to) + wsi->http.rw = lws_rewrite_create(wsi, html_parser_cb, + i->uri_replace_from, + i->uri_replace_to); +#endif + + return wsi; + +bail1: + lws_client_stash_destroy(wsi); + +bail: + lws_free(wsi); +#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) +bail2: +#endif + if (i->pwsi) + *i->pwsi = NULL; + + return NULL; +} diff --git a/thirdparty/libwebsockets/core/context.c b/thirdparty/libwebsockets/lib/core/context.c index 7be004df33..94b2d86339 100644 --- a/thirdparty/libwebsockets/core/context.c +++ b/thirdparty/libwebsockets/lib/core/context.c @@ -35,6 +35,9 @@ const struct lws_role_ops *available_roles[] = { #if defined(LWS_ROLE_WS) &role_ops_ws, #endif +#if defined(LWS_ROLE_DBUS) + &role_ops_dbus, +#endif NULL }; @@ -86,6 +89,57 @@ lws_role_call_alpn_negotiated(struct lws *wsi, const char *alpn) return 0; } +#if !defined(LWS_WITHOUT_SERVER) +int +lws_role_call_adoption_bind(struct lws *wsi, int type, const char *prot) +{ + LWS_FOR_EVERY_AVAILABLE_ROLE_START(ar) + if (ar->adoption_bind) + if (ar->adoption_bind(wsi, type, prot)) + return 0; + LWS_FOR_EVERY_AVAILABLE_ROLE_END; + + /* fall back to raw socket role if, eg, h1 not configured */ + + if (role_ops_raw_skt.adoption_bind && + role_ops_raw_skt.adoption_bind(wsi, type, prot)) + return 0; + + /* fall back to raw file role if, eg, h1 not configured */ + + if (role_ops_raw_file.adoption_bind && + role_ops_raw_file.adoption_bind(wsi, type, prot)) + return 0; + + return 1; +} +#endif + +#if !defined(LWS_WITHOUT_CLIENT) +int +lws_role_call_client_bind(struct lws *wsi, + const struct lws_client_connect_info *i) +{ + LWS_FOR_EVERY_AVAILABLE_ROLE_START(ar) + if (ar->client_bind) { + int m = ar->client_bind(wsi, i); + if (m < 0) + return m; + if (m) + return 0; + } + LWS_FOR_EVERY_AVAILABLE_ROLE_END; + + /* fall back to raw socket role if, eg, h1 not configured */ + + if (role_ops_raw_skt.client_bind && + role_ops_raw_skt.client_bind(wsi, i)) + return 0; + + return 1; +} +#endif + static const char * const mount_protocols[] = { "http://", "https://", @@ -263,8 +317,10 @@ lws_protocol_init(struct lws_context *context) (void *)pvo, 0)) { lws_free(vh->protocol_vh_privs[n]); vh->protocol_vh_privs[n] = NULL; - lwsl_err("%s: protocol %s failed init\n", __func__, - vh->protocols[n].name); + lwsl_err("%s: protocol %s failed init\n", + __func__, vh->protocols[n].name); + + return 1; } } @@ -286,229 +342,6 @@ next: return 0; } -LWS_VISIBLE int -lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, - void *user, void *in, size_t len) -{ - struct lws_ssl_info *si; -#ifdef LWS_WITH_CGI - struct lws_cgi_args *args; -#endif -#if defined(LWS_WITH_CGI) || defined(LWS_WITH_HTTP_PROXY) - char buf[512]; - int n; -#endif - - switch (reason) { -#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) - case LWS_CALLBACK_HTTP: -#ifndef LWS_NO_SERVER - if (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL)) - return -1; - - if (lws_http_transaction_completed(wsi)) -#endif - return -1; - break; -#if !defined(LWS_NO_SERVER) - case LWS_CALLBACK_HTTP_FILE_COMPLETION: - if (lws_http_transaction_completed(wsi)) - return -1; - break; -#endif - - case LWS_CALLBACK_HTTP_WRITEABLE: -#ifdef LWS_WITH_CGI - if (wsi->reason_bf & (LWS_CB_REASON_AUX_BF__CGI_HEADERS | - LWS_CB_REASON_AUX_BF__CGI)) { - n = lws_cgi_write_split_stdout_headers(wsi); - if (n < 0) { - lwsl_debug("AUX_BF__CGI forcing close\n"); - return -1; - } - if (!n) - lws_rx_flow_control( - wsi->http.cgi->stdwsi[LWS_STDOUT], 1); - - if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__CGI_HEADERS) - wsi->reason_bf &= - ~LWS_CB_REASON_AUX_BF__CGI_HEADERS; - else - wsi->reason_bf &= ~LWS_CB_REASON_AUX_BF__CGI; - break; - } - - if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__CGI_CHUNK_END) { - if (!wsi->http2_substream) { - memcpy(buf + LWS_PRE, "0\x0d\x0a\x0d\x0a", 5); - lwsl_debug("writing chunk term and exiting\n"); - n = lws_write(wsi, (unsigned char *)buf + - LWS_PRE, 5, LWS_WRITE_HTTP); - } else - n = lws_write(wsi, (unsigned char *)buf + - LWS_PRE, 0, - LWS_WRITE_HTTP_FINAL); - - /* always close after sending it */ - return -1; - } -#endif -#if defined(LWS_WITH_HTTP_PROXY) - if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__PROXY) { - char *px = buf + LWS_PRE; - int lenx = sizeof(buf) - LWS_PRE; - - /* - * our sink is writeable and our source has something - * to read. So read a lump of source material of - * suitable size to send or what's available, whichever - * is the smaller. - */ - wsi->reason_bf &= ~LWS_CB_REASON_AUX_BF__PROXY; - if (!lws_get_child(wsi)) - break; - if (lws_http_client_read(lws_get_child(wsi), &px, - &lenx) < 0) - return -1; - break; - } -#endif - break; - -#if defined(LWS_WITH_HTTP_PROXY) - case LWS_CALLBACK_RECEIVE_CLIENT_HTTP: - assert(lws_get_parent(wsi)); - if (!lws_get_parent(wsi)) - break; - lws_get_parent(wsi)->reason_bf |= LWS_CB_REASON_AUX_BF__PROXY; - lws_callback_on_writable(lws_get_parent(wsi)); - break; - - case LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ: - assert(lws_get_parent(wsi)); - n = lws_write(lws_get_parent(wsi), (unsigned char *)in, - len, LWS_WRITE_HTTP); - if (n < 0) - return -1; - break; - - case LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP: { - unsigned char *p, *end; - char ctype[64], ctlen = 0; - - p = (unsigned char *)buf + LWS_PRE; - end = p + sizeof(buf) - LWS_PRE; - - if (lws_add_http_header_status(lws_get_parent(wsi), - HTTP_STATUS_OK, &p, end)) - return 1; - if (lws_add_http_header_by_token(lws_get_parent(wsi), - WSI_TOKEN_HTTP_SERVER, - (unsigned char *)"libwebsockets", - 13, &p, end)) - return 1; - - ctlen = lws_hdr_copy(wsi, ctype, sizeof(ctype), - WSI_TOKEN_HTTP_CONTENT_TYPE); - if (ctlen > 0) { - if (lws_add_http_header_by_token(lws_get_parent(wsi), - WSI_TOKEN_HTTP_CONTENT_TYPE, - (unsigned char *)ctype, ctlen, &p, end)) - return 1; - } - - if (lws_finalize_http_header(lws_get_parent(wsi), &p, end)) - return 1; - - *p = '\0'; - n = lws_write(lws_get_parent(wsi), - (unsigned char *)buf + LWS_PRE, - p - ((unsigned char *)buf + LWS_PRE), - LWS_WRITE_HTTP_HEADERS); - if (n < 0) - return -1; - - break; } - -#endif - -#ifdef LWS_WITH_CGI - /* CGI IO events (POLLIN/OUT) appear here, our default policy is: - * - * - POST data goes on subprocess stdin - * - subprocess stdout goes on http via writeable callback - * - subprocess stderr goes to the logs - */ - case LWS_CALLBACK_CGI: - args = (struct lws_cgi_args *)in; - switch (args->ch) { /* which of stdin/out/err ? */ - case LWS_STDIN: - /* TBD stdin rx flow control */ - break; - case LWS_STDOUT: - /* quench POLLIN on STDOUT until MASTER got writeable */ - lws_rx_flow_control(args->stdwsi[LWS_STDOUT], 0); - wsi->reason_bf |= LWS_CB_REASON_AUX_BF__CGI; - /* when writing to MASTER would not block */ - lws_callback_on_writable(wsi); - break; - case LWS_STDERR: - n = lws_get_socket_fd(args->stdwsi[LWS_STDERR]); - if (n < 0) - break; - n = read(n, buf, sizeof(buf) - 2); - if (n > 0) { - if (buf[n - 1] != '\n') - buf[n++] = '\n'; - buf[n] = '\0'; - lwsl_notice("CGI-stderr: %s\n", buf); - } - break; - } - break; - - case LWS_CALLBACK_CGI_TERMINATED: - lwsl_debug("LWS_CALLBACK_CGI_TERMINATED: %d %" PRIu64 "\n", - wsi->http.cgi->explicitly_chunked, - (uint64_t)wsi->http.cgi->content_length); - if (!wsi->http.cgi->explicitly_chunked && - !wsi->http.cgi->content_length) { - /* send terminating chunk */ - lwsl_debug("LWS_CALLBACK_CGI_TERMINATED: ending\n"); - wsi->reason_bf |= LWS_CB_REASON_AUX_BF__CGI_CHUNK_END; - lws_callback_on_writable(wsi); - lws_set_timeout(wsi, PENDING_TIMEOUT_CGI, 3); - break; - } - return -1; - - case LWS_CALLBACK_CGI_STDIN_DATA: /* POST body for stdin */ - args = (struct lws_cgi_args *)in; - args->data[args->len] = '\0'; - n = lws_get_socket_fd(args->stdwsi[LWS_STDIN]); - if (n < 0) - return -1; - n = write(n, args->data, args->len); - if (n < args->len) - lwsl_notice("LWS_CALLBACK_CGI_STDIN_DATA: " - "sent %d only %d went", n, args->len); - return n; -#endif -#endif - case LWS_CALLBACK_SSL_INFO: - si = in; - - (void)si; - lwsl_notice("LWS_CALLBACK_SSL_INFO: where: 0x%x, ret: 0x%x\n", - si->where, si->ret); - break; - - default: - break; - } - - return 0; -} /* list of supported protocols and callbacks */ @@ -534,9 +367,6 @@ static const struct lws_protocols protocols_dummy[] = { #undef LWS_HAVE_GETENV #endif -static void -lws_vhost_destroy2(struct lws_vhost *vh); - LWS_VISIBLE struct lws_vhost * lws_create_vhost(struct lws_context *context, const struct lws_context_creation_info *info) @@ -595,6 +425,8 @@ lws_create_vhost(struct lws_context *context, vh->pvo = info->pvo; vh->headers = info->headers; vh->user = info->user; + vh->finalize = info->finalize; + vh->finalize_arg = info->finalize_arg; LWS_FOR_EVERY_AVAILABLE_ROLE_START(ar) if (ar->init_vhost) @@ -630,10 +462,12 @@ lws_create_vhost(struct lws_context *context, n += (int)strlen(info->ssl_private_key_filepath) + 1; if (n) { - vh->tls.key_path = vh->tls.alloc_cert_path = lws_malloc(n, "vh paths"); + vh->tls.key_path = vh->tls.alloc_cert_path = + lws_malloc(n, "vh paths"); if (info->ssl_cert_filepath) { n = (int)strlen(info->ssl_cert_filepath) + 1; - memcpy(vh->tls.alloc_cert_path, info->ssl_cert_filepath, n); + memcpy(vh->tls.alloc_cert_path, + info->ssl_cert_filepath, n); vh->tls.key_path += n; } if (info->ssl_private_key_filepath) @@ -648,7 +482,7 @@ lws_create_vhost(struct lws_context *context, */ lwsp = lws_zalloc(sizeof(struct lws_protocols) * (vh->count_protocols + context->plugin_protocol_count + 1), - "vhost-specific plugin table"); + "vhost-specific plugin table"); if (!lwsp) { lwsl_err("OOM\n"); return NULL; @@ -699,15 +533,15 @@ lws_create_vhost(struct lws_context *context, lws_free(lwsp); } - vh->same_vh_protocol_list = (struct lws **) - lws_zalloc(sizeof(struct lws *) * vh->count_protocols, - "same vh list"); + vh->same_vh_protocol_heads = (struct lws_dll_lws *) + lws_zalloc(sizeof(struct lws_dll_lws) * + vh->count_protocols, "same vh list"); #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) vh->http.mount_list = info->mounts; #endif #ifdef LWS_WITH_UNIX_SOCK - if (LWS_UNIX_SOCK_ENABLED(context)) { + if (LWS_UNIX_SOCK_ENABLED(vh)) { lwsl_notice("Creating Vhost '%s' path \"%s\", %d protocols\n", vh->name, vh->iface, vh->count_protocols); } else @@ -725,8 +559,8 @@ lws_create_vhost(struct lws_context *context, break; } lwsl_notice("Creating Vhost '%s' %s, %d protocols, IPv6 %s\n", - vh->name, buf, vh->count_protocols, - LWS_IPV6_ENABLED(vh) ? "on" : "off"); + vh->name, buf, vh->count_protocols, + LWS_IPV6_ENABLED(vh) ? "on" : "off"); } mounts = info->mounts; while (mounts) { @@ -833,7 +667,7 @@ lws_create_vhost(struct lws_context *context, lwsl_err("%s: lws_context_init_client_ssl failed\n", __func__); goto bail1; } - lws_context_lock(context); + lws_context_lock(context, "create_vhost"); n = _lws_vhost_init_server(info, vh); lws_context_unlock(context); if (n < 0) { @@ -841,7 +675,6 @@ lws_create_vhost(struct lws_context *context, goto bail1; } - while (1) { if (!(*vh1)) { *vh1 = vh; @@ -862,7 +695,6 @@ lws_create_vhost(struct lws_context *context, bail1: lws_vhost_destroy(vh); - lws_vhost_destroy2(vh); return NULL; @@ -927,7 +759,7 @@ lws_create_event_pipes(struct lws_context *context) wsi = lws_zalloc(sizeof(*wsi), "event pipe wsi"); if (!wsi) { - lwsl_err("Out of mem\n"); + lwsl_err("%s: Out of mem\n", __func__); return 1; } wsi->context = context; @@ -955,7 +787,8 @@ lws_create_event_pipes(struct lws_context *context) lwsl_debug("event pipe fd %d\n", wsi->desc.sockfd); if (context->event_loop_ops->accept) - context->event_loop_ops->accept(wsi); + if (context->event_loop_ops->accept(wsi)) + return 1; if (__insert_wsi_socket_into_fds(context, wsi)) return 1; @@ -973,6 +806,7 @@ lws_destroy_event_pipe(struct lws *wsi) if (wsi->context->event_loop_ops->wsi_logical_close) { wsi->context->event_loop_ops->wsi_logical_close(wsi); lws_plat_pipe_close(wsi); + wsi->context->count_wsi_allocated--; return; } @@ -996,13 +830,8 @@ lws_create_context(const struct lws_context_creation_info *info) struct rlimit rt; #endif - - lwsl_info("Initial logging level %d\n", log_level); lwsl_info("Libwebsockets version: %s\n", library_version); -#if defined(GCC_VER) - lwsl_info("Compiled with %s\n", GCC_VER); -#endif #ifdef LWS_WITH_IPV6 if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DISABLE_IPV6)) @@ -1053,7 +882,7 @@ lws_create_context(const struct lws_context_creation_info *info) #endif #if LWS_MAX_SMP > 1 - pthread_mutex_init(&context->lock, NULL); + lws_mutex_refcount_init(&context->mr); #endif #if defined(LWS_WITH_ESP32) @@ -1213,7 +1042,11 @@ lws_create_context(const struct lws_context_creation_info *info) if (info->max_http_header_pool) context->max_http_header_pool = info->max_http_header_pool; else - context->max_http_header_pool = context->max_fds; + if (info->max_http_header_pool2) + context->max_http_header_pool = + info->max_http_header_pool2; + else + context->max_http_header_pool = context->max_fds; if (info->fd_limit_per_thread) context->fd_limit_per_thread = info->fd_limit_per_thread; @@ -1251,16 +1084,17 @@ lws_create_context(const struct lws_context_creation_info *info) return NULL; } - #if defined(LWS_WITH_PEER_LIMITS) /* scale the peer hash table according to the max fds for the process, * so that the max list depth averages 16. Eg, 1024 fd -> 64, * 102400 fd -> 6400 */ + context->pl_hash_elements = (context->count_threads * context->fd_limit_per_thread) / 16; context->pl_hash_table = lws_zalloc(sizeof(struct lws_peer *) * context->pl_hash_elements, "peer limits hash table"); + context->ip_limit_ah = info->ip_limit_ah; context->ip_limit_wsi = info->ip_limit_wsi; #endif @@ -1404,7 +1238,6 @@ LWS_VISIBLE LWS_EXTERN void lws_context_deprecate(struct lws_context *context, lws_reload_func cb) { struct lws_vhost *vh = context->vhost_list, *vh1; - struct lws *wsi; /* * "deprecation" means disable the context from accepting any new @@ -1418,7 +1251,8 @@ lws_context_deprecate(struct lws_context *context, lws_reload_func cb) /* for each vhost, close his listen socket */ while (vh) { - wsi = vh->lserv_wsi; + struct lws *wsi = vh->lserv_wsi; + if (wsi) { wsi->socket_is_permanently_unusable = 1; lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, "ctx deprecate"); @@ -1450,24 +1284,29 @@ lws_context_is_deprecated(struct lws_context *context) void lws_vhost_destroy1(struct lws_vhost *vh) { - const struct lws_protocols *protocol = NULL; - struct lws_context_per_thread *pt; - int n, m = vh->context->count_threads; struct lws_context *context = vh->context; - struct lws wsi; lwsl_info("%s\n", __func__); + lws_context_lock(context, "vhost destroy 1"); /* ---------- context { */ + if (vh->being_destroyed) - return; + goto out; + + lws_vhost_lock(vh); /* -------------- vh { */ vh->being_destroyed = 1; /* + * PHASE 1: take down or reassign any listen wsi + * * Are there other vhosts that are piggybacking on our listen socket? * If so we need to hand the listen socket off to one of the others - * so it will remain open. If not, leave it attached to the closing - * vhost and it will get closed. + * so it will remain open. + * + * If not, leave it attached to the closing vhost, the vh being marked + * being_destroyed will defeat any service and it will get closed in + * later phases. */ if (vh->lserv_wsi) @@ -1488,46 +1327,48 @@ lws_vhost_destroy1(struct lws_vhost *vh) */ assert(v->lserv_wsi == NULL); v->lserv_wsi = vh->lserv_wsi; - vh->lserv_wsi = NULL; - if (v->lserv_wsi) - v->lserv_wsi->vhost = v; lwsl_notice("%s: listen skt from %s to %s\n", __func__, vh->name, v->name); + + if (v->lserv_wsi) { + lws_vhost_unbind_wsi(vh->lserv_wsi); + lws_vhost_bind_wsi(v, v->lserv_wsi); + } + break; } } lws_end_foreach_ll(v, vhost_next); + lws_vhost_unlock(vh); /* } vh -------------- */ + /* - * Forcibly close every wsi assoicated with this vhost. That will - * include the listen socket if it is still associated with the closing - * vhost. + * lws_check_deferred_free() will notice there is a vhost that is + * marked for destruction during the next 1s, for all tsi. + * + * It will start closing all wsi on this vhost. When the last wsi + * is closed, it will trigger lws_vhost_destroy2() */ - while (m--) { - pt = &context->pt[m]; - - for (n = 0; (unsigned int)n < context->pt[m].fds_count; n++) { - struct lws *wsi = wsi_from_fd(context, pt->fds[n].fd); - if (!wsi) - continue; - if (wsi->vhost != vh) - continue; +out: + lws_context_unlock(context); /* --------------------------- context { */ +} - lws_close_free_wsi(wsi, - LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY, - "vh destroy" - /* no protocol close */); - n--; - } - } +void +__lws_vhost_destroy2(struct lws_vhost *vh) +{ + const struct lws_protocols *protocol = NULL; + struct lws_context *context = vh->context; + struct lws_deferred_free *df; + struct lws wsi; + int n; /* * destroy any pending timed events */ while (vh->timed_vh_protocol_list) - lws_timed_callback_remove(vh, vh->timed_vh_protocol_list); + __lws_timed_callback_remove(vh, vh->timed_vh_protocol_list); /* * let the protocols destroy the per-vhost protocol objects @@ -1535,7 +1376,7 @@ lws_vhost_destroy1(struct lws_vhost *vh) memset(&wsi, 0, sizeof(wsi)); wsi.context = vh->context; - wsi.vhost = vh; + wsi.vhost = vh; /* not a real bound wsi */ protocol = vh->protocols; if (protocol && vh->created_vhost_protocols) { n = 0; @@ -1563,15 +1404,6 @@ lws_vhost_destroy1(struct lws_vhost *vh) vh->vhost_next = vh->context->vhost_pending_destruction_list; vh->context->vhost_pending_destruction_list = vh; -} - -static void -lws_vhost_destroy2(struct lws_vhost *vh) -{ - const struct lws_protocols *protocol = NULL; - struct lws_context *context = vh->context; - struct lws_deferred_free *df; - int n; lwsl_info("%s: %p\n", __func__, vh); @@ -1617,7 +1449,7 @@ lws_vhost_destroy2(struct lws_vhost *vh) if (vh->protocol_vh_privs) lws_free(vh->protocol_vh_privs); lws_ssl_SSL_CTX_destroy(vh); - lws_free(vh->same_vh_protocol_list); + lws_free(vh->same_vh_protocol_heads); if (context->plugin_list || (context->options & LWS_SERVER_OPTION_EXPLICIT_VHOSTS)) @@ -1642,7 +1474,7 @@ lws_vhost_destroy2(struct lws_vhost *vh) #endif #if defined(LWS_WITH_UNIX_SOCK) - if (LWS_UNIX_SOCK_ENABLED(context)) { + if (LWS_UNIX_SOCK_ENABLED(vh)) { n = unlink(vh->iface); if (n) lwsl_info("Closing unix socket %s: errno %d\n", @@ -1655,31 +1487,74 @@ lws_vhost_destroy2(struct lws_vhost *vh) * they do not refer to the vhost. So it's safe to free. */ + if (vh->finalize) + vh->finalize(vh, vh->finalize_arg); + lwsl_info(" %s: Freeing vhost %p\n", __func__, vh); memset(vh, 0, sizeof(*vh)); lws_free(vh); } +/* + * each service thread calls this once a second or so + */ + int -lws_check_deferred_free(struct lws_context *context, int force) +lws_check_deferred_free(struct lws_context *context, int tsi, int force) { - struct lws_deferred_free *df; - time_t now = lws_now_secs(); + struct lws_context_per_thread *pt; + int n; - lws_start_foreach_llp(struct lws_deferred_free **, pdf, - context->deferred_free_list) { - if (force || - lws_compare_time_t(context, now, (*pdf)->deadline) > 5) { - df = *pdf; - *pdf = df->next; - /* finalize vh destruction */ - lwsl_notice("deferred vh %p destroy\n", df->payload); - lws_vhost_destroy2(df->payload); - lws_free(df); - continue; /* after deletion we already point to next */ + /* + * If we see a vhost is being destroyed, forcibly close every wsi on + * this tsi associated with this vhost. That will include the listen + * socket if it is still associated with the closing vhost. + * + * For SMP, we do this once per tsi per destroyed vhost. The reference + * counting on the vhost as the bound wsi close will notice that there + * are no bound wsi left, that vhost destruction can complete, + * and perform it. It doesn't matter which service thread does that + * because there is nothing left using the vhost to conflict. + */ + + lws_context_lock(context, "check deferred free"); /* ------ context { */ + + lws_start_foreach_ll_safe(struct lws_vhost *, v, context->vhost_list, vhost_next) { + if (v->being_destroyed +#if LWS_MAX_SMP > 1 + && !v->close_flow_vs_tsi[tsi] +#endif + ) { + + pt = &context->pt[tsi]; + + lws_pt_lock(pt, "vhost removal"); /* -------------- pt { */ + +#if LWS_MAX_SMP > 1 + v->close_flow_vs_tsi[tsi] = 1; +#endif + + for (n = 0; (unsigned int)n < pt->fds_count; n++) { + struct lws *wsi = wsi_from_fd(context, pt->fds[n].fd); + if (!wsi) + continue; + if (wsi->vhost != v) + continue; + + __lws_close_free_wsi(wsi, + LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY, + "vh destroy" + /* no protocol close */); + n--; + } + + lws_pt_unlock(pt); /* } pt -------------- */ } - } lws_end_foreach_llp(pdf, next); + } lws_end_foreach_ll_safe(v); + + + lws_context_unlock(context); /* } context ------------------- */ return 0; } @@ -1688,18 +1563,38 @@ LWS_VISIBLE void lws_vhost_destroy(struct lws_vhost *vh) { struct lws_deferred_free *df = lws_malloc(sizeof(*df), "deferred free"); + struct lws_context *context = vh->context; if (!df) return; + lws_context_lock(context, __func__); /* ------ context { */ + lws_vhost_destroy1(vh); + if (!vh->count_bound_wsi) { + /* + * After listen handoff, there are already no wsi bound to this + * vhost by any pt: nothing can be servicing any wsi belonging + * to it any more. + * + * Finalize the vh destruction immediately + */ + __lws_vhost_destroy2(vh); + lws_free(df); + + goto out; + } + /* part 2 is deferred to allow all the handle closes to complete */ df->next = vh->context->deferred_free_list; df->deadline = lws_now_secs(); df->payload = vh; vh->context->deferred_free_list = df; + +out: + lws_context_unlock(context); /* } context ------------------- */ } /* @@ -1733,11 +1628,12 @@ static void lws_context_destroy3(struct lws_context *context) { struct lws_context **pcontext_finalize = context->pcontext_finalize; - struct lws_context_per_thread *pt; int n; for (n = 0; n < context->count_threads; n++) { - pt = &context->pt[n]; +#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) + struct lws_context_per_thread *pt = &context->pt[n]; +#endif if (context->event_loop_ops->destroy_pt) context->event_loop_ops->destroy_pt(context, n); @@ -1750,6 +1646,9 @@ lws_context_destroy3(struct lws_context *context) #endif } + if (context->pt[0].fds) + lws_free_set_NULL(context->pt[0].fds); + lws_free(context); lwsl_info("%s: ctx %p freed\n", __func__, context); @@ -1768,14 +1667,12 @@ lws_context_destroy2(struct lws_context *context) #if defined(LWS_WITH_PEER_LIMITS) uint32_t nu; #endif - int n; lwsl_info("%s: ctx %p\n", __func__, context); - context->being_destroyed2 = 1; + lws_context_lock(context, "context destroy 2"); /* ------ context { */ - if (context->pt[0].fds) - lws_free_set_NULL(context->pt[0].fds); + context->being_destroyed2 = 1; /* * free all the per-vhost allocations @@ -1784,7 +1681,7 @@ lws_context_destroy2(struct lws_context *context) vh = context->vhost_list; while (vh) { vh1 = vh->vhost_next; - lws_vhost_destroy2(vh); + __lws_vhost_destroy2(vh); vh = vh1; } @@ -1792,7 +1689,7 @@ lws_context_destroy2(struct lws_context *context) while (context->vhost_pending_destruction_list) /* removes itself from list */ - lws_vhost_destroy2(context->vhost_pending_destruction_list); + __lws_vhost_destroy2(context->vhost_pending_destruction_list); lws_stats_log_dump(context); @@ -1816,22 +1713,29 @@ lws_context_destroy2(struct lws_context *context) if (context->external_baggage_free_on_destroy) free(context->external_baggage_free_on_destroy); - lws_check_deferred_free(context, 1); + lws_check_deferred_free(context, 0, 1); #if LWS_MAX_SMP > 1 - pthread_mutex_destroy(&context->lock); + lws_mutex_refcount_destroy(&context->mr); #endif if (context->event_loop_ops->destroy_context2) if (context->event_loop_ops->destroy_context2(context)) { + lws_context_unlock(context); /* } context ----------- */ context->finalize_destroy_after_internal_loops_stopped = 1; return; } - if (!context->pt[0].event_loop_foreign) + if (!context->pt[0].event_loop_foreign) { + int n; for (n = 0; n < context->count_threads; n++) - if (context->pt[n].inside_service) + if (context->pt[n].inside_service) { + lws_context_unlock(context); /* } context --- */ return; + } + } + + lws_context_unlock(context); /* } context ------------------- */ lws_context_destroy3(context); } @@ -1845,7 +1749,6 @@ lws_context_destroy(struct lws_context *context) { volatile struct lws_foreign_thread_pollfd *ftp, *next; volatile struct lws_context_per_thread *vpt; - struct lws_context_per_thread *pt; struct lws_vhost *vh = NULL; struct lws wsi; int n, m; @@ -1891,7 +1794,7 @@ lws_context_destroy(struct lws_context *context) #endif while (m--) { - pt = &context->pt[m]; + struct lws_context_per_thread *pt = &context->pt[m]; vpt = (volatile struct lws_context_per_thread *)pt; ftp = vpt->foreign_pfd_list; diff --git a/thirdparty/libwebsockets/lib/core/dummy-callback.c b/thirdparty/libwebsockets/lib/core/dummy-callback.c new file mode 100644 index 0000000000..8fd18be9c5 --- /dev/null +++ b/thirdparty/libwebsockets/lib/core/dummy-callback.c @@ -0,0 +1,611 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include "core/private.h" + +#if defined(LWS_WITH_HTTP_PROXY) +static int +proxy_header(struct lws *wsi, struct lws *par, unsigned char *temp, + int temp_len, int index, unsigned char **p, unsigned char *end) +{ + int n = lws_hdr_total_length(par, index); + + if (n < 1) { + lwsl_debug("%s: no index %d:\n", __func__, index); + return 0; + } + + if (lws_hdr_copy(par, (char *)temp, temp_len, index) < 0) + return -1; + + lwsl_debug("%s: index %d: %s\n", __func__, index, (char *)temp); + + if (lws_add_http_header_by_token(wsi, index, temp, n, p, end)) + return -1; + + return 0; +} + +static int +stream_close(struct lws *wsi) +{ + char buf[LWS_PRE + 6], *out = buf + LWS_PRE; + + if (wsi->http.did_stream_close) + return 0; + + wsi->http.did_stream_close = 1; + + if (wsi->http2_substream) { + if (lws_write(wsi, (unsigned char *)buf + LWS_PRE, 0, + LWS_WRITE_HTTP_FINAL) < 0) { + lwsl_info("%s: COMPL_CLIENT_HTTP: h2 fin wr failed\n", + __func__); + + return -1; + } + } else { + *out++ = '0'; + *out++ = '\x0d'; + *out++ = '\x0a'; + *out++ = '\x0d'; + *out++ = '\x0a'; + + if (lws_write(wsi, (unsigned char *)buf + LWS_PRE, 5, + LWS_WRITE_HTTP_FINAL) < 0) { + lwsl_err("%s: COMPL_CLIENT_HTTP: " + "h2 final write failed\n", __func__); + + return -1; + } + } + + return 0; +} + +#endif + +LWS_VISIBLE int +lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, + void *user, void *in, size_t len) +{ + struct lws_ssl_info *si; +#ifdef LWS_WITH_CGI + struct lws_cgi_args *args; +#endif +#if defined(LWS_WITH_CGI) || defined(LWS_WITH_HTTP_PROXY) + char buf[8192]; + int n; +#endif +#if defined(LWS_WITH_HTTP_PROXY) + unsigned char **p, *end; + struct lws *parent; +#endif + + switch (reason) { +#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) + case LWS_CALLBACK_HTTP: +#ifndef LWS_NO_SERVER + if (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL)) + return -1; + + if (lws_http_transaction_completed(wsi)) +#endif + return -1; + break; +#if !defined(LWS_NO_SERVER) + case LWS_CALLBACK_HTTP_BODY_COMPLETION: + case LWS_CALLBACK_HTTP_FILE_COMPLETION: + if (lws_http_transaction_completed(wsi)) + return -1; + break; +#endif + + case LWS_CALLBACK_HTTP_WRITEABLE: +#ifdef LWS_WITH_CGI + if (wsi->reason_bf & (LWS_CB_REASON_AUX_BF__CGI_HEADERS | + LWS_CB_REASON_AUX_BF__CGI)) { + n = lws_cgi_write_split_stdout_headers(wsi); + if (n < 0) { + lwsl_debug("AUX_BF__CGI forcing close\n"); + return -1; + } + if (!n) + lws_rx_flow_control( + wsi->http.cgi->stdwsi[LWS_STDOUT], 1); + + if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__CGI_HEADERS) + wsi->reason_bf &= + ~LWS_CB_REASON_AUX_BF__CGI_HEADERS; + else + wsi->reason_bf &= ~LWS_CB_REASON_AUX_BF__CGI; + + if (wsi->http.cgi && wsi->http.cgi->cgi_transaction_over) + return -1; + break; + } + + if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__CGI_CHUNK_END) { + if (!wsi->http2_substream) { + memcpy(buf + LWS_PRE, "0\x0d\x0a\x0d\x0a", 5); + lwsl_debug("writing chunk term and exiting\n"); + n = lws_write(wsi, (unsigned char *)buf + + LWS_PRE, 5, LWS_WRITE_HTTP); + } else + n = lws_write(wsi, (unsigned char *)buf + + LWS_PRE, 0, + LWS_WRITE_HTTP_FINAL); + + /* always close after sending it */ + return -1; + } +#endif +#if defined(LWS_WITH_HTTP_PROXY) + + if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__PROXY_HEADERS) { + + wsi->reason_bf &= ~LWS_CB_REASON_AUX_BF__PROXY_HEADERS; + + lwsl_debug("%s: %p: issuing proxy headers\n", + __func__, wsi); + n = lws_write(wsi, wsi->http.pending_return_headers + + LWS_PRE, + wsi->http.pending_return_headers_len, + LWS_WRITE_HTTP_HEADERS); + + lws_free_set_NULL(wsi->http.pending_return_headers); + + if (n < 0) { + lwsl_err("%s: EST_CLIENT_HTTP: write failed\n", + __func__); + return -1; + } + lws_callback_on_writable(wsi); + break; + } + + if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__PROXY) { + char *px = buf + LWS_PRE; + int lenx = sizeof(buf) - LWS_PRE - 32; + + /* + * our sink is writeable and our source has something + * to read. So read a lump of source material of + * suitable size to send or what's available, whichever + * is the smaller. + */ + wsi->reason_bf &= ~LWS_CB_REASON_AUX_BF__PROXY; + if (!lws_get_child(wsi)) + break; + + /* this causes LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ */ + if (lws_http_client_read(lws_get_child(wsi), &px, + &lenx) < 0) { + lwsl_info("%s: LWS_CB_REASON_AUX_BF__PROXY: " + "client closed\n", __func__); + + stream_close(wsi); + + return -1; + } + break; + } + + if (wsi->reason_bf & LWS_CB_REASON_AUX_BF__PROXY_TRANS_END) { + lwsl_info("%s: LWS_CB_REASON_AUX_BF__PROXY_TRANS_END\n", + __func__); + + wsi->reason_bf &= ~LWS_CB_REASON_AUX_BF__PROXY_TRANS_END; + + if (stream_close(wsi)) + return -1; + + if (lws_http_transaction_completed(wsi)) + return -1; + } +#endif + break; + +#if defined(LWS_WITH_HTTP_PROXY) + case LWS_CALLBACK_RECEIVE_CLIENT_HTTP: + assert(lws_get_parent(wsi)); + if (!lws_get_parent(wsi)) + break; + lws_get_parent(wsi)->reason_bf |= LWS_CB_REASON_AUX_BF__PROXY; + lws_callback_on_writable(lws_get_parent(wsi)); + break; + + case LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ: { + char *out = buf + LWS_PRE; + + assert(lws_get_parent(wsi)); + + if (wsi->http.proxy_parent_chunked) { + + if (len > sizeof(buf) - LWS_PRE - 16) { + lwsl_err("oversize buf %d %d\n", (int)len, + (int)sizeof(buf) - LWS_PRE - 16); + return -1; + } + + /* + * this only needs dealing with on http/1.1 to allow + * pipelining + */ + n = lws_snprintf(out, 14, "%X\x0d\x0a", (int)len); + out += n; + memcpy(out, in, len); + out += len; + *out++ = '\x0d'; + *out++ = '\x0a'; + + n = lws_write(lws_get_parent(wsi), + (unsigned char *)buf + LWS_PRE, + len + n + 2, LWS_WRITE_HTTP); + } else + n = lws_write(lws_get_parent(wsi), (unsigned char *)in, + len, LWS_WRITE_HTTP); + if (n < 0) + return -1; + break; } + + + /* this handles the proxy case... */ + case LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP: { + unsigned char *start, *p, *end; + + /* + * We want to proxy these headers, but we are being called + * at the point the onward client was established, which is + * unrelated to the state or writability of our proxy + * connection. + * + * Therefore produce the headers using the onward client ah + * while we have it, and stick them on the output buflist to be + * written on the proxy connection as soon as convenient. + */ + + parent = lws_get_parent(wsi); + + if (!parent) + return 0; + + start = p = (unsigned char *)buf + LWS_PRE; + end = p + sizeof(buf) - LWS_PRE - 256; + + if (lws_add_http_header_status(lws_get_parent(wsi), + lws_http_client_http_response(wsi), &p, end)) + return 1; + + /* + * copy these headers from the client connection to the parent + */ + + proxy_header(parent, wsi, end, 256, + WSI_TOKEN_HTTP_CONTENT_LENGTH, &p, end); + proxy_header(parent, wsi, end, 256, + WSI_TOKEN_HTTP_CONTENT_TYPE, &p, end); + proxy_header(parent, wsi, end, 256, + WSI_TOKEN_HTTP_ETAG, &p, end); + proxy_header(parent, wsi, end, 256, + WSI_TOKEN_HTTP_ACCEPT_LANGUAGE, &p, end); + proxy_header(parent, wsi, end, 256, + WSI_TOKEN_HTTP_CONTENT_ENCODING, &p, end); + proxy_header(parent, wsi, end, 256, + WSI_TOKEN_HTTP_CACHE_CONTROL, &p, end); + + if (!parent->http2_substream) + if (lws_add_http_header_by_token(parent, + WSI_TOKEN_CONNECTION, (unsigned char *)"close", + 5, &p, end)) + return -1; + + /* + * We proxy using h1 only atm, and strip any chunking so it + * can go back out on h2 just fine. + * + * However if we are actually going out on h1, we need to add + * our own chunking since we still don't know the size. + */ + + if (!parent->http2_substream && + !lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH)) { + lwsl_debug("downstream parent chunked\n"); + if (lws_add_http_header_by_token(parent, + WSI_TOKEN_HTTP_TRANSFER_ENCODING, + (unsigned char *)"chunked", 7, &p, end)) + return -1; + + wsi->http.proxy_parent_chunked = 1; + } + + if (lws_finalize_http_header(parent, &p, end)) + return 1; + + parent->http.pending_return_headers_len = + lws_ptr_diff(p, start); + parent->http.pending_return_headers = + lws_malloc(parent->http.pending_return_headers_len + + LWS_PRE, "return proxy headers"); + if (!parent->http.pending_return_headers) + return -1; + + memcpy(parent->http.pending_return_headers + LWS_PRE, start, + parent->http.pending_return_headers_len); + + parent->reason_bf |= LWS_CB_REASON_AUX_BF__PROXY_HEADERS; + + lwsl_debug("%s: LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP: " + "prepared headers\n", __func__); + lws_callback_on_writable(parent); + + break; } + + case LWS_CALLBACK_COMPLETED_CLIENT_HTTP: + lwsl_info("%s: COMPLETED_CLIENT_HTTP: %p (parent %p)\n", + __func__, wsi, lws_get_parent(wsi)); + if (!lws_get_parent(wsi)) + break; + lws_get_parent(wsi)->reason_bf |= + LWS_CB_REASON_AUX_BF__PROXY_TRANS_END; + lws_callback_on_writable(lws_get_parent(wsi)); + break; + + case LWS_CALLBACK_CLOSED_CLIENT_HTTP: + if (!lws_get_parent(wsi)) + break; + lwsl_err("%s: LWS_CALLBACK_CLOSED_CLIENT_HTTP\n", __func__); + lws_set_timeout(lws_get_parent(wsi), LWS_TO_KILL_ASYNC, + PENDING_TIMEOUT_KILLED_BY_PROXY_CLIENT_CLOSE); + break; + + case LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: + parent = lws_get_parent(wsi); + + if (!parent) + break; + + p = (unsigned char **)in; + end = (*p) + len; + + /* + * copy these headers from the parent request to the client + * connection's request + */ + + proxy_header(wsi, parent, (unsigned char *)buf, sizeof(buf), + WSI_TOKEN_HOST, p, end); + proxy_header(wsi, parent, (unsigned char *)buf, sizeof(buf), + WSI_TOKEN_HTTP_ETAG, p, end); + proxy_header(wsi, parent, (unsigned char *)buf, sizeof(buf), + WSI_TOKEN_HTTP_IF_MODIFIED_SINCE, p, end); + proxy_header(wsi, parent, (unsigned char *)buf, sizeof(buf), + WSI_TOKEN_HTTP_ACCEPT_LANGUAGE, p, end); + proxy_header(wsi, parent, (unsigned char *)buf, sizeof(buf), + WSI_TOKEN_HTTP_ACCEPT_ENCODING, p, end); + proxy_header(wsi, parent, (unsigned char *)buf, sizeof(buf), + WSI_TOKEN_HTTP_CACHE_CONTROL, p, end); + + buf[0] = '\0'; + lws_get_peer_simple(parent, buf, sizeof(buf)); + if (lws_add_http_header_by_token(wsi, WSI_TOKEN_X_FORWARDED_FOR, + (unsigned char *)buf, (int)strlen(buf), p, end)) + return -1; + + break; + +#endif + +#ifdef LWS_WITH_CGI + /* CGI IO events (POLLIN/OUT) appear here, our default policy is: + * + * - POST data goes on subprocess stdin + * - subprocess stdout goes on http via writeable callback + * - subprocess stderr goes to the logs + */ + case LWS_CALLBACK_CGI: + args = (struct lws_cgi_args *)in; + switch (args->ch) { /* which of stdin/out/err ? */ + case LWS_STDIN: + /* TBD stdin rx flow control */ + break; + case LWS_STDOUT: + /* quench POLLIN on STDOUT until MASTER got writeable */ + lws_rx_flow_control(args->stdwsi[LWS_STDOUT], 0); + wsi->reason_bf |= LWS_CB_REASON_AUX_BF__CGI; + /* when writing to MASTER would not block */ + lws_callback_on_writable(wsi); + break; + case LWS_STDERR: + n = lws_get_socket_fd(args->stdwsi[LWS_STDERR]); + if (n < 0) + break; + n = read(n, buf, sizeof(buf) - 2); + if (n > 0) { + if (buf[n - 1] != '\n') + buf[n++] = '\n'; + buf[n] = '\0'; + lwsl_notice("CGI-stderr: %s\n", buf); + } + break; + } + break; + + case LWS_CALLBACK_CGI_TERMINATED: + lwsl_debug("LWS_CALLBACK_CGI_TERMINATED: %d %" PRIu64 "\n", + wsi->http.cgi->explicitly_chunked, + (uint64_t)wsi->http.cgi->content_length); + if (!wsi->http.cgi->explicitly_chunked && + !wsi->http.cgi->content_length) { + /* send terminating chunk */ + lwsl_debug("LWS_CALLBACK_CGI_TERMINATED: ending\n"); + wsi->reason_bf |= LWS_CB_REASON_AUX_BF__CGI_CHUNK_END; + lws_callback_on_writable(wsi); + lws_set_timeout(wsi, PENDING_TIMEOUT_CGI, 3); + break; + } + return -1; + + case LWS_CALLBACK_CGI_STDIN_DATA: /* POST body for stdin */ + args = (struct lws_cgi_args *)in; + args->data[args->len] = '\0'; + if (!args->stdwsi[LWS_STDIN]) + return -1; + n = lws_get_socket_fd(args->stdwsi[LWS_STDIN]); + if (n < 0) + return -1; + +#if defined(LWS_WITH_ZLIB) + if (wsi->http.cgi->gzip_inflate) { + /* gzip handling */ + + if (!wsi->http.cgi->gzip_init) { + lwsl_info("inflating gzip\n"); + + memset(&wsi->http.cgi->inflate, 0, + sizeof(wsi->http.cgi->inflate)); + + if (inflateInit2(&wsi->http.cgi->inflate, + 16 + 15) != Z_OK) { + lwsl_err("%s: iniflateInit failed\n", + __func__); + return -1; + } + + wsi->http.cgi->gzip_init = 1; + } + + wsi->http.cgi->inflate.next_in = args->data; + wsi->http.cgi->inflate.avail_in = args->len; + + do { + + wsi->http.cgi->inflate.next_out = + wsi->http.cgi->inflate_buf; + wsi->http.cgi->inflate.avail_out = + sizeof(wsi->http.cgi->inflate_buf); + + n = inflate(&wsi->http.cgi->inflate, + Z_SYNC_FLUSH); + + switch (n) { + case Z_NEED_DICT: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_MEM_ERROR: + inflateEnd(&wsi->http.cgi->inflate); + wsi->http.cgi->gzip_init = 0; + lwsl_err("zlib error inflate %d\n", n); + return -1; + } + + if (wsi->http.cgi->inflate.avail_out != + sizeof(wsi->http.cgi->inflate_buf)) { + int written; + + written = write(args->stdwsi[LWS_STDIN]->desc.filefd, + wsi->http.cgi->inflate_buf, + sizeof(wsi->http.cgi->inflate_buf) - + wsi->http.cgi->inflate.avail_out); + + if (written != (int)( + sizeof(wsi->http.cgi->inflate_buf) - + wsi->http.cgi->inflate.avail_out)) { + lwsl_notice("LWS_CALLBACK_CGI_STDIN_DATA: " + "sent %d only %d went", n, args->len); + } + + if (n == Z_STREAM_END) { + lwsl_err("gzip inflate end\n"); + inflateEnd(&wsi->http.cgi->inflate); + wsi->http.cgi->gzip_init = 0; + break; + } + + } else + break; + + if (wsi->http.cgi->inflate.avail_out) + break; + + } while (1); + + return args->len; + } +#endif /* WITH_ZLIB */ + + n = write(n, args->data, args->len); +// lwsl_hexdump_notice(args->data, args->len); + if (n < args->len) + lwsl_notice("LWS_CALLBACK_CGI_STDIN_DATA: " + "sent %d only %d went", n, args->len); + + if (wsi->http.cgi->post_in_expected && args->stdwsi[LWS_STDIN] && + args->stdwsi[LWS_STDIN]->desc.filefd > 0) { + wsi->http.cgi->post_in_expected -= n; + if (!wsi->http.cgi->post_in_expected) { + struct lws *siwsi = args->stdwsi[LWS_STDIN]; + + lwsl_debug("%s: expected POST in end: " + "closing stdin wsi %p, fd %d\n", + __func__, siwsi, siwsi->desc.sockfd); + + __remove_wsi_socket_from_fds(siwsi); + lwsi_set_state(siwsi, LRS_DEAD_SOCKET); + siwsi->socket_is_permanently_unusable = 1; + lws_remove_child_from_any_parent(siwsi); + if (wsi->context->event_loop_ops-> + close_handle_manually) { + wsi->context->event_loop_ops-> + close_handle_manually(siwsi); + siwsi->told_event_loop_closed = 1; + } else { + compatible_close(siwsi->desc.sockfd); + __lws_free_wsi(siwsi); + } + wsi->http.cgi->pipe_fds[LWS_STDIN][1] = -1; + + args->stdwsi[LWS_STDIN] = NULL; + } + } + + return n; +#endif /* WITH_CGI */ +#endif /* ROLE_ H1 / H2 */ + case LWS_CALLBACK_SSL_INFO: + si = in; + + (void)si; + lwsl_notice("LWS_CALLBACK_SSL_INFO: where: 0x%x, ret: 0x%x\n", + si->where, si->ret); + break; + +#if LWS_MAX_SMP > 1 + case LWS_CALLBACK_GET_THREAD_ID: + return (int)(unsigned long long)pthread_self(); +#endif + + default: + break; + } + + return 0; +} diff --git a/thirdparty/libwebsockets/core/libwebsockets.c b/thirdparty/libwebsockets/lib/core/libwebsockets.c index 58f00226f6..972422114a 100644 --- a/thirdparty/libwebsockets/core/libwebsockets.c +++ b/thirdparty/libwebsockets/lib/core/libwebsockets.c @@ -53,11 +53,42 @@ static const char * const log_level_names[] = { "CLIENT", "LATENCY", "USER", + "THREAD", "?", "?" }; #endif +#if defined (_DEBUG) +void lwsi_set_role(struct lws *wsi, lws_wsi_state_t role) +{ + wsi->wsistate = (wsi->wsistate & (~LWSI_ROLE_MASK)) | role; + + lwsl_debug("lwsi_set_role(%p, 0x%x)\n", wsi, wsi->wsistate); +} + +void lwsi_set_state(struct lws *wsi, lws_wsi_state_t lrs) +{ + wsi->wsistate = (wsi->wsistate & (~LRS_MASK)) | lrs; + + lwsl_debug("lwsi_set_state(%p, 0x%x)\n", wsi, wsi->wsistate); +} +#endif + +signed char char_to_hex(const char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + + if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + + return -1; +} + int lws_open(const char *__file, int __oflag, ...) { va_list ap; @@ -75,39 +106,56 @@ int lws_open(const char *__file, int __oflag, ...) n = open(__file, __oflag); va_end(ap); - lws_plat_apply_FD_CLOEXEC(n); + if (n != -1 && lws_plat_apply_FD_CLOEXEC(n)) { + close(n); + + return -1; + } return n; } -#if defined (_DEBUG) -void lwsi_set_role(struct lws *wsi, lws_wsi_state_t role) +void +lws_vhost_bind_wsi(struct lws_vhost *vh, struct lws *wsi) { - wsi->wsistate = (wsi->wsistate & (~LWSI_ROLE_MASK)) | role; - - lwsl_debug("lwsi_set_role(%p, 0x%x)\n", wsi, wsi->wsistate); + if (wsi->vhost == vh) + return; + lws_context_lock(vh->context, __func__); /* ---------- context { */ + wsi->vhost = vh; + vh->count_bound_wsi++; + lws_context_unlock(vh->context); /* } context ---------- */ + lwsl_info("%s: vh %s: count_bound_wsi %d\n", + __func__, vh->name, vh->count_bound_wsi); + assert(wsi->vhost->count_bound_wsi > 0); } -void lwsi_set_state(struct lws *wsi, lws_wsi_state_t lrs) +void +lws_vhost_unbind_wsi(struct lws *wsi) { - wsi->wsistate = (wsi->wsistate & (~LRS_MASK)) | lrs; - - lwsl_debug("lwsi_set_state(%p, 0x%x)\n", wsi, wsi->wsistate); -} -#endif + if (!wsi->vhost) + return; -signed char char_to_hex(const char c) -{ - if (c >= '0' && c <= '9') - return c - '0'; + lws_context_lock(wsi->context, __func__); /* ---------- context { */ - if (c >= 'a' && c <= 'f') - return c - 'a' + 10; + assert(wsi->vhost->count_bound_wsi > 0); + wsi->vhost->count_bound_wsi--; + lwsl_info("%s: vh %s: count_bound_wsi %d\n", __func__, + wsi->vhost->name, wsi->vhost->count_bound_wsi); - if (c >= 'A' && c <= 'F') - return c - 'A' + 10; + if (!wsi->vhost->count_bound_wsi && + wsi->vhost->being_destroyed) { + /* + * We have closed all wsi that were bound to this vhost + * by any pt: nothing can be servicing any wsi belonging + * to it any more. + * + * Finalize the vh destruction + */ + __lws_vhost_destroy2(wsi->vhost); + } + wsi->vhost = NULL; - return -1; + lws_context_unlock(wsi->context); /* } context ---------- */ } void @@ -125,13 +173,24 @@ __lws_free_wsi(struct lws *wsi) lws_free(wsi->user_space); lws_buflist_destroy_all_segments(&wsi->buflist); - lws_free_set_NULL(wsi->trunc_alloc); + lws_buflist_destroy_all_segments(&wsi->buflist_out); lws_free_set_NULL(wsi->udp); if (wsi->vhost && wsi->vhost->lserv_wsi == wsi) wsi->vhost->lserv_wsi = NULL; +#if !defined(LWS_NO_CLIENT) + lws_dll_lws_remove(&wsi->dll_active_client_conns); +#endif + wsi->context->count_wsi_allocated--; - // lws_peer_dump_from_wsi(wsi); +#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) + __lws_header_table_detach(wsi, 0); +#endif + __lws_same_vh_protocol_remove(wsi); +#if !defined(LWS_NO_CLIENT) + lws_client_stash_destroy(wsi); + lws_free_set_NULL(wsi->client_hostname_copy); +#endif if (wsi->role_ops->destroy_role) wsi->role_ops->destroy_role(wsi); @@ -151,7 +210,8 @@ __lws_free_wsi(struct lws *wsi) if (wsi->context->event_loop_ops->destroy_wsi) wsi->context->event_loop_ops->destroy_wsi(wsi); - wsi->context->count_wsi_allocated--; + lws_vhost_unbind_wsi(wsi); + lwsl_debug("%s: %p, remaining wsi %d\n", __func__, wsi, wsi->context->count_wsi_allocated); @@ -327,6 +387,15 @@ __lws_set_timer_usecs(struct lws *wsi, lws_usec_t usecs) // lws_dll_dump(&pt->dll_head_hrtimer, "after set_timer_usec"); } +LWS_VISIBLE lws_usec_t +lws_now_usecs(void) +{ + struct timeval now; + + gettimeofday(&now, NULL); + return (now.tv_sec * 1000000ll) + now.tv_usec; +} + LWS_VISIBLE void lws_set_timer_usecs(struct lws *wsi, lws_usec_t usecs) { @@ -370,7 +439,8 @@ __lws_hrtimer_service(struct lws_context_per_thread *pt) if (!pt->dll_head_hrtimer.next) return LWS_HRTIMER_NOWAIT; - wsi = lws_container_of(pt->dll_head_hrtimer.next, struct lws, dll_hrtimer); + wsi = lws_container_of(pt->dll_head_hrtimer.next, struct lws, + dll_hrtimer); gettimeofday(&now, NULL); t = (now.tv_sec * 1000000ll) + now.tv_usec; @@ -389,7 +459,7 @@ __lws_set_timeout(struct lws *wsi, enum pending_timeout reason, int secs) time(&now); - lwsl_debug("%s: %p: %d secs\n", __func__, wsi, secs); + lwsl_debug("%s: %p: %d secs (reason %d)\n", __func__, wsi, secs, reason); wsi->pending_timeout_limit = secs; wsi->pending_timeout_set = now; wsi->pending_timeout = reason; @@ -408,7 +478,8 @@ lws_set_timeout(struct lws *wsi, enum pending_timeout reason, int secs) if (secs == LWS_TO_KILL_SYNC) { lws_remove_from_timeout_list(wsi); lwsl_debug("synchronously killing %p\n", wsi); - lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, "to sync kill"); + lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, + "to sync kill"); return; } @@ -420,8 +491,10 @@ lws_set_timeout(struct lws *wsi, enum pending_timeout reason, int secs) lws_pt_unlock(pt); } +/* requires context + vh lock */ + int -lws_timed_callback_remove(struct lws_vhost *vh, struct lws_timed_vh_protocol *p) +__lws_timed_callback_remove(struct lws_vhost *vh, struct lws_timed_vh_protocol *p) { lws_start_foreach_llp(struct lws_timed_vh_protocol **, pt, vh->timed_vh_protocol_list) { @@ -436,9 +509,30 @@ lws_timed_callback_remove(struct lws_vhost *vh, struct lws_timed_vh_protocol *p) return 1; } +int +lws_pthread_self_to_tsi(struct lws_context *context) +{ +#if LWS_MAX_SMP > 1 + pthread_t ps = pthread_self(); + struct lws_context_per_thread *pt = &context->pt[0]; + int n; + + for (n = 0; n < context->count_threads; n++) { + if (pthread_equal(ps, pt->self)) + return n; + pt++; + } + + return -1; +#else + return 0; +#endif +} + LWS_VISIBLE LWS_EXTERN int -lws_timed_callback_vh_protocol(struct lws_vhost *vh, const struct lws_protocols *prot, - int reason, int secs) +lws_timed_callback_vh_protocol(struct lws_vhost *vh, + const struct lws_protocols *prot, int reason, + int secs) { struct lws_timed_vh_protocol *p = (struct lws_timed_vh_protocol *) lws_malloc(sizeof(*p), "timed_vh"); @@ -446,17 +540,27 @@ lws_timed_callback_vh_protocol(struct lws_vhost *vh, const struct lws_protocols if (!p) return 1; + p->tsi_req = lws_pthread_self_to_tsi(vh->context); + if (p->tsi_req < 0) /* not called from a service thread --> tsi 0 */ + p->tsi_req = 0; + + lws_context_lock(vh->context, __func__); /* context ----------------- */ + p->protocol = prot; p->reason = reason; p->time = lws_now_secs() + secs; - p->next = vh->timed_vh_protocol_list; + lws_vhost_lock(vh); /* vhost ---------------------------------------- */ + p->next = vh->timed_vh_protocol_list; vh->timed_vh_protocol_list = p; + lws_vhost_unlock(vh); /* -------------------------------------- vhost */ + + lws_context_unlock(vh->context); /* ------------------------- context */ return 0; } -static void +void lws_remove_child_from_any_parent(struct lws *wsi) { struct lws **pwsi; @@ -490,15 +594,17 @@ lws_remove_child_from_any_parent(struct lws *wsi) } int -lws_bind_protocol(struct lws *wsi, const struct lws_protocols *p) +lws_bind_protocol(struct lws *wsi, const struct lws_protocols *p, + const char *reason) { // if (wsi->protocol == p) // return 0; const struct lws_protocols *vp = wsi->vhost->protocols, *vpo; if (wsi->protocol && wsi->protocol_bind_balance) { - wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP_DROP_PROTOCOL, - wsi->user_space, NULL, 0); + wsi->protocol->callback(wsi, + wsi->role_ops->protocol_unbind_cb[!!lwsi_role_server(wsi)], + wsi->user_space, (void *)reason, 0); wsi->protocol_bind_balance = 0; } if (!wsi->user_space_externally_allocated) @@ -534,7 +640,8 @@ lws_bind_protocol(struct lws *wsi, const struct lws_protocols *p) __func__, p, wsi->vhost->name); } - if (wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP_BIND_PROTOCOL, + if (wsi->protocol->callback(wsi, wsi->role_ops->protocol_bind_cb[ + !!lwsi_role_server(wsi)], wsi->user_space, NULL, 0)) return 1; @@ -544,7 +651,8 @@ lws_bind_protocol(struct lws *wsi, const struct lws_protocols *p) } void -__lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char *caller) +__lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, + const char *caller) { struct lws_context_per_thread *pt; struct lws *wsi1, *wsi2; @@ -576,20 +684,21 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char * if ((int)reason != -1) lws_vhost_lock(wsi->vhost); lws_start_foreach_dll_safe(struct lws_dll_lws *, d, d1, - wsi->dll_client_transaction_queue_head.next) { + wsi->dll_client_transaction_queue_head.next) { struct lws *w = lws_container_of(d, struct lws, - dll_client_transaction_queue); + dll_client_transaction_queue); __lws_close_free_wsi(w, -1, "trans q leader closing"); } lws_end_foreach_dll_safe(d, d1); /* - * !!! If we are closing, but we have pending pipelined transaction - * results we already sent headers for, that's going to destroy sync - * for HTTP/1 and leave H2 stream with no live swsi. + * !!! If we are closing, but we have pending pipelined + * transaction results we already sent headers for, that's going + * to destroy sync for HTTP/1 and leave H2 stream with no live + * swsi. * - * However this is normal if we are being closed because the transaction - * queue leader is closing. + * However this is normal if we are being closed because the + * transaction queue leader is closing. */ lws_dll_lws_remove(&wsi->dll_client_transaction_queue); if ((int)reason !=-1) @@ -605,7 +714,8 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char * wsi2->parent = NULL; /* stop it doing shutdown processing */ wsi2->socket_is_permanently_unusable = 1; - __lws_close_free_wsi(wsi2, reason, "general child recurse"); + __lws_close_free_wsi(wsi2, reason, + "general child recurse"); wsi2 = wsi1; } wsi->child_list = NULL; @@ -630,7 +740,8 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char * lws_cgi_remove_and_kill(wsi->parent); /* end the binding between us and master */ - wsi->parent->http.cgi->stdwsi[(int)wsi->cgi_channel] = NULL; + wsi->parent->http.cgi->stdwsi[(int)wsi->cgi_channel] = + NULL; } wsi->socket_is_permanently_unusable = 1; @@ -674,14 +785,24 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char * goto just_kill_connection; case LRS_FLUSHING_BEFORE_CLOSE: - if (wsi->trunc_len) { + if (lws_has_buffered_out(wsi) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + || wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more +#endif + ) { lws_callback_on_writable(wsi); return; } lwsl_info("%p: end LRS_FLUSHING_BEFORE_CLOSE\n", wsi); goto just_kill_connection; default: - if (wsi->trunc_len) { + if (lws_has_buffered_out(wsi) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + || wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more +#endif + ) { lwsl_info("%p: LRS_FLUSHING_BEFORE_CLOSE\n", wsi); lwsi_set_state(wsi, LRS_FLUSHING_BEFORE_CLOSE); __lws_set_timeout(wsi, @@ -695,15 +816,13 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char * lwsi_state(wsi) == LRS_H1C_ISSUE_HANDSHAKE) goto just_kill_connection; - if (!wsi->told_user_closed && lwsi_role_http(wsi) && - lwsi_role_server(wsi)) { - if (wsi->user_space && wsi->protocol && - wsi->protocol_bind_balance) { - wsi->protocol->callback(wsi, - LWS_CALLBACK_HTTP_DROP_PROTOCOL, - wsi->user_space, NULL, 0); - wsi->protocol_bind_balance = 0; - } + if (!wsi->told_user_closed && wsi->user_space && wsi->protocol && + wsi->protocol_bind_balance) { + wsi->protocol->callback(wsi, + wsi->role_ops->protocol_unbind_cb[ + !!lwsi_role_server(wsi)], + wsi->user_space, (void *)__func__, 0); + wsi->protocol_bind_balance = 0; } /* @@ -734,8 +853,10 @@ just_kill_connection: wsi->protocol_bind_balance) { lwsl_debug("%s: %p: DROP_PROTOCOL %s\n", __func__, wsi, wsi->protocol->name); - wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP_DROP_PROTOCOL, - wsi->user_space, NULL, 0); + wsi->protocol->callback(wsi, + wsi->role_ops->protocol_unbind_cb[ + !!lwsi_role_server(wsi)], + wsi->user_space, (void *)__func__, 0); wsi->protocol_bind_balance = 0; } @@ -772,7 +893,7 @@ just_kill_connection: } else #endif { - lwsl_info("%s: shutdown conn: %p (sock %d, state 0x%x)\n", + lwsl_info("%s: shutdown conn: %p (sk %d, state 0x%x)\n", __func__, wsi, (int)(long)wsi->desc.sockfd, lwsi_state(wsi)); if (!wsi->socket_is_permanently_unusable && @@ -808,12 +929,16 @@ just_kill_connection: lwsl_debug("%s: real just_kill_connection: %p (sockfd %d)\n", __func__, wsi, wsi->desc.sockfd); -#ifdef LWS_WITH_HTTP_PROXY +#ifdef LWS_WITH_HUBBUB if (wsi->http.rw) { lws_rewrite_destroy(wsi->http.rw); wsi->http.rw = NULL; } #endif + + if (wsi->http.pending_return_headers) + lws_free_set_NULL(wsi->http.pending_return_headers); + /* * we won't be servicing or receiving anything further from this guy * delete socket from the internal poll list if still present @@ -830,7 +955,7 @@ just_kill_connection: if (wsi->desc.sockfd != LWS_SOCK_INVALID) __remove_wsi_socket_from_fds(wsi); else - lws_same_vh_protocol_remove(wsi); + __lws_same_vh_protocol_remove(wsi); lwsi_set_state(wsi, LRS_DEAD_SOCKET); lws_buflist_destroy_all_segments(&wsi->buflist); @@ -841,7 +966,9 @@ just_kill_connection: /* tell the user it's all over for this guy */ - if (lwsi_state_est_PRE_CLOSE(wsi) && !wsi->told_user_closed && + if ((lwsi_state_est_PRE_CLOSE(wsi) || + lwsi_state_PRE_CLOSE(wsi) == LRS_WAITING_SERVER_REPLY) && + !wsi->told_user_closed && wsi->role_ops->close_cb[lwsi_role_server(wsi)]) { const struct lws_protocols *pro = wsi->protocol; @@ -877,7 +1004,9 @@ __lws_close_free_wsi_final(struct lws *wsi) { int n; - if (lws_socket_is_valid(wsi->desc.sockfd) && !lws_ssl_close(wsi)) { + if (!wsi->shadow && + lws_socket_is_valid(wsi->desc.sockfd) && !lws_ssl_close(wsi)) { + lwsl_debug("%s: wsi %p: fd %d\n", __func__, wsi, wsi->desc.sockfd); n = compatible_close(wsi->desc.sockfd); if (n) lwsl_debug("closing: close ret %d\n", LWS_ERRNO); @@ -944,8 +1073,7 @@ lws_buflist_append_segment(struct lws_buflist **head, const uint8_t *buf, lwsl_info("%s: len %u first %d %p\n", __func__, (uint32_t)len, first, p); - nbuf = (struct lws_buflist *) - lws_malloc(sizeof(**head) + len, __func__); + nbuf = (struct lws_buflist *)lws_malloc(sizeof(**head) + len, __func__); if (!nbuf) { lwsl_err("%s: OOM\n", __func__); return -1; @@ -1179,9 +1307,6 @@ lws_get_peer_simple(struct lws *wsi, char *name, int namelen) wsi = lws_get_network_wsi(wsi); - if (wsi->parent_carries_io) - wsi = wsi->parent; - #ifdef LWS_WITH_IPV6 if (LWS_IPV6_ENABLED(wsi->vhost)) { len = sizeof(sin6); @@ -1298,7 +1423,11 @@ lws_get_network_wsi(struct lws *wsi) return NULL; #if defined(LWS_WITH_HTTP2) - if (!wsi->http2_substream && !wsi->client_h2_substream) + if (!wsi->http2_substream +#if !defined(LWS_NO_CLIENT) + && !wsi->client_h2_substream +#endif + ) return wsi; while (wsi->h2.parent_wsi) @@ -1396,7 +1525,7 @@ lws_callback_vhost_protocols_vhost(struct lws_vhost *vh, int reason, void *in, struct lws *wsi = lws_zalloc(sizeof(*wsi), "fake wsi"); wsi->context = vh->context; - wsi->vhost = vh; + lws_vhost_bind_wsi(vh, wsi); for (n = 0; n < wsi->vhost->count_protocols; n++) { wsi->protocol = &vh->protocols[n]; @@ -1486,8 +1615,8 @@ lws_vfs_select_fops(const struct lws_plat_file_ops *fops, const char *vfs_path, while (n < (int)LWS_ARRAY_SIZE(pf->fi) && pf->fi[n].sig) { if (p >= vfs_path + pf->fi[n].len) if (!strncmp(p - (pf->fi[n].len - 1), - pf->fi[n].sig, - pf->fi[n].len - 1)) { + pf->fi[n].sig, + pf->fi[n].len - 1)) { *vpath = p + 1; return pf; } @@ -1557,7 +1686,7 @@ lws_latency(struct lws_context *context, struct lws *wsi, const char *action, unsigned long long u; char buf[256]; - u = time_in_microseconds(); + u = lws_time_in_microseconds(); if (!action) { wsi->latency_start = u; @@ -1625,7 +1754,8 @@ lws_rx_flow_control(struct lws *wsi, int _enable) wsi->rxflow_change_to) goto skip; - wsi->rxflow_change_to = LWS_RXFLOW_PENDING_CHANGE | !wsi->rxflow_bitmap; + wsi->rxflow_change_to = LWS_RXFLOW_PENDING_CHANGE | + (!wsi->rxflow_bitmap); lwsl_info("%s: %p: bitmap 0x%x: en 0x%x, ch 0x%x\n", __func__, wsi, wsi->rxflow_bitmap, en, wsi->rxflow_change_to); @@ -1676,7 +1806,7 @@ lws_broadcast(struct lws_context *context, int reason, void *in, size_t len) while (v) { const struct lws_protocols *p = v->protocols; - wsi.vhost = v; + wsi.vhost = v; /* not a real bound wsi */ for (n = 0; n < v->count_protocols; n++) { wsi.protocol = p; @@ -1766,7 +1896,9 @@ lws_set_proxy(struct lws_vhost *vhost, const char *proxy) lwsl_info(" Proxy auth in use\n"); +#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) proxy = p + 1; +#endif } else vhost->proxy_basic_auth_token[0] = '\0'; @@ -1913,7 +2045,9 @@ LWS_VISIBLE int lwsl_timestamp(int level, char *p, int len) { #ifndef LWS_PLAT_OPTEE +#ifndef _WIN32_WCE time_t o_now = time(NULL); +#endif unsigned long long now; struct tm *ptm = NULL; #ifndef WIN32 @@ -1933,7 +2067,7 @@ lwsl_timestamp(int level, char *p, int len) for (n = 0; n < LLL_COUNT; n++) { if (level != (1 << n)) continue; - now = time_in_microseconds() / 100; + now = lws_time_in_microseconds() / 100; if (ptm) n = lws_snprintf(p, len, "[%04d/%02d/%02d %02d:%02d:%02d:%04d] %s: ", @@ -1970,12 +2104,15 @@ static const char * const colours[] = { "[33m", /* LLL_CLIENT */ "[33;1m", /* LLL_LATENCY */ "[30;1m", /* LLL_USER */ + "[31m", /* LLL_THREAD */ }; -LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line) +static char tty; + +LWS_VISIBLE void +lwsl_emit_stderr(int level, const char *line) { char buf[50]; - static char tty = 3; int n, m = LWS_ARRAY_SIZE(colours) - 1; if (!tty) @@ -1994,6 +2131,28 @@ LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line) } else fprintf(stderr, "%s%s", buf, line); } + +LWS_VISIBLE void +lwsl_emit_stderr_notimestamp(int level, const char *line) +{ + int n, m = LWS_ARRAY_SIZE(colours) - 1; + + if (!tty) + tty = isatty(2) | 2; + + if (tty == 3) { + n = 1 << (LWS_ARRAY_SIZE(colours) - 1); + while (n) { + if (level & n) + break; + m--; + n >>= 1; + } + fprintf(stderr, "%c%s%s%c[0m", 27, colours[m], line, 27); + } else + fprintf(stderr, "%s", line); +} + #endif LWS_VISIBLE void _lws_logv(int filter, const char *format, va_list vl) @@ -2007,8 +2166,14 @@ LWS_VISIBLE void _lws_logv(int filter, const char *format, va_list vl) n = vsnprintf(buf, sizeof(buf) - 1, format, vl); (void)n; /* vnsprintf returns what it would have written, even if truncated */ - if (n > (int)sizeof(buf) - 1) - n = sizeof(buf) - 1; + if (n > (int)sizeof(buf) - 1) { + n = sizeof(buf) - 5; + buf[n++] = '.'; + buf[n++] = '.'; + buf[n++] = '.'; + buf[n++] = '\n'; + buf[n] = '\0'; + } if (n > 0) buf[n] = '\0'; @@ -2041,9 +2206,7 @@ LWS_VISIBLE void lwsl_hexdump_level(int hexdump_level, const void *vbuf, size_t len) { unsigned char *buf = (unsigned char *)vbuf; - unsigned int n, m, start; - char line[80]; - char *p; + unsigned int n; if (!lwsl_visible(hexdump_level)) return; @@ -2057,8 +2220,8 @@ lwsl_hexdump_level(int hexdump_level, const void *vbuf, size_t len) _lws_log(hexdump_level, "\n"); for (n = 0; n < len;) { - start = n; - p = line; + unsigned int start = n, m; + char line[80], *p = line; p += sprintf(p, "%04X: ", start); @@ -2117,7 +2280,7 @@ lws_get_ssl(struct lws *wsi) LWS_VISIBLE int lws_partial_buffered(struct lws *wsi) { - return !!wsi->trunc_len; + return lws_has_buffered_out(wsi); } LWS_VISIBLE lws_fileofs_t @@ -2130,7 +2293,7 @@ lws_get_peer_write_allowance(struct lws *wsi) LWS_VISIBLE void lws_role_transition(struct lws *wsi, enum lwsi_role role, enum lwsi_state state, - struct lws_role_ops *ops) + struct lws_role_ops *ops) { #if defined(_DEBUG) const char *name = "(unset)"; @@ -2192,12 +2355,6 @@ lws_get_child(const struct lws *wsi) return wsi->child_list; } -LWS_VISIBLE LWS_EXTERN void -lws_set_parent_carries_io(struct lws *wsi) -{ - wsi->parent_carries_io = 1; -} - LWS_VISIBLE LWS_EXTERN void * lws_get_opaque_parent_data(const struct lws *wsi) { @@ -2257,7 +2414,7 @@ __lws_rx_flow_control(struct lws *wsi) wsi->rxflow_change_to &= ~LWS_RXFLOW_PENDING_CHANGE; lwsl_info("rxflow: wsi %p change_to %d\n", wsi, - wsi->rxflow_change_to & LWS_RXFLOW_ALLOW); + wsi->rxflow_change_to & LWS_RXFLOW_ALLOW); /* adjust the pollfd for this wsi */ @@ -2273,36 +2430,60 @@ __lws_rx_flow_control(struct lws *wsi) return 0; } +static const unsigned char e0f4[] = { + 0xa0 | ((2 - 1) << 2) | 1, /* e0 */ + 0x80 | ((4 - 1) << 2) | 1, /* e1 */ + 0x80 | ((4 - 1) << 2) | 1, /* e2 */ + 0x80 | ((4 - 1) << 2) | 1, /* e3 */ + 0x80 | ((4 - 1) << 2) | 1, /* e4 */ + 0x80 | ((4 - 1) << 2) | 1, /* e5 */ + 0x80 | ((4 - 1) << 2) | 1, /* e6 */ + 0x80 | ((4 - 1) << 2) | 1, /* e7 */ + 0x80 | ((4 - 1) << 2) | 1, /* e8 */ + 0x80 | ((4 - 1) << 2) | 1, /* e9 */ + 0x80 | ((4 - 1) << 2) | 1, /* ea */ + 0x80 | ((4 - 1) << 2) | 1, /* eb */ + 0x80 | ((4 - 1) << 2) | 1, /* ec */ + 0x80 | ((2 - 1) << 2) | 1, /* ed */ + 0x80 | ((4 - 1) << 2) | 1, /* ee */ + 0x80 | ((4 - 1) << 2) | 1, /* ef */ + 0x90 | ((3 - 1) << 2) | 2, /* f0 */ + 0x80 | ((4 - 1) << 2) | 2, /* f1 */ + 0x80 | ((4 - 1) << 2) | 2, /* f2 */ + 0x80 | ((4 - 1) << 2) | 2, /* f3 */ + 0x80 | ((1 - 1) << 2) | 2, /* f4 */ + + 0, /* s0 */ + 0x80 | ((4 - 1) << 2) | 0, /* s2 */ + 0x80 | ((4 - 1) << 2) | 1, /* s3 */ +}; + +LWS_EXTERN int +lws_check_byte_utf8(unsigned char state, unsigned char c) +{ + unsigned char s = state; + + if (!s) { + if (c >= 0x80) { + if (c < 0xc2 || c > 0xf4) + return -1; + if (c < 0xe0) + return 0x80 | ((4 - 1) << 2); + else + return e0f4[c - 0xe0]; + } + + return s; + } + if (c < (s & 0xf0) || c >= (s & 0xf0) + 0x10 + ((s << 2) & 0x30)) + return -1; + + return e0f4[21 + (s & 3)]; +} + LWS_EXTERN int lws_check_utf8(unsigned char *state, unsigned char *buf, size_t len) { - static const unsigned char e0f4[] = { - 0xa0 | ((2 - 1) << 2) | 1, /* e0 */ - 0x80 | ((4 - 1) << 2) | 1, /* e1 */ - 0x80 | ((4 - 1) << 2) | 1, /* e2 */ - 0x80 | ((4 - 1) << 2) | 1, /* e3 */ - 0x80 | ((4 - 1) << 2) | 1, /* e4 */ - 0x80 | ((4 - 1) << 2) | 1, /* e5 */ - 0x80 | ((4 - 1) << 2) | 1, /* e6 */ - 0x80 | ((4 - 1) << 2) | 1, /* e7 */ - 0x80 | ((4 - 1) << 2) | 1, /* e8 */ - 0x80 | ((4 - 1) << 2) | 1, /* e9 */ - 0x80 | ((4 - 1) << 2) | 1, /* ea */ - 0x80 | ((4 - 1) << 2) | 1, /* eb */ - 0x80 | ((4 - 1) << 2) | 1, /* ec */ - 0x80 | ((2 - 1) << 2) | 1, /* ed */ - 0x80 | ((4 - 1) << 2) | 1, /* ee */ - 0x80 | ((4 - 1) << 2) | 1, /* ef */ - 0x90 | ((3 - 1) << 2) | 2, /* f0 */ - 0x80 | ((4 - 1) << 2) | 2, /* f1 */ - 0x80 | ((4 - 1) << 2) | 2, /* f2 */ - 0x80 | ((4 - 1) << 2) | 2, /* f3 */ - 0x80 | ((1 - 1) << 2) | 2, /* f4 */ - - 0, /* s0 */ - 0x80 | ((4 - 1) << 2) | 0, /* s2 */ - 0x80 | ((4 - 1) << 2) | 1, /* s3 */ - }; unsigned char s = *state; while (len--) { @@ -2335,7 +2516,7 @@ lws_parse_uri(char *p, const char **prot, const char **ads, int *port, const char **path) { const char *end; - static const char *slash = "/"; + char unix_skt = 0; /* cut up the location into address, port and path */ *prot = p; @@ -2349,32 +2530,32 @@ lws_parse_uri(char *p, const char **prot, const char **ads, int *port, *p = '\0'; p += 3; } + if (*p == '+') /* unix skt */ + unix_skt = 1; + *ads = p; if (!strcmp(*prot, "http") || !strcmp(*prot, "ws")) *port = 80; else if (!strcmp(*prot, "https") || !strcmp(*prot, "wss")) *port = 443; - if (*p == '[') - { - ++(*ads); - while (*p && *p != ']') - p++; - if (*p) - *p++ = '\0'; - } - else - { - while (*p && *p != ':' && *p != '/') - p++; - } + if (*p == '[') { + ++(*ads); + while (*p && *p != ']') + p++; + if (*p) + *p++ = '\0'; + } else + while (*p && *p != ':' && (unix_skt || *p != '/')) + p++; + if (*p == ':') { *p++ = '\0'; *port = atoi(p); while (*p && *p != '/') p++; } - *path = slash; + *path = "/"; if (*p) { *p++ = '\0'; if (*p) @@ -2384,6 +2565,17 @@ lws_parse_uri(char *p, const char **prot, const char **ads, int *port, return 0; } +char * +lws_strdup(const char *s) +{ + char *d = lws_malloc(strlen(s) + 1, "strdup"); + + if (d) + strcpy(d, s); + + return d; +} + #if defined(LWS_WITHOUT_EXTENSIONS) /* we need to provide dummy callbacks for internal exts @@ -2417,6 +2609,14 @@ lws_set_extension_option(struct lws *wsi, const char *ext_name, } #endif +/* note: this returns a random port, or one of these <= 0 return codes: + * + * LWS_ITOSA_USABLE: the interface is usable, returned if so and sockfd invalid + * LWS_ITOSA_NOT_EXIST: the requested iface does not even exist + * LWS_ITOSA_NOT_USABLE: the requested iface exists but is not usable (eg, no IP) + * LWS_ITOSA_BUSY: the port at the requested iface + port is already in use + */ + LWS_EXTERN int lws_socket_bind(struct lws_vhost *vhost, lws_sockfd_type sockfd, int port, const char *iface) @@ -2438,22 +2638,26 @@ lws_socket_bind(struct lws_vhost *vhost, lws_sockfd_type sockfd, int port, struct sockaddr_storage sin; struct sockaddr *v; -#ifdef LWS_WITH_UNIX_SOCK + memset(&sin, 0, sizeof(sin)); + +#if defined(LWS_WITH_UNIX_SOCK) if (LWS_UNIX_SOCK_ENABLED(vhost)) { v = (struct sockaddr *)&serv_unix; n = sizeof(struct sockaddr_un); bzero((char *) &serv_unix, sizeof(serv_unix)); serv_unix.sun_family = AF_UNIX; if (!iface) - return -1; + return LWS_ITOSA_NOT_EXIST; if (sizeof(serv_unix.sun_path) <= strlen(iface)) { lwsl_err("\"%s\" too long for UNIX domain socket\n", iface); - return -1; + return LWS_ITOSA_NOT_EXIST; } strcpy(serv_unix.sun_path, iface); if (serv_unix.sun_path[0] == '@') serv_unix.sun_path[0] = '\0'; + else + unlink(serv_unix.sun_path); } else #endif @@ -2488,8 +2692,8 @@ lws_socket_bind(struct lws_vhost *vhost, lws_sockfd_type sockfd, int port, bzero((char *) &serv_addr4, sizeof(serv_addr4)); serv_addr4.sin_addr.s_addr = INADDR_ANY; serv_addr4.sin_family = AF_INET; -#if !defined(LWS_WITH_ESP32) +#if !defined(LWS_WITH_ESP32) if (iface) { m = interface_to_sa(vhost, iface, (struct sockaddr_in *)v, n); @@ -2510,22 +2714,38 @@ lws_socket_bind(struct lws_vhost *vhost, lws_sockfd_type sockfd, int port, /* just checking for the interface extant */ if (sockfd == LWS_SOCK_INVALID) - return 0; + return LWS_ITOSA_USABLE; n = bind(sockfd, v, n); #ifdef LWS_WITH_UNIX_SOCK if (n < 0 && LWS_UNIX_SOCK_ENABLED(vhost)) { lwsl_err("ERROR on binding fd %d to \"%s\" (%d %d)\n", - sockfd, iface, n, LWS_ERRNO); - return -1; + sockfd, iface, n, LWS_ERRNO); + return LWS_ITOSA_NOT_EXIST; } else #endif if (n < 0) { lwsl_err("ERROR on binding fd %d to port %d (%d %d)\n", - sockfd, port, n, LWS_ERRNO); - return -1; + sockfd, port, n, LWS_ERRNO); + + /* if something already listening, tell caller to fail permanently */ + + if (LWS_ERRNO == LWS_EADDRINUSE) + return LWS_ITOSA_BUSY; + + /* otherwise ask caller to retry later */ + + return LWS_ITOSA_NOT_EXIST; } +#if defined(LWS_WITH_UNIX_SOCK) + if (LWS_UNIX_SOCK_ENABLED(vhost) && vhost->context->uid) + if (chown(serv_unix.sun_path, vhost->context->uid, + vhost->context->gid)) + lwsl_notice("%s: chown for unix skt %s failed\n", + __func__, serv_unix.sun_path); +#endif + #ifndef LWS_PLAT_OPTEE if (getsockname(sockfd, (struct sockaddr *)&sin, &len) == -1) lwsl_warn("getsockname: %s\n", strerror(LWS_ERRNO)); @@ -2600,7 +2820,7 @@ lws_get_addr_scope(const char *ipaddr) for (i = 0; i < 5; i++) { ret = GetAdaptersAddresses(AF_INET6, GAA_FLAG_INCLUDE_PREFIX, - NULL, addrs, &size); + NULL, addrs, &size); if ((ret == NO_ERROR) || (ret == ERROR_NO_DATA)) { break; } else if (ret == ERROR_BUFFER_OVERFLOW) @@ -2653,73 +2873,6 @@ lws_get_addr_scope(const char *ipaddr) } #endif -#if !defined(LWS_NO_SERVER) - -LWS_EXTERN struct lws * -lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags, - const char *protocol_name, struct lws *parent_wsi) -{ - lws_sock_file_fd_type sock; - struct addrinfo h, *r, *rp; - struct lws *wsi = NULL; - char buf[16]; - int n; - - memset(&h, 0, sizeof(h)); - h.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ - h.ai_socktype = SOCK_DGRAM; - h.ai_protocol = IPPROTO_UDP; - h.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; - - lws_snprintf(buf, sizeof(buf), "%u", port); - n = getaddrinfo(NULL, buf, &h, &r); - if (n) { - lwsl_info("%s: getaddrinfo error: %s\n", __func__, - gai_strerror(n)); - goto bail; - } - - for (rp = r; rp; rp = rp->ai_next) { - sock.sockfd = socket(rp->ai_family, rp->ai_socktype, - rp->ai_protocol); - if (sock.sockfd >= 0) - break; - } - if (!rp) { - lwsl_err("%s: unable to create INET socket\n", __func__); - goto bail1; - } - - if ((flags & LWS_CAUDP_BIND) && bind(sock.sockfd, rp->ai_addr, -#if defined(_WIN32) - (int)rp->ai_addrlen -#else - rp->ai_addrlen -#endif - ) == -1) { - lwsl_err("%s: bind failed\n", __func__); - goto bail2; - } - - wsi = lws_adopt_descriptor_vhost(vhost, LWS_ADOPT_RAW_SOCKET_UDP, sock, - protocol_name, parent_wsi); - if (!wsi) - lwsl_err("%s: udp adoption failed\n", __func__); - -bail2: - if (!wsi) - close((int)sock.sockfd); -bail1: - freeaddrinfo(r); - -bail: - return wsi; -} - -#endif - - - static const char *hex = "0123456789ABCDEF"; LWS_VISIBLE LWS_EXTERN const char * @@ -2754,6 +2907,27 @@ lws_json_purify(char *escaped, const char *string, int len) } while (*p && len-- > 6) { + if (*p == '\t') { + p++; + *q++ = '\\'; + *q++ = 't'; + continue; + } + + if (*p == '\n') { + p++; + *q++ = '\\'; + *q++ = 'n'; + continue; + } + + if (*p == '\r') { + p++; + *q++ = '\\'; + *q++ = 'r'; + continue; + } + if (*p == '\"' || *p == '\\' || *p < 0x20) { *q++ = '\\'; *q++ = 'u'; @@ -2890,6 +3064,13 @@ lws_finalize_startup(struct lws_context *context) return 0; } +LWS_VISIBLE LWS_EXTERN void +lws_get_effective_uid_gid(struct lws_context *context, int *uid, int *gid) +{ + *uid = context->uid; + *gid = context->gid; +} + int lws_snprintf(char *str, size_t size, const char *format, ...) { @@ -2919,6 +3100,316 @@ lws_strncpy(char *dest, const char *src, size_t size) } +typedef enum { + LWS_TOKZS_LEADING_WHITESPACE, + LWS_TOKZS_QUOTED_STRING, + LWS_TOKZS_TOKEN, + LWS_TOKZS_TOKEN_POST_TERMINAL +} lws_tokenize_state; + +int +lws_tokenize(struct lws_tokenize *ts) +{ + const char *rfc7230_delims = "(),/:;<=>?@[\\]{}"; + lws_tokenize_state state = LWS_TOKZS_LEADING_WHITESPACE; + char c, flo = 0, d_minus = '-', d_dot = '.', s_minus = '\0', + s_dot = '\0'; + signed char num = -1; + int utf8 = 0; + + /* for speed, compute the effect of the flags outside the loop */ + + if (ts->flags & LWS_TOKENIZE_F_MINUS_NONTERM) { + d_minus = '\0'; + s_minus = '-'; + } + if (ts->flags & LWS_TOKENIZE_F_DOT_NONTERM) { + d_dot = '\0'; + s_dot = '.'; + } + + ts->token = NULL; + ts->token_len = 0; + + while (ts->len) { + c = *ts->start++; + ts->len--; + + utf8 = lws_check_byte_utf8((unsigned char)utf8, c); + if (utf8 < 0) + return LWS_TOKZE_ERR_BROKEN_UTF8; + + if (!c) + break; + + /* whitespace */ + + if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || + c == '\f') { + switch (state) { + case LWS_TOKZS_LEADING_WHITESPACE: + case LWS_TOKZS_TOKEN_POST_TERMINAL: + continue; + case LWS_TOKZS_QUOTED_STRING: + ts->token_len++; + continue; + case LWS_TOKZS_TOKEN: + /* we want to scan forward to look for = */ + + state = LWS_TOKZS_TOKEN_POST_TERMINAL; + continue; + } + } + + /* quoted string */ + + if (c == '\"') { + if (state == LWS_TOKZS_QUOTED_STRING) + return LWS_TOKZE_QUOTED_STRING; + + /* starting a quoted string */ + + if (ts->flags & LWS_TOKENIZE_F_COMMA_SEP_LIST) { + if (ts->delim == LWSTZ_DT_NEED_DELIM) + return LWS_TOKZE_ERR_COMMA_LIST; + ts->delim = LWSTZ_DT_NEED_DELIM; + } + + state = LWS_TOKZS_QUOTED_STRING; + ts->token = ts->start; + ts->token_len = 0; + + continue; + } + + /* token= aggregation */ + + if (c == '=' && (state == LWS_TOKZS_TOKEN_POST_TERMINAL || + state == LWS_TOKZS_TOKEN)) { + if (num == 1) + return LWS_TOKZE_ERR_NUM_ON_LHS; + /* swallow the = */ + return LWS_TOKZE_TOKEN_NAME_EQUALS; + } + + /* optional token: aggregation */ + + if ((ts->flags & LWS_TOKENIZE_F_AGG_COLON) && c == ':' && + (state == LWS_TOKZS_TOKEN_POST_TERMINAL || + state == LWS_TOKZS_TOKEN)) + /* swallow the : */ + return LWS_TOKZE_TOKEN_NAME_COLON; + + /* aggregate . in a number as a float */ + + if (c == '.' && !(ts->flags & LWS_TOKENIZE_F_NO_FLOATS) && + state == LWS_TOKZS_TOKEN && num == 1) { + if (flo) + return LWS_TOKZE_ERR_MALFORMED_FLOAT; + flo = 1; + ts->token_len++; + continue; + } + + /* + * Delimiter... by default anything that: + * + * - isn't matched earlier, or + * - is [A-Z, a-z, 0-9, _], and + * - is not a partial utf8 char + * + * is a "delimiter", it marks the end of a token and is itself + * reported as a single LWS_TOKZE_DELIMITER each time. + * + * However with LWS_TOKENIZE_F_RFC7230_DELIMS flag, tokens may + * contain any noncontrol character that isn't defined in + * rfc7230_delims, and only characters listed there are treated + * as delimiters. + */ + + if (!utf8 && + ((ts->flags & LWS_TOKENIZE_F_RFC7230_DELIMS && + strchr(rfc7230_delims, c) && c > 32) || + ((!(ts->flags & LWS_TOKENIZE_F_RFC7230_DELIMS) && + (c < '0' || c > '9') && (c < 'A' || c > 'Z') && + (c < 'a' || c > 'z') && c != '_') && + c != s_minus && c != s_dot) || + c == d_minus || c == d_dot + )) { + switch (state) { + case LWS_TOKZS_LEADING_WHITESPACE: + if (ts->flags & LWS_TOKENIZE_F_COMMA_SEP_LIST) { + if (c != ',' || + ts->delim != LWSTZ_DT_NEED_DELIM) + return LWS_TOKZE_ERR_COMMA_LIST; + ts->delim = LWSTZ_DT_NEED_NEXT_CONTENT; + } + + ts->token = ts->start - 1; + ts->token_len = 1; + return LWS_TOKZE_DELIMITER; + + case LWS_TOKZS_QUOTED_STRING: + ts->token_len++; + continue; + + case LWS_TOKZS_TOKEN_POST_TERMINAL: + case LWS_TOKZS_TOKEN: + /* report the delimiter next time */ + ts->start--; + ts->len++; + goto token_or_numeric; + } + } + + /* anything that's not whitespace or delimiter is payload */ + + switch (state) { + case LWS_TOKZS_LEADING_WHITESPACE: + + if (ts->flags & LWS_TOKENIZE_F_COMMA_SEP_LIST) { + if (ts->delim == LWSTZ_DT_NEED_DELIM) + return LWS_TOKZE_ERR_COMMA_LIST; + ts->delim = LWSTZ_DT_NEED_DELIM; + } + + state = LWS_TOKZS_TOKEN; + ts->token = ts->start - 1; + ts->token_len = 1; + if (c < '0' || c > '9') + num = 0; + else + if (num < 0) + num = 1; + continue; + case LWS_TOKZS_QUOTED_STRING: + case LWS_TOKZS_TOKEN: + if (c < '0' || c > '9') + num = 0; + else + if (num < 0) + num = 1; + ts->token_len++; + continue; + case LWS_TOKZS_TOKEN_POST_TERMINAL: + /* report the new token next time */ + ts->start--; + ts->len++; + goto token_or_numeric; + } + } + + /* we ran out of content */ + + if (utf8) /* ended partway through a multibyte char */ + return LWS_TOKZE_ERR_BROKEN_UTF8; + + if (state == LWS_TOKZS_QUOTED_STRING) + return LWS_TOKZE_ERR_UNTERM_STRING; + + if (state != LWS_TOKZS_TOKEN_POST_TERMINAL && + state != LWS_TOKZS_TOKEN) { + if ((ts->flags & LWS_TOKENIZE_F_COMMA_SEP_LIST) && + ts->delim == LWSTZ_DT_NEED_NEXT_CONTENT) + return LWS_TOKZE_ERR_COMMA_LIST; + + return LWS_TOKZE_ENDED; + } + + /* report the pending token */ + +token_or_numeric: + + if (num != 1) + return LWS_TOKZE_TOKEN; + if (flo) + return LWS_TOKZE_FLOAT; + + return LWS_TOKZE_INTEGER; +} + + +LWS_VISIBLE LWS_EXTERN int +lws_tokenize_cstr(struct lws_tokenize *ts, char *str, int max) +{ + if (ts->token_len + 1 >= max) + return 1; + + memcpy(str, ts->token, ts->token_len); + str[ts->token_len] = '\0'; + + return 0; +} + +LWS_VISIBLE LWS_EXTERN void +lws_tokenize_init(struct lws_tokenize *ts, const char *start, int flags) +{ + ts->start = start; + ts->len = 0x7fffffff; + ts->flags = flags; + ts->delim = LWSTZ_DT_NEED_FIRST_CONTENT; +} + +#if LWS_MAX_SMP > 1 + +void +lws_mutex_refcount_init(struct lws_mutex_refcount *mr) +{ + pthread_mutex_init(&mr->lock, NULL); + mr->last_lock_reason = NULL; + mr->lock_depth = 0; + mr->metadata = 0; + mr->lock_owner = 0; +} + +void +lws_mutex_refcount_destroy(struct lws_mutex_refcount *mr) +{ + pthread_mutex_destroy(&mr->lock); +} + +void +lws_mutex_refcount_lock(struct lws_mutex_refcount *mr, const char *reason) +{ + /* if true, this sequence is atomic because our thread has the lock + * + * - if true, only guy who can race to make it untrue is our thread, + * and we are here. + * + * - if false, only guy who could race to make it true is our thread, + * and we are here + * + * - it can be false and change to a different tid that is also false + */ + if (mr->lock_owner == pthread_self()) { + /* atomic because we only change it if we own the lock */ + mr->lock_depth++; + return; + } + + pthread_mutex_lock(&mr->lock); + /* atomic because only we can have the lock */ + mr->last_lock_reason = reason; + mr->lock_owner = pthread_self(); + mr->lock_depth = 1; + //lwsl_notice("tid %d: lock %s\n", mr->tid, reason); +} + +void +lws_mutex_refcount_unlock(struct lws_mutex_refcount *mr) +{ + if (--mr->lock_depth) + /* atomic because only thread that has the lock can unlock */ + return; + + mr->last_lock_reason = "free"; + mr->lock_owner = 0; + //lwsl_notice("tid %d: unlock %s\n", mr->tid, mr->last_lock_reason); + pthread_mutex_unlock(&mr->lock); +} + +#endif /* SMP */ + LWS_VISIBLE LWS_EXTERN int lws_is_cgi(struct lws *wsi) { #ifdef LWS_WITH_CGI @@ -2941,6 +3432,21 @@ lws_pvo_search(const struct lws_protocol_vhost_options *pvo, const char *name) return pvo; } +int +lws_pvo_get_str(void *in, const char *name, const char **result) +{ + const struct lws_protocol_vhost_options *pv = + lws_pvo_search((const struct lws_protocol_vhost_options *)in, + name); + + if (!pv) + return 1; + + *result = (const char *)pv->value; + + return 0; +} + void lws_sum_stats(const struct lws_context *ctx, struct lws_conn_stats *cs) { @@ -3255,9 +3761,10 @@ LWS_VISIBLE LWS_EXTERN void lws_stats_log_dump(struct lws_context *context) { struct lws_vhost *v = context->vhost_list; - int n, m; - - (void)m; + int n; +#if defined(LWS_WITH_PEER_LIMITS) + int m; +#endif if (!context->updated) return; diff --git a/thirdparty/libwebsockets/core/output.c b/thirdparty/libwebsockets/lib/core/output.c index 11965a06b9..49d289db40 100644 --- a/thirdparty/libwebsockets/core/output.c +++ b/thirdparty/libwebsockets/lib/core/output.c @@ -1,7 +1,7 @@ /* * libwebsockets - small server side websockets and web server implementation * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,49 +29,65 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) struct lws_context *context = lws_get_context(wsi); struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; size_t real_len = len; - unsigned int n; + unsigned int n, m; - // lwsl_hexdump_err(buf, len); + // lwsl_notice("%s: len %d\n", __func__, (int)len); + // lwsl_hexdump_level(LLL_NOTICE, buf, len); /* * Detect if we got called twice without going through the - * event loop to handle pending. This would be caused by either - * back-to-back writes in one WRITABLE (illegal) or calling lws_write() - * from outside the WRITABLE callback (illegal). + * event loop to handle pending. Since that guarantees extending any + * existing buflist_out it's inefficient. */ - if (wsi->could_have_pending) { - lwsl_hexdump_level(LLL_ERR, buf, len); - lwsl_err("** %p: vh: %s, prot: %s, role %s: " - "Illegal back-to-back write of %lu detected...\n", + if (0 && buf && wsi->could_have_pending) { + lwsl_hexdump_level(LLL_INFO, buf, len); + lwsl_info("** %p: vh: %s, prot: %s, role %s: " + "Inefficient back-to-back write of %lu detected...\n", wsi, wsi->vhost->name, wsi->protocol->name, wsi->role_ops->name, (unsigned long)len); - // assert(0); - - return -1; } lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_API_WRITE, 1); - if (!len) - return 0; /* just ignore sends after we cleared the truncation buffer */ - if (lwsi_state(wsi) == LRS_FLUSHING_BEFORE_CLOSE && !wsi->trunc_len) + if (lwsi_state(wsi) == LRS_FLUSHING_BEFORE_CLOSE && + !lws_has_buffered_out(wsi) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + && !wsi->http.comp_ctx.may_have_more +#endif + ) return (int)len; - if (wsi->trunc_len && (buf < wsi->trunc_alloc || - buf > (wsi->trunc_alloc + wsi->trunc_len + wsi->trunc_offset))) { - lwsl_hexdump_level(LLL_ERR, buf, len); - lwsl_err("** %p: vh: %s, prot: %s, Sending new %lu, pending truncated ...\n" - " It's illegal to do an lws_write outside of\n" - " the writable callback: fix your code\n", + if (buf && lws_has_buffered_out(wsi)) { + lwsl_info("** %p: vh: %s, prot: %s, incr buflist_out by %lu\n", wsi, wsi->vhost->name, wsi->protocol->name, (unsigned long)len); - assert(0); - return -1; + /* + * already buflist ahead of this, add it on the tail of the + * buflist, then ignore it for now and act like we're flushing + * the buflist... + */ + + lws_buflist_append_segment(&wsi->buflist_out, buf, len); + + buf = NULL; + len = 0; } + if (wsi->buflist_out) { + /* we have to drain the earliest buflist_out stuff first */ + + len = lws_buflist_next_segment_len(&wsi->buflist_out, &buf); + real_len = len; + + lwsl_debug("%s: draining %d\n", __func__, (int)len); + } + + if (!len || !buf) + return 0; + if (!wsi->http2_substream && !lws_socket_is_valid(wsi->desc.sockfd)) lwsl_warn("** error invalid sock but expected to send\n"); @@ -89,13 +105,15 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) /* nope, send it on the socket directly */ lws_latency_pre(context, wsi); - n = lws_ssl_capable_write(wsi, buf, n); - lws_latency(context, wsi, "send lws_issue_raw", n, n == len); + m = lws_ssl_capable_write(wsi, buf, n); + lws_latency(context, wsi, "send lws_issue_raw", n, n == m); + + lwsl_info("%s: ssl_capable_write (%d) says %d\n", __func__, n, m); /* something got written, it can have been truncated now */ wsi->could_have_pending = 1; - switch (n) { + switch (m) { case LWS_SSL_CAPABLE_ERROR: /* we're going to close, let close know sends aren't possible */ wsi->socket_is_permanently_unusable = 1; @@ -106,24 +124,29 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) * ie, implying treat it was a truncated send so it gets * retried */ - n = 0; + m = 0; break; } /* - * we were already handling a truncated send? + * we were sending this from buflist_out? Then not sending everything + * is a small matter of advancing ourselves only by the amount we did + * send in the buflist. */ - if (wsi->trunc_len) { - lwsl_info("%p partial adv %d (vs %ld)\n", wsi, n, (long)real_len); - wsi->trunc_offset += n; - wsi->trunc_len -= n; - - if (!wsi->trunc_len) { - lwsl_info("** %p partial send completed\n", wsi); - /* done with it, but don't free it */ - n = (int)real_len; + if (lws_has_buffered_out(wsi)) { + if (m) { + lwsl_info("%p partial adv %d (vs %ld)\n", wsi, m, + (long)real_len); + lws_buflist_use_segment(&wsi->buflist_out, m); + } + + if (!lws_has_buffered_out(wsi)) { + lwsl_info("%s: wsi %p: buflist_out flushed\n", + __func__, wsi); + + m = (int)real_len; if (lwsi_state(wsi) == LRS_FLUSHING_BEFORE_CLOSE) { - lwsl_info("** %p signalling to close now\n", wsi); + lwsl_info("*%p signalling to close now\n", wsi); return -1; /* retry closing now */ } @@ -134,7 +157,8 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) "deferred transaction completed\n", __func__); wsi->http.deferred_transaction_completed = 0; - return lws_http_transaction_completed(wsi); + return lws_http_transaction_completed(wsi) ? + -1 : (int)real_len; } #endif #endif @@ -142,43 +166,32 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) /* always callback on writeable */ lws_callback_on_writable(wsi); - return n; + return m; } - if ((unsigned int)n == real_len) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (wsi->http.comp_ctx.may_have_more) + lws_callback_on_writable(wsi); +#endif + + if (m == real_len) /* what we just sent went out cleanly */ - return n; + return m; /* - * Newly truncated send. Buffer the remainder (it will get - * first priority next time the socket is writable). + * We were not able to send everything... and we were not sending from + * an existing buflist_out. So we are starting a fresh buflist_out, by + * buffering the unsent remainder on it. + * (it will get first priority next time the socket is writable). */ - lwsl_debug("%p new partial sent %d from %lu total\n", wsi, n, + lwsl_debug("%p new partial sent %d from %lu total\n", wsi, m, (unsigned long)real_len); - lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_WRITE_PARTIALS, 1); - lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_B_PARTIALS_ACCEPTED_PARTS, n); + lws_buflist_append_segment(&wsi->buflist_out, buf + m, real_len - m); - /* - * - if we still have a suitable malloc lying around, use it - * - or, if too small, reallocate it - * - or, if no buffer, create it - */ - if (!wsi->trunc_alloc || real_len - n > wsi->trunc_alloc_len) { - lws_free(wsi->trunc_alloc); - - wsi->trunc_alloc_len = (unsigned int)(real_len - n); - wsi->trunc_alloc = lws_malloc(real_len - n, - "truncated send alloc"); - if (!wsi->trunc_alloc) { - lwsl_err("truncated send: unable to malloc %lu\n", - (unsigned long)(real_len - n)); - return -1; - } - } - wsi->trunc_offset = 0; - wsi->trunc_len = (unsigned int)(real_len - n); - memcpy(wsi->trunc_alloc, buf + n, real_len - n); + lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_WRITE_PARTIALS, 1); + lws_stats_atomic_bump(wsi->context, pt, + LWSSTATS_B_PARTIALS_ACCEPTED_PARTS, m); #if !defined(LWS_WITH_ESP32) if (lws_wsi_is_udp(wsi)) { @@ -199,23 +212,6 @@ LWS_VISIBLE int lws_write(struct lws *wsi, unsigned char *buf, size_t len, { struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; - if (wsi->parent_carries_io) { - struct lws_write_passthru pas; - - pas.buf = buf; - pas.len = len; - pas.wp = wp; - pas.wsi = wsi; - - if (wsi->parent->protocol->callback(wsi->parent, - LWS_CALLBACK_CHILD_WRITE_VIA_PARENT, - wsi->parent->user_space, - (void *)&pas, 0)) - return 1; - - return (int)len; - } - lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_API_LWS_WRITE, 1); if ((int)len < 0) { @@ -258,6 +254,10 @@ lws_ssl_capable_read_no_ssl(struct lws *wsi, unsigned char *buf, int len) n = recv(wsi->desc.sockfd, (char *)buf, len, 0); if (n >= 0) { + + if (!n && wsi->unix_skt) + return LWS_SSL_CAPABLE_ERROR; + if (wsi->vhost) wsi->vhost->conn_stats.rx += n; lws_stats_atomic_bump(context, pt, LWSSTATS_B_READ, n); @@ -270,7 +270,7 @@ lws_ssl_capable_read_no_ssl(struct lws *wsi, unsigned char *buf, int len) LWS_ERRNO == LWS_EINTR) return LWS_SSL_CAPABLE_MORE_SERVICE; - lwsl_notice("error on reading from skt : %d\n", LWS_ERRNO); + lwsl_info("error on reading from skt : %d\n", LWS_ERRNO); return LWS_SSL_CAPABLE_ERROR; } @@ -281,10 +281,13 @@ lws_ssl_capable_write_no_ssl(struct lws *wsi, unsigned char *buf, int len) if (lws_wsi_is_udp(wsi)) { #if !defined(LWS_WITH_ESP32) - if (wsi->trunc_len) - n = sendto(wsi->desc.sockfd, buf, len, 0, &wsi->udp->sa_pending, wsi->udp->salen_pending); + if (lws_has_buffered_out(wsi)) + n = sendto(wsi->desc.sockfd, (const char *)buf, + len, 0, &wsi->udp->sa_pending, + wsi->udp->salen_pending); else - n = sendto(wsi->desc.sockfd, buf, len, 0, &wsi->udp->sa, wsi->udp->salen); + n = sendto(wsi->desc.sockfd, (const char *)buf, + len, 0, &wsi->udp->sa, wsi->udp->salen); #endif } else n = send(wsi->desc.sockfd, (char *)buf, len, MSG_NOSIGNAL); @@ -303,7 +306,7 @@ lws_ssl_capable_write_no_ssl(struct lws *wsi, unsigned char *buf, int len) } lwsl_debug("ERROR writing len %d to skt fd %d err %d / errno %d\n", - len, wsi->desc.sockfd, n, LWS_ERRNO); + len, wsi->desc.sockfd, n, LWS_ERRNO); return LWS_SSL_CAPABLE_ERROR; } diff --git a/thirdparty/libwebsockets/core/pollfd.c b/thirdparty/libwebsockets/lib/core/pollfd.c index 2a632ce8ec..834298577a 100644 --- a/thirdparty/libwebsockets/core/pollfd.c +++ b/thirdparty/libwebsockets/lib/core/pollfd.c @@ -134,7 +134,8 @@ _lws_change_pollfd(struct lws *wsi, int _and, int _or, struct lws_pollargs *pa) pfd = &pt->fds[wsi->position_in_fds_table]; pa->fd = wsi->desc.sockfd; - lwsl_debug("%s: wsi %p: fd %d events %d -> %d\n", __func__, wsi, pa->fd, pfd->events, (pfd->events & ~_and) | _or); + lwsl_debug("%s: wsi %p: fd %d events %d -> %d\n", __func__, wsi, + pa->fd, pfd->events, (pfd->events & ~_and) | _or); pa->prev_events = pfd->events; pa->events = pfd->events = (pfd->events & ~_and) | _or; @@ -182,7 +183,7 @@ _lws_change_pollfd(struct lws *wsi, int _and, int _or, struct lws_pollargs *pa) ret = -1; goto bail; } - sampled_tid = context->service_tid; + sampled_tid = pt->service_tid; if (sampled_tid && wsi->vhost) { tid = wsi->vhost->protocols[0].callback(wsi, LWS_CALLBACK_GET_THREAD_ID, NULL, NULL, 0); @@ -245,7 +246,8 @@ __insert_wsi_socket_into_fds(struct lws_context *context, struct lws *wsi) #if !defined(_WIN32) if (wsi->desc.sockfd - lws_plat_socket_offset() >= context->max_fds) { lwsl_err("Socket fd %d is too high (%d) offset %d\n", - wsi->desc.sockfd, context->max_fds, lws_plat_socket_offset()); + wsi->desc.sockfd, context->max_fds, + lws_plat_socket_offset()); return 1; } #endif @@ -298,11 +300,6 @@ __remove_wsi_socket_from_fds(struct lws *wsi) int v; int m, ret = 0; - if (wsi->parent_carries_io) { - lws_same_vh_protocol_remove(wsi); - return 0; - } - #if !defined(_WIN32) if (wsi->desc.sockfd - lws_plat_socket_offset() > context->max_fds) { lwsl_err("fd %d too high (%d)\n", wsi->desc.sockfd, @@ -330,7 +327,7 @@ __remove_wsi_socket_from_fds(struct lws *wsi) LWS_EV_STOP | LWS_EV_READ | LWS_EV_WRITE | LWS_EV_PREPARE_DELETION); - lwsl_debug("%s: wsi=%p, sock=%d, fds pos=%d, end guy pos=%d, endfd=%d\n", + lwsl_debug("%s: wsi=%p, skt=%d, fds pos=%d, end guy pos=%d, endfd=%d\n", __func__, wsi, wsi->desc.sockfd, wsi->position_in_fds_table, pt->fds_count, pt->fds[pt->fds_count].fd); @@ -340,11 +337,13 @@ __remove_wsi_socket_from_fds(struct lws *wsi) pt->fds[m] = pt->fds[pt->fds_count - 1]; /* this decrements pt->fds_count */ lws_plat_delete_socket_from_fds(context, wsi, m); + pt->count_conns--; v = (int) pt->fds[m].fd; - /* end guy's "position in fds table" is now the deletion guy's old one */ + /* end guy's "position in fds table" is now the deletion + * guy's old one */ end_wsi = wsi_from_fd(context, v); if (!end_wsi) { - lwsl_err("no wsi for fd %d at pos %d, pt->fds_count=%d\n", + lwsl_err("no wsi for fd %d pos %d, pt->fds_count=%d\n", (int)pt->fds[m].fd, m, pt->fds_count); assert(0); } else @@ -426,7 +425,6 @@ LWS_VISIBLE int lws_callback_on_writable(struct lws *wsi) { struct lws_context_per_thread *pt; - int n; if (lwsi_state(wsi) == LRS_SHUTDOWN) return 0; @@ -436,26 +434,10 @@ lws_callback_on_writable(struct lws *wsi) pt = &wsi->context->pt[(int)wsi->tsi]; - if (wsi->parent_carries_io) { -#if defined(LWS_WITH_STATS) - if (!wsi->active_writable_req_us) { - wsi->active_writable_req_us = time_in_microseconds(); - lws_stats_atomic_bump(wsi->context, pt, - LWSSTATS_C_WRITEABLE_CB_EFF_REQ, 1); - } -#endif - n = lws_callback_on_writable(wsi->parent); - if (n < 0) - return n; - - wsi->parent_pending_cb_on_writable = 1; - return 1; - } - lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_WRITEABLE_CB_REQ, 1); #if defined(LWS_WITH_STATS) if (!wsi->active_writable_req_us) { - wsi->active_writable_req_us = time_in_microseconds(); + wsi->active_writable_req_us = lws_time_in_microseconds(); lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_WRITEABLE_CB_EFF_REQ, 1); } @@ -493,64 +475,33 @@ lws_callback_on_writable(struct lws *wsi) void lws_same_vh_protocol_insert(struct lws *wsi, int n) { - if (wsi->same_vh_protocol_prev || wsi->same_vh_protocol_next) { - lws_same_vh_protocol_remove(wsi); - lwsl_notice("Attempted to attach wsi twice to same vh prot\n"); - } - lws_vhost_lock(wsi->vhost); - wsi->same_vh_protocol_prev = &wsi->vhost->same_vh_protocol_list[n]; - /* old first guy is our next */ - wsi->same_vh_protocol_next = wsi->vhost->same_vh_protocol_list[n]; - /* we become the new first guy */ - wsi->vhost->same_vh_protocol_list[n] = wsi; + if (!lws_dll_is_null(&wsi->same_vh_protocol)) + lws_dll_lws_remove(&wsi->same_vh_protocol); - if (wsi->same_vh_protocol_next) - /* old first guy points back to us now */ - wsi->same_vh_protocol_next->same_vh_protocol_prev = - &wsi->same_vh_protocol_next; - - wsi->on_same_vh_list = 1; + lws_dll_lws_add_front(&wsi->same_vh_protocol, + &wsi->vhost->same_vh_protocol_heads[n]); lws_vhost_unlock(wsi->vhost); } void -lws_same_vh_protocol_remove(struct lws *wsi) +__lws_same_vh_protocol_remove(struct lws *wsi) { - /* - * detach ourselves from vh protocol list if we're on one - * A -> B -> C - * A -> C , or, B -> C, or A -> B - * - * OK to call on already-detached wsi - */ - lwsl_info("%s: removing same prot wsi %p\n", __func__, wsi); + if (!lws_dll_is_null(&wsi->same_vh_protocol)) + lws_dll_lws_remove(&wsi->same_vh_protocol); +} - if (!wsi->vhost || !wsi->on_same_vh_list) +void +lws_same_vh_protocol_remove(struct lws *wsi) +{ + if (!wsi->vhost) return; lws_vhost_lock(wsi->vhost); - if (wsi->same_vh_protocol_prev) { - assert (*(wsi->same_vh_protocol_prev) == wsi); - lwsl_info("have prev %p, setting him to our next %p\n", - wsi->same_vh_protocol_prev, - wsi->same_vh_protocol_next); - - /* guy who pointed to us should point to our next */ - *(wsi->same_vh_protocol_prev) = wsi->same_vh_protocol_next; - } - - /* our next should point back to our prev */ - if (wsi->same_vh_protocol_next) - wsi->same_vh_protocol_next->same_vh_protocol_prev = - wsi->same_vh_protocol_prev; - - wsi->same_vh_protocol_prev = NULL; - wsi->same_vh_protocol_next = NULL; - wsi->on_same_vh_list = 0; + __lws_same_vh_protocol_remove(wsi); lws_vhost_unlock(wsi->vhost); } @@ -558,9 +509,10 @@ lws_same_vh_protocol_remove(struct lws *wsi) LWS_VISIBLE int lws_callback_on_writable_all_protocol_vhost(const struct lws_vhost *vhost, - const struct lws_protocols *protocol) + const struct lws_protocols *protocol) { struct lws *wsi; + int n; if (protocol < vhost->protocols || protocol >= (vhost->protocols + vhost->count_protocols)) { @@ -571,18 +523,16 @@ lws_callback_on_writable_all_protocol_vhost(const struct lws_vhost *vhost, return -1; } - wsi = vhost->same_vh_protocol_list[protocol - vhost->protocols]; - while (wsi) { - assert(wsi->protocol == protocol); - assert(*wsi->same_vh_protocol_prev == wsi); - if (wsi->same_vh_protocol_next) - assert(wsi->same_vh_protocol_next-> - same_vh_protocol_prev == - &wsi->same_vh_protocol_next); + n = (int)(protocol - vhost->protocols); + lws_start_foreach_dll_safe(struct lws_dll_lws *, d, d1, + vhost->same_vh_protocol_heads[n].next) { + wsi = lws_container_of(d, struct lws, same_vh_protocol); + + assert(wsi->protocol == protocol); lws_callback_on_writable(wsi); - wsi = wsi->same_vh_protocol_next; - } + + } lws_end_foreach_dll_safe(d, d1); return 0; } @@ -602,7 +552,7 @@ lws_callback_on_writable_all_protocol(const struct lws_context *context, while (vhost) { for (n = 0; n < vhost->count_protocols; n++) if (protocol->callback == - vhost->protocols[n].callback && + vhost->protocols[n].callback && !strcmp(protocol->name, vhost->protocols[n].name)) break; if (n != vhost->count_protocols) diff --git a/thirdparty/libwebsockets/core/private.h b/thirdparty/libwebsockets/lib/core/private.h index 73748b0498..c1a0a661b1 100644 --- a/thirdparty/libwebsockets/core/private.h +++ b/thirdparty/libwebsockets/lib/core/private.h @@ -36,10 +36,6 @@ typedef float _Float128x; #endif -#ifdef LWS_HAVE_SYS_TYPES_H - #include <sys/types.h> -#endif - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -48,271 +44,17 @@ #include <limits.h> #include <stdarg.h> #include <inttypes.h> - -#if defined(LWS_WITH_ESP32) - #define MSG_NOSIGNAL 0 - #define SOMAXCONN 3 -#endif - -#define STORE_IN_ROM #include <assert.h> -#if LWS_MAX_SMP > 1 - #include <pthread.h> -#endif - -#ifdef LWS_HAVE_SYS_STAT_H - #include <sys/stat.h> -#endif - -#if defined(WIN32) || defined(_WIN32) - - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif - - #if (WINVER < 0x0501) - #undef WINVER - #undef _WIN32_WINNT - #define WINVER 0x0501 - #define _WIN32_WINNT WINVER - #endif - - #define LWS_NO_DAEMONIZE - #define LWS_ERRNO WSAGetLastError() - #define LWS_EAGAIN WSAEWOULDBLOCK - #define LWS_EALREADY WSAEALREADY - #define LWS_EINPROGRESS WSAEINPROGRESS - #define LWS_EINTR WSAEINTR - #define LWS_EISCONN WSAEISCONN - #define LWS_EWOULDBLOCK WSAEWOULDBLOCK - #define MSG_NOSIGNAL 0 - #define SHUT_RDWR SD_BOTH - #define SOL_TCP IPPROTO_TCP - #define SHUT_WR SD_SEND - - #define compatible_close(fd) closesocket(fd) - #define lws_set_blocking_send(wsi) wsi->sock_send_blocking = 1 - #define LWS_SOCK_INVALID (INVALID_SOCKET) - - #include <winsock2.h> - #include <ws2tcpip.h> - #include <windows.h> - #include <tchar.h> - #ifdef LWS_HAVE_IN6ADDR_H - #include <in6addr.h> - #endif - #include <mstcpip.h> - #include <io.h> - - #if !defined(LWS_HAVE_ATOLL) - #if defined(LWS_HAVE__ATOI64) - #define atoll _atoi64 - #else - #warning No atoll or _atoi64 available, using atoi - #define atoll atoi - #endif - #endif - - #ifndef __func__ - #define __func__ __FUNCTION__ - #endif - - #ifdef LWS_HAVE__VSNPRINTF - #define vsnprintf _vsnprintf - #endif - /* we don't have an implementation for this on windows... */ - int kill(int pid, int sig); - int fork(void); - #ifndef SIGINT - #define SIGINT 2 - #endif - -#else /* not windows --> */ - - #include <fcntl.h> - #include <strings.h> - #include <unistd.h> +#ifdef LWS_HAVE_SYS_TYPES_H #include <sys/types.h> - - #ifndef __cplusplus - #include <errno.h> - #endif - #include <netdb.h> - #include <signal.h> - #include <sys/socket.h> - - #if defined(LWS_BUILTIN_GETIFADDRS) - #include "./misc/getifaddrs.h" - #else - #if !defined(LWS_WITH_ESP32) - #if defined(__HAIKU__) - #define _BSD_SOURCE - #endif - #include <ifaddrs.h> - #endif - #endif - #if defined (__ANDROID__) - #include <syslog.h> - #include <sys/resource.h> - #elif defined (__sun) || defined(__HAIKU__) || defined(__QNX__) - #include <syslog.h> - #else - #if !defined(LWS_WITH_ESP32) - #include <sys/syslog.h> - #endif - #endif - #include <netdb.h> - #if !defined(LWS_WITH_ESP32) - #include <sys/mman.h> - #include <sys/un.h> - #include <netinet/in.h> - #include <netinet/tcp.h> - #include <arpa/inet.h> - #include <poll.h> - #endif - #ifndef LWS_NO_FORK - #ifdef LWS_HAVE_SYS_PRCTL_H - #include <sys/prctl.h> - #endif - #endif - - #include <sys/time.h> - - #define LWS_ERRNO errno - #define LWS_EAGAIN EAGAIN - #define LWS_EALREADY EALREADY - #define LWS_EINPROGRESS EINPROGRESS - #define LWS_EINTR EINTR - #define LWS_EISCONN EISCONN - #define LWS_EWOULDBLOCK EWOULDBLOCK - - #define lws_set_blocking_send(wsi) - - #define LWS_SOCK_INVALID (-1) -#endif /* not windows */ - -#ifndef LWS_HAVE_BZERO - #ifndef bzero - #define bzero(b, len) (memset((b), '\0', (len)), (void) 0) - #endif #endif - -#ifndef LWS_HAVE_STRERROR - #define strerror(x) "" -#endif - - -#define lws_socket_is_valid(x) (x != LWS_SOCK_INVALID) - -#include "libwebsockets.h" - -#include "tls/private.h" - -#if defined(WIN32) || defined(_WIN32) - #include <gettimeofday.h> - - #ifndef BIG_ENDIAN - #define BIG_ENDIAN 4321 /* to show byte order (taken from gcc) */ - #endif - #ifndef LITTLE_ENDIAN - #define LITTLE_ENDIAN 1234 - #endif - #ifndef BYTE_ORDER - #define BYTE_ORDER LITTLE_ENDIAN - #endif - - #undef __P - #ifndef __P - #if __STDC__ - #define __P(protos) protos - #else - #define __P(protos) () - #endif - #endif - -#else /* not windows */ - static LWS_INLINE int compatible_close(int fd) { return close(fd); } - +#ifdef LWS_HAVE_SYS_STAT_H #include <sys/stat.h> - #include <sys/time.h> - - #if defined(__APPLE__) - #include <machine/endian.h> - #elif defined(__FreeBSD__) - #include <sys/endian.h> - #elif defined(__linux__) - #include <endian.h> - #endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__QNX__) - #include <gulliver.h> - #if defined(__LITTLEENDIAN__) - #define BYTE_ORDER __LITTLEENDIAN__ - #define LITTLE_ENDIAN __LITTLEENDIAN__ - #define BIG_ENDIAN 4321 /* to show byte order (taken from gcc); for suppres warning that BIG_ENDIAN is not defined. */ - #endif - #if defined(__BIGENDIAN__) - #define BYTE_ORDER __BIGENDIAN__ - #define LITTLE_ENDIAN 1234 /* to show byte order (taken from gcc); for suppres warning that LITTLE_ENDIAN is not defined. */ - #define BIG_ENDIAN __BIGENDIAN__ - #endif -#endif - -#if defined(__sun) && defined(__GNUC__) - - #include <arpa/nameser_compat.h> - - #if !defined (BYTE_ORDER) - #define BYTE_ORDER __BYTE_ORDER__ - #endif - - #if !defined(LITTLE_ENDIAN) - #define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ - #endif - - #if !defined(BIG_ENDIAN) - #define BIG_ENDIAN __ORDER_BIG_ENDIAN__ - #endif - -#endif /* sun + GNUC */ - -#if !defined(BYTE_ORDER) - #define BYTE_ORDER __BYTE_ORDER -#endif -#if !defined(LITTLE_ENDIAN) - #define LITTLE_ENDIAN __LITTLE_ENDIAN -#endif -#if !defined(BIG_ENDIAN) - #define BIG_ENDIAN __BIG_ENDIAN -#endif - - -/* - * Mac OSX as well as iOS do not define the MSG_NOSIGNAL flag, - * but happily have something equivalent in the SO_NOSIGPIPE flag. - */ -#ifdef __APPLE__ -#define MSG_NOSIGNAL SO_NOSIGPIPE -#endif - -/* - * Solaris 11.X only supports POSIX 2001, MSG_NOSIGNAL appears in - * POSIX 2008. - */ -#ifdef __sun - #define MSG_NOSIGNAL 0 #endif -#ifdef _WIN32 - #ifndef FD_HASHTABLE_MODULUS - #define FD_HASHTABLE_MODULUS 32 - #endif +#if LWS_MAX_SMP > 1 + #include <pthread.h> #endif #ifndef LWS_DEF_HEADER_LEN @@ -351,6 +93,49 @@ extern "C" { #define LWS_H2_RX_SCRATCH_SIZE 512 +#define lws_socket_is_valid(x) (x != LWS_SOCK_INVALID) + +#ifndef LWS_HAVE_STRERROR + #define strerror(x) "" +#endif + + /* + * + * ------ private platform defines ------ + * + */ + +#if defined(LWS_WITH_ESP32) + #include "plat/esp32/private.h" +#else + #if defined(WIN32) || defined(_WIN32) + #include "plat/windows/private.h" + #else + #if defined(LWS_PLAT_OPTEE) + #include "plat/optee/private.h" + #else + #include "plat/unix/private.h" + #endif + #endif +#endif + +#ifndef LWS_HAVE_BZERO + #ifndef bzero + #define bzero(b, len) (memset((b), '\0', (len)), (void) 0) + #endif +#endif + + /* + * + * ------ public api ------ + * + */ + +#include "libwebsockets.h" + + +#include "tls/private.h" + #if defined(WIN32) || defined(_WIN32) // Visual studio older than 2015 and WIN_CE has only _stricmp #if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(_WIN32_WCE) @@ -361,6 +146,14 @@ extern "C" { #define getdtablesize() 30000 #endif +#ifndef LWS_ARRAY_SIZE +#define LWS_ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + /* * All lws_tls...() functions must return this type, converting the * native backend result and doing the extra work to determine which one @@ -371,11 +164,11 @@ extern "C" { * Non-SSL mode also uses these types. */ enum lws_ssl_capable_status { - LWS_SSL_CAPABLE_ERROR = -1, /* it failed */ - LWS_SSL_CAPABLE_DONE = 0, /* it succeeded */ - LWS_SSL_CAPABLE_MORE_SERVICE_READ = -2, /* retry WANT_READ */ - LWS_SSL_CAPABLE_MORE_SERVICE_WRITE = -3, /* retry WANT_WRITE */ - LWS_SSL_CAPABLE_MORE_SERVICE = -4, /* general retry */ + LWS_SSL_CAPABLE_ERROR = -1, /* it failed */ + LWS_SSL_CAPABLE_DONE = 0, /* it succeeded */ + LWS_SSL_CAPABLE_MORE_SERVICE_READ = -2, /* retry WANT_READ */ + LWS_SSL_CAPABLE_MORE_SERVICE_WRITE = -3, /* retry WANT_WRITE */ + LWS_SSL_CAPABLE_MORE_SERVICE = -4, /* general retry */ }; #if defined(__clang__) @@ -517,14 +310,6 @@ struct lws_signal_watcher { struct lws_context *context; }; -#ifdef _WIN32 -#define LWS_FD_HASH(fd) ((fd ^ (fd >> 8) ^ (fd >> 16)) % FD_HASHTABLE_MODULUS) -struct lws_fd_hashtable { - struct lws **wsi; - int length; -}; -#endif - struct lws_foreign_thread_pollfd { struct lws_foreign_thread_pollfd *next; int fd_index; @@ -532,6 +317,28 @@ struct lws_foreign_thread_pollfd { int _or; }; +#if LWS_MAX_SMP > 1 + +struct lws_mutex_refcount { + pthread_mutex_t lock; + pthread_t lock_owner; + const char *last_lock_reason; + char lock_depth; + char metadata; +}; + +void +lws_mutex_refcount_init(struct lws_mutex_refcount *mr); + +void +lws_mutex_refcount_destroy(struct lws_mutex_refcount *mr); + +void +lws_mutex_refcount_lock(struct lws_mutex_refcount *mr, const char *reason); + +void +lws_mutex_refcount_unlock(struct lws_mutex_refcount *mr); +#endif #define LWS_HRTIMER_NOWAIT (0x7fffffffffffffffll) @@ -542,10 +349,9 @@ struct lws_foreign_thread_pollfd { struct lws_context_per_thread { #if LWS_MAX_SMP > 1 - pthread_mutex_t lock; pthread_mutex_t lock_stats; - pthread_t lock_owner; - const char *last_lock_reason; + struct lws_mutex_refcount mr; + pthread_t self; #endif struct lws_context *context; @@ -568,7 +374,7 @@ struct lws_context_per_thread { struct lws_pollfd *fds; volatile struct lws_foreign_thread_pollfd * volatile foreign_pfd_list; #ifdef _WIN32 - WSAEVENT *events; + WSAEVENT events; #endif lws_sockfd_type dummy_pipe_fds[2]; struct lws *pipe_wsi; @@ -581,6 +387,9 @@ struct lws_context_per_thread { #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) struct lws_pt_role_http http; #endif +#if defined(LWS_ROLE_DBUS) + struct lws_pt_role_dbus dbus; +#endif /* --- event library based members --- */ @@ -594,7 +403,8 @@ struct lws_context_per_thread { struct lws_pt_eventlibs_libevent event; #endif -#if defined(LWS_WITH_LIBEV) || defined(LWS_WITH_LIBUV) || defined(LWS_WITH_LIBEVENT) +#if defined(LWS_WITH_LIBEV) || defined(LWS_WITH_LIBUV) || \ + defined(LWS_WITH_LIBEVENT) struct lws_signal_watcher w_sigint; #endif @@ -603,12 +413,20 @@ struct lws_context_per_thread { unsigned long count_conns; unsigned int fds_count; + /* + * set to the Thread ID that's doing the service loop just before entry + * to poll indicates service thread likely idling in poll() + * volatile because other threads may check it as part of processing + * for pollfd event change. + */ + volatile int service_tid; + int service_tid_detected; + volatile unsigned char inside_poll; volatile unsigned char foreign_spinlock; unsigned char tid; - unsigned char lock_depth; unsigned char inside_service:1; unsigned char event_loop_foreign:1; unsigned char event_loop_destroy_processing_done:1; @@ -626,8 +444,10 @@ lws_sum_stats(const struct lws_context *ctx, struct lws_conn_stats *cs); struct lws_timed_vh_protocol { struct lws_timed_vh_protocol *next; const struct lws_protocols *protocol; + struct lws_vhost *vhost; /* only used for pending processing */ time_t time; int reason; + int tsi_req; }; /* @@ -655,6 +475,7 @@ struct lws_vhost { #endif #if LWS_MAX_SMP > 1 pthread_mutex_t lock; + char close_flow_vs_tsi[LWS_MAX_SMP]; #endif #if defined(LWS_ROLE_H2) @@ -683,6 +504,9 @@ struct lws_vhost { const char *name; const char *iface; + void (*finalize)(struct lws_vhost *vh, void *arg); + void *finalize_arg; + #if !defined(LWS_WITH_ESP32) && !defined(OPTEE_TA) && !defined(WIN32) int bind_iface; #endif @@ -690,7 +514,7 @@ struct lws_vhost { void **protocol_vh_privs; const struct lws_protocol_vhost_options *pvo; const struct lws_protocol_vhost_options *headers; - struct lws **same_vh_protocol_list; + struct lws_dll_lws *same_vh_protocol_heads; struct lws_vhost *no_listener_vhost_list; #if !defined(LWS_NO_CLIENT) struct lws_dll_lws dll_active_client_conns; @@ -716,6 +540,8 @@ struct lws_vhost { int keepalive_timeout; int timeout_secs_ah_idle; + int count_bound_wsi; + #ifdef LWS_WITH_ACCESS_LOG int log_fd; #endif @@ -727,6 +553,13 @@ struct lws_vhost { unsigned char raw_protocol_index; }; +void +lws_vhost_bind_wsi(struct lws_vhost *vh, struct lws *wsi); +void +lws_vhost_unbind_wsi(struct lws *wsi); +void +__lws_vhost_destroy2(struct lws_vhost *vh); + struct lws_deferred_free { struct lws_deferred_free *next; @@ -791,8 +624,7 @@ struct lws_context { struct lws_context_per_thread pt[LWS_MAX_SMP]; struct lws_conn_stats conn_stats; #if LWS_MAX_SMP > 1 - pthread_mutex_t lock; - int lock_depth; + struct lws_mutex_refcount mr; #endif #ifdef _WIN32 /* different implementation between unix and windows */ @@ -805,6 +637,11 @@ struct lws_context { struct lws_vhost *vhost_pending_destruction_list; struct lws_plugin *plugin_list; struct lws_deferred_free *deferred_free_list; + +#if defined(LWS_WITH_THREADPOOL) + struct lws_threadpool *tp_list_head; +#endif + #if defined(LWS_WITH_PEER_LIMITS) struct lws_peer **pl_hash_table; struct lws_peer *peer_wait_list; @@ -889,14 +726,6 @@ struct lws_context { unsigned int doing_protocol_init:1; unsigned int done_protocol_destroy_cb:1; unsigned int finalize_destroy_after_internal_loops_stopped:1; - /* - * set to the Thread ID that's doing the service loop just before entry - * to poll indicates service thread likely idling in poll() - * volatile because other threads may check it as part of processing - * for pollfd event change. - */ - volatile int service_tid; - int service_tid_detected; short count_threads; short plugin_protocol_count; @@ -909,7 +738,7 @@ struct lws_context { }; int -lws_check_deferred_free(struct lws_context *context, int force); +lws_check_deferred_free(struct lws_context *context, int tsi, int force); #define lws_get_context_protocol(ctx, x) ctx->vhost_list->protocols[x] #define lws_get_vh_protocol(vh, x) vh->protocols[x] @@ -945,13 +774,13 @@ enum { LWS_EV_START = (1 << 2), LWS_EV_STOP = (1 << 3), - LWS_EV_PREPARE_DELETION = (1 << 31), + LWS_EV_PREPARE_DELETION = (1u << 31), }; #if defined(LWS_WITH_ESP32) LWS_EXTERN int -lws_find_string_in_file(const char *filename, const char *string, int stringlen); +lws_find_string_in_file(const char *filename, const char *str, int stringlen); #endif #ifdef LWS_WITH_IPV6 @@ -1026,6 +855,9 @@ struct lws { #if defined(LWS_ROLE_WS) struct _lws_websocket_related *ws; /* allocated if we upgrade to ws */ #endif +#if defined(LWS_ROLE_DBUS) + struct _lws_dbus_mode_related dbus; +#endif const struct lws_role_ops *role_ops; lws_wsi_state_t wsistate; @@ -1033,7 +865,8 @@ struct lws { /* lifetime members */ -#if defined(LWS_WITH_LIBEV) || defined(LWS_WITH_LIBUV) || defined(LWS_WITH_LIBEVENT) +#if defined(LWS_WITH_LIBEV) || defined(LWS_WITH_LIBUV) || \ + defined(LWS_WITH_LIBEVENT) struct lws_io_watcher w_read; #endif #if defined(LWS_WITH_LIBEV) || defined(LWS_WITH_LIBEVENT) @@ -1049,12 +882,16 @@ struct lws { struct lws *sibling_list; /* subsequent children at same level */ const struct lws_protocols *protocol; - struct lws **same_vh_protocol_prev, *same_vh_protocol_next; + struct lws_dll_lws same_vh_protocol; struct lws_dll_lws dll_timeout; struct lws_dll_lws dll_hrtimer; struct lws_dll_lws dll_buflist; /* guys with pending rxflow */ +#if defined(LWS_WITH_THREADPOOL) + struct lws_threadpool_task *tp_task; +#endif + #if defined(LWS_WITH_PEER_LIMITS) struct lws_peer *peer; #endif @@ -1070,10 +907,8 @@ struct lws { void *user_space; void *opaque_parent_data; - struct lws_buflist *buflist; - - /* truncated send handling */ - unsigned char *trunc_alloc; /* non-NULL means buffering in progress */ + struct lws_buflist *buflist; /* input-side buflist */ + struct lws_buflist *buflist_out; /* output-side buflist */ #if defined(LWS_WITH_TLS) struct lws_lws_tls tls; @@ -1098,9 +933,7 @@ struct lws { /* ints */ #define LWS_NO_FDS_POS (-1) int position_in_fds_table; - unsigned int trunc_alloc_len; /* size of malloc */ - unsigned int trunc_offset; /* where we are in terms of spilling */ - unsigned int trunc_len; /* how much is buffered */ + #ifndef LWS_NO_CLIENT int chunk_remaining; #endif @@ -1128,18 +961,18 @@ struct lws { unsigned int waiting_to_send_close_frame:1; unsigned int close_needs_ack:1; unsigned int ipv6:1; - unsigned int parent_carries_io:1; unsigned int parent_pending_cb_on_writable:1; unsigned int cgi_stdout_zero_length:1; unsigned int seen_zero_length_recv:1; unsigned int rxflow_will_be_applied:1; unsigned int event_pipe:1; - unsigned int on_same_vh_list:1; unsigned int handling_404:1; unsigned int protocol_bind_balance:1; + unsigned int unix_skt:1; unsigned int could_have_pending:1; /* detect back-to-back writes */ unsigned int outer_will_close:1; + unsigned int shadow:1; /* we do not control fd lifecycle at all */ #ifdef LWS_WITH_ACCESS_LOG unsigned int access_log_pending:1; @@ -1194,6 +1027,9 @@ struct lws { volatile char leave_pollout_active; }; +LWS_EXTERN char * +lws_strdup(const char *s); + #define lws_is_flowcontrolled(w) (!!(wsi->rxflow_bitmap)) void @@ -1243,6 +1079,9 @@ lws_latency(struct lws_context *context, struct lws *wsi, const char *action, int ret, int completion); #endif +static LWS_INLINE int +lws_has_buffered_out(struct lws *wsi) { return !!wsi->buflist_out; } + LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ws_client_rx_sm(struct lws *wsi, unsigned char c); @@ -1262,22 +1101,7 @@ LWS_EXTERN int lws_service_flag_pending(struct lws_context *context, int tsi); LWS_EXTERN int -lws_timed_callback_remove(struct lws_vhost *vh, struct lws_timed_vh_protocol *p); - -#if defined(_WIN32) -LWS_EXTERN struct lws * -wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd); - -LWS_EXTERN int -insert_wsi(struct lws_context *context, struct lws *wsi); - -LWS_EXTERN int -delete_from_fd(struct lws_context *context, lws_sockfd_type fd); -#else -#define wsi_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()] -#define insert_wsi(A,B) assert(A->lws_lookup[B->desc.sockfd - lws_plat_socket_offset()] == 0); A->lws_lookup[B->desc.sockfd - lws_plat_socket_offset()]=B -#define delete_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()]=0 -#endif +__lws_timed_callback_remove(struct lws_vhost *vh, struct lws_timed_vh_protocol *p); LWS_EXTERN int LWS_WARN_UNUSED_RESULT __insert_wsi_socket_into_fds(struct lws_context *context, struct lws *wsi); @@ -1305,7 +1129,7 @@ LWS_EXTERN int lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd); LWS_EXTERN struct lws * -lws_client_connect_via_info2(struct lws *wsi); +lws_http_client_connect_via_info2(struct lws *wsi); @@ -1343,10 +1167,8 @@ user_callback_handle_rxflow(lws_callback_function, struct lws *wsi, void *in, size_t len); LWS_EXTERN int -lws_plat_socket_offset(void); - -LWS_EXTERN int -lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd); +lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd, + int unix_skt); LWS_EXTERN int lws_plat_check_connection_error(struct lws *wsi); @@ -1429,7 +1251,7 @@ LWS_EXTERN void lwsl_emit_stderr(int level, const char *line); static LWS_INLINE void lws_pt_mutex_init(struct lws_context_per_thread *pt) { - pthread_mutex_init(&pt->lock, NULL); + lws_mutex_refcount_init(&pt->mr); pthread_mutex_init(&pt->lock_stats, NULL); } @@ -1437,34 +1259,11 @@ static LWS_INLINE void lws_pt_mutex_destroy(struct lws_context_per_thread *pt) { pthread_mutex_destroy(&pt->lock_stats); - pthread_mutex_destroy(&pt->lock); + lws_mutex_refcount_destroy(&pt->mr); } -static LWS_INLINE void -lws_pt_lock(struct lws_context_per_thread *pt, const char *reason) -{ - if (pt->lock_owner == pthread_self()) { - pt->lock_depth++; - return; - } - pthread_mutex_lock(&pt->lock); - pt->last_lock_reason = reason; - pt->lock_owner = pthread_self(); - //lwsl_notice("tid %d: lock %s\n", pt->tid, reason); -} - -static LWS_INLINE void -lws_pt_unlock(struct lws_context_per_thread *pt) -{ - if (pt->lock_depth) { - pt->lock_depth--; - return; - } - pt->last_lock_reason = "free"; - pt->lock_owner = 0; - //lwsl_notice("tid %d: unlock %s\n", pt->tid, pt->last_lock_reason); - pthread_mutex_unlock(&pt->lock); -} +#define lws_pt_lock(pt, reason) lws_mutex_refcount_lock(&pt->mr, reason) +#define lws_pt_unlock(pt) lws_mutex_refcount_unlock(&pt->mr) static LWS_INLINE void lws_pt_stats_lock(struct lws_context_per_thread *pt) @@ -1478,17 +1277,8 @@ lws_pt_stats_unlock(struct lws_context_per_thread *pt) pthread_mutex_unlock(&pt->lock_stats); } -static LWS_INLINE void -lws_context_lock(struct lws_context *context) -{ - pthread_mutex_lock(&context->lock); -} - -static LWS_INLINE void -lws_context_unlock(struct lws_context *context) -{ - pthread_mutex_unlock(&context->lock); -} +#define lws_context_lock(c, reason) lws_mutex_refcount_lock(&c->mr, reason) +#define lws_context_unlock(c) lws_mutex_refcount_unlock(&c->mr) static LWS_INLINE void lws_vhost_lock(struct lws_vhost *vhost) @@ -1508,7 +1298,7 @@ lws_vhost_unlock(struct lws_vhost *vhost) #define lws_pt_mutex_destroy(_a) (void)(_a) #define lws_pt_lock(_a, b) (void)(_a) #define lws_pt_unlock(_a) (void)(_a) -#define lws_context_lock(_a) (void)(_a) +#define lws_context_lock(_a, _b) (void)(_a) #define lws_context_unlock(_a) (void)(_a) #define lws_vhost_lock(_a) (void)(_a) #define lws_vhost_unlock(_a) (void)(_a) @@ -1566,7 +1356,7 @@ lws_handshake_server(struct lws *wsi, unsigned char **buf, size_t len); LWS_EXTERN int lws_access_log(struct lws *wsi); LWS_EXTERN void -lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth); +lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int len, int meth); #else #define lws_access_log(_a) #endif @@ -1581,7 +1371,8 @@ int lws_protocol_init(struct lws_context *context); int -lws_bind_protocol(struct lws *wsi, const struct lws_protocols *p); +lws_bind_protocol(struct lws *wsi, const struct lws_protocols *p, + const char *reason); const struct lws_http_mount * lws_find_mount(struct lws *wsi, const char *uri_ptr, int uri_len); @@ -1605,9 +1396,6 @@ void lws_free(void *p); #define lws_free_set_NULL(P) do { lws_realloc(P, 0, "free"); (P) = NULL; } while(0) #endif -char * -lws_strdup(const char *s); - int lws_plat_pipe_create(struct lws *wsi); int @@ -1617,8 +1405,8 @@ lws_plat_pipe_close(struct lws *wsi); int lws_create_event_pipes(struct lws_context *context); -int lws_open(const char *__file, int __oflag, ...); -void lws_plat_apply_FD_CLOEXEC(int n); +int +lws_plat_apply_FD_CLOEXEC(int n); const struct lws_plat_file_ops * lws_vfs_select_fops(const struct lws_plat_file_ops *fops, const char *vfs_path, @@ -1653,27 +1441,33 @@ LWS_EXTERN int lws_plat_service(struct lws_context *context, int timeout_ms); LWS_EXTERN LWS_VISIBLE int _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi); + +LWS_EXTERN int +lws_pthread_self_to_tsi(struct lws_context *context); + LWS_EXTERN int lws_plat_init(struct lws_context *context, const struct lws_context_creation_info *info); LWS_EXTERN void lws_plat_drop_app_privileges(const struct lws_context_creation_info *info); -LWS_EXTERN unsigned long long -time_in_microseconds(void); LWS_EXTERN const char * LWS_WARN_UNUSED_RESULT lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt); LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_plat_inet_pton(int af, const char *src, void *dst); +LWS_EXTERN int +lws_check_byte_utf8(unsigned char state, unsigned char c); LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_check_utf8(unsigned char *state, unsigned char *buf, size_t len); -LWS_EXTERN int alloc_file(struct lws_context *context, const char *filename, uint8_t **buf, - lws_filepos_t *amount); +LWS_EXTERN int alloc_file(struct lws_context *context, const char *filename, + uint8_t **buf, lws_filepos_t *amount); LWS_EXTERN void lws_same_vh_protocol_remove(struct lws *wsi); LWS_EXTERN void +__lws_same_vh_protocol_remove(struct lws *wsi); +LWS_EXTERN void lws_same_vh_protocol_insert(struct lws *wsi, int n); LWS_EXTERN int @@ -1703,7 +1497,8 @@ void socks_generate_msg(struct lws *wsi, enum socks_msg_type type, void lws_peer_track_wsi_close(struct lws_context *context, struct lws_peer *peer); int -lws_peer_confirm_ah_attach_ok(struct lws_context *context, struct lws_peer *peer); +lws_peer_confirm_ah_attach_ok(struct lws_context *context, + struct lws_peer *peer); void lws_peer_track_ah_detach(struct lws_context *context, struct lws_peer *peer); void @@ -1717,11 +1512,13 @@ void lws_peer_dump_from_wsi(struct lws *wsi); #endif -#ifdef LWS_WITH_HTTP_PROXY +#ifdef LWS_WITH_HUBBUB hubbub_error html_parser_cb(const hubbub_token *token, void *pw); #endif +int +lws_threadpool_tsi_context(struct lws_context *context, int tsi); void __lws_remove_from_timeout_list(struct lws *wsi); @@ -1746,11 +1543,12 @@ lws_buflist_aware_consume(struct lws *wsi, struct lws_tokens *ebuf, int used, char * -lws_generate_client_ws_handshake(struct lws *wsi, char *p); +lws_generate_client_ws_handshake(struct lws *wsi, char *p, const char *conn1); int lws_client_ws_upgrade(struct lws *wsi, const char **cce); int -lws_create_client_ws_object(struct lws_client_connect_info *i, struct lws *wsi); +lws_create_client_ws_object(const struct lws_client_connect_info *i, + struct lws *wsi); int lws_alpn_comma_to_openssl(const char *comma, uint8_t *os, int len); int @@ -1764,6 +1562,11 @@ void lws_destroy_event_pipe(struct lws *wsi); void lws_context_destroy2(struct lws_context *context); +int +lws_role_call_client_bind(struct lws *wsi, + const struct lws_client_connect_info *i); +void +lws_remove_child_from_any_parent(struct lws *wsi); #ifdef __cplusplus }; diff --git a/thirdparty/libwebsockets/core/service.c b/thirdparty/libwebsockets/lib/core/service.c index 6523058814..ef251409cb 100644 --- a/thirdparty/libwebsockets/core/service.c +++ b/thirdparty/libwebsockets/lib/core/service.c @@ -30,7 +30,7 @@ lws_callback_as_writeable(struct lws *wsi) lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_WRITEABLE_CB, 1); #if defined(LWS_WITH_STATS) if (wsi->active_writable_req_us) { - uint64_t ul = time_in_microseconds() - + uint64_t ul = lws_time_in_microseconds() - wsi->active_writable_req_us; lws_stats_atomic_bump(wsi->context, pt, @@ -74,12 +74,13 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd) * Priority 1: pending truncated sends are incomplete ws fragments * If anything else sent first the protocol would be * corrupted. + * + * These are post- any compression transform */ - if (wsi->trunc_len) { + if (lws_has_buffered_out(wsi)) { //lwsl_notice("%s: completing partial\n", __func__); - if (lws_issue_raw(wsi, wsi->trunc_alloc + wsi->trunc_offset, - wsi->trunc_len) < 0) { + if (lws_issue_raw(wsi, NULL, 0) < 0) { lwsl_info("%s signalling to close\n", __func__); goto bail_die; } @@ -91,6 +92,28 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd) goto bail_die; /* retry closing now */ } + /* Priority 2: pre- compression transform */ + +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more) { + enum lws_write_protocol wp = LWS_WRITE_HTTP; + + lwsl_info("%s: completing comp partial (buflist_comp %p, may %d)\n", + __func__, wsi->http.comp_ctx.buflist_comp, + wsi->http.comp_ctx.may_have_more + ); + + if (wsi->role_ops->write_role_protocol(wsi, NULL, 0, &wp) < 0) { + lwsl_info("%s signalling to close\n", __func__); + goto bail_die; + } + lws_callback_on_writable(wsi); + + goto bail_ok; + } +#endif + #ifdef LWS_WITH_CGI /* * A cgi master's wire protocol remains h1 or h2. He is just getting @@ -126,13 +149,6 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd) /* one shot */ - if (wsi->parent_carries_io) { - vwsi->handling_pollout = 0; - vwsi->leave_pollout_active = 0; - - return lws_callback_as_writeable(wsi); - } - if (pollfd) { int eff = vwsi->leave_pollout_active; @@ -216,7 +232,9 @@ static int __lws_service_timeout_check(struct lws *wsi, time_t sec) { struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; +#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) int n = 0; +#endif (void)n; @@ -228,9 +246,11 @@ __lws_service_timeout_check(struct lws *wsi, time_t sec) lws_compare_time_t(wsi->context, sec, wsi->pending_timeout_set) > wsi->pending_timeout_limit) { +#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) if (wsi->desc.sockfd != LWS_SOCK_INVALID && wsi->position_in_fds_table >= 0) n = pt->fds[wsi->position_in_fds_table].events; +#endif lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_TIMEOUTS, 1); @@ -318,9 +338,10 @@ lws_service_adjust_timeout(struct lws_context *context, int timeout_ms, int tsi) { struct lws_context_per_thread *pt = &context->pt[tsi]; - /* Figure out if we really want to wait in poll() - * We only need to wait if really nothing already to do and we have - * to wait for something from network + /* + * Figure out if we really want to wait in poll()... we only need to + * wait if really nothing already to do and we have to wait for + * something from network */ #if defined(LWS_ROLE_WS) && !defined(LWS_WITHOUT_EXTENSIONS) /* 1) if we know we are draining rx ext, do not wait in poll */ @@ -328,23 +349,31 @@ lws_service_adjust_timeout(struct lws_context *context, int timeout_ms, int tsi) return 0; #endif - /* 2) if we know we have non-network pending data, do not wait in poll */ + /* 2) if we know we have non-network pending data, + * do not wait in poll */ if (pt->context->tls_ops && - pt->context->tls_ops->fake_POLLIN_for_buffered) - if (pt->context->tls_ops->fake_POLLIN_for_buffered(pt)) + pt->context->tls_ops->fake_POLLIN_for_buffered && + pt->context->tls_ops->fake_POLLIN_for_buffered(pt)) return 0; - /* 3) If there is any wsi with rxflow buffered and in a state to process + /* + * 3) If there is any wsi with rxflow buffered and in a state to process * it, we should not wait in poll */ - lws_start_foreach_dll(struct lws_dll_lws *, d, pt->dll_head_buflist.next) { + lws_start_foreach_dll(struct lws_dll_lws *, d, + pt->dll_head_buflist.next) { struct lws *wsi = lws_container_of(d, struct lws, dll_buflist); if (lwsi_state(wsi) != LRS_DEFERRING_ACTION) return 0; + /* + * 4) If any guys with http compression to spill, we shouldn't wait in + * poll but hurry along and service them + */ + } lws_end_foreach_dll(d); return timeout_ms; @@ -431,8 +460,10 @@ lws_buflist_aware_consume(struct lws *wsi, struct lws_tokens *ebuf, int used, if (m < 0) return 1; /* OOM */ if (m) { - lwsl_debug("%s: added %p to rxflow list\n", __func__, wsi); - lws_dll_lws_add_front(&wsi->dll_buflist, &pt->dll_head_buflist); + lwsl_debug("%s: added %p to rxflow list\n", + __func__, wsi); + lws_dll_lws_add_front(&wsi->dll_buflist, + &pt->dll_head_buflist); } } @@ -487,10 +518,6 @@ int lws_service_flag_pending(struct lws_context *context, int tsi) { struct lws_context_per_thread *pt = &context->pt[tsi]; - -#if defined(LWS_WITH_TLS) - struct lws *wsi, *wsi_next; -#endif int forced = 0; lws_pt_lock(pt, __func__); @@ -520,9 +547,11 @@ lws_service_flag_pending(struct lws_context *context, int tsi) * service to use up the buffered incoming data, even though their * network socket may have nothing */ - wsi = pt->tls.pending_read_list; - while (wsi) { - wsi_next = wsi->tls.pending_read_list_next; + lws_start_foreach_dll_safe(struct lws_dll_lws *, p, p1, + pt->tls.pending_tls_head.next) { + struct lws *wsi = lws_container_of(p, struct lws, + tls.pending_tls_list); + pt->fds[wsi->position_in_fds_table].revents |= pt->fds[wsi->position_in_fds_table].events & LWS_POLLIN; if (pt->fds[wsi->position_in_fds_table].revents & LWS_POLLIN) { @@ -536,8 +565,7 @@ lws_service_flag_pending(struct lws_context *context, int tsi) __lws_ssl_remove_wsi_from_buffered_list(wsi); } - wsi = wsi_next; - } + } lws_end_foreach_dll_safe(p, p1); #endif lws_pt_unlock(pt); @@ -550,18 +578,21 @@ lws_service_periodic_checks(struct lws_context *context, struct lws_pollfd *pollfd, int tsi) { struct lws_context_per_thread *pt = &context->pt[tsi]; + struct lws_timed_vh_protocol *tmr; lws_sockfd_type our_fd = 0, tmp_fd; struct lws *wsi; int timed_out = 0; time_t now; #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) struct allocated_headers *ah; - int m; + int n, m; #endif if (!context->protocol_init_done) - if (lws_protocol_init(context)) + if (lws_protocol_init(context)) { + lwsl_err("%s: lws_protocol_init failed\n", __func__); return -1; + } time(&now); @@ -609,7 +640,7 @@ lws_service_periodic_checks(struct lws_context *context, #endif lws_plat_service_periodic(context); - lws_check_deferred_free(context, 0); + lws_check_deferred_free(context, tsi, 0); #if defined(LWS_WITH_PEER_LIMITS) lws_peer_cull_peer_wait_list(context); @@ -631,7 +662,7 @@ lws_service_periodic_checks(struct lws_context *context, our_fd = pollfd->fd; /* - * Phase 1: check every wsi on the timeout check list + * Phase 1: check every wsi on our pt's timeout check list */ lws_pt_lock(pt, __func__); @@ -701,8 +732,7 @@ lws_service_periodic_checks(struct lws_context *context, continue; } - if (lws_hdr_copy(wsi, buf, - sizeof buf, m) > 0) { + if (lws_hdr_copy(wsi, buf, sizeof buf, m) > 0) { buf[sizeof(buf) - 1] = '\0'; lwsl_notice(" %s = %s\n", @@ -749,37 +779,126 @@ lws_service_periodic_checks(struct lws_context *context, * Phase 3: vhost / protocol timer callbacks */ - wsi = NULL; + /* 3a: lock, collect, and remove vh timers that are pending */ + + lws_context_lock(context, "expired vh timers"); /* context ---------- */ + + n = 0; + + /* + * first, under the context lock, get a count of the number of + * expired timers so we can allocate for them (or not, cleanly) + */ + lws_start_foreach_ll(struct lws_vhost *, v, context->vhost_list) { - struct lws_timed_vh_protocol *nx; + if (v->timed_vh_protocol_list) { - lws_start_foreach_ll(struct lws_timed_vh_protocol *, - q, v->timed_vh_protocol_list) { - if (now >= q->time) { - if (!wsi) - wsi = lws_zalloc(sizeof(*wsi), "cbwsi"); - wsi->context = context; - wsi->vhost = v; - wsi->protocol = q->protocol; - lwsl_debug("timed cb: vh %s, protocol %s, reason %d\n", v->name, q->protocol->name, q->reason); - q->protocol->callback(wsi, q->reason, NULL, NULL, 0); - nx = q->next; - lws_timed_callback_remove(v, q); - q = nx; - continue; /* we pointed ourselves to the next from the now-deleted guy */ - } - } lws_end_foreach_ll(q, next); + + lws_start_foreach_ll_safe(struct lws_timed_vh_protocol *, + q, v->timed_vh_protocol_list, next) { + if (now >= q->time && q->tsi_req == tsi) + n++; + } lws_end_foreach_ll_safe(q); } + } lws_end_foreach_ll(v, vhost_next); - if (wsi) + + /* if nothing to do, unlock and move on to the next vhost */ + + if (!n) { + lws_context_unlock(context); /* ----------- context */ + goto vh_timers_done; + } + + /* + * attempt to do the wsi and timer info allocation + * first en bloc. If it fails, we can just skip the rest and + * the timers will still be pending next time. + */ + + wsi = lws_zalloc(sizeof(*wsi), "cbwsi"); + if (!wsi) { + /* + * at this point, we haven't cleared any vhost + * timers. We can fail out and retry cleanly + * next periodic check + */ + lws_context_unlock(context); /* ----------- context */ + goto vh_timers_done; + } + wsi->context = context; + + tmr = lws_zalloc(sizeof(*tmr) * n, "cbtmr"); + if (!tmr) { + /* again OOM here can be handled cleanly */ lws_free(wsi); + lws_context_unlock(context); /* ----------- context */ + goto vh_timers_done; + } + + /* so we have the allocation for n pending timers... */ + + m = 0; + lws_start_foreach_ll(struct lws_vhost *, v, context->vhost_list) { + + if (v->timed_vh_protocol_list) { + + lws_vhost_lock(v); /* vhost ------------------------- */ + + lws_start_foreach_ll_safe(struct lws_timed_vh_protocol *, + q, v->timed_vh_protocol_list, next) { + + /* only do n */ + if (m == n) + break; + + if (now >= q->time && q->tsi_req == tsi) { + + /* + * tmr is an allocated array. + * Ignore the linked-list. + */ + tmr[m].vhost = v; + tmr[m].protocol = q->protocol; + tmr[m++].reason = q->reason; + + /* take the timer out now we took + * responsibility */ + __lws_timed_callback_remove(v, q); + } + + } lws_end_foreach_ll_safe(q); + + lws_vhost_unlock(v); /* ----------------------- vhost */ + } + + } lws_end_foreach_ll(v, vhost_next); + lws_context_unlock(context); /* ---------------------------- context */ + + /* 3b: call the vh timer callbacks outside any lock */ + + for (m = 0; m < n; m++) { + + wsi->vhost = tmr[m].vhost; /* not a real bound wsi */ + wsi->protocol = tmr[m].protocol; + + lwsl_debug("%s: timed cb: vh %s, protocol %s, reason %d\n", + __func__, tmr[m].vhost->name, tmr[m].protocol->name, + tmr[m].reason); + tmr[m].protocol->callback(wsi, tmr[m].reason, NULL, NULL, 0); + } + + lws_free(tmr); + lws_free(wsi); + +vh_timers_done: /* * Phase 4: check for unconfigured vhosts due to required * interface missing before */ - lws_context_lock(context); + lws_context_lock(context, "periodic checks"); lws_start_foreach_llp(struct lws_vhost **, pv, context->no_listener_vhost_list) { struct lws_vhost *v = *pv; @@ -812,7 +931,7 @@ lws_service_periodic_checks(struct lws_context *context, context->tls_ops->periodic_housekeeping) context->tls_ops->periodic_housekeeping(context, now); - return timed_out; + return 0; } LWS_VISIBLE int @@ -825,9 +944,11 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, if (!context || context->being_destroyed1) return -1; - /* the socket we came to service timed out, nothing to do */ - if (lws_service_periodic_checks(context, pollfd, tsi) || !pollfd) - return 0; + /* the case there's no pollfd to service, we just want to do periodic */ + if (!pollfd) { + lws_service_periodic_checks(context, pollfd, tsi); + return -2; + } /* no, here to service a socket descriptor */ wsi = wsi_from_fd(context, pollfd->fd); @@ -923,6 +1044,9 @@ handled: #endif pollfd->revents = 0; + /* check the timeout situation if we didn't in the last second */ + lws_service_periodic_checks(context, pollfd, tsi); + lws_pt_lock(pt, __func__); __lws_hrtimer_service(pt); lws_pt_unlock(pt); @@ -969,6 +1093,9 @@ lws_service_tsi(struct lws_context *context, int timeout_ms, int tsi) int n; pt->inside_service = 1; +#if LWS_MAX_SMP > 1 + pt->self = pthread_self(); +#endif if (context->event_loop_ops->run_pt) { /* we are configured for an event loop */ diff --git a/thirdparty/libwebsockets/event-libs/poll/poll.c b/thirdparty/libwebsockets/lib/event-libs/poll/poll.c index 09af5b15d8..09af5b15d8 100644 --- a/thirdparty/libwebsockets/event-libs/poll/poll.c +++ b/thirdparty/libwebsockets/lib/event-libs/poll/poll.c diff --git a/thirdparty/libwebsockets/event-libs/poll/private.h b/thirdparty/libwebsockets/lib/event-libs/poll/private.h index ca313ebfb0..ca313ebfb0 100644 --- a/thirdparty/libwebsockets/event-libs/poll/private.h +++ b/thirdparty/libwebsockets/lib/event-libs/poll/private.h diff --git a/thirdparty/libwebsockets/event-libs/private.h b/thirdparty/libwebsockets/lib/event-libs/private.h index c36d39c8c2..58bca946b5 100644 --- a/thirdparty/libwebsockets/event-libs/private.h +++ b/thirdparty/libwebsockets/lib/event-libs/private.h @@ -41,7 +41,7 @@ struct lws_event_loop_ops { /* close handle manually */ void (*close_handle_manually)(struct lws *wsi); /* event loop accept processing */ - void (*accept)(struct lws *wsi); + int (*accept)(struct lws *wsi); /* control wsi active events */ void (*io)(struct lws *wsi, int flags); /* run the event loop for a pt */ diff --git a/thirdparty/libwebsockets/lws_config_private.h b/thirdparty/libwebsockets/lib/lws_config_private.h index e531777624..e531777624 100644 --- a/thirdparty/libwebsockets/lws_config_private.h +++ b/thirdparty/libwebsockets/lib/lws_config_private.h diff --git a/thirdparty/libwebsockets/misc/base64-decode.c b/thirdparty/libwebsockets/lib/misc/base64-decode.c index 64b84d78fa..de2efc8fd1 100644 --- a/thirdparty/libwebsockets/misc/base64-decode.c +++ b/thirdparty/libwebsockets/lib/misc/base64-decode.c @@ -55,12 +55,11 @@ _lws_b64_encode_string(const char *encode, const char *in, int in_len, { unsigned char triple[3]; int i; - int len; int line = 0; int done = 0; while (in_len) { - len = 0; + int len = 0; for (i = 0; i < 3; i++) { if (in_len) { triple[i] = *in++; diff --git a/thirdparty/libwebsockets/misc/getifaddrs.c b/thirdparty/libwebsockets/lib/misc/getifaddrs.c index 735b899f48..735b899f48 100644 --- a/thirdparty/libwebsockets/misc/getifaddrs.c +++ b/thirdparty/libwebsockets/lib/misc/getifaddrs.c diff --git a/thirdparty/libwebsockets/misc/getifaddrs.h b/thirdparty/libwebsockets/lib/misc/getifaddrs.h index d26670c082..d26670c082 100644 --- a/thirdparty/libwebsockets/misc/getifaddrs.h +++ b/thirdparty/libwebsockets/lib/misc/getifaddrs.h diff --git a/thirdparty/libwebsockets/misc/lejp.c b/thirdparty/libwebsockets/lib/misc/lejp.c index 99142b9553..599a6d37ba 100644 --- a/thirdparty/libwebsockets/misc/lejp.c +++ b/thirdparty/libwebsockets/lib/misc/lejp.c @@ -126,7 +126,7 @@ lejp_check_path_match(struct lejp_ctx *ctx) q++; continue; } - ctx->wild[ctx->wildcount++] = p - ctx->path; + ctx->wild[ctx->wildcount++] = lws_ptr_diff(p, ctx->path); q++; /* * if * has something after it, match to . diff --git a/thirdparty/libwebsockets/misc/sha-1.c b/thirdparty/libwebsockets/lib/misc/sha-1.c index 2e4db52693..898f3f45b1 100644 --- a/thirdparty/libwebsockets/misc/sha-1.c +++ b/thirdparty/libwebsockets/lib/misc/sha-1.c @@ -236,18 +236,14 @@ sha1_pad(struct sha1_ctxt *ctxt) void sha1_loop(struct sha1_ctxt *ctxt, const unsigned char *input, size_t len) { - size_t gaplen; - size_t gapstart; size_t off; - size_t copysiz; off = 0; while (off < len) { - gapstart = COUNT % 64; - gaplen = 64 - gapstart; + size_t gapstart = COUNT % 64, gaplen = 64 - gapstart, + copysiz = (gaplen < len - off) ? gaplen : len - off; - copysiz = (gaplen < len - off) ? gaplen : len - off; memcpy(&ctxt->m.b8[gapstart], &input[off], copysiz); COUNT += (unsigned char)copysiz; COUNT %= 64; diff --git a/thirdparty/libwebsockets/lib/plat/unix/private.h b/thirdparty/libwebsockets/lib/plat/unix/private.h new file mode 100644 index 0000000000..8583ee7bc8 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/private.h @@ -0,0 +1,169 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Included from lib/core/private.h if no explicit platform + */ + +#include <fcntl.h> +#include <strings.h> +#include <unistd.h> + +#include <netinet/in.h> +#include <netinet/tcp.h> +#include <arpa/inet.h> +#include <poll.h> +#include <netdb.h> + +#ifndef __cplusplus +#include <errno.h> +#endif +#include <netdb.h> +#include <signal.h> + +#include <sys/socket.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/time.h> +#include <sys/mman.h> +#include <sys/un.h> + +#if defined(__APPLE__) +#include <machine/endian.h> +#endif +#if defined(__FreeBSD__) +#include <sys/endian.h> +#endif +#if defined(__linux__) +#include <endian.h> +#endif +#if defined(__QNX__) + #include <gulliver.h> + #if defined(__LITTLEENDIAN__) + #define BYTE_ORDER __LITTLEENDIAN__ + #define LITTLE_ENDIAN __LITTLEENDIAN__ + #define BIG_ENDIAN 4321 /* to show byte order (taken from gcc); for suppres warning that BIG_ENDIAN is not defined. */ + #endif + #if defined(__BIGENDIAN__) + #define BYTE_ORDER __BIGENDIAN__ + #define LITTLE_ENDIAN 1234 /* to show byte order (taken from gcc); for suppres warning that LITTLE_ENDIAN is not defined. */ + #define BIG_ENDIAN __BIGENDIAN__ + #endif +#endif + +#if defined(__sun) && defined(__GNUC__) + +#include <arpa/nameser_compat.h> + +#if !defined (BYTE_ORDER) +#define BYTE_ORDER __BYTE_ORDER__ +#endif + +#if !defined(LITTLE_ENDIAN) +#define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ +#endif + +#if !defined(BIG_ENDIAN) +#define BIG_ENDIAN __ORDER_BIG_ENDIAN__ +#endif + +#endif /* sun + GNUC */ + +#if !defined(BYTE_ORDER) +#define BYTE_ORDER __BYTE_ORDER +#endif +#if !defined(LITTLE_ENDIAN) +#define LITTLE_ENDIAN __LITTLE_ENDIAN +#endif +#if !defined(BIG_ENDIAN) +#define BIG_ENDIAN __BIG_ENDIAN +#endif + +#if defined(LWS_BUILTIN_GETIFADDRS) +#include "./misc/getifaddrs.h" +#else + +#if defined(__HAIKU__) +#define _BSD_SOURCE +#endif +#include <ifaddrs.h> + +#endif + +#if defined (__sun) || defined(__HAIKU__) || defined(__QNX__) +#include <syslog.h> +#else +#include <sys/syslog.h> +#endif + +#ifdef __QNX__ +# include "netinet/tcp_var.h" +# define TCP_KEEPINTVL TCPCTL_KEEPINTVL +# define TCP_KEEPIDLE TCPCTL_KEEPIDLE +# define TCP_KEEPCNT TCPCTL_KEEPCNT +#endif + +#define LWS_ERRNO errno +#define LWS_EAGAIN EAGAIN +#define LWS_EALREADY EALREADY +#define LWS_EINPROGRESS EINPROGRESS +#define LWS_EINTR EINTR +#define LWS_EISCONN EISCONN +#define LWS_ENOTCONN ENOTCONN +#define LWS_EWOULDBLOCK EWOULDBLOCK +#define LWS_EADDRINUSE EADDRINUSE +#define lws_set_blocking_send(wsi) +#define LWS_SOCK_INVALID (-1) + +#define wsi_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()] +#define insert_wsi(A,B) assert(A->lws_lookup[B->desc.sockfd - \ + lws_plat_socket_offset()] == 0); \ + A->lws_lookup[B->desc.sockfd - \ + lws_plat_socket_offset()] = B +#define delete_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()] = 0 + +#ifndef LWS_NO_FORK +#ifdef LWS_HAVE_SYS_PRCTL_H +#include <sys/prctl.h> +#endif +#endif + +#if defined (__ANDROID__) + #include <syslog.h> + #include <sys/resource.h> +#endif + +#define compatible_close(x) close(x) +#define lws_plat_socket_offset() (0) + +/* + * Mac OSX as well as iOS do not define the MSG_NOSIGNAL flag, + * but happily have something equivalent in the SO_NOSIGPIPE flag. + */ +#ifdef __APPLE__ +#define MSG_NOSIGNAL SO_NOSIGPIPE +#endif + +/* + * Solaris 11.X only supports POSIX 2001, MSG_NOSIGNAL appears in + * POSIX 2008. + */ +#ifdef __sun + #define MSG_NOSIGNAL 0 +#endif diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-caps.c b/thirdparty/libwebsockets/lib/plat/unix/unix-caps.c new file mode 100644 index 0000000000..64aea61816 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-caps.c @@ -0,0 +1,85 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + +#include <pwd.h> +#include <grp.h> + +#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) +static void +_lws_plat_apply_caps(int mode, const cap_value_t *cv, int count) +{ + cap_t caps; + + if (!count) + return; + + caps = cap_get_proc(); + + cap_set_flag(caps, mode, count, cv, CAP_SET); + cap_set_proc(caps); + prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0); + cap_free(caps); +} +#endif + +void +lws_plat_drop_app_privileges(const struct lws_context_creation_info *info) +{ + if (info->gid && info->gid != -1) + if (setgid(info->gid)) + lwsl_warn("setgid: %s\n", strerror(LWS_ERRNO)); + + if (info->uid && info->uid != -1) { + struct passwd *p = getpwuid(info->uid); + + if (p) { + +#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) + _lws_plat_apply_caps(CAP_PERMITTED, info->caps, + info->count_caps); +#endif + + initgroups(p->pw_name, info->gid); + if (setuid(info->uid)) + lwsl_warn("setuid: %s\n", strerror(LWS_ERRNO)); + else + lwsl_notice("Set privs to user '%s'\n", + p->pw_name); + +#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) + _lws_plat_apply_caps(CAP_EFFECTIVE, info->caps, + info->count_caps); + + if (info->count_caps) { + int n; + for (n = 0; n < info->count_caps; n++) + lwsl_notice(" RETAINING CAP %d\n", + (int)info->caps[n]); + } +#endif + + } else + lwsl_warn("getpwuid: unable to find uid %d", info->uid); + } +} diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-fds.c b/thirdparty/libwebsockets/lib/plat/unix/unix-fds.c new file mode 100644 index 0000000000..8a00bcff3f --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-fds.c @@ -0,0 +1,54 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + +void +lws_plat_insert_socket_into_fds(struct lws_context *context, struct lws *wsi) +{ + struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + + if (context->event_loop_ops->io) + context->event_loop_ops->io(wsi, LWS_EV_START | LWS_EV_READ); + + pt->fds[pt->fds_count++].revents = 0; +} + +void +lws_plat_delete_socket_from_fds(struct lws_context *context, + struct lws *wsi, int m) +{ + struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + + if (context->event_loop_ops->io) + context->event_loop_ops->io(wsi, + LWS_EV_STOP | LWS_EV_READ | LWS_EV_WRITE); + + pt->fds_count--; +} + +int +lws_plat_change_pollfd(struct lws_context *context, + struct lws *wsi, struct lws_pollfd *pfd) +{ + return 0; +} diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-file.c b/thirdparty/libwebsockets/lib/plat/unix/unix-file.c new file mode 100644 index 0000000000..bcdc213a89 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-file.c @@ -0,0 +1,172 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + +#include <pwd.h> +#include <grp.h> + +#ifdef LWS_WITH_PLUGINS +#include <dlfcn.h> +#endif +#include <dirent.h> + +int lws_plat_apply_FD_CLOEXEC(int n) +{ + if (n == -1) + return 0; + + return fcntl(n, F_SETFD, FD_CLOEXEC); +} + +int +lws_plat_write_file(const char *filename, void *buf, int len) +{ + int m, fd; + + fd = lws_open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600); + + if (fd == -1) + return 1; + + m = write(fd, buf, len); + close(fd); + + return m != len; +} + +int +lws_plat_read_file(const char *filename, void *buf, int len) +{ + int n, fd = lws_open(filename, O_RDONLY); + if (fd == -1) + return -1; + + n = read(fd, buf, len); + close(fd); + + return n; +} + +lws_fop_fd_t +_lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, + const char *vpath, lws_fop_flags_t *flags) +{ + struct stat stat_buf; + int ret = lws_open(filename, (*flags) & LWS_FOP_FLAGS_MASK, 0664); + lws_fop_fd_t fop_fd; + + if (ret < 0) + return NULL; + + if (fstat(ret, &stat_buf) < 0) + goto bail; + + fop_fd = malloc(sizeof(*fop_fd)); + if (!fop_fd) + goto bail; + + fop_fd->fops = fops; + fop_fd->flags = *flags; + fop_fd->fd = ret; + fop_fd->filesystem_priv = NULL; /* we don't use it */ + fop_fd->len = stat_buf.st_size; + fop_fd->pos = 0; + + return fop_fd; + +bail: + close(ret); + return NULL; +} + +int +_lws_plat_file_close(lws_fop_fd_t *fop_fd) +{ + int fd = (*fop_fd)->fd; + + free(*fop_fd); + *fop_fd = NULL; + + return close(fd); +} + +lws_fileofs_t +_lws_plat_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset) +{ + lws_fileofs_t r; + + if (offset > 0 && + offset > (lws_fileofs_t)fop_fd->len - (lws_fileofs_t)fop_fd->pos) + offset = fop_fd->len - fop_fd->pos; + + if ((lws_fileofs_t)fop_fd->pos + offset < 0) + offset = -fop_fd->pos; + + r = lseek(fop_fd->fd, offset, SEEK_CUR); + + if (r >= 0) + fop_fd->pos = r; + else + lwsl_err("error seeking from cur %ld, offset %ld\n", + (long)fop_fd->pos, (long)offset); + + return r; +} + +int +_lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len) +{ + long n; + + n = read((int)fop_fd->fd, buf, len); + if (n == -1) { + *amount = 0; + return -1; + } + fop_fd->pos += n; + lwsl_debug("%s: read %ld of req %ld, pos %ld, len %ld\n", __func__, n, + (long)len, (long)fop_fd->pos, (long)fop_fd->len); + *amount = n; + + return 0; +} + +int +_lws_plat_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len) +{ + long n; + + n = write((int)fop_fd->fd, buf, len); + if (n == -1) { + *amount = 0; + return -1; + } + + fop_fd->pos += n; + *amount = n; + + return 0; +} + diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-init.c b/thirdparty/libwebsockets/lib/plat/unix/unix-init.c new file mode 100644 index 0000000000..fa9a30e8d2 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-init.c @@ -0,0 +1,97 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + +#include <pwd.h> +#include <grp.h> + +#ifdef LWS_WITH_PLUGINS +#include <dlfcn.h> +#endif +#include <dirent.h> + +int +lws_plat_init(struct lws_context *context, + const struct lws_context_creation_info *info) +{ + int fd; + + /* master context has the global fd lookup array */ + context->lws_lookup = lws_zalloc(sizeof(struct lws *) * + context->max_fds, "lws_lookup"); + if (context->lws_lookup == NULL) { + lwsl_err("OOM on lws_lookup array for %d connections\n", + context->max_fds); + return 1; + } + + lwsl_info(" mem: platform fd map: %5lu bytes\n", + (unsigned long)(sizeof(struct lws *) * context->max_fds)); + fd = lws_open(SYSTEM_RANDOM_FILEPATH, O_RDONLY); + + context->fd_random = fd; + if (context->fd_random < 0) { + lwsl_err("Unable to open random device %s %d\n", + SYSTEM_RANDOM_FILEPATH, context->fd_random); + return 1; + } + +#ifdef LWS_WITH_PLUGINS + if (info->plugin_dirs && (context->options & LWS_SERVER_OPTION_LIBUV)) + lws_plat_plugins_init(context, info->plugin_dirs); +#endif + + return 0; +} + +int +lws_plat_context_early_init(void) +{ +#if !defined(LWS_AVOID_SIGPIPE_IGN) + signal(SIGPIPE, SIG_IGN); +#endif + + return 0; +} + +void +lws_plat_context_early_destroy(struct lws_context *context) +{ +} + +void +lws_plat_context_late_destroy(struct lws_context *context) +{ +#ifdef LWS_WITH_PLUGINS + if (context->plugin_list) + lws_plat_plugins_destroy(context); +#endif + + if (context->lws_lookup) + lws_free(context->lws_lookup); + + if (!context->fd_random) + lwsl_err("ZERO RANDOM FD\n"); + if (context->fd_random != LWS_INVALID_FILE) + close(context->fd_random); +} diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-misc.c b/thirdparty/libwebsockets/lib/plat/unix/unix-misc.c new file mode 100644 index 0000000000..d4b0f76658 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-misc.c @@ -0,0 +1,83 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + + +uint64_t +lws_time_in_microseconds(void) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); + return ((unsigned long long)tv.tv_sec * 1000000LL) + tv.tv_usec; +} + +LWS_VISIBLE int +lws_get_random(struct lws_context *context, void *buf, int len) +{ + return read(context->fd_random, (char *)buf, len); +} + +LWS_VISIBLE void lwsl_emit_syslog(int level, const char *line) +{ + int syslog_level = LOG_DEBUG; + + switch (level) { + case LLL_ERR: + syslog_level = LOG_ERR; + break; + case LLL_WARN: + syslog_level = LOG_WARNING; + break; + case LLL_NOTICE: + syslog_level = LOG_NOTICE; + break; + case LLL_INFO: + syslog_level = LOG_INFO; + break; + } + syslog(syslog_level, "%s", line); +} + + +int +lws_plat_write_cert(struct lws_vhost *vhost, int is_key, int fd, void *buf, + int len) +{ + int n; + + n = write(fd, buf, len); + + fsync(fd); + if (lseek(fd, 0, SEEK_SET) < 0) + return 1; + + return n != len; +} + + +int +lws_plat_recommended_rsa_bits(void) +{ + return 4096; +} diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-pipe.c b/thirdparty/libwebsockets/lib/plat/unix/unix-pipe.c new file mode 100644 index 0000000000..64ce253be6 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-pipe.c @@ -0,0 +1,62 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + + +int +lws_plat_pipe_create(struct lws *wsi) +{ + struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; + +#if defined(LWS_HAVE_PIPE2) + return pipe2(pt->dummy_pipe_fds, O_NONBLOCK); +#else + return pipe(pt->dummy_pipe_fds); +#endif +} + +int +lws_plat_pipe_signal(struct lws *wsi) +{ + struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; + char buf = 0; + int n; + + n = write(pt->dummy_pipe_fds[1], &buf, 1); + + return n != 1; +} + +void +lws_plat_pipe_close(struct lws *wsi) +{ + struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; + + if (pt->dummy_pipe_fds[0] && pt->dummy_pipe_fds[0] != -1) + close(pt->dummy_pipe_fds[0]); + if (pt->dummy_pipe_fds[1] && pt->dummy_pipe_fds[1] != -1) + close(pt->dummy_pipe_fds[1]); + + pt->dummy_pipe_fds[0] = pt->dummy_pipe_fds[1] = -1; +} + diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-service.c b/thirdparty/libwebsockets/lib/plat/unix/unix-service.c new file mode 100644 index 0000000000..e61ef59959 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-service.c @@ -0,0 +1,204 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + +int +lws_poll_listen_fd(struct lws_pollfd *fd) +{ + return poll(fd, 1, 0); +} + +LWS_EXTERN int +_lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) +{ + volatile struct lws_foreign_thread_pollfd *ftp, *next; + volatile struct lws_context_per_thread *vpt; + struct lws_context_per_thread *pt; + int n = -1, m, c; + + /* stay dead once we are dead */ + + if (!context || !context->vhost_list) + return 1; + + pt = &context->pt[tsi]; + vpt = (volatile struct lws_context_per_thread *)pt; + + lws_stats_atomic_bump(context, pt, LWSSTATS_C_SERVICE_ENTRY, 1); + + if (timeout_ms < 0) + goto faked_service; + + if (context->event_loop_ops->run_pt) + context->event_loop_ops->run_pt(context, tsi); + + if (!pt->service_tid_detected) { + struct lws _lws; + + memset(&_lws, 0, sizeof(_lws)); + _lws.context = context; + + pt->service_tid = + context->vhost_list->protocols[0].callback( + &_lws, LWS_CALLBACK_GET_THREAD_ID, NULL, NULL, 0); + pt->service_tid_detected = 1; + } + + /* + * is there anybody with pending stuff that needs service forcing? + */ + if (!lws_service_adjust_timeout(context, 1, tsi)) { + /* -1 timeout means just do forced service */ + _lws_plat_service_tsi(context, -1, pt->tid); + /* still somebody left who wants forced service? */ + if (!lws_service_adjust_timeout(context, 1, pt->tid)) + /* yes... come back again quickly */ + timeout_ms = 0; + } + + if (timeout_ms) { + lws_pt_lock(pt, __func__); + /* don't stay in poll wait longer than next hr timeout */ + lws_usec_t t = __lws_hrtimer_service(pt); + if ((lws_usec_t)timeout_ms * 1000 > t) + timeout_ms = t / 1000; + lws_pt_unlock(pt); + } + + vpt->inside_poll = 1; + lws_memory_barrier(); + n = poll(pt->fds, pt->fds_count, timeout_ms); + vpt->inside_poll = 0; + lws_memory_barrier(); + + /* Collision will be rare and brief. Just spin until it completes */ + while (vpt->foreign_spinlock) + ; + + /* + * At this point we are not inside a foreign thread pollfd change, + * and we have marked ourselves as outside the poll() wait. So we + * are the only guys that can modify the lws_foreign_thread_pollfd + * list on the pt. Drain the list and apply the changes to the + * affected pollfds in the correct order. + */ + + lws_pt_lock(pt, __func__); + + ftp = vpt->foreign_pfd_list; + //lwsl_notice("cleared list %p\n", ftp); + while (ftp) { + struct lws *wsi; + struct lws_pollfd *pfd; + + next = ftp->next; + pfd = &vpt->fds[ftp->fd_index]; + if (lws_socket_is_valid(pfd->fd)) { + wsi = wsi_from_fd(context, pfd->fd); + if (wsi) + __lws_change_pollfd(wsi, ftp->_and, ftp->_or); + } + lws_free((void *)ftp); + ftp = next; + } + vpt->foreign_pfd_list = NULL; + lws_memory_barrier(); + + /* we have come out of a poll wait... check the hrtimer list */ + + __lws_hrtimer_service(pt); + + lws_pt_unlock(pt); + + m = 0; +#if defined(LWS_ROLE_WS) && !defined(LWS_WITHOUT_EXTENSIONS) + m |= !!pt->ws.rx_draining_ext_list; +#endif + + if (pt->context->tls_ops && + pt->context->tls_ops->fake_POLLIN_for_buffered) + m |= pt->context->tls_ops->fake_POLLIN_for_buffered(pt); + + if (!m && !n) { /* nothing to do */ + lws_service_fd_tsi(context, NULL, tsi); + lws_service_do_ripe_rxflow(pt); + + return 0; + } + +faked_service: + m = lws_service_flag_pending(context, tsi); + if (m) + c = -1; /* unknown limit */ + else + if (n < 0) { + if (LWS_ERRNO != LWS_EINTR) + return -1; + return 0; + } else + c = n; + + /* any socket with events to service? */ + for (n = 0; n < (int)pt->fds_count && c; n++) { + if (!pt->fds[n].revents) + continue; + + c--; + + m = lws_service_fd_tsi(context, &pt->fds[n], tsi); + if (m < 0) { + lwsl_err("%s: lws_service_fd_tsi returned %d\n", + __func__, m); + return -1; + } + /* if something closed, retry this slot */ + if (m) + n--; + } + + lws_service_do_ripe_rxflow(pt); + + return 0; +} + +int +lws_plat_check_connection_error(struct lws *wsi) +{ + return 0; +} + +int +lws_plat_service(struct lws_context *context, int timeout_ms) +{ + return _lws_plat_service_tsi(context, timeout_ms, 0); +} + + +void +lws_plat_service_periodic(struct lws_context *context) +{ + /* if our parent went down, don't linger around */ + if (context->started_with_parent && + kill(context->started_with_parent, 0) < 0) + kill(getpid(), SIGTERM); +} diff --git a/thirdparty/libwebsockets/lib/plat/unix/unix-sockets.c b/thirdparty/libwebsockets/lib/plat/unix/unix-sockets.c new file mode 100644 index 0000000000..192dddee63 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/unix/unix-sockets.c @@ -0,0 +1,263 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include "core/private.h" + +#include <pwd.h> +#include <grp.h> + + + +int +lws_send_pipe_choked(struct lws *wsi) +{ + struct lws_pollfd fds; + struct lws *wsi_eff; + +#if defined(LWS_WITH_HTTP2) + wsi_eff = lws_get_network_wsi(wsi); +#else + wsi_eff = wsi; +#endif + + /* the fact we checked implies we avoided back-to-back writes */ + wsi_eff->could_have_pending = 0; + + /* treat the fact we got a truncated send pending as if we're choked */ + if (lws_has_buffered_out(wsi_eff) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + ||wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more +#endif + ) + return 1; + + fds.fd = wsi_eff->desc.sockfd; + fds.events = POLLOUT; + fds.revents = 0; + + if (poll(&fds, 1, 0) != 1) + return 1; + + if ((fds.revents & POLLOUT) == 0) + return 1; + + /* okay to send another packet without blocking */ + + return 0; +} + + +int +lws_plat_set_socket_options(struct lws_vhost *vhost, int fd, int unix_skt) +{ + int optval = 1; + socklen_t optlen = sizeof(optval); + +#ifdef LWS_WITH_IPV6 + optval = 0; + setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen); +#endif + +#if defined(__APPLE__) || \ + defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ + defined(__NetBSD__) || \ + defined(__OpenBSD__) || \ + defined(__HAIKU__) + struct protoent *tcp_proto; +#endif + + (void)fcntl(fd, F_SETFD, FD_CLOEXEC); + + if (!unix_skt && vhost->ka_time) { + /* enable keepalive on this socket */ + optval = 1; + if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, + (const void *)&optval, optlen) < 0) + return 1; + +#if defined(__APPLE__) || \ + defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ + defined(__NetBSD__) || \ + defined(__CYGWIN__) || defined(__OpenBSD__) || defined (__sun) || \ + defined(__HAIKU__) + + /* + * didn't find a way to set these per-socket, need to + * tune kernel systemwide values + */ +#else + /* set the keepalive conditions we want on it too */ + +#if defined(LWS_HAVE_TCP_USER_TIMEOUT) + optval = 1000 * (vhost->ka_time + + (vhost->ka_interval * vhost->ka_probes)); + if (setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, + (const void *)&optval, optlen) < 0) + return 1; +#endif + optval = vhost->ka_time; + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, + (const void *)&optval, optlen) < 0) + return 1; + + optval = vhost->ka_interval; + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, + (const void *)&optval, optlen) < 0) + return 1; + + optval = vhost->ka_probes; + if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, + (const void *)&optval, optlen) < 0) + return 1; +#endif + } + +#if defined(SO_BINDTODEVICE) + if (!unix_skt && vhost->bind_iface && vhost->iface) { + lwsl_info("binding listen skt to %s using SO_BINDTODEVICE\n", vhost->iface); + if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, vhost->iface, + strlen(vhost->iface)) < 0) { + lwsl_warn("Failed to bind to device %s\n", vhost->iface); + return 1; + } + } +#endif + + /* Disable Nagle */ + optval = 1; +#if defined (__sun) || defined(__QNX__) + if (!unix_skt && setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (const void *)&optval, optlen) < 0) + return 1; +#elif !defined(__APPLE__) && \ + !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && \ + !defined(__NetBSD__) && \ + !defined(__OpenBSD__) && \ + !defined(__HAIKU__) + if (!unix_skt && setsockopt(fd, SOL_TCP, TCP_NODELAY, (const void *)&optval, optlen) < 0) + return 1; +#else + tcp_proto = getprotobyname("TCP"); + if (!unix_skt && setsockopt(fd, tcp_proto->p_proto, TCP_NODELAY, &optval, optlen) < 0) + return 1; +#endif + + /* We are nonblocking... */ + if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) + return 1; + + return 0; +} + + +/* cast a struct sockaddr_in6 * into addr for ipv6 */ + +int +lws_interface_to_sa(int ipv6, const char *ifname, struct sockaddr_in *addr, + size_t addrlen) +{ + int rc = LWS_ITOSA_NOT_EXIST; + + struct ifaddrs *ifr; + struct ifaddrs *ifc; +#ifdef LWS_WITH_IPV6 + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr; +#endif + + getifaddrs(&ifr); + for (ifc = ifr; ifc != NULL && rc; ifc = ifc->ifa_next) { + if (!ifc->ifa_addr) + continue; + + lwsl_debug(" interface %s vs %s (fam %d) ipv6 %d\n", + ifc->ifa_name, ifname, + ifc->ifa_addr->sa_family, ipv6); + + if (strcmp(ifc->ifa_name, ifname)) + continue; + + switch (ifc->ifa_addr->sa_family) { +#if defined(AF_PACKET) + case AF_PACKET: + /* interface exists but is not usable */ + rc = LWS_ITOSA_NOT_USABLE; + continue; +#endif + + case AF_INET: +#ifdef LWS_WITH_IPV6 + if (ipv6) { + /* map IPv4 to IPv6 */ + bzero((char *)&addr6->sin6_addr, + sizeof(struct in6_addr)); + addr6->sin6_addr.s6_addr[10] = 0xff; + addr6->sin6_addr.s6_addr[11] = 0xff; + memcpy(&addr6->sin6_addr.s6_addr[12], + &((struct sockaddr_in *)ifc->ifa_addr)->sin_addr, + sizeof(struct in_addr)); + } else +#endif + memcpy(addr, + (struct sockaddr_in *)ifc->ifa_addr, + sizeof(struct sockaddr_in)); + break; +#ifdef LWS_WITH_IPV6 + case AF_INET6: + memcpy(&addr6->sin6_addr, + &((struct sockaddr_in6 *)ifc->ifa_addr)->sin6_addr, + sizeof(struct in6_addr)); + break; +#endif + default: + continue; + } + rc = LWS_ITOSA_USABLE; + } + + freeifaddrs(ifr); + + if (rc) { + /* check if bind to IP address */ +#ifdef LWS_WITH_IPV6 + if (inet_pton(AF_INET6, ifname, &addr6->sin6_addr) == 1) + rc = LWS_ITOSA_USABLE; + else +#endif + if (inet_pton(AF_INET, ifname, &addr->sin_addr) == 1) + rc = LWS_ITOSA_USABLE; + } + + return rc; +} + + +const char * +lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt) +{ + return inet_ntop(af, src, dst, cnt); +} + +int +lws_plat_inet_pton(int af, const char *src, void *dst) +{ + return inet_pton(af, src, dst); +} diff --git a/thirdparty/libwebsockets/lib/plat/windows/private.h b/thirdparty/libwebsockets/lib/plat/windows/private.h new file mode 100644 index 0000000000..980028ce42 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/private.h @@ -0,0 +1,148 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Included from lib/core/private.h if defined(WIN32) || defined(_WIN32) + */ + + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + + #if (WINVER < 0x0501) + #undef WINVER + #undef _WIN32_WINNT + #define WINVER 0x0501 + #define _WIN32_WINNT WINVER + #endif + + #define LWS_NO_DAEMONIZE + #define LWS_ERRNO WSAGetLastError() + #define LWS_EAGAIN WSAEWOULDBLOCK + #define LWS_EALREADY WSAEALREADY + #define LWS_EINPROGRESS WSAEINPROGRESS + #define LWS_EINTR WSAEINTR + #define LWS_EISCONN WSAEISCONN + #define LWS_ENOTCONN WSAENOTCONN + #define LWS_EWOULDBLOCK WSAEWOULDBLOCK + #define LWS_EADDRINUSE WSAEADDRINUSE + #define MSG_NOSIGNAL 0 + #define SHUT_RDWR SD_BOTH + #define SOL_TCP IPPROTO_TCP + #define SHUT_WR SD_SEND + + #define compatible_close(fd) closesocket(fd) + #define lws_set_blocking_send(wsi) wsi->sock_send_blocking = 1 + #define LWS_SOCK_INVALID (INVALID_SOCKET) + + #include <winsock2.h> + #include <ws2tcpip.h> + #include <windows.h> + #include <tchar.h> + #ifdef LWS_HAVE_IN6ADDR_H + #include <in6addr.h> + #endif + #include <mstcpip.h> + #include <io.h> + + #if !defined(LWS_HAVE_ATOLL) + #if defined(LWS_HAVE__ATOI64) + #define atoll _atoi64 + #else + #warning No atoll or _atoi64 available, using atoi + #define atoll atoi + #endif + #endif + + #ifndef __func__ + #define __func__ __FUNCTION__ + #endif + + #ifdef LWS_HAVE__VSNPRINTF + #define vsnprintf _vsnprintf + #endif + +/* we don't have an implementation for this on windows... */ +int kill(int pid, int sig); +int fork(void); +#ifndef SIGINT +#define SIGINT 2 +#endif + +#include <gettimeofday.h> + +#ifndef BIG_ENDIAN + #define BIG_ENDIAN 4321 /* to show byte order (taken from gcc) */ +#endif +#ifndef LITTLE_ENDIAN + #define LITTLE_ENDIAN 1234 +#endif +#ifndef BYTE_ORDER + #define BYTE_ORDER LITTLE_ENDIAN +#endif + +#undef __P +#ifndef __P + #if __STDC__ + #define __P(protos) protos + #else + #define __P(protos) () + #endif +#endif + +#ifdef _WIN32 + #ifndef FD_HASHTABLE_MODULUS + #define FD_HASHTABLE_MODULUS 32 + #endif +#endif + +#define lws_plat_socket_offset() (0) + +struct lws; +struct lws_context; + +#define LWS_FD_HASH(fd) ((fd ^ (fd >> 8) ^ (fd >> 16)) % FD_HASHTABLE_MODULUS) +struct lws_fd_hashtable { + struct lws **wsi; + int length; +}; + + +#ifdef LWS_DLL +#ifdef LWS_INTERNAL +#define LWS_EXTERN extern __declspec(dllexport) +#else +#define LWS_EXTERN extern __declspec(dllimport) +#endif +#else +#define LWS_EXTERN +#endif + +typedef SOCKET lws_sockfd_type; +typedef HANDLE lws_filefd_type; +#define LWS_WIN32_HANDLE_TYPES + +LWS_EXTERN struct lws * +wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd); + +LWS_EXTERN int +insert_wsi(struct lws_context *context, struct lws *wsi); + +LWS_EXTERN int +delete_from_fd(struct lws_context *context, lws_sockfd_type fd); diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-fds.c b/thirdparty/libwebsockets/lib/plat/windows/windows-fds.c new file mode 100644 index 0000000000..0d324e8f3a --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/windows-fds.c @@ -0,0 +1,76 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#include "core/private.h" + +struct lws * +wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd) +{ + int h = LWS_FD_HASH(fd); + int n = 0; + + for (n = 0; n < context->fd_hashtable[h].length; n++) + if (context->fd_hashtable[h].wsi[n]->desc.sockfd == fd) + return context->fd_hashtable[h].wsi[n]; + + return NULL; +} + +int +insert_wsi(struct lws_context *context, struct lws *wsi) +{ + int h = LWS_FD_HASH(wsi->desc.sockfd); + + if (context->fd_hashtable[h].length == (getdtablesize() - 1)) { + lwsl_err("hash table overflow\n"); + return 1; + } + + context->fd_hashtable[h].wsi[context->fd_hashtable[h].length++] = wsi; + + return 0; +} + +int +delete_from_fd(struct lws_context *context, lws_sockfd_type fd) +{ + int h = LWS_FD_HASH(fd); + int n = 0; + + for (n = 0; n < context->fd_hashtable[h].length; n++) + if (context->fd_hashtable[h].wsi[n]->desc.sockfd == fd) { + while (n < context->fd_hashtable[h].length) { + context->fd_hashtable[h].wsi[n] = + context->fd_hashtable[h].wsi[n + 1]; + n++; + } + context->fd_hashtable[h].length--; + + return 0; + } + + lwsl_err("Failed to find fd %d requested for " + "delete in hashtable\n", fd); + return 1; +} diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-file.c b/thirdparty/libwebsockets/lib/plat/windows/windows-file.c new file mode 100644 index 0000000000..eb73aab7f6 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/windows-file.c @@ -0,0 +1,185 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#include "core/private.h" + +int lws_plat_apply_FD_CLOEXEC(int n) +{ + return 0; +} + +lws_fop_fd_t +_lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, + const char *vpath, lws_fop_flags_t *flags) +{ + HANDLE ret; + WCHAR buf[MAX_PATH]; + lws_fop_fd_t fop_fd; + FILE_STANDARD_INFO fInfo = {0}; + + MultiByteToWideChar(CP_UTF8, 0, filename, -1, buf, LWS_ARRAY_SIZE(buf)); + +#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0602 // Windows 8 (minimum when UWP_ENABLED, but can be used in Windows builds) + CREATEFILE2_EXTENDED_PARAMETERS extParams = {0}; + extParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + + if (((*flags) & 7) == _O_RDONLY) { + ret = CreateFile2(buf, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, &extParams); + } else { + ret = CreateFile2(buf, GENERIC_WRITE, 0, CREATE_ALWAYS, &extParams); + } +#else + if (((*flags) & 7) == _O_RDONLY) { + ret = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + } else { + ret = CreateFileW(buf, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + } +#endif + + if (ret == LWS_INVALID_FILE) + goto bail; + + fop_fd = malloc(sizeof(*fop_fd)); + if (!fop_fd) + goto bail; + + fop_fd->fops = fops; + fop_fd->fd = ret; + fop_fd->filesystem_priv = NULL; /* we don't use it */ + fop_fd->flags = *flags; + fop_fd->len = 0; + if(GetFileInformationByHandleEx(ret, FileStandardInfo, &fInfo, sizeof(fInfo))) + fop_fd->len = fInfo.EndOfFile.QuadPart; + + fop_fd->pos = 0; + + return fop_fd; + +bail: + return NULL; +} + +int +_lws_plat_file_close(lws_fop_fd_t *fop_fd) +{ + HANDLE fd = (*fop_fd)->fd; + + free(*fop_fd); + *fop_fd = NULL; + + CloseHandle((HANDLE)fd); + + return 0; +} + +lws_fileofs_t +_lws_plat_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset) +{ + LARGE_INTEGER l; + + l.QuadPart = offset; + return SetFilePointerEx((HANDLE)fop_fd->fd, l, NULL, FILE_CURRENT); +} + +int +_lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t *buf, lws_filepos_t len) +{ + DWORD _amount; + + if (!ReadFile((HANDLE)fop_fd->fd, buf, (DWORD)len, &_amount, NULL)) { + *amount = 0; + + return 1; + } + + fop_fd->pos += _amount; + *amount = (unsigned long)_amount; + + return 0; +} + +int +_lws_plat_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, + uint8_t* buf, lws_filepos_t len) +{ + DWORD _amount; + + if (!WriteFile((HANDLE)fop_fd->fd, buf, (DWORD)len, &_amount, NULL)) { + *amount = 0; + + return 1; + } + + fop_fd->pos += _amount; + *amount = (unsigned long)_amount; + + return 0; +} + + +int +lws_plat_write_cert(struct lws_vhost *vhost, int is_key, int fd, void *buf, + int len) +{ + int n; + + n = write(fd, buf, len); + + lseek(fd, 0, SEEK_SET); + + return n != len; +} + +int +lws_plat_write_file(const char *filename, void *buf, int len) +{ + int m, fd; + + fd = lws_open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600); + + if (fd == -1) + return -1; + + m = write(fd, buf, len); + close(fd); + + return m != len; +} + +int +lws_plat_read_file(const char *filename, void *buf, int len) +{ + int n, fd = lws_open(filename, O_RDONLY); + if (fd == -1) + return -1; + + n = read(fd, buf, len); + close(fd); + + return n; +} + diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-init.c b/thirdparty/libwebsockets/lib/plat/windows/windows-init.c new file mode 100644 index 0000000000..8c4d9373f6 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/windows-init.c @@ -0,0 +1,110 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#include "core/private.h" + +void +lws_plat_drop_app_privileges(const struct lws_context_creation_info *info) +{ +} + +int +lws_plat_context_early_init(void) +{ + WORD wVersionRequested; + WSADATA wsaData; + int err; + + /* Use the MAKEWORD(lowbyte, highbyte) macro from Windef.h */ + wVersionRequested = MAKEWORD(2, 2); + + err = WSAStartup(wVersionRequested, &wsaData); + if (!err) + return 0; + /* + * Tell the user that we could not find a usable + * Winsock DLL + */ + lwsl_err("WSAStartup failed with error: %d\n", err); + + return 1; +} + +int +lws_plat_init(struct lws_context *context, + const struct lws_context_creation_info *info) +{ + struct lws_context_per_thread *pt = &context->pt[0]; + int i, n = context->count_threads; + + for (i = 0; i < FD_HASHTABLE_MODULUS; i++) { + context->fd_hashtable[i].wsi = + lws_zalloc(sizeof(struct lws*) * context->max_fds, + "win hashtable"); + + if (!context->fd_hashtable[i].wsi) + return -1; + } + + while (n--) { + pt->fds_count = 0; + pt->events = WSACreateEvent(); /* the cancel event */ + + pt++; + } + + context->fd_random = 0; + +#ifdef LWS_WITH_PLUGINS + if (info->plugin_dirs) + lws_plat_plugins_init(context, info->plugin_dirs); +#endif + + return 0; +} + +void +lws_plat_context_early_destroy(struct lws_context *context) +{ + struct lws_context_per_thread *pt = &context->pt[0]; + int n = context->count_threads; + + while (n--) { + WSACloseEvent(pt->events); + pt++; + } +} + +void +lws_plat_context_late_destroy(struct lws_context *context) +{ + int n; + + for (n = 0; n < FD_HASHTABLE_MODULUS; n++) { + if (context->fd_hashtable[n].wsi) + lws_free(context->fd_hashtable[n].wsi); + } + + WSACleanup(); +} diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-misc.c b/thirdparty/libwebsockets/lib/plat/windows/windows-misc.c new file mode 100644 index 0000000000..53cc19b6b9 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/windows-misc.c @@ -0,0 +1,108 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#include "core/private.h" + + +uint64_t +lws_time_in_microseconds() +{ +#ifndef DELTA_EPOCH_IN_MICROSECS +#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL +#endif + FILETIME filetime; + ULARGE_INTEGER datetime; + +#ifdef _WIN32_WCE + GetCurrentFT(&filetime); +#else + GetSystemTimeAsFileTime(&filetime); +#endif + + /* + * As per Windows documentation for FILETIME, copy the resulting + * FILETIME structure to a ULARGE_INTEGER structure using memcpy + * (using memcpy instead of direct assignment can prevent alignment + * faults on 64-bit Windows). + */ + memcpy(&datetime, &filetime, sizeof(datetime)); + + /* Windows file times are in 100s of nanoseconds. */ + return (datetime.QuadPart / 10) - DELTA_EPOCH_IN_MICROSECS; +} + + +#ifdef _WIN32_WCE +time_t time(time_t *t) +{ + time_t ret = lws_time_in_microseconds() / 1000000; + + if(t != NULL) + *t = ret; + + return ret; +} +#endif + +LWS_VISIBLE int +lws_get_random(struct lws_context *context, void *buf, int len) +{ + int n; + char *p = (char *)buf; + + for (n = 0; n < len; n++) + p[n] = (unsigned char)rand(); + + return n; +} + + +LWS_VISIBLE void +lwsl_emit_syslog(int level, const char *line) +{ + lwsl_emit_stderr(level, line); +} + + +int kill(int pid, int sig) +{ + lwsl_err("Sorry Windows doesn't support kill()."); + exit(0); +} + +int fork(void) +{ + lwsl_err("Sorry Windows doesn't support fork()."); + exit(0); +} + + +int +lws_plat_recommended_rsa_bits(void) +{ + return 4096; +} + + + diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-pipe.c b/thirdparty/libwebsockets/lib/plat/windows/windows-pipe.c new file mode 100644 index 0000000000..af2af1fa83 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/windows-pipe.c @@ -0,0 +1,46 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#include "core/private.h" + +int +lws_plat_pipe_create(struct lws *wsi) +{ + return 1; +} + +int +lws_plat_pipe_signal(struct lws *wsi) +{ + struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; + + WSASetEvent(pt->events); /* trigger the cancel event */ + + return 0; +} + +void +lws_plat_pipe_close(struct lws *wsi) +{ +} diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-service.c b/thirdparty/libwebsockets/lib/plat/windows/windows-service.c new file mode 100644 index 0000000000..a6adefbd3b --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/windows-service.c @@ -0,0 +1,194 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#include "core/private.h" + + +LWS_EXTERN int +_lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) +{ + struct lws_context_per_thread *pt; + WSANETWORKEVENTS networkevents; + struct lws_pollfd *pfd; + struct lws *wsi; + unsigned int i; + DWORD ev; + int n; + + /* stay dead once we are dead */ + if (context == NULL || !context->vhost_list) + return 1; + + pt = &context->pt[tsi]; + + if (!pt->service_tid_detected) { + struct lws _lws; + + memset(&_lws, 0, sizeof(_lws)); + _lws.context = context; + + pt->service_tid = context->vhost_list-> + protocols[0].callback(&_lws, LWS_CALLBACK_GET_THREAD_ID, + NULL, NULL, 0); + pt->service_tid_detected = 1; + } + + if (timeout_ms < 0) { + if (lws_service_flag_pending(context, tsi)) { + /* any socket with events to service? */ + for (n = 0; n < (int)pt->fds_count; n++) { + int m; + if (!pt->fds[n].revents) + continue; + + m = lws_service_fd_tsi(context, &pt->fds[n], tsi); + if (m < 0) + return -1; + /* if something closed, retry this slot */ + if (m) + n--; + } + } + return 0; + } + + if (context->event_loop_ops->run_pt) + context->event_loop_ops->run_pt(context, tsi); + + for (i = 0; i < pt->fds_count; ++i) { + pfd = &pt->fds[i]; + + if (!(pfd->events & LWS_POLLOUT)) + continue; + + wsi = wsi_from_fd(context, pfd->fd); + if (!wsi || wsi->listener) + continue; + if (wsi->sock_send_blocking) + continue; + pfd->revents = LWS_POLLOUT; + n = lws_service_fd(context, pfd); + if (n < 0) + return -1; + + /* Force WSAWaitForMultipleEvents() to check events and then return immediately. */ + timeout_ms = 0; + + /* if something closed, retry this slot */ + if (n) + i--; + } + + /* + * is there anybody with pending stuff that needs service forcing? + */ + if (!lws_service_adjust_timeout(context, 1, tsi)) { + /* -1 timeout means just do forced service */ + _lws_plat_service_tsi(context, -1, pt->tid); + /* still somebody left who wants forced service? */ + if (!lws_service_adjust_timeout(context, 1, pt->tid)) + /* yes... come back again quickly */ + timeout_ms = 0; + } + + if (timeout_ms) { + lws_usec_t t; + + lws_pt_lock(pt, __func__); + /* don't stay in poll wait longer than next hr timeout */ + t = __lws_hrtimer_service(pt); + + if ((lws_usec_t)timeout_ms * 1000 > t) + timeout_ms = (int)(t / 1000); + lws_pt_unlock(pt); + } + + ev = WSAWaitForMultipleEvents(1, &pt->events, FALSE, timeout_ms, FALSE); + if (ev == WSA_WAIT_EVENT_0) { + unsigned int eIdx; + + WSAResetEvent(pt->events); + + if (pt->context->tls_ops && + pt->context->tls_ops->fake_POLLIN_for_buffered) + pt->context->tls_ops->fake_POLLIN_for_buffered(pt); + + for (eIdx = 0; eIdx < pt->fds_count; ++eIdx) { + unsigned int err; + + if (WSAEnumNetworkEvents(pt->fds[eIdx].fd, 0, + &networkevents) == SOCKET_ERROR) { + lwsl_err("WSAEnumNetworkEvents() failed " + "with error %d\n", LWS_ERRNO); + return -1; + } + + pfd = &pt->fds[eIdx]; + pfd->revents = (short)networkevents.lNetworkEvents; + + err = networkevents.iErrorCode[FD_CONNECT_BIT]; + + if ((networkevents.lNetworkEvents & FD_CONNECT) && + err && err != LWS_EALREADY && + err != LWS_EINPROGRESS && err != LWS_EWOULDBLOCK && + err != WSAEINVAL) { + lwsl_debug("Unable to connect errno=%d\n", err); + pfd->revents |= LWS_POLLHUP; + } + + if (pfd->revents & LWS_POLLOUT) { + wsi = wsi_from_fd(context, pfd->fd); + if (wsi) + wsi->sock_send_blocking = 0; + } + /* if something closed, retry this slot */ + if (pfd->revents & LWS_POLLHUP) + --eIdx; + + if (pfd->revents) { + recv(pfd->fd, NULL, 0, 0); + lws_service_fd_tsi(context, pfd, tsi); + } + } + } + + if (ev == WSA_WAIT_TIMEOUT) + lws_service_fd(context, NULL); + + return 0; +} + +int +lws_plat_service(struct lws_context *context, int timeout_ms) +{ + return _lws_plat_service_tsi(context, timeout_ms, 0); +} + + + +void +lws_plat_service_periodic(struct lws_context *context) +{ +} + diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-sockets.c b/thirdparty/libwebsockets/lib/plat/windows/windows-sockets.c new file mode 100644 index 0000000000..62a0a49846 --- /dev/null +++ b/thirdparty/libwebsockets/lib/plat/windows/windows-sockets.c @@ -0,0 +1,288 @@ +#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif +#include "core/private.h" + + +LWS_VISIBLE int +lws_send_pipe_choked(struct lws *wsi) +{ struct lws *wsi_eff; + +#if defined(LWS_WITH_HTTP2) + wsi_eff = lws_get_network_wsi(wsi); +#else + wsi_eff = wsi; +#endif + /* the fact we checked implies we avoided back-to-back writes */ + wsi_eff->could_have_pending = 0; + + /* treat the fact we got a truncated send pending as if we're choked */ + if (lws_has_buffered_out(wsi_eff) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + ||wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more +#endif + ) + return 1; + + return (int)wsi_eff->sock_send_blocking; +} + +int +lws_poll_listen_fd(struct lws_pollfd *fd) +{ + fd_set readfds; + struct timeval tv = { 0, 0 }; + + assert((fd->events & LWS_POLLIN) == LWS_POLLIN); + + FD_ZERO(&readfds); + FD_SET(fd->fd, &readfds); + + return select(((int)fd->fd) + 1, &readfds, NULL, NULL, &tv); +} + +int +lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd, + int unix_skt) +{ + int optval = 1; + int optlen = sizeof(optval); + u_long optl = 1; + DWORD dwBytesRet; + struct tcp_keepalive alive; + int protonbr; +#ifndef _WIN32_WCE + struct protoent *tcp_proto; +#endif + +#ifdef LWS_WITH_IPV6 + optval = 0; + setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen); +#endif + + if (vhost->ka_time) { + /* enable keepalive on this socket */ + optval = 1; + if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, + (const char *)&optval, optlen) < 0) + return 1; + + alive.onoff = TRUE; + alive.keepalivetime = vhost->ka_time; + alive.keepaliveinterval = vhost->ka_interval; + + if (WSAIoctl(fd, SIO_KEEPALIVE_VALS, &alive, sizeof(alive), + NULL, 0, &dwBytesRet, NULL, NULL)) + return 1; + } + + /* Disable Nagle */ + optval = 1; +#ifndef _WIN32_WCE + tcp_proto = getprotobyname("TCP"); + if (!tcp_proto) { + lwsl_err("getprotobyname() failed with error %d\n", LWS_ERRNO); + return 1; + } + protonbr = tcp_proto->p_proto; +#else + protonbr = 6; +#endif + + setsockopt(fd, protonbr, TCP_NODELAY, (const char *)&optval, optlen); + + /* We are nonblocking... */ + ioctlsocket(fd, FIONBIO, &optl); + + return 0; +} + + +LWS_EXTERN int +lws_interface_to_sa(int ipv6, + const char *ifname, struct sockaddr_in *addr, size_t addrlen) +{ +#ifdef LWS_WITH_IPV6 + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr; + + if (ipv6) { + if (lws_plat_inet_pton(AF_INET6, ifname, &addr6->sin6_addr) == 1) { + return LWS_ITOSA_USABLE; + } + } +#endif + + long long address = inet_addr(ifname); + + if (address == INADDR_NONE) { + struct hostent *entry = gethostbyname(ifname); + if (entry) + address = ((struct in_addr *)entry->h_addr_list[0])->s_addr; + } + + if (address == INADDR_NONE) + return LWS_ITOSA_NOT_EXIST; + + addr->sin_addr.s_addr = (unsigned long)(lws_intptr_t)address; + + return LWS_ITOSA_USABLE; +} + +void +lws_plat_insert_socket_into_fds(struct lws_context *context, struct lws *wsi) +{ + struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + + pt->fds[pt->fds_count++].revents = 0; + WSAEventSelect(wsi->desc.sockfd, pt->events, + LWS_POLLIN | LWS_POLLHUP | FD_CONNECT); +} + +void +lws_plat_delete_socket_from_fds(struct lws_context *context, + struct lws *wsi, int m) +{ + struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + + pt->fds_count--; +} + + +int +lws_plat_check_connection_error(struct lws *wsi) +{ + int optVal; + int optLen = sizeof(int); + + if (getsockopt(wsi->desc.sockfd, SOL_SOCKET, SO_ERROR, + (char*)&optVal, &optLen) != SOCKET_ERROR && optVal && + optVal != LWS_EALREADY && optVal != LWS_EINPROGRESS && + optVal != LWS_EWOULDBLOCK && optVal != WSAEINVAL) { + lwsl_debug("Connect failed SO_ERROR=%d\n", optVal); + return 1; + } + + return 0; +} + +int +lws_plat_change_pollfd(struct lws_context *context, + struct lws *wsi, struct lws_pollfd *pfd) +{ + struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + long networkevents = LWS_POLLHUP | FD_CONNECT; + + if ((pfd->events & LWS_POLLIN)) + networkevents |= LWS_POLLIN; + + if ((pfd->events & LWS_POLLOUT)) + networkevents |= LWS_POLLOUT; + + if (WSAEventSelect(wsi->desc.sockfd, pt->events, + networkevents) != SOCKET_ERROR) + return 0; + + lwsl_err("WSAEventSelect() failed with error %d\n", LWS_ERRNO); + + return 1; +} + +const char * +lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt) +{ + WCHAR *buffer; + DWORD bufferlen = cnt; + BOOL ok = FALSE; + + buffer = lws_malloc(bufferlen * 2, "inet_ntop"); + if (!buffer) { + lwsl_err("Out of memory\n"); + return NULL; + } + + if (af == AF_INET) { + struct sockaddr_in srcaddr; + bzero(&srcaddr, sizeof(srcaddr)); + srcaddr.sin_family = AF_INET; + memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr)); + + if (!WSAAddressToStringW((struct sockaddr*)&srcaddr, sizeof(srcaddr), 0, buffer, &bufferlen)) + ok = TRUE; +#ifdef LWS_WITH_IPV6 + } else if (af == AF_INET6) { + struct sockaddr_in6 srcaddr; + bzero(&srcaddr, sizeof(srcaddr)); + srcaddr.sin6_family = AF_INET6; + memcpy(&(srcaddr.sin6_addr), src, sizeof(srcaddr.sin6_addr)); + + if (!WSAAddressToStringW((struct sockaddr*)&srcaddr, sizeof(srcaddr), 0, buffer, &bufferlen)) + ok = TRUE; +#endif + } else + lwsl_err("Unsupported type\n"); + + if (!ok) { + int rv = WSAGetLastError(); + lwsl_err("WSAAddressToString() : %d\n", rv); + } else { + if (WideCharToMultiByte(CP_ACP, 0, buffer, bufferlen, dst, cnt, 0, NULL) <= 0) + ok = FALSE; + } + + lws_free(buffer); + return ok ? dst : NULL; +} + +int +lws_plat_inet_pton(int af, const char *src, void *dst) +{ + WCHAR *buffer; + DWORD bufferlen = (int)strlen(src) + 1; + BOOL ok = FALSE; + + buffer = lws_malloc(bufferlen * 2, "inet_pton"); + if (!buffer) { + lwsl_err("Out of memory\n"); + return -1; + } + + if (MultiByteToWideChar(CP_ACP, 0, src, bufferlen, buffer, bufferlen) <= 0) { + lwsl_err("Failed to convert multi byte to wide char\n"); + lws_free(buffer); + return -1; + } + + if (af == AF_INET) { + struct sockaddr_in dstaddr; + int dstaddrlen = sizeof(dstaddr); + bzero(&dstaddr, sizeof(dstaddr)); + dstaddr.sin_family = AF_INET; + + if (!WSAStringToAddressW(buffer, af, 0, (struct sockaddr *) &dstaddr, &dstaddrlen)) { + ok = TRUE; + memcpy(dst, &dstaddr.sin_addr, sizeof(dstaddr.sin_addr)); + } +#ifdef LWS_WITH_IPV6 + } else if (af == AF_INET6) { + struct sockaddr_in6 dstaddr; + int dstaddrlen = sizeof(dstaddr); + bzero(&dstaddr, sizeof(dstaddr)); + dstaddr.sin6_family = AF_INET6; + + if (!WSAStringToAddressW(buffer, af, 0, (struct sockaddr *) &dstaddr, &dstaddrlen)) { + ok = TRUE; + memcpy(dst, &dstaddr.sin6_addr, sizeof(dstaddr.sin6_addr)); + } +#endif + } else + lwsl_err("Unsupported type\n"); + + if (!ok) { + int rv = WSAGetLastError(); + lwsl_err("WSAAddressToString() : %d\n", rv); + } + + lws_free(buffer); + return ok ? 1 : -1; +} diff --git a/thirdparty/libwebsockets/roles/h1/ops-h1.c b/thirdparty/libwebsockets/lib/roles/h1/ops-h1.c index 9001c864ea..2fa0fe16e4 100644 --- a/thirdparty/libwebsockets/roles/h1/ops-h1.c +++ b/thirdparty/libwebsockets/lib/roles/h1/ops-h1.c @@ -42,7 +42,7 @@ lws_read_h1(struct lws *wsi, unsigned char *buf, lws_filepos_t len) lws_filepos_t body_chunk_len; size_t n; - // lwsl_notice("%s: h1 path: wsi state 0x%x\n", __func__, lwsi_state(wsi)); + lwsl_debug("%s: h1 path: wsi state 0x%x\n", __func__, lwsi_state(wsi)); switch (lwsi_state(wsi)) { @@ -90,7 +90,6 @@ lws_read_h1(struct lws *wsi, unsigned char *buf, lws_filepos_t len) * appropriately: */ len -= (buf - last_char); -// lwsl_debug("%s: thinks we have used %ld\n", __func__, (long)len); if (!wsi->hdr_parsing_completed) /* More header content on the way */ @@ -119,6 +118,10 @@ lws_read_h1(struct lws *wsi, unsigned char *buf, lws_filepos_t len) http_postbody: lwsl_debug("%s: http post body: remain %d\n", __func__, (int)wsi->http.rx_content_remain); + + if (!wsi->http.rx_content_remain) + goto postbody_completion; + while (len && wsi->http.rx_content_remain) { /* Copy as much as possible, up to the limit of: * what we have in the read buffer (len) @@ -158,7 +161,8 @@ http_postbody: buf += n; if (wsi->http.rx_content_remain) { - lws_set_timeout(wsi, PENDING_TIMEOUT_HTTP_CONTENT, + lws_set_timeout(wsi, + PENDING_TIMEOUT_HTTP_CONTENT, wsi->context->timeout_secs); break; } @@ -221,7 +225,7 @@ ws_mode: break; case LRS_DEFERRING_ACTION: - lwsl_debug("%s: LRS_DEFERRING_ACTION\n", __func__); + lwsl_notice("%s: LRS_DEFERRING_ACTION\n", __func__); break; case LRS_SSL_ACK_PENDING: @@ -311,7 +315,8 @@ lws_h1_server_socket_service(struct lws *wsi, struct lws_pollfd *pollfd) lwsi_state(wsi) == LRS_BODY)) { if (!wsi->http.ah && lws_header_table_attach(wsi, 0)) { - lwsl_info("%s: wsi %p: ah not available\n", __func__, wsi); + lwsl_info("%s: wsi %p: ah not available\n", __func__, + wsi); goto try_pollout; } @@ -337,7 +342,8 @@ lws_h1_server_socket_service(struct lws *wsi, struct lws_pollfd *pollfd) * and draining the extensions */ if (wsi->ws && - (wsi->ws->rx_draining_ext || wsi->ws->tx_draining_ext)) + (wsi->ws->rx_draining_ext || + wsi->ws->tx_draining_ext)) goto try_pollout; #endif /* @@ -445,10 +451,9 @@ try_pollout: if (lwsi_state(wsi) != LRS_ISSUING_FILE) { - if (wsi->trunc_len) { + if (lws_has_buffered_out(wsi)) { //lwsl_notice("%s: completing partial\n", __func__); - if (lws_issue_raw(wsi, wsi->trunc_alloc + wsi->trunc_offset, - wsi->trunc_len) < 0) { + if (lws_issue_raw(wsi, NULL, 0) < 0) { lwsl_info("%s signalling to close\n", __func__); goto fail; } @@ -459,7 +464,7 @@ try_pollout: LWSSTATS_C_WRITEABLE_CB, 1); #if defined(LWS_WITH_STATS) if (wsi->active_writable_req_us) { - uint64_t ul = time_in_microseconds() - + uint64_t ul = lws_time_in_microseconds() - wsi->active_writable_req_us; lws_stats_atomic_bump(wsi->context, pt, @@ -519,6 +524,58 @@ rops_handle_POLLIN_h1(struct lws_context_per_thread *pt, struct lws *wsi, } #endif +#if 0 + + /* + * !!! lws_serve_http_file_fragment() seems to duplicate most of + * lws_handle_POLLOUT_event() in its own loop... + */ + lwsl_debug("%s: %d %d\n", __func__, (pollfd->revents & LWS_POLLOUT), + lwsi_state_can_handle_POLLOUT(wsi)); + + if ((pollfd->revents & LWS_POLLOUT) && + lwsi_state_can_handle_POLLOUT(wsi) && + lws_handle_POLLOUT_event(wsi, pollfd)) { + if (lwsi_state(wsi) == LRS_RETURNED_CLOSE) + lwsi_set_state(wsi, LRS_FLUSHING_BEFORE_CLOSE); + /* the write failed... it's had it */ + wsi->socket_is_permanently_unusable = 1; + + return LWS_HPI_RET_PLEASE_CLOSE_ME; + } +#endif + + + /* Priority 2: pre- compression transform */ + +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more) { + enum lws_write_protocol wp = LWS_WRITE_HTTP; + + lwsl_info("%s: completing comp partial (buflist_comp %p, may %d)\n", + __func__, wsi->http.comp_ctx.buflist_comp, + wsi->http.comp_ctx.may_have_more + ); + + if (wsi->role_ops->write_role_protocol(wsi, NULL, 0, &wp) < 0) { + lwsl_info("%s signalling to close\n", __func__); + return LWS_HPI_RET_PLEASE_CLOSE_ME; + } + lws_callback_on_writable(wsi); + + if (!wsi->http.comp_ctx.buflist_comp && + !wsi->http.comp_ctx.may_have_more && + wsi->http.deferred_transaction_completed) { + wsi->http.deferred_transaction_completed = 0; + if (lws_http_transaction_completed(wsi)) + return LWS_HPI_RET_PLEASE_CLOSE_ME; + } + + return LWS_HPI_RET_HANDLED; + } +#endif + if (lws_is_flowcontrolled(wsi)) /* We cannot deal with any kind of new RX because we are * RX-flowcontrolled. @@ -529,12 +586,14 @@ rops_handle_POLLIN_h1(struct lws_context_per_thread *pt, struct lws *wsi, if (!lwsi_role_client(wsi)) { int n; - lwsl_debug("%s: %p: wsistate 0x%x\n", __func__, wsi, wsi->wsistate); + lwsl_debug("%s: %p: wsistate 0x%x\n", __func__, wsi, + wsi->wsistate); n = lws_h1_server_socket_service(wsi, pollfd); if (n != LWS_HPI_RET_HANDLED) return n; if (lwsi_state(wsi) != LRS_SSL_INIT) - if (lws_server_socket_service_ssl(wsi, LWS_SOCK_INVALID)) + if (lws_server_socket_service_ssl(wsi, + LWS_SOCK_INVALID)) return LWS_HPI_RET_PLEASE_CLOSE_ME; return LWS_HPI_RET_HANDLED; @@ -564,10 +623,9 @@ rops_handle_POLLIN_h1(struct lws_context_per_thread *pt, struct lws *wsi, /* let user code know, he'll usually ask for writeable * callback and drain / re-enable it there */ - if (user_callback_handle_rxflow( - wsi->protocol->callback, - wsi, LWS_CALLBACK_RECEIVE_CLIENT_HTTP, - wsi->user_space, NULL, 0)) { + if (user_callback_handle_rxflow(wsi->protocol->callback, wsi, + LWS_CALLBACK_RECEIVE_CLIENT_HTTP, + wsi->user_space, NULL, 0)) { lwsl_info("RECEIVE_CLIENT_HTTP closed it\n"); return LWS_HPI_RET_PLEASE_CLOSE_ME; } @@ -608,19 +666,68 @@ static int rops_write_role_protocol_h1(struct lws *wsi, unsigned char *buf, size_t len, enum lws_write_protocol *wp) { -#if 0 - /* if not in a state to send stuff, then just send nothing */ + size_t olen = len; + int n; + +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (wsi->http.lcs && (((*wp) & 0x1f) == LWS_WRITE_HTTP_FINAL || + ((*wp) & 0x1f) == LWS_WRITE_HTTP)) { + unsigned char mtubuf[1400 + LWS_PRE + + LWS_HTTP_CHUNK_HDR_MAX_SIZE + + LWS_HTTP_CHUNK_TRL_MAX_SIZE], + *out = mtubuf + LWS_PRE + + LWS_HTTP_CHUNK_HDR_MAX_SIZE; + size_t o = sizeof(mtubuf) - LWS_PRE - + LWS_HTTP_CHUNK_HDR_MAX_SIZE - + LWS_HTTP_CHUNK_TRL_MAX_SIZE; + + n = lws_http_compression_transform(wsi, buf, len, wp, &out, &o); + if (n) + return n; - if ((lwsi_state(wsi) != LRS_RETURNED_CLOSE && - lwsi_state(wsi) != LRS_WAITING_TO_SEND_CLOSE && - lwsi_state(wsi) != LRS_AWAITING_CLOSE_ACK)) { - //assert(0); - lwsl_debug("binning %d %d\n", lwsi_state(wsi), *wp); - return 0; + lwsl_info("%s: %p: transformed %d bytes to %d " + "(wp 0x%x, more %d)\n", __func__, wsi, (int)len, + (int)o, (int)*wp, wsi->http.comp_ctx.may_have_more); + + if (!o) + return olen; + + if (wsi->http.comp_ctx.chunking) { + char c[LWS_HTTP_CHUNK_HDR_MAX_SIZE + 2]; + /* + * this only needs dealing with on http/1.1 to allow + * pipelining + */ + n = lws_snprintf(c, sizeof(c), "%X\x0d\x0a", (int)o); + lwsl_info("%s: chunk (%d) %s", __func__, (int)o, c); + out -= n; + o += n; + memcpy(out, c, n); + out[o++] = '\x0d'; + out[o++] = '\x0a'; + + if (((*wp) & 0x1f) == LWS_WRITE_HTTP_FINAL) { + lwsl_info("%s: final chunk\n", __func__); + out[o++] = '0'; + out[o++] = '\x0d'; + out[o++] = '\x0a'; + out[o++] = '\x0d'; + out[o++] = '\x0a'; + } + } + + buf = out; + len = o; } #endif - return lws_issue_raw(wsi, (unsigned char *)buf, len); + n = lws_issue_raw(wsi, (unsigned char *)buf, len); + if (n < 0) + return n; + + /* hide there may have been compression */ + + return (int)olen; } static int @@ -666,12 +773,230 @@ rops_destroy_role_h1(struct lws *wsi) ah = ah->next; } +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + lws_http_compression_destroy(wsi); +#endif + #ifdef LWS_ROLE_WS lws_free_set_NULL(wsi->ws); #endif return 0; } +#if !defined(LWS_NO_SERVER) + +static int +rops_adoption_bind_h1(struct lws *wsi, int type, const char *vh_prot_name) +{ + if (!(type & LWS_ADOPT_HTTP)) + return 0; /* no match */ + + + if (type & _LWS_ADOPT_FINISH) { + if (!lws_header_table_attach(wsi, 0)) + lwsl_debug("Attached ah immediately\n"); + else + lwsl_info("%s: waiting for ah\n", __func__); + + return 1; + } + + lws_role_transition(wsi, LWSIFR_SERVER, (type & LWS_ADOPT_ALLOW_SSL) ? + LRS_SSL_INIT : LRS_HEADERS, &role_ops_h1); + + if (!vh_prot_name) + wsi->protocol = &wsi->vhost->protocols[ + wsi->vhost->default_protocol_index]; + + /* the transport is accepted... give him time to negotiate */ + lws_set_timeout(wsi, PENDING_TIMEOUT_ESTABLISH_WITH_SERVER, + wsi->context->timeout_secs); + + return 1; /* bound */ +} + +#endif + +#if !defined(LWS_NO_CLIENT) + +static const char * const http_methods[] = { + "GET", "POST", "OPTIONS", "PUT", "PATCH", "DELETE", "CONNECT" +}; + +static int +rops_client_bind_h1(struct lws *wsi, const struct lws_client_connect_info *i) +{ + int n; + + if (!i) { + /* we are finalizing an already-selected role */ + + /* + * If we stay in http, assuming there wasn't already-set + * external user_space, since we know our initial protocol + * we can assign the user space now, otherwise do it after the + * ws subprotocol negotiated + */ + if (!wsi->user_space && wsi->stash->method) + if (lws_ensure_user_space(wsi)) + return 1; + + /* + * For ws, default to http/1.1 only. If i->alpn had been set + * though, defer to whatever he has set in there (eg, "h2"). + * + * The problem is he has to commit to h2 before he can find + * out if the server has the SETTINGS for ws-over-h2 enabled; + * if not then ws is not possible on that connection. So we + * only try h2 if he assertively said to use h2 alpn, otherwise + * ws implies alpn restriction to h1. + */ + if (!wsi->stash->method && !wsi->stash->alpn) { + wsi->stash->alpn = lws_strdup("http/1.1"); + if (!wsi->stash->alpn) + return 1; + } + + /* if we went on the ah waiting list, it's ok, we can wait. + * + * When we do get the ah, now or later, he will end up at + * lws_http_client_connect_via_info2(). + */ + if (lws_header_table_attach(wsi, 0) < 0) + /* + * if we failed here, the connection is already closed + * and freed. + */ + return -1; + + return 0; + } + + /* + * Clients that want to be h1, h2, or ws all start out as h1 + * (we don't yet know if the server supports h2 or ws) + */ + + if (!i->method) { /* websockets */ +#if defined(LWS_ROLE_WS) + if (lws_create_client_ws_object(i, wsi)) + goto fail_wsi; +#else + lwsl_err("%s: ws role not configured\n", __func__); + + goto fail_wsi; +#endif + goto bind_h1; + } + + /* if a recognized http method, bind to it */ + + for (n = 0; n < (int)LWS_ARRAY_SIZE(http_methods); n++) + if (!strcmp(i->method, http_methods[n])) + goto bind_h1; + + /* other roles may bind to it */ + + return 0; /* no match */ + +bind_h1: + /* assert the mode and union status (hdr) clearly */ + lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, &role_ops_h1); + + return 1; /* matched */ + +fail_wsi: + return -1; +} +#endif + +#if 0 +static int +rops_perform_user_POLLOUT_h1(struct lws *wsi) +{ + volatile struct lws *vwsi = (volatile struct lws *)wsi; + int n; + + /* priority 1: post compression-transform buffered output */ + + if (lws_has_buffered_out(wsi)) { + lwsl_debug("%s: completing partial\n", __func__); + if (lws_issue_raw(wsi, NULL, 0) < 0) { + lwsl_info("%s signalling to close\n", __func__); + return -1; + } + n = 0; + vwsi->leave_pollout_active = 1; + goto cleanup; + } + + /* priority 2: pre compression-transform buffered output */ + +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more) { + enum lws_write_protocol wp = LWS_WRITE_HTTP; + + lwsl_info("%s: completing comp partial" + "(buflist_comp %p, may %d)\n", + __func__, wsi->http.comp_ctx.buflist_comp, + wsi->http.comp_ctx.may_have_more); + + if (rops_write_role_protocol_h1(wsi, NULL, 0, &wp) < 0) { + lwsl_info("%s signalling to close\n", __func__); + lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, + "comp write fail"); + } + n = 0; + vwsi->leave_pollout_active = 1; + goto cleanup; + } +#endif + + /* priority 3: if no buffered out and waiting for that... */ + + if (lwsi_state(wsi) == LRS_FLUSHING_BEFORE_CLOSE) { + wsi->socket_is_permanently_unusable = 1; + return -1; + } + + /* priority 4: user writeable callback */ + + vwsi = (volatile struct lws *)wsi; + vwsi->leave_pollout_active = 0; + + n = lws_callback_as_writeable(wsi); + +cleanup: + vwsi->handling_pollout = 0; + + if (vwsi->leave_pollout_active) + lws_change_pollfd(wsi, 0, LWS_POLLOUT); + + return n; +} +#endif + +static int +rops_close_kill_connection_h1(struct lws *wsi, enum lws_close_status reason) +{ +#if defined(LWS_WITH_HTTP_PROXY) + struct lws *wsi_eff = lws_client_wsi_effective(wsi); + + if (!wsi_eff->http.proxy_clientside) + return 0; + + wsi_eff->http.proxy_clientside = 0; + + if (user_callback_handle_rxflow(wsi_eff->protocol->callback, wsi_eff, + LWS_CALLBACK_COMPLETED_CLIENT_HTTP, + wsi_eff->user_space, NULL, 0)) + return 0; +#endif + return 0; +} + + struct lws_role_ops role_ops_h1 = { /* role name */ "h1", /* alpn id */ "http/1.1", @@ -691,11 +1016,25 @@ struct lws_role_ops role_ops_h1 = { /* alpn_negotiated */ rops_alpn_negotiated_h1, /* close_via_role_protocol */ NULL, /* close_role */ NULL, - /* close_kill_connection */ NULL, + /* close_kill_connection */ rops_close_kill_connection_h1, /* destroy_role */ rops_destroy_role_h1, +#if !defined(LWS_NO_SERVER) + /* adoption_bind */ rops_adoption_bind_h1, +#else + NULL, +#endif +#if !defined(LWS_NO_CLIENT) + /* client_bind */ rops_client_bind_h1, +#else + NULL, +#endif /* writeable cb clnt, srv */ { LWS_CALLBACK_CLIENT_HTTP_WRITEABLE, LWS_CALLBACK_HTTP_WRITEABLE }, /* close cb clnt, srv */ { LWS_CALLBACK_CLOSED_CLIENT_HTTP, LWS_CALLBACK_CLOSED_HTTP }, + /* protocol_bind cb c, srv */ { LWS_CALLBACK_CLIENT_HTTP_BIND_PROTOCOL, + LWS_CALLBACK_HTTP_BIND_PROTOCOL }, + /* protocol_unbind cb c, srv */ { LWS_CALLBACK_CLIENT_HTTP_DROP_PROTOCOL, + LWS_CALLBACK_HTTP_DROP_PROTOCOL }, /* file_handle */ 0, }; diff --git a/thirdparty/libwebsockets/roles/h1/private.h b/thirdparty/libwebsockets/lib/roles/h1/private.h index 3f53954d33..3f53954d33 100644 --- a/thirdparty/libwebsockets/roles/h1/private.h +++ b/thirdparty/libwebsockets/lib/roles/h1/private.h diff --git a/thirdparty/libwebsockets/roles/http/client/client-handshake.c b/thirdparty/libwebsockets/lib/roles/http/client/client-handshake.c index 0095c79a69..6b4e98f346 100644 --- a/thirdparty/libwebsockets/roles/http/client/client-handshake.c +++ b/thirdparty/libwebsockets/lib/roles/http/client/client-handshake.c @@ -37,9 +37,14 @@ lws_client_connect_2(struct lws *wsi) ssize_t plen = 0; #endif struct addrinfo *result; +#if defined(LWS_WITH_UNIX_SOCK) + struct sockaddr_un sau; + char unix_skt = 0; +#endif const char *ads; sockaddr46 sa46; - int n, port; + const struct sockaddr *psa; + int n, port = 0; const char *cce = "", *iface; const char *meth = NULL; #ifdef LWS_WITH_IPV6 @@ -126,7 +131,7 @@ lws_client_connect_2(struct lws *wsi) } #endif - lwsl_info("applying %p to txn queue on %p (wsistate 0x%x)\n", + lwsl_info("applying %p to txn queue on %p state 0x%x\n", wsi, w, w->wsistate); /* * ...let's add ourselves to his transaction queue... @@ -177,12 +182,36 @@ create_new_conn: lws_dll_is_null(&wsi->dll_client_transaction_queue) && lws_dll_is_null(&wsi->dll_active_client_conns)) { lws_vhost_lock(wsi->vhost); + /* caution... we will have to unpick this on oom4 path */ lws_dll_lws_add_front(&wsi->dll_active_client_conns, &wsi->vhost->dll_active_client_conns); lws_vhost_unlock(wsi->vhost); } /* + * unix socket destination? + */ + + ads = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_PEER_ADDRESS); +#if defined(LWS_WITH_UNIX_SOCK) + if (*ads == '+') { + ads++; + memset(&sau, 0, sizeof(sau)); + sau.sun_family = AF_UNIX; + strncpy(sau.sun_path, ads, sizeof(sau.sun_path)); + sau.sun_path[sizeof(sau.sun_path) - 1] = '\0'; + + lwsl_info("%s: Unix skt: %s\n", __func__, ads); + + if (sau.sun_path[0] == '@') + sau.sun_path[0] = '\0'; + + unix_skt = 1; + goto ads_known; + } +#endif + + /* * start off allowing ipv6 on connection if vhost allows it */ wsi->ipv6 = LWS_IPV6_ENABLED(wsi->vhost); @@ -241,10 +270,9 @@ create_new_conn: #ifdef LWS_WITH_IPV6 if (wsi->ipv6) { - struct sockaddr_in6 *sa6 = - ((struct sockaddr_in6 *)result->ai_addr); + struct sockaddr_in6 *sa6; - if (n) { + if (n || !result) { /* lws_getaddrinfo46 failed, there is no usable result */ lwsl_notice("%s: lws_getaddrinfo46 failed %d\n", __func__, n); @@ -252,6 +280,8 @@ create_new_conn: goto oom4; } + sa6 = ((struct sockaddr_in6 *)result->ai_addr); + memset(&sa46, 0, sizeof(sa46)); sa46.sa6.sin6_family = AF_INET6; @@ -307,7 +337,7 @@ create_new_conn: } else if (n == EAI_SYSTEM) { struct hostent *host; - lwsl_info("getaddrinfo (ipv4) failed, trying gethostbyname\n"); + lwsl_info("ipv4 getaddrinfo err, try gethostbyname\n"); host = gethostbyname(ads); if (host) { p = host->h_addr; @@ -318,7 +348,7 @@ create_new_conn: } #endif } else { - lwsl_err("getaddrinfo failed\n"); + lwsl_err("getaddrinfo failed: %d\n", n); cce = "getaddrinfo failed"; goto oom4; } @@ -339,6 +369,10 @@ create_new_conn: if (result) freeaddrinfo(result); +#if defined(LWS_WITH_UNIX_SOCK) +ads_known: +#endif + /* now we decided on ipv4 or ipv6, set the port */ if (!lws_socket_is_valid(wsi->desc.sockfd)) { @@ -349,12 +383,21 @@ create_new_conn: goto oom4; } +#if defined(LWS_WITH_UNIX_SOCK) + if (unix_skt) { + wsi->unix_skt = 1; + wsi->desc.sockfd = socket(AF_UNIX, SOCK_STREAM, 0); + } else +#endif + { + #ifdef LWS_WITH_IPV6 if (wsi->ipv6) wsi->desc.sockfd = socket(AF_INET6, SOCK_STREAM, 0); else #endif wsi->desc.sockfd = socket(AF_INET, SOCK_STREAM, 0); + } if (!lws_socket_is_valid(wsi->desc.sockfd)) { lwsl_warn("Unable to open socket\n"); @@ -362,7 +405,12 @@ create_new_conn: goto oom4; } - if (lws_plat_set_socket_options(wsi->vhost, wsi->desc.sockfd)) { + if (lws_plat_set_socket_options(wsi->vhost, wsi->desc.sockfd, +#if defined(LWS_WITH_UNIX_SOCK) + unix_skt)) { +#else + 0)) { +#endif lwsl_err("Failed to set wsi socket options\n"); compatible_close(wsi->desc.sockfd); cce = "set socket opts failed"; @@ -372,7 +420,11 @@ create_new_conn: lwsi_set_state(wsi, LRS_WAITING_CONNECT); if (wsi->context->event_loop_ops->accept) - wsi->context->event_loop_ops->accept(wsi); + if (wsi->context->event_loop_ops->accept(wsi)) { + compatible_close(wsi->desc.sockfd); + cce = "event loop accept failed"; + goto oom4; + } if (__insert_wsi_socket_into_fds(wsi->context, wsi)) { compatible_close(wsi->desc.sockfd); @@ -399,7 +451,8 @@ create_new_conn: iface = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_IFACE); if (iface) { - n = lws_socket_bind(wsi->vhost, wsi->desc.sockfd, 0, iface); + n = lws_socket_bind(wsi->vhost, wsi->desc.sockfd, 0, + iface); if (n < 0) { cce = "unable to bind socket"; goto failed; @@ -407,18 +460,29 @@ create_new_conn: } } -#ifdef LWS_WITH_IPV6 - if (wsi->ipv6) { - sa46.sa6.sin6_port = htons(port); - n = sizeof(struct sockaddr_in6); +#if defined(LWS_WITH_UNIX_SOCK) + if (unix_skt) { + psa = (const struct sockaddr *)&sau; + n = sizeof(sau); } else #endif + { - sa46.sa4.sin_port = htons(port); - n = sizeof(struct sockaddr); +#ifdef LWS_WITH_IPV6 + if (wsi->ipv6) { + sa46.sa6.sin6_port = htons(port); + n = sizeof(struct sockaddr_in6); + psa = (const struct sockaddr *)&sa46; + } else +#endif + { + sa46.sa4.sin_port = htons(port); + n = sizeof(struct sockaddr); + psa = (const struct sockaddr *)&sa46; + } } - if (connect(wsi->desc.sockfd, (const struct sockaddr *)&sa46, n) == -1 || + if (connect(wsi->desc.sockfd, (const struct sockaddr *)psa, n) == -1 || LWS_ERRNO == LWS_EISCONN) { if (LWS_ERRNO == LWS_EALREADY || LWS_ERRNO == LWS_EINPROGRESS || @@ -500,7 +564,8 @@ create_new_conn: goto failed; } - lws_set_timeout(wsi, PENDING_TIMEOUT_AWAITING_SOCKS_GREETING_REPLY, + lws_set_timeout(wsi, + PENDING_TIMEOUT_AWAITING_SOCKS_GREETING_REPLY, AWAITING_TIMEOUT); lwsi_set_state(wsi, LRS_WAITING_SOCKS_GREETING_REPLY); @@ -531,7 +596,7 @@ send_hs: * wait in the queue until it's possible to send them. */ lws_callback_on_writable(wsi_piggyback); - lwsl_info("%s: wsi %p: waiting to send headers (parent state %x)\n", + lwsl_info("%s: wsi %p: waiting to send hdrs (par state 0x%x)\n", __func__, wsi, lwsi_state(wsi_piggyback)); } else { lwsl_info("%s: wsi %p: client creating own connection\n", @@ -570,7 +635,7 @@ send_hs: return wsi; oom4: - if (lwsi_role_client(wsi) && lwsi_state_est(wsi)) { + if (lwsi_role_client(wsi) /* && lwsi_state_est(wsi) */) { wsi->protocol->callback(wsi, LWS_CALLBACK_CLIENT_CONNECTION_ERROR, wsi->user_space, (void *)cce, strlen(cce)); @@ -579,13 +644,21 @@ oom4: /* take care that we might be inserted in fds already */ if (wsi->position_in_fds_table != LWS_NO_FDS_POS) goto failed1; - lws_remove_from_timeout_list(wsi); -#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) - lws_header_table_detach(wsi, 0); -#endif - lws_client_stash_destroy(wsi); - lws_free_set_NULL(wsi->client_hostname_copy); - lws_free(wsi); + + /* + * We can't be an active client connection any more, if we thought + * that was what we were going to be doing. It should be if we are + * failing by oom4 path, we are still called by + * lws_client_connect_via_info() and will be returning NULL to that, + * so nobody else should have had a chance to queue on us. + */ + { + struct lws_vhost *vhost = wsi->vhost; + + lws_vhost_lock(vhost); + __lws_free_wsi(wsi); + lws_vhost_unlock(vhost); + } return NULL; @@ -603,7 +676,8 @@ failed1: #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) /** - * lws_client_reset() - retarget a connected wsi to start over with a new connection (ie, redirect) + * lws_client_reset() - retarget a connected wsi to start over with a new + * connection (ie, redirect) * this only works if still in HTTP, ie, not upgraded yet * wsi: connection to reset * address: network address of the new server @@ -716,7 +790,7 @@ lws_client_reset(struct lws **pwsi, int ssl, const char *address, int port, return *pwsi; } -#ifdef LWS_WITH_HTTP_PROXY +#if defined(LWS_WITH_HTTP_PROXY) && defined(LWS_WITH_HUBBUB) hubbub_error html_parser_cb(const hubbub_token *token, void *pw) { @@ -846,252 +920,8 @@ html_parser_cb(const hubbub_token *token, void *pw) #endif -char * -lws_strdup(const char *s) -{ - char *d = lws_malloc(strlen(s) + 1, "strdup"); - - if (d) - strcpy(d, s); - - return d; -} - -void -lws_client_stash_destroy(struct lws *wsi) -{ - if (!wsi || !wsi->stash) - return; - - lws_free_set_NULL(wsi->stash->address); - lws_free_set_NULL(wsi->stash->path); - lws_free_set_NULL(wsi->stash->host); - lws_free_set_NULL(wsi->stash->origin); - lws_free_set_NULL(wsi->stash->protocol); - lws_free_set_NULL(wsi->stash->method); - lws_free_set_NULL(wsi->stash->iface); - lws_free_set_NULL(wsi->stash->alpn); - - lws_free_set_NULL(wsi->stash); -} - -LWS_VISIBLE struct lws * -lws_client_connect_via_info(struct lws_client_connect_info *i) -{ - struct lws *wsi; - const struct lws_protocols *p; - const char *local = i->protocol; - - if (i->context->requested_kill) - return NULL; - - if (!i->context->protocol_init_done) - lws_protocol_init(i->context); - /* - * If we have .local_protocol_name, use it to select the - * local protocol handler to bind to. Otherwise use .protocol if - * http[s]. - */ - if (i->local_protocol_name) - local = i->local_protocol_name; - - wsi = lws_zalloc(sizeof(struct lws), "client wsi"); - if (wsi == NULL) - goto bail; - - wsi->context = i->context; -#if defined(LWS_ROLE_H1) - /* assert the mode and union status (hdr) clearly */ - lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, &role_ops_h1); -#else - lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, &role_ops_raw_skt); -#endif - wsi->desc.sockfd = LWS_SOCK_INVALID; - - /* 1) fill up the wsi with stuff from the connect_info as far as it - * can go. It's because not only is our connection async, we might - * not even be able to get ahold of an ah at this point. - */ - - if (!i->method) /* ie, ws */ -#if defined(LWS_ROLE_WS) - if (lws_create_client_ws_object(i, wsi)) - return NULL; -#else - return NULL; -#endif - - wsi->user_space = NULL; - wsi->pending_timeout = NO_PENDING_TIMEOUT; - wsi->position_in_fds_table = LWS_NO_FDS_POS; - wsi->c_port = i->port; - wsi->vhost = i->vhost; - if (!wsi->vhost) - wsi->vhost = i->context->vhost_list; - - if (!wsi->vhost) { - lwsl_err("At least one vhost in the context is required\n"); - - goto bail; - } - - wsi->protocol = &wsi->vhost->protocols[0]; - wsi->client_pipeline = !!(i->ssl_connection & LCCSCF_PIPELINE); - - /* reasonable place to start */ - lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, -#if defined(LWS_ROLE_H1) - &role_ops_h1); -#else - &role_ops_raw_skt); -#endif - - /* - * 1) for http[s] connection, allow protocol selection by name - * 2) for ws[s], if local_protocol_name given also use it for - * local protocol binding... this defeats the server - * protocol negotiation if so - * - * Otherwise leave at protocols[0]... the server will tell us - * which protocol we are associated with since we can give it a - * list. - */ - if (/*(i->method || i->local_protocol_name) && */local) { - lwsl_info("binding to %s\n", local); - p = lws_vhost_name_to_protocol(wsi->vhost, local); - if (p) - wsi->protocol = p; - } - - if (wsi && !wsi->user_space && i->userdata) { - wsi->user_space_externally_allocated = 1; - wsi->user_space = i->userdata; - } else - /* if we stay in http, we can assign the user space now, - * otherwise do it after the protocol negotiated - */ - if (i->method) - if (lws_ensure_user_space(wsi)) - goto bail; - -#if defined(LWS_WITH_TLS) - wsi->tls.use_ssl = i->ssl_connection; -#else - if (i->ssl_connection & LCCSCF_USE_SSL) { - lwsl_err("libwebsockets not configured for ssl\n"); - goto bail; - } -#endif - - /* 2) stash the things from connect_info that we can't process without - * an ah. Because if no ah, we will go on the ah waiting list and - * process those things later (after the connect_info and maybe the - * things pointed to have gone out of scope. - */ - - wsi->stash = lws_zalloc(sizeof(*wsi->stash), "client stash"); - if (!wsi->stash) { - lwsl_err("%s: OOM\n", __func__); - goto bail1; - } - - wsi->stash->address = lws_strdup(i->address); - wsi->stash->path = lws_strdup(i->path); - wsi->stash->host = lws_strdup(i->host); - - if (!wsi->stash->address || !wsi->stash->path || !wsi->stash->host) - goto bail1; - - if (i->origin) { - wsi->stash->origin = lws_strdup(i->origin); - if (!wsi->stash->origin) - goto bail1; - } - if (i->protocol) { - wsi->stash->protocol = lws_strdup(i->protocol); - if (!wsi->stash->protocol) - goto bail1; - } - if (i->method) { - wsi->stash->method = lws_strdup(i->method); - if (!wsi->stash->method) - goto bail1; - } - if (i->iface) { - wsi->stash->iface = lws_strdup(i->iface); - if (!wsi->stash->iface) - goto bail1; - } - /* - * For ws, default to http/1.1 only. If i->alpn is set, defer to - * whatever he has set in there (eg, "h2"). - * - * The problem is he has to commit to h2 before he can find out if the - * server has the SETTINGS for ws-over-h2 enabled; if not then ws is - * not possible on that connection. So we only try it if he - * assertively said to use h2 alpn. - */ - if (!i->method && !i->alpn) { - wsi->stash->alpn = lws_strdup("http/1.1"); - if (!wsi->stash->alpn) - goto bail1; - } else - if (i->alpn) { - wsi->stash->alpn = lws_strdup(i->alpn); - if (!wsi->stash->alpn) - goto bail1; - } - - if (i->pwsi) - *i->pwsi = wsi; - -#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) - /* if we went on the waiting list, no probs just return the wsi - * when we get the ah, now or later, he will call - * lws_client_connect_via_info2() below. - */ - if (lws_header_table_attach(wsi, 0) < 0) { - /* - * if we failed here, the connection is already closed - * and freed. - */ - goto bail2; - } - -#endif - - if (i->parent_wsi) { - lwsl_info("%s: created child %p of parent %p\n", __func__, - wsi, i->parent_wsi); - wsi->parent = i->parent_wsi; - wsi->sibling_list = i->parent_wsi->child_list; - i->parent_wsi->child_list = wsi; - } -#ifdef LWS_WITH_HTTP_PROXY - if (i->uri_replace_to) - wsi->http.rw = lws_rewrite_create(wsi, html_parser_cb, - i->uri_replace_from, - i->uri_replace_to); -#endif - - return wsi; - -bail1: - lws_client_stash_destroy(wsi); - -bail: - lws_free(wsi); -#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) -bail2: -#endif - if (i->pwsi) - *i->pwsi = NULL; - - return NULL; -} - struct lws * -lws_client_connect_via_info2(struct lws *wsi) +lws_http_client_connect_via_info2(struct lws *wsi) { struct client_info_stash *stash = wsi->stash; @@ -1156,55 +986,6 @@ bail1: return NULL; } -LWS_VISIBLE struct lws * -lws_client_connect_extended(struct lws_context *context, const char *address, - int port, int ssl_connection, const char *path, - const char *host, const char *origin, - const char *protocol, int ietf_version_or_minus_one, - void *userdata) -{ - struct lws_client_connect_info i; - - memset(&i, 0, sizeof(i)); - - i.context = context; - i.address = address; - i.port = port; - i.ssl_connection = ssl_connection; - i.path = path; - i.host = host; - i.origin = origin; - i.protocol = protocol; - i.ietf_version_or_minus_one = ietf_version_or_minus_one; - i.userdata = userdata; - - return lws_client_connect_via_info(&i); -} - -LWS_VISIBLE struct lws * -lws_client_connect(struct lws_context *context, const char *address, - int port, int ssl_connection, const char *path, - const char *host, const char *origin, - const char *protocol, int ietf_version_or_minus_one) -{ - struct lws_client_connect_info i; - - memset(&i, 0, sizeof(i)); - - i.context = context; - i.address = address; - i.port = port; - i.ssl_connection = ssl_connection; - i.path = path; - i.host = host; - i.origin = origin; - i.protocol = protocol; - i.ietf_version_or_minus_one = ietf_version_or_minus_one; - i.userdata = NULL; - - return lws_client_connect_via_info(&i); -} - #if defined(LWS_WITH_SOCKS5) void socks_generate_msg(struct lws *wsi, enum socks_msg_type type, ssize_t *msg_len) @@ -1242,8 +1023,9 @@ void socks_generate_msg(struct lws *wsi, enum socks_msg_type type, /* length of the password */ pt->serv_buf[len++] = passwd_len; /* password */ - lws_strncpy((char *)&pt->serv_buf[len], wsi->vhost->socks_password, - context->pt_serv_buf_size - len + 1); + lws_strncpy((char *)&pt->serv_buf[len], + wsi->vhost->socks_password, + context->pt_serv_buf_size - len + 1); len += passwd_len; break; diff --git a/thirdparty/libwebsockets/roles/http/client/client.c b/thirdparty/libwebsockets/lib/roles/http/client/client.c index 5645fa2b7a..1d6f13dcf8 100644 --- a/thirdparty/libwebsockets/roles/http/client/client.c +++ b/thirdparty/libwebsockets/lib/roles/http/client/client.c @@ -1,7 +1,7 @@ /* * libwebsockets - lib/client/client.c * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -48,7 +48,7 @@ lws_client_wsi_effective(struct lws *wsi) } lws_end_foreach_dll_safe(d, d1); return lws_container_of(tail, struct lws, - dll_client_transaction_queue); + dll_client_transaction_queue); } /* @@ -66,7 +66,7 @@ _lws_client_wsi_master(struct lws *wsi) d = wsi->dll_client_transaction_queue.prev; while (d) { wsi_eff = lws_container_of(d, struct lws, - dll_client_transaction_queue_head); + dll_client_transaction_queue_head); d = d->prev; } @@ -111,11 +111,12 @@ lws_client_socket_service(struct lws *wsi, struct lws_pollfd *pollfd, */ lws_vhost_lock(wsi->vhost); lws_start_foreach_dll_safe(struct lws_dll_lws *, d, d1, - wsi->dll_client_transaction_queue_head.next) { + wsi->dll_client_transaction_queue_head.next) { struct lws *w = lws_container_of(d, struct lws, dll_client_transaction_queue); - lwsl_debug("%s: %p states 0x%x\n", __func__, w, w->wsistate); + lwsl_debug("%s: %p states 0x%x\n", __func__, w, + w->wsistate); if (lwsi_state(w) == LRS_H1C_ISSUE_HANDSHAKE2) wfound = w; } lws_end_foreach_dll_safe(d, d1); @@ -208,7 +209,8 @@ lws_client_socket_service(struct lws *wsi, struct lws_pollfd *pollfd, case LRS_WAITING_SOCKS_AUTH_REPLY: if (pt->serv_buf[0] != SOCKS_SUBNEGOTIATION_VERSION_1 || - pt->serv_buf[1] != SOCKS_SUBNEGOTIATION_STATUS_SUCCESS) + pt->serv_buf[1] != + SOCKS_SUBNEGOTIATION_STATUS_SUCCESS) goto socks_reply_fail; lwsl_client("SOCKS password OK, sending connect\n"); @@ -243,8 +245,8 @@ socks_reply_fail: /* free stash since we are done with it */ lws_client_stash_destroy(wsi); if (lws_hdr_simple_create(wsi, - _WSI_TOKEN_CLIENT_PEER_ADDRESS, - wsi->vhost->socks_proxy_address)) + _WSI_TOKEN_CLIENT_PEER_ADDRESS, + wsi->vhost->socks_proxy_address)) goto bail3; wsi->c_port = wsi->vhost->socks_proxy_port; @@ -352,7 +354,9 @@ start_ws_handshake: * So this is it, we are an h2 master client connection * now, not an h1 client connection. */ +#if defined (LWS_WITH_TLS) lws_tls_server_conn_alpn(wsi); +#endif /* send the H2 preface to legitimize the connection */ if (lws_h2_issue_preface(wsi)) { @@ -377,7 +381,8 @@ start_ws_handshake: return 0; lwsl_err("Failed to generate handshake for client\n"); - lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, "chs"); + lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, + "chs"); return 0; } @@ -385,8 +390,9 @@ start_ws_handshake: lws_latency_pre(context, wsi); w = _lws_client_wsi_master(wsi); - lwsl_info("%s: HANDSHAKE2: %p: sending headers on %p (wsistate 0x%x 0x%x)\n", - __func__, wsi, w, wsi->wsistate, w->wsistate); + lwsl_info("%s: HANDSHAKE2: %p: sending headers on %p " + "(wsistate 0x%x 0x%x)\n", __func__, wsi, w, + wsi->wsistate, w->wsistate); n = lws_ssl_capable_write(w, (unsigned char *)sb, (int)(p - sb)); lws_latency(context, wsi, "send lws_issue_raw", n, @@ -394,7 +400,8 @@ start_ws_handshake: switch (n) { case LWS_SSL_CAPABLE_ERROR: lwsl_debug("ERROR writing to client socket\n"); - lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, "cws"); + lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, + "cws"); return 0; case LWS_SSL_CAPABLE_MORE_SERVICE: lws_callback_on_writable(wsi); @@ -419,7 +426,7 @@ start_ws_handshake: #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) w->http.ah->parser_state = WSI_TOKEN_NAME_PART; w->http.ah->lextable_pos = 0; - /* If we're (re)starting on headers, need other implied init */ + /* If we're (re)starting on hdr, need other implied init */ wsi->http.ah->ues = URIES_IDLE; #endif } @@ -549,11 +556,12 @@ lws_http_transaction_completed_client(struct lws *wsi) { struct lws *wsi_eff = lws_client_wsi_effective(wsi); - lwsl_info("%s: wsi: %p, wsi_eff: %p\n", __func__, wsi, wsi_eff); + lwsl_info("%s: wsi: %p, wsi_eff: %p (%s)\n", __func__, wsi, wsi_eff, + wsi_eff->protocol->name); - if (user_callback_handle_rxflow(wsi_eff->protocol->callback, - wsi_eff, LWS_CALLBACK_COMPLETED_CLIENT_HTTP, - wsi_eff->user_space, NULL, 0)) { + if (user_callback_handle_rxflow(wsi_eff->protocol->callback, wsi_eff, + LWS_CALLBACK_COMPLETED_CLIENT_HTTP, + wsi_eff->user_space, NULL, 0)) { lwsl_debug("%s: Completed call returned nonzero (role 0x%x)\n", __func__, lwsi_role(wsi_eff)); return -1; @@ -626,7 +634,8 @@ lws_http_transaction_completed_client(struct lws *wsi) /* If we're (re)starting on headers, need other implied init */ wsi->http.ah->ues = URIES_IDLE; - lwsl_info("%s: %p: new queued transaction as %p\n", __func__, wsi, wsi_eff); + lwsl_info("%s: %p: new queued transaction as %p\n", __func__, wsi, + wsi_eff); lws_callback_on_writable(wsi); return 0; @@ -672,7 +681,7 @@ lws_client_interpret_server_handshake(struct lws *wsi) int n, port = 0, ssl = 0; int close_reason = LWS_CLOSE_STATUS_PROTOCOL_ERR; const char *prot, *ads = NULL, *path, *cce = NULL; - struct allocated_headers *ah = NULL; + struct allocated_headers *ah; struct lws *w = lws_client_wsi_effective(wsi); char *p, *q; char new_path[300]; @@ -685,7 +694,8 @@ lws_client_interpret_server_handshake(struct lws *wsi) */ #if defined(LWS_ROLE_H2) if (wsi->client_h2_alpn || wsi->client_h2_substream) { - lwsl_debug("%s: %p: transitioning to h2 client\n", __func__, wsi); + lwsl_debug("%s: %p: transitioning to h2 client\n", + __func__, wsi); lws_role_transition(wsi, LWSIFR_CLIENT, LRS_ESTABLISHED, &role_ops_h2); } else @@ -693,7 +703,8 @@ lws_client_interpret_server_handshake(struct lws *wsi) { #if defined(LWS_ROLE_H1) { - lwsl_debug("%s: %p: transitioning to h1 client\n", __func__, wsi); + lwsl_debug("%s: %p: transitioning to h1 client\n", + __func__, wsi); lws_role_transition(wsi, LWSIFR_CLIENT, LRS_ESTABLISHED, &role_ops_h1); } @@ -719,7 +730,7 @@ lws_client_interpret_server_handshake(struct lws *wsi) * set-cookie:.test=LWS_1456736240_336776_COOKIE;Max-Age=360000 */ - wsi->http.connection_type = HTTP_CONNECTION_KEEP_ALIVE; + wsi->http.conn_type = HTTP_CONNECTION_KEEP_ALIVE; if (!wsi->client_h2_substream) { p = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP); if (wsi->do_ws && !p) { @@ -729,7 +740,7 @@ lws_client_interpret_server_handshake(struct lws *wsi) } if (!p) { p = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP1_0); - wsi->http.connection_type = HTTP_CONNECTION_CLOSE; + wsi->http.conn_type = HTTP_CONNECTION_CLOSE; } if (!p) { cce = "HS: URI missing"; @@ -826,8 +837,9 @@ lws_client_interpret_server_handshake(struct lws *wsi) /* if h1 KA is allowed, enable the queued pipeline guys */ - if (!wsi->client_h2_alpn && !wsi->client_h2_substream && w == wsi) { /* ie, coming to this for the first time */ - if (wsi->http.connection_type == HTTP_CONNECTION_KEEP_ALIVE) + if (!wsi->client_h2_alpn && !wsi->client_h2_substream && + w == wsi) { /* ie, coming to this for the first time */ + if (wsi->http.conn_type == HTTP_CONNECTION_KEEP_ALIVE) wsi->keepalive_active = 1; else { /* @@ -847,13 +859,16 @@ lws_client_interpret_server_handshake(struct lws *wsi) wsi->keepalive_rejected = 1; lws_vhost_lock(wsi->vhost); - lws_start_foreach_dll_safe(struct lws_dll_lws *, d, d1, - wsi->dll_client_transaction_queue_head.next) { - struct lws *ww = lws_container_of(d, struct lws, - dll_client_transaction_queue); + lws_start_foreach_dll_safe(struct lws_dll_lws *, + d, d1, + wsi->dll_client_transaction_queue_head.next) { + struct lws *ww = lws_container_of(d, + struct lws, + dll_client_transaction_queue); /* remove him from our queue */ - lws_dll_lws_remove(&ww->dll_client_transaction_queue); + lws_dll_lws_remove( + &ww->dll_client_transaction_queue); /* give up on pipelining */ ww->client_pipeline = 0; @@ -881,7 +896,7 @@ lws_client_interpret_server_handshake(struct lws *wsi) if (!strncmp(lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_CONTENT_TYPE), "text/html", 9)) - wsi->http.perform_rewrite = 1; + wsi->http.perform_rewrite = 0; } #endif @@ -915,8 +930,7 @@ lws_client_interpret_server_handshake(struct lws *wsi) wsi->http.rx_content_length; } else /* can't do 1.1 without a content length or chunked */ if (!wsi->chunked) - wsi->http.connection_type = - HTTP_CONNECTION_CLOSE; + wsi->http.conn_type = HTTP_CONNECTION_CLOSE; /* * we seem to be good to go, give client last chance to check @@ -954,6 +968,15 @@ lws_client_interpret_server_handshake(struct lws *wsi) lwsl_info("%s: client connection up\n", __func__); + /* + * Did we get a response from the server with an explicit + * content-length of zero? If so, this transaction is already + * completed at the end of the header processing... + */ + if (lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH) && + !wsi->http.rx_content_length) + return !!lws_http_transaction_completed_client(wsi); + return 0; } @@ -983,7 +1006,9 @@ bail2: } wsi->already_did_cce = 1; - lwsl_info("closing connection due to bail2 connection error\n"); + lwsl_info("closing connection (prot %s) " + "due to bail2 connection error: %s\n", wsi->protocol ? + wsi->protocol->name : "unknown", cce); /* closing will free up his parsing allocations */ lws_close_free_wsi(wsi, close_reason, "c hs interp"); @@ -1023,7 +1048,7 @@ lws_generate_client_handshake(struct lws *wsi, char *pkt) return NULL; } - lws_bind_protocol(wsi, pr); + lws_bind_protocol(wsi, pr, __func__); } if ((wsi->protocol->callback)(wsi, LWS_CALLBACK_RAW_ADOPT, @@ -1070,16 +1095,22 @@ lws_generate_client_handshake(struct lws *wsi, char *pkt) _WSI_TOKEN_CLIENT_ORIGIN)); } #if defined(LWS_ROLE_WS) - if (wsi->do_ws) - p = lws_generate_client_ws_handshake(wsi, p); + if (wsi->do_ws) { + const char *conn1 = ""; + if (!wsi->client_pipeline) + conn1 = "close, "; + p = lws_generate_client_ws_handshake(wsi, p, conn1); + } else #endif + if (!wsi->client_pipeline) + p += sprintf(p, "connection: close\x0d\x0a"); /* give userland a chance to append, eg, cookies */ if (wsi->protocol->callback(wsi, - LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER, - wsi->user_space, &p, - (pkt + wsi->context->pt_serv_buf_size) - p - 12)) + LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER, + wsi->user_space, &p, + (pkt + wsi->context->pt_serv_buf_size) - p - 12)) return NULL; p += sprintf(p, "\x0d\x0a"); @@ -1103,14 +1134,11 @@ lws_http_client_read(struct lws *wsi, char **buf, int *len) lws_change_pollfd(wsi, 0, LWS_POLLIN); if (rlen == LWS_SSL_CAPABLE_ERROR) { - lwsl_notice("%s: SSL capable error\n", __func__); + lwsl_debug("%s: SSL capable error\n", __func__); return -1; } - if (rlen == 0) - return -1; - - if (rlen < 0) + if (rlen <= 0) return 0; *len = rlen; @@ -1130,7 +1158,7 @@ spin_chunks: } n = char_to_hex((*buf)[0]); if (n < 0) { - lwsl_debug("chunking failure\n"); + lwsl_info("%s: chunking failure\n", __func__); return -1; } wsi->chunk_remaining <<= 4; @@ -1138,7 +1166,7 @@ spin_chunks: break; case ELCP_CR: if ((*buf)[0] != '\x0a') { - lwsl_debug("chunking failure\n"); + lwsl_info("%s: chunking failure\n", __func__); return -1; } wsi->chunk_parser = ELCP_CONTENT; @@ -1153,7 +1181,7 @@ spin_chunks: case ELCP_POST_CR: if ((*buf)[0] != '\x0d') { - lwsl_debug("chunking failure\n"); + lwsl_info("%s: chunking failure\n", __func__); return -1; } @@ -1162,8 +1190,11 @@ spin_chunks: break; case ELCP_POST_LF: - if ((*buf)[0] != '\x0a') + if ((*buf)[0] != '\x0a') { + lwsl_info("%s: chunking failure\n", __func__); + return -1; + } wsi->chunk_parser = ELCP_HEX; wsi->chunk_remaining = 0; @@ -1186,7 +1217,7 @@ spin_chunks: wsi->chunk_remaining < n) n = wsi->chunk_remaining; -#ifdef LWS_WITH_HTTP_PROXY +#if defined(LWS_WITH_HTTP_PROXY) && defined(LWS_WITH_HUBBUB) /* hubbub */ if (wsi->http.perform_rewrite) lws_rewrite_parse(wsi->http.rw, (unsigned char *)*buf, n); @@ -1198,7 +1229,7 @@ spin_chunks: if (user_callback_handle_rxflow(wsi_eff->protocol->callback, wsi_eff, LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ, wsi_eff->user_space, *buf, n)) { - lwsl_debug("%s: RECEIVE_CLIENT_HTTP_READ returned -1\n", + lwsl_info("%s: RECEIVE_CLIENT_HTTP_READ returned -1\n", __func__); return -1; diff --git a/thirdparty/libwebsockets/roles/http/header.c b/thirdparty/libwebsockets/lib/roles/http/header.c index dbcf27cbd1..448c5a8b5c 100644 --- a/thirdparty/libwebsockets/roles/http/header.c +++ b/thirdparty/libwebsockets/lib/roles/http/header.c @@ -1,7 +1,7 @@ /* * libwebsockets - small server side websockets and web server implementation * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -116,9 +116,10 @@ lws_add_http_header_by_token(struct lws *wsi, enum lws_token_indexes token, return lws_add_http_header_by_name(wsi, name, value, length, p, end); } -int lws_add_http_header_content_length(struct lws *wsi, - lws_filepos_t content_length, - unsigned char **p, unsigned char *end) +int +lws_add_http_header_content_length(struct lws *wsi, + lws_filepos_t content_length, + unsigned char **p, unsigned char *end) { char b[24]; int n; @@ -141,6 +142,10 @@ lws_add_http_common_headers(struct lws *wsi, unsigned int code, const char *content_type, lws_filepos_t content_len, unsigned char **p, unsigned char *end) { + const char *ka[] = { "close", "keep-alive" }; + int types[] = { HTTP_CONNECTION_CLOSE, HTTP_CONNECTION_KEEP_ALIVE }, + t = 0; + if (lws_add_http_header_status(wsi, code, p, end)) return 1; @@ -149,22 +154,67 @@ lws_add_http_common_headers(struct lws *wsi, unsigned int code, (int)strlen(content_type), p, end)) return 1; - if (content_len != LWS_ILLEGAL_HTTP_CONTENT_LEN) { - if (lws_add_http_header_content_length(wsi, content_len, p, end)) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (!wsi->http.lcs && + (!strncmp(content_type, "text/", 5) || + !strcmp(content_type, "application/javascript") || + !strcmp(content_type, "image/svg+xml"))) + lws_http_compression_apply(wsi, NULL, p, end, 0); +#endif + + /* + * if we decided to compress it, we don't know the content length... + * the compressed data will go out chunked on h1 + */ + if ( +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + !wsi->http.lcs && +#endif + content_len != LWS_ILLEGAL_HTTP_CONTENT_LEN) { + if (lws_add_http_header_content_length(wsi, content_len, + p, end)) return 1; } else { - if (lws_add_http_header_by_token(wsi, WSI_TOKEN_CONNECTION, - (unsigned char *)"close", 5, - p, end)) - return 1; - - wsi->http.connection_type = HTTP_CONNECTION_CLOSE; + /* there was no length... it normally means CONNECTION_CLOSE */ +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + + if (!wsi->http2_substream && wsi->http.lcs) { + /* so... + * - h1 connection + * - http compression transform active + * - did not send content length + * + * then mark as chunked... + */ + wsi->http.comp_ctx.chunking = 1; + if (lws_add_http_header_by_token(wsi, + WSI_TOKEN_HTTP_TRANSFER_ENCODING, + (unsigned char *)"chunked", 7, p, end)) + return -1; + + /* ... but h1 compression is chunked, if active we can + * still pipeline + */ + if (wsi->http.lcs && + wsi->http.conn_type == HTTP_CONNECTION_KEEP_ALIVE) + t = 1; + } +#endif + if (!wsi->http2_substream) { + if (lws_add_http_header_by_token(wsi, + WSI_TOKEN_CONNECTION, + (unsigned char *)ka[t], + (int)strlen(ka[t]), p, end)) + return 1; + + wsi->http.conn_type = types[t]; + } } return 0; } -STORE_IN_ROM static const char * const err400[] = { +static const char * const err400[] = { "Bad Request", "Unauthorized", "Payment Required", @@ -185,7 +235,7 @@ STORE_IN_ROM static const char * const err400[] = { "Expectation Failed" }; -STORE_IN_ROM static const char * const err500[] = { +static const char * const err500[] = { "Internal Server Error", "Not Implemented", "Bad Gateway", @@ -194,11 +244,31 @@ STORE_IN_ROM static const char * const err500[] = { "HTTP Version Not Supported" }; +/* security best practices from Mozilla Observatory */ + +static const +struct lws_protocol_vhost_options pvo_hsbph[] = {{ + NULL, NULL, "referrer-policy:", "no-referrer" +}, { + &pvo_hsbph[0], NULL, "x-frame-options:", "deny" +}, { + &pvo_hsbph[1], NULL, "x-xss-protection:", "1; mode=block" +}, { + &pvo_hsbph[2], NULL, "x-content-type-options:", "nosniff" +}, { + &pvo_hsbph[3], NULL, "content-security-policy:", + "default-src 'none'; img-src 'self' data: ; " + "script-src 'self'; font-src 'self'; " + "style-src 'self'; connect-src 'self'; " + "frame-ancestors 'none'; base-uri 'none';" + "form-action 'self';" +}}; + int lws_add_http_header_status(struct lws *wsi, unsigned int _code, unsigned char **p, unsigned char *end) { - STORE_IN_ROM static const char * const hver[] = { + static const char * const hver[] = { "HTTP/1.0", "HTTP/1.1", "HTTP/2" }; const struct lws_protocol_vhost_options *headers; @@ -246,6 +316,7 @@ lws_add_http_header_status(struct lws *wsi, unsigned int _code, end)) return 1; } + headers = wsi->vhost->headers; while (headers) { if (lws_add_http_header_by_name(wsi, @@ -257,6 +328,20 @@ lws_add_http_header_status(struct lws *wsi, unsigned int _code, headers = headers->next; } + if (wsi->vhost->options & + LWS_SERVER_OPTION_HTTP_HEADERS_SECURITY_BEST_PRACTICES_ENFORCE) { + headers = &pvo_hsbph[LWS_ARRAY_SIZE(pvo_hsbph) - 1]; + while (headers) { + if (lws_add_http_header_by_name(wsi, + (const unsigned char *)headers->name, + (unsigned char *)headers->value, + (int)strlen(headers->value), p, end)) + return 1; + + headers = headers->next; + } + } + if (wsi->context->server_string && !(_code & LWSAHH_FLAG_NO_SERVER_NAME)) if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_SERVER, @@ -271,6 +356,12 @@ lws_add_http_header_status(struct lws *wsi, unsigned int _code, "includeSubDomains", 36, p, end)) return 1; + if (*p >= (end - 2)) { + lwsl_err("%s: reached end of buffer\n", __func__); + + return 1; + } + return 0; } @@ -283,6 +374,7 @@ lws_return_http_status(struct lws *wsi, unsigned int code, unsigned char *p = pt->serv_buf + LWS_PRE; unsigned char *start = p; unsigned char *end = p + context->pt_serv_buf_size - LWS_PRE; + char *body = (char *)start + context->pt_serv_buf_size - 512; int n = 0, m = 0, len; char slen[20]; @@ -297,9 +389,9 @@ lws_return_http_status(struct lws *wsi, unsigned int code, code == HTTP_STATUS_NOT_FOUND) /* we should do a redirect, and do the 404 there */ if (lws_http_redirect(wsi, HTTP_STATUS_FOUND, - (uint8_t *)wsi->vhost->http.error_document_404, - (int)strlen(wsi->vhost->http.error_document_404), - &p, end) > 0) + (uint8_t *)wsi->vhost->http.error_document_404, + (int)strlen(wsi->vhost->http.error_document_404), + &p, end) > 0) return 0; #endif @@ -317,9 +409,15 @@ lws_return_http_status(struct lws *wsi, unsigned int code, &p, end)) return 1; - len = 35 + (int)strlen(html_body) + sprintf(slen, "%d", code); - n = sprintf(slen, "%d", len); + len = lws_snprintf(body, 510, "<html><head>" + "<meta charset=utf-8 http-equiv=\"Content-Language\" " + "content=\"en\"/>" + "<link rel=\"stylesheet\" type=\"text/css\" " + "href=\"/error.css\"/>" + "</head><body><h1>%u</h1>%s</body></html>", code, html_body); + + n = sprintf(slen, "%d", len); if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH, (unsigned char *)slen, n, &p, end)) return 1; @@ -329,7 +427,6 @@ lws_return_http_status(struct lws *wsi, unsigned int code, #if defined(LWS_WITH_HTTP2) if (wsi->http2_substream) { - unsigned char *body = p + 512; /* * for HTTP/2, the headers must be sent separately, since they @@ -343,7 +440,8 @@ lws_return_http_status(struct lws *wsi, unsigned int code, * * Solve it by writing the headers now... */ - m = lws_write(wsi, start, p - start, LWS_WRITE_HTTP_HEADERS); + m = lws_write(wsi, start, lws_ptr_diff(p, start), + LWS_WRITE_HTTP_HEADERS); if (m != lws_ptr_diff(p, start)) return 1; @@ -351,10 +449,6 @@ lws_return_http_status(struct lws *wsi, unsigned int code, * ... but stash the body and send it as a priority next * handle_POLLOUT */ - - len = sprintf((char *)body, - "<html><body><h1>%u</h1>%s</body></html>", - code, html_body); wsi->http.tx_content_length = len; wsi->http.tx_content_remain = len; @@ -363,8 +457,7 @@ lws_return_http_status(struct lws *wsi, unsigned int code, if (!wsi->h2.pending_status_body) return -1; - strcpy(wsi->h2.pending_status_body + LWS_PRE, - (const char *)body); + strcpy(wsi->h2.pending_status_body + LWS_PRE, body); lws_callback_on_writable(wsi); return 0; @@ -375,11 +468,9 @@ lws_return_http_status(struct lws *wsi, unsigned int code, * for http/1, we can just append the body after the finalized * headers and send it all in one go. */ - p += lws_snprintf((char *)p, end - p - 1, - "<html><body><h1>%u</h1>%s</body></html>", - code, html_body); - n = lws_ptr_diff(p, start); + n = lws_ptr_diff(p, start) + len; + memcpy(p, body, len); m = lws_write(wsi, start, n, LWS_WRITE_HTTP); if (m != n) return 1; @@ -419,3 +510,20 @@ lws_http_redirect(struct lws *wsi, int code, const unsigned char *loc, int len, return lws_write(wsi, start, *p - start, LWS_WRITE_HTTP_HEADERS | LWS_WRITE_H2_STREAM_END); } + +#if !defined(LWS_WITH_HTTP_STREAM_COMPRESSION) +LWS_VISIBLE int +lws_http_compression_apply(struct lws *wsi, const char *name, + unsigned char **p, unsigned char *end, char decomp) +{ + (void)wsi; + (void)name; + (void)p; + (void)end; + (void)decomp; + + return 0; +} +#endif + + diff --git a/thirdparty/libwebsockets/roles/http/lextable-strings.h b/thirdparty/libwebsockets/lib/roles/http/lextable-strings.h index 631f5cb600..1e4fee855f 100644 --- a/thirdparty/libwebsockets/roles/http/lextable-strings.h +++ b/thirdparty/libwebsockets/lib/roles/http/lextable-strings.h @@ -1,10 +1,6 @@ /* set of parsable strings -- ALL LOWER CASE */ -#if !defined(STORE_IN_ROM) -#define STORE_IN_ROM -#endif - -STORE_IN_ROM static const char * const set[] = { +static const char * const set[] = { "get ", "post ", "options ", diff --git a/thirdparty/libwebsockets/roles/http/lextable.h b/thirdparty/libwebsockets/lib/roles/http/lextable.h index 9a8063b157..9a8063b157 100644 --- a/thirdparty/libwebsockets/roles/http/lextable.h +++ b/thirdparty/libwebsockets/lib/roles/http/lextable.h diff --git a/thirdparty/libwebsockets/roles/http/private.h b/thirdparty/libwebsockets/lib/roles/http/private.h index 5699914742..ff8b0581cc 100644 --- a/thirdparty/libwebsockets/roles/http/private.h +++ b/thirdparty/libwebsockets/lib/roles/http/private.h @@ -22,11 +22,15 @@ * enabled */ -#if defined(LWS_WITH_HTTP_PROXY) +#if defined(LWS_WITH_HUBBUB) #include <hubbub/hubbub.h> #include <hubbub/parser.h> #endif +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) +#include "roles/http/compression/private.h" +#endif + #define lwsi_role_http(wsi) (lwsi_role_h1(wsi) || lwsi_role_h2(wsi)) enum http_version { @@ -35,7 +39,7 @@ enum http_version { HTTP_VERSION_2 }; -enum http_connection_type { +enum http_conn_type { HTTP_CONNECTION_CLOSE, HTTP_CONNECTION_KEEP_ALIVE }; @@ -133,7 +137,7 @@ struct allocated_headers { -#if defined(LWS_WITH_HTTP_PROXY) +#if defined(LWS_WITH_HUBBUB) struct lws_rewrite { hubbub_parser *parser; hubbub_parser_optparams params; @@ -192,9 +196,15 @@ struct lws_access_log { }; #endif +#define LWS_HTTP_CHUNK_HDR_MAX_SIZE (6 + 2) /* 6 hex digits and then CRLF */ +#define LWS_HTTP_CHUNK_TRL_MAX_SIZE (2 + 5) /* CRLF, then maybe 0 CRLF CRLF */ + struct _lws_http_mode_related { struct lws *new_wsi_list; + unsigned char *pending_return_headers; + size_t pending_return_headers_len; + #if defined(LWS_WITH_HTTP_PROXY) struct lws_rewrite *rw; #endif @@ -216,9 +226,14 @@ struct _lws_http_mode_related { #ifdef LWS_WITH_CGI struct lws_cgi *cgi; /* wsi being cgi master have one of these */ #endif +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + struct lws_compression_support *lcs; + lws_comp_ctx_t comp_ctx; + unsigned char comp_accept_mask; +#endif enum http_version request_version; - enum http_connection_type connection_type; + enum http_conn_type conn_type; lws_filepos_t tx_content_length; lws_filepos_t tx_content_remain; lws_filepos_t rx_content_length; @@ -226,8 +241,12 @@ struct _lws_http_mode_related { #if defined(LWS_WITH_HTTP_PROXY) unsigned int perform_rewrite:1; + unsigned int proxy_clientside:1; + unsigned int proxy_parent_chunked:1; #endif unsigned int deferred_transaction_completed:1; + unsigned int content_length_explicitly_zero:1; + unsigned int did_stream_close:1; }; diff --git a/thirdparty/libwebsockets/roles/http/server/fops-zip.c b/thirdparty/libwebsockets/lib/roles/http/server/fops-zip.c index 4db83ce621..4db83ce621 100644 --- a/thirdparty/libwebsockets/roles/http/server/fops-zip.c +++ b/thirdparty/libwebsockets/lib/roles/http/server/fops-zip.c diff --git a/thirdparty/libwebsockets/roles/http/server/lejp-conf.c b/thirdparty/libwebsockets/lib/roles/http/server/lejp-conf.c index fbf10c288e..0dd701d835 100644 --- a/thirdparty/libwebsockets/roles/http/server/lejp-conf.c +++ b/thirdparty/libwebsockets/lib/roles/http/server/lejp-conf.c @@ -1,7 +1,7 @@ /* * libwebsockets web server application * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -105,6 +105,11 @@ static const char * const paths_vhosts[] = { "vhosts[].ignore-missing-cert", "vhosts[].error-document-404", "vhosts[].alpn", + "vhosts[].ssl-client-option-set", + "vhosts[].ssl-client-option-clear", + "vhosts[].tls13-ciphers", + "vhosts[].client-tls13-ciphers", + "vhosts[].strict-host-check", }; enum lejp_vhost_paths { @@ -156,6 +161,11 @@ enum lejp_vhost_paths { LEJPVP_IGNORE_MISSING_CERT, LEJPVP_ERROR_DOCUMENT_404, LEJPVP_ALPN, + LEJPVP_SSL_CLIENT_OPTION_SET, + LEJPVP_SSL_CLIENT_OPTION_CLEAR, + LEJPVP_TLS13_CIPHERS, + LEJPVP_CLIENT_TLS13_CIPHERS, + LEJPVP_FLAG_STRICT_HOST_CHECK, }; static const char * const parser_errs[] = { @@ -252,7 +262,7 @@ lejp_globals_cb(struct lejp_ctx *ctx, char reason) rej = lwsws_align(a); a->p += sizeof(*rej); - n = lejp_get_wildcard(ctx, 0, a->p, a->end - a->p); + n = lejp_get_wildcard(ctx, 0, a->p, lws_ptr_diff(a->end, a->p)); rej->next = a->info->reject_service_keywords; a->info->reject_service_keywords = rej; rej->name = a->p; @@ -403,7 +413,7 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) a->pvo = lwsws_align(a); a->p += sizeof(*a->pvo); - n = lejp_get_wildcard(ctx, 0, a->p, a->end - a->p); + n = lejp_get_wildcard(ctx, 0, a->p, lws_ptr_diff(a->end, a->p)); /* ie, enable this protocol, no options yet */ a->pvo->next = a->info->pvo; a->info->pvo = a->pvo; @@ -418,6 +428,7 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) /* this catches, eg, vhosts[].headers[].xxx */ if ((reason == LEJPCB_VAL_STR_END || reason == LEJPCB_VAL_STR_CHUNK) && ctx->path_match == LEJPVP_HEADERS_NAME + 1) { + if (!a->chunk) { headers = lwsws_align(a); a->p += sizeof(*headers); @@ -450,8 +461,9 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) struct lws_vhost *vhost; //lwsl_notice("%s\n", ctx->path); - if (!a->info->port) { - lwsl_err("Port required (eg, 443)"); + if (!a->info->port && + !(a->info->options & LWS_SERVER_OPTION_UNIX_SOCK)) { + lwsl_err("Port required (eg, 443)\n"); return 1; } a->valid = 0; @@ -467,13 +479,19 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) #if defined(LWS_WITH_TLS) if (a->enable_client_ssl) { - const char *cert_filepath = a->info->client_ssl_cert_filepath; - const char *private_key_filepath = a->info->client_ssl_private_key_filepath; - const char *ca_filepath = a->info->client_ssl_ca_filepath; - const char *cipher_list = a->info->client_ssl_cipher_list; + const char *cert_filepath = + a->info->client_ssl_cert_filepath; + const char *private_key_filepath = + a->info->client_ssl_private_key_filepath; + const char *ca_filepath = + a->info->client_ssl_ca_filepath; + const char *cipher_list = + a->info->client_ssl_cipher_list; + memset(a->info, 0, sizeof(*a->info)); a->info->client_ssl_cert_filepath = cert_filepath; - a->info->client_ssl_private_key_filepath = private_key_filepath; + a->info->client_ssl_private_key_filepath = + private_key_filepath; a->info->client_ssl_ca_filepath = ca_filepath; a->info->client_ssl_cipher_list = cipher_list; a->info->options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; @@ -617,6 +635,13 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) case LEJPVP_CIPHERS: a->info->ssl_cipher_list = a->p; break; + case LEJPVP_TLS13_CIPHERS: + a->info->tls1_3_plus_cipher_list = a->p; + break; + case LEJPVP_CLIENT_TLS13_CIPHERS: + a->info->client_tls_1_3_plus_cipher_list = a->p; + break; + case LEJPVP_ECDH_CURVE: a->info->ecdh_curve = a->p; break; @@ -628,13 +653,13 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) mp_cgienv->next = a->m.cgienv; a->m.cgienv = mp_cgienv; - n = lejp_get_wildcard(ctx, 0, a->p, a->end - a->p); + n = lejp_get_wildcard(ctx, 0, a->p, lws_ptr_diff(a->end, a->p)); mp_cgienv->name = a->p; a->p += n; mp_cgienv->value = a->p; mp_cgienv->options = NULL; - //lwsl_notice(" adding pmo / cgi-env '%s' = '%s'\n", mp_cgienv->name, - // mp_cgienv->value); + //lwsl_notice(" adding pmo / cgi-env '%s' = '%s'\n", + // mp_cgienv->name, mp_cgienv->value); goto dostring; case LEJPVP_PROTOCOL_NAME_OPT: @@ -645,7 +670,7 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) pvo = lwsws_align(a); a->p += sizeof(*a->pvo); - n = lejp_get_wildcard(ctx, 1, a->p, a->end - a->p); + n = lejp_get_wildcard(ctx, 1, a->p, lws_ptr_diff(a->end, a->p)); /* ie, enable this protocol, no options yet */ pvo->next = a->pvo->options; a->pvo->options = pvo; @@ -659,12 +684,12 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) a->pvo_em = lwsws_align(a); a->p += sizeof(*a->pvo_em); - n = lejp_get_wildcard(ctx, 0, a->p, a->end - a->p); + n = lejp_get_wildcard(ctx, 0, a->p, lws_ptr_diff(a->end, a->p)); /* ie, enable this protocol, no options yet */ a->pvo_em->next = a->m.extra_mimetypes; a->m.extra_mimetypes = a->pvo_em; a->pvo_em->name = a->p; - lwsl_notice(" adding extra-mimetypes %s -> %s\n", a->p, ctx->buf); + lwsl_notice(" + extra-mimetypes %s -> %s\n", a->p, ctx->buf); a->p += n; a->pvo_em->value = a->p; a->pvo_em->options = NULL; @@ -674,7 +699,7 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) a->pvo_int = lwsws_align(a); a->p += sizeof(*a->pvo_int); - n = lejp_get_wildcard(ctx, 0, a->p, a->end - a->p); + n = lejp_get_wildcard(ctx, 0, a->p, lws_ptr_diff(a->end, a->p)); /* ie, enable this protocol, no options yet */ a->pvo_int->next = a->m.interpret; a->m.interpret = a->pvo_int; @@ -737,6 +762,15 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) return 0; + case LEJPVP_FLAG_STRICT_HOST_CHECK: + if (arg_to_bool(ctx->buf)) + a->info->options |= + LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK; + else + a->info->options &= + ~(LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK); + return 0; + case LEJPVP_ERROR_DOCUMENT_404: a->info->error_document_404 = a->p; break; @@ -748,6 +782,13 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) a->info->ssl_options_clear |= atol(ctx->buf); return 0; + case LEJPVP_SSL_CLIENT_OPTION_SET: + a->info->ssl_client_options_set |= atol(ctx->buf); + return 0; + case LEJPVP_SSL_CLIENT_OPTION_CLEAR: + a->info->ssl_client_options_clear |= atol(ctx->buf); + return 0; + case LEJPVP_ALPN: a->info->alpn = a->p; break; @@ -761,12 +802,13 @@ dostring: p[LEJP_STRING_CHUNK] = '\0'; p1 = strstr(p, ESC_INSTALL_DATADIR); if (p1) { - n = p1 - p; + n = lws_ptr_diff(p1, p); if (n > a->end - a->p) - n = a->end - a->p; + n = lws_ptr_diff(a->end, a->p); lws_strncpy(a->p, p, n + 1); a->p += n; - a->p += lws_snprintf(a->p, a->end - a->p, "%s", LWS_INSTALL_DATADIR); + a->p += lws_snprintf(a->p, a->end - a->p, "%s", + LWS_INSTALL_DATADIR); p += n + strlen(ESC_INSTALL_DATADIR); } @@ -871,7 +913,7 @@ static int lwsws_get_config_d(void *user, const char *d, const char * const *paths, int count_paths, lejp_callback cb) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(LWS_WITH_ESP32) struct dirent **namelist; char path[256]; int n, i, ret = 0; @@ -941,13 +983,14 @@ lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d, return 1; lws_snprintf(dd, sizeof(dd) - 1, "%s/conf.d", d); if (lwsws_get_config_d(&a, dd, paths_global, - LWS_ARRAY_SIZE(paths_global), lejp_globals_cb) > 1) + LWS_ARRAY_SIZE(paths_global), + lejp_globals_cb) > 1) return 1; a.plugin_dirs[a.count_plugin_dirs] = NULL; *cs = a.p; - *len = a.end - a.p; + *len = lws_ptr_diff(a.end, a.p); return 0; } @@ -980,7 +1023,7 @@ lwsws_get_config_vhosts(struct lws_context *context, return 1; *cs = a.p; - *len = a.end - a.p; + *len = lws_ptr_diff(a.end, a.p); if (!a.any_vhosts) { lwsl_err("Need at least one vhost\n"); diff --git a/thirdparty/libwebsockets/roles/http/server/parsers.c b/thirdparty/libwebsockets/lib/roles/http/server/parsers.c index 482bdc676a..641e9b8dac 100644 --- a/thirdparty/libwebsockets/roles/http/server/parsers.c +++ b/thirdparty/libwebsockets/lib/roles/http/server/parsers.c @@ -240,8 +240,9 @@ lws_header_table_attach(struct lws *wsi, int autoservice) wsi->http.ah->wsi = wsi; /* mark our owner */ pt->http.ah_count_in_use++; -#if defined(LWS_WITH_PEER_LIMITS) && (defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)) - lws_context_lock(context); /* <====================================== */ +#if defined(LWS_WITH_PEER_LIMITS) && (defined(LWS_ROLE_H1) || \ + defined(LWS_ROLE_H2)) + lws_context_lock(context, "ah attach"); /* <========================= */ if (wsi->peer) wsi->peer->http.count_ah++; lws_context_unlock(context); /* ====================================> */ @@ -259,7 +260,7 @@ reset: #ifndef LWS_NO_CLIENT if (lwsi_role_client(wsi) && lwsi_state(wsi) == LRS_UNCONNECTED) - if (!lws_client_connect_via_info2(wsi)) + if (!lws_http_client_connect_via_info2(wsi)) /* our client connect has failed, the wsi * has been closed */ @@ -353,14 +354,16 @@ int __lws_header_table_detach(struct lws *wsi, int autoservice) if (!wsi) /* everybody waiting already has too many ah... */ goto nobody_usable_waiting; - lwsl_info("%s: transferring ah to last eligible wsi in wait list %p (wsistate 0x%x)\n", __func__, wsi, wsi->wsistate); + lwsl_info("%s: transferring ah to last eligible wsi in wait list " + "%p (wsistate 0x%x)\n", __func__, wsi, wsi->wsistate); wsi->http.ah = ah; ah->wsi = wsi; /* new owner */ __lws_header_table_reset(wsi, autoservice); -#if defined(LWS_WITH_PEER_LIMITS) && (defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)) - lws_context_lock(context); /* <====================================== */ +#if defined(LWS_WITH_PEER_LIMITS) && (defined(LWS_ROLE_H1) || \ + defined(LWS_ROLE_H2)) + lws_context_lock(context, "ah detach"); /* <========================= */ if (wsi->peer) wsi->peer->http.count_ah++; lws_context_unlock(context); /* ====================================> */ @@ -386,7 +389,7 @@ int __lws_header_table_detach(struct lws *wsi, int autoservice) if (lwsi_role_client(wsi) && lwsi_state(wsi) == LRS_UNCONNECTED) { lws_pt_unlock(pt); - if (!lws_client_connect_via_info2(wsi)) { + if (!lws_http_client_connect_via_info2(wsi)) { /* our client connect has failed, the wsi * has been closed */ @@ -397,7 +400,8 @@ int __lws_header_table_detach(struct lws *wsi, int autoservice) } #endif - assert(!!pt->http.ah_wait_list_length == !!(lws_intptr_t)pt->http.ah_wait_list); + assert(!!pt->http.ah_wait_list_length == + !!(lws_intptr_t)pt->http.ah_wait_list); bail: lwsl_info("%s: wsi %p: ah %p (tsi=%d, count = %d)\n", __func__, (void *)wsi, (void *)ah, pt->tid, pt->http.ah_count_in_use); @@ -459,6 +463,10 @@ LWS_VISIBLE int lws_hdr_total_length(struct lws *wsi, enum lws_token_indexes h) do { len += wsi->http.ah->frags[n].len; n = wsi->http.ah->frags[n].nfrag; + + if (n && h != WSI_TOKEN_HTTP_COOKIE) + ++len; + } while (n); return len; @@ -500,6 +508,11 @@ LWS_VISIBLE int lws_hdr_copy(struct lws *wsi, char *dst, int len, { int toklen = lws_hdr_total_length(wsi, h); int n; + int comma; + + *dst = '\0'; + if (!toklen) + return 0; if (toklen >= len) return -1; @@ -512,13 +525,20 @@ LWS_VISIBLE int lws_hdr_copy(struct lws *wsi, char *dst, int len, return 0; do { - if (wsi->http.ah->frags[n].len >= len) + comma = (wsi->http.ah->frags[n].nfrag && + h != WSI_TOKEN_HTTP_COOKIE) ? 1 : 0; + + if (wsi->http.ah->frags[n].len + comma >= len) return -1; strncpy(dst, &wsi->http.ah->data[wsi->http.ah->frags[n].offset], wsi->http.ah->frags[n].len); dst += wsi->http.ah->frags[n].len; len -= wsi->http.ah->frags[n].len; n = wsi->http.ah->frags[n].nfrag; + + if (comma) + *dst++ = ','; + } while (n); *dst = '\0'; @@ -529,6 +549,9 @@ char *lws_hdr_simple_ptr(struct lws *wsi, enum lws_token_indexes h) { int n; + if (!wsi->http.ah) + return NULL; + n = wsi->http.ah->frag_index[h]; if (!n) return NULL; @@ -539,6 +562,9 @@ char *lws_hdr_simple_ptr(struct lws *wsi, enum lws_token_indexes h) static int LWS_WARN_UNUSED_RESULT lws_pos_in_bounds(struct lws *wsi) { + if (!wsi->http.ah) + return -1; + if (wsi->http.ah->pos < (unsigned int)wsi->context->max_http_header_data) return 0; @@ -599,7 +625,8 @@ issue_char(struct lws *wsi, unsigned char c) * If we haven't hit the token limit, just copy the character into * the header */ - if (frag_len < wsi->http.ah->current_token_limit) { + if (!wsi->http.ah->current_token_limit || + frag_len < wsi->http.ah->current_token_limit) { wsi->http.ah->data[wsi->http.ah->pos++] = c; if (c) wsi->http.ah->frags[wsi->http.ah->nfrag].len++; @@ -868,8 +895,9 @@ lws_parse(struct lws *wsi, unsigned char *buf, int *len) if (ah->ups == URIPS_SEEN_SLASH_DOT_DOT) { /* * back up one dir level if possible - * safe against header fragmentation because - * the method URI can only be in 1 fragment + * safe against header fragmentation + * because the method URI can only be + * in 1 fragment */ if (ah->frags[ah->nfrag].len > 2) { ah->pos--; @@ -939,7 +967,8 @@ swallow: pos = ah->lextable_pos; while (1) { - if (lextable[pos] & (1 << 7)) { /* 1-byte, fail on mismatch */ + if (lextable[pos] & (1 << 7)) { + /* 1-byte, fail on mismatch */ if ((lextable[pos] & 0x7f) != c) { nope: ah->lextable_pos = -1; @@ -958,14 +987,15 @@ nope: goto nope; /* b7 = 0, end or 3-byte */ - if (lextable[pos] < FAIL_CHAR) { /* terminal marker */ + if (lextable[pos] < FAIL_CHAR) { /* term mark */ ah->lextable_pos = pos; break; } if (lextable[pos] == c) { /* goto */ - ah->lextable_pos = pos + (lextable[pos + 1]) + - (lextable[pos + 2] << 8); + ah->lextable_pos = pos + + (lextable[pos + 1]) + + (lextable[pos + 2] << 8); break; } @@ -1038,13 +1068,13 @@ nope: n = WSI_TOKEN_ORIGIN; ah->parser_state = (enum lws_token_indexes) - (WSI_TOKEN_GET_URI + n); + (WSI_TOKEN_GET_URI + n); ah->ups = URIPS_IDLE; if (context->token_limits) ah->current_token_limit = context-> - token_limits->token_limit[ - ah->parser_state]; + token_limits->token_limit[ + ah->parser_state]; else ah->current_token_limit = wsi->context->max_http_header_data; @@ -1116,6 +1146,7 @@ excessive: set_parsing_complete: if (ah->ues != URIES_IDLE) goto forbid; + if (lws_hdr_total_length(wsi, WSI_TOKEN_UPGRADE)) { if (lws_hdr_total_length(wsi, WSI_TOKEN_VERSION)) wsi->rx_frame_type = /* temp for ws version index */ diff --git a/thirdparty/libwebsockets/roles/http/server/server.c b/thirdparty/libwebsockets/lib/roles/http/server/server.c index abd86dc9b5..729315602c 100644 --- a/thirdparty/libwebsockets/roles/http/server/server.c +++ b/thirdparty/libwebsockets/lib/roles/http/server/server.c @@ -28,6 +28,8 @@ const char * const method_names[] = { #endif }; +static const char * const intermediates[] = { "private", "public" }; + /* * return 0: all done * 1: nonfatal error @@ -38,7 +40,7 @@ const char * const method_names[] = { int _lws_vhost_init_server(const struct lws_context_creation_info *info, - struct lws_vhost *vhost) + struct lws_vhost *vhost) { int n, opt = 1, limit = 1; lws_sockfd_type sockfd; @@ -81,15 +83,22 @@ _lws_vhost_init_server(const struct lws_context_creation_info *info, * let's check before we do anything else about the disposition * of the interface he wants to bind to... */ - is = lws_socket_bind(vhost, LWS_SOCK_INVALID, vhost->listen_port, vhost->iface); + is = lws_socket_bind(vhost, LWS_SOCK_INVALID, vhost->listen_port, + vhost->iface); lwsl_debug("initial if check says %d\n", is); + + if (is == LWS_ITOSA_BUSY) + /* treat as fatal */ + return -1; + deal: lws_start_foreach_llp(struct lws_vhost **, pv, vhost->context->no_listener_vhost_list) { if (is >= LWS_ITOSA_USABLE && *pv == vhost) { /* on the list and shouldn't be: remove it */ - lwsl_debug("deferred iface: removing vh %s\n", (*pv)->name); + lwsl_debug("deferred iface: removing vh %s\n", + (*pv)->name); *pv = vhost->no_listener_vhost_list; vhost->no_listener_vhost_list = NULL; goto done_list; @@ -105,7 +114,8 @@ deal: /* ... but needs to be: so add it */ lwsl_debug("deferred iface: adding vh %s\n", vhost->name); - vhost->no_listener_vhost_list = vhost->context->no_listener_vhost_list; + vhost->no_listener_vhost_list = + vhost->context->no_listener_vhost_list; vhost->context->no_listener_vhost_list = vhost; } @@ -221,9 +231,16 @@ done_list: } #endif #endif - lws_plat_set_socket_options(vhost, sockfd); + lws_plat_set_socket_options(vhost, sockfd, 0); is = lws_socket_bind(vhost, sockfd, vhost->listen_port, vhost->iface); + if (is == LWS_ITOSA_BUSY) { + /* treat as fatal */ + compatible_close(sockfd); + + return -1; + } + /* * There is a race where the network device may come up and then * go away and fail here. So correctly handle unexpected failure @@ -234,21 +251,29 @@ done_list: compatible_close(sockfd); goto deal; } - vhost->listen_port = is; - - lwsl_debug("%s: lws_socket_bind says %d\n", __func__, is); wsi = lws_zalloc(sizeof(struct lws), "listen wsi"); if (wsi == NULL) { lwsl_err("Out of mem\n"); goto bail; } + +#ifdef LWS_WITH_UNIX_SOCK + if (!LWS_UNIX_SOCK_ENABLED(vhost)) +#endif + { + wsi->unix_skt = 1; + vhost->listen_port = is; + + lwsl_debug("%s: lws_socket_bind says %d\n", __func__, is); + } + wsi->context = vhost->context; wsi->desc.sockfd = sockfd; lws_role_transition(wsi, 0, LRS_UNCONNECTED, &role_ops_listen); wsi->protocol = vhost->protocols; wsi->tsi = m; - wsi->vhost = vhost; + lws_vhost_bind_wsi(vhost, wsi); wsi->listener = 1; if (wsi->context->event_loop_ops->init_vhost_listen_wsi) @@ -296,7 +321,7 @@ lws_select_vhost(struct lws_context *context, int port, const char *servername) { struct lws_vhost *vhost = context->vhost_list; const char *p; - int n, m, colon; + int n, colon; n = (int)strlen(servername); colon = n; @@ -324,8 +349,8 @@ lws_select_vhost(struct lws_context *context, int port, const char *servername) */ vhost = context->vhost_list; while (vhost) { - m = (int)strlen(vhost->name); - if (port == vhost->listen_port && + int m = (int)strlen(vhost->name); + if (port && port == vhost->listen_port && m <= (colon - 2) && servername[colon - m - 1] == '.' && !strncmp(vhost->name, servername + colon - m, m)) { @@ -340,7 +365,7 @@ lws_select_vhost(struct lws_context *context, int port, const char *servername) vhost = context->vhost_list; while (vhost) { - if (port == vhost->listen_port) { + if (port && port == vhost->listen_port) { lwsl_info("%s: vhost match to %s based on port %d\n", __func__, vhost->name, port); return vhost; @@ -356,8 +381,8 @@ lws_select_vhost(struct lws_context *context, int port, const char *servername) LWS_VISIBLE LWS_EXTERN const char * lws_get_mimetype(const char *file, const struct lws_http_mount *m) { - int n = (int)strlen(file); const struct lws_protocol_vhost_options *pvo = NULL; + int n = (int)strlen(file); if (m) pvo = m->extra_mimetypes; @@ -457,7 +482,7 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, #endif int spin = 0; #endif - char path[256], sym[512]; + char path[256], sym[2048]; unsigned char *p = (unsigned char *)sym + 32 + LWS_PRE, *start = p; unsigned char *end = p + sizeof(sym) - 32 - LWS_PRE; #if !defined(WIN32) && !defined(LWS_WITH_ESP32) @@ -494,7 +519,7 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, lwsl_info("%s: Unable to open '%s': errno %d\n", __func__, path, errno); - return -1; + return 1; } /* if it can't be statted, don't try */ @@ -506,18 +531,18 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, #if !defined(WIN32) if (fstat(wsi->http.fop_fd->fd, &st)) { lwsl_info("unable to stat %s\n", path); - goto bail; + goto notfound; } #else #if defined(LWS_HAVE__STAT32I64) if (_stat32i64(path, &st)) { lwsl_info("unable to stat %s\n", path); - goto bail; + goto notfound; } #else if (stat(path, &st)) { lwsl_info("unable to stat %s\n", path); - goto bail; + goto notfound; } #endif #endif @@ -530,7 +555,7 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, len = readlink(path, sym, sizeof(sym) - 1); if (len) { lwsl_err("Failed to read link %s\n", path); - goto bail; + goto notfound; } sym[len] = '\0'; lwsl_debug("symlink %s -> %s\n", path, sym); @@ -567,19 +592,48 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, if (!strcmp(sym, lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_IF_NONE_MATCH))) { + char cache_control[50], *cc = "no-store"; + int cclen = 8; + lwsl_debug("%s: ETAG match %s %s\n", __func__, uri, origin); /* we don't need to send the payload */ if (lws_add_http_header_status(wsi, - HTTP_STATUS_NOT_MODIFIED, &p, end)) + HTTP_STATUS_NOT_MODIFIED, &p, end)) { + lwsl_err("%s: failed adding not modified\n", + __func__); return -1; + } if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_ETAG, (unsigned char *)sym, n, &p, end)) return -1; + /* but we still need to send cache control... */ + + if (m->cache_max_age && m->cache_reusable) { + if (!m->cache_revalidate) { + cc = cache_control; + cclen = sprintf(cache_control, + "%s, max-age=%u", + intermediates[wsi->cache_intermediaries], + m->cache_max_age); + } else { + cc = cache_control; + cclen = sprintf(cache_control, + "must-revalidate, %s, max-age=%u", + intermediates[wsi->cache_intermediaries], + m->cache_max_age); + } + } + + if (lws_add_http_header_by_token(wsi, + WSI_TOKEN_HTTP_CACHE_CONTROL, + (unsigned char *)cc, cclen, &p, end)) + return -1; + if (lws_finalize_http_header(wsi, &p, end)) return -1; @@ -594,7 +648,10 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, lws_vfs_file_close(&wsi->http.fop_fd); - return lws_http_transaction_completed(wsi); + if (lws_http_transaction_completed(wsi)) + return -1; + + return 0; } } @@ -605,8 +662,13 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, mimetype = lws_get_mimetype(path, m); if (!mimetype) { - lwsl_err("unknown mimetype for %s\n", path); - goto bail; + lwsl_info("unknown mimetype for %s\n", path); + if (lws_return_http_status(wsi, + HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE, NULL) || + lws_http_transaction_completed(wsi)) + return -1; + + return 0; } if (!mimetype[0]) lwsl_debug("sending no mimetype for %s\n", path); @@ -642,8 +704,8 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, const struct lws_protocols *pp = lws_vhost_name_to_protocol( wsi->vhost, m->protocol); - if (lws_bind_protocol(wsi, pp)) - return 1; + if (lws_bind_protocol(wsi, pp, __func__)) + return -1; args.p = (char *)p; args.max_len = lws_ptr_diff(end, p); if (pp->callback(wsi, LWS_CALLBACK_ADD_HEADERS, @@ -652,6 +714,7 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, p = (unsigned char *)args.p; } + *p = '\0'; n = lws_serve_http_file(wsi, path, mimetype, (char *)start, lws_ptr_diff(p, start)); @@ -659,9 +722,10 @@ lws_http_serve(struct lws *wsi, char *uri, const char *origin, return -1; /* error or can't reuse connection: close the socket */ return 0; -bail: - return -1; +notfound: + + return 1; } #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) @@ -749,7 +813,7 @@ lws_unauthorised_basic_auth(struct lws *wsi) { struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; unsigned char *start = pt->serv_buf + LWS_PRE, - *p = start, *end = p + 512; + *p = start, *end = p + 2048; char buf[64]; int n; @@ -848,24 +912,25 @@ lws_http_get_uri_and_method(struct lws *wsi, char **puri_ptr, int *puri_len) return -1; } +static const char * const oprot[] = { + "http://", "https://" +}; + int lws_http_action(struct lws *wsi) { struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; - enum http_connection_type connection_type; + const struct lws_http_mount *hit = NULL; enum http_version request_version; - char content_length_str[32]; struct lws_process_html_args args; - const struct lws_http_mount *hit = NULL; - unsigned int n; - char http_version_str[10]; - char http_conn_str[20]; - int http_version_len; + enum http_conn_type conn_type; + char content_length_str[32]; + char http_version_str[12]; char *uri_ptr = NULL, *s; - int uri_len = 0, meth; - static const char * const oprot[] = { - "http://", "https://" - }; + int uri_len = 0, meth, m; + char http_conn_str[25]; + int http_version_len; + unsigned int n; meth = lws_http_get_uri_and_method(wsi, &uri_ptr, &uri_len); if (meth < 0 || meth >= (int)LWS_ARRAY_SIZE(method_names)) @@ -898,16 +963,21 @@ lws_http_action(struct lws *wsi) /* HTTP header had a content length? */ wsi->http.rx_content_length = 0; + wsi->http.content_length_explicitly_zero = 0; if (lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI) || - lws_hdr_total_length(wsi, WSI_TOKEN_PATCH_URI) || - lws_hdr_total_length(wsi, WSI_TOKEN_PUT_URI)) + lws_hdr_total_length(wsi, WSI_TOKEN_PATCH_URI) || + lws_hdr_total_length(wsi, WSI_TOKEN_PUT_URI)) wsi->http.rx_content_length = 100 * 1024 * 1024; - if (lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH)) { - lws_hdr_copy(wsi, content_length_str, - sizeof(content_length_str) - 1, - WSI_TOKEN_HTTP_CONTENT_LENGTH); + if (lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH) && + lws_hdr_copy(wsi, content_length_str, + sizeof(content_length_str) - 1, + WSI_TOKEN_HTTP_CONTENT_LENGTH) > 0) { wsi->http.rx_content_length = atoll(content_length_str); + if (!wsi->http.rx_content_length) { + wsi->http.content_length_explicitly_zero = 1; + lwsl_debug("%s: explicit 0 content-length\n", __func__); + } } if (wsi->http2_substream) { @@ -918,35 +988,33 @@ lws_http_action(struct lws *wsi) /* Works for single digit HTTP versions. : */ http_version_len = lws_hdr_total_length(wsi, WSI_TOKEN_HTTP); - if (http_version_len > 7) { - lws_hdr_copy(wsi, http_version_str, - sizeof(http_version_str) - 1, - WSI_TOKEN_HTTP); - if (http_version_str[5] == '1' && - http_version_str[7] == '1') - request_version = HTTP_VERSION_1_1; - } + if (http_version_len > 7 && + lws_hdr_copy(wsi, http_version_str, + sizeof(http_version_str) - 1, + WSI_TOKEN_HTTP) > 0 && + http_version_str[5] == '1' && http_version_str[7] == '1') + request_version = HTTP_VERSION_1_1; + wsi->http.request_version = request_version; /* HTTP/1.1 defaults to "keep-alive", 1.0 to "close" */ if (request_version == HTTP_VERSION_1_1) - connection_type = HTTP_CONNECTION_KEEP_ALIVE; + conn_type = HTTP_CONNECTION_KEEP_ALIVE; else - connection_type = HTTP_CONNECTION_CLOSE; + conn_type = HTTP_CONNECTION_CLOSE; /* Override default if http "Connection:" header: */ - if (lws_hdr_total_length(wsi, WSI_TOKEN_CONNECTION)) { - lws_hdr_copy(wsi, http_conn_str, - sizeof(http_conn_str) - 1, - WSI_TOKEN_CONNECTION); + if (lws_hdr_total_length(wsi, WSI_TOKEN_CONNECTION) && + lws_hdr_copy(wsi, http_conn_str, sizeof(http_conn_str) - 1, + WSI_TOKEN_CONNECTION) > 0) { http_conn_str[sizeof(http_conn_str) - 1] = '\0'; if (!strcasecmp(http_conn_str, "keep-alive")) - connection_type = HTTP_CONNECTION_KEEP_ALIVE; + conn_type = HTTP_CONNECTION_KEEP_ALIVE; else if (!strcasecmp(http_conn_str, "close")) - connection_type = HTTP_CONNECTION_CLOSE; + conn_type = HTTP_CONNECTION_CLOSE; } - wsi->http.connection_type = connection_type; + wsi->http.conn_type = conn_type; } n = wsi->protocol->callback(wsi, LWS_CALLBACK_FILTER_HTTP_CONNECTION, @@ -970,7 +1038,7 @@ lws_http_action(struct lws *wsi) * URI from the host: header and ignore the path part */ unsigned char *start = pt->serv_buf + LWS_PRE, *p = start, - *end = p + 512; + *end = p + wsi->context->pt_serv_buf_size - LWS_PRE; if (!lws_hdr_total_length(wsi, WSI_TOKEN_HOST)) goto bail_nuke_ah; @@ -988,7 +1056,7 @@ lws_http_action(struct lws *wsi) #endif #ifdef LWS_WITH_ACCESS_LOG - lws_prepare_access_log_info(wsi, uri_ptr, meth); + lws_prepare_access_log_info(wsi, uri_ptr, uri_len, meth); #endif /* can we serve it from the mount list? */ @@ -999,12 +1067,13 @@ lws_http_action(struct lws *wsi) lwsl_info("no hit\n"); - if (lws_bind_protocol(wsi, &wsi->vhost->protocols[0])) + if (lws_bind_protocol(wsi, &wsi->vhost->protocols[0], + "no mount hit")) return 1; lwsi_set_state(wsi, LRS_DOING_TRANSACTION); - n = wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP, + m = wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP, wsi->user_space, uri_ptr, uri_len); goto after; @@ -1035,10 +1104,11 @@ lws_http_action(struct lws *wsi) hit->origin_protocol == LWSMPRO_REDIR_HTTPS)) && (hit->origin_protocol != LWSMPRO_CGI && hit->origin_protocol != LWSMPRO_CALLBACK)) { - unsigned char *start = pt->serv_buf + LWS_PRE, - *p = start, *end = p + 512; + unsigned char *start = pt->serv_buf + LWS_PRE, *p = start, + *end = p + wsi->context->pt_serv_buf_size - + LWS_PRE - 512; - lwsl_debug("Doing 301 '%s' org %s\n", s, hit->origin); + lwsl_info("Doing 301 '%s' org %s\n", s, hit->origin); /* > at start indicates deal with by redirect */ if (hit->origin_protocol == LWSMPRO_REDIR_HTTP || @@ -1075,12 +1145,21 @@ lws_http_action(struct lws *wsi) /* basic auth? */ if (hit->basic_auth_login_file) { - char b64[160], plain[(sizeof(b64) * 3) / 4]; - int m; + char b64[160], plain[(sizeof(b64) * 3) / 4], *pcolon; + int m, ml, fi; /* Did he send auth? */ - if (!lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_AUTHORIZATION)) + ml = lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_AUTHORIZATION); + if (!ml) + return lws_unauthorised_basic_auth(wsi); + + /* Disallow fragmentation monkey business */ + + fi = wsi->http.ah->frag_index[WSI_TOKEN_HTTP_AUTHORIZATION]; + if (wsi->http.ah->frags[fi].nfrag) { + lwsl_err("fragmented basic auth header not allowed\n"); return lws_unauthorised_basic_auth(wsi); + } n = HTTP_STATUS_FORBIDDEN; @@ -1099,21 +1178,36 @@ lws_http_action(struct lws *wsi) /* It'll be like Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l */ - m = lws_b64_decode_string(b64 + 6, plain, sizeof(plain)); + m = lws_b64_decode_string(b64 + 6, plain, sizeof(plain) - 1); if (m < 0) { lwsl_err("plain auth too long\n"); goto transaction_result_n; } + plain[m] = '\0'; + pcolon = strchr(plain, ':'); + if (!pcolon) { + lwsl_err("basic auth format broken\n"); + return lws_unauthorised_basic_auth(wsi); + } if (!lws_find_string_in_file(hit->basic_auth_login_file, plain, m)) { lwsl_err("basic auth lookup failed\n"); return lws_unauthorised_basic_auth(wsi); } - lwsl_info("basic auth accepted\n"); + /* + * Rewrite WSI_TOKEN_HTTP_AUTHORIZATION so it is just the + * authorized username + */ - /* accept the auth */ + *pcolon = '\0'; + wsi->http.ah->frags[fi].len = lws_ptr_diff(pcolon, plain); + pcolon = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_AUTHORIZATION); + strncpy(pcolon, plain, ml - 1); + pcolon[ml - 1] = '\0'; + lwsl_info("%s: basic auth accepted for %s\n", __func__, + lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_AUTHORIZATION)); } #if defined(LWS_WITH_HTTP_PROXY) @@ -1121,15 +1215,21 @@ lws_http_action(struct lws *wsi) * The mount is a reverse proxy? */ + // lwsl_notice("%s: origin_protocol: %d\n", __func__, hit->origin_protocol); + if (hit->origin_protocol == LWSMPRO_HTTPS || hit->origin_protocol == LWSMPRO_HTTP) { + char ads[96], rpath[256], *pcolon, *pslash, unix_skt = 0; struct lws_client_connect_info i; - char ads[96], rpath[256], *pcolon, *pslash, *p; + struct lws *cwsi; int n, na; memset(&i, 0, sizeof(i)); i.context = lws_get_context(wsi); + if (hit->origin[0] == '+') + unix_skt = 1; + pcolon = strchr(hit->origin, ':'); pslash = strchr(hit->origin, '/'); if (!pslash) { @@ -1137,16 +1237,28 @@ lws_http_action(struct lws *wsi) hit->origin); return -1; } - if (pcolon > pslash) - pcolon = NULL; - if (pcolon) - n = pcolon - hit->origin; - else - n = pslash - hit->origin; + if (unix_skt) { + if (!pcolon) { + lwsl_err("Proxy mount origin for unix skt must " + "have address delimited by :\n"); + + return -1; + } + n = lws_ptr_diff(pcolon, hit->origin); + pslash = pcolon; + } else { + if (pcolon > pslash) + pcolon = NULL; + + if (pcolon) + n = (int)(pcolon - hit->origin); + else + n = (int)(pslash - hit->origin); - if (n >= (int)sizeof(ads) - 2) - n = sizeof(ads) - 2; + if (n >= (int)sizeof(ads) - 2) + n = sizeof(ads) - 2; + } memcpy(ads, hit->origin, n); ads[n] = '\0'; @@ -1160,41 +1272,75 @@ lws_http_action(struct lws *wsi) if (pcolon) i.port = atoi(pcolon + 1); - lws_snprintf(rpath, sizeof(rpath) - 1, "/%s/%s", pslash + 1, - uri_ptr + hit->mountpoint_len); + n = lws_snprintf(rpath, sizeof(rpath) - 1, "/%s/%s", + pslash + 1, uri_ptr + hit->mountpoint_len) - 2; lws_clean_url(rpath); na = lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_URI_ARGS); if (na) { - p = rpath + strlen(rpath); - *p++ = '?'; - lws_hdr_copy(wsi, p, &rpath[sizeof(rpath) - 1] - p, - WSI_TOKEN_HTTP_URI_ARGS); - while (--na) { - if (*p == '\0') - *p = '&'; - p++; + char *p = rpath + n; + + if (na >= (int)sizeof(rpath) - n - 2) { + lwsl_info("%s: query string %d longer " + "than we can handle\n", __func__, + na); + + return -1; } - } + *p++ = '?'; + if (lws_hdr_copy(wsi, p, + (int)(&rpath[sizeof(rpath) - 1] - p), + WSI_TOKEN_HTTP_URI_ARGS) > 0) + while (na--) { + if (*p == '\0') + *p = '&'; + p++; + } + *p = '\0'; + } i.path = rpath; - i.host = i.address; + if (i.address[0] != '+' || + !lws_hdr_simple_ptr(wsi, WSI_TOKEN_HOST)) + i.host = i.address; + else + i.host = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HOST); i.origin = NULL; i.method = "GET"; + i.alpn = "http/1.1"; i.parent_wsi = wsi; - i.uri_replace_from = hit->origin; - i.uri_replace_to = hit->mountpoint; + i.pwsi = &cwsi; + + // i.uri_replace_from = hit->origin; + // i.uri_replace_to = hit->mountpoint; - lwsl_notice("proxying to %s port %d url %s, ssl %d, " + lwsl_info("proxying to %s port %d url %s, ssl %d, " "from %s, to %s\n", i.address, i.port, i.path, i.ssl_connection, i.uri_replace_from, i.uri_replace_to); if (!lws_client_connect_via_info(&i)) { lwsl_err("proxy connect fail\n"); + + /* + * ... we can't do the proxy action, but we can + * cleanly return him a 503 and a description + */ + + lws_return_http_status(wsi, + HTTP_STATUS_SERVICE_UNAVAILABLE, + "<h1>Service Temporarily Unavailable</h1>" + "The server is temporarily unable to service " + "your request due to maintenance downtime or " + "capacity problems. Please try again later."); + return 1; } + lwsl_info("%s: setting proxy clientside on %p (parent %p)\n", + __func__, cwsi, lws_get_parent(cwsi)); + cwsi->http.proxy_clientside = 1; + return 0; } #endif @@ -1219,7 +1365,7 @@ lws_http_action(struct lws *wsi) return 1; } - if (lws_bind_protocol(wsi, pp)) + if (lws_bind_protocol(wsi, pp, "http action CALLBACK bind")) return 1; args.p = uri_ptr; @@ -1245,7 +1391,7 @@ lws_http_action(struct lws *wsi) return 1; if (lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI)) { - n = wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP, + m = wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP, wsi->user_space, uri_ptr + hit->mountpoint_len, uri_len - hit->mountpoint_len); @@ -1279,7 +1425,7 @@ lws_http_action(struct lws *wsi) } #endif - n = (int)strlen(s); + n = uri_len - lws_ptr_diff(s, uri_ptr); // (int)strlen(s); if (s[0] == '\0' || (n == 1 && s[n - 1] == '/')) s = (char *)hit->def; if (!s) @@ -1290,10 +1436,11 @@ lws_http_action(struct lws *wsi) wsi->cache_revalidate = hit->cache_revalidate; wsi->cache_intermediaries = hit->cache_intermediaries; - n = 1; + m = 1; if (hit->origin_protocol == LWSMPRO_FILE) - n = lws_http_serve(wsi, s, hit->origin, hit); - if (n) { + m = lws_http_serve(wsi, s, hit->origin, hit); + + if (m > 0) { /* * lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL); */ @@ -1302,20 +1449,22 @@ lws_http_action(struct lws *wsi) lws_vhost_name_to_protocol( wsi->vhost, hit->protocol); - if (lws_bind_protocol(wsi, pp)) + lwsi_set_state(wsi, LRS_DOING_TRANSACTION); + + if (lws_bind_protocol(wsi, pp, "http_action HTTP")) return 1; - n = pp->callback(wsi, LWS_CALLBACK_HTTP, + m = pp->callback(wsi, LWS_CALLBACK_HTTP, wsi->user_space, uri_ptr + hit->mountpoint_len, uri_len - hit->mountpoint_len); } else - n = wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP, + m = wsi->protocol->callback(wsi, LWS_CALLBACK_HTTP, wsi->user_space, uri_ptr, uri_len); } after: - if (n) { + if (m) { lwsl_info("LWS_CALLBACK_HTTP closing\n"); return 1; @@ -1337,9 +1486,35 @@ deal_body: lwsl_debug("wsi->http.rx_content_length %lld %d %d\n", (long long)wsi->http.rx_content_length, wsi->upgraded_to_http2, wsi->http2_substream); + + if (wsi->http.content_length_explicitly_zero && + lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI)) { + + /* + * POST with an explicit content-length of zero + * + * If we don't give the user code the empty HTTP_BODY + * callback, he may become confused to hear the + * HTTP_BODY_COMPLETION (due to, eg, instantiation of + * lws_spa never happened). + * + * HTTP_BODY_COMPLETION is responsible for sending the + * result status code and result body if any, and + * do the transaction complete processing. + */ + if (wsi->protocol->callback(wsi, + LWS_CALLBACK_HTTP_BODY, + wsi->user_space, NULL, 0)) + return 1; + if (wsi->protocol->callback(wsi, + LWS_CALLBACK_HTTP_BODY_COMPLETION, + wsi->user_space, NULL, 0)) + return 1; + + return 0; + } + if (wsi->http.rx_content_length > 0) { - struct lws_tokens ebuf; - int m; lwsi_set_state(wsi, LRS_BODY); lwsl_info("%s: %p: LRS_BODY state set (0x%x)\n", @@ -1355,12 +1530,18 @@ deal_body: */ while (1) { + struct lws_tokens ebuf; + int m; + ebuf.len = (int)lws_buflist_next_segment_len( - &wsi->buflist, (uint8_t **)&ebuf.token); + &wsi->buflist, + (uint8_t **)&ebuf.token); if (!ebuf.len) break; - lwsl_notice("%s: consuming %d\n", __func__, (int)ebuf.len); - m = lws_read_h1(wsi, (uint8_t *)ebuf.token, ebuf.len); + lwsl_notice("%s: consuming %d\n", __func__, + (int)ebuf.len); + m = lws_read_h1(wsi, (uint8_t *)ebuf.token, + ebuf.len); if (m < 0) return -1; @@ -1384,6 +1565,75 @@ transaction_result_n: } int +lws_confirm_host_header(struct lws *wsi) +{ + struct lws_tokenize ts; + lws_tokenize_elem e; + char buf[128]; + int port = 80; + + /* + * this vhost wants us to validate what the + * client sent against our vhost name + */ + + if (!lws_hdr_total_length(wsi, WSI_TOKEN_HOST)) { + lwsl_info("%s: missing host on upgrade\n", __func__); + + return 1; + } + +#if defined(LWS_WITH_TLS) + if (wsi->tls.ssl) + port = 443; +#endif + + lws_tokenize_init(&ts, buf, LWS_TOKENIZE_F_DOT_NONTERM /* server.com */| + LWS_TOKENIZE_F_NO_FLOATS /* 1.server.com */| + LWS_TOKENIZE_F_MINUS_NONTERM /* a-b.com */); + ts.len = lws_hdr_copy(wsi, buf, sizeof(buf) - 1, WSI_TOKEN_HOST); + if (ts.len <= 0) { + lwsl_info("%s: missing or oversize host header\n", __func__); + return 1; + } + + if (lws_tokenize(&ts) != LWS_TOKZE_TOKEN) + goto bad_format; + + if (strncmp(ts.token, wsi->vhost->name, ts.token_len)) { + buf[(ts.token - buf) + ts.token_len] = '\0'; + lwsl_info("%s: '%s' in host hdr but vhost name %s\n", + __func__, ts.token, wsi->vhost->name); + return 1; + } + + e = lws_tokenize(&ts); + if (e == LWS_TOKZE_DELIMITER && ts.token[0] == ':') { + if (lws_tokenize(&ts) != LWS_TOKZE_INTEGER) + goto bad_format; + else + port = atoi(ts.token); + } else + if (e != LWS_TOKZE_ENDED) + goto bad_format; + + if (wsi->vhost->listen_port != port) { + lwsl_info("%s: host port %d mismatches vhost port %d\n", + __func__, port, wsi->vhost->listen_port); + return 1; + } + + lwsl_debug("%s: host header OK\n", __func__); + + return 0; + +bad_format: + lwsl_info("%s: bad host header format\n", __func__); + + return 1; +} + +int lws_handshake_server(struct lws *wsi, unsigned char **buf, size_t len) { struct lws_context *context = lws_get_context(wsi); @@ -1427,7 +1677,8 @@ raw_transition: lws_set_timeout(wsi, NO_PENDING_TIMEOUT, 0); lws_bind_protocol(wsi, &wsi->vhost->protocols[ wsi->vhost-> - raw_protocol_index]); + raw_protocol_index], + __func__); lwsl_info("transition to raw vh %s prot %d\n", wsi->vhost->name, wsi->vhost->raw_protocol_index); @@ -1440,7 +1691,7 @@ raw_transition: &role_ops_raw_skt); lws_header_table_detach(wsi, 1); - if (m == 2 && (wsi->protocol->callback)(wsi, + if (wsi->protocol->callback(wsi, LWS_CALLBACK_RAW_RX, wsi->user_space, obuf, olen)) return 1; @@ -1458,13 +1709,14 @@ raw_transition: /* select vhost */ - if (lws_hdr_total_length(wsi, WSI_TOKEN_HOST)) { + if (wsi->vhost->listen_port && + lws_hdr_total_length(wsi, WSI_TOKEN_HOST)) { struct lws_vhost *vhost = lws_select_vhost( context, wsi->vhost->listen_port, lws_hdr_simple_ptr(wsi, WSI_TOKEN_HOST)); if (vhost) - wsi->vhost = vhost; + lws_vhost_bind_wsi(vhost, wsi); } else lwsl_info("no host\n"); @@ -1506,7 +1758,7 @@ raw_transition: &uri_ptr, &uri_len); if (meth >= 0) lws_prepare_access_log_info(wsi, - uri_ptr, meth); + uri_ptr, uri_len, meth); /* wsi close will do the log */ #endif @@ -1532,12 +1784,49 @@ raw_transition: lwsi_set_state(wsi, LRS_PRE_WS_SERVING_ACCEPT); lws_set_timeout(wsi, NO_PENDING_TIMEOUT, 0); - /* is this websocket protocol or normal http 1.0? */ - if (lws_hdr_total_length(wsi, WSI_TOKEN_UPGRADE)) { - if (!strcasecmp(lws_hdr_simple_ptr(wsi, - WSI_TOKEN_UPGRADE), - "websocket")) { + + const char *up = lws_hdr_simple_ptr(wsi, + WSI_TOKEN_UPGRADE); + + if (strcasecmp(up, "websocket") && + strcasecmp(up, "h2c")) { + lwsl_info("Unknown upgrade '%s'\n", up); + + if (lws_return_http_status(wsi, + HTTP_STATUS_FORBIDDEN, NULL) || + lws_http_transaction_completed(wsi)) + goto bail_nuke_ah; + } + + n = user_callback_handle_rxflow(wsi->protocol->callback, + wsi, LWS_CALLBACK_HTTP_CONFIRM_UPGRADE, + wsi->user_space, (char *)up, 0); + + /* just hang up? */ + + if (n < 0) + goto bail_nuke_ah; + + /* callback returned headers already, do t_c? */ + + if (n > 0) { + if (lws_http_transaction_completed(wsi)) + goto bail_nuke_ah; + + /* continue on */ + + return 0; + } + + /* callback said 0, it was allowed */ + + if (wsi->vhost->options & + LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK && + lws_confirm_host_header(wsi)) + goto bail_nuke_ah; + + if (!strcasecmp(up, "websocket")) { #if defined(LWS_ROLE_WS) wsi->vhost->conn_stats.ws_upg++; lwsl_info("Upgrade to ws\n"); @@ -1545,17 +1834,12 @@ raw_transition: #endif } #if defined(LWS_WITH_HTTP2) - if (!strcasecmp(lws_hdr_simple_ptr(wsi, - WSI_TOKEN_UPGRADE), - "h2c")) { + if (!strcasecmp(up, "h2c")) { wsi->vhost->conn_stats.h2_upg++; lwsl_info("Upgrade to h2c\n"); goto upgrade_h2c; } #endif - lwsl_info("Unknown upgrade\n"); - /* dunno what he wanted to upgrade to */ - goto bail_nuke_ah; } /* no upgrade ack... he remained as HTTP */ @@ -1565,6 +1849,10 @@ raw_transition: lwsi_set_state(wsi, LRS_ESTABLISHED); wsi->http.fop_fd = NULL; +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + lws_http_compression_validate(wsi); +#endif + lwsl_debug("%s: wsi %p: ah %p\n", __func__, (void *)wsi, (void *)wsi->http.ah); @@ -1641,91 +1929,17 @@ bail_nuke_ah: } -static int -lws_get_idlest_tsi(struct lws_context *context) -{ - unsigned int lowest = ~0; - int n = 0, hit = -1; - - for (; n < context->count_threads; n++) { - if ((unsigned int)context->pt[n].fds_count != - context->fd_limit_per_thread - 1 && - (unsigned int)context->pt[n].fds_count < lowest) { - lowest = context->pt[n].fds_count; - hit = n; - } - } - - return hit; -} - -struct lws * -lws_create_new_server_wsi(struct lws_vhost *vhost, int fixed_tsi) -{ - struct lws *new_wsi; - int n = fixed_tsi; - - if (n < 0) - n = lws_get_idlest_tsi(vhost->context); - - if (n < 0) { - lwsl_err("no space for new conn\n"); - return NULL; - } - - new_wsi = lws_zalloc(sizeof(struct lws), "new server wsi"); - if (new_wsi == NULL) { - lwsl_err("Out of memory for new connection\n"); - return NULL; - } - - new_wsi->tsi = n; - lwsl_debug("new wsi %p joining vhost %s, tsi %d\n", new_wsi, - vhost->name, new_wsi->tsi); - - new_wsi->vhost = vhost; - new_wsi->context = vhost->context; - new_wsi->pending_timeout = NO_PENDING_TIMEOUT; - new_wsi->rxflow_change_to = LWS_RXFLOW_ALLOW; - - /* initialize the instance struct */ - - lwsi_set_state(new_wsi, LRS_UNCONNECTED); - new_wsi->hdr_parsing_completed = 0; - -#ifdef LWS_WITH_TLS - new_wsi->tls.use_ssl = LWS_SSL_ENABLED(vhost); -#endif - - /* - * these can only be set once the protocol is known - * we set an un-established connection's protocol pointer - * to the start of the supported list, so it can look - * for matching ones during the handshake - */ - new_wsi->protocol = vhost->protocols; - new_wsi->user_space = NULL; - new_wsi->desc.sockfd = LWS_SOCK_INVALID; - new_wsi->position_in_fds_table = LWS_NO_FDS_POS; - - vhost->context->count_wsi_allocated++; - - /* - * outermost create notification for wsi - * no user_space because no protocol selection - */ - vhost->protocols[0].callback(new_wsi, LWS_CALLBACK_WSI_CREATE, - NULL, NULL, 0); - - return new_wsi; -} - LWS_VISIBLE int LWS_WARN_UNUSED_RESULT lws_http_transaction_completed(struct lws *wsi) { int n = NO_PENDING_TIMEOUT; - if (wsi->trunc_len) { + if (lws_has_buffered_out(wsi) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + || wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more +#endif + ) { /* * ...so he tried to send something large as the http reply, * it went as a partial, but he immediately said the @@ -1734,14 +1948,18 @@ lws_http_transaction_completed(struct lws *wsi) * Defer the transaction completed until the last part of the * partial is sent. */ - lwsl_notice("%s: deferring due to partial\n", __func__); + lwsl_debug("%s: %p: deferring due to partial\n", __func__, wsi); wsi->http.deferred_transaction_completed = 1; + lws_callback_on_writable(wsi); return 0; } lwsl_info("%s: wsi %p\n", __func__, wsi); +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + lws_http_compression_destroy(wsi); +#endif lws_access_log(wsi); if (!wsi->hdr_parsing_completed) { @@ -1755,17 +1973,17 @@ lws_http_transaction_completed(struct lws *wsi) /* if we can't go back to accept new headers, drop the connection */ if (wsi->http2_substream) - return 0; + return 1; if (wsi->seen_zero_length_recv) return 1; - if (wsi->http.connection_type != HTTP_CONNECTION_KEEP_ALIVE) { - lwsl_notice("%s: %p: close connection\n", __func__, wsi); + if (wsi->http.conn_type != HTTP_CONNECTION_KEEP_ALIVE) { + lwsl_info("%s: %p: close connection\n", __func__, wsi); return 1; } - if (lws_bind_protocol(wsi, &wsi->vhost->protocols[0])) + if (lws_bind_protocol(wsi, &wsi->vhost->protocols[0], __func__)) return 1; /* @@ -1780,6 +1998,7 @@ lws_http_transaction_completed(struct lws *wsi) wsi->http.tx_content_length = 0; wsi->http.tx_content_remain = 0; wsi->hdr_parsing_completed = 0; + wsi->sending_chunked = 0; #ifdef LWS_WITH_ACCESS_LOG wsi->http.access_log.sent = 0; #endif @@ -1803,7 +2022,7 @@ lws_http_transaction_completed(struct lws *wsi) if (wsi->http.ah) { // lws_buflist_describe(&wsi->buflist, wsi); if (!lws_buflist_next_segment_len(&wsi->buflist, NULL)) { - lwsl_info("%s: %p: nothing in buflist so detaching ah\n", + lwsl_debug("%s: %p: nothing in buflist, detaching ah\n", __func__, wsi); lws_header_table_detach(wsi, 1); #ifdef LWS_WITH_TLS @@ -1823,7 +2042,7 @@ lws_http_transaction_completed(struct lws *wsi) } #endif } else { - lwsl_info("%s: %p: resetting and keeping ah as pipeline\n", + lwsl_info("%s: %p: resetting/keeping ah as pipeline\n", __func__, wsi); lws_header_table_reset(wsi, 0); /* @@ -1839,360 +2058,41 @@ lws_http_transaction_completed(struct lws *wsi) if (wsi->http.ah) wsi->http.ah->ues = URIES_IDLE; - //lwsi_set_state(wsi, LRS_ESTABLISHED); + //lwsi_set_state(wsi, LRS_ESTABLISHED); // !!! } else if (lws_buflist_next_segment_len(&wsi->buflist, NULL)) if (lws_header_table_attach(wsi, 0)) lwsl_debug("acquired ah\n"); - lwsl_info("%s: %p: keep-alive await new transaction\n", __func__, wsi); + lwsl_debug("%s: %p: keep-alive await new transaction (state 0x%x)\n", + __func__, wsi, wsi->wsistate); lws_callback_on_writable(wsi); return 0; } -/* if not a socket, it's a raw, non-ssl file descriptor */ - -LWS_VISIBLE struct lws * -lws_adopt_descriptor_vhost(struct lws_vhost *vh, lws_adoption_type type, - lws_sock_file_fd_type fd, const char *vh_prot_name, - struct lws *parent) -{ - struct lws_context *context = vh->context; - struct lws *new_wsi; - struct lws_context_per_thread *pt; - int n, ssl = 0; - -#if defined(LWS_WITH_PEER_LIMITS) - struct lws_peer *peer = NULL; - - if (type & LWS_ADOPT_SOCKET && !(type & LWS_ADOPT_WS_PARENTIO)) { - peer = lws_get_or_create_peer(vh, fd.sockfd); - - if (peer && context->ip_limit_wsi && - peer->count_wsi >= context->ip_limit_wsi) { - lwsl_notice("Peer reached wsi limit %d\n", - context->ip_limit_wsi); - lws_stats_atomic_bump(context, &context->pt[0], - LWSSTATS_C_PEER_LIMIT_WSI_DENIED, 1); - return NULL; - } - } -#endif - - n = -1; - if (parent) - n = parent->tsi; - new_wsi = lws_create_new_server_wsi(vh, n); - if (!new_wsi) { - if (type & LWS_ADOPT_SOCKET && !(type & LWS_ADOPT_WS_PARENTIO)) - compatible_close(fd.sockfd); - return NULL; - } -#if defined(LWS_WITH_PEER_LIMITS) - if (peer) - lws_peer_add_wsi(context, peer, new_wsi); -#endif - pt = &context->pt[(int)new_wsi->tsi]; - lws_stats_atomic_bump(context, pt, LWSSTATS_C_CONNECTIONS, 1); - - if (parent) { - new_wsi->parent = parent; - new_wsi->sibling_list = parent->child_list; - parent->child_list = new_wsi; - - if (type & LWS_ADOPT_WS_PARENTIO) - new_wsi->parent_carries_io = 1; - } - - new_wsi->desc = fd; - - if (vh_prot_name) { - new_wsi->protocol = lws_vhost_name_to_protocol(new_wsi->vhost, - vh_prot_name); - if (!new_wsi->protocol) { - lwsl_err("Protocol %s not enabled on vhost %s\n", - vh_prot_name, new_wsi->vhost->name); - goto bail; - } - if (lws_ensure_user_space(new_wsi)) { - lwsl_notice("OOM trying to get user_space\n"); - goto bail; - } -#if defined(LWS_ROLE_WS) - if (type & LWS_ADOPT_WS_PARENTIO) { - new_wsi->desc.sockfd = LWS_SOCK_INVALID; - lwsl_debug("binding to %s\n", new_wsi->protocol->name); - lws_bind_protocol(new_wsi, new_wsi->protocol); - lws_role_transition(new_wsi, LWSIFR_SERVER, - LRS_ESTABLISHED, &role_ops_ws); - /* allocate the ws struct for the wsi */ - new_wsi->ws = lws_zalloc(sizeof(*new_wsi->ws), "ws struct"); - if (!new_wsi->ws) { - lwsl_notice("OOM\n"); - goto bail; - } - lws_server_init_wsi_for_ws(new_wsi); - - return new_wsi; - } -#endif - } else -#if defined(LWS_ROLE_H1) - if (type & LWS_ADOPT_HTTP) {/* he will transition later */ - new_wsi->protocol = - &vh->protocols[vh->default_protocol_index]; - new_wsi->role_ops = &role_ops_h1; - } - else -#endif - { /* this is the only time he will transition */ - lws_bind_protocol(new_wsi, - &vh->protocols[vh->raw_protocol_index]); - lws_role_transition(new_wsi, 0, LRS_ESTABLISHED, - &role_ops_raw_skt); - } - - if (type & LWS_ADOPT_SOCKET) { /* socket desc */ - lwsl_debug("%s: new wsi %p, sockfd %d\n", __func__, new_wsi, - (int)(lws_intptr_t)fd.sockfd); -#if !defined(LWS_WITH_ESP32) - if (type & LWS_ADOPT_FLAG_UDP) - /* - * these can be >128 bytes, so just alloc for UDP - */ - new_wsi->udp = lws_malloc(sizeof(*new_wsi->udp), - "udp struct"); -#endif - - if (type & LWS_ADOPT_HTTP) - /* the transport is accepted... - * give him time to negotiate */ - lws_set_timeout(new_wsi, - PENDING_TIMEOUT_ESTABLISH_WITH_SERVER, - context->timeout_secs); - - } else /* file desc */ - lwsl_debug("%s: new wsi %p, filefd %d\n", __func__, new_wsi, - (int)(lws_intptr_t)fd.filefd); - - /* - * A new connection was accepted. Give the user a chance to - * set properties of the newly created wsi. There's no protocol - * selected yet so we issue this to the vhosts's default protocol, - * itself by default protocols[0] - */ - n = LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED; - if (!(type & LWS_ADOPT_HTTP)) { - if (!(type & LWS_ADOPT_SOCKET)) - n = LWS_CALLBACK_RAW_ADOPT_FILE; - else - n = LWS_CALLBACK_RAW_ADOPT; - } - - if (!LWS_SSL_ENABLED(new_wsi->vhost) || !(type & LWS_ADOPT_ALLOW_SSL) || - !(type & LWS_ADOPT_SOCKET)) { - /* non-SSL */ - if (!(type & LWS_ADOPT_HTTP)) { - if (!(type & LWS_ADOPT_SOCKET)) - lws_role_transition(new_wsi, 0, LRS_ESTABLISHED, - &role_ops_raw_file); - else - lws_role_transition(new_wsi, 0, LRS_ESTABLISHED, - &role_ops_raw_skt); - } -#if defined(LWS_ROLE_H1) - else - lws_role_transition(new_wsi, LWSIFR_SERVER, - LRS_HEADERS, &role_ops_h1); -#endif - } else { - /* SSL */ - if (!(type & LWS_ADOPT_HTTP)) - lws_role_transition(new_wsi, 0, LRS_SSL_INIT, - &role_ops_raw_skt); -#if defined(LWS_ROLE_H1) - else - lws_role_transition(new_wsi, LWSIFR_SERVER, - LRS_SSL_INIT, &role_ops_h1); -#endif - ssl = 1; - } - - lwsl_debug("new wsi wsistate 0x%x\n", new_wsi->wsistate); - - if (context->event_loop_ops->accept) - context->event_loop_ops->accept(new_wsi); - - if (!ssl) { - lws_pt_lock(pt, __func__); - if (__insert_wsi_socket_into_fds(context, new_wsi)) { - lws_pt_unlock(pt); - lwsl_err("%s: fail inserting socket\n", __func__); - goto fail; - } - lws_pt_unlock(pt); - } else - if (lws_server_socket_service_ssl(new_wsi, fd.sockfd)) { - lwsl_info("%s: fail ssl negotiation\n", __func__); - goto fail; - } - - /* - * by deferring callback to this point, after insertion to fds, - * lws_callback_on_writable() can work from the callback - */ - if ((new_wsi->protocol->callback)( - new_wsi, n, new_wsi->user_space, NULL, 0)) - goto fail; - - if (type & LWS_ADOPT_HTTP) { - if (!lws_header_table_attach(new_wsi, 0)) - lwsl_debug("Attached ah immediately\n"); - else - lwsl_info("%s: waiting for ah\n", __func__); - } - - lws_cancel_service_pt(new_wsi); - - return new_wsi; - -fail: - if (type & LWS_ADOPT_SOCKET) - lws_close_free_wsi(new_wsi, LWS_CLOSE_STATUS_NOSTATUS, "adopt skt fail"); - - return NULL; - -bail: - lwsl_notice("%s: exiting on bail\n", __func__); - if (parent) - parent->child_list = new_wsi->sibling_list; - if (new_wsi->user_space) - lws_free(new_wsi->user_space); - lws_free(new_wsi); - compatible_close(fd.sockfd); - - return NULL; -} - -LWS_VISIBLE struct lws * -lws_adopt_socket_vhost(struct lws_vhost *vh, lws_sockfd_type accept_fd) -{ - lws_sock_file_fd_type fd; - - fd.sockfd = accept_fd; - return lws_adopt_descriptor_vhost(vh, LWS_ADOPT_SOCKET | - LWS_ADOPT_HTTP | LWS_ADOPT_ALLOW_SSL, fd, NULL, NULL); -} - -LWS_VISIBLE struct lws * -lws_adopt_socket(struct lws_context *context, lws_sockfd_type accept_fd) -{ - return lws_adopt_socket_vhost(context->vhost_list, accept_fd); -} - -/* Common read-buffer adoption for lws_adopt_*_readbuf */ -static struct lws* -adopt_socket_readbuf(struct lws *wsi, const char *readbuf, size_t len) -{ - struct lws_context_per_thread *pt; - struct lws_pollfd *pfd; - int n; - - if (!wsi) - return NULL; - - if (!readbuf || len == 0) - return wsi; - - if (wsi->position_in_fds_table == LWS_NO_FDS_POS) - return wsi; - - pt = &wsi->context->pt[(int)wsi->tsi]; - - n = lws_buflist_append_segment(&wsi->buflist, (const uint8_t *)readbuf, len); - if (n < 0) - goto bail; - if (n) - lws_dll_lws_add_front(&wsi->dll_buflist, &pt->dll_head_buflist); - - /* - * we can't process the initial read data until we can attach an ah. - * - * if one is available, get it and place the data in his ah rxbuf... - * wsi with ah that have pending rxbuf get auto-POLLIN service. - * - * no autoservice because we didn't get a chance to attach the - * readbuf data to wsi or ah yet, and we will do it next if we get - * the ah. - */ - if (wsi->http.ah || !lws_header_table_attach(wsi, 0)) { - - lwsl_notice("%s: calling service on readbuf ah\n", __func__); - - /* unlike a normal connect, we have the headers already - * (or the first part of them anyway). - * libuv won't come back and service us without a network - * event, so we need to do the header service right here. - */ - pfd = &pt->fds[wsi->position_in_fds_table]; - pfd->revents |= LWS_POLLIN; - lwsl_err("%s: calling service\n", __func__); - if (lws_service_fd_tsi(wsi->context, pfd, wsi->tsi)) - /* service closed us */ - return NULL; - - return wsi; - } - lwsl_err("%s: deferring handling ah\n", __func__); - - return wsi; - -bail: - lws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, "adopt skt readbuf fail"); - - return NULL; -} - -LWS_VISIBLE struct lws * -lws_adopt_socket_readbuf(struct lws_context *context, lws_sockfd_type accept_fd, - const char *readbuf, size_t len) -{ - return adopt_socket_readbuf(lws_adopt_socket(context, accept_fd), - readbuf, len); -} - -LWS_VISIBLE struct lws * -lws_adopt_socket_vhost_readbuf(struct lws_vhost *vhost, - lws_sockfd_type accept_fd, - const char *readbuf, size_t len) -{ - return adopt_socket_readbuf(lws_adopt_socket_vhost(vhost, accept_fd), - readbuf, len); -} LWS_VISIBLE int lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, const char *other_headers, int other_headers_len) { - static const char * const intermediates[] = { "private", "public" }; struct lws_context *context = lws_get_context(wsi); struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + unsigned char *response = pt->serv_buf + LWS_PRE; #if defined(LWS_WITH_RANGES) struct lws_range_parsing *rp = &wsi->http.range; #endif + int ret = 0, cclen = 8, n = HTTP_STATUS_OK; char cache_control[50], *cc = "no-store"; - unsigned char *response = pt->serv_buf + LWS_PRE; + lws_fop_flags_t fflags = LWS_O_RDONLY; + const struct lws_plat_file_ops *fops; + lws_filepos_t total_content_length; unsigned char *p = response; unsigned char *end = p + context->pt_serv_buf_size - LWS_PRE; - lws_filepos_t total_content_length; - int ret = 0, cclen = 8, n = HTTP_STATUS_OK; - lws_fop_flags_t fflags = LWS_O_RDONLY; + const char *vpath; #if defined(LWS_WITH_RANGES) int ranges; #endif - const struct lws_plat_file_ops *fops; - const char *vpath; if (wsi->handling_404) n = HTTP_STATUS_NOT_FOUND; @@ -2212,7 +2112,8 @@ lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, if (!wsi->http.fop_fd) { lwsl_info("%s: Unable to open: '%s': errno %d\n", __func__, file, errno); - if (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL)) + if (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, + NULL)) return -1; return !wsi->http2_substream; } @@ -2233,14 +2134,14 @@ lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, */ if (ranges < 0) { /* it means he expressed a range in Range:, but it was illegal */ - lws_return_http_status(wsi, HTTP_STATUS_REQ_RANGE_NOT_SATISFIABLE, - NULL); + lws_return_http_status(wsi, + HTTP_STATUS_REQ_RANGE_NOT_SATISFIABLE, NULL); if (lws_http_transaction_completed(wsi)) return -1; /* <0 means just hang up */ lws_vfs_file_close(&wsi->http.fop_fd); - return 0; /* == 0 means we dealt with the transaction complete */ + return 0; /* == 0 means we did the transaction complete */ } if (ranges) n = HTTP_STATUS_PARTIAL_CONTENT; @@ -2258,6 +2159,20 @@ lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, return -1; lwsl_info("file is being provided in gzip\n"); } +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + else { + /* + * if we know its very compressible, and we can use + * compression, then use the most preferred compression + * method that the client said he will accept + */ + + if (!strncmp(content_type, "text/", 5) || + !strcmp(content_type, "application/javascript") || + !strcmp(content_type, "image/svg+xml")) + lws_http_compression_apply(wsi, NULL, &p, end, 0); + } +#endif if ( #if defined(LWS_WITH_RANGES) @@ -2339,40 +2254,78 @@ lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, #endif if (!wsi->http2_substream) { - if (!wsi->sending_chunked) { + /* for http/1.1 ... */ + if (!wsi->sending_chunked +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + && !wsi->http.lcs +#endif + ) { + /* ... if not already using chunked and not using an + * http compression translation, then send the naive + * content length + */ if (lws_add_http_header_content_length(wsi, - total_content_length, - &p, end)) + total_content_length, &p, end)) return -1; } else { - if (lws_add_http_header_by_token(wsi, - WSI_TOKEN_HTTP_TRANSFER_ENCODING, - (unsigned char *)"chunked", - 7, &p, end)) - return -1; + +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (wsi->http.lcs) { + + /* ...otherwise, for http 1 it must go chunked. + * For the compression case, the reason is we + * compress on the fly and do not know the + * compressed content-length until it has all + * been sent. Http/1.1 pipelining must be able + * to know where the transaction boundaries are + * ... so chunking... + */ + if (lws_add_http_header_by_token(wsi, + WSI_TOKEN_HTTP_TRANSFER_ENCODING, + (unsigned char *)"chunked", 7, + &p, end)) + return -1; + + /* + * ...this is fun, isn't it :-) For h1 that is + * using an http compression translation, the + * compressor must chunk its output privately. + * + * h2 doesn't need (or support) any of this + * crap. + */ + lwsl_debug("setting chunking\n"); + wsi->http.comp_ctx.chunking = 1; + } +#endif } } if (wsi->cache_secs && wsi->cache_reuse) { - if (wsi->cache_revalidate) { + if (!wsi->cache_revalidate) { cc = cache_control; - cclen = sprintf(cache_control, "%s max-age: %u", + cclen = sprintf(cache_control, "%s, max-age=%u", intermediates[wsi->cache_intermediaries], wsi->cache_secs); } else { - cc = "no-cache"; - cclen = 8; + cc = cache_control; + cclen = sprintf(cache_control, + "must-revalidate, %s, max-age=%u", + intermediates[wsi->cache_intermediaries], + wsi->cache_secs); + } } - if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CACHE_CONTROL, - (unsigned char *)cc, cclen, &p, end)) - return -1; - - if (wsi->http.connection_type == HTTP_CONNECTION_KEEP_ALIVE) - if (lws_add_http_header_by_token(wsi, WSI_TOKEN_CONNECTION, - (unsigned char *)"keep-alive", 10, &p, end)) + /* Only add cache control if its not specified by any other_headers. */ + if (!other_headers || + (!strstr(other_headers, "cache-control") && + !strstr(other_headers, "Cache-Control"))) { + if (lws_add_http_header_by_token(wsi, + WSI_TOKEN_HTTP_CACHE_CONTROL, + (unsigned char *)cc, cclen, &p, end)) return -1; + } if (other_headers) { if ((end - p) < other_headers_len) @@ -2415,16 +2368,37 @@ LWS_VISIBLE int lws_serve_http_file_fragment(struct lws *wsi) do { - if (wsi->trunc_len) { - if (lws_issue_raw(wsi, wsi->trunc_alloc + - wsi->trunc_offset, - wsi->trunc_len) < 0) { + /* priority 1: buffered output */ + + if (lws_has_buffered_out(wsi)) { + if (lws_issue_raw(wsi, NULL, 0) < 0) { lwsl_info("%s: closing\n", __func__); goto file_had_it; } break; } + /* priority 2: buffered pre-compression-transform */ + +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + if (wsi->http.comp_ctx.buflist_comp || + wsi->http.comp_ctx.may_have_more) { + enum lws_write_protocol wp = LWS_WRITE_HTTP; + + lwsl_info("%s: completing comp partial (buflist %p, may %d)\n", + __func__, wsi->http.comp_ctx.buflist_comp, + wsi->http.comp_ctx.may_have_more); + + if (wsi->role_ops->write_role_protocol(wsi, NULL, 0, &wp) < 0) { + lwsl_info("%s signalling to close\n", __func__); + goto file_had_it; + } + lws_callback_on_writable(wsi); + + break; + } +#endif + if (wsi->http.filepos == wsi->http.filelen) goto all_sent; @@ -2453,7 +2427,8 @@ LWS_VISIBLE int lws_serve_http_file_fragment(struct lws *wsi) LWS_H2_FRAME_HEADER_LENGTH, "_lws\x0d\x0a" "Content-Type: %s\x0d\x0a" - "Content-Range: bytes %llu-%llu/%llu\x0d\x0a" + "Content-Range: bytes " + "%llu-%llu/%llu\x0d\x0a" "\x0d\x0a", wsi->http.multipart_content_type, wsi->http.range.start, @@ -2468,7 +2443,8 @@ LWS_VISIBLE int lws_serve_http_file_fragment(struct lws *wsi) } #endif - poss = context->pt_serv_buf_size - n - LWS_H2_FRAME_HEADER_LENGTH; + poss = context->pt_serv_buf_size - n - + LWS_H2_FRAME_HEADER_LENGTH; if (wsi->http.tx_content_length) if (poss > wsi->http.tx_content_remain) @@ -2556,11 +2532,9 @@ LWS_VISIBLE int lws_serve_http_file_fragment(struct lws *wsi) lwsl_debug("added trailing boundary\n"); } #endif - m = lws_write(wsi, p, n, - wsi->http.filepos + amount == wsi->http.filelen ? - LWS_WRITE_HTTP_FINAL : - LWS_WRITE_HTTP - ); + m = lws_write(wsi, p, n, wsi->http.filepos + amount == + wsi->http.filelen ? + LWS_WRITE_HTTP_FINAL : LWS_WRITE_HTTP); if (m < 0) goto file_had_it; @@ -2592,12 +2566,18 @@ LWS_VISIBLE int lws_serve_http_file_fragment(struct lws *wsi) } all_sent: - if ((!wsi->trunc_len && wsi->http.filepos >= wsi->http.filelen) + if ((!lws_has_buffered_out(wsi) +#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION) + && !wsi->http.comp_ctx.buflist_comp && + !wsi->http.comp_ctx.may_have_more +#endif + ) && (wsi->http.filepos >= wsi->http.filelen #if defined(LWS_WITH_RANGES) || finished) #else ) #endif + ) { lwsi_set_state(wsi, LRS_ESTABLISHED); /* we might be in keepalive, so close it off here */ @@ -2607,9 +2587,8 @@ all_sent: if (wsi->protocol->callback && user_callback_handle_rxflow(wsi->protocol->callback, - wsi, LWS_CALLBACK_HTTP_FILE_COMPLETION, - wsi->user_space, NULL, - 0) < 0) { + wsi, LWS_CALLBACK_HTTP_FILE_COMPLETION, + wsi->user_space, NULL, 0) < 0) { /* * For http/1.x, the choices from * transaction_completed are either @@ -2632,7 +2611,7 @@ all_sent: return 1; /* >0 indicates completed */ } - } while (0); // while (!lws_send_pipe_choked(wsi)) + } while (1); //(!lws_send_pipe_choked(wsi)); lws_callback_on_writable(wsi); @@ -2713,8 +2692,7 @@ skip: n = (int)strlen(pc); s->swallow[s->pos] = '\0'; if (n != s->pos) { - memmove(s->start + n, - s->start + s->pos, + memmove(s->start + n, s->start + s->pos, old_len - (sp - args->p)); old_len += (n - s->pos) + 1; } diff --git a/thirdparty/libwebsockets/roles/listen/ops-listen.c b/thirdparty/libwebsockets/lib/roles/listen/ops-listen.c index dbeb9753a2..977c4b0377 100644 --- a/thirdparty/libwebsockets/roles/listen/ops-listen.c +++ b/thirdparty/libwebsockets/lib/roles/listen/ops-listen.c @@ -32,6 +32,11 @@ rops_handle_POLLIN_listen(struct lws_context_per_thread *pt, struct lws *wsi, struct sockaddr_storage cli_addr; socklen_t clilen; + /* if our vhost is going down, ignore it */ + + if (wsi->vhost->being_destroyed) + return LWS_HPI_RET_HANDLED; + /* pollin means a client has connected to us then * * pollout is a hack on esp32 for background accepts signalling @@ -74,8 +79,8 @@ rops_handle_POLLIN_listen(struct lws_context_per_thread *pt, struct lws *wsi, * block the connect queue for other legit peers. */ - accept_fd = accept((int)pollfd->fd, - (struct sockaddr *)&cli_addr, &clilen); + accept_fd = accept((int)pollfd->fd, + (struct sockaddr *)&cli_addr, &clilen); lws_latency(context, wsi, "listener accept", (int)accept_fd, accept_fd != LWS_SOCK_INVALID); if (accept_fd == LWS_SOCK_INVALID) { @@ -83,12 +88,11 @@ rops_handle_POLLIN_listen(struct lws_context_per_thread *pt, struct lws *wsi, LWS_ERRNO == LWS_EWOULDBLOCK) { break; } - lwsl_err("ERROR on accept: %s\n", - strerror(LWS_ERRNO)); - break; + lwsl_err("accept: %s\n", strerror(LWS_ERRNO)); + return LWS_HPI_RET_HANDLED; } - lws_plat_set_socket_options(wsi->vhost, accept_fd); + lws_plat_set_socket_options(wsi->vhost, accept_fd, 0); #if defined(LWS_WITH_IPV6) lwsl_debug("accepted new conn port %u on fd=%d\n", @@ -125,9 +129,12 @@ rops_handle_POLLIN_listen(struct lws_context_per_thread *pt, struct lws *wsi, fd.sockfd = accept_fd; cwsi = lws_adopt_descriptor_vhost(wsi->vhost, opts, fd, NULL, NULL); - if (!cwsi) + if (!cwsi) { + lwsl_err("%s: lws_adopt_descriptor_vhost failed\n", + __func__); /* already closed cleanly as necessary */ return LWS_HPI_RET_WSI_ALREADY_DIED; + } if (lws_server_socket_service_ssl(cwsi, accept_fd)) { lws_close_free_wsi(cwsi, LWS_CLOSE_STATUS_NOSTATUS, @@ -171,7 +178,11 @@ struct lws_role_ops role_ops_listen = { /* close_role */ NULL, /* close_kill_connection */ NULL, /* destroy_role */ NULL, + /* adoption_bind */ NULL, + /* client_bind */ NULL, /* writeable cb clnt, srv */ { 0, 0 }, /* close cb clnt, srv */ { 0, 0 }, + /* protocol_bind_cb c,s */ { 0, 0 }, + /* protocol_unbind_cb c,s */ { 0, 0 }, /* file_handle */ 0, }; diff --git a/thirdparty/libwebsockets/roles/pipe/ops-pipe.c b/thirdparty/libwebsockets/lib/roles/pipe/ops-pipe.c index b9348d58d7..659c9bd935 100644 --- a/thirdparty/libwebsockets/roles/pipe/ops-pipe.c +++ b/thirdparty/libwebsockets/lib/roles/pipe/ops-pipe.c @@ -39,6 +39,18 @@ rops_handle_POLLIN_pipe(struct lws_context_per_thread *pt, struct lws *wsi, if (n < 0) return LWS_HPI_RET_PLEASE_CLOSE_ME; #endif + +#if defined(LWS_WITH_THREADPOOL) + /* + * threadpools that need to call for on_writable callbacks do it by + * marking the task as needing one for its wsi, then cancelling service. + * + * Each tsi will call this to perform the actual callback_on_writable + * from the correct service thread context + */ + lws_threadpool_tsi_context(pt->context, pt->tid); +#endif + /* * the poll() wait, or the event loop for libuv etc is a * process-wide resource that we interrupted. So let every @@ -75,7 +87,11 @@ struct lws_role_ops role_ops_pipe = { /* close_role */ NULL, /* close_kill_connection */ NULL, /* destroy_role */ NULL, + /* adoption_bind */ NULL, + /* client_bind */ NULL, /* writeable cb clnt, srv */ { 0, 0 }, /* close cb clnt, srv */ { 0, 0 }, + /* protocol_bind_cb c,s */ { 0, 0 }, + /* protocol_unbind_cb c,s */ { 0, 0 }, /* file_handle */ 1, }; diff --git a/thirdparty/libwebsockets/roles/private.h b/thirdparty/libwebsockets/lib/roles/private.h index ae4278b5d3..5f93b86e8f 100644 --- a/thirdparty/libwebsockets/roles/private.h +++ b/thirdparty/libwebsockets/lib/roles/private.h @@ -148,9 +148,11 @@ enum lwsi_state { }; #define lwsi_state(wsi) ((enum lwsi_state)(wsi->wsistate & LRS_MASK)) -#define lwsi_state_PRE_CLOSE(wsi) ((enum lwsi_state)(wsi->wsistate_pre_close & LRS_MASK)) +#define lwsi_state_PRE_CLOSE(wsi) \ + ((enum lwsi_state)(wsi->wsistate_pre_close & LRS_MASK)) #define lwsi_state_est(wsi) (!(wsi->wsistate & LWSIFS_NOT_EST)) -#define lwsi_state_est_PRE_CLOSE(wsi) (!(wsi->wsistate_pre_close & LWSIFS_NOT_EST)) +#define lwsi_state_est_PRE_CLOSE(wsi) \ + (!(wsi->wsistate_pre_close & LWSIFS_NOT_EST)) #define lwsi_state_can_handle_POLLOUT(wsi) (wsi->wsistate & LWSIFS_POCB) #if !defined (_DEBUG) #define lwsi_set_state(wsi, lrs) wsi->wsistate = \ @@ -159,6 +161,8 @@ enum lwsi_state { void lwsi_set_state(struct lws *wsi, lws_wsi_state_t lrs); #endif +#define _LWS_ADOPT_FINISH (1 << 24) + /* * internal role-specific ops */ @@ -217,6 +221,16 @@ struct lws_role_ops { /* role-specific destructor */ int (*destroy_role)(struct lws *wsi); + /* role-specific socket-adopt */ + int (*adoption_bind)(struct lws *wsi, int type, const char *prot); + /* role-specific client-bind: + * ret 1 = bound, 0 = not bound, -1 = fail out + * i may be NULL, indicating client_bind is being called after + * a successful bind earlier, to finalize the binding. In that + * case ret 0 = OK, 1 = fail, wsi needs freeing, -1 = fail, wsi freed */ + int (*client_bind)(struct lws *wsi, + const struct lws_client_connect_info *i); + /* * the callback reasons for WRITEABLE for client, server * (just client applies if no concept of client or server) @@ -227,6 +241,16 @@ struct lws_role_ops { * (just client applies if no concept of client or server) */ uint16_t close_cb[2]; + /* + * the callback reasons for protocol bind for client, server + * (just client applies if no concept of client or server) + */ + uint16_t protocol_bind_cb[2]; + /* + * the callback reasons for protocol unbind for client, server + * (just client applies if no concept of client or server) + */ + uint16_t protocol_unbind_cb[2]; unsigned int file_handle:1; /* role operates on files not sockets */ }; @@ -267,6 +291,12 @@ extern struct lws_role_ops role_ops_raw_skt, role_ops_raw_file, role_ops_listen, #define lwsi_role_cgi(wsi) (0) #endif +#if defined(LWS_ROLE_DBUS) + #include "roles/dbus/private.h" +#else + #define lwsi_role_dbus(wsi) (0) +#endif + enum { LWS_HP_RET_BAIL_OK, LWS_HP_RET_BAIL_DIE, @@ -280,3 +310,6 @@ enum { LWS_UPG_RET_CONTINUE, LWS_UPG_RET_BAIL }; + +int +lws_role_call_adoption_bind(struct lws *wsi, int type, const char *prot); diff --git a/thirdparty/libwebsockets/lib/roles/raw-file/ops-raw-file.c b/thirdparty/libwebsockets/lib/roles/raw-file/ops-raw-file.c new file mode 100644 index 0000000000..075a2ee8b1 --- /dev/null +++ b/thirdparty/libwebsockets/lib/roles/raw-file/ops-raw-file.c @@ -0,0 +1,108 @@ +/* + * libwebsockets - small server side websockets and web server implementation + * + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include <core/private.h> + +static int +rops_handle_POLLIN_raw_file(struct lws_context_per_thread *pt, struct lws *wsi, + struct lws_pollfd *pollfd) +{ + int n; + + if (pollfd->revents & LWS_POLLOUT) { + n = lws_callback_as_writeable(wsi); + if (lws_change_pollfd(wsi, LWS_POLLOUT, 0)) { + lwsl_info("failed at set pollfd\n"); + return LWS_HPI_RET_WSI_ALREADY_DIED; + } + if (n) + return LWS_HPI_RET_PLEASE_CLOSE_ME; + } + + if (pollfd->revents & LWS_POLLIN) { + if (user_callback_handle_rxflow(wsi->protocol->callback, + wsi, LWS_CALLBACK_RAW_RX_FILE, + wsi->user_space, NULL, 0)) { + lwsl_debug("raw rx callback closed it\n"); + return LWS_HPI_RET_PLEASE_CLOSE_ME; + } + } + + if (pollfd->revents & LWS_POLLHUP) + return LWS_HPI_RET_PLEASE_CLOSE_ME; + + return LWS_HPI_RET_HANDLED; +} + +#if !defined(LWS_NO_SERVER) +static int +rops_adoption_bind_raw_file(struct lws *wsi, int type, const char *vh_prot_name) +{ + /* no socket or http: it can only be a raw file */ + if ((type & LWS_ADOPT_HTTP) || (type & LWS_ADOPT_SOCKET) || + (type & _LWS_ADOPT_FINISH)) + return 0; /* no match */ + + lws_role_transition(wsi, 0, LRS_ESTABLISHED, &role_ops_raw_file); + + if (!vh_prot_name) + wsi->protocol = &wsi->vhost->protocols[ + wsi->vhost->default_protocol_index]; + + return 1; /* bound */ +} +#endif + +struct lws_role_ops role_ops_raw_file = { + /* role name */ "raw-file", + /* alpn id */ NULL, + /* check_upgrades */ NULL, + /* init_context */ NULL, + /* init_vhost */ NULL, + /* destroy_vhost */ NULL, + /* periodic_checks */ NULL, + /* service_flag_pending */ NULL, + /* handle_POLLIN */ rops_handle_POLLIN_raw_file, + /* handle_POLLOUT */ NULL, + /* perform_user_POLLOUT */ NULL, + /* callback_on_writable */ NULL, + /* tx_credit */ NULL, + /* write_role_protocol */ NULL, + /* encapsulation_parent */ NULL, + /* alpn_negotiated */ NULL, + /* close_via_role_protocol */ NULL, + /* close_role */ NULL, + /* close_kill_connection */ NULL, + /* destroy_role */ NULL, +#if !defined(LWS_NO_SERVER) + /* adoption_bind */ rops_adoption_bind_raw_file, +#else + NULL, +#endif + /* client_bind */ NULL, + /* writeable cb clnt, srv */ { LWS_CALLBACK_RAW_WRITEABLE_FILE, 0 }, + /* close cb clnt, srv */ { LWS_CALLBACK_RAW_CLOSE_FILE, 0 }, + /* protocol_bind cb c, srv */ { LWS_CALLBACK_RAW_FILE_BIND_PROTOCOL, + LWS_CALLBACK_RAW_FILE_BIND_PROTOCOL }, + /* protocol_unbind cb c, srv */ { LWS_CALLBACK_RAW_FILE_DROP_PROTOCOL, + LWS_CALLBACK_RAW_FILE_DROP_PROTOCOL }, + /* file_handle */ 1, +}; diff --git a/thirdparty/libwebsockets/roles/raw/ops-raw.c b/thirdparty/libwebsockets/lib/roles/raw-skt/ops-raw-skt.c index 68b52bded6..8b94de4bed 100644 --- a/thirdparty/libwebsockets/roles/raw/ops-raw.c +++ b/thirdparty/libwebsockets/lib/roles/raw-skt/ops-raw-skt.c @@ -30,12 +30,12 @@ rops_handle_POLLIN_raw_skt(struct lws_context_per_thread *pt, struct lws *wsi, /* pending truncated sends have uber priority */ - if (wsi->trunc_len) { + if (lws_has_buffered_out(wsi)) { if (!(pollfd->revents & LWS_POLLOUT)) return LWS_HPI_RET_HANDLED; - if (lws_issue_raw(wsi, wsi->trunc_alloc + wsi->trunc_offset, - wsi->trunc_len) < 0) + /* drain the output buflist */ + if (lws_issue_raw(wsi, NULL, 0) < 0) goto fail; /* * we can't afford to allow input processing to send @@ -109,7 +109,7 @@ try_pollout: LWSSTATS_C_WRITEABLE_CB, 1); #if defined(LWS_WITH_STATS) if (wsi->active_writable_req_us) { - uint64_t ul = time_in_microseconds() - + uint64_t ul = lws_time_in_microseconds() - wsi->active_writable_req_us; lws_stats_atomic_bump(wsi->context, pt, @@ -135,38 +135,62 @@ fail: return LWS_HPI_RET_WSI_ALREADY_DIED; } +#if !defined(LWS_NO_SERVER) +static int +rops_adoption_bind_raw_skt(struct lws *wsi, int type, const char *vh_prot_name) +{ + /* no http but socket... must be raw skt */ + if ((type & LWS_ADOPT_HTTP) || !(type & LWS_ADOPT_SOCKET) || + (type & _LWS_ADOPT_FINISH)) + return 0; /* no match */ + +#if !defined(LWS_WITH_ESP32) + if (type & LWS_ADOPT_FLAG_UDP) + /* + * these can be >128 bytes, so just alloc for UDP + */ + wsi->udp = lws_malloc(sizeof(*wsi->udp), "udp struct"); +#endif + lws_role_transition(wsi, 0, (type & LWS_ADOPT_ALLOW_SSL) ? LRS_SSL_INIT : + LRS_ESTABLISHED, &role_ops_raw_skt); + + if (vh_prot_name) + lws_bind_protocol(wsi, wsi->protocol, __func__); + else + /* this is the only time he will transition */ + lws_bind_protocol(wsi, + &wsi->vhost->protocols[wsi->vhost->raw_protocol_index], + __func__); + + return 1; /* bound */ +} +#endif + +#if !defined(LWS_NO_CLIENT) static int -rops_handle_POLLIN_raw_file(struct lws_context_per_thread *pt, struct lws *wsi, - struct lws_pollfd *pollfd) +rops_client_bind_raw_skt(struct lws *wsi, + const struct lws_client_connect_info *i) { - int n; + if (!i) { - if (pollfd->revents & LWS_POLLOUT) { - n = lws_callback_as_writeable(wsi); - if (lws_change_pollfd(wsi, LWS_POLLOUT, 0)) { - lwsl_info("failed at set pollfd\n"); - return LWS_HPI_RET_WSI_ALREADY_DIED; - } - if (n) - return LWS_HPI_RET_PLEASE_CLOSE_ME; - } + /* finalize */ - if (pollfd->revents & LWS_POLLIN) { - if (user_callback_handle_rxflow(wsi->protocol->callback, - wsi, LWS_CALLBACK_RAW_RX_FILE, - wsi->user_space, NULL, 0)) { - lwsl_debug("raw rx callback closed it\n"); - return LWS_HPI_RET_PLEASE_CLOSE_ME; - } + if (!wsi->user_space && wsi->stash->method) + if (lws_ensure_user_space(wsi)) + return 1; + + return 0; } - if (pollfd->revents & LWS_POLLHUP) - return LWS_HPI_RET_PLEASE_CLOSE_ME; + /* we are a fallback if nothing else matched */ - return LWS_HPI_RET_HANDLED; -} + lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, + &role_ops_raw_skt); + return 1; /* matched */ +} +#endif struct lws_role_ops role_ops_raw_skt = { /* role name */ "raw-skt", @@ -189,35 +213,21 @@ struct lws_role_ops role_ops_raw_skt = { /* close_role */ NULL, /* close_kill_connection */ NULL, /* destroy_role */ NULL, +#if !defined(LWS_NO_SERVER) + /* adoption_bind */ rops_adoption_bind_raw_skt, +#else + NULL, +#endif +#if !defined(LWS_NO_CLIENT) + /* client_bind */ rops_client_bind_raw_skt, +#else + NULL, +#endif /* writeable cb clnt, srv */ { LWS_CALLBACK_RAW_WRITEABLE, 0 }, /* close cb clnt, srv */ { LWS_CALLBACK_RAW_CLOSE, 0 }, + /* protocol_bind cb c, srv */ { LWS_CALLBACK_RAW_SKT_BIND_PROTOCOL, + LWS_CALLBACK_RAW_SKT_BIND_PROTOCOL }, + /* protocol_unbind cb c, srv */ { LWS_CALLBACK_RAW_SKT_DROP_PROTOCOL, + LWS_CALLBACK_RAW_SKT_DROP_PROTOCOL }, /* file_handle */ 0, }; - - - -struct lws_role_ops role_ops_raw_file = { - /* role name */ "raw-file", - /* alpn id */ NULL, - /* check_upgrades */ NULL, - /* init_context */ NULL, - /* init_vhost */ NULL, - /* destroy_vhost */ NULL, - /* periodic_checks */ NULL, - /* service_flag_pending */ NULL, - /* handle_POLLIN */ rops_handle_POLLIN_raw_file, - /* handle_POLLOUT */ NULL, - /* perform_user_POLLOUT */ NULL, - /* callback_on_writable */ NULL, - /* tx_credit */ NULL, - /* write_role_protocol */ NULL, - /* encapsulation_parent */ NULL, - /* alpn_negotiated */ NULL, - /* close_via_role_protocol */ NULL, - /* close_role */ NULL, - /* close_kill_connection */ NULL, - /* destroy_role */ NULL, - /* writeable cb clnt, srv */ { LWS_CALLBACK_RAW_WRITEABLE_FILE, 0 }, - /* close cb clnt, srv */ { LWS_CALLBACK_RAW_CLOSE_FILE, 0 }, - /* file_handle */ 1, -}; diff --git a/thirdparty/libwebsockets/roles/ws/client-parser-ws.c b/thirdparty/libwebsockets/lib/roles/ws/client-parser-ws.c index 7287fb1590..f5aaa6dbb5 100644 --- a/thirdparty/libwebsockets/roles/ws/client-parser-ws.c +++ b/thirdparty/libwebsockets/lib/roles/ws/client-parser-ws.c @@ -1,7 +1,7 @@ /* * libwebsockets - small server side websockets and web server implementation * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -399,9 +399,11 @@ spill: memcpy(wsi->ws->ping_payload_buf + LWS_PRE, pp, wsi->ws->rx_ubuf_head); - wsi->ws->close_in_ping_buffer_len = wsi->ws->rx_ubuf_head; + wsi->ws->close_in_ping_buffer_len = + wsi->ws->rx_ubuf_head; - lwsl_info("%s: scheduling return close as ack\n", __func__); + lwsl_info("%s: scheduling return close as ack\n", + __func__); __lws_change_pollfd(wsi, LWS_POLLIN, 0); lws_set_timeout(wsi, PENDING_TIMEOUT_CLOSE_SEND, 3); wsi->waiting_to_send_close_frame = 1; @@ -437,7 +439,7 @@ spill: /* stash the pong payload */ memcpy(wsi->ws->ping_payload_buf + LWS_PRE, &wsi->ws->rx_ubuf[LWS_PRE], - wsi->ws->rx_ubuf_head); + wsi->ws->rx_ubuf_head); wsi->ws->ping_payload_len = wsi->ws->rx_ubuf_head; wsi->ws->ping_pending_flag = 1; diff --git a/thirdparty/libwebsockets/roles/ws/client-ws.c b/thirdparty/libwebsockets/lib/roles/ws/client-ws.c index fd6cf42551..d88833f381 100644 --- a/thirdparty/libwebsockets/roles/ws/client-ws.c +++ b/thirdparty/libwebsockets/lib/roles/ws/client-ws.c @@ -40,7 +40,8 @@ strtolower(char *s) } int -lws_create_client_ws_object(struct lws_client_connect_info *i, struct lws *wsi) +lws_create_client_ws_object(const struct lws_client_connect_info *i, + struct lws *wsi) { int v = SPEC_LATEST_SUPPORTED; @@ -113,7 +114,7 @@ lws_ws_handshake_client(struct lws *wsi, unsigned char **buf, size_t len) #endif char * -lws_generate_client_ws_handshake(struct lws *wsi, char *p) +lws_generate_client_ws_handshake(struct lws *wsi, char *p, const char *conn1) { char buf[128], hash[20], key_b64[40]; int n; @@ -135,8 +136,8 @@ lws_generate_client_ws_handshake(struct lws *wsi, char *p) lws_b64_encode_string(hash, 16, key_b64, sizeof(key_b64)); p += sprintf(p, "Upgrade: websocket\x0d\x0a" - "Connection: Upgrade\x0d\x0a" - "Sec-WebSocket-Key: "); + "Connection: %sUpgrade\x0d\x0a" + "Sec-WebSocket-Key: ", conn1); strcpy(p, key_b64); p += strlen(key_b64); p += sprintf(p, "\x0d\x0a"); @@ -203,10 +204,12 @@ lws_generate_client_ws_handshake(struct lws *wsi, char *p) int lws_client_ws_upgrade(struct lws *wsi, const char **cce) { - int n, len, okay = 0; struct lws_context *context = wsi->context; + struct lws_tokenize ts; + int n, len, okay = 0; + lws_tokenize_elem e; + char *p, buf[64]; const char *pc; - char *p; #if !defined(LWS_WITHOUT_EXTENSIONS) struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; char *sb = (char *)&pt->serv_buf[0]; @@ -214,8 +217,8 @@ lws_client_ws_upgrade(struct lws *wsi, const char **cce) const struct lws_extension *ext; char ext_name[128]; const char *c, *a; - char ignore; int more = 1; + char ignore; #endif if (wsi->client_h2_substream) {/* !!! client ws-over-h2 not there yet */ @@ -261,18 +264,31 @@ lws_client_ws_upgrade(struct lws *wsi, const char **cce) goto bail3; } - p = lws_hdr_simple_ptr(wsi, WSI_TOKEN_CONNECTION); - if (!p) { - lwsl_info("no Connection hdr\n"); - *cce = "HS: CONNECTION missing"; - goto bail3; - } - strtolower(p); - if (strcmp(p, "upgrade")) { - lwsl_warn("lws_client_int_s_hs: bad header %s\n", p); - *cce = "HS: UPGRADE malformed"; - goto bail3; - } + /* connection: must have "upgrade" */ + + lws_tokenize_init(&ts, buf, LWS_TOKENIZE_F_COMMA_SEP_LIST | + LWS_TOKENIZE_F_MINUS_NONTERM); + ts.len = lws_hdr_copy(wsi, buf, sizeof(buf) - 1, WSI_TOKEN_CONNECTION); + if (ts.len <= 0) /* won't fit, or absent */ + goto bad_conn_format; + + do { + e = lws_tokenize(&ts); + switch (e) { + case LWS_TOKZE_TOKEN: + if (!strcasecmp(ts.token, "upgrade")) + e = LWS_TOKZE_ENDED; + break; + + case LWS_TOKZE_DELIMITER: + break; + + default: /* includes ENDED */ +bad_conn_format: + *cce = "HS: UPGRADE malformed"; + goto bail3; + } + } while (e > 0); pc = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_SENT_PROTOCOLS); if (!pc) { @@ -308,7 +324,7 @@ lws_client_ws_upgrade(struct lws *wsi, const char **cce) } while (*pc && *pc++ != ',') ; - while (*pc && *pc == ' ') + while (*pc == ' ') pc++; } @@ -376,22 +392,7 @@ check_extensions: * X <-> pAn <-> pB */ - lws_vhost_lock(wsi->vhost); - - wsi->same_vh_protocol_prev = /* guy who points to us */ - &wsi->vhost->same_vh_protocol_list[n]; - wsi->same_vh_protocol_next = /* old first guy is our next */ - wsi->vhost->same_vh_protocol_list[n]; - /* we become the new first guy */ - wsi->vhost->same_vh_protocol_list[n] = wsi; - - if (wsi->same_vh_protocol_next) - /* old first guy points back to us now */ - wsi->same_vh_protocol_next->same_vh_protocol_prev = - &wsi->same_vh_protocol_next; - wsi->on_same_vh_list = 1; - - lws_vhost_unlock(wsi->vhost); + lws_same_vh_protocol_insert(wsi, n); #if !defined(LWS_WITHOUT_EXTENSIONS) /* instantiate the accepted extensions */ @@ -468,7 +469,8 @@ check_extensions: if (ext->callback(lws_get_context(wsi), ext, wsi, LWS_EXT_CB_CLIENT_CONSTRUCT, - (void *)&wsi->ws->act_ext_user[wsi->ws->count_act_ext], + (void *)&wsi->ws->act_ext_user[ + wsi->ws->count_act_ext], (void *)&opts, 0)) { lwsl_info(" ext %s failed construction\n", ext_name); @@ -490,8 +492,10 @@ check_extensions: } if (ext_name[0] && - lws_ext_parse_options(ext, wsi, wsi->ws->act_ext_user[ - wsi->ws->count_act_ext], opts, ext_name, + lws_ext_parse_options(ext, wsi, + wsi->ws->act_ext_user[ + wsi->ws->count_act_ext], + opts, ext_name, (int)strlen(ext_name))) { lwsl_err("%s: unable to parse user defaults '%s'", __func__, ext_name); @@ -503,7 +507,8 @@ check_extensions: * give the extension the server options */ if (a && lws_ext_parse_options(ext, wsi, - wsi->ws->act_ext_user[wsi->ws->count_act_ext], + wsi->ws->act_ext_user[ + wsi->ws->count_act_ext], opts, a, lws_ptr_diff(c, a))) { lwsl_err("%s: unable to parse remote def '%s'", __func__, a); diff --git a/thirdparty/libwebsockets/roles/ws/ops-ws.c b/thirdparty/libwebsockets/lib/roles/ws/ops-ws.c index 665b2c9b74..1cbc6ac6a6 100644 --- a/thirdparty/libwebsockets/roles/ws/ops-ws.c +++ b/thirdparty/libwebsockets/lib/roles/ws/ops-ws.c @@ -155,7 +155,9 @@ handle_first: if (wsi->ws->opcode == LWSWSOPC_BINARY_FRAME) wsi->ws->check_utf8 = 0; if (wsi->ws->continuation_possible) { - lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, (uint8_t *)"bad cont", 8); + lws_close_reason(wsi, + LWS_CLOSE_STATUS_PROTOCOL_ERR, + (uint8_t *)"bad cont", 8); return -1; } wsi->ws->rsv_first_msg = (c & 0x70); @@ -166,7 +168,9 @@ handle_first: break; case LWSWSOPC_CONTINUATION: if (!wsi->ws->continuation_possible) { - lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, (uint8_t *)"bad cont", 8); + lws_close_reason(wsi, + LWS_CLOSE_STATUS_PROTOCOL_ERR, + (uint8_t *)"bad cont", 8); return -1; } break; @@ -184,7 +188,8 @@ handle_first: case 0xd: case 0xe: case 0xf: - lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, (uint8_t *)"bad opc", 7); + lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, + (uint8_t *)"bad opc", 7); lwsl_info("illegal opcode\n"); return -1; } @@ -193,7 +198,8 @@ handle_first: (wsi->ws->opcode == LWSWSOPC_TEXT_FRAME || wsi->ws->opcode == LWSWSOPC_BINARY_FRAME)) { lwsl_info("hey you owed us a FIN\n"); - lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, (uint8_t *)"bad fin", 7); + lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, + (uint8_t *)"bad fin", 7); return -1; } if ((!(wsi->ws->opcode & 8)) && wsi->ws->final) { @@ -373,17 +379,19 @@ handle_first: } if (!(already_processed & ALREADY_PROCESSED_IGNORE_CHAR)) { if (wsi->ws->all_zero_nonce) - wsi->ws->rx_ubuf[LWS_PRE + (wsi->ws->rx_ubuf_head++)] = - c; + wsi->ws->rx_ubuf[LWS_PRE + + (wsi->ws->rx_ubuf_head++)] = c; else - wsi->ws->rx_ubuf[LWS_PRE + (wsi->ws->rx_ubuf_head++)] = + wsi->ws->rx_ubuf[LWS_PRE + + (wsi->ws->rx_ubuf_head++)] = c ^ wsi->ws->mask[(wsi->ws->mask_idx++) & 3]; --wsi->ws->rx_packet_length; } if (!wsi->ws->rx_packet_length) { - lwsl_debug("%s: ws fragment length exhausted\n", __func__); + lwsl_debug("%s: ws fragment length exhausted\n", + __func__); /* spill because we have the whole frame */ wsi->lws_rx_parse_state = LWS_RXPS_NEW; goto spill; @@ -451,7 +459,8 @@ spill: * have to just close our end. */ wsi->socket_is_permanently_unusable = 1; - lwsl_parser("Closing on peer close due to Pending tx\n"); + lwsl_parser("Closing on peer close " + "due to pending tx\n"); return -1; } @@ -570,7 +579,8 @@ drain_extension: //if (lin) // lwsl_hexdump_notice(ebuf.token, ebuf.len); n = lws_ext_cb_active(wsi, LWS_EXT_CB_PAYLOAD_RX, &ebuf, 0); - lwsl_debug("%s: ext says %d / ebuf.len %d\n", __func__, n, ebuf.len); + lwsl_debug("%s: ext says %d / ebuf.len %d\n", __func__, + n, ebuf.len); if (wsi->ws->rx_draining_ext) already_processed &= ~ALREADY_PROCESSED_NO_CB; #endif @@ -781,8 +791,7 @@ lws_server_init_wsi_for_ws(struct lws *wsi) lwsl_debug("Allocating RX buffer %d\n", n); #if !defined(LWS_WITH_ESP32) - if (!wsi->parent_carries_io && - !wsi->h2_stream_carries_ws) + if (!wsi->h2_stream_carries_ws) if (setsockopt(wsi->desc.sockfd, SOL_SOCKET, SO_SNDBUF, (const char *)&n, sizeof n)) { lwsl_warn("Failed to set SNDBUF to %d", n); @@ -814,9 +823,9 @@ LWS_VISIBLE int lws_is_final_fragment(struct lws *wsi) { #if !defined(LWS_WITHOUT_EXTENSIONS) - lwsl_debug("%s: final %d, rx pk length %ld, draining %ld\n", __func__, - wsi->ws->final, (long)wsi->ws->rx_packet_length, - (long)wsi->ws->rx_draining_ext); + lwsl_debug("%s: final %d, rx pk length %ld, draining %ld\n", __func__, + wsi->ws->final, (long)wsi->ws->rx_packet_length, + (long)wsi->ws->rx_draining_ext); return wsi->ws->final && !wsi->ws->rx_packet_length && !wsi->ws->rx_draining_ext; #else @@ -883,8 +892,8 @@ static int rops_handle_POLLIN_ws(struct lws_context_per_thread *pt, struct lws *wsi, struct lws_pollfd *pollfd) { - struct lws_tokens ebuf; unsigned int pending = 0; + struct lws_tokens ebuf; char buffered = 0; int n = 0, m; #if defined(LWS_WITH_HTTP2) @@ -928,7 +937,9 @@ rops_handle_POLLIN_ws(struct lws_context_per_thread *pt, struct lws *wsi, return LWS_HPI_RET_HANDLED; } - //lwsl_notice("%s: wsi->ws->tx_draining_ext %d revents 0x%x 0x%x %d\n", __func__, wsi->ws->tx_draining_ext, pollfd->revents, wsi->wsistate, lwsi_state_can_handle_POLLOUT(wsi)); + //lwsl_notice("%s: wsi->ws->tx_draining_ext %d revents 0x%x 0x%x %d\n", + //__func__, wsi->ws->tx_draining_ext, pollfd->revents, wsi->wsistate, + //lwsi_state_can_handle_POLLOUT(wsi)); /* 1: something requested a callback when it was OK to write */ @@ -977,7 +988,7 @@ rops_handle_POLLIN_ws(struct lws_context_per_thread *pt, struct lws *wsi, #if defined(LWS_WITH_HTTP2) if (wsi->http2_substream || wsi->upgraded_to_http2) { wsi1 = lws_get_network_wsi(wsi); - if (wsi1 && wsi1->trunc_len) + if (wsi1 && lws_has_buffered_out(wsi1)) /* We cannot deal with any kind of new RX * because we are dealing with a partial send * (new RX may trigger new http_action() that @@ -1200,8 +1211,9 @@ int rops_handle_POLLOUT_ws(struct lws *wsi) if (n >= 0) { if (wsi->close_needs_ack) { lwsi_set_state(wsi, LRS_AWAITING_CLOSE_ACK); - lws_set_timeout(wsi, PENDING_TIMEOUT_CLOSE_ACK, 5); - lwsl_debug("sent close indication, awaiting ack\n"); + lws_set_timeout(wsi, PENDING_TIMEOUT_CLOSE_ACK, + 5); + lwsl_debug("sent close, await ack\n"); return LWS_HP_RET_BAIL_OK; } @@ -1226,7 +1238,8 @@ int rops_handle_POLLOUT_ws(struct lws *wsi) wsi->ws->ping_pending_flag = 0; return LWS_HP_RET_BAIL_OK; } - lwsl_info("issuing pong %d on wsi %p\n", wsi->ws->ping_payload_len, wsi); + lwsl_info("issuing pong %d on wsi %p\n", + wsi->ws->ping_payload_len, wsi); } n = lws_write(wsi, &wsi->ws->ping_payload_buf[LWS_PRE], @@ -1402,9 +1415,12 @@ rops_periodic_checks_ws(struct lws_context *context, int tsi, time_t now) lws_vhost_lock(vh); for (n = 0; n < vh->count_protocols; n++) { - struct lws *wsi = vh->same_vh_protocol_list[n]; - while (wsi) { + lws_start_foreach_dll_safe(struct lws_dll_lws *, d, d1, + vh->same_vh_protocol_heads[n].next) { + struct lws *wsi = lws_container_of(d, + struct lws, same_vh_protocol); + if (lwsi_role_ws(wsi) && !wsi->socket_is_permanently_unusable && !wsi->ws->send_check_ping && @@ -1421,8 +1437,8 @@ rops_periodic_checks_ws(struct lws_context *context, int tsi, time_t now) lws_callback_on_writable(wsi); wsi->ws->time_next_ping_check = now; } - wsi = wsi->same_vh_protocol_next; - } + + } lws_end_foreach_dll_safe(d, d1); } lws_vhost_unlock(vh); @@ -1496,7 +1512,11 @@ rops_close_via_role_protocol_ws(struct lws *wsi, enum lws_close_status reason) static int rops_close_role_ws(struct lws_context_per_thread *pt, struct lws *wsi) { + if (!wsi->ws) + return 0; + #if !defined(LWS_WITHOUT_EXTENSIONS) + if (wsi->ws->rx_draining_ext) { struct lws **w = &pt->ws.rx_draining_ext_list; @@ -1529,10 +1549,6 @@ rops_close_role_ws(struct lws_context_per_thread *pt, struct lws *wsi) #endif lws_free_set_NULL(wsi->ws->rx_ubuf); - if (wsi->trunc_alloc) - /* not going to be completed... nuke it */ - lws_free_set_NULL(wsi->trunc_alloc); - wsi->ws->ping_payload_len = 0; wsi->ws->ping_pending_flag = 0; @@ -1590,8 +1606,9 @@ rops_write_role_protocol_ws(struct lws *wsi, unsigned char *buf, size_t len, if (!(wpt & LWS_WRITE_NO_FIN) && len) *wp &= ~LWS_WRITE_NO_FIN; - lwsl_ext("FORCED draining wp to 0x%02X (stashed 0x%02X, incoming 0x%02X)\n", *wp, - wsi->ws->tx_draining_stashed_wp, wpt); + lwsl_ext("FORCED draining wp to 0x%02X " + "(stashed 0x%02X, incoming 0x%02X)\n", *wp, + wsi->ws->tx_draining_stashed_wp, wpt); // assert(0); } #endif @@ -1643,13 +1660,16 @@ rops_write_role_protocol_ws(struct lws *wsi, unsigned char *buf, size_t len, n = lws_ext_cb_active(wsi, LWS_EXT_CB_PAYLOAD_TX, &ebuf, *wp); if (n < 0) return -1; - // lwsl_notice("ext processed %d plaintext into %d compressed (wp 0x%x)\n", m, (int)ebuf.len, *wp); + // lwsl_notice("ext processed %d plaintext into %d compressed" + // " (wp 0x%x)\n", m, (int)ebuf.len, *wp); if (n && ebuf.len) { - lwsl_ext("write drain len %d (wp 0x%x) SETTING tx_draining_ext\n", (int)ebuf.len, *wp); + lwsl_ext("write drain len %d (wp 0x%x) SETTING " + "tx_draining_ext\n", (int)ebuf.len, *wp); /* extension requires further draining */ wsi->ws->tx_draining_ext = 1; - wsi->ws->tx_draining_ext_list = pt->ws.tx_draining_ext_list; + wsi->ws->tx_draining_ext_list = + pt->ws.tx_draining_ext_list; pt->ws.tx_draining_ext_list = wsi; /* we must come back to do more */ lws_callback_on_writable(wsi); @@ -1686,7 +1706,8 @@ rops_write_role_protocol_ws(struct lws *wsi, unsigned char *buf, size_t len, */ if (len && !ebuf.len) { if (!wsi->ws->stashed_write_pending) - wsi->ws->stashed_write_type = (char)(*wp) & 0x3f; + wsi->ws->stashed_write_type = + (char)(*wp) & 0x3f; wsi->ws->stashed_write_pending = 1; return (int)len; } @@ -1808,7 +1829,7 @@ do_more_inside_frame: assert(encap != wsi); return encap->role_ops->write_role_protocol(wsi, buf - pre, - len + pre, wp); + len + pre, wp); } switch ((*wp) & 0x1f) { @@ -1986,9 +2007,15 @@ struct lws_role_ops role_ops_ws = { /* close_role */ rops_close_role_ws, /* close_kill_connection */ rops_close_kill_connection_ws, /* destroy_role */ rops_destroy_role_ws, + /* adoption_bind */ NULL, + /* client_bind */ NULL, /* writeable cb clnt, srv */ { LWS_CALLBACK_CLIENT_WRITEABLE, LWS_CALLBACK_SERVER_WRITEABLE }, /* close cb clnt, srv */ { LWS_CALLBACK_CLIENT_CLOSED, LWS_CALLBACK_CLOSED }, + /* protocol_bind cb c, srv */ { LWS_CALLBACK_WS_CLIENT_BIND_PROTOCOL, + LWS_CALLBACK_WS_SERVER_BIND_PROTOCOL }, + /* protocol_unbind cb c, srv */ { LWS_CALLBACK_WS_CLIENT_DROP_PROTOCOL, + LWS_CALLBACK_WS_SERVER_DROP_PROTOCOL }, /* file handles */ 0 }; diff --git a/thirdparty/libwebsockets/roles/ws/private.h b/thirdparty/libwebsockets/lib/roles/ws/private.h index 71ffcaea96..71ffcaea96 100644 --- a/thirdparty/libwebsockets/roles/ws/private.h +++ b/thirdparty/libwebsockets/lib/roles/ws/private.h diff --git a/thirdparty/libwebsockets/roles/ws/server-ws.c b/thirdparty/libwebsockets/lib/roles/ws/server-ws.c index 62bcd8524f..bdc45367d4 100644 --- a/thirdparty/libwebsockets/roles/ws/server-ws.c +++ b/thirdparty/libwebsockets/lib/roles/ws/server-ws.c @@ -104,7 +104,7 @@ lws_extension_server_handshake(struct lws *wsi, char **p, int budget) continue; } - while (args && *args && *args == ' ') + while (args && *args == ' ') args++; /* check a client's extension against our support */ @@ -124,7 +124,7 @@ lws_extension_server_handshake(struct lws *wsi, char **p, int budget) */ for (m = 0; m < wsi->ws->count_act_ext; m++) if (wsi->ws->active_extensions[m] == ext) { - lwsl_info("extension mentioned twice\n"); + lwsl_info("ext mentioned twice\n"); return 1; /* shenanigans */ } @@ -209,16 +209,17 @@ lws_extension_server_handshake(struct lws *wsi, char **p, int budget) oa.len = 0; lwsl_info("setting '%s'\n", po->name); if (!ext->callback(lws_get_context(wsi), - ext, wsi, - LWS_EXT_CB_OPTION_SET, - wsi->ws->act_ext_user[ - wsi->ws->count_act_ext], + ext, wsi, + LWS_EXT_CB_OPTION_SET, + wsi->ws->act_ext_user[ + wsi->ws->count_act_ext], &oa, (end - *p))) { - *p += lws_snprintf(*p, (end - *p), - "; %s", po->name); + *p += lws_snprintf(*p, + (end - *p), + "; %s", po->name); lwsl_debug("adding option %s\n", - po->name); + po->name); } po++; } @@ -230,7 +231,8 @@ lws_extension_server_handshake(struct lws *wsi, char **p, int budget) } wsi->ws->count_act_ext++; - lwsl_parser("cnt_act_ext <- %d\n", wsi->ws->count_act_ext); + lwsl_parser("cnt_act_ext <- %d\n", + wsi->ws->count_act_ext); if (args && *args == ',') more = 0; @@ -246,96 +248,149 @@ lws_extension_server_handshake(struct lws *wsi, char **p, int budget) } #endif - - int lws_process_ws_upgrade(struct lws *wsi) { struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; - char protocol_list[128], protocol_name[64], *p; - int protocol_len, hit, n = 0, non_space_char_found = 0; + const struct lws_protocols *pcol = NULL; + char buf[128], name[64]; + struct lws_tokenize ts; + lws_tokenize_elem e; if (!wsi->protocol) lwsl_err("NULL protocol at lws_read\n"); /* + * We are upgrading to ws, so http/1.1 + h2 and keepalive + pipelined + * header considerations about keeping the ah around no longer apply. + * + * However it's common for the first ws protocol data to have been + * coalesced with the browser upgrade request and to already be in the + * ah rx buffer. + */ + + lws_pt_lock(pt, __func__); + + if (!wsi->h2_stream_carries_ws) + lws_role_transition(wsi, LWSIFR_SERVER, LRS_ESTABLISHED, + &role_ops_ws); + + lws_pt_unlock(pt); + + /* * It's either websocket or h2->websocket * + * If we are on h1, confirm we got the required "connection: upgrade" + * header. h2 / ws-over-h2 does not have this. + */ + +#if defined(LWS_WITH_HTTP2) + if (wsi->http2_substream) + goto check_protocol; +#endif + + lws_tokenize_init(&ts, buf, LWS_TOKENIZE_F_COMMA_SEP_LIST | + LWS_TOKENIZE_F_MINUS_NONTERM); + ts.len = lws_hdr_copy(wsi, buf, sizeof(buf) - 1, WSI_TOKEN_CONNECTION); + if (ts.len <= 0) + goto bad_conn_format; + + do { + e = lws_tokenize(&ts); + switch (e) { + case LWS_TOKZE_TOKEN: + if (!strcasecmp(ts.token, "upgrade")) + e = LWS_TOKZE_ENDED; + break; + + case LWS_TOKZE_DELIMITER: + break; + + default: /* includes ENDED */ +bad_conn_format: + lwsl_err("%s: malformed or absent connection hdr\n", + __func__); + + return 1; + } + } while (e > 0); + +#if defined(LWS_WITH_HTTP2) +check_protocol: +#endif + + /* * Select the first protocol we support from the list * the client sent us. - * - * Copy it to remove header fragmentation */ - if (lws_hdr_copy(wsi, protocol_list, sizeof(protocol_list) - 1, - WSI_TOKEN_PROTOCOL) < 0) { - lwsl_err("protocol list too long"); + lws_tokenize_init(&ts, buf, LWS_TOKENIZE_F_COMMA_SEP_LIST | + LWS_TOKENIZE_F_MINUS_NONTERM | + LWS_TOKENIZE_F_RFC7230_DELIMS); + ts.len = lws_hdr_copy(wsi, buf, sizeof(buf) - 1, WSI_TOKEN_PROTOCOL); + if (ts.len < 0) { + lwsl_err("%s: protocol list too long\n", __func__); return 1; } + if (!ts.len) { + int n = wsi->vhost->default_protocol_index; + /* + * some clients only have one protocol and do not send the + * protocol list header... allow it and match to the vhost's + * default protocol (which itself defaults to zero) + */ + lwsl_info("%s: defaulting to prot handler %d\n", __func__, n); - protocol_len = lws_hdr_total_length(wsi, WSI_TOKEN_PROTOCOL); - protocol_list[protocol_len] = '\0'; - p = protocol_list; - hit = 0; + lws_bind_protocol(wsi, &wsi->vhost->protocols[n], + "ws upgrade default pcol"); - while (*p && !hit) { - n = 0; - non_space_char_found = 0; - while (n < (int)sizeof(protocol_name) - 1 && - *p && *p != ',') { - /* ignore leading spaces */ - if (!non_space_char_found && *p == ' ') { - n++; - continue; - } - non_space_char_found = 1; - protocol_name[n++] = *p++; - } - protocol_name[n] = '\0'; - if (*p) - p++; + goto alloc_ws; + } - lwsl_debug("checking %s\n", protocol_name); + /* otherwise go through the user-provided protocol list */ - n = 0; - while (wsi->vhost->protocols[n].callback) { - lwsl_debug("try %s\n", - wsi->vhost->protocols[n].name); - - if (wsi->vhost->protocols[n].name && - !strcmp(wsi->vhost->protocols[n].name, - protocol_name)) { - wsi->protocol = &wsi->vhost->protocols[n]; - hit = 1; - break; + do { + e = lws_tokenize(&ts); + switch (e) { + case LWS_TOKZE_TOKEN: + + if (lws_tokenize_cstr(&ts, name, sizeof(name))) { + lwsl_err("%s: pcol name too long\n", __func__); + + return 1; + } + lwsl_debug("checking %s\n", name); + pcol = lws_vhost_name_to_protocol(wsi->vhost, name); + if (pcol) { + /* if we know it, bind to it and stop looking */ + lws_bind_protocol(wsi, pcol, "ws upg pcol"); + e = LWS_TOKZE_ENDED; } + break; - n++; - } - } + case LWS_TOKZE_DELIMITER: + case LWS_TOKZE_ENDED: + break; - /* we didn't find a protocol he wanted? */ + default: + lwsl_err("%s: malformatted protocol list", __func__); - if (!hit) { - if (lws_hdr_simple_ptr(wsi, WSI_TOKEN_PROTOCOL)) { - lwsl_notice("No protocol from \"%s\" supported\n", - protocol_list); return 1; } - /* - * some clients only have one protocol and - * do not send the protocol list header... - * allow it and match to the vhost's default - * protocol (which itself defaults to zero) - */ - lwsl_info("defaulting to prot handler %d\n", - wsi->vhost->default_protocol_index); - n = wsi->vhost->default_protocol_index; - wsi->protocol = &wsi->vhost->protocols[ - (int)wsi->vhost->default_protocol_index]; + } while (e > 0); + + /* we didn't find a protocol he wanted? */ + + if (!pcol) { + lwsl_notice("No supported protocol \"%s\"\n", buf); + + return 1; } +alloc_ws: + /* allocate the ws struct for the wsi */ + wsi->ws = lws_zalloc(sizeof(*wsi->ws), "ws struct"); if (!wsi->ws) { lwsl_notice("OOM\n"); @@ -383,6 +438,9 @@ lws_process_ws_upgrade(struct lws *wsi) lwsl_notice("h2 ws handshake failed\n"); return 1; } + lws_role_transition(wsi, + LWSIFR_SERVER | LWSIFR_P_ENCAP_H2, + LRS_ESTABLISHED, &role_ops_ws); } else #endif { @@ -395,28 +453,6 @@ lws_process_ws_upgrade(struct lws *wsi) break; } - lws_same_vh_protocol_insert(wsi, n); - - /* - * We are upgrading to ws, so http/1.1 + h2 and keepalive + pipelined - * header considerations about keeping the ah around no longer apply. - * - * However it's common for the first ws protocol data to have been - * coalesced with the browser upgrade request and to already be in the - * ah rx buffer. - */ - - lws_pt_lock(pt, __func__); - - if (wsi->h2_stream_carries_ws) - lws_role_transition(wsi, LWSIFR_SERVER | LWSIFR_P_ENCAP_H2, - LRS_ESTABLISHED, &role_ops_ws); - else - lws_role_transition(wsi, LWSIFR_SERVER, LRS_ESTABLISHED, - &role_ops_ws); - - lws_pt_unlock(pt); - lws_server_init_wsi_for_ws(wsi); lwsl_parser("accepted v%02d connection\n", wsi->ws->ietf_spec_revision); @@ -443,7 +479,8 @@ handshake_0405(struct lws_context *context, struct lws *wsi) goto bail; } - if (lws_hdr_total_length(wsi, WSI_TOKEN_KEY) >= MAX_WEBSOCKET_04_KEY_LEN) { + if (lws_hdr_total_length(wsi, WSI_TOKEN_KEY) >= + MAX_WEBSOCKET_04_KEY_LEN) { lwsl_warn("Client key too long %d\n", MAX_WEBSOCKET_04_KEY_LEN); goto bail; } @@ -473,7 +510,8 @@ handshake_0405(struct lws_context *context, struct lws *wsi) /* make a buffer big enough for everything */ - response = (char *)pt->serv_buf + MAX_WEBSOCKET_04_KEY_LEN + 256 + LWS_PRE; + response = (char *)pt->serv_buf + MAX_WEBSOCKET_04_KEY_LEN + + 256 + LWS_PRE; p = response; LWS_CPYAPP(p, "HTTP/1.1 101 Switching Protocols\x0d\x0a" "Upgrade: WebSocket\x0d\x0a" @@ -566,9 +604,9 @@ bail: static int lws_ws_frame_rest_is_payload(struct lws *wsi, uint8_t **buf, size_t len) { + unsigned int avail = (unsigned int)len; uint8_t *buffer = *buf, mask[4]; struct lws_tokens ebuf; - unsigned int avail = (unsigned int)len; #if !defined(LWS_WITHOUT_EXTENSIONS) unsigned int old_packet_length = (int)wsi->ws->rx_packet_length; #endif @@ -600,7 +638,7 @@ lws_ws_frame_rest_is_payload(struct lws *wsi, uint8_t **buf, size_t len) if (avail > len) avail = (unsigned int)len; - if (avail <= 0) + if (!avail) return 0; ebuf.token = (char *)buffer; diff --git a/thirdparty/libwebsockets/tls/mbedtls/lws-genhash.c b/thirdparty/libwebsockets/lib/tls/mbedtls/lws-genhash.c index ce4ee6e382..ce4ee6e382 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/lws-genhash.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/lws-genhash.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/lws-genrsa.c b/thirdparty/libwebsockets/lib/tls/mbedtls/lws-genrsa.c index 70a9fcf42c..99b2e75653 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/lws-genrsa.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/lws-genrsa.c @@ -36,8 +36,6 @@ lws_jwk_destroy_genrsa_elements(struct lws_genrsa_elements *el) LWS_VISIBLE int lws_genrsa_create(struct lws_genrsa_ctx *ctx, struct lws_genrsa_elements *el) { - int n; - memset(ctx, 0, sizeof(*ctx)); ctx->ctx = lws_zalloc(sizeof(*ctx->ctx), "genrsa"); if (!ctx->ctx) @@ -46,6 +44,8 @@ lws_genrsa_create(struct lws_genrsa_ctx *ctx, struct lws_genrsa_elements *el) mbedtls_rsa_init(ctx->ctx, MBEDTLS_RSA_PKCS_V15, 0); { + int n; + mbedtls_mpi *mpi[LWS_COUNT_RSA_ELEMENTS] = { &ctx->ctx->E, &ctx->ctx->N, &ctx->ctx->D, &ctx->ctx->P, &ctx->ctx->Q, &ctx->ctx->DP, &ctx->ctx->DQ, @@ -129,7 +129,7 @@ cleanup_1: LWS_VISIBLE int lws_genrsa_public_decrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, - size_t in_len, uint8_t *out, size_t out_max) + size_t in_len, uint8_t *out, size_t out_max) { size_t olen = 0; int n; @@ -149,7 +149,7 @@ lws_genrsa_public_decrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, LWS_VISIBLE int lws_genrsa_public_encrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, - size_t in_len, uint8_t *out) + size_t in_len, uint8_t *out) { int n; @@ -213,8 +213,8 @@ lws_genrsa_public_verify(struct lws_genrsa_ctx *ctx, const uint8_t *in, LWS_VISIBLE int lws_genrsa_public_sign(struct lws_genrsa_ctx *ctx, const uint8_t *in, - enum lws_genhash_types hash_type, uint8_t *sig, - size_t sig_len) + enum lws_genhash_types hash_type, uint8_t *sig, + size_t sig_len) { int n, h = lws_genrsa_genrsa_hash_to_mbed_hash(hash_type); diff --git a/thirdparty/libwebsockets/tls/mbedtls/mbedtls-client.c b/thirdparty/libwebsockets/lib/tls/mbedtls/mbedtls-client.c index a7864ab790..84270c15bc 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/mbedtls-client.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/mbedtls-client.c @@ -30,7 +30,6 @@ OpenSSL_client_verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) int lws_ssl_client_bio_create(struct lws *wsi) { - X509_VERIFY_PARAM *param; char hostname[128], *p; const char *alpn_comma = wsi->context->tls.alpn_default; struct alpn_ctx protos; @@ -63,7 +62,7 @@ lws_ssl_client_bio_create(struct lws *wsi) SSL_set_info_callback(wsi->tls.ssl, lws_ssl_info_callback); if (!(wsi->tls.use_ssl & LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK)) { - param = SSL_get0_param(wsi->tls.ssl); + X509_VERIFY_PARAM *param = SSL_get0_param(wsi->tls.ssl); /* Enable automatic hostname checks */ // X509_VERIFY_PARAM_set_hostflags(param, // X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); @@ -188,6 +187,8 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh, const struct lws_context_creation_info *info, const char *cipher_list, const char *ca_filepath, + const void *ca_mem, + unsigned int ca_mem_len, const char *cert_filepath, const char *private_key_filepath) { @@ -214,16 +215,20 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh, return 1; } - if (!ca_filepath) + if (!ca_filepath && (!ca_mem || !ca_mem_len)) return 0; - if (alloc_file(vh->context, ca_filepath, &buf, &len)) { - lwsl_err("Load CA cert file %s failed\n", ca_filepath); - return 1; + if (ca_filepath) { + if (alloc_file(vh->context, ca_filepath, &buf, &len)) { + lwsl_err("Load CA cert file %s failed\n", ca_filepath); + return 1; + } + vh->tls.x509_client_CA = d2i_X509(NULL, buf, len); + free(buf); + } else { + vh->tls.x509_client_CA = d2i_X509(NULL, (uint8_t*)ca_mem, ca_mem_len); } - vh->tls.x509_client_CA = d2i_X509(NULL, buf, len); - free(buf); if (!vh->tls.x509_client_CA) { lwsl_err("client CA: x509 parse failed\n"); return 1; diff --git a/thirdparty/libwebsockets/tls/mbedtls/mbedtls-server.c b/thirdparty/libwebsockets/lib/tls/mbedtls/mbedtls-server.c index f17c7e5494..df6ddf2c61 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/mbedtls-server.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/mbedtls-server.c @@ -294,18 +294,20 @@ lws_tls_server_accept(struct lws *wsi) if (n == 1) { if (strstr(wsi->vhost->name, ".invalid")) { - lwsl_notice("%s: vhost has .invalid, rejecting accept\n", __func__); + lwsl_notice("%s: vhost has .invalid, " + "rejecting accept\n", __func__); return LWS_SSL_CAPABLE_ERROR; } - n = lws_tls_peer_cert_info(wsi, LWS_TLS_CERT_INFO_COMMON_NAME, &ir, - sizeof(ir.ns.name)); + n = lws_tls_peer_cert_info(wsi, LWS_TLS_CERT_INFO_COMMON_NAME, + &ir, sizeof(ir.ns.name)); if (!n) lwsl_notice("%s: client cert CN '%s'\n", __func__, ir.ns.name); else - lwsl_info("%s: couldn't get client cert CN\n", __func__); + lwsl_info("%s: couldn't get client cert CN\n", + __func__); return LWS_SSL_CAPABLE_DONE; } @@ -322,7 +324,8 @@ lws_tls_server_accept(struct lws *wsi) if (m == SSL_ERROR_WANT_READ || SSL_want_read(wsi->tls.ssl)) { if (lws_change_pollfd(wsi, 0, LWS_POLLIN)) { - lwsl_info("%s: WANT_READ change_pollfd failed\n", __func__); + lwsl_info("%s: WANT_READ change_pollfd failed\n", + __func__); return LWS_SSL_CAPABLE_ERROR; } @@ -333,7 +336,8 @@ lws_tls_server_accept(struct lws *wsi) lwsl_debug("%s: WANT_WRITE\n", __func__); if (lws_change_pollfd(wsi, 0, LWS_POLLOUT)) { - lwsl_info("%s: WANT_WRITE change_pollfd failed\n", __func__); + lwsl_info("%s: WANT_WRITE change_pollfd failed\n", + __func__); return LWS_SSL_CAPABLE_ERROR; } return LWS_SSL_CAPABLE_MORE_SERVICE_WRITE; @@ -554,7 +558,8 @@ lws_tls_acme_sni_cert_create(struct lws_vhost *vhost, const char *san_a, //lwsl_hexdump_level(LLL_DEBUG, pkey_asn1, n); /* and to use our generated private key */ - n = SSL_CTX_use_PrivateKey_ASN1(0, vhost->tls.ssl_ctx, pkey_asn1, m); + n = SSL_CTX_use_PrivateKey_ASN1(0, vhost->tls.ssl_ctx, + pkey_asn1, m); lws_free(pkey_asn1); if (n != 1) { lwsl_err("%s: SSL_CTX_use_PrivateKey_ASN1 failed\n", diff --git a/thirdparty/libwebsockets/tls/mbedtls/ssl.c b/thirdparty/libwebsockets/lib/tls/mbedtls/ssl.c index f311ef50e3..b81f88862b 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/ssl.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/ssl.c @@ -33,7 +33,8 @@ lws_context_init_ssl_library(const struct lws_context_creation_info *info) lwsl_info(" Compiled with MbedTLS support\n"); if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT)) - lwsl_info(" SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT\n"); + lwsl_info(" SSL disabled: no " + "LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT\n"); return 0; } @@ -69,16 +70,17 @@ lws_ssl_capable_read(struct lws *wsi, unsigned char *buf, int len) errno = 0; n = SSL_read(wsi->tls.ssl, buf, len); #if defined(LWS_WITH_ESP32) - if (!n && errno == ENOTCONN) { + if (!n && errno == LWS_ENOTCONN) { lwsl_debug("%p: SSL_read ENOTCONN\n", wsi); return LWS_SSL_CAPABLE_ERROR; } #endif #if defined(LWS_WITH_STATS) - if (!wsi->seen_rx) { + if (!wsi->seen_rx && wsi->accept_start_us) { lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_MS_SSL_RX_DELAY, - time_in_microseconds() - wsi->accept_start_us); + lws_time_in_microseconds() - + wsi->accept_start_us); lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_SSL_CONNS_HAD_RX, 1); wsi->seen_rx = 1; @@ -133,23 +135,12 @@ lws_ssl_capable_read(struct lws *wsi, unsigned char *buf, int len) if (!wsi->tls.ssl) goto bail; - if (!SSL_pending(wsi->tls.ssl)) - goto bail; + if (SSL_pending(wsi->tls.ssl) && + lws_dll_is_null(&wsi->tls.pending_tls_list)) { - if (wsi->tls.pending_read_list_next) - return n; - if (wsi->tls.pending_read_list_prev) - return n; - if (pt->tls.pending_read_list == wsi) - return n; - - /* add us to the linked list of guys with pending ssl */ - if (pt->tls.pending_read_list) - pt->tls.pending_read_list->tls.pending_read_list_prev = wsi; - - wsi->tls.pending_read_list_next = pt->tls.pending_read_list; - wsi->tls.pending_read_list_prev = NULL; - pt->tls.pending_read_list = wsi; + lws_dll_lws_add_front(&wsi->tls.pending_tls_list, + &pt->tls.pending_tls_head); + } return n; bail: @@ -189,7 +180,7 @@ lws_ssl_capable_write(struct lws *wsi, unsigned char *buf, int len) if (m == SSL_ERROR_WANT_WRITE || SSL_want_write(wsi->tls.ssl)) { lws_set_blocking_send(wsi); - lwsl_notice("%s: want write\n", __func__); + lwsl_debug("%s: want write\n", __func__); return LWS_SSL_CAPABLE_MORE_SERVICE; } diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl3.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl3.h index 007b392f3e..007b392f3e 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl3.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl3.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_cert.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_cert.h index 86cf31ad51..86cf31ad51 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_cert.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_cert.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_code.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_code.h index 80fdbb20f3..80fdbb20f3 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_code.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_code.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_dbg.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_dbg.h index ad32cb92ff..ad32cb92ff 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_dbg.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_dbg.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_lib.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_lib.h index 42b2de7501..42b2de7501 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_lib.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_lib.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_methods.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_methods.h index cd2f8c0533..cd2f8c0533 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_methods.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_methods.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_pkey.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_pkey.h index e790fcc995..e790fcc995 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_pkey.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_pkey.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_stack.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_stack.h index 7a7051a026..7a7051a026 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_stack.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_stack.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_types.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_types.h index 68ac748a28..68ac748a28 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_types.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_types.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_x509.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_x509.h index 7594d064b4..7594d064b4 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/ssl_x509.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/ssl_x509.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/tls1.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/tls1.h index 7af1b0157d..7af1b0157d 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/tls1.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/tls1.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/x509_vfy.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/x509_vfy.h index 26bf6c88a8..26bf6c88a8 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/internal/x509_vfy.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/internal/x509_vfy.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/openssl/ssl.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/openssl/ssl.h index e2b74fc6af..e2b74fc6af 100755 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/openssl/ssl.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/openssl/ssl.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/platform/ssl_pm.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/platform/ssl_pm.h index cbbe3aa3a2..cbbe3aa3a2 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/platform/ssl_pm.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/platform/ssl_pm.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/platform/ssl_port.h b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/platform/ssl_port.h index 74c7634355..74c7634355 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/include/platform/ssl_port.h +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/include/platform/ssl_port.h diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_cert.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_cert.c index 5c608125ac..5c608125ac 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_cert.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_cert.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_lib.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_lib.c index 2f688ca9ef..2f688ca9ef 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_lib.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_lib.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_methods.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_methods.c index 0002360846..0002360846 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_methods.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_methods.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_pkey.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_pkey.c index 567a33e2c2..567a33e2c2 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_pkey.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_pkey.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_stack.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_stack.c index da836daf9c..da836daf9c 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_stack.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_stack.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_x509.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_x509.c index ed79150831..ed79150831 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/library/ssl_x509.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/library/ssl_x509.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/platform/ssl_pm.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/platform/ssl_pm.c index 4716c1ff56..4716c1ff56 100755 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/platform/ssl_pm.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/platform/ssl_pm.c diff --git a/thirdparty/libwebsockets/tls/mbedtls/wrapper/platform/ssl_port.c b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/platform/ssl_port.c index 8c7a31338b..8c7a31338b 100644 --- a/thirdparty/libwebsockets/tls/mbedtls/wrapper/platform/ssl_port.c +++ b/thirdparty/libwebsockets/lib/tls/mbedtls/wrapper/platform/ssl_port.c diff --git a/thirdparty/libwebsockets/tls/private.h b/thirdparty/libwebsockets/lib/tls/private.h index 606e2574dc..ad01bfd4fb 100644 --- a/thirdparty/libwebsockets/tls/private.h +++ b/thirdparty/libwebsockets/lib/tls/private.h @@ -64,6 +64,8 @@ #include <openssl/err.h> #include <openssl/md5.h> #include <openssl/sha.h> + #include <openssl/rsa.h> + #include <openssl/bn.h> #ifdef LWS_HAVE_OPENSSL_ECDH_H #include <openssl/ecdh.h> #endif @@ -71,8 +73,9 @@ #endif /* not mbedtls */ #if defined(OPENSSL_VERSION_NUMBER) #if (OPENSSL_VERSION_NUMBER < 0x0009080afL) -/* later openssl defines this to negate the presence of tlsext... but it was only - * introduced at 0.9.8j. Earlier versions don't know it exists so don't +/* + * later openssl defines this to negate the presence of tlsext... but it was + * only introduced at 0.9.8j. Earlier versions don't know it exists so don't * define it... making it look like the feature exists... */ #define OPENSSL_NO_TLSEXT @@ -115,7 +118,7 @@ struct lws_context_tls { }; struct lws_pt_tls { - struct lws *pending_read_list; /* linked list */ + struct lws_dll_lws pending_tls_head; }; struct lws_tls_ss_pieces; @@ -149,7 +152,7 @@ struct lws_vhost_tls { struct lws_lws_tls { lws_tls_conn *ssl; lws_tls_bio *client_bio; - struct lws *pending_read_list_prev, *pending_read_list_next; + struct lws_dll_lws pending_tls_list; unsigned int use_ssl; unsigned int redirect_to_https:1; }; @@ -211,8 +214,8 @@ lws_tls_generic_cert_checks(struct lws_vhost *vhost, const char *cert, const char *private_key); LWS_EXTERN int lws_tls_alloc_pem_to_der_file(struct lws_context *context, const char *filename, - const char *inbuf, lws_filepos_t inlen, - uint8_t **buf, lws_filepos_t *amount); + const char *inbuf, lws_filepos_t inlen, + uint8_t **buf, lws_filepos_t *amount); #if !defined(LWS_NO_SERVER) LWS_EXTERN int @@ -260,6 +263,8 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh, const struct lws_context_creation_info *info, const char *cipher_list, const char *ca_filepath, + const void *ca_mem, + unsigned int ca_mem_len, const char *cert_filepath, const char *private_key_filepath); @@ -278,4 +283,4 @@ lws_ssl_info_callback(const lws_tls_conn *ssl, int where, int ret); int lws_tls_fake_POLLIN_for_buffered(struct lws_context_per_thread *pt); -#endif
\ No newline at end of file +#endif diff --git a/thirdparty/libwebsockets/tls/tls-client.c b/thirdparty/libwebsockets/lib/tls/tls-client.c index 70eb6f6078..f69c685fa7 100644 --- a/thirdparty/libwebsockets/tls/tls-client.c +++ b/thirdparty/libwebsockets/lib/tls/tls-client.c @@ -1,7 +1,7 @@ /* * libwebsockets - client-related ssl code independent of backend * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> + * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -89,10 +89,10 @@ lws_ssl_client_connect2(struct lws *wsi, char *errbuf, int len) int lws_context_init_client_ssl(const struct lws_context_creation_info *info, struct lws_vhost *vhost) { - const char *ca_filepath = info->ssl_ca_filepath; - const char *cipher_list = info->ssl_cipher_list; const char *private_key_filepath = info->ssl_private_key_filepath; const char *cert_filepath = info->ssl_cert_filepath; + const char *ca_filepath = info->ssl_ca_filepath; + const char *cipher_list = info->ssl_cipher_list; struct lws wsi; if (vhost->options & LWS_SERVER_OPTION_ONLY_RAW) @@ -128,7 +128,10 @@ int lws_context_init_client_ssl(const struct lws_context_creation_info *info, } if (lws_tls_client_create_vhost_context(vhost, info, cipher_list, - ca_filepath, cert_filepath, + ca_filepath, + info->client_ssl_ca_mem, + info->client_ssl_ca_mem_len, + cert_filepath, private_key_filepath)) return 1; @@ -139,12 +142,12 @@ int lws_context_init_client_ssl(const struct lws_context_creation_info *info, * lws_get_context() in the callback */ memset(&wsi, 0, sizeof(wsi)); - wsi.vhost = vhost; + wsi.vhost = vhost; /* not a real bound wsi */ wsi.context = vhost->context; vhost->protocols[0].callback(&wsi, LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS, - vhost->tls.ssl_client_ctx, NULL, 0); + vhost->tls.ssl_client_ctx, NULL, 0); return 0; } diff --git a/thirdparty/libwebsockets/tls/tls-server.c b/thirdparty/libwebsockets/lib/tls/tls-server.c index 440e790660..9d3f70dbea 100644 --- a/thirdparty/libwebsockets/tls/tls-server.c +++ b/thirdparty/libwebsockets/lib/tls/tls-server.c @@ -56,7 +56,8 @@ lws_context_init_alpn(struct lws_vhost *vhost) vhost->tls.alpn_ctx.data, sizeof(vhost->tls.alpn_ctx.data) - 1); - SSL_CTX_set_alpn_select_cb(vhost->tls.ssl_ctx, alpn_cb, &vhost->tls.alpn_ctx); + SSL_CTX_set_alpn_select_cb(vhost->tls.ssl_ctx, alpn_cb, + &vhost->tls.alpn_ctx); #else lwsl_err( " HTTP2 / ALPN configured but not supported by OpenSSL 0x%lx\n", @@ -139,7 +140,7 @@ lws_context_init_server_ssl(const struct lws_context_creation_info *info, * lws_get_context() in the callback */ memset(&wsi, 0, sizeof(wsi)); - wsi.vhost = vhost; + wsi.vhost = vhost; /* not a real bound wsi */ wsi.context = context; /* @@ -177,10 +178,10 @@ LWS_VISIBLE int lws_server_socket_service_ssl(struct lws *wsi, lws_sockfd_type accept_fd) { struct lws_context *context = wsi->context; - struct lws_vhost *vh; struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; - int n; + struct lws_vhost *vh; char buf[256]; + int n; (void)buf; @@ -312,12 +313,14 @@ lws_server_socket_service_ssl(struct lws *wsi, lws_sockfd_type accept_fd) /* normal SSL connection processing path */ #if defined(LWS_WITH_STATS) + /* only set this the first time around */ if (!wsi->accept_start_us) - wsi->accept_start_us = time_in_microseconds(); + wsi->accept_start_us = lws_time_in_microseconds(); #endif errno = 0; lws_stats_atomic_bump(wsi->context, pt, - LWSSTATS_C_SSL_CONNECTIONS_ACCEPT_SPIN, 1); + LWSSTATS_C_SSL_CONNECTIONS_ACCEPT_SPIN, + 1); n = lws_tls_server_accept(wsi); lws_latency(context, wsi, "SSL_accept LRS_SSL_ACK_PENDING\n", n, n == 1); @@ -327,7 +330,8 @@ lws_server_socket_service_ssl(struct lws *wsi, lws_sockfd_type accept_fd) break; case LWS_SSL_CAPABLE_ERROR: lws_stats_atomic_bump(wsi->context, pt, - LWSSTATS_C_SSL_CONNECTIONS_FAILED, 1); + LWSSTATS_C_SSL_CONNECTIONS_FAILED, + 1); lwsl_info("SSL_accept failed socket %u: %d\n", wsi->desc.sockfd, n); wsi->socket_is_permanently_unusable = 1; @@ -340,10 +344,12 @@ lws_server_socket_service_ssl(struct lws *wsi, lws_sockfd_type accept_fd) lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_SSL_CONNECTIONS_ACCEPTED, 1); #if defined(LWS_WITH_STATS) - lws_stats_atomic_bump(wsi->context, pt, + if (wsi->accept_start_us) + lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_MS_SSL_CONNECTIONS_ACCEPTED_DELAY, - time_in_microseconds() - wsi->accept_start_us); - wsi->accept_start_us = time_in_microseconds(); + lws_time_in_microseconds() - + wsi->accept_start_us); + wsi->accept_start_us = lws_time_in_microseconds(); #endif accepted: @@ -354,7 +360,7 @@ accepted: if (!vh->being_destroyed && wsi->tls.ssl && vh->tls.ssl_ctx == lws_tls_ctx_from_wsi(wsi)) { lwsl_info("setting wsi to vh %s\n", vh->name); - wsi->vhost = vh; + lws_vhost_bind_wsi(vh, wsi); break; } vh = vh->vhost_next; diff --git a/thirdparty/libwebsockets/tls/tls.c b/thirdparty/libwebsockets/lib/tls/tls.c index 92b7c5593c..a32951689f 100644 --- a/thirdparty/libwebsockets/tls/tls.c +++ b/thirdparty/libwebsockets/lib/tls/tls.c @@ -30,18 +30,18 @@ int lws_tls_fake_POLLIN_for_buffered(struct lws_context_per_thread *pt) { - struct lws *wsi, *wsi_next; int ret = 0; - wsi = pt->tls.pending_read_list; - while (wsi && wsi->position_in_fds_table != LWS_NO_FDS_POS) { - wsi_next = wsi->tls.pending_read_list_next; + lws_start_foreach_dll_safe(struct lws_dll_lws *, p, p1, + pt->tls.pending_tls_head.next) { + struct lws *wsi = lws_container_of(p, struct lws, + tls.pending_tls_list); + pt->fds[wsi->position_in_fds_table].revents |= pt->fds[wsi->position_in_fds_table].events & LWS_POLLIN; ret |= pt->fds[wsi->position_in_fds_table].revents & LWS_POLLIN; - wsi = wsi_next; - } + } lws_end_foreach_dll_safe(p, p1); return !!ret; } @@ -49,29 +49,10 @@ lws_tls_fake_POLLIN_for_buffered(struct lws_context_per_thread *pt) void __lws_ssl_remove_wsi_from_buffered_list(struct lws *wsi) { - struct lws_context *context = wsi->context; - struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; - - if (!wsi->tls.pending_read_list_prev && - !wsi->tls.pending_read_list_next && - pt->tls.pending_read_list != wsi) - /* we are not on the list */ + if (lws_dll_is_null(&wsi->tls.pending_tls_list)) return; - /* point previous guy's next to our next */ - if (!wsi->tls.pending_read_list_prev) - pt->tls.pending_read_list = wsi->tls.pending_read_list_next; - else - wsi->tls.pending_read_list_prev->tls.pending_read_list_next = - wsi->tls.pending_read_list_next; - - /* point next guy's previous to our previous */ - if (wsi->tls.pending_read_list_next) - wsi->tls.pending_read_list_next->tls.pending_read_list_prev = - wsi->tls.pending_read_list_prev; - - wsi->tls.pending_read_list_prev = NULL; - wsi->tls.pending_read_list_next = NULL; + lws_dll_lws_remove(&wsi->tls.pending_tls_list); } void @@ -173,12 +154,12 @@ bail: int lws_tls_alloc_pem_to_der_file(struct lws_context *context, const char *filename, - const char *inbuf, lws_filepos_t inlen, - uint8_t **buf, lws_filepos_t *amount) + const char *inbuf, lws_filepos_t inlen, + uint8_t **buf, lws_filepos_t *amount) { const uint8_t *pem, *p, *end; - uint8_t *q; lws_filepos_t len; + uint8_t *q; int n; if (filename) { @@ -238,23 +219,25 @@ bail: int lws_tls_check_cert_lifetime(struct lws_vhost *v) { - union lws_tls_cert_info_results ir; time_t now = (time_t)lws_now_secs(), life = 0; struct lws_acme_cert_aging_args caa; + union lws_tls_cert_info_results ir; int n; if (v->tls.ssl_ctx && !v->tls.skipped_certs) { - if (now < 1464083026) /* May 2016 */ + if (now < 1542933698) /* Nov 23 2018 00:42 UTC */ /* our clock is wrong and we can't judge the certs */ return -1; - n = lws_tls_vhost_cert_info(v, LWS_TLS_CERT_INFO_VALIDITY_TO, &ir, 0); + n = lws_tls_vhost_cert_info(v, LWS_TLS_CERT_INFO_VALIDITY_TO, + &ir, 0); if (n) return 1; life = (ir.time - now) / (24 * 3600); - lwsl_notice(" vhost %s: cert expiry: %dd\n", v->name, (int)life); + lwsl_notice(" vhost %s: cert expiry: %dd\n", v->name, + (int)life); } else lwsl_notice(" vhost %s: no cert\n", v->name); @@ -446,7 +429,7 @@ lws_tls_cert_updated(struct lws_context *context, const char *certpath, wsi.context = context; lws_start_foreach_ll(struct lws_vhost *, v, context->vhost_list) { - wsi.vhost = v; + wsi.vhost = v; /* not a real bound wsi */ if (v->tls.alloc_cert_path && v->tls.key_path && !strcmp(v->tls.alloc_cert_path, certpath) && !strcmp(v->tls.key_path, keypath)) { diff --git a/thirdparty/libwebsockets/libwebsockets.h b/thirdparty/libwebsockets/libwebsockets.h deleted file mode 100644 index 2c01696404..0000000000 --- a/thirdparty/libwebsockets/libwebsockets.h +++ /dev/null @@ -1,7346 +0,0 @@ -/* - * libwebsockets - small server side websockets and web server implementation - * - * Copyright (C) 2010-2018 Andy Green <andy@warmcat.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation: - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -/** @file */ - -#ifndef LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C -#define LIBWEBSOCKET_H_3060898B846849FF9F88F5DB59B5950C - -#ifdef __cplusplus -#include <cstddef> -#include <cstdarg> - -extern "C" { -#else -#include <stdarg.h> -#endif - -#include <string.h> -#include <stdlib.h> - -#include "lws_config.h" - -/* - * CARE: everything using cmake defines needs to be below here - */ - -#if defined(LWS_HAS_INTPTR_T) -#include <stdint.h> -#define lws_intptr_t intptr_t -#else -typedef unsigned long long lws_intptr_t; -#endif - -#if defined(WIN32) || defined(_WIN32) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -#include <winsock2.h> -#include <ws2tcpip.h> -#include <stddef.h> -#include <basetsd.h> -#include <io.h> -#ifndef _WIN32_WCE -#include <fcntl.h> -#else -#define _O_RDONLY 0x0000 -#define O_RDONLY _O_RDONLY -#endif - -#define LWS_INLINE __inline -#define LWS_VISIBLE -#define LWS_WARN_UNUSED_RESULT -#define LWS_WARN_DEPRECATED -#define LWS_FORMAT(string_index) - -#ifdef LWS_DLL -#ifdef LWS_INTERNAL -#define LWS_EXTERN extern __declspec(dllexport) -#else -#define LWS_EXTERN extern __declspec(dllimport) -#endif -#else -#define LWS_EXTERN -#endif - -#define LWS_INVALID_FILE INVALID_HANDLE_VALUE -#define LWS_O_RDONLY _O_RDONLY -#define LWS_O_WRONLY _O_WRONLY -#define LWS_O_CREAT _O_CREAT -#define LWS_O_TRUNC _O_TRUNC - -#ifndef __func__ -#define __func__ __FUNCTION__ -#endif - -#else /* NOT WIN32 */ -#include <unistd.h> -#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) -#include <sys/capability.h> -#endif - -#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__QNX__) || defined(__OpenBSD__) -#include <sys/socket.h> -#include <netinet/in.h> -#endif - -#define LWS_INLINE inline -#define LWS_O_RDONLY O_RDONLY -#define LWS_O_WRONLY O_WRONLY -#define LWS_O_CREAT O_CREAT -#define LWS_O_TRUNC O_TRUNC - -#if !defined(LWS_PLAT_OPTEE) && !defined(OPTEE_TA) && !defined(LWS_WITH_ESP32) -#include <poll.h> -#include <netdb.h> -#define LWS_INVALID_FILE -1 -#else -#define getdtablesize() (30) -#if defined(LWS_WITH_ESP32) -#define LWS_INVALID_FILE NULL -#else -#define LWS_INVALID_FILE NULL -#endif -#endif - -#if defined(__GNUC__) - -/* warn_unused_result attribute only supported by GCC 3.4 or later */ -#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -#define LWS_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#else -#define LWS_WARN_UNUSED_RESULT -#endif - -#define LWS_VISIBLE __attribute__((visibility("default"))) -#define LWS_WARN_DEPRECATED __attribute__ ((deprecated)) -#define LWS_FORMAT(string_index) __attribute__ ((format(printf, string_index, string_index+1))) -#else -#define LWS_VISIBLE -#define LWS_WARN_UNUSED_RESULT -#define LWS_WARN_DEPRECATED -#define LWS_FORMAT(string_index) -#endif - -#if defined(__ANDROID__) -#include <netinet/in.h> -#include <unistd.h> -#define getdtablesize() sysconf(_SC_OPEN_MAX) -#endif - -#endif - -#if defined(LWS_WITH_LIBEV) -#include <ev.h> -#endif /* LWS_WITH_LIBEV */ -#ifdef LWS_WITH_LIBUV -#include <uv.h> -#ifdef LWS_HAVE_UV_VERSION_H -#include <uv-version.h> -#endif -#ifdef LWS_HAVE_NEW_UV_VERSION_H -#include <uv/version.h> -#endif -#endif /* LWS_WITH_LIBUV */ -#if defined(LWS_WITH_LIBEVENT) -#include <event2/event.h> -#endif /* LWS_WITH_LIBEVENT */ - -#ifndef LWS_EXTERN -#define LWS_EXTERN extern -#endif - -#ifdef _WIN32 -#define random rand -#else -#if !defined(OPTEE_TA) -#include <sys/time.h> -#include <unistd.h> -#endif -#endif - -#if defined(LWS_WITH_TLS) - -#ifdef USE_WOLFSSL -#ifdef USE_OLD_CYASSL -#ifdef _WIN32 -/* - * Include user-controlled settings for windows from - * <wolfssl-root>/IDE/WIN/user_settings.h - */ -#include <IDE/WIN/user_settings.h> -#include <cyassl/ctaocrypt/settings.h> -#else -#include <cyassl/options.h> -#endif -#include <cyassl/openssl/ssl.h> -#include <cyassl/error-ssl.h> - -#else -#ifdef _WIN32 -/* - * Include user-controlled settings for windows from - * <wolfssl-root>/IDE/WIN/user_settings.h - */ -#include <IDE/WIN/user_settings.h> -#include <wolfssl/wolfcrypt/settings.h> -#else -#include <wolfssl/options.h> -#endif -#include <wolfssl/openssl/ssl.h> -#include <wolfssl/error-ssl.h> -#endif /* not USE_OLD_CYASSL */ -#else -#if defined(LWS_WITH_MBEDTLS) -#if defined(LWS_WITH_ESP32) -/* this filepath is passed to us but without quotes or <> */ -#undef MBEDTLS_CONFIG_FILE -#define MBEDTLS_CONFIG_FILE <mbedtls/esp_config.h> -#endif -#include <mbedtls/ssl.h> -#else -#include <openssl/ssl.h> -#if !defined(LWS_WITH_MBEDTLS) -#include <openssl/err.h> -#endif -#endif -#endif /* not USE_WOLFSSL */ -#endif - -/* - * Helpers for pthread mutex in user code... if lws is built for - * multiple service threads, these resolve to pthread mutex - * operations. In the case LWS_MAX_SMP is 1 (the default), they - * are all NOPs and no pthread type or api is referenced. - */ - -#if LWS_MAX_SMP > 1 - -#include <pthread.h> - -#define lws_pthread_mutex(name) pthread_mutex_t name; - -static LWS_INLINE void -lws_pthread_mutex_init(pthread_mutex_t *lock) -{ - pthread_mutex_init(lock, NULL); -} - -static LWS_INLINE void -lws_pthread_mutex_destroy(pthread_mutex_t *lock) -{ - pthread_mutex_destroy(lock); -} - -static LWS_INLINE void -lws_pthread_mutex_lock(pthread_mutex_t *lock) -{ - pthread_mutex_lock(lock); -} - -static LWS_INLINE void -lws_pthread_mutex_unlock(pthread_mutex_t *lock) -{ - pthread_mutex_unlock(lock); -} - -#else -#define lws_pthread_mutex(name) -#define lws_pthread_mutex_init(_a) -#define lws_pthread_mutex_destroy(_a) -#define lws_pthread_mutex_lock(_a) -#define lws_pthread_mutex_unlock(_a) -#endif - - -#define CONTEXT_PORT_NO_LISTEN -1 -#define CONTEXT_PORT_NO_LISTEN_SERVER -2 - -/** \defgroup log Logging - * - * ##Logging - * - * Lws provides flexible and filterable logging facilities, which can be - * used inside lws and in user code. - * - * Log categories may be individually filtered bitwise, and directed to built-in - * sinks for syslog-compatible logging, or a user-defined function. - */ -///@{ - -enum lws_log_levels { - LLL_ERR = 1 << 0, - LLL_WARN = 1 << 1, - LLL_NOTICE = 1 << 2, - LLL_INFO = 1 << 3, - LLL_DEBUG = 1 << 4, - LLL_PARSER = 1 << 5, - LLL_HEADER = 1 << 6, - LLL_EXT = 1 << 7, - LLL_CLIENT = 1 << 8, - LLL_LATENCY = 1 << 9, - LLL_USER = 1 << 10, - - LLL_COUNT = 11 /* set to count of valid flags */ -}; - -LWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...) LWS_FORMAT(2); -LWS_VISIBLE LWS_EXTERN void _lws_logv(int filter, const char *format, va_list vl); -/** - * lwsl_timestamp: generate logging timestamp string - * - * \param level: logging level - * \param p: char * buffer to take timestamp - * \param len: length of p - * - * returns length written in p - */ -LWS_VISIBLE LWS_EXTERN int -lwsl_timestamp(int level, char *p, int len); - -/* these guys are unconditionally included */ - -#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__) -#define lwsl_user(...) _lws_log(LLL_USER, __VA_ARGS__) - -#if !defined(LWS_WITH_NO_LOGS) -/* notice and warn are usually included by being compiled in */ -#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__) -#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) -#endif -/* - * weaker logging can be deselected by telling CMake to build in RELEASE mode - * that gets rid of the overhead of checking while keeping _warn and _err - * active - */ - -#ifdef _DEBUG -#if defined(LWS_WITH_NO_LOGS) -/* notice, warn and log are always compiled in */ -#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__) -#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) -#endif -#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__) -#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__) -#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__) -#define lwsl_header(...) _lws_log(LLL_HEADER, __VA_ARGS__) -#define lwsl_ext(...) _lws_log(LLL_EXT, __VA_ARGS__) -#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__) -#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__) - -#else /* no debug */ -#if defined(LWS_WITH_NO_LOGS) -#define lwsl_warn(...) do {} while(0) -#define lwsl_notice(...) do {} while(0) -#endif -#define lwsl_info(...) do {} while(0) -#define lwsl_debug(...) do {} while(0) -#define lwsl_parser(...) do {} while(0) -#define lwsl_header(...) do {} while(0) -#define lwsl_ext(...) do {} while(0) -#define lwsl_client(...) do {} while(0) -#define lwsl_latency(...) do {} while(0) - -#endif - -#define lwsl_hexdump_err(...) lwsl_hexdump_level(LLL_ERR, __VA_ARGS__) -#define lwsl_hexdump_warn(...) lwsl_hexdump_level(LLL_WARN, __VA_ARGS__) -#define lwsl_hexdump_notice(...) lwsl_hexdump_level(LLL_NOTICE, __VA_ARGS__) -#define lwsl_hexdump_info(...) lwsl_hexdump_level(LLL_INFO, __VA_ARGS__) -#define lwsl_hexdump_debug(...) lwsl_hexdump_level(LLL_DEBUG, __VA_ARGS__) - -/** - * lwsl_hexdump_level() - helper to hexdump a buffer at a selected debug level - * - * \param level: one of LLL_ constants - * \param vbuf: buffer start to dump - * \param len: length of buffer to dump - * - * If \p level is visible, does a nice hexdump -C style dump of \p vbuf for - * \p len bytes. This can be extremely convenient while debugging. - */ -LWS_VISIBLE LWS_EXTERN void -lwsl_hexdump_level(int level, const void *vbuf, size_t len); - -/** - * lwsl_hexdump() - helper to hexdump a buffer (DEBUG builds only) - * - * \param buf: buffer start to dump - * \param len: length of buffer to dump - * - * Calls through to lwsl_hexdump_level(LLL_DEBUG, ... for compatability. - * It's better to use lwsl_hexdump_level(level, ... directly so you can control - * the visibility. - */ -LWS_VISIBLE LWS_EXTERN void -lwsl_hexdump(const void *buf, size_t len); - -/** - * lws_is_be() - returns nonzero if the platform is Big Endian - */ -static LWS_INLINE int lws_is_be(void) { - const int probe = ~0xff; - - return *(const char *)&probe; -} - -/** - * lws_set_log_level() - Set the logging bitfield - * \param level: OR together the LLL_ debug contexts you want output from - * \param log_emit_function: NULL to leave it as it is, or a user-supplied - * function to perform log string emission instead of - * the default stderr one. - * - * log level defaults to "err", "warn" and "notice" contexts enabled and - * emission on stderr. If stderr is a tty (according to isatty()) then - * the output is coloured according to the log level using ANSI escapes. - */ -LWS_VISIBLE LWS_EXTERN void -lws_set_log_level(int level, - void (*log_emit_function)(int level, const char *line)); - -/** - * lwsl_emit_syslog() - helper log emit function writes to system log - * - * \param level: one of LLL_ log level indexes - * \param line: log string - * - * You use this by passing the function pointer to lws_set_log_level(), to set - * it as the log emit function, it is not called directly. - */ -LWS_VISIBLE LWS_EXTERN void -lwsl_emit_syslog(int level, const char *line); - -/** - * lwsl_visible() - returns true if the log level should be printed - * - * \param level: one of LLL_ log level indexes - * - * This is useful if you have to do work to generate the log content, you - * can skip the work if the log level used to print it is not actually - * enabled at runtime. - */ -LWS_VISIBLE LWS_EXTERN int -lwsl_visible(int level); - -///@} - - -#include <stddef.h> - -#ifndef lws_container_of -#define lws_container_of(P,T,M) ((T *)((char *)(P) - offsetof(T, M))) -#endif - -struct lws; - -typedef int64_t lws_usec_t; - -/* api change list for user code to test against */ - -#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_ARG - -/* the struct lws_protocols has the id field present */ -#define LWS_FEATURE_PROTOCOLS_HAS_ID_FIELD - -/* you can call lws_get_peer_write_allowance */ -#define LWS_FEATURE_PROTOCOLS_HAS_PEER_WRITE_ALLOWANCE - -/* extra parameter introduced in 917f43ab821 */ -#define LWS_FEATURE_SERVE_HTTP_FILE_HAS_OTHER_HEADERS_LEN - -/* File operations stuff exists */ -#define LWS_FEATURE_FOPS - - -#if defined(_WIN32) -typedef SOCKET lws_sockfd_type; -typedef HANDLE lws_filefd_type; - -struct lws_pollfd { - lws_sockfd_type fd; /**< file descriptor */ - SHORT events; /**< which events to respond to */ - SHORT revents; /**< which events happened */ -}; -#define LWS_POLLHUP (FD_CLOSE) -#define LWS_POLLIN (FD_READ | FD_ACCEPT) -#define LWS_POLLOUT (FD_WRITE) -#else - - -#if defined(LWS_WITH_ESP32) - -typedef int lws_sockfd_type; -typedef int lws_filefd_type; - -struct pollfd { - lws_sockfd_type fd; /**< fd related to */ - short events; /**< which POLL... events to respond to */ - short revents; /**< which POLL... events occurred */ -}; -#define POLLIN 0x0001 -#define POLLPRI 0x0002 -#define POLLOUT 0x0004 -#define POLLERR 0x0008 -#define POLLHUP 0x0010 -#define POLLNVAL 0x0020 - -#include <freertos/FreeRTOS.h> -#include <freertos/event_groups.h> -#include <string.h> -#include "esp_wifi.h" -#include "esp_system.h" -#include "esp_event.h" -#include "esp_event_loop.h" -#include "nvs.h" -#include "driver/gpio.h" -#include "esp_spi_flash.h" -#include "freertos/timers.h" - -#if !defined(CONFIG_FREERTOS_HZ) -#define CONFIG_FREERTOS_HZ 100 -#endif - -typedef TimerHandle_t uv_timer_t; -typedef void uv_cb_t(uv_timer_t *); -typedef void * uv_handle_t; - -struct timer_mapping { - uv_cb_t *cb; - uv_timer_t *t; -}; - -#define UV_VERSION_MAJOR 1 - -#define lws_uv_getloop(a, b) (NULL) - -static LWS_INLINE void uv_timer_init(void *l, uv_timer_t *t) -{ - (void)l; - *t = NULL; -} - -extern void esp32_uvtimer_cb(TimerHandle_t t); - -static LWS_INLINE void uv_timer_start(uv_timer_t *t, uv_cb_t *cb, int first, int rep) -{ - struct timer_mapping *tm = (struct timer_mapping *)malloc(sizeof(*tm)); - - if (!tm) - return; - - tm->t = t; - tm->cb = cb; - - *t = xTimerCreate("x", pdMS_TO_TICKS(first), !!rep, tm, - (TimerCallbackFunction_t)esp32_uvtimer_cb); - xTimerStart(*t, 0); -} - -static LWS_INLINE void uv_timer_stop(uv_timer_t *t) -{ - xTimerStop(*t, 0); -} - -static LWS_INLINE void uv_close(uv_handle_t *h, void *v) -{ - free(pvTimerGetTimerID((uv_timer_t)h)); - xTimerDelete(*(uv_timer_t *)h, 0); -} - -/* ESP32 helper declarations */ - -#include <mdns.h> -#include <esp_partition.h> - -#define LWS_PLUGIN_STATIC -#define LWS_MAGIC_REBOOT_TYPE_ADS 0x50001ffc -#define LWS_MAGIC_REBOOT_TYPE_REQ_FACTORY 0xb00bcafe -#define LWS_MAGIC_REBOOT_TYPE_FORCED_FACTORY 0xfaceb00b -#define LWS_MAGIC_REBOOT_TYPE_FORCED_FACTORY_BUTTON 0xf0cedfac - - -/* user code provides these */ - -extern void -lws_esp32_identify_physical_device(void); - -/* lws-plat-esp32 provides these */ - -typedef void (*lws_cb_scan_done)(uint16_t count, wifi_ap_record_t *recs, void *arg); - -enum genled_state { - LWSESP32_GENLED__INIT, - LWSESP32_GENLED__LOST_NETWORK, - LWSESP32_GENLED__NO_NETWORK, - LWSESP32_GENLED__CONN_AP, - LWSESP32_GENLED__GOT_IP, - LWSESP32_GENLED__OK, -}; - -struct lws_group_member { - struct lws_group_member *next; - uint64_t last_seen; - char model[16]; - char role[16]; - char host[32]; - char mac[20]; - int width, height; - struct ip4_addr addr; - struct ip6_addr addrv6; - uint8_t flags; -}; - -#define LWS_SYSTEM_GROUP_MEMBER_ADD 1 -#define LWS_SYSTEM_GROUP_MEMBER_CHANGE 2 -#define LWS_SYSTEM_GROUP_MEMBER_REMOVE 3 - -#define LWS_GROUP_FLAG_SELF 1 - -struct lws_esp32 { - char sta_ip[16]; - char sta_mask[16]; - char sta_gw[16]; - char serial[16]; - char opts[16]; - char model[16]; - char group[16]; - char role[16]; - char ssid[4][64]; - char password[4][64]; - char active_ssid[64]; - char access_pw[16]; - char hostname[32]; - char mac[20]; - char le_dns[64]; - char le_email[64]; - char region; - char inet; - char conn_ap; - - enum genled_state genled; - uint64_t genled_t; - - lws_cb_scan_done scan_consumer; - void *scan_consumer_arg; - struct lws_group_member *first; - int extant_group_members; - - char acme; - char upload; - - volatile char button_is_down; -}; - -struct lws_esp32_image { - uint32_t romfs; - uint32_t romfs_len; - uint32_t json; - uint32_t json_len; -}; - -extern struct lws_esp32 lws_esp32; -struct lws_vhost; - -extern esp_err_t -lws_esp32_event_passthru(void *ctx, system_event_t *event); -extern void -lws_esp32_wlan_config(void); -extern void -lws_esp32_wlan_start_ap(void); -extern void -lws_esp32_wlan_start_station(void); -struct lws_context_creation_info; -extern void -lws_esp32_set_creation_defaults(struct lws_context_creation_info *info); -extern struct lws_context * -lws_esp32_init(struct lws_context_creation_info *, struct lws_vhost **pvh); -extern int -lws_esp32_wlan_nvs_get(int retry); -extern esp_err_t -lws_nvs_set_str(nvs_handle handle, const char* key, const char* value); -extern void -lws_esp32_restart_guided(uint32_t type); -extern const esp_partition_t * -lws_esp_ota_get_boot_partition(void); -extern int -lws_esp32_get_image_info(const esp_partition_t *part, struct lws_esp32_image *i, char *json, int json_len); -extern int -lws_esp32_leds_network_indication(void); - -extern uint32_t lws_esp32_get_reboot_type(void); -extern uint16_t lws_esp32_sine_interp(int n); - -/* required in external code by esp32 plat (may just return if no leds) */ -extern void lws_esp32_leds_timer_cb(TimerHandle_t th); -#else -typedef int lws_sockfd_type; -typedef int lws_filefd_type; -#endif - -#define lws_pollfd pollfd -#define LWS_POLLHUP (POLLHUP|POLLERR) -#define LWS_POLLIN (POLLIN) -#define LWS_POLLOUT (POLLOUT) -#endif - - -#if (defined(WIN32) || defined(_WIN32)) && !defined(__MINGW32__) -/* ... */ -#define ssize_t SSIZE_T -#endif - -#if defined(WIN32) && defined(LWS_HAVE__STAT32I64) -#include <sys/types.h> -#include <sys/stat.h> -#endif - -#if defined(LWS_HAVE_STDINT_H) -#include <stdint.h> -#else -#if defined(WIN32) || defined(_WIN32) -/* !!! >:-[ */ -typedef unsigned __int32 uint32_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int8 uint8_t; -#else -typedef unsigned int uint32_t; -typedef unsigned short uint16_t; -typedef unsigned char uint8_t; -#endif -#endif - -typedef unsigned long long lws_filepos_t; -typedef long long lws_fileofs_t; -typedef uint32_t lws_fop_flags_t; - -/** struct lws_pollargs - argument structure for all external poll related calls - * passed in via 'in' */ -struct lws_pollargs { - lws_sockfd_type fd; /**< applicable socket descriptor */ - int events; /**< the new event mask */ - int prev_events; /**< the previous event mask */ -}; - -struct lws_tokens; -struct lws_token_limits; - -/*! \defgroup wsclose Websocket Close - * - * ##Websocket close frame control - * - * When we close a ws connection, we can send a reason code and a short - * UTF-8 description back with the close packet. - */ -///@{ - -/* - * NOTE: These public enums are part of the abi. If you want to add one, - * add it at where specified so existing users are unaffected. - */ -/** enum lws_close_status - RFC6455 close status codes */ -enum lws_close_status { - LWS_CLOSE_STATUS_NOSTATUS = 0, - LWS_CLOSE_STATUS_NORMAL = 1000, - /**< 1000 indicates a normal closure, meaning that the purpose for - which the connection was established has been fulfilled. */ - LWS_CLOSE_STATUS_GOINGAWAY = 1001, - /**< 1001 indicates that an endpoint is "going away", such as a server - going down or a browser having navigated away from a page. */ - LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002, - /**< 1002 indicates that an endpoint is terminating the connection due - to a protocol error. */ - LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003, - /**< 1003 indicates that an endpoint is terminating the connection - because it has received a type of data it cannot accept (e.g., an - endpoint that understands only text data MAY send this if it - receives a binary message). */ - LWS_CLOSE_STATUS_RESERVED = 1004, - /**< Reserved. The specific meaning might be defined in the future. */ - LWS_CLOSE_STATUS_NO_STATUS = 1005, - /**< 1005 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that no status - code was actually present. */ - LWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006, - /**< 1006 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that the - connection was closed abnormally, e.g., without sending or - receiving a Close control frame. */ - LWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007, - /**< 1007 indicates that an endpoint is terminating the connection - because it has received data within a message that was not - consistent with the type of the message (e.g., non-UTF-8 [RFC3629] - data within a text message). */ - LWS_CLOSE_STATUS_POLICY_VIOLATION = 1008, - /**< 1008 indicates that an endpoint is terminating the connection - because it has received a message that violates its policy. This - is a generic status code that can be returned when there is no - other more suitable status code (e.g., 1003 or 1009) or if there - is a need to hide specific details about the policy. */ - LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009, - /**< 1009 indicates that an endpoint is terminating the connection - because it has received a message that is too big for it to - process. */ - LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010, - /**< 1010 indicates that an endpoint (client) is terminating the - connection because it has expected the server to negotiate one or - more extension, but the server didn't return them in the response - message of the WebSocket handshake. The list of extensions that - are needed SHOULD appear in the /reason/ part of the Close frame. - Note that this status code is not used by the server, because it - can fail the WebSocket handshake instead */ - LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011, - /**< 1011 indicates that a server is terminating the connection because - it encountered an unexpected condition that prevented it from - fulfilling the request. */ - LWS_CLOSE_STATUS_TLS_FAILURE = 1015, - /**< 1015 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that the - connection was closed due to a failure to perform a TLS handshake - (e.g., the server certificate can't be verified). */ - - LWS_CLOSE_STATUS_CLIENT_TRANSACTION_DONE = 2000, - - /****** add new things just above ---^ ******/ - - LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY = 9999, -}; - -/** - * lws_close_reason - Set reason and aux data to send with Close packet - * If you are going to return nonzero from the callback - * requesting the connection to close, you can optionally - * call this to set the reason the peer will be told if - * possible. - * - * \param wsi: The websocket connection to set the close reason on - * \param status: A valid close status from websocket standard - * \param buf: NULL or buffer containing up to 124 bytes of auxiliary data - * \param len: Length of data in \param buf to send - */ -LWS_VISIBLE LWS_EXTERN void -lws_close_reason(struct lws *wsi, enum lws_close_status status, - unsigned char *buf, size_t len); - -///@} - -struct lws; -struct lws_context; -/* needed even with extensions disabled for create context */ -struct lws_extension; - - -/*! \defgroup usercb User Callback - * - * ##User protocol callback - * - * The protocol callback is the primary way lws interacts with - * user code. For one of a list of a few dozen reasons the callback gets - * called at some event to be handled. - * - * All of the events can be ignored, returning 0 is taken as "OK" and returning - * nonzero in most cases indicates that the connection should be closed. - */ -///@{ - -struct lws_ssl_info { - int where; - int ret; -}; - -enum lws_cert_update_state { - LWS_CUS_IDLE, - LWS_CUS_STARTING, - LWS_CUS_SUCCESS, - LWS_CUS_FAILED, - - LWS_CUS_CREATE_KEYS, - LWS_CUS_REG, - LWS_CUS_AUTH, - LWS_CUS_CHALLENGE, - LWS_CUS_CREATE_REQ, - LWS_CUS_REQ, - LWS_CUS_CONFIRM, - LWS_CUS_ISSUE, -}; - -enum { - LWS_TLS_REQ_ELEMENT_COUNTRY, - LWS_TLS_REQ_ELEMENT_STATE, - LWS_TLS_REQ_ELEMENT_LOCALITY, - LWS_TLS_REQ_ELEMENT_ORGANIZATION, - LWS_TLS_REQ_ELEMENT_COMMON_NAME, - LWS_TLS_REQ_ELEMENT_EMAIL, - - LWS_TLS_REQ_ELEMENT_COUNT, - - LWS_TLS_SET_DIR_URL = LWS_TLS_REQ_ELEMENT_COUNT, - LWS_TLS_SET_AUTH_PATH, - LWS_TLS_SET_CERT_PATH, - LWS_TLS_SET_KEY_PATH, - - LWS_TLS_TOTAL_COUNT -}; - -struct lws_acme_cert_aging_args { - struct lws_vhost *vh; - const char *element_overrides[LWS_TLS_TOTAL_COUNT]; /* NULL = use pvo */ -}; - -/* - * NOTE: These public enums are part of the abi. If you want to add one, - * add it at where specified so existing users are unaffected. - */ -/** enum lws_callback_reasons - reason you're getting a protocol callback */ -enum lws_callback_reasons { - - /* --------------------------------------------------------------------- - * ----- Callbacks related to wsi and protocol binding lifecycle ----- - */ - - LWS_CALLBACK_PROTOCOL_INIT = 27, - /**< One-time call per protocol, per-vhost using it, so it can - * do initial setup / allocations etc */ - - LWS_CALLBACK_PROTOCOL_DESTROY = 28, - /**< One-time call per protocol, per-vhost using it, indicating - * this protocol won't get used at all after this callback, the - * vhost is getting destroyed. Take the opportunity to - * deallocate everything that was allocated by the protocol. */ - - LWS_CALLBACK_WSI_CREATE = 29, - /**< outermost (earliest) wsi create notification to protocols[0] */ - - LWS_CALLBACK_WSI_DESTROY = 30, - /**< outermost (latest) wsi destroy notification to protocols[0] */ - - LWS_CALLBACK_HTTP_BIND_PROTOCOL = 49, - /**< By default, all HTTP handling is done in protocols[0]. - * However you can bind different protocols (by name) to - * different parts of the URL space using callback mounts. This - * callback occurs in the new protocol when a wsi is bound - * to that protocol. Any protocol allocation related to the - * http transaction processing should be created then. - * These specific callbacks are necessary because with HTTP/1.1, - * a single connection may perform at series of different - * transactions at different URLs, thus the lifetime of the - * protocol bind is just for one transaction, not connection. */ - - LWS_CALLBACK_HTTP_DROP_PROTOCOL = 50, - /**< This is called when a transaction is unbound from a protocol. - * It indicates the connection completed its transaction and may - * do something different now. Any protocol allocation related - * to the http transaction processing should be destroyed. */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to Server TLS ----- - */ - - LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS = 21, - /**< if configured for - * including OpenSSL support, this callback allows your user code - * to perform extra SSL_CTX_load_verify_locations() or similar - * calls to direct OpenSSL where to find certificates the client - * can use to confirm the remote server identity. user is the - * OpenSSL SSL_CTX* */ - - LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS = 22, - /**< if configured for - * including OpenSSL support, this callback allows your user code - * to load extra certificates into the server which allow it to - * verify the validity of certificates returned by clients. user - * is the server's OpenSSL SSL_CTX* and in is the lws_vhost */ - - LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION = 23, - /**< if the libwebsockets vhost was created with the option - * LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this - * callback is generated during OpenSSL verification of the cert - * sent from the client. It is sent to protocol[0] callback as - * no protocol has been negotiated on the connection yet. - * Notice that the libwebsockets context and wsi are both NULL - * during this callback. See - * http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html - * to understand more detail about the OpenSSL callback that - * generates this libwebsockets callback and the meanings of the - * arguments passed. In this callback, user is the x509_ctx, - * in is the ssl pointer and len is preverify_ok - * Notice that this callback maintains libwebsocket return - * conventions, return 0 to mean the cert is OK or 1 to fail it. - * This also means that if you don't handle this callback then - * the default callback action of returning 0 allows the client - * certificates. */ - - LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY = 37, - /**< if configured for including OpenSSL support but no private key - * file has been specified (ssl_private_key_filepath is NULL), this is - * called to allow the user to set the private key directly via - * libopenssl and perform further operations if required; this might be - * useful in situations where the private key is not directly accessible - * by the OS, for example if it is stored on a smartcard. - * user is the server's OpenSSL SSL_CTX* */ - - LWS_CALLBACK_SSL_INFO = 67, - /**< SSL connections only. An event you registered an - * interest in at the vhost has occurred on a connection - * using the vhost. in is a pointer to a - * struct lws_ssl_info containing information about the - * event*/ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to Client TLS ----- - */ - - LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION = 58, - /**< Similar to LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION - * this callback is called during OpenSSL verification of the cert - * sent from the server to the client. It is sent to protocol[0] - * callback as no protocol has been negotiated on the connection yet. - * Notice that the wsi is set because lws_client_connect_via_info was - * successful. - * - * See http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html - * to understand more detail about the OpenSSL callback that - * generates this libwebsockets callback and the meanings of the - * arguments passed. In this callback, user is the x509_ctx, - * in is the ssl pointer and len is preverify_ok. - * - * THIS IS NOT RECOMMENDED BUT if a cert validation error shall be - * overruled and cert shall be accepted as ok, - * X509_STORE_CTX_set_error((X509_STORE_CTX*)user, X509_V_OK); must be - * called and return value must be 0 to mean the cert is OK; - * returning 1 will fail the cert in any case. - * - * This also means that if you don't handle this callback then - * the default callback action of returning 0 will not accept the - * certificate in case of a validation error decided by the SSL lib. - * - * This is expected and secure behaviour when validating certificates. - * - * Note: LCCSCF_ALLOW_SELFSIGNED and - * LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK still work without this - * callback being implemented. - */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to HTTP Server ----- - */ - - LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED = 19, - /**< A new client has been accepted by the ws server. This - * callback allows setting any relevant property to it. Because this - * happens immediately after the instantiation of a new client, - * there's no websocket protocol selected yet so this callback is - * issued only to protocol 0. Only wsi is defined, pointing to the - * new client, and the return value is ignored. */ - - LWS_CALLBACK_HTTP = 12, - /**< an http request has come from a client that is not - * asking to upgrade the connection to a websocket - * one. This is a chance to serve http content, - * for example, to send a script to the client - * which will then open the websockets connection. - * in points to the URI path requested and - * lws_serve_http_file() makes it very - * simple to send back a file to the client. - * Normally after sending the file you are done - * with the http connection, since the rest of the - * activity will come by websockets from the script - * that was delivered by http, so you will want to - * return 1; to close and free up the connection. */ - - LWS_CALLBACK_HTTP_BODY = 13, - /**< the next len bytes data from the http - * request body HTTP connection is now available in in. */ - - LWS_CALLBACK_HTTP_BODY_COMPLETION = 14, - /**< the expected amount of http request body has been delivered */ - - LWS_CALLBACK_HTTP_FILE_COMPLETION = 15, - /**< a file requested to be sent down http link has completed. */ - - LWS_CALLBACK_HTTP_WRITEABLE = 16, - /**< you can write more down the http protocol link now. */ - - LWS_CALLBACK_CLOSED_HTTP = 5, - /**< when a HTTP (non-websocket) session ends */ - - LWS_CALLBACK_FILTER_HTTP_CONNECTION = 18, - /**< called when the request has - * been received and parsed from the client, but the response is - * not sent yet. Return non-zero to disallow the connection. - * user is a pointer to the connection user space allocation, - * in is the URI, eg, "/" - * In your handler you can use the public APIs - * lws_hdr_total_length() / lws_hdr_copy() to access all of the - * headers using the header enums lws_token_indexes from - * libwebsockets.h to check for and read the supported header - * presence and content before deciding to allow the http - * connection to proceed or to kill the connection. */ - - LWS_CALLBACK_ADD_HEADERS = 53, - /**< This gives your user code a chance to add headers to a server - * transaction bound to your protocol. `in` points to a - * `struct lws_process_html_args` describing a buffer and length - * you can add headers into using the normal lws apis. - * - * (see LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER to add headers to - * a client transaction) - * - * Only `args->p` and `args->len` are valid, and `args->p` should - * be moved on by the amount of bytes written, if any. Eg - * - * case LWS_CALLBACK_ADD_HEADERS: - * - * struct lws_process_html_args *args = - * (struct lws_process_html_args *)in; - * - * if (lws_add_http_header_by_name(wsi, - * (unsigned char *)"set-cookie:", - * (unsigned char *)cookie, cookie_len, - * (unsigned char **)&args->p, - * (unsigned char *)args->p + args->max_len)) - * return 1; - * - * break; - */ - - LWS_CALLBACK_CHECK_ACCESS_RIGHTS = 51, - /**< This gives the user code a chance to forbid an http access. - * `in` points to a `struct lws_process_html_args`, which - * describes the URL, and a bit mask describing the type of - * authentication required. If the callback returns nonzero, - * the transaction ends with HTTP_STATUS_UNAUTHORIZED. */ - - LWS_CALLBACK_PROCESS_HTML = 52, - /**< This gives your user code a chance to mangle outgoing - * HTML. `in` points to a `struct lws_process_html_args` - * which describes the buffer containing outgoing HTML. - * The buffer may grow up to `.max_len` (currently +128 - * bytes per buffer). - */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to HTTP Client ----- - */ - - LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP = 44, - /**< The HTTP client connection has succeeded, and is now - * connected to the server */ - - LWS_CALLBACK_CLOSED_CLIENT_HTTP = 45, - /**< The HTTP client connection is closing */ - - LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ = 48, - /**< This is generated by lws_http_client_read() used to drain - * incoming data. In the case the incoming data was chunked, it will - * be split into multiple smaller callbacks for each chunk block, - * removing the chunk headers. If not chunked, it will appear all in - * one callback. */ - - LWS_CALLBACK_RECEIVE_CLIENT_HTTP = 46, - /**< This simply indicates data was received on the HTTP client - * connection. It does NOT drain or provide the data. - * This exists to neatly allow a proxying type situation, - * where this incoming data will go out on another connection. - * If the outgoing connection stalls, we should stall processing - * the incoming data. So a handler for this in that case should - * simply set a flag to indicate there is incoming data ready - * and ask for a writeable callback on the outgoing connection. - * In the writable callback he can check the flag and then get - * and drain the waiting incoming data using lws_http_client_read(). - * This will use callbacks to LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ - * to get and drain the incoming data, where it should be sent - * back out on the outgoing connection. */ - LWS_CALLBACK_COMPLETED_CLIENT_HTTP = 47, - /**< The client transaction completed... at the moment this - * is the same as closing since transaction pipelining on - * client side is not yet supported. */ - - LWS_CALLBACK_CLIENT_HTTP_WRITEABLE = 57, - /**< when doing an HTTP type client connection, you can call - * lws_client_http_body_pending(wsi, 1) from - * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER to get these callbacks - * sending the HTTP headers. - * - * From this callback, when you have sent everything, you should let - * lws know by calling lws_client_http_body_pending(wsi, 0) - */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to Websocket Server ----- - */ - - LWS_CALLBACK_ESTABLISHED = 0, - /**< (VH) after the server completes a handshake with an incoming - * client. If you built the library with ssl support, in is a - * pointer to the ssl struct associated with the connection or NULL. - * - * b0 of len is set if the connection was made using ws-over-h2 - */ - - LWS_CALLBACK_CLOSED = 4, - /**< when the websocket session ends */ - - LWS_CALLBACK_SERVER_WRITEABLE = 11, - /**< See LWS_CALLBACK_CLIENT_WRITEABLE */ - - LWS_CALLBACK_RECEIVE = 6, - /**< data has appeared for this server endpoint from a - * remote client, it can be found at *in and is - * len bytes long */ - - LWS_CALLBACK_RECEIVE_PONG = 7, - /**< servers receive PONG packets with this callback reason */ - - LWS_CALLBACK_WS_PEER_INITIATED_CLOSE = 38, - /**< The peer has sent an unsolicited Close WS packet. in and - * len are the optional close code (first 2 bytes, network - * order) and the optional additional information which is not - * defined in the standard, and may be a string or non human-readable - * data. - * If you return 0 lws will echo the close and then close the - * connection. If you return nonzero lws will just close the - * connection. */ - - LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION = 20, - /**< called when the handshake has - * been received and parsed from the client, but the response is - * not sent yet. Return non-zero to disallow the connection. - * user is a pointer to the connection user space allocation, - * in is the requested protocol name - * In your handler you can use the public APIs - * lws_hdr_total_length() / lws_hdr_copy() to access all of the - * headers using the header enums lws_token_indexes from - * libwebsockets.h to check for and read the supported header - * presence and content before deciding to allow the handshake - * to proceed or to kill the connection. */ - - LWS_CALLBACK_CONFIRM_EXTENSION_OKAY = 25, - /**< When the server handshake code - * sees that it does support a requested extension, before - * accepting the extension by additing to the list sent back to - * the client it gives this callback just to check that it's okay - * to use that extension. It calls back to the requested protocol - * and with in being the extension name, len is 0 and user is - * valid. Note though at this time the ESTABLISHED callback hasn't - * happened yet so if you initialize user content there, user - * content during this callback might not be useful for anything. */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to Websocket Client ----- - */ - - LWS_CALLBACK_CLIENT_CONNECTION_ERROR = 1, - /**< the request client connection has been unable to complete a - * handshake with the remote server. If in is non-NULL, you can - * find an error string of length len where it points to - * - * Diagnostic strings that may be returned include - * - * "getaddrinfo (ipv6) failed" - * "unknown address family" - * "getaddrinfo (ipv4) failed" - * "set socket opts failed" - * "insert wsi failed" - * "lws_ssl_client_connect1 failed" - * "lws_ssl_client_connect2 failed" - * "Peer hung up" - * "read failed" - * "HS: URI missing" - * "HS: Redirect code but no Location" - * "HS: URI did not parse" - * "HS: Redirect failed" - * "HS: Server did not return 200" - * "HS: OOM" - * "HS: disallowed by client filter" - * "HS: disallowed at ESTABLISHED" - * "HS: ACCEPT missing" - * "HS: ws upgrade response not 101" - * "HS: UPGRADE missing" - * "HS: Upgrade to something other than websocket" - * "HS: CONNECTION missing" - * "HS: UPGRADE malformed" - * "HS: PROTOCOL malformed" - * "HS: Cannot match protocol" - * "HS: EXT: list too big" - * "HS: EXT: failed setting defaults" - * "HS: EXT: failed parsing defaults" - * "HS: EXT: failed parsing options" - * "HS: EXT: Rejects server options" - * "HS: EXT: unknown ext" - * "HS: Accept hash wrong" - * "HS: Rejected by filter cb" - * "HS: OOM" - * "HS: SO_SNDBUF failed" - * "HS: Rejected at CLIENT_ESTABLISHED" - */ - - LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH = 2, - /**< this is the last chance for the client user code to examine the - * http headers and decide to reject the connection. If the - * content in the headers is interesting to the - * client (url, etc) it needs to copy it out at - * this point since it will be destroyed before - * the CLIENT_ESTABLISHED call */ - - LWS_CALLBACK_CLIENT_ESTABLISHED = 3, - /**< after your client connection completed the websocket upgrade - * handshake with the remote server */ - - LWS_CALLBACK_CLIENT_CLOSED = 75, - /**< when a client websocket session ends */ - - LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER = 24, - /**< this callback happens - * when a client handshake is being compiled. user is NULL, - * in is a char **, it's pointing to a char * which holds the - * next location in the header buffer where you can add - * headers, and len is the remaining space in the header buffer, - * which is typically some hundreds of bytes. So, to add a canned - * cookie, your handler code might look similar to: - * - * char **p = (char **)in; - * - * if (len < 100) - * return 1; - * - * *p += sprintf(*p, "Cookie: a=b\x0d\x0a"); - * - * return 0; - * - * Notice if you add anything, you just have to take care about - * the CRLF on the line you added. Obviously this callback is - * optional, if you don't handle it everything is fine. - * - * Notice the callback is coming to protocols[0] all the time, - * because there is no specific protocol negotiated yet. - * - * See LWS_CALLBACK_ADD_HEADERS for adding headers to server - * transactions. - */ - - LWS_CALLBACK_CLIENT_RECEIVE = 8, - /**< data has appeared from the server for the client connection, it - * can be found at *in and is len bytes long */ - - LWS_CALLBACK_CLIENT_RECEIVE_PONG = 9, - /**< clients receive PONG packets with this callback reason */ - - LWS_CALLBACK_CLIENT_WRITEABLE = 10, - /**< If you call lws_callback_on_writable() on a connection, you will - * get one of these callbacks coming when the connection socket - * is able to accept another write packet without blocking. - * If it already was able to take another packet without blocking, - * you'll get this callback at the next call to the service loop - * function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE - * and servers get LWS_CALLBACK_SERVER_WRITEABLE. */ - - LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED = 26, - /**< When a ws client - * connection is being prepared to start a handshake to a server, - * each supported extension is checked with protocols[0] callback - * with this reason, giving the user code a chance to suppress the - * claim to support that extension by returning non-zero. If - * unhandled, by default 0 will be returned and the extension - * support included in the header to the server. Notice this - * callback comes to protocols[0]. */ - - LWS_CALLBACK_WS_EXT_DEFAULTS = 39, - /**< Gives client connections an opportunity to adjust negotiated - * extension defaults. `user` is the extension name that was - * negotiated (eg, "permessage-deflate"). `in` points to a - * buffer and `len` is the buffer size. The user callback can - * set the buffer to a string describing options the extension - * should parse. Or just ignore for defaults. */ - - - LWS_CALLBACK_FILTER_NETWORK_CONNECTION = 17, - /**< called when a client connects to - * the server at network level; the connection is accepted but then - * passed to this callback to decide whether to hang up immediately - * or not, based on the client IP. in contains the connection - * socket's descriptor. Since the client connection information is - * not available yet, wsi still pointing to the main server socket. - * Return non-zero to terminate the connection before sending or - * receiving anything. Because this happens immediately after the - * network connection from the client, there's no websocket protocol - * selected yet so this callback is issued only to protocol 0. */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to external poll loop integration ----- - */ - - LWS_CALLBACK_GET_THREAD_ID = 31, - /**< lws can accept callback when writable requests from other - * threads, if you implement this callback and return an opaque - * current thread ID integer. */ - - /* external poll() management support */ - LWS_CALLBACK_ADD_POLL_FD = 32, - /**< lws normally deals with its poll() or other event loop - * internally, but in the case you are integrating with another - * server you will need to have lws sockets share a - * polling array with the other server. This and the other - * POLL_FD related callbacks let you put your specialized - * poll array interface code in the callback for protocol 0, the - * first protocol you support, usually the HTTP protocol in the - * serving case. - * This callback happens when a socket needs to be - * added to the polling loop: in points to a struct - * lws_pollargs; the fd member of the struct is the file - * descriptor, and events contains the active events - * - * If you are using the internal lws polling / event loop - * you can just ignore these callbacks. */ - - LWS_CALLBACK_DEL_POLL_FD = 33, - /**< This callback happens when a socket descriptor - * needs to be removed from an external polling array. in is - * again the struct lws_pollargs containing the fd member - * to be removed. If you are using the internal polling - * loop, you can just ignore it. */ - - LWS_CALLBACK_CHANGE_MODE_POLL_FD = 34, - /**< This callback happens when lws wants to modify the events for - * a connection. - * in is the struct lws_pollargs with the fd to change. - * The new event mask is in events member and the old mask is in - * the prev_events member. - * If you are using the internal polling loop, you can just ignore - * it. */ - - LWS_CALLBACK_LOCK_POLL = 35, - /**< These allow the external poll changes driven - * by lws to participate in an external thread locking - * scheme around the changes, so the whole thing is threadsafe. - * These are called around three activities in the library, - * - inserting a new wsi in the wsi / fd table (len=1) - * - deleting a wsi from the wsi / fd table (len=1) - * - changing a wsi's POLLIN/OUT state (len=0) - * Locking and unlocking external synchronization objects when - * len == 1 allows external threads to be synchronized against - * wsi lifecycle changes if it acquires the same lock for the - * duration of wsi dereference from the other thread context. */ - - LWS_CALLBACK_UNLOCK_POLL = 36, - /**< See LWS_CALLBACK_LOCK_POLL, ignore if using lws internal poll */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to CGI serving ----- - */ - - LWS_CALLBACK_CGI = 40, - /**< CGI: CGI IO events on stdin / out / err are sent here on - * protocols[0]. The provided `lws_callback_http_dummy()` - * handles this and the callback should be directed there if - * you use CGI. */ - - LWS_CALLBACK_CGI_TERMINATED = 41, - /**< CGI: The related CGI process ended, this is called before - * the wsi is closed. Used to, eg, terminate chunking. - * The provided `lws_callback_http_dummy()` - * handles this and the callback should be directed there if - * you use CGI. The child PID that terminated is in len. */ - - LWS_CALLBACK_CGI_STDIN_DATA = 42, - /**< CGI: Data is, to be sent to the CGI process stdin, eg from - * a POST body. The provided `lws_callback_http_dummy()` - * handles this and the callback should be directed there if - * you use CGI. */ - - LWS_CALLBACK_CGI_STDIN_COMPLETED = 43, - /**< CGI: no more stdin is coming. The provided - * `lws_callback_http_dummy()` handles this and the callback - * should be directed there if you use CGI. */ - - LWS_CALLBACK_CGI_PROCESS_ATTACH = 70, - /**< CGI: Sent when the CGI process is spawned for the wsi. The - * len parameter is the PID of the child process */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to Generic Sessions ----- - */ - - LWS_CALLBACK_SESSION_INFO = 54, - /**< This is only generated by user code using generic sessions. - * It's used to get a `struct lws_session_info` filled in by - * generic sessions with information about the logged-in user. - * See the messageboard sample for an example of how to use. */ - - LWS_CALLBACK_GS_EVENT = 55, - /**< Indicates an event happened to the Generic Sessions session. - * `in` contains a `struct lws_gs_event_args` describing the event. */ - - LWS_CALLBACK_HTTP_PMO = 56, - /**< per-mount options for this connection, called before - * the normal LWS_CALLBACK_HTTP when the mount has per-mount - * options. - */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to RAW sockets ----- - */ - - LWS_CALLBACK_RAW_RX = 59, - /**< RAW mode connection RX */ - - LWS_CALLBACK_RAW_CLOSE = 60, - /**< RAW mode connection is closing */ - - LWS_CALLBACK_RAW_WRITEABLE = 61, - /**< RAW mode connection may be written */ - - LWS_CALLBACK_RAW_ADOPT = 62, - /**< RAW mode connection was adopted (equivalent to 'wsi created') */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to RAW file handles ----- - */ - - LWS_CALLBACK_RAW_ADOPT_FILE = 63, - /**< RAW mode file was adopted (equivalent to 'wsi created') */ - - LWS_CALLBACK_RAW_RX_FILE = 64, - /**< This is the indication the RAW mode file has something to read. - * This doesn't actually do the read of the file and len is always - * 0... your code should do the read having been informed there is - * something to read now. */ - - LWS_CALLBACK_RAW_WRITEABLE_FILE = 65, - /**< RAW mode file is writeable */ - - LWS_CALLBACK_RAW_CLOSE_FILE = 66, - /**< RAW mode wsi that adopted a file is closing */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to generic wsi events ----- - */ - - LWS_CALLBACK_TIMER = 73, - /**< When the time elapsed after a call to - * lws_set_timer_usecs(wsi, usecs) is up, the wsi will get one of - * these callbacks. The deadline can be continuously extended into the - * future by later calls to lws_set_timer_usecs() before the deadline - * expires, or cancelled by lws_set_timer_usecs(wsi, -1); - * See the note on lws_set_timer_usecs() about which event loops are - * supported. */ - - LWS_CALLBACK_EVENT_WAIT_CANCELLED = 71, - /**< This is sent to every protocol of every vhost in response - * to lws_cancel_service() or lws_cancel_service_pt(). This - * callback is serialized in the lws event loop normally, even - * if the lws_cancel_service[_pt]() call was from a different - * thread. */ - - LWS_CALLBACK_CHILD_CLOSING = 69, - /**< Sent to parent to notify them a child is closing / being - * destroyed. in is the child wsi. - */ - - LWS_CALLBACK_CHILD_WRITE_VIA_PARENT = 68, - /**< Child has been marked with parent_carries_io attribute, so - * lws_write directs the to this callback at the parent, - * in is a struct lws_write_passthru containing the args - * the lws_write() was called with. - */ - - /* --------------------------------------------------------------------- - * ----- Callbacks related to TLS certificate management ----- - */ - - LWS_CALLBACK_VHOST_CERT_AGING = 72, - /**< When a vhost TLS cert has its expiry checked, this callback - * is broadcast to every protocol of every vhost in case the - * protocol wants to take some action with this information. - * \p in is a pointer to a struct lws_acme_cert_aging_args, - * and \p len is the number of days left before it expires, as - * a (ssize_t). In the struct lws_acme_cert_aging_args, vh - * points to the vhost the cert aging information applies to, - * and element_overrides[] is an optional way to update information - * from the pvos... NULL in an index means use the information from - * from the pvo for the cert renewal, non-NULL in the array index - * means use that pointer instead for the index. */ - - LWS_CALLBACK_VHOST_CERT_UPDATE = 74, - /**< When a vhost TLS cert is being updated, progress is - * reported to the vhost in question here, including completion - * and failure. in points to optional JSON, and len represents the - * connection state using enum lws_cert_update_state */ - - - /****** add new things just above ---^ ******/ - - LWS_CALLBACK_USER = 1000, - /**< user code can use any including above without fear of clashes */ -}; - - - -/** - * typedef lws_callback_function() - User server actions - * \param wsi: Opaque websocket instance pointer - * \param reason: The reason for the call - * \param user: Pointer to per-session user data allocated by library - * \param in: Pointer used for some callback reasons - * \param len: Length set for some callback reasons - * - * This callback is the way the user controls what is served. All the - * protocol detail is hidden and handled by the library. - * - * For each connection / session there is user data allocated that is - * pointed to by "user". You set the size of this user data area when - * the library is initialized with lws_create_server. - */ -typedef int -lws_callback_function(struct lws *wsi, enum lws_callback_reasons reason, - void *user, void *in, size_t len); - -#define LWS_CB_REASON_AUX_BF__CGI 1 -#define LWS_CB_REASON_AUX_BF__PROXY 2 -#define LWS_CB_REASON_AUX_BF__CGI_CHUNK_END 4 -#define LWS_CB_REASON_AUX_BF__CGI_HEADERS 8 -///@} - -struct lws_vhost; - -/*! \defgroup generic hash - * ## Generic Hash related functions - * - * Lws provides generic hash / digest accessors that abstract the ones - * provided by whatever OpenSSL library you are linking against. - * - * It lets you use the same code if you build against mbedtls or OpenSSL - * for example. - */ -///@{ - -#if defined(LWS_WITH_TLS) - -#if defined(LWS_WITH_MBEDTLS) -#include <mbedtls/sha1.h> -#include <mbedtls/sha256.h> -#include <mbedtls/sha512.h> -#endif - -enum lws_genhash_types { - LWS_GENHASH_TYPE_SHA1, - LWS_GENHASH_TYPE_SHA256, - LWS_GENHASH_TYPE_SHA384, - LWS_GENHASH_TYPE_SHA512, -}; - -enum lws_genhmac_types { - LWS_GENHMAC_TYPE_SHA256, - LWS_GENHMAC_TYPE_SHA384, - LWS_GENHMAC_TYPE_SHA512, -}; - -#define LWS_GENHASH_LARGEST 64 - -struct lws_genhash_ctx { - uint8_t type; -#if defined(LWS_WITH_MBEDTLS) - union { - mbedtls_sha1_context sha1; - mbedtls_sha256_context sha256; - mbedtls_sha512_context sha512; /* 384 also uses this */ - const mbedtls_md_info_t *hmac; - } u; -#else - const EVP_MD *evp_type; - EVP_MD_CTX *mdctx; -#endif -}; - -struct lws_genhmac_ctx { - uint8_t type; -#if defined(LWS_WITH_MBEDTLS) - const mbedtls_md_info_t *hmac; - mbedtls_md_context_t ctx; -#else - const EVP_MD *evp_type; - EVP_MD_CTX *ctx; -#endif -}; - -/** lws_genhash_size() - get hash size in bytes - * - * \param type: one of LWS_GENHASH_TYPE_... - * - * Returns number of bytes in this type of hash - */ -LWS_VISIBLE LWS_EXTERN size_t LWS_WARN_UNUSED_RESULT -lws_genhash_size(enum lws_genhash_types type); - -/** lws_genhmac_size() - get hash size in bytes - * - * \param type: one of LWS_GENHASH_TYPE_... - * - * Returns number of bytes in this type of hmac - */ -LWS_VISIBLE LWS_EXTERN size_t LWS_WARN_UNUSED_RESULT -lws_genhmac_size(enum lws_genhmac_types type); - -/** lws_genhash_init() - prepare your struct lws_genhash_ctx for use - * - * \param ctx: your struct lws_genhash_ctx - * \param type: one of LWS_GENHASH_TYPE_... - * - * Initializes the hash context for the type you requested - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_genhash_init(struct lws_genhash_ctx *ctx, enum lws_genhash_types type); - -/** lws_genhash_update() - digest len bytes of the buffer starting at in - * - * \param ctx: your struct lws_genhash_ctx - * \param in: start of the bytes to digest - * \param len: count of bytes to digest - * - * Updates the state of your hash context to reflect digesting len bytes from in - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_genhash_update(struct lws_genhash_ctx *ctx, const void *in, size_t len); - -/** lws_genhash_destroy() - copy out the result digest and destroy the ctx - * - * \param ctx: your struct lws_genhash_ctx - * \param result: NULL, or where to copy the result hash - * - * Finalizes the hash and copies out the digest. Destroys any allocations such - * that ctx can safely go out of scope after calling this. - * - * NULL result is supported so that you can destroy the ctx cleanly on error - * conditions, where there is no valid result. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genhash_destroy(struct lws_genhash_ctx *ctx, void *result); - -/** lws_genhmac_init() - prepare your struct lws_genhmac_ctx for use - * - * \param ctx: your struct lws_genhmac_ctx - * \param type: one of LWS_GENHMAC_TYPE_... - * \param key: pointer to the start of the HMAC key - * \param key_len: length of the HMAC key - * - * Initializes the hash context for the type you requested - * - * If the return is nonzero, it failed and there is nothing needing to be - * destroyed. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_genhmac_init(struct lws_genhmac_ctx *ctx, enum lws_genhmac_types type, - const uint8_t *key, size_t key_len); - -/** lws_genhmac_update() - digest len bytes of the buffer starting at in - * - * \param ctx: your struct lws_genhmac_ctx - * \param in: start of the bytes to digest - * \param len: count of bytes to digest - * - * Updates the state of your hash context to reflect digesting len bytes from in - * - * If the return is nonzero, it failed and needs destroying. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_genhmac_update(struct lws_genhmac_ctx *ctx, const void *in, size_t len); - -/** lws_genhmac_destroy() - copy out the result digest and destroy the ctx - * - * \param ctx: your struct lws_genhmac_ctx - * \param result: NULL, or where to copy the result hash - * - * Finalizes the hash and copies out the digest. Destroys any allocations such - * that ctx can safely go out of scope after calling this. - * - * NULL result is supported so that you can destroy the ctx cleanly on error - * conditions, where there is no valid result. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genhmac_destroy(struct lws_genhmac_ctx *ctx, void *result); -///@} - -/*! \defgroup generic RSA - * ## Generic RSA related functions - * - * Lws provides generic RSA functions that abstract the ones - * provided by whatever OpenSSL library you are linking against. - * - * It lets you use the same code if you build against mbedtls or OpenSSL - * for example. - */ -///@{ - -enum enum_jwk_tok { - JWK_KEY_E, - JWK_KEY_N, - JWK_KEY_D, - JWK_KEY_P, - JWK_KEY_Q, - JWK_KEY_DP, - JWK_KEY_DQ, - JWK_KEY_QI, - JWK_KTY, /* also serves as count of real elements */ - JWK_KEY, -}; - -#define LWS_COUNT_RSA_ELEMENTS JWK_KTY - -struct lws_genrsa_ctx { -#if defined(LWS_WITH_MBEDTLS) - mbedtls_rsa_context *ctx; -#else - BIGNUM *bn[LWS_COUNT_RSA_ELEMENTS]; - RSA *rsa; -#endif -}; - -struct lws_genrsa_element { - uint8_t *buf; - uint16_t len; -}; - -struct lws_genrsa_elements { - struct lws_genrsa_element e[LWS_COUNT_RSA_ELEMENTS]; -}; - -/** lws_jwk_destroy_genrsa_elements() - Free allocations in genrsa_elements - * - * \param el: your struct lws_genrsa_elements - * - * This is a helper for user code making use of struct lws_genrsa_elements - * where the elements are allocated on the heap, it frees any non-NULL - * buf element and sets the buf to NULL. - * - * NB: lws_genrsa_public_... apis do not need this as they take care of the key - * creation and destruction themselves. - */ -LWS_VISIBLE LWS_EXTERN void -lws_jwk_destroy_genrsa_elements(struct lws_genrsa_elements *el); - -/** lws_genrsa_public_decrypt_create() - Create RSA public decrypt context - * - * \param ctx: your struct lws_genrsa_ctx - * \param el: struct prepared with key element data - * - * Creates an RSA context with a public key associated with it, formed from - * the key elements in \p el. - * - * Returns 0 for OK or nonzero for error. - * - * This and related APIs operate identically with OpenSSL or mbedTLS backends. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genrsa_create(struct lws_genrsa_ctx *ctx, struct lws_genrsa_elements *el); - -/** lws_genrsa_new_keypair() - Create new RSA keypair - * - * \param context: your struct lws_context (may be used for RNG) - * \param ctx: your struct lws_genrsa_ctx - * \param el: struct to get the new key element data allocated into it - * \param bits: key size, eg, 4096 - * - * Creates a new RSA context and generates a new keypair into it, with \p bits - * bits. - * - * Returns 0 for OK or nonzero for error. - * - * This and related APIs operate identically with OpenSSL or mbedTLS backends. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genrsa_new_keypair(struct lws_context *context, struct lws_genrsa_ctx *ctx, - struct lws_genrsa_elements *el, int bits); - -/** lws_genrsa_public_decrypt() - Perform RSA public decryption - * - * \param ctx: your struct lws_genrsa_ctx - * \param in: encrypted input - * \param in_len: length of encrypted input - * \param out: decrypted output - * \param out_max: size of output buffer - * - * Performs the decryption. - * - * Returns <0 for error, or length of decrypted data. - * - * This and related APIs operate identically with OpenSSL or mbedTLS backends. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genrsa_public_decrypt(struct lws_genrsa_ctx *ctx, const uint8_t *in, - size_t in_len, uint8_t *out, size_t out_max); - -/** lws_genrsa_public_verify() - Perform RSA public verification - * - * \param ctx: your struct lws_genrsa_ctx - * \param in: unencrypted payload (usually a recomputed hash) - * \param hash_type: one of LWS_GENHASH_TYPE_ - * \param sig: pointer to the signature we received with the payload - * \param sig_len: length of the signature we are checking in bytes - * - * Returns <0 for error, or 0 if signature matches the payload + key. - * - * This and related APIs operate identically with OpenSSL or mbedTLS backends. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genrsa_public_verify(struct lws_genrsa_ctx *ctx, const uint8_t *in, - enum lws_genhash_types hash_type, - const uint8_t *sig, size_t sig_len); - -/** lws_genrsa_public_sign() - Create RSA signature - * - * \param ctx: your struct lws_genrsa_ctx - * \param in: precomputed hash - * \param hash_type: one of LWS_GENHASH_TYPE_ - * \param sig: pointer to buffer to take signature - * \param sig_len: length of the buffer (must be >= length of key N) - * - * Returns <0 for error, or 0 for success. - * - * This and related APIs operate identically with OpenSSL or mbedTLS backends. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genrsa_public_sign(struct lws_genrsa_ctx *ctx, const uint8_t *in, - enum lws_genhash_types hash_type, uint8_t *sig, - size_t sig_len); - -/** lws_genrsa_public_decrypt_destroy() - Destroy RSA public decrypt context - * - * \param ctx: your struct lws_genrsa_ctx - * - * Destroys any allocations related to \p ctx. - * - * This and related APIs operate identically with OpenSSL or mbedTLS backends. - */ -LWS_VISIBLE LWS_EXTERN void -lws_genrsa_destroy(struct lws_genrsa_ctx *ctx); - -/** lws_genrsa_render_pkey_asn1() - Exports public or private key to ASN1/DER - * - * \param ctx: your struct lws_genrsa_ctx - * \param _private: 0 = public part only, 1 = all parts of the key - * \param pkey_asn1: pointer to buffer to take the ASN1 - * \param pkey_asn1_len: max size of the pkey_asn1_len - * - * Returns length of pkey_asn1 written, or -1 for error. - */ -LWS_VISIBLE LWS_EXTERN int -lws_genrsa_render_pkey_asn1(struct lws_genrsa_ctx *ctx, int _private, - uint8_t *pkey_asn1, size_t pkey_asn1_len); -///@} - -/*! \defgroup jwk JSON Web Keys - * ## JSON Web Keys API - * - * Lws provides an API to parse JSON Web Keys into a struct lws_genrsa_elements. - * - * "oct" and "RSA" type keys are supported. For "oct" keys, they are held in - * the "e" member of the struct lws_genrsa_elements. - * - * Keys elements are allocated on the heap. You must destroy the allocations - * in the struct lws_genrsa_elements by calling - * lws_jwk_destroy_genrsa_elements() when you are finished with it. - */ -///@{ - -struct lws_jwk { - char keytype[5]; /**< "oct" or "RSA" */ - struct lws_genrsa_elements el; /**< OCTet key is in el.e */ -}; - -/** lws_jwk_import() - Create a JSON Web key from the textual representation - * - * \param s: the JWK object to create - * \param in: a single JWK JSON stanza in utf-8 - * \param len: the length of the JWK JSON stanza in bytes - * - * Creates an lws_jwk struct filled with data from the JSON representation. - * "oct" and "rsa" key types are supported. - * - * For "oct" type keys, it is loaded into el.e. - */ -LWS_VISIBLE LWS_EXTERN int -lws_jwk_import(struct lws_jwk *s, const char *in, size_t len); - -/** lws_jwk_destroy() - Destroy a JSON Web key - * - * \param s: the JWK object to destroy - * - * All allocations in the lws_jwk are destroyed - */ -LWS_VISIBLE LWS_EXTERN void -lws_jwk_destroy(struct lws_jwk *s); - -/** lws_jwk_export() - Export a JSON Web key to a textual representation - * - * \param s: the JWK object to export - * \param _private: 0 = just export public parts, 1 = export everything - * \param p: the buffer to write the exported JWK to - * \param len: the length of the buffer \p p in bytes - * - * Returns length of the used part of the buffer if OK, or -1 for error. - * - * Serializes the content of the JWK into a char buffer. - */ -LWS_VISIBLE LWS_EXTERN int -lws_jwk_export(struct lws_jwk *s, int _private, char *p, size_t len); - -/** lws_jwk_load() - Import a JSON Web key from a file - * - * \param s: the JWK object to load into - * \param filename: filename to load from - * - * Returns 0 for OK or -1 for failure - */ -LWS_VISIBLE int -lws_jwk_load(struct lws_jwk *s, const char *filename); - -/** lws_jwk_save() - Export a JSON Web key to a file - * - * \param s: the JWK object to save from - * \param filename: filename to save to - * - * Returns 0 for OK or -1 for failure - */ -LWS_VISIBLE int -lws_jwk_save(struct lws_jwk *s, const char *filename); - -/** lws_jwk_rfc7638_fingerprint() - jwk to RFC7638 compliant fingerprint - * - * \param s: the JWK object to fingerprint - * \param digest32: buffer to take 32-byte digest - * - * Returns 0 for OK or -1 for failure - */ -LWS_VISIBLE int -lws_jwk_rfc7638_fingerprint(struct lws_jwk *s, char *digest32); -///@} - - -/*! \defgroup jws JSON Web Signature - * ## JSON Web Signature API - * - * Lws provides an API to check and create RFC7515 JSON Web Signatures - * - * SHA256/384/512 HMAC, and RSA 256/384/512 are supported. - * - * The API uses your TLS library crypto, but works exactly the same no matter - * what you TLS backend is. - */ -///@{ - -LWS_VISIBLE LWS_EXTERN int -lws_jws_confirm_sig(const char *in, size_t len, struct lws_jwk *jwk); - -/** - * lws_jws_sign_from_b64() - add b64 sig to b64 hdr + payload - * - * \param b64_hdr: protected header encoded in b64, may be NULL - * \param hdr_len: bytes in b64 coding of protected header - * \param b64_pay: payload encoded in b64 - * \param pay_len: bytes in b64 coding of payload - * \param b64_sig: buffer to write the b64 encoded signature into - * \param sig_len: max bytes we can write at b64_sig - * \param hash_type: one of LWS_GENHASH_TYPE_SHA[256|384|512] - * \param jwk: the struct lws_jwk containing the signing key - * - * This adds a b64-coded JWS signature of the b64-encoded protected header - * and b64-encoded payload, at \p b64_sig. The signature will be as large - * as the N element of the RSA key when the RSA key is used, eg, 512 bytes for - * a 4096-bit key, and then b64-encoding on top. - * - * In some special cases, there is only payload to sign and no header, in that - * case \p b64_hdr may be NULL, and only the payload will be hashed before - * signing. - * - * Returns the length of the encoded signature written to \p b64_sig, or -1. - */ -LWS_VISIBLE LWS_EXTERN int -lws_jws_sign_from_b64(const char *b64_hdr, size_t hdr_len, const char *b64_pay, - size_t pay_len, char *b64_sig, size_t sig_len, - enum lws_genhash_types hash_type, struct lws_jwk *jwk); - -/** - * lws_jws_create_packet() - add b64 sig to b64 hdr + payload - * - * \param jwk: the struct lws_jwk containing the signing key - * \param payload: unencoded payload JSON - * \param len: length of unencoded payload JSON - * \param nonce: Nonse string to include in protected header - * \param out: buffer to take signed packet - * \param out_len: size of \p out buffer - * - * This creates a "flattened" JWS packet from the jwk and the plaintext - * payload, and signs it. The packet is written into \p out. - * - * This does the whole packet assembly and signing, calling through to - * lws_jws_sign_from_b64() as part of the process. - * - * Returns the length written to \p out, or -1. - */ -LWS_VISIBLE LWS_EXTERN int -lws_jws_create_packet(struct lws_jwk *jwk, const char *payload, size_t len, - const char *nonce, char *out, size_t out_len); - -/** - * lws_jws_base64_enc() - encode input data into b64url data - * - * \param in: the incoming plaintext - * \param in_len: the length of the incoming plaintext in bytes - * \param out: the buffer to store the b64url encoded data to - * \param out_max: the length of \p out in bytes - * - * Returns either -1 if problems, or the number of bytes written to \p out. - */ -LWS_VISIBLE LWS_EXTERN int -lws_jws_base64_enc(const char *in, size_t in_len, char *out, size_t out_max); -///@} -#endif - -/*! \defgroup extensions Extension related functions - * ##Extension releated functions - * - * Ws defines optional extensions, lws provides the ability to implement these - * in user code if so desired. - * - * We provide one extensions permessage-deflate. - */ -///@{ - -/* - * NOTE: These public enums are part of the abi. If you want to add one, - * add it at where specified so existing users are unaffected. - */ -enum lws_extension_callback_reasons { - LWS_EXT_CB_CONSTRUCT = 4, - LWS_EXT_CB_CLIENT_CONSTRUCT = 5, - LWS_EXT_CB_DESTROY = 8, - LWS_EXT_CB_PACKET_TX_PRESEND = 12, - LWS_EXT_CB_PAYLOAD_TX = 21, - LWS_EXT_CB_PAYLOAD_RX = 22, - LWS_EXT_CB_OPTION_DEFAULT = 23, - LWS_EXT_CB_OPTION_SET = 24, - LWS_EXT_CB_OPTION_CONFIRM = 25, - LWS_EXT_CB_NAMED_OPTION_SET = 26, - - /****** add new things just above ---^ ******/ -}; - -/** enum lws_ext_options_types */ -enum lws_ext_options_types { - EXTARG_NONE, /**< does not take an argument */ - EXTARG_DEC, /**< requires a decimal argument */ - EXTARG_OPT_DEC /**< may have an optional decimal argument */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility */ -}; - -/** struct lws_ext_options - Option arguments to the extension. These are - * used in the negotiation at ws upgrade time. - * The helper function lws_ext_parse_options() - * uses these to generate callbacks */ -struct lws_ext_options { - const char *name; /**< Option name, eg, "server_no_context_takeover" */ - enum lws_ext_options_types type; /**< What kind of args the option can take */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility */ -}; - -/** struct lws_ext_option_arg */ -struct lws_ext_option_arg { - const char *option_name; /**< may be NULL, option_index used then */ - int option_index; /**< argument ordinal to use if option_name missing */ - const char *start; /**< value */ - int len; /**< length of value */ -}; - -/** - * typedef lws_extension_callback_function() - Hooks to allow extensions to operate - * \param context: Websockets context - * \param ext: This extension - * \param wsi: Opaque websocket instance pointer - * \param reason: The reason for the call - * \param user: Pointer to ptr to per-session user data allocated by library - * \param in: Pointer used for some callback reasons - * \param len: Length set for some callback reasons - * - * Each extension that is active on a particular connection receives - * callbacks during the connection lifetime to allow the extension to - * operate on websocket data and manage itself. - * - * Libwebsockets takes care of allocating and freeing "user" memory for - * each active extension on each connection. That is what is pointed to - * by the user parameter. - * - * LWS_EXT_CB_CONSTRUCT: called when the server has decided to - * select this extension from the list provided by the client, - * just before the server will send back the handshake accepting - * the connection with this extension active. This gives the - * extension a chance to initialize its connection context found - * in user. - * - * LWS_EXT_CB_CLIENT_CONSTRUCT: same as LWS_EXT_CB_CONSTRUCT - * but called when client is instantiating this extension. Some - * extensions will work the same on client and server side and then - * you can just merge handlers for both CONSTRUCTS. - * - * LWS_EXT_CB_DESTROY: called when the connection the extension was - * being used on is about to be closed and deallocated. It's the - * last chance for the extension to deallocate anything it has - * allocated in the user data (pointed to by user) before the - * user data is deleted. This same callback is used whether you - * are in client or server instantiation context. - * - * LWS_EXT_CB_PACKET_TX_PRESEND: this works the same way as - * LWS_EXT_CB_PACKET_RX_PREPARSE above, except it gives the - * extension a chance to change websocket data just before it will - * be sent out. Using the same lws_token pointer scheme in in, - * the extension can change the buffer and the length to be - * transmitted how it likes. Again if it wants to grow the - * buffer safely, it should copy the data into its own buffer and - * set the lws_tokens token pointer to it. - * - * LWS_EXT_CB_ARGS_VALIDATE: - */ -typedef int -lws_extension_callback_function(struct lws_context *context, - const struct lws_extension *ext, struct lws *wsi, - enum lws_extension_callback_reasons reason, - void *user, void *in, size_t len); - -/** struct lws_extension - An extension we support */ -struct lws_extension { - const char *name; /**< Formal extension name, eg, "permessage-deflate" */ - lws_extension_callback_function *callback; /**< Service callback */ - const char *client_offer; /**< String containing exts and options client offers */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility */ -}; - -/** - * lws_set_extension_option(): set extension option if possible - * - * \param wsi: websocket connection - * \param ext_name: name of ext, like "permessage-deflate" - * \param opt_name: name of option, like "rx_buf_size" - * \param opt_val: value to set option to - */ -LWS_VISIBLE LWS_EXTERN int -lws_set_extension_option(struct lws *wsi, const char *ext_name, - const char *opt_name, const char *opt_val); - -/** - * lws_ext_parse_options() - deal with parsing negotiated extension options - * - * \param ext: related extension struct - * \param wsi: websocket connection - * \param ext_user: per-connection extension private data - * \param opts: list of supported options - * \param o: option string to parse - * \param len: length - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_ext_parse_options(const struct lws_extension *ext, struct lws *wsi, - void *ext_user, const struct lws_ext_options *opts, - const char *o, int len); - -/** lws_extension_callback_pm_deflate() - extension for RFC7692 - * - * \param context: lws context - * \param ext: related lws_extension struct - * \param wsi: websocket connection - * \param reason: incoming callback reason - * \param user: per-connection extension private data - * \param in: pointer parameter - * \param len: length parameter - * - * Built-in callback implementing RFC7692 permessage-deflate - */ -LWS_EXTERN -int lws_extension_callback_pm_deflate( - struct lws_context *context, const struct lws_extension *ext, - struct lws *wsi, enum lws_extension_callback_reasons reason, - void *user, void *in, size_t len); - -/* - * The internal exts are part of the public abi - * If we add more extensions, publish the callback here ------v - */ -///@} - -/*! \defgroup Protocols-and-Plugins Protocols and Plugins - * \ingroup lwsapi - * - * ##Protocol and protocol plugin -related apis - * - * Protocols bind ws protocol names to a custom callback specific to that - * protocol implementaion. - * - * A list of protocols can be passed in at context creation time, but it is - * also legal to leave that NULL and add the protocols and their callback code - * using plugins. - * - * Plugins are much preferable compared to cut and pasting code into an - * application each time, since they can be used standalone. - */ -///@{ -/** struct lws_protocols - List of protocols and handlers client or server - * supports. */ - -struct lws_protocols { - const char *name; - /**< Protocol name that must match the one given in the client - * Javascript new WebSocket(url, 'protocol') name. */ - lws_callback_function *callback; - /**< The service callback used for this protocol. It allows the - * service action for an entire protocol to be encapsulated in - * the protocol-specific callback */ - size_t per_session_data_size; - /**< Each new connection using this protocol gets - * this much memory allocated on connection establishment and - * freed on connection takedown. A pointer to this per-connection - * allocation is passed into the callback in the 'user' parameter */ - size_t rx_buffer_size; - /**< lws allocates this much space for rx data and informs callback - * when something came. Due to rx flow control, the callback may not - * be able to consume it all without having to return to the event - * loop. That is supported in lws. - * - * If .tx_packet_size is 0, this also controls how much may be sent at - * once for backwards compatibility. - */ - unsigned int id; - /**< ignored by lws, but useful to contain user information bound - * to the selected protocol. For example if this protocol was - * called "myprotocol-v2", you might set id to 2, and the user - * code that acts differently according to the version can do so by - * switch (wsi->protocol->id), user code might use some bits as - * capability flags based on selected protocol version, etc. */ - void *user; /**< ignored by lws, but user code can pass a pointer - here it can later access from the protocol callback */ - size_t tx_packet_size; - /**< 0 indicates restrict send() size to .rx_buffer_size for backwards- - * compatibility. - * If greater than zero, a single send() is restricted to this amount - * and any remainder is buffered by lws and sent afterwards also in - * these size chunks. Since that is expensive, it's preferable - * to restrict one fragment you are trying to send to match this - * size. - */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility */ -}; - -/** - * lws_vhost_name_to_protocol() - get vhost's protocol object from its name - * - * \param vh: vhost to search - * \param name: protocol name - * - * Returns NULL or a pointer to the vhost's protocol of the requested name - */ -LWS_VISIBLE LWS_EXTERN const struct lws_protocols * -lws_vhost_name_to_protocol(struct lws_vhost *vh, const char *name); - -/** - * lws_get_protocol() - Returns a protocol pointer from a websocket - * connection. - * \param wsi: pointer to struct websocket you want to know the protocol of - * - * - * Some apis can act on all live connections of a given protocol, - * this is how you can get a pointer to the active protocol if needed. - */ -LWS_VISIBLE LWS_EXTERN const struct lws_protocols * -lws_get_protocol(struct lws *wsi); - -/** lws_protocol_get() - deprecated: use lws_get_protocol */ -LWS_VISIBLE LWS_EXTERN const struct lws_protocols * -lws_protocol_get(struct lws *wsi) LWS_WARN_DEPRECATED; - -/** - * lws_protocol_vh_priv_zalloc() - Allocate and zero down a protocol's per-vhost - * storage - * \param vhost: vhost the instance is related to - * \param prot: protocol the instance is related to - * \param size: bytes to allocate - * - * Protocols often find it useful to allocate a per-vhost struct, this is a - * helper to be called in the per-vhost init LWS_CALLBACK_PROTOCOL_INIT - */ -LWS_VISIBLE LWS_EXTERN void * -lws_protocol_vh_priv_zalloc(struct lws_vhost *vhost, const struct lws_protocols *prot, - int size); - -/** - * lws_protocol_vh_priv_get() - retreive a protocol's per-vhost storage - * - * \param vhost: vhost the instance is related to - * \param prot: protocol the instance is related to - * - * Recover a pointer to the allocated per-vhost storage for the protocol created - * by lws_protocol_vh_priv_zalloc() earlier - */ -LWS_VISIBLE LWS_EXTERN void * -lws_protocol_vh_priv_get(struct lws_vhost *vhost, const struct lws_protocols *prot); - -/** - * lws_adjust_protocol_psds - change a vhost protocol's per session data size - * - * \param wsi: a connection with the protocol to change - * \param new_size: the new size of the per session data size for the protocol - * - * Returns user_space for the wsi, after allocating - * - * This should not be used except to initalize a vhost protocol's per session - * data size one time, before any connections are accepted. - * - * Sometimes the protocol wraps another protocol and needs to discover and set - * its per session data size at runtime. - */ -LWS_VISIBLE LWS_EXTERN void * -lws_adjust_protocol_psds(struct lws *wsi, size_t new_size); - -/** - * lws_finalize_startup() - drop initial process privileges - * - * \param context: lws context - * - * This is called after the end of the vhost protocol initializations, but - * you may choose to call it earlier - */ -LWS_VISIBLE LWS_EXTERN int -lws_finalize_startup(struct lws_context *context); - -/** - * lws_pvo_search() - helper to find a named pvo in a linked-list - * - * \param pvo: the first pvo in the linked-list - * \param name: the name of the pvo to return if found - * - * Returns NULL, or a pointer to the name pvo in the linked-list - */ -LWS_VISIBLE LWS_EXTERN const struct lws_protocol_vhost_options * -lws_pvo_search(const struct lws_protocol_vhost_options *pvo, const char *name); - -LWS_VISIBLE LWS_EXTERN int -lws_protocol_init(struct lws_context *context); - -#ifdef LWS_WITH_PLUGINS - -/* PLUGINS implies LIBUV */ - -#define LWS_PLUGIN_API_MAGIC 180 - -/** struct lws_plugin_capability - how a plugin introduces itself to lws */ -struct lws_plugin_capability { - unsigned int api_magic; /**< caller fills this in, plugin fills rest */ - const struct lws_protocols *protocols; /**< array of supported protocols provided by plugin */ - int count_protocols; /**< how many protocols */ - const struct lws_extension *extensions; /**< array of extensions provided by plugin */ - int count_extensions; /**< how many extensions */ -}; - -typedef int (*lws_plugin_init_func)(struct lws_context *, - struct lws_plugin_capability *); -typedef int (*lws_plugin_destroy_func)(struct lws_context *); - -/** struct lws_plugin */ -struct lws_plugin { - struct lws_plugin *list; /**< linked list */ -#if (UV_VERSION_MAJOR > 0) - uv_lib_t lib; /**< shared library pointer */ -#else - void *l; /**< so we can compile on ancient libuv */ -#endif - char name[64]; /**< name of the plugin */ - struct lws_plugin_capability caps; /**< plugin capabilities */ -}; - -#endif - -///@} - - -/*! \defgroup generic-sessions plugin: generic-sessions - * \ingroup Protocols-and-Plugins - * - * ##Plugin Generic-sessions related - * - * generic-sessions plugin provides a reusable, generic session and login / - * register / forgot password framework including email verification. - */ -///@{ - -#define LWSGS_EMAIL_CONTENT_SIZE 16384 -/**< Maximum size of email we might send */ - -/* SHA-1 binary and hexified versions */ -/** typedef struct lwsgw_hash_bin */ -typedef struct { unsigned char bin[20]; /**< binary representation of hash */} lwsgw_hash_bin; -/** typedef struct lwsgw_hash */ -typedef struct { char id[41]; /**< ascii hex representation of hash */ } lwsgw_hash; - -/** enum lwsgs_auth_bits */ -enum lwsgs_auth_bits { - LWSGS_AUTH_LOGGED_IN = 1, /**< user is logged in as somebody */ - LWSGS_AUTH_ADMIN = 2, /**< logged in as the admin user */ - LWSGS_AUTH_VERIFIED = 4, /**< user has verified his email */ - LWSGS_AUTH_FORGOT_FLOW = 8, /**< he just completed "forgot password" flow */ -}; - -/** struct lws_session_info - information about user session status */ -struct lws_session_info { - char username[32]; /**< username logged in as, or empty string */ - char email[100]; /**< email address associated with login, or empty string */ - char ip[72]; /**< ip address session was started from */ - unsigned int mask; /**< access rights mask associated with session - * see enum lwsgs_auth_bits */ - char session[42]; /**< session id string, usable as opaque uid when not logged in */ -}; - -/** enum lws_gs_event */ -enum lws_gs_event { - LWSGSE_CREATED, /**< a new user was created */ - LWSGSE_DELETED /**< an existing user was deleted */ -}; - -/** struct lws_gs_event_args */ -struct lws_gs_event_args { - enum lws_gs_event event; /**< which event happened */ - const char *username; /**< which username the event happened to */ - const char *email; /**< the email address of that user */ -}; - -///@} - - -/*! \defgroup context-and-vhost context and vhost related functions - * ##Context and Vhost releated functions - * \ingroup lwsapi - * - * - * LWS requires that there is one context, in which you may define multiple - * vhosts. Each vhost is a virtual host, with either its own listen port - * or sharing an existing one. Each vhost has its own SSL context that can - * be set up individually or left disabled. - * - * If you don't care about multiple "site" support, you can ignore it and - * lws will create a single default vhost at context creation time. - */ -///@{ - -/* - * NOTE: These public enums are part of the abi. If you want to add one, - * add it at where specified so existing users are unaffected. - */ - -/** enum lws_context_options - context and vhost options */ -enum lws_context_options { - LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = (1 << 1) | - (1 << 12), - /**< (VH) Don't allow the connection unless the client has a - * client cert that we recognize; provides - * LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT */ - LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = (1 << 2), - /**< (CTX) Don't try to get the server's hostname */ - LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT = (1 << 3) | - (1 << 12), - /**< (VH) Allow non-SSL (plaintext) connections on the same - * port as SSL is listening... undermines the security of SSL; - * provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT */ - LWS_SERVER_OPTION_LIBEV = (1 << 4), - /**< (CTX) Use libev event loop */ - LWS_SERVER_OPTION_DISABLE_IPV6 = (1 << 5), - /**< (VH) Disable IPV6 support */ - LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS = (1 << 6), - /**< (VH) Don't load OS CA certs, you will need to load your - * own CA cert(s) */ - LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED = (1 << 7), - /**< (VH) Accept connections with no valid Cert (eg, selfsigned) */ - LWS_SERVER_OPTION_VALIDATE_UTF8 = (1 << 8), - /**< (VH) Check UT-8 correctness */ - LWS_SERVER_OPTION_SSL_ECDH = (1 << 9) | - (1 << 12), - /**< (VH) initialize ECDH ciphers */ - LWS_SERVER_OPTION_LIBUV = (1 << 10), - /**< (CTX) Use libuv event loop */ - LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS = (1 << 11) | - (1 << 12), - /**< (VH) Use http redirect to force http to https - * (deprecated: use mount redirection) */ - LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT = (1 << 12), - /**< (CTX) Initialize the SSL library at all */ - LWS_SERVER_OPTION_EXPLICIT_VHOSTS = (1 << 13), - /**< (CTX) Only create the context when calling context - * create api, implies user code will create its own vhosts */ - LWS_SERVER_OPTION_UNIX_SOCK = (1 << 14), - /**< (VH) Use Unix socket */ - LWS_SERVER_OPTION_STS = (1 << 15), - /**< (VH) Send Strict Transport Security header, making - * clients subsequently go to https even if user asked for http */ - LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY = (1 << 16), - /**< (VH) Enable LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE to take effect */ - LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE = (1 << 17), - /**< (VH) if set, only ipv6 allowed on the vhost */ - LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN = (1 << 18), - /**< (CTX) Libuv only: Do not spin on SIGSEGV / SIGFPE. A segfault - * normally makes the lib spin so you can attach a debugger to it - * even if it happened without a debugger in place. You can disable - * that by giving this option. - */ - LWS_SERVER_OPTION_JUST_USE_RAW_ORIGIN = (1 << 19), - /**< For backwards-compatibility reasons, by default - * lws prepends "http://" to the origin you give in the client - * connection info struct. If you give this flag when you create - * the context, only the string you give in the client connect - * info for .origin (if any) will be used directly. - */ - LWS_SERVER_OPTION_FALLBACK_TO_RAW = (1 << 20), - /**< (VH) if invalid http is coming in the first line, */ - LWS_SERVER_OPTION_LIBEVENT = (1 << 21), - /**< (CTX) Use libevent event loop */ - LWS_SERVER_OPTION_ONLY_RAW = (1 << 22), - /**< (VH) All connections to this vhost / port are RAW as soon as - * the connection is accepted, no HTTP is going to be coming. - */ - LWS_SERVER_OPTION_ALLOW_LISTEN_SHARE = (1 << 23), - /**< (VH) Set to allow multiple listen sockets on one interface + - * address + port. The default is to strictly allow only one - * listen socket at a time. This is automatically selected if you - * have multiple service threads. - */ - LWS_SERVER_OPTION_CREATE_VHOST_SSL_CTX = (1 << 24), - /**< (VH) Force setting up the vhost SSL_CTX, even though the user - * code doesn't explicitly provide a cert in the info struct. It - * implies the user code is going to provide a cert at the - * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS callback, which - * provides the vhost SSL_CTX * in the user parameter. - */ - LWS_SERVER_OPTION_SKIP_PROTOCOL_INIT = (1 << 25), - /**< (VH) You probably don't want this. It forces this vhost to not - * call LWS_CALLBACK_PROTOCOL_INIT on its protocols. It's used in the - * special case of a temporary vhost bound to a single protocol. - */ - LWS_SERVER_OPTION_IGNORE_MISSING_CERT = (1 << 26), - /**< (VH) Don't fail if the vhost TLS cert or key are missing, just - * continue. The vhost won't be able to serve anything, but if for - * example the ACME plugin was configured to fetch a cert, this lets - * you bootstrap your vhost from having no cert to start with. - */ - - /****** add new things just above ---^ ******/ -}; - -#define lws_check_opt(c, f) (((c) & (f)) == (f)) - -struct lws_plat_file_ops; - -/** struct lws_context_creation_info - parameters to create context and /or vhost with - * - * This is also used to create vhosts.... if LWS_SERVER_OPTION_EXPLICIT_VHOSTS - * is not given, then for backwards compatibility one vhost is created at - * context-creation time using the info from this struct. - * - * If LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, then no vhosts are created - * at the same time as the context, they are expected to be created afterwards. - */ -struct lws_context_creation_info { - int port; - /**< VHOST: Port to listen on. Use CONTEXT_PORT_NO_LISTEN to suppress - * listening for a client. Use CONTEXT_PORT_NO_LISTEN_SERVER if you are - * writing a server but you are using \ref sock-adopt instead of the - * built-in listener. - * - * You can also set port to 0, in which case the kernel will pick - * a random port that is not already in use. You can find out what - * port the vhost is listening on using lws_get_vhost_listen_port() */ - const char *iface; - /**< VHOST: NULL to bind the listen socket to all interfaces, or the - * interface name, eg, "eth2" - * If options specifies LWS_SERVER_OPTION_UNIX_SOCK, this member is - * the pathname of a UNIX domain socket. you can use the UNIX domain - * sockets in abstract namespace, by prepending an at symbol to the - * socket name. */ - const struct lws_protocols *protocols; - /**< VHOST: Array of structures listing supported protocols and a protocol- - * specific callback for each one. The list is ended with an - * entry that has a NULL callback pointer. */ - const struct lws_extension *extensions; - /**< VHOST: NULL or array of lws_extension structs listing the - * extensions this context supports. */ - const struct lws_token_limits *token_limits; - /**< CONTEXT: NULL or struct lws_token_limits pointer which is initialized - * with a token length limit for each possible WSI_TOKEN_ */ - const char *ssl_private_key_password; - /**< VHOST: NULL or the passphrase needed for the private key. (For - * backwards compatibility, this can also be used to pass the client - * cert passphrase when setting up a vhost client SSL context, but it is - * preferred to use .client_ssl_private_key_password for that.) */ - const char *ssl_cert_filepath; - /**< VHOST: If libwebsockets was compiled to use ssl, and you want - * to listen using SSL, set to the filepath to fetch the - * server cert from, otherwise NULL for unencrypted. (For backwards - * compatibility, this can also be used to pass the client certificate - * when setting up a vhost client SSL context, but it is preferred to - * use .client_ssl_cert_filepath for that.) */ - const char *ssl_private_key_filepath; - /**< VHOST: filepath to private key if wanting SSL mode; - * if this is set to NULL but ssl_cert_filepath is set, the - * OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY callback is called - * to allow setting of the private key directly via openSSL - * library calls. (For backwards compatibility, this can also be used - * to pass the client cert private key filepath when setting up a - * vhost client SSL context, but it is preferred to use - * .client_ssl_private_key_filepath for that.) */ - const char *ssl_ca_filepath; - /**< VHOST: CA certificate filepath or NULL. (For backwards - * compatibility, this can also be used to pass the client CA - * filepath when setting up a vhost client SSL context, - * but it is preferred to use .client_ssl_ca_filepath for that.) */ - const char *ssl_cipher_list; - /**< VHOST: List of valid ciphers to use (eg, - * "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" - * or you can leave it as NULL to get "DEFAULT" (For backwards - * compatibility, this can also be used to pass the client cipher - * list when setting up a vhost client SSL context, - * but it is preferred to use .client_ssl_cipher_list for that.)*/ - const char *http_proxy_address; - /**< VHOST: If non-NULL, attempts to proxy via the given address. - * If proxy auth is required, use format "username:password\@server:port" */ - unsigned int http_proxy_port; - /**< VHOST: If http_proxy_address was non-NULL, uses this port */ - int gid; - /**< CONTEXT: group id to change to after setting listen socket, or -1. */ - int uid; - /**< CONTEXT: user id to change to after setting listen socket, or -1. */ - unsigned int options; - /**< VHOST + CONTEXT: 0, or LWS_SERVER_OPTION_... bitfields */ - void *user; - /**< VHOST + CONTEXT: optional user pointer that will be associated - * with the context when creating the context (and can be retrieved by - * lws_context_user(context), or with the vhost when creating the vhost - * (and can be retrieved by lws_vhost_user(vhost)). You will need to - * use LWS_SERVER_OPTION_EXPLICIT_VHOSTS and create the vhost separately - * if you care about giving the context and vhost different user pointer - * values. - */ - int ka_time; - /**< CONTEXT: 0 for no TCP keepalive, otherwise apply this keepalive - * timeout to all libwebsocket sockets, client or server */ - int ka_probes; - /**< CONTEXT: if ka_time was nonzero, after the timeout expires how many - * times to try to get a response from the peer before giving up - * and killing the connection */ - int ka_interval; - /**< CONTEXT: if ka_time was nonzero, how long to wait before each ka_probes - * attempt */ -#if defined(LWS_WITH_TLS) && !defined(LWS_WITH_MBEDTLS) - SSL_CTX *provided_client_ssl_ctx; - /**< CONTEXT: If non-null, swap out libwebsockets ssl - * implementation for the one provided by provided_ssl_ctx. - * Libwebsockets no longer is responsible for freeing the context - * if this option is selected. */ -#else /* maintain structure layout either way */ - void *provided_client_ssl_ctx; /**< dummy if ssl disabled */ -#endif - - short max_http_header_data; - /**< CONTEXT: The max amount of header payload that can be handled - * in an http request (unrecognized header payload is dropped) */ - short max_http_header_pool; - /**< CONTEXT: The max number of connections with http headers that - * can be processed simultaneously (the corresponding memory is - * allocated and deallocated dynamically as needed). If the pool is - * fully busy new incoming connections must wait for accept until one - * becomes free. 0 = allow as many ah as number of availble fds for - * the process */ - - unsigned int count_threads; - /**< CONTEXT: how many contexts to create in an array, 0 = 1 */ - unsigned int fd_limit_per_thread; - /**< CONTEXT: nonzero means restrict each service thread to this - * many fds, 0 means the default which is divide the process fd - * limit by the number of threads. */ - unsigned int timeout_secs; - /**< VHOST: various processes involving network roundtrips in the - * library are protected from hanging forever by timeouts. If - * nonzero, this member lets you set the timeout used in seconds. - * Otherwise a default timeout is used. */ - const char *ecdh_curve; - /**< VHOST: if NULL, defaults to initializing server with "prime256v1" */ - const char *vhost_name; - /**< VHOST: name of vhost, must match external DNS name used to - * access the site, like "warmcat.com" as it's used to match - * Host: header and / or SNI name for SSL. */ - const char * const *plugin_dirs; - /**< CONTEXT: NULL, or NULL-terminated array of directories to - * scan for lws protocol plugins at context creation time */ - const struct lws_protocol_vhost_options *pvo; - /**< VHOST: pointer to optional linked list of per-vhost - * options made accessible to protocols */ - int keepalive_timeout; - /**< VHOST: (default = 0 = 5s) seconds to allow remote - * client to hold on to an idle HTTP/1.1 connection */ - const char *log_filepath; - /**< VHOST: filepath to append logs to... this is opened before - * any dropping of initial privileges */ - const struct lws_http_mount *mounts; - /**< VHOST: optional linked list of mounts for this vhost */ - const char *server_string; - /**< CONTEXT: string used in HTTP headers to identify server - * software, if NULL, "libwebsockets". */ - unsigned int pt_serv_buf_size; - /**< CONTEXT: 0 = default of 4096. This buffer is used by - * various service related features including file serving, it - * defines the max chunk of file that can be sent at once. - * At the risk of lws having to buffer failed large sends, it - * can be increased to, eg, 128KiB to improve throughput. */ - unsigned int max_http_header_data2; - /**< CONTEXT: if max_http_header_data is 0 and this - * is nonzero, this will be used in place of the default. It's - * like this for compatibility with the original short version, - * this is unsigned int length. */ - long ssl_options_set; - /**< VHOST: Any bits set here will be set as SSL options */ - long ssl_options_clear; - /**< VHOST: Any bits set here will be cleared as SSL options */ - unsigned short ws_ping_pong_interval; - /**< CONTEXT: 0 for none, else interval in seconds between sending - * PINGs on idle websocket connections. When the PING is sent, - * the PONG must come within the normal timeout_secs timeout period - * or the connection will be dropped. - * Any RX or TX traffic on the connection restarts the interval timer, - * so a connection which always sends or receives something at intervals - * less than the interval given here will never send PINGs / expect - * PONGs. Conversely as soon as the ws connection is established, an - * idle connection will do the PING / PONG roundtrip as soon as - * ws_ping_pong_interval seconds has passed without traffic - */ - const struct lws_protocol_vhost_options *headers; - /**< VHOST: pointer to optional linked list of per-vhost - * canned headers that are added to server responses */ - - const struct lws_protocol_vhost_options *reject_service_keywords; - /**< CONTEXT: Optional list of keywords and rejection codes + text. - * - * The keywords are checked for existing in the user agent string. - * - * Eg, "badrobot" "404 Not Found" - */ - void *external_baggage_free_on_destroy; - /**< CONTEXT: NULL, or pointer to something externally malloc'd, that - * should be freed when the context is destroyed. This allows you to - * automatically sync the freeing action to the context destruction - * action, so there is no need for an external free() if the context - * succeeded to create. - */ - - const char *client_ssl_private_key_password; - /**< VHOST: Client SSL context init: NULL or the passphrase needed - * for the private key */ - const char *client_ssl_cert_filepath; - /**< VHOST: Client SSL context init:T he certificate the client - * should present to the peer on connection */ - const char *client_ssl_private_key_filepath; - /**< VHOST: Client SSL context init: filepath to client private key - * if this is set to NULL but client_ssl_cert_filepath is set, you - * can handle the LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS - * callback of protocols[0] to allow setting of the private key directly - * via openSSL library calls */ - const char *client_ssl_ca_filepath; - /**< VHOST: Client SSL context init: CA certificate filepath or NULL */ - const char *client_ssl_cipher_list; - /**< VHOST: Client SSL context init: List of valid ciphers to use (eg, - * "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" - * or you can leave it as NULL to get "DEFAULT" */ - - const struct lws_plat_file_ops *fops; - /**< CONTEXT: NULL, or pointer to an array of fops structs, terminated - * by a sentinel with NULL .open. - * - * If NULL, lws provides just the platform file operations struct for - * backwards compatibility. - */ - int simultaneous_ssl_restriction; - /**< CONTEXT: 0 (no limit) or limit of simultaneous SSL sessions possible.*/ - const char *socks_proxy_address; - /**< VHOST: If non-NULL, attempts to proxy via the given address. - * If proxy auth is required, use format "username:password\@server:port" */ - unsigned int socks_proxy_port; - /**< VHOST: If socks_proxy_address was non-NULL, uses this port */ -#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) - cap_value_t caps[4]; - /**< CONTEXT: array holding Linux capabilities you want to - * continue to be available to the server after it transitions - * to a noprivileged user. Usually none are needed but for, eg, - * .bind_iface, CAP_NET_RAW is required. This gives you a way - * to still have the capability but drop root. - */ - char count_caps; - /**< CONTEXT: count of Linux capabilities in .caps[]. 0 means - * no capabilities will be inherited from root (the default) */ -#endif - int bind_iface; - /**< VHOST: nonzero to strictly bind sockets to the interface name in - * .iface (eg, "eth2"), using SO_BIND_TO_DEVICE. - * - * Requires SO_BINDTODEVICE support from your OS and CAP_NET_RAW - * capability. - * - * Notice that common things like access network interface IP from - * your local machine use your lo / loopback interface and will be - * disallowed by this. - */ - int ssl_info_event_mask; - /**< VHOST: mask of ssl events to be reported on LWS_CALLBACK_SSL_INFO - * callback for connections on this vhost. The mask values are of - * the form SSL_CB_ALERT, defined in openssl/ssl.h. The default of - * 0 means no info events will be reported. - */ - unsigned int timeout_secs_ah_idle; - /**< VHOST: seconds to allow a client to hold an ah without using it. - * 0 defaults to 10s. */ - unsigned short ip_limit_ah; - /**< CONTEXT: max number of ah a single IP may use simultaneously - * 0 is no limit. This is a soft limit: if the limit is - * reached, connections from that IP will wait in the ah - * waiting list and not be able to acquire an ah until - * a connection belonging to the IP relinquishes one it - * already has. - */ - unsigned short ip_limit_wsi; - /**< CONTEXT: max number of wsi a single IP may use simultaneously. - * 0 is no limit. This is a hard limit, connections from - * the same IP will simply be dropped once it acquires the - * amount of simultaneous wsi / accepted connections - * given here. - */ - uint32_t http2_settings[7]; - /**< VHOST: if http2_settings[0] is nonzero, the values given in - * http2_settings[1]..[6] are used instead of the lws - * platform default values. - * Just leave all at 0 if you don't care. - */ - const char *error_document_404; - /**< VHOST: If non-NULL, when asked to serve a non-existent file, - * lws attempts to server this url path instead. Eg, - * "/404.html" */ - const char *alpn; - /**< CONTEXT: If non-NULL, default list of advertised alpn, comma- - * separated - * - * VHOST: If non-NULL, per-vhost list of advertised alpn, comma- - * separated - */ - void **foreign_loops; - /**< CONTEXT: This is ignored if the context is not being started with - * an event loop, ie, .options has a flag like - * LWS_SERVER_OPTION_LIBUV. - * - * NULL indicates lws should start its own even loop for - * each service thread, and deal with closing the loops - * when the context is destroyed. - * - * Non-NULL means it points to an array of external - * ("foreign") event loops that are to be used in turn for - * each service thread. In the default case of 1 service - * thread, it can just point to one foreign event loop. - */ - void (*signal_cb)(void *event_lib_handle, int signum); - /**< CONTEXT: NULL: default signal handling. Otherwise this receives - * the signal handler callback. event_lib_handle is the - * native event library signal handle, eg uv_signal_t * - * for libuv. - */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility - * - * The below is to ensure later library versions with new - * members added above will see 0 (default) even if the app - * was not built against the newer headers. - */ - struct lws_context **pcontext; - /**< CONTEXT: if non-NULL, at the end of context destroy processing, - * the pointer pointed to by pcontext is written with NULL. You can - * use this to let foreign event loops know that lws context destruction - * is fully completed. - */ - - void *_unused[4]; /**< dummy */ -}; - -/** - * lws_create_context() - Create the websocket handler - * \param info: pointer to struct with parameters - * - * This function creates the listening socket (if serving) and takes care - * of all initialization in one step. - * - * If option LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, no vhost is - * created; you're expected to create your own vhosts afterwards using - * lws_create_vhost(). Otherwise a vhost named "default" is also created - * using the information in the vhost-related members, for compatibility. - * - * After initialization, it returns a struct lws_context * that - * represents this server. After calling, user code needs to take care - * of calling lws_service() with the context pointer to get the - * server's sockets serviced. This must be done in the same process - * context as the initialization call. - * - * The protocol callback functions are called for a handful of events - * including http requests coming in, websocket connections becoming - * established, and data arriving; it's also called periodically to allow - * async transmission. - * - * HTTP requests are sent always to the FIRST protocol in protocol, since - * at that time websocket protocol has not been negotiated. Other - * protocols after the first one never see any HTTP callback activity. - * - * The server created is a simple http server by default; part of the - * websocket standard is upgrading this http connection to a websocket one. - * - * This allows the same server to provide files like scripts and favicon / - * images or whatever over http and dynamic data over websockets all in - * one place; they're all handled in the user callback. - */ -LWS_VISIBLE LWS_EXTERN struct lws_context * -lws_create_context(const struct lws_context_creation_info *info); - - -/** - * lws_context_destroy() - Destroy the websocket context - * \param context: Websocket context - * - * This function closes any active connections and then frees the - * context. After calling this, any further use of the context is - * undefined. - */ -LWS_VISIBLE LWS_EXTERN void -lws_context_destroy(struct lws_context *context); - -typedef int (*lws_reload_func)(void); - -/** - * lws_context_deprecate() - Deprecate the websocket context - * - * \param context: Websocket context - * \param cb: Callback notified when old context listen sockets are closed - * - * This function is used on an existing context before superceding it - * with a new context. - * - * It closes any listen sockets in the context, so new connections are - * not possible. - * - * And it marks the context to be deleted when the number of active - * connections into it falls to zero. - * - * Otherwise if you attach the deprecated context to the replacement - * context when it has been created using lws_context_attach_deprecated() - * both any deprecated and the new context will service their connections. - * - * This is aimed at allowing seamless configuration reloads. - * - * The callback cb will be called after the listen sockets are actually - * closed and may be reopened. In the callback the new context should be - * configured and created. (With libuv, socket close happens async after - * more loop events). - */ -LWS_VISIBLE LWS_EXTERN void -lws_context_deprecate(struct lws_context *context, lws_reload_func cb); - -LWS_VISIBLE LWS_EXTERN int -lws_context_is_deprecated(struct lws_context *context); - -/** - * lws_set_proxy() - Setups proxy to lws_context. - * \param vhost: pointer to struct lws_vhost you want set proxy for - * \param proxy: pointer to c string containing proxy in format address:port - * - * Returns 0 if proxy string was parsed and proxy was setup. - * Returns -1 if proxy is NULL or has incorrect format. - * - * This is only required if your OS does not provide the http_proxy - * environment variable (eg, OSX) - * - * IMPORTANT! You should call this function right after creation of the - * lws_context and before call to connect. If you call this - * function after connect behavior is undefined. - * This function will override proxy settings made on lws_context - * creation with genenv() call. - */ -LWS_VISIBLE LWS_EXTERN int -lws_set_proxy(struct lws_vhost *vhost, const char *proxy); - -/** - * lws_set_socks() - Setup socks to lws_context. - * \param vhost: pointer to struct lws_vhost you want set socks for - * \param socks: pointer to c string containing socks in format address:port - * - * Returns 0 if socks string was parsed and socks was setup. - * Returns -1 if socks is NULL or has incorrect format. - * - * This is only required if your OS does not provide the socks_proxy - * environment variable (eg, OSX) - * - * IMPORTANT! You should call this function right after creation of the - * lws_context and before call to connect. If you call this - * function after connect behavior is undefined. - * This function will override proxy settings made on lws_context - * creation with genenv() call. - */ -LWS_VISIBLE LWS_EXTERN int -lws_set_socks(struct lws_vhost *vhost, const char *socks); - -struct lws_vhost; - -/** - * lws_create_vhost() - Create a vhost (virtual server context) - * \param context: pointer to result of lws_create_context() - * \param info: pointer to struct with parameters - * - * This function creates a virtual server (vhost) using the vhost-related - * members of the info struct. You can create many vhosts inside one context - * if you created the context with the option LWS_SERVER_OPTION_EXPLICIT_VHOSTS - */ -LWS_VISIBLE LWS_EXTERN struct lws_vhost * -lws_create_vhost(struct lws_context *context, - const struct lws_context_creation_info *info); - -/** - * lws_vhost_destroy() - Destroy a vhost (virtual server context) - * - * \param vh: pointer to result of lws_create_vhost() - * - * This function destroys a vhost. Normally, if you just want to exit, - * then lws_destroy_context() will take care of everything. If you want - * to destroy an individual vhost and all connections and allocations, you - * can do it with this. - * - * If the vhost has a listen sockets shared by other vhosts, it will be given - * to one of the vhosts sharing it rather than closed. - */ -LWS_VISIBLE LWS_EXTERN void -lws_vhost_destroy(struct lws_vhost *vh); - -/** - * lwsws_get_config_globals() - Parse a JSON server config file - * \param info: pointer to struct with parameters - * \param d: filepath of the config file - * \param config_strings: storage for the config strings extracted from JSON, - * the pointer is incremented as strings are stored - * \param len: pointer to the remaining length left in config_strings - * the value is decremented as strings are stored - * - * This function prepares a n lws_context_creation_info struct with global - * settings from a file d. - * - * Requires CMake option LWS_WITH_LEJP_CONF to have been enabled - */ -LWS_VISIBLE LWS_EXTERN int -lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d, - char **config_strings, int *len); - -/** - * lwsws_get_config_vhosts() - Create vhosts from a JSON server config file - * \param context: pointer to result of lws_create_context() - * \param info: pointer to struct with parameters - * \param d: filepath of the config file - * \param config_strings: storage for the config strings extracted from JSON, - * the pointer is incremented as strings are stored - * \param len: pointer to the remaining length left in config_strings - * the value is decremented as strings are stored - * - * This function creates vhosts into a context according to the settings in - *JSON files found in directory d. - * - * Requires CMake option LWS_WITH_LEJP_CONF to have been enabled - */ -LWS_VISIBLE LWS_EXTERN int -lwsws_get_config_vhosts(struct lws_context *context, - struct lws_context_creation_info *info, const char *d, - char **config_strings, int *len); - -/** lws_vhost_get() - \deprecated deprecated: use lws_get_vhost() */ -LWS_VISIBLE LWS_EXTERN struct lws_vhost * -lws_vhost_get(struct lws *wsi) LWS_WARN_DEPRECATED; - -/** - * lws_get_vhost() - return the vhost a wsi belongs to - * - * \param wsi: which connection - */ -LWS_VISIBLE LWS_EXTERN struct lws_vhost * -lws_get_vhost(struct lws *wsi); - -/** - * lws_get_vhost_name() - returns the name of a vhost - * - * \param vhost: which vhost - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_get_vhost_name(struct lws_vhost *vhost); - -/** - * lws_get_vhost_port() - returns the port a vhost listens on, or -1 - * - * \param vhost: which vhost - */ -LWS_VISIBLE LWS_EXTERN int -lws_get_vhost_port(struct lws_vhost *vhost); - -/** - * lws_get_vhost_user() - returns the user pointer for the vhost - * - * \param vhost: which vhost - */ -LWS_VISIBLE LWS_EXTERN void * -lws_get_vhost_user(struct lws_vhost *vhost); - -/** - * lws_get_vhost_iface() - returns the binding for the vhost listen socket - * - * \param vhost: which vhost - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_get_vhost_iface(struct lws_vhost *vhost); - -/** - * lws_json_dump_vhost() - describe vhost state and stats in JSON - * - * \param vh: the vhost - * \param buf: buffer to fill with JSON - * \param len: max length of buf - */ -LWS_VISIBLE LWS_EXTERN int -lws_json_dump_vhost(const struct lws_vhost *vh, char *buf, int len); - -/** - * lws_json_dump_context() - describe context state and stats in JSON - * - * \param context: the context - * \param buf: buffer to fill with JSON - * \param len: max length of buf - * \param hide_vhosts: nonzero to not provide per-vhost mount etc information - * - * Generates a JSON description of vhost state into buf - */ -LWS_VISIBLE LWS_EXTERN int -lws_json_dump_context(const struct lws_context *context, char *buf, int len, - int hide_vhosts); - -/** - * lws_vhost_user() - get the user data associated with the vhost - * \param vhost: Websocket vhost - * - * This returns the optional user pointer that can be attached to - * a vhost when it was created. Lws never dereferences this pointer, it only - * sets it when the vhost is created, and returns it using this api. - */ -LWS_VISIBLE LWS_EXTERN void * -lws_vhost_user(struct lws_vhost *vhost); - -/** - * lws_context_user() - get the user data associated with the context - * \param context: Websocket context - * - * This returns the optional user allocation that can be attached to - * the context the sockets live in at context_create time. It's a way - * to let all sockets serviced in the same context share data without - * using globals statics in the user code. - */ -LWS_VISIBLE LWS_EXTERN void * -lws_context_user(struct lws_context *context); - -/*! \defgroup vhost-mounts Vhost mounts and options - * \ingroup context-and-vhost-creation - * - * ##Vhost mounts and options - */ -///@{ -/** struct lws_protocol_vhost_options - linked list of per-vhost protocol - * name=value options - * - * This provides a general way to attach a linked-list of name=value pairs, - * which can also have an optional child link-list using the options member. - */ -struct lws_protocol_vhost_options { - const struct lws_protocol_vhost_options *next; /**< linked list */ - const struct lws_protocol_vhost_options *options; /**< child linked-list of more options for this node */ - const char *name; /**< name of name=value pair */ - const char *value; /**< value of name=value pair */ -}; - -/** enum lws_mount_protocols - * This specifies the mount protocol for a mountpoint, whether it is to be - * served from a filesystem, or it is a cgi etc. - */ -enum lws_mount_protocols { - LWSMPRO_HTTP = 0, /**< http reverse proxy */ - LWSMPRO_HTTPS = 1, /**< https reverse proxy */ - LWSMPRO_FILE = 2, /**< serve from filesystem directory */ - LWSMPRO_CGI = 3, /**< pass to CGI to handle */ - LWSMPRO_REDIR_HTTP = 4, /**< redirect to http:// url */ - LWSMPRO_REDIR_HTTPS = 5, /**< redirect to https:// url */ - LWSMPRO_CALLBACK = 6, /**< hand by named protocol's callback */ -}; - -/** struct lws_http_mount - * - * arguments for mounting something in a vhost's url namespace - */ -struct lws_http_mount { - const struct lws_http_mount *mount_next; - /**< pointer to next struct lws_http_mount */ - const char *mountpoint; - /**< mountpoint in http pathspace, eg, "/" */ - const char *origin; - /**< path to be mounted, eg, "/var/www/warmcat.com" */ - const char *def; - /**< default target, eg, "index.html" */ - const char *protocol; - /**<"protocol-name" to handle mount */ - - const struct lws_protocol_vhost_options *cgienv; - /**< optional linked-list of cgi options. These are created - * as environment variables for the cgi process - */ - const struct lws_protocol_vhost_options *extra_mimetypes; - /**< optional linked-list of mimetype mappings */ - const struct lws_protocol_vhost_options *interpret; - /**< optional linked-list of files to be interpreted */ - - int cgi_timeout; - /**< seconds cgi is allowed to live, if cgi://mount type */ - int cache_max_age; - /**< max-age for reuse of client cache of files, seconds */ - unsigned int auth_mask; - /**< bits set here must be set for authorized client session */ - - unsigned int cache_reusable:1; /**< set if client cache may reuse this */ - unsigned int cache_revalidate:1; /**< set if client cache should revalidate on use */ - unsigned int cache_intermediaries:1; /**< set if intermediaries are allowed to cache */ - - unsigned char origin_protocol; /**< one of enum lws_mount_protocols */ - unsigned char mountpoint_len; /**< length of mountpoint string */ - - const char *basic_auth_login_file; - /**<NULL, or filepath to use to check basic auth logins against */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility - * - * The below is to ensure later library versions with new - * members added above will see 0 (default) even if the app - * was not built against the newer headers. - */ - - void *_unused[2]; /**< dummy */ -}; -///@} -///@} - -/*! \defgroup client Client related functions - * ##Client releated functions - * \ingroup lwsapi - * - * */ -///@{ - -/** enum lws_client_connect_ssl_connection_flags - flags that may be used - * with struct lws_client_connect_info ssl_connection member to control if - * and how SSL checks apply to the client connection being created - */ - -enum lws_client_connect_ssl_connection_flags { - LCCSCF_USE_SSL = (1 << 0), - LCCSCF_ALLOW_SELFSIGNED = (1 << 1), - LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK = (1 << 2), - LCCSCF_ALLOW_EXPIRED = (1 << 3), - - LCCSCF_PIPELINE = (1 << 16), - /**< Serialize / pipeline multiple client connections - * on a single connection where possible. - * - * HTTP/1.0: possible if Keep-Alive: yes sent by server - * HTTP/1.1: always possible... uses pipelining - * HTTP/2: always possible... uses parallel streams - * */ -}; - -/** struct lws_client_connect_info - parameters to connect with when using - * lws_client_connect_via_info() */ - -struct lws_client_connect_info { - struct lws_context *context; - /**< lws context to create connection in */ - const char *address; - /**< remote address to connect to */ - int port; - /**< remote port to connect to */ - int ssl_connection; - /**< 0, or a combination of LCCSCF_ flags */ - const char *path; - /**< uri path */ - const char *host; - /**< content of host header */ - const char *origin; - /**< content of origin header */ - const char *protocol; - /**< list of ws protocols we could accept */ - int ietf_version_or_minus_one; - /**< deprecated: currently leave at 0 or -1 */ - void *userdata; - /**< if non-NULL, use this as wsi user_data instead of malloc it */ - const void *client_exts; - /**< UNUSED... provide in info.extensions at context creation time */ - const char *method; - /**< if non-NULL, do this http method instead of ws[s] upgrade. - * use "GET" to be a simple http client connection. "RAW" gets - * you a connected socket that lws itself will leave alone once - * connected. */ - struct lws *parent_wsi; - /**< if another wsi is responsible for this connection, give it here. - * this is used to make sure if the parent closes so do any - * child connections first. */ - const char *uri_replace_from; - /**< if non-NULL, when this string is found in URIs in - * text/html content-encoding, it's replaced with uri_replace_to */ - const char *uri_replace_to; - /**< see uri_replace_from */ - struct lws_vhost *vhost; - /**< vhost to bind to (used to determine related SSL_CTX) */ - struct lws **pwsi; - /**< if not NULL, store the new wsi here early in the connection - * process. Although we return the new wsi, the call to create the - * client connection does progress the connection somewhat and may - * meet an error that will result in the connection being scrubbed and - * NULL returned. While the wsi exists though, he may process a - * callback like CLIENT_CONNECTION_ERROR with his wsi: this gives the - * user callback a way to identify which wsi it is that faced the error - * even before the new wsi is returned and even if ultimately no wsi - * is returned. - */ - const char *iface; - /**< NULL to allow routing on any interface, or interface name or IP - * to bind the socket to */ - const char *local_protocol_name; - /**< NULL: .protocol is used both to select the local protocol handler - * to bind to and as the list of remote ws protocols we could - * accept. - * non-NULL: this protocol name is used to bind the connection to - * the local protocol handler. .protocol is used for the - * list of remote ws protocols we could accept */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility - * - * The below is to ensure later library versions with new - * members added above will see 0 (default) even if the app - * was not built against the newer headers. - */ - const char *alpn; - /* NULL: allow lws default ALPN list, from vhost if present or from - * list of roles built into lws - * non-NULL: require one from provided comma-separated list of alpn - * tokens - */ - - void *_unused[4]; /**< dummy */ -}; - -/** - * lws_client_connect_via_info() - Connect to another websocket server - * \param ccinfo: pointer to lws_client_connect_info struct - * - * This function creates a connection to a remote server using the - * information provided in ccinfo. - */ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_client_connect_via_info(struct lws_client_connect_info * ccinfo); - -/** - * lws_client_connect() - Connect to another websocket server - * \deprecated DEPRECATED use lws_client_connect_via_info - * \param clients: Websocket context - * \param address: Remote server address, eg, "myserver.com" - * \param port: Port to connect to on the remote server, eg, 80 - * \param ssl_connection: 0 = ws://, 1 = wss:// encrypted, 2 = wss:// allow self - * signed certs - * \param path: Websocket path on server - * \param host: Hostname on server - * \param origin: Socket origin name - * \param protocol: Comma-separated list of protocols being asked for from - * the server, or just one. The server will pick the one it - * likes best. If you don't want to specify a protocol, which is - * legal, use NULL here. - * \param ietf_version_or_minus_one: -1 to ask to connect using the default, latest - * protocol supported, or the specific protocol ordinal - * - * This function creates a connection to a remote server - */ -/* deprecated, use lws_client_connect_via_info() */ -LWS_VISIBLE LWS_EXTERN struct lws * LWS_WARN_UNUSED_RESULT -lws_client_connect(struct lws_context *clients, const char *address, - int port, int ssl_connection, const char *path, - const char *host, const char *origin, const char *protocol, - int ietf_version_or_minus_one) LWS_WARN_DEPRECATED; -/* deprecated, use lws_client_connect_via_info() */ -/** - * lws_client_connect_extended() - Connect to another websocket server - * \deprecated DEPRECATED use lws_client_connect_via_info - * \param clients: Websocket context - * \param address: Remote server address, eg, "myserver.com" - * \param port: Port to connect to on the remote server, eg, 80 - * \param ssl_connection: 0 = ws://, 1 = wss:// encrypted, 2 = wss:// allow self - * signed certs - * \param path: Websocket path on server - * \param host: Hostname on server - * \param origin: Socket origin name - * \param protocol: Comma-separated list of protocols being asked for from - * the server, or just one. The server will pick the one it - * likes best. - * \param ietf_version_or_minus_one: -1 to ask to connect using the default, latest - * protocol supported, or the specific protocol ordinal - * \param userdata: Pre-allocated user data - * - * This function creates a connection to a remote server - */ -LWS_VISIBLE LWS_EXTERN struct lws * LWS_WARN_UNUSED_RESULT -lws_client_connect_extended(struct lws_context *clients, const char *address, - int port, int ssl_connection, const char *path, - const char *host, const char *origin, - const char *protocol, int ietf_version_or_minus_one, - void *userdata) LWS_WARN_DEPRECATED; - -/** - * lws_init_vhost_client_ssl() - also enable client SSL on an existing vhost - * - * \param info: client ssl related info - * \param vhost: which vhost to initialize client ssl operations on - * - * You only need to call this if you plan on using SSL client connections on - * the vhost. For non-SSL client connections, it's not necessary to call this. - * - * The following members of info are used during the call - * - * - options must have LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT set, - * otherwise the call does nothing - * - provided_client_ssl_ctx must be NULL to get a generated client - * ssl context, otherwise you can pass a prepared one in by setting it - * - ssl_cipher_list may be NULL or set to the client valid cipher list - * - ssl_ca_filepath may be NULL or client cert filepath - * - ssl_cert_filepath may be NULL or client cert filepath - * - ssl_private_key_filepath may be NULL or client cert private key - * - * You must create your vhost explicitly if you want to use this, so you have - * a pointer to the vhost. Create the context first with the option flag - * LWS_SERVER_OPTION_EXPLICIT_VHOSTS and then call lws_create_vhost() with - * the same info struct. - */ -LWS_VISIBLE LWS_EXTERN int -lws_init_vhost_client_ssl(const struct lws_context_creation_info *info, - struct lws_vhost *vhost); -/** - * lws_http_client_read() - consume waiting received http client data - * - * \param wsi: client connection - * \param buf: pointer to buffer pointer - fill with pointer to your buffer - * \param len: pointer to chunk length - fill with max length of buffer - * - * This is called when the user code is notified client http data has arrived. - * The user code may choose to delay calling it to consume the data, for example - * waiting until an onward connection is writeable. - * - * For non-chunked connections, up to len bytes of buf are filled with the - * received content. len is set to the actual amount filled before return. - * - * For chunked connections, the linear buffer content contains the chunking - * headers and it cannot be passed in one lump. Instead, this function will - * call back LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ with in pointing to the - * chunk start and len set to the chunk length. There will be as many calls - * as there are chunks or partial chunks in the buffer. - */ -LWS_VISIBLE LWS_EXTERN int -lws_http_client_read(struct lws *wsi, char **buf, int *len); - -/** - * lws_http_client_http_response() - get last HTTP response code - * - * \param wsi: client connection - * - * Returns the last server response code, eg, 200 for client http connections. - * - * You should capture this during the LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP - * callback, because after that the memory reserved for storing the related - * headers is freed and this value is lost. - */ -LWS_VISIBLE LWS_EXTERN unsigned int -lws_http_client_http_response(struct lws *wsi); - -LWS_VISIBLE LWS_EXTERN void -lws_client_http_body_pending(struct lws *wsi, int something_left_to_send); - -/** - * lws_client_http_body_pending() - control if client connection neeeds to send body - * - * \param wsi: client connection - * \param something_left_to_send: nonzero if need to send more body, 0 (default) - * if nothing more to send - * - * If you will send payload data with your HTTP client connection, eg, for POST, - * when you set the related http headers in - * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER callback you should also call - * this API with something_left_to_send nonzero, and call - * lws_callback_on_writable(wsi); - * - * After sending the headers, lws will call your callback with - * LWS_CALLBACK_CLIENT_HTTP_WRITEABLE reason when writable. You can send the - * next part of the http body payload, calling lws_callback_on_writable(wsi); - * if there is more to come, or lws_client_http_body_pending(wsi, 0); to - * let lws know the last part is sent and the connection can move on. - */ - -///@} - -/** \defgroup service Built-in service loop entry - * - * ##Built-in service loop entry - * - * If you're not using libev / libuv, these apis are needed to enter the poll() - * wait in lws and service any connections with pending events. - */ -///@{ - -/** - * lws_service() - Service any pending websocket activity - * \param context: Websocket context - * \param timeout_ms: Timeout for poll; 0 means return immediately if nothing needed - * service otherwise block and service immediately, returning - * after the timeout if nothing needed service. - * - * This function deals with any pending websocket traffic, for three - * kinds of event. It handles these events on both server and client - * types of connection the same. - * - * 1) Accept new connections to our context's server - * - * 2) Call the receive callback for incoming frame data received by - * server or client connections. - * - * You need to call this service function periodically to all the above - * functions to happen; if your application is single-threaded you can - * just call it in your main event loop. - * - * Alternatively you can fork a new process that asynchronously handles - * calling this service in a loop. In that case you are happy if this - * call blocks your thread until it needs to take care of something and - * would call it with a large nonzero timeout. Your loop then takes no - * CPU while there is nothing happening. - * - * If you are calling it in a single-threaded app, you don't want it to - * wait around blocking other things in your loop from happening, so you - * would call it with a timeout_ms of 0, so it returns immediately if - * nothing is pending, or as soon as it services whatever was pending. - */ -LWS_VISIBLE LWS_EXTERN int -lws_service(struct lws_context *context, int timeout_ms); - -/** - * lws_service_tsi() - Service any pending websocket activity - * - * \param context: Websocket context - * \param timeout_ms: Timeout for poll; 0 means return immediately if nothing needed - * service otherwise block and service immediately, returning - * after the timeout if nothing needed service. - * \param tsi: Thread service index, starting at 0 - * - * Same as lws_service(), but for a specific thread service index. Only needed - * if you are spawning multiple service threads. - */ -LWS_VISIBLE LWS_EXTERN int -lws_service_tsi(struct lws_context *context, int timeout_ms, int tsi); - -/** - * lws_cancel_service_pt() - Cancel servicing of pending socket activity - * on one thread - * \param wsi: Cancel service on the thread this wsi is serviced by - * - * Same as lws_cancel_service(), but targets a single service thread, the one - * the wsi belongs to. You probably want to use lws_cancel_service() instead. - */ -LWS_VISIBLE LWS_EXTERN void -lws_cancel_service_pt(struct lws *wsi); - -/** - * lws_cancel_service() - Cancel wait for new pending socket activity - * \param context: Websocket context - * - * This function creates an immediate "synchronous interrupt" to the lws poll() - * wait or event loop. As soon as possible in the serialzed service sequencing, - * a LWS_CALLBACK_EVENT_WAIT_CANCELLED callback is sent to every protocol on - * every vhost. - * - * lws_cancel_service() may be called from another thread while the context - * exists, and its effect will be immediately serialized. - */ -LWS_VISIBLE LWS_EXTERN void -lws_cancel_service(struct lws_context *context); - -/** - * lws_service_fd() - Service polled socket with something waiting - * \param context: Websocket context - * \param pollfd: The pollfd entry describing the socket fd and which events - * happened, or NULL to tell lws to do only timeout servicing. - * - * This function takes a pollfd that has POLLIN or POLLOUT activity and - * services it according to the state of the associated - * struct lws. - * - * The one call deals with all "service" that might happen on a socket - * including listen accepts, http files as well as websocket protocol. - * - * If a pollfd says it has something, you can just pass it to - * lws_service_fd() whether it is a socket handled by lws or not. - * If it sees it is a lws socket, the traffic will be handled and - * pollfd->revents will be zeroed now. - * - * If the socket is foreign to lws, it leaves revents alone. So you can - * see if you should service yourself by checking the pollfd revents - * after letting lws try to service it. - * - * You should also call this with pollfd = NULL to just allow the - * once-per-second global timeout checks; if less than a second since the last - * check it returns immediately then. - */ -LWS_VISIBLE LWS_EXTERN int -lws_service_fd(struct lws_context *context, struct lws_pollfd *pollfd); - -/** - * lws_service_fd_tsi() - Service polled socket in specific service thread - * \param context: Websocket context - * \param pollfd: The pollfd entry describing the socket fd and which events - * happened. - * \param tsi: thread service index - * - * Same as lws_service_fd() but used with multiple service threads - */ -LWS_VISIBLE LWS_EXTERN int -lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, - int tsi); - -/** - * lws_service_adjust_timeout() - Check for any connection needing forced service - * \param context: Websocket context - * \param timeout_ms: The original poll timeout value. You can just set this - * to 1 if you don't really have a poll timeout. - * \param tsi: thread service index - * - * Under some conditions connections may need service even though there is no - * pending network action on them, this is "forced service". For default - * poll() and libuv / libev, the library takes care of calling this and - * dealing with it for you. But for external poll() integration, you need - * access to the apis. - * - * If anybody needs "forced service", returned timeout is zero. In that case, - * you can call lws_service_tsi() with a timeout of -1 to only service - * guys who need forced service. - */ -LWS_VISIBLE LWS_EXTERN int -lws_service_adjust_timeout(struct lws_context *context, int timeout_ms, int tsi); - -/* Backwards compatibility */ -#define lws_plat_service_tsi lws_service_tsi - -LWS_VISIBLE LWS_EXTERN int -lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd); - -///@} - -/*! \defgroup http HTTP - - Modules related to handling HTTP -*/ -//@{ - -/*! \defgroup httpft HTTP File transfer - * \ingroup http - - APIs for sending local files in response to HTTP requests -*/ -//@{ - -/** - * lws_get_mimetype() - Determine mimetype to use from filename - * - * \param file: filename - * \param m: NULL, or mount context - * - * This uses a canned list of known filetypes first, if no match and m is - * non-NULL, then tries a list of per-mount file suffix to mimtype mappings. - * - * Returns either NULL or a pointer to the mimetype matching the file. - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_get_mimetype(const char *file, const struct lws_http_mount *m); - -/** - * lws_serve_http_file() - Send a file back to the client using http - * \param wsi: Websocket instance (available from user callback) - * \param file: The file to issue over http - * \param content_type: The http content type, eg, text/html - * \param other_headers: NULL or pointer to header string - * \param other_headers_len: length of the other headers if non-NULL - * - * This function is intended to be called from the callback in response - * to http requests from the client. It allows the callback to issue - * local files down the http link in a single step. - * - * Returning <0 indicates error and the wsi should be closed. Returning - * >0 indicates the file was completely sent and - * lws_http_transaction_completed() called on the wsi (and close if != 0) - * ==0 indicates the file transfer is started and needs more service later, - * the wsi should be left alone. - */ -LWS_VISIBLE LWS_EXTERN int -lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, - const char *other_headers, int other_headers_len); - -LWS_VISIBLE LWS_EXTERN int -lws_serve_http_file_fragment(struct lws *wsi); -//@} - - -enum http_status { - HTTP_STATUS_CONTINUE = 100, - - HTTP_STATUS_OK = 200, - HTTP_STATUS_NO_CONTENT = 204, - HTTP_STATUS_PARTIAL_CONTENT = 206, - - HTTP_STATUS_MOVED_PERMANENTLY = 301, - HTTP_STATUS_FOUND = 302, - HTTP_STATUS_SEE_OTHER = 303, - HTTP_STATUS_NOT_MODIFIED = 304, - - HTTP_STATUS_BAD_REQUEST = 400, - HTTP_STATUS_UNAUTHORIZED, - HTTP_STATUS_PAYMENT_REQUIRED, - HTTP_STATUS_FORBIDDEN, - HTTP_STATUS_NOT_FOUND, - HTTP_STATUS_METHOD_NOT_ALLOWED, - HTTP_STATUS_NOT_ACCEPTABLE, - HTTP_STATUS_PROXY_AUTH_REQUIRED, - HTTP_STATUS_REQUEST_TIMEOUT, - HTTP_STATUS_CONFLICT, - HTTP_STATUS_GONE, - HTTP_STATUS_LENGTH_REQUIRED, - HTTP_STATUS_PRECONDITION_FAILED, - HTTP_STATUS_REQ_ENTITY_TOO_LARGE, - HTTP_STATUS_REQ_URI_TOO_LONG, - HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE, - HTTP_STATUS_REQ_RANGE_NOT_SATISFIABLE, - HTTP_STATUS_EXPECTATION_FAILED, - - HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, - HTTP_STATUS_NOT_IMPLEMENTED, - HTTP_STATUS_BAD_GATEWAY, - HTTP_STATUS_SERVICE_UNAVAILABLE, - HTTP_STATUS_GATEWAY_TIMEOUT, - HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED, -}; -/*! \defgroup html-chunked-substitution HTML Chunked Substitution - * \ingroup http - * - * ##HTML chunked Substitution - * - * APIs for receiving chunks of text, replacing a set of variable names via - * a callback, and then prepending and appending HTML chunked encoding - * headers. - */ -//@{ - -struct lws_process_html_args { - char *p; /**< pointer to the buffer containing the data */ - int len; /**< length of the original data at p */ - int max_len; /**< maximum length we can grow the data to */ - int final; /**< set if this is the last chunk of the file */ - int chunked; /**< 0 == unchunked, 1 == produce chunk headers (incompatible with HTTP/2) */ -}; - -typedef const char *(*lws_process_html_state_cb)(void *data, int index); - -struct lws_process_html_state { - char *start; /**< pointer to start of match */ - char swallow[16]; /**< matched character buffer */ - int pos; /**< position in match */ - void *data; /**< opaque pointer */ - const char * const *vars; /**< list of variable names */ - int count_vars; /**< count of variable names */ - - lws_process_html_state_cb replace; /**< called on match to perform substitution */ -}; - -/*! lws_chunked_html_process() - generic chunked substitution - * \param args: buffer to process using chunked encoding - * \param s: current processing state - */ -LWS_VISIBLE LWS_EXTERN int -lws_chunked_html_process(struct lws_process_html_args *args, - struct lws_process_html_state *s); -//@} - -/** \defgroup HTTP-headers-read HTTP headers: read - * \ingroup http - * - * ##HTTP header releated functions - * - * In lws the client http headers are temporarily stored in a pool, only for the - * duration of the http part of the handshake. It's because in most cases, - * the header content is ignored for the whole rest of the connection lifetime - * and would then just be taking up space needlessly. - * - * During LWS_CALLBACK_HTTP when the URI path is delivered is the last time - * the http headers are still allocated, you can use these apis then to - * look at and copy out interesting header content (cookies, etc) - * - * Notice that the header total length reported does not include a terminating - * '\0', however you must allocate for it when using the _copy apis. So the - * length reported for a header containing "123" is 3, but you must provide - * a buffer of length 4 so that "123\0" may be copied into it, or the copy - * will fail with a nonzero return code. - * - * In the special case of URL arguments, like ?x=1&y=2, the arguments are - * stored in a token named for the method, eg, WSI_TOKEN_GET_URI if it - * was a GET or WSI_TOKEN_POST_URI if POST. You can check the total - * length to confirm the method. - * - * For URL arguments, each argument is stored urldecoded in a "fragment", so - * you can use the fragment-aware api lws_hdr_copy_fragment() to access each - * argument in turn: the fragments contain urldecoded strings like x=1 or y=2. - * - * As a convenience, lws has an api that will find the fragment with a - * given name= part, lws_get_urlarg_by_name(). - */ -///@{ - -/** struct lws_tokens - * you need these to look at headers that have been parsed if using the - * LWS_CALLBACK_FILTER_CONNECTION callback. If a header from the enum - * list below is absent, .token = NULL and len = 0. Otherwise .token - * points to .len chars containing that header content. - */ -struct lws_tokens { - char *token; /**< pointer to start of the token */ - int len; /**< length of the token's value */ -}; - -/* enum lws_token_indexes - * these have to be kept in sync with lextable.h / minilex.c - * - * NOTE: These public enums are part of the abi. If you want to add one, - * add it at where specified so existing users are unaffected. - */ -enum lws_token_indexes { - WSI_TOKEN_GET_URI = 0, - WSI_TOKEN_POST_URI = 1, - WSI_TOKEN_OPTIONS_URI = 2, - WSI_TOKEN_HOST = 3, - WSI_TOKEN_CONNECTION = 4, - WSI_TOKEN_UPGRADE = 5, - WSI_TOKEN_ORIGIN = 6, - WSI_TOKEN_DRAFT = 7, - WSI_TOKEN_CHALLENGE = 8, - WSI_TOKEN_EXTENSIONS = 9, - WSI_TOKEN_KEY1 = 10, - WSI_TOKEN_KEY2 = 11, - WSI_TOKEN_PROTOCOL = 12, - WSI_TOKEN_ACCEPT = 13, - WSI_TOKEN_NONCE = 14, - WSI_TOKEN_HTTP = 15, - WSI_TOKEN_HTTP2_SETTINGS = 16, - WSI_TOKEN_HTTP_ACCEPT = 17, - WSI_TOKEN_HTTP_AC_REQUEST_HEADERS = 18, - WSI_TOKEN_HTTP_IF_MODIFIED_SINCE = 19, - WSI_TOKEN_HTTP_IF_NONE_MATCH = 20, - WSI_TOKEN_HTTP_ACCEPT_ENCODING = 21, - WSI_TOKEN_HTTP_ACCEPT_LANGUAGE = 22, - WSI_TOKEN_HTTP_PRAGMA = 23, - WSI_TOKEN_HTTP_CACHE_CONTROL = 24, - WSI_TOKEN_HTTP_AUTHORIZATION = 25, - WSI_TOKEN_HTTP_COOKIE = 26, - WSI_TOKEN_HTTP_CONTENT_LENGTH = 27, - WSI_TOKEN_HTTP_CONTENT_TYPE = 28, - WSI_TOKEN_HTTP_DATE = 29, - WSI_TOKEN_HTTP_RANGE = 30, - WSI_TOKEN_HTTP_REFERER = 31, - WSI_TOKEN_KEY = 32, - WSI_TOKEN_VERSION = 33, - WSI_TOKEN_SWORIGIN = 34, - - WSI_TOKEN_HTTP_COLON_AUTHORITY = 35, - WSI_TOKEN_HTTP_COLON_METHOD = 36, - WSI_TOKEN_HTTP_COLON_PATH = 37, - WSI_TOKEN_HTTP_COLON_SCHEME = 38, - WSI_TOKEN_HTTP_COLON_STATUS = 39, - - WSI_TOKEN_HTTP_ACCEPT_CHARSET = 40, - WSI_TOKEN_HTTP_ACCEPT_RANGES = 41, - WSI_TOKEN_HTTP_ACCESS_CONTROL_ALLOW_ORIGIN = 42, - WSI_TOKEN_HTTP_AGE = 43, - WSI_TOKEN_HTTP_ALLOW = 44, - WSI_TOKEN_HTTP_CONTENT_DISPOSITION = 45, - WSI_TOKEN_HTTP_CONTENT_ENCODING = 46, - WSI_TOKEN_HTTP_CONTENT_LANGUAGE = 47, - WSI_TOKEN_HTTP_CONTENT_LOCATION = 48, - WSI_TOKEN_HTTP_CONTENT_RANGE = 49, - WSI_TOKEN_HTTP_ETAG = 50, - WSI_TOKEN_HTTP_EXPECT = 51, - WSI_TOKEN_HTTP_EXPIRES = 52, - WSI_TOKEN_HTTP_FROM = 53, - WSI_TOKEN_HTTP_IF_MATCH = 54, - WSI_TOKEN_HTTP_IF_RANGE = 55, - WSI_TOKEN_HTTP_IF_UNMODIFIED_SINCE = 56, - WSI_TOKEN_HTTP_LAST_MODIFIED = 57, - WSI_TOKEN_HTTP_LINK = 58, - WSI_TOKEN_HTTP_LOCATION = 59, - WSI_TOKEN_HTTP_MAX_FORWARDS = 60, - WSI_TOKEN_HTTP_PROXY_AUTHENTICATE = 61, - WSI_TOKEN_HTTP_PROXY_AUTHORIZATION = 62, - WSI_TOKEN_HTTP_REFRESH = 63, - WSI_TOKEN_HTTP_RETRY_AFTER = 64, - WSI_TOKEN_HTTP_SERVER = 65, - WSI_TOKEN_HTTP_SET_COOKIE = 66, - WSI_TOKEN_HTTP_STRICT_TRANSPORT_SECURITY = 67, - WSI_TOKEN_HTTP_TRANSFER_ENCODING = 68, - WSI_TOKEN_HTTP_USER_AGENT = 69, - WSI_TOKEN_HTTP_VARY = 70, - WSI_TOKEN_HTTP_VIA = 71, - WSI_TOKEN_HTTP_WWW_AUTHENTICATE = 72, - - WSI_TOKEN_PATCH_URI = 73, - WSI_TOKEN_PUT_URI = 74, - WSI_TOKEN_DELETE_URI = 75, - - WSI_TOKEN_HTTP_URI_ARGS = 76, - WSI_TOKEN_PROXY = 77, - WSI_TOKEN_HTTP_X_REAL_IP = 78, - WSI_TOKEN_HTTP1_0 = 79, - WSI_TOKEN_X_FORWARDED_FOR = 80, - WSI_TOKEN_CONNECT = 81, - WSI_TOKEN_HEAD_URI = 82, - WSI_TOKEN_TE = 83, - WSI_TOKEN_REPLAY_NONCE = 84, - WSI_TOKEN_COLON_PROTOCOL = 85, - WSI_TOKEN_X_AUTH_TOKEN = 86, - - /****** add new things just above ---^ ******/ - - /* use token storage to stash these internally, not for - * user use */ - - _WSI_TOKEN_CLIENT_SENT_PROTOCOLS, - _WSI_TOKEN_CLIENT_PEER_ADDRESS, - _WSI_TOKEN_CLIENT_URI, - _WSI_TOKEN_CLIENT_HOST, - _WSI_TOKEN_CLIENT_ORIGIN, - _WSI_TOKEN_CLIENT_METHOD, - _WSI_TOKEN_CLIENT_IFACE, - _WSI_TOKEN_CLIENT_ALPN, - - /* always last real token index*/ - WSI_TOKEN_COUNT, - - /* parser state additions, no storage associated */ - WSI_TOKEN_NAME_PART, - WSI_TOKEN_SKIPPING, - WSI_TOKEN_SKIPPING_SAW_CR, - WSI_PARSING_COMPLETE, - WSI_INIT_TOKEN_MUXURL, -}; - -struct lws_token_limits { - unsigned short token_limit[WSI_TOKEN_COUNT]; /**< max chars for this token */ -}; - -/** - * lws_token_to_string() - returns a textual representation of a hdr token index - * - * \param token: token index - */ -LWS_VISIBLE LWS_EXTERN const unsigned char * -lws_token_to_string(enum lws_token_indexes token); - -/** - * lws_hdr_total_length: report length of all fragments of a header totalled up - * The returned length does not include the space for a - * terminating '\0' - * - * \param wsi: websocket connection - * \param h: which header index we are interested in - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_hdr_total_length(struct lws *wsi, enum lws_token_indexes h); - -/** - * lws_hdr_fragment_length: report length of a single fragment of a header - * The returned length does not include the space for a - * terminating '\0' - * - * \param wsi: websocket connection - * \param h: which header index we are interested in - * \param frag_idx: which fragment of h we want to get the length of - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_hdr_fragment_length(struct lws *wsi, enum lws_token_indexes h, int frag_idx); - -/** - * lws_hdr_copy() - copy a single fragment of the given header to a buffer - * The buffer length len must include space for an additional - * terminating '\0', or it will fail returning -1. - * - * \param wsi: websocket connection - * \param dest: destination buffer - * \param len: length of destination buffer - * \param h: which header index we are interested in - * - * copies the whole, aggregated header, even if it was delivered in - * several actual headers piece by piece - */ -LWS_VISIBLE LWS_EXTERN int -lws_hdr_copy(struct lws *wsi, char *dest, int len, enum lws_token_indexes h); - -/** - * lws_hdr_copy_fragment() - copy a single fragment of the given header to a buffer - * The buffer length len must include space for an additional - * terminating '\0', or it will fail returning -1. - * If the requested fragment index is not present, it fails - * returning -1. - * - * \param wsi: websocket connection - * \param dest: destination buffer - * \param len: length of destination buffer - * \param h: which header index we are interested in - * \param frag_idx: which fragment of h we want to copy - * - * Normally this is only useful - * to parse URI arguments like ?x=1&y=2, token index WSI_TOKEN_HTTP_URI_ARGS - * fragment 0 will contain "x=1" and fragment 1 "y=2" - */ -LWS_VISIBLE LWS_EXTERN int -lws_hdr_copy_fragment(struct lws *wsi, char *dest, int len, - enum lws_token_indexes h, int frag_idx); - -/** - * lws_get_urlarg_by_name() - return pointer to arg value if present - * \param wsi: the connection to check - * \param name: the arg name, like "token=" - * \param buf: the buffer to receive the urlarg (including the name= part) - * \param len: the length of the buffer to receive the urlarg - * - * Returns NULL if not found or a pointer inside buf to just after the - * name= part. - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_get_urlarg_by_name(struct lws *wsi, const char *name, char *buf, int len); -///@} - -/*! \defgroup HTTP-headers-create HTTP headers: create - * - * ## HTTP headers: Create - * - * These apis allow you to create HTTP response headers in a way compatible with - * both HTTP/1.x and HTTP/2. - * - * They each append to a buffer taking care about the buffer end, which is - * passed in as a pointer. When data is written to the buffer, the current - * position p is updated accordingly. - * - * All of these apis are LWS_WARN_UNUSED_RESULT as they can run out of space - * and fail with nonzero return. - */ -///@{ - -#define LWSAHH_CODE_MASK ((1 << 16) - 1) -#define LWSAHH_FLAG_NO_SERVER_NAME (1 << 30) - -/** - * lws_add_http_header_status() - add the HTTP response status code - * - * \param wsi: the connection to check - * \param code: an HTTP code like 200, 404 etc (see enum http_status) - * \param p: pointer to current position in buffer pointer - * \param end: pointer to end of buffer - * - * Adds the initial response code, so should be called first. - * - * Code may additionally take OR'd flags: - * - * LWSAHH_FLAG_NO_SERVER_NAME: don't apply server name header this time - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_add_http_header_status(struct lws *wsi, - unsigned int code, unsigned char **p, - unsigned char *end); -/** - * lws_add_http_header_by_name() - append named header and value - * - * \param wsi: the connection to check - * \param name: the hdr name, like "my-header" - * \param value: the value after the = for this header - * \param length: the length of the value - * \param p: pointer to current position in buffer pointer - * \param end: pointer to end of buffer - * - * Appends name: value to the headers - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_add_http_header_by_name(struct lws *wsi, const unsigned char *name, - const unsigned char *value, int length, - unsigned char **p, unsigned char *end); -/** - * lws_add_http_header_by_token() - append given header and value - * - * \param wsi: the connection to check - * \param token: the token index for the hdr - * \param value: the value after the = for this header - * \param length: the length of the value - * \param p: pointer to current position in buffer pointer - * \param end: pointer to end of buffer - * - * Appends name=value to the headers, but is able to take advantage of better - * HTTP/2 coding mechanisms where possible. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_add_http_header_by_token(struct lws *wsi, enum lws_token_indexes token, - const unsigned char *value, int length, - unsigned char **p, unsigned char *end); -/** - * lws_add_http_header_content_length() - append content-length helper - * - * \param wsi: the connection to check - * \param content_length: the content length to use - * \param p: pointer to current position in buffer pointer - * \param end: pointer to end of buffer - * - * Appends content-length: content_length to the headers - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_add_http_header_content_length(struct lws *wsi, - lws_filepos_t content_length, - unsigned char **p, unsigned char *end); -/** - * lws_finalize_http_header() - terminate header block - * - * \param wsi: the connection to check - * \param p: pointer to current position in buffer pointer - * \param end: pointer to end of buffer - * - * Indicates no more headers will be added - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_finalize_http_header(struct lws *wsi, unsigned char **p, - unsigned char *end); - -/** - * lws_finalize_write_http_header() - Helper finializing and writing http headers - * - * \param wsi: the connection to check - * \param start: pointer to the start of headers in the buffer, eg &buf[LWS_PRE] - * \param p: pointer to current position in buffer pointer - * \param end: pointer to end of buffer - * - * Terminates the headers correctly accoring to the protocol in use (h1 / h2) - * and writes the headers. Returns nonzero for error. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_finalize_write_http_header(struct lws *wsi, unsigned char *start, - unsigned char **p, unsigned char *end); - -#define LWS_ILLEGAL_HTTP_CONTENT_LEN ((lws_filepos_t)-1ll) - -/** - * lws_add_http_common_headers() - Helper preparing common http headers - * - * \param wsi: the connection to check - * \param code: an HTTP code like 200, 404 etc (see enum http_status) - * \param content_type: the content type, like "text/html" - * \param content_len: the content length, in bytes - * \param p: pointer to current position in buffer pointer - * \param end: pointer to end of buffer - * - * Adds the initial response code, so should be called first. - * - * Code may additionally take OR'd flags: - * - * LWSAHH_FLAG_NO_SERVER_NAME: don't apply server name header this time - * - * This helper just calls public apis to simplify adding headers that are - * commonly needed. If it doesn't fit your case, or you want to add additional - * headers just call the public apis directly yourself for what you want. - * - * You can miss out the content length header by providing the constant - * LWS_ILLEGAL_HTTP_CONTENT_LEN for the content_len. - * - * It does not call lws_finalize_http_header(), to allow you to add further - * headers after calling this. You will need to call that yourself at the end. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_add_http_common_headers(struct lws *wsi, unsigned int code, - const char *content_type, lws_filepos_t content_len, - unsigned char **p, unsigned char *end); -///@} - -/** \defgroup form-parsing Form Parsing - * \ingroup http - * ##POSTed form parsing functions - * - * These lws_spa (stateful post arguments) apis let you parse and urldecode - * POSTed form arguments, both using simple urlencoded and multipart transfer - * encoding. - * - * It's capable of handling file uploads as well a named input parsing, - * and the apis are the same for both form upload styles. - * - * You feed it a list of parameter names and it creates pointers to the - * urldecoded arguments: file upload parameters pass the file data in chunks to - * a user-supplied callback as they come. - * - * Since it's stateful, it handles the incoming data needing more than one - * POST_BODY callback and has no limit on uploaded file size. - */ -///@{ - -/** enum lws_spa_fileupload_states */ -enum lws_spa_fileupload_states { - LWS_UFS_CONTENT, - /**< a chunk of file content has arrived */ - LWS_UFS_FINAL_CONTENT, - /**< the last chunk (possibly zero length) of file content has arrived */ - LWS_UFS_OPEN - /**< a new file is starting to arrive */ -}; - -/** - * lws_spa_fileupload_cb() - callback to receive file upload data - * - * \param data: opt_data pointer set in lws_spa_create - * \param name: name of the form field being uploaded - * \param filename: original filename from client - * \param buf: start of data to receive - * \param len: length of data to receive - * \param state: information about how this call relates to file - * - * Notice name and filename shouldn't be trusted, as they are passed from - * HTTP provided by the client. - */ -typedef int (*lws_spa_fileupload_cb)(void *data, const char *name, - const char *filename, char *buf, int len, - enum lws_spa_fileupload_states state); - -/** struct lws_spa - opaque urldecode parser capable of handling multipart - * and file uploads */ -struct lws_spa; - -/** - * lws_spa_create() - create urldecode parser - * - * \param wsi: lws connection (used to find Content Type) - * \param param_names: array of form parameter names, like "username" - * \param count_params: count of param_names - * \param max_storage: total amount of form parameter values we can store - * \param opt_cb: NULL, or callback to receive file upload data. - * \param opt_data: NULL, or user pointer provided to opt_cb. - * - * Creates a urldecode parser and initializes it. - * - * opt_cb can be NULL if you just want normal name=value parsing, however - * if one or more entries in your form are bulk data (file transfer), you - * can provide this callback and filter on the name callback parameter to - * treat that urldecoded data separately. The callback should return -1 - * in case of fatal error, and 0 if OK. - */ -LWS_VISIBLE LWS_EXTERN struct lws_spa * -lws_spa_create(struct lws *wsi, const char * const *param_names, - int count_params, int max_storage, lws_spa_fileupload_cb opt_cb, - void *opt_data); - -/** - * lws_spa_process() - parses a chunk of input data - * - * \param spa: the parser object previously created - * \param in: incoming, urlencoded data - * \param len: count of bytes valid at \param in - */ -LWS_VISIBLE LWS_EXTERN int -lws_spa_process(struct lws_spa *spa, const char *in, int len); - -/** - * lws_spa_finalize() - indicate incoming data completed - * - * \param spa: the parser object previously created - */ -LWS_VISIBLE LWS_EXTERN int -lws_spa_finalize(struct lws_spa *spa); - -/** - * lws_spa_get_length() - return length of parameter value - * - * \param spa: the parser object previously created - * \param n: parameter ordinal to return length of value for - */ -LWS_VISIBLE LWS_EXTERN int -lws_spa_get_length(struct lws_spa *spa, int n); - -/** - * lws_spa_get_string() - return pointer to parameter value - * \param spa: the parser object previously created - * \param n: parameter ordinal to return pointer to value for - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_spa_get_string(struct lws_spa *spa, int n); - -/** - * lws_spa_destroy() - destroy parser object - * - * \param spa: the parser object previously created - */ -LWS_VISIBLE LWS_EXTERN int -lws_spa_destroy(struct lws_spa *spa); -///@} - -/*! \defgroup urlendec Urlencode and Urldecode - * \ingroup http - * - * ##HTML chunked Substitution - * - * APIs for receiving chunks of text, replacing a set of variable names via - * a callback, and then prepending and appending HTML chunked encoding - * headers. - */ -//@{ - -/** - * lws_urlencode() - like strncpy but with urlencoding - * - * \param escaped: output buffer - * \param string: input buffer ('/0' terminated) - * \param len: output buffer max length - * - * Because urlencoding expands the output string, it's not - * possible to do it in-place, ie, with escaped == string - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_urlencode(char *escaped, const char *string, int len); - -/* - * URLDECODE 1 / 2 - * - * This simple urldecode only operates until the first '\0' and requires the - * data to exist all at once - */ -/** - * lws_urldecode() - like strncpy but with urldecoding - * - * \param string: output buffer - * \param escaped: input buffer ('\0' terminated) - * \param len: output buffer max length - * - * This is only useful for '\0' terminated strings - * - * Since urldecoding only shrinks the output string, it is possible to - * do it in-place, ie, string == escaped - * - * Returns 0 if completed OK or nonzero for urldecode violation (non-hex chars - * where hex required, etc) - */ -LWS_VISIBLE LWS_EXTERN int -lws_urldecode(char *string, const char *escaped, int len); -///@} -/** - * lws_return_http_status() - Return simple http status - * \param wsi: Websocket instance (available from user callback) - * \param code: Status index, eg, 404 - * \param html_body: User-readable HTML description < 1KB, or NULL - * - * Helper to report HTTP errors back to the client cleanly and - * consistently - */ -LWS_VISIBLE LWS_EXTERN int -lws_return_http_status(struct lws *wsi, unsigned int code, - const char *html_body); - -/** - * lws_http_redirect() - write http redirect out on wsi - * - * \param wsi: websocket connection - * \param code: HTTP response code (eg, 301) - * \param loc: where to redirect to - * \param len: length of loc - * \param p: pointer current position in buffer (updated as we write) - * \param end: pointer to end of buffer - * - * Returns amount written, or < 0 indicating fatal write failure. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_http_redirect(struct lws *wsi, int code, const unsigned char *loc, int len, - unsigned char **p, unsigned char *end); - -/** - * lws_http_transaction_completed() - wait for new http transaction or close - * \param wsi: websocket connection - * - * Returns 1 if the HTTP connection must close now - * Returns 0 and resets connection to wait for new HTTP header / - * transaction if possible - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_http_transaction_completed(struct lws *wsi); -///@} - -/*! \defgroup pur Sanitize / purify SQL and JSON helpers - * - * ##Sanitize / purify SQL and JSON helpers - * - * APIs for escaping untrusted JSON and SQL safely before use - */ -//@{ - -/** - * lws_sql_purify() - like strncpy but with escaping for sql quotes - * - * \param escaped: output buffer - * \param string: input buffer ('/0' terminated) - * \param len: output buffer max length - * - * Because escaping expands the output string, it's not - * possible to do it in-place, ie, with escaped == string - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_sql_purify(char *escaped, const char *string, int len); - -/** - * lws_json_purify() - like strncpy but with escaping for json chars - * - * \param escaped: output buffer - * \param string: input buffer ('/0' terminated) - * \param len: output buffer max length - * - * Because escaping expands the output string, it's not - * possible to do it in-place, ie, with escaped == string - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_json_purify(char *escaped, const char *string, int len); - -/** - * lws_filename_purify_inplace() - replace scary filename chars with underscore - * - * \param filename: filename to be purified - * - * Replace scary characters in the filename (it should not be a path) - * with underscore, so it's safe to use. - */ -LWS_VISIBLE LWS_EXTERN void -lws_filename_purify_inplace(char *filename); - -LWS_VISIBLE LWS_EXTERN int -lws_plat_write_cert(struct lws_vhost *vhost, int is_key, int fd, void *buf, - int len); -LWS_VISIBLE LWS_EXTERN int -lws_plat_write_file(const char *filename, void *buf, int len); - -LWS_VISIBLE LWS_EXTERN int -lws_plat_read_file(const char *filename, void *buf, int len); - -LWS_VISIBLE LWS_EXTERN int -lws_plat_recommended_rsa_bits(void); -///@} - -/*! \defgroup uv libuv helpers - * - * ##libuv helpers - * - * APIs specific to libuv event loop itegration - */ -///@{ -#ifdef LWS_WITH_LIBUV -/* - * Any direct libuv allocations in lws protocol handlers must participate in the - * lws reference counting scheme. Two apis are provided: - * - * - lws_libuv_static_refcount_add(handle, context) to mark the handle with - * a pointer to the context and increment the global uv object counter - * - * - lws_libuv_static_refcount_del() which should be used as the close callback - * for your own libuv objects declared in the protocol scope. - * - * Using the apis allows lws to detach itself from a libuv loop completely - * cleanly and at the moment all of its libuv objects have completed close. - */ - -LWS_VISIBLE LWS_EXTERN uv_loop_t * -lws_uv_getloop(struct lws_context *context, int tsi); - -LWS_VISIBLE LWS_EXTERN void -lws_libuv_static_refcount_add(uv_handle_t *, struct lws_context *context); - -LWS_VISIBLE LWS_EXTERN void -lws_libuv_static_refcount_del(uv_handle_t *); - -#endif /* LWS_WITH_LIBUV */ - -#if defined(LWS_WITH_ESP32) -#define lws_libuv_static_refcount_add(_a, _b) -#define lws_libuv_static_refcount_del NULL -#endif -///@} - - -/*! \defgroup timeout Connection timeouts - - APIs related to setting connection timeouts -*/ -//@{ - -/* - * NOTE: These public enums are part of the abi. If you want to add one, - * add it at where specified so existing users are unaffected. - */ -enum pending_timeout { - NO_PENDING_TIMEOUT = 0, - PENDING_TIMEOUT_AWAITING_PROXY_RESPONSE = 1, - PENDING_TIMEOUT_AWAITING_CONNECT_RESPONSE = 2, - PENDING_TIMEOUT_ESTABLISH_WITH_SERVER = 3, - PENDING_TIMEOUT_AWAITING_SERVER_RESPONSE = 4, - PENDING_TIMEOUT_AWAITING_PING = 5, - PENDING_TIMEOUT_CLOSE_ACK = 6, - PENDING_TIMEOUT_UNUSED1 = 7, - PENDING_TIMEOUT_SENT_CLIENT_HANDSHAKE = 8, - PENDING_TIMEOUT_SSL_ACCEPT = 9, - PENDING_TIMEOUT_HTTP_CONTENT = 10, - PENDING_TIMEOUT_AWAITING_CLIENT_HS_SEND = 11, - PENDING_FLUSH_STORED_SEND_BEFORE_CLOSE = 12, - PENDING_TIMEOUT_SHUTDOWN_FLUSH = 13, - PENDING_TIMEOUT_CGI = 14, - PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE = 15, - PENDING_TIMEOUT_WS_PONG_CHECK_SEND_PING = 16, - PENDING_TIMEOUT_WS_PONG_CHECK_GET_PONG = 17, - PENDING_TIMEOUT_CLIENT_ISSUE_PAYLOAD = 18, - PENDING_TIMEOUT_AWAITING_SOCKS_GREETING_REPLY = 19, - PENDING_TIMEOUT_AWAITING_SOCKS_CONNECT_REPLY = 20, - PENDING_TIMEOUT_AWAITING_SOCKS_AUTH_REPLY = 21, - PENDING_TIMEOUT_KILLED_BY_SSL_INFO = 22, - PENDING_TIMEOUT_KILLED_BY_PARENT = 23, - PENDING_TIMEOUT_CLOSE_SEND = 24, - PENDING_TIMEOUT_HOLDING_AH = 25, - PENDING_TIMEOUT_UDP_IDLE = 26, - PENDING_TIMEOUT_CLIENT_CONN_IDLE = 27, - PENDING_TIMEOUT_LAGGING = 28, - - /****** add new things just above ---^ ******/ - - PENDING_TIMEOUT_USER_REASON_BASE = 1000 -}; - -#define LWS_TO_KILL_ASYNC -1 -/**< If LWS_TO_KILL_ASYNC is given as the timeout sec in a lws_set_timeout() - * call, then the connection is marked to be killed at the next timeout - * check. This is how you should force-close the wsi being serviced if - * you are doing it outside the callback (where you should close by nonzero - * return). - */ -#define LWS_TO_KILL_SYNC -2 -/**< If LWS_TO_KILL_SYNC is given as the timeout sec in a lws_set_timeout() - * call, then the connection is closed before returning (which may delete - * the wsi). This should only be used where the wsi being closed is not the - * wsi currently being serviced. - */ -/** - * lws_set_timeout() - marks the wsi as subject to a timeout - * - * You will not need this unless you are doing something special - * - * \param wsi: Websocket connection instance - * \param reason: timeout reason - * \param secs: how many seconds. You may set to LWS_TO_KILL_ASYNC to - * force the connection to timeout at the next opportunity, or - * LWS_TO_KILL_SYNC to close it synchronously if you know the - * wsi is not the one currently being serviced. - */ -LWS_VISIBLE LWS_EXTERN void -lws_set_timeout(struct lws *wsi, enum pending_timeout reason, int secs); - -#define LWS_SET_TIMER_USEC_CANCEL ((lws_usec_t)-1ll) -#define LWS_USEC_PER_SEC (1000000ll) - -/** - * lws_set_timer_usecs() - schedules a callback on the wsi in the future - * - * \param wsi: Websocket connection instance - * \param usecs: LWS_SET_TIMER_USEC_CANCEL removes any existing scheduled - * callback, otherwise number of microseconds in the future - * the callback will occur at. - * - * NOTE: event loop support for this: - * - * default poll() loop: yes - * libuv event loop: yes - * libev: not implemented (patch welcome) - * libevent: not implemented (patch welcome) - * - * After the deadline expires, the wsi will get a callback of type - * LWS_CALLBACK_TIMER and the timer is exhausted. The deadline may be - * continuously deferred by further calls to lws_set_timer_usecs() with a later - * deadline, or cancelled by lws_set_timer_usecs(wsi, -1). - * - * If the timer should repeat, lws_set_timer_usecs() must be called again from - * LWS_CALLBACK_TIMER. - * - * Accuracy depends on the platform and the load on the event loop or system... - * all that's guaranteed is the callback will come after the requested wait - * period. - */ -LWS_VISIBLE LWS_EXTERN void -lws_set_timer_usecs(struct lws *wsi, lws_usec_t usecs); - -/* - * lws_timed_callback_vh_protocol() - calls back a protocol on a vhost after - * the specified delay - * - * \param vh: the vhost to call back - * \param protocol: the protocol to call back - * \param reason: callback reason - * \param secs: how many seconds in the future to do the callback. Set to - * -1 to cancel the timer callback. - * - * Callback the specified protocol with a fake wsi pointing to the specified - * vhost and protocol, with the specified reason, at the specified time in the - * future. - * - * Returns 0 if OK. - */ -LWS_VISIBLE LWS_EXTERN int -lws_timed_callback_vh_protocol(struct lws_vhost *vh, - const struct lws_protocols *prot, - int reason, int secs); -///@} - -/*! \defgroup sending-data Sending data - - APIs related to writing data on a connection -*/ -//@{ -#if !defined(LWS_SIZEOFPTR) -#define LWS_SIZEOFPTR ((int)sizeof (void *)) -#endif - -#if defined(__x86_64__) -#define _LWS_PAD_SIZE 16 /* Intel recommended for best performance */ -#else -#define _LWS_PAD_SIZE LWS_SIZEOFPTR /* Size of a pointer on the target arch */ -#endif -#define _LWS_PAD(n) (((n) % _LWS_PAD_SIZE) ? \ - ((n) + (_LWS_PAD_SIZE - ((n) % _LWS_PAD_SIZE))) : (n)) -/* last 2 is for lws-meta */ -#define LWS_PRE _LWS_PAD(4 + 10 + 2) -/* used prior to 1.7 and retained for backward compatibility */ -#define LWS_SEND_BUFFER_PRE_PADDING LWS_PRE -#define LWS_SEND_BUFFER_POST_PADDING 0 - -#define LWS_WRITE_RAW LWS_WRITE_HTTP - -/* - * NOTE: These public enums are part of the abi. If you want to add one, - * add it at where specified so existing users are unaffected. - */ -enum lws_write_protocol { - LWS_WRITE_TEXT = 0, - /**< Send a ws TEXT message,the pointer must have LWS_PRE valid - * memory behind it. The receiver expects only valid utf-8 in the - * payload */ - LWS_WRITE_BINARY = 1, - /**< Send a ws BINARY message, the pointer must have LWS_PRE valid - * memory behind it. Any sequence of bytes is valid */ - LWS_WRITE_CONTINUATION = 2, - /**< Continue a previous ws message, the pointer must have LWS_PRE valid - * memory behind it */ - LWS_WRITE_HTTP = 3, - /**< Send HTTP content */ - - /* LWS_WRITE_CLOSE is handled by lws_close_reason() */ - LWS_WRITE_PING = 5, - LWS_WRITE_PONG = 6, - - /* Same as write_http but we know this write ends the transaction */ - LWS_WRITE_HTTP_FINAL = 7, - - /* HTTP2 */ - - LWS_WRITE_HTTP_HEADERS = 8, - /**< Send http headers (http2 encodes this payload and LWS_WRITE_HTTP - * payload differently, http 1.x links also handle this correctly. so - * to be compatible with both in the future,header response part should - * be sent using this regardless of http version expected) - */ - LWS_WRITE_HTTP_HEADERS_CONTINUATION = 9, - /**< Continuation of http/2 headers - */ - - /****** add new things just above ---^ ******/ - - /* flags */ - - LWS_WRITE_NO_FIN = 0x40, - /**< This part of the message is not the end of the message */ - - LWS_WRITE_H2_STREAM_END = 0x80, - /**< Flag indicates this packet should go out with STREAM_END if h2 - * STREAM_END is allowed on DATA or HEADERS. - */ - - LWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80 - /**< client packet payload goes out on wire unmunged - * only useful for security tests since normal servers cannot - * decode the content if used */ -}; - -/* used with LWS_CALLBACK_CHILD_WRITE_VIA_PARENT */ - -struct lws_write_passthru { - struct lws *wsi; - unsigned char *buf; - size_t len; - enum lws_write_protocol wp; -}; - - -/** - * lws_write() - Apply protocol then write data to client - * \param wsi: Websocket instance (available from user callback) - * \param buf: The data to send. For data being sent on a websocket - * connection (ie, not default http), this buffer MUST have - * LWS_PRE bytes valid BEFORE the pointer. - * This is so the protocol header data can be added in-situ. - * \param len: Count of the data bytes in the payload starting from buf - * \param protocol: Use LWS_WRITE_HTTP to reply to an http connection, and one - * of LWS_WRITE_BINARY or LWS_WRITE_TEXT to send appropriate - * data on a websockets connection. Remember to allow the extra - * bytes before and after buf if LWS_WRITE_BINARY or LWS_WRITE_TEXT - * are used. - * - * This function provides the way to issue data back to the client - * for both http and websocket protocols. - * - * IMPORTANT NOTICE! - * - * When sending with websocket protocol - * - * LWS_WRITE_TEXT, - * LWS_WRITE_BINARY, - * LWS_WRITE_CONTINUATION, - * LWS_WRITE_PING, - * LWS_WRITE_PONG - * - * the send buffer has to have LWS_PRE bytes valid BEFORE - * the buffer pointer you pass to lws_write(). - * - * This allows us to add protocol info before and after the data, and send as - * one packet on the network without payload copying, for maximum efficiency. - * - * So for example you need this kind of code to use lws_write with a - * 128-byte payload - * - * char buf[LWS_PRE + 128]; - * - * // fill your part of the buffer... for example here it's all zeros - * memset(&buf[LWS_PRE], 0, 128); - * - * lws_write(wsi, &buf[LWS_PRE], 128, LWS_WRITE_TEXT); - * - * When sending HTTP, with - * - * LWS_WRITE_HTTP, - * LWS_WRITE_HTTP_HEADERS - * LWS_WRITE_HTTP_FINAL - * - * there is no protocol data prepended, and don't need to take care about the - * LWS_PRE bytes valid before the buffer pointer. - * - * LWS_PRE is at least the frame nonce + 2 header + 8 length - * LWS_SEND_BUFFER_POST_PADDING is deprecated, it's now 0 and can be left off. - * The example apps no longer use it. - * - * Pad LWS_PRE to the CPU word size, so that word references - * to the address immediately after the padding won't cause an unaligned access - * error. Sometimes for performance reasons the recommended padding is even - * larger than sizeof(void *). - * - * In the case of sending using websocket protocol, be sure to allocate - * valid storage before and after buf as explained above. This scheme - * allows maximum efficiency of sending data and protocol in a single - * packet while not burdening the user code with any protocol knowledge. - * - * Return may be -1 for a fatal error needing connection close, or the - * number of bytes sent. - * - * Truncated Writes - * ================ - * - * The OS may not accept everything you asked to write on the connection. - * - * Posix defines POLLOUT indication from poll() to show that the connection - * will accept more write data, but it doesn't specifiy how much. It may just - * accept one byte of whatever you wanted to send. - * - * LWS will buffer the remainder automatically, and send it out autonomously. - * - * During that time, WRITABLE callbacks will be suppressed. - * - * This is to handle corner cases where unexpectedly the OS refuses what we - * usually expect it to accept. You should try to send in chunks that are - * almost always accepted in order to avoid the inefficiency of the buffering. - */ -LWS_VISIBLE LWS_EXTERN int -lws_write(struct lws *wsi, unsigned char *buf, size_t len, - enum lws_write_protocol protocol); - -/* helper for case where buffer may be const */ -#define lws_write_http(wsi, buf, len) \ - lws_write(wsi, (unsigned char *)(buf), len, LWS_WRITE_HTTP) - -/* helper for multi-frame ws message flags */ -static LWS_INLINE int -lws_write_ws_flags(int initial, int is_start, int is_end) -{ - int r; - - if (is_start) - r = initial; - else - r = LWS_WRITE_CONTINUATION; - - if (!is_end) - r |= LWS_WRITE_NO_FIN; - - return r; -} -///@} - -/** \defgroup callback-when-writeable Callback when writeable - * - * ##Callback When Writeable - * - * lws can only write data on a connection when it is able to accept more - * data without blocking. - * - * So a basic requirement is we should only use the lws_write() apis when the - * connection we want to write on says that he can accept more data. - * - * When lws cannot complete your send at the time, it will buffer the data - * and send it in the background, suppressing any further WRITEABLE callbacks - * on that connection until it completes. So it is important to write new - * things in a new writeable callback. - * - * These apis reflect the various ways we can indicate we would like to be - * called back when one or more connections is writeable. - */ -///@{ - -/** - * lws_callback_on_writable() - Request a callback when this socket - * becomes able to be written to without - * blocking - * - * \param wsi: Websocket connection instance to get callback for - * - * - Which: only this wsi - * - When: when the individual connection becomes writeable - * - What: LWS_CALLBACK_*_WRITEABLE - */ -LWS_VISIBLE LWS_EXTERN int -lws_callback_on_writable(struct lws *wsi); - -/** - * lws_callback_on_writable_all_protocol() - Request a callback for all - * connections using the given protocol when it - * becomes possible to write to each socket without - * blocking in turn. - * - * \param context: lws_context - * \param protocol: Protocol whose connections will get callbacks - * - * - Which: connections using this protocol on ANY VHOST - * - When: when the individual connection becomes writeable - * - What: LWS_CALLBACK_*_WRITEABLE - */ -LWS_VISIBLE LWS_EXTERN int -lws_callback_on_writable_all_protocol(const struct lws_context *context, - const struct lws_protocols *protocol); - -/** - * lws_callback_on_writable_all_protocol_vhost() - Request a callback for - * all connections on same vhost using the given protocol - * when it becomes possible to write to each socket without - * blocking in turn. - * - * \param vhost: Only consider connections on this lws_vhost - * \param protocol: Protocol whose connections will get callbacks - * - * - Which: connections using this protocol on GIVEN VHOST ONLY - * - When: when the individual connection becomes writeable - * - What: LWS_CALLBACK_*_WRITEABLE - */ -LWS_VISIBLE LWS_EXTERN int -lws_callback_on_writable_all_protocol_vhost(const struct lws_vhost *vhost, - const struct lws_protocols *protocol); - -/** - * lws_callback_all_protocol() - Callback all connections using - * the given protocol with the given reason - * - * \param context: lws_context - * \param protocol: Protocol whose connections will get callbacks - * \param reason: Callback reason index - * - * - Which: connections using this protocol on ALL VHOSTS - * - When: before returning - * - What: reason - * - * This isn't normally what you want... normally any update of connection- - * specific information can wait until a network-related callback like rx, - * writable, or close. - */ -LWS_VISIBLE LWS_EXTERN int -lws_callback_all_protocol(struct lws_context *context, - const struct lws_protocols *protocol, int reason); - -/** - * lws_callback_all_protocol_vhost() - Callback all connections using - * the given protocol with the given reason. This is - * deprecated since v2.4: use lws_callback_all_protocol_vhost_args - * - * \param vh: Vhost whose connections will get callbacks - * \param protocol: Which protocol to match. NULL means all. - * \param reason: Callback reason index - * - * - Which: connections using this protocol on GIVEN VHOST ONLY - * - When: now - * - What: reason - */ -LWS_VISIBLE LWS_EXTERN int -lws_callback_all_protocol_vhost(struct lws_vhost *vh, - const struct lws_protocols *protocol, int reason) -LWS_WARN_DEPRECATED; - -/** - * lws_callback_all_protocol_vhost_args() - Callback all connections using - * the given protocol with the given reason and args - * - * \param vh: Vhost whose connections will get callbacks - * \param protocol: Which protocol to match. NULL means all. - * \param reason: Callback reason index - * \param argp: Callback "in" parameter - * \param len: Callback "len" parameter - * - * - Which: connections using this protocol on GIVEN VHOST ONLY - * - When: now - * - What: reason - */ -LWS_VISIBLE int -lws_callback_all_protocol_vhost_args(struct lws_vhost *vh, - const struct lws_protocols *protocol, int reason, - void *argp, size_t len); - -/** - * lws_callback_vhost_protocols() - Callback all protocols enabled on a vhost - * with the given reason - * - * \param wsi: wsi whose vhost will get callbacks - * \param reason: Callback reason index - * \param in: in argument to callback - * \param len: len argument to callback - * - * - Which: connections using this protocol on same VHOST as wsi ONLY - * - When: now - * - What: reason - * - * This is deprecated since v2.5, use lws_callback_vhost_protocols_vhost() - * which takes the pointer to the vhost directly without using or needing the - * wsi. - */ -LWS_VISIBLE LWS_EXTERN int -lws_callback_vhost_protocols(struct lws *wsi, int reason, void *in, int len) -LWS_WARN_DEPRECATED; - -/** - * lws_callback_vhost_protocols_vhost() - Callback all protocols enabled on a vhost - * with the given reason - * - * \param vh: vhost that will get callbacks - * \param reason: Callback reason index - * \param in: in argument to callback - * \param len: len argument to callback - * - * - Which: connections using this protocol on same VHOST as wsi ONLY - * - When: now - * - What: reason - */ -LWS_VISIBLE LWS_EXTERN int -lws_callback_vhost_protocols_vhost(struct lws_vhost *vh, int reason, void *in, - size_t len); - -LWS_VISIBLE LWS_EXTERN int -lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason, - void *user, void *in, size_t len); - -/** - * lws_get_socket_fd() - returns the socket file descriptor - * - * This is needed to use sendto() on UDP raw sockets - * - * \param wsi: Websocket connection instance - */ -LWS_VISIBLE LWS_EXTERN lws_sockfd_type -lws_get_socket_fd(struct lws *wsi); - -/** - * lws_get_peer_write_allowance() - get the amount of data writeable to peer - * if known - * - * \param wsi: Websocket connection instance - * - * if the protocol does not have any guidance, returns -1. Currently only - * http2 connections get send window information from this API. But your code - * should use it so it can work properly with any protocol. - * - * If nonzero return is the amount of payload data the peer or intermediary has - * reported it has buffer space for. That has NO relationship with the amount - * of buffer space your OS can accept on this connection for a write action. - * - * This number represents the maximum you could send to the peer or intermediary - * on this connection right now without the protocol complaining. - * - * lws manages accounting for send window updates and payload writes - * automatically, so this number reflects the situation at the peer or - * intermediary dynamically. - */ -LWS_VISIBLE LWS_EXTERN lws_fileofs_t -lws_get_peer_write_allowance(struct lws *wsi); -///@} - -enum { - /* - * Flags for enable and disable rxflow with reason bitmap and with - * backwards-compatible single bool - */ - LWS_RXFLOW_REASON_USER_BOOL = (1 << 0), - LWS_RXFLOW_REASON_HTTP_RXBUFFER = (1 << 6), - LWS_RXFLOW_REASON_H2_PPS_PENDING = (1 << 7), - - LWS_RXFLOW_REASON_APPLIES = (1 << 14), - LWS_RXFLOW_REASON_APPLIES_ENABLE_BIT = (1 << 13), - LWS_RXFLOW_REASON_APPLIES_ENABLE = LWS_RXFLOW_REASON_APPLIES | - LWS_RXFLOW_REASON_APPLIES_ENABLE_BIT, - LWS_RXFLOW_REASON_APPLIES_DISABLE = LWS_RXFLOW_REASON_APPLIES, - LWS_RXFLOW_REASON_FLAG_PROCESS_NOW = (1 << 12), - -}; - -/** - * lws_rx_flow_control() - Enable and disable socket servicing for - * received packets. - * - * If the output side of a server process becomes choked, this allows flow - * control for the input side. - * - * \param wsi: Websocket connection instance to get callback for - * \param enable: 0 = disable read servicing for this connection, 1 = enable - * - * If you need more than one additive reason for rxflow control, you can give - * iLWS_RXFLOW_REASON_APPLIES_ENABLE or _DISABLE together with one or more of - * b5..b0 set to idicate which bits to enable or disable. If any bits are - * enabled, rx on the connection is suppressed. - * - * LWS_RXFLOW_REASON_FLAG_PROCESS_NOW flag may also be given to force any change - * in rxflowbstatus to benapplied immediately, this should be used when you are - * changing a wsi flow control state from outside a callback on that wsi. - */ -LWS_VISIBLE LWS_EXTERN int -lws_rx_flow_control(struct lws *wsi, int enable); - -/** - * lws_rx_flow_allow_all_protocol() - Allow all connections with this protocol to receive - * - * When the user server code realizes it can accept more input, it can - * call this to have the RX flow restriction removed from all connections using - * the given protocol. - * \param context: lws_context - * \param protocol: all connections using this protocol will be allowed to receive - */ -LWS_VISIBLE LWS_EXTERN void -lws_rx_flow_allow_all_protocol(const struct lws_context *context, - const struct lws_protocols *protocol); - -/** - * lws_remaining_packet_payload() - Bytes to come before "overall" - * rx fragment is complete - * \param wsi: Websocket instance (available from user callback) - * - * This tracks how many bytes are left in the current ws fragment, according - * to the ws length given in the fragment header. - * - * If the message was in a single fragment, and there is no compression, this - * is the same as "how much data is left to read for this message". - * - * However, if the message is being sent in multiple fragments, this will - * reflect the unread amount of the current **fragment**, not the message. With - * ws, it is legal to not know the length of the message before it completes. - * - * Additionally if the message is sent via the negotiated permessage-deflate - * extension, this number only tells the amount of **compressed** data left to - * be read, since that is the only information available at the ws layer. - */ -LWS_VISIBLE LWS_EXTERN size_t -lws_remaining_packet_payload(struct lws *wsi); - - -/** \defgroup sock-adopt Socket adoption helpers - * ##Socket adoption helpers - * - * When integrating with an external app with its own event loop, these can - * be used to accept connections from someone else's listening socket. - * - * When using lws own event loop, these are not needed. - */ -///@{ - -/** - * lws_adopt_socket() - adopt foreign socket as if listen socket accepted it - * for the default vhost of context. - * - * \param context: lws context - * \param accept_fd: fd of already-accepted socket to adopt - * - * Either returns new wsi bound to accept_fd, or closes accept_fd and - * returns NULL, having cleaned up any new wsi pieces. - * - * LWS adopts the socket in http serving mode, it's ready to accept an upgrade - * to ws or just serve http. - */ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_adopt_socket(struct lws_context *context, lws_sockfd_type accept_fd); -/** - * lws_adopt_socket_vhost() - adopt foreign socket as if listen socket accepted it - * for vhost - * - * \param vh: lws vhost - * \param accept_fd: fd of already-accepted socket to adopt - * - * Either returns new wsi bound to accept_fd, or closes accept_fd and - * returns NULL, having cleaned up any new wsi pieces. - * - * LWS adopts the socket in http serving mode, it's ready to accept an upgrade - * to ws or just serve http. - */ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_adopt_socket_vhost(struct lws_vhost *vh, lws_sockfd_type accept_fd); - -typedef enum { - LWS_ADOPT_RAW_FILE_DESC = 0, /* convenience constant */ - LWS_ADOPT_HTTP = 1, /* flag: absent implies RAW */ - LWS_ADOPT_SOCKET = 2, /* flag: absent implies file descr */ - LWS_ADOPT_ALLOW_SSL = 4, /* flag: if set requires LWS_ADOPT_SOCKET */ - LWS_ADOPT_WS_PARENTIO = 8, /* flag: ws mode parent handles IO - * if given must be only flag - * wsi put directly into ws mode */ - LWS_ADOPT_FLAG_UDP = 16, /* flag: socket is UDP */ - - LWS_ADOPT_RAW_SOCKET_UDP = LWS_ADOPT_SOCKET | LWS_ADOPT_FLAG_UDP, -} lws_adoption_type; - -typedef union { - lws_sockfd_type sockfd; - lws_filefd_type filefd; -} lws_sock_file_fd_type; - -#if !defined(LWS_WITH_ESP32) -struct lws_udp { - struct sockaddr sa; - socklen_t salen; - - struct sockaddr sa_pending; - socklen_t salen_pending; -}; -#endif - -/* -* lws_adopt_descriptor_vhost() - adopt foreign socket or file descriptor -* if socket descriptor, should already have been accepted from listen socket -* -* \param vhost: lws vhost -* \param type: OR-ed combinations of lws_adoption_type flags -* \param fd: union with either .sockfd or .filefd set -* \param vh_prot_name: NULL or vh protocol name to bind raw connection to -* \param parent: NULL or struct lws to attach new_wsi to as a child -* -* Either returns new wsi bound to accept_fd, or closes accept_fd and -* returns NULL, having cleaned up any new wsi pieces. -* -* If LWS_ADOPT_SOCKET is set, LWS adopts the socket in http serving mode, it's -* ready to accept an upgrade to ws or just serve http. -* -* parent may be NULL, if given it should be an existing wsi that will become the -* parent of the new wsi created by this call. -*/ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_adopt_descriptor_vhost(struct lws_vhost *vh, lws_adoption_type type, - lws_sock_file_fd_type fd, const char *vh_prot_name, - struct lws *parent); - -/** - * lws_adopt_socket_readbuf() - adopt foreign socket and first rx as if listen socket accepted it - * for the default vhost of context. - * \param context: lws context - * \param accept_fd: fd of already-accepted socket to adopt - * \param readbuf: NULL or pointer to data that must be drained before reading from - * accept_fd - * \param len: The length of the data held at \param readbuf - * - * Either returns new wsi bound to accept_fd, or closes accept_fd and - * returns NULL, having cleaned up any new wsi pieces. - * - * LWS adopts the socket in http serving mode, it's ready to accept an upgrade - * to ws or just serve http. - * - * If your external code did not already read from the socket, you can use - * lws_adopt_socket() instead. - * - * This api is guaranteed to use the data at \param readbuf first, before reading from - * the socket. - * - * readbuf is limited to the size of the ah rx buf, currently 2048 bytes. - */ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_adopt_socket_readbuf(struct lws_context *context, lws_sockfd_type accept_fd, - const char *readbuf, size_t len); -/** - * lws_adopt_socket_vhost_readbuf() - adopt foreign socket and first rx as if listen socket - * accepted it for vhost. - * \param vhost: lws vhost - * \param accept_fd: fd of already-accepted socket to adopt - * \param readbuf: NULL or pointer to data that must be drained before reading from - * accept_fd - * \param len: The length of the data held at \param readbuf - * - * Either returns new wsi bound to accept_fd, or closes accept_fd and - * returns NULL, having cleaned up any new wsi pieces. - * - * LWS adopts the socket in http serving mode, it's ready to accept an upgrade - * to ws or just serve http. - * - * If your external code did not already read from the socket, you can use - * lws_adopt_socket() instead. - * - * This api is guaranteed to use the data at \param readbuf first, before reading from - * the socket. - * - * readbuf is limited to the size of the ah rx buf, currently 2048 bytes. - */ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_adopt_socket_vhost_readbuf(struct lws_vhost *vhost, lws_sockfd_type accept_fd, - const char *readbuf, size_t len); - -#define LWS_CAUDP_BIND 1 - -/** - * lws_create_adopt_udp() - create, bind and adopt a UDP socket - * - * \param vhost: lws vhost - * \param port: UDP port to bind to, -1 means unbound - * \param flags: 0 or LWS_CAUDP_NO_BIND - * \param protocol_name: Name of protocol on vhost to bind wsi to - * \param parent_wsi: NULL or parent wsi new wsi will be a child of - * - * Either returns new wsi bound to accept_fd, or closes accept_fd and - * returns NULL, having cleaned up any new wsi pieces. - * */ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags, - const char *protocol_name, struct lws *parent_wsi); -///@} - -/** \defgroup net Network related helper APIs - * ##Network related helper APIs - * - * These wrap miscellaneous useful network-related functions - */ -///@{ - -/** - * lws_canonical_hostname() - returns this host's hostname - * - * This is typically used by client code to fill in the host parameter - * when making a client connection. You can only call it after the context - * has been created. - * - * \param context: Websocket context - */ -LWS_VISIBLE LWS_EXTERN const char * LWS_WARN_UNUSED_RESULT -lws_canonical_hostname(struct lws_context *context); - -/** - * lws_get_peer_addresses() - Get client address information - * \param wsi: Local struct lws associated with - * \param fd: Connection socket descriptor - * \param name: Buffer to take client address name - * \param name_len: Length of client address name buffer - * \param rip: Buffer to take client address IP dotted quad - * \param rip_len: Length of client address IP buffer - * - * This function fills in name and rip with the name and IP of - * the client connected with socket descriptor fd. Names may be - * truncated if there is not enough room. If either cannot be - * determined, they will be returned as valid zero-length strings. - */ -LWS_VISIBLE LWS_EXTERN void -lws_get_peer_addresses(struct lws *wsi, lws_sockfd_type fd, char *name, - int name_len, char *rip, int rip_len); - -/** - * lws_get_peer_simple() - Get client address information without RDNS - * - * \param wsi: Local struct lws associated with - * \param name: Buffer to take client address name - * \param namelen: Length of client address name buffer - * - * This provides a 123.123.123.123 type IP address in name from the - * peer that has connected to wsi - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_get_peer_simple(struct lws *wsi, char *name, int namelen); - - -#define LWS_ITOSA_NOT_EXIST -1 -#define LWS_ITOSA_NOT_USABLE -2 -#define LWS_ITOSA_USABLE 0 -#if !defined(LWS_WITH_ESP32) -/** - * lws_interface_to_sa() - Convert interface name or IP to sockaddr struct - * - * \param ipv6: Allow IPV6 addresses - * \param ifname: Interface name or IP - * \param addr: struct sockaddr_in * to be written - * \param addrlen: Length of addr - * - * This converts a textual network interface name to a sockaddr usable by - * other network functions. - * - * If the network interface doesn't exist, it will return LWS_ITOSA_NOT_EXIST. - * - * If the network interface is not usable, eg ethernet cable is removed, it - * may logically exist but not have any IP address. As such it will return - * LWS_ITOSA_NOT_USABLE. - * - * If the network interface exists and is usable, it will return - * LWS_ITOSA_USABLE. - */ -LWS_VISIBLE LWS_EXTERN int -lws_interface_to_sa(int ipv6, const char *ifname, struct sockaddr_in *addr, - size_t addrlen); -///@} -#endif - -/** \defgroup misc Miscellaneous APIs -* ##Miscellaneous APIs -* -* Various APIs outside of other categories -*/ -///@{ - -/** - * lws_start_foreach_ll(): linkedlist iterator helper start - * - * \param type: type of iteration, eg, struct xyz * - * \param it: iterator var name to create - * \param start: start of list - * - * This helper creates an iterator and starts a while (it) { - * loop. The iterator runs through the linked list starting at start and - * ends when it gets a NULL. - * The while loop should be terminated using lws_start_foreach_ll(). - */ -#define lws_start_foreach_ll(type, it, start)\ -{ \ - type it = start; \ - while (it) { - -/** - * lws_end_foreach_ll(): linkedlist iterator helper end - * - * \param it: same iterator var name given when starting - * \param nxt: member name in the iterator pointing to next list element - * - * This helper is the partner for lws_start_foreach_ll() that ends the - * while loop. - */ - -#define lws_end_foreach_ll(it, nxt) \ - it = it->nxt; \ - } \ -} - -/** - * lws_start_foreach_llp(): linkedlist pointer iterator helper start - * - * \param type: type of iteration, eg, struct xyz ** - * \param it: iterator var name to create - * \param start: start of list - * - * This helper creates an iterator and starts a while (it) { - * loop. The iterator runs through the linked list starting at the - * address of start and ends when it gets a NULL. - * The while loop should be terminated using lws_start_foreach_llp(). - * - * This helper variant iterates using a pointer to the previous linked-list - * element. That allows you to easily delete list members by rewriting the - * previous pointer to the element's next pointer. - */ -#define lws_start_foreach_llp(type, it, start)\ -{ \ - type it = &(start); \ - while (*(it)) { - -#define lws_start_foreach_llp_safe(type, it, start, nxt)\ -{ \ - type it = &(start); \ - type next; \ - while (*(it)) { \ - next = &((*(it))->nxt); \ - -/** - * lws_end_foreach_llp(): linkedlist pointer iterator helper end - * - * \param it: same iterator var name given when starting - * \param nxt: member name in the iterator pointing to next list element - * - * This helper is the partner for lws_start_foreach_llp() that ends the - * while loop. - */ - -#define lws_end_foreach_llp(it, nxt) \ - it = &(*(it))->nxt; \ - } \ -} - -#define lws_end_foreach_llp_safe(it) \ - it = next; \ - } \ -} - -#define lws_ll_fwd_insert(\ - ___new_object, /* pointer to new object */ \ - ___m_list, /* member for next list object ptr */ \ - ___list_head /* list head */ \ - ) {\ - ___new_object->___m_list = ___list_head; \ - ___list_head = ___new_object; \ - } - -#define lws_ll_fwd_remove(\ - ___type, /* type of listed object */ \ - ___m_list, /* member for next list object ptr */ \ - ___target, /* object to remove from list */ \ - ___list_head /* list head */ \ - ) { \ - lws_start_foreach_llp(___type **, ___ppss, ___list_head) { \ - if (*___ppss == ___target) { \ - *___ppss = ___target->___m_list; \ - break; \ - } \ - } lws_end_foreach_llp(___ppss, ___m_list); \ - } - -/* - * doubly linked-list - */ - -struct lws_dll { /* abstract */ - struct lws_dll *prev; - struct lws_dll *next; -}; - -/* - * these all point to the composed list objects... you have to use the - * lws_container_of() helper to recover the start of the containing struct - */ - -LWS_VISIBLE LWS_EXTERN void -lws_dll_add_front(struct lws_dll *d, struct lws_dll *phead); - -LWS_VISIBLE LWS_EXTERN void -lws_dll_remove(struct lws_dll *d); - -struct lws_dll_lws { /* typed as struct lws * */ - struct lws_dll_lws *prev; - struct lws_dll_lws *next; -}; - -#define lws_dll_is_null(___dll) (!(___dll)->prev && !(___dll)->next) - -static LWS_INLINE void -lws_dll_lws_add_front(struct lws_dll_lws *_a, struct lws_dll_lws *_head) -{ - lws_dll_add_front((struct lws_dll *)_a, (struct lws_dll *)_head); -} - -static LWS_INLINE void -lws_dll_lws_remove(struct lws_dll_lws *_a) -{ - lws_dll_remove((struct lws_dll *)_a); -} - -/* - * these are safe against the current container object getting deleted, - * since the hold his next in a temp and go to that next. ___tmp is - * the temp. - */ - -#define lws_start_foreach_dll_safe(___type, ___it, ___tmp, ___start) \ -{ \ - ___type ___it = ___start; \ - while (___it) { \ - ___type ___tmp = (___it)->next; - -#define lws_end_foreach_dll_safe(___it, ___tmp) \ - ___it = ___tmp; \ - } \ -} - -#define lws_start_foreach_dll(___type, ___it, ___start) \ -{ \ - ___type ___it = ___start; \ - while (___it) { - -#define lws_end_foreach_dll(___it) \ - ___it = (___it)->next; \ - } \ -} - -struct lws_buflist; - -/** - * lws_buflist_append_segment(): add buffer to buflist at head - * - * \param head: list head - * \param buf: buffer to stash - * \param len: length of buffer to stash - * - * Returns -1 on OOM, 1 if this was the first segment on the list, and 0 if - * it was a subsequent segment. - */ -LWS_VISIBLE LWS_EXTERN int -lws_buflist_append_segment(struct lws_buflist **head, const uint8_t *buf, - size_t len); -/** - * lws_buflist_next_segment_len(): number of bytes left in current segment - * - * \param head: list head - * \param buf: if non-NULL, *buf is written with the address of the start of - * the remaining data in the segment - * - * Returns the number of bytes left in the current segment. 0 indicates - * that the buflist is empty (there are no segments on the buflist). - */ -LWS_VISIBLE LWS_EXTERN size_t -lws_buflist_next_segment_len(struct lws_buflist **head, uint8_t **buf); -/** - * lws_buflist_use_segment(): remove len bytes from the current segment - * - * \param head: list head - * \param len: number of bytes to mark as used - * - * If len is less than the remaining length of the current segment, the position - * in the current segment is simply advanced and it returns. - * - * If len uses up the remaining length of the current segment, then the segment - * is deleted and the list head moves to the next segment if any. - * - * Returns the number of bytes left in the current segment. 0 indicates - * that the buflist is empty (there are no segments on the buflist). - */ -LWS_VISIBLE LWS_EXTERN int -lws_buflist_use_segment(struct lws_buflist **head, size_t len); -/** - * lws_buflist_destroy_all_segments(): free all segments on the list - * - * \param head: list head - * - * This frees everything on the list unconditionally. *head is always - * NULL after this. - */ -LWS_VISIBLE LWS_EXTERN void -lws_buflist_destroy_all_segments(struct lws_buflist **head); - -void -lws_buflist_describe(struct lws_buflist **head, void *id); - -/** - * lws_ptr_diff(): helper to report distance between pointers as an int - * - * \param head: the pointer with the larger address - * \param tail: the pointer with the smaller address - * - * This helper gives you an int representing the number of bytes further - * forward the first pointer is compared to the second pointer. - */ -#define lws_ptr_diff(head, tail) \ - ((int)((char *)(head) - (char *)(tail))) - -/** - * lws_snprintf(): snprintf that truncates the returned length too - * - * \param str: destination buffer - * \param size: bytes left in destination buffer - * \param format: format string - * \param ...: args for format - * - * This lets you correctly truncate buffers by concatenating lengths, if you - * reach the limit the reported length doesn't exceed the limit. - */ -LWS_VISIBLE LWS_EXTERN int -lws_snprintf(char *str, size_t size, const char *format, ...) LWS_FORMAT(3); - -/** - * lws_strncpy(): strncpy that guarantees NUL on truncated copy - * - * \param dest: destination buffer - * \param src: source buffer - * \param size: bytes left in destination buffer - * - * This lets you correctly truncate buffers by concatenating lengths, if you - * reach the limit the reported length doesn't exceed the limit. - */ -LWS_VISIBLE LWS_EXTERN char * -lws_strncpy(char *dest, const char *src, size_t size); - -/** - * lws_get_random(): fill a buffer with platform random data - * - * \param context: the lws context - * \param buf: buffer to fill - * \param len: how much to fill - * - * This is intended to be called from the LWS_CALLBACK_RECEIVE callback if - * it's interested to see if the frame it's dealing with was sent in binary - * mode. - */ -LWS_VISIBLE LWS_EXTERN int -lws_get_random(struct lws_context *context, void *buf, int len); -/** - * lws_daemonize(): make current process run in the background - * - * \param _lock_path: the filepath to write the lock file - * - * Spawn lws as a background process, taking care of various things - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_daemonize(const char *_lock_path); -/** - * lws_get_library_version(): return string describing the version of lws - * - * On unix, also includes the git describe - */ -LWS_VISIBLE LWS_EXTERN const char * LWS_WARN_UNUSED_RESULT -lws_get_library_version(void); - -/** - * lws_wsi_user() - get the user data associated with the connection - * \param wsi: lws connection - * - * Not normally needed since it's passed into the callback - */ -LWS_VISIBLE LWS_EXTERN void * -lws_wsi_user(struct lws *wsi); - -/** - * lws_wsi_set_user() - set the user data associated with the client connection - * \param wsi: lws connection - * \param user: user data - * - * By default lws allocates this and it's not legal to externally set it - * yourself. However client connections may have it set externally when the - * connection is created... if so, this api can be used to modify it at - * runtime additionally. - */ -LWS_VISIBLE LWS_EXTERN void -lws_set_wsi_user(struct lws *wsi, void *user); - -/** - * lws_parse_uri: cut up prot:/ads:port/path into pieces - * Notice it does so by dropping '\0' into input string - * and the leading / on the path is consequently lost - * - * \param p: incoming uri string.. will get written to - * \param prot: result pointer for protocol part (https://) - * \param ads: result pointer for address part - * \param port: result pointer for port part - * \param path: result pointer for path part - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_parse_uri(char *p, const char **prot, const char **ads, int *port, - const char **path); -/** - * lws_cmdline_option(): simple commandline parser - * - * \param argc: count of argument strings - * \param argv: argument strings - * \param val: string to find - * - * Returns NULL if the string \p val is not found in the arguments. - * - * If it is found, then it returns a pointer to the next character after \p val. - * So if \p val is "-d", then for the commandlines "myapp -d15" and - * "myapp -d 15", in both cases the return will point to the "15". - * - * In the case there is no argument, like "myapp -d", the return will - * either point to the '\\0' at the end of -d, or to the start of the - * next argument, ie, will be non-NULL. - */ -LWS_VISIBLE LWS_EXTERN const char * -lws_cmdline_option(int argc, const char **argv, const char *val); - -/** - * lws_now_secs(): return seconds since 1970-1-1 - */ -LWS_VISIBLE LWS_EXTERN unsigned long -lws_now_secs(void); - -/** - * lws_compare_time_t(): return relationship between two time_t - * - * \param context: struct lws_context - * \param t1: time_t 1 - * \param t2: time_t 2 - * - * returns <0 if t2 > t1; >0 if t1 > t2; or == 0 if t1 == t2. - * - * This is aware of clock discontiguities that may have affected either t1 or - * t2 and adapts the comparison for them. - * - * For the discontiguity detection to work, you must avoid any arithmetic on - * the times being compared. For example to have a timeout that triggers - * 15s from when it was set, store the time it was set and compare like - * `if (lws_compare_time_t(context, now, set_time) > 15)` - */ -LWS_VISIBLE LWS_EXTERN int -lws_compare_time_t(struct lws_context *context, time_t t1, time_t t2); - -/** - * lws_get_context - Allow getting lws_context from a Websocket connection - * instance - * - * With this function, users can access context in the callback function. - * Otherwise users may have to declare context as a global variable. - * - * \param wsi: Websocket connection instance - */ -LWS_VISIBLE LWS_EXTERN struct lws_context * LWS_WARN_UNUSED_RESULT -lws_get_context(const struct lws *wsi); - -/** - * lws_get_vhost_listen_port - Find out the port number a vhost is listening on - * - * In the case you passed 0 for the port number at context creation time, you - * can discover the port number that was actually chosen for the vhost using - * this api. - * - * \param vhost: Vhost to get listen port from - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_get_vhost_listen_port(struct lws_vhost *vhost); - -/** - * lws_get_count_threads(): how many service threads the context uses - * - * \param context: the lws context - * - * By default this is always 1, if you asked for more than lws can handle it - * will clip the number of threads. So you can use this to find out how many - * threads are actually in use. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_get_count_threads(struct lws_context *context); - -/** - * lws_get_parent() - get parent wsi or NULL - * \param wsi: lws connection - * - * Specialized wsi like cgi stdin/out/err are associated to a parent wsi, - * this allows you to get their parent. - */ -LWS_VISIBLE LWS_EXTERN struct lws * LWS_WARN_UNUSED_RESULT -lws_get_parent(const struct lws *wsi); - -/** - * lws_get_child() - get child wsi or NULL - * \param wsi: lws connection - * - * Allows you to find a related wsi from the parent wsi. - */ -LWS_VISIBLE LWS_EXTERN struct lws * LWS_WARN_UNUSED_RESULT -lws_get_child(const struct lws *wsi); - -/** - * lws_get_udp() - get wsi's udp struct - * - * \param wsi: lws connection - * - * Returns NULL or pointer to the wsi's UDP-specific information - */ -LWS_VISIBLE LWS_EXTERN const struct lws_udp * LWS_WARN_UNUSED_RESULT -lws_get_udp(const struct lws *wsi); - -/** - * lws_parent_carries_io() - mark wsi as needing to send messages via parent - * - * \param wsi: child lws connection - */ - -LWS_VISIBLE LWS_EXTERN void -lws_set_parent_carries_io(struct lws *wsi); - -LWS_VISIBLE LWS_EXTERN void * -lws_get_opaque_parent_data(const struct lws *wsi); - -LWS_VISIBLE LWS_EXTERN void -lws_set_opaque_parent_data(struct lws *wsi, void *data); - -LWS_VISIBLE LWS_EXTERN int -lws_get_child_pending_on_writable(const struct lws *wsi); - -LWS_VISIBLE LWS_EXTERN void -lws_clear_child_pending_on_writable(struct lws *wsi); - -LWS_VISIBLE LWS_EXTERN int -lws_get_close_length(struct lws *wsi); - -LWS_VISIBLE LWS_EXTERN unsigned char * -lws_get_close_payload(struct lws *wsi); - -/** - * lws_get_network_wsi() - Returns wsi that has the tcp connection for this wsi - * - * \param wsi: wsi you have - * - * Returns wsi that has the tcp connection (which may be the incoming wsi) - * - * HTTP/1 connections will always return the incoming wsi - * HTTP/2 connections may return a different wsi that has the tcp connection - */ -LWS_VISIBLE LWS_EXTERN -struct lws *lws_get_network_wsi(struct lws *wsi); - -/** - * lws_set_allocator() - custom allocator support - * - * \param realloc - * - * Allows you to replace the allocator (and deallocator) used by lws - */ -LWS_VISIBLE LWS_EXTERN void -lws_set_allocator(void *(*realloc)(void *ptr, size_t size, const char *reason)); -///@} - -/** \defgroup wsstatus Websocket status APIs - * ##Websocket connection status APIs - * - * These provide information about ws connection or message status - */ -///@{ -/** - * lws_send_pipe_choked() - tests if socket is writable or not - * \param wsi: lws connection - * - * Allows you to check if you can write more on the socket - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_send_pipe_choked(struct lws *wsi); - -/** - * lws_is_final_fragment() - tests if last part of ws message - * - * \param wsi: lws connection - */ -LWS_VISIBLE LWS_EXTERN int -lws_is_final_fragment(struct lws *wsi); - -/** - * lws_is_first_fragment() - tests if first part of ws message - * - * \param wsi: lws connection - */ -LWS_VISIBLE LWS_EXTERN int -lws_is_first_fragment(struct lws *wsi); - -/** - * lws_get_reserved_bits() - access reserved bits of ws frame - * \param wsi: lws connection - */ -LWS_VISIBLE LWS_EXTERN unsigned char -lws_get_reserved_bits(struct lws *wsi); - -/** - * lws_partial_buffered() - find out if lws buffered the last write - * \param wsi: websocket connection to check - * - * Returns 1 if you cannot use lws_write because the last - * write on this connection is still buffered, and can't be cleared without - * returning to the service loop and waiting for the connection to be - * writeable again. - * - * If you will try to do >1 lws_write call inside a single - * WRITEABLE callback, you must check this after every write and bail if - * set, ask for a new writeable callback and continue writing from there. - * - * This is never set at the start of a writeable callback, but any write - * may set it. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_partial_buffered(struct lws *wsi); - -/** - * lws_frame_is_binary(): true if the current frame was sent in binary mode - * - * \param wsi: the connection we are inquiring about - * - * This is intended to be called from the LWS_CALLBACK_RECEIVE callback if - * it's interested to see if the frame it's dealing with was sent in binary - * mode. - */ -LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT -lws_frame_is_binary(struct lws *wsi); - -/** - * lws_is_ssl() - Find out if connection is using SSL - * \param wsi: websocket connection to check - * - * Returns 0 if the connection is not using SSL, 1 if using SSL and - * using verified cert, and 2 if using SSL but the cert was not - * checked (appears for client wsi told to skip check on connection) - */ -LWS_VISIBLE LWS_EXTERN int -lws_is_ssl(struct lws *wsi); -/** - * lws_is_cgi() - find out if this wsi is running a cgi process - * \param wsi: lws connection - */ -LWS_VISIBLE LWS_EXTERN int -lws_is_cgi(struct lws *wsi); - - -struct lws_wifi_scan { /* generic wlan scan item */ - struct lws_wifi_scan *next; - char ssid[32]; - int32_t rssi; /* divide by .count to get db */ - uint8_t bssid[6]; - uint8_t count; - uint8_t channel; - uint8_t authmode; -}; - -#if defined(LWS_WITH_TLS) && !defined(LWS_WITH_MBEDTLS) -/** - * lws_get_ssl() - Return wsi's SSL context structure - * \param wsi: websocket connection - * - * Returns pointer to the SSL library's context structure - */ -LWS_VISIBLE LWS_EXTERN SSL* -lws_get_ssl(struct lws *wsi); -#endif - -enum lws_tls_cert_info { - LWS_TLS_CERT_INFO_VALIDITY_FROM, - /**< fills .time with the time_t the cert validity started from */ - LWS_TLS_CERT_INFO_VALIDITY_TO, - /**< fills .time with the time_t the cert validity ends at */ - LWS_TLS_CERT_INFO_COMMON_NAME, - /**< fills up to len bytes of .ns.name with the cert common name */ - LWS_TLS_CERT_INFO_ISSUER_NAME, - /**< fills up to len bytes of .ns.name with the cert issuer name */ - LWS_TLS_CERT_INFO_USAGE, - /**< fills verified with a bitfield asserting the valid uses */ - LWS_TLS_CERT_INFO_VERIFIED, - /**< fills .verified with a bool representing peer cert validity, - * call returns -1 if no cert */ - LWS_TLS_CERT_INFO_OPAQUE_PUBLIC_KEY, - /**< the certificate's public key, as an opaque bytestream. These - * opaque bytestreams can only be compared with each other using the - * same tls backend, ie, OpenSSL or mbedTLS. The different backends - * produce different, incompatible representations for the same cert. - */ -}; - -union lws_tls_cert_info_results { - unsigned int verified; - time_t time; - unsigned int usage; - struct { - int len; - /* KEEP LAST... notice the [64] is only there because - * name[] is not allowed in a union. The actual length of - * name[] is arbitrary and is passed into the api using the - * len parameter. Eg - * - * char big[1024]; - * union lws_tls_cert_info_results *buf = - * (union lws_tls_cert_info_results *)big; - * - * lws_tls_peer_cert_info(wsi, type, buf, sizeof(big) - - * sizeof(*buf) + sizeof(buf->ns.name)); - */ - char name[64]; - } ns; -}; - -/** - * lws_tls_peer_cert_info() - get information from the peer's TLS cert - * - * \param wsi: the connection to query - * \param type: one of LWS_TLS_CERT_INFO_ - * \param buf: pointer to union to take result - * \param len: when result is a string, the true length of buf->ns.name[] - * - * lws_tls_peer_cert_info() lets you get hold of information from the peer - * certificate. - * - * Return 0 if there is a result in \p buf, or -1 indicating there was no cert - * or another problem. - * - * This function works the same no matter if the TLS backend is OpenSSL or - * mbedTLS. - */ -LWS_VISIBLE LWS_EXTERN int -lws_tls_peer_cert_info(struct lws *wsi, enum lws_tls_cert_info type, - union lws_tls_cert_info_results *buf, size_t len); - -/** - * lws_tls_vhost_cert_info() - get information from the vhost's own TLS cert - * - * \param vhost: the vhost to query - * \param type: one of LWS_TLS_CERT_INFO_ - * \param buf: pointer to union to take result - * \param len: when result is a string, the true length of buf->ns.name[] - * - * lws_tls_vhost_cert_info() lets you get hold of information from the vhost - * certificate. - * - * Return 0 if there is a result in \p buf, or -1 indicating there was no cert - * or another problem. - * - * This function works the same no matter if the TLS backend is OpenSSL or - * mbedTLS. - */ -LWS_VISIBLE LWS_EXTERN int -lws_tls_vhost_cert_info(struct lws_vhost *vhost, enum lws_tls_cert_info type, - union lws_tls_cert_info_results *buf, size_t len); - -/** - * lws_tls_acme_sni_cert_create() - creates a temp selfsigned cert - * and attaches to a vhost - * - * \param vhost: the vhost to acquire the selfsigned cert - * \param san_a: SAN written into the certificate - * \param san_b: second SAN written into the certificate - * - * - * Returns 0 if created and attached to the vhost. Returns -1 if problems and - * frees all allocations before returning. - * - * On success, any allocations are destroyed at vhost destruction automatically. - */ -LWS_VISIBLE LWS_EXTERN int -lws_tls_acme_sni_cert_create(struct lws_vhost *vhost, const char *san_a, - const char *san_b); - -/** - * lws_tls_acme_sni_csr_create() - creates a CSR and related private key PEM - * - * \param context: lws_context used for random - * \param elements: array of LWS_TLS_REQ_ELEMENT_COUNT const char * - * \param csr: buffer that will get the b64URL(ASN-1 CSR) - * \param csr_len: max length of the csr buffer - * \param privkey_pem: pointer to pointer allocated to hold the privkey_pem - * \param privkey_len: pointer to size_t set to the length of the privkey_pem - * - * Creates a CSR according to the information in \p elements, and a private - * RSA key used to sign the CSR. - * - * The outputs are the b64URL(ASN-1 CSR) into csr, and the PEM private key into - * privkey_pem. - * - * Notice that \p elements points to an array of const char *s pointing to the - * information listed in the enum above. If an entry is NULL or an empty - * string, the element is set to "none" in the CSR. - * - * Returns 0 on success or nonzero for failure. - */ -LWS_VISIBLE LWS_EXTERN int -lws_tls_acme_sni_csr_create(struct lws_context *context, const char *elements[], - uint8_t *csr, size_t csr_len, char **privkey_pem, - size_t *privkey_len); - -/** - * lws_tls_cert_updated() - update every vhost using the given cert path - * - * \param context: our lws_context - * \param certpath: the filepath to the certificate - * \param keypath: the filepath to the private key of the certificate - * \param mem_cert: copy of the cert in memory - * \param len_mem_cert: length of the copy of the cert in memory - * \param mem_privkey: copy of the private key in memory - * \param len_mem_privkey: length of the copy of the private key in memory - * - * Checks every vhost to see if it is the using certificate described by the - * the given filepaths. If so, it attempts to update the vhost ssl_ctx to use - * the new certificate. - * - * Returns 0 on success or nonzero for failure. - */ -LWS_VISIBLE LWS_EXTERN int -lws_tls_cert_updated(struct lws_context *context, const char *certpath, - const char *keypath, - const char *mem_cert, size_t len_mem_cert, - const char *mem_privkey, size_t len_mem_privkey); -///@} - -/** \defgroup lws_ring LWS Ringbuffer APIs - * ##lws_ring: generic ringbuffer struct - * - * Provides an abstract ringbuffer api supporting one head and one or an - * unlimited number of tails. - * - * All of the members are opaque and manipulated by lws_ring_...() apis. - * - * The lws_ring and its buffer is allocated at runtime on the heap, using - * - * - lws_ring_create() - * - lws_ring_destroy() - * - * It may contain any type, the size of the "element" stored in the ring - * buffer and the number of elements is given at creation time. - * - * When you create the ringbuffer, you can optionally provide an element - * destroy callback that frees any allocations inside the element. This is then - * automatically called for elements with no tail behind them, ie, elements - * which don't have any pending consumer are auto-freed. - * - * Whole elements may be inserted into the ringbuffer and removed from it, using - * - * - lws_ring_insert() - * - lws_ring_consume() - * - * You can find out how many whole elements are free or waiting using - * - * - lws_ring_get_count_free_elements() - * - lws_ring_get_count_waiting_elements() - * - * In addition there are special purpose optional byte-centric apis - * - * - lws_ring_next_linear_insert_range() - * - lws_ring_bump_head() - * - * which let you, eg, read() directly into the ringbuffer without needing - * an intermediate bounce buffer. - * - * The accessors understand that the ring wraps, and optimizes insertion and - * consumption into one or two memcpy()s depending on if the head or tail - * wraps. - * - * lws_ring only supports a single head, but optionally multiple tails with - * an API to inform it when the "oldest" tail has moved on. You can give - * NULL where-ever an api asks for a tail pointer, and it will use an internal - * single tail pointer for convenience. - * - * The "oldest tail", which is the only tail if you give it NULL instead of - * some other tail, is used to track which elements in the ringbuffer are - * still unread by anyone. - * - * - lws_ring_update_oldest_tail() - */ -///@{ -struct lws_ring; - -/** - * lws_ring_create(): create a new ringbuffer - * - * \param element_len: the size in bytes of one element in the ringbuffer - * \param count: the number of elements the ringbuffer can contain - * \param destroy_element: NULL, or callback to be called for each element - * that is removed from the ringbuffer due to the - * oldest tail moving beyond it - * - * Creates the ringbuffer and allocates the storage. Returns the new - * lws_ring *, or NULL if the allocation failed. - * - * If non-NULL, destroy_element will get called back for every element that is - * retired from the ringbuffer after the oldest tail has gone past it, and for - * any element still left in the ringbuffer when it is destroyed. It replaces - * all other element destruction code in your user code. - */ -LWS_VISIBLE LWS_EXTERN struct lws_ring * -lws_ring_create(size_t element_len, size_t count, - void (*destroy_element)(void *element)); - -/** - * lws_ring_destroy(): destroy a previously created ringbuffer - * - * \param ring: the struct lws_ring to destroy - * - * Destroys the ringbuffer allocation and the struct lws_ring itself. - */ -LWS_VISIBLE LWS_EXTERN void -lws_ring_destroy(struct lws_ring *ring); - -/** - * lws_ring_get_count_free_elements(): return how many elements can fit - * in the free space - * - * \param ring: the struct lws_ring to report on - * - * Returns how much room is left in the ringbuffer for whole element insertion. - */ -LWS_VISIBLE LWS_EXTERN size_t -lws_ring_get_count_free_elements(struct lws_ring *ring); - -/** - * lws_ring_get_count_waiting_elements(): return how many elements can be consumed - * - * \param ring: the struct lws_ring to report on - * \param tail: a pointer to the tail struct to use, or NULL for single tail - * - * Returns how many elements are waiting to be consumed from the perspective - * of the tail pointer given. - */ -LWS_VISIBLE LWS_EXTERN size_t -lws_ring_get_count_waiting_elements(struct lws_ring *ring, uint32_t *tail); - -/** - * lws_ring_insert(): attempt to insert up to max_count elements from src - * - * \param ring: the struct lws_ring to report on - * \param src: the array of elements to be inserted - * \param max_count: the number of available elements at src - * - * Attempts to insert as many of the elements at src as possible, up to the - * maximum max_count. Returns the number of elements actually inserted. - */ -LWS_VISIBLE LWS_EXTERN size_t -lws_ring_insert(struct lws_ring *ring, const void *src, size_t max_count); - -/** - * lws_ring_consume(): attempt to copy out and remove up to max_count elements - * to src - * - * \param ring: the struct lws_ring to report on - * \param tail: a pointer to the tail struct to use, or NULL for single tail - * \param dest: the array of elements to be inserted. or NULL for no copy - * \param max_count: the number of available elements at src - * - * Attempts to copy out as many waiting elements as possible into dest, from - * the perspective of the given tail, up to max_count. If dest is NULL, the - * copying out is not done but the elements are logically consumed as usual. - * NULL dest is useful in combination with lws_ring_get_element(), where you - * can use the element direct from the ringbuffer and then call this with NULL - * dest to logically consume it. - * - * Increments the tail position according to how many elements could be - * consumed. - * - * Returns the number of elements consumed. - */ -LWS_VISIBLE LWS_EXTERN size_t -lws_ring_consume(struct lws_ring *ring, uint32_t *tail, void *dest, - size_t max_count); - -/** - * lws_ring_get_element(): get a pointer to the next waiting element for tail - * - * \param ring: the struct lws_ring to report on - * \param tail: a pointer to the tail struct to use, or NULL for single tail - * - * Points to the next element that tail would consume, directly in the - * ringbuffer. This lets you write() or otherwise use the element without - * having to copy it out somewhere first. - * - * After calling this, you must call lws_ring_consume(ring, &tail, NULL, 1) - * which will logically consume the element you used up and increment your - * tail (tail may also be NULL there if you use a single tail). - * - * Returns NULL if no waiting element, or a const void * pointing to it. - */ -LWS_VISIBLE LWS_EXTERN const void * -lws_ring_get_element(struct lws_ring *ring, uint32_t *tail); - -/** - * lws_ring_update_oldest_tail(): free up elements older than tail for reuse - * - * \param ring: the struct lws_ring to report on - * \param tail: a pointer to the tail struct to use, or NULL for single tail - * - * If you are using multiple tails, you must use this API to inform the - * lws_ring when none of the tails still need elements in the fifo any more, - * by updating it when the "oldest" tail has moved on. - */ -LWS_VISIBLE LWS_EXTERN void -lws_ring_update_oldest_tail(struct lws_ring *ring, uint32_t tail); - -/** - * lws_ring_get_oldest_tail(): get current oldest available data index - * - * \param ring: the struct lws_ring to report on - * - * If you are initializing a new ringbuffer consumer, you can set its tail to - * this to start it from the oldest ringbuffer entry still available. - */ -LWS_VISIBLE LWS_EXTERN uint32_t -lws_ring_get_oldest_tail(struct lws_ring *ring); - -/** - * lws_ring_next_linear_insert_range(): used to write directly into the ring - * - * \param ring: the struct lws_ring to report on - * \param start: pointer to a void * set to the start of the next ringbuffer area - * \param bytes: pointer to a size_t set to the max length you may use from *start - * - * This provides a low-level, bytewise access directly into the ringbuffer - * allowing direct insertion of data without having to use a bounce buffer. - * - * The api reports the position and length of the next linear range that can - * be written in the ringbuffer, ie, up to the point it would wrap, and sets - * *start and *bytes accordingly. You can then, eg, directly read() into - * *start for up to *bytes, and use lws_ring_bump_head() to update the lws_ring - * with what you have done. - * - * Returns nonzero if no insertion is currently possible. - */ -LWS_VISIBLE LWS_EXTERN int -lws_ring_next_linear_insert_range(struct lws_ring *ring, void **start, - size_t *bytes); - -/** - * lws_ring_bump_head(): used to write directly into the ring - * - * \param ring: the struct lws_ring to operate on - * \param bytes: the number of bytes you inserted at the current head - */ -LWS_VISIBLE LWS_EXTERN void -lws_ring_bump_head(struct lws_ring *ring, size_t bytes); - -LWS_VISIBLE LWS_EXTERN void -lws_ring_dump(struct lws_ring *ring, uint32_t *tail); - -/* - * This is a helper that combines the common pattern of needing to consume - * some ringbuffer elements, move the consumer tail on, and check if that - * has moved any ringbuffer elements out of scope, because it was the last - * consumer that had not already consumed them. - * - * Elements that go out of scope because the oldest tail is now after them - * get garbage-collected by calling the destroy_element callback on them - * defined when the ringbuffer was created. - */ - -#define lws_ring_consume_and_update_oldest_tail(\ - ___ring, /* the lws_ring object */ \ - ___type, /* type of objects with tails */ \ - ___ptail, /* ptr to tail of obj with tail doing consuming */ \ - ___count, /* count of payload objects being consumed */ \ - ___list_head, /* head of list of objects with tails */ \ - ___mtail, /* member name of tail in ___type */ \ - ___mlist /* member name of next list member ptr in ___type */ \ - ) { \ - int ___n, ___m; \ - \ - ___n = lws_ring_get_oldest_tail(___ring) == *(___ptail); \ - lws_ring_consume(___ring, ___ptail, NULL, ___count); \ - if (___n) { \ - uint32_t ___oldest; \ - ___n = 0; \ - ___oldest = *(___ptail); \ - lws_start_foreach_llp(___type **, ___ppss, ___list_head) { \ - ___m = lws_ring_get_count_waiting_elements( \ - ___ring, &(*___ppss)->tail); \ - if (___m >= ___n) { \ - ___n = ___m; \ - ___oldest = (*___ppss)->tail; \ - } \ - } lws_end_foreach_llp(___ppss, ___mlist); \ - \ - lws_ring_update_oldest_tail(___ring, ___oldest); \ - } \ -} - -/* - * This does the same as the lws_ring_consume_and_update_oldest_tail() - * helper, but for the simpler case there is only one consumer, so one - * tail, and that tail is always the oldest tail. - */ - -#define lws_ring_consume_single_tail(\ - ___ring, /* the lws_ring object */ \ - ___ptail, /* ptr to tail of obj with tail doing consuming */ \ - ___count /* count of payload objects being consumed */ \ - ) { \ - lws_ring_consume(___ring, ___ptail, NULL, ___count); \ - lws_ring_update_oldest_tail(___ring, *(___ptail)); \ -} -///@} - -/** \defgroup sha SHA and B64 helpers - * ##SHA and B64 helpers - * - * These provide SHA-1 and B64 helper apis - */ -///@{ -#ifdef LWS_SHA1_USE_OPENSSL_NAME -#define lws_SHA1 SHA1 -#else -/** - * lws_SHA1(): make a SHA-1 digest of a buffer - * - * \param d: incoming buffer - * \param n: length of incoming buffer - * \param md: buffer for message digest (must be >= 20 bytes) - * - * Reduces any size buffer into a 20-byte SHA-1 hash. - */ -LWS_VISIBLE LWS_EXTERN unsigned char * -lws_SHA1(const unsigned char *d, size_t n, unsigned char *md); -#endif -/** - * lws_b64_encode_string(): encode a string into base 64 - * - * \param in: incoming buffer - * \param in_len: length of incoming buffer - * \param out: result buffer - * \param out_size: length of result buffer - * - * Encodes a string using b64 - */ -LWS_VISIBLE LWS_EXTERN int -lws_b64_encode_string(const char *in, int in_len, char *out, int out_size); -/** - * lws_b64_encode_string_url(): encode a string into base 64 - * - * \param in: incoming buffer - * \param in_len: length of incoming buffer - * \param out: result buffer - * \param out_size: length of result buffer - * - * Encodes a string using b64 with the "URL" variant (+ -> -, and / -> _) - */ -LWS_VISIBLE LWS_EXTERN int -lws_b64_encode_string_url(const char *in, int in_len, char *out, int out_size); -/** - * lws_b64_decode_string(): decode a string from base 64 - * - * \param in: incoming buffer - * \param out: result buffer - * \param out_size: length of result buffer - * - * Decodes a NUL-terminated string using b64 - */ -LWS_VISIBLE LWS_EXTERN int -lws_b64_decode_string(const char *in, char *out, int out_size); -/** - * lws_b64_decode_string_len(): decode a string from base 64 - * - * \param in: incoming buffer - * \param in_len: length of incoming buffer - * \param out: result buffer - * \param out_size: length of result buffer - * - * Decodes a range of chars using b64 - */ -LWS_VISIBLE LWS_EXTERN int -lws_b64_decode_string_len(const char *in, int in_len, char *out, int out_size); -///@} - - -/*! \defgroup cgi cgi handling - * - * ##CGI handling - * - * These functions allow low-level control over stdin/out/err of the cgi. - * - * However for most cases, binding the cgi to http in and out, the default - * lws implementation already does the right thing. - */ - -enum lws_enum_stdinouterr { - LWS_STDIN = 0, - LWS_STDOUT = 1, - LWS_STDERR = 2, -}; - -enum lws_cgi_hdr_state { - LCHS_HEADER, - LCHS_CR1, - LCHS_LF1, - LCHS_CR2, - LCHS_LF2, - LHCS_RESPONSE, - LHCS_DUMP_HEADERS, - LHCS_PAYLOAD, - LCHS_SINGLE_0A, -}; - -struct lws_cgi_args { - struct lws **stdwsi; /**< get fd with lws_get_socket_fd() */ - enum lws_enum_stdinouterr ch; /**< channel index */ - unsigned char *data; /**< for messages with payload */ - enum lws_cgi_hdr_state hdr_state; /**< track where we are in cgi headers */ - int len; /**< length */ -}; - -#ifdef LWS_WITH_CGI -/** - * lws_cgi: spawn network-connected cgi process - * - * \param wsi: connection to own the process - * \param exec_array: array of "exec-name" "arg1" ... "argn" NULL - * \param script_uri_path_len: how many chars on the left of the uri are the - * path to the cgi, or -1 to spawn without URL-related env vars - * \param timeout_secs: seconds script should be allowed to run - * \param mp_cgienv: pvo list with per-vhost cgi options to put in env - */ -LWS_VISIBLE LWS_EXTERN int -lws_cgi(struct lws *wsi, const char * const *exec_array, - int script_uri_path_len, int timeout_secs, - const struct lws_protocol_vhost_options *mp_cgienv); - -/** - * lws_cgi_write_split_stdout_headers: write cgi output accounting for header part - * - * \param wsi: connection to own the process - */ -LWS_VISIBLE LWS_EXTERN int -lws_cgi_write_split_stdout_headers(struct lws *wsi); - -/** - * lws_cgi_kill: terminate cgi process associated with wsi - * - * \param wsi: connection to own the process - */ -LWS_VISIBLE LWS_EXTERN int -lws_cgi_kill(struct lws *wsi); - -/** - * lws_cgi_get_stdwsi: get wsi for stdin, stdout, or stderr - * - * \param wsi: parent wsi that has cgi - * \param ch: which of LWS_STDIN, LWS_STDOUT or LWS_STDERR - */ -LWS_VISIBLE LWS_EXTERN struct lws * -lws_cgi_get_stdwsi(struct lws *wsi, enum lws_enum_stdinouterr ch); - -#endif -///@} - - -/*! \defgroup fops file operation wrapping - * - * ##File operation wrapping - * - * Use these helper functions if you want to access a file from the perspective - * of a specific wsi, which is usually the case. If you just want contextless - * file access, use the fops callbacks directly with NULL wsi instead of these - * helpers. - * - * If so, then it calls the platform handler or user overrides where present - * (as defined in info->fops) - * - * The advantage from all this is user code can be portable for file operations - * without having to deal with differences between platforms. - */ -//@{ - -/** struct lws_plat_file_ops - Platform-specific file operations - * - * These provide platform-agnostic ways to deal with filesystem access in the - * library and in the user code. - */ - -#if defined(LWS_WITH_ESP32) -/* sdk preprocessor defs? compiler issue? gets confused with member names */ -#define LWS_FOP_OPEN _open -#define LWS_FOP_CLOSE _close -#define LWS_FOP_SEEK_CUR _seek_cur -#define LWS_FOP_READ _read -#define LWS_FOP_WRITE _write -#else -#define LWS_FOP_OPEN open -#define LWS_FOP_CLOSE close -#define LWS_FOP_SEEK_CUR seek_cur -#define LWS_FOP_READ read -#define LWS_FOP_WRITE write -#endif - -#define LWS_FOP_FLAGS_MASK ((1 << 23) - 1) -#define LWS_FOP_FLAG_COMPR_ACCEPTABLE_GZIP (1 << 24) -#define LWS_FOP_FLAG_COMPR_IS_GZIP (1 << 25) -#define LWS_FOP_FLAG_MOD_TIME_VALID (1 << 26) -#define LWS_FOP_FLAG_VIRTUAL (1 << 27) - -struct lws_plat_file_ops; - -struct lws_fop_fd { - lws_filefd_type fd; - /**< real file descriptor related to the file... */ - const struct lws_plat_file_ops *fops; - /**< fops that apply to this fop_fd */ - void *filesystem_priv; - /**< ignored by lws; owned by the fops handlers */ - lws_filepos_t pos; - /**< generic "position in file" */ - lws_filepos_t len; - /**< generic "length of file" */ - lws_fop_flags_t flags; - /**< copy of the returned flags */ - uint32_t mod_time; - /**< optional "modification time of file", only valid if .open() - * set the LWS_FOP_FLAG_MOD_TIME_VALID flag */ -}; -typedef struct lws_fop_fd *lws_fop_fd_t; - -struct lws_fops_index { - const char *sig; /* NULL or vfs signature, eg, ".zip/" */ - uint8_t len; /* length of above string */ -}; - -struct lws_plat_file_ops { - lws_fop_fd_t (*LWS_FOP_OPEN)(const struct lws_plat_file_ops *fops, - const char *filename, const char *vpath, - lws_fop_flags_t *flags); - /**< Open file (always binary access if plat supports it) - * vpath may be NULL, or if the fops understands it, the point at which - * the filename's virtual part starts. - * *flags & LWS_FOP_FLAGS_MASK should be set to O_RDONLY or O_RDWR. - * If the file may be gzip-compressed, - * LWS_FOP_FLAG_COMPR_ACCEPTABLE_GZIP is set. If it actually is - * gzip-compressed, then the open handler should OR - * LWS_FOP_FLAG_COMPR_IS_GZIP on to *flags before returning. - */ - int (*LWS_FOP_CLOSE)(lws_fop_fd_t *fop_fd); - /**< close file AND set the pointer to NULL */ - lws_fileofs_t (*LWS_FOP_SEEK_CUR)(lws_fop_fd_t fop_fd, - lws_fileofs_t offset_from_cur_pos); - /**< seek from current position */ - int (*LWS_FOP_READ)(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len); - /**< Read from file, on exit *amount is set to amount actually read */ - int (*LWS_FOP_WRITE)(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len); - /**< Write to file, on exit *amount is set to amount actually written */ - - struct lws_fops_index fi[3]; - /**< vfs path signatures implying use of this fops */ - - const struct lws_plat_file_ops *next; - /**< NULL or next fops in list */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility */ -}; - -/** - * lws_get_fops() - get current file ops - * - * \param context: context - */ -LWS_VISIBLE LWS_EXTERN struct lws_plat_file_ops * LWS_WARN_UNUSED_RESULT -lws_get_fops(struct lws_context *context); -LWS_VISIBLE LWS_EXTERN void -lws_set_fops(struct lws_context *context, const struct lws_plat_file_ops *fops); -/** - * lws_vfs_tell() - get current file position - * - * \param fop_fd: fop_fd we are asking about - */ -LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT -lws_vfs_tell(lws_fop_fd_t fop_fd); -/** - * lws_vfs_get_length() - get current file total length in bytes - * - * \param fop_fd: fop_fd we are asking about - */ -LWS_VISIBLE LWS_EXTERN lws_filepos_t LWS_WARN_UNUSED_RESULT -lws_vfs_get_length(lws_fop_fd_t fop_fd); -/** - * lws_vfs_get_mod_time() - get time file last modified - * - * \param fop_fd: fop_fd we are asking about - */ -LWS_VISIBLE LWS_EXTERN uint32_t LWS_WARN_UNUSED_RESULT -lws_vfs_get_mod_time(lws_fop_fd_t fop_fd); -/** - * lws_vfs_file_seek_set() - seek relative to start of file - * - * \param fop_fd: fop_fd we are seeking in - * \param offset: offset from start of file - */ -LWS_VISIBLE LWS_EXTERN lws_fileofs_t -lws_vfs_file_seek_set(lws_fop_fd_t fop_fd, lws_fileofs_t offset); -/** - * lws_vfs_file_seek_end() - seek relative to end of file - * - * \param fop_fd: fop_fd we are seeking in - * \param offset: offset from start of file - */ -LWS_VISIBLE LWS_EXTERN lws_fileofs_t -lws_vfs_file_seek_end(lws_fop_fd_t fop_fd, lws_fileofs_t offset); - -extern struct lws_plat_file_ops fops_zip; - -/** - * lws_plat_file_open() - open vfs filepath - * - * \param fops: file ops struct that applies to this descriptor - * \param vfs_path: filename to open - * \param flags: pointer to open flags - * - * The vfs_path is scanned for known fops signatures, and the open directed - * to any matching fops open. - * - * User code should use this api to perform vfs opens. - * - * returns semi-opaque handle - */ -LWS_VISIBLE LWS_EXTERN lws_fop_fd_t LWS_WARN_UNUSED_RESULT -lws_vfs_file_open(const struct lws_plat_file_ops *fops, const char *vfs_path, - lws_fop_flags_t *flags); - -/** - * lws_plat_file_close() - close file - * - * \param fop_fd: file handle to close - */ -static LWS_INLINE int -lws_vfs_file_close(lws_fop_fd_t *fop_fd) -{ - return (*fop_fd)->fops->LWS_FOP_CLOSE(fop_fd); -} - -/** - * lws_plat_file_seek_cur() - close file - * - * - * \param fop_fd: file handle - * \param offset: position to seek to - */ -static LWS_INLINE lws_fileofs_t -lws_vfs_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset) -{ - return fop_fd->fops->LWS_FOP_SEEK_CUR(fop_fd, offset); -} -/** - * lws_plat_file_read() - read from file - * - * \param fop_fd: file handle - * \param amount: how much to read (rewritten by call) - * \param buf: buffer to write to - * \param len: max length - */ -static LWS_INLINE int LWS_WARN_UNUSED_RESULT -lws_vfs_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len) -{ - return fop_fd->fops->LWS_FOP_READ(fop_fd, amount, buf, len); -} -/** - * lws_plat_file_write() - write from file - * - * \param fop_fd: file handle - * \param amount: how much to write (rewritten by call) - * \param buf: buffer to read from - * \param len: max length - */ -static LWS_INLINE int LWS_WARN_UNUSED_RESULT -lws_vfs_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len) -{ - return fop_fd->fops->LWS_FOP_WRITE(fop_fd, amount, buf, len); -} - -/* these are the platform file operations implementations... they can - * be called directly and used in fops arrays - */ - -LWS_VISIBLE LWS_EXTERN lws_fop_fd_t -_lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, - const char *vpath, lws_fop_flags_t *flags); -LWS_VISIBLE LWS_EXTERN int -_lws_plat_file_close(lws_fop_fd_t *fop_fd); -LWS_VISIBLE LWS_EXTERN lws_fileofs_t -_lws_plat_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset); -LWS_VISIBLE LWS_EXTERN int -_lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len); -LWS_VISIBLE LWS_EXTERN int -_lws_plat_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len); - -LWS_VISIBLE LWS_EXTERN int -lws_alloc_vfs_file(struct lws_context *context, const char *filename, - uint8_t **buf, lws_filepos_t *amount); -//@} - -/** \defgroup smtp SMTP related functions - * ##SMTP related functions - * \ingroup lwsapi - * - * These apis let you communicate with a local SMTP server to send email from - * lws. It handles all the SMTP sequencing and protocol actions. - * - * Your system should have postfix, sendmail or another MTA listening on port - * 25 and able to send email using the "mail" commandline app. Usually distro - * MTAs are configured for this by default. - * - * It runs via its own libuv events if initialized (which requires giving it - * a libuv loop to attach to). - * - * It operates using three callbacks, on_next() queries if there is a new email - * to send, on_get_body() asks for the body of the email, and on_sent() is - * called after the email is successfully sent. - * - * To use it - * - * - create an lws_email struct - * - * - initialize data, loop, the email_* strings, max_content_size and - * the callbacks - * - * - call lws_email_init() - * - * When you have at least one email to send, call lws_email_check() to - * schedule starting to send it. - */ -//@{ -#ifdef LWS_WITH_SMTP - -/** enum lwsgs_smtp_states - where we are in SMTP protocol sequence */ -enum lwsgs_smtp_states { - LGSSMTP_IDLE, /**< awaiting new email */ - LGSSMTP_CONNECTING, /**< opening tcp connection to MTA */ - LGSSMTP_CONNECTED, /**< tcp connection to MTA is connected */ - LGSSMTP_SENT_HELO, /**< sent the HELO */ - LGSSMTP_SENT_FROM, /**< sent FROM */ - LGSSMTP_SENT_TO, /**< sent TO */ - LGSSMTP_SENT_DATA, /**< sent DATA request */ - LGSSMTP_SENT_BODY, /**< sent the email body */ - LGSSMTP_SENT_QUIT, /**< sent the session quit */ -}; - -/** struct lws_email - abstract context for performing SMTP operations */ -struct lws_email { - void *data; - /**< opaque pointer set by user code and available to the callbacks */ - uv_loop_t *loop; - /**< the libuv loop we will work on */ - - char email_smtp_ip[32]; /**< Fill before init, eg, "127.0.0.1" */ - char email_helo[32]; /**< Fill before init, eg, "myserver.com" */ - char email_from[100]; /**< Fill before init or on_next */ - char email_to[100]; /**< Fill before init or on_next */ - - unsigned int max_content_size; - /**< largest possible email body size */ - - /* Fill all the callbacks before init */ - - int (*on_next)(struct lws_email *email); - /**< (Fill in before calling lws_email_init) - * called when idle, 0 = another email to send, nonzero is idle. - * If you return 0, all of the email_* char arrays must be set - * to something useful. */ - int (*on_sent)(struct lws_email *email); - /**< (Fill in before calling lws_email_init) - * called when transfer of the email to the SMTP server was - * successful, your callback would remove the current email - * from its queue */ - int (*on_get_body)(struct lws_email *email, char *buf, int len); - /**< (Fill in before calling lws_email_init) - * called when the body part of the queued email is about to be - * sent to the SMTP server. */ - - - /* private things */ - uv_timer_t timeout_email; /**< private */ - enum lwsgs_smtp_states estate; /**< private */ - uv_connect_t email_connect_req; /**< private */ - uv_tcp_t email_client; /**< private */ - time_t email_connect_started; /**< private */ - char email_buf[256]; /**< private */ - char *content; /**< private */ -}; - -/** - * lws_email_init() - Initialize a struct lws_email - * - * \param email: struct lws_email to init - * \param loop: libuv loop to use - * \param max_content: max email content size - * - * Prepares a struct lws_email for use ending SMTP - */ -LWS_VISIBLE LWS_EXTERN int -lws_email_init(struct lws_email *email, uv_loop_t *loop, int max_content); - -/** - * lws_email_check() - Request check for new email - * - * \param email: struct lws_email context to check - * - * Schedules a check for new emails in 1s... call this when you have queued an - * email for send. - */ -LWS_VISIBLE LWS_EXTERN void -lws_email_check(struct lws_email *email); -/** - * lws_email_destroy() - stop using the struct lws_email - * - * \param email: the struct lws_email context - * - * Stop sending email using email and free allocations - */ -LWS_VISIBLE LWS_EXTERN void -lws_email_destroy(struct lws_email *email); - -#endif -//@} - - -/** \defgroup lejp JSON parser - * ##JSON parsing related functions - * \ingroup lwsapi - * - * LEJP is an extremely lightweight JSON stream parser included in lws. - */ -//@{ -struct lejp_ctx; - -#define LWS_ARRAY_SIZE(_x) (sizeof(_x) / sizeof(_x[0])) -#define LEJP_FLAG_WS_KEEP 64 -#define LEJP_FLAG_WS_COMMENTLINE 32 - -enum lejp_states { - LEJP_IDLE = 0, - LEJP_MEMBERS = 1, - LEJP_M_P = 2, - LEJP_MP_STRING = LEJP_FLAG_WS_KEEP | 3, - LEJP_MP_STRING_ESC = LEJP_FLAG_WS_KEEP | 4, - LEJP_MP_STRING_ESC_U1 = LEJP_FLAG_WS_KEEP | 5, - LEJP_MP_STRING_ESC_U2 = LEJP_FLAG_WS_KEEP | 6, - LEJP_MP_STRING_ESC_U3 = LEJP_FLAG_WS_KEEP | 7, - LEJP_MP_STRING_ESC_U4 = LEJP_FLAG_WS_KEEP | 8, - LEJP_MP_DELIM = 9, - LEJP_MP_VALUE = 10, - LEJP_MP_VALUE_NUM_INT = LEJP_FLAG_WS_KEEP | 11, - LEJP_MP_VALUE_NUM_EXP = LEJP_FLAG_WS_KEEP | 12, - LEJP_MP_VALUE_TOK = LEJP_FLAG_WS_KEEP | 13, - LEJP_MP_COMMA_OR_END = 14, - LEJP_MP_ARRAY_END = 15, -}; - -enum lejp_reasons { - LEJP_CONTINUE = -1, - LEJP_REJECT_IDLE_NO_BRACE = -2, - LEJP_REJECT_MEMBERS_NO_CLOSE = -3, - LEJP_REJECT_MP_NO_OPEN_QUOTE = -4, - LEJP_REJECT_MP_STRING_UNDERRUN = -5, - LEJP_REJECT_MP_ILLEGAL_CTRL = -6, - LEJP_REJECT_MP_STRING_ESC_ILLEGAL_ESC = -7, - LEJP_REJECT_ILLEGAL_HEX = -8, - LEJP_REJECT_MP_DELIM_MISSING_COLON = -9, - LEJP_REJECT_MP_DELIM_BAD_VALUE_START = -10, - LEJP_REJECT_MP_VAL_NUM_INT_NO_FRAC = -11, - LEJP_REJECT_MP_VAL_NUM_FORMAT = -12, - LEJP_REJECT_MP_VAL_NUM_EXP_BAD_EXP = -13, - LEJP_REJECT_MP_VAL_TOK_UNKNOWN = -14, - LEJP_REJECT_MP_C_OR_E_UNDERF = -15, - LEJP_REJECT_MP_C_OR_E_NOTARRAY = -16, - LEJP_REJECT_MP_ARRAY_END_MISSING = -17, - LEJP_REJECT_STACK_OVERFLOW = -18, - LEJP_REJECT_MP_DELIM_ISTACK = -19, - LEJP_REJECT_NUM_TOO_LONG = -20, - LEJP_REJECT_MP_C_OR_E_NEITHER = -21, - LEJP_REJECT_UNKNOWN = -22, - LEJP_REJECT_CALLBACK = -23 -}; - -#define LEJP_FLAG_CB_IS_VALUE 64 - -enum lejp_callbacks { - LEJPCB_CONSTRUCTED = 0, - LEJPCB_DESTRUCTED = 1, - - LEJPCB_START = 2, - LEJPCB_COMPLETE = 3, - LEJPCB_FAILED = 4, - - LEJPCB_PAIR_NAME = 5, - - LEJPCB_VAL_TRUE = LEJP_FLAG_CB_IS_VALUE | 6, - LEJPCB_VAL_FALSE = LEJP_FLAG_CB_IS_VALUE | 7, - LEJPCB_VAL_NULL = LEJP_FLAG_CB_IS_VALUE | 8, - LEJPCB_VAL_NUM_INT = LEJP_FLAG_CB_IS_VALUE | 9, - LEJPCB_VAL_NUM_FLOAT = LEJP_FLAG_CB_IS_VALUE | 10, - LEJPCB_VAL_STR_START = 11, /* notice handle separately */ - LEJPCB_VAL_STR_CHUNK = LEJP_FLAG_CB_IS_VALUE | 12, - LEJPCB_VAL_STR_END = LEJP_FLAG_CB_IS_VALUE | 13, - - LEJPCB_ARRAY_START = 14, - LEJPCB_ARRAY_END = 15, - - LEJPCB_OBJECT_START = 16, - LEJPCB_OBJECT_END = 17 -}; - -/** - * _lejp_callback() - User parser actions - * \param ctx: LEJP context - * \param reason: Callback reason - * - * Your user callback is associated with the context at construction time, - * and receives calls as the parsing progresses. - * - * All of the callbacks may be ignored and just return 0. - * - * The reasons it might get called, found in @reason, are: - * - * LEJPCB_CONSTRUCTED: The context was just constructed... you might want to - * perform one-time allocation for the life of the context. - * - * LEJPCB_DESTRUCTED: The context is being destructed... if you made any - * allocations at construction-time, you can free them now - * - * LEJPCB_START: Parsing is beginning at the first byte of input - * - * LEJPCB_COMPLETE: Parsing has completed successfully. You'll get a 0 or - * positive return code from lejp_parse indicating the - * amount of unused bytes left in the input buffer - * - * LEJPCB_FAILED: Parsing failed. You'll get a negative error code - * returned from lejp_parse - * - * LEJPCB_PAIR_NAME: When a "name":"value" pair has had the name parsed, - * this callback occurs. You can find the new name at - * the end of ctx->path[] - * - * LEJPCB_VAL_TRUE: The "true" value appeared - * - * LEJPCB_VAL_FALSE: The "false" value appeared - * - * LEJPCB_VAL_NULL: The "null" value appeared - * - * LEJPCB_VAL_NUM_INT: A string representing an integer is in ctx->buf - * - * LEJPCB_VAL_NUM_FLOAT: A string representing a float is in ctx->buf - * - * LEJPCB_VAL_STR_START: We are starting to parse a string, no data yet - * - * LEJPCB_VAL_STR_CHUNK: We parsed LEJP_STRING_CHUNK -1 bytes of string data in - * ctx->buf, which is as much as we can buffer, so we are - * spilling it. If all your strings are less than - * LEJP_STRING_CHUNK - 1 bytes, you will never see this - * callback. - * - * LEJPCB_VAL_STR_END: String parsing has completed, the last chunk of the - * string is in ctx->buf. - * - * LEJPCB_ARRAY_START: An array started - * - * LEJPCB_ARRAY_END: An array ended - * - * LEJPCB_OBJECT_START: An object started - * - * LEJPCB_OBJECT_END: An object ended - */ -LWS_EXTERN signed char _lejp_callback(struct lejp_ctx *ctx, char reason); - -typedef signed char (*lejp_callback)(struct lejp_ctx *ctx, char reason); - -#ifndef LEJP_MAX_DEPTH -#define LEJP_MAX_DEPTH 12 -#endif -#ifndef LEJP_MAX_INDEX_DEPTH -#define LEJP_MAX_INDEX_DEPTH 5 -#endif -#ifndef LEJP_MAX_PATH -#define LEJP_MAX_PATH 128 -#endif -#ifndef LEJP_STRING_CHUNK -/* must be >= 30 to assemble floats */ -#define LEJP_STRING_CHUNK 254 -#endif - -enum num_flags { - LEJP_SEEN_MINUS = (1 << 0), - LEJP_SEEN_POINT = (1 << 1), - LEJP_SEEN_POST_POINT = (1 << 2), - LEJP_SEEN_EXP = (1 << 3) -}; - -struct _lejp_stack { - char s; /* lejp_state stack*/ - char p; /* path length */ - char i; /* index array length */ - char b; /* user bitfield */ -}; - -struct lejp_ctx { - - /* sorted by type for most compact alignment - * - * pointers - */ - - signed char (*callback)(struct lejp_ctx *ctx, char reason); - void *user; - const char * const *paths; - - /* arrays */ - - struct _lejp_stack st[LEJP_MAX_DEPTH]; - uint16_t i[LEJP_MAX_INDEX_DEPTH]; /* index array */ - uint16_t wild[LEJP_MAX_INDEX_DEPTH]; /* index array */ - char path[LEJP_MAX_PATH]; - char buf[LEJP_STRING_CHUNK + 1]; - - /* int */ - - uint32_t line; - - /* short */ - - uint16_t uni; - - /* char */ - - uint8_t npos; - uint8_t dcount; - uint8_t f; - uint8_t sp; /* stack head */ - uint8_t ipos; /* index stack depth */ - uint8_t ppos; - uint8_t count_paths; - uint8_t path_match; - uint8_t path_match_len; - uint8_t wildcount; -}; - -LWS_VISIBLE LWS_EXTERN void -lejp_construct(struct lejp_ctx *ctx, - signed char (*callback)(struct lejp_ctx *ctx, char reason), - void *user, const char * const *paths, unsigned char paths_count); - -LWS_VISIBLE LWS_EXTERN void -lejp_destruct(struct lejp_ctx *ctx); - -LWS_VISIBLE LWS_EXTERN int -lejp_parse(struct lejp_ctx *ctx, const unsigned char *json, int len); - -LWS_VISIBLE LWS_EXTERN void -lejp_change_callback(struct lejp_ctx *ctx, - signed char (*callback)(struct lejp_ctx *ctx, char reason)); - -LWS_VISIBLE LWS_EXTERN int -lejp_get_wildcard(struct lejp_ctx *ctx, int wildcard, char *dest, int len); -//@} - -/* - * Stats are all uint64_t numbers that start at 0. - * Index names here have the convention - * - * _C_ counter - * _B_ byte count - * _MS_ millisecond count - */ - -enum { - LWSSTATS_C_CONNECTIONS, /**< count incoming connections */ - LWSSTATS_C_API_CLOSE, /**< count calls to close api */ - LWSSTATS_C_API_READ, /**< count calls to read from socket api */ - LWSSTATS_C_API_LWS_WRITE, /**< count calls to lws_write API */ - LWSSTATS_C_API_WRITE, /**< count calls to write API */ - LWSSTATS_C_WRITE_PARTIALS, /**< count of partial writes */ - LWSSTATS_C_WRITEABLE_CB_REQ, /**< count of writable callback requests */ - LWSSTATS_C_WRITEABLE_CB_EFF_REQ, /**< count of effective writable callback requests */ - LWSSTATS_C_WRITEABLE_CB, /**< count of writable callbacks */ - LWSSTATS_C_SSL_CONNECTIONS_FAILED, /**< count of failed SSL connections */ - LWSSTATS_C_SSL_CONNECTIONS_ACCEPTED, /**< count of accepted SSL connections */ - LWSSTATS_C_SSL_CONNECTIONS_ACCEPT_SPIN, /**< count of SSL_accept() attempts */ - LWSSTATS_C_SSL_CONNS_HAD_RX, /**< count of accepted SSL conns that have had some RX */ - LWSSTATS_C_TIMEOUTS, /**< count of timed-out connections */ - LWSSTATS_C_SERVICE_ENTRY, /**< count of entries to lws service loop */ - LWSSTATS_B_READ, /**< aggregate bytes read */ - LWSSTATS_B_WRITE, /**< aggregate bytes written */ - LWSSTATS_B_PARTIALS_ACCEPTED_PARTS, /**< aggreate of size of accepted write data from new partials */ - LWSSTATS_MS_SSL_CONNECTIONS_ACCEPTED_DELAY, /**< aggregate delay in accepting connection */ - LWSSTATS_MS_WRITABLE_DELAY, /**< aggregate delay between asking for writable and getting cb */ - LWSSTATS_MS_WORST_WRITABLE_DELAY, /**< single worst delay between asking for writable and getting cb */ - LWSSTATS_MS_SSL_RX_DELAY, /**< aggregate delay between ssl accept complete and first RX */ - LWSSTATS_C_PEER_LIMIT_AH_DENIED, /**< number of times we would have given an ah but for the peer limit */ - LWSSTATS_C_PEER_LIMIT_WSI_DENIED, /**< number of times we would have given a wsi but for the peer limit */ - - /* Add new things just above here ---^ - * This is part of the ABI, don't needlessly break compatibility */ - LWSSTATS_SIZE -}; - -#if defined(LWS_WITH_STATS) - -LWS_VISIBLE LWS_EXTERN uint64_t -lws_stats_get(struct lws_context *context, int index); -LWS_VISIBLE LWS_EXTERN void -lws_stats_log_dump(struct lws_context *context); -#else -static LWS_INLINE uint64_t -lws_stats_get(struct lws_context *context, int index) { (void)context; (void)index; return 0; } -static LWS_INLINE void -lws_stats_log_dump(struct lws_context *context) { (void)context; } -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/thirdparty/libwebsockets/plat/lws-plat-unix.c b/thirdparty/libwebsockets/plat/lws-plat-unix.c deleted file mode 100644 index 7dba3bd82f..0000000000 --- a/thirdparty/libwebsockets/plat/lws-plat-unix.c +++ /dev/null @@ -1,977 +0,0 @@ -/* - * libwebsockets - small server side websockets and web server implementation - * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation: - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -#define _GNU_SOURCE -#include "core/private.h" - -#include <pwd.h> -#include <grp.h> - -#ifdef LWS_WITH_PLUGINS -#include <dlfcn.h> -#endif -#include <dirent.h> - -void lws_plat_apply_FD_CLOEXEC(int n) -{ - if (n != -1) - fcntl(n, F_SETFD, FD_CLOEXEC ); -} - -int -lws_plat_socket_offset(void) -{ - return 0; -} - -int -lws_plat_pipe_create(struct lws *wsi) -{ - struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; - -#if defined(LWS_HAVE_PIPE2) - return pipe2(pt->dummy_pipe_fds, O_NONBLOCK); -#else - return pipe(pt->dummy_pipe_fds); -#endif -} - -int -lws_plat_pipe_signal(struct lws *wsi) -{ - struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; - char buf = 0; - int n; - - n = write(pt->dummy_pipe_fds[1], &buf, 1); - - return n != 1; -} - -void -lws_plat_pipe_close(struct lws *wsi) -{ - struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; - - if (pt->dummy_pipe_fds[0] && pt->dummy_pipe_fds[0] != -1) - close(pt->dummy_pipe_fds[0]); - if (pt->dummy_pipe_fds[1] && pt->dummy_pipe_fds[1] != -1) - close(pt->dummy_pipe_fds[1]); - - pt->dummy_pipe_fds[0] = pt->dummy_pipe_fds[1] = -1; -} - -#ifdef __QNX__ -# include "netinet/tcp_var.h" -# define TCP_KEEPINTVL TCPCTL_KEEPINTVL -# define TCP_KEEPIDLE TCPCTL_KEEPIDLE -# define TCP_KEEPCNT TCPCTL_KEEPCNT -#endif - -unsigned long long time_in_microseconds(void) -{ - struct timeval tv; - - gettimeofday(&tv, NULL); - return ((unsigned long long)tv.tv_sec * 1000000LL) + tv.tv_usec; -} - -LWS_VISIBLE int -lws_get_random(struct lws_context *context, void *buf, int len) -{ - return read(context->fd_random, (char *)buf, len); -} - -LWS_VISIBLE int -lws_send_pipe_choked(struct lws *wsi) -{ - struct lws_pollfd fds; - struct lws *wsi_eff = wsi; - -#if defined(LWS_WITH_HTTP2) - wsi_eff = lws_get_network_wsi(wsi); -#endif - - /* the fact we checked implies we avoided back-to-back writes */ - wsi_eff->could_have_pending = 0; - - /* treat the fact we got a truncated send pending as if we're choked */ - if (wsi_eff->trunc_len) - return 1; - - fds.fd = wsi_eff->desc.sockfd; - fds.events = POLLOUT; - fds.revents = 0; - - if (poll(&fds, 1, 0) != 1) - return 1; - - if ((fds.revents & POLLOUT) == 0) - return 1; - - /* okay to send another packet without blocking */ - - return 0; -} - -LWS_VISIBLE int -lws_poll_listen_fd(struct lws_pollfd *fd) -{ - return poll(fd, 1, 0); -} - -LWS_VISIBLE void lwsl_emit_syslog(int level, const char *line) -{ - int syslog_level = LOG_DEBUG; - - switch (level) { - case LLL_ERR: - syslog_level = LOG_ERR; - break; - case LLL_WARN: - syslog_level = LOG_WARNING; - break; - case LLL_NOTICE: - syslog_level = LOG_NOTICE; - break; - case LLL_INFO: - syslog_level = LOG_INFO; - break; - } - syslog(syslog_level, "%s", line); -} - -LWS_VISIBLE LWS_EXTERN int -_lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) -{ - volatile struct lws_foreign_thread_pollfd *ftp, *next; - volatile struct lws_context_per_thread *vpt; - struct lws_context_per_thread *pt; - int n = -1, m, c; - - /* stay dead once we are dead */ - - if (!context || !context->vhost_list) - return 1; - - pt = &context->pt[tsi]; - vpt = (volatile struct lws_context_per_thread *)pt; - - lws_stats_atomic_bump(context, pt, LWSSTATS_C_SERVICE_ENTRY, 1); - - if (timeout_ms < 0) - goto faked_service; - - if (context->event_loop_ops->run_pt) - context->event_loop_ops->run_pt(context, tsi); - - if (!context->service_tid_detected) { - struct lws _lws; - - memset(&_lws, 0, sizeof(_lws)); - _lws.context = context; - - context->service_tid_detected = - context->vhost_list->protocols[0].callback( - &_lws, LWS_CALLBACK_GET_THREAD_ID, NULL, NULL, 0); - context->service_tid = context->service_tid_detected; - context->service_tid_detected = 1; - } - - /* - * is there anybody with pending stuff that needs service forcing? - */ - if (!lws_service_adjust_timeout(context, 1, tsi)) { - /* -1 timeout means just do forced service */ - _lws_plat_service_tsi(context, -1, pt->tid); - /* still somebody left who wants forced service? */ - if (!lws_service_adjust_timeout(context, 1, pt->tid)) - /* yes... come back again quickly */ - timeout_ms = 0; - } - - if (timeout_ms) { - lws_pt_lock(pt, __func__); - /* don't stay in poll wait longer than next hr timeout */ - lws_usec_t t = __lws_hrtimer_service(pt); - if ((lws_usec_t)timeout_ms * 1000 > t) - timeout_ms = t / 1000; - lws_pt_unlock(pt); - } - - vpt->inside_poll = 1; - lws_memory_barrier(); - n = poll(pt->fds, pt->fds_count, timeout_ms); - vpt->inside_poll = 0; - lws_memory_barrier(); - - /* Collision will be rare and brief. Just spin until it completes */ - while (vpt->foreign_spinlock) - ; - - /* - * At this point we are not inside a foreign thread pollfd change, - * and we have marked ourselves as outside the poll() wait. So we - * are the only guys that can modify the lws_foreign_thread_pollfd - * list on the pt. Drain the list and apply the changes to the - * affected pollfds in the correct order. - */ - - lws_pt_lock(pt, __func__); - - ftp = vpt->foreign_pfd_list; - //lwsl_notice("cleared list %p\n", ftp); - while (ftp) { - struct lws *wsi; - struct lws_pollfd *pfd; - - next = ftp->next; - pfd = &vpt->fds[ftp->fd_index]; - if (lws_socket_is_valid(pfd->fd)) { - wsi = wsi_from_fd(context, pfd->fd); - if (wsi) - __lws_change_pollfd(wsi, ftp->_and, ftp->_or); - } - lws_free((void *)ftp); - ftp = next; - } - vpt->foreign_pfd_list = NULL; - lws_memory_barrier(); - - /* we have come out of a poll wait... check the hrtimer list */ - - __lws_hrtimer_service(pt); - - lws_pt_unlock(pt); - - m = 0; -#if defined(LWS_ROLE_WS) && !defined(LWS_WITHOUT_EXTENSIONS) - m |= !!pt->ws.rx_draining_ext_list; -#endif - - if (pt->context->tls_ops && - pt->context->tls_ops->fake_POLLIN_for_buffered) - m |= pt->context->tls_ops->fake_POLLIN_for_buffered(pt); - - if (!m && !n) { /* nothing to do */ - lws_service_fd_tsi(context, NULL, tsi); - lws_service_do_ripe_rxflow(pt); - - return 0; - } - -faked_service: - m = lws_service_flag_pending(context, tsi); - if (m) - c = -1; /* unknown limit */ - else - if (n < 0) { - if (LWS_ERRNO != LWS_EINTR) - return -1; - return 0; - } else - c = n; - - /* any socket with events to service? */ - for (n = 0; n < (int)pt->fds_count && c; n++) { - if (!pt->fds[n].revents) - continue; - - c--; - - m = lws_service_fd_tsi(context, &pt->fds[n], tsi); - if (m < 0) - return -1; - /* if something closed, retry this slot */ - if (m) - n--; - } - - lws_service_do_ripe_rxflow(pt); - - return 0; -} - -LWS_VISIBLE int -lws_plat_check_connection_error(struct lws *wsi) -{ - return 0; -} - -LWS_VISIBLE int -lws_plat_service(struct lws_context *context, int timeout_ms) -{ - return _lws_plat_service_tsi(context, timeout_ms, 0); -} - -LWS_VISIBLE int -lws_plat_set_socket_options(struct lws_vhost *vhost, int fd) -{ - int optval = 1; - socklen_t optlen = sizeof(optval); - -#if defined(__APPLE__) || \ - defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__NetBSD__) || \ - defined(__OpenBSD__) || \ - defined(__HAIKU__) - struct protoent *tcp_proto; -#endif - - fcntl(fd, F_SETFD, FD_CLOEXEC); - - if (vhost->ka_time) { - /* enable keepalive on this socket */ - optval = 1; - if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, - (const void *)&optval, optlen) < 0) - return 1; - -#if defined(__APPLE__) || \ - defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ - defined(__NetBSD__) || \ - defined(__CYGWIN__) || defined(__OpenBSD__) || defined (__sun) || \ - defined(__HAIKU__) - - /* - * didn't find a way to set these per-socket, need to - * tune kernel systemwide values - */ -#else - /* set the keepalive conditions we want on it too */ - -#if defined(LWS_HAVE_TCP_USER_TIMEOUT) - optval = 1000 * (vhost->ka_time + - (vhost->ka_interval * vhost->ka_probes)); - if (setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, - (const void *)&optval, optlen) < 0) - return 1; -#endif - optval = vhost->ka_time; - if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, - (const void *)&optval, optlen) < 0) - return 1; - - optval = vhost->ka_interval; - if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, - (const void *)&optval, optlen) < 0) - return 1; - - optval = vhost->ka_probes; - if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, - (const void *)&optval, optlen) < 0) - return 1; -#endif - } - -#if defined(SO_BINDTODEVICE) - if (vhost->bind_iface && vhost->iface) { - lwsl_info("binding listen skt to %s using SO_BINDTODEVICE\n", vhost->iface); - if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, vhost->iface, - strlen(vhost->iface)) < 0) { - lwsl_warn("Failed to bind to device %s\n", vhost->iface); - return 1; - } - } -#endif - - /* Disable Nagle */ - optval = 1; -#if defined (__sun) || defined(__QNX__) - if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (const void *)&optval, optlen) < 0) - return 1; -#elif !defined(__APPLE__) && \ - !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && \ - !defined(__NetBSD__) && \ - !defined(__OpenBSD__) && \ - !defined(__HAIKU__) - if (setsockopt(fd, SOL_TCP, TCP_NODELAY, (const void *)&optval, optlen) < 0) - return 1; -#else - tcp_proto = getprotobyname("TCP"); - if (setsockopt(fd, tcp_proto->p_proto, TCP_NODELAY, &optval, optlen) < 0) - return 1; -#endif - - /* We are nonblocking... */ - if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) - return 1; - - return 0; -} - -#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) -static void -_lws_plat_apply_caps(int mode, const cap_value_t *cv, int count) -{ - cap_t caps; - - if (!count) - return; - - caps = cap_get_proc(); - - cap_set_flag(caps, mode, count, cv, CAP_SET); - cap_set_proc(caps); - prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0); - cap_free(caps); -} -#endif - -LWS_VISIBLE void -lws_plat_drop_app_privileges(const struct lws_context_creation_info *info) -{ -#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) - int n; -#endif - - if (info->gid && info->gid != -1) - if (setgid(info->gid)) - lwsl_warn("setgid: %s\n", strerror(LWS_ERRNO)); - - if (info->uid && info->uid != -1) { - struct passwd *p = getpwuid(info->uid); - - if (p) { - -#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) - _lws_plat_apply_caps(CAP_PERMITTED, info->caps, info->count_caps); -#endif - - initgroups(p->pw_name, info->gid); - if (setuid(info->uid)) - lwsl_warn("setuid: %s\n", strerror(LWS_ERRNO)); - else - lwsl_notice("Set privs to user '%s'\n", p->pw_name); - -#if defined(LWS_HAVE_SYS_CAPABILITY_H) && defined(LWS_HAVE_LIBCAP) - _lws_plat_apply_caps(CAP_EFFECTIVE, info->caps, info->count_caps); - - if (info->count_caps) - for (n = 0; n < info->count_caps; n++) - lwsl_notice(" RETAINING CAPABILITY %d\n", (int)info->caps[n]); -#endif - - } else - lwsl_warn("getpwuid: unable to find uid %d", info->uid); - } -} - -#ifdef LWS_WITH_PLUGINS - -#if defined(LWS_WITH_LIBUV) && UV_VERSION_MAJOR > 0 - -/* libuv.c implements these in a cross-platform way */ - -#else - -static int filter(const struct dirent *ent) -{ - if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) - return 0; - - return 1; -} - -LWS_VISIBLE int -lws_plat_plugins_init(struct lws_context * context, const char * const *d) -{ - struct lws_plugin_capability lcaps; - struct lws_plugin *plugin; - lws_plugin_init_func initfunc; - struct dirent **namelist; - int n, i, m, ret = 0; - char path[256]; - void *l; - - lwsl_notice(" Plugins:\n"); - - while (d && *d) { - n = scandir(*d, &namelist, filter, alphasort); - if (n < 0) { - lwsl_err("Scandir on %s failed\n", *d); - return 1; - } - - for (i = 0; i < n; i++) { - if (strlen(namelist[i]->d_name) < 7) - goto inval; - - lwsl_notice(" %s\n", namelist[i]->d_name); - - lws_snprintf(path, sizeof(path) - 1, "%s/%s", *d, - namelist[i]->d_name); - l = dlopen(path, RTLD_NOW); - if (!l) { - lwsl_err("Error loading DSO: %s\n", dlerror()); - while (i++ < n) - free(namelist[i]); - goto bail; - } - /* we could open it, can we get his init function? */ - m = lws_snprintf(path, sizeof(path) - 1, "init_%s", - namelist[i]->d_name + 3 /* snip lib... */); - path[m - 3] = '\0'; /* snip the .so */ - initfunc = dlsym(l, path); - if (!initfunc) { - lwsl_err("Failed to get init on %s: %s", - namelist[i]->d_name, dlerror()); - dlclose(l); - } - lcaps.api_magic = LWS_PLUGIN_API_MAGIC; - m = initfunc(context, &lcaps); - if (m) { - lwsl_err("Initializing %s failed %d\n", - namelist[i]->d_name, m); - dlclose(l); - goto skip; - } - - plugin = lws_malloc(sizeof(*plugin), "plugin"); - if (!plugin) { - lwsl_err("OOM\n"); - goto bail; - } - plugin->list = context->plugin_list; - context->plugin_list = plugin; - lws_strncpy(plugin->name, namelist[i]->d_name, - sizeof(plugin->name)); - plugin->l = l; - plugin->caps = lcaps; - context->plugin_protocol_count += lcaps.count_protocols; - context->plugin_extension_count += lcaps.count_extensions; - - free(namelist[i]); - continue; - - skip: - dlclose(l); - inval: - free(namelist[i]); - } - free(namelist); - d++; - } - -bail: - free(namelist); - - return ret; -} - -LWS_VISIBLE int -lws_plat_plugins_destroy(struct lws_context * context) -{ - struct lws_plugin *plugin = context->plugin_list, *p; - lws_plugin_destroy_func func; - char path[256]; - int m; - - if (!plugin) - return 0; - - lwsl_notice("%s\n", __func__); - - while (plugin) { - p = plugin; - m = lws_snprintf(path, sizeof(path) - 1, "destroy_%s", plugin->name + 3); - path[m - 3] = '\0'; - func = dlsym(plugin->l, path); - if (!func) { - lwsl_err("Failed to get destroy on %s: %s", - plugin->name, dlerror()); - goto next; - } - m = func(context); - if (m) - lwsl_err("Initializing %s failed %d\n", - plugin->name, m); -next: - dlclose(p->l); - plugin = p->list; - p->list = NULL; - free(p); - } - - context->plugin_list = NULL; - - return 0; -} - -#endif -#endif - - -#if 0 -static void -sigabrt_handler(int x) -{ - printf("%s\n", __func__); -} -#endif - -LWS_VISIBLE int -lws_plat_context_early_init(void) -{ -#if !defined(LWS_AVOID_SIGPIPE_IGN) - signal(SIGPIPE, SIG_IGN); -#endif - - return 0; -} - -LWS_VISIBLE void -lws_plat_context_early_destroy(struct lws_context *context) -{ -} - -LWS_VISIBLE void -lws_plat_context_late_destroy(struct lws_context *context) -{ -#ifdef LWS_WITH_PLUGINS - if (context->plugin_list) - lws_plat_plugins_destroy(context); -#endif - - if (context->lws_lookup) - lws_free(context->lws_lookup); - - if (!context->fd_random) - lwsl_err("ZERO RANDOM FD\n"); - if (context->fd_random != LWS_INVALID_FILE) - close(context->fd_random); -} - -/* cast a struct sockaddr_in6 * into addr for ipv6 */ - -LWS_VISIBLE int -lws_interface_to_sa(int ipv6, const char *ifname, struct sockaddr_in *addr, - size_t addrlen) -{ - int rc = LWS_ITOSA_NOT_EXIST; - - struct ifaddrs *ifr; - struct ifaddrs *ifc; -#ifdef LWS_WITH_IPV6 - struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr; -#endif - - getifaddrs(&ifr); - for (ifc = ifr; ifc != NULL && rc; ifc = ifc->ifa_next) { - if (!ifc->ifa_addr) - continue; - - lwsl_debug(" interface %s vs %s (fam %d) ipv6 %d\n", ifc->ifa_name, ifname, ifc->ifa_addr->sa_family, ipv6); - - if (strcmp(ifc->ifa_name, ifname)) - continue; - - switch (ifc->ifa_addr->sa_family) { -#if defined(AF_PACKET) - case AF_PACKET: - /* interface exists but is not usable */ - rc = LWS_ITOSA_NOT_USABLE; - continue; -#endif - - case AF_INET: -#ifdef LWS_WITH_IPV6 - if (ipv6) { - /* map IPv4 to IPv6 */ - bzero((char *)&addr6->sin6_addr, - sizeof(struct in6_addr)); - addr6->sin6_addr.s6_addr[10] = 0xff; - addr6->sin6_addr.s6_addr[11] = 0xff; - memcpy(&addr6->sin6_addr.s6_addr[12], - &((struct sockaddr_in *)ifc->ifa_addr)->sin_addr, - sizeof(struct in_addr)); - } else -#endif - memcpy(addr, - (struct sockaddr_in *)ifc->ifa_addr, - sizeof(struct sockaddr_in)); - break; -#ifdef LWS_WITH_IPV6 - case AF_INET6: - memcpy(&addr6->sin6_addr, - &((struct sockaddr_in6 *)ifc->ifa_addr)->sin6_addr, - sizeof(struct in6_addr)); - break; -#endif - default: - continue; - } - rc = LWS_ITOSA_USABLE; - } - - freeifaddrs(ifr); - - if (rc) { - /* check if bind to IP address */ -#ifdef LWS_WITH_IPV6 - if (inet_pton(AF_INET6, ifname, &addr6->sin6_addr) == 1) - rc = LWS_ITOSA_USABLE; - else -#endif - if (inet_pton(AF_INET, ifname, &addr->sin_addr) == 1) - rc = LWS_ITOSA_USABLE; - } - - return rc; -} - -LWS_VISIBLE void -lws_plat_insert_socket_into_fds(struct lws_context *context, struct lws *wsi) -{ - struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; - - if (context->event_loop_ops->io) - context->event_loop_ops->io(wsi, LWS_EV_START | LWS_EV_READ); - - pt->fds[pt->fds_count++].revents = 0; -} - -LWS_VISIBLE void -lws_plat_delete_socket_from_fds(struct lws_context *context, - struct lws *wsi, int m) -{ - struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; - - if (context->event_loop_ops->io) - context->event_loop_ops->io(wsi, - LWS_EV_STOP | LWS_EV_READ | LWS_EV_WRITE); - - pt->fds_count--; -} - -LWS_VISIBLE void -lws_plat_service_periodic(struct lws_context *context) -{ - /* if our parent went down, don't linger around */ - if (context->started_with_parent && - kill(context->started_with_parent, 0) < 0) - kill(getpid(), SIGTERM); -} - -LWS_VISIBLE int -lws_plat_change_pollfd(struct lws_context *context, - struct lws *wsi, struct lws_pollfd *pfd) -{ - return 0; -} - -LWS_VISIBLE const char * -lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt) -{ - return inet_ntop(af, src, dst, cnt); -} - -LWS_VISIBLE int -lws_plat_inet_pton(int af, const char *src, void *dst) -{ - return inet_pton(af, src, dst); -} - -LWS_VISIBLE lws_fop_fd_t -_lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, - const char *vpath, lws_fop_flags_t *flags) -{ - struct stat stat_buf; - int ret = open(filename, (*flags) & LWS_FOP_FLAGS_MASK, 0664); - lws_fop_fd_t fop_fd; - - if (ret < 0) - return NULL; - - if (fstat(ret, &stat_buf) < 0) - goto bail; - - fop_fd = malloc(sizeof(*fop_fd)); - if (!fop_fd) - goto bail; - - fop_fd->fops = fops; - fop_fd->flags = *flags; - fop_fd->fd = ret; - fop_fd->filesystem_priv = NULL; /* we don't use it */ - fop_fd->len = stat_buf.st_size; - fop_fd->pos = 0; - - return fop_fd; - -bail: - close(ret); - return NULL; -} - -LWS_VISIBLE int -_lws_plat_file_close(lws_fop_fd_t *fop_fd) -{ - int fd = (*fop_fd)->fd; - - free(*fop_fd); - *fop_fd = NULL; - - return close(fd); -} - -LWS_VISIBLE lws_fileofs_t -_lws_plat_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset) -{ - lws_fileofs_t r; - - if (offset > 0 && - offset > (lws_fileofs_t)fop_fd->len - (lws_fileofs_t)fop_fd->pos) - offset = fop_fd->len - fop_fd->pos; - - if ((lws_fileofs_t)fop_fd->pos + offset < 0) - offset = -fop_fd->pos; - - r = lseek(fop_fd->fd, offset, SEEK_CUR); - - if (r >= 0) - fop_fd->pos = r; - else - lwsl_err("error seeking from cur %ld, offset %ld\n", - (long)fop_fd->pos, (long)offset); - - return r; -} - -LWS_VISIBLE int -_lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len) -{ - long n; - - n = read((int)fop_fd->fd, buf, len); - if (n == -1) { - *amount = 0; - return -1; - } - fop_fd->pos += n; - lwsl_debug("%s: read %ld of req %ld, pos %ld, len %ld\n", __func__, n, - (long)len, (long)fop_fd->pos, (long)fop_fd->len); - *amount = n; - - return 0; -} - -LWS_VISIBLE int -_lws_plat_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len) -{ - long n; - - n = write((int)fop_fd->fd, buf, len); - if (n == -1) { - *amount = 0; - return -1; - } - - fop_fd->pos += n; - *amount = n; - - return 0; -} - -LWS_VISIBLE int -lws_plat_init(struct lws_context *context, - const struct lws_context_creation_info *info) -{ - int fd; - - /* master context has the global fd lookup array */ - context->lws_lookup = lws_zalloc(sizeof(struct lws *) * - context->max_fds, "lws_lookup"); - if (context->lws_lookup == NULL) { - lwsl_err("OOM on lws_lookup array for %d connections\n", - context->max_fds); - return 1; - } - - lwsl_info(" mem: platform fd map: %5lu bytes\n", - (unsigned long)(sizeof(struct lws *) * context->max_fds)); - fd = open(SYSTEM_RANDOM_FILEPATH, O_RDONLY); - - context->fd_random = fd; - if (context->fd_random < 0) { - lwsl_err("Unable to open random device %s %d\n", - SYSTEM_RANDOM_FILEPATH, context->fd_random); - return 1; - } - -#ifdef LWS_WITH_PLUGINS - if (info->plugin_dirs) - lws_plat_plugins_init(context, info->plugin_dirs); -#endif - - return 0; -} - -LWS_VISIBLE int -lws_plat_write_cert(struct lws_vhost *vhost, int is_key, int fd, void *buf, - int len) -{ - int n; - - n = write(fd, buf, len); - - fsync(fd); - lseek(fd, 0, SEEK_SET); - - return n != len; -} - -LWS_VISIBLE int -lws_plat_write_file(const char *filename, void *buf, int len) -{ - int m, fd; - - fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600); - - if (fd == -1) - return 1; - - m = write(fd, buf, len); - close(fd); - - return m != len; -} - -LWS_VISIBLE int -lws_plat_read_file(const char *filename, void *buf, int len) -{ - int n, fd = lws_open(filename, O_RDONLY); - if (fd == -1) - return -1; - - n = read(fd, buf, len); - close(fd); - - return n; -} - -LWS_VISIBLE int -lws_plat_recommended_rsa_bits(void) -{ - return 4096; -} diff --git a/thirdparty/libwebsockets/plat/lws-plat-win.c b/thirdparty/libwebsockets/plat/lws-plat-win.c deleted file mode 100644 index 1850b64250..0000000000 --- a/thirdparty/libwebsockets/plat/lws-plat-win.c +++ /dev/null @@ -1,847 +0,0 @@ -#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS -#define _WINSOCK_DEPRECATED_NO_WARNINGS -#endif -#include "core/private.h" - -void lws_plat_apply_FD_CLOEXEC(int n) -{ -} - -int -lws_plat_socket_offset(void) -{ - return 0; -} - -int -lws_plat_pipe_create(struct lws *wsi) -{ - return 1; -} - -int -lws_plat_pipe_signal(struct lws *wsi) -{ - struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; - - WSASetEvent(pt->events[0]); /* trigger the cancel event */ - - return 0; -} - -void -lws_plat_pipe_close(struct lws *wsi) -{ -} - -unsigned long long -time_in_microseconds() -{ -#ifndef DELTA_EPOCH_IN_MICROSECS -#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL -#endif - FILETIME filetime; - ULARGE_INTEGER datetime; - -#ifdef _WIN32_WCE - GetCurrentFT(&filetime); -#else - GetSystemTimeAsFileTime(&filetime); -#endif - - /* - * As per Windows documentation for FILETIME, copy the resulting - * FILETIME structure to a ULARGE_INTEGER structure using memcpy - * (using memcpy instead of direct assignment can prevent alignment - * faults on 64-bit Windows). - */ - memcpy(&datetime, &filetime, sizeof(datetime)); - - /* Windows file times are in 100s of nanoseconds. */ - return (datetime.QuadPart / 10) - DELTA_EPOCH_IN_MICROSECS; -} - -#ifdef _WIN32_WCE -time_t time(time_t *t) -{ - time_t ret = time_in_microseconds() / 1000000; - - if(t != NULL) - *t = ret; - - return ret; -} -#endif - -/* file descriptor hash management */ - -struct lws * -wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd) -{ - int h = LWS_FD_HASH(fd); - int n = 0; - - for (n = 0; n < context->fd_hashtable[h].length; n++) - if (context->fd_hashtable[h].wsi[n]->desc.sockfd == fd) - return context->fd_hashtable[h].wsi[n]; - - return NULL; -} - -int -insert_wsi(struct lws_context *context, struct lws *wsi) -{ - int h = LWS_FD_HASH(wsi->desc.sockfd); - - if (context->fd_hashtable[h].length == (getdtablesize() - 1)) { - lwsl_err("hash table overflow\n"); - return 1; - } - - context->fd_hashtable[h].wsi[context->fd_hashtable[h].length++] = wsi; - - return 0; -} - -int -delete_from_fd(struct lws_context *context, lws_sockfd_type fd) -{ - int h = LWS_FD_HASH(fd); - int n = 0; - - for (n = 0; n < context->fd_hashtable[h].length; n++) - if (context->fd_hashtable[h].wsi[n]->desc.sockfd == fd) { - while (n < context->fd_hashtable[h].length) { - context->fd_hashtable[h].wsi[n] = - context->fd_hashtable[h].wsi[n + 1]; - n++; - } - context->fd_hashtable[h].length--; - - return 0; - } - - lwsl_err("Failed to find fd %d requested for " - "delete in hashtable\n", fd); - return 1; -} - -LWS_VISIBLE int -lws_get_random(struct lws_context *context, void *buf, int len) -{ - int n; - char *p = (char *)buf; - - for (n = 0; n < len; n++) - p[n] = (unsigned char)rand(); - - return n; -} - -LWS_VISIBLE int -lws_send_pipe_choked(struct lws *wsi) -{ struct lws *wsi_eff = wsi; - -#if defined(LWS_WITH_HTTP2) - wsi_eff = lws_get_network_wsi(wsi); -#endif - /* the fact we checked implies we avoided back-to-back writes */ - wsi_eff->could_have_pending = 0; - - /* treat the fact we got a truncated send pending as if we're choked */ - if (wsi_eff->trunc_len) - return 1; - - return (int)wsi_eff->sock_send_blocking; -} - -LWS_VISIBLE int -lws_poll_listen_fd(struct lws_pollfd *fd) -{ - fd_set readfds; - struct timeval tv = { 0, 0 }; - - assert((fd->events & LWS_POLLIN) == LWS_POLLIN); - - FD_ZERO(&readfds); - FD_SET(fd->fd, &readfds); - - return select(((int)fd->fd) + 1, &readfds, NULL, NULL, &tv); -} - -LWS_VISIBLE void -lwsl_emit_syslog(int level, const char *line) -{ - lwsl_emit_stderr(level, line); -} - -LWS_VISIBLE LWS_EXTERN int -_lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) -{ - struct lws_context_per_thread *pt; - WSANETWORKEVENTS networkevents; - struct lws_pollfd *pfd; - struct lws *wsi; - unsigned int i; - DWORD ev; - int n, m; - - /* stay dead once we are dead */ - if (context == NULL || !context->vhost_list) - return 1; - - pt = &context->pt[tsi]; - - if (!context->service_tid_detected) { - struct lws _lws; - - memset(&_lws, 0, sizeof(_lws)); - _lws.context = context; - - context->service_tid_detected = context->vhost_list-> - protocols[0].callback(&_lws, LWS_CALLBACK_GET_THREAD_ID, - NULL, NULL, 0); - context->service_tid = context->service_tid_detected; - context->service_tid_detected = 1; - } - - if (timeout_ms < 0) { - if (lws_service_flag_pending(context, tsi)) { - /* any socket with events to service? */ - for (n = 0; n < (int)pt->fds_count; n++) { - if (!pt->fds[n].revents) - continue; - - m = lws_service_fd_tsi(context, &pt->fds[n], tsi); - if (m < 0) - return -1; - /* if something closed, retry this slot */ - if (m) - n--; - } - } - return 0; - } - - if (context->event_loop_ops->run_pt) - context->event_loop_ops->run_pt(context, tsi); - - for (i = 0; i < pt->fds_count; ++i) { - pfd = &pt->fds[i]; - - if (!(pfd->events & LWS_POLLOUT)) - continue; - - wsi = wsi_from_fd(context, pfd->fd); - if (!wsi || wsi->listener) - continue; - if (wsi->sock_send_blocking) - continue; - pfd->revents = LWS_POLLOUT; - n = lws_service_fd(context, pfd); - if (n < 0) - return -1; - - /* Force WSAWaitForMultipleEvents() to check events and then return immediately. */ - timeout_ms = 0; - - /* if something closed, retry this slot */ - if (n) - i--; - } - - /* - * is there anybody with pending stuff that needs service forcing? - */ - if (!lws_service_adjust_timeout(context, 1, tsi)) { - /* -1 timeout means just do forced service */ - _lws_plat_service_tsi(context, -1, pt->tid); - /* still somebody left who wants forced service? */ - if (!lws_service_adjust_timeout(context, 1, pt->tid)) - /* yes... come back again quickly */ - timeout_ms = 0; - } - - if (timeout_ms) { - lws_usec_t t; - - lws_pt_lock(pt, __func__); - /* don't stay in poll wait longer than next hr timeout */ - t = __lws_hrtimer_service(pt); - - if ((lws_usec_t)timeout_ms * 1000 > t) - timeout_ms = (int)(t / 1000); - lws_pt_unlock(pt); - } - - ev = WSAWaitForMultipleEvents(1, pt->events, FALSE, timeout_ms, FALSE); - if (ev == WSA_WAIT_EVENT_0) { - unsigned int eIdx, err; - - WSAResetEvent(pt->events[0]); - - if (pt->context->tls_ops && - pt->context->tls_ops->fake_POLLIN_for_buffered) - pt->context->tls_ops->fake_POLLIN_for_buffered(pt); - - for (eIdx = 0; eIdx < pt->fds_count; ++eIdx) { - if (WSAEnumNetworkEvents(pt->fds[eIdx].fd, 0, - &networkevents) == SOCKET_ERROR) { - lwsl_err("WSAEnumNetworkEvents() failed " - "with error %d\n", LWS_ERRNO); - return -1; - } - - pfd = &pt->fds[eIdx]; - pfd->revents = (short)networkevents.lNetworkEvents; - - err = networkevents.iErrorCode[FD_CONNECT_BIT]; - - if ((networkevents.lNetworkEvents & FD_CONNECT) && - err && err != LWS_EALREADY && - err != LWS_EINPROGRESS && err != LWS_EWOULDBLOCK && - err != WSAEINVAL) { - lwsl_debug("Unable to connect errno=%d\n", err); - pfd->revents |= LWS_POLLHUP; - } - - if (pfd->revents & LWS_POLLOUT) { - wsi = wsi_from_fd(context, pfd->fd); - if (wsi) - wsi->sock_send_blocking = 0; - } - /* if something closed, retry this slot */ - if (pfd->revents & LWS_POLLHUP) - --eIdx; - - if (pfd->revents) { - recv(pfd->fd, NULL, 0, 0); - lws_service_fd_tsi(context, pfd, tsi); - } - } - } - - context->service_tid = 0; - - if (ev == WSA_WAIT_TIMEOUT) - lws_service_fd(context, NULL); - - return 0; -} - -LWS_VISIBLE int -lws_plat_service(struct lws_context *context, int timeout_ms) -{ - return _lws_plat_service_tsi(context, timeout_ms, 0); -} - -LWS_VISIBLE int -lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd) -{ - int optval = 1; - int optlen = sizeof(optval); - u_long optl = 1; - DWORD dwBytesRet; - struct tcp_keepalive alive; - int protonbr; -#ifndef _WIN32_WCE - struct protoent *tcp_proto; -#endif - - if (vhost->ka_time) { - /* enable keepalive on this socket */ - optval = 1; - if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, - (const char *)&optval, optlen) < 0) - return 1; - - alive.onoff = TRUE; - alive.keepalivetime = vhost->ka_time; - alive.keepaliveinterval = vhost->ka_interval; - - if (WSAIoctl(fd, SIO_KEEPALIVE_VALS, &alive, sizeof(alive), - NULL, 0, &dwBytesRet, NULL, NULL)) - return 1; - } - - /* Disable Nagle */ - optval = 1; -#ifndef _WIN32_WCE - tcp_proto = getprotobyname("TCP"); - if (!tcp_proto) { - lwsl_err("getprotobyname() failed with error %d\n", LWS_ERRNO); - return 1; - } - protonbr = tcp_proto->p_proto; -#else - protonbr = 6; -#endif - - setsockopt(fd, protonbr, TCP_NODELAY, (const char *)&optval, optlen); - - /* We are nonblocking... */ - ioctlsocket(fd, FIONBIO, &optl); - - return 0; -} - -LWS_VISIBLE void -lws_plat_drop_app_privileges(const struct lws_context_creation_info *info) -{ -} - -LWS_VISIBLE int -lws_plat_context_early_init(void) -{ - WORD wVersionRequested; - WSADATA wsaData; - int err; - - /* Use the MAKEWORD(lowbyte, highbyte) macro from Windef.h */ - wVersionRequested = MAKEWORD(2, 2); - - err = WSAStartup(wVersionRequested, &wsaData); - if (!err) - return 0; - /* - * Tell the user that we could not find a usable - * Winsock DLL - */ - lwsl_err("WSAStartup failed with error: %d\n", err); - - return 1; -} - -LWS_VISIBLE void -lws_plat_context_early_destroy(struct lws_context *context) -{ - struct lws_context_per_thread *pt = &context->pt[0]; - int n = context->count_threads; - - while (n--) { - if (pt->events) { - WSACloseEvent(pt->events[0]); - lws_free(pt->events); - } - pt++; - } -} - -LWS_VISIBLE void -lws_plat_context_late_destroy(struct lws_context *context) -{ - int n; - - for (n = 0; n < FD_HASHTABLE_MODULUS; n++) { - if (context->fd_hashtable[n].wsi) - lws_free(context->fd_hashtable[n].wsi); - } - - WSACleanup(); -} - -LWS_VISIBLE LWS_EXTERN int -lws_interface_to_sa(int ipv6, - const char *ifname, struct sockaddr_in *addr, size_t addrlen) -{ -#ifdef LWS_WITH_IPV6 - struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr; - - if (ipv6) { - if (lws_plat_inet_pton(AF_INET6, ifname, &addr6->sin6_addr) == 1) { - return LWS_ITOSA_USABLE; - } - } -#endif - - long long address = inet_addr(ifname); - - if (address == INADDR_NONE) { - struct hostent *entry = gethostbyname(ifname); - if (entry) - address = ((struct in_addr *)entry->h_addr_list[0])->s_addr; - } - - if (address == INADDR_NONE) - return LWS_ITOSA_NOT_EXIST; - - addr->sin_addr.s_addr = (unsigned long)(lws_intptr_t)address; - - return LWS_ITOSA_USABLE; -} - -LWS_VISIBLE void -lws_plat_insert_socket_into_fds(struct lws_context *context, struct lws *wsi) -{ - struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; - - pt->fds[pt->fds_count++].revents = 0; - pt->events[pt->fds_count] = pt->events[0]; - WSAEventSelect(wsi->desc.sockfd, pt->events[0], - LWS_POLLIN | LWS_POLLHUP | FD_CONNECT); -} - -LWS_VISIBLE void -lws_plat_delete_socket_from_fds(struct lws_context *context, - struct lws *wsi, int m) -{ - struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; - - pt->events[m + 1] = pt->events[pt->fds_count--]; -} - -LWS_VISIBLE void -lws_plat_service_periodic(struct lws_context *context) -{ -} - -LWS_VISIBLE int -lws_plat_check_connection_error(struct lws *wsi) -{ - int optVal; - int optLen = sizeof(int); - - if (getsockopt(wsi->desc.sockfd, SOL_SOCKET, SO_ERROR, - (char*)&optVal, &optLen) != SOCKET_ERROR && optVal && - optVal != LWS_EALREADY && optVal != LWS_EINPROGRESS && - optVal != LWS_EWOULDBLOCK && optVal != WSAEINVAL) { - lwsl_debug("Connect failed SO_ERROR=%d\n", optVal); - return 1; - } - - return 0; -} - -LWS_VISIBLE int -lws_plat_change_pollfd(struct lws_context *context, - struct lws *wsi, struct lws_pollfd *pfd) -{ - struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; - long networkevents = LWS_POLLHUP | FD_CONNECT; - - if ((pfd->events & LWS_POLLIN)) - networkevents |= LWS_POLLIN; - - if ((pfd->events & LWS_POLLOUT)) - networkevents |= LWS_POLLOUT; - - if (WSAEventSelect(wsi->desc.sockfd, - pt->events[0], - networkevents) != SOCKET_ERROR) - return 0; - - lwsl_err("WSAEventSelect() failed with error %d\n", LWS_ERRNO); - - return 1; -} - -LWS_VISIBLE const char * -lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt) -{ - WCHAR *buffer; - DWORD bufferlen = cnt; - BOOL ok = FALSE; - - buffer = lws_malloc(bufferlen * 2, "inet_ntop"); - if (!buffer) { - lwsl_err("Out of memory\n"); - return NULL; - } - - if (af == AF_INET) { - struct sockaddr_in srcaddr; - bzero(&srcaddr, sizeof(srcaddr)); - srcaddr.sin_family = AF_INET; - memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr)); - - if (!WSAAddressToStringW((struct sockaddr*)&srcaddr, sizeof(srcaddr), 0, buffer, &bufferlen)) - ok = TRUE; -#ifdef LWS_WITH_IPV6 - } else if (af == AF_INET6) { - struct sockaddr_in6 srcaddr; - bzero(&srcaddr, sizeof(srcaddr)); - srcaddr.sin6_family = AF_INET6; - memcpy(&(srcaddr.sin6_addr), src, sizeof(srcaddr.sin6_addr)); - - if (!WSAAddressToStringW((struct sockaddr*)&srcaddr, sizeof(srcaddr), 0, buffer, &bufferlen)) - ok = TRUE; -#endif - } else - lwsl_err("Unsupported type\n"); - - if (!ok) { - int rv = WSAGetLastError(); - lwsl_err("WSAAddressToString() : %d\n", rv); - } else { - if (WideCharToMultiByte(CP_ACP, 0, buffer, bufferlen, dst, cnt, 0, NULL) <= 0) - ok = FALSE; - } - - lws_free(buffer); - return ok ? dst : NULL; -} - -LWS_VISIBLE int -lws_plat_inet_pton(int af, const char *src, void *dst) -{ - WCHAR *buffer; - DWORD bufferlen = (int)strlen(src) + 1; - BOOL ok = FALSE; - - buffer = lws_malloc(bufferlen * 2, "inet_pton"); - if (!buffer) { - lwsl_err("Out of memory\n"); - return -1; - } - - if (MultiByteToWideChar(CP_ACP, 0, src, bufferlen, buffer, bufferlen) <= 0) { - lwsl_err("Failed to convert multi byte to wide char\n"); - lws_free(buffer); - return -1; - } - - if (af == AF_INET) { - struct sockaddr_in dstaddr; - int dstaddrlen = sizeof(dstaddr); - bzero(&dstaddr, sizeof(dstaddr)); - dstaddr.sin_family = AF_INET; - - if (!WSAStringToAddressW(buffer, af, 0, (struct sockaddr *) &dstaddr, &dstaddrlen)) { - ok = TRUE; - memcpy(dst, &dstaddr.sin_addr, sizeof(dstaddr.sin_addr)); - } -#ifdef LWS_WITH_IPV6 - } else if (af == AF_INET6) { - struct sockaddr_in6 dstaddr; - int dstaddrlen = sizeof(dstaddr); - bzero(&dstaddr, sizeof(dstaddr)); - dstaddr.sin6_family = AF_INET6; - - if (!WSAStringToAddressW(buffer, af, 0, (struct sockaddr *) &dstaddr, &dstaddrlen)) { - ok = TRUE; - memcpy(dst, &dstaddr.sin6_addr, sizeof(dstaddr.sin6_addr)); - } -#endif - } else - lwsl_err("Unsupported type\n"); - - if (!ok) { - int rv = WSAGetLastError(); - lwsl_err("WSAAddressToString() : %d\n", rv); - } - - lws_free(buffer); - return ok ? 1 : -1; -} - -LWS_VISIBLE lws_fop_fd_t -_lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, - const char *vpath, lws_fop_flags_t *flags) -{ - HANDLE ret; - WCHAR buf[MAX_PATH]; - lws_fop_fd_t fop_fd; - FILE_STANDARD_INFO fInfo = {0}; - - MultiByteToWideChar(CP_UTF8, 0, filename, -1, buf, LWS_ARRAY_SIZE(buf)); - -#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0602 // Windows 8 (minimum when UWP_ENABLED, but can be used in Windows builds) - CREATEFILE2_EXTENDED_PARAMETERS extParams = {0}; - extParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; - - if (((*flags) & 7) == _O_RDONLY) { - ret = CreateFile2(buf, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, &extParams); - } else { - ret = CreateFile2(buf, GENERIC_WRITE, 0, CREATE_ALWAYS, &extParams); - } -#else - if (((*flags) & 7) == _O_RDONLY) { - ret = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - } else { - ret = CreateFileW(buf, GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - } -#endif - - if (ret == LWS_INVALID_FILE) - goto bail; - - fop_fd = malloc(sizeof(*fop_fd)); - if (!fop_fd) - goto bail; - - fop_fd->fops = fops; - fop_fd->fd = ret; - fop_fd->filesystem_priv = NULL; /* we don't use it */ - fop_fd->flags = *flags; - fop_fd->len = 0; - if(GetFileInformationByHandleEx(ret, FileStandardInfo, &fInfo, sizeof(fInfo))) - fop_fd->len = fInfo.EndOfFile.QuadPart; - - fop_fd->pos = 0; - - return fop_fd; - -bail: - return NULL; -} - -LWS_VISIBLE int -_lws_plat_file_close(lws_fop_fd_t *fop_fd) -{ - HANDLE fd = (*fop_fd)->fd; - - free(*fop_fd); - *fop_fd = NULL; - - CloseHandle((HANDLE)fd); - - return 0; -} - -LWS_VISIBLE lws_fileofs_t -_lws_plat_file_seek_cur(lws_fop_fd_t fop_fd, lws_fileofs_t offset) -{ - LARGE_INTEGER l; - - l.QuadPart = offset; - return SetFilePointerEx((HANDLE)fop_fd->fd, l, NULL, FILE_CURRENT); -} - -LWS_VISIBLE int -_lws_plat_file_read(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t *buf, lws_filepos_t len) -{ - DWORD _amount; - - if (!ReadFile((HANDLE)fop_fd->fd, buf, (DWORD)len, &_amount, NULL)) { - *amount = 0; - - return 1; - } - - fop_fd->pos += _amount; - *amount = (unsigned long)_amount; - - return 0; -} - -LWS_VISIBLE int -_lws_plat_file_write(lws_fop_fd_t fop_fd, lws_filepos_t *amount, - uint8_t* buf, lws_filepos_t len) -{ - DWORD _amount; - - if (!WriteFile((HANDLE)fop_fd->fd, buf, (DWORD)len, &_amount, NULL)) { - *amount = 0; - - return 1; - } - - fop_fd->pos += _amount; - *amount = (unsigned long)_amount; - - return 0; -} - -LWS_VISIBLE int -lws_plat_init(struct lws_context *context, - const struct lws_context_creation_info *info) -{ - struct lws_context_per_thread *pt = &context->pt[0]; - int i, n = context->count_threads; - - for (i = 0; i < FD_HASHTABLE_MODULUS; i++) { - context->fd_hashtable[i].wsi = - lws_zalloc(sizeof(struct lws*) * context->max_fds, "win hashtable"); - - if (!context->fd_hashtable[i].wsi) - return -1; - } - - while (n--) { - pt->events = lws_malloc(sizeof(WSAEVENT) * - (context->fd_limit_per_thread + 1), "event table"); - if (pt->events == NULL) { - lwsl_err("Unable to allocate events array for %d connections\n", - context->fd_limit_per_thread + 1); - return 1; - } - - pt->fds_count = 0; - pt->events[0] = WSACreateEvent(); /* the cancel event */ - - pt++; - } - - context->fd_random = 0; - -#ifdef LWS_WITH_PLUGINS - if (info->plugin_dirs) - lws_plat_plugins_init(context, info->plugin_dirs); -#endif - - return 0; -} - - -int kill(int pid, int sig) -{ - lwsl_err("Sorry Windows doesn't support kill()."); - exit(0); -} - -int fork(void) -{ - lwsl_err("Sorry Windows doesn't support fork()."); - exit(0); -} - -LWS_VISIBLE int -lws_plat_write_cert(struct lws_vhost *vhost, int is_key, int fd, void *buf, - int len) -{ - int n; - - n = write(fd, buf, len); - - lseek(fd, 0, SEEK_SET); - - return n != len; -} - -LWS_VISIBLE int -lws_plat_write_file(const char *filename, void *buf, int len) -{ - int m, fd; - - fd = lws_open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600); - - if (fd == -1) - return -1; - - m = write(fd, buf, len); - close(fd); - - return m != len; -} - -LWS_VISIBLE int -lws_plat_read_file(const char *filename, void *buf, int len) -{ - int n, fd = lws_open(filename, O_RDONLY); - if (fd == -1) - return -1; - - n = read(fd, buf, len); - close(fd); - - return n; -} - -LWS_VISIBLE int -lws_plat_recommended_rsa_bits(void) -{ - return 4096; -} diff --git a/thirdparty/libwebsockets/roles/http/server/access-log.c b/thirdparty/libwebsockets/roles/http/server/access-log.c deleted file mode 100644 index 0e75309d7a..0000000000 --- a/thirdparty/libwebsockets/roles/http/server/access-log.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * libwebsockets - server access log handling - * - * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation: - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -#include "core/private.h" - -/* - * Produce Apache-compatible log string for wsi, like this: - * - * 2.31.234.19 - - [27/Mar/2016:03:22:44 +0800] - * "GET /aep-screen.png HTTP/1.1" - * 200 152987 "https://libwebsockets.org/index.html" - * "Mozilla/5.0 (Macint... Chrome/49.0.2623.87 Safari/537.36" - * - */ - -extern const char * const method_names[]; - -static const char * const hver[] = { - "HTTP/1.0", "HTTP/1.1", "HTTP/2" -}; - -void -lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth) -{ -#ifdef LWS_WITH_IPV6 - char ads[INET6_ADDRSTRLEN]; -#else - char ads[INET_ADDRSTRLEN]; -#endif - char da[64]; - const char *pa, *me; - struct tm *tmp; - time_t t = time(NULL); - int l = 256, m; - - if (!wsi->vhost) - return; - - /* only worry about preparing it if we store it */ - if (wsi->vhost->log_fd == (int)LWS_INVALID_FILE) - return; - - if (wsi->access_log_pending) - lws_access_log(wsi); - - wsi->http.access_log.header_log = lws_malloc(l, "access log"); - if (wsi->http.access_log.header_log) { - - tmp = localtime(&t); - if (tmp) - strftime(da, sizeof(da), "%d/%b/%Y:%H:%M:%S %z", tmp); - else - strcpy(da, "01/Jan/1970:00:00:00 +0000"); - - pa = lws_get_peer_simple(wsi, ads, sizeof(ads)); - if (!pa) - pa = "(unknown)"; - - if (wsi->http2_substream) - me = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_COLON_METHOD); - else - me = method_names[meth]; - if (!me) - me = "(null)"; - - lws_snprintf(wsi->http.access_log.header_log, l, - "%s - - [%s] \"%s %s %s\"", - pa, da, me, uri_ptr, - hver[wsi->http.request_version]); - - l = lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_USER_AGENT); - if (l) { - wsi->http.access_log.user_agent = lws_malloc(l + 2, "access log"); - if (!wsi->http.access_log.user_agent) { - lwsl_err("OOM getting user agent\n"); - lws_free_set_NULL(wsi->http.access_log.header_log); - return; - } - - lws_hdr_copy(wsi, wsi->http.access_log.user_agent, - l + 1, WSI_TOKEN_HTTP_USER_AGENT); - - for (m = 0; m < l; m++) - if (wsi->http.access_log.user_agent[m] == '\"') - wsi->http.access_log.user_agent[m] = '\''; - } - l = lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_REFERER); - if (l) { - wsi->http.access_log.referrer = lws_malloc(l + 2, "referrer"); - if (!wsi->http.access_log.referrer) { - lwsl_err("OOM getting user agent\n"); - lws_free_set_NULL(wsi->http.access_log.user_agent); - lws_free_set_NULL(wsi->http.access_log.header_log); - return; - } - lws_hdr_copy(wsi, wsi->http.access_log.referrer, - l + 1, WSI_TOKEN_HTTP_REFERER); - - for (m = 0; m < l; m++) - if (wsi->http.access_log.referrer[m] == '\"') - wsi->http.access_log.referrer[m] = '\''; - } - wsi->access_log_pending = 1; - } -} - - -int -lws_access_log(struct lws *wsi) -{ - char *p = wsi->http.access_log.user_agent, ass[512], - *p1 = wsi->http.access_log.referrer; - int l; - - if (!wsi->vhost) - return 0; - - if (wsi->vhost->log_fd == (int)LWS_INVALID_FILE) - return 0; - - if (!wsi->access_log_pending) - return 0; - - if (!wsi->http.access_log.header_log) - return 0; - - if (!p) - p = ""; - - if (!p1) - p1 = ""; - - /* - * We do this in two parts to restrict an oversize referrer such that - * we will always have space left to append an empty useragent, while - * maintaining the structure of the log text - */ - l = lws_snprintf(ass, sizeof(ass) - 7, "%s %d %lu \"%s", - wsi->http.access_log.header_log, - wsi->http.access_log.response, wsi->http.access_log.sent, p1); - if (strlen(p) > sizeof(ass) - 6 - l) - p[sizeof(ass) - 6 - l] = '\0'; - l += lws_snprintf(ass + l, sizeof(ass) - 1 - l, "\" \"%s\"\n", p); - - if (write(wsi->vhost->log_fd, ass, l) != l) - lwsl_err("Failed to write log\n"); - - if (wsi->http.access_log.header_log) { - lws_free(wsi->http.access_log.header_log); - wsi->http.access_log.header_log = NULL; - } - if (wsi->http.access_log.user_agent) { - lws_free(wsi->http.access_log.user_agent); - wsi->http.access_log.user_agent = NULL; - } - if (wsi->http.access_log.referrer) { - lws_free(wsi->http.access_log.referrer); - wsi->http.access_log.referrer = NULL; - } - wsi->access_log_pending = 0; - - return 0; -} - diff --git a/thirdparty/libwebsockets/uwp_fixes.diff b/thirdparty/libwebsockets/uwp_fixes.diff index 21c3275bba..3350f2a661 100644 --- a/thirdparty/libwebsockets/uwp_fixes.diff +++ b/thirdparty/libwebsockets/uwp_fixes.diff @@ -1,8 +1,8 @@ -diff --git a/thirdparty/libwebsockets/plat/lws-plat-win.c b/thirdparty/libwebsockets/plat/lws-plat-win.c -index bd513b494..1850b6425 100644 ---- a/thirdparty/libwebsockets/plat/lws-plat-win.c -+++ b/thirdparty/libwebsockets/plat/lws-plat-win.c -@@ -641,9 +641,20 @@ _lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, +diff --git a/thirdparty/libwebsockets/lib/plat/windows/windows-file.c b/thirdparty/libwebsockets/lib/plat/windows/windows-file.c +index 6516b70b0..eb73aab7f 100644 +--- a/thirdparty/libwebsockets/lib/plat/windows/windows-file.c ++++ b/thirdparty/libwebsockets/lib/plat/windows/windows-file.c +@@ -36,9 +36,20 @@ _lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, HANDLE ret; WCHAR buf[MAX_PATH]; lws_fop_fd_t fop_fd; @@ -24,7 +24,7 @@ index bd513b494..1850b6425 100644 if (((*flags) & 7) == _O_RDONLY) { ret = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); -@@ -651,6 +662,7 @@ _lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, +@@ -46,6 +57,7 @@ _lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, ret = CreateFileW(buf, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); } @@ -32,7 +32,7 @@ index bd513b494..1850b6425 100644 if (ret == LWS_INVALID_FILE) goto bail; -@@ -663,9 +675,9 @@ _lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, +@@ -58,9 +70,9 @@ _lws_plat_file_open(const struct lws_plat_file_ops *fops, const char *filename, fop_fd->fd = ret; fop_fd->filesystem_priv = NULL; /* we don't use it */ fop_fd->flags = *flags; diff --git a/thirdparty/libwebsockets/win32helpers/getopt.c b/thirdparty/libwebsockets/win32helpers/getopt.c index 3bb21f6f28..2181f1cb12 100644 --- a/thirdparty/libwebsockets/win32helpers/getopt.c +++ b/thirdparty/libwebsockets/win32helpers/getopt.c @@ -1,153 +1,153 @@ -/* $NetBSD: getopt.c,v 1.16 1999/12/02 13:15:56 kleink Exp $ */ - -/* - * Copyright (c) 1987, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; -#endif - -#include <assert.h> -#include <errno.h> -#include <stdio.h> -#include <string.h> - -#define __P(x) x -#define _DIAGASSERT(x) assert(x) - -#ifdef __weak_alias -__weak_alias(getopt,_getopt); -#endif - - -int opterr = 1, /* if error message should be printed */ - optind = 1, /* index into parent argv vector */ - optopt, /* character checked for validity */ - optreset; /* reset getopt */ -char *optarg; /* argument associated with option */ - -static char * _progname __P((char *)); -int getopt_internal __P((int, char * const *, const char *)); - -static char * -_progname(nargv0) - char * nargv0; -{ - char * tmp; - - _DIAGASSERT(nargv0 != NULL); - - tmp = strrchr(nargv0, '/'); - if (tmp) - tmp++; - else - tmp = nargv0; - return(tmp); -} - -#define BADCH (int)'?' -#define BADARG (int)':' -#define EMSG "" - -/* - * getopt -- - * Parse argc/argv argument vector. - */ -int -getopt(nargc, nargv, ostr) - int nargc; - char * const nargv[]; - const char *ostr; -{ - static char *__progname = 0; - static char *place = EMSG; /* option letter processing */ - char *oli; /* option letter list index */ - __progname = __progname?__progname:_progname(*nargv); - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(ostr != NULL); - - if (optreset || !*place) { /* update scanning pointer */ - optreset = 0; - if (optind >= nargc || *(place = nargv[optind]) != '-') { - place = EMSG; - return (-1); - } - if (place[1] && *++place == '-' /* found "--" */ - && place[1] == '\0') { - ++optind; - place = EMSG; - return (-1); - } - } /* option letter okay? */ - if ((optopt = (int)*place++) == (int)':' || - !(oli = strchr(ostr, optopt))) { - /* - * if the user didn't specify '-' as an option, - * assume it means -1. - */ - if (optopt == (int)'-') - return (-1); - if (!*place) - ++optind; - if (opterr && *ostr != ':') - (void)fprintf(stderr, - "%s: illegal option -- %c\n", __progname, optopt); - return (BADCH); - } - if (*++oli != ':') { /* don't need argument */ - optarg = NULL; - if (!*place) - ++optind; - } - else { /* need an argument */ - if (*place) /* no white space */ - optarg = place; - else if (nargc <= ++optind) { /* no arg */ - place = EMSG; - if (*ostr == ':') - return (BADARG); - if (opterr) - (void)fprintf(stderr, - "%s: option requires an argument -- %c\n", - __progname, optopt); - return (BADCH); - } - else /* white space */ - optarg = nargv[optind]; - place = EMSG; - ++optind; - } - return (optopt); /* dump back option letter */ -} - +/* $NetBSD: getopt.c,v 1.16 1999/12/02 13:15:56 kleink Exp $ */
+
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if 0
+static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
+#endif
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#define __P(x) x
+#define _DIAGASSERT(x) assert(x)
+
+#ifdef __weak_alias
+__weak_alias(getopt,_getopt);
+#endif
+
+
+int opterr = 1, /* if error message should be printed */
+ optind = 1, /* index into parent argv vector */
+ optopt, /* character checked for validity */
+ optreset; /* reset getopt */
+char *optarg; /* argument associated with option */
+
+static char * _progname __P((char *));
+int getopt_internal __P((int, char * const *, const char *));
+
+static char *
+_progname(nargv0)
+ char * nargv0;
+{
+ char * tmp;
+
+ _DIAGASSERT(nargv0 != NULL);
+
+ tmp = strrchr(nargv0, '/');
+ if (tmp)
+ tmp++;
+ else
+ tmp = nargv0;
+ return(tmp);
+}
+
+#define BADCH (int)'?'
+#define BADARG (int)':'
+#define EMSG ""
+
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt(nargc, nargv, ostr)
+ int nargc;
+ char * const nargv[];
+ const char *ostr;
+{
+ static char *__progname = 0;
+ static char *place = EMSG; /* option letter processing */
+ char *oli; /* option letter list index */
+ __progname = __progname?__progname:_progname(*nargv);
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(ostr != NULL);
+
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc || *(place = nargv[optind]) != '-') {
+ place = EMSG;
+ return (-1);
+ }
+ if (place[1] && *++place == '-' /* found "--" */
+ && place[1] == '\0') {
+ ++optind;
+ place = EMSG;
+ return (-1);
+ }
+ } /* option letter okay? */
+ if ((optopt = (int)*place++) == (int)':' ||
+ !(oli = strchr(ostr, optopt))) {
+ /*
+ * if the user didn't specify '-' as an option,
+ * assume it means -1.
+ */
+ if (optopt == (int)'-')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (opterr && *ostr != ':')
+ (void)fprintf(stderr,
+ "%s: illegal option -- %c\n", __progname, optopt);
+ return (BADCH);
+ }
+ if (*++oli != ':') { /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
+ }
+ else { /* need an argument */
+ if (*place) /* no white space */
+ optarg = place;
+ else if (nargc <= ++optind) { /* no arg */
+ place = EMSG;
+ if (*ostr == ':')
+ return (BADARG);
+ if (opterr)
+ (void)fprintf(stderr,
+ "%s: option requires an argument -- %c\n",
+ __progname, optopt);
+ return (BADCH);
+ }
+ else /* white space */
+ optarg = nargv[optind];
+ place = EMSG;
+ ++optind;
+ }
+ return (optopt); /* dump back option letter */
+}
+
diff --git a/thirdparty/libwebsockets/win32helpers/getopt_long.c b/thirdparty/libwebsockets/win32helpers/getopt_long.c index 6dfccf367d..22e5fa8945 100644 --- a/thirdparty/libwebsockets/win32helpers/getopt_long.c +++ b/thirdparty/libwebsockets/win32helpers/getopt_long.c @@ -1,240 +1,240 @@ - -/* - * Copyright (c) 1987, 1993, 1994, 1996 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include <assert.h> -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "getopt.h" - -#define lws_ptr_diff(head, tail) \ - ((int)((char *)(head) - (char *)(tail))) - -extern int opterr; /* if error message should be printed */ -extern int optind; /* index into parent argv vector */ -extern int optopt; /* character checked for validity */ -extern int optreset; /* reset getopt */ -extern char *optarg; /* argument associated with option */ - -#define __P(x) x -#define _DIAGASSERT(x) assert(x) - -static char * __progname __P((char *)); -int getopt_internal __P((int, char * const *, const char *)); - -static char * -__progname(nargv0) - char * nargv0; -{ - char * tmp; - - _DIAGASSERT(nargv0 != NULL); - - tmp = strrchr(nargv0, '/'); - if (tmp) - tmp++; - else - tmp = nargv0; - return(tmp); -} - -#define BADCH (int)'?' -#define BADARG (int)':' -#define EMSG "" - -/* - * getopt -- - * Parse argc/argv argument vector. - */ -int -getopt_internal(nargc, nargv, ostr) - int nargc; - char * const *nargv; - const char *ostr; -{ - static char *place = EMSG; /* option letter processing */ - char *oli; /* option letter list index */ - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(ostr != NULL); - - if (optreset || !*place) { /* update scanning pointer */ - optreset = 0; - if (optind >= nargc || *(place = nargv[optind]) != '-') { - place = EMSG; - return (-1); - } - if (place[1] && *++place == '-') { /* found "--" */ - /* ++optind; */ - place = EMSG; - return (-2); - } - } /* option letter okay? */ - if ((optopt = (int)*place++) == (int)':' || - !(oli = strchr(ostr, optopt))) { - /* - * if the user didn't specify '-' as an option, - * assume it means -1. - */ - if (optopt == (int)'-') - return (-1); - if (!*place) - ++optind; - if (opterr && *ostr != ':') - (void)fprintf(stderr, - "%s: illegal option -- %c\n", __progname(nargv[0]), optopt); - return (BADCH); - } - if (*++oli != ':') { /* don't need argument */ - optarg = NULL; - if (!*place) - ++optind; - } else { /* need an argument */ - if (*place) /* no white space */ - optarg = place; - else if (nargc <= ++optind) { /* no arg */ - place = EMSG; - if ((opterr) && (*ostr != ':')) - (void)fprintf(stderr, - "%s: option requires an argument -- %c\n", - __progname(nargv[0]), optopt); - return (BADARG); - } else /* white space */ - optarg = nargv[optind]; - place = EMSG; - ++optind; - } - return (optopt); /* dump back option letter */ -} - -#if 0 -/* - * getopt -- - * Parse argc/argv argument vector. - */ -int -getopt2(nargc, nargv, ostr) - int nargc; - char * const *nargv; - const char *ostr; -{ - int retval; - - if ((retval = getopt_internal(nargc, nargv, ostr)) == -2) { - retval = -1; - ++optind; - } - return(retval); -} -#endif - -/* - * getopt_long -- - * Parse argc/argv argument vector. - */ -int -getopt_long(nargc, nargv, options, long_options, index) - int nargc; - char ** nargv; - char * options; - struct option * long_options; - int * index; -{ - int retval; - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(options != NULL); - _DIAGASSERT(long_options != NULL); - /* index may be NULL */ - - if ((retval = getopt_internal(nargc, nargv, options)) == -2) { - char *current_argv = nargv[optind++] + 2, *has_equal; - int i, current_argv_len, match = -1; - - if (*current_argv == '\0') { - return(-1); - } - if ((has_equal = strchr(current_argv, '=')) != NULL) { - current_argv_len = lws_ptr_diff(has_equal, current_argv); - has_equal++; - } else - current_argv_len = (int)strlen(current_argv); - - for (i = 0; long_options[i].name; i++) { - if (strncmp(current_argv, long_options[i].name, current_argv_len)) - continue; - - if (strlen(long_options[i].name) == (unsigned)current_argv_len) { - match = i; - break; - } - if (match == -1) - match = i; - } - if (match != -1) { - if (long_options[match].has_arg == required_argument || - long_options[match].has_arg == optional_argument) { - if (has_equal) - optarg = has_equal; - else - optarg = nargv[optind++]; - } - if ((long_options[match].has_arg == required_argument) - && (optarg == NULL)) { - /* - * Missing argument, leading : - * indicates no error should be generated - */ - if ((opterr) && (*options != ':')) - (void)fprintf(stderr, - "%s: option requires an argument -- %s\n", - __progname(nargv[0]), current_argv); - return (BADARG); - } - } else { /* No matching argument */ - if ((opterr) && (*options != ':')) - (void)fprintf(stderr, - "%s: illegal option -- %s\n", __progname(nargv[0]), current_argv); - return (BADCH); - } - if (long_options[match].flag) { - *long_options[match].flag = long_options[match].val; - retval = 0; - } else - retval = long_options[match].val; - if (index) - *index = match; - } - return(retval); -} +
+/*
+ * Copyright (c) 1987, 1993, 1994, 1996
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "getopt.h"
+
+#define lws_ptr_diff(head, tail) \
+ ((int)((char *)(head) - (char *)(tail)))
+
+extern int opterr; /* if error message should be printed */
+extern int optind; /* index into parent argv vector */
+extern int optopt; /* character checked for validity */
+extern int optreset; /* reset getopt */
+extern char *optarg; /* argument associated with option */
+
+#define __P(x) x
+#define _DIAGASSERT(x) assert(x)
+
+static char * __progname __P((char *));
+int getopt_internal __P((int, char * const *, const char *));
+
+static char *
+__progname(nargv0)
+ char * nargv0;
+{
+ char * tmp;
+
+ _DIAGASSERT(nargv0 != NULL);
+
+ tmp = strrchr(nargv0, '/');
+ if (tmp)
+ tmp++;
+ else
+ tmp = nargv0;
+ return(tmp);
+}
+
+#define BADCH (int)'?'
+#define BADARG (int)':'
+#define EMSG ""
+
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt_internal(nargc, nargv, ostr)
+ int nargc;
+ char * const *nargv;
+ const char *ostr;
+{
+ static char *place = EMSG; /* option letter processing */
+ char *oli; /* option letter list index */
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(ostr != NULL);
+
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc || *(place = nargv[optind]) != '-') {
+ place = EMSG;
+ return (-1);
+ }
+ if (place[1] && *++place == '-') { /* found "--" */
+ /* ++optind; */
+ place = EMSG;
+ return (-2);
+ }
+ } /* option letter okay? */
+ if ((optopt = (int)*place++) == (int)':' ||
+ !(oli = strchr(ostr, optopt))) {
+ /*
+ * if the user didn't specify '-' as an option,
+ * assume it means -1.
+ */
+ if (optopt == (int)'-')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (opterr && *ostr != ':')
+ (void)fprintf(stderr,
+ "%s: illegal option -- %c\n", __progname(nargv[0]), optopt);
+ return (BADCH);
+ }
+ if (*++oli != ':') { /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
+ } else { /* need an argument */
+ if (*place) /* no white space */
+ optarg = place;
+ else if (nargc <= ++optind) { /* no arg */
+ place = EMSG;
+ if ((opterr) && (*ostr != ':'))
+ (void)fprintf(stderr,
+ "%s: option requires an argument -- %c\n",
+ __progname(nargv[0]), optopt);
+ return (BADARG);
+ } else /* white space */
+ optarg = nargv[optind];
+ place = EMSG;
+ ++optind;
+ }
+ return (optopt); /* dump back option letter */
+}
+
+#if 0
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt2(nargc, nargv, ostr)
+ int nargc;
+ char * const *nargv;
+ const char *ostr;
+{
+ int retval;
+
+ if ((retval = getopt_internal(nargc, nargv, ostr)) == -2) {
+ retval = -1;
+ ++optind;
+ }
+ return(retval);
+}
+#endif
+
+/*
+ * getopt_long --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt_long(nargc, nargv, options, long_options, index)
+ int nargc;
+ char ** nargv;
+ char * options;
+ struct option * long_options;
+ int * index;
+{
+ int retval;
+
+ _DIAGASSERT(nargv != NULL);
+ _DIAGASSERT(options != NULL);
+ _DIAGASSERT(long_options != NULL);
+ /* index may be NULL */
+
+ if ((retval = getopt_internal(nargc, nargv, options)) == -2) {
+ char *current_argv = nargv[optind++] + 2, *has_equal;
+ int i, current_argv_len, match = -1;
+
+ if (*current_argv == '\0') {
+ return(-1);
+ }
+ if ((has_equal = strchr(current_argv, '=')) != NULL) {
+ current_argv_len = lws_ptr_diff(has_equal, current_argv);
+ has_equal++;
+ } else
+ current_argv_len = (int)strlen(current_argv);
+
+ for (i = 0; long_options[i].name; i++) {
+ if (strncmp(current_argv, long_options[i].name, current_argv_len))
+ continue;
+
+ if (strlen(long_options[i].name) == (unsigned)current_argv_len) {
+ match = i;
+ break;
+ }
+ if (match == -1)
+ match = i;
+ }
+ if (match != -1) {
+ if (long_options[match].has_arg == required_argument ||
+ long_options[match].has_arg == optional_argument) {
+ if (has_equal)
+ optarg = has_equal;
+ else
+ optarg = nargv[optind++];
+ }
+ if ((long_options[match].has_arg == required_argument)
+ && (optarg == NULL)) {
+ /*
+ * Missing argument, leading :
+ * indicates no error should be generated
+ */
+ if ((opterr) && (*options != ':'))
+ (void)fprintf(stderr,
+ "%s: option requires an argument -- %s\n",
+ __progname(nargv[0]), current_argv);
+ return (BADARG);
+ }
+ } else { /* No matching argument */
+ if ((opterr) && (*options != ':'))
+ (void)fprintf(stderr,
+ "%s: illegal option -- %s\n", __progname(nargv[0]), current_argv);
+ return (BADCH);
+ }
+ if (long_options[match].flag) {
+ *long_options[match].flag = long_options[match].val;
+ retval = 0;
+ } else
+ retval = long_options[match].val;
+ if (index)
+ *index = match;
+ }
+ return(retval);
+}
diff --git a/thirdparty/libwebsockets/win32helpers/gettimeofday.c b/thirdparty/libwebsockets/win32helpers/gettimeofday.c index 35dd73531d..08385c2320 100644 --- a/thirdparty/libwebsockets/win32helpers/gettimeofday.c +++ b/thirdparty/libwebsockets/win32helpers/gettimeofday.c @@ -1,36 +1,36 @@ -#include <time.h> -#include <windows.h> //I've omitted context line - -#include "gettimeofday.h" - -int gettimeofday(struct timeval *tv, struct timezone *tz) -{ - FILETIME ft; - unsigned __int64 tmpres = 0; - static int tzflag; - - if (NULL != tv) { - GetSystemTimeAsFileTime(&ft); - - tmpres |= ft.dwHighDateTime; - tmpres <<= 32; - tmpres |= ft.dwLowDateTime; - - /*converting file time to unix epoch*/ - tmpres /= 10; /*convert into microseconds*/ +#include <time.h>
+#include <windows.h> //I've omitted context line
+
+#include "gettimeofday.h"
+
+int gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+ FILETIME ft;
+ unsigned __int64 tmpres = 0;
+ static int tzflag;
+
+ if (NULL != tv) {
+ GetSystemTimeAsFileTime(&ft);
+
+ tmpres |= ft.dwHighDateTime;
+ tmpres <<= 32;
+ tmpres |= ft.dwLowDateTime;
+
+ /*converting file time to unix epoch*/
+ tmpres /= 10; /*convert into microseconds*/
tmpres -= DELTA_EPOCH_IN_MICROSECS; - tv->tv_sec = (long)(tmpres / 1000000UL); - tv->tv_usec = (long)(tmpres % 1000000UL); - } - - if (NULL != tz) { - if (!tzflag) { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - - return 0; -} + tv->tv_sec = (long)(tmpres / 1000000UL);
+ tv->tv_usec = (long)(tmpres % 1000000UL);
+ }
+
+ if (NULL != tz) {
+ if (!tzflag) {
+ _tzset();
+ tzflag++;
+ }
+ tz->tz_minuteswest = _timezone / 60;
+ tz->tz_dsttime = _daylight;
+ }
+
+ return 0;
+}
diff --git a/thirdparty/misc/stb_truetype.h b/thirdparty/misc/stb_truetype.h index e2efae2285..72299ea86d 100644 --- a/thirdparty/misc/stb_truetype.h +++ b/thirdparty/misc/stb_truetype.h @@ -1,4 +1,4 @@ -// stb_truetype.h - v1.19 - public domain +// stb_truetype.h - v1.21 - public domain // authored from 2009-2016 by Sean Barrett / RAD Game Tools // // This library processes TrueType files: @@ -49,6 +49,8 @@ // // VERSION HISTORY // +// 1.21 (2019-02-25) fix warning +// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics() // 1.19 (2018-02-11) GPOS kerning, STBTT_fmod // 1.18 (2018-01-29) add missing function // 1.17 (2017-07-23) make more arguments const; doc fix @@ -75,7 +77,7 @@ // // USAGE // -// Include this file in whatever places neeed to refer to it. In ONE C/C++ +// Include this file in whatever places need to refer to it. In ONE C/C++ // file, write: // #define STB_TRUETYPE_IMPLEMENTATION // before the #include of this file. This expands out the actual @@ -242,19 +244,6 @@ // recommend it. // // -// SOURCE STATISTICS (based on v0.6c, 2050 LOC) -// -// Documentation & header file 520 LOC \___ 660 LOC documentation -// Sample code 140 LOC / -// Truetype parsing 620 LOC ---- 620 LOC TrueType -// Software rasterization 240 LOC \ . -// Curve tesselation 120 LOC \__ 550 LOC Bitmap creation -// Bitmap management 100 LOC / -// Baked bitmap interface 70 LOC / -// Font name matching & access 150 LOC ---- 150 -// C runtime library abstraction 60 LOC ---- 60 -// -// // PERFORMANCE MEASUREMENTS FOR 1.06: // // 32-bit 64-bit @@ -556,6 +545,8 @@ STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int p // // It's inefficient; you might want to c&p it and optimize it. +STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap); +// Query the font vertical metrics without having to create a font first. ////////////////////////////////////////////////////////////////////////////// @@ -641,6 +632,12 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h // To use with PackFontRangesGather etc., you must set it before calls // call to PackFontRangesGatherRects. +STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip); +// If skip != 0, this tells stb_truetype to skip any codepoints for which +// there is no corresponding glyph. If skip=0, which is the default, then +// codepoints without a glyph recived the font's "missing character" glyph, +// typically an empty box by convention. + STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above int char_index, // character to display float *xpos, float *ypos, // pointers to current position in screen pixel space @@ -669,6 +666,7 @@ struct stbtt_pack_context { int height; int stride_in_bytes; int padding; + int skip_missing; unsigned int h_oversample, v_oversample; unsigned char *pixels; void *nodes; @@ -694,7 +692,7 @@ STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); // file will only define one font and it always be at offset 0, so it will // return '0' for index 0, and -1 for all other indices. -// The following structure is defined publically so you can declare one on +// The following structure is defined publicly so you can declare one on // the stack or as a global or etc, but you should treat it as opaque. struct stbtt_fontinfo { @@ -733,6 +731,7 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codep // and you want a speed-up, call this function with the character you're // going to process, then use glyph-based functions instead of the // codepoint-based functions. +// Returns 0 if the character codepoint is not defined in the font. ////////////////////////////////////////////////////////////////////////////// @@ -820,7 +819,7 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s // returns # of vertices and fills *vertices with the pointer to them // these are expressed in "unscaled" coordinates // -// The shape is a series of countours. Each one starts with +// The shape is a series of contours. Each one starts with // a STBTT_moveto, then consists of a series of mixed // STBTT_lineto and STBTT_curveto segments. A lineto // draws a line from previous endpoint to its x,y; a curveto @@ -916,7 +915,7 @@ STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float sc STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); // These functions compute a discretized SDF field for a single character, suitable for storing // in a single-channel texture, sampling with bilinear filtering, and testing against -// larger than some threshhold to produce scalable fonts. +// larger than some threshold to produce scalable fonts. // info -- the font // scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap // glyph/codepoint -- the character to generate the SDF for @@ -2463,6 +2462,7 @@ static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, i if (valueFormat2 != 0) return 0; STBTT_assert(coverageIndex < pairSetCount); + STBTT__NOTUSED(pairSetCount); needle=glyph2; r=pairValueCount-1; @@ -3160,7 +3160,13 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, if (e->y0 != e->y1) { stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); if (z != NULL) { - STBTT_assert(z->ey >= scan_y_top); + if (j == 0 && off_y != 0) { + if (z->ey < scan_y_top) { + // this can happen due to subpixel positioning and some kind of fp rounding error i think + z->ey = scan_y_top; + } + } + STBTT_assert(z->ey >= scan_y_top); // if we get really unlucky a tiny bit of an edge can be out of bounds // insert at front z->next = active; active = z; @@ -3229,7 +3235,7 @@ static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n) static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n) { - /* threshhold for transitioning to insertion sort */ + /* threshold for transitioning to insertion sort */ while (n > 12) { stbtt__edge t; int c01,c12,c,m,i,j; @@ -3364,7 +3370,7 @@ static void stbtt__add_point(stbtt__point *points, int n, float x, float y) points[n].y = y; } -// tesselate until threshhold p is happy... @TODO warped to compensate for non-linear stretching +// tessellate until threshold p is happy... @TODO warped to compensate for non-linear stretching static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) { // midpoint @@ -3789,6 +3795,7 @@ STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, in spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw; spc->h_oversample = 1; spc->v_oversample = 1; + spc->skip_missing = 0; stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); @@ -3814,6 +3821,11 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h spc->v_oversample = v_oversample; } +STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip) +{ + spc->skip_missing = skip; +} + #define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1) static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) @@ -3967,13 +3979,17 @@ STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stb int x0,y0,x1,y1; int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; int glyph = stbtt_FindGlyphIndex(info, codepoint); - stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, - scale * spc->h_oversample, - scale * spc->v_oversample, - 0,0, - &x0,&y0,&x1,&y1); - rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); - rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); + if (glyph == 0 && spc->skip_missing) { + rects[k].w = rects[k].h = 0; + } else { + stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, + scale * spc->h_oversample, + scale * spc->v_oversample, + 0,0, + &x0,&y0,&x1,&y1); + rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); + rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); + } ++k; } } @@ -4026,7 +4042,7 @@ STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const sub_y = stbtt__oversample_shift(spc->v_oversample); for (j=0; j < ranges[i].num_chars; ++j) { stbrp_rect *r = &rects[k]; - if (r->was_packed) { + if (r->was_packed && r->w != 0 && r->h != 0) { stbtt_packedchar *bc = &ranges[i].chardata_for_range[j]; int advance, lsb, x0,y0,x1,y1; int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; @@ -4140,6 +4156,19 @@ STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char * return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); } +STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap) +{ + int i_ascent, i_descent, i_lineGap; + float scale; + stbtt_fontinfo info; + stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata, index)); + scale = size > 0 ? stbtt_ScaleForPixelHeight(&info, size) : stbtt_ScaleForMappingEmToPixels(&info, -size); + stbtt_GetFontVMetrics(&info, &i_ascent, &i_descent, &i_lineGap); + *ascent = (float) i_ascent * scale; + *descent = (float) i_descent * scale; + *lineGap = (float) i_lineGap * scale; +} + STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer) { float ipw = 1.0f / pw, iph = 1.0f / ph; diff --git a/thirdparty/misc/stb_vorbis.c b/thirdparty/misc/stb_vorbis.c index 8edcf0f38a..88276026ef 100644 --- a/thirdparty/misc/stb_vorbis.c +++ b/thirdparty/misc/stb_vorbis.c @@ -1,4 +1,4 @@ -// Ogg Vorbis audio decoder - v1.14 - public domain +// Ogg Vorbis audio decoder - v1.15 - public domain // http://nothings.org/stb_vorbis/ // // Original version written by Sean Barrett in 2007. @@ -33,6 +33,7 @@ // Timur Gagiev // // Partial history: +// 1.15 - 2019-02-07 - explicit failure if Ogg Skeleton data is found // 1.14 - 2018-02-11 - delete bogus dealloca usage // 1.13 - 2018-01-29 - fix truncation of last frame (hopefully) // 1.12 - 2017-11-21 - limit residue begin/end to blocksize/2 to avoid large temp allocs in bad/corrupt files @@ -253,7 +254,7 @@ extern stb_vorbis * stb_vorbis_open_file(FILE *f, int close_handle_on_close, // create an ogg vorbis decoder from an open FILE *, looking for a stream at // the _current_ seek point (ftell). on failure, returns NULL and sets *error. // note that stb_vorbis must "own" this stream; if you seek it in between -// calls to stb_vorbis, it will become confused. Morever, if you attempt to +// calls to stb_vorbis, it will become confused. Moreover, if you attempt to // perform stb_vorbis_seek_*() operations on this file, it will assume it // owns the _entire_ rest of the file after the start point. Use the next // function, stb_vorbis_open_file_section(), to limit it. @@ -374,7 +375,8 @@ enum STBVorbisError VORBIS_invalid_first_page, VORBIS_bad_packet_type, VORBIS_cant_find_last_page, - VORBIS_seek_failed + VORBIS_seek_failed, + VORBIS_ogg_skeleton_not_supported }; @@ -1073,7 +1075,7 @@ static int compute_codewords(Codebook *c, uint8 *len, int n, uint32 *values) assert(z >= 0 && z < 32); available[z] = 0; add_entry(c, bit_reverse(res), i, m++, len[i], values); - // propogate availability up the tree + // propagate availability up the tree if (z != len[i]) { assert(len[i] >= 0 && len[i] < 32); for (y=len[i]; y > z; --y) { @@ -2637,7 +2639,7 @@ static void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) // once I combined the passes. // so there's a missing 'times 2' here (for adding X to itself). - // this propogates through linearly to the end, where the numbers + // this propagates through linearly to the end, where the numbers // are 1/2 too small, and need to be compensated for. { @@ -3578,7 +3580,22 @@ static int start_decoder(vorb *f) if (f->page_flag & PAGEFLAG_continued_packet) return error(f, VORBIS_invalid_first_page); // check for expected packet length if (f->segment_count != 1) return error(f, VORBIS_invalid_first_page); - if (f->segments[0] != 30) return error(f, VORBIS_invalid_first_page); + if (f->segments[0] != 30) { + // check for the Ogg skeleton fishead identifying header to refine our error + if (f->segments[0] == 64 && + getn(f, header, 6) && + header[0] == 'f' && + header[1] == 'i' && + header[2] == 's' && + header[3] == 'h' && + header[4] == 'e' && + header[5] == 'a' && + get8(f) == 'd' && + get8(f) == '\0') return error(f, VORBIS_ogg_skeleton_not_supported); + else + return error(f, VORBIS_invalid_first_page); + } + // read packet // check packet header if (get8(f) != VORBIS_packet_id) return error(f, VORBIS_invalid_first_page); @@ -4566,7 +4583,7 @@ static int get_seek_page_info(stb_vorbis *f, ProbedPage *z) return 1; } -// rarely used function to seek back to the preceeding page while finding the +// rarely used function to seek back to the preceding page while finding the // start of a packet static int go_to_page_before(stb_vorbis *f, unsigned int limit_offset) { diff --git a/thirdparty/nanosvg/nanosvg.h b/thirdparty/nanosvg/nanosvg.h index 2321c56fd2..8c8b061cd1 100644 --- a/thirdparty/nanosvg/nanosvg.h +++ b/thirdparty/nanosvg/nanosvg.h @@ -29,9 +29,11 @@ #ifndef NANOSVG_H #define NANOSVG_H +#ifndef NANOSVG_CPLUSPLUS #ifdef __cplusplus extern "C" { #endif +#endif // NanoSVG is a simple stupid single-header-file SVG parse. The output of the parser is a list of cubic bezier shapes. // @@ -45,15 +47,15 @@ extern "C" { // NanoSVG can return the paths in few different units. For example if you want to render an image, you may choose // to get the paths in pixels, or if you are feeding the data into a CNC-cutter, you may want to use millimeters. // -// The units passed to NanoVG should be one of: 'px', 'pt', 'pc' 'mm', 'cm', or 'in'. +// The units passed to NanoSVG should be one of: 'px', 'pt', 'pc' 'mm', 'cm', or 'in'. // DPI (dots-per-inch) controls how the unit conversion is done. // // If you don't know or care about the units stuff, "px" and 96 should get you going. /* Example Usage: - // Load - NSVGImage* image; + // Load SVG + NSVGimage* image; image = nsvgParseFromFile("test.svg", "px", 96); printf("size: %f x %f\n", image->width, image->height); // Use... @@ -167,12 +169,17 @@ NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi) // Important note: changes the string. NSVGimage* nsvgParse(char* input, const char* units, float dpi); -// Deletes list of paths. +// Duplicates a path. +NSVGpath* nsvgDuplicatePath(NSVGpath* p); + +// Deletes an image. void nsvgDelete(NSVGimage* image); +#ifndef NANOSVG_CPLUSPLUS #ifdef __cplusplus } #endif +#endif #endif // NANOSVG_H @@ -1415,8 +1422,7 @@ static unsigned int nsvg__parseColor(const char* str) static float nsvg__parseOpacity(const char* str) { - float val = 0; - sscanf(str, "%f", &val); + float val = nsvg__atof(str); if (val < 0.0f) val = 0.0f; if (val > 1.0f) val = 1.0f; return val; @@ -1424,8 +1430,7 @@ static float nsvg__parseOpacity(const char* str) static float nsvg__parseMiterLimit(const char* str) { - float val = 0; - sscanf(str, "%f", &val); + float val = nsvg__atof(str); if (val < 0.0f) val = 0.0f; return val; } @@ -1456,9 +1461,9 @@ static int nsvg__parseUnits(const char* units) static NSVGcoordinate nsvg__parseCoordinateRaw(const char* str) { NSVGcoordinate coord = {0, NSVG_UNITS_USER}; - char units[32]=""; - sscanf(str, "%f%31s", &coord.value, units); - coord.units = nsvg__parseUnits(units); + char buf[64]; + coord.units = nsvg__parseUnits(nsvg__parseNumber(str, buf, 64)); + coord.value = nsvg__atof(buf); return coord; } @@ -1650,7 +1655,7 @@ static char nsvg__parseLineJoin(const char* str) else if (strcmp(str, "bevel") == 0) return NSVG_JOIN_BEVEL; // TODO: handle inherit. - return NSVG_CAP_BUTT; + return NSVG_JOIN_MITER; } static char nsvg__parseFillRule(const char* str) @@ -2494,11 +2499,26 @@ static void nsvg__parseSVG(NSVGparser* p, const char** attr) for (i = 0; attr[i]; i += 2) { if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { if (strcmp(attr[i], "width") == 0) { - p->image->width = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 1.0f); + p->image->width = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 0.0f); } else if (strcmp(attr[i], "height") == 0) { - p->image->height = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 1.0f); + p->image->height = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 0.0f); } else if (strcmp(attr[i], "viewBox") == 0) { - sscanf(attr[i + 1], "%f%*[%%, \t]%f%*[%%, \t]%f%*[%%, \t]%f", &p->viewMinx, &p->viewMiny, &p->viewWidth, &p->viewHeight); + const char *s = attr[i + 1]; + char buf[64]; + s = nsvg__parseNumber(s, buf, 64); + p->viewMinx = nsvg__atof(buf); + while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; + if (!*s) return; + s = nsvg__parseNumber(s, buf, 64); + p->viewMiny = nsvg__atof(buf); + while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; + if (!*s) return; + s = nsvg__parseNumber(s, buf, 64); + p->viewWidth = nsvg__atof(buf); + while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; + if (!*s) return; + s = nsvg__parseNumber(s, buf, 64); + p->viewHeight = nsvg__atof(buf); } else if (strcmp(attr[i], "preserveAspectRatio") == 0) { if (strstr(attr[i + 1], "none") != 0) { // No uniform scaling @@ -2906,6 +2926,36 @@ error: return NULL; } +NSVGpath* nsvgDuplicatePath(NSVGpath* p) +{ + NSVGpath* res = NULL; + + if (p == NULL) + return NULL; + + res = (NSVGpath*)malloc(sizeof(NSVGpath)); + if (res == NULL) goto error; + memset(res, 0, sizeof(NSVGpath)); + + res->pts = (float*)malloc(p->npts*2*sizeof(float)); + if (res->pts == NULL) goto error; + memcpy(res->pts, p->pts, p->npts * sizeof(float) * 2); + res->npts = p->npts; + + memcpy(res->bounds, p->bounds, sizeof(p->bounds)); + + res->closed = p->closed; + + return res; + +error: + if (res != NULL) { + free(res->pts); + free(res); + } + return NULL; +} + void nsvgDelete(NSVGimage* image) { NSVGshape *snext, *shape; diff --git a/thirdparty/nanosvg/nanosvgrast.h b/thirdparty/nanosvg/nanosvgrast.h index 2940c1f916..b740c316ca 100644 --- a/thirdparty/nanosvg/nanosvgrast.h +++ b/thirdparty/nanosvg/nanosvgrast.h @@ -25,15 +25,18 @@ #ifndef NANOSVGRAST_H #define NANOSVGRAST_H +#ifndef NANOSVGRAST_CPLUSPLUS #ifdef __cplusplus extern "C" { #endif +#endif typedef struct NSVGrasterizer NSVGrasterizer; /* Example Usage: // Load SVG - struct SNVGImage* image = nsvgParseFromFile("test.svg."); + NSVGimage* image; + image = nsvgParseFromFile("test.svg", "px", 96); // Create rasterizer (can be used to render multiple images). struct NSVGrasterizer* rast = nsvgCreateRasterizer(); @@ -63,9 +66,11 @@ void nsvgRasterize(NSVGrasterizer* r, void nsvgDeleteRasterizer(NSVGrasterizer*); +#ifndef NANOSVGRAST_CPLUSPLUS #ifdef __cplusplus } #endif +#endif #endif // NANOSVGRAST_H diff --git a/thirdparty/pcre2/LICENCE b/thirdparty/pcre2/LICENCE index bfe3c8d528..b0f8804fff 100644 --- a/thirdparty/pcre2/LICENCE +++ b/thirdparty/pcre2/LICENCE @@ -4,11 +4,11 @@ PCRE2 LICENCE PCRE2 is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. -Release 10 of PCRE2 is distributed under the terms of the "BSD" licence, as -specified below, with one exemption for certain binary redistributions. The -documentation for PCRE2, supplied in the "doc" directory, is distributed under -the same terms as the software itself. The data in the testdata directory is -not copyrighted and is in the public domain. +Releases 10.00 and above of PCRE2 are distributed under the terms of the "BSD" +licence, as specified below, with one exemption for certain binary +redistributions. The documentation for PCRE2, supplied in the "doc" directory, +is distributed under the same terms as the software itself. The data in the +testdata directory is not copyrighted and is in the public domain. The basic library functions are written in C and are freestanding. Also included in the distribution is a just-in-time compiler that can be used to @@ -35,7 +35,7 @@ PCRE2 JUST-IN-TIME COMPILATION SUPPORT Written by: Zoltan Herczeg Email local part: hzmester -Emain domain: freemail.hu +Email domain: freemail.hu Copyright(c) 2010-2018 Zoltan Herczeg All rights reserved. @@ -46,7 +46,7 @@ STACK-LESS JUST-IN-TIME COMPILER Written by: Zoltan Herczeg Email local part: hzmester -Emain domain: freemail.hu +Email domain: freemail.hu Copyright(c) 2009-2018 Zoltan Herczeg All rights reserved. diff --git a/thirdparty/pcre2/src/config.h b/thirdparty/pcre2/src/config.h index f738616714..89a52ef848 100644 --- a/thirdparty/pcre2/src/config.h +++ b/thirdparty/pcre2/src/config.h @@ -18,10 +18,10 @@ to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H, but if you do, default values will be taken from config.h for non-boolean macros that are not defined on the command line. -Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE2_8 should either be defined -(conventionally to 1) for TRUE, and not defined at all for FALSE. All such -macros are listed as a commented #undef in config.h.generic. Macros such as -MATCH_LIMIT, whose actual value is relevant, have defaults defined, but are +Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE2_8 should either be +defined (conventionally to 1) for TRUE, and not defined at all for FALSE. All +such macros are listed as a commented #undef in config.h.generic. Macros such +as MATCH_LIMIT, whose actual value is relevant, have defaults defined, but are surrounded by #ifndef/#endif lines so that the value can be overridden by -D. PCRE2 uses memmove() if HAVE_MEMMOVE is defined; otherwise it uses bcopy() if @@ -132,17 +132,18 @@ sure both macros are undefined; an emulation function will then be used. */ /* Define to 1 if you have the <zlib.h> header file. */ /* #undef HAVE_ZLIB_H */ -/* This limits the amount of memory that pcre2_match() may use while matching - a pattern. The value is in kilobytes. */ +/* This limits the amount of memory that may be used while matching a pattern. + It applies to both pcre2_match() and pcre2_dfa_match(). It does not apply + to JIT matching. The value is in kibibytes (units of 1024 bytes). */ #ifndef HEAP_LIMIT #define HEAP_LIMIT 20000000 #endif /* The value of LINK_SIZE determines the number of bytes used to store links as offsets within the compiled regex. The default is 2, which allows for - compiled patterns up to 64K long. This covers the vast majority of cases. - However, PCRE2 can also be compiled to use 3 or 4 bytes instead. This - allows for longer patterns in extreme cases. */ + compiled patterns up to 65535 code units long. This covers the vast + majority of cases. However, PCRE2 can also be compiled to use 3 or 4 bytes + instead. This allows for longer patterns in extreme cases. */ #ifndef LINK_SIZE #define LINK_SIZE 2 #endif @@ -155,7 +156,8 @@ sure both macros are undefined; an emulation function will then be used. */ /* The value of MATCH_LIMIT determines the default number of times the pcre2_match() function can record a backtrack position during a single - matching attempt. There is a runtime interface for setting a different + matching attempt. The value is also used to limit a loop counter in + pcre2_dfa_match(). There is a runtime interface for setting a different limit. The limit exists in order to catch runaway regular expressions that take for ever to determine that they do not match. The default is set very large so that it does not accidentally catch legitimate cases. */ @@ -170,7 +172,9 @@ sure both macros are undefined; an emulation function will then be used. */ MATCH_LIMIT_DEPTH provides this facility. To have any useful effect, it must be less than the value of MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT. There is a runtime method for setting a different - limit. */ + limit. In the case of pcre2_dfa_match(), this limit controls the depth of + the internal nested function calls that are used for pattern recursions, + lookarounds, and atomic groups. */ #ifndef MATCH_LIMIT_DEPTH #define MATCH_LIMIT_DEPTH MATCH_LIMIT #endif @@ -210,7 +214,7 @@ sure both macros are undefined; an emulation function will then be used. */ #define PACKAGE_NAME "PCRE2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PCRE2 10.31" +#define PACKAGE_STRING "PCRE2 10.32" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pcre2" @@ -219,7 +223,7 @@ sure both macros are undefined; an emulation function will then be used. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "10.31" +#define PACKAGE_VERSION "10.32" /* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested parentheses (of any kind) in a pattern. This limits the amount of system @@ -339,7 +343,7 @@ sure both macros are undefined; an emulation function will then be used. */ #endif /* Version number of package */ -#define VERSION "10.31" +#define VERSION "10.32" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/thirdparty/pcre2/src/pcre2.h b/thirdparty/pcre2/src/pcre2.h index fffcc307d0..3d2feb7a6b 100644 --- a/thirdparty/pcre2/src/pcre2.h +++ b/thirdparty/pcre2/src/pcre2.h @@ -5,7 +5,7 @@ /* This is the public header file for the PCRE library, second API, to be #included by applications that call PCRE2 functions. - Copyright (c) 2016-2017 University of Cambridge + Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -41,10 +41,16 @@ POSSIBILITY OF SUCH DAMAGE. /* The current PCRE version information. */ -#define PCRE2_MAJOR 10 -#define PCRE2_MINOR 31 -#define PCRE2_PRERELEASE -#define PCRE2_DATE 2018-02-12 +#define PCRE2_MAJOR 10 +#define PCRE2_MINOR 32 +#define PCRE2_PRERELEASE +#define PCRE2_DATE 2018-09-10 + +/* For the benefit of systems without stdint.h, an alternative is to use +inttypes.h. The existence of these headers is checked by configure or CMake. */ + +#define PCRE2_HAVE_STDINT_H 1 +#define PCRE2_HAVE_INTTYPES_H 1 /* When an application links to a PCRE DLL in Windows, the symbols that are imported have to be identified as such. When building PCRE2, the appropriate @@ -81,12 +87,18 @@ set, we ensure here that it has no effect. */ #define PCRE2_CALL_CONVENTION #endif -/* Have to include limits.h, stdlib.h and stdint.h to ensure that size_t and -uint8_t, UCHAR_MAX, etc are defined. */ +/* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure +that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither +header, the relevant values must be provided by some other means. */ #include <limits.h> #include <stdlib.h> + +#if PCRE2_HAVE_STDINT_H #include <stdint.h> +#elif PCRE2_HAVE_INTTYPES_H +#include <inttypes.h> +#endif /* Allow for C++ users compiling this directly. */ @@ -269,6 +281,7 @@ pcre2_pattern_convert(). */ #define PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE 156 #define PCRE2_ERROR_BACKSLASH_G_SYNTAX 157 #define PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING 158 +/* Error 159 is obsolete and should now never occur */ #define PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED 159 #define PCRE2_ERROR_VERB_UNKNOWN 160 #define PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG 161 @@ -303,6 +316,8 @@ pcre2_pattern_convert(). */ #define PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP 190 #define PCRE2_ERROR_NO_SURROGATES_IN_UTF16 191 #define PCRE2_ERROR_BAD_LITERAL_OPTIONS 192 +#define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE 193 +#define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194 /* "Expected" matching error codes: no match and partial match. */ @@ -387,6 +402,7 @@ released, the numbers must not be changed. */ #define PCRE2_ERROR_BADSERIALIZEDDATA (-62) #define PCRE2_ERROR_HEAPLIMIT (-63) #define PCRE2_ERROR_CONVERT_SYNTAX (-64) +#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) /* Request types for pcre2_pattern_info() */ diff --git a/thirdparty/pcre2/src/pcre2_auto_possess.c b/thirdparty/pcre2/src/pcre2_auto_possess.c index 23275a2e39..2ce152e952 100644 --- a/thirdparty/pcre2/src/pcre2_auto_possess.c +++ b/thirdparty/pcre2/src/pcre2_auto_possess.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -505,7 +505,7 @@ Arguments: utf TRUE in UTF mode cb compile data block base_list the data list of the base opcode - base_end the end of the data list + base_end the end of the base opcode rec_limit points to recursion depth counter Returns: TRUE if the auto-possessification is possible @@ -730,7 +730,7 @@ for(;;) if ((*xclass_flags & XCL_MAP) == 0) { /* No bits are set for characters < 256. */ - if (list[1] == 0) return TRUE; + if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0; /* Might be an empty repeat. */ continue; } @@ -1235,6 +1235,7 @@ for (;;) #endif case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: diff --git a/thirdparty/pcre2/src/pcre2_chartables.c b/thirdparty/pcre2/src/pcre2_chartables.c index 203cb1a4ab..4046500c00 100644 --- a/thirdparty/pcre2/src/pcre2_chartables.c +++ b/thirdparty/pcre2/src/pcre2_chartables.c @@ -2,23 +2,24 @@ * Perl-Compatible Regular Expressions * *************************************************/ -/* This file contains character tables that are used when no external tables -are passed to PCRE2 by the application that calls it. The tables are used only -for characters whose code values are less than 256. - -This is a default version of the tables that assumes ASCII encoding. A program -called dftables (which is distributed with PCRE2) can be used to build -alternative versions of this file. This is necessary if you are running in an -EBCDIC environment, or if you want to default to a different encoding, for -example ISO-8859-1. When dftables is run, it creates these tables in the -current locale. If PCRE2 is configured with --enable-rebuild-chartables, this -happens automatically. - -The following #includes are present because without them gcc 4.x may remove the -array definition from the final binary if PCRE2 is built into a static library -and dead code stripping is activated. This leads to link errors. Pulling in the -header ensures that the array gets flagged as "someone outside this compilation -unit might reference this" and so it will always be supplied to the linker. */ +/* This file was automatically written by the dftables auxiliary +program. It contains character tables that are used when no external +tables are passed to PCRE2 by the application that calls it. The tables +are used only for characters whose code values are less than 256. */ + +/*The dftables program (which is distributed with PCRE2) can be used to +build alternative versions of this file. This is necessary if you are +running in an EBCDIC environment, or if you want to default to a different +encoding, for example ISO-8859-1. When dftables is run, it creates these +tables in the current locale. This happens automatically if PCRE2 is +configured with --enable-rebuild-chartables. */ + +/* The following #include is present because without it gcc 4.x may remove +the array definition from the final binary if PCRE2 is built into a static +library and dead code stripping is activated. This leads to link errors. +Pulling in the header ensures that the array gets flagged as "someone +outside this compilation unit might reference this" and so it will always +be supplied to the linker. */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -101,7 +102,7 @@ const uint8_t PRIV(default_tables)[] = { /* This table contains bit maps for various character classes. Each map is 32 bytes long and the bits run from the least significant end of each byte. The classes that have their own maps are: space, xdigit, digit, upper, lower, word, -graph, print, punct, and cntrl. Other classes are built from combinations. */ +graph print, punct, and cntrl. Other classes are built from combinations. */ 0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -159,25 +160,24 @@ graph, print, punct, and cntrl. Other classes are built from combinations. */ 0x04 decimal digit 0x08 hexadecimal digit 0x10 alphanumeric or '_' - 0x80 regular expression metacharacter or binary zero */ - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ 0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00, /* 8- 15 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ - 0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */ - 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */ 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ - 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */ + 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */ 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */ - 0x12,0x12,0x12,0x80,0x80,0x00,0x80,0x10, /* X - _ */ + 0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x10, /* X - _ */ 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */ - 0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */ + 0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00, /* x -127 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ diff --git a/thirdparty/pcre2/src/pcre2_compile.c b/thirdparty/pcre2/src/pcre2_compile.c index 87530fb584..6bb1de3610 100644 --- a/thirdparty/pcre2/src/pcre2_compile.c +++ b/thirdparty/pcre2/src/pcre2_compile.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -63,8 +63,8 @@ POSSIBILITY OF SUCH DAMAGE. /* Other debugging code can be enabled by these defines. */ -// #define DEBUG_SHOW_CAPTURES -// #define DEBUG_SHOW_PARSED +/* #define DEBUG_SHOW_CAPTURES */ +/* #define DEBUG_SHOW_PARSED */ /* There are a few things that vary with different code unit sizes. Handle them by defining macros in order to minimize #if usage. */ @@ -250,34 +250,35 @@ is present where expected in a conditional group. */ #define META_LOOKBEHINDNOT 0x80250000u /* (?<! */ /* These must be kept in this order, with consecutive values, and the _ARG -versions of PRUNE, SKIP, and THEN immediately after their non-argument +versions of COMMIT, PRUNE, SKIP, and THEN immediately after their non-argument versions. */ #define META_MARK 0x80260000u /* (*MARK) */ #define META_ACCEPT 0x80270000u /* (*ACCEPT) */ -#define META_COMMIT 0x80280000u /* (*COMMIT) */ -#define META_FAIL 0x80290000u /* (*FAIL) */ -#define META_PRUNE 0x802a0000u /* These pairs must */ -#define META_PRUNE_ARG 0x802b0000u /* be */ -#define META_SKIP 0x802c0000u /* kept */ -#define META_SKIP_ARG 0x802d0000u /* in */ -#define META_THEN 0x802e0000u /* this */ -#define META_THEN_ARG 0x802f0000u /* order */ +#define META_FAIL 0x80280000u /* (*FAIL) */ +#define META_COMMIT 0x80290000u /* These */ +#define META_COMMIT_ARG 0x802a0000u /* pairs */ +#define META_PRUNE 0x802b0000u /* must */ +#define META_PRUNE_ARG 0x802c0000u /* be */ +#define META_SKIP 0x802d0000u /* kept */ +#define META_SKIP_ARG 0x802e0000u /* in */ +#define META_THEN 0x802f0000u /* this */ +#define META_THEN_ARG 0x80300000u /* order */ /* These must be kept in groups of adjacent 3 values, and all together. */ -#define META_ASTERISK 0x80300000u /* * */ -#define META_ASTERISK_PLUS 0x80310000u /* *+ */ -#define META_ASTERISK_QUERY 0x80320000u /* *? */ -#define META_PLUS 0x80330000u /* + */ -#define META_PLUS_PLUS 0x80340000u /* ++ */ -#define META_PLUS_QUERY 0x80350000u /* +? */ -#define META_QUERY 0x80360000u /* ? */ -#define META_QUERY_PLUS 0x80370000u /* ?+ */ -#define META_QUERY_QUERY 0x80380000u /* ?? */ -#define META_MINMAX 0x80390000u /* {n,m} repeat */ -#define META_MINMAX_PLUS 0x803a0000u /* {n,m}+ repeat */ -#define META_MINMAX_QUERY 0x803b0000u /* {n,m}? repeat */ +#define META_ASTERISK 0x80310000u /* * */ +#define META_ASTERISK_PLUS 0x80320000u /* *+ */ +#define META_ASTERISK_QUERY 0x80330000u /* *? */ +#define META_PLUS 0x80340000u /* + */ +#define META_PLUS_PLUS 0x80350000u /* ++ */ +#define META_PLUS_QUERY 0x80360000u /* +? */ +#define META_QUERY 0x80370000u /* ? */ +#define META_QUERY_PLUS 0x80380000u /* ?+ */ +#define META_QUERY_QUERY 0x80390000u /* ?? */ +#define META_MINMAX 0x803a0000u /* {n,m} repeat */ +#define META_MINMAX_PLUS 0x803b0000u /* {n,m}+ repeat */ +#define META_MINMAX_QUERY 0x803c0000u /* {n,m}? repeat */ #define META_FIRST_QUANTIFIER META_ASTERISK #define META_LAST_QUANTIFIER META_MINMAX_QUERY @@ -327,8 +328,9 @@ static unsigned char meta_extra_lengths[] = { SIZEOFFSET, /* META_LOOKBEHINDNOT */ 1, /* META_MARK - plus the string length */ 0, /* META_ACCEPT */ - 0, /* META_COMMIT */ 0, /* META_FAIL */ + 0, /* META_COMMIT */ + 1, /* META_COMMIT_ARG - plus the string length */ 0, /* META_PRUNE */ 1, /* META_PRUNE_ARG - plus the string length */ 0, /* META_SKIP */ @@ -510,17 +512,17 @@ static const short int escapes[] = { -ESC_Z, CHAR_LEFT_SQUARE_BRACKET, CHAR_BACKSLASH, CHAR_RIGHT_SQUARE_BRACKET, CHAR_CIRCUMFLEX_ACCENT, CHAR_UNDERSCORE, - CHAR_GRAVE_ACCENT, ESC_a, + CHAR_GRAVE_ACCENT, CHAR_BEL, -ESC_b, 0, - -ESC_d, ESC_e, - ESC_f, 0, + -ESC_d, CHAR_ESC, + CHAR_FF, 0, -ESC_h, 0, 0, -ESC_k, 0, 0, - ESC_n, 0, + CHAR_LF, 0, -ESC_p, 0, - ESC_r, -ESC_s, - ESC_tee, 0, + CHAR_CR, -ESC_s, + CHAR_HT, 0, -ESC_v, -ESC_w, 0, 0, -ESC_z @@ -544,22 +546,22 @@ because it is defined as 'a', which of course picks up the ASCII value. */ #endif static const short int escapes[] = { -/* 80 */ ESC_a, -ESC_b, 0, -ESC_d, ESC_e, ESC_f, 0, -/* 88 */-ESC_h, 0, 0, '{', 0, 0, 0, 0, -/* 90 */ 0, 0, -ESC_k, 0, 0, ESC_n, 0, -ESC_p, -/* 98 */ 0, ESC_r, 0, '}', 0, 0, 0, 0, -/* A0 */ 0, '~', -ESC_s, ESC_tee, 0,-ESC_v, -ESC_w, 0, -/* A8 */ 0,-ESC_z, 0, 0, 0, '[', 0, 0, -/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-', -/* C0 */ '{',-ESC_A, -ESC_B, -ESC_C, -ESC_D,-ESC_E, 0, -ESC_G, -/* C8 */-ESC_H, 0, 0, 0, 0, 0, 0, 0, -/* D0 */ '}', 0, -ESC_K, 0, 0,-ESC_N, 0, -ESC_P, -/* D8 */-ESC_Q,-ESC_R, 0, 0, 0, 0, 0, 0, -/* E0 */ '\\', 0, -ESC_S, 0, 0,-ESC_V, -ESC_W, -ESC_X, -/* E8 */ 0,-ESC_Z, 0, 0, 0, 0, 0, 0, -/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0, -/* F8 */ 0, 0 +/* 80 */ CHAR_BEL, -ESC_b, 0, -ESC_d, CHAR_ESC, CHAR_FF, 0, +/* 88 */ -ESC_h, 0, 0, '{', 0, 0, 0, 0, +/* 90 */ 0, 0, -ESC_k, 0, 0, CHAR_LF, 0, -ESC_p, +/* 98 */ 0, CHAR_CR, 0, '}', 0, 0, 0, 0, +/* A0 */ 0, '~', -ESC_s, CHAR_HT, 0, -ESC_v, -ESC_w, 0, +/* A8 */ 0, -ESC_z, 0, 0, 0, '[', 0, 0, +/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* B8 */ 0, 0, 0, 0, 0, ']', '=', '-', +/* C0 */ '{', -ESC_A, -ESC_B, -ESC_C, -ESC_D, -ESC_E, 0, -ESC_G, +/* C8 */ -ESC_H, 0, 0, 0, 0, 0, 0, 0, +/* D0 */ '}', 0, -ESC_K, 0, 0, -ESC_N, 0, -ESC_P, +/* D8 */ -ESC_Q, -ESC_R, 0, 0, 0, 0, 0, 0, +/* E0 */ '\\', 0, -ESC_S, 0, 0, -ESC_V, -ESC_W, -ESC_X, +/* E8 */ 0, -ESC_Z, 0, 0, 0, 0, 0, 0, +/* F0 */ 0, 0, 0, 0, 0, 0, 0, 0, +/* F8 */ 0, 0 }; /* We also need a table of characters that may follow \c in an EBCDIC @@ -586,9 +588,9 @@ static const char verbnames[] = "\0" /* Empty name is a shorthand for MARK */ STRING_MARK0 STRING_ACCEPT0 - STRING_COMMIT0 STRING_F0 STRING_FAIL0 + STRING_COMMIT0 STRING_PRUNE0 STRING_SKIP0 STRING_THEN; @@ -596,11 +598,11 @@ static const char verbnames[] = static const verbitem verbs[] = { { 0, META_MARK, +1 }, /* > 0 => must have an argument */ { 4, META_MARK, +1 }, - { 6, META_ACCEPT, -1 }, /* < 0 => must not have an argument */ - { 6, META_COMMIT, -1 }, + { 6, META_ACCEPT, -1 }, /* < 0 => Optional argument, convert to pre-MARK */ { 1, META_FAIL, -1 }, { 4, META_FAIL, -1 }, - { 5, META_PRUNE, 0 }, /* Argument is optional; bump META code if found */ + { 6, META_COMMIT, 0 }, + { 5, META_PRUNE, 0 }, /* Optional argument; bump META code if found */ { 4, META_SKIP, 0 }, { 4, META_THEN, 0 } }; @@ -610,8 +612,8 @@ static const int verbcount = sizeof(verbs)/sizeof(verbitem); /* Verb opcodes, indexed by their META code offset from META_MARK. */ static const uint32_t verbops[] = { - OP_MARK, OP_ACCEPT, OP_COMMIT, OP_FAIL, OP_PRUNE, OP_PRUNE_ARG, OP_SKIP, - OP_SKIP_ARG, OP_THEN, OP_THEN_ARG }; + OP_MARK, OP_ACCEPT, OP_FAIL, OP_COMMIT, OP_COMMIT_ARG, OP_PRUNE, + OP_PRUNE_ARG, OP_SKIP, OP_SKIP_ARG, OP_THEN, OP_THEN_ARG }; /* Offsets from OP_STAR for case-independent and negative repeat opcodes. */ @@ -729,7 +731,7 @@ enum { ERR0 = COMPILE_ERROR_BASE, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERR88, ERR89, ERR90, - ERR91, ERR92}; + ERR91, ERR92, ERR93, ERR94 }; /* This is a table of start-of-pattern options such as (*UTF) and settings such as (*LIMIT_MATCH=nnnn) and (*CRLF). For completeness and backward @@ -976,8 +978,8 @@ for (;;) case META_POSIX_NEG: fprintf(stderr, "META_POSIX_NEG %d", *pptr++); break; case META_ACCEPT: fprintf(stderr, "META (*ACCEPT)"); break; - case META_COMMIT: fprintf(stderr, "META (*COMMIT)"); break; case META_FAIL: fprintf(stderr, "META (*FAIL)"); break; + case META_COMMIT: fprintf(stderr, "META (*COMMIT)"); break; case META_PRUNE: fprintf(stderr, "META (*PRUNE)"); break; case META_SKIP: fprintf(stderr, "META (*SKIP)"); break; case META_THEN: fprintf(stderr, "META (*THEN)"); break; @@ -1067,6 +1069,10 @@ for (;;) fprintf(stderr, "META (*MARK:"); goto SHOWARG; + case META_COMMIT_ARG: + fprintf(stderr, "META (*COMMIT:"); + goto SHOWARG; + case META_PRUNE_ARG: fprintf(stderr, "META (*PRUNE:"); goto SHOWARG; @@ -1435,6 +1441,48 @@ else if ((i = escapes[c - ESCAPES_FIRST]) != 0) escape = -i; /* Else return a special escape */ if (cb != NULL && (escape == ESC_P || escape == ESC_p || escape == ESC_X)) cb->external_flags |= PCRE2_HASBKPORX; /* Note \P, \p, or \X */ + + /* Perl supports \N{name} for character names and \N{U+dddd} for numerical + Unicode code points, as well as plain \N for "not newline". PCRE does not + support \N{name}. However, it does support quantification such as \N{2,3}, + so if \N{ is not followed by U+dddd we check for a quantifier. */ + + if (escape == ESC_N && ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET) + { + PCRE2_SPTR p = ptr + 1; + + /* \N{U+ can be handled by the \x{ code. However, this construction is + not valid in EBCDIC environments because it specifies a Unicode + character, not a codepoint in the local code. For example \N{U+0041} + must be "A" in all environments. Also, in Perl, \N{U+ forces Unicode + casing semantics for the entire pattern, so allow it only in UTF (i.e. + Unicode) mode. */ + + if (ptrend - p > 1 && *p == CHAR_U && p[1] == CHAR_PLUS) + { +#ifdef EBCDIC + *errorcodeptr = ERR93; +#else + if (utf) + { + ptr = p + 1; + escape = 0; /* Not a fancy escape after all */ + goto COME_FROM_NU; + } + else *errorcodeptr = ERR93; +#endif + } + + /* Give an error if what follows is not a quantifier, but don't override + an error set by the quantifier reader (e.g. number overflow). */ + + else + { + if (!read_repeat_counts(&p, ptrend, NULL, NULL, errorcodeptr) && + *errorcodeptr == 0) + *errorcodeptr = ERR37; + } + } } } @@ -1462,6 +1510,7 @@ else /* A number of Perl escapes are not handled by PCRE. We give an explicit error. */ + case CHAR_F: case CHAR_l: case CHAR_L: *errorcodeptr = ERR37; @@ -1719,6 +1768,9 @@ else { if (ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET) { +#ifndef EBCDIC + COME_FROM_NU: +#endif if (++ptr >= ptrend || *ptr == CHAR_RIGHT_CURLY_BRACKET) { *errorcodeptr = ERR78; @@ -1852,19 +1904,6 @@ else } } -/* Perl supports \N{name} for character names, as well as plain \N for "not -newline". PCRE does not support \N{name}. However, it does support -quantification such as \N{2,3}. */ - -if (escape == ESC_N && ptr < ptrend && *ptr == CHAR_LEFT_CURLY_BRACKET && - ptrend - ptr > 2) - { - PCRE2_SPTR p = ptr + 1; - if (!read_repeat_counts(&p, ptrend, NULL, NULL, errorcodeptr) && - *errorcodeptr == 0) - *errorcodeptr = ERR37; - } - /* Set the pointer to the next character before returning. */ *ptrptr = ptr; @@ -2251,11 +2290,14 @@ typedef struct nest_save { #define NSF_RESET 0x0001u #define NSF_CONDASSERT 0x0002u -/* Of the options that are changeable within the pattern, these are tracked -during parsing. The rest are used from META_OPTIONS items when compiling. */ +/* Options that are changeable within the pattern must be tracked during +parsing. Some (e.g. PCRE2_EXTENDED) are implemented entirely during parsing, +but all must be tracked so that META_OPTIONS items set the correct values for +the main compiling phase. */ -#define PARSE_TRACKED_OPTIONS \ - (PCRE2_DUPNAMES|PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_NO_AUTO_CAPTURE) +#define PARSE_TRACKED_OPTIONS (PCRE2_CASELESS|PCRE2_DOTALL|PCRE2_DUPNAMES| \ + PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_MULTILINE|PCRE2_NO_AUTO_CAPTURE| \ + PCRE2_UNGREEDY) /* States used for analyzing ranges in character classes. The two OK values must be last. */ @@ -2290,6 +2332,7 @@ uint32_t *previous_callout = NULL; uint32_t *parsed_pattern = cb->parsed_pattern; uint32_t *parsed_pattern_end = cb->parsed_pattern_end; uint32_t meta_quantifier = 0; +uint32_t add_after_mark = 0; uint16_t nest_depth = 0; int after_manual_callout = 0; int expect_cond_assert = 0; @@ -2434,11 +2477,17 @@ while (ptr < ptrend) /* EITHER: not both options set */ ((options & (PCRE2_EXTENDED | PCRE2_ALT_VERBNAMES)) != (PCRE2_EXTENDED | PCRE2_ALT_VERBNAMES)) || - /* OR: character > 255 */ - c > 255 || - /* OR: not a # comment or white space */ - (c != CHAR_NUMBER_SIGN && (cb->ctypes[c] & ctype_space) == 0) - )) +#ifdef SUPPORT_UNICODE + /* OR: character > 255 AND not Unicode Pattern White Space */ + (c > 255 && (c|1) != 0x200f && (c|1) != 0x2029) || +#endif + /* OR: not a # comment or isspace() white space */ + (c < 256 && c != CHAR_NUMBER_SIGN && (cb->ctypes[c] & ctype_space) == 0 +#ifdef SUPPORT_UNICODE + /* and not CHAR_NEL when Unicode is supported */ + && c != CHAR_NEL +#endif + ))) { PCRE2_SIZE verbnamelength; @@ -2461,6 +2510,16 @@ while (ptr < ptrend) goto FAILED; } *verblengthptr = (uint32_t)verbnamelength; + + /* If this name was on a verb such as (*ACCEPT) which does not continue, + a (*MARK) was generated for the name. We now add the original verb as the + next item. */ + + if (add_after_mark != 0) + { + *parsed_pattern++ = add_after_mark; + add_after_mark = 0; + } break; case CHAR_BACKSLASH: @@ -2510,11 +2569,18 @@ while (ptr < ptrend) /* Skip over whitespace and # comments in extended mode. Note that c is a character, not a code unit, so we must not use MAX_255 to test its size - because MAX_255 tests code units and is assumed TRUE in 8-bit mode. */ + because MAX_255 tests code units and is assumed TRUE in 8-bit mode. The + whitespace characters are those designated as "Pattern White Space" by + Unicode, which are the isspace() characters plus CHAR_NEL (newline), which is + U+0085 in Unicode, plus U+200E, U+200F, U+2028, and U+2029. These are a + subset of space characters that match \h and \v. */ if ((options & PCRE2_EXTENDED) != 0) { if (c < 256 && (cb->ctypes[c] & ctype_space) != 0) continue; +#ifdef SUPPORT_UNICODE + if (c == CHAR_NEL || (c|1) == 0x200f || (c|1) == 0x2029) continue; +#endif if (c == CHAR_NUMBER_SIGN) { while (ptr < ptrend) @@ -3206,7 +3272,6 @@ while (ptr < ptrend) tempptr = ptr; escape = PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options, TRUE, cb); - if (errorcode != 0) { CLASS_ESCAPE_FAILED: @@ -3454,13 +3519,25 @@ while (ptr < ptrend) if (*ptr++ == CHAR_COLON) /* Skip past : or ) */ { - if (verbs[i].has_arg < 0) /* Argument is forbidden */ + /* Some optional arguments can be treated as a preceding (*MARK) */ + + if (verbs[i].has_arg < 0) { - errorcode = ERR59; - goto FAILED; + add_after_mark = verbs[i].meta; + *parsed_pattern++ = META_MARK; } - *parsed_pattern++ = verbs[i].meta + - ((verbs[i].meta != META_MARK)? 0x00010000u:0); + + /* The remaining verbs with arguments (except *MARK) need a different + opcode. */ + + else + { + *parsed_pattern++ = verbs[i].meta + + ((verbs[i].meta != META_MARK)? 0x00010000u:0); + } + + /* Set up for reading the name in the main loop. */ + verblengthptr = parsed_pattern++; verbnamestart = ptr; inverbname = TRUE; @@ -3521,17 +3598,39 @@ while (ptr < ptrend) else { + BOOL hyphenok = TRUE; + uint32_t oldoptions = options; + top_nest->reset_group = 0; top_nest->max_group = 0; set = unset = 0; optset = &set; + /* ^ at the start unsets imnsx and disables the subsequent use of - */ + + if (ptr < ptrend && *ptr == CHAR_CIRCUMFLEX_ACCENT) + { + options &= ~(PCRE2_CASELESS|PCRE2_MULTILINE|PCRE2_NO_AUTO_CAPTURE| + PCRE2_DOTALL|PCRE2_EXTENDED|PCRE2_EXTENDED_MORE); + hyphenok = FALSE; + ptr++; + } + while (ptr < ptrend && *ptr != CHAR_RIGHT_PARENTHESIS && *ptr != CHAR_COLON) { switch (*ptr++) { - case CHAR_MINUS: optset = &unset; break; + case CHAR_MINUS: + if (!hyphenok) + { + errorcode = ERR94; + ptr--; /* Correct the offset */ + goto FAILED; + } + optset = &unset; + hyphenok = FALSE; + break; case CHAR_J: /* Record that it changed in the external options */ *optset |= PCRE2_DUPNAMES; @@ -3591,7 +3690,7 @@ while (ptr < ptrend) /* If nothing changed, no need to record. */ - if (set != 0 || unset != 0) + if (options != oldoptions) { *parsed_pattern++ = META_OPTIONS; *parsed_pattern++ = options; @@ -3896,9 +3995,8 @@ while (ptr < ptrend) if (*ptr == CHAR_DOT) { if (++ptr >= ptrend || !IS_DIGIT(*ptr)) goto BAD_VERSION_CONDITION; - if (!read_number(&ptr, ptrend, -1, 99 , ERR79, &minor, &errorcode)) - goto FAILED; - if (minor < 10) minor *= 10; + minor = (*ptr++ - CHAR_0) * 10; + if (IS_DIGIT(*ptr)) minor += *ptr++ - CHAR_0; if (ptr >= ptrend || *ptr != CHAR_RIGHT_PARENTHESIS) goto BAD_VERSION_CONDITION; } @@ -4261,11 +4359,11 @@ goto FAILED; /************************************************* -* Find first significant op code * +* Find first significant opcode * *************************************************/ /* This is called by several functions that scan a compiled expression looking -for a fixed first character, or an anchoring op code etc. It skips over things +for a fixed first character, or an anchoring opcode etc. It skips over things that do not influence this. For some calls, it makes sense to skip negative forward and all backward assertions, and also the \b assertion; for others it does not. @@ -5472,7 +5570,7 @@ for (;; pptr++) set xclass = TRUE. Then, in the pre-compile phase, accumulate the length of the extra data and reset the pointer. This is so that very large classes that contain a zillion wide characters or Unicode property tests - do not overwrite the work space (which is on the stack). */ + do not overwrite the workspace (which is on the stack). */ if (class_uchardata > class_uchardata_base) { @@ -5563,7 +5661,7 @@ for (;; pptr++) if (class_has_8bitchar > 0) { *code++ |= XCL_MAP; - memmove(code + (32 / sizeof(PCRE2_UCHAR)), code, + (void)memmove(code + (32 / sizeof(PCRE2_UCHAR)), code, CU2BYTES(class_uchardata - code)); if (negate_class && !xclass_has_prop) for (i = 0; i < 32; i++) classbits[i] = ~classbits[i]; @@ -5655,6 +5753,7 @@ for (;; pptr++) cb->had_pruneorskip = TRUE; /* Fall through */ case META_MARK: + case META_COMMIT_ARG: VERB_ARG: *code++ = verbops[(meta - META_MARK) >> 16]; /* The length is in characters. */ @@ -6509,7 +6608,7 @@ for (;; pptr++) /* Wrap the recursion call in OP_BRA brackets. */ - memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(1 + LINK_SIZE)); + (void)memmove(previous + 1 + LINK_SIZE, previous, CU2BYTES(1 + LINK_SIZE)); op_previous = *previous = OP_BRA; PUT(previous, 1, 2 + 2*LINK_SIZE); previous[2 + 2*LINK_SIZE] = OP_KET; @@ -6589,7 +6688,7 @@ for (;; pptr++) if (repeat_max <= 1 || repeat_max == REPEAT_UNLIMITED) { - memmove(previous + 1, previous, CU2BYTES(len)); + (void)memmove(previous + 1, previous, CU2BYTES(len)); code++; if (repeat_max == 0) { @@ -6610,7 +6709,7 @@ for (;; pptr++) else { int linkoffset; - memmove(previous + 2 + LINK_SIZE, previous, CU2BYTES(len)); + (void)memmove(previous + 2 + LINK_SIZE, previous, CU2BYTES(len)); code += 2 + LINK_SIZE; *previous++ = OP_BRAZERO + repeat_type; *previous++ = OP_BRA; @@ -6811,7 +6910,7 @@ for (;; pptr++) if (*bracode == OP_COND || *bracode == OP_SCOND) { int nlen = (int)(code - bracode); - memmove(bracode + 1 + LINK_SIZE, bracode, CU2BYTES(nlen)); + (void)memmove(bracode + 1 + LINK_SIZE, bracode, CU2BYTES(nlen)); code += 1 + LINK_SIZE; nlen += 1 + LINK_SIZE; *bracode = (*bracode == OP_COND)? OP_BRAPOS : OP_SBRAPOS; @@ -7082,7 +7181,7 @@ for (;; pptr++) else { - memmove(tempcode + 1 + LINK_SIZE, tempcode, CU2BYTES(len)); + (void)memmove(tempcode + 1 + LINK_SIZE, tempcode, CU2BYTES(len)); code += 1 + LINK_SIZE; len += 1 + LINK_SIZE; tempcode[0] = OP_ONCE; @@ -7460,7 +7559,7 @@ length of the BRA and KET and any extra code units that are required at the beginning. We accumulate in a local variable to save frequent testing of lengthptr for NULL. We cannot do this by looking at the value of 'code' at the start and end of each alternative, because compiled items are discarded during -the pre-compile phase so that the work space is not exceeded. */ +the pre-compile phase so that the workspace is not exceeded. */ length = 2 + 2*LINK_SIZE + skipunits; @@ -7622,7 +7721,7 @@ for (;;) { if (cb->open_caps->flag) { - memmove(start_bracket + 1 + LINK_SIZE, start_bracket, + (void)memmove(start_bracket + 1 + LINK_SIZE, start_bracket, CU2BYTES(code - start_bracket)); *start_bracket = OP_ONCE; code += 1 + LINK_SIZE; @@ -7765,10 +7864,11 @@ do { if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE; } - /* Condition */ + /* Condition. If there is no second branch, it can't be anchored. */ - else if (op == OP_COND) + else if (op == OP_COND || op == OP_SCOND) { + if (scode[GET(scode,1)] != OP_ALT) return FALSE; if (!is_anchored(scode, bracket_map, cb, atomcount, inassert)) return FALSE; } @@ -8003,6 +8103,7 @@ for (;;) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: @@ -8221,7 +8322,7 @@ for (i = 0; i < tablecount; i++) if (crc < 0) { - memmove(slot + cb->name_entry_size, slot, + (void)memmove(slot + cb->name_entry_size, slot, CU2BYTES((tablecount - i) * cb->name_entry_size)); break; } @@ -8311,6 +8412,7 @@ for (;; pptr++) break; case META_MARK: /* Add the length of the name. */ + case META_COMMIT_ARG: case META_PRUNE_ARG: case META_SKIP_ARG: case META_THEN_ARG: @@ -8501,6 +8603,7 @@ for (;; pptr++) goto EXIT; case META_MARK: + case META_COMMIT_ARG: case META_PRUNE_ARG: case META_SKIP_ARG: case META_THEN_ARG: @@ -8572,6 +8675,32 @@ for (;; pptr++) case META_LOOKAHEADNOT: pptr = parsed_skip(pptr + 1, PSKIP_KET); if (pptr == NULL) goto PARSED_SKIP_FAILED; + + /* Also ignore any qualifiers that follow a lookahead assertion. */ + + switch (pptr[1]) + { + case META_ASTERISK: + case META_ASTERISK_PLUS: + case META_ASTERISK_QUERY: + case META_PLUS: + case META_PLUS_PLUS: + case META_PLUS_QUERY: + case META_QUERY: + case META_QUERY_PLUS: + case META_QUERY_QUERY: + pptr++; + break; + + case META_MINMAX: + case META_MINMAX_PLUS: + case META_MINMAX_QUERY: + pptr += 3; + break; + + default: + break; + } break; /* Lookbehinds can be ignored, but must themselves be checked. */ @@ -8942,6 +9071,7 @@ for (pptr = cb->parsed_pattern; *pptr != META_END; pptr++) break; case META_MARK: + case META_COMMIT_ARG: case META_PRUNE_ARG: case META_SKIP_ARG: case META_THEN_ARG: diff --git a/thirdparty/pcre2/src/pcre2_convert.c b/thirdparty/pcre2/src/pcre2_convert.c index bdf9b86df6..1dd5c337dc 100644 --- a/thirdparty/pcre2/src/pcre2_convert.c +++ b/thirdparty/pcre2/src/pcre2_convert.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -1066,11 +1066,12 @@ BOOL utf = (options & PCRE2_CONVERT_UTF) != 0; uint32_t pattype = options & TYPE_OPTIONS; if (pattern == NULL || bufflenptr == NULL) return PCRE2_ERROR_NULL; + if ((options & ~ALL_OPTIONS) != 0 || /* Undefined bit set */ (pattype & (~pattype+1)) != pattype || /* More than one type set */ pattype == 0) /* No type set */ { - *bufflenptr = 0; /* Error offset */ + *bufflenptr = 0; /* Error offset */ return PCRE2_ERROR_BADOPTION; } @@ -1081,7 +1082,11 @@ if (ccontext == NULL) ccontext = /* Check UTF if required. */ #ifndef SUPPORT_UNICODE -if (utf) return PCRE2_ERROR_UNICODE_NOT_SUPPORTED; +if (utf) + { + *bufflenptr = 0; /* Error offset */ + return PCRE2_ERROR_UNICODE_NOT_SUPPORTED; + } #else if (utf && (options & PCRE2_CONVERT_NO_UTF_CHECK) == 0) { @@ -1126,6 +1131,7 @@ for (i = 0; i < 2; i++) break; default: + *bufflenptr = 0; /* Error offset */ return PCRE2_ERROR_INTERNAL; } diff --git a/thirdparty/pcre2/src/pcre2_dfa_match.c b/thirdparty/pcre2/src/pcre2_dfa_match.c index c6184ff5e9..9b43237da7 100644 --- a/thirdparty/pcre2/src/pcre2_dfa_match.c +++ b/thirdparty/pcre2/src/pcre2_dfa_match.c @@ -181,7 +181,8 @@ static const uint8_t coptable[] = { 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ - 0, 0, 0, 0, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ + 0, 0, /* COMMIT, COMMIT_ARG */ + 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0 /* CLOSE, SKIPZERO, DEFINE */ }; @@ -254,7 +255,8 @@ static const uint8_t poptable[] = { 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ - 0, 0, 0, 0, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ + 0, 0, /* COMMIT, COMMIT_ARG */ + 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0 /* CLOSE, SKIPZERO, DEFINE */ }; @@ -292,6 +294,35 @@ typedef struct stateblock { #define INTS_PER_STATEBLOCK (int)(sizeof(stateblock)/sizeof(int)) +/* Before version 10.32 the recursive calls of internal_dfa_match() were passed +local working space and output vectors that were created on the stack. This has +caused issues for some patterns, especially in small-stack environments such as +Windows. A new scheme is now in use which sets up a vector on the stack, but if +this is too small, heap memory is used, up to the heap_limit. The main +parameters are all numbers of ints because the workspace is a vector of ints. + +The size of the starting stack vector, DFA_START_RWS_SIZE, is in bytes, and is +defined in pcre2_internal.h so as to be available to pcre2test when it is +finding the minimum heap requirement for a match. */ + +#define OVEC_UNIT (sizeof(PCRE2_SIZE)/sizeof(int)) + +#define RWS_BASE_SIZE (DFA_START_RWS_SIZE/sizeof(int)) /* Stack vector */ +#define RWS_RSIZE 1000 /* Work size for recursion */ +#define RWS_OVEC_RSIZE (1000*OVEC_UNIT) /* Ovector for recursion */ +#define RWS_OVEC_OSIZE (2*OVEC_UNIT) /* Ovector in other cases */ + +/* This structure is at the start of each workspace block. */ + +typedef struct RWS_anchor { + struct RWS_anchor *next; + unsigned int size; /* Number of ints */ + unsigned int free; /* Number of ints */ +} RWS_anchor; + +#define RWS_ANCHOR_SIZE (sizeof(RWS_anchor)/sizeof(int)) + + /************************************************* * Process a callout * @@ -354,6 +385,61 @@ return (mb->callout)(cb, mb->callout_data); /************************************************* +* Expand local workspace memory * +*************************************************/ + +/* This function is called when internal_dfa_match() is about to be called +recursively and there is insufficient working space left in the current +workspace block. If there's an existing next block, use it; otherwise get a new +block unless the heap limit is reached. + +Arguments: + rwsptr pointer to block pointer (updated) + ovecsize space needed for an ovector + mb the match block + +Returns: 0 rwsptr has been updated + !0 an error code +*/ + +static int +more_workspace(RWS_anchor **rwsptr, unsigned int ovecsize, dfa_match_block *mb) +{ +RWS_anchor *rws = *rwsptr; +RWS_anchor *new; + +if (rws->next != NULL) + { + new = rws->next; + } + +/* All sizes are in units of sizeof(int), except for mb->heaplimit, which is in +kibibytes. */ + +else + { + unsigned int newsize = rws->size * 2; + unsigned int heapleft = (unsigned int) + (((1024/sizeof(int))*mb->heap_limit - mb->heap_used)); + if (newsize > heapleft) newsize = heapleft; + if (newsize < RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE) + return PCRE2_ERROR_HEAPLIMIT; + new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data); + if (new == NULL) return PCRE2_ERROR_NOMEMORY; + mb->heap_used += newsize; + new->next = NULL; + new->size = newsize; + rws->next = new; + } + +new->free = new->size - RWS_ANCHOR_SIZE; +*rwsptr = new; +return 0; +} + + + +/************************************************* * Match a Regular Expression - DFA engine * *************************************************/ @@ -431,7 +517,8 @@ internal_dfa_match( uint32_t offsetcount, int *workspace, int wscount, - uint32_t rlevel) + uint32_t rlevel, + int *RWS) { stateblock *active_states, *new_states, *temp_states; stateblock *next_active_state, *next_new_state; @@ -788,7 +875,7 @@ for (;;) else if (match_count > 0 && ++match_count * 2 > (int)offsetcount) match_count = 0; count = ((match_count == 0)? (int)offsetcount : match_count * 2) - 2; - if (count > 0) memmove(offsets + 2, offsets, + if (count > 0) (void)memmove(offsets + 2, offsets, (size_t)count * sizeof(PCRE2_SIZE)); if (offsetcount >= 2) { @@ -2587,10 +2674,22 @@ for (;;) case OP_ASSERTBACK: case OP_ASSERTBACK_NOT: { - PCRE2_SPTR endasscode = code + GET(code, 1); - PCRE2_SIZE local_offsets[2]; int rc; - int local_workspace[1000]; + int *local_workspace; + PCRE2_SIZE *local_offsets; + PCRE2_SPTR endasscode = code + GET(code, 1); + RWS_anchor *rws = (RWS_anchor *)RWS; + + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); @@ -2600,10 +2699,13 @@ for (;;) ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; if (rc < 0 && rc != PCRE2_ERROR_NOMATCH) return rc; if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK)) @@ -2615,8 +2717,6 @@ for (;;) case OP_COND: case OP_SCOND: { - PCRE2_SIZE local_offsets[1000]; - int local_workspace[1000]; int codelink = (int)GET(code, 1); PCRE2_UCHAR condcode; @@ -2673,8 +2773,22 @@ for (;;) else { int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; PCRE2_SPTR asscode = code + LINK_SIZE + 1; PCRE2_SPTR endasscode = asscode + GET(asscode, 1); + RWS_anchor *rws = (RWS_anchor *)RWS; + + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1); @@ -2684,10 +2798,13 @@ for (;;) ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; if (rc < 0 && rc != PCRE2_ERROR_NOMATCH) return rc; if ((rc >= 0) == @@ -2702,13 +2819,25 @@ for (;;) /*-----------------------------------------------------------------*/ case OP_RECURSE: { + int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; + RWS_anchor *rws = (RWS_anchor *)RWS; dfa_recursion_info *ri; - PCRE2_SIZE local_offsets[1000]; - int local_workspace[1000]; PCRE2_SPTR callpat = start_code + GET(code, 1); uint32_t recno = (callpat == mb->start_code)? 0 : GET2(callpat, 1 + LINK_SIZE); - int rc; + + if (rws->free < RWS_RSIZE + RWS_OVEC_RSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_RSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_RSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_RSIZE; /* Check for repeating a recursion without advancing the subject pointer. This should catch convoluted mutual recursions. (Some simple @@ -2732,11 +2861,13 @@ for (;;) ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_RSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + rws->free += RWS_RSIZE + RWS_OVEC_RSIZE; mb->recursive = new_recursive.prevrec; /* Done this recursion */ /* Ran out of internal offsets */ @@ -2782,10 +2913,25 @@ for (;;) case OP_SCBRAPOS: case OP_BRAPOSZERO: { + int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; PCRE2_SIZE charcount, matched_count; PCRE2_SPTR local_ptr = ptr; + RWS_anchor *rws = (RWS_anchor *)RWS; BOOL allow_zero; + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; + if (codevalue == OP_BRAPOSZERO) { allow_zero = TRUE; @@ -2798,19 +2944,17 @@ for (;;) for (matched_count = 0;; matched_count++) { - PCRE2_SIZE local_offsets[2]; - int local_workspace[1000]; - - int rc = internal_dfa_match( + rc = internal_dfa_match( mb, /* fixed match data */ code, /* this subexpression's code */ local_ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ /* Failed to match */ @@ -2827,6 +2971,8 @@ for (;;) local_ptr += charcount; /* Advance temporary position ptr */ } + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; + /* At this point we have matched the subpattern matched_count times, and local_ptr is pointing to the character after the end of the last match. */ @@ -2869,19 +3015,35 @@ for (;;) /*-----------------------------------------------------------------*/ case OP_ONCE: { - PCRE2_SIZE local_offsets[2]; - int local_workspace[1000]; + int rc; + int *local_workspace; + PCRE2_SIZE *local_offsets; + RWS_anchor *rws = (RWS_anchor *)RWS; - int rc = internal_dfa_match( + if (rws->free < RWS_RSIZE + RWS_OVEC_OSIZE) + { + rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); + if (rc != 0) return rc; + RWS = (int *)rws; + } + + local_offsets = (PCRE2_SIZE *)(RWS + rws->size - rws->free); + local_workspace = ((int *)local_offsets) + RWS_OVEC_OSIZE; + rws->free -= RWS_RSIZE + RWS_OVEC_OSIZE; + + rc = internal_dfa_match( mb, /* fixed match data */ code, /* this subexpression's code */ ptr, /* where we currently are */ (PCRE2_SIZE)(ptr - start_subject), /* start offset */ local_offsets, /* offset vector */ - sizeof(local_offsets)/sizeof(PCRE2_SIZE), /* size of same */ + RWS_OVEC_OSIZE/OVEC_UNIT, /* size of same */ local_workspace, /* workspace vector */ - sizeof(local_workspace)/sizeof(int), /* size of same */ - rlevel); /* function recursion level */ + RWS_RSIZE, /* size of same */ + rlevel, /* function recursion level */ + RWS); /* recursion workspace */ + + rws->free += RWS_RSIZE + RWS_OVEC_OSIZE; if (rc >= 0) { @@ -3063,6 +3225,7 @@ pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, PCRE2_SIZE start_offset, uint32_t options, pcre2_match_data *match_data, pcre2_match_context *mcontext, int *workspace, PCRE2_SIZE wscount) { +int rc; const pcre2_real_code *re = (const pcre2_real_code *)code; PCRE2_SPTR start_match; @@ -3071,9 +3234,9 @@ PCRE2_SPTR bumpalong_limit; PCRE2_SPTR req_cu_ptr; BOOL utf, anchored, startline, firstline; - BOOL has_first_cu = FALSE; BOOL has_req_cu = FALSE; + PCRE2_UCHAR first_cu = 0; PCRE2_UCHAR first_cu2 = 0; PCRE2_UCHAR req_cu = 0; @@ -3088,6 +3251,17 @@ pcre2_callout_block cb; dfa_match_block actual_match_block; dfa_match_block *mb = &actual_match_block; +/* Set up a starting block of memory for use during recursive calls to +internal_dfa_match(). By putting this on the stack, it minimizes resource use +in the case when it is not needed. If this is too small, more memory is +obtained from the heap. At the start of each block is an anchor structure.*/ + +int base_recursion_workspace[RWS_BASE_SIZE]; +RWS_anchor *rws = (RWS_anchor *)base_recursion_workspace; +rws->next = NULL; +rws->size = RWS_BASE_SIZE; +rws->free = RWS_BASE_SIZE - RWS_ANCHOR_SIZE; + /* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated subject string. */ @@ -3184,6 +3358,7 @@ if (mcontext == NULL) mb->memctl = re->memctl; mb->match_limit = PRIV(default_match_context).match_limit; mb->match_limit_depth = PRIV(default_match_context).depth_limit; + mb->heap_limit = PRIV(default_match_context).heap_limit; } else { @@ -3198,6 +3373,7 @@ else mb->memctl = mcontext->memctl; mb->match_limit = mcontext->match_limit; mb->match_limit_depth = mcontext->depth_limit; + mb->heap_limit = mcontext->heap_limit; } if (mb->match_limit > re->limit_match) @@ -3206,6 +3382,9 @@ if (mb->match_limit > re->limit_match) if (mb->match_limit_depth > re->limit_depth) mb->match_limit_depth = re->limit_depth; +if (mb->heap_limit > re->limit_heap) + mb->heap_limit = re->limit_heap; + mb->start_code = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) + re->name_count * re->name_entry_size; mb->tables = re->tables; @@ -3215,6 +3394,7 @@ mb->start_offset = start_offset; mb->moptions = options; mb->poptions = re->overall_options; mb->match_call_count = 0; +mb->heap_used = 0; /* Process the \R and newline settings. */ @@ -3351,8 +3531,6 @@ a match. */ for (;;) { - int rc; - /* ----------------- Start of match optimizations ---------------- */ /* There are some optimizations that avoid running the match if a known @@ -3544,7 +3722,7 @@ for (;;) in characters, we treat it as code units to avoid spending too much time in this optimization. */ - if (end_subject - start_match < re->minlength) return PCRE2_ERROR_NOMATCH; + if (end_subject - start_match < re->minlength) goto NOMATCH_EXIT; /* If req_cu is set, we know that that code unit must appear in the subject for the match to succeed. If the first code unit is set, req_cu @@ -3621,7 +3799,8 @@ for (;;) (uint32_t)match_data->oveccount * 2, /* actual size of same */ workspace, /* workspace vector */ (int)wscount, /* size of same */ - 0); /* function recurse level */ + 0, /* function recurse level */ + base_recursion_workspace); /* initial workspace for recursion */ /* Anything other than "no match" means we are done, always; otherwise, carry on only if not anchored. */ @@ -3637,7 +3816,7 @@ for (;;) match_data->rightchar = (PCRE2_SIZE)( mb->last_used_ptr - subject); match_data->startchar = (PCRE2_SIZE)(start_match - subject); match_data->rc = rc; - return rc; + goto EXIT; } /* Advance to the next subject character unless we are at the end of a line @@ -3668,8 +3847,18 @@ for (;;) } /* "Bumpalong" loop */ +NOMATCH_EXIT: +rc = PCRE2_ERROR_NOMATCH; + +EXIT: +while (rws->next != NULL) + { + RWS_anchor *next = rws->next; + rws->next = next->next; + mb->memctl.free(next, mb->memctl.memory_data); + } -return PCRE2_ERROR_NOMATCH; +return rc; } /* End of pcre2_dfa_match.c */ diff --git a/thirdparty/pcre2/src/pcre2_error.c b/thirdparty/pcre2/src/pcre2_error.c index d98cae9963..4b3b3f1bc0 100644 --- a/thirdparty/pcre2/src/pcre2_error.c +++ b/thirdparty/pcre2/src/pcre2_error.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -107,7 +107,7 @@ static const unsigned char compile_error_texts[] = /* 35 */ "lookbehind is too complicated\0" "\\C is not allowed in a lookbehind assertion in UTF-" XSTRING(PCRE2_CODE_UNIT_WIDTH) " mode\0" - "PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u\0" + "PCRE2 does not support \\F, \\L, \\l, \\N{name}, \\U, or \\u\0" "number after (?C is greater than 255\0" "closing parenthesis for (?C expected\0" /* 40 */ @@ -133,7 +133,8 @@ static const unsigned char compile_error_texts[] = "internal error: unknown newline setting\0" "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number\0" "(?R (recursive pattern call) must be followed by a closing parenthesis\0" - "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)\0" + /* "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)\0" */ + "obsolete error (should not occur)\0" /* Was the above */ /* 60 */ "(*VERB) not recognized or malformed\0" "group number is too big\0" @@ -160,7 +161,7 @@ static const unsigned char compile_error_texts[] = "using UCP is disabled by the application\0" "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0" "character code point value in \\u.... sequence is too large\0" - "digits missing in \\x{} or \\o{}\0" + "digits missing in \\x{} or \\o{} or \\N{U+}\0" "syntax error or number too big in (?(VERSION condition\0" /* 80 */ "internal error: unknown opcode in auto_possessify()\0" @@ -178,6 +179,8 @@ static const unsigned char compile_error_texts[] = "internal error: bad code value in parsed_skip()\0" "PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode\0" "invalid option bits with PCRE2_LITERAL\0" + "\\N{U+dddd} is supported only in Unicode (UTF) mode\0" + "invalid hyphen in option setting\0" ; /* Match-time and UTF error texts are in the same format. */ @@ -255,11 +258,13 @@ static const unsigned char match_error_texts[] = "expected closing curly bracket in replacement string\0" "bad substitution in replacement string\0" /* 60 */ - "match with end before start is not supported\0" + "match with end before start or start moved backwards is not supported\0" "too many replacements (more than INT_MAX)\0" "bad serialized data\0" "heap limit exceeded\0" "invalid syntax\0" + /* 65 */ + "internal error - duplicate substitution match\0" ; diff --git a/thirdparty/pcre2/src/pcre2_extuni.c b/thirdparty/pcre2/src/pcre2_extuni.c index 11a0bfbdd6..237211abf7 100644 --- a/thirdparty/pcre2/src/pcre2_extuni.c +++ b/thirdparty/pcre2/src/pcre2_extuni.c @@ -129,11 +129,11 @@ while (eptr < end_subject) if ((ricount & 1) != 0) break; /* Grapheme break required */ } - /* If Extend follows E_Base[_GAZ] do not update lgb; this allows - any number of Extend before a following E_Modifier. */ + /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this + allows any number of them before a following Extended_Pictographic. */ - if (rgb != ucp_gbExtend || - (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ)) + if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) || + lgb != ucp_gbExtended_Pictographic) lgb = rgb; eptr += len; diff --git a/thirdparty/pcre2/src/pcre2_find_bracket.c b/thirdparty/pcre2/src/pcre2_find_bracket.c index 357385a11c..70baa1394f 100644 --- a/thirdparty/pcre2/src/pcre2_find_bracket.c +++ b/thirdparty/pcre2/src/pcre2_find_bracket.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -131,6 +131,7 @@ for (;;) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: diff --git a/thirdparty/pcre2/src/pcre2_internal.h b/thirdparty/pcre2/src/pcre2_internal.h index 3db9d604f4..8750f2f174 100644 --- a/thirdparty/pcre2/src/pcre2_internal.h +++ b/thirdparty/pcre2/src/pcre2_internal.h @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -165,6 +165,16 @@ by "configure". */ #define INT64_OR_DOUBLE double #endif +/* External (in the C sense) functions and tables that are private to the +libraries are always referenced using the PRIV macro. This makes it possible +for pcre2test.c to include some of the source files from the libraries using a +different PRIV definition to avoid name clashes. It also makes it clear in the +code that a non-static object is being referenced. */ + +#ifndef PRIV +#define PRIV(name) _pcre2_##name +#endif + /* When compiling for use with the Virtual Pascal compiler, these functions need to have their names changed. PCRE2 must be compiled with the -DVPCOMPAT option on the command line. */ @@ -178,50 +188,15 @@ option on the command line. */ #define memset(s,c,n) _memset(s,c,n) #else /* VPCOMPAT */ -/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(), -define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY -is set. Otherwise, include an emulating function for those systems that have -neither (there some non-Unix environments where this is the case). */ +/* Otherwise, to cope with SunOS4 and other systems that lack memmove(), define +a macro that calls an emulating function. */ #ifndef HAVE_MEMMOVE -#undef memmove /* some systems may have a macro */ -#ifdef HAVE_BCOPY -#define memmove(a, b, c) bcopy(b, a, c) -#else /* HAVE_BCOPY */ -static void * -pcre2_memmove(void *d, const void *s, size_t n) -{ -size_t i; -unsigned char *dest = (unsigned char *)d; -const unsigned char *src = (const unsigned char *)s; -if (dest > src) - { - dest += n; - src += n; - for (i = 0; i < n; ++i) *(--dest) = *(--src); - return (void *)dest; - } -else - { - for (i = 0; i < n; ++i) *dest++ = *src++; - return (void *)(dest - n); - } -} -#define memmove(a, b, c) pcre2_memmove(a, b, c) -#endif /* not HAVE_BCOPY */ +#undef memmove /* Some systems may have a macro */ +#define memmove(a, b, c) PRIV(memmove)(a, b, c) #endif /* not HAVE_MEMMOVE */ #endif /* not VPCOMPAT */ -/* External (in the C sense) functions and tables that are private to the -libraries are always referenced using the PRIV macro. This makes it possible -for pcre2test.c to include some of the source files from the libraries using a -different PRIV definition to avoid name clashes. It also makes it clear in the -code that a non-static object is being referenced. */ - -#ifndef PRIV -#define PRIV(name) _pcre2_##name -#endif - /* This is an unsigned int value that no UTF character can ever have, as Unicode doesn't go beyond 0x0010ffff. */ @@ -247,12 +222,17 @@ not rely on this. */ pcre2_match() is allocated on the system stack, of this size (bytes). The size must be a multiple of sizeof(PCRE2_SPTR) in all environments, so making it a multiple of 8 is best. Typical frame sizes are a few hundred bytes (it depends -on the number of capturing parentheses) so 20K handles quite a few frames. A +on the number of capturing parentheses) so 20KiB handles quite a few frames. A larger vector on the heap is obtained for patterns that need more frames. The maximum size of this can be limited. */ #define START_FRAMES_SIZE 20480 +/* Similarly, for DFA matching, an initial internal workspace vector is +allocated on the stack. */ + +#define DFA_START_RWS_SIZE 30720 + /* Define the default BSR convention. */ #ifdef BSR_ANYCRLF @@ -585,14 +565,15 @@ these tables. */ #define cbit_cntrl 288 /* [:cntrl:] */ #define cbit_length 320 /* Length of the cbits table */ -/* Bit definitions for entries in the ctypes table. */ +/* Bit definitions for entries in the ctypes table. Do not change these values +without checking pcre2_jit_compile.c, which has an assertion to ensure that +ctype_word has the value 16. */ #define ctype_space 0x01 #define ctype_letter 0x02 #define ctype_digit 0x04 -#define ctype_xdigit 0x08 +#define ctype_xdigit 0x08 /* not actually used any more */ #define ctype_word 0x10 /* alphanumeric or '_' */ -#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ /* Offsets of the various tables from the base tables pointer, and total length of the tables. */ @@ -1267,36 +1248,6 @@ contain characters with values greater than 255. */ #define XCL_PROP 3 /* Unicode property (2-byte property code follows) */ #define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */ -/* Escape items that are just an encoding of a particular data value. These -appear in the escapes[] table in pcre2_compile.c as positive numbers. */ - -#ifndef ESC_a -#define ESC_a CHAR_BEL -#endif - -#ifndef ESC_e -#define ESC_e CHAR_ESC -#endif - -#ifndef ESC_f -#define ESC_f CHAR_FF -#endif - -#ifndef ESC_n -#define ESC_n CHAR_LF -#endif - -#ifndef ESC_r -#define ESC_r CHAR_CR -#endif - -/* We can't officially use ESC_t because it is a POSIX reserved identifier -(presumably because of all the others like size_t). */ - -#ifndef ESC_tee -#define ESC_tee CHAR_HT -#endif - /* These are escaped items that aren't just an encoding of a particular data value such as \n. They must have non-zero values, as check_escape() returns 0 for a data character. In the escapes[] table in pcre2_compile.c their values @@ -1578,23 +1529,26 @@ enum { OP_THEN, /* 155 */ OP_THEN_ARG, /* 156 same, but with argument */ OP_COMMIT, /* 157 */ + OP_COMMIT_ARG, /* 158 same, but with argument */ - /* These are forced failure and success verbs */ + /* These are forced failure and success verbs. FAIL and ACCEPT do accept an + argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL) + without the need for a special opcode. */ - OP_FAIL, /* 158 */ - OP_ACCEPT, /* 159 */ - OP_ASSERT_ACCEPT, /* 160 Used inside assertions */ - OP_CLOSE, /* 161 Used before OP_ACCEPT to close open captures */ + OP_FAIL, /* 159 */ + OP_ACCEPT, /* 160 */ + OP_ASSERT_ACCEPT, /* 161 Used inside assertions */ + OP_CLOSE, /* 162 Used before OP_ACCEPT to close open captures */ /* This is used to skip a subpattern with a {0} quantifier */ - OP_SKIPZERO, /* 162 */ + OP_SKIPZERO, /* 163 */ /* This is used to identify a DEFINE group during compilation so that it can be checked for having only one branch. It is changed to OP_FALSE before compilation finishes. */ - OP_DEFINE, /* 163 */ + OP_DEFINE, /* 164 */ /* This is not an opcode, but is used to check that tables indexed by opcode are the correct length, in order to catch updating errors - there have been @@ -1650,7 +1604,7 @@ some cases doesn't actually use these names at all). */ "Cond false", "Cond true", \ "Brazero", "Braminzero", "Braposzero", \ "*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \ - "*THEN", "*THEN", "*COMMIT", "*FAIL", \ + "*THEN", "*THEN", "*COMMIT", "*COMMIT", "*FAIL", \ "*ACCEPT", "*ASSERT_ACCEPT", \ "Close", "Skip zero", "Define" @@ -1742,7 +1696,8 @@ in UTF-8 mode. The code that uses this table must know about such things. */ 3, 1, 3, /* MARK, PRUNE, PRUNE_ARG */ \ 1, 3, /* SKIP, SKIP_ARG */ \ 1, 3, /* THEN, THEN_ARG */ \ - 1, 1, 1, 1, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ \ + 1, 3, /* COMMIT, COMMIT_ARG */ \ + 1, 1, 1, /* FAIL, ACCEPT, ASSERT_ACCEPT */ \ 1+IMM2_SIZE, 1, /* CLOSE, SKIPZERO */ \ 1 /* DEFINE */ @@ -1896,7 +1851,7 @@ extern const ucd_record PRIV(ucd_records)[]; #if PCRE2_CODE_UNIT_WIDTH == 32 extern const ucd_record PRIV(dummy_ucd_record)[]; #endif -extern const uint8_t PRIV(ucd_stage1)[]; +extern const uint16_t PRIV(ucd_stage1)[]; extern const uint16_t PRIV(ucd_stage2)[]; extern const uint32_t PRIV(ucp_gbtable)[]; extern const uint32_t PRIV(ucp_gentype)[]; @@ -1976,6 +1931,14 @@ extern int _pcre2_valid_utf(PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE *); extern BOOL _pcre2_was_newline(PCRE2_SPTR, uint32_t, PCRE2_SPTR, uint32_t *, BOOL); extern BOOL _pcre2_xclass(uint32_t, PCRE2_SPTR, BOOL); + +/* This function is needed only when memmove() is not available. */ + +#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) +#define _pcre2_memmove PCRE2_SUFFIX(_pcre2_memmove) +extern void * _pcre2_memmove(void *, const void *, size_t); +#endif + #endif /* PCRE2_CODE_UNIT_WIDTH */ #endif /* PCRE2_INTERNAL_H_IDEMPOTENT_GUARD */ diff --git a/thirdparty/pcre2/src/pcre2_intmodedep.h b/thirdparty/pcre2/src/pcre2_intmodedep.h index c4c4c3adb9..62626d0a8a 100644 --- a/thirdparty/pcre2/src/pcre2_intmodedep.h +++ b/thirdparty/pcre2/src/pcre2_intmodedep.h @@ -793,11 +793,23 @@ typedef struct heapframe { uint8_t return_id; /* Where to go on in internal "return" */ uint8_t op; /* Processing opcode */ + /* At this point, the structure is 16-bit aligned. On most architectures + the alignment requirement for a pointer will ensure that the eptr field below + is 32-bit or 64-bit aligned. However, on m68k it is fine to have a pointer + that is 16-bit aligned. We must therefore ensure that what comes between here + and eptr is an odd multiple of 16 bits so as to get back into 32-bit + alignment. This happens naturally when PCRE2_UCHAR is 8 bits wide, but needs + fudges in the other cases. In the 32-bit case the padding comes first so that + the occu field itself is 32-bit aligned. Without the padding, this structure + is no longer a multiple of PCRE2_SIZE on m68k, and the check below fails. */ + #if PCRE2_CODE_UNIT_WIDTH == 8 PCRE2_UCHAR occu[6]; /* Used for other case code units */ #elif PCRE2_CODE_UNIT_WIDTH == 16 PCRE2_UCHAR occu[2]; /* Used for other case code units */ + uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ #else + uint8_t unused[2]; /* Ensure 32-bit alignment (see above) */ PCRE2_UCHAR occu[1]; /* Used for other case code units */ #endif @@ -818,6 +830,9 @@ typedef struct heapframe { PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ } heapframe; +/* This typedef is a check that the size of the heapframe structure is a +multiple of PCRE2_SIZE. See various comments above. */ + typedef char check_heapframe_size[ ((sizeof(heapframe) % sizeof(PCRE2_SIZE)) == 0)? (+1):(-1)]; @@ -881,6 +896,8 @@ typedef struct dfa_match_block { PCRE2_SPTR last_used_ptr; /* Latest consulted character */ const uint8_t *tables; /* Character tables */ PCRE2_SIZE start_offset; /* The start offset value */ + PCRE2_SIZE heap_limit; /* As it says */ + PCRE2_SIZE heap_used; /* As it says */ uint32_t match_limit; /* As it says */ uint32_t match_limit_depth; /* As it says */ uint32_t match_call_count; /* Number of calls of internal function */ diff --git a/thirdparty/pcre2/src/pcre2_jit_compile.c b/thirdparty/pcre2/src/pcre2_jit_compile.c index 80ed1c4ca6..32e985b793 100644 --- a/thirdparty/pcre2/src/pcre2_jit_compile.c +++ b/thirdparty/pcre2/src/pcre2_jit_compile.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -839,6 +839,7 @@ switch(*cc) #endif case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: @@ -939,6 +940,7 @@ while (cc < ccend) common->control_head_ptr = 1; /* Fall through. */ + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_MARK: if (common->mark_ptr == 0) @@ -1553,6 +1555,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -1733,6 +1736,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -2041,6 +2045,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -2428,6 +2433,7 @@ while (cc < ccend) break; case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_THEN_ARG: SLJIT_ASSERT(common->mark_ptr != 0); @@ -3666,7 +3672,8 @@ if (!common->utf) #endif OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); -OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); +OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); +OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); @@ -5894,6 +5901,8 @@ for (i = 0; i < 32; i++) } } +if (len == 0) return FALSE; /* Should never occur, but stops analyzers complaining. */ + i = 0; j = 0; @@ -6627,7 +6636,8 @@ if (needstype || needsscript) #endif OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); - OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); + OP1(SLJIT_MOV_U16, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_stage1)); OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK); OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); @@ -7254,10 +7264,11 @@ while (cc < end_subject) if ((ricount & 1) != 0) break; /* Grapheme break required */ } - /* If Extend follows E_Base[_GAZ] do not update lgb; this allows - any number of Extend before a following E_Modifier. */ + /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this + allows any number of them before a following Extended_Pictographic. */ - if (rgb != ucp_gbExtend || (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ)) + if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) || + lgb != ucp_gbExtended_Pictographic) lgb = rgb; prevcc = cc; @@ -7309,10 +7320,11 @@ while (cc < end_subject) if ((ricount & 1) != 0) break; /* Grapheme break required */ } - /* If Extend follows E_Base[_GAZ] do not update lgb; this allows - any number of Extend before a following E_Modifier. */ + /* If Extend or ZWJ follows Extended_Pictographic, do not update lgb; this + allows any number of them before a following Extended_Pictographic. */ - if (rgb != ucp_gbExtend || (lgb != ucp_gbE_Base && lgb != ucp_gbE_Base_GAZ)) + if ((rgb != ucp_gbExtend && rgb != ucp_gbZWJ) || + lgb != ucp_gbExtended_Pictographic) lgb = rgb; cc++; @@ -10346,7 +10358,8 @@ backtrack_common *backtrack; PCRE2_UCHAR opcode = *cc; PCRE2_SPTR ccend = cc + 1; -if (opcode == OP_PRUNE_ARG || opcode == OP_SKIP_ARG || opcode == OP_THEN_ARG) +if (opcode == OP_COMMIT_ARG || opcode == OP_PRUNE_ARG || + opcode == OP_SKIP_ARG || opcode == OP_THEN_ARG) ccend += 2 + cc[1]; PUSH_BACKTRACK(sizeof(backtrack_common), cc, NULL); @@ -10358,7 +10371,7 @@ if (opcode == OP_SKIP) return ccend; } -if (opcode == OP_PRUNE_ARG || opcode == OP_THEN_ARG) +if (opcode == OP_COMMIT_ARG || opcode == OP_PRUNE_ARG || opcode == OP_THEN_ARG) { OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)(cc + 2)); @@ -10677,6 +10690,7 @@ while (cc < ccend) case OP_THEN: case OP_THEN_ARG: case OP_COMMIT: + case OP_COMMIT_ARG: cc = compile_control_verb_matchingpath(common, cc, parent); break; @@ -11751,6 +11765,7 @@ while (current) break; case OP_COMMIT: + case OP_COMMIT_ARG: if (!common->local_quit_available) OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE2_ERROR_NOMATCH); if (common->quit_label == NULL) diff --git a/thirdparty/pcre2/src/pcre2_maketables.c b/thirdparty/pcre2/src/pcre2_maketables.c index 2c7ae84d86..537edba8c3 100644 --- a/thirdparty/pcre2/src/pcre2_maketables.c +++ b/thirdparty/pcre2/src/pcre2_maketables.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -141,13 +141,6 @@ for (i = 0; i < 256; i++) if (isdigit(i)) x += ctype_digit; if (isxdigit(i)) x += ctype_xdigit; if (isalnum(i) || i == '_') x += ctype_word; - - /* Note: strchr includes the terminating zero in the characters it considers. - In this instance, that is ok because we want binary zero to be flagged as a - meta-character, which in this sense is any character that terminates a run - of data characters. */ - - if (strchr("\\*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; } diff --git a/thirdparty/pcre2/src/pcre2_match.c b/thirdparty/pcre2/src/pcre2_match.c index 79cc93f918..8741e1432d 100644 --- a/thirdparty/pcre2/src/pcre2_match.c +++ b/thirdparty/pcre2/src/pcre2_match.c @@ -43,11 +43,11 @@ POSSIBILITY OF SUCH DAMAGE. #include "config.h" #endif -/* These defines enables debugging code */ +/* These defines enable debugging code */ -//#define DEBUG_FRAMES_DISPLAY -//#define DEBUG_SHOW_OPS -//#define DEBUG_SHOW_RMATCH +/* #define DEBUG_FRAMES_DISPLAY */ +/* #define DEBUG_SHOW_OPS */ +/* #define DEBUG_SHOW_RMATCH */ #ifdef DEBUG_FRAME_DISPLAY #include <stdarg.h> @@ -149,7 +149,7 @@ changed, the code at RETURN_SWITCH below must be updated in sync. */ enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10, RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20, RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30, - RM31, RM32, RM33, RM34, RM35 }; + RM31, RM32, RM33, RM34, RM35, RM36 }; #ifdef SUPPORT_WIDE_CHARS enum { RM100=100, RM101 }; @@ -770,7 +770,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* ===================================================================== */ /* Real or forced end of the pattern, assertion, or recursion. In an assertion ACCEPT, update the last used pointer and remember the current - frame so that the captures can be fished out of it. */ + frame so that the captures and mark can be fished out of it. */ case OP_ASSERT_ACCEPT: if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr; @@ -1776,7 +1776,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* ===================================================================== */ - /* Match a bit-mapped character class, possibly repeatedly. These op codes + /* Match a bit-mapped character class, possibly repeatedly. These opcodes are used when all the characters in the class have values in the range 0-255, and either the matching is caseful, or the characters are in the range 0-127 when UTF processing is enabled. The only difference between @@ -1962,11 +1962,15 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (reptype == REPTYPE_POS) continue; /* No backtracking */ + /* After \C in UTF mode, Lstart_eptr might be in the middle of a + Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't + go too far. */ + for (;;) { RMATCH(Fecode, RM201); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (Feptr-- == Lstart_eptr) break; /* Tried at original position */ + if (Feptr-- <= Lstart_eptr) break; /* Tried at original position */ BACKCHAR(Feptr); } } @@ -2126,11 +2130,15 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (reptype == REPTYPE_POS) continue; /* No backtracking */ + /* After \C in UTF mode, Lstart_eptr might be in the middle of a + Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't + go too far. */ + for(;;) { RMATCH(Fecode, RM101); if (rrc != MATCH_NOMATCH) RRETURN(rrc); - if (Feptr-- == Lstart_eptr) break; /* Tried at original position */ + if (Feptr-- <= Lstart_eptr) break; /* Tried at original position */ #ifdef SUPPORT_UNICODE if (utf) BACKCHAR(Feptr); #endif @@ -2456,7 +2464,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* ===================================================================== */ /* Match a single character type repeatedly. Note that the property type - does not need to be in a stack frame as it not used within an RMATCH() + does not need to be in a stack frame as it is not used within an RMATCH() loop. */ #define Lstart_eptr F->temp_sptr[0] @@ -4002,8 +4010,8 @@ fprintf(stderr, "++ op=%d\n", *Fecode); if (reptype == REPTYPE_POS) continue; /* No backtracking */ /* After \C in UTF mode, Lstart_eptr might be in the middle of a - Unicode character. Use <= pp to ensure backtracking doesn't go too far. - */ + Unicode character. Use <= Lstart_eptr to ensure backtracking doesn't + go too far. */ for(;;) { @@ -4135,7 +4143,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); } break; - /* The "byte" (i.e. "code unit") case is the same as non-UTF */ + /* The "byte" (i.e. "code unit") case is the same as non-UTF */ case OP_ANYBYTE: fc = Lmax - Lmin; @@ -5111,7 +5119,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); /* Positive assertions are like other groups except that PCRE doesn't allow the effect of (*THEN) to escape beyond an assertion; it is therefore treated as NOMATCH. (*ACCEPT) is treated as successful assertion, with its - captures retained. Any other return is an error. */ + captures and mark retained. Any other return is an error. */ #define Lframe_type F->temp_32[0] @@ -5128,6 +5136,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); (char *)assert_accept_frame + offsetof(heapframe, ovector), assert_accept_frame->offset_top * sizeof(PCRE2_SIZE)); Foffset_top = assert_accept_frame->offset_top; + Fmark = assert_accept_frame->mark; break; } if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); @@ -5416,7 +5425,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); Feptr -= number; } - /* Save the earliest consulted character, then skip to next op code */ + /* Save the earliest consulted character, then skip to next opcode */ if (Feptr < mb->start_used_ptr) mb->start_used_ptr = Feptr; Fecode += 1 + LINK_SIZE; @@ -5501,7 +5510,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode); frame so that it points to the final branch. */ case OP_ONCE: - Fback_frame = ((char *)F - (char *)P) + frame_size; + Fback_frame = ((char *)F - (char *)P); for (;;) { uint32_t y = GET(P->ecode,1); @@ -5829,6 +5838,13 @@ fprintf(stderr, "++ op=%d\n", *Fecode); mb->verb_current_recurse = Fcurrent_recurse; RRETURN(MATCH_COMMIT); + case OP_COMMIT_ARG: + Fmark = mb->nomatch_mark = Fecode + 2; + RMATCH(Fecode + PRIV(OP_lengths)[*Fecode] + Fecode[1], RM36); + if (rrc != MATCH_NOMATCH) RRETURN(rrc); + mb->verb_current_recurse = Fcurrent_recurse; + RRETURN(MATCH_COMMIT); + case OP_PRUNE: RMATCH(Fecode + PRIV(OP_lengths)[*Fecode], RM14); if (rrc != MATCH_NOMATCH) RRETURN(rrc); @@ -5921,7 +5937,7 @@ in rrc. */ RETURN_SWITCH: if (Frdepth == 0) return rrc; /* Exit from the top level */ -F = (heapframe *)((char *)F - Fback_frame); /* Back track */ +F = (heapframe *)((char *)F - Fback_frame); /* Backtrack */ mb->cb->callout_flags |= PCRE2_CALLOUT_BACKTRACK; /* Note for callouts */ #ifdef DEBUG_SHOW_RMATCH @@ -5934,7 +5950,7 @@ switch (Freturn_id) LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(16) LBL(17) LBL(18) LBL(19) LBL(20) LBL(21) LBL(22) LBL(23) LBL(24) LBL(25) LBL(26) LBL(27) LBL(28) LBL(29) LBL(30) LBL(31) LBL(32) - LBL(33) LBL(34) LBL(35) + LBL(33) LBL(34) LBL(35) LBL(36) #ifdef SUPPORT_WIDE_CHARS LBL(100) LBL(101) @@ -6275,7 +6291,7 @@ mb->match_limit_depth = (mcontext->depth_limit < re->limit_depth)? /* If a pattern has very many capturing parentheses, the frame size may be very large. Ensure that there are at least 10 available frames by getting an initial vector on the heap if necessary, except when the heap limit prevents this. Get -fewer if possible. (The heap limit is in kilobytes.) */ +fewer if possible. (The heap limit is in kibibytes.) */ if (frame_size <= START_FRAMES_SIZE/10) { diff --git a/thirdparty/pcre2/src/pcre2_pattern_info.c b/thirdparty/pcre2/src/pcre2_pattern_info.c index 906e9198f5..a29f5eff67 100644 --- a/thirdparty/pcre2/src/pcre2_pattern_info.c +++ b/thirdparty/pcre2/src/pcre2_pattern_info.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -390,6 +390,7 @@ while (TRUE) #endif case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: diff --git a/thirdparty/pcre2/src/pcre2_serialize.c b/thirdparty/pcre2/src/pcre2_serialize.c index d2cc603cbb..cec1a035d1 100644 --- a/thirdparty/pcre2/src/pcre2_serialize.c +++ b/thirdparty/pcre2/src/pcre2_serialize.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -127,7 +127,25 @@ dst_bytes += tables_length; for (i = 0; i < number_of_codes; i++) { re = (const pcre2_real_code *)(codes[i]); - memcpy(dst_bytes, (char *)re, re->blocksize); + (void)memcpy(dst_bytes, (char *)re, re->blocksize); + + /* Certain fields in the compiled code block are re-set during + deserialization. In order to ensure that the serialized data stream is always + the same for the same pattern, set them to zero here. We can't assume the + copy of the pattern is correctly aligned for accessing the fields as part of + a structure. Note the use of sizeof(void *) in the second of these, to + specify the size of a pointer. If sizeof(uint8_t *) is used (tables is a + pointer to uint8_t), gcc gives a warning because the first argument is also a + pointer to uint8_t. Casting the first argument to (void *) can stop this, but + it didn't stop Coverity giving the same complaint. */ + + (void)memset(dst_bytes + offsetof(pcre2_real_code, memctl), 0, + sizeof(pcre2_memctl)); + (void)memset(dst_bytes + offsetof(pcre2_real_code, tables), 0, + sizeof(void *)); + (void)memset(dst_bytes + offsetof(pcre2_real_code, executable_jit), 0, + sizeof(void *)); + dst_bytes += re->blocksize; } diff --git a/thirdparty/pcre2/src/pcre2_string_utils.c b/thirdparty/pcre2/src/pcre2_string_utils.c index 2a1f282629..d6be01acf5 100644 --- a/thirdparty/pcre2/src/pcre2_string_utils.c +++ b/thirdparty/pcre2/src/pcre2_string_utils.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -51,6 +51,42 @@ functions work only on 8-bit data. */ /************************************************* +* Emulated memmove() for systems without it * +*************************************************/ + +/* This function can make use of bcopy() if it is available. Otherwise do it by +steam, as there some non-Unix environments that lack both memmove() and +bcopy(). */ + +#if !defined(VPCOMPAT) && !defined(HAVE_MEMMOVE) +void * +PRIV(memmove)(void *d, const void *s, size_t n) +{ +#ifdef HAVE_BCOPY +bcopy(s, d, n); +return d; +#else +size_t i; +unsigned char *dest = (unsigned char *)d; +const unsigned char *src = (const unsigned char *)s; +if (dest > src) + { + dest += n; + src += n; + for (i = 0; i < n; ++i) *(--dest) = *(--src); + return (void *)dest; + } +else + { + for (i = 0; i < n; ++i) *dest++ = *src++; + return (void *)(dest - n); + } +#endif /* not HAVE_BCOPY */ +} +#endif /* not VPCOMPAT && not HAVE_MEMMOVE */ + + +/************************************************* * Compare two zero-terminated PCRE2 strings * *************************************************/ diff --git a/thirdparty/pcre2/src/pcre2_study.c b/thirdparty/pcre2/src/pcre2_study.c index b92686759d..acbf98b41b 100644 --- a/thirdparty/pcre2/src/pcre2_study.c +++ b/thirdparty/pcre2/src/pcre2_study.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -707,6 +707,7 @@ for (;;) /* Skip these, but we need to add in the name length. */ case OP_MARK: + case OP_COMMIT_ARG: case OP_PRUNE_ARG: case OP_SKIP_ARG: case OP_THEN_ARG: @@ -956,6 +957,7 @@ do case OP_CIRCM: case OP_CLOSE: case OP_COMMIT: + case OP_COMMIT_ARG: case OP_COND: case OP_CREF: case OP_FALSE: @@ -1274,7 +1276,7 @@ do break; /* Single character types set the bits and stop. Note that if PCRE2_UCP - is set, we do not see these op codes because \d etc are converted to + is set, we do not see these opcodes because \d etc are converted to properties. Therefore, these apply in the case when only characters less than 256 are recognized to match the types. */ diff --git a/thirdparty/pcre2/src/pcre2_substitute.c b/thirdparty/pcre2/src/pcre2_substitute.c index 8da951fc6e..ab8d10908a 100644 --- a/thirdparty/pcre2/src/pcre2_substitute.c +++ b/thirdparty/pcre2/src/pcre2_substitute.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -238,10 +238,12 @@ PCRE2_SPTR repend; PCRE2_SIZE extra_needed = 0; PCRE2_SIZE buff_offset, buff_length, lengthleft, fraglength; PCRE2_SIZE *ovector; +PCRE2_SIZE ovecsave[3]; buff_offset = 0; lengthleft = buff_length = *blength; *blength = PCRE2_UNSET; +ovecsave[0] = ovecsave[1] = ovecsave[2] = PCRE2_UNSET; /* Partial matching is not valid. */ @@ -361,13 +363,33 @@ do } /* Handle a successful match. Matches that use \K to end before they start - are not supported. */ - - if (ovector[1] < ovector[0]) + or start before the current point in the subject are not supported. */ + + if (ovector[1] < ovector[0] || ovector[0] < start_offset) { rc = PCRE2_ERROR_BADSUBSPATTERN; goto EXIT; } + + /* Check for the same match as previous. This is legitimate after matching an + empty string that starts after the initial match offset. We have tried again + at the match point in case the pattern is one like /(?<=\G.)/ which can never + match at its starting point, so running the match achieves the bumpalong. If + we do get the same (null) match at the original match point, it isn't such a + pattern, so we now do the empty string magic. In all other cases, a repeat + match should never occur. */ + + if (ovecsave[0] == ovector[0] && ovecsave[1] == ovector[1]) + { + if (ovector[0] == ovector[1] && ovecsave[2] != start_offset) + { + goptions = PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED; + ovecsave[2] = start_offset; + continue; /* Back to the top of the loop */ + } + rc = PCRE2_ERROR_INTERNAL_DUPMATCH; + goto EXIT; + } /* Count substitutions with a paranoid check for integer overflow; surely no real call to this function would ever hit this! */ @@ -799,13 +821,18 @@ do } /* End handling a literal code unit */ } /* End of loop for scanning the replacement. */ - /* The replacement has been copied to the output. Update the start offset to - point to the rest of the subject string. If we matched an empty string, - do the magic for global matches. */ - - start_offset = ovector[1]; - goptions = (ovector[0] != ovector[1])? 0 : + /* The replacement has been copied to the output. Save the details of this + match. See above for how this data is used. If we matched an empty string, do + the magic for global matches. Finally, update the start offset to point to + the rest of the subject string. */ + + ovecsave[0] = ovector[0]; + ovecsave[1] = ovector[1]; + ovecsave[2] = start_offset; + + goptions = (ovector[0] != ovector[1] || ovector[0] > start_offset)? 0 : PCRE2_ANCHORED|PCRE2_NOTEMPTY_ATSTART; + start_offset = ovector[1]; } while ((suboptions & PCRE2_SUBSTITUTE_GLOBAL) != 0); /* Repeat "do" loop */ /* Copy the rest of the subject. */ diff --git a/thirdparty/pcre2/src/pcre2_tables.c b/thirdparty/pcre2/src/pcre2_tables.c index 9f8dc293aa..83d6f9de55 100644 --- a/thirdparty/pcre2/src/pcre2_tables.c +++ b/thirdparty/pcre2/src/pcre2_tables.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2017 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -137,9 +137,10 @@ const uint32_t PRIV(ucp_gentype)[] = { /* This table encodes the rules for finding the end of an extended grapheme cluster. Every code point has a grapheme break property which is one of the -ucp_gbXX values defined in pcre2_ucp.h. The 2-dimensional table is indexed by -the properties of two adjacent code points. The left property selects a word -from the table, and the right property selects a bit from that word like this: +ucp_gbXX values defined in pcre2_ucp.h. These changed between Unicode versions +10 and 11. The 2-dimensional table is indexed by the properties of two adjacent +code points. The left property selects a word from the table, and the right +property selects a bit from that word like this: PRIV(ucp_gbtable)[left-property] & (1 << right-property) @@ -166,49 +167,41 @@ are implementing). 6. Do not break after Prepend characters. -7. Do not break within emoji modifier sequences (E_Base or E_Base_GAZ followed - by E_Modifier). Extend characters are allowed before the modifier; this - cannot be represented in this table, the code has to deal with it. +7. Do not break within emoji modifier sequences or emoji zwj sequences. That + is, do not break between characters with the Extended_Pictographic property. + Extend and ZWJ characters are allowed between the characters; this cannot be + represented in this table, the code has to deal with it. -8. Do not break within emoji zwj sequences (ZWJ followed by Glue_After_Zwj or - E_Base_GAZ). - -9. Do not break within emoji flag sequences. That is, do not break between +8. Do not break within emoji flag sequences. That is, do not break between regional indicator (RI) symbols if there are an odd number of RI characters before the break point. This table encodes "join RI characters"; the code has to deal with checking for previous adjoining RIs. -10. Otherwise, break everywhere. +9. Otherwise, break everywhere. */ #define ESZ (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbZWJ) const uint32_t PRIV(ucp_gbtable)[] = { - (1<<ucp_gbLF), /* 0 CR */ - 0, /* 1 LF */ - 0, /* 2 Control */ - ESZ, /* 3 Extend */ - ESZ|(1<<ucp_gbPrepend)| /* 4 Prepend */ + (1<<ucp_gbLF), /* 0 CR */ + 0, /* 1 LF */ + 0, /* 2 Control */ + ESZ, /* 3 Extend */ + ESZ|(1<<ucp_gbPrepend)| /* 4 Prepend */ (1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbT)| (1<<ucp_gbLV)|(1<<ucp_gbLVT)|(1<<ucp_gbOther)| - (1<<ucp_gbRegionalIndicator)| - (1<<ucp_gbE_Base)|(1<<ucp_gbE_Modifier)| - (1<<ucp_gbE_Base_GAZ)| - (1<<ucp_gbZWJ)|(1<<ucp_gbGlue_After_Zwj), - ESZ, /* 5 SpacingMark */ - ESZ|(1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbLV)| /* 6 L */ + (1<<ucp_gbRegionalIndicator), + ESZ, /* 5 SpacingMark */ + ESZ|(1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbLV)| /* 6 L */ (1<<ucp_gbLVT), - ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 7 V */ - ESZ|(1<<ucp_gbT), /* 8 T */ - ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 9 LV */ - ESZ|(1<<ucp_gbT), /* 10 LVT */ - (1<<ucp_gbRegionalIndicator), /* 11 RegionalIndicator */ - ESZ, /* 12 Other */ - ESZ|(1<<ucp_gbE_Modifier), /* 13 E_Base */ - ESZ, /* 14 E_Modifier */ - ESZ|(1<<ucp_gbE_Modifier), /* 15 E_Base_GAZ */ - ESZ|(1<<ucp_gbGlue_After_Zwj)|(1<<ucp_gbE_Base_GAZ), /* 16 ZWJ */ - ESZ /* 12 Glue_After_Zwj */ + ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 7 V */ + ESZ|(1<<ucp_gbT), /* 8 T */ + ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 9 LV */ + ESZ|(1<<ucp_gbT), /* 10 LVT */ + (1<<ucp_gbRegionalIndicator), /* 11 RegionalIndicator */ + ESZ, /* 12 Other */ + ESZ, /* 13 ZWJ */ + ESZ|(1<<ucp_gbExtended_Pictographic) /* 14 Extended Pictographic */ }; #undef ESZ @@ -282,6 +275,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */ #define STRING_Cyrillic0 STR_C STR_y STR_r STR_i STR_l STR_l STR_i STR_c "\0" #define STRING_Deseret0 STR_D STR_e STR_s STR_e STR_r STR_e STR_t "\0" #define STRING_Devanagari0 STR_D STR_e STR_v STR_a STR_n STR_a STR_g STR_a STR_r STR_i "\0" +#define STRING_Dogra0 STR_D STR_o STR_g STR_r STR_a "\0" #define STRING_Duployan0 STR_D STR_u STR_p STR_l STR_o STR_y STR_a STR_n "\0" #define STRING_Egyptian_Hieroglyphs0 STR_E STR_g STR_y STR_p STR_t STR_i STR_a STR_n STR_UNDERSCORE STR_H STR_i STR_e STR_r STR_o STR_g STR_l STR_y STR_p STR_h STR_s "\0" #define STRING_Elbasan0 STR_E STR_l STR_b STR_a STR_s STR_a STR_n "\0" @@ -292,9 +286,11 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */ #define STRING_Grantha0 STR_G STR_r STR_a STR_n STR_t STR_h STR_a "\0" #define STRING_Greek0 STR_G STR_r STR_e STR_e STR_k "\0" #define STRING_Gujarati0 STR_G STR_u STR_j STR_a STR_r STR_a STR_t STR_i "\0" +#define STRING_Gunjala_Gondi0 STR_G STR_u STR_n STR_j STR_a STR_l STR_a STR_UNDERSCORE STR_G STR_o STR_n STR_d STR_i "\0" #define STRING_Gurmukhi0 STR_G STR_u STR_r STR_m STR_u STR_k STR_h STR_i "\0" #define STRING_Han0 STR_H STR_a STR_n "\0" #define STRING_Hangul0 STR_H STR_a STR_n STR_g STR_u STR_l "\0" +#define STRING_Hanifi_Rohingya0 STR_H STR_a STR_n STR_i STR_f STR_i STR_UNDERSCORE STR_R STR_o STR_h STR_i STR_n STR_g STR_y STR_a "\0" #define STRING_Hanunoo0 STR_H STR_a STR_n STR_u STR_n STR_o STR_o "\0" #define STRING_Hatran0 STR_H STR_a STR_t STR_r STR_a STR_n "\0" #define STRING_Hebrew0 STR_H STR_e STR_b STR_r STR_e STR_w "\0" @@ -330,6 +326,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */ #define STRING_Lydian0 STR_L STR_y STR_d STR_i STR_a STR_n "\0" #define STRING_M0 STR_M "\0" #define STRING_Mahajani0 STR_M STR_a STR_h STR_a STR_j STR_a STR_n STR_i "\0" +#define STRING_Makasar0 STR_M STR_a STR_k STR_a STR_s STR_a STR_r "\0" #define STRING_Malayalam0 STR_M STR_a STR_l STR_a STR_y STR_a STR_l STR_a STR_m "\0" #define STRING_Mandaic0 STR_M STR_a STR_n STR_d STR_a STR_i STR_c "\0" #define STRING_Manichaean0 STR_M STR_a STR_n STR_i STR_c STR_h STR_a STR_e STR_a STR_n "\0" @@ -337,6 +334,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */ #define STRING_Masaram_Gondi0 STR_M STR_a STR_s STR_a STR_r STR_a STR_m STR_UNDERSCORE STR_G STR_o STR_n STR_d STR_i "\0" #define STRING_Mc0 STR_M STR_c "\0" #define STRING_Me0 STR_M STR_e "\0" +#define STRING_Medefaidrin0 STR_M STR_e STR_d STR_e STR_f STR_a STR_i STR_d STR_r STR_i STR_n "\0" #define STRING_Meetei_Mayek0 STR_M STR_e STR_e STR_t STR_e STR_i STR_UNDERSCORE STR_M STR_a STR_y STR_e STR_k "\0" #define STRING_Mende_Kikakui0 STR_M STR_e STR_n STR_d STR_e STR_UNDERSCORE STR_K STR_i STR_k STR_a STR_k STR_u STR_i "\0" #define STRING_Meroitic_Cursive0 STR_M STR_e STR_r STR_o STR_i STR_t STR_i STR_c STR_UNDERSCORE STR_C STR_u STR_r STR_s STR_i STR_v STR_e "\0" @@ -364,6 +362,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */ #define STRING_Old_North_Arabian0 STR_O STR_l STR_d STR_UNDERSCORE STR_N STR_o STR_r STR_t STR_h STR_UNDERSCORE STR_A STR_r STR_a STR_b STR_i STR_a STR_n "\0" #define STRING_Old_Permic0 STR_O STR_l STR_d STR_UNDERSCORE STR_P STR_e STR_r STR_m STR_i STR_c "\0" #define STRING_Old_Persian0 STR_O STR_l STR_d STR_UNDERSCORE STR_P STR_e STR_r STR_s STR_i STR_a STR_n "\0" +#define STRING_Old_Sogdian0 STR_O STR_l STR_d STR_UNDERSCORE STR_S STR_o STR_g STR_d STR_i STR_a STR_n "\0" #define STRING_Old_South_Arabian0 STR_O STR_l STR_d STR_UNDERSCORE STR_S STR_o STR_u STR_t STR_h STR_UNDERSCORE STR_A STR_r STR_a STR_b STR_i STR_a STR_n "\0" #define STRING_Old_Turkic0 STR_O STR_l STR_d STR_UNDERSCORE STR_T STR_u STR_r STR_k STR_i STR_c "\0" #define STRING_Oriya0 STR_O STR_r STR_i STR_y STR_a "\0" @@ -397,6 +396,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */ #define STRING_Sk0 STR_S STR_k "\0" #define STRING_Sm0 STR_S STR_m "\0" #define STRING_So0 STR_S STR_o "\0" +#define STRING_Sogdian0 STR_S STR_o STR_g STR_d STR_i STR_a STR_n "\0" #define STRING_Sora_Sompeng0 STR_S STR_o STR_r STR_a STR_UNDERSCORE STR_S STR_o STR_m STR_p STR_e STR_n STR_g "\0" #define STRING_Soyombo0 STR_S STR_o STR_y STR_o STR_m STR_b STR_o "\0" #define STRING_Sundanese0 STR_S STR_u STR_n STR_d STR_a STR_n STR_e STR_s STR_e "\0" @@ -469,6 +469,7 @@ const char PRIV(utt_names)[] = STRING_Cyrillic0 STRING_Deseret0 STRING_Devanagari0 + STRING_Dogra0 STRING_Duployan0 STRING_Egyptian_Hieroglyphs0 STRING_Elbasan0 @@ -479,9 +480,11 @@ const char PRIV(utt_names)[] = STRING_Grantha0 STRING_Greek0 STRING_Gujarati0 + STRING_Gunjala_Gondi0 STRING_Gurmukhi0 STRING_Han0 STRING_Hangul0 + STRING_Hanifi_Rohingya0 STRING_Hanunoo0 STRING_Hatran0 STRING_Hebrew0 @@ -517,6 +520,7 @@ const char PRIV(utt_names)[] = STRING_Lydian0 STRING_M0 STRING_Mahajani0 + STRING_Makasar0 STRING_Malayalam0 STRING_Mandaic0 STRING_Manichaean0 @@ -524,6 +528,7 @@ const char PRIV(utt_names)[] = STRING_Masaram_Gondi0 STRING_Mc0 STRING_Me0 + STRING_Medefaidrin0 STRING_Meetei_Mayek0 STRING_Mende_Kikakui0 STRING_Meroitic_Cursive0 @@ -551,6 +556,7 @@ const char PRIV(utt_names)[] = STRING_Old_North_Arabian0 STRING_Old_Permic0 STRING_Old_Persian0 + STRING_Old_Sogdian0 STRING_Old_South_Arabian0 STRING_Old_Turkic0 STRING_Oriya0 @@ -584,6 +590,7 @@ const char PRIV(utt_names)[] = STRING_Sk0 STRING_Sm0 STRING_So0 + STRING_Sogdian0 STRING_Sora_Sompeng0 STRING_Soyombo0 STRING_Sundanese0 @@ -656,154 +663,161 @@ const ucp_type_table PRIV(utt)[] = { { 265, PT_SC, ucp_Cyrillic }, { 274, PT_SC, ucp_Deseret }, { 282, PT_SC, ucp_Devanagari }, - { 293, PT_SC, ucp_Duployan }, - { 302, PT_SC, ucp_Egyptian_Hieroglyphs }, - { 323, PT_SC, ucp_Elbasan }, - { 331, PT_SC, ucp_Ethiopic }, - { 340, PT_SC, ucp_Georgian }, - { 349, PT_SC, ucp_Glagolitic }, - { 360, PT_SC, ucp_Gothic }, - { 367, PT_SC, ucp_Grantha }, - { 375, PT_SC, ucp_Greek }, - { 381, PT_SC, ucp_Gujarati }, - { 390, PT_SC, ucp_Gurmukhi }, - { 399, PT_SC, ucp_Han }, - { 403, PT_SC, ucp_Hangul }, - { 410, PT_SC, ucp_Hanunoo }, - { 418, PT_SC, ucp_Hatran }, - { 425, PT_SC, ucp_Hebrew }, - { 432, PT_SC, ucp_Hiragana }, - { 441, PT_SC, ucp_Imperial_Aramaic }, - { 458, PT_SC, ucp_Inherited }, - { 468, PT_SC, ucp_Inscriptional_Pahlavi }, - { 490, PT_SC, ucp_Inscriptional_Parthian }, - { 513, PT_SC, ucp_Javanese }, - { 522, PT_SC, ucp_Kaithi }, - { 529, PT_SC, ucp_Kannada }, - { 537, PT_SC, ucp_Katakana }, - { 546, PT_SC, ucp_Kayah_Li }, - { 555, PT_SC, ucp_Kharoshthi }, - { 566, PT_SC, ucp_Khmer }, - { 572, PT_SC, ucp_Khojki }, - { 579, PT_SC, ucp_Khudawadi }, - { 589, PT_GC, ucp_L }, - { 591, PT_LAMP, 0 }, - { 594, PT_SC, ucp_Lao }, - { 598, PT_SC, ucp_Latin }, - { 604, PT_SC, ucp_Lepcha }, - { 611, PT_SC, ucp_Limbu }, - { 617, PT_SC, ucp_Linear_A }, - { 626, PT_SC, ucp_Linear_B }, - { 635, PT_SC, ucp_Lisu }, - { 640, PT_PC, ucp_Ll }, - { 643, PT_PC, ucp_Lm }, - { 646, PT_PC, ucp_Lo }, - { 649, PT_PC, ucp_Lt }, - { 652, PT_PC, ucp_Lu }, - { 655, PT_SC, ucp_Lycian }, - { 662, PT_SC, ucp_Lydian }, - { 669, PT_GC, ucp_M }, - { 671, PT_SC, ucp_Mahajani }, - { 680, PT_SC, ucp_Malayalam }, - { 690, PT_SC, ucp_Mandaic }, - { 698, PT_SC, ucp_Manichaean }, - { 709, PT_SC, ucp_Marchen }, - { 717, PT_SC, ucp_Masaram_Gondi }, - { 731, PT_PC, ucp_Mc }, - { 734, PT_PC, ucp_Me }, - { 737, PT_SC, ucp_Meetei_Mayek }, - { 750, PT_SC, ucp_Mende_Kikakui }, - { 764, PT_SC, ucp_Meroitic_Cursive }, - { 781, PT_SC, ucp_Meroitic_Hieroglyphs }, - { 802, PT_SC, ucp_Miao }, - { 807, PT_PC, ucp_Mn }, - { 810, PT_SC, ucp_Modi }, - { 815, PT_SC, ucp_Mongolian }, - { 825, PT_SC, ucp_Mro }, - { 829, PT_SC, ucp_Multani }, - { 837, PT_SC, ucp_Myanmar }, - { 845, PT_GC, ucp_N }, - { 847, PT_SC, ucp_Nabataean }, - { 857, PT_PC, ucp_Nd }, - { 860, PT_SC, ucp_New_Tai_Lue }, - { 872, PT_SC, ucp_Newa }, - { 877, PT_SC, ucp_Nko }, - { 881, PT_PC, ucp_Nl }, - { 884, PT_PC, ucp_No }, - { 887, PT_SC, ucp_Nushu }, - { 893, PT_SC, ucp_Ogham }, - { 899, PT_SC, ucp_Ol_Chiki }, - { 908, PT_SC, ucp_Old_Hungarian }, - { 922, PT_SC, ucp_Old_Italic }, - { 933, PT_SC, ucp_Old_North_Arabian }, - { 951, PT_SC, ucp_Old_Permic }, - { 962, PT_SC, ucp_Old_Persian }, - { 974, PT_SC, ucp_Old_South_Arabian }, - { 992, PT_SC, ucp_Old_Turkic }, - { 1003, PT_SC, ucp_Oriya }, - { 1009, PT_SC, ucp_Osage }, - { 1015, PT_SC, ucp_Osmanya }, - { 1023, PT_GC, ucp_P }, - { 1025, PT_SC, ucp_Pahawh_Hmong }, - { 1038, PT_SC, ucp_Palmyrene }, - { 1048, PT_SC, ucp_Pau_Cin_Hau }, - { 1060, PT_PC, ucp_Pc }, - { 1063, PT_PC, ucp_Pd }, - { 1066, PT_PC, ucp_Pe }, - { 1069, PT_PC, ucp_Pf }, - { 1072, PT_SC, ucp_Phags_Pa }, - { 1081, PT_SC, ucp_Phoenician }, - { 1092, PT_PC, ucp_Pi }, - { 1095, PT_PC, ucp_Po }, - { 1098, PT_PC, ucp_Ps }, - { 1101, PT_SC, ucp_Psalter_Pahlavi }, - { 1117, PT_SC, ucp_Rejang }, - { 1124, PT_SC, ucp_Runic }, - { 1130, PT_GC, ucp_S }, - { 1132, PT_SC, ucp_Samaritan }, - { 1142, PT_SC, ucp_Saurashtra }, - { 1153, PT_PC, ucp_Sc }, - { 1156, PT_SC, ucp_Sharada }, - { 1164, PT_SC, ucp_Shavian }, - { 1172, PT_SC, ucp_Siddham }, - { 1180, PT_SC, ucp_SignWriting }, - { 1192, PT_SC, ucp_Sinhala }, - { 1200, PT_PC, ucp_Sk }, - { 1203, PT_PC, ucp_Sm }, - { 1206, PT_PC, ucp_So }, - { 1209, PT_SC, ucp_Sora_Sompeng }, - { 1222, PT_SC, ucp_Soyombo }, - { 1230, PT_SC, ucp_Sundanese }, - { 1240, PT_SC, ucp_Syloti_Nagri }, - { 1253, PT_SC, ucp_Syriac }, - { 1260, PT_SC, ucp_Tagalog }, - { 1268, PT_SC, ucp_Tagbanwa }, - { 1277, PT_SC, ucp_Tai_Le }, - { 1284, PT_SC, ucp_Tai_Tham }, - { 1293, PT_SC, ucp_Tai_Viet }, - { 1302, PT_SC, ucp_Takri }, - { 1308, PT_SC, ucp_Tamil }, - { 1314, PT_SC, ucp_Tangut }, - { 1321, PT_SC, ucp_Telugu }, - { 1328, PT_SC, ucp_Thaana }, - { 1335, PT_SC, ucp_Thai }, - { 1340, PT_SC, ucp_Tibetan }, - { 1348, PT_SC, ucp_Tifinagh }, - { 1357, PT_SC, ucp_Tirhuta }, - { 1365, PT_SC, ucp_Ugaritic }, - { 1374, PT_SC, ucp_Vai }, - { 1378, PT_SC, ucp_Warang_Citi }, - { 1390, PT_ALNUM, 0 }, - { 1394, PT_PXSPACE, 0 }, - { 1398, PT_SPACE, 0 }, - { 1402, PT_UCNC, 0 }, - { 1406, PT_WORD, 0 }, - { 1410, PT_SC, ucp_Yi }, - { 1413, PT_GC, ucp_Z }, - { 1415, PT_SC, ucp_Zanabazar_Square }, - { 1432, PT_PC, ucp_Zl }, - { 1435, PT_PC, ucp_Zp }, - { 1438, PT_PC, ucp_Zs } + { 293, PT_SC, ucp_Dogra }, + { 299, PT_SC, ucp_Duployan }, + { 308, PT_SC, ucp_Egyptian_Hieroglyphs }, + { 329, PT_SC, ucp_Elbasan }, + { 337, PT_SC, ucp_Ethiopic }, + { 346, PT_SC, ucp_Georgian }, + { 355, PT_SC, ucp_Glagolitic }, + { 366, PT_SC, ucp_Gothic }, + { 373, PT_SC, ucp_Grantha }, + { 381, PT_SC, ucp_Greek }, + { 387, PT_SC, ucp_Gujarati }, + { 396, PT_SC, ucp_Gunjala_Gondi }, + { 410, PT_SC, ucp_Gurmukhi }, + { 419, PT_SC, ucp_Han }, + { 423, PT_SC, ucp_Hangul }, + { 430, PT_SC, ucp_Hanifi_Rohingya }, + { 446, PT_SC, ucp_Hanunoo }, + { 454, PT_SC, ucp_Hatran }, + { 461, PT_SC, ucp_Hebrew }, + { 468, PT_SC, ucp_Hiragana }, + { 477, PT_SC, ucp_Imperial_Aramaic }, + { 494, PT_SC, ucp_Inherited }, + { 504, PT_SC, ucp_Inscriptional_Pahlavi }, + { 526, PT_SC, ucp_Inscriptional_Parthian }, + { 549, PT_SC, ucp_Javanese }, + { 558, PT_SC, ucp_Kaithi }, + { 565, PT_SC, ucp_Kannada }, + { 573, PT_SC, ucp_Katakana }, + { 582, PT_SC, ucp_Kayah_Li }, + { 591, PT_SC, ucp_Kharoshthi }, + { 602, PT_SC, ucp_Khmer }, + { 608, PT_SC, ucp_Khojki }, + { 615, PT_SC, ucp_Khudawadi }, + { 625, PT_GC, ucp_L }, + { 627, PT_LAMP, 0 }, + { 630, PT_SC, ucp_Lao }, + { 634, PT_SC, ucp_Latin }, + { 640, PT_SC, ucp_Lepcha }, + { 647, PT_SC, ucp_Limbu }, + { 653, PT_SC, ucp_Linear_A }, + { 662, PT_SC, ucp_Linear_B }, + { 671, PT_SC, ucp_Lisu }, + { 676, PT_PC, ucp_Ll }, + { 679, PT_PC, ucp_Lm }, + { 682, PT_PC, ucp_Lo }, + { 685, PT_PC, ucp_Lt }, + { 688, PT_PC, ucp_Lu }, + { 691, PT_SC, ucp_Lycian }, + { 698, PT_SC, ucp_Lydian }, + { 705, PT_GC, ucp_M }, + { 707, PT_SC, ucp_Mahajani }, + { 716, PT_SC, ucp_Makasar }, + { 724, PT_SC, ucp_Malayalam }, + { 734, PT_SC, ucp_Mandaic }, + { 742, PT_SC, ucp_Manichaean }, + { 753, PT_SC, ucp_Marchen }, + { 761, PT_SC, ucp_Masaram_Gondi }, + { 775, PT_PC, ucp_Mc }, + { 778, PT_PC, ucp_Me }, + { 781, PT_SC, ucp_Medefaidrin }, + { 793, PT_SC, ucp_Meetei_Mayek }, + { 806, PT_SC, ucp_Mende_Kikakui }, + { 820, PT_SC, ucp_Meroitic_Cursive }, + { 837, PT_SC, ucp_Meroitic_Hieroglyphs }, + { 858, PT_SC, ucp_Miao }, + { 863, PT_PC, ucp_Mn }, + { 866, PT_SC, ucp_Modi }, + { 871, PT_SC, ucp_Mongolian }, + { 881, PT_SC, ucp_Mro }, + { 885, PT_SC, ucp_Multani }, + { 893, PT_SC, ucp_Myanmar }, + { 901, PT_GC, ucp_N }, + { 903, PT_SC, ucp_Nabataean }, + { 913, PT_PC, ucp_Nd }, + { 916, PT_SC, ucp_New_Tai_Lue }, + { 928, PT_SC, ucp_Newa }, + { 933, PT_SC, ucp_Nko }, + { 937, PT_PC, ucp_Nl }, + { 940, PT_PC, ucp_No }, + { 943, PT_SC, ucp_Nushu }, + { 949, PT_SC, ucp_Ogham }, + { 955, PT_SC, ucp_Ol_Chiki }, + { 964, PT_SC, ucp_Old_Hungarian }, + { 978, PT_SC, ucp_Old_Italic }, + { 989, PT_SC, ucp_Old_North_Arabian }, + { 1007, PT_SC, ucp_Old_Permic }, + { 1018, PT_SC, ucp_Old_Persian }, + { 1030, PT_SC, ucp_Old_Sogdian }, + { 1042, PT_SC, ucp_Old_South_Arabian }, + { 1060, PT_SC, ucp_Old_Turkic }, + { 1071, PT_SC, ucp_Oriya }, + { 1077, PT_SC, ucp_Osage }, + { 1083, PT_SC, ucp_Osmanya }, + { 1091, PT_GC, ucp_P }, + { 1093, PT_SC, ucp_Pahawh_Hmong }, + { 1106, PT_SC, ucp_Palmyrene }, + { 1116, PT_SC, ucp_Pau_Cin_Hau }, + { 1128, PT_PC, ucp_Pc }, + { 1131, PT_PC, ucp_Pd }, + { 1134, PT_PC, ucp_Pe }, + { 1137, PT_PC, ucp_Pf }, + { 1140, PT_SC, ucp_Phags_Pa }, + { 1149, PT_SC, ucp_Phoenician }, + { 1160, PT_PC, ucp_Pi }, + { 1163, PT_PC, ucp_Po }, + { 1166, PT_PC, ucp_Ps }, + { 1169, PT_SC, ucp_Psalter_Pahlavi }, + { 1185, PT_SC, ucp_Rejang }, + { 1192, PT_SC, ucp_Runic }, + { 1198, PT_GC, ucp_S }, + { 1200, PT_SC, ucp_Samaritan }, + { 1210, PT_SC, ucp_Saurashtra }, + { 1221, PT_PC, ucp_Sc }, + { 1224, PT_SC, ucp_Sharada }, + { 1232, PT_SC, ucp_Shavian }, + { 1240, PT_SC, ucp_Siddham }, + { 1248, PT_SC, ucp_SignWriting }, + { 1260, PT_SC, ucp_Sinhala }, + { 1268, PT_PC, ucp_Sk }, + { 1271, PT_PC, ucp_Sm }, + { 1274, PT_PC, ucp_So }, + { 1277, PT_SC, ucp_Sogdian }, + { 1285, PT_SC, ucp_Sora_Sompeng }, + { 1298, PT_SC, ucp_Soyombo }, + { 1306, PT_SC, ucp_Sundanese }, + { 1316, PT_SC, ucp_Syloti_Nagri }, + { 1329, PT_SC, ucp_Syriac }, + { 1336, PT_SC, ucp_Tagalog }, + { 1344, PT_SC, ucp_Tagbanwa }, + { 1353, PT_SC, ucp_Tai_Le }, + { 1360, PT_SC, ucp_Tai_Tham }, + { 1369, PT_SC, ucp_Tai_Viet }, + { 1378, PT_SC, ucp_Takri }, + { 1384, PT_SC, ucp_Tamil }, + { 1390, PT_SC, ucp_Tangut }, + { 1397, PT_SC, ucp_Telugu }, + { 1404, PT_SC, ucp_Thaana }, + { 1411, PT_SC, ucp_Thai }, + { 1416, PT_SC, ucp_Tibetan }, + { 1424, PT_SC, ucp_Tifinagh }, + { 1433, PT_SC, ucp_Tirhuta }, + { 1441, PT_SC, ucp_Ugaritic }, + { 1450, PT_SC, ucp_Vai }, + { 1454, PT_SC, ucp_Warang_Citi }, + { 1466, PT_ALNUM, 0 }, + { 1470, PT_PXSPACE, 0 }, + { 1474, PT_SPACE, 0 }, + { 1478, PT_UCNC, 0 }, + { 1482, PT_WORD, 0 }, + { 1486, PT_SC, ucp_Yi }, + { 1489, PT_GC, ucp_Z }, + { 1491, PT_SC, ucp_Zanabazar_Square }, + { 1508, PT_PC, ucp_Zl }, + { 1511, PT_PC, ucp_Zp }, + { 1514, PT_PC, ucp_Zs } }; const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table); diff --git a/thirdparty/pcre2/src/pcre2_ucd.c b/thirdparty/pcre2/src/pcre2_ucd.c index ac7649b99e..275a4be2fe 100644 --- a/thirdparty/pcre2/src/pcre2_ucd.c +++ b/thirdparty/pcre2/src/pcre2_ucd.c @@ -20,7 +20,7 @@ needed. */ /* Unicode character database. */ /* This file was autogenerated by the MultiStage2.py script. */ -/* Total size: 80808 bytes, block size: 128. */ +/* Total size: 92592 bytes, block size: 128. */ /* The tables herein are needed only when UCP support is built, and in PCRE2 that happens automatically with UTF support. @@ -34,12 +34,12 @@ Instead, just supply small dummy tables. */ #ifndef SUPPORT_UNICODE const ucd_record PRIV(ucd_records)[] = {{0,0,0,0,0 }}; -const uint8_t PRIV(ucd_stage1)[] = {0}; +const uint16_t PRIV(ucd_stage1)[] = {0}; const uint16_t PRIV(ucd_stage2)[] = {0}; const uint32_t PRIV(ucd_caseless_sets)[] = {0}; #else -const char *PRIV(unicode_version) = "10.0.0"; +const char *PRIV(unicode_version) = "11.0.0"; /* If the 32-bit library is run in non-32-bit mode, character values greater than 0x10ffff may be encountered. For these we set up a @@ -104,7 +104,7 @@ const uint32_t PRIV(ucd_caseless_sets)[] = { #ifndef PCRE2_PCRE2TEST -const ucd_record PRIV(ucd_records)[] = { /* 6568 bytes, record size 8 */ +const ucd_record PRIV(ucd_records)[] = { /* 6832 bytes, record size 8 */ { 9, 0, 2, 0, 0, }, /* 0 */ { 9, 0, 1, 0, 0, }, /* 1 */ { 9, 0, 0, 0, 0, }, /* 2 */ @@ -125,1357 +125,1390 @@ const ucd_record PRIV(ucd_records)[] = { /* 6568 bytes, record size 8 */ { 33, 5, 12, 100, -32, }, /* 17 */ { 33, 5, 12, 1, -32, }, /* 18 */ { 9, 26, 12, 0, 0, }, /* 19 */ - { 33, 7, 12, 0, 0, }, /* 20 */ - { 9, 20, 12, 0, 0, }, /* 21 */ - { 9, 1, 2, 0, 0, }, /* 22 */ - { 9, 15, 12, 0, 0, }, /* 23 */ - { 9, 5, 12, 26, 775, }, /* 24 */ - { 9, 19, 12, 0, 0, }, /* 25 */ - { 33, 9, 12, 104, 32, }, /* 26 */ - { 33, 5, 12, 0, 7615, }, /* 27 */ - { 33, 5, 12, 104, -32, }, /* 28 */ - { 33, 5, 12, 0, 121, }, /* 29 */ - { 33, 9, 12, 0, 1, }, /* 30 */ - { 33, 5, 12, 0, -1, }, /* 31 */ - { 33, 9, 12, 0, 0, }, /* 32 */ - { 33, 5, 12, 0, 0, }, /* 33 */ - { 33, 9, 12, 0, -121, }, /* 34 */ - { 33, 5, 12, 1, -268, }, /* 35 */ - { 33, 5, 12, 0, 195, }, /* 36 */ - { 33, 9, 12, 0, 210, }, /* 37 */ - { 33, 9, 12, 0, 206, }, /* 38 */ - { 33, 9, 12, 0, 205, }, /* 39 */ - { 33, 9, 12, 0, 79, }, /* 40 */ - { 33, 9, 12, 0, 202, }, /* 41 */ - { 33, 9, 12, 0, 203, }, /* 42 */ - { 33, 9, 12, 0, 207, }, /* 43 */ - { 33, 5, 12, 0, 97, }, /* 44 */ - { 33, 9, 12, 0, 211, }, /* 45 */ - { 33, 9, 12, 0, 209, }, /* 46 */ - { 33, 5, 12, 0, 163, }, /* 47 */ - { 33, 9, 12, 0, 213, }, /* 48 */ - { 33, 5, 12, 0, 130, }, /* 49 */ - { 33, 9, 12, 0, 214, }, /* 50 */ - { 33, 9, 12, 0, 218, }, /* 51 */ - { 33, 9, 12, 0, 217, }, /* 52 */ - { 33, 9, 12, 0, 219, }, /* 53 */ - { 33, 5, 12, 0, 56, }, /* 54 */ - { 33, 9, 12, 5, 2, }, /* 55 */ - { 33, 8, 12, 5, 1, }, /* 56 */ - { 33, 5, 12, 5, -2, }, /* 57 */ - { 33, 9, 12, 9, 2, }, /* 58 */ - { 33, 8, 12, 9, 1, }, /* 59 */ - { 33, 5, 12, 9, -2, }, /* 60 */ - { 33, 9, 12, 13, 2, }, /* 61 */ - { 33, 8, 12, 13, 1, }, /* 62 */ - { 33, 5, 12, 13, -2, }, /* 63 */ - { 33, 5, 12, 0, -79, }, /* 64 */ - { 33, 9, 12, 17, 2, }, /* 65 */ - { 33, 8, 12, 17, 1, }, /* 66 */ - { 33, 5, 12, 17, -2, }, /* 67 */ - { 33, 9, 12, 0, -97, }, /* 68 */ - { 33, 9, 12, 0, -56, }, /* 69 */ - { 33, 9, 12, 0, -130, }, /* 70 */ - { 33, 9, 12, 0, 10795, }, /* 71 */ - { 33, 9, 12, 0, -163, }, /* 72 */ - { 33, 9, 12, 0, 10792, }, /* 73 */ - { 33, 5, 12, 0, 10815, }, /* 74 */ - { 33, 9, 12, 0, -195, }, /* 75 */ - { 33, 9, 12, 0, 69, }, /* 76 */ - { 33, 9, 12, 0, 71, }, /* 77 */ - { 33, 5, 12, 0, 10783, }, /* 78 */ - { 33, 5, 12, 0, 10780, }, /* 79 */ - { 33, 5, 12, 0, 10782, }, /* 80 */ - { 33, 5, 12, 0, -210, }, /* 81 */ - { 33, 5, 12, 0, -206, }, /* 82 */ - { 33, 5, 12, 0, -205, }, /* 83 */ - { 33, 5, 12, 0, -202, }, /* 84 */ - { 33, 5, 12, 0, -203, }, /* 85 */ - { 33, 5, 12, 0, 42319, }, /* 86 */ - { 33, 5, 12, 0, 42315, }, /* 87 */ - { 33, 5, 12, 0, -207, }, /* 88 */ - { 33, 5, 12, 0, 42280, }, /* 89 */ - { 33, 5, 12, 0, 42308, }, /* 90 */ - { 33, 5, 12, 0, -209, }, /* 91 */ - { 33, 5, 12, 0, -211, }, /* 92 */ - { 33, 5, 12, 0, 10743, }, /* 93 */ - { 33, 5, 12, 0, 42305, }, /* 94 */ - { 33, 5, 12, 0, 10749, }, /* 95 */ - { 33, 5, 12, 0, -213, }, /* 96 */ - { 33, 5, 12, 0, -214, }, /* 97 */ - { 33, 5, 12, 0, 10727, }, /* 98 */ - { 33, 5, 12, 0, -218, }, /* 99 */ - { 33, 5, 12, 0, 42282, }, /* 100 */ - { 33, 5, 12, 0, -69, }, /* 101 */ - { 33, 5, 12, 0, -217, }, /* 102 */ - { 33, 5, 12, 0, -71, }, /* 103 */ - { 33, 5, 12, 0, -219, }, /* 104 */ - { 33, 5, 12, 0, 42261, }, /* 105 */ - { 33, 5, 12, 0, 42258, }, /* 106 */ - { 33, 6, 12, 0, 0, }, /* 107 */ - { 9, 6, 12, 0, 0, }, /* 108 */ - { 3, 24, 12, 0, 0, }, /* 109 */ - { 27, 12, 3, 0, 0, }, /* 110 */ - { 27, 12, 3, 21, 116, }, /* 111 */ - { 19, 9, 12, 0, 1, }, /* 112 */ - { 19, 5, 12, 0, -1, }, /* 113 */ - { 19, 24, 12, 0, 0, }, /* 114 */ - { 9, 2, 12, 0, 0, }, /* 115 */ - { 19, 6, 12, 0, 0, }, /* 116 */ - { 19, 5, 12, 0, 130, }, /* 117 */ - { 19, 9, 12, 0, 116, }, /* 118 */ - { 19, 9, 12, 0, 38, }, /* 119 */ - { 19, 9, 12, 0, 37, }, /* 120 */ - { 19, 9, 12, 0, 64, }, /* 121 */ - { 19, 9, 12, 0, 63, }, /* 122 */ - { 19, 5, 12, 0, 0, }, /* 123 */ - { 19, 9, 12, 0, 32, }, /* 124 */ - { 19, 9, 12, 34, 32, }, /* 125 */ - { 19, 9, 12, 59, 32, }, /* 126 */ - { 19, 9, 12, 38, 32, }, /* 127 */ - { 19, 9, 12, 21, 32, }, /* 128 */ - { 19, 9, 12, 51, 32, }, /* 129 */ - { 19, 9, 12, 26, 32, }, /* 130 */ - { 19, 9, 12, 47, 32, }, /* 131 */ - { 19, 9, 12, 55, 32, }, /* 132 */ - { 19, 9, 12, 30, 32, }, /* 133 */ - { 19, 9, 12, 43, 32, }, /* 134 */ - { 19, 9, 12, 96, 32, }, /* 135 */ - { 19, 5, 12, 0, -38, }, /* 136 */ - { 19, 5, 12, 0, -37, }, /* 137 */ - { 19, 5, 12, 0, -32, }, /* 138 */ - { 19, 5, 12, 34, -32, }, /* 139 */ - { 19, 5, 12, 59, -32, }, /* 140 */ - { 19, 5, 12, 38, -32, }, /* 141 */ - { 19, 5, 12, 21, -116, }, /* 142 */ - { 19, 5, 12, 51, -32, }, /* 143 */ - { 19, 5, 12, 26, -775, }, /* 144 */ - { 19, 5, 12, 47, -32, }, /* 145 */ - { 19, 5, 12, 55, -32, }, /* 146 */ - { 19, 5, 12, 30, 1, }, /* 147 */ - { 19, 5, 12, 30, -32, }, /* 148 */ - { 19, 5, 12, 43, -32, }, /* 149 */ - { 19, 5, 12, 96, -32, }, /* 150 */ - { 19, 5, 12, 0, -64, }, /* 151 */ - { 19, 5, 12, 0, -63, }, /* 152 */ - { 19, 9, 12, 0, 8, }, /* 153 */ - { 19, 5, 12, 34, -30, }, /* 154 */ - { 19, 5, 12, 38, -25, }, /* 155 */ - { 19, 9, 12, 0, 0, }, /* 156 */ - { 19, 5, 12, 43, -15, }, /* 157 */ - { 19, 5, 12, 47, -22, }, /* 158 */ - { 19, 5, 12, 0, -8, }, /* 159 */ - { 10, 9, 12, 0, 1, }, /* 160 */ - { 10, 5, 12, 0, -1, }, /* 161 */ - { 19, 5, 12, 51, -54, }, /* 162 */ - { 19, 5, 12, 55, -48, }, /* 163 */ - { 19, 5, 12, 0, 7, }, /* 164 */ - { 19, 5, 12, 0, -116, }, /* 165 */ - { 19, 9, 12, 38, -60, }, /* 166 */ - { 19, 5, 12, 59, -64, }, /* 167 */ - { 19, 25, 12, 0, 0, }, /* 168 */ - { 19, 9, 12, 0, -7, }, /* 169 */ - { 19, 9, 12, 0, -130, }, /* 170 */ - { 12, 9, 12, 0, 80, }, /* 171 */ - { 12, 9, 12, 0, 32, }, /* 172 */ - { 12, 9, 12, 63, 32, }, /* 173 */ - { 12, 9, 12, 67, 32, }, /* 174 */ - { 12, 9, 12, 71, 32, }, /* 175 */ - { 12, 9, 12, 75, 32, }, /* 176 */ - { 12, 9, 12, 79, 32, }, /* 177 */ - { 12, 9, 12, 84, 32, }, /* 178 */ - { 12, 5, 12, 0, -32, }, /* 179 */ - { 12, 5, 12, 63, -32, }, /* 180 */ - { 12, 5, 12, 67, -32, }, /* 181 */ - { 12, 5, 12, 71, -32, }, /* 182 */ - { 12, 5, 12, 75, -32, }, /* 183 */ - { 12, 5, 12, 79, -32, }, /* 184 */ - { 12, 5, 12, 84, -32, }, /* 185 */ - { 12, 5, 12, 0, -80, }, /* 186 */ - { 12, 9, 12, 0, 1, }, /* 187 */ - { 12, 5, 12, 0, -1, }, /* 188 */ - { 12, 9, 12, 88, 1, }, /* 189 */ - { 12, 5, 12, 88, -1, }, /* 190 */ - { 12, 26, 12, 0, 0, }, /* 191 */ - { 12, 12, 3, 0, 0, }, /* 192 */ - { 12, 11, 3, 0, 0, }, /* 193 */ - { 12, 9, 12, 0, 15, }, /* 194 */ - { 12, 5, 12, 0, -15, }, /* 195 */ - { 1, 9, 12, 0, 48, }, /* 196 */ - { 1, 6, 12, 0, 0, }, /* 197 */ - { 1, 21, 12, 0, 0, }, /* 198 */ - { 1, 5, 12, 0, -48, }, /* 199 */ + { 9, 26, 14, 0, 0, }, /* 20 */ + { 33, 7, 12, 0, 0, }, /* 21 */ + { 9, 20, 12, 0, 0, }, /* 22 */ + { 9, 1, 2, 0, 0, }, /* 23 */ + { 9, 15, 12, 0, 0, }, /* 24 */ + { 9, 5, 12, 26, 775, }, /* 25 */ + { 9, 19, 12, 0, 0, }, /* 26 */ + { 33, 9, 12, 104, 32, }, /* 27 */ + { 33, 5, 12, 0, 7615, }, /* 28 */ + { 33, 5, 12, 104, -32, }, /* 29 */ + { 33, 5, 12, 0, 121, }, /* 30 */ + { 33, 9, 12, 0, 1, }, /* 31 */ + { 33, 5, 12, 0, -1, }, /* 32 */ + { 33, 9, 12, 0, 0, }, /* 33 */ + { 33, 5, 12, 0, 0, }, /* 34 */ + { 33, 9, 12, 0, -121, }, /* 35 */ + { 33, 5, 12, 1, -268, }, /* 36 */ + { 33, 5, 12, 0, 195, }, /* 37 */ + { 33, 9, 12, 0, 210, }, /* 38 */ + { 33, 9, 12, 0, 206, }, /* 39 */ + { 33, 9, 12, 0, 205, }, /* 40 */ + { 33, 9, 12, 0, 79, }, /* 41 */ + { 33, 9, 12, 0, 202, }, /* 42 */ + { 33, 9, 12, 0, 203, }, /* 43 */ + { 33, 9, 12, 0, 207, }, /* 44 */ + { 33, 5, 12, 0, 97, }, /* 45 */ + { 33, 9, 12, 0, 211, }, /* 46 */ + { 33, 9, 12, 0, 209, }, /* 47 */ + { 33, 5, 12, 0, 163, }, /* 48 */ + { 33, 9, 12, 0, 213, }, /* 49 */ + { 33, 5, 12, 0, 130, }, /* 50 */ + { 33, 9, 12, 0, 214, }, /* 51 */ + { 33, 9, 12, 0, 218, }, /* 52 */ + { 33, 9, 12, 0, 217, }, /* 53 */ + { 33, 9, 12, 0, 219, }, /* 54 */ + { 33, 5, 12, 0, 56, }, /* 55 */ + { 33, 9, 12, 5, 2, }, /* 56 */ + { 33, 8, 12, 5, 1, }, /* 57 */ + { 33, 5, 12, 5, -2, }, /* 58 */ + { 33, 9, 12, 9, 2, }, /* 59 */ + { 33, 8, 12, 9, 1, }, /* 60 */ + { 33, 5, 12, 9, -2, }, /* 61 */ + { 33, 9, 12, 13, 2, }, /* 62 */ + { 33, 8, 12, 13, 1, }, /* 63 */ + { 33, 5, 12, 13, -2, }, /* 64 */ + { 33, 5, 12, 0, -79, }, /* 65 */ + { 33, 9, 12, 17, 2, }, /* 66 */ + { 33, 8, 12, 17, 1, }, /* 67 */ + { 33, 5, 12, 17, -2, }, /* 68 */ + { 33, 9, 12, 0, -97, }, /* 69 */ + { 33, 9, 12, 0, -56, }, /* 70 */ + { 33, 9, 12, 0, -130, }, /* 71 */ + { 33, 9, 12, 0, 10795, }, /* 72 */ + { 33, 9, 12, 0, -163, }, /* 73 */ + { 33, 9, 12, 0, 10792, }, /* 74 */ + { 33, 5, 12, 0, 10815, }, /* 75 */ + { 33, 9, 12, 0, -195, }, /* 76 */ + { 33, 9, 12, 0, 69, }, /* 77 */ + { 33, 9, 12, 0, 71, }, /* 78 */ + { 33, 5, 12, 0, 10783, }, /* 79 */ + { 33, 5, 12, 0, 10780, }, /* 80 */ + { 33, 5, 12, 0, 10782, }, /* 81 */ + { 33, 5, 12, 0, -210, }, /* 82 */ + { 33, 5, 12, 0, -206, }, /* 83 */ + { 33, 5, 12, 0, -205, }, /* 84 */ + { 33, 5, 12, 0, -202, }, /* 85 */ + { 33, 5, 12, 0, -203, }, /* 86 */ + { 33, 5, 12, 0, 42319, }, /* 87 */ + { 33, 5, 12, 0, 42315, }, /* 88 */ + { 33, 5, 12, 0, -207, }, /* 89 */ + { 33, 5, 12, 0, 42280, }, /* 90 */ + { 33, 5, 12, 0, 42308, }, /* 91 */ + { 33, 5, 12, 0, -209, }, /* 92 */ + { 33, 5, 12, 0, -211, }, /* 93 */ + { 33, 5, 12, 0, 10743, }, /* 94 */ + { 33, 5, 12, 0, 42305, }, /* 95 */ + { 33, 5, 12, 0, 10749, }, /* 96 */ + { 33, 5, 12, 0, -213, }, /* 97 */ + { 33, 5, 12, 0, -214, }, /* 98 */ + { 33, 5, 12, 0, 10727, }, /* 99 */ + { 33, 5, 12, 0, -218, }, /* 100 */ + { 33, 5, 12, 0, 42282, }, /* 101 */ + { 33, 5, 12, 0, -69, }, /* 102 */ + { 33, 5, 12, 0, -217, }, /* 103 */ + { 33, 5, 12, 0, -71, }, /* 104 */ + { 33, 5, 12, 0, -219, }, /* 105 */ + { 33, 5, 12, 0, 42261, }, /* 106 */ + { 33, 5, 12, 0, 42258, }, /* 107 */ + { 33, 6, 12, 0, 0, }, /* 108 */ + { 9, 6, 12, 0, 0, }, /* 109 */ + { 3, 24, 12, 0, 0, }, /* 110 */ + { 27, 12, 3, 0, 0, }, /* 111 */ + { 27, 12, 3, 21, 116, }, /* 112 */ + { 19, 9, 12, 0, 1, }, /* 113 */ + { 19, 5, 12, 0, -1, }, /* 114 */ + { 19, 24, 12, 0, 0, }, /* 115 */ + { 9, 2, 12, 0, 0, }, /* 116 */ + { 19, 6, 12, 0, 0, }, /* 117 */ + { 19, 5, 12, 0, 130, }, /* 118 */ + { 19, 9, 12, 0, 116, }, /* 119 */ + { 19, 9, 12, 0, 38, }, /* 120 */ + { 19, 9, 12, 0, 37, }, /* 121 */ + { 19, 9, 12, 0, 64, }, /* 122 */ + { 19, 9, 12, 0, 63, }, /* 123 */ + { 19, 5, 12, 0, 0, }, /* 124 */ + { 19, 9, 12, 0, 32, }, /* 125 */ + { 19, 9, 12, 34, 32, }, /* 126 */ + { 19, 9, 12, 59, 32, }, /* 127 */ + { 19, 9, 12, 38, 32, }, /* 128 */ + { 19, 9, 12, 21, 32, }, /* 129 */ + { 19, 9, 12, 51, 32, }, /* 130 */ + { 19, 9, 12, 26, 32, }, /* 131 */ + { 19, 9, 12, 47, 32, }, /* 132 */ + { 19, 9, 12, 55, 32, }, /* 133 */ + { 19, 9, 12, 30, 32, }, /* 134 */ + { 19, 9, 12, 43, 32, }, /* 135 */ + { 19, 9, 12, 96, 32, }, /* 136 */ + { 19, 5, 12, 0, -38, }, /* 137 */ + { 19, 5, 12, 0, -37, }, /* 138 */ + { 19, 5, 12, 0, -32, }, /* 139 */ + { 19, 5, 12, 34, -32, }, /* 140 */ + { 19, 5, 12, 59, -32, }, /* 141 */ + { 19, 5, 12, 38, -32, }, /* 142 */ + { 19, 5, 12, 21, -116, }, /* 143 */ + { 19, 5, 12, 51, -32, }, /* 144 */ + { 19, 5, 12, 26, -775, }, /* 145 */ + { 19, 5, 12, 47, -32, }, /* 146 */ + { 19, 5, 12, 55, -32, }, /* 147 */ + { 19, 5, 12, 30, 1, }, /* 148 */ + { 19, 5, 12, 30, -32, }, /* 149 */ + { 19, 5, 12, 43, -32, }, /* 150 */ + { 19, 5, 12, 96, -32, }, /* 151 */ + { 19, 5, 12, 0, -64, }, /* 152 */ + { 19, 5, 12, 0, -63, }, /* 153 */ + { 19, 9, 12, 0, 8, }, /* 154 */ + { 19, 5, 12, 34, -30, }, /* 155 */ + { 19, 5, 12, 38, -25, }, /* 156 */ + { 19, 9, 12, 0, 0, }, /* 157 */ + { 19, 5, 12, 43, -15, }, /* 158 */ + { 19, 5, 12, 47, -22, }, /* 159 */ + { 19, 5, 12, 0, -8, }, /* 160 */ + { 10, 9, 12, 0, 1, }, /* 161 */ + { 10, 5, 12, 0, -1, }, /* 162 */ + { 19, 5, 12, 51, -54, }, /* 163 */ + { 19, 5, 12, 55, -48, }, /* 164 */ + { 19, 5, 12, 0, 7, }, /* 165 */ + { 19, 5, 12, 0, -116, }, /* 166 */ + { 19, 9, 12, 38, -60, }, /* 167 */ + { 19, 5, 12, 59, -64, }, /* 168 */ + { 19, 25, 12, 0, 0, }, /* 169 */ + { 19, 9, 12, 0, -7, }, /* 170 */ + { 19, 9, 12, 0, -130, }, /* 171 */ + { 12, 9, 12, 0, 80, }, /* 172 */ + { 12, 9, 12, 0, 32, }, /* 173 */ + { 12, 9, 12, 63, 32, }, /* 174 */ + { 12, 9, 12, 67, 32, }, /* 175 */ + { 12, 9, 12, 71, 32, }, /* 176 */ + { 12, 9, 12, 75, 32, }, /* 177 */ + { 12, 9, 12, 79, 32, }, /* 178 */ + { 12, 9, 12, 84, 32, }, /* 179 */ + { 12, 5, 12, 0, -32, }, /* 180 */ + { 12, 5, 12, 63, -32, }, /* 181 */ + { 12, 5, 12, 67, -32, }, /* 182 */ + { 12, 5, 12, 71, -32, }, /* 183 */ + { 12, 5, 12, 75, -32, }, /* 184 */ + { 12, 5, 12, 79, -32, }, /* 185 */ + { 12, 5, 12, 84, -32, }, /* 186 */ + { 12, 5, 12, 0, -80, }, /* 187 */ + { 12, 9, 12, 0, 1, }, /* 188 */ + { 12, 5, 12, 0, -1, }, /* 189 */ + { 12, 9, 12, 88, 1, }, /* 190 */ + { 12, 5, 12, 88, -1, }, /* 191 */ + { 12, 26, 12, 0, 0, }, /* 192 */ + { 12, 12, 3, 0, 0, }, /* 193 */ + { 12, 11, 3, 0, 0, }, /* 194 */ + { 12, 9, 12, 0, 15, }, /* 195 */ + { 12, 5, 12, 0, -15, }, /* 196 */ + { 1, 9, 12, 0, 48, }, /* 197 */ + { 1, 6, 12, 0, 0, }, /* 198 */ + { 1, 21, 12, 0, 0, }, /* 199 */ { 1, 5, 12, 0, 0, }, /* 200 */ - { 1, 17, 12, 0, 0, }, /* 201 */ - { 1, 26, 12, 0, 0, }, /* 202 */ - { 1, 23, 12, 0, 0, }, /* 203 */ - { 25, 12, 3, 0, 0, }, /* 204 */ - { 25, 17, 12, 0, 0, }, /* 205 */ - { 25, 21, 12, 0, 0, }, /* 206 */ - { 25, 7, 12, 0, 0, }, /* 207 */ - { 0, 1, 4, 0, 0, }, /* 208 */ - { 9, 1, 4, 0, 0, }, /* 209 */ - { 0, 25, 12, 0, 0, }, /* 210 */ - { 0, 21, 12, 0, 0, }, /* 211 */ - { 0, 23, 12, 0, 0, }, /* 212 */ - { 0, 26, 12, 0, 0, }, /* 213 */ - { 0, 12, 3, 0, 0, }, /* 214 */ - { 0, 1, 2, 0, 0, }, /* 215 */ - { 0, 7, 12, 0, 0, }, /* 216 */ - { 0, 13, 12, 0, 0, }, /* 217 */ - { 0, 6, 12, 0, 0, }, /* 218 */ - { 49, 21, 12, 0, 0, }, /* 219 */ - { 49, 1, 4, 0, 0, }, /* 220 */ - { 49, 7, 12, 0, 0, }, /* 221 */ - { 49, 12, 3, 0, 0, }, /* 222 */ - { 55, 7, 12, 0, 0, }, /* 223 */ - { 55, 12, 3, 0, 0, }, /* 224 */ - { 63, 13, 12, 0, 0, }, /* 225 */ - { 63, 7, 12, 0, 0, }, /* 226 */ - { 63, 12, 3, 0, 0, }, /* 227 */ - { 63, 6, 12, 0, 0, }, /* 228 */ - { 63, 26, 12, 0, 0, }, /* 229 */ - { 63, 21, 12, 0, 0, }, /* 230 */ - { 89, 7, 12, 0, 0, }, /* 231 */ - { 89, 12, 3, 0, 0, }, /* 232 */ - { 89, 6, 12, 0, 0, }, /* 233 */ - { 89, 21, 12, 0, 0, }, /* 234 */ - { 94, 7, 12, 0, 0, }, /* 235 */ - { 94, 12, 3, 0, 0, }, /* 236 */ - { 94, 21, 12, 0, 0, }, /* 237 */ - { 14, 12, 3, 0, 0, }, /* 238 */ - { 14, 10, 5, 0, 0, }, /* 239 */ - { 14, 7, 12, 0, 0, }, /* 240 */ - { 14, 13, 12, 0, 0, }, /* 241 */ - { 14, 21, 12, 0, 0, }, /* 242 */ - { 14, 6, 12, 0, 0, }, /* 243 */ - { 2, 7, 12, 0, 0, }, /* 244 */ - { 2, 12, 3, 0, 0, }, /* 245 */ - { 2, 10, 5, 0, 0, }, /* 246 */ - { 2, 10, 3, 0, 0, }, /* 247 */ - { 2, 13, 12, 0, 0, }, /* 248 */ - { 2, 23, 12, 0, 0, }, /* 249 */ - { 2, 15, 12, 0, 0, }, /* 250 */ - { 2, 26, 12, 0, 0, }, /* 251 */ - { 2, 21, 12, 0, 0, }, /* 252 */ - { 21, 12, 3, 0, 0, }, /* 253 */ - { 21, 10, 5, 0, 0, }, /* 254 */ - { 21, 7, 12, 0, 0, }, /* 255 */ - { 21, 13, 12, 0, 0, }, /* 256 */ - { 20, 12, 3, 0, 0, }, /* 257 */ - { 20, 10, 5, 0, 0, }, /* 258 */ - { 20, 7, 12, 0, 0, }, /* 259 */ - { 20, 13, 12, 0, 0, }, /* 260 */ - { 20, 21, 12, 0, 0, }, /* 261 */ - { 20, 23, 12, 0, 0, }, /* 262 */ - { 43, 12, 3, 0, 0, }, /* 263 */ - { 43, 10, 5, 0, 0, }, /* 264 */ - { 43, 7, 12, 0, 0, }, /* 265 */ - { 43, 10, 3, 0, 0, }, /* 266 */ - { 43, 13, 12, 0, 0, }, /* 267 */ - { 43, 26, 12, 0, 0, }, /* 268 */ - { 43, 15, 12, 0, 0, }, /* 269 */ - { 53, 12, 3, 0, 0, }, /* 270 */ - { 53, 7, 12, 0, 0, }, /* 271 */ - { 53, 10, 3, 0, 0, }, /* 272 */ - { 53, 10, 5, 0, 0, }, /* 273 */ - { 53, 13, 12, 0, 0, }, /* 274 */ - { 53, 15, 12, 0, 0, }, /* 275 */ - { 53, 26, 12, 0, 0, }, /* 276 */ - { 53, 23, 12, 0, 0, }, /* 277 */ - { 54, 12, 3, 0, 0, }, /* 278 */ - { 54, 10, 5, 0, 0, }, /* 279 */ - { 54, 7, 12, 0, 0, }, /* 280 */ - { 54, 13, 12, 0, 0, }, /* 281 */ - { 54, 15, 12, 0, 0, }, /* 282 */ - { 54, 26, 12, 0, 0, }, /* 283 */ - { 28, 7, 12, 0, 0, }, /* 284 */ - { 28, 12, 3, 0, 0, }, /* 285 */ - { 28, 10, 5, 0, 0, }, /* 286 */ - { 28, 10, 3, 0, 0, }, /* 287 */ - { 28, 13, 12, 0, 0, }, /* 288 */ - { 36, 12, 3, 0, 0, }, /* 289 */ - { 36, 10, 5, 0, 0, }, /* 290 */ - { 36, 7, 12, 0, 0, }, /* 291 */ - { 36, 10, 3, 0, 0, }, /* 292 */ - { 36, 7, 4, 0, 0, }, /* 293 */ - { 36, 26, 12, 0, 0, }, /* 294 */ - { 36, 15, 12, 0, 0, }, /* 295 */ - { 36, 13, 12, 0, 0, }, /* 296 */ - { 47, 10, 5, 0, 0, }, /* 297 */ - { 47, 7, 12, 0, 0, }, /* 298 */ - { 47, 12, 3, 0, 0, }, /* 299 */ - { 47, 10, 3, 0, 0, }, /* 300 */ - { 47, 13, 12, 0, 0, }, /* 301 */ - { 47, 21, 12, 0, 0, }, /* 302 */ - { 56, 7, 12, 0, 0, }, /* 303 */ - { 56, 12, 3, 0, 0, }, /* 304 */ - { 56, 7, 5, 0, 0, }, /* 305 */ - { 56, 6, 12, 0, 0, }, /* 306 */ - { 56, 21, 12, 0, 0, }, /* 307 */ - { 56, 13, 12, 0, 0, }, /* 308 */ - { 32, 7, 12, 0, 0, }, /* 309 */ - { 32, 12, 3, 0, 0, }, /* 310 */ - { 32, 7, 5, 0, 0, }, /* 311 */ - { 32, 6, 12, 0, 0, }, /* 312 */ - { 32, 13, 12, 0, 0, }, /* 313 */ - { 57, 7, 12, 0, 0, }, /* 314 */ - { 57, 26, 12, 0, 0, }, /* 315 */ - { 57, 21, 12, 0, 0, }, /* 316 */ - { 57, 12, 3, 0, 0, }, /* 317 */ - { 57, 13, 12, 0, 0, }, /* 318 */ - { 57, 15, 12, 0, 0, }, /* 319 */ - { 57, 22, 12, 0, 0, }, /* 320 */ - { 57, 18, 12, 0, 0, }, /* 321 */ - { 57, 10, 5, 0, 0, }, /* 322 */ - { 38, 7, 12, 0, 0, }, /* 323 */ - { 38, 10, 12, 0, 0, }, /* 324 */ - { 38, 12, 3, 0, 0, }, /* 325 */ - { 38, 10, 5, 0, 0, }, /* 326 */ - { 38, 13, 12, 0, 0, }, /* 327 */ - { 38, 21, 12, 0, 0, }, /* 328 */ - { 38, 26, 12, 0, 0, }, /* 329 */ - { 16, 9, 12, 0, 7264, }, /* 330 */ - { 16, 7, 12, 0, 0, }, /* 331 */ - { 16, 6, 12, 0, 0, }, /* 332 */ - { 23, 7, 6, 0, 0, }, /* 333 */ - { 23, 7, 7, 0, 0, }, /* 334 */ - { 23, 7, 8, 0, 0, }, /* 335 */ - { 15, 7, 12, 0, 0, }, /* 336 */ - { 15, 12, 3, 0, 0, }, /* 337 */ - { 15, 21, 12, 0, 0, }, /* 338 */ - { 15, 15, 12, 0, 0, }, /* 339 */ - { 15, 26, 12, 0, 0, }, /* 340 */ - { 8, 9, 12, 0, 38864, }, /* 341 */ - { 8, 9, 12, 0, 8, }, /* 342 */ - { 8, 5, 12, 0, -8, }, /* 343 */ - { 7, 17, 12, 0, 0, }, /* 344 */ - { 7, 7, 12, 0, 0, }, /* 345 */ - { 7, 21, 12, 0, 0, }, /* 346 */ - { 40, 29, 12, 0, 0, }, /* 347 */ - { 40, 7, 12, 0, 0, }, /* 348 */ - { 40, 22, 12, 0, 0, }, /* 349 */ - { 40, 18, 12, 0, 0, }, /* 350 */ - { 45, 7, 12, 0, 0, }, /* 351 */ - { 45, 14, 12, 0, 0, }, /* 352 */ - { 50, 7, 12, 0, 0, }, /* 353 */ - { 50, 12, 3, 0, 0, }, /* 354 */ - { 24, 7, 12, 0, 0, }, /* 355 */ - { 24, 12, 3, 0, 0, }, /* 356 */ - { 6, 7, 12, 0, 0, }, /* 357 */ - { 6, 12, 3, 0, 0, }, /* 358 */ - { 51, 7, 12, 0, 0, }, /* 359 */ - { 51, 12, 3, 0, 0, }, /* 360 */ - { 31, 7, 12, 0, 0, }, /* 361 */ - { 31, 12, 3, 0, 0, }, /* 362 */ - { 31, 10, 5, 0, 0, }, /* 363 */ - { 31, 21, 12, 0, 0, }, /* 364 */ - { 31, 6, 12, 0, 0, }, /* 365 */ - { 31, 23, 12, 0, 0, }, /* 366 */ - { 31, 13, 12, 0, 0, }, /* 367 */ - { 31, 15, 12, 0, 0, }, /* 368 */ - { 37, 21, 12, 0, 0, }, /* 369 */ - { 37, 17, 12, 0, 0, }, /* 370 */ - { 37, 12, 3, 0, 0, }, /* 371 */ - { 37, 1, 2, 0, 0, }, /* 372 */ - { 37, 13, 12, 0, 0, }, /* 373 */ - { 37, 7, 12, 0, 0, }, /* 374 */ - { 37, 6, 12, 0, 0, }, /* 375 */ - { 34, 7, 12, 0, 0, }, /* 376 */ - { 34, 12, 3, 0, 0, }, /* 377 */ - { 34, 10, 5, 0, 0, }, /* 378 */ - { 34, 26, 12, 0, 0, }, /* 379 */ - { 34, 21, 12, 0, 0, }, /* 380 */ - { 34, 13, 12, 0, 0, }, /* 381 */ - { 52, 7, 12, 0, 0, }, /* 382 */ - { 39, 7, 12, 0, 0, }, /* 383 */ - { 39, 13, 12, 0, 0, }, /* 384 */ - { 39, 15, 12, 0, 0, }, /* 385 */ - { 39, 26, 12, 0, 0, }, /* 386 */ - { 31, 26, 12, 0, 0, }, /* 387 */ - { 5, 7, 12, 0, 0, }, /* 388 */ - { 5, 12, 3, 0, 0, }, /* 389 */ - { 5, 10, 5, 0, 0, }, /* 390 */ - { 5, 21, 12, 0, 0, }, /* 391 */ - { 90, 7, 12, 0, 0, }, /* 392 */ - { 90, 10, 5, 0, 0, }, /* 393 */ - { 90, 12, 3, 0, 0, }, /* 394 */ - { 90, 10, 12, 0, 0, }, /* 395 */ - { 90, 13, 12, 0, 0, }, /* 396 */ - { 90, 21, 12, 0, 0, }, /* 397 */ - { 90, 6, 12, 0, 0, }, /* 398 */ - { 27, 11, 3, 0, 0, }, /* 399 */ - { 61, 12, 3, 0, 0, }, /* 400 */ - { 61, 10, 5, 0, 0, }, /* 401 */ - { 61, 7, 12, 0, 0, }, /* 402 */ - { 61, 13, 12, 0, 0, }, /* 403 */ - { 61, 21, 12, 0, 0, }, /* 404 */ - { 61, 26, 12, 0, 0, }, /* 405 */ - { 75, 12, 3, 0, 0, }, /* 406 */ - { 75, 10, 5, 0, 0, }, /* 407 */ - { 75, 7, 12, 0, 0, }, /* 408 */ - { 75, 13, 12, 0, 0, }, /* 409 */ - { 92, 7, 12, 0, 0, }, /* 410 */ - { 92, 12, 3, 0, 0, }, /* 411 */ - { 92, 10, 5, 0, 0, }, /* 412 */ - { 92, 21, 12, 0, 0, }, /* 413 */ - { 69, 7, 12, 0, 0, }, /* 414 */ - { 69, 10, 5, 0, 0, }, /* 415 */ - { 69, 12, 3, 0, 0, }, /* 416 */ - { 69, 21, 12, 0, 0, }, /* 417 */ - { 69, 13, 12, 0, 0, }, /* 418 */ - { 72, 13, 12, 0, 0, }, /* 419 */ - { 72, 7, 12, 0, 0, }, /* 420 */ - { 72, 6, 12, 0, 0, }, /* 421 */ - { 72, 21, 12, 0, 0, }, /* 422 */ - { 12, 5, 12, 63, -6222, }, /* 423 */ - { 12, 5, 12, 67, -6221, }, /* 424 */ - { 12, 5, 12, 71, -6212, }, /* 425 */ - { 12, 5, 12, 75, -6210, }, /* 426 */ - { 12, 5, 12, 79, -6210, }, /* 427 */ - { 12, 5, 12, 79, -6211, }, /* 428 */ - { 12, 5, 12, 84, -6204, }, /* 429 */ - { 12, 5, 12, 88, -6180, }, /* 430 */ - { 12, 5, 12, 108, 35267, }, /* 431 */ - { 75, 21, 12, 0, 0, }, /* 432 */ - { 9, 10, 5, 0, 0, }, /* 433 */ - { 9, 7, 12, 0, 0, }, /* 434 */ - { 12, 5, 12, 0, 0, }, /* 435 */ - { 12, 6, 12, 0, 0, }, /* 436 */ - { 33, 5, 12, 0, 35332, }, /* 437 */ - { 33, 5, 12, 0, 3814, }, /* 438 */ - { 33, 9, 12, 92, 1, }, /* 439 */ - { 33, 5, 12, 92, -1, }, /* 440 */ - { 33, 5, 12, 92, -58, }, /* 441 */ - { 33, 9, 12, 0, -7615, }, /* 442 */ - { 19, 5, 12, 0, 8, }, /* 443 */ - { 19, 9, 12, 0, -8, }, /* 444 */ - { 19, 5, 12, 0, 74, }, /* 445 */ - { 19, 5, 12, 0, 86, }, /* 446 */ - { 19, 5, 12, 0, 100, }, /* 447 */ - { 19, 5, 12, 0, 128, }, /* 448 */ - { 19, 5, 12, 0, 112, }, /* 449 */ - { 19, 5, 12, 0, 126, }, /* 450 */ - { 19, 8, 12, 0, -8, }, /* 451 */ - { 19, 5, 12, 0, 9, }, /* 452 */ - { 19, 9, 12, 0, -74, }, /* 453 */ - { 19, 8, 12, 0, -9, }, /* 454 */ - { 19, 5, 12, 21, -7173, }, /* 455 */ - { 19, 9, 12, 0, -86, }, /* 456 */ - { 19, 9, 12, 0, -100, }, /* 457 */ - { 19, 9, 12, 0, -112, }, /* 458 */ - { 19, 9, 12, 0, -128, }, /* 459 */ - { 19, 9, 12, 0, -126, }, /* 460 */ - { 27, 1, 3, 0, 0, }, /* 461 */ - { 27, 1, 16, 0, 0, }, /* 462 */ - { 9, 27, 2, 0, 0, }, /* 463 */ - { 9, 28, 2, 0, 0, }, /* 464 */ - { 9, 2, 2, 0, 0, }, /* 465 */ - { 9, 9, 12, 0, 0, }, /* 466 */ - { 9, 5, 12, 0, 0, }, /* 467 */ - { 19, 9, 12, 96, -7517, }, /* 468 */ - { 33, 9, 12, 100, -8383, }, /* 469 */ - { 33, 9, 12, 104, -8262, }, /* 470 */ - { 33, 9, 12, 0, 28, }, /* 471 */ - { 33, 5, 12, 0, -28, }, /* 472 */ - { 33, 14, 12, 0, 16, }, /* 473 */ - { 33, 14, 12, 0, -16, }, /* 474 */ - { 33, 14, 12, 0, 0, }, /* 475 */ - { 9, 26, 12, 0, 26, }, /* 476 */ - { 9, 26, 12, 0, -26, }, /* 477 */ - { 9, 26, 13, 0, 0, }, /* 478 */ - { 9, 26, 17, 0, 0, }, /* 479 */ - { 4, 26, 12, 0, 0, }, /* 480 */ - { 17, 9, 12, 0, 48, }, /* 481 */ - { 17, 5, 12, 0, -48, }, /* 482 */ - { 33, 9, 12, 0, -10743, }, /* 483 */ - { 33, 9, 12, 0, -3814, }, /* 484 */ - { 33, 9, 12, 0, -10727, }, /* 485 */ - { 33, 5, 12, 0, -10795, }, /* 486 */ - { 33, 5, 12, 0, -10792, }, /* 487 */ - { 33, 9, 12, 0, -10780, }, /* 488 */ - { 33, 9, 12, 0, -10749, }, /* 489 */ - { 33, 9, 12, 0, -10783, }, /* 490 */ - { 33, 9, 12, 0, -10782, }, /* 491 */ - { 33, 9, 12, 0, -10815, }, /* 492 */ - { 10, 5, 12, 0, 0, }, /* 493 */ - { 10, 26, 12, 0, 0, }, /* 494 */ - { 10, 12, 3, 0, 0, }, /* 495 */ - { 10, 21, 12, 0, 0, }, /* 496 */ - { 10, 15, 12, 0, 0, }, /* 497 */ - { 16, 5, 12, 0, -7264, }, /* 498 */ - { 58, 7, 12, 0, 0, }, /* 499 */ - { 58, 6, 12, 0, 0, }, /* 500 */ - { 58, 21, 12, 0, 0, }, /* 501 */ - { 58, 12, 3, 0, 0, }, /* 502 */ - { 22, 26, 12, 0, 0, }, /* 503 */ - { 22, 6, 12, 0, 0, }, /* 504 */ - { 22, 14, 12, 0, 0, }, /* 505 */ - { 23, 10, 3, 0, 0, }, /* 506 */ - { 26, 7, 12, 0, 0, }, /* 507 */ - { 26, 6, 12, 0, 0, }, /* 508 */ - { 29, 7, 12, 0, 0, }, /* 509 */ - { 29, 6, 12, 0, 0, }, /* 510 */ - { 3, 7, 12, 0, 0, }, /* 511 */ - { 23, 7, 12, 0, 0, }, /* 512 */ - { 23, 26, 12, 0, 0, }, /* 513 */ - { 29, 26, 12, 0, 0, }, /* 514 */ - { 22, 7, 12, 0, 0, }, /* 515 */ - { 60, 7, 12, 0, 0, }, /* 516 */ - { 60, 6, 12, 0, 0, }, /* 517 */ - { 60, 26, 12, 0, 0, }, /* 518 */ - { 85, 7, 12, 0, 0, }, /* 519 */ - { 85, 6, 12, 0, 0, }, /* 520 */ - { 85, 21, 12, 0, 0, }, /* 521 */ - { 76, 7, 12, 0, 0, }, /* 522 */ - { 76, 6, 12, 0, 0, }, /* 523 */ - { 76, 21, 12, 0, 0, }, /* 524 */ - { 76, 13, 12, 0, 0, }, /* 525 */ - { 12, 9, 12, 108, 1, }, /* 526 */ - { 12, 5, 12, 108, -35267, }, /* 527 */ - { 12, 7, 12, 0, 0, }, /* 528 */ - { 12, 21, 12, 0, 0, }, /* 529 */ - { 78, 7, 12, 0, 0, }, /* 530 */ - { 78, 14, 12, 0, 0, }, /* 531 */ - { 78, 12, 3, 0, 0, }, /* 532 */ - { 78, 21, 12, 0, 0, }, /* 533 */ - { 33, 9, 12, 0, -35332, }, /* 534 */ - { 33, 9, 12, 0, -42280, }, /* 535 */ - { 33, 9, 12, 0, -42308, }, /* 536 */ - { 33, 9, 12, 0, -42319, }, /* 537 */ - { 33, 9, 12, 0, -42315, }, /* 538 */ - { 33, 9, 12, 0, -42305, }, /* 539 */ - { 33, 9, 12, 0, -42258, }, /* 540 */ - { 33, 9, 12, 0, -42282, }, /* 541 */ - { 33, 9, 12, 0, -42261, }, /* 542 */ - { 33, 9, 12, 0, 928, }, /* 543 */ - { 48, 7, 12, 0, 0, }, /* 544 */ - { 48, 12, 3, 0, 0, }, /* 545 */ - { 48, 10, 5, 0, 0, }, /* 546 */ - { 48, 26, 12, 0, 0, }, /* 547 */ - { 64, 7, 12, 0, 0, }, /* 548 */ - { 64, 21, 12, 0, 0, }, /* 549 */ - { 74, 10, 5, 0, 0, }, /* 550 */ - { 74, 7, 12, 0, 0, }, /* 551 */ - { 74, 12, 3, 0, 0, }, /* 552 */ - { 74, 21, 12, 0, 0, }, /* 553 */ - { 74, 13, 12, 0, 0, }, /* 554 */ - { 68, 13, 12, 0, 0, }, /* 555 */ - { 68, 7, 12, 0, 0, }, /* 556 */ - { 68, 12, 3, 0, 0, }, /* 557 */ - { 68, 21, 12, 0, 0, }, /* 558 */ - { 73, 7, 12, 0, 0, }, /* 559 */ - { 73, 12, 3, 0, 0, }, /* 560 */ - { 73, 10, 5, 0, 0, }, /* 561 */ - { 73, 21, 12, 0, 0, }, /* 562 */ - { 83, 12, 3, 0, 0, }, /* 563 */ - { 83, 10, 5, 0, 0, }, /* 564 */ - { 83, 7, 12, 0, 0, }, /* 565 */ - { 83, 21, 12, 0, 0, }, /* 566 */ - { 83, 13, 12, 0, 0, }, /* 567 */ - { 38, 6, 12, 0, 0, }, /* 568 */ - { 67, 7, 12, 0, 0, }, /* 569 */ - { 67, 12, 3, 0, 0, }, /* 570 */ - { 67, 10, 5, 0, 0, }, /* 571 */ - { 67, 13, 12, 0, 0, }, /* 572 */ - { 67, 21, 12, 0, 0, }, /* 573 */ - { 91, 7, 12, 0, 0, }, /* 574 */ - { 91, 12, 3, 0, 0, }, /* 575 */ - { 91, 6, 12, 0, 0, }, /* 576 */ - { 91, 21, 12, 0, 0, }, /* 577 */ - { 86, 7, 12, 0, 0, }, /* 578 */ - { 86, 10, 5, 0, 0, }, /* 579 */ - { 86, 12, 3, 0, 0, }, /* 580 */ - { 86, 21, 12, 0, 0, }, /* 581 */ - { 86, 6, 12, 0, 0, }, /* 582 */ - { 33, 5, 12, 0, -928, }, /* 583 */ - { 8, 5, 12, 0, -38864, }, /* 584 */ - { 86, 13, 12, 0, 0, }, /* 585 */ - { 23, 7, 9, 0, 0, }, /* 586 */ - { 23, 7, 10, 0, 0, }, /* 587 */ - { 9, 4, 2, 0, 0, }, /* 588 */ - { 9, 3, 12, 0, 0, }, /* 589 */ - { 25, 25, 12, 0, 0, }, /* 590 */ - { 0, 24, 12, 0, 0, }, /* 591 */ - { 9, 6, 3, 0, 0, }, /* 592 */ - { 35, 7, 12, 0, 0, }, /* 593 */ - { 19, 14, 12, 0, 0, }, /* 594 */ - { 19, 15, 12, 0, 0, }, /* 595 */ - { 19, 26, 12, 0, 0, }, /* 596 */ - { 70, 7, 12, 0, 0, }, /* 597 */ - { 66, 7, 12, 0, 0, }, /* 598 */ - { 41, 7, 12, 0, 0, }, /* 599 */ - { 41, 15, 12, 0, 0, }, /* 600 */ - { 18, 7, 12, 0, 0, }, /* 601 */ - { 18, 14, 12, 0, 0, }, /* 602 */ - { 117, 7, 12, 0, 0, }, /* 603 */ - { 117, 12, 3, 0, 0, }, /* 604 */ - { 59, 7, 12, 0, 0, }, /* 605 */ - { 59, 21, 12, 0, 0, }, /* 606 */ - { 42, 7, 12, 0, 0, }, /* 607 */ - { 42, 21, 12, 0, 0, }, /* 608 */ - { 42, 14, 12, 0, 0, }, /* 609 */ - { 13, 9, 12, 0, 40, }, /* 610 */ - { 13, 5, 12, 0, -40, }, /* 611 */ - { 46, 7, 12, 0, 0, }, /* 612 */ - { 44, 7, 12, 0, 0, }, /* 613 */ - { 44, 13, 12, 0, 0, }, /* 614 */ - { 135, 9, 12, 0, 40, }, /* 615 */ - { 135, 5, 12, 0, -40, }, /* 616 */ - { 105, 7, 12, 0, 0, }, /* 617 */ - { 103, 7, 12, 0, 0, }, /* 618 */ - { 103, 21, 12, 0, 0, }, /* 619 */ - { 109, 7, 12, 0, 0, }, /* 620 */ - { 11, 7, 12, 0, 0, }, /* 621 */ - { 80, 7, 12, 0, 0, }, /* 622 */ - { 80, 21, 12, 0, 0, }, /* 623 */ - { 80, 15, 12, 0, 0, }, /* 624 */ - { 119, 7, 12, 0, 0, }, /* 625 */ - { 119, 26, 12, 0, 0, }, /* 626 */ - { 119, 15, 12, 0, 0, }, /* 627 */ - { 115, 7, 12, 0, 0, }, /* 628 */ - { 115, 15, 12, 0, 0, }, /* 629 */ - { 127, 7, 12, 0, 0, }, /* 630 */ - { 127, 15, 12, 0, 0, }, /* 631 */ - { 65, 7, 12, 0, 0, }, /* 632 */ - { 65, 15, 12, 0, 0, }, /* 633 */ - { 65, 21, 12, 0, 0, }, /* 634 */ - { 71, 7, 12, 0, 0, }, /* 635 */ - { 71, 21, 12, 0, 0, }, /* 636 */ - { 97, 7, 12, 0, 0, }, /* 637 */ - { 96, 7, 12, 0, 0, }, /* 638 */ - { 96, 15, 12, 0, 0, }, /* 639 */ - { 30, 7, 12, 0, 0, }, /* 640 */ - { 30, 12, 3, 0, 0, }, /* 641 */ - { 30, 15, 12, 0, 0, }, /* 642 */ - { 30, 21, 12, 0, 0, }, /* 643 */ - { 87, 7, 12, 0, 0, }, /* 644 */ - { 87, 15, 12, 0, 0, }, /* 645 */ - { 87, 21, 12, 0, 0, }, /* 646 */ - { 116, 7, 12, 0, 0, }, /* 647 */ - { 116, 15, 12, 0, 0, }, /* 648 */ - { 111, 7, 12, 0, 0, }, /* 649 */ - { 111, 26, 12, 0, 0, }, /* 650 */ - { 111, 12, 3, 0, 0, }, /* 651 */ - { 111, 15, 12, 0, 0, }, /* 652 */ - { 111, 21, 12, 0, 0, }, /* 653 */ - { 77, 7, 12, 0, 0, }, /* 654 */ - { 77, 21, 12, 0, 0, }, /* 655 */ - { 82, 7, 12, 0, 0, }, /* 656 */ - { 82, 15, 12, 0, 0, }, /* 657 */ - { 81, 7, 12, 0, 0, }, /* 658 */ - { 81, 15, 12, 0, 0, }, /* 659 */ - { 120, 7, 12, 0, 0, }, /* 660 */ - { 120, 21, 12, 0, 0, }, /* 661 */ - { 120, 15, 12, 0, 0, }, /* 662 */ - { 88, 7, 12, 0, 0, }, /* 663 */ - { 129, 9, 12, 0, 64, }, /* 664 */ - { 129, 5, 12, 0, -64, }, /* 665 */ - { 129, 15, 12, 0, 0, }, /* 666 */ - { 0, 15, 12, 0, 0, }, /* 667 */ - { 93, 10, 5, 0, 0, }, /* 668 */ - { 93, 12, 3, 0, 0, }, /* 669 */ - { 93, 7, 12, 0, 0, }, /* 670 */ - { 93, 21, 12, 0, 0, }, /* 671 */ - { 93, 15, 12, 0, 0, }, /* 672 */ - { 93, 13, 12, 0, 0, }, /* 673 */ - { 84, 12, 3, 0, 0, }, /* 674 */ - { 84, 10, 5, 0, 0, }, /* 675 */ - { 84, 7, 12, 0, 0, }, /* 676 */ - { 84, 21, 12, 0, 0, }, /* 677 */ - { 84, 1, 4, 0, 0, }, /* 678 */ - { 100, 7, 12, 0, 0, }, /* 679 */ - { 100, 13, 12, 0, 0, }, /* 680 */ - { 95, 12, 3, 0, 0, }, /* 681 */ - { 95, 7, 12, 0, 0, }, /* 682 */ - { 95, 10, 5, 0, 0, }, /* 683 */ - { 95, 13, 12, 0, 0, }, /* 684 */ - { 95, 21, 12, 0, 0, }, /* 685 */ - { 110, 7, 12, 0, 0, }, /* 686 */ - { 110, 12, 3, 0, 0, }, /* 687 */ - { 110, 21, 12, 0, 0, }, /* 688 */ - { 99, 12, 3, 0, 0, }, /* 689 */ - { 99, 10, 5, 0, 0, }, /* 690 */ - { 99, 7, 12, 0, 0, }, /* 691 */ - { 99, 7, 4, 0, 0, }, /* 692 */ - { 99, 21, 12, 0, 0, }, /* 693 */ - { 99, 13, 12, 0, 0, }, /* 694 */ - { 47, 15, 12, 0, 0, }, /* 695 */ - { 107, 7, 12, 0, 0, }, /* 696 */ - { 107, 10, 5, 0, 0, }, /* 697 */ - { 107, 12, 3, 0, 0, }, /* 698 */ - { 107, 21, 12, 0, 0, }, /* 699 */ - { 128, 7, 12, 0, 0, }, /* 700 */ - { 128, 21, 12, 0, 0, }, /* 701 */ - { 108, 7, 12, 0, 0, }, /* 702 */ - { 108, 12, 3, 0, 0, }, /* 703 */ - { 108, 10, 5, 0, 0, }, /* 704 */ - { 108, 13, 12, 0, 0, }, /* 705 */ - { 106, 12, 3, 0, 0, }, /* 706 */ - { 106, 10, 5, 0, 0, }, /* 707 */ - { 106, 7, 12, 0, 0, }, /* 708 */ - { 106, 10, 3, 0, 0, }, /* 709 */ - { 134, 7, 12, 0, 0, }, /* 710 */ - { 134, 10, 5, 0, 0, }, /* 711 */ - { 134, 12, 3, 0, 0, }, /* 712 */ - { 134, 21, 12, 0, 0, }, /* 713 */ - { 134, 13, 12, 0, 0, }, /* 714 */ - { 123, 7, 12, 0, 0, }, /* 715 */ - { 123, 10, 3, 0, 0, }, /* 716 */ - { 123, 10, 5, 0, 0, }, /* 717 */ - { 123, 12, 3, 0, 0, }, /* 718 */ - { 123, 21, 12, 0, 0, }, /* 719 */ - { 123, 13, 12, 0, 0, }, /* 720 */ - { 122, 7, 12, 0, 0, }, /* 721 */ - { 122, 10, 3, 0, 0, }, /* 722 */ - { 122, 10, 5, 0, 0, }, /* 723 */ - { 122, 12, 3, 0, 0, }, /* 724 */ - { 122, 21, 12, 0, 0, }, /* 725 */ - { 113, 7, 12, 0, 0, }, /* 726 */ - { 113, 10, 5, 0, 0, }, /* 727 */ - { 113, 12, 3, 0, 0, }, /* 728 */ - { 113, 21, 12, 0, 0, }, /* 729 */ - { 113, 13, 12, 0, 0, }, /* 730 */ - { 101, 7, 12, 0, 0, }, /* 731 */ - { 101, 12, 3, 0, 0, }, /* 732 */ - { 101, 10, 5, 0, 0, }, /* 733 */ - { 101, 13, 12, 0, 0, }, /* 734 */ - { 125, 7, 12, 0, 0, }, /* 735 */ - { 125, 12, 3, 0, 0, }, /* 736 */ - { 125, 10, 5, 0, 0, }, /* 737 */ - { 125, 13, 12, 0, 0, }, /* 738 */ - { 125, 15, 12, 0, 0, }, /* 739 */ - { 125, 21, 12, 0, 0, }, /* 740 */ - { 125, 26, 12, 0, 0, }, /* 741 */ - { 124, 9, 12, 0, 32, }, /* 742 */ - { 124, 5, 12, 0, -32, }, /* 743 */ - { 124, 13, 12, 0, 0, }, /* 744 */ - { 124, 15, 12, 0, 0, }, /* 745 */ - { 124, 7, 12, 0, 0, }, /* 746 */ - { 140, 7, 12, 0, 0, }, /* 747 */ - { 140, 12, 3, 0, 0, }, /* 748 */ - { 140, 10, 5, 0, 0, }, /* 749 */ - { 140, 7, 4, 0, 0, }, /* 750 */ - { 140, 21, 12, 0, 0, }, /* 751 */ - { 139, 7, 12, 0, 0, }, /* 752 */ - { 139, 12, 3, 0, 0, }, /* 753 */ - { 139, 10, 5, 0, 0, }, /* 754 */ - { 139, 7, 4, 0, 0, }, /* 755 */ - { 139, 21, 12, 0, 0, }, /* 756 */ - { 121, 7, 12, 0, 0, }, /* 757 */ - { 132, 7, 12, 0, 0, }, /* 758 */ - { 132, 10, 5, 0, 0, }, /* 759 */ - { 132, 12, 3, 0, 0, }, /* 760 */ - { 132, 21, 12, 0, 0, }, /* 761 */ - { 132, 13, 12, 0, 0, }, /* 762 */ - { 132, 15, 12, 0, 0, }, /* 763 */ - { 133, 21, 12, 0, 0, }, /* 764 */ - { 133, 7, 12, 0, 0, }, /* 765 */ - { 133, 12, 3, 0, 0, }, /* 766 */ - { 133, 10, 5, 0, 0, }, /* 767 */ - { 137, 7, 12, 0, 0, }, /* 768 */ - { 137, 12, 3, 0, 0, }, /* 769 */ - { 137, 7, 4, 0, 0, }, /* 770 */ - { 137, 13, 12, 0, 0, }, /* 771 */ - { 62, 7, 12, 0, 0, }, /* 772 */ - { 62, 14, 12, 0, 0, }, /* 773 */ - { 62, 21, 12, 0, 0, }, /* 774 */ - { 79, 7, 12, 0, 0, }, /* 775 */ - { 126, 7, 12, 0, 0, }, /* 776 */ - { 114, 7, 12, 0, 0, }, /* 777 */ - { 114, 13, 12, 0, 0, }, /* 778 */ - { 114, 21, 12, 0, 0, }, /* 779 */ - { 102, 7, 12, 0, 0, }, /* 780 */ - { 102, 12, 3, 0, 0, }, /* 781 */ - { 102, 21, 12, 0, 0, }, /* 782 */ - { 118, 7, 12, 0, 0, }, /* 783 */ - { 118, 12, 3, 0, 0, }, /* 784 */ - { 118, 21, 12, 0, 0, }, /* 785 */ - { 118, 26, 12, 0, 0, }, /* 786 */ - { 118, 6, 12, 0, 0, }, /* 787 */ - { 118, 13, 12, 0, 0, }, /* 788 */ - { 118, 15, 12, 0, 0, }, /* 789 */ - { 98, 7, 12, 0, 0, }, /* 790 */ - { 98, 10, 5, 0, 0, }, /* 791 */ - { 98, 12, 3, 0, 0, }, /* 792 */ - { 98, 6, 12, 0, 0, }, /* 793 */ - { 136, 6, 12, 0, 0, }, /* 794 */ - { 138, 6, 12, 0, 0, }, /* 795 */ - { 136, 7, 12, 0, 0, }, /* 796 */ - { 138, 7, 12, 0, 0, }, /* 797 */ - { 104, 7, 12, 0, 0, }, /* 798 */ - { 104, 26, 12, 0, 0, }, /* 799 */ - { 104, 12, 3, 0, 0, }, /* 800 */ - { 104, 21, 12, 0, 0, }, /* 801 */ - { 9, 10, 3, 0, 0, }, /* 802 */ - { 19, 12, 3, 0, 0, }, /* 803 */ - { 130, 26, 12, 0, 0, }, /* 804 */ - { 130, 12, 3, 0, 0, }, /* 805 */ - { 130, 21, 12, 0, 0, }, /* 806 */ - { 17, 12, 3, 0, 0, }, /* 807 */ - { 112, 7, 12, 0, 0, }, /* 808 */ - { 112, 15, 12, 0, 0, }, /* 809 */ - { 112, 12, 3, 0, 0, }, /* 810 */ - { 131, 9, 12, 0, 34, }, /* 811 */ - { 131, 5, 12, 0, -34, }, /* 812 */ - { 131, 12, 3, 0, 0, }, /* 813 */ - { 131, 13, 12, 0, 0, }, /* 814 */ - { 131, 21, 12, 0, 0, }, /* 815 */ - { 9, 26, 11, 0, 0, }, /* 816 */ - { 26, 26, 12, 0, 0, }, /* 817 */ - { 9, 24, 14, 0, 0, }, /* 818 */ - { 9, 26, 15, 0, 0, }, /* 819 */ - { 9, 1, 3, 0, 0, }, /* 820 */ + { 1, 5, 12, 0, -48, }, /* 201 */ + { 1, 17, 12, 0, 0, }, /* 202 */ + { 1, 26, 12, 0, 0, }, /* 203 */ + { 1, 23, 12, 0, 0, }, /* 204 */ + { 25, 12, 3, 0, 0, }, /* 205 */ + { 25, 17, 12, 0, 0, }, /* 206 */ + { 25, 21, 12, 0, 0, }, /* 207 */ + { 25, 7, 12, 0, 0, }, /* 208 */ + { 0, 1, 4, 0, 0, }, /* 209 */ + { 9, 1, 4, 0, 0, }, /* 210 */ + { 0, 25, 12, 0, 0, }, /* 211 */ + { 0, 21, 12, 0, 0, }, /* 212 */ + { 0, 23, 12, 0, 0, }, /* 213 */ + { 0, 26, 12, 0, 0, }, /* 214 */ + { 0, 12, 3, 0, 0, }, /* 215 */ + { 0, 1, 2, 0, 0, }, /* 216 */ + { 0, 7, 12, 0, 0, }, /* 217 */ + { 0, 13, 12, 0, 0, }, /* 218 */ + { 0, 6, 12, 0, 0, }, /* 219 */ + { 49, 21, 12, 0, 0, }, /* 220 */ + { 49, 1, 4, 0, 0, }, /* 221 */ + { 49, 7, 12, 0, 0, }, /* 222 */ + { 49, 12, 3, 0, 0, }, /* 223 */ + { 55, 7, 12, 0, 0, }, /* 224 */ + { 55, 12, 3, 0, 0, }, /* 225 */ + { 63, 13, 12, 0, 0, }, /* 226 */ + { 63, 7, 12, 0, 0, }, /* 227 */ + { 63, 12, 3, 0, 0, }, /* 228 */ + { 63, 6, 12, 0, 0, }, /* 229 */ + { 63, 26, 12, 0, 0, }, /* 230 */ + { 63, 21, 12, 0, 0, }, /* 231 */ + { 63, 23, 12, 0, 0, }, /* 232 */ + { 89, 7, 12, 0, 0, }, /* 233 */ + { 89, 12, 3, 0, 0, }, /* 234 */ + { 89, 6, 12, 0, 0, }, /* 235 */ + { 89, 21, 12, 0, 0, }, /* 236 */ + { 94, 7, 12, 0, 0, }, /* 237 */ + { 94, 12, 3, 0, 0, }, /* 238 */ + { 94, 21, 12, 0, 0, }, /* 239 */ + { 14, 12, 3, 0, 0, }, /* 240 */ + { 14, 10, 5, 0, 0, }, /* 241 */ + { 14, 7, 12, 0, 0, }, /* 242 */ + { 14, 13, 12, 0, 0, }, /* 243 */ + { 14, 21, 12, 0, 0, }, /* 244 */ + { 14, 6, 12, 0, 0, }, /* 245 */ + { 2, 7, 12, 0, 0, }, /* 246 */ + { 2, 12, 3, 0, 0, }, /* 247 */ + { 2, 10, 5, 0, 0, }, /* 248 */ + { 2, 10, 3, 0, 0, }, /* 249 */ + { 2, 13, 12, 0, 0, }, /* 250 */ + { 2, 23, 12, 0, 0, }, /* 251 */ + { 2, 15, 12, 0, 0, }, /* 252 */ + { 2, 26, 12, 0, 0, }, /* 253 */ + { 2, 21, 12, 0, 0, }, /* 254 */ + { 21, 12, 3, 0, 0, }, /* 255 */ + { 21, 10, 5, 0, 0, }, /* 256 */ + { 21, 7, 12, 0, 0, }, /* 257 */ + { 21, 13, 12, 0, 0, }, /* 258 */ + { 21, 21, 12, 0, 0, }, /* 259 */ + { 20, 12, 3, 0, 0, }, /* 260 */ + { 20, 10, 5, 0, 0, }, /* 261 */ + { 20, 7, 12, 0, 0, }, /* 262 */ + { 20, 13, 12, 0, 0, }, /* 263 */ + { 20, 21, 12, 0, 0, }, /* 264 */ + { 20, 23, 12, 0, 0, }, /* 265 */ + { 43, 12, 3, 0, 0, }, /* 266 */ + { 43, 10, 5, 0, 0, }, /* 267 */ + { 43, 7, 12, 0, 0, }, /* 268 */ + { 43, 10, 3, 0, 0, }, /* 269 */ + { 43, 13, 12, 0, 0, }, /* 270 */ + { 43, 26, 12, 0, 0, }, /* 271 */ + { 43, 15, 12, 0, 0, }, /* 272 */ + { 53, 12, 3, 0, 0, }, /* 273 */ + { 53, 7, 12, 0, 0, }, /* 274 */ + { 53, 10, 3, 0, 0, }, /* 275 */ + { 53, 10, 5, 0, 0, }, /* 276 */ + { 53, 13, 12, 0, 0, }, /* 277 */ + { 53, 15, 12, 0, 0, }, /* 278 */ + { 53, 26, 12, 0, 0, }, /* 279 */ + { 53, 23, 12, 0, 0, }, /* 280 */ + { 54, 12, 3, 0, 0, }, /* 281 */ + { 54, 10, 5, 0, 0, }, /* 282 */ + { 54, 7, 12, 0, 0, }, /* 283 */ + { 54, 13, 12, 0, 0, }, /* 284 */ + { 54, 15, 12, 0, 0, }, /* 285 */ + { 54, 26, 12, 0, 0, }, /* 286 */ + { 28, 7, 12, 0, 0, }, /* 287 */ + { 28, 12, 3, 0, 0, }, /* 288 */ + { 28, 10, 5, 0, 0, }, /* 289 */ + { 28, 21, 12, 0, 0, }, /* 290 */ + { 28, 10, 3, 0, 0, }, /* 291 */ + { 28, 13, 12, 0, 0, }, /* 292 */ + { 36, 12, 3, 0, 0, }, /* 293 */ + { 36, 10, 5, 0, 0, }, /* 294 */ + { 36, 7, 12, 0, 0, }, /* 295 */ + { 36, 10, 3, 0, 0, }, /* 296 */ + { 36, 7, 4, 0, 0, }, /* 297 */ + { 36, 26, 12, 0, 0, }, /* 298 */ + { 36, 15, 12, 0, 0, }, /* 299 */ + { 36, 13, 12, 0, 0, }, /* 300 */ + { 47, 10, 5, 0, 0, }, /* 301 */ + { 47, 7, 12, 0, 0, }, /* 302 */ + { 47, 12, 3, 0, 0, }, /* 303 */ + { 47, 10, 3, 0, 0, }, /* 304 */ + { 47, 13, 12, 0, 0, }, /* 305 */ + { 47, 21, 12, 0, 0, }, /* 306 */ + { 56, 7, 12, 0, 0, }, /* 307 */ + { 56, 12, 3, 0, 0, }, /* 308 */ + { 56, 7, 5, 0, 0, }, /* 309 */ + { 56, 6, 12, 0, 0, }, /* 310 */ + { 56, 21, 12, 0, 0, }, /* 311 */ + { 56, 13, 12, 0, 0, }, /* 312 */ + { 32, 7, 12, 0, 0, }, /* 313 */ + { 32, 12, 3, 0, 0, }, /* 314 */ + { 32, 7, 5, 0, 0, }, /* 315 */ + { 32, 6, 12, 0, 0, }, /* 316 */ + { 32, 13, 12, 0, 0, }, /* 317 */ + { 57, 7, 12, 0, 0, }, /* 318 */ + { 57, 26, 12, 0, 0, }, /* 319 */ + { 57, 21, 12, 0, 0, }, /* 320 */ + { 57, 12, 3, 0, 0, }, /* 321 */ + { 57, 13, 12, 0, 0, }, /* 322 */ + { 57, 15, 12, 0, 0, }, /* 323 */ + { 57, 22, 12, 0, 0, }, /* 324 */ + { 57, 18, 12, 0, 0, }, /* 325 */ + { 57, 10, 5, 0, 0, }, /* 326 */ + { 38, 7, 12, 0, 0, }, /* 327 */ + { 38, 10, 12, 0, 0, }, /* 328 */ + { 38, 12, 3, 0, 0, }, /* 329 */ + { 38, 10, 5, 0, 0, }, /* 330 */ + { 38, 13, 12, 0, 0, }, /* 331 */ + { 38, 21, 12, 0, 0, }, /* 332 */ + { 38, 26, 12, 0, 0, }, /* 333 */ + { 16, 9, 12, 0, 7264, }, /* 334 */ + { 16, 5, 12, 0, 3008, }, /* 335 */ + { 16, 6, 12, 0, 0, }, /* 336 */ + { 23, 7, 6, 0, 0, }, /* 337 */ + { 23, 7, 7, 0, 0, }, /* 338 */ + { 23, 7, 8, 0, 0, }, /* 339 */ + { 15, 7, 12, 0, 0, }, /* 340 */ + { 15, 12, 3, 0, 0, }, /* 341 */ + { 15, 21, 12, 0, 0, }, /* 342 */ + { 15, 15, 12, 0, 0, }, /* 343 */ + { 15, 26, 12, 0, 0, }, /* 344 */ + { 8, 9, 12, 0, 38864, }, /* 345 */ + { 8, 9, 12, 0, 8, }, /* 346 */ + { 8, 5, 12, 0, -8, }, /* 347 */ + { 7, 17, 12, 0, 0, }, /* 348 */ + { 7, 7, 12, 0, 0, }, /* 349 */ + { 7, 21, 12, 0, 0, }, /* 350 */ + { 40, 29, 12, 0, 0, }, /* 351 */ + { 40, 7, 12, 0, 0, }, /* 352 */ + { 40, 22, 12, 0, 0, }, /* 353 */ + { 40, 18, 12, 0, 0, }, /* 354 */ + { 45, 7, 12, 0, 0, }, /* 355 */ + { 45, 14, 12, 0, 0, }, /* 356 */ + { 50, 7, 12, 0, 0, }, /* 357 */ + { 50, 12, 3, 0, 0, }, /* 358 */ + { 24, 7, 12, 0, 0, }, /* 359 */ + { 24, 12, 3, 0, 0, }, /* 360 */ + { 6, 7, 12, 0, 0, }, /* 361 */ + { 6, 12, 3, 0, 0, }, /* 362 */ + { 51, 7, 12, 0, 0, }, /* 363 */ + { 51, 12, 3, 0, 0, }, /* 364 */ + { 31, 7, 12, 0, 0, }, /* 365 */ + { 31, 12, 3, 0, 0, }, /* 366 */ + { 31, 10, 5, 0, 0, }, /* 367 */ + { 31, 21, 12, 0, 0, }, /* 368 */ + { 31, 6, 12, 0, 0, }, /* 369 */ + { 31, 23, 12, 0, 0, }, /* 370 */ + { 31, 13, 12, 0, 0, }, /* 371 */ + { 31, 15, 12, 0, 0, }, /* 372 */ + { 37, 21, 12, 0, 0, }, /* 373 */ + { 37, 17, 12, 0, 0, }, /* 374 */ + { 37, 12, 3, 0, 0, }, /* 375 */ + { 37, 1, 2, 0, 0, }, /* 376 */ + { 37, 13, 12, 0, 0, }, /* 377 */ + { 37, 7, 12, 0, 0, }, /* 378 */ + { 37, 6, 12, 0, 0, }, /* 379 */ + { 34, 7, 12, 0, 0, }, /* 380 */ + { 34, 12, 3, 0, 0, }, /* 381 */ + { 34, 10, 5, 0, 0, }, /* 382 */ + { 34, 26, 12, 0, 0, }, /* 383 */ + { 34, 21, 12, 0, 0, }, /* 384 */ + { 34, 13, 12, 0, 0, }, /* 385 */ + { 52, 7, 12, 0, 0, }, /* 386 */ + { 39, 7, 12, 0, 0, }, /* 387 */ + { 39, 13, 12, 0, 0, }, /* 388 */ + { 39, 15, 12, 0, 0, }, /* 389 */ + { 39, 26, 12, 0, 0, }, /* 390 */ + { 31, 26, 12, 0, 0, }, /* 391 */ + { 5, 7, 12, 0, 0, }, /* 392 */ + { 5, 12, 3, 0, 0, }, /* 393 */ + { 5, 10, 5, 0, 0, }, /* 394 */ + { 5, 21, 12, 0, 0, }, /* 395 */ + { 90, 7, 12, 0, 0, }, /* 396 */ + { 90, 10, 5, 0, 0, }, /* 397 */ + { 90, 12, 3, 0, 0, }, /* 398 */ + { 90, 10, 12, 0, 0, }, /* 399 */ + { 90, 13, 12, 0, 0, }, /* 400 */ + { 90, 21, 12, 0, 0, }, /* 401 */ + { 90, 6, 12, 0, 0, }, /* 402 */ + { 27, 11, 3, 0, 0, }, /* 403 */ + { 61, 12, 3, 0, 0, }, /* 404 */ + { 61, 10, 5, 0, 0, }, /* 405 */ + { 61, 7, 12, 0, 0, }, /* 406 */ + { 61, 13, 12, 0, 0, }, /* 407 */ + { 61, 21, 12, 0, 0, }, /* 408 */ + { 61, 26, 12, 0, 0, }, /* 409 */ + { 75, 12, 3, 0, 0, }, /* 410 */ + { 75, 10, 5, 0, 0, }, /* 411 */ + { 75, 7, 12, 0, 0, }, /* 412 */ + { 75, 13, 12, 0, 0, }, /* 413 */ + { 92, 7, 12, 0, 0, }, /* 414 */ + { 92, 12, 3, 0, 0, }, /* 415 */ + { 92, 10, 5, 0, 0, }, /* 416 */ + { 92, 21, 12, 0, 0, }, /* 417 */ + { 69, 7, 12, 0, 0, }, /* 418 */ + { 69, 10, 5, 0, 0, }, /* 419 */ + { 69, 12, 3, 0, 0, }, /* 420 */ + { 69, 21, 12, 0, 0, }, /* 421 */ + { 69, 13, 12, 0, 0, }, /* 422 */ + { 72, 13, 12, 0, 0, }, /* 423 */ + { 72, 7, 12, 0, 0, }, /* 424 */ + { 72, 6, 12, 0, 0, }, /* 425 */ + { 72, 21, 12, 0, 0, }, /* 426 */ + { 12, 5, 12, 63, -6222, }, /* 427 */ + { 12, 5, 12, 67, -6221, }, /* 428 */ + { 12, 5, 12, 71, -6212, }, /* 429 */ + { 12, 5, 12, 75, -6210, }, /* 430 */ + { 12, 5, 12, 79, -6210, }, /* 431 */ + { 12, 5, 12, 79, -6211, }, /* 432 */ + { 12, 5, 12, 84, -6204, }, /* 433 */ + { 12, 5, 12, 88, -6180, }, /* 434 */ + { 12, 5, 12, 108, 35267, }, /* 435 */ + { 16, 9, 12, 0, -3008, }, /* 436 */ + { 75, 21, 12, 0, 0, }, /* 437 */ + { 9, 10, 5, 0, 0, }, /* 438 */ + { 9, 7, 12, 0, 0, }, /* 439 */ + { 12, 5, 12, 0, 0, }, /* 440 */ + { 12, 6, 12, 0, 0, }, /* 441 */ + { 33, 5, 12, 0, 35332, }, /* 442 */ + { 33, 5, 12, 0, 3814, }, /* 443 */ + { 33, 9, 12, 92, 1, }, /* 444 */ + { 33, 5, 12, 92, -1, }, /* 445 */ + { 33, 5, 12, 92, -58, }, /* 446 */ + { 33, 9, 12, 0, -7615, }, /* 447 */ + { 19, 5, 12, 0, 8, }, /* 448 */ + { 19, 9, 12, 0, -8, }, /* 449 */ + { 19, 5, 12, 0, 74, }, /* 450 */ + { 19, 5, 12, 0, 86, }, /* 451 */ + { 19, 5, 12, 0, 100, }, /* 452 */ + { 19, 5, 12, 0, 128, }, /* 453 */ + { 19, 5, 12, 0, 112, }, /* 454 */ + { 19, 5, 12, 0, 126, }, /* 455 */ + { 19, 8, 12, 0, -8, }, /* 456 */ + { 19, 5, 12, 0, 9, }, /* 457 */ + { 19, 9, 12, 0, -74, }, /* 458 */ + { 19, 8, 12, 0, -9, }, /* 459 */ + { 19, 5, 12, 21, -7173, }, /* 460 */ + { 19, 9, 12, 0, -86, }, /* 461 */ + { 19, 9, 12, 0, -100, }, /* 462 */ + { 19, 9, 12, 0, -112, }, /* 463 */ + { 19, 9, 12, 0, -128, }, /* 464 */ + { 19, 9, 12, 0, -126, }, /* 465 */ + { 27, 1, 3, 0, 0, }, /* 466 */ + { 27, 1, 13, 0, 0, }, /* 467 */ + { 9, 27, 2, 0, 0, }, /* 468 */ + { 9, 28, 2, 0, 0, }, /* 469 */ + { 9, 21, 14, 0, 0, }, /* 470 */ + { 9, 2, 2, 0, 0, }, /* 471 */ + { 9, 9, 12, 0, 0, }, /* 472 */ + { 9, 5, 12, 0, 0, }, /* 473 */ + { 19, 9, 12, 96, -7517, }, /* 474 */ + { 33, 9, 12, 100, -8383, }, /* 475 */ + { 33, 9, 12, 104, -8262, }, /* 476 */ + { 33, 9, 12, 0, 28, }, /* 477 */ + { 9, 5, 14, 0, 0, }, /* 478 */ + { 33, 5, 12, 0, -28, }, /* 479 */ + { 33, 14, 12, 0, 16, }, /* 480 */ + { 33, 14, 12, 0, -16, }, /* 481 */ + { 33, 14, 12, 0, 0, }, /* 482 */ + { 9, 25, 14, 0, 0, }, /* 483 */ + { 9, 26, 12, 0, 26, }, /* 484 */ + { 9, 26, 14, 0, 26, }, /* 485 */ + { 9, 26, 12, 0, -26, }, /* 486 */ + { 4, 26, 12, 0, 0, }, /* 487 */ + { 17, 9, 12, 0, 48, }, /* 488 */ + { 17, 5, 12, 0, -48, }, /* 489 */ + { 33, 9, 12, 0, -10743, }, /* 490 */ + { 33, 9, 12, 0, -3814, }, /* 491 */ + { 33, 9, 12, 0, -10727, }, /* 492 */ + { 33, 5, 12, 0, -10795, }, /* 493 */ + { 33, 5, 12, 0, -10792, }, /* 494 */ + { 33, 9, 12, 0, -10780, }, /* 495 */ + { 33, 9, 12, 0, -10749, }, /* 496 */ + { 33, 9, 12, 0, -10783, }, /* 497 */ + { 33, 9, 12, 0, -10782, }, /* 498 */ + { 33, 9, 12, 0, -10815, }, /* 499 */ + { 10, 5, 12, 0, 0, }, /* 500 */ + { 10, 26, 12, 0, 0, }, /* 501 */ + { 10, 12, 3, 0, 0, }, /* 502 */ + { 10, 21, 12, 0, 0, }, /* 503 */ + { 10, 15, 12, 0, 0, }, /* 504 */ + { 16, 5, 12, 0, -7264, }, /* 505 */ + { 58, 7, 12, 0, 0, }, /* 506 */ + { 58, 6, 12, 0, 0, }, /* 507 */ + { 58, 21, 12, 0, 0, }, /* 508 */ + { 58, 12, 3, 0, 0, }, /* 509 */ + { 22, 26, 12, 0, 0, }, /* 510 */ + { 22, 6, 12, 0, 0, }, /* 511 */ + { 22, 14, 12, 0, 0, }, /* 512 */ + { 23, 10, 3, 0, 0, }, /* 513 */ + { 9, 17, 14, 0, 0, }, /* 514 */ + { 26, 7, 12, 0, 0, }, /* 515 */ + { 26, 6, 12, 0, 0, }, /* 516 */ + { 29, 7, 12, 0, 0, }, /* 517 */ + { 29, 6, 12, 0, 0, }, /* 518 */ + { 3, 7, 12, 0, 0, }, /* 519 */ + { 23, 7, 12, 0, 0, }, /* 520 */ + { 23, 26, 12, 0, 0, }, /* 521 */ + { 29, 26, 12, 0, 0, }, /* 522 */ + { 22, 7, 12, 0, 0, }, /* 523 */ + { 60, 7, 12, 0, 0, }, /* 524 */ + { 60, 6, 12, 0, 0, }, /* 525 */ + { 60, 26, 12, 0, 0, }, /* 526 */ + { 85, 7, 12, 0, 0, }, /* 527 */ + { 85, 6, 12, 0, 0, }, /* 528 */ + { 85, 21, 12, 0, 0, }, /* 529 */ + { 76, 7, 12, 0, 0, }, /* 530 */ + { 76, 6, 12, 0, 0, }, /* 531 */ + { 76, 21, 12, 0, 0, }, /* 532 */ + { 76, 13, 12, 0, 0, }, /* 533 */ + { 12, 9, 12, 108, 1, }, /* 534 */ + { 12, 5, 12, 108, -35267, }, /* 535 */ + { 12, 7, 12, 0, 0, }, /* 536 */ + { 12, 21, 12, 0, 0, }, /* 537 */ + { 78, 7, 12, 0, 0, }, /* 538 */ + { 78, 14, 12, 0, 0, }, /* 539 */ + { 78, 12, 3, 0, 0, }, /* 540 */ + { 78, 21, 12, 0, 0, }, /* 541 */ + { 33, 9, 12, 0, -35332, }, /* 542 */ + { 33, 9, 12, 0, -42280, }, /* 543 */ + { 33, 9, 12, 0, -42308, }, /* 544 */ + { 33, 9, 12, 0, -42319, }, /* 545 */ + { 33, 9, 12, 0, -42315, }, /* 546 */ + { 33, 9, 12, 0, -42305, }, /* 547 */ + { 33, 9, 12, 0, -42258, }, /* 548 */ + { 33, 9, 12, 0, -42282, }, /* 549 */ + { 33, 9, 12, 0, -42261, }, /* 550 */ + { 33, 9, 12, 0, 928, }, /* 551 */ + { 48, 7, 12, 0, 0, }, /* 552 */ + { 48, 12, 3, 0, 0, }, /* 553 */ + { 48, 10, 5, 0, 0, }, /* 554 */ + { 48, 26, 12, 0, 0, }, /* 555 */ + { 64, 7, 12, 0, 0, }, /* 556 */ + { 64, 21, 12, 0, 0, }, /* 557 */ + { 74, 10, 5, 0, 0, }, /* 558 */ + { 74, 7, 12, 0, 0, }, /* 559 */ + { 74, 12, 3, 0, 0, }, /* 560 */ + { 74, 21, 12, 0, 0, }, /* 561 */ + { 74, 13, 12, 0, 0, }, /* 562 */ + { 68, 13, 12, 0, 0, }, /* 563 */ + { 68, 7, 12, 0, 0, }, /* 564 */ + { 68, 12, 3, 0, 0, }, /* 565 */ + { 68, 21, 12, 0, 0, }, /* 566 */ + { 73, 7, 12, 0, 0, }, /* 567 */ + { 73, 12, 3, 0, 0, }, /* 568 */ + { 73, 10, 5, 0, 0, }, /* 569 */ + { 73, 21, 12, 0, 0, }, /* 570 */ + { 83, 12, 3, 0, 0, }, /* 571 */ + { 83, 10, 5, 0, 0, }, /* 572 */ + { 83, 7, 12, 0, 0, }, /* 573 */ + { 83, 21, 12, 0, 0, }, /* 574 */ + { 83, 13, 12, 0, 0, }, /* 575 */ + { 38, 6, 12, 0, 0, }, /* 576 */ + { 67, 7, 12, 0, 0, }, /* 577 */ + { 67, 12, 3, 0, 0, }, /* 578 */ + { 67, 10, 5, 0, 0, }, /* 579 */ + { 67, 13, 12, 0, 0, }, /* 580 */ + { 67, 21, 12, 0, 0, }, /* 581 */ + { 91, 7, 12, 0, 0, }, /* 582 */ + { 91, 12, 3, 0, 0, }, /* 583 */ + { 91, 6, 12, 0, 0, }, /* 584 */ + { 91, 21, 12, 0, 0, }, /* 585 */ + { 86, 7, 12, 0, 0, }, /* 586 */ + { 86, 10, 5, 0, 0, }, /* 587 */ + { 86, 12, 3, 0, 0, }, /* 588 */ + { 86, 21, 12, 0, 0, }, /* 589 */ + { 86, 6, 12, 0, 0, }, /* 590 */ + { 33, 5, 12, 0, -928, }, /* 591 */ + { 8, 5, 12, 0, -38864, }, /* 592 */ + { 86, 13, 12, 0, 0, }, /* 593 */ + { 23, 7, 9, 0, 0, }, /* 594 */ + { 23, 7, 10, 0, 0, }, /* 595 */ + { 9, 4, 2, 0, 0, }, /* 596 */ + { 9, 3, 12, 0, 0, }, /* 597 */ + { 25, 25, 12, 0, 0, }, /* 598 */ + { 0, 24, 12, 0, 0, }, /* 599 */ + { 9, 6, 3, 0, 0, }, /* 600 */ + { 35, 7, 12, 0, 0, }, /* 601 */ + { 19, 14, 12, 0, 0, }, /* 602 */ + { 19, 15, 12, 0, 0, }, /* 603 */ + { 19, 26, 12, 0, 0, }, /* 604 */ + { 70, 7, 12, 0, 0, }, /* 605 */ + { 66, 7, 12, 0, 0, }, /* 606 */ + { 41, 7, 12, 0, 0, }, /* 607 */ + { 41, 15, 12, 0, 0, }, /* 608 */ + { 18, 7, 12, 0, 0, }, /* 609 */ + { 18, 14, 12, 0, 0, }, /* 610 */ + { 117, 7, 12, 0, 0, }, /* 611 */ + { 117, 12, 3, 0, 0, }, /* 612 */ + { 59, 7, 12, 0, 0, }, /* 613 */ + { 59, 21, 12, 0, 0, }, /* 614 */ + { 42, 7, 12, 0, 0, }, /* 615 */ + { 42, 21, 12, 0, 0, }, /* 616 */ + { 42, 14, 12, 0, 0, }, /* 617 */ + { 13, 9, 12, 0, 40, }, /* 618 */ + { 13, 5, 12, 0, -40, }, /* 619 */ + { 46, 7, 12, 0, 0, }, /* 620 */ + { 44, 7, 12, 0, 0, }, /* 621 */ + { 44, 13, 12, 0, 0, }, /* 622 */ + { 135, 9, 12, 0, 40, }, /* 623 */ + { 135, 5, 12, 0, -40, }, /* 624 */ + { 105, 7, 12, 0, 0, }, /* 625 */ + { 103, 7, 12, 0, 0, }, /* 626 */ + { 103, 21, 12, 0, 0, }, /* 627 */ + { 109, 7, 12, 0, 0, }, /* 628 */ + { 11, 7, 12, 0, 0, }, /* 629 */ + { 80, 7, 12, 0, 0, }, /* 630 */ + { 80, 21, 12, 0, 0, }, /* 631 */ + { 80, 15, 12, 0, 0, }, /* 632 */ + { 119, 7, 12, 0, 0, }, /* 633 */ + { 119, 26, 12, 0, 0, }, /* 634 */ + { 119, 15, 12, 0, 0, }, /* 635 */ + { 115, 7, 12, 0, 0, }, /* 636 */ + { 115, 15, 12, 0, 0, }, /* 637 */ + { 127, 7, 12, 0, 0, }, /* 638 */ + { 127, 15, 12, 0, 0, }, /* 639 */ + { 65, 7, 12, 0, 0, }, /* 640 */ + { 65, 15, 12, 0, 0, }, /* 641 */ + { 65, 21, 12, 0, 0, }, /* 642 */ + { 71, 7, 12, 0, 0, }, /* 643 */ + { 71, 21, 12, 0, 0, }, /* 644 */ + { 97, 7, 12, 0, 0, }, /* 645 */ + { 96, 7, 12, 0, 0, }, /* 646 */ + { 96, 15, 12, 0, 0, }, /* 647 */ + { 30, 7, 12, 0, 0, }, /* 648 */ + { 30, 12, 3, 0, 0, }, /* 649 */ + { 30, 15, 12, 0, 0, }, /* 650 */ + { 30, 21, 12, 0, 0, }, /* 651 */ + { 87, 7, 12, 0, 0, }, /* 652 */ + { 87, 15, 12, 0, 0, }, /* 653 */ + { 87, 21, 12, 0, 0, }, /* 654 */ + { 116, 7, 12, 0, 0, }, /* 655 */ + { 116, 15, 12, 0, 0, }, /* 656 */ + { 111, 7, 12, 0, 0, }, /* 657 */ + { 111, 26, 12, 0, 0, }, /* 658 */ + { 111, 12, 3, 0, 0, }, /* 659 */ + { 111, 15, 12, 0, 0, }, /* 660 */ + { 111, 21, 12, 0, 0, }, /* 661 */ + { 77, 7, 12, 0, 0, }, /* 662 */ + { 77, 21, 12, 0, 0, }, /* 663 */ + { 82, 7, 12, 0, 0, }, /* 664 */ + { 82, 15, 12, 0, 0, }, /* 665 */ + { 81, 7, 12, 0, 0, }, /* 666 */ + { 81, 15, 12, 0, 0, }, /* 667 */ + { 120, 7, 12, 0, 0, }, /* 668 */ + { 120, 21, 12, 0, 0, }, /* 669 */ + { 120, 15, 12, 0, 0, }, /* 670 */ + { 88, 7, 12, 0, 0, }, /* 671 */ + { 129, 9, 12, 0, 64, }, /* 672 */ + { 129, 5, 12, 0, -64, }, /* 673 */ + { 129, 15, 12, 0, 0, }, /* 674 */ + { 143, 7, 12, 0, 0, }, /* 675 */ + { 143, 12, 3, 0, 0, }, /* 676 */ + { 143, 13, 12, 0, 0, }, /* 677 */ + { 0, 15, 12, 0, 0, }, /* 678 */ + { 146, 7, 12, 0, 0, }, /* 679 */ + { 146, 15, 12, 0, 0, }, /* 680 */ + { 147, 7, 12, 0, 0, }, /* 681 */ + { 147, 12, 3, 0, 0, }, /* 682 */ + { 147, 15, 12, 0, 0, }, /* 683 */ + { 147, 21, 12, 0, 0, }, /* 684 */ + { 93, 10, 5, 0, 0, }, /* 685 */ + { 93, 12, 3, 0, 0, }, /* 686 */ + { 93, 7, 12, 0, 0, }, /* 687 */ + { 93, 21, 12, 0, 0, }, /* 688 */ + { 93, 15, 12, 0, 0, }, /* 689 */ + { 93, 13, 12, 0, 0, }, /* 690 */ + { 84, 12, 3, 0, 0, }, /* 691 */ + { 84, 10, 5, 0, 0, }, /* 692 */ + { 84, 7, 12, 0, 0, }, /* 693 */ + { 84, 21, 12, 0, 0, }, /* 694 */ + { 84, 1, 4, 0, 0, }, /* 695 */ + { 100, 7, 12, 0, 0, }, /* 696 */ + { 100, 13, 12, 0, 0, }, /* 697 */ + { 95, 12, 3, 0, 0, }, /* 698 */ + { 95, 7, 12, 0, 0, }, /* 699 */ + { 95, 10, 5, 0, 0, }, /* 700 */ + { 95, 13, 12, 0, 0, }, /* 701 */ + { 95, 21, 12, 0, 0, }, /* 702 */ + { 110, 7, 12, 0, 0, }, /* 703 */ + { 110, 12, 3, 0, 0, }, /* 704 */ + { 110, 21, 12, 0, 0, }, /* 705 */ + { 99, 12, 3, 0, 0, }, /* 706 */ + { 99, 10, 5, 0, 0, }, /* 707 */ + { 99, 7, 12, 0, 0, }, /* 708 */ + { 99, 7, 4, 0, 0, }, /* 709 */ + { 99, 21, 12, 0, 0, }, /* 710 */ + { 99, 13, 12, 0, 0, }, /* 711 */ + { 47, 15, 12, 0, 0, }, /* 712 */ + { 107, 7, 12, 0, 0, }, /* 713 */ + { 107, 10, 5, 0, 0, }, /* 714 */ + { 107, 12, 3, 0, 0, }, /* 715 */ + { 107, 21, 12, 0, 0, }, /* 716 */ + { 128, 7, 12, 0, 0, }, /* 717 */ + { 128, 21, 12, 0, 0, }, /* 718 */ + { 108, 7, 12, 0, 0, }, /* 719 */ + { 108, 12, 3, 0, 0, }, /* 720 */ + { 108, 10, 5, 0, 0, }, /* 721 */ + { 108, 13, 12, 0, 0, }, /* 722 */ + { 106, 12, 3, 0, 0, }, /* 723 */ + { 106, 10, 5, 0, 0, }, /* 724 */ + { 106, 7, 12, 0, 0, }, /* 725 */ + { 106, 10, 3, 0, 0, }, /* 726 */ + { 134, 7, 12, 0, 0, }, /* 727 */ + { 134, 10, 5, 0, 0, }, /* 728 */ + { 134, 12, 3, 0, 0, }, /* 729 */ + { 134, 21, 12, 0, 0, }, /* 730 */ + { 134, 13, 12, 0, 0, }, /* 731 */ + { 123, 7, 12, 0, 0, }, /* 732 */ + { 123, 10, 3, 0, 0, }, /* 733 */ + { 123, 10, 5, 0, 0, }, /* 734 */ + { 123, 12, 3, 0, 0, }, /* 735 */ + { 123, 21, 12, 0, 0, }, /* 736 */ + { 123, 13, 12, 0, 0, }, /* 737 */ + { 122, 7, 12, 0, 0, }, /* 738 */ + { 122, 10, 3, 0, 0, }, /* 739 */ + { 122, 10, 5, 0, 0, }, /* 740 */ + { 122, 12, 3, 0, 0, }, /* 741 */ + { 122, 21, 12, 0, 0, }, /* 742 */ + { 113, 7, 12, 0, 0, }, /* 743 */ + { 113, 10, 5, 0, 0, }, /* 744 */ + { 113, 12, 3, 0, 0, }, /* 745 */ + { 113, 21, 12, 0, 0, }, /* 746 */ + { 113, 13, 12, 0, 0, }, /* 747 */ + { 101, 7, 12, 0, 0, }, /* 748 */ + { 101, 12, 3, 0, 0, }, /* 749 */ + { 101, 10, 5, 0, 0, }, /* 750 */ + { 101, 13, 12, 0, 0, }, /* 751 */ + { 125, 7, 12, 0, 0, }, /* 752 */ + { 125, 12, 3, 0, 0, }, /* 753 */ + { 125, 10, 5, 0, 0, }, /* 754 */ + { 125, 13, 12, 0, 0, }, /* 755 */ + { 125, 15, 12, 0, 0, }, /* 756 */ + { 125, 21, 12, 0, 0, }, /* 757 */ + { 125, 26, 12, 0, 0, }, /* 758 */ + { 141, 7, 12, 0, 0, }, /* 759 */ + { 141, 10, 5, 0, 0, }, /* 760 */ + { 141, 12, 3, 0, 0, }, /* 761 */ + { 141, 21, 12, 0, 0, }, /* 762 */ + { 124, 9, 12, 0, 32, }, /* 763 */ + { 124, 5, 12, 0, -32, }, /* 764 */ + { 124, 13, 12, 0, 0, }, /* 765 */ + { 124, 15, 12, 0, 0, }, /* 766 */ + { 124, 7, 12, 0, 0, }, /* 767 */ + { 140, 7, 12, 0, 0, }, /* 768 */ + { 140, 12, 3, 0, 0, }, /* 769 */ + { 140, 10, 5, 0, 0, }, /* 770 */ + { 140, 7, 4, 0, 0, }, /* 771 */ + { 140, 21, 12, 0, 0, }, /* 772 */ + { 139, 7, 12, 0, 0, }, /* 773 */ + { 139, 12, 3, 0, 0, }, /* 774 */ + { 139, 10, 5, 0, 0, }, /* 775 */ + { 139, 7, 4, 0, 0, }, /* 776 */ + { 139, 21, 12, 0, 0, }, /* 777 */ + { 121, 7, 12, 0, 0, }, /* 778 */ + { 132, 7, 12, 0, 0, }, /* 779 */ + { 132, 10, 5, 0, 0, }, /* 780 */ + { 132, 12, 3, 0, 0, }, /* 781 */ + { 132, 21, 12, 0, 0, }, /* 782 */ + { 132, 13, 12, 0, 0, }, /* 783 */ + { 132, 15, 12, 0, 0, }, /* 784 */ + { 133, 21, 12, 0, 0, }, /* 785 */ + { 133, 7, 12, 0, 0, }, /* 786 */ + { 133, 12, 3, 0, 0, }, /* 787 */ + { 133, 10, 5, 0, 0, }, /* 788 */ + { 137, 7, 12, 0, 0, }, /* 789 */ + { 137, 12, 3, 0, 0, }, /* 790 */ + { 137, 7, 4, 0, 0, }, /* 791 */ + { 137, 13, 12, 0, 0, }, /* 792 */ + { 142, 7, 12, 0, 0, }, /* 793 */ + { 142, 10, 5, 0, 0, }, /* 794 */ + { 142, 12, 3, 0, 0, }, /* 795 */ + { 142, 13, 12, 0, 0, }, /* 796 */ + { 144, 7, 12, 0, 0, }, /* 797 */ + { 144, 12, 3, 0, 0, }, /* 798 */ + { 144, 10, 5, 0, 0, }, /* 799 */ + { 144, 21, 12, 0, 0, }, /* 800 */ + { 62, 7, 12, 0, 0, }, /* 801 */ + { 62, 14, 12, 0, 0, }, /* 802 */ + { 62, 21, 12, 0, 0, }, /* 803 */ + { 79, 7, 12, 0, 0, }, /* 804 */ + { 126, 7, 12, 0, 0, }, /* 805 */ + { 114, 7, 12, 0, 0, }, /* 806 */ + { 114, 13, 12, 0, 0, }, /* 807 */ + { 114, 21, 12, 0, 0, }, /* 808 */ + { 102, 7, 12, 0, 0, }, /* 809 */ + { 102, 12, 3, 0, 0, }, /* 810 */ + { 102, 21, 12, 0, 0, }, /* 811 */ + { 118, 7, 12, 0, 0, }, /* 812 */ + { 118, 12, 3, 0, 0, }, /* 813 */ + { 118, 21, 12, 0, 0, }, /* 814 */ + { 118, 26, 12, 0, 0, }, /* 815 */ + { 118, 6, 12, 0, 0, }, /* 816 */ + { 118, 13, 12, 0, 0, }, /* 817 */ + { 118, 15, 12, 0, 0, }, /* 818 */ + { 145, 9, 12, 0, 32, }, /* 819 */ + { 145, 5, 12, 0, -32, }, /* 820 */ + { 145, 15, 12, 0, 0, }, /* 821 */ + { 145, 21, 12, 0, 0, }, /* 822 */ + { 98, 7, 12, 0, 0, }, /* 823 */ + { 98, 10, 5, 0, 0, }, /* 824 */ + { 98, 12, 3, 0, 0, }, /* 825 */ + { 98, 6, 12, 0, 0, }, /* 826 */ + { 136, 6, 12, 0, 0, }, /* 827 */ + { 138, 6, 12, 0, 0, }, /* 828 */ + { 136, 7, 12, 0, 0, }, /* 829 */ + { 138, 7, 12, 0, 0, }, /* 830 */ + { 104, 7, 12, 0, 0, }, /* 831 */ + { 104, 26, 12, 0, 0, }, /* 832 */ + { 104, 12, 3, 0, 0, }, /* 833 */ + { 104, 21, 12, 0, 0, }, /* 834 */ + { 9, 10, 3, 0, 0, }, /* 835 */ + { 19, 12, 3, 0, 0, }, /* 836 */ + { 130, 26, 12, 0, 0, }, /* 837 */ + { 130, 12, 3, 0, 0, }, /* 838 */ + { 130, 21, 12, 0, 0, }, /* 839 */ + { 17, 12, 3, 0, 0, }, /* 840 */ + { 112, 7, 12, 0, 0, }, /* 841 */ + { 112, 15, 12, 0, 0, }, /* 842 */ + { 112, 12, 3, 0, 0, }, /* 843 */ + { 131, 9, 12, 0, 34, }, /* 844 */ + { 131, 5, 12, 0, -34, }, /* 845 */ + { 131, 12, 3, 0, 0, }, /* 846 */ + { 131, 13, 12, 0, 0, }, /* 847 */ + { 131, 21, 12, 0, 0, }, /* 848 */ + { 9, 2, 14, 0, 0, }, /* 849 */ + { 9, 26, 11, 0, 0, }, /* 850 */ + { 26, 26, 12, 0, 0, }, /* 851 */ + { 9, 24, 3, 0, 0, }, /* 852 */ + { 9, 1, 3, 0, 0, }, /* 853 */ }; -const uint8_t PRIV(ucd_stage1)[] = { /* 8704 bytes */ +const uint16_t PRIV(ucd_stage1)[] = { /* 17408 bytes */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* U+0000 */ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* U+0800 */ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 41, 42, 43, 44, 45, /* U+1000 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, /* U+1800 */ 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, /* U+2000 */ - 77, 77, 66, 78, 66, 66, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, /* U+2800 */ - 89, 90, 91, 92, 93, 94, 95, 71, 96, 96, 96, 96, 96, 96, 96, 96, /* U+3000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+3800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+4000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 96, 96, 96, 96, /* U+4800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+5000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+5800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+6000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+6800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+7000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+7800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+8000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+8800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+9000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 98, /* U+9800 */ - 99,100,100,100,100,100,100,100,100,101,102,102,103,104,105,106, /* U+A000 */ -107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,115, /* U+A800 */ -116,117,118,119,120,121,115,116,117,118,119,120,121,115,116,117, /* U+B000 */ -118,119,120,121,115,116,117,118,119,120,121,115,116,117,118,119, /* U+B800 */ -120,121,115,116,117,118,119,120,121,115,116,117,118,119,120,121, /* U+C000 */ -115,116,117,118,119,120,121,115,116,117,118,119,120,121,115,116, /* U+C800 */ -117,118,119,120,121,115,116,117,118,119,120,121,115,116,117,122, /* U+D000 */ -123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123, /* U+D800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+E000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+E800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F000 */ -124,124, 96, 96,125,126,127,128,129,129,130,131,132,133,134,135, /* U+F800 */ -136,137,138,139,140,141,142,143,144,145,146,140,147,147,148,140, /* U+10000 */ -149,150,151,152,153,154,155,156,157,158,140,140,159,140,140,140, /* U+10800 */ -160,161,162,163,164,165,166,140,167,168,140,169,170,171,172,140, /* U+11000 */ -140,173,140,140,174,175,140,140,176,177,178,140,140,140,140,140, /* U+11800 */ -179,179,179,179,179,179,179,180,181,179,182,140,140,140,140,140, /* U+12000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+12800 */ -183,183,183,183,183,183,183,183,184,140,140,140,140,140,140,140, /* U+13000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+13800 */ -140,140,140,140,140,140,140,140,185,185,185,185,186,140,140,140, /* U+14000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+14800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+15000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+15800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+16000 */ -187,187,187,187,188,189,190,191,140,140,140,140,140,140,192,193, /* U+16800 */ -194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194, /* U+17000 */ -194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194, /* U+17800 */ -194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,195, /* U+18000 */ -194,194,194,194,194,196,140,140,140,140,140,140,140,140,140,140, /* U+18800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+19000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+19800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1A800 */ -197,198,199,200,200,201,140,140,140,140,140,140,140,140,140,140, /* U+1B000 */ -140,140,140,140,140,140,140,140,202,203,140,140,140,140,140,140, /* U+1B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1C800 */ - 71,204,205,206,207,140,208,140,209,210,211,212,213,214,215,216, /* U+1D000 */ -217,217,217,217,218,219,140,140,140,140,140,140,140,140,140,140, /* U+1D800 */ -220,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1E000 */ -221,222,223,140,140,140,140,140,140,140,140,140,224,225,140,140, /* U+1E800 */ -226,227,228,229,230,140,231,232,233,234,235,236,237,238,239,240, /* U+1F000 */ -241,242,243,244,140,140,140,140,140,140,140,140,140,140,140,140, /* U+1F800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+20000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+20800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+21000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+21800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+22000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+22800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+23000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+23800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+24000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+24800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+25000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+25800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+26000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+26800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+27000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+27800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+28000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+28800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+29000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+29800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,245, 96, 96, /* U+2A000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2A800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,246, 96, /* U+2B000 */ -247, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2B800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2C000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,248, 96, 96, /* U+2C800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2D000 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2D800 */ - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, /* U+2E000 */ - 96, 96, 96, 96, 96, 96, 96,249,140,140,140,140,140,140,140,140, /* U+2E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+2F000 */ - 96, 96, 96, 96,250,140,140,140,140,140,140,140,140,140,140,140, /* U+2F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+30000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+30800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+31000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+31800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+32000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+32800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+33000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+33800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+34000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+34800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+35000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+35800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+36000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+36800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+37000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+37800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+38000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+38800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+39000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+39800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3A800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3B000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3C800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3D000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3D800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3E000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3F000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+3F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+40000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+40800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+41000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+41800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+42000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+42800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+43000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+43800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+44000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+44800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+45000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+45800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+46000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+46800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+47000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+47800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+48000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+48800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+49000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+49800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4A800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4B000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4C800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4D000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4D800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4E000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4F000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+4F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+50000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+50800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+51000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+51800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+52000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+52800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+53000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+53800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+54000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+54800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+55000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+55800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+56000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+56800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+57000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+57800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+58000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+58800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+59000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+59800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5A800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5B000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5C800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5D000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5D800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5E000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5F000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+5F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+60000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+60800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+61000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+61800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+62000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+62800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+63000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+63800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+64000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+64800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+65000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+65800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+66000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+66800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+67000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+67800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+68000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+68800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+69000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+69800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6A800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6B000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6C800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6D000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6D800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6E000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6F000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+6F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+70000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+70800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+71000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+71800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+72000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+72800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+73000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+73800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+74000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+74800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+75000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+75800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+76000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+76800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+77000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+77800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+78000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+78800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+79000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+79800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7A800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7B000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7C800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7D000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7D800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7E000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7F000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+7F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+80000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+80800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+81000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+81800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+82000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+82800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+83000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+83800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+84000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+84800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+85000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+85800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+86000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+86800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+87000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+87800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+88000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+88800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+89000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+89800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8A800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8B000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8C800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8D000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8D800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8E000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8F000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+8F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+90000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+90800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+91000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+91800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+92000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+92800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+93000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+93800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+94000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+94800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+95000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+95800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+96000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+96800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+97000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+97800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+98000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+98800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+99000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+99800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9A000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9A800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9B000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9B800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9C000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9C800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9D000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9D800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9E000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9E800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9F000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+9F800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A0000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A0800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A1000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A1800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A2000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A2800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A3000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A3800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A4000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A4800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A5000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A5800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A6000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A6800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A7000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A7800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A8000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A8800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A9000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+A9800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AA000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AA800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AB000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AB800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AC000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AC800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AD000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AD800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AE000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AE800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AF000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+AF800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B0000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B0800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B1000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B1800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B2000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B2800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B3000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B3800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B4000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B4800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B5000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B5800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B6000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B6800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B7000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B7800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B8000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B8800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B9000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+B9800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BA000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BA800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BB000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BB800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BC000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BC800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BD000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BD800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BE000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BE800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BF000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+BF800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C0000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C0800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C1000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C1800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C2000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C2800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C3000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C3800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C4000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C4800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C5000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C5800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C6000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C6800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C7000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C7800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C8000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C8800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C9000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+C9800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CA000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CA800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CB000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CB800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CC000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CC800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CD000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CD800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CE000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CE800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CF000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+CF800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D0000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D0800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D1000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D1800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D2000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D2800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D3000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D3800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D4000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D4800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D5000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D5800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D6000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D6800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D7000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D7800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D8000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D8800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D9000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+D9800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DA000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DA800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DB000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DB800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DC000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DC800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DD000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DD800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DE000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DE800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DF000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+DF800 */ -251,252,253,254,252,252,252,252,252,252,252,252,252,252,252,252, /* U+E0000 */ -252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252, /* U+E0800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E1000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E1800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E2000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E2800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E3000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E3800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E4000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E4800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E5000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E5800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E6000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E6800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E7000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E7800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E8000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E8800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E9000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+E9800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EA000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EA800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EB000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EB800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EC000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EC800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+ED000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+ED800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EE000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EE800 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EF000 */ -140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, /* U+EF800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F0000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F0800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F1000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F1800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F2000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F2800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F3000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F3800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F4000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F4800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F5000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F5800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F6000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F6800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F7000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F7800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F8000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F8800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F9000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+F9800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FA000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FA800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FB000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FB800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FC000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FC800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FD000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FD800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FE000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FE800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+FF000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,255, /* U+FF800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+100000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+100800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+101000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+101800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+102000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+102800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+103000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+103800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+104000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+104800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+105000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+105800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+106000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+106800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+107000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+107800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+108000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+108800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+109000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+109800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10A000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10A800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10B000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10B800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10C000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10C800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10D000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10D800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10E000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10E800 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+10F000 */ -124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,255, /* U+10F800 */ + 77, 77, 78, 79, 66, 66, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, /* U+2800 */ + 90, 91, 92, 93, 94, 95, 96, 71, 97, 97, 97, 97, 97, 97, 97, 97, /* U+3000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+3800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+4000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 97, 97, 97, 97, /* U+4800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+5000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+5800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+6000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+6800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+7000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+7800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+8000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+8800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+9000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 99, /* U+9800 */ +100,101,101,101,101,101,101,101,101,102,103,103,104,105,106,107, /* U+A000 */ +108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,116, /* U+A800 */ +117,118,119,120,121,122,116,117,118,119,120,121,122,116,117,118, /* U+B000 */ +119,120,121,122,116,117,118,119,120,121,122,116,117,118,119,120, /* U+B800 */ +121,122,116,117,118,119,120,121,122,116,117,118,119,120,121,122, /* U+C000 */ +116,117,118,119,120,121,122,116,117,118,119,120,121,122,116,117, /* U+C800 */ +118,119,120,121,122,116,117,118,119,120,121,122,116,117,118,123, /* U+D000 */ +124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124, /* U+D800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+E000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+E800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F000 */ +125,125, 97, 97,126,127,128,129,130,130,131,132,133,134,135,136, /* U+F800 */ +137,138,139,140,141,142,143,144,145,146,147,141,148,148,149,141, /* U+10000 */ +150,151,152,153,154,155,156,157,158,159,160,141,161,141,162,141, /* U+10800 */ +163,164,165,166,167,168,169,141,170,171,141,172,173,174,175,141, /* U+11000 */ +176,177,141,141,178,179,141,141,180,181,182,183,141,184,141,141, /* U+11800 */ +185,185,185,185,185,185,185,186,187,185,188,141,141,141,141,141, /* U+12000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+12800 */ +189,189,189,189,189,189,189,189,190,141,141,141,141,141,141,141, /* U+13000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+13800 */ +141,141,141,141,141,141,141,141,191,191,191,191,192,141,141,141, /* U+14000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+14800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+15000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+15800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+16000 */ +193,193,193,193,194,195,196,197,141,141,141,141,198,199,200,201, /* U+16800 */ +202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, /* U+17000 */ +202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202, /* U+17800 */ +202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,203, /* U+18000 */ +202,202,202,202,202,204,141,141,141,141,141,141,141,141,141,141, /* U+18800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+19000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+19800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1A800 */ +205,206,207,208,208,209,141,141,141,141,141,141,141,141,141,141, /* U+1B000 */ +141,141,141,141,141,141,141,141,210,211,141,141,141,141,141,141, /* U+1B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1C800 */ + 71,212,213,214,215,216,217,141,218,219,220,221,222,223,224,225, /* U+1D000 */ +226,226,226,226,227,228,141,141,141,141,141,141,141,141,141,141, /* U+1D800 */ +229,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+1E000 */ +230,231,232,141,141,141,141,141,233,234,141,141,235,236,141,141, /* U+1E800 */ +237,238,239,240,241,242,243,244,243,243,245,243,246,247,248,249, /* U+1F000 */ +250,251,252,253,254,242,242,242,242,242,242,242,242,242,242,255, /* U+1F800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+20000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+20800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+21000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+21800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+22000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+22800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+23000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+23800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+24000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+24800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+25000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+25800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+26000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+26800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+27000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+27800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+28000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+28800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+29000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+29800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,256, 97, 97, /* U+2A000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2A800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,257, 97, /* U+2B000 */ +258, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2B800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2C000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,259, 97, 97, /* U+2C800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2D000 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2D800 */ + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, /* U+2E000 */ + 97, 97, 97, 97, 97, 97, 97,260,141,141,141,141,141,141,141,141, /* U+2E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+2F000 */ + 97, 97, 97, 97,261,141,141,141,141,141,141,141,141,141,141,141, /* U+2F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+30000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+30800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+31000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+31800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+32000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+32800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+33000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+33800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+34000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+34800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+35000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+35800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+36000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+36800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+37000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+37800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+38000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+38800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+39000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+39800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3A800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3B000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3C800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3D000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3D800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3E000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3F000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+3F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+40000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+40800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+41000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+41800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+42000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+42800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+43000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+43800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+44000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+44800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+45000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+45800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+46000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+46800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+47000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+47800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+48000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+48800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+49000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+49800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4A800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4B000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4C800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4D000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4D800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4E000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4F000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+4F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+50000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+50800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+51000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+51800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+52000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+52800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+53000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+53800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+54000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+54800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+55000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+55800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+56000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+56800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+57000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+57800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+58000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+58800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+59000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+59800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5A800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5B000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5C800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5D000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5D800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5E000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5F000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+5F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+60000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+60800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+61000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+61800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+62000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+62800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+63000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+63800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+64000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+64800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+65000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+65800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+66000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+66800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+67000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+67800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+68000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+68800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+69000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+69800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6A800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6B000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6C800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6D000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6D800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6E000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6F000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+6F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+70000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+70800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+71000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+71800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+72000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+72800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+73000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+73800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+74000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+74800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+75000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+75800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+76000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+76800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+77000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+77800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+78000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+78800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+79000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+79800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7A800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7B000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7C800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7D000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7D800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7E000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7F000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+7F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+80000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+80800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+81000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+81800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+82000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+82800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+83000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+83800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+84000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+84800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+85000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+85800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+86000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+86800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+87000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+87800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+88000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+88800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+89000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+89800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8A800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8B000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8C800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8D000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8D800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8E000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8F000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+8F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+90000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+90800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+91000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+91800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+92000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+92800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+93000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+93800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+94000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+94800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+95000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+95800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+96000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+96800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+97000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+97800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+98000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+98800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+99000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+99800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9A000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9A800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9B000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9B800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9C000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9C800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9D000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9D800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9E000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9E800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9F000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+9F800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A0000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A0800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A1000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A1800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A2000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A2800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A3000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A3800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A4000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A4800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A5000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A5800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A6000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A6800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A7000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A7800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A8000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A8800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A9000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+A9800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AA000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AA800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AB000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AB800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AC000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AC800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AD000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AD800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AE000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AE800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AF000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+AF800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B0000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B0800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B1000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B1800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B2000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B2800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B3000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B3800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B4000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B4800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B5000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B5800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B6000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B6800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B7000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B7800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B8000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B8800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B9000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+B9800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BA000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BA800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BB000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BB800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BC000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BC800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BD000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BD800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BE000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BE800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BF000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+BF800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C0000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C0800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C1000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C1800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C2000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C2800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C3000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C3800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C4000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C4800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C5000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C5800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C6000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C6800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C7000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C7800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C8000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C8800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C9000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+C9800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CA000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CA800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CB000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CB800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CC000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CC800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CD000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CD800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CE000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CE800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CF000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+CF800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D0000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D0800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D1000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D1800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D2000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D2800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D3000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D3800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D4000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D4800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D5000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D5800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D6000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D6800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D7000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D7800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D8000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D8800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D9000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+D9800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DA000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DA800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DB000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DB800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DC000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DC800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DD000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DD800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DE000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DE800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DF000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+DF800 */ +262,263,264,265,263,263,263,263,263,263,263,263,263,263,263,263, /* U+E0000 */ +263,263,263,263,263,263,263,263,263,263,263,263,263,263,263,263, /* U+E0800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E1000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E1800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E2000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E2800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E3000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E3800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E4000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E4800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E5000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E5800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E6000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E6800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E7000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E7800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E8000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E8800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E9000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+E9800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EA000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EA800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EB000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EB800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EC000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EC800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+ED000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+ED800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EE000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EE800 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EF000 */ +141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, /* U+EF800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F0000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F0800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F1000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F1800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F2000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F2800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F3000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F3800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F4000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F4800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F5000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F5800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F6000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F6800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F7000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F7800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F8000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F8800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F9000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+F9800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FA000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FA800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FB000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FB800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FC000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FC800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FD000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FD800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FE000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FE800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+FF000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,266, /* U+FF800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+100000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+100800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+101000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+101800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+102000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+102800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+103000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+103800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+104000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+104800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+105000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+105800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+106000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+106800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+107000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+107800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+108000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+108800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+109000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+109800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10A000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10A800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10B000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10B800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10C000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10C800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10D000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10D800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10E000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10E800 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125, /* U+10F000 */ +125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,266, /* U+10F800 */ }; -const uint16_t PRIV(ucd_stage2)[] = { /* 65536 bytes, block = 128 */ +const uint16_t PRIV(ucd_stage2)[] = { /* 68352 bytes, block = 128 */ /* block 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1489,647 +1522,647 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 65536 bytes, block = 128 */ /* block 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 4, 5, 5, 5, 5, 19, 4, 14, 19, 20, 21, 8, 22, 19, 14, - 19, 8, 23, 23, 14, 24, 4, 4, 14, 23, 20, 25, 23, 23, 23, 4, - 11, 11, 11, 11, 11, 26, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 8, 11, 11, 11, 11, 11, 11, 11, 27, - 16, 16, 16, 16, 16, 28, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 8, 16, 16, 16, 16, 16, 16, 16, 29, + 3, 4, 5, 5, 5, 5, 19, 4, 14, 20, 21, 22, 8, 23, 20, 14, + 19, 8, 24, 24, 14, 25, 4, 4, 14, 24, 21, 26, 24, 24, 24, 4, + 11, 11, 11, 11, 11, 27, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 8, 11, 11, 11, 11, 11, 11, 11, 28, + 16, 16, 16, 16, 16, 29, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 8, 16, 16, 16, 16, 16, 16, 16, 30, /* block 2 */ - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 32, 33, 30, 31, 30, 31, 30, 31, 33, 30, 31, 30, 31, 30, 31, 30, - 31, 30, 31, 30, 31, 30, 31, 30, 31, 33, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 34, 30, 31, 30, 31, 30, 31, 35, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 33, 34, 31, 32, 31, 32, 31, 32, 34, 31, 32, 31, 32, 31, 32, 31, + 32, 31, 32, 31, 32, 31, 32, 31, 32, 34, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 35, 31, 32, 31, 32, 31, 32, 36, /* block 3 */ - 36, 37, 30, 31, 30, 31, 38, 30, 31, 39, 39, 30, 31, 33, 40, 41, - 42, 30, 31, 39, 43, 44, 45, 46, 30, 31, 47, 33, 45, 48, 49, 50, - 30, 31, 30, 31, 30, 31, 51, 30, 31, 51, 33, 33, 30, 31, 51, 30, - 31, 52, 52, 30, 31, 30, 31, 53, 30, 31, 33, 20, 30, 31, 33, 54, - 20, 20, 20, 20, 55, 56, 57, 58, 59, 60, 61, 62, 63, 30, 31, 30, - 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 64, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 33, 65, 66, 67, 30, 31, 68, 69, 30, 31, 30, 31, 30, 31, 30, 31, + 37, 38, 31, 32, 31, 32, 39, 31, 32, 40, 40, 31, 32, 34, 41, 42, + 43, 31, 32, 40, 44, 45, 46, 47, 31, 32, 48, 34, 46, 49, 50, 51, + 31, 32, 31, 32, 31, 32, 52, 31, 32, 52, 34, 34, 31, 32, 52, 31, + 32, 53, 53, 31, 32, 31, 32, 54, 31, 32, 34, 21, 31, 32, 34, 55, + 21, 21, 21, 21, 56, 57, 58, 59, 60, 61, 62, 63, 64, 31, 32, 31, + 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 65, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 34, 66, 67, 68, 31, 32, 69, 70, 31, 32, 31, 32, 31, 32, 31, 32, /* block 4 */ - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 70, 33, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 33, 33, 33, 33, 33, 33, 71, 30, 31, 72, 73, 74, - 74, 30, 31, 75, 76, 77, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 78, 79, 80, 81, 82, 33, 83, 83, 33, 84, 33, 85, 86, 33, 33, 33, - 83, 87, 33, 88, 33, 89, 90, 33, 91, 92, 90, 93, 94, 33, 33, 92, - 33, 95, 96, 33, 33, 97, 33, 33, 33, 33, 33, 33, 33, 98, 33, 33, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 71, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 34, 34, 34, 34, 34, 34, 72, 31, 32, 73, 74, 75, + 75, 31, 32, 76, 77, 78, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 79, 80, 81, 82, 83, 34, 84, 84, 34, 85, 34, 86, 87, 34, 34, 34, + 84, 88, 34, 89, 34, 90, 91, 34, 92, 93, 91, 94, 95, 34, 34, 93, + 34, 96, 97, 34, 34, 98, 34, 34, 34, 34, 34, 34, 34, 99, 34, 34, /* block 5 */ - 99, 33, 33, 99, 33, 33, 33,100, 99,101,102,102,103, 33, 33, 33, - 33, 33,104, 33, 20, 33, 33, 33, 33, 33, 33, 33, 33,105,106, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, -107,107,107,107,107,107,107,107,107,108,108,108,108,108,108,108, -108,108, 14, 14, 14, 14,108,108,108,108,108,108,108,108,108,108, -108,108, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -107,107,107,107,107, 14, 14, 14, 14, 14,109,109,108, 14,108, 14, +100, 34, 34,100, 34, 34, 34,101,100,102,103,103,104, 34, 34, 34, + 34, 34,105, 34, 21, 34, 34, 34, 34, 34, 34, 34, 34,106,107, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, +108,108,108,108,108,108,108,108,108,109,109,109,109,109,109,109, +109,109, 14, 14, 14, 14,109,109,109,109,109,109,109,109,109,109, +109,109, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +108,108,108,108,108, 14, 14, 14, 14, 14,110,110,109, 14,109, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, /* block 6 */ -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,111,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -112,113,112,113,108,114,112,113,115,115,116,117,117,117, 4,118, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,112,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +113,114,113,114,109,115,113,114,116,116,117,118,118,118, 4,119, /* block 7 */ -115,115,115,115,114, 14,119, 4,120,120,120,115,121,115,122,122, -123,124,125,124,124,126,124,124,127,128,129,124,130,124,124,124, -131,132,115,133,124,124,134,124,124,135,124,124,136,137,137,137, -123,138,139,138,138,140,138,138,141,142,143,138,144,138,138,138, -145,146,147,148,138,138,149,138,138,150,138,138,151,152,152,153, -154,155,156,156,156,157,158,159,112,113,112,113,112,113,112,113, -112,113,160,161,160,161,160,161,160,161,160,161,160,161,160,161, -162,163,164,165,166,167,168,112,113,169,112,113,123,170,170,170, +116,116,116,116,115, 14,120, 4,121,121,121,116,122,116,123,123, +124,125,126,125,125,127,125,125,128,129,130,125,131,125,125,125, +132,133,116,134,125,125,135,125,125,136,125,125,137,138,138,138, +124,139,140,139,139,141,139,139,142,143,144,139,145,139,139,139, +146,147,148,149,139,139,150,139,139,151,139,139,152,153,153,154, +155,156,157,157,157,158,159,160,113,114,113,114,113,114,113,114, +113,114,161,162,161,162,161,162,161,162,161,162,161,162,161,162, +163,164,165,166,167,168,169,113,114,170,113,114,124,171,171,171, /* block 8 */ -171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171, -172,172,173,172,174,172,172,172,172,172,172,172,172,172,175,172, -172,176,177,172,172,172,172,172,172,172,178,172,172,172,172,172, -179,179,180,179,181,179,179,179,179,179,179,179,179,179,182,179, -179,183,184,179,179,179,179,179,179,179,185,179,179,179,179,179, -186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186, -187,188,189,190,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, +172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172, +173,173,174,173,175,173,173,173,173,173,173,173,173,173,176,173, +173,177,178,173,173,173,173,173,173,173,179,173,173,173,173,173, +180,180,181,180,182,180,180,180,180,180,180,180,180,180,183,180, +180,184,185,180,180,180,180,180,180,180,186,180,180,180,180,180, +187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187, +188,189,190,191,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, /* block 9 */ -187,188,191,192,192,110,110,192,193,193,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -194,187,188,187,188,187,188,187,188,187,188,187,188,187,188,195, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, +188,189,192,193,193,111,111,193,194,194,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +195,188,189,188,189,188,189,188,189,188,189,188,189,188,189,196, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, /* block 10 */ -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -115,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, -196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196, -196,196,196,196,196,196,196,115,115,197,198,198,198,198,198,198, -115,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199, -199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +116,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197, +197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197, +197,197,197,197,197,197,197,116,116,198,199,199,199,199,199,199, +200,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201, +201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201, /* block 11 */ -199,199,199,199,199,199,199,200,115, 4,201,115,115,202,202,203, -115,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204, -204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204, -204,204,204,204,204,204,204,204,204,204,204,204,204,204,205,204, -206,204,204,206,204,204,206,204,115,115,115,115,115,115,115,115, -207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207, -207,207,207,207,207,207,207,207,207,207,207,115,115,115,115,115, -207,207,207,206,206,115,115,115,115,115,115,115,115,115,115,115, +201,201,201,201,201,201,201,200,200, 4,202,116,116,203,203,204, +116,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205, +205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205, +205,205,205,205,205,205,205,205,205,205,205,205,205,205,206,205, +207,205,205,207,205,205,207,205,116,116,116,116,116,116,116,116, +208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208, +208,208,208,208,208,208,208,208,208,208,208,116,116,116,116,208, +208,208,208,207,207,116,116,116,116,116,116,116,116,116,116,116, /* block 12 */ -208,208,208,208,208,209,210,210,210,211,211,212, 4,211,213,213, -214,214,214,214,214,214,214,214,214,214,214, 4,215,115,211, 4, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -108,216,216,216,216,216,216,216,216,216,216,110,110,110,110,110, -110,110,110,110,110,110,214,214,214,214,214,214,214,214,214,214, -217,217,217,217,217,217,217,217,217,217,211,211,211,211,216,216, -110,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, +209,209,209,209,209,210,211,211,211,212,212,213, 4,212,214,214, +215,215,215,215,215,215,215,215,215,215,215, 4,216,116,212, 4, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +109,217,217,217,217,217,217,217,217,217,217,111,111,111,111,111, +111,111,111,111,111,111,215,215,215,215,215,215,215,215,215,215, +218,218,218,218,218,218,218,218,218,218,212,212,212,212,217,217, +111,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, /* block 13 */ -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,211,216,214,214,214,214,214,214,214,209,213,214, -214,214,214,214,214,218,218,214,214,213,214,214,214,214,216,216, -217,217,217,217,217,217,217,217,217,217,216,216,216,213,213,216, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,212,217,215,215,215,215,215,215,215,210,214,215, +215,215,215,215,215,219,219,215,215,214,215,215,215,215,217,217, +218,218,218,218,218,218,218,218,218,218,217,217,217,214,214,217, /* block 14 */ -219,219,219,219,219,219,219,219,219,219,219,219,219,219,115,220, -221,222,221,221,221,221,221,221,221,221,221,221,221,221,221,221, -221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221, +220,220,220,220,220,220,220,220,220,220,220,220,220,220,116,221, +222,223,222,222,222,222,222,222,222,222,222,222,222,222,222,222, 222,222,222,222,222,222,222,222,222,222,222,222,222,222,222,222, -222,222,222,222,222,222,222,222,222,222,222,115,115,221,221,221, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, +223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, +223,223,223,223,223,223,223,223,223,223,223,116,116,222,222,222, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, /* block 15 */ -223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, -223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223, -223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224, -224,223,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226, -226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, -226,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227, -227,227,227,227,228,228,229,230,230,230,228,115,115,115,115,115, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224, +224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225, +225,224,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227, +227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227, +227,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228, +228,228,228,228,229,229,230,231,231,231,229,116,116,228,232,232, /* block 16 */ -231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231, -231,231,231,231,231,231,232,232,232,232,233,232,232,232,232,232, -232,232,232,232,233,232,232,232,233,232,232,232,232,232,115,115, -234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,115, -235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235, -235,235,235,235,235,235,235,235,235,236,236,236,115,115,237,115, -221,221,221,221,221,221,221,221,221,221,221,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +233,233,233,233,233,233,233,233,233,233,233,233,233,233,233,233, +233,233,233,233,233,233,234,234,234,234,235,234,234,234,234,234, +234,234,234,234,235,234,234,234,235,234,234,234,234,234,116,116, +236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,116, +237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,237, +237,237,237,237,237,237,237,237,237,238,238,238,116,116,239,116, +222,222,222,222,222,222,222,222,222,222,222,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 17 */ -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,115,216,216,216,216,216,216,216,216,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,214,214,214,214,214,214,214,214,214,214,214,214, -214,214,209,214,214,214,214,214,214,214,214,214,214,214,214,214, -214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,116,217,217,217,217,217,217,217,217,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,215,215,215,215,215,215,215,215,215,215,215,215,215, +215,215,210,215,215,215,215,215,215,215,215,215,215,215,215,215, +215,215,215,215,215,215,215,215,215,215,215,215,215,215,215,215, /* block 18 */ -238,238,238,239,240,240,240,240,240,240,240,240,240,240,240,240, -240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240, -240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240, -240,240,240,240,240,240,240,240,240,240,238,239,238,240,239,239, -239,238,238,238,238,238,238,238,238,239,239,239,239,238,239,239, -240,110,110,238,238,238,238,238,240,240,240,240,240,240,240,240, -240,240,238,238, 4, 4,241,241,241,241,241,241,241,241,241,241, -242,243,240,240,240,240,240,240,240,240,240,240,240,240,240,240, +240,240,240,241,242,242,242,242,242,242,242,242,242,242,242,242, +242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242, +242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242, +242,242,242,242,242,242,242,242,242,242,240,241,240,242,241,241, +241,240,240,240,240,240,240,240,240,241,241,241,241,240,241,241, +242,111,111,240,240,240,240,240,242,242,242,242,242,242,242,242, +242,242,240,240, 4, 4,243,243,243,243,243,243,243,243,243,243, +244,245,242,242,242,242,242,242,242,242,242,242,242,242,242,242, /* block 19 */ -244,245,246,246,115,244,244,244,244,244,244,244,244,115,115,244, -244,115,115,244,244,244,244,244,244,244,244,244,244,244,244,244, -244,244,244,244,244,244,244,244,244,115,244,244,244,244,244,244, -244,115,244,115,115,115,244,244,244,244,115,115,245,244,247,246, -246,245,245,245,245,115,115,246,246,115,115,246,246,245,244,115, -115,115,115,115,115,115,115,247,115,115,115,115,244,244,115,244, -244,244,245,245,115,115,248,248,248,248,248,248,248,248,248,248, -244,244,249,249,250,250,250,250,250,250,251,249,244,252,115,115, +246,247,248,248,116,246,246,246,246,246,246,246,246,116,116,246, +246,116,116,246,246,246,246,246,246,246,246,246,246,246,246,246, +246,246,246,246,246,246,246,246,246,116,246,246,246,246,246,246, +246,116,246,116,116,116,246,246,246,246,116,116,247,246,249,248, +248,247,247,247,247,116,116,248,248,116,116,248,248,247,246,116, +116,116,116,116,116,116,116,249,116,116,116,116,246,246,116,246, +246,246,247,247,116,116,250,250,250,250,250,250,250,250,250,250, +246,246,251,251,252,252,252,252,252,252,253,251,246,254,247,116, /* block 20 */ -115,253,253,254,115,255,255,255,255,255,255,115,115,115,115,255, -255,115,115,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,115,255,255,255,255,255,255, -255,115,255,255,115,255,255,115,255,255,115,115,253,115,254,254, -254,253,253,115,115,115,115,253,253,115,115,253,253,253,115,115, -115,253,115,115,115,115,115,115,115,255,255,255,255,115,255,115, -115,115,115,115,115,115,256,256,256,256,256,256,256,256,256,256, -253,253,255,255,255,253,115,115,115,115,115,115,115,115,115,115, +116,255,255,256,116,257,257,257,257,257,257,116,116,116,116,257, +257,116,116,257,257,257,257,257,257,257,257,257,257,257,257,257, +257,257,257,257,257,257,257,257,257,116,257,257,257,257,257,257, +257,116,257,257,116,257,257,116,257,257,116,116,255,116,256,256, +256,255,255,116,116,116,116,255,255,116,116,255,255,255,116,116, +116,255,116,116,116,116,116,116,116,257,257,257,257,116,257,116, +116,116,116,116,116,116,258,258,258,258,258,258,258,258,258,258, +255,255,257,257,257,255,259,116,116,116,116,116,116,116,116,116, /* block 21 */ -115,257,257,258,115,259,259,259,259,259,259,259,259,259,115,259, -259,259,115,259,259,259,259,259,259,259,259,259,259,259,259,259, -259,259,259,259,259,259,259,259,259,115,259,259,259,259,259,259, -259,115,259,259,115,259,259,259,259,259,115,115,257,259,258,258, -258,257,257,257,257,257,115,257,257,258,115,258,258,257,115,115, -259,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -259,259,257,257,115,115,260,260,260,260,260,260,260,260,260,260, -261,262,115,115,115,115,115,115,115,259,257,257,257,257,257,257, +116,260,260,261,116,262,262,262,262,262,262,262,262,262,116,262, +262,262,116,262,262,262,262,262,262,262,262,262,262,262,262,262, +262,262,262,262,262,262,262,262,262,116,262,262,262,262,262,262, +262,116,262,262,116,262,262,262,262,262,116,116,260,262,261,261, +261,260,260,260,260,260,116,260,260,261,116,261,261,260,116,116, +262,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +262,262,260,260,116,116,263,263,263,263,263,263,263,263,263,263, +264,265,116,116,116,116,116,116,116,262,260,260,260,260,260,260, /* block 22 */ -115,263,264,264,115,265,265,265,265,265,265,265,265,115,115,265, -265,115,115,265,265,265,265,265,265,265,265,265,265,265,265,265, -265,265,265,265,265,265,265,265,265,115,265,265,265,265,265,265, -265,115,265,265,115,265,265,265,265,265,115,115,263,265,266,263, -264,263,263,263,263,115,115,264,264,115,115,264,264,263,115,115, -115,115,115,115,115,115,263,266,115,115,115,115,265,265,115,265, -265,265,263,263,115,115,267,267,267,267,267,267,267,267,267,267, -268,265,269,269,269,269,269,269,115,115,115,115,115,115,115,115, +116,266,267,267,116,268,268,268,268,268,268,268,268,116,116,268, +268,116,116,268,268,268,268,268,268,268,268,268,268,268,268,268, +268,268,268,268,268,268,268,268,268,116,268,268,268,268,268,268, +268,116,268,268,116,268,268,268,268,268,116,116,266,268,269,266, +267,266,266,266,266,116,116,267,267,116,116,267,267,266,116,116, +116,116,116,116,116,116,266,269,116,116,116,116,268,268,116,268, +268,268,266,266,116,116,270,270,270,270,270,270,270,270,270,270, +271,268,272,272,272,272,272,272,116,116,116,116,116,116,116,116, /* block 23 */ -115,115,270,271,115,271,271,271,271,271,271,115,115,115,271,271, -271,115,271,271,271,271,115,115,115,271,271,115,271,115,271,271, -115,115,115,271,271,115,115,115,271,271,271,115,115,115,271,271, -271,271,271,271,271,271,271,271,271,271,115,115,115,115,272,273, -270,273,273,115,115,115,273,273,273,115,273,273,273,270,115,115, -271,115,115,115,115,115,115,272,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,274,274,274,274,274,274,274,274,274,274, -275,275,275,276,276,276,276,276,276,277,276,115,115,115,115,115, +116,116,273,274,116,274,274,274,274,274,274,116,116,116,274,274, +274,116,274,274,274,274,116,116,116,274,274,116,274,116,274,274, +116,116,116,274,274,116,116,116,274,274,274,116,116,116,274,274, +274,274,274,274,274,274,274,274,274,274,116,116,116,116,275,276, +273,276,276,116,116,116,276,276,276,116,276,276,276,273,116,116, +274,116,116,116,116,116,116,275,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,277,277,277,277,277,277,277,277,277,277, +278,278,278,279,279,279,279,279,279,280,279,116,116,116,116,116, /* block 24 */ -278,279,279,279,115,280,280,280,280,280,280,280,280,115,280,280, -280,115,280,280,280,280,280,280,280,280,280,280,280,280,280,280, -280,280,280,280,280,280,280,280,280,115,280,280,280,280,280,280, -280,280,280,280,280,280,280,280,280,280,115,115,115,280,278,278, -278,279,279,279,279,115,278,278,278,115,278,278,278,278,115,115, -115,115,115,115,115,278,278,115,280,280,280,115,115,115,115,115, -280,280,278,278,115,115,281,281,281,281,281,281,281,281,281,281, -115,115,115,115,115,115,115,115,282,282,282,282,282,282,282,283, +281,282,282,282,281,283,283,283,283,283,283,283,283,116,283,283, +283,116,283,283,283,283,283,283,283,283,283,283,283,283,283,283, +283,283,283,283,283,283,283,283,283,116,283,283,283,283,283,283, +283,283,283,283,283,283,283,283,283,283,116,116,116,283,281,281, +281,282,282,282,282,116,281,281,281,116,281,281,281,281,116,116, +116,116,116,116,116,281,281,116,283,283,283,116,116,116,116,116, +283,283,281,281,116,116,284,284,284,284,284,284,284,284,284,284, +116,116,116,116,116,116,116,116,285,285,285,285,285,285,285,286, /* block 25 */ -284,285,286,286,115,284,284,284,284,284,284,284,284,115,284,284, -284,115,284,284,284,284,284,284,284,284,284,284,284,284,284,284, -284,284,284,284,284,284,284,284,284,115,284,284,284,284,284,284, -284,284,284,284,115,284,284,284,284,284,115,115,285,284,286,285, -286,286,287,286,286,115,285,286,286,115,286,286,285,285,115,115, -115,115,115,115,115,287,287,115,115,115,115,115,115,115,284,115, -284,284,285,285,115,115,288,288,288,288,288,288,288,288,288,288, -115,284,284,115,115,115,115,115,115,115,115,115,115,115,115,115, +287,288,289,289,290,287,287,287,287,287,287,287,287,116,287,287, +287,116,287,287,287,287,287,287,287,287,287,287,287,287,287,287, +287,287,287,287,287,287,287,287,287,116,287,287,287,287,287,287, +287,287,287,287,116,287,287,287,287,287,116,116,288,287,289,288, +289,289,291,289,289,116,288,289,289,116,289,289,288,288,116,116, +116,116,116,116,116,291,291,116,116,116,116,116,116,116,287,116, +287,287,288,288,116,116,292,292,292,292,292,292,292,292,292,292, +116,287,287,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 26 */ -289,289,290,290,115,291,291,291,291,291,291,291,291,115,291,291, -291,115,291,291,291,291,291,291,291,291,291,291,291,291,291,291, -291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291, -291,291,291,291,291,291,291,291,291,291,291,289,289,291,292,290, -290,289,289,289,289,115,290,290,290,115,290,290,290,289,293,294, -115,115,115,115,291,291,291,292,295,295,295,295,295,295,295,291, -291,291,289,289,115,115,296,296,296,296,296,296,296,296,296,296, -295,295,295,295,295,295,295,295,295,294,291,291,291,291,291,291, +293,293,294,294,116,295,295,295,295,295,295,295,295,116,295,295, +295,116,295,295,295,295,295,295,295,295,295,295,295,295,295,295, +295,295,295,295,295,295,295,295,295,295,295,295,295,295,295,295, +295,295,295,295,295,295,295,295,295,295,295,293,293,295,296,294, +294,293,293,293,293,116,294,294,294,116,294,294,294,293,297,298, +116,116,116,116,295,295,295,296,299,299,299,299,299,299,299,295, +295,295,293,293,116,116,300,300,300,300,300,300,300,300,300,300, +299,299,299,299,299,299,299,299,299,298,295,295,295,295,295,295, /* block 27 */ -115,115,297,297,115,298,298,298,298,298,298,298,298,298,298,298, -298,298,298,298,298,298,298,115,115,115,298,298,298,298,298,298, -298,298,298,298,298,298,298,298,298,298,298,298,298,298,298,298, -298,298,115,298,298,298,298,298,298,298,298,298,115,298,115,115, -298,298,298,298,298,298,298,115,115,115,299,115,115,115,115,300, -297,297,299,299,299,115,299,115,297,297,297,297,297,297,297,300, -115,115,115,115,115,115,301,301,301,301,301,301,301,301,301,301, -115,115,297,297,302,115,115,115,115,115,115,115,115,115,115,115, +116,116,301,301,116,302,302,302,302,302,302,302,302,302,302,302, +302,302,302,302,302,302,302,116,116,116,302,302,302,302,302,302, +302,302,302,302,302,302,302,302,302,302,302,302,302,302,302,302, +302,302,116,302,302,302,302,302,302,302,302,302,116,302,116,116, +302,302,302,302,302,302,302,116,116,116,303,116,116,116,116,304, +301,301,303,303,303,116,303,116,301,301,301,301,301,301,301,304, +116,116,116,116,116,116,305,305,305,305,305,305,305,305,305,305, +116,116,301,301,306,116,116,116,116,116,116,116,116,116,116,116, /* block 28 */ -115,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303, -303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303, -303,303,303,303,303,303,303,303,303,303,303,303,303,303,303,303, -303,304,303,305,304,304,304,304,304,304,304,115,115,115,115, 5, -303,303,303,303,303,303,306,304,304,304,304,304,304,304,304,307, -308,308,308,308,308,308,308,308,308,308,307,307,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +116,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307, +307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307, +307,307,307,307,307,307,307,307,307,307,307,307,307,307,307,307, +307,308,307,309,308,308,308,308,308,308,308,116,116,116,116, 5, +307,307,307,307,307,307,310,308,308,308,308,308,308,308,308,311, +312,312,312,312,312,312,312,312,312,312,311,311,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 29 */ -115,309,309,115,309,115,115,309,309,115,309,115,115,309,115,115, -115,115,115,115,309,309,309,309,115,309,309,309,309,309,309,309, -115,309,309,309,115,309,115,309,115,115,309,309,115,309,309,309, -309,310,309,311,310,310,310,310,310,310,115,310,310,309,115,115, -309,309,309,309,309,115,312,115,310,310,310,310,310,310,115,115, -313,313,313,313,313,313,313,313,313,313,115,115,309,309,309,309, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +116,313,313,116,313,116,116,313,313,116,313,116,116,313,116,116, +116,116,116,116,313,313,313,313,116,313,313,313,313,313,313,313, +116,313,313,313,116,313,116,313,116,116,313,313,116,313,313,313, +313,314,313,315,314,314,314,314,314,314,116,314,314,313,116,116, +313,313,313,313,313,116,316,116,314,314,314,314,314,314,116,116, +317,317,317,317,317,317,317,317,317,317,116,116,313,313,313,313, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 30 */ -314,315,315,315,316,316,316,316,316,316,316,316,316,316,316,316, -316,316,316,315,316,315,315,315,317,317,315,315,315,315,315,315, -318,318,318,318,318,318,318,318,318,318,319,319,319,319,319,319, -319,319,319,319,315,317,315,317,315,317,320,321,320,321,322,322, -314,314,314,314,314,314,314,314,115,314,314,314,314,314,314,314, -314,314,314,314,314,314,314,314,314,314,314,314,314,314,314,314, -314,314,314,314,314,314,314,314,314,314,314,314,314,115,115,115, -115,317,317,317,317,317,317,317,317,317,317,317,317,317,317,322, +318,319,319,319,320,320,320,320,320,320,320,320,320,320,320,320, +320,320,320,319,320,319,319,319,321,321,319,319,319,319,319,319, +322,322,322,322,322,322,322,322,322,322,323,323,323,323,323,323, +323,323,323,323,319,321,319,321,319,321,324,325,324,325,326,326, +318,318,318,318,318,318,318,318,116,318,318,318,318,318,318,318, +318,318,318,318,318,318,318,318,318,318,318,318,318,318,318,318, +318,318,318,318,318,318,318,318,318,318,318,318,318,116,116,116, +116,321,321,321,321,321,321,321,321,321,321,321,321,321,321,326, /* block 31 */ -317,317,317,317,317,316,317,317,314,314,314,314,314,317,317,317, -317,317,317,317,317,317,317,317,115,317,317,317,317,317,317,317, -317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317, -317,317,317,317,317,317,317,317,317,317,317,317,317,115,315,315, -315,315,315,315,315,315,317,315,315,315,315,315,315,115,315,315, -316,316,316,316,316, 19, 19, 19, 19,316,316,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +321,321,321,321,321,320,321,321,318,318,318,318,318,321,321,321, +321,321,321,321,321,321,321,321,116,321,321,321,321,321,321,321, +321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321, +321,321,321,321,321,321,321,321,321,321,321,321,321,116,319,319, +319,319,319,319,319,319,321,319,319,319,319,319,319,116,319,319, +320,320,320,320,320, 19, 19, 19, 19,320,320,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 32 */ -323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323, -323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323, -323,323,323,323,323,323,323,323,323,323,323,324,324,325,325,325, -325,326,325,325,325,325,325,325,324,325,325,326,326,325,325,323, -327,327,327,327,327,327,327,327,327,327,328,328,328,328,328,328, -323,323,323,323,323,323,326,326,325,325,323,323,323,323,325,325, -325,323,324,324,324,323,323,324,324,324,324,324,324,324,323,323, -323,325,325,325,325,323,323,323,323,323,323,323,323,323,323,323, +327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327, +327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327, +327,327,327,327,327,327,327,327,327,327,327,328,328,329,329,329, +329,330,329,329,329,329,329,329,328,329,329,330,330,329,329,327, +331,331,331,331,331,331,331,331,331,331,332,332,332,332,332,332, +327,327,327,327,327,327,330,330,329,329,327,327,327,327,329,329, +329,327,328,328,328,327,327,328,328,328,328,328,328,328,327,327, +327,329,329,329,329,327,327,327,327,327,327,327,327,327,327,327, /* block 33 */ -323,323,325,324,326,325,325,324,324,324,324,324,324,325,323,324, -327,327,327,327,327,327,327,327,327,327,324,324,324,325,329,329, -330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330, -330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330, -330,330,330,330,330,330,115,330,115,115,115,115,115,330,115,115, -331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331, -331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331, -331,331,331,331,331,331,331,331,331,331,331, 4,332,331,331,331, - -/* block 34 */ -333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, -333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, -333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, -333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, -333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, -333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, -334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, +327,327,329,328,330,329,329,328,328,328,328,328,328,329,327,328, +331,331,331,331,331,331,331,331,331,331,328,328,328,329,333,333, 334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, - -/* block 35 */ 334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, -334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, -334,334,334,334,334,334,334,334,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, +334,334,334,334,334,334,116,334,116,116,116,116,116,334,116,116, 335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, 335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, +335,335,335,335,335,335,335,335,335,335,335, 4,336,335,335,335, + +/* block 34 */ +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, + +/* block 35 */ +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,338,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, /* block 36 */ -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,115,336,336,336,336,115,115, -336,336,336,336,336,336,336,115,336,115,336,336,336,336,115,115, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,116,340,340,340,340,116,116, +340,340,340,340,340,340,340,116,340,116,340,340,340,340,116,116, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, /* block 37 */ -336,336,336,336,336,336,336,336,336,115,336,336,336,336,115,115, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,115,336,336,336,336,115,115,336,336,336,336,336,336,336,115, -336,115,336,336,336,336,115,115,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, +340,340,340,340,340,340,340,340,340,116,340,340,340,340,116,116, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,116,340,340,340,340,116,116,340,340,340,340,340,340,340,116, +340,116,340,340,340,340,116,116,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, /* block 38 */ -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,115,336,336,336,336,115,115,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,336,336,336,336,115,115,337,337,337, -338,338,338,338,338,338,338,338,338,339,339,339,339,339,339,339, -339,339,339,339,339,339,339,339,339,339,339,339,339,115,115,115, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,116,340,340,340,340,116,116,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,340,340,340,340,116,116,341,341,341, +342,342,342,342,342,342,342,342,342,343,343,343,343,343,343,343, +343,343,343,343,343,343,343,343,343,343,343,343,343,116,116,116, /* block 39 */ -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -340,340,340,340,340,340,340,340,340,340,115,115,115,115,115,115, -341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341, -341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341, -341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341, -341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341, -341,341,341,341,341,341,341,341,341,341,341,341,341,341,341,341, -342,342,342,342,342,342,115,115,343,343,343,343,343,343,115,115, - -/* block 40 */ -344,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +344,344,344,344,344,344,344,344,344,344,116,116,116,116,116,116, 345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, 345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, 345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, 345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, 345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, +346,346,346,346,346,346,116,116,347,347,347,347,347,347,116,116, + +/* block 40 */ +348,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, /* block 41 */ -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, /* block 42 */ -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,346,346,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,350,350,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, /* block 43 */ -347,348,348,348,348,348,348,348,348,348,348,348,348,348,348,348, -348,348,348,348,348,348,348,348,348,348,348,349,350,115,115,115, -351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351, -351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351, -351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351, -351,351,351,351,351,351,351,351,351,351,351,351,351,351,351,351, -351,351,351,351,351,351,351,351,351,351,351, 4, 4, 4,352,352, -352,351,351,351,351,351,351,351,351,115,115,115,115,115,115,115, +351,352,352,352,352,352,352,352,352,352,352,352,352,352,352,352, +352,352,352,352,352,352,352,352,352,352,352,353,354,116,116,116, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, +355,355,355,355,355,355,355,355,355,355,355, 4, 4, 4,356,356, +356,355,355,355,355,355,355,355,355,116,116,116,116,116,116,116, /* block 44 */ -353,353,353,353,353,353,353,353,353,353,353,353,353,115,353,353, -353,353,354,354,354,115,115,115,115,115,115,115,115,115,115,115, -355,355,355,355,355,355,355,355,355,355,355,355,355,355,355,355, -355,355,356,356,356, 4, 4,115,115,115,115,115,115,115,115,115, -357,357,357,357,357,357,357,357,357,357,357,357,357,357,357,357, -357,357,358,358,115,115,115,115,115,115,115,115,115,115,115,115, -359,359,359,359,359,359,359,359,359,359,359,359,359,115,359,359, -359,115,360,360,115,115,115,115,115,115,115,115,115,115,115,115, +357,357,357,357,357,357,357,357,357,357,357,357,357,116,357,357, +357,357,358,358,358,116,116,116,116,116,116,116,116,116,116,116, +359,359,359,359,359,359,359,359,359,359,359,359,359,359,359,359, +359,359,360,360,360, 4, 4,116,116,116,116,116,116,116,116,116, +361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, +361,361,362,362,116,116,116,116,116,116,116,116,116,116,116,116, +363,363,363,363,363,363,363,363,363,363,363,363,363,116,363,363, +363,116,364,364,116,116,116,116,116,116,116,116,116,116,116,116, /* block 45 */ -361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, -361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, -361,361,361,361,361,361,361,361,361,361,361,361,361,361,361,361, -361,361,361,361,362,362,363,362,362,362,362,362,362,362,363,363, -363,363,363,363,363,363,362,363,363,362,362,362,362,362,362,362, -362,362,362,362,364,364,364,365,364,364,364,366,361,362,115,115, -367,367,367,367,367,367,367,367,367,367,115,115,115,115,115,115, -368,368,368,368,368,368,368,368,368,368,115,115,115,115,115,115, +365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, +365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, +365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365, +365,365,365,365,366,366,367,366,366,366,366,366,366,366,367,367, +367,367,367,367,367,367,366,367,367,366,366,366,366,366,366,366, +366,366,366,366,368,368,368,369,368,368,368,370,365,366,116,116, +371,371,371,371,371,371,371,371,371,371,116,116,116,116,116,116, +372,372,372,372,372,372,372,372,372,372,116,116,116,116,116,116, /* block 46 */ -369,369, 4, 4,369, 4,370,369,369,369,369,371,371,371,372,115, -373,373,373,373,373,373,373,373,373,373,115,115,115,115,115,115, -374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -374,374,374,375,374,374,374,374,374,374,374,374,374,374,374,374, -374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -374,374,374,374,374,374,374,374,115,115,115,115,115,115,115,115, +373,373, 4, 4,373, 4,374,373,373,373,373,375,375,375,376,116, +377,377,377,377,377,377,377,377,377,377,116,116,116,116,116,116, +378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, +378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, +378,378,378,379,378,378,378,378,378,378,378,378,378,378,378,378, +378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, +378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, +378,378,378,378,378,378,378,378,378,116,116,116,116,116,116,116, /* block 47 */ -374,374,374,374,374,371,371,374,374,374,374,374,374,374,374,374, -374,374,374,374,374,374,374,374,374,374,374,374,374,374,374,374, -374,374,374,374,374,374,374,374,374,371,374,115,115,115,115,115, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345, -345,345,345,345,345,345,115,115,115,115,115,115,115,115,115,115, +378,378,378,378,378,375,375,378,378,378,378,378,378,378,378,378, +378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, +378,378,378,378,378,378,378,378,378,375,378,116,116,116,116,116, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,349,349,349,349,349,349,349,349,349,349, +349,349,349,349,349,349,116,116,116,116,116,116,116,116,116,116, /* block 48 */ -376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, -376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,115, -377,377,377,378,378,378,378,377,377,378,378,378,115,115,115,115, -378,378,377,378,378,378,378,378,378,377,377,377,115,115,115,115, -379,115,115,115,380,380,381,381,381,381,381,381,381,381,381,381, -382,382,382,382,382,382,382,382,382,382,382,382,382,382,382,382, -382,382,382,382,382,382,382,382,382,382,382,382,382,382,115,115, -382,382,382,382,382,115,115,115,115,115,115,115,115,115,115,115, +380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,380, +380,380,380,380,380,380,380,380,380,380,380,380,380,380,380,116, +381,381,381,382,382,382,382,381,381,382,382,382,116,116,116,116, +382,382,381,382,382,382,382,382,382,381,381,381,116,116,116,116, +383,116,116,116,384,384,385,385,385,385,385,385,385,385,385,385, +386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386, +386,386,386,386,386,386,386,386,386,386,386,386,386,386,116,116, +386,386,386,386,386,116,116,116,116,116,116,116,116,116,116,116, /* block 49 */ -383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383, -383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383, -383,383,383,383,383,383,383,383,383,383,383,383,115,115,115,115, -383,383,383,383,383,383,383,383,383,383,383,383,383,383,383,383, -383,383,383,383,383,383,383,383,383,383,115,115,115,115,115,115, -384,384,384,384,384,384,384,384,384,384,385,115,115,115,386,386, 387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, 387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, +387,387,387,387,387,387,387,387,387,387,387,387,116,116,116,116, +387,387,387,387,387,387,387,387,387,387,387,387,387,387,387,387, +387,387,387,387,387,387,387,387,387,387,116,116,116,116,116,116, +388,388,388,388,388,388,388,388,388,388,389,116,116,116,390,390, +391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, +391,391,391,391,391,391,391,391,391,391,391,391,391,391,391,391, /* block 50 */ -388,388,388,388,388,388,388,388,388,388,388,388,388,388,388,388, -388,388,388,388,388,388,388,389,389,390,390,389,115,115,391,391, 392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392, -392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392, -392,392,392,392,392,392,392,392,392,392,392,392,392,392,392,392, -392,392,392,392,392,393,394,393,394,394,394,394,394,394,394,115, -394,395,394,395,395,394,394,394,394,394,394,394,394,393,393,393, -393,393,393,394,394,394,394,394,394,394,394,394,394,115,115,394, +392,392,392,392,392,392,392,393,393,394,394,393,116,116,395,395, +396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, +396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, +396,396,396,396,396,396,396,396,396,396,396,396,396,396,396,396, +396,396,396,396,396,397,398,397,398,398,398,398,398,398,398,116, +398,399,398,399,399,398,398,398,398,398,398,398,398,397,397,397, +397,397,397,398,398,398,398,398,398,398,398,398,398,116,116,398, /* block 51 */ -396,396,396,396,396,396,396,396,396,396,115,115,115,115,115,115, -396,396,396,396,396,396,396,396,396,396,115,115,115,115,115,115, -397,397,397,397,397,397,397,398,397,397,397,397,397,397,115,115, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,399,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +400,400,400,400,400,400,400,400,400,400,116,116,116,116,116,116, +400,400,400,400,400,400,400,400,400,400,116,116,116,116,116,116, +401,401,401,401,401,401,401,402,401,401,401,401,401,401,116,116, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,403,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 52 */ -400,400,400,400,401,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, -402,402,402,402,400,401,400,400,400,400,400,401,400,401,401,401, -401,401,400,401,401,402,402,402,402,402,402,402,115,115,115,115, -403,403,403,403,403,403,403,403,403,403,404,404,404,404,404,404, -404,405,405,405,405,405,405,405,405,405,405,400,400,400,400,400, -400,400,400,400,405,405,405,405,405,405,405,405,405,115,115,115, +404,404,404,404,405,406,406,406,406,406,406,406,406,406,406,406, +406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,406, +406,406,406,406,406,406,406,406,406,406,406,406,406,406,406,406, +406,406,406,406,404,405,404,404,404,404,404,405,404,405,405,405, +405,405,404,405,405,406,406,406,406,406,406,406,116,116,116,116, +407,407,407,407,407,407,407,407,407,407,408,408,408,408,408,408, +408,409,409,409,409,409,409,409,409,409,409,404,404,404,404,404, +404,404,404,404,409,409,409,409,409,409,409,409,409,116,116,116, /* block 53 */ -406,406,407,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, -408,407,406,406,406,406,407,407,406,406,407,406,406,406,408,408, -409,409,409,409,409,409,409,409,409,409,408,408,408,408,408,408, -410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410, -410,410,410,410,410,410,410,410,410,410,410,410,410,410,410,410, -410,410,410,410,410,410,411,412,411,411,412,412,412,411,412,411, -411,411,412,412,115,115,115,115,115,115,115,115,413,413,413,413, - -/* block 54 */ +410,410,411,412,412,412,412,412,412,412,412,412,412,412,412,412, +412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, +412,411,410,410,410,410,411,411,410,410,411,410,410,410,412,412, +413,413,413,413,413,413,413,413,413,413,412,412,412,412,412,412, 414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, 414,414,414,414,414,414,414,414,414,414,414,414,414,414,414,414, -414,414,414,414,415,415,415,415,415,415,415,415,416,416,416,416, -416,416,416,416,415,415,416,416,115,115,115,417,417,417,417,417, -418,418,418,418,418,418,418,418,418,418,115,115,115,414,414,414, -419,419,419,419,419,419,419,419,419,419,420,420,420,420,420,420, -420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, -420,420,420,420,420,420,420,420,421,421,421,421,421,421,422,422, +414,414,414,414,414,414,415,416,415,415,416,416,416,415,416,415, +415,415,416,416,116,116,116,116,116,116,116,116,417,417,417,417, + +/* block 54 */ +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,418,418,418,418,418,418,418,418,418,418,418,418, +418,418,418,418,419,419,419,419,419,419,419,419,420,420,420,420, +420,420,420,420,419,419,420,420,116,116,116,421,421,421,421,421, +422,422,422,422,422,422,422,422,422,422,116,116,116,418,418,418, +423,423,423,423,423,423,423,423,423,423,424,424,424,424,424,424, +424,424,424,424,424,424,424,424,424,424,424,424,424,424,424,424, +424,424,424,424,424,424,424,424,425,425,425,425,425,425,426,426, /* block 55 */ -423,424,425,426,427,428,429,430,431,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -432,432,432,432,432,432,432,432,115,115,115,115,115,115,115,115, -110,110,110, 4,110,110,110,110,110,110,110,110,110,110,110,110, -110,433,110,110,110,110,110,110,110,434,434,434,434,110,434,434, -434,434,433,433,110,434,434,433,110,110,115,115,115,115,115,115, +427,428,429,430,431,432,433,434,435,116,116,116,116,116,116,116, +436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436, +436,436,436,436,436,436,436,436,436,436,436,436,436,436,436,436, +436,436,436,436,436,436,436,436,436,436,436,116,116,436,436,436, +437,437,437,437,437,437,437,437,116,116,116,116,116,116,116,116, +111,111,111, 4,111,111,111,111,111,111,111,111,111,111,111,111, +111,438,111,111,111,111,111,111,111,439,439,439,439,111,439,439, +439,439,438,438,111,439,439,438,111,111,116,116,116,116,116,116, /* block 56 */ - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33,123,123,123,123,123,435,107,107,107,107, -107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, -107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, -107,107,107,107,107,107,107,107,107,107,107,107,107,116,116,116, -116,116,107,107,107,107,116,116,116,116,116, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33,436,437, 33, 33, 33,438, 33, 33, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34,124,124,124,124,124,440,108,108,108,108, +108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108, +108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108, +108,108,108,108,108,108,108,108,108,108,108,108,108,117,117,117, +117,117,108,108,108,108,117,117,117,117,117, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34,441,442, 34, 34, 34,443, 34, 34, /* block 57 */ - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,107,107,107,107,107, -107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107, -107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,116, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,115,110,110,110,110,110, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,108,108,108,108,108, +108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108, +108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,117, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,116,111,111,111,111,111, /* block 58 */ - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, -439,440, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, +444,445, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, /* block 59 */ - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 33, 33, 33, 33, 33,441, 33, 33,442, 33, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 34, 34, 34, 34, 34,446, 34, 34,447, 34, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, /* block 60 */ -443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444, -443,443,443,443,443,443,115,115,444,444,444,444,444,444,115,115, -443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444, -443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444, -443,443,443,443,443,443,115,115,444,444,444,444,444,444,115,115, -123,443,123,443,123,443,123,443,115,444,115,444,115,444,115,444, -443,443,443,443,443,443,443,443,444,444,444,444,444,444,444,444, -445,445,446,446,446,446,447,447,448,448,449,449,450,450,115,115, +448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, +448,448,448,448,448,448,116,116,449,449,449,449,449,449,116,116, +448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, +448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, +448,448,448,448,448,448,116,116,449,449,449,449,449,449,116,116, +124,448,124,448,124,448,124,448,116,449,116,449,116,449,116,449, +448,448,448,448,448,448,448,448,449,449,449,449,449,449,449,449, +450,450,451,451,451,451,452,452,453,453,454,454,455,455,116,116, /* block 61 */ -443,443,443,443,443,443,443,443,451,451,451,451,451,451,451,451, -443,443,443,443,443,443,443,443,451,451,451,451,451,451,451,451, -443,443,443,443,443,443,443,443,451,451,451,451,451,451,451,451, -443,443,123,452,123,115,123,123,444,444,453,453,454,114,455,114, -114,114,123,452,123,115,123,123,456,456,456,456,454,114,114,114, -443,443,123,123,115,115,123,123,444,444,457,457,115,114,114,114, -443,443,123,123,123,164,123,123,444,444,458,458,169,114,114,114, -115,115,123,452,123,115,123,123,459,459,460,460,454,114,114,115, +448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456, +448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456, +448,448,448,448,448,448,448,448,456,456,456,456,456,456,456,456, +448,448,124,457,124,116,124,124,449,449,458,458,459,115,460,115, +115,115,124,457,124,116,124,124,461,461,461,461,459,115,115,115, +448,448,124,124,116,116,124,124,449,449,462,462,116,115,115,115, +448,448,124,124,124,165,124,124,449,449,463,463,170,115,115,115, +116,116,124,457,124,116,124,124,464,464,465,465,459,115,115,116, /* block 62 */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 22,461,462, 22, 22, - 9, 9, 9, 9, 9, 9, 4, 4, 21, 25, 6, 21, 21, 25, 6, 21, - 4, 4, 4, 4, 4, 4, 4, 4,463,464, 22, 22, 22, 22, 22, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 21, 25, 4, 4, 4, 4, 15, - 15, 4, 4, 4, 8, 6, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 23,466,467, 23, 23, + 9, 9, 9, 9, 9, 9, 4, 4, 22, 26, 6, 22, 22, 26, 6, 22, + 4, 4, 4, 4, 4, 4, 4, 4,468,469, 23, 23, 23, 23, 23, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 22, 26, 4,470, 4, 4, 15, + 15, 4, 4, 4, 8, 6, 7, 4, 4,470, 4, 4, 4, 4, 4, 4, 4, 4, 8, 4, 15, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, - 22, 22, 22, 22, 22,465, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 23,107,115,115, 23, 23, 23, 23, 23, 23, 8, 8, 8, 6, 7,107, + 23, 23, 23, 23, 23,471, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 24,108,116,116, 24, 24, 24, 24, 24, 24, 8, 8, 8, 6, 7,108, /* block 63 */ - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 8, 8, 8, 6, 7,115, -107,107,107,107,107,107,107,107,107,107,107,107,107,115,115,115, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 8, 8, 6, 7,116, +108,108,108,108,108,108,108,108,108,108,108,108,108,116,116,116, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -110,110,110,110,110,110,110,110,110,110,110,110,110,399,399,399, -399,110,399,399,399,110,110,110,110,110,110,110,110,110,110,110, -110,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +111,111,111,111,111,111,111,111,111,111,111,111,111,403,403,403, +403,111,403,403,403,111,111,111,111,111,111,111,111,111,111,111, +111,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 64 */ - 19, 19,466, 19, 19, 19, 19,466, 19, 19,467,466,466,466,467,467, -466,466,466,467, 19,466, 19, 19, 8,466,466,466,466,466, 19, 19, - 19, 19, 19, 19,466, 19,468, 19,466, 19,469,470,466,466, 19,467, -466,466,471,466,467,434,434,434,434,467, 19, 19,467,467,466,466, - 8, 8, 8, 8, 8,466,467,467,467,467, 19, 8, 19, 19,472, 19, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, -473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, -474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474, + 19, 19,472, 19, 19, 19, 19,472, 19, 19,473,472,472,472,473,473, +472,472,472,473, 19,472, 19, 19, 8,472,472,472,472,472, 19, 19, + 19, 19, 20, 19,472, 19,474, 19,472, 19,475,476,472,472, 19,473, +472,472,477,472,473,439,439,439,439,478, 19, 19,473,473,472,472, + 8, 8, 8, 8, 8,472,473,473,473,473, 19, 8, 19, 19,479, 19, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, /* block 65 */ -475,475,475, 30, 31,475,475,475,475, 23, 19, 19,115,115,115,115, - 8, 8, 8, 8, 8, 19, 19, 19, 19, 19, 8, 8, 19, 19, 19, 19, - 8, 19, 19, 8, 19, 19, 8, 19, 19, 19, 19, 19, 19, 19, 8, 19, +482,482,482, 31, 32,482,482,482,482, 24, 19, 19,116,116,116,116, + 8, 8, 8, 8,483, 20, 20, 20, 20, 20, 8, 8, 19, 19, 19, 19, + 8, 19, 19, 8, 19, 19, 8, 19, 19, 20, 20, 19, 19, 19, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 19, 19, 8, 19, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, @@ -2148,8 +2181,8 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 65536 bytes, block = 128 */ /* block 67 */ 19, 19, 19, 19, 19, 19, 19, 19, 6, 7, 6, 7, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 8, 8, 19, 19, 19, 19, 19, 19, 19, 6, 7, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, 19, + 8, 8, 19, 19, 19, 19, 19, 19, 20, 6, 7, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, @@ -2157,34 +2190,34 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 65536 bytes, block = 128 */ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 19, 19, 19, /* block 68 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8, 8, - 8, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 8, 8, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 19, 19, 19, 19, 20, 20, 20, 19, 19, 19, 19, 19, /* block 69 */ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, /* block 70 */ - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,476,476,476,476,476,476,476,476,476,476, -476,476,476,476,476,476,476,476,476,476,476,476,476,476,476,476, -477,477,477,477,477,477,477,477,477,477,477,477,477,477,477,477, -477,477,477,477,477,477,477,477,477,477, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 19, 19, 19, 19, 19, 19,484,484,484,484,484,484,484,484,484,484, +484,484,485,484,484,484,484,484,484,484,484,484,484,484,484,484, +486,486,486,486,486,486,486,486,486,486,486,486,486,486,486,486, +486,486,486,486,486,486,486,486,486,486, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, /* block 71 */ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, @@ -2199,64 +2232,74 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 65536 bytes, block = 128 */ /* block 72 */ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 20, 8, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 8, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 8, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8, 8, 8, 8, 8, 8, + 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8,483,483,483,483, 8, /* block 73 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -479, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,483, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 74 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19,479,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 75 */ - 19, 19, 19, 19, 19, 19, 19, 19,479, 19,478,478,478,478, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,479, 19, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7, - 6, 7, 6, 7, 6, 7, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 20, 20, 20, 20, 20, 20, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 19, 20, 19, 20, 19, 19, 19, 19, 19, 19, 20, 19, 19, + 19, 20, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 20, 19, 19, 20, 19, 19, 19, 19, 20, 19, 20, 19, + 19, 19, 19, 20, 20, 20, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 20, 20, 20, 20, 20, 6, 7, 6, 7, 6, 7, 6, 7, + 6, 7, 6, 7, 6, 7, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, /* block 76 */ - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 19, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 8, 8, 8, 8, 8, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, /* block 77 */ -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, -480,480,480,480,480,480,480,480,480,480,480,480,480,480,480,480, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, +487,487,487,487,487,487,487,487,487,487,487,487,487,487,487,487, /* block 78 */ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8,483,483, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + +/* block 79 */ 8, 8, 8, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, @@ -2266,1775 +2309,1875 @@ const uint16_t PRIV(ucd_stage2)[] = { /* 65536 bytes, block = 128 */ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 7, 8, 8, -/* block 79 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +/* block 80 */ + 19, 19, 19, 19, 19, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 19, 19, 8, 8, 8, 8, 8, 8, 19, 19, 19, + 20, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -/* block 80 */ +/* block 81 */ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19,115, 19, 19, 19, 19, 19, 19, - 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115, 19, 19, 19, 19, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - -/* block 81 */ -481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, -481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,481, -481,481,481,481,481,481,481,481,481,481,481,481,481,481,481,115, -482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, -482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,482, -482,482,482,482,482,482,482,482,482,482,482,482,482,482,482,115, - 30, 31,483,484,485,486,487, 30, 31, 30, 31, 30, 31,488,489,490, -491, 33, 30, 31, 33, 30, 31, 33, 33, 33, 33, 33,107,107,492,492, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19,116, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116, /* block 82 */ -160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161, -160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161, -160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161, -160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161, -160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161, -160,161,160,161,160,161,160,161,160,161,160,161,160,161,160,161, -160,161,160,161,493,494,494,494,494,494,494,160,161,160,161,495, -495,495,160,161,115,115,115,115,115,496,496,496,496,497,496,496, +488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488, +488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,488, +488,488,488,488,488,488,488,488,488,488,488,488,488,488,488,116, +489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, +489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,489, +489,489,489,489,489,489,489,489,489,489,489,489,489,489,489,116, + 31, 32,490,491,492,493,494, 31, 32, 31, 32, 31, 32,495,496,497, +498, 34, 31, 32, 34, 31, 32, 34, 34, 34, 34, 34,108,108,499,499, /* block 83 */ -498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, -498,498,498,498,498,498,498,498,498,498,498,498,498,498,498,498, -498,498,498,498,498,498,115,498,115,115,115,115,115,498,115,115, -499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, -499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, -499,499,499,499,499,499,499,499,499,499,499,499,499,499,499,499, -499,499,499,499,499,499,499,499,115,115,115,115,115,115,115,500, -501,115,115,115,115,115,115,115,115,115,115,115,115,115,115,502, +161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, +161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, +161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, +161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, +161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, +161,162,161,162,161,162,161,162,161,162,161,162,161,162,161,162, +161,162,161,162,500,501,501,501,501,501,501,161,162,161,162,502, +502,502,161,162,116,116,116,116,116,503,503,503,503,504,503,503, /* block 84 */ -336,336,336,336,336,336,336,336,336,336,336,336,336,336,336,336, -336,336,336,336,336,336,336,115,115,115,115,115,115,115,115,115, -336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115, -336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115, -336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115, -336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115, -192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, -192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,505,505,505,505,505,505,505,505,505,505, +505,505,505,505,505,505,116,505,116,116,116,116,116,505,116,116, +506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, +506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, +506,506,506,506,506,506,506,506,506,506,506,506,506,506,506,506, +506,506,506,506,506,506,506,506,116,116,116,116,116,116,116,507, +508,116,116,116,116,116,116,116,116,116,116,116,116,116,116,509, /* block 85 */ - 4, 4, 21, 25, 21, 25, 4, 4, 4, 21, 25, 4, 21, 25, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 9, 4, 4, 9, 4, 21, 25, 4, 4, - 21, 25, 6, 7, 6, 7, 6, 7, 6, 7, 4, 4, 4, 4, 4,108, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, 9, 4, 4, 4, 4, - 9, 4, 6, 4, 4, 4, 4, 4, 4, 4,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +340,340,340,340,340,340,340,340,340,340,340,340,340,340,340,340, +340,340,340,340,340,340,340,116,116,116,116,116,116,116,116,116, +340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, +340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, +340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, +340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, +193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193, +193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193, /* block 86 */ -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,115,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,115,115,115,115,115,115,115,115,115,115,115,115, + 4, 4, 22, 26, 22, 26, 4, 4, 4, 22, 26, 4, 22, 26, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 9, 4, 4, 9, 4, 22, 26, 4, 4, + 22, 26, 6, 7, 6, 7, 6, 7, 6, 7, 4, 4, 4, 4, 4,109, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, 9, 4, 4, 4, 4, + 9, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 87 */ -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,116,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,116,116,116,116,116,116,116,116,116,116,116,116, /* block 88 */ -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,503,503,503,503,503,503,503,503,503,503, -503,503,503,503,503,503,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, /* block 89 */ - 3, 4, 4, 4, 19,504,434,505, 6, 7, 6, 7, 6, 7, 6, 7, - 6, 7, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7, 9, 6, 7, 7, - 19,505,505,505,505,505,505,505,505,505,110,110,110,110,506,506, - 9,108,108,108,108,108, 19, 19,505,505,505,504,434, 4, 19, 19, -115,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,510,510,510,510,510,510,510,510,510,510, +510,510,510,510,510,510,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116, /* block 90 */ -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,115,115,110,110, 14, 14,508,508,507, - 9,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509, 4,108,510,510,509, + 3, 4, 4, 4, 19,511,439,512, 6, 7, 6, 7, 6, 7, 6, 7, + 6, 7, 19, 19, 6, 7, 6, 7, 6, 7, 6, 7, 9, 6, 7, 7, + 19,512,512,512,512,512,512,512,512,512,111,111,111,111,513,513, +514,109,109,109,109,109, 19, 19,512,512,512,511,439,470, 19, 19, +116,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, /* block 91 */ -115,115,115,115,115,511,511,511,511,511,511,511,511,511,511,511, -511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511, -511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,115, -115,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,116,116,111,111, 14, 14,516,516,515, + 9,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +517,517,517,517,517,517,517,517,517,517,517, 4,109,518,518,517, /* block 92 */ -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,115, - 19, 19, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511, -511,511,511,511,511,511,511,511,511,511,511,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, +116,116,116,116,116,519,519,519,519,519,519,519,519,519,519,519, +519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, +519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, +116,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, /* block 93 */ -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,115, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,116, + 19, 19, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, +519,519,519,519,519,519,519,519,519,519,519,116,116,116,116,116, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 23, - 19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, -513,513,513,513,513,513,513,513,513,513,513,513,513,513,513, 19, + 19, 19, 19, 19,116,116,116,116,116,116,116,116,116,116,116,116, +517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, /* block 94 */ - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, +521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, +521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,116, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,115, + 19, 19, 19, 19, 19, 19, 19, 19, 24, 24, 24, 24, 24, 24, 24, 24, + 19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +521,521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, +521,521,521,521,521,521,521,521,521,521,521,521,521,521,521, 19, /* block 95 */ -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,514,514,514,514,514,514,514,514,514,514,514,514,514,514, -514,514,514,514,514,514,514,514, 19, 19, 19, 19, 19, 19, 19, 19, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 20, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,116, /* block 96 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +522,522,522,522,522,522,522,522, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, /* block 97 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,115,115,115,115,115,115,115,115,115,115, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, + +/* block 98 */ +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,116,116,116,116,116,116,116,116,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -/* block 98 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - /* block 99 */ -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,517,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 100 */ -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, -516,516,516,516,516,516,516,516,516,516,516,516,516,516,516,516, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,525,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, /* block 101 */ -516,516,516,516,516,516,516,516,516,516,516,516,516,115,115,115, -518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518, -518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518, -518,518,518,518,518,518,518,518,518,518,518,518,518,518,518,518, -518,518,518,518,518,518,518,115,115,115,115,115,115,115,115,115, -519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, -519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519, -519,519,519,519,519,519,519,519,520,520,520,520,520,520,521,521, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, +524,524,524,524,524,524,524,524,524,524,524,524,524,524,524,524, /* block 102 */ -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, +524,524,524,524,524,524,524,524,524,524,524,524,524,116,116,116, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,526,526,526,526,526,526,526,526,526, +526,526,526,526,526,526,526,116,116,116,116,116,116,116,116,116, +527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,527, +527,527,527,527,527,527,527,527,527,527,527,527,527,527,527,527, +527,527,527,527,527,527,527,527,528,528,528,528,528,528,529,529, /* block 103 */ -522,522,522,522,522,522,522,522,522,522,522,522,523,524,524,524, -522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, -525,525,525,525,525,525,525,525,525,525,522,522,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -187,188,187,188,187,188,187,188,187,188,526,527,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,187,188,528,192, -193,193,193,529,192,192,192,192,192,192,192,192,192,192,529,436, - -/* block 104 */ -187,188,187,188,187,188,187,188,187,188,187,188,187,188,187,188, -187,188,187,188,187,188,187,188,187,188,187,188,436,436,192,192, 530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, 530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, 530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, 530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,531,531,531,531,531,531,531,531,531,531, -532,532,533,533,533,533,533,533,115,115,115,115,115,115,115,115, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, + +/* block 104 */ +530,530,530,530,530,530,530,530,530,530,530,530,531,532,532,532, +530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +533,533,533,533,533,533,533,533,533,533,530,530,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +188,189,188,189,188,189,188,189,188,189,534,535,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,536,193, +194,194,194,537,193,193,193,193,193,193,193,193,193,193,537,441, /* block 105 */ - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14,108,108,108,108,108,108,108,108,108, - 14, 14, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 33, 33, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, -107, 33, 33, 33, 33, 33, 33, 33, 33, 30, 31, 30, 31,534, 30, 31, +188,189,188,189,188,189,188,189,188,189,188,189,188,189,188,189, +188,189,188,189,188,189,188,189,188,189,188,189,441,441,193,193, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,539,539,539,539,539,539,539,539,539,539, +540,540,541,541,541,541,541,541,116,116,116,116,116,116,116,116, /* block 106 */ - 30, 31, 30, 31, 30, 31, 30, 31,108, 14, 14, 30, 31,535, 33, 20, - 30, 31, 30, 31, 33, 33, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, - 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,536,537,538,539,536,115, -540,541,542,543, 30, 31, 30, 31,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115, 20,107,107, 33, 20, 20, 20, 20, 20, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14,109,109,109,109,109,109,109,109,109, + 14, 14, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 34, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, +108, 34, 34, 34, 34, 34, 34, 34, 34, 31, 32, 31, 32,542, 31, 32, /* block 107 */ -544,544,545,544,544,544,545,544,544,544,544,545,544,544,544,544, -544,544,544,544,544,544,544,544,544,544,544,544,544,544,544,544, -544,544,544,546,546,545,545,546,547,547,547,547,115,115,115,115, - 23, 23, 23, 23, 23, 23, 19, 19, 5, 19,115,115,115,115,115,115, -548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548, -548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548, -548,548,548,548,548,548,548,548,548,548,548,548,548,548,548,548, -548,548,548,548,549,549,549,549,115,115,115,115,115,115,115,115, + 31, 32, 31, 32, 31, 32, 31, 32,109, 14, 14, 31, 32,543, 34, 21, + 31, 32, 31, 32, 34, 34, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, + 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,544,545,546,547,544, 34, +548,549,550,551, 31, 32, 31, 32, 31, 32,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116, 21,108,108, 34, 21, 21, 21, 21, 21, /* block 108 */ -550,550,551,551,551,551,551,551,551,551,551,551,551,551,551,551, -551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551, -551,551,551,551,551,551,551,551,551,551,551,551,551,551,551,551, -551,551,551,551,550,550,550,550,550,550,550,550,550,550,550,550, -550,550,550,550,552,552,115,115,115,115,115,115,115,115,553,553, -554,554,554,554,554,554,554,554,554,554,115,115,115,115,115,115, -238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238, -238,238,240,240,240,240,240,240,242,242,242,240,242,240,115,115, +552,552,553,552,552,552,553,552,552,552,552,553,552,552,552,552, +552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552, +552,552,552,554,554,553,553,554,555,555,555,555,116,116,116,116, + 24, 24, 24, 24, 24, 24, 19, 19, 5, 19,116,116,116,116,116,116, +556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556, +556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556, +556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556, +556,556,556,556,557,557,557,557,116,116,116,116,116,116,116,116, /* block 109 */ -555,555,555,555,555,555,555,555,555,555,556,556,556,556,556,556, -556,556,556,556,556,556,556,556,556,556,556,556,556,556,556,556, -556,556,556,556,556,556,557,557,557,557,557,557,557,557, 4,558, +558,558,559,559,559,559,559,559,559,559,559,559,559,559,559,559, 559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559, -559,559,559,559,559,559,559,560,560,560,560,560,560,560,560,560, -560,560,561,561,115,115,115,115,115,115,115,115,115,115,115,562, -333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, -333,333,333,333,333,333,333,333,333,333,333,333,333,115,115,115, +559,559,559,559,559,559,559,559,559,559,559,559,559,559,559,559, +559,559,559,559,558,558,558,558,558,558,558,558,558,558,558,558, +558,558,558,558,560,560,116,116,116,116,116,116,116,116,561,561, +562,562,562,562,562,562,562,562,562,562,116,116,116,116,116,116, +240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240, +240,240,242,242,242,242,242,242,244,244,244,242,244,242,242,240, /* block 110 */ -563,563,563,564,565,565,565,565,565,565,565,565,565,565,565,565, -565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565, -565,565,565,565,565,565,565,565,565,565,565,565,565,565,565,565, -565,565,565,563,564,564,563,563,563,563,564,564,563,564,564,564, -564,566,566,566,566,566,566,566,566,566,566,566,566,566,115,108, -567,567,567,567,567,567,567,567,567,567,115,115,115,115,566,566, -323,323,323,323,323,325,568,323,323,323,323,323,323,323,323,323, -327,327,327,327,327,327,327,327,327,327,323,323,323,323,323,115, +563,563,563,563,563,563,563,563,563,563,564,564,564,564,564,564, +564,564,564,564,564,564,564,564,564,564,564,564,564,564,564,564, +564,564,564,564,564,564,565,565,565,565,565,565,565,565, 4,566, +567,567,567,567,567,567,567,567,567,567,567,567,567,567,567,567, +567,567,567,567,567,567,567,568,568,568,568,568,568,568,568,568, +568,568,569,569,116,116,116,116,116,116,116,116,116,116,116,570, +337,337,337,337,337,337,337,337,337,337,337,337,337,337,337,337, +337,337,337,337,337,337,337,337,337,337,337,337,337,116,116,116, /* block 111 */ -569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, -569,569,569,569,569,569,569,569,569,569,569,569,569,569,569,569, -569,569,569,569,569,569,569,569,569,570,570,570,570,570,570,571, -571,570,570,571,571,570,570,115,115,115,115,115,115,115,115,115, -569,569,569,570,569,569,569,569,569,569,569,569,570,571,115,115, -572,572,572,572,572,572,572,572,572,572,115,115,573,573,573,573, -323,323,323,323,323,323,323,323,323,323,323,323,323,323,323,323, -568,323,323,323,323,323,323,329,329,329,323,324,325,324,323,323, +571,571,571,572,573,573,573,573,573,573,573,573,573,573,573,573, +573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, +573,573,573,573,573,573,573,573,573,573,573,573,573,573,573,573, +573,573,573,571,572,572,571,571,571,571,572,572,571,572,572,572, +572,574,574,574,574,574,574,574,574,574,574,574,574,574,116,109, +575,575,575,575,575,575,575,575,575,575,116,116,116,116,574,574, +327,327,327,327,327,329,576,327,327,327,327,327,327,327,327,327, +331,331,331,331,331,331,331,331,331,331,327,327,327,327,327,116, /* block 112 */ -574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574, -574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574, -574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574, -575,574,575,575,575,574,574,575,575,574,574,574,574,574,575,575, -574,575,574,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,574,574,576,577,577, -578,578,578,578,578,578,578,578,578,578,578,579,580,580,579,579, -581,581,578,582,582,579,580,115,115,115,115,115,115,115,115,115, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,577,577,577,577,577,577,577, +577,577,577,577,577,577,577,577,577,578,578,578,578,578,578,579, +579,578,578,579,579,578,578,116,116,116,116,116,116,116,116,116, +577,577,577,578,577,577,577,577,577,577,577,577,578,579,116,116, +580,580,580,580,580,580,580,580,580,580,116,116,581,581,581,581, +327,327,327,327,327,327,327,327,327,327,327,327,327,327,327,327, +576,327,327,327,327,327,327,333,333,333,327,328,329,328,327,327, /* block 113 */ -115,336,336,336,336,336,336,115,115,336,336,336,336,336,336,115, -115,336,336,336,336,336,336,115,115,115,115,115,115,115,115,115, -336,336,336,336,336,336,336,115,336,336,336,336,336,336,336,115, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33,583, 33, 33, 33, 33, 33, 33, 33, 14,107,107,107,107, - 33, 33, 33, 33, 33,123,115,115,115,115,115,115,115,115,115,115, -584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, +582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582, +582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582, +582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582, +583,582,583,583,583,582,582,583,583,582,582,582,582,582,583,583, +582,583,582,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,582,582,584,585,585, +586,586,586,586,586,586,586,586,586,586,586,587,588,588,587,587, +589,589,586,590,590,587,588,116,116,116,116,116,116,116,116,116, /* block 114 */ -584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, -584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, -584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, -584,584,584,584,584,584,584,584,584,584,584,584,584,584,584,584, -578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, -578,578,578,578,578,578,578,578,578,578,578,578,578,578,578,578, -578,578,578,579,579,580,579,579,580,579,579,581,579,580,115,115, -585,585,585,585,585,585,585,585,585,585,115,115,115,115,115,115, +116,340,340,340,340,340,340,116,116,340,340,340,340,340,340,116, +116,340,340,340,340,340,340,116,116,116,116,116,116,116,116,116, +340,340,340,340,340,340,340,116,340,340,340,340,340,340,340,116, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34,591, 34, 34, 34, 34, 34, 34, 34, 14,108,108,108,108, + 34, 34, 34, 34, 34,124,116,116,116,116,116,116,116,116,116,116, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, /* block 115 */ -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, +586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586, +586,586,586,586,586,586,586,586,586,586,586,586,586,586,586,586, +586,586,586,587,587,588,587,587,588,587,587,589,587,588,116,116, +593,593,593,593,593,593,593,593,593,593,116,116,116,116,116,116, /* block 116 */ -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, /* block 117 */ -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, /* block 118 */ -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, /* block 119 */ -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, /* block 120 */ -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, /* block 121 */ -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -586,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,586,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,586,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, /* block 122 */ -587,587,587,587,587,587,587,587,586,587,587,587,587,587,587,587, -587,587,587,587,587,587,587,587,587,587,587,587,587,587,587,587, -587,587,587,587,115,115,115,115,115,115,115,115,115,115,115,115, -334,334,334,334,334,334,334,334,334,334,334,334,334,334,334,334, -334,334,334,334,334,334,334,115,115,115,115,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,335,335,335,335, -335,335,335,335,335,335,335,335,335,335,335,335,115,115,115,115, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +594,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,594,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,594,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, /* block 123 */ -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, -588,588,588,588,588,588,588,588,588,588,588,588,588,588,588,588, +595,595,595,595,595,595,595,595,594,595,595,595,595,595,595,595, +595,595,595,595,595,595,595,595,595,595,595,595,595,595,595,595, +595,595,595,595,116,116,116,116,116,116,116,116,116,116,116,116, +338,338,338,338,338,338,338,338,338,338,338,338,338,338,338,338, +338,338,338,338,338,338,338,116,116,116,116,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,339,339,339,339, +339,339,339,339,339,339,339,339,339,339,339,339,116,116,116,116, /* block 124 */ -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, +596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, /* block 125 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,115,115, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, /* block 126 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, /* block 127 */ - 33, 33, 33, 33, 33, 33, 33,115,115,115,115,115,115,115,115,115, -115,115,115,200,200,200,200,200,115,115,115,115,115,207,204,207, -207,207,207,207,207,207,207,207,207,590,207,207,207,207,207,207, -207,207,207,207,207,207,207,115,207,207,207,207,207,115,207,115, -207,207,115,207,207,115,207,207,207,207,207,207,207,207,207,207, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 128 */ -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,591,591,591,591,591,591,591,591,591,591,591,591,591,591, -591,591,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, + 34, 34, 34, 34, 34, 34, 34,116,116,116,116,116,116,116,116,116, +116,116,116,200,200,200,200,200,116,116,116,116,116,208,205,208, +208,208,208,208,208,208,208,208,208,598,208,208,208,208,208,208, +208,208,208,208,208,208,208,116,208,208,208,208,208,116,208,116, +208,208,116,208,208,116,208,208,208,208,208,208,208,208,208,208, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, /* block 129 */ -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,599,599,599,599,599,599,599,599,599,599,599,599,599,599, +599,599,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, /* block 130 */ -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216, 7, 6, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, /* block 131 */ -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -115,115,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -216,216,216,216,216,216,216,216,216,216,216,216,212,213,115,115, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217, 7, 6, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, /* block 132 */ -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, - 4, 4, 4, 4, 4, 4, 4, 6, 7, 4,115,115,115,115,115,115, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,192,192, - 4, 9, 9, 15, 15, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, - 7, 6, 7, 6, 7, 4, 4, 6, 7, 4, 4, 4, 4, 15, 15, 15, - 4, 4, 4,115, 4, 4, 4, 4, 9, 6, 7, 6, 7, 6, 7, 4, - 4, 4, 8, 9, 8, 8, 8,115, 4, 5, 4, 4,115,115,115,115, -216,216,216,216,216,115,216,216,216,216,216,216,216,216,216,216, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +116,116,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +217,217,217,217,217,217,217,217,217,217,217,217,213,214,116,116, /* block 133 */ -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,115,115, 22, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, + 4, 4, 4, 4, 4, 4, 4, 6, 7, 4,116,116,116,116,116,116, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,193,193, + 4, 9, 9, 15, 15, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, + 7, 6, 7, 6, 7, 4, 4, 6, 7, 4, 4, 4, 4, 15, 15, 15, + 4, 4, 4,116, 4, 4, 4, 4, 9, 6, 7, 6, 7, 6, 7, 4, + 4, 4, 8, 9, 8, 8, 8,116, 4, 5, 4, 4,116,116,116,116, +217,217,217,217,217,116,217,217,217,217,217,217,217,217,217,217, /* block 134 */ -115, 4, 4, 4, 5, 4, 4, 4, 6, 7, 4, 8, 4, 9, 4, 4, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,116,116, 23, + +/* block 135 */ +116, 4, 4, 4, 5, 4, 4, 4, 6, 7, 4, 8, 4, 9, 4, 4, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 4, 8, 8, 8, 4, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 6, 4, 7, 14, 15, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 6, 8, 7, 8, 6, - 7, 4, 6, 7, 4, 4,509,509,509,509,509,509,509,509,509,509, -108,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, - -/* block 135 */ -509,509,509,509,509,509,509,509,509,509,509,509,509,509,509,509, -509,509,509,509,509,509,509,509,509,509,509,509,509,509,592,592, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, -512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,115, -115,115,512,512,512,512,512,512,115,115,512,512,512,512,512,512, -115,115,512,512,512,512,512,512,115,115,512,512,512,115,115,115, - 5, 5, 8, 14, 19, 5, 5,115, 19, 8, 8, 8, 8, 19, 19,115, -465,465,465,465,465,465,465,465,465, 22, 22, 22, 19, 19,115,115, + 7, 4, 6, 7, 4, 4,517,517,517,517,517,517,517,517,517,517, +109,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, /* block 136 */ -593,593,593,593,593,593,593,593,593,593,593,593,115,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,115,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,115,593,593,115,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,115,115, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +517,517,517,517,517,517,517,517,517,517,517,517,517,517,517,517, +517,517,517,517,517,517,517,517,517,517,517,517,517,517,600,600, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,520, +520,520,520,520,520,520,520,520,520,520,520,520,520,520,520,116, +116,116,520,520,520,520,520,520,116,116,520,520,520,520,520,520, +116,116,520,520,520,520,520,520,116,116,520,520,520,116,116,116, + 5, 5, 8, 14, 19, 5, 5,116, 19, 8, 8, 8, 8, 19, 19,116, +471,471,471,471,471,471,471,471,471, 23, 23, 23, 19, 19,116,116, /* block 137 */ -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,593,593,593,593,593, -593,593,593,593,593,593,593,593,593,593,593,115,115,115,115,115, +601,601,601,601,601,601,601,601,601,601,601,601,116,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,116,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,116,601,601,116,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,116,116, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 138 */ - 4, 4, 4,115,115,115,115, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23,115,115,115, 19, 19, 19, 19, 19, 19, 19, 19, 19, -594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594, -594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594, -594,594,594,594,594,594,594,594,594,594,594,594,594,594,594,594, -594,594,594,594,594,595,595,595,595,596,596,596,596,596,596,596, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, +601,601,601,601,601,601,601,601,601,601,601,116,116,116,116,116, /* block 139 */ -596,596,596,596,596,596,596,596,596,596,595,595,596,596,596,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, -596,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,110,115,115, + 4, 4, 4,116,116,116,116, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24,116,116,116, 19, 19, 19, 19, 19, 19, 19, 19, 19, +602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, +602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, +602,602,602,602,602,602,602,602,602,602,602,602,602,602,602,602, +602,602,602,602,602,603,603,603,603,604,604,604,604,604,604,604, /* block 140 */ -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +604,604,604,604,604,604,604,604,604,604,603,603,604,604,604,116, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116, +604,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,111,116,116, /* block 141 */ -597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, -597,597,597,597,597,597,597,597,597,597,597,597,597,115,115,115, -598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598, -598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598, -598,598,598,598,598,598,598,598,598,598,598,598,598,598,598,598, -598,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -110, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,115,115,115,115, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 142 */ -599,599,599,599,599,599,599,599,599,599,599,599,599,599,599,599, -599,599,599,599,599,599,599,599,599,599,599,599,599,599,599,599, -600,600,600,600,115,115,115,115,115,115,115,115,115,599,599,599, -601,601,601,601,601,601,601,601,601,601,601,601,601,601,601,601, -601,602,601,601,601,601,601,601,601,601,602,115,115,115,115,115, -603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603, -603,603,603,603,603,603,603,603,603,603,603,603,603,603,603,603, -603,603,603,603,603,603,604,604,604,604,604,115,115,115,115,115, +605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605, +605,605,605,605,605,605,605,605,605,605,605,605,605,116,116,116, +606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606, +606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606, +606,606,606,606,606,606,606,606,606,606,606,606,606,606,606,606, +606,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +111, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,116,116,116,116, /* block 143 */ -605,605,605,605,605,605,605,605,605,605,605,605,605,605,605,605, -605,605,605,605,605,605,605,605,605,605,605,605,605,605,115,606, 607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607, 607,607,607,607,607,607,607,607,607,607,607,607,607,607,607,607, -607,607,607,607,115,115,115,115,607,607,607,607,607,607,607,607, -608,609,609,609,609,609,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - -/* block 144 */ -610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,610, -610,610,610,610,610,610,610,610,610,610,610,610,610,610,610,610, -610,610,610,610,610,610,610,610,611,611,611,611,611,611,611,611, +608,608,608,608,116,116,116,116,116,116,116,116,116,607,607,607, +609,609,609,609,609,609,609,609,609,609,609,609,609,609,609,609, +609,610,609,609,609,609,609,609,609,609,610,116,116,116,116,116, 611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611, 611,611,611,611,611,611,611,611,611,611,611,611,611,611,611,611, -612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612, -612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612, -612,612,612,612,612,612,612,612,612,612,612,612,612,612,612,612, +611,611,611,611,611,611,612,612,612,612,612,116,116,116,116,116, -/* block 145 */ +/* block 144 */ 613,613,613,613,613,613,613,613,613,613,613,613,613,613,613,613, -613,613,613,613,613,613,613,613,613,613,613,613,613,613,115,115, -614,614,614,614,614,614,614,614,614,614,115,115,115,115,115,115, +613,613,613,613,613,613,613,613,613,613,613,613,613,613,116,614, 615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615, 615,615,615,615,615,615,615,615,615,615,615,615,615,615,615,615, -615,615,615,615,115,115,115,115,616,616,616,616,616,616,616,616, -616,616,616,616,616,616,616,616,616,616,616,616,616,616,616,616, -616,616,616,616,616,616,616,616,616,616,616,616,115,115,115,115, +615,615,615,615,116,116,116,116,615,615,615,615,615,615,615,615, +616,617,617,617,617,617,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, -/* block 146 */ -617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,617, -617,617,617,617,617,617,617,617,617,617,617,617,617,617,617,617, -617,617,617,617,617,617,617,617,115,115,115,115,115,115,115,115, -618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618, +/* block 145 */ 618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618, 618,618,618,618,618,618,618,618,618,618,618,618,618,618,618,618, -618,618,618,618,115,115,115,115,115,115,115,115,115,115,115,619, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - -/* block 147 */ -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, +618,618,618,618,618,618,618,618,619,619,619,619,619,619,619,619, +619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,619, +619,619,619,619,619,619,619,619,619,619,619,619,619,619,619,619, 620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, 620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, 620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, +/* block 146 */ +621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621, +621,621,621,621,621,621,621,621,621,621,621,621,621,621,116,116, +622,622,622,622,622,622,622,622,622,622,116,116,116,116,116,116, +623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,623, +623,623,623,623,623,623,623,623,623,623,623,623,623,623,623,623, +623,623,623,623,116,116,116,116,624,624,624,624,624,624,624,624, +624,624,624,624,624,624,624,624,624,624,624,624,624,624,624,624, +624,624,624,624,624,624,624,624,624,624,624,624,116,116,116,116, + +/* block 147 */ +625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625, +625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625, +625,625,625,625,625,625,625,625,116,116,116,116,116,116,116,116, +626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626, +626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626, +626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626, +626,626,626,626,116,116,116,116,116,116,116,116,116,116,116,627, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + /* block 148 */ -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,620,115,115,115,115,115,115,115,115,115, -620,620,620,620,620,620,620,620,620,620,620,620,620,620,620,620, -620,620,620,620,620,620,115,115,115,115,115,115,115,115,115,115, -620,620,620,620,620,620,620,620,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, /* block 149 */ -621,621,621,621,621,621,115,115,621,115,621,621,621,621,621,621, -621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621, -621,621,621,621,621,621,621,621,621,621,621,621,621,621,621,621, -621,621,621,621,621,621,115,621,621,115,115,115,621,115,115,621, -622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622, -622,622,622,622,622,622,115,623,624,624,624,624,624,624,624,624, -625,625,625,625,625,625,625,625,625,625,625,625,625,625,625,625, -625,625,625,625,625,625,625,626,626,627,627,627,627,627,627,627, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,628,116,116,116,116,116,116,116,116,116, +628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, +628,628,628,628,628,628,116,116,116,116,116,116,116,116,116,116, +628,628,628,628,628,628,628,628,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 150 */ -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,628, -628,628,628,628,628,628,628,628,628,628,628,628,628,628,628,115, -115,115,115,115,115,115,115,629,629,629,629,629,629,629,629,629, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +629,629,629,629,629,629,116,116,629,116,629,629,629,629,629,629, +629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629, +629,629,629,629,629,629,629,629,629,629,629,629,629,629,629,629, +629,629,629,629,629,629,116,629,629,116,116,116,629,116,116,629, 630,630,630,630,630,630,630,630,630,630,630,630,630,630,630,630, -630,630,630,115,630,630,115,115,115,115,115,631,631,631,631,631, +630,630,630,630,630,630,116,631,632,632,632,632,632,632,632,632, +633,633,633,633,633,633,633,633,633,633,633,633,633,633,633,633, +633,633,633,633,633,633,633,634,634,635,635,635,635,635,635,635, /* block 151 */ -632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, -632,632,632,632,632,632,633,633,633,633,633,633,115,115,115,634, -635,635,635,635,635,635,635,635,635,635,635,635,635,635,635,635, -635,635,635,635,635,635,635,635,635,635,115,115,115,115,115,636, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,636, +636,636,636,636,636,636,636,636,636,636,636,636,636,636,636,116, +116,116,116,116,116,116,116,637,637,637,637,637,637,637,637,637, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,638, +638,638,638,116,638,638,116,116,116,116,116,639,639,639,639,639, /* block 152 */ -637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637, -637,637,637,637,637,637,637,637,637,637,637,637,637,637,637,637, -638,638,638,638,638,638,638,638,638,638,638,638,638,638,638,638, -638,638,638,638,638,638,638,638,115,115,115,115,639,639,638,638, -639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639, -115,115,639,639,639,639,639,639,639,639,639,639,639,639,639,639, -639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639, -639,639,639,639,639,639,639,639,639,639,639,639,639,639,639,639, +640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640, +640,640,640,640,640,640,641,641,641,641,641,641,116,116,116,642, +643,643,643,643,643,643,643,643,643,643,643,643,643,643,643,643, +643,643,643,643,643,643,643,643,643,643,116,116,116,116,116,644, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 153 */ -640,641,641,641,115,641,641,115,115,115,115,115,641,641,641,641, -640,640,640,640,115,640,640,640,115,640,640,640,640,640,640,640, -640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640, -640,640,640,640,115,115,115,115,641,641,641,115,115,115,115,641, -642,642,642,642,642,642,642,642,115,115,115,115,115,115,115,115, -643,643,643,643,643,643,643,643,643,115,115,115,115,115,115,115, -644,644,644,644,644,644,644,644,644,644,644,644,644,644,644,644, -644,644,644,644,644,644,644,644,644,644,644,644,644,645,645,646, +645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,645, +645,645,645,645,645,645,645,645,645,645,645,645,645,645,645,645, +646,646,646,646,646,646,646,646,646,646,646,646,646,646,646,646, +646,646,646,646,646,646,646,646,116,116,116,116,647,647,646,646, +647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, +116,116,647,647,647,647,647,647,647,647,647,647,647,647,647,647, +647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, +647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, /* block 154 */ -647,647,647,647,647,647,647,647,647,647,647,647,647,647,647,647, -647,647,647,647,647,647,647,647,647,647,647,647,647,648,648,648, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -649,649,649,649,649,649,649,649,650,649,649,649,649,649,649,649, -649,649,649,649,649,649,649,649,649,649,649,649,649,649,649,649, -649,649,649,649,649,651,651,115,115,115,115,652,652,652,652,652, -653,653,653,653,653,653,653,115,115,115,115,115,115,115,115,115, +648,649,649,649,116,649,649,116,116,116,116,116,649,649,649,649, +648,648,648,648,116,648,648,648,116,648,648,648,648,648,648,648, +648,648,648,648,648,648,648,648,648,648,648,648,648,648,648,648, +648,648,648,648,648,648,116,116,649,649,649,116,116,116,116,649, +650,650,650,650,650,650,650,650,650,116,116,116,116,116,116,116, +651,651,651,651,651,651,651,651,651,116,116,116,116,116,116,116, +652,652,652,652,652,652,652,652,652,652,652,652,652,652,652,652, +652,652,652,652,652,652,652,652,652,652,652,652,652,653,653,654, /* block 155 */ -654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, -654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, -654,654,654,654,654,654,654,654,654,654,654,654,654,654,654,654, -654,654,654,654,654,654,115,115,115,655,655,655,655,655,655,655, -656,656,656,656,656,656,656,656,656,656,656,656,656,656,656,656, -656,656,656,656,656,656,115,115,657,657,657,657,657,657,657,657, -658,658,658,658,658,658,658,658,658,658,658,658,658,658,658,658, -658,658,658,115,115,115,115,115,659,659,659,659,659,659,659,659, +655,655,655,655,655,655,655,655,655,655,655,655,655,655,655,655, +655,655,655,655,655,655,655,655,655,655,655,655,655,656,656,656, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +657,657,657,657,657,657,657,657,658,657,657,657,657,657,657,657, +657,657,657,657,657,657,657,657,657,657,657,657,657,657,657,657, +657,657,657,657,657,659,659,116,116,116,116,660,660,660,660,660, +661,661,661,661,661,661,661,116,116,116,116,116,116,116,116,116, /* block 156 */ -660,660,660,660,660,660,660,660,660,660,660,660,660,660,660,660, -660,660,115,115,115,115,115,115,115,661,661,661,661,115,115,115, -115,115,115,115,115,115,115,115,115,662,662,662,662,662,662,662, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662, +662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662, +662,662,662,662,662,662,662,662,662,662,662,662,662,662,662,662, +662,662,662,662,662,662,116,116,116,663,663,663,663,663,663,663, +664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664, +664,664,664,664,664,664,116,116,665,665,665,665,665,665,665,665, +666,666,666,666,666,666,666,666,666,666,666,666,666,666,666,666, +666,666,666,116,116,116,116,116,667,667,667,667,667,667,667,667, /* block 157 */ -663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663, -663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663, -663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663, -663,663,663,663,663,663,663,663,663,663,663,663,663,663,663,663, -663,663,663,663,663,663,663,663,663,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668, +668,668,116,116,116,116,116,116,116,669,669,669,669,116,116,116, +116,116,116,116,116,116,116,116,116,670,670,670,670,670,670,670, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 158 */ -664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664, -664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664, -664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664, -664,664,664,115,115,115,115,115,115,115,115,115,115,115,115,115, -665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, -665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, -665,665,665,665,665,665,665,665,665,665,665,665,665,665,665,665, -665,665,665,115,115,115,115,115,115,115,666,666,666,666,666,666, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,671,671,671,671,671,671,671, +671,671,671,671,671,671,671,671,671,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 159 */ -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,667, -667,667,667,667,667,667,667,667,667,667,667,667,667,667,667,115, +672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672, +672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672, +672,672,672,672,672,672,672,672,672,672,672,672,672,672,672,672, +672,672,672,116,116,116,116,116,116,116,116,116,116,116,116,116, +673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, +673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, +673,673,673,673,673,673,673,673,673,673,673,673,673,673,673,673, +673,673,673,116,116,116,116,116,116,116,674,674,674,674,674,674, /* block 160 */ -668,669,668,670,670,670,670,670,670,670,670,670,670,670,670,670, -670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670, -670,670,670,670,670,670,670,670,670,670,670,670,670,670,670,670, -670,670,670,670,670,670,670,670,669,669,669,669,669,669,669,669, -669,669,669,669,669,669,669,671,671,671,671,671,671,671,115,115, -115,115,672,672,672,672,672,672,672,672,672,672,672,672,672,672, -672,672,672,672,672,672,673,673,673,673,673,673,673,673,673,673, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,669, +675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675, +675,675,675,675,675,675,675,675,675,675,675,675,675,675,675,675, +675,675,675,675,676,676,676,676,116,116,116,116,116,116,116,116, +677,677,677,677,677,677,677,677,677,677,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 161 */ -674,674,675,676,676,676,676,676,676,676,676,676,676,676,676,676, -676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676, -676,676,676,676,676,676,676,676,676,676,676,676,676,676,676,676, -675,675,675,674,674,674,674,675,675,674,674,677,677,678,677,677, -677,677,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679, -679,679,679,679,679,679,679,679,679,115,115,115,115,115,115,115, -680,680,680,680,680,680,680,680,680,680,115,115,115,115,115,115, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,678, +678,678,678,678,678,678,678,678,678,678,678,678,678,678,678,116, /* block 162 */ -681,681,681,682,682,682,682,682,682,682,682,682,682,682,682,682, -682,682,682,682,682,682,682,682,682,682,682,682,682,682,682,682, -682,682,682,682,682,682,682,681,681,681,681,681,683,681,681,681, -681,681,681,681,681,115,684,684,684,684,684,684,684,684,684,684, -685,685,685,685,115,115,115,115,115,115,115,115,115,115,115,115, -686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686, -686,686,686,686,686,686,686,686,686,686,686,686,686,686,686,686, -686,686,686,687,688,688,686,115,115,115,115,115,115,115,115,115, +679,679,679,679,679,679,679,679,679,679,679,679,679,679,679,679, +679,679,679,679,679,679,679,679,679,679,679,679,679,680,680,680, +680,680,680,680,680,680,680,679,116,116,116,116,116,116,116,116, +681,681,681,681,681,681,681,681,681,681,681,681,681,681,681,681, +681,681,681,681,681,681,682,682,682,682,682,682,682,682,682,682, +682,683,683,683,683,684,684,684,684,684,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 163 */ -689,689,690,691,691,691,691,691,691,691,691,691,691,691,691,691, -691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691, -691,691,691,691,691,691,691,691,691,691,691,691,691,691,691,691, -691,691,691,690,690,690,689,689,689,689,689,689,689,689,689,690, -690,691,692,692,691,693,693,693,693,693,689,689,689,693,115,115, -694,694,694,694,694,694,694,694,694,694,691,693,691,693,693,693, -115,695,695,695,695,695,695,695,695,695,695,695,695,695,695,695, -695,695,695,695,695,115,115,115,115,115,115,115,115,115,115,115, +685,686,685,687,687,687,687,687,687,687,687,687,687,687,687,687, +687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, +687,687,687,687,687,687,687,687,687,687,687,687,687,687,687,687, +687,687,687,687,687,687,687,687,686,686,686,686,686,686,686,686, +686,686,686,686,686,686,686,688,688,688,688,688,688,688,116,116, +116,116,689,689,689,689,689,689,689,689,689,689,689,689,689,689, +689,689,689,689,689,689,690,690,690,690,690,690,690,690,690,690, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,686, /* block 164 */ +691,691,692,693,693,693,693,693,693,693,693,693,693,693,693,693, +693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693, +693,693,693,693,693,693,693,693,693,693,693,693,693,693,693,693, +692,692,692,691,691,691,691,692,692,691,691,694,694,695,694,694, +694,694,116,116,116,116,116,116,116,116,116,116,116,695,116,116, 696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696, -696,696,115,696,696,696,696,696,696,696,696,696,696,696,696,696, -696,696,696,696,696,696,696,696,696,696,696,696,697,697,697,698, -698,698,697,697,698,697,698,698,699,699,699,699,699,699,698,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +696,696,696,696,696,696,696,696,696,116,116,116,116,116,116,116, +697,697,697,697,697,697,697,697,697,697,116,116,116,116,116,116, /* block 165 */ -700,700,700,700,700,700,700,115,700,115,700,700,700,700,115,700, -700,700,700,700,700,700,700,700,700,700,700,700,700,700,115,700, -700,700,700,700,700,700,700,700,700,701,115,115,115,115,115,115, -702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702, -702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,702, -702,702,702,702,702,702,702,702,702,702,702,702,702,702,702,703, -704,704,704,703,703,703,703,703,703,703,703,115,115,115,115,115, -705,705,705,705,705,705,705,705,705,705,115,115,115,115,115,115, +698,698,698,699,699,699,699,699,699,699,699,699,699,699,699,699, +699,699,699,699,699,699,699,699,699,699,699,699,699,699,699,699, +699,699,699,699,699,699,699,698,698,698,698,698,700,698,698,698, +698,698,698,698,698,116,701,701,701,701,701,701,701,701,701,701, +702,702,702,702,699,700,700,116,116,116,116,116,116,116,116,116, +703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703, +703,703,703,703,703,703,703,703,703,703,703,703,703,703,703,703, +703,703,703,704,705,705,703,116,116,116,116,116,116,116,116,116, /* block 166 */ -706,706,707,707,115,708,708,708,708,708,708,708,708,115,115,708, -708,115,115,708,708,708,708,708,708,708,708,708,708,708,708,708, -708,708,708,708,708,708,708,708,708,115,708,708,708,708,708,708, -708,115,708,708,115,708,708,708,708,708,115,115,706,708,709,707, -706,707,707,707,707,115,115,707,707,115,115,707,707,707,115,115, -708,115,115,115,115,115,115,709,115,115,115,115,115,708,708,708, -708,708,707,707,115,115,706,706,706,706,706,706,706,115,115,115, -706,706,706,706,706,115,115,115,115,115,115,115,115,115,115,115, +706,706,707,708,708,708,708,708,708,708,708,708,708,708,708,708, +708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, +708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708, +708,708,708,707,707,707,706,706,706,706,706,706,706,706,706,707, +707,708,709,709,708,710,710,710,710,706,706,706,706,710,116,116, +711,711,711,711,711,711,711,711,711,711,708,710,708,710,710,710, +116,712,712,712,712,712,712,712,712,712,712,712,712,712,712,712, +712,712,712,712,712,116,116,116,116,116,116,116,116,116,116,116, /* block 167 */ -710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710, -710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710, -710,710,710,710,710,710,710,710,710,710,710,710,710,710,710,710, -710,710,710,710,710,711,711,711,712,712,712,712,712,712,712,712, -711,711,712,712,712,711,712,710,710,710,710,713,713,713,713,713, -714,714,714,714,714,714,714,714,714,714,115,713,115,713,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +713,713,713,713,713,713,713,713,713,713,713,713,713,713,713,713, +713,713,116,713,713,713,713,713,713,713,713,713,713,713,713,713, +713,713,713,713,713,713,713,713,713,713,713,713,714,714,714,715, +715,715,714,714,715,714,715,715,716,716,716,716,716,716,715,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 168 */ -715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715, -715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715, -715,715,715,715,715,715,715,715,715,715,715,715,715,715,715,715, -716,717,717,718,718,718,718,718,718,717,718,717,717,716,717,718, -718,717,718,718,715,715,719,715,115,115,115,115,115,115,115,115, -720,720,720,720,720,720,720,720,720,720,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +717,717,717,717,717,717,717,116,717,116,717,717,717,717,116,717, +717,717,717,717,717,717,717,717,717,717,717,717,717,717,116,717, +717,717,717,717,717,717,717,717,717,718,116,116,116,116,116,116, +719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719, +719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,719, +719,719,719,719,719,719,719,719,719,719,719,719,719,719,719,720, +721,721,721,720,720,720,720,720,720,720,720,116,116,116,116,116, +722,722,722,722,722,722,722,722,722,722,116,116,116,116,116,116, /* block 169 */ -721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,721, -721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,721, -721,721,721,721,721,721,721,721,721,721,721,721,721,721,721,722, -723,723,724,724,724,724,115,115,723,723,723,723,724,724,723,724, -724,725,725,725,725,725,725,725,725,725,725,725,725,725,725,725, -725,725,725,725,725,725,725,725,721,721,721,721,724,724,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +723,723,724,724,116,725,725,725,725,725,725,725,725,116,116,725, +725,116,116,725,725,725,725,725,725,725,725,725,725,725,725,725, +725,725,725,725,725,725,725,725,725,116,725,725,725,725,725,725, +725,116,725,725,116,725,725,725,725,725,116,111,723,725,726,724, +723,724,724,724,724,116,116,724,724,116,116,724,724,724,116,116, +725,116,116,116,116,116,116,726,116,116,116,116,116,725,725,725, +725,725,724,724,116,116,723,723,723,723,723,723,723,116,116,116, +723,723,723,723,723,116,116,116,116,116,116,116,116,116,116,116, /* block 170 */ -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -726,726,726,726,726,726,726,726,726,726,726,726,726,726,726,726, -727,727,727,728,728,728,728,728,728,728,728,727,727,728,727,728, -728,729,729,729,726,115,115,115,115,115,115,115,115,115,115,115, -730,730,730,730,730,730,730,730,730,730,115,115,115,115,115,115, -369,369,369,369,369,369,369,369,369,369,369,369,369,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727, +727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727, +727,727,727,727,727,727,727,727,727,727,727,727,727,727,727,727, +727,727,727,727,727,728,728,728,729,729,729,729,729,729,729,729, +728,728,729,729,729,728,729,727,727,727,727,730,730,730,730,730, +731,731,731,731,731,731,731,731,731,731,116,730,116,730,729,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 171 */ -731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -731,731,731,731,731,731,731,731,731,731,731,731,731,731,731,731, -731,731,731,731,731,731,731,731,731,731,731,732,733,732,733,733, -732,732,732,732,732,732,733,732,115,115,115,115,115,115,115,115, -734,734,734,734,734,734,734,734,734,734,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732, +732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732, +732,732,732,732,732,732,732,732,732,732,732,732,732,732,732,732, +733,734,734,735,735,735,735,735,735,734,735,734,734,733,734,735, +735,734,735,735,732,732,736,732,116,116,116,116,116,116,116,116, +737,737,737,737,737,737,737,737,737,737,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 172 */ -735,735,735,735,735,735,735,735,735,735,735,735,735,735,735,735, -735,735,735,735,735,735,735,735,735,735,115,115,115,736,736,736, -737,737,736,736,736,736,737,736,736,736,736,736,115,115,115,115, -738,738,738,738,738,738,738,738,738,738,739,739,740,740,740,741, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738, +738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,738, +738,738,738,738,738,738,738,738,738,738,738,738,738,738,738,739, +740,740,741,741,741,741,116,116,740,740,740,740,741,741,740,741, +741,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742, +742,742,742,742,742,742,742,742,738,738,738,738,741,741,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 173 */ -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742, -742,742,742,742,742,742,742,742,742,742,742,742,742,742,742,742, 743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743, 743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743, -744,744,744,744,744,744,744,744,744,744,745,745,745,745,745,745, -745,745,745,115,115,115,115,115,115,115,115,115,115,115,115,746, +743,743,743,743,743,743,743,743,743,743,743,743,743,743,743,743, +744,744,744,745,745,745,745,745,745,745,745,744,744,745,744,745, +745,746,746,746,743,116,116,116,116,116,116,116,116,116,116,116, +747,747,747,747,747,747,747,747,747,747,116,116,116,116,116,116, +373,373,373,373,373,373,373,373,373,373,373,373,373,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 174 */ -747,748,748,748,748,748,748,749,749,748,748,747,747,747,747,747, -747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, -747,747,747,747,747,747,747,747,747,747,747,747,747,747,747,747, -747,747,747,748,748,748,748,748,748,749,750,748,748,748,748,751, -751,751,751,751,751,751,751,748,115,115,115,115,115,115,115,115, -752,753,753,753,753,753,753,754,754,753,753,753,752,752,752,752, -752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752, -752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752, +748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748, +748,748,748,748,748,748,748,748,748,748,748,748,748,748,748,748, +748,748,748,748,748,748,748,748,748,748,748,749,750,749,750,750, +749,749,749,749,749,749,750,749,116,116,116,116,116,116,116,116, +751,751,751,751,751,751,751,751,751,751,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 175 */ -752,752,752,752,115,115,755,755,755,755,753,753,753,753,753,753, -753,753,753,753,753,753,753,754,753,753,756,756,756,115,756,756, -756,756,756,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757, -757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757, -757,757,757,757,757,757,757,757,757,757,757,757,757,757,757,757, -757,757,757,757,757,757,757,757,757,115,115,115,115,115,115,115, +752,752,752,752,752,752,752,752,752,752,752,752,752,752,752,752, +752,752,752,752,752,752,752,752,752,752,752,116,116,753,753,753, +754,754,753,753,753,753,754,753,753,753,753,753,116,116,116,116, +755,755,755,755,755,755,755,755,755,755,756,756,757,757,757,758, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 176 */ -758,758,758,758,758,758,758,758,758,115,758,758,758,758,758,758, -758,758,758,758,758,758,758,758,758,758,758,758,758,758,758,758, -758,758,758,758,758,758,758,758,758,758,758,758,758,758,758,759, -760,760,760,760,760,760,760,115,760,760,760,760,760,760,759,760, -758,761,761,761,761,761,115,115,115,115,115,115,115,115,115,115, -762,762,762,762,762,762,762,762,762,762,763,763,763,763,763,763, -763,763,763,763,763,763,763,763,763,763,763,763,763,115,115,115, -764,764,765,765,765,765,765,765,765,765,765,765,765,765,765,765, +759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,759, +759,759,759,759,759,759,759,759,759,759,759,759,759,759,759,759, +759,759,759,759,759,759,759,759,759,759,759,759,760,760,760,761, +761,761,761,761,761,761,761,761,760,761,761,762,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 177 */ -765,765,765,765,765,765,765,765,765,765,765,765,765,765,765,765, -115,115,766,766,766,766,766,766,766,766,766,766,766,766,766,766, -766,766,766,766,766,766,766,766,115,767,766,766,766,766,766,766, -766,767,766,766,767,766,766,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763, +763,763,763,763,763,763,763,763,763,763,763,763,763,763,763,763, +764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, +764,764,764,764,764,764,764,764,764,764,764,764,764,764,764,764, +765,765,765,765,765,765,765,765,765,765,766,766,766,766,766,766, +766,766,766,116,116,116,116,116,116,116,116,116,116,116,116,767, /* block 178 */ -768,768,768,768,768,768,768,115,768,768,115,768,768,768,768,768, +768,769,769,769,769,769,769,769,769,769,769,768,768,768,768,768, 768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768, 768,768,768,768,768,768,768,768,768,768,768,768,768,768,768,768, -768,769,769,769,769,769,769,115,115,115,769,115,769,769,115,769, -769,769,769,769,769,769,770,769,115,115,115,115,115,115,115,115, -771,771,771,771,771,771,771,771,771,771,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +768,768,768,769,769,769,769,769,769,770,771,769,769,769,769,772, +772,772,772,772,772,772,772,769,116,116,116,116,116,116,116,116, +773,774,774,774,774,774,774,775,775,774,774,774,773,773,773,773, +773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, +773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, /* block 179 */ -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, +773,773,773,773,116,116,776,776,776,776,774,774,774,774,774,774, +774,774,774,774,774,774,774,775,774,774,777,777,777,773,777,777, +777,777,777,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778, +778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778, +778,778,778,778,778,778,778,778,778,778,778,778,778,778,778,778, +778,778,778,778,778,778,778,778,778,116,116,116,116,116,116,116, /* block 180 */ -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +779,779,779,779,779,779,779,779,779,116,779,779,779,779,779,779, +779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,779, +779,779,779,779,779,779,779,779,779,779,779,779,779,779,779,780, +781,781,781,781,781,781,781,116,781,781,781,781,781,781,780,781, +779,782,782,782,782,782,116,116,116,116,116,116,116,116,116,116, +783,783,783,783,783,783,783,783,783,783,784,784,784,784,784,784, +784,784,784,784,784,784,784,784,784,784,784,784,784,116,116,116, +785,785,786,786,786,786,786,786,786,786,786,786,786,786,786,786, /* block 181 */ -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,773, -773,773,773,773,773,773,773,773,773,773,773,773,773,773,773,115, -774,774,774,774,774,115,115,115,115,115,115,115,115,115,115,115, +786,786,786,786,786,786,786,786,786,786,786,786,786,786,786,786, +116,116,787,787,787,787,787,787,787,787,787,787,787,787,787,787, +787,787,787,787,787,787,787,787,116,788,787,787,787,787,787,787, +787,788,787,787,788,787,787,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 182 */ -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,772,772,772,772,772,772,772,772,772,772,772,772, -772,772,772,772,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +789,789,789,789,789,789,789,116,789,789,116,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,789,789,789,789,789,789,789,789,789,789,789,789,789,789,789, +789,790,790,790,790,790,790,116,116,116,790,116,790,790,116,790, +790,790,790,790,790,790,791,790,116,116,116,116,116,116,116,116, +792,792,792,792,792,792,792,792,792,792,116,116,116,116,116,116, +793,793,793,793,793,793,116,793,793,116,793,793,793,793,793,793, +793,793,793,793,793,793,793,793,793,793,793,793,793,793,793,793, /* block 183 */ -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, +793,793,793,793,793,793,793,793,793,793,794,794,794,794,794,116, +795,795,116,794,794,795,794,795,793,116,116,116,116,116,116,116, +796,796,796,796,796,796,796,796,796,796,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 184 */ -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,775, -775,775,775,775,775,775,775,775,775,775,775,775,775,775,775,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, +797,797,797,798,798,799,799,800,800,116,116,116,116,116,116,116, /* block 185 */ -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, /* block 186 */ -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,776,776,776,776,776,776,776,776,776, -776,776,776,776,776,776,776,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 187 */ -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, +802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, +802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, +802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, +802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, +802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, +802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,802, +802,802,802,802,802,802,802,802,802,802,802,802,802,802,802,116, +803,803,803,803,803,116,116,116,116,116,116,116,116,116,116,116, /* block 188 */ -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,530,530,530,530,530,530,530, -530,530,530,530,530,530,530,530,530,115,115,115,115,115,115,115, -777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,777, -777,777,777,777,777,777,777,777,777,777,777,777,777,777,777,115, -778,778,778,778,778,778,778,778,778,778,115,115,115,115,779,779, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,801,801,801,801,801,801,801,801,801,801,801,801, +801,801,801,801,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 189 */ -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -780,780,780,780,780,780,780,780,780,780,780,780,780,780,780,780, -780,780,780,780,780,780,780,780,780,780,780,780,780,780,115,115, -781,781,781,781,781,782,115,115,115,115,115,115,115,115,115,115, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, /* block 190 */ -783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783, -783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783, -783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783, -784,784,784,784,784,784,784,785,785,785,785,785,786,786,786,786, -787,787,787,787,785,786,115,115,115,115,115,115,115,115,115,115, -788,788,788,788,788,788,788,788,788,788,115,789,789,789,789,789, -789,789,115,783,783,783,783,783,783,783,783,783,783,783,783,783, -783,783,783,783,783,783,783,783,115,115,115,115,115,783,783,783, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, +804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 191 */ -783,783,783,783,783,783,783,783,783,783,783,783,783,783,783,783, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, /* block 192 */ -790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, -790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, -790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, -790,790,790,790,790,790,790,790,790,790,790,790,790,790,790,790, -790,790,790,790,790,115,115,115,115,115,115,115,115,115,115,115, -790,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791, -791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,791, -791,791,791,791,791,791,791,791,791,791,791,791,791,791,791,115, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, +805,805,805,805,805,805,805,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 193 */ -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,792, -792,792,792,793,793,793,793,793,793,793,793,793,793,793,793,793, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -794,795,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, /* block 194 */ -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,538,538,538,538,538,538,538, +538,538,538,538,538,538,538,538,538,116,116,116,116,116,116,116, +806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,806, +806,806,806,806,806,806,806,806,806,806,806,806,806,806,806,116, +807,807,807,807,807,807,807,807,807,807,116,116,116,116,808,808, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 195 */ -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +809,809,809,809,809,809,809,809,809,809,809,809,809,809,809,809, +809,809,809,809,809,809,809,809,809,809,809,809,809,809,116,116, +810,810,810,810,810,811,116,116,116,116,116,116,116,116,116,116, /* block 196 */ -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,796,796,796,796,796,796,796,796,796,796,796,796,796, -796,796,796,115,115,115,115,115,115,115,115,115,115,115,115,115, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +813,813,813,813,813,813,813,814,814,814,814,814,815,815,815,815, +816,816,816,816,814,815,116,116,116,116,116,116,116,116,116,116, +817,817,817,817,817,817,817,817,817,817,116,818,818,818,818,818, +818,818,116,812,812,812,812,812,812,812,812,812,812,812,812,812, +812,812,812,812,812,812,812,812,116,116,116,116,116,812,812,812, /* block 197 */ -509,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, +812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 198 */ -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, +819,819,819,819,819,819,819,819,819,819,819,819,819,819,819,819, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, +820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, /* block 199 */ -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,507, -507,507,507,507,507,507,507,507,507,507,507,507,507,507,507,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, +821,821,821,821,821,821,821,821,821,821,821,821,821,821,821,821, +821,821,821,821,821,821,821,822,822,822,822,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 200 */ -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, +823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, +823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, +823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, +823,823,823,823,823,823,823,823,823,823,823,823,823,823,823,823, +823,823,823,823,823,116,116,116,116,116,116,116,116,116,116,116, +823,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, +824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, +824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,116, /* block 201 */ -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,797,797,797,797, -797,797,797,797,797,797,797,797,797,797,797,797,115,115,115,115, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,825, +825,825,825,826,826,826,826,826,826,826,826,826,826,826,826,826, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +827,828,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 202 */ -798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798, -798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798, -798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798, -798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798, -798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798, -798,798,798,798,798,798,798,798,798,798,798,798,798,798,798,798, -798,798,798,798,798,798,798,798,798,798,798,115,115,115,115,115, -798,798,798,798,798,798,798,798,798,798,798,798,798,115,115,115, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, /* block 203 */ -798,798,798,798,798,798,798,798,798,115,115,115,115,115,115,115, -798,798,798,798,798,798,798,798,798,798,115,115,799,800,800,801, - 22, 22, 22, 22,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 204 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,829,829,829,829,829,829,829,829,829,829,829,829,829, +829,829,829,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 205 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19,115,115, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19,802,433,110,110,110, 19, 19, 19,433,802,802, -802,802,802, 22, 22, 22, 22, 22, 22, 22, 22,110,110,110,110,110, +517,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, /* block 206 */ -110,110,110, 19, 19,110,110,110,110,110,110,110, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,110,110,110,110, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, /* block 207 */ -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,596,596,596,596,596,596,596,596,596,596,596,596,596,596, -596,596,803,803,803,596,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, +515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, /* block 208 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, /* block 209 */ -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,467,467, -467,467,467,467,467,115,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,830,830,830,830, +830,830,830,830,830,830,830,830,830,830,830,830,116,116,116,116, /* block 210 */ -466,466,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,466,115,466,466, -115,115,466,115,115,466,466,115,115,466,466,466,466,115,466,466, -466,466,466,466,466,466,467,467,467,467,115,467,115,467,467,467, -467,467,467,467,115,467,467,467,467,467,467,467,467,467,467,467, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,831,831,831,831,831, +831,831,831,831,831,831,831,831,831,831,831,116,116,116,116,116, +831,831,831,831,831,831,831,831,831,831,831,831,831,116,116,116, /* block 211 */ -467,467,467,467,466,466,115,466,466,466,466,115,115,466,466,466, -466,466,466,466,466,115,466,466,466,466,466,466,466,115,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,466,466,115,466,466,466,466,115, -466,466,466,466,466,115,466,115,115,115,466,466,466,466,466,466, -466,115,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, +831,831,831,831,831,831,831,831,831,116,116,116,116,116,116,116, +831,831,831,831,831,831,831,831,831,831,116,116,832,833,833,834, + 23, 23, 23, 23,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 212 */ -466,466,466,466,466,466,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116,116, /* block 213 */ -467,467,467,467,467,467,467,467,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19,116,116, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19,835,438,111,111,111, 19, 19, 19,438,835,835, +835,835,835, 23, 23, 23, 23, 23, 23, 23, 23,111,111,111,111,111, /* block 214 */ -466,466,466,466,466,466,466,466,466,466,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,115,115,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466, 8,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467, 8,467,467,467,467, -467,467,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466, 8,467,467,467,467, +111,111,111, 19, 19,111,111,111,111,111,111,111, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,111,111,111,111, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 215 */ -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467, 8,467,467,467,467,467,467,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466, 8,467,467,467,467,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, 8, -467,467,467,467,467,467,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, 8, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, +604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, +604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, +604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, +604,604,604,604,604,604,604,604,604,604,604,604,604,604,604,604, +604,604,836,836,836,604,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 216 */ -467,467,467,467,467,467,467,467,467, 8,467,467,467,467,467,467, -466,466,466,466,466,466,466,466,466,466,466,466,466,466,466,466, -466,466,466,466,466,466,466,466,466, 8,467,467,467,467,467,467, -467,467,467,467,467,467,467,467,467,467,467,467,467,467,467,467, -467,467,467, 8,467,467,467,467,467,467,466,467,115,115, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24,116,116,116,116,116,116,116,116,116,116,116,116, /* block 217 */ -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, -804,804,804,804,804,804,804,804,804,804,804,804,804,804,804,804, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19,116,116,116,116,116,116,116,116,116, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24,116,116,116,116,116,116,116, /* block 218 */ -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,804,804,804,804,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -805,805,805,805,805,805,805,805,805,805,805,805,805,804,804,804, -804,804,804,804,804,805,804,804,804,804,804,804,804,804,804,804, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,473,473, +473,473,473,473,473,116,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, /* block 219 */ -804,804,804,804,805,804,804,806,806,806,806,806,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,805,805,805,805,805, -115,805,805,805,805,805,805,805,805,805,805,805,805,805,805,805, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +472,472,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,472,116,472,472, +116,116,472,116,116,472,472,116,116,472,472,472,472,116,472,472, +472,472,472,472,472,472,473,473,473,473,116,473,116,473,473,473, +473,473,473,473,116,473,473,473,473,473,473,473,473,473,473,473, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, /* block 220 */ -807,807,807,807,807,807,807,115,807,807,807,807,807,807,807,807, -807,807,807,807,807,807,807,807,807,115,115,807,807,807,807,807, -807,807,115,807,807,115,807,807,807,807,807,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +473,473,473,473,472,472,116,472,472,472,472,116,116,472,472,472, +472,472,472,472,472,116,472,472,472,472,472,472,472,116,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,472,472,116,472,472,472,472,116, +472,472,472,472,472,116,472,116,116,116,472,472,472,472,472,472, +472,116,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, /* block 221 */ -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, +472,472,472,472,472,472,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, /* block 222 */ -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,808,808,808,808,808,808,808,808,808,808,808, -808,808,808,808,808,115,115,809,809,809,809,809,809,809,809,809, -810,810,810,810,810,810,810,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +473,473,473,473,473,473,473,473,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, /* block 223 */ -811,811,811,811,811,811,811,811,811,811,811,811,811,811,811,811, -811,811,811,811,811,811,811,811,811,811,811,811,811,811,811,811, -811,811,812,812,812,812,812,812,812,812,812,812,812,812,812,812, -812,812,812,812,812,812,812,812,812,812,812,812,812,812,812,812, -812,812,812,812,813,813,813,813,813,813,813,115,115,115,115,115, -814,814,814,814,814,814,814,814,814,814,115,115,115,115,815,815, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +472,472,472,472,472,472,472,472,472,472,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,116,116,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472, 8,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473, 8,473,473,473,473, +473,473,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472, 8,473,473,473,473, /* block 224 */ -216,216,216,216,115,216,216,216,216,216,216,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216, -115,216,216,115,216,115,115,216,115,216,216,216,216,216,216,216, -216,216,216,115,216,216,216,216,115,216,115,216,115,115,115,115, -115,115,216,115,115,115,115,216,115,216,115,216,115,216,216,216, -115,216,216,115,216,115,115,216,115,216,115,216,115,216,115,216, -115,216,216,115,216,115,115,216,216,216,216,115,216,216,216,216, -216,216,216,115,216,216,216,216,115,216,216,216,216,115,216,115, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473, 8,473,473,473,473,473,473,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472, 8,473,473,473,473,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, 8, +473,473,473,473,473,473,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, 8, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, /* block 225 */ -216,216,216,216,216,216,216,216,216,216,115,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,115,115,115,115, -115,216,216,216,115,216,216,216,216,216,115,216,216,216,216,216, -216,216,216,216,216,216,216,216,216,216,216,216,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -210,210,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +473,473,473,473,473,473,473,473,473, 8,473,473,473,473,473,473, +472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, +472,472,472,472,472,472,472,472,472, 8,473,473,473,473,473,473, +473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473, +473,473,473, 8,473,473,473,473,473,473,472,473,116,116, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, /* block 226 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, +837,837,837,837,837,837,837,837,837,837,837,837,837,837,837,837, /* block 227 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115, -115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -115, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115, +838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, +838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, +838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, +838,838,838,838,838,838,838,837,837,837,837,838,838,838,838,838, +838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, +838,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, +838,838,838,838,838,838,838,838,838,838,838,838,838,837,837,837, +837,837,837,837,837,838,837,837,837,837,837,837,837,837,837,837, /* block 228 */ - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +837,837,837,837,838,837,837,839,839,839,839,839,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,838,838,838,838,838, +116,838,838,838,838,838,838,838,838,838,838,838,838,838,838,838, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 229 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,816,816,816,816,816,816,816,816,816,816, -816,816,816,816,816,816,816,816,816,816,816,816,816,816,816,816, +840,840,840,840,840,840,840,116,840,840,840,840,840,840,840,840, +840,840,840,840,840,840,840,840,840,116,116,840,840,840,840,840, +840,840,116,840,840,116,840,840,840,840,840,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 230 */ -817, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115, - 19, 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, /* block 231 */ - 19, 19, 19, 19, 19, 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,479, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,841,841,841,841,841,841,841,841,841,841,841, +841,841,841,841,841,116,116,842,842,842,842,842,842,842,842,842, +843,843,843,843,843,843,843,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 232 */ - 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,479, 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19,478,478,478, 19, 19,478, 19, 19,478,478,478, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,479, 19,479, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,818,818,818,818,818, +844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,844, +844,844,844,844,844,844,844,844,844,844,844,844,844,844,844,844, +844,844,845,845,845,845,845,845,845,845,845,845,845,845,845,845, +845,845,845,845,845,845,845,845,845,845,845,845,845,845,845,845, +845,845,845,845,846,846,846,846,846,846,846,116,116,116,116,116, +847,847,847,847,847,847,847,847,847,847,116,116,116,116,848,848, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 233 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19,478,478, 19, 19,478,478,478,478,478,478,478,478,478,478, -478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19,819,819,819,819, 19, 19, 19, 19,478, 19, -478,478,478,478,478,478,478,478,478, 19, 19, 19,478, 19, 19, 19, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, /* block 234 */ - 19,478,478,478, 19,478,478,478, 19, 19, 19,479, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,479,479, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 19, 24, 24, 24, + 5, 24, 24, 24, 24,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 235 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19,479, 19, 19, 19, 19,479, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,478,478, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, +217,217,217,217,116,217,217,217,217,217,217,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217, +116,217,217,116,217,116,116,217,116,217,217,217,217,217,217,217, +217,217,217,116,217,217,217,217,116,217,116,217,116,116,116,116, +116,116,217,116,116,116,116,217,116,217,116,217,116,217,217,217, +116,217,217,116,217,116,116,217,116,217,116,217,116,217,116,217, +116,217,217,116,217,116,116,217,217,217,217,116,217,217,217,217, +217,217,217,116,217,217,217,217,116,217,217,217,217,116,217,116, /* block 236 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, -478, 19, 19, 19, 19,478,478, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19,479, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +217,217,217,217,217,217,217,217,217,217,116,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,116,116,116,116, +116,217,217,217,116,217,217,217,217,217,116,217,217,217,217,217, +217,217,217,217,217,217,217,217,217,217,217,217,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +211,211,116,116,116,116,116,116,116,116,116,116,116,116,116,116, /* block 237 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19,478,478,478, 19, 19, 19,478,478,478,478,478, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 238 */ -479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19,479, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19,478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,478,478,478, 19, 19, 19, 19, 19, 19, 19, 19, 19, -478, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,478, 19, 19, 19, - 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849, +849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +849, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849, /* block 239 */ + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,849,849,849, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115,115, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849, + 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, /* block 240 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, + 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,850,850,850,850,850,850,850,850,850,850, +850,850,850,850,850,850,850,850,850,850,850,850,850,850,850,850, /* block 241 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, +851, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, + 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19,849,849,849,849, + 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849, + 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849,849, + 20, 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, /* block 242 */ - 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, /* block 243 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19,478,478,478,478,478, 19,478,478, - 19, 19, 19, 19, 19, 19,478, 19, 19, 19, 19, 19, 19, 19, 19, 19, -478,478,478,478,478,478,478,478,478,478, 19, 19, 19,478,478,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 244 */ - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - 19,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, - 19,478,478,478,478,478,478,478,478,478,478,478,478,478, 19, 19, - 19, 19, 19, 19, 19, 19, 19,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,852,852,852,852,852, /* block 245 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, + 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 246 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,115,115,115,115,115,115,115,115,115,115,115, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, /* block 247 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,115,115, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849,849,849, /* block 248 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19,849,849,849,849,849,849,849,849,849,849,849,849, /* block 249 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 20, 20, 20, 20,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, /* block 250 */ -515,515,515,515,515,515,515,515,515,515,515,515,515,515,515,515, -515,515,515,515,515,515,515,515,515,515,515,515,515,515,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, -115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849,849, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, /* block 251 */ -465, 22,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, -820,820,820,820,820,820,820,820,820,820,820,820,820,820,820,820, + 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849,849,849,849,849, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, /* block 252 */ -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 20, 20, 20,849, + 20, 20, 20, 20, 20, 20, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20,849,849, 20, 20, 20, 20,849,849,849, 20,849, 20, 20, 20, 20, /* block 253 */ -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849,849,849,849,849, + 20, 20, 20,849,849,849,849,849,849,849,849,849,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, /* block 254 */ -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110, -465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, /* block 255 */ -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,589,589, -589,589,589,589,589,589,589,589,589,589,589,589,589,589,115,115, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,849,849, +849,849,849,849,849,849,849,849,849,849,849,849,849,849,116,116, + +/* block 256 */ +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + +/* block 257 */ +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,116,116,116,116,116,116,116,116,116,116,116, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, + +/* block 258 */ +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, + +/* block 259 */ +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, + +/* block 260 */ +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + +/* block 261 */ +523,523,523,523,523,523,523,523,523,523,523,523,523,523,523,523, +523,523,523,523,523,523,523,523,523,523,523,523,523,523,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, +116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116, + +/* block 262 */ +471, 23,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, +853,853,853,853,853,853,853,853,853,853,853,853,853,853,853,853, + +/* block 263 */ +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, + +/* block 264 */ +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, + +/* block 265 */ +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111, +471,471,471,471,471,471,471,471,471,471,471,471,471,471,471,471, + +/* block 266 */ +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,597,597, +597,597,597,597,597,597,597,597,597,597,597,597,597,597,116,116, }; diff --git a/thirdparty/pcre2/src/pcre2_ucp.h b/thirdparty/pcre2/src/pcre2_ucp.h index defba4c10e..0c330edcb2 100644 --- a/thirdparty/pcre2/src/pcre2_ucp.h +++ b/thirdparty/pcre2/src/pcre2_ucp.h @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016 University of Cambridge + New API code Copyright (c) 2016-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -100,27 +100,25 @@ enum { ucp_Zs /* Space separator */ }; -/* These are grapheme break properties. */ +/* These are grapheme break properties. The Extended Pictographic property +comes from the emoji-data.txt file. */ enum { - ucp_gbCR, /* 0 */ - ucp_gbLF, /* 1 */ - ucp_gbControl, /* 2 */ - ucp_gbExtend, /* 3 */ - ucp_gbPrepend, /* 4 */ - ucp_gbSpacingMark, /* 5 */ - ucp_gbL, /* 6 Hangul syllable type L */ - ucp_gbV, /* 7 Hangul syllable type V */ - ucp_gbT, /* 8 Hangul syllable type T */ - ucp_gbLV, /* 9 Hangul syllable type LV */ - ucp_gbLVT, /* 10 Hangul syllable type LVT */ - ucp_gbRegionalIndicator, /* 11 */ - ucp_gbOther, /* 12 */ - ucp_gbE_Base, /* 13 */ - ucp_gbE_Modifier, /* 14 */ - ucp_gbE_Base_GAZ, /* 15 */ - ucp_gbZWJ, /* 16 */ - ucp_gbGlue_After_Zwj /* 17 */ + ucp_gbCR, /* 0 */ + ucp_gbLF, /* 1 */ + ucp_gbControl, /* 2 */ + ucp_gbExtend, /* 3 */ + ucp_gbPrepend, /* 4 */ + ucp_gbSpacingMark, /* 5 */ + ucp_gbL, /* 6 Hangul syllable type L */ + ucp_gbV, /* 7 Hangul syllable type V */ + ucp_gbT, /* 8 Hangul syllable type T */ + ucp_gbLV, /* 9 Hangul syllable type LV */ + ucp_gbLVT, /* 10 Hangul syllable type LVT */ + ucp_gbRegionalIndicator, /* 11 */ + ucp_gbOther, /* 12 */ + ucp_gbZWJ, /* 13 */ + ucp_gbExtended_Pictographic /* 14 */ }; /* These are the script identifications. */ @@ -274,7 +272,15 @@ enum { ucp_Masaram_Gondi, ucp_Nushu, ucp_Soyombo, - ucp_Zanabazar_Square + ucp_Zanabazar_Square, + /* New for Unicode 11.0.0 */ + ucp_Dogra, + ucp_Gunjala_Gondi, + ucp_Hanifi_Rohingya, + ucp_Makasar, + ucp_Medefaidrin, + ucp_Old_Sogdian, + ucp_Sogdian }; #endif /* PCRE2_UCP_H_IDEMPOTENT_GUARD */ diff --git a/thirdparty/pcre2/src/sljit/sljitConfigInternal.h b/thirdparty/pcre2/src/sljit/sljitConfigInternal.h index e13282c842..f5703e8e7f 100644 --- a/thirdparty/pcre2/src/sljit/sljitConfigInternal.h +++ b/thirdparty/pcre2/src/sljit/sljitConfigInternal.h @@ -66,7 +66,7 @@ SLJIT_RETURN_ADDRESS_OFFSET : a return instruction always adds this offset to the return address Other macros: - SLJIT_FUNC : calling convention attribute for both calling JIT form C and C calling back from JIT + SLJIT_FUNC : calling convention attribute for both calling JIT from C and C calling back from JIT SLJIT_W(number) : defining 64 bit constants on 64 bit architectures (compiler independent helper) */ @@ -147,17 +147,23 @@ #define SLJIT_CONFIG_UNSUPPORTED 1 #endif -#else /* !_WIN32 */ +#else /* _WIN32 */ #if defined(_M_X64) || defined(__x86_64__) #define SLJIT_CONFIG_X86_64 1 +#elif (defined(_M_ARM) && _M_ARM >= 7 && defined(_M_ARMT)) || defined(__thumb2__) +#define SLJIT_CONFIG_ARM_THUMB2 1 +#elif (defined(_M_ARM) && _M_ARM >= 7) +#define SLJIT_CONFIG_ARM_V7 1 #elif defined(_ARM_) #define SLJIT_CONFIG_ARM_V5 1 +#elif defined(_M_ARM64) || defined(__aarch64__) +#define SLJIT_CONFIG_ARM_64 1 #else #define SLJIT_CONFIG_X86_32 1 #endif -#endif /* !WIN32 */ +#endif /* !_WIN32 */ #endif /* SLJIT_CONFIG_AUTO */ #if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED) @@ -324,6 +330,11 @@ sparc_cache_flush((from), (to)) #define SLJIT_CACHE_FLUSH_OWN_IMPL 1 +#elif defined _WIN32 + +#define SLJIT_CACHE_FLUSH(from, to) \ + FlushInstructionCache(GetCurrentProcess(), (char*)(from), (char*)(to) - (char*)(from)) + #else /* Calls __ARM_NR_cacheflush on ARM-Linux. */ @@ -371,12 +382,18 @@ typedef int sljit_sw; #define SLJIT_64BIT_ARCHITECTURE 1 #define SLJIT_WORD_SHIFT 3 #ifdef _WIN32 +#ifdef __GNUC__ +/* These types do not require windows.h */ +typedef unsigned long long sljit_uw; +typedef long long sljit_sw; +#else typedef unsigned __int64 sljit_uw; typedef __int64 sljit_sw; -#else +#endif +#else /* !_WIN32 */ typedef unsigned long int sljit_uw; typedef long int sljit_sw; -#endif +#endif /* _WIN32 */ #endif typedef sljit_uw sljit_p; @@ -590,7 +607,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_sw sljit_exec_offset(void* ptr); #define SLJIT_NUMBER_OF_REGISTERS 26 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 10 -#define SLJIT_LOCALS_OFFSET_BASE (2 * sizeof(sljit_sw)) +#define SLJIT_LOCALS_OFFSET_BASE 0 #elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC) diff --git a/thirdparty/pcre2/src/sljit/sljitExecAllocator.c b/thirdparty/pcre2/src/sljit/sljitExecAllocator.c index f5009788f6..7c18578618 100644 --- a/thirdparty/pcre2/src/sljit/sljitExecAllocator.c +++ b/thirdparty/pcre2/src/sljit/sljitExecAllocator.c @@ -99,7 +99,14 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size) void *retval; #ifdef MAP_ANON - retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); + + int flags = MAP_PRIVATE | MAP_ANON; + +#ifdef MAP_JIT + flags |= MAP_JIT; +#endif + + retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, -1, 0); #else if (dev_zero < 0) { if (open_dev_zero()) diff --git a/thirdparty/pcre2/src/sljit/sljitLir.c b/thirdparty/pcre2/src/sljit/sljitLir.c index 5e435f0154..5bdddc10cf 100644 --- a/thirdparty/pcre2/src/sljit/sljitLir.c +++ b/thirdparty/pcre2/src/sljit/sljitLir.c @@ -26,6 +26,13 @@ #include "sljitLir.h" +#ifdef _WIN32 + +/* For SLJIT_CACHE_FLUSH, which can expand to FlushInstructionCache. */ +#include <windows.h> + +#endif /* _WIN32 */ + #if !(defined SLJIT_STD_MACROS_DEFINED && SLJIT_STD_MACROS_DEFINED) /* These libraries are needed for the macros below. */ @@ -2178,7 +2185,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compil #endif -#if !(defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) +#if !(defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \ + && !(defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset) { diff --git a/thirdparty/pcre2/src/sljit/sljitLir.h b/thirdparty/pcre2/src/sljit/sljitLir.h index 920f6d4f78..e71890cf7b 100644 --- a/thirdparty/pcre2/src/sljit/sljitLir.h +++ b/thirdparty/pcre2/src/sljit/sljitLir.h @@ -138,7 +138,7 @@ of sljitConfigInternal.h */ be specified as scratch registers and the fifth one as saved register on the CPU above and any user code which requires four scratch registers can run unmodified. The SLJIT compiler automatically saves - the content of the two extra scrath register on the stack. Scratch + the content of the two extra scratch register on the stack. Scratch registers can also be preserved by saving their value on the stack but this needs to be done manually. @@ -746,7 +746,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler be mixed. The only exception is SLJIT_MOV32 and SLJIT_MOVU32 whose source register can hold any 32 or 64 bit value, and it is converted to a 32 bit compatible format first. This conversion is free (no instructions are - emitted) on most CPUs. A 32 bit value can also be coverted to a 64 bit + emitted) on most CPUs. A 32 bit value can also be converted to a 64 bit value by SLJIT_MOV_S32 (sign extension) or SLJIT_MOV_U32 (zero extension). Note: memory addressing always uses 64 bit values on 64 bit systems so @@ -773,8 +773,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler */ #define SLJIT_F32_OP SLJIT_I32_OP -/* Many CPUs (x86, ARM, PPC) has status flags which can be set according - to the result of an operation. Other CPUs (MIPS) does not have status +/* Many CPUs (x86, ARM, PPC) have status flags which can be set according + to the result of an operation. Other CPUs (MIPS) do not have status flags, and results must be stored in registers. To cover both architecture types efficiently only two flags are defined by SLJIT: @@ -810,14 +810,14 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler Using these flags can reduce the number of emitted instructions. E.g. a fast loop can be implemented by decreasing a counter register and set the - zero flag to jump back if the counter register is not reached zero. + zero flag to jump back if the counter register has not reached zero. Motivation: although CPUs can set a large number of flags, usually their values are ignored or only one of them is used. Emulating a large number of flags on systems without flag register is complicated so SLJIT instructions must specify the flag they want to use and only that flag will be emulated. The last arithmetic instruction can be repeated if - multiple flags needs to be checked. + multiple flags need to be checked. */ /* Set Zero status flag. */ @@ -884,7 +884,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile /* Starting index of opcodes for sljit_emit_op1. */ #define SLJIT_OP1_BASE 32 -/* The MOV instruction transfer data from source to destination. +/* The MOV instruction transfers data from source to destination. MOV instruction suffixes: @@ -1156,7 +1156,7 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi #define SLJIT_FAST_CALL 25 /* Called function must be declared with the SLJIT_FUNC attribute. */ #define SLJIT_CALL 26 - /* Called function must be decalred with cdecl attribute. + /* Called function must be declared with cdecl attribute. This is the default attribute for C functions. */ #define SLJIT_CALL_CDECL 27 @@ -1210,7 +1210,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_label(struct sljit_jump *jump, struct sl /* Set the destination address of the jump to this label. */ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw target); -/* Emit an indirect jump or fast call. Both direct and indirect form +/* Emit an indirect jump or fast call. Direct form: set src to SLJIT_IMM() and srcw to the address Indirect form: any other valid addressing mode type must be between SLJIT_JUMP and SLJIT_FAST_CALL @@ -1274,7 +1274,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil #define SLJIT_MEM_POST 0x1000 /* Emit a single memory load or store with update instruction. When the - requested instruction from is not supported by the CPU, it returns + requested instruction form is not supported by the CPU, it returns with SLJIT_ERR_UNSUPPORTED instead of emulating the instruction. This allows specializing tight loops based on the supported instruction forms (see SLJIT_MEM_SUPP flag). diff --git a/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c b/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c index 8a437bd6a0..27af741487 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeARM_64.c @@ -37,14 +37,14 @@ typedef sljit_u32 sljit_ins; #define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2) #define TMP_REG2 (SLJIT_NUMBER_OF_REGISTERS + 3) #define TMP_LR (SLJIT_NUMBER_OF_REGISTERS + 4) -#define TMP_SP (SLJIT_NUMBER_OF_REGISTERS + 5) +#define TMP_FP (SLJIT_NUMBER_OF_REGISTERS + 5) #define TMP_FREG1 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1) #define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2) /* r18 - platform register, currently not used */ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 8] = { - 31, 0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 8, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 29, 9, 10, 30, 31 + 31, 0, 1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 8, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 31, 9, 10, 30, 29 }; static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { @@ -68,6 +68,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define ADC 0x9a000000 #define ADD 0x8b000000 +#define ADDE 0x8b200000 #define ADDI 0x91000000 #define AND 0x8a000000 #define ANDI 0x92000000 @@ -96,7 +97,8 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define FSUB 0x1e603800 #define LDRI 0xf9400000 #define LDP 0xa9400000 -#define LDP_PST 0xa8c00000 +#define LDP_PRE 0xa9c00000 +#define LDR_PRE 0xf8400c00 #define LSLV 0x9ac02000 #define LSRV 0x9ac02400 #define MADD 0x9b000000 @@ -873,73 +875,51 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); - saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 0); - local_size += saved_regs_size + SLJIT_LOCALS_OFFSET; + saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 2); + if (saved_regs_size & 0x8) + saved_regs_size += sizeof(sljit_sw); + local_size = (local_size + 15) & ~0xf; - compiler->local_size = local_size; - - if (local_size <= (63 * sizeof(sljit_sw))) { - FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR) - | RN(TMP_SP) | ((-(local_size >> 3) & 0x7f) << 15))); - FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10))); - offs = (local_size - saved_regs_size) << (15 - 3); - } else { - offs = 0 << 15; - if (saved_regs_size & 0x8) { - offs = 1 << 15; - saved_regs_size += sizeof(sljit_sw); - } - local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET; - if (saved_regs_size > 0) - FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10))); - } + compiler->local_size = local_size + saved_regs_size; + + FAIL_IF(push_inst(compiler, STP_PRE | RT(TMP_FP) | RT2(TMP_LR) + | RN(SLJIT_SP) | ((-(saved_regs_size >> 3) & 0x7f) << 15))); + +#ifdef _WIN32 + if (local_size >= 4096) + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(SLJIT_SP) | (1 << 10) | (1 << 22))); + else if (local_size > 256) + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(SLJIT_SP) | (local_size << 10))); +#endif tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG; prev = -1; + offs = 2 << 15; for (i = SLJIT_S0; i >= tmp; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, STRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } for (i = scratches; i >= SLJIT_FIRST_SAVED_REG; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, STRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } - SLJIT_ASSERT(prev == -1); + if (prev != -1) + FAIL_IF(push_inst(compiler, STRI | RT(prev) | RN(SLJIT_SP) | (offs >> 5))); - if (compiler->local_size > (63 * sizeof(sljit_sw))) { - /* The local_size is already adjusted by the saved registers. */ - if (local_size > 0xfff) { - FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22))); - local_size &= 0xfff; - } - if (local_size) - FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10))); - FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR) - | RN(TMP_SP) | ((-(16 >> 3) & 0x7f) << 15))); - FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10))); - } + + FAIL_IF(push_inst(compiler, ADDI | RD(TMP_FP) | RN(SLJIT_SP) | (0 << 10))); args = get_arg_count(arg_types); @@ -950,6 +930,64 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi if (args >= 3) FAIL_IF(push_inst(compiler, ORR | RD(SLJIT_S2) | RN(TMP_ZERO) | RM(SLJIT_R2))); +#ifdef _WIN32 + if (local_size >= 4096) { + if (local_size < 4 * 4096) { + /* No need for a loop. */ + if (local_size >= 2 * 4096) { + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (1 << 10) | (1 << 22))); + local_size -= 4096; + } + + if (local_size >= 2 * 4096) { + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (1 << 10) | (1 << 22))); + local_size -= 4096; + } + + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + local_size -= 4096; + } + else { + FAIL_IF(push_inst(compiler, MOVZ | RD(TMP_REG2) | (((local_size >> 12) - 1) << 5))); + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (1 << 10) | (1 << 22))); + FAIL_IF(push_inst(compiler, SUBI | (1 << 29) | RD(TMP_REG2) | RN(TMP_REG2) | (1 << 10))); + FAIL_IF(push_inst(compiler, B_CC | ((((sljit_ins) -3) & 0x7ffff) << 5) | 0x1 /* not-equal */)); + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + + local_size &= 0xfff; + } + + if (local_size > 256) { + FAIL_IF(push_inst(compiler, SUBI | RD(TMP_REG1) | RN(TMP_REG1) | (local_size << 10))); + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + } + else if (local_size > 0) + FAIL_IF(push_inst(compiler, LDR_PRE | RT(TMP_ZERO) | RN(TMP_REG1) | ((-local_size & 0x1ff) << 12))); + + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_REG1) | (0 << 10))); + } + else if (local_size > 256) { + FAIL_IF(push_inst(compiler, LDRI | RT(TMP_ZERO) | RN(TMP_REG1))); + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_REG1) | (0 << 10))); + } + else if (local_size > 0) + FAIL_IF(push_inst(compiler, LDR_PRE | RT(TMP_ZERO) | RN(SLJIT_SP) | ((-local_size & 0x1ff) << 12))); + +#else /* !_WIN32 */ + + /* The local_size does not include saved registers size. */ + if (local_size > 0xfff) { + FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((local_size >> 12) << 10) | (1 << 22))); + local_size &= 0xfff; + } + if (local_size != 0) + FAIL_IF(push_inst(compiler, SUBI | RD(SLJIT_SP) | RN(SLJIT_SP) | (local_size << 10))); + +#endif /* _WIN32 */ + return SLJIT_SUCCESS; } @@ -957,13 +995,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp sljit_s32 options, sljit_s32 arg_types, sljit_s32 scratches, sljit_s32 saveds, sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size) { + sljit_s32 saved_regs_size; + CHECK_ERROR(); CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); - local_size += GET_SAVED_REGISTERS_SIZE(scratches, saveds, 0) + SLJIT_LOCALS_OFFSET; - local_size = (local_size + 15) & ~0xf; - compiler->local_size = local_size; + saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 2); + if (saved_regs_size & 0x8) + saved_regs_size += sizeof(sljit_sw); + + compiler->local_size = saved_regs_size + ((local_size + 15) & ~0xf); return SLJIT_SUCCESS; } @@ -977,71 +1019,59 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp FAIL_IF(emit_mov_before_return(compiler, op, src, srcw)); - local_size = compiler->local_size; + saved_regs_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 2); + if (saved_regs_size & 0x8) + saved_regs_size += sizeof(sljit_sw); - saved_regs_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 0); - if (local_size <= (63 * sizeof(sljit_sw))) - offs = (local_size - saved_regs_size) << (15 - 3); + local_size = compiler->local_size - saved_regs_size; + + /* Load LR as early as possible. */ + if (local_size == 0) + FAIL_IF(push_inst(compiler, LDP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); + else if (local_size < 63 * sizeof(sljit_sw)) { + FAIL_IF(push_inst(compiler, LDP_PRE | RT(TMP_FP) | RT2(TMP_LR) + | RN(SLJIT_SP) | (local_size << (15 - 3)))); + } else { - FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR) - | RN(TMP_SP) | (((16 >> 3) & 0x7f) << 15))); - offs = 0 << 15; - if (saved_regs_size & 0x8) { - offs = 1 << 15; - saved_regs_size += sizeof(sljit_sw); - } - local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET; if (local_size > 0xfff) { - FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22))); + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | ((local_size >> 12) << 10) | (1 << 22))); local_size &= 0xfff; } if (local_size) - FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10))); + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | (local_size << 10))); + + FAIL_IF(push_inst(compiler, LDP | RT(TMP_FP) | RT2(TMP_LR) | RN(SLJIT_SP))); } tmp = compiler->saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - compiler->saveds) : SLJIT_FIRST_SAVED_REG; prev = -1; + offs = 2 << 15; for (i = SLJIT_S0; i >= tmp; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, LDRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } for (i = compiler->scratches; i >= SLJIT_FIRST_SAVED_REG; i--) { if (prev == -1) { - if (!(offs & (1 << 15))) { - prev = i; - continue; - } - FAIL_IF(push_inst(compiler, LDRI | RT(i) | RN(TMP_SP) | (offs >> 5))); - offs += 1 << 15; + prev = i; continue; } - FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); + FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(SLJIT_SP) | offs)); offs += 2 << 15; prev = -1; } - SLJIT_ASSERT(prev == -1); + if (prev != -1) + FAIL_IF(push_inst(compiler, LDRI | RT(prev) | RN(SLJIT_SP) | (offs >> 5))); - if (compiler->local_size <= (63 * sizeof(sljit_sw))) { - FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR) - | RN(TMP_SP) | (((local_size >> 3) & 0x7f) << 15))); - } else if (saved_regs_size > 0) { - FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10))); - } - - FAIL_IF(push_inst(compiler, RET | RN(TMP_LR))); - return SLJIT_SUCCESS; + /* These two can be executed in parallel. */ + FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(SLJIT_SP) | (saved_regs_size << 10))); + return push_inst(compiler, RET | RN(TMP_LR)); } /* --------------------------------------------------------------------- */ @@ -1856,6 +1886,46 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compil return push_inst(compiler, inst | VT(freg) | RN(mem & REG_MASK) | ((memw & 0x1ff) << 12)); } +SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw offset) +{ + sljit_s32 dst_reg; + sljit_ins ins; + + CHECK_ERROR(); + CHECK(check_sljit_get_local_base(compiler, dst, dstw, offset)); + + SLJIT_ASSERT (SLJIT_LOCALS_OFFSET_BASE == 0); + + dst_reg = FAST_IS_REG(dst) ? dst : TMP_REG1; + + if (offset <= 0xffffff && offset >= -0xffffff) { + ins = ADDI; + if (offset < 0) { + offset = -offset; + ins = SUBI; + } + + if (offset <= 0xfff) + FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(SLJIT_SP) | (offset << 10))); + else { + FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(SLJIT_SP) | ((offset & 0xfff000) >> (12 - 10)) | (1 << 22))); + + offset &= 0xfff; + if (offset != 0) + FAIL_IF(push_inst(compiler, ins | RD(dst_reg) | RN(dst_reg) | (offset << 10))); + } + } + else { + FAIL_IF(load_immediate (compiler, dst_reg, offset)); + /* Add extended register form. */ + FAIL_IF(push_inst(compiler, ADDE | (0x3 << 13) | RD(dst_reg) | RN(SLJIT_SP) | RM(dst_reg))); + } + + if (SLJIT_UNLIKELY(dst & SLJIT_MEM)) + return emit_op_mem(compiler, WORD_SIZE | STORE, dst_reg, dst, dstw, TMP_REG1); + return SLJIT_SUCCESS; +} + SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw, sljit_sw init_value) { struct sljit_const *const_; diff --git a/thirdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c b/thirdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c index 75e7a38b5f..d7024b6d7d 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeARM_T2_32.c @@ -110,6 +110,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define ASRSI 0x1000 #define ASR_W 0xfa40f000 #define ASR_WI 0xea4f0020 +#define BCC 0xd000 #define BICI 0xf0200000 #define BKPT 0xbe00 #define BLX 0x4780 @@ -125,6 +126,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define EORS 0x4040 #define EOR_W 0xea800000 #define IT 0xbf00 +#define LDRI 0xf8500800 #define LSLS 0x4080 #define LSLSI 0x0000 #define LSL_W 0xfa00f000 @@ -158,6 +160,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define SBCI 0xf1600000 #define SBCS 0x4180 #define SBC_W 0xeb600000 +#define SDIV 0xfb90f0f0 #define SMULL 0xfb800000 #define STR_SP 0x9000 #define SUBS 0x1a00 @@ -172,6 +175,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = { #define SXTH 0xb200 #define SXTH_W 0xfa0ff080 #define TST 0x4200 +#define UDIV 0xfbb0f0f0 #define UMULL 0xfba00000 #define UXTB 0xb2c0 #define UXTB_W 0xfa5ff080 @@ -339,8 +343,8 @@ static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump, sljit_sw /* Really complex instruction form for branches. */ s = (diff >> 23) & 0x1; - j1 = (~(diff >> 21) ^ s) & 0x1; - j2 = (~(diff >> 22) ^ s) & 0x1; + j1 = (~(diff >> 22) ^ s) & 0x1; + j2 = (~(diff >> 21) ^ s) & 0x1; jump_inst[0] = 0xf000 | (s << 10) | COPY_BITS(diff, 11, 0, 10); jump_inst[1] = (j1 << 13) | (j2 << 11) | (diff & 0x7ff); @@ -520,6 +524,8 @@ static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst, { sljit_uw tmp; + /* MOVS cannot be used since it destroy flags. */ + if (imm >= 0x10000) { tmp = get_imm(imm); if (tmp != INVALID_IMM) @@ -1032,6 +1038,9 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi { sljit_s32 args, size, i, tmp; sljit_ins push = 0; +#ifdef _WIN32 + sljit_uw imm; +#endif CHECK_ERROR(); CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); @@ -1052,12 +1061,25 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 1); local_size = ((size + local_size + 7) & ~7) - size; compiler->local_size = local_size; + +#ifdef _WIN32 + if (local_size >= 256) { + if (local_size > 4096) + imm = get_imm(4096); + else + imm = get_imm(local_size & ~0xff); + + SLJIT_ASSERT(imm != INVALID_IMM); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(SLJIT_SP) | imm)); + } +#else if (local_size > 0) { if (local_size <= (127 << 2)) FAIL_IF(push_inst16(compiler, SUB_SP | (local_size >> 2))); else FAIL_IF(emit_op_imm(compiler, SLJIT_SUB | ARG2_IMM, SLJIT_SP, SLJIT_SP, local_size)); } +#endif args = get_arg_count(arg_types); @@ -1068,6 +1090,61 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi if (args >= 3) FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_S2, SLJIT_R2))); +#ifdef _WIN32 + if (local_size >= 256) { + if (local_size > 4096) { + imm = get_imm(4096); + SLJIT_ASSERT(imm != INVALID_IMM); + + if (local_size < 4 * 4096) { + if (local_size > 2 * 4096) { + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + local_size -= 4096; + } + + if (local_size > 2 * 4096) { + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + local_size -= 4096; + } + + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + local_size -= 4096; + + SLJIT_ASSERT(local_size > 0); + } + else { + FAIL_IF(load_immediate(compiler, SLJIT_R3, (local_size >> 12) - 1)); + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + SLJIT_ASSERT(reg_map[SLJIT_R3] < 7); + FAIL_IF(push_inst16(compiler, SUBSI8 | RDN3(SLJIT_R3) | 1)); + FAIL_IF(push_inst16(compiler, BCC | (0x1 << 8) /* not-equal */ | (-7 & 0xff))); + + local_size &= 0xfff; + + if (local_size != 0) + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | RT4(TMP_REG2) | RN4(TMP_REG1))); + } + + if (local_size >= 256) { + imm = get_imm(local_size & ~0xff); + SLJIT_ASSERT(imm != INVALID_IMM); + + FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); + } + } + + local_size &= 0xff; + FAIL_IF(push_inst32(compiler, LDRI | 0x400 | (local_size > 0 ? 0x100 : 0) | RT4(TMP_REG2) | RN4(TMP_REG1) | local_size)); + + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_SP, TMP_REG1))); + } + else if (local_size > 0) + FAIL_IF(push_inst32(compiler, LDRI | 0x500 | RT4(TMP_REG1) | RN4(SLJIT_SP) | local_size)); +#endif + return SLJIT_SUCCESS; } @@ -1119,11 +1196,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp /* Operators */ /* --------------------------------------------------------------------- */ +#if !(defined __ARM_FEATURE_IDIV) && !(defined __ARM_ARCH_EXT_IDIV__) + #ifdef __cplusplus extern "C" { #endif -#if defined(__GNUC__) +#ifdef _WIN32 +extern unsigned long long __rt_udiv(unsigned int denominator, unsigned int numerator); +extern long long __rt_sdiv(int denominator, int numerator); +#elif defined(__GNUC__) extern unsigned int __aeabi_uidivmod(unsigned int numerator, int unsigned denominator); extern int __aeabi_idivmod(int numerator, int denominator); #else @@ -1134,10 +1216,14 @@ extern int __aeabi_idivmod(int numerator, int denominator); } #endif +#endif /* !__ARM_FEATURE_IDIV && !__ARM_ARCH_EXT_IDIV__ */ + SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) { +#if !(defined __ARM_FEATURE_IDIV) && !(defined __ARM_ARCH_EXT_IDIV__) sljit_sw saved_reg_list[3]; sljit_sw saved_reg_count; +#endif CHECK_ERROR(); CHECK(check_sljit_emit_op0(compiler, op)); @@ -1155,6 +1241,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile | (reg_map[SLJIT_R0] << 12) | (reg_map[SLJIT_R0] << 16) | reg_map[SLJIT_R1]); +#if (defined __ARM_FEATURE_IDIV) || (defined __ARM_ARCH_EXT_IDIV__) + case SLJIT_DIVMOD_UW: + case SLJIT_DIVMOD_SW: + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG1, SLJIT_R0))); + FAIL_IF(push_inst32(compiler, (op == SLJIT_DIVMOD_UW ? UDIV : SDIV) | RD4(SLJIT_R0) | RN4(SLJIT_R0) | RM4(SLJIT_R1))); + FAIL_IF(push_inst32(compiler, MUL | RD4(SLJIT_R1) | RN4(SLJIT_R0) | RM4(SLJIT_R1))); + return push_inst32(compiler, SUB_W | RD4(SLJIT_R1) | RN4(TMP_REG1) | RM4(SLJIT_R1)); + case SLJIT_DIV_UW: + case SLJIT_DIV_SW: + return push_inst32(compiler, (op == SLJIT_DIV_UW ? UDIV : SDIV) | RD4(SLJIT_R0) | RN4(SLJIT_R0) | RM4(SLJIT_R1)); +#else /* !__ARM_FEATURE_IDIV && !__ARM_ARCH_EXT_IDIV__ */ case SLJIT_DIVMOD_UW: case SLJIT_DIVMOD_SW: case SLJIT_DIV_UW: @@ -1183,7 +1280,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile } } -#if defined(__GNUC__) +#ifdef _WIN32 + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(TMP_REG1, SLJIT_R0))); + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_R0, SLJIT_R1))); + FAIL_IF(push_inst16(compiler, MOV | SET_REGS44(SLJIT_R1, TMP_REG1))); + FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, + ((op | 0x2) == SLJIT_DIV_UW ? SLJIT_FUNC_OFFSET(__rt_udiv) : SLJIT_FUNC_OFFSET(__rt_sdiv)))); +#elif defined(__GNUC__) FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, ((op | 0x2) == SLJIT_DIV_UW ? SLJIT_FUNC_OFFSET(__aeabi_uidivmod) : SLJIT_FUNC_OFFSET(__aeabi_idivmod)))); #else @@ -1203,6 +1306,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile | (saved_reg_list[0] << 12) /* ldr rX, [sp], #8/16 */); } return SLJIT_SUCCESS; +#endif /* __ARM_FEATURE_IDIV || __ARM_ARCH_EXT_IDIV__ */ } return SLJIT_SUCCESS; diff --git a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c index 9f9e157a05..094c9923bc 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_32.c @@ -448,7 +448,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t sljit_ins ins = NOP; sljit_u8 offsets[4]; - SLJIT_ASSERT(reg_map[TMP_REG3] == 4 && freg_map[TMP_FREG1] == 12); + SLJIT_ASSERT(reg_map[TMP_REG1] == 4 && freg_map[TMP_FREG1] == 12); arg_types >>= SLJIT_DEF_SHIFT; @@ -516,7 +516,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t else if (arg_count != word_arg_count) ins = ADDU | S(word_arg_count) | TA(0) | DA(4 + (offsets[arg_count - 1] >> 2)); else if (arg_count == 1) - ins = ADDU | S(SLJIT_R0) | TA(0) | D(TMP_REG3); + ins = ADDU | S(SLJIT_R0) | TA(0) | DA(4); arg_count--; word_arg_count--; diff --git a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c index ff6f048659..f841aef5dd 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_64.c @@ -547,7 +547,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t sljit_ins prev_ins = NOP; sljit_ins ins = NOP; - SLJIT_ASSERT(reg_map[TMP_REG3] == 4 && freg_map[TMP_FREG1] == 12); + SLJIT_ASSERT(reg_map[TMP_REG1] == 4 && freg_map[TMP_FREG1] == 12); arg_types >>= SLJIT_DEF_SHIFT; @@ -591,7 +591,7 @@ static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_t if (arg_count != word_arg_count) ins = DADDU | S(word_arg_count) | TA(0) | D(arg_count); else if (arg_count == 1) - ins = DADDU | S(SLJIT_R0) | TA(0) | D(TMP_REG3); + ins = DADDU | S(SLJIT_R0) | TA(0) | DA(4); arg_count--; word_arg_count--; break; diff --git a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c index e108433f70..894e21304b 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeMIPS_common.c @@ -57,14 +57,14 @@ typedef sljit_u32 sljit_ins; #define RETURN_ADDR_REG 31 /* Flags are kept in volatile registers. */ -#define EQUAL_FLAG 31 +#define EQUAL_FLAG 3 #define OTHER_FLAG 1 #define TMP_FREG1 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1) #define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2) static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = { - 0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 3, 25, 4 + 0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 4, 25, 31 }; #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) @@ -612,16 +612,17 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi /* Frequent case. */ FAIL_IF(push_inst(compiler, ADDIU_W | S(SLJIT_SP) | T(SLJIT_SP) | IMM(-local_size), DR(SLJIT_SP))); base = S(SLJIT_SP); + offs = local_size - (sljit_sw)sizeof(sljit_sw); } else { - FAIL_IF(load_immediate(compiler, DR(TMP_REG1), local_size)); + FAIL_IF(load_immediate(compiler, DR(OTHER_FLAG), local_size)); FAIL_IF(push_inst(compiler, ADDU_W | S(SLJIT_SP) | TA(0) | D(TMP_REG2), DR(TMP_REG2))); - FAIL_IF(push_inst(compiler, SUBU_W | S(SLJIT_SP) | T(TMP_REG1) | D(SLJIT_SP), DR(SLJIT_SP))); + FAIL_IF(push_inst(compiler, SUBU_W | S(SLJIT_SP) | T(OTHER_FLAG) | D(SLJIT_SP), DR(SLJIT_SP))); base = S(TMP_REG2); local_size = 0; + offs = -(sljit_sw)sizeof(sljit_sw); } - offs = local_size - (sljit_sw)(sizeof(sljit_sw)); FAIL_IF(push_inst(compiler, STACK_STORE | base | TA(RETURN_ADDR_REG) | IMM(offs), MOVABLE_INS)); tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG; @@ -805,7 +806,8 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl if ((flags & MEM_MASK) <= GPR_REG && (flags & LOAD_DATA)) { tmp_ar = reg_ar; delay_slot = reg_ar; - } else { + } + else { tmp_ar = DR(TMP_REG1); delay_slot = MOVABLE_INS; } @@ -881,11 +883,39 @@ static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sl static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg_ar, sljit_s32 arg, sljit_sw argw) { + sljit_s32 tmp_ar, base, delay_slot; + if (getput_arg_fast(compiler, flags, reg_ar, arg, argw)) return compiler->error; - compiler->cache_arg = 0; - compiler->cache_argw = 0; - return getput_arg(compiler, flags, reg_ar, arg, argw, 0, 0); + + if ((flags & MEM_MASK) <= GPR_REG && (flags & LOAD_DATA)) { + tmp_ar = reg_ar; + delay_slot = reg_ar; + } + else { + tmp_ar = DR(TMP_REG1); + delay_slot = MOVABLE_INS; + } + base = arg & REG_MASK; + + if (SLJIT_UNLIKELY(arg & OFFS_REG_MASK)) { + argw &= 0x3; + + if (SLJIT_UNLIKELY(argw)) { + FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(arg)) | DA(tmp_ar) | SH_IMM(argw), tmp_ar)); + FAIL_IF(push_inst(compiler, ADDU_W | S(base) | TA(tmp_ar) | DA(tmp_ar), tmp_ar)); + } + else + FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(OFFS_REG(arg)) | DA(tmp_ar), tmp_ar)); + return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot); + } + + FAIL_IF(load_immediate(compiler, tmp_ar, argw)); + + if (base != 0) + FAIL_IF(push_inst(compiler, ADDU_W | S(base) | TA(tmp_ar) | DA(tmp_ar), tmp_ar)); + + return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_slot); } static SLJIT_INLINE sljit_s32 emit_op_mem2(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit_s32 arg1, sljit_sw arg1w, sljit_s32 arg2, sljit_sw arg2w) diff --git a/thirdparty/pcre2/src/sljit/sljitNativeX86_32.c b/thirdparty/pcre2/src/sljit/sljitNativeX86_32.c index 8a83e273a4..074e64b9f2 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeX86_32.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeX86_32.c @@ -123,34 +123,38 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL) if (args > 0) { - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S0] << 3) | reg_map[SLJIT_R2]; + inst[0] = MOV_r_rm; + inst[1] = MOD_REG | (reg_map[SLJIT_S0] << 3) | reg_map[SLJIT_R2]; + inst += 2; } if (args > 1) { - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S1] << 3) | reg_map[SLJIT_R1]; + inst[0] = MOV_r_rm; + inst[1] = MOD_REG | (reg_map[SLJIT_S1] << 3) | reg_map[SLJIT_R1]; + inst += 2; } if (args > 2) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | 0x4 /* esp */; - *inst++ = 0x24; - *inst++ = sizeof(sljit_sw) * (3 + 2); /* saveds >= 3 as well. */ + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | 0x4 /* esp */; + inst[2] = 0x24; + inst[3] = sizeof(sljit_sw) * (3 + 2); /* saveds >= 3 as well. */ } #else if (args > 0) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S0] << 3) | reg_map[TMP_REG1]; - *inst++ = sizeof(sljit_sw) * 2; + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S0] << 3) | reg_map[TMP_REG1]; + inst[2] = sizeof(sljit_sw) * 2; + inst += 3; } if (args > 1) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S1] << 3) | reg_map[TMP_REG1]; - *inst++ = sizeof(sljit_sw) * 3; + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S1] << 3) | reg_map[TMP_REG1]; + inst[2] = sizeof(sljit_sw) * 3; + inst += 3; } if (args > 2) { - *inst++ = MOV_r_rm; - *inst++ = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | reg_map[TMP_REG1]; - *inst++ = sizeof(sljit_sw) * 4; + inst[0] = MOV_r_rm; + inst[1] = MOD_DISP8 | (reg_map[SLJIT_S2] << 3) | reg_map[TMP_REG1]; + inst[2] = sizeof(sljit_sw) * 4; } #endif @@ -170,17 +174,36 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi compiler->local_size = local_size; #ifdef _WIN32 - if (local_size > 1024) { -#if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL) - FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size)); -#else - /* Space for a single argument. This amount is excluded when the stack is allocated below. */ - local_size -= sizeof(sljit_sw); - FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size)); - FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), - SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, sizeof(sljit_sw))); -#endif - FAIL_IF(sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARG1(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack))); + if (local_size > 0) { + if (local_size <= 4 * 4096) { + if (local_size > 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096); + if (local_size > 2 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 2); + if (local_size > 3 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 3); + } + else { + EMIT_MOV(compiler, SLJIT_R0, 0, SLJIT_SP, 0); + EMIT_MOV(compiler, SLJIT_R1, 0, SLJIT_IMM, (local_size - 1) >> 12); + + SLJIT_ASSERT (reg_map[SLJIT_R0] == 0); + + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_R0), -4096); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_R0, 0, SLJIT_R0, 0, SLJIT_IMM, 4096)); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_R1, 0, SLJIT_R1, 0, SLJIT_IMM, 1)); + + inst = (sljit_u8*)ensure_buf(compiler, 1 + 2); + FAIL_IF(!inst); + + INC_SIZE(2); + inst[0] = JNE_i8; + inst[1] = (sljit_s8) -16; + } + + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -local_size); } #endif diff --git a/thirdparty/pcre2/src/sljit/sljitNativeX86_64.c b/thirdparty/pcre2/src/sljit/sljitNativeX86_64.c index 635ebd087c..8506565614 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeX86_64.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeX86_64.c @@ -83,6 +83,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size)); set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); + compiler->mode32 = 0; + #ifdef _WIN64 /* Two/four register slots for parameters plus space for xmm6 register if needed. */ if (fscratches >= 6 || fsaveds >= 1) @@ -126,35 +128,39 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi #ifndef _WIN64 if (args > 0) { - *inst++ = REX_W; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x7 /* rdi */; + inst[0] = REX_W; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x7 /* rdi */; + inst += 3; } if (args > 1) { - *inst++ = REX_W | REX_R; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_lmap[SLJIT_S1] << 3) | 0x6 /* rsi */; + inst[0] = REX_W | REX_R; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_lmap[SLJIT_S1] << 3) | 0x6 /* rsi */; + inst += 3; } if (args > 2) { - *inst++ = REX_W | REX_R; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_lmap[SLJIT_S2] << 3) | 0x2 /* rdx */; + inst[0] = REX_W | REX_R; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_lmap[SLJIT_S2] << 3) | 0x2 /* rdx */; } #else if (args > 0) { - *inst++ = REX_W; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x1 /* rcx */; + inst[0] = REX_W; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S0] << 3) | 0x1 /* rcx */; + inst += 3; } if (args > 1) { - *inst++ = REX_W; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S1] << 3) | 0x2 /* rdx */; + inst[0] = REX_W; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S1] << 3) | 0x2 /* rdx */; + inst += 3; } if (args > 2) { - *inst++ = REX_W | REX_B; - *inst++ = MOV_r_rm; - *inst++ = MOD_REG | (reg_map[SLJIT_S2] << 3) | 0x0 /* r8 */; + inst[0] = REX_W | REX_B; + inst[1] = MOV_r_rm; + inst[2] = MOD_REG | (reg_map[SLJIT_S2] << 3) | 0x0 /* r8 */; } #endif } @@ -163,58 +169,42 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi compiler->local_size = local_size; #ifdef _WIN64 - if (local_size > 1024) { - /* Allocate stack for the callback, which grows the stack. */ - inst = (sljit_u8*)ensure_buf(compiler, 1 + 4 + (3 + sizeof(sljit_s32))); - FAIL_IF(!inst); - INC_SIZE(4 + (3 + sizeof(sljit_s32))); - *inst++ = REX_W; - *inst++ = GROUP_BINARY_83; - *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP]; - /* Allocated size for registers must be divisible by 8. */ - SLJIT_ASSERT(!(saved_register_size & 0x7)); - /* Aligned to 16 byte. */ - if (saved_register_size & 0x8) { - *inst++ = 5 * sizeof(sljit_sw); - local_size -= 5 * sizeof(sljit_sw); - } else { - *inst++ = 4 * sizeof(sljit_sw); - local_size -= 4 * sizeof(sljit_sw); - } - /* Second instruction */ - SLJIT_ASSERT(reg_map[SLJIT_R0] < 8); - *inst++ = REX_W; - *inst++ = MOV_rm_i32; - *inst++ = MOD_REG | reg_lmap[SLJIT_R0]; - sljit_unaligned_store_s32(inst, local_size); -#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \ - || (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS) - compiler->skip_checks = 1; -#endif - FAIL_IF(sljit_emit_icall(compiler, SLJIT_CALL, SLJIT_ARG1(SW), SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack))); - } -#endif - if (local_size > 0) { - if (local_size <= 127) { - inst = (sljit_u8*)ensure_buf(compiler, 1 + 4); - FAIL_IF(!inst); - INC_SIZE(4); - *inst++ = REX_W; - *inst++ = GROUP_BINARY_83; - *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP]; - *inst++ = local_size; + if (local_size <= 4 * 4096) { + if (local_size > 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096); + if (local_size > 2 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 2); + if (local_size > 3 * 4096) + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -4096 * 3); } else { - inst = (sljit_u8*)ensure_buf(compiler, 1 + 7); + EMIT_MOV(compiler, SLJIT_R0, 0, SLJIT_SP, 0); + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, (local_size - 1) >> 12); + + SLJIT_ASSERT (reg_map[SLJIT_R0] == 0); + + EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_MEM1(SLJIT_R0), -4096); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_R0, 0, SLJIT_R0, 0, SLJIT_IMM, 4096)); + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + TMP_REG1, 0, TMP_REG1, 0, SLJIT_IMM, 1)); + + inst = (sljit_u8*)ensure_buf(compiler, 1 + 2); FAIL_IF(!inst); - INC_SIZE(7); - *inst++ = REX_W; - *inst++ = GROUP_BINARY_81; - *inst++ = MOD_REG | SUB | reg_map[SLJIT_SP]; - sljit_unaligned_store_s32(inst, local_size); - inst += sizeof(sljit_s32); + + INC_SIZE(2); + inst[0] = JNE_i8; + inst[1] = (sljit_s8) -19; } + + EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -local_size); + } +#endif + + if (local_size > 0) { + FAIL_IF(emit_non_cum_binary(compiler, BINARY_OPCODE(SUB), + SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, local_size)); } #ifdef _WIN64 diff --git a/thirdparty/pcre2/src/sljit/sljitNativeX86_common.c b/thirdparty/pcre2/src/sljit/sljitNativeX86_common.c index ab7b36adb2..6f02ee3e8b 100644 --- a/thirdparty/pcre2/src/sljit/sljitNativeX86_common.c +++ b/thirdparty/pcre2/src/sljit/sljitNativeX86_common.c @@ -669,23 +669,6 @@ static SLJIT_INLINE sljit_s32 emit_sse2_store(struct sljit_compiler *compiler, static SLJIT_INLINE sljit_s32 emit_sse2_load(struct sljit_compiler *compiler, sljit_s32 single, sljit_s32 dst, sljit_s32 src, sljit_sw srcw); -#ifdef _WIN32 -#include <malloc.h> - -static void SLJIT_FUNC sljit_grow_stack(sljit_sw local_size) -{ - /* Workaround for calling the internal _chkstk() function on Windows. - This function touches all 4k pages belongs to the requested stack space, - which size is passed in local_size. This is necessary on Windows where - the stack can only grow in 4k steps. However, this function just burn - CPU cycles if the stack is large enough. However, you don't know it in - advance, so it must always be called. I think this is a bad design in - general even if it has some reasons. */ - *(volatile sljit_s32*)alloca(local_size) = 0; -} - -#endif - #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) #include "sljitNativeX86_32.c" #else diff --git a/thirdparty/tinyexr/tinyexr.h b/thirdparty/tinyexr/tinyexr.h index b3a7ee00c2..3c19391850 100644 --- a/thirdparty/tinyexr/tinyexr.h +++ b/thirdparty/tinyexr/tinyexr.h @@ -274,6 +274,12 @@ extern int LoadEXR(float **out_rgba, int *width, int *height, const char *filename, const char **err); // @deprecated { to be removed. } +// Simple wrapper API for ParseEXRHeaderFromFile. +// checking given file is a EXR file(by just look up header) +// @return TINYEXR_SUCCEES for EXR image, TINYEXR_ERROR_INVALID_HEADER for others +extern int IsEXR(const char *filename); + +// @deprecated { to be removed. } // Saves single-frame OpenEXR image. Assume EXR image contains RGB(A) channels. // components must be 1(Grayscale), 3(RGB) or 4(RGBA). // Input image format is: `float x width x height`, or `float x RGB(A) x width x @@ -6998,6 +7004,10 @@ static void swap2(unsigned short *val) { #endif } +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" +#endif static void cpy4(int *dst_val, const int *src_val) { unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val); const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val); @@ -7028,6 +7038,10 @@ static void cpy4(float *dst_val, const float *src_val) { dst[3] = src[3]; } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + static void swap4(unsigned int *val) { #ifdef MINIZ_LITTLE_ENDIAN (void)val; @@ -8840,7 +8854,8 @@ static bool getCode(int po, int rlc, long long &c, int &lc, const char *&in, if (out + cs > oe) return false; // Bounds check for safety - if ((out - 1) <= ob) return false; + // Issue 100. + if ((out - 1) < ob) return false; unsigned short s = out[-1]; while (cs-- > 0) *out++ = s; @@ -10721,6 +10736,15 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, int data_width = exr_header->data_window[2] - exr_header->data_window[0] + 1; int data_height = exr_header->data_window[3] - exr_header->data_window[1] + 1; + if ((data_width < 0) || (data_height < 0)) { + if (err) { + std::stringstream ss; + ss << "Invalid data width or data height: " << data_width << ", " << data_height << std::endl; + (*err) += ss.str(); + } + return TINYEXR_ERROR_INVALID_DATA; + } + size_t num_blocks = offsets.size(); std::vector<size_t> channel_offset_list; @@ -10816,6 +10840,17 @@ static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header, } } else { // scanline format + // Don't allow too large image(256GB * pixel_data_size or more). Workaround for #104. + size_t data_len = size_t(data_width) * size_t(data_height) * size_t(num_channels); + if ((data_len == 0) || (data_len >= 0x4000000000)) { + if (err) { + std::stringstream ss; + ss << "Image data size is zero or too large: width = " << data_width << ", height = " << data_height << ", channels = " << num_channels << std::endl; + (*err) += ss.str(); + } + return TINYEXR_ERROR_INVALID_DATA; + } + exr_image->images = tinyexr::AllocateImage( num_channels, exr_header->channels, exr_header->requested_pixel_types, data_width, data_height); @@ -11155,7 +11190,6 @@ int LoadEXR(float **out_rgba, int *width, int *height, const char *filename, static_cast<size_t>(exr_image.height))); if (exr_header.tiled) { - // todo.implement this for (int it = 0; it < exr_image.num_tiles; it++) { for (int j = 0; j < exr_header.tile_size_y; j++) { @@ -11284,6 +11318,17 @@ int LoadEXR(float **out_rgba, int *width, int *height, const char *filename, return TINYEXR_SUCCESS; } +int IsEXR(const char *filename) { + EXRVersion exr_version; + + int ret = ParseEXRVersionFromFile(&exr_version, filename); + if (ret != TINYEXR_SUCCESS) { + return TINYEXR_ERROR_INVALID_HEADER; + } + + return TINYEXR_SUCCESS; +} + int ParseEXRHeaderFromMemory(EXRHeader *exr_header, const EXRVersion *version, const unsigned char *memory, size_t size, const char **err) { @@ -11380,75 +11425,128 @@ int LoadEXRFromMemory(float **out_rgba, int *width, int *height, } } - if (idxR == -1) { - tinyexr::SetErrorMessage("R channel not found", err); - - // @todo { free exr_image } - return TINYEXR_ERROR_INVALID_DATA; - } - - if (idxG == -1) { - tinyexr::SetErrorMessage("G channel not found", err); - // @todo { free exr_image } - return TINYEXR_ERROR_INVALID_DATA; - } + // TODO(syoyo): Refactor removing same code as used in LoadEXR(). + if (exr_header.num_channels == 1) { + // Grayscale channel only. - if (idxB == -1) { - tinyexr::SetErrorMessage("B channel not found", err); - // @todo { free exr_image } - return TINYEXR_ERROR_INVALID_DATA; - } + (*out_rgba) = reinterpret_cast<float *>( + malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) * + static_cast<size_t>(exr_image.height))); - (*out_rgba) = reinterpret_cast<float *>( - malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) * - static_cast<size_t>(exr_image.height))); + if (exr_header.tiled) { - if (exr_header.tiled) { - for (int it = 0; it < exr_image.num_tiles; it++) { - for (int j = 0; j < exr_header.tile_size_y; j++) - for (int i = 0; i < exr_header.tile_size_x; i++) { - const int ii = - exr_image.tiles[it].offset_x * exr_header.tile_size_x + i; - const int jj = - exr_image.tiles[it].offset_y * exr_header.tile_size_y + j; - const int idx = ii + jj * exr_image.width; + for (int it = 0; it < exr_image.num_tiles; it++) { + for (int j = 0; j < exr_header.tile_size_y; j++) { + for (int i = 0; i < exr_header.tile_size_x; i++) { + const int ii = + exr_image.tiles[it].offset_x * exr_header.tile_size_x + i; + const int jj = + exr_image.tiles[it].offset_y * exr_header.tile_size_y + j; + const int idx = ii + jj * exr_image.width; - // out of region check. - if (ii >= exr_image.width) { - continue; - } - if (jj >= exr_image.height) { - continue; - } - const int srcIdx = i + j * exr_header.tile_size_x; - unsigned char **src = exr_image.tiles[it].images; - (*out_rgba)[4 * idx + 0] = - reinterpret_cast<float **>(src)[idxR][srcIdx]; - (*out_rgba)[4 * idx + 1] = - reinterpret_cast<float **>(src)[idxG][srcIdx]; - (*out_rgba)[4 * idx + 2] = - reinterpret_cast<float **>(src)[idxB][srcIdx]; - if (idxA != -1) { + // out of region check. + if (ii >= exr_image.width) { + continue; + } + if (jj >= exr_image.height) { + continue; + } + const int srcIdx = i + j * exr_header.tile_size_x; + unsigned char **src = exr_image.tiles[it].images; + (*out_rgba)[4 * idx + 0] = + reinterpret_cast<float **>(src)[0][srcIdx]; + (*out_rgba)[4 * idx + 1] = + reinterpret_cast<float **>(src)[0][srcIdx]; + (*out_rgba)[4 * idx + 2] = + reinterpret_cast<float **>(src)[0][srcIdx]; (*out_rgba)[4 * idx + 3] = - reinterpret_cast<float **>(src)[idxA][srcIdx]; - } else { - (*out_rgba)[4 * idx + 3] = 1.0; + reinterpret_cast<float **>(src)[0][srcIdx]; } } + } + } else { + for (int i = 0; i < exr_image.width * exr_image.height; i++) { + const float val = reinterpret_cast<float **>(exr_image.images)[0][i]; + (*out_rgba)[4 * i + 0] = val; + (*out_rgba)[4 * i + 1] = val; + (*out_rgba)[4 * i + 2] = val; + (*out_rgba)[4 * i + 3] = val; + } } + } else { - for (int i = 0; i < exr_image.width * exr_image.height; i++) { - (*out_rgba)[4 * i + 0] = - reinterpret_cast<float **>(exr_image.images)[idxR][i]; - (*out_rgba)[4 * i + 1] = - reinterpret_cast<float **>(exr_image.images)[idxG][i]; - (*out_rgba)[4 * i + 2] = - reinterpret_cast<float **>(exr_image.images)[idxB][i]; - if (idxA != -1) { - (*out_rgba)[4 * i + 3] = - reinterpret_cast<float **>(exr_image.images)[idxA][i]; - } else { - (*out_rgba)[4 * i + 3] = 1.0; + // TODO(syoyo): Support non RGBA image. + + if (idxR == -1) { + tinyexr::SetErrorMessage("R channel not found", err); + + // @todo { free exr_image } + return TINYEXR_ERROR_INVALID_DATA; + } + + if (idxG == -1) { + tinyexr::SetErrorMessage("G channel not found", err); + // @todo { free exr_image } + return TINYEXR_ERROR_INVALID_DATA; + } + + if (idxB == -1) { + tinyexr::SetErrorMessage("B channel not found", err); + // @todo { free exr_image } + return TINYEXR_ERROR_INVALID_DATA; + } + + (*out_rgba) = reinterpret_cast<float *>( + malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) * + static_cast<size_t>(exr_image.height))); + + if (exr_header.tiled) { + for (int it = 0; it < exr_image.num_tiles; it++) { + for (int j = 0; j < exr_header.tile_size_y; j++) + for (int i = 0; i < exr_header.tile_size_x; i++) { + const int ii = + exr_image.tiles[it].offset_x * exr_header.tile_size_x + i; + const int jj = + exr_image.tiles[it].offset_y * exr_header.tile_size_y + j; + const int idx = ii + jj * exr_image.width; + + // out of region check. + if (ii >= exr_image.width) { + continue; + } + if (jj >= exr_image.height) { + continue; + } + const int srcIdx = i + j * exr_header.tile_size_x; + unsigned char **src = exr_image.tiles[it].images; + (*out_rgba)[4 * idx + 0] = + reinterpret_cast<float **>(src)[idxR][srcIdx]; + (*out_rgba)[4 * idx + 1] = + reinterpret_cast<float **>(src)[idxG][srcIdx]; + (*out_rgba)[4 * idx + 2] = + reinterpret_cast<float **>(src)[idxB][srcIdx]; + if (idxA != -1) { + (*out_rgba)[4 * idx + 3] = + reinterpret_cast<float **>(src)[idxA][srcIdx]; + } else { + (*out_rgba)[4 * idx + 3] = 1.0; + } + } + } + } else { + for (int i = 0; i < exr_image.width * exr_image.height; i++) { + (*out_rgba)[4 * i + 0] = + reinterpret_cast<float **>(exr_image.images)[idxR][i]; + (*out_rgba)[4 * i + 1] = + reinterpret_cast<float **>(exr_image.images)[idxG][i]; + (*out_rgba)[4 * i + 2] = + reinterpret_cast<float **>(exr_image.images)[idxB][i]; + if (idxA != -1) { + (*out_rgba)[4 * i + 3] = + reinterpret_cast<float **>(exr_image.images)[idxA][i]; + } else { + (*out_rgba)[4 * i + 3] = 1.0; + } } } } diff --git a/version.py b/version.py index 17be155464..3d7def727d 100644 --- a/version.py +++ b/version.py @@ -1,6 +1,7 @@ short_name = "godot" name = "Godot Engine" major = 3 -minor = 1 -status = "beta" +minor = 2 +status = "dev" module_config = "" +year = 2019 |