zemu 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/zemu/config.rb +312 -0
- data/lib/zemu/instance.rb +179 -0
- data/lib/zemu.rb +172 -0
- data/src/debug.c +118 -0
- data/src/debug.h +30 -0
- data/src/external/Z/API/Z/ABIs/generic/allocator.h +36 -0
- data/src/external/Z/API/Z/ABIs/generic/cipher.h +47 -0
- data/src/external/Z/API/Z/ABIs/generic/data codec.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/emulation.h +103 -0
- data/src/external/Z/API/Z/ABIs/generic/hash function.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/module.h +33 -0
- data/src/external/Z/API/Z/ABIs/generic/wave codec.h +40 -0
- data/src/external/Z/API/Z/classes/base/InitializerList.hpp +34 -0
- data/src/external/Z/API/Z/classes/base/OpaqueFunctionPointer.hpp +26 -0
- data/src/external/Z/API/Z/classes/base/OpaqueMemberFunctionPointer.hpp +26 -0
- data/src/external/Z/API/Z/classes/base/Pair.hpp +46 -0
- data/src/external/Z/API/Z/classes/base/Range.hpp +111 -0
- data/src/external/Z/API/Z/classes/base/SizedString.hpp +66 -0
- data/src/external/Z/API/Z/classes/base/Status.hpp +89 -0
- data/src/external/Z/API/Z/classes/base/Symbol.hpp +39 -0
- data/src/external/Z/API/Z/classes/base/Tuple.hpp +111 -0
- data/src/external/Z/API/Z/classes/base/Value2D.hpp +389 -0
- data/src/external/Z/API/Z/classes/base/Value3D.hpp +368 -0
- data/src/external/Z/API/Z/classes/buffering/RingBuffer.hpp +93 -0
- data/src/external/Z/API/Z/classes/buffering/TripleBuffer.hpp +68 -0
- data/src/external/Z/API/Z/classes/functional/Functor.hpp +265 -0
- data/src/external/Z/API/Z/classes/functional/MemberFunction.hpp +98 -0
- data/src/external/Z/API/Z/classes/functional/ObjectMemberFunction.hpp +172 -0
- data/src/external/Z/API/Z/classes/functional/ObjectSelector.hpp +219 -0
- data/src/external/Z/API/Z/classes/functional/Selector.hpp +146 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABB.hpp +81 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABR.hpp +685 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Box.hpp +219 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Circle.hpp +80 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line2D.hpp +93 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line3D.hpp +80 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Rectangle.hpp +675 -0
- data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Sphere.hpp +0 -0
- data/src/external/Z/API/Z/classes/memory/Shared.hpp +90 -0
- data/src/external/Z/API/Z/constants/base.h +35 -0
- data/src/external/Z/API/Z/constants/chemical elements.h +6385 -0
- data/src/external/Z/API/Z/constants/numbers.h +963 -0
- data/src/external/Z/API/Z/constants/version.h +15 -0
- data/src/external/Z/API/Z/formats/character set/ASCII.h +158 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP437.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP737.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP775.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP850.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP852.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP855.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP857.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP858.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP860.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP861.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP862.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP863.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP864.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP865.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP866.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP869.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP872.h +159 -0
- data/src/external/Z/API/Z/formats/character set/DOS CP874.h +159 -0
- data/src/external/Z/API/Z/formats/character set/Unicode.h +30119 -0
- data/src/external/Z/API/Z/formats/data model/I16LP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/ILP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/ILP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/IP16L32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LLP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LP32.h +19 -0
- data/src/external/Z/API/Z/formats/data model/LP64.h +19 -0
- data/src/external/Z/API/Z/formats/data model/SILP64.h +19 -0
- data/src/external/Z/API/Z/formats/file system/FAT12.h +61 -0
- data/src/external/Z/API/Z/formats/floating-point/IEEE 754.h +141 -0
- data/src/external/Z/API/Z/formats/floating-point/x87.h +74 -0
- data/src/external/Z/API/Z/formats/image/ICNS.h +39 -0
- data/src/external/Z/API/Z/formats/keymap/Mac OS.h +284 -0
- data/src/external/Z/API/Z/formats/keymap/Z.h +141 -0
- data/src/external/Z/API/Z/formats/multimedia/Creative Voice.h +106 -0
- data/src/external/Z/API/Z/formats/multimedia/Microsoft Wave.h +49 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ACH.h +44 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/FRZ.h +54 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/PRG.h +33 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SEM.h +46 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SIT.h +34 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNA.h +117 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNP.h +37 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SP.h +62 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/Z80.h +117 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX.h +56 -0
- data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX82.h +70 -0
- data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/UNIF.h +26 -0
- data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/iNES.h +76 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/TAP.h +25 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/TZX.h +1185 -0
- data/src/external/Z/API/Z/formats/storage medium image/audio/Warajevo TAP.h +32 -0
- data/src/external/Z/API/Z/formats/storage medium image/floppy disk/FDI.h +45 -0
- data/src/external/Z/API/Z/functions/base/Z2D.h +583 -0
- data/src/external/Z/API/Z/functions/base/Z3D.h +712 -0
- data/src/external/Z/API/Z/functions/base/ZRange.h +137 -0
- data/src/external/Z/API/Z/functions/base/all.h +16 -0
- data/src/external/Z/API/Z/functions/base/casting.hpp +37 -0
- data/src/external/Z/API/Z/functions/base/character.h +38 -0
- data/src/external/Z/API/Z/functions/base/constructors.h +326 -0
- data/src/external/Z/API/Z/functions/base/structure.hpp +26 -0
- data/src/external/Z/API/Z/functions/base/type.hpp +60 -0
- data/src/external/Z/API/Z/functions/base/value.h +1901 -0
- data/src/external/Z/API/Z/functions/base/value.hpp +112 -0
- data/src/external/Z/API/Z/functions/buffering/ZRingBuffer.h +85 -0
- data/src/external/Z/API/Z/functions/buffering/ZTripleBuffer.h +65 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z2DLine.h +179 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z3DLine.h +168 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABB.h +361 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABR.h +1081 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZBox.h +340 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZCircle.h +142 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZRectangle.h +1267 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZSphere.h +156 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/all.h +18 -0
- data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/constructors.h +620 -0
- data/src/external/Z/API/Z/functions/time/date.h +29 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/6502.h +90 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/Z80.h +245 -0
- data/src/external/Z/API/Z/hardware/CPU/architecture/i4004.h +37 -0
- data/src/external/Z/API/Z/hardware/PSG/General Instrument/AY-3-891x.h +180 -0
- data/src/external/Z/API/Z/hardware/VDC/Ricoh/RP2C0x.h +625 -0
- data/src/external/Z/API/Z/hardware/bus/AGP.h +24 -0
- data/src/external/Z/API/Z/hardware/bus/USB.h +510 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Inves Spectrum +.h +47 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Pentagon.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Scorpion.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum + 128K.h +158 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +.h +82 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2A.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +3.h +13 -0
- data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum.h +109 -0
- data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (NTSC).h +29 -0
- data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (PAL).h +29 -0
- data/src/external/Z/API/Z/hardware/machine/platform/computer/ZX Spectrum.h +405 -0
- data/src/external/Z/API/Z/hardware/machine/platform/console/Game Boy.h +49 -0
- data/src/external/Z/API/Z/hardware/machine/platform/console/Nintendo Entertainment System.h +350 -0
- data/src/external/Z/API/Z/hardware/storage medium/ROM cartridge/SNES Game Pak.h +238 -0
- data/src/external/Z/API/Z/inspection/C/completion.h +178 -0
- data/src/external/Z/API/Z/inspection/C/modules/C11.h +41 -0
- data/src/external/Z/API/Z/inspection/C/modules/C18.h +13 -0
- data/src/external/Z/API/Z/inspection/C/modules/C89.h +19 -0
- data/src/external/Z/API/Z/inspection/C/modules/C90.h +13 -0
- data/src/external/Z/API/Z/inspection/C/modules/C94.h +15 -0
- data/src/external/Z/API/Z/inspection/C/modules/C99.h +29 -0
- data/src/external/Z/API/Z/inspection/C/modules/KR C.h +19 -0
- data/src/external/Z/API/Z/inspection/C++/completion.h +512 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++03.h +15 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++11.h +80 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++14.h +26 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++17.h +55 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++85.h +11 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++89.h +13 -0
- data/src/external/Z/API/Z/inspection/C++/modules/C++98.h +17 -0
- data/src/external/Z/API/Z/inspection/C++.h +78 -0
- data/src/external/Z/API/Z/inspection/C.h +79 -0
- data/src/external/Z/API/Z/inspection/CPU/completion.h +56 -0
- data/src/external/Z/API/Z/inspection/CPU/detection.h +714 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/6502.h +25 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/AArch32.h +32 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/AArch64.h +32 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/Z80.h +26 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/x86-32.h +31 -0
- data/src/external/Z/API/Z/inspection/CPU/modules/x86-64.h +312 -0
- data/src/external/Z/API/Z/inspection/CPU.h +209 -0
- data/src/external/Z/API/Z/inspection/OS/completion.h +36 -0
- data/src/external/Z/API/Z/inspection/OS/detection.h +768 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Linux.h +22 -0
- data/src/external/Z/API/Z/inspection/OS/modules/MS-DOS.h +16 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Mac OS X.h +23 -0
- data/src/external/Z/API/Z/inspection/OS/modules/Windows.h +19 -0
- data/src/external/Z/API/Z/inspection/OS/modules/iPhone OS.h +23 -0
- data/src/external/Z/API/Z/inspection/OS.h +236 -0
- data/src/external/Z/API/Z/inspection/Objective-C/completion.h +8 -0
- data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v1.0.h +11 -0
- data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v2.0.h +15 -0
- data/src/external/Z/API/Z/inspection/Objective-C.h +51 -0
- data/src/external/Z/API/Z/inspection/Z.h +19 -0
- data/src/external/Z/API/Z/inspection/build.h +22 -0
- data/src/external/Z/API/Z/inspection/character set.h +66 -0
- data/src/external/Z/API/Z/inspection/compiler/completion.h +2885 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Apple LLVM.h +26 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Clang.h +1664 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/GCC.h +1366 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/SCCZ80.h +473 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/Visual C++.h +606 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/cc65.h +529 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/generic.h +13 -0
- data/src/external/Z/API/Z/inspection/compiler/modules/template.h +650 -0
- data/src/external/Z/API/Z/inspection/compiler.h +299 -0
- data/src/external/Z/API/Z/inspection/data model/completion.h +128 -0
- data/src/external/Z/API/Z/inspection/data model/deduction.h +9 -0
- data/src/external/Z/API/Z/inspection/data model/detection.h +45 -0
- data/src/external/Z/API/Z/inspection/data model.h +362 -0
- data/src/external/Z/API/Z/inspection/floating-point/completion.h +50 -0
- data/src/external/Z/API/Z/inspection/floating-point.h +324 -0
- data/src/external/Z/API/Z/inspection/language.h +163 -0
- data/src/external/Z/API/Z/inspection/platform/detection.h +9 -0
- data/src/external/Z/API/Z/inspection/platform.h +29 -0
- data/src/external/Z/API/Z/keys/C++.h +27 -0
- data/src/external/Z/API/Z/keys/C.h +29 -0
- data/src/external/Z/API/Z/keys/CPU.h +80 -0
- data/src/external/Z/API/Z/keys/OS.h +182 -0
- data/src/external/Z/API/Z/keys/Objective-C.h +17 -0
- data/src/external/Z/API/Z/keys/chemistry.h +26 -0
- data/src/external/Z/API/Z/keys/compiler.h +178 -0
- data/src/external/Z/API/Z/keys/data model.h +32 -0
- data/src/external/Z/API/Z/keys/endianness.h +24 -0
- data/src/external/Z/API/Z/keys/language.h +21 -0
- data/src/external/Z/API/Z/keys/layout.h +20 -0
- data/src/external/Z/API/Z/keys/mathematics/geometry.h +29 -0
- data/src/external/Z/API/Z/keys/mathematics/number.h +21 -0
- data/src/external/Z/API/Z/keys/order.h +18 -0
- data/src/external/Z/API/Z/keys/platform.h +87 -0
- data/src/external/Z/API/Z/keys/program.h +39 -0
- data/src/external/Z/API/Z/keys/science/chemical elements.h +200 -0
- data/src/external/Z/API/Z/keys/science/electricity.h +18 -0
- data/src/external/Z/API/Z/keys/science/magnetism.h +19 -0
- data/src/external/Z/API/Z/keys/status.h +69 -0
- data/src/external/Z/API/Z/keys/text.h +27 -0
- data/src/external/Z/API/Z/keys/value.h +88 -0
- data/src/external/Z/API/Z/macros/arguments.h +25 -0
- data/src/external/Z/API/Z/macros/casting.h +22 -0
- data/src/external/Z/API/Z/macros/character.h +159 -0
- data/src/external/Z/API/Z/macros/date.h +14 -0
- data/src/external/Z/API/Z/macros/key.h +20 -0
- data/src/external/Z/API/Z/macros/language.h +126 -0
- data/src/external/Z/API/Z/macros/language.hpp +81 -0
- data/src/external/Z/API/Z/macros/members.h +86 -0
- data/src/external/Z/API/Z/macros/pasting.h +308 -0
- data/src/external/Z/API/Z/macros/pointer.h +33 -0
- data/src/external/Z/API/Z/macros/repetition.h +283 -0
- data/src/external/Z/API/Z/macros/structure.h +104 -0
- data/src/external/Z/API/Z/macros/templating.h +407 -0
- data/src/external/Z/API/Z/macros/tokens.h +14 -0
- data/src/external/Z/API/Z/macros/type enumeration.h +43 -0
- data/src/external/Z/API/Z/macros/type selection.hpp +76 -0
- data/src/external/Z/API/Z/macros/value.h +489 -0
- data/src/external/Z/API/Z/macros/variadic pasting.h +21 -0
- data/src/external/Z/API/Z/macros/variadic selection.h +56 -0
- data/src/external/Z/API/Z/macros/variadic.h +46 -0
- data/src/external/Z/API/Z/macros/version.h +17 -0
- data/src/external/Z/API/Z/network/3/IP.h +36 -0
- data/src/external/Z/API/Z/network/4/TCP.h +24 -0
- data/src/external/Z/API/Z/network/4/UDP.h +26 -0
- data/src/external/Z/API/Z/network/7/ED2K.h +104 -0
- data/src/external/Z/API/Z/network/7/HTTP.h +100 -0
- data/src/external/Z/API/Z/traits/SelectType.hpp +71 -0
- data/src/external/Z/API/Z/traits/TernaryType.hpp +20 -0
- data/src/external/Z/API/Z/traits/Type.hpp +4516 -0
- data/src/external/Z/API/Z/traits/TypeCount.hpp +52 -0
- data/src/external/Z/API/Z/traits/TypeList.hpp +376 -0
- data/src/external/Z/API/Z/traits/base.hpp +19 -0
- data/src/external/Z/API/Z/traits/filtering.hpp +30 -0
- data/src/external/Z/API/Z/traits/mathematics.hpp +48 -0
- data/src/external/Z/API/Z/types/arguments.h +19 -0
- data/src/external/Z/API/Z/types/base.h +1655 -0
- data/src/external/Z/API/Z/types/base.hpp +169 -0
- data/src/external/Z/API/Z/types/buffering.h +27 -0
- data/src/external/Z/API/Z/types/mathematics.h +135 -0
- data/src/external/Z/API/Z/types/time.h +23 -0
- data/src/external/Z/COPYING.LESSER +165 -0
- data/src/external/Z/development/Qt Creator/Z.pro +253 -0
- data/src/external/Z/distribution/CocoaPods/Zeta.podspec +18 -0
- data/src/external/Z/distribution/Gentoo Linux/Zeta-0.1.ebuild +22 -0
- data/src/external/Z/distribution/Gentoo Linux/metadata.xml +8 -0
- data/src/external/Z/distribution/Homebrew/Zeta.rb +11 -0
- data/src/external/z80/API/emulation/CPU/Z80.h +201 -0
- data/src/external/z80/README.md +229 -0
- data/src/external/z80/building/premake4.lua +33 -0
- data/src/external/z80/development/Xcode/Z80.xcodeproj/project.pbxproj +520 -0
- data/src/external/z80/sources/Z80.c +1660 -0
- data/src/interrupt.c +6 -0
- data/src/interrupt.h +3 -0
- data/src/io.c.erb +115 -0
- data/src/io.h.erb +18 -0
- data/src/main.c +69 -0
- data/src/memory.c.erb +43 -0
- data/src/memory.h.erb +9 -0
- metadata +329 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
/* Z Kit - network/3/IP.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_network_3_IP_H_
|
9
|
+
#define _Z_network_3_IP_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
Z_DEFINE_STRICT_UNION (
|
14
|
+
zuint32 value;
|
15
|
+
) ZIPv4;
|
16
|
+
|
17
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
18
|
+
zuint8 version :4;
|
19
|
+
zuint8 header_size :4;
|
20
|
+
zuint8 differenciated_services :8;
|
21
|
+
|
22
|
+
|
23
|
+
zuint8 version_and_header_lenght;
|
24
|
+
zuint8 service_type;
|
25
|
+
zuint16 total_size;
|
26
|
+
zuint16 identification;
|
27
|
+
zuint8 flags_and_fragment_offset;
|
28
|
+
zuint8 time_to_live;
|
29
|
+
zuint8 protocol;
|
30
|
+
zuint8 header_checksum;
|
31
|
+
ZIPv4 source;
|
32
|
+
ZIPv4 destination;
|
33
|
+
zuint32 options;
|
34
|
+
) ZIPv4Header;
|
35
|
+
|
36
|
+
#endif /* _Z_network_3_IP_H_ */
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/* Z Kit - network/4/TCP.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_network_4_TCP_H_
|
9
|
+
#define _Z_network_4_TCP_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
typedef Z_STRICT_STRUCTURE (
|
14
|
+
zuint16 source_port;
|
15
|
+
zuint16 destination_port;
|
16
|
+
zuint32 sequence_number;
|
17
|
+
zuint64 acknowledgment_number;
|
18
|
+
zuint16 state; /* WIP */
|
19
|
+
zuint16 window_size;
|
20
|
+
zuint16 checksum;
|
21
|
+
zuint16 urgent_pointer;
|
22
|
+
) ZTCPHeader;
|
23
|
+
|
24
|
+
#endif /* _Z_network_4_TCP_H_ */
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/* Z Kit - network/4/UDP.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_network_4_UDP_H_
|
9
|
+
#define _Z_network_4_UDP_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
typedef Z_STRICT_STRUCTURE (
|
14
|
+
zuint32 source_address;
|
15
|
+
zuint32 destination_address;
|
16
|
+
zuint8 zeros;
|
17
|
+
zuint8 protocol;
|
18
|
+
zuint16 udp_length;
|
19
|
+
zuint16 source_port;
|
20
|
+
zuint16 destination_port;
|
21
|
+
zuint16 size;
|
22
|
+
zuint16 checksum;
|
23
|
+
zuint32 data;
|
24
|
+
) ZUDPPseudoHeader;
|
25
|
+
|
26
|
+
#endif /* _Z_network_4_UDP_H_ */
|
@@ -0,0 +1,104 @@
|
|
1
|
+
/* Z Kit - Z/network/7/ED2K.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_network_7_ED2K_H_
|
9
|
+
#define _Z_network_7_ED2K_H_
|
10
|
+
|
11
|
+
#include <Z/types/base.h>
|
12
|
+
|
13
|
+
Z_DEFINE_STRICT_STRUCTURE (
|
14
|
+
zuint8 protocol;
|
15
|
+
zuint32 size;
|
16
|
+
zuint8 opcode;
|
17
|
+
) ZED2KMessageHeader;
|
18
|
+
|
19
|
+
#define Z_ED2K_MESSAGE_HEADER_PROTOCOL_EDONKEY 0xE3
|
20
|
+
#define Z_ED2K_MESSAGE_HEADER_PROTOCOL_EMULE 0xC5
|
21
|
+
|
22
|
+
/* client <-> server (TCP) */
|
23
|
+
|
24
|
+
#define Z_ED2K_OPCODE_LOGINREQUEST 0x01 /* <HASH 16><ID 4><PORT 2><1 Tag_set> */
|
25
|
+
#define Z_ED2K_OPCODE_REJECT 0x05 /* (null) */
|
26
|
+
#define Z_ED2K_OPCODE_GETSERVERLIST 0x14 /* (null)client->server */
|
27
|
+
#define Z_ED2K_OPCODE_OFFERFILES 0x15 /* <count 4>(<HASH 16><ID 4><PORT 2><1 Tag_set>)[count] */
|
28
|
+
#define Z_ED2K_OPCODE_SEARCHREQUEST 0x16 /* <Query_Tree> */
|
29
|
+
#define Z_ED2K_OPCODE_DISCONNECT 0x18 /* (not verified) */
|
30
|
+
#define Z_ED2K_OPCODE_GETSOURCES 0x19 /* <HASH 16> */
|
31
|
+
#define Z_ED2K_OPCODE_SEARCH_USER 0x1A /* <Query_Tree> */
|
32
|
+
#define Z_ED2K_OPCODE_CALLBACKREQUEST 0x1C /* <ID 4> */
|
33
|
+
#define Z_ED2K_OPCODE_QUERY_CHATS 0x1D /* (deprecated not supported by server any longer) */
|
34
|
+
#define Z_ED2K_OPCODE_CHAT_MESSAGE 0x1E /* (deprecated not supported by server any longer) */
|
35
|
+
#define Z_ED2K_OPCODE_JOIN_ROOM 0x1F /* (deprecated not supported by server any longer) */
|
36
|
+
#define Z_ED2K_OPCODE_QUERY_MORE_RESULT 0x21 /* (null) */
|
37
|
+
#define Z_ED2K_OPCODE_GETSOURCES_OBFU 0x23
|
38
|
+
#define Z_ED2K_OPCODE_SERVERLIST 0x32 /* <count 1>(<IP 4><PORT 2>)[count] server->client */
|
39
|
+
#define Z_ED2K_OPCODE_SEARCHRESULT 0x33 /* <count 4>(<HASH 16><ID 4><PORT 2><1 Tag_set>)[count] */
|
40
|
+
#define Z_ED2K_OPCODE_SERVERSTATUS 0x34 /* <USER 4><FILES 4> */
|
41
|
+
#define Z_ED2K_OPCODE_CALLBACKREQUESTED 0x35 /* <IP 4><PORT 2> */
|
42
|
+
#define Z_ED2K_OPCODE_CALLBACK_FAIL 0x36 /* (null notverified) */
|
43
|
+
#define Z_ED2K_OPCODE_SERVERMESSAGE 0x38 /* <len 2><Message len> */
|
44
|
+
#define Z_ED2K_OPCODE_CHAT_ROOM_REQUEST 0x39 /* (deprecated not supported by server any longer) */
|
45
|
+
#define Z_ED2K_OPCODE_CHAT_BROADCAST 0x3A /* (deprecated not supported by server any longer) */
|
46
|
+
#define Z_ED2K_OPCODE_CHAT_USER_JOIN 0x3B /* (deprecated not supported by server any longer) */
|
47
|
+
#define Z_ED2K_OPCODE_CHAT_USER_LEAVE 0x3C /* (deprecated not supported by server any longer) */
|
48
|
+
#define Z_ED2K_OPCODE_CHAT_USER 0x3D /* (deprecated not supported by server any longer) */
|
49
|
+
#define Z_ED2K_OPCODE_IDCHANGE 0x40 /* <NEW_ID 4><server_flags 4><primary_tcp_port 4 (unused)><client_IP_address 4> */
|
50
|
+
#define Z_ED2K_OPCODE_SERVERIDENT 0x41 /* <HASH 16><IP 4><PORT 2>{1 TAG_SET} */
|
51
|
+
#define Z_ED2K_OPCODE_FOUNDSOURCES 0x42 /* <HASH 16><count 1>(<ID 4><PORT 2>)[count] */
|
52
|
+
#define Z_ED2K_OPCODE_USERS_LIST 0x43 /* <count 4>(<HASH 16><ID 4><PORT 2><1 Tag_set>)[count] */
|
53
|
+
#define Z_ED2K_OPCODE_FOUNDSOURCES_OBFU 0x44 /* <HASH 16><count 1>(<ID 4><PORT 2><obf settings 1>(UserHash16 if obf&0x08))[count] */
|
54
|
+
|
55
|
+
/* client <-> server (UDP) */
|
56
|
+
|
57
|
+
#define Z_ED2K_OPCODE_GLOBSEARCHREQ3 0x90 /* <1 tag set><search_tree> */
|
58
|
+
#define Z_ED2K_OPCODE_GLOBSEARCHREQ2 0x92 /* <search_tree> */
|
59
|
+
#define Z_ED2K_OPCODE_GLOBSERVSTATREQ 0x96 /* (null) */
|
60
|
+
#define Z_ED2K_OPCODE_GLOBSERVSTATRES 0x97 /* <USER 4><FILES 4> */
|
61
|
+
#define Z_ED2K_OPCODE_GLOBSEARCHREQ 0x98 /* <search_tree> */
|
62
|
+
#define Z_ED2K_OPCODE_GLOBSEARCHRES 0x99
|
63
|
+
#define Z_ED2K_OPCODE_GLOBGETSOURCES 0x9A /* <HASH 16> */
|
64
|
+
#define Z_ED2K_OPCODE_GLOBGETSOURCES2 0x94 /* <HASH 16><FILESIZE 4> */
|
65
|
+
#define Z_ED2K_OPCODE_GLOBFOUNDSOURCES 0x9B
|
66
|
+
#define Z_ED2K_OPCODE_GLOBCALLBACKREQ 0x9C /* <IP 4><PORT 2><client_ID 4> */
|
67
|
+
#define Z_ED2K_OPCODE_INVALID_LOWID 0x9E /* <ID 4> */
|
68
|
+
#define Z_ED2K_OPCODE_SERVER_LIST_REQ 0xA0 /* <IP 4><PORT 2> */
|
69
|
+
#define Z_ED2K_OPCODE_SERVER_LIST_RES 0xA1 /* <count 1> (<ip 4><port 2>)[count] */
|
70
|
+
#define Z_ED2K_OPCODE_SERVER_DESC_REQ 0xA2 /* (null) */
|
71
|
+
#define Z_ED2K_OPCODE_SERVER_DESC_RES 0xA3 /* <name_len 2><name name_len><desc_len 2 desc_en> */
|
72
|
+
#define Z_ED2K_OPCODE_SERVER_LIST_REQ2 0xA4 /* (null) */
|
73
|
+
|
74
|
+
/* client <-> client (TCP)*/
|
75
|
+
|
76
|
+
#define Z_ED2K_OPCODE_HELLO 0x01 /* 0x10<HASH 16><ID 4><PORT 2><1 Tag_set> */
|
77
|
+
#define Z_ED2K_OPCODE_SENDINGPART 0x46 /* <HASH 16><von 4><bis 4><Daten len:(von-bis)> */
|
78
|
+
#define Z_ED2K_OPCODE_REQUESTPARTS 0x47 /* <HASH 16><von[3] 4*3><bis[3] 4*3> */
|
79
|
+
#define Z_ED2K_OPCODE_FILEREQANSNOFIL 0x48 /* <HASH 16> */
|
80
|
+
#define Z_ED2K_OPCODE_END_OF_DOWNLOAD 0x49 /* <HASH 16> */
|
81
|
+
#define Z_ED2K_OPCODE_ASKSHAREDFILES 0x4A /* (null) */
|
82
|
+
#define Z_ED2K_OPCODE_ASKSHAREDFILESANSWER 0x4B /* <count 4>(<HASH 16><ID 4><PORT 2><1 Tag_set>)[count] */
|
83
|
+
#define Z_ED2K_OPCODE_HELLOANSWER 0x4C /* <HASH 16><ID 4><PORT 2><1 Tag_set><SERVER_IP 4><SERVER_PORT 2> */
|
84
|
+
#define Z_ED2K_OPCODE_CHANGE_CLIENT_ID 0x4D /* <ID_old 4><ID_new 4> */
|
85
|
+
#define Z_ED2K_OPCODE_MESSAGE 0x4E /* <len 2><Message len> */
|
86
|
+
#define Z_ED2K_OPCODE_SETREQFILEID 0x4F /* <HASH 16> */
|
87
|
+
#define Z_ED2K_OPCODE_FILESTATUS 0x50 /* <HASH 16><count 2><status(bit array) len:((count+7)/8)> */
|
88
|
+
#define Z_ED2K_OPCODE_HASHSETREQUEST 0x51 /* <HASH 16> */
|
89
|
+
#define Z_ED2K_OPCODE_HASHSETANSWER 0x52 /* <count 2><HASH[count] 16*count> */
|
90
|
+
#define Z_ED2K_OPCODE_STARTUPLOADREQ 0x54 /* <HASH 16> */
|
91
|
+
#define Z_ED2K_OPCODE_ACCEPTUPLOADREQ 0x55 /* (null) */
|
92
|
+
#define Z_ED2K_OPCODE_CANCELTRANSFER 0x56 /* (null) */
|
93
|
+
#define Z_ED2K_OPCODE_OUTOFPARTREQS 0x57 /* (null) */
|
94
|
+
#define Z_ED2K_OPCODE_REQUESTFILENAME 0x58 /* <HASH 16> (more correctly file_name_request) */
|
95
|
+
#define Z_ED2K_OPCODE_REQFILENAMEANSWER 0x59 /* <HASH 16><len 4><NAME len> */
|
96
|
+
#define Z_ED2K_OPCODE_CHANGE_SLOT 0x5B /* <HASH 16> */
|
97
|
+
#define Z_ED2K_OPCODE_QUEUERANK 0x5C /* <wert 4> (slot index of the request) */
|
98
|
+
#define Z_ED2K_OPCODE_ASKSHAREDDIRS 0x5D /* (null) */
|
99
|
+
#define Z_ED2K_OPCODE_ASKSHAREDFILESDIR 0x5E /* <len 2><Directory len> */
|
100
|
+
#define Z_ED2K_OPCODE_ASKSHAREDDIRSANS 0x5F /* <count 4>(<len 2><Directory len>)[count] */
|
101
|
+
#define Z_ED2K_OPCODE_ASKSHAREDFILESDIRANS 0x60 /* <len 2><Directory len><count 4>(<HASH 16><ID 4><PORT 2><1 Tag_set>)[count] */
|
102
|
+
#define Z_ED2K_OPCODE_ASKSHAREDDENIEDANS 0x61 /* (null) */
|
103
|
+
|
104
|
+
#endif /* _Z_network_7_ED2K_H_ */
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/* Z Kit - Z/network/7/HTTP.h
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_network_7_HTTP_H_
|
9
|
+
#define _Z_network_7_HTTP_H_
|
10
|
+
|
11
|
+
/* MARK: - Ports */
|
12
|
+
|
13
|
+
#define Z_HTTP_DEFAULT_SERVER_PORT 80
|
14
|
+
|
15
|
+
/* MARK: - Status: Informational */
|
16
|
+
|
17
|
+
#define Z_HTTP_STATUS_CONTINUE 100
|
18
|
+
#define Z_HTTP_STATUS_SWITCHING_PROTOCOLS 101
|
19
|
+
#define Z_HTTP_STATUS_PROCESSING 102 /* WebDAV, RFC 2518 */
|
20
|
+
|
21
|
+
/* MARK: - Status: Success */
|
22
|
+
|
23
|
+
#define Z_HTTP_STATUS_OK 200
|
24
|
+
#define Z_HTTP_STATUS_CREATED 201
|
25
|
+
#define Z_HTTP_STATUS_ACCEPTED 202
|
26
|
+
#define Z_HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION 203
|
27
|
+
#define Z_HTTP_STATUS_NO_CONTENT 204
|
28
|
+
#define Z_HTTP_STATUS_RESET_CONTENT 205
|
29
|
+
#define Z_HTTP_STATUS_PARTIAL_CONTENT 206
|
30
|
+
#define Z_HTTP_STATUS_MULTI_STATUS 207 /* WebDAV, RFC 4918 */
|
31
|
+
#define Z_HTTP_STATUS_ALREADY_REPORTED 208 /* WebDAV, RFC 5842 */
|
32
|
+
#define Z_HTTP_STATUS_IM_USED 226 /* RFC 3229 */
|
33
|
+
|
34
|
+
/* MARK: - Status: Redirection */
|
35
|
+
|
36
|
+
#define Z_HTTP_STATUS_MULTIPLE_CHOICES 300
|
37
|
+
#define Z_HTTP_STATUS_MOVED_PERMANENTLY 301
|
38
|
+
#define Z_HTTP_STATUS_FOUND 302
|
39
|
+
#define Z_HTTP_STATUS_SEE_OTHER 303 /* v1.1 */
|
40
|
+
#define Z_HTTP_STATUS_NOT_MODIFIED 304
|
41
|
+
#define Z_HTTP_STATUS_USE_PROXY 305 /* v1.1 */
|
42
|
+
#define Z_HTTP_STATUS_SWITCH_PROXY 306
|
43
|
+
#define Z_HTTP_STATUS_TEMPORARY_REDIRECT 307 /* v1.1 */
|
44
|
+
#define Z_HTTP_STATUS_PERMANENT_REDIRECT 308 /* Experimental Internet draft */
|
45
|
+
|
46
|
+
/* MARK: - Status: Client error */
|
47
|
+
|
48
|
+
#define Z_HTTP_STATUS_BAD_REQUEST 400
|
49
|
+
#define Z_HTTP_STATUS_UNAUTHORIZED 401
|
50
|
+
#define Z_HTTP_STATUS_PAYMENT_REQUIRED 402 /* Reserved for future use by the forces of the dark side */
|
51
|
+
#define Z_HTTP_STATUS_FORBIDDEN 403
|
52
|
+
#define Z_HTTP_STATUS_NOT_FOUND 404
|
53
|
+
#define Z_HTTP_STATUS_METHOD_NOT_ALLOWED 405
|
54
|
+
#define Z_HTTP_STATUS_NOT_ACCEPTABLE 406
|
55
|
+
#define Z_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED 407
|
56
|
+
#define Z_HTTP_STATUS_REQUEST_TIME_OUT 408
|
57
|
+
#define Z_HTTP_STATUS_CONFLICT 409
|
58
|
+
#define Z_HTTP_STATUS_GONE 410
|
59
|
+
#define Z_HTTP_STATUS_LENGTH_REQUIRED 411
|
60
|
+
#define Z_HTTP_STATUS_PRECONDITION_FAILED 412
|
61
|
+
#define Z_HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE 413
|
62
|
+
#define Z_HTTP_STATUS_REQUEST_URI_TOO_LONG 414
|
63
|
+
#define Z_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE 415
|
64
|
+
#define Z_HTTP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE 416
|
65
|
+
#define Z_HTTP_STATUS_EXPECTATION_FAILED 417
|
66
|
+
#define Z_HTTP_STATUS_I_AM_A_TEAPOT 418 /* RFC 2324 */
|
67
|
+
#define Z_HTTP_STATUS_ENHANCE_YOUR_CALM 420 /* Twitter */
|
68
|
+
#define Z_HTTP_STATUS_UNPROCESSABLE_ENTITY 422 /* WebDAV, RFC 4918 */
|
69
|
+
#define Z_HTTP_STATUS_LOCKED 423 /* WebDAV, RFC 4918 */
|
70
|
+
#define Z_HTTP_STATUS_FAILED_DEPENDENCY 424 /* WebDAV, RFC 4918 */
|
71
|
+
#define Z_HTTP_STATUS_METHOD_FAILURE 424 /* WebDAV */
|
72
|
+
#define Z_HTTP_STATUS_UNORDERED_COLLECTION 425 /* WebDAV Internet draft */
|
73
|
+
#define Z_HTTP_STATUS_UPGRADE_REQUIRED 426 /* RFC 2817 */
|
74
|
+
#define Z_HTTP_STATUS_PRECONDITION_REQUIRED 428 /* RFC 6585 */
|
75
|
+
#define Z_HTTP_STATUS_TOO_MANY_REQUESTS 429 /* RFC 6585 */
|
76
|
+
#define Z_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE 431 /* RFC 6585 */
|
77
|
+
#define Z_HTTP_STATUS_NO_RESPONSE 444 /* Nginx */
|
78
|
+
#define Z_HTTP_STATUS_RETRY_WITH 449 /* Microsoft */
|
79
|
+
#define Z_HTTP_STATUS_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450 /* Microsoft */
|
80
|
+
#define Z_HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS 451 /* Internet draft */
|
81
|
+
#define Z_HTTP_STATUS_CLIENT_CLOSED_REQUEST 499 /* Nginx */
|
82
|
+
|
83
|
+
/* MARK: - Status: Server error */
|
84
|
+
|
85
|
+
#define Z_HTTP_STATUS_INTERNAL_SERVER_ERROR 500
|
86
|
+
#define Z_HTTP_STATUS_NOT_IMPLEMENTED 501
|
87
|
+
#define Z_HTTP_STATUS_BAD_GATEWAY 502
|
88
|
+
#define Z_HTTP_STATUS_SERVICE_UNAVAILABLE 503
|
89
|
+
#define Z_HTTP_STATUS_GATEWAY_TIME_OUT 504
|
90
|
+
#define Z_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED 505
|
91
|
+
#define Z_HTTP_STATUS_VARIANT_ALSO_NEGOTIATES 506 /* RFC 2295 */
|
92
|
+
#define Z_HTTP_STATUS_INSUFICIENT_STORAGE 507 /* WebDAV, RFC 4918 */
|
93
|
+
#define Z_HTTP_STATUS_LOOP_DETECTED 508 /* WebDAV, RFC 5842 */
|
94
|
+
#define Z_HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED 509 /* Apache bw/limited extension */
|
95
|
+
#define Z_HTTP_STATUS_NOT_EXTENDED 510 /* RFC 2774 */
|
96
|
+
#define Z_HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED 511 /* RFC 6585 */
|
97
|
+
#define Z_HTTP_STATUS_NETWORK_READ_TIME_OUT_ERROR 598 /* Microsoft HTTP proxies */
|
98
|
+
#define Z_HTTP_STATUS_NETWORK_CONNECT_TIME_OUT_ERROR 599 /* Microsoft HTTP proxies */
|
99
|
+
|
100
|
+
#endif /* _Z_network_7_HTTP_H_ */
|
@@ -0,0 +1,71 @@
|
|
1
|
+
/* Z Kit - traits/SelectType.hpp
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_traits_SelectType_HPP_
|
9
|
+
#define _Z_traits_SelectType_HPP_
|
10
|
+
|
11
|
+
#include <Z/types/base.hpp>
|
12
|
+
|
13
|
+
#if Z_LANGUAGE_HAS(CPP, VARIADIC_TEMPLATE) && Z_LANGUAGE_HAS(CPP, TEMPLATE_ALIAS)
|
14
|
+
# define Z_HAS_TRAIT_ALIAS_select_type TRUE
|
15
|
+
#else
|
16
|
+
# define Z_HAS_TRAIT_ALIAS_select_type FALSE
|
17
|
+
#endif
|
18
|
+
|
19
|
+
#if Z_LANGUAGE_HAS(CPP, VARIADIC_TEMPLATE)
|
20
|
+
|
21
|
+
namespace Zeta {
|
22
|
+
|
23
|
+
template <UInt I, class T0 = NaT, class... T> struct SelectType {
|
24
|
+
typedef typename SelectType<I - 1, T...>::type type;
|
25
|
+
};
|
26
|
+
|
27
|
+
template <class T0, class... T> struct SelectType<0, T0, T...> {
|
28
|
+
typedef T0 type;
|
29
|
+
};
|
30
|
+
|
31
|
+
# if Z_LANGUAGE_HAS(CPP, TEMPLATE_ALIAS)
|
32
|
+
template <UInt I, class... T> using select_type = typename SelectType<I, T...>::type;
|
33
|
+
# endif
|
34
|
+
}
|
35
|
+
|
36
|
+
#else
|
37
|
+
|
38
|
+
# include <Z/macros/repetition.h>
|
39
|
+
# include <Z/macros/tokens.h>
|
40
|
+
|
41
|
+
namespace Zeta {
|
42
|
+
|
43
|
+
template <UInt,
|
44
|
+
class T00 = NaT, class T01 = NaT, class T02 = NaT, class T03 = NaT,
|
45
|
+
class T04 = NaT, class T05 = NaT, class T06 = NaT, class T07 = NaT,
|
46
|
+
class T08 = NaT, class T09 = NaT, class T10 = NaT, class T11 = NaT,
|
47
|
+
class T12 = NaT, class T13 = NaT, class T14 = NaT, class T15 = NaT,
|
48
|
+
class T16 = NaT, class T17 = NaT, class T18 = NaT, class T19 = NaT,
|
49
|
+
class T20 = NaT, class T21 = NaT, class T22 = NaT, class T23 = NaT,
|
50
|
+
class T24 = NaT, class T25 = NaT, class T26 = NaT, class T27 = NaT,
|
51
|
+
class T28 = NaT, class T29 = NaT, class T30 = NaT, class T31 = NaT
|
52
|
+
> struct SelectType {};
|
53
|
+
|
54
|
+
# define Z_TEMPLATE_SPECIALIZATION(type_count, index) \
|
55
|
+
template <Z_FOR_##type_count##_APPEND_INDEX(class T, Z_COMMA)> \
|
56
|
+
struct SelectType<index, Z_FOR_##type_count##_APPEND_INDEX(T, Z_COMMA)> { \
|
57
|
+
typedef T##index type; \
|
58
|
+
};
|
59
|
+
|
60
|
+
# define Z_TEMPLATE_SPECIALIZATION_GROUP(type_count) \
|
61
|
+
Z_FOR_##type_count##_CALL_WITH_TOKEN_AND_INDEX(Z_TEMPLATE_SPECIALIZATION, type_count, Z_EMPTY)
|
62
|
+
|
63
|
+
Z_FOR_32_CALL_WITH_INDEX(Z_TEMPLATE_SPECIALIZATION_GROUP, Z_EMPTY)
|
64
|
+
|
65
|
+
# undef Z_TEMPLATE_SPECIALIZATION_GROUP
|
66
|
+
# undef Z_TEMPLATE_SPECIALIZATION
|
67
|
+
}
|
68
|
+
|
69
|
+
#endif
|
70
|
+
|
71
|
+
#endif // _Z_traits_SelectType_HPP_
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/* Z Kit - traits/TernaryType.hpp
|
2
|
+
_____ _______________
|
3
|
+
/_ /_/ -_/_ _/ _ |
|
4
|
+
/____/\___/ /__//___/_| Kit
|
5
|
+
Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
|
6
|
+
Released under the terms of the GNU Lesser General Public License v3. */
|
7
|
+
|
8
|
+
#ifndef _Z_traits_TernaryType_HPP_
|
9
|
+
#define _Z_traits_TernaryType_HPP_
|
10
|
+
|
11
|
+
#include <Z/types/base.hpp>
|
12
|
+
|
13
|
+
namespace Zeta {
|
14
|
+
template <Boolean condition, class if_true, class if_false> struct TernaryType;
|
15
|
+
|
16
|
+
template <class A, class B> struct TernaryType<true, A, B> {typedef A type;};
|
17
|
+
template <class A, class B> struct TernaryType<false, A, B> {typedef B type;};
|
18
|
+
}
|
19
|
+
|
20
|
+
#endif // _Z_traits_TernaryType_HPP_
|