code
stringlengths
3
10M
language
stringclasses
31 values
/** * The package provides the functionaly to loading and manage a collection of properties * * Copyright: (c) 2015-2016, Milofon Project. * License: Subject to the terms of the BSD license, as written in the included LICENSE.txt file. * Authors: Maksim Galanin */ module proped; public { version(Have_sdlang_d) import proped.loaders.sdl : SDLPropertiesLoader; version(Have_dyaml_dlang_tour) import proped.loaders.yaml : YAMLPropertiesLoader; import proped.loaders.json : JSONPropertiesLoader; import proped.loaders.properties : PropertiesPropertiesLoader; import proped.properties : Properties, PropNode; import proped.loader : PropertiesLoader, loadProperties, Loader, createPropertiesLoader; import proped.exception : PropertiesException, PropertiesNotFoundException; }
D
/Users/noah-vincenznoeh/Desktop/Financial-Smart-Contracts/target/wasm32-unknown-unknown/release/deps/libtiny_keccak-c91b04eee2b6c0a6.rlib: /Users/noah-vincenznoeh/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-keccak-1.4.2/src/lib.rs /Users/noah-vincenznoeh/Desktop/Financial-Smart-Contracts/target/wasm32-unknown-unknown/release/deps/tiny_keccak-c91b04eee2b6c0a6.d: /Users/noah-vincenznoeh/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-keccak-1.4.2/src/lib.rs /Users/noah-vincenznoeh/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-keccak-1.4.2/src/lib.rs:
D
/** * immintrin.h style functions * * Copyright: * (C) 2014-2015 Etienne Cimon * * License: * Released under the MIT license */ module botan.utils.simd.immintrin; import botan.constants; static if (BOTAN_HAS_THREEFISH_512_AVX2): import core.simd; alias __m256i = byte32; pure: nothrow: @trusted: int _MM_SHUFFLE(int a, int b, int c, int d) { return (z<<6) | (y<<4) | (x<<2) | w; } version(GDC) { // GDC <--> immintrin => gcc/gcc/config/i386/immintrin.h static import gcc.attribute; import gcc.builtins; enum inline = gcc.attribute.attribute("forceinline"); enum avx2 = gcc.attribute.attribute("target", "avx2"); @inline @avx2 __m256i _mm256_unpacklo_epi64(__m256i a, __m256i b) { return cast(__m256i) __builtin_ia32_punpcklqdq256(cast(long4) a, cast(long4) b); } @inline @avx2 __m256i _mm256_unpackhi_epi64(__m256i a, __m256i b) { return cast(__m256i) __builtin_ia32_punpckhqdq256(cast(long4) a, cast(long4) b); } @inline @avx2 __m256i _mm256_set_epi64x(long a, long b, long c, long d) { return cast(__m256i) long4([a, b, c, d]); } @inline @avx2 void _mm256_storeu_si256(__m256i* ptr, __m256i a) { __builtin_ia32_storedqu256(ptr, a); return; } @inline @avx2 __m256i _mm256_loadu_si256(__m256i* ptr) { return cast(__m256i) __builtin_ia32_loaddqu256(ptr); } @inline @avx2 __m256i _mm256_permute4x64_epi64(__m256 X, in int M) { return cast(__m256i) __builtin_ia32_permdi256(cast(long4) X, M); } @inline @avx2 __m256i _mm256_add_epi64(__m256 a, __m256 b) { return cast(__m256i) __builtin_ia32_paddq256(cast(long4) a, cast(long4) b); } @inline @avx2 __m256i _mm256_sub_epi64(__m256 a, __m256 b) { return cast(__m256i) __builtin_ia32_psubq256(cast(long4) a, cast(long4) b); } @inline @avx2 __m256i _mm256_xor_si256(__m256 a, __m256 b) { return cast(__m256i) __builtin_ia32_pxor256(cast(long4) a, cast(long4) b); } @inline @avx2 __m256i _mm256_or_si256(__m256 a, __m256 b) { return cast(__m256i) __builtin_ia32_por256(cast(long4) a, cast(long4) b); } @inline @avx2 __m256i _mm256_srlv_epi64(__m256 a, __m256 b) { return cast(__m256i) __builtin_ia32_psrlv4di(cast(long4) a, cast(long4) b); } @inline @avx2 __m256i _mm256_sllv_epi64(__m256 a, __m256 b) { return cast(__m256i) __builtin_ia32_psllv4di(cast(long4) a, cast(long4) b); } } version(none) { // LDC <--> immintrin ==> clang/test/CodeGen/avx2-builtins.c, rdrand-builtins.c pragma(LDC_inline_ir) R inlineIR(string s, R, P...)(P); pragma(LDC_intrinsic, "llvm.x86.rdrand.32") int _rdrand32_step(uint*); __m256i _mm256_set_epi64x(long a, long b, long c, long d) { return cast(__m256i) long4([a, b, c, d]); } __m256i _mm256_unpacklo_epi64(__m256i a, __m256i b) { pragma(LDC_allow_inline); return inlineIR!(` %tmp = shufflevector <4 x i64> %0, <4 x i64> %1, <4 x i32> <i32 0, i32 4, i32 2, i32 6> ret <4 x i64> %tmp`, __m256i)(a, b); } __m256i _mm256_unpackhi_epi64(__m256i a, __m256i b) { pragma(LDC_allow_inline); return inlineIR!(` %tmp = shufflevector <4 x i64> %0, <4 x i64> %1, <4 x i32> <i32 1, i32 5, i32 3, i32 7> ret <4 x i64> %tmp`, __m256i)(a, b); } __m256i _mm256_loadu_si256(__m256i* a) { pragma(LDC_allow_inline); return inlineIR!(` %tmp = load <4 x i64>* %0, align 1 ret <4 x i64> %tmp`, __m256i)(a); } void _mm256_storeu_si256(__m256i* ptr, __m256i a) { pragma(LDC_allow_inline); return inlineIR!(`store <4 x i64> %1, <4 x i64>* %0 ret`, void)(ptr, a); } __m256i _mm256_permute4x64_epi64(__m256i a, in int M) { pragma(LDC_allow_inline); int[4] val = [(M) & 0x3, ((M) & 0xc) >> 2, ((M) & 0x30) >> 4, ((M) & 0xc0) >> 6]; return inlineIR!(`%tmp = shufflevector <4 x i64> %0, <4 x i64> undef, <i32 %1, i32 %2, i32 %3, i32 %4> ret <4 x i64> %tmp`, __m256i)(a, val[0], val[1], val[2], val[3]); } __m256i _mm256_add_epi64(__m256i a, __m256i b) { pragma(LDC_allow_inline); return inlineIR!(`%tmp = add <4 x i64> %0, %1 ret <4 x i64> %tmp`, __m256i)(a, b); } __m256i _mm256_sub_epi64(__m256i a, __m256i b) { pragma(LDC_allow_inline); return inlineIR!(`%tmp = sub <4 x i64> %0, %1 ret <4 x i64> %tmp`, __m256i)(a, b); } __m256i _mm256_xor_si256(__m256i a, __m256i b) { pragma(LDC_allow_inline); return inlineIR!(`%tmp = xor <4 x i64> %0, %1 ret <4 x i64> %tmp`, __m256i)(a, b); } __m256i _mm256_or_si256(__m256i a, __m256i b) { pragma(LDC_allow_inline); return inlineIR!(`%tmp = or <4 x i64> %0, %1 ret <4 x i64> %tmp`, __m256i)(a, b); } pragma(LDC_intrinsic, "llvm.x86.avx2.psrlv.q.256") __m256i _mm256_srlv_epi64(__m256i a, __m256i b); pragma(LDC_intrinsic, "llvm.x86.avx2.psllv.q.256") __m256i _mm256_sllv_epi64(__m256i a, __m256i b); } version(D_InlineAsm_X86_64) { static assert(false, "DMD does not currently support AVX2."); __m256i _mm256_unpacklo_epi64(__m256i a, __m256i b) { // http://www.felixcloutier.com/x86/PUNPCKLBW:PUNPCKLWD:PUNPCKLDQ:PUNPCKLQDQ.html __m256i ret; __m256i* _a = &a; __m256i* _b = &b; __m256i* _c = &ret; asm { mov RAX, _a; mov RBX, _b; mov RCX, _c; vpunpcklqdq [RCX], [RAX], [RBX]; } return ret; } __m256i _mm256_unpackhi_epi64(__m256i a, __m256i b) { // http://www.felixcloutier.com/x86/PUNPCKHBW:PUNPCKHWD:PUNPCKHDQ:PUNPCKHQDQ.html __m256i ret; __m256i* _a = &a; __m256i* _b = &b; __m256i* _c = &ret; asm { mov RAX, _a; mov RBX, _b; mov RCX, _c; vpunpckhqdq [RCX], [RAX], [RBX]; } return ret; } __m256i _mm256_set_epi64x(long a, long b, long c, long d) { return cast(__m256i) long4([a, b, c, d]); } __m256i _mm256_loadu_si256(__m256i* a) { // http://www.felixcloutier.com/x86/MOVDQU.html __m256i ret; __m256i* b = &ret; asm { mov RAX, a; mov RBX, b; vmovdqu YMM0, [RAX]; vmovdqu [RBX], YMM0; } return ret; } void _mm256_storeu_si256(__m256i* ptr, __m256i a) { __m256i ret; __m256i* _a = &a; __m256i* _b = &ret; asm { mov RAX, _a; mov RBX, _b; vmovdqu YMM0, [RAX]; vmovdqu [RBX], YMM0; } *ptr = ret; } __m256i _mm256_permute4x64_epi64(__m256i a, in int M) { __m256i ret; __m256i* _a = &a; __m256i* _b = &ret; ubyte[4] val = [cast(ubyte) ((M) & 0x3), cast(ubyte) (((M) & 0xc) >> 2), cast(ubyte) (((M) & 0x30) >> 4), cast(ubyte) (((M) & 0xc0) >> 6)]; ubyte _imm8; _imm8 |= (val >> 0) & 0x3; _imm8 |= (val >> 2) & 0x3; _imm8 |= (val >> 4) & 0x3; _imm8 |= (val >> 6) & 0x3; asm { mov imm8, _imm8; mov RAX, _a; mov RBX, _b; vmovdqu YMM0, [RAX]; vmovdqu [RBX], YMM0; } *ptr = ret; } // todo: Prepare the rest of the assembly. Use GDC/LDC in the meantime } // _mm256_unpacklo_epi64 // _mm256_unpackhi_epi64 // _mm256_set_epi64x // _mm256_loadu_si256 // _mm256_storeu_si256 // _mm256_permute4x64_epi64 // _mm256_add_epi64 // _mm256_sub_epi64 // _mm256_xor_si256 // _mm256_or_si256 // _mm256_srlv_epi64 // _mm256_sllv_epi64 // _rdrand32_step => asm(".ubyte 0x0F, 0xC7, 0xF0; adcl $0,%1" : "=a" (r), "=r" (cf) : "0" (r), "1" (cf) : "cc");
D
module bullet2.BulletDynamics.ConstraintSolver.btSolverBody; extern (C++): import bullet2.BulletDynamics.Dynamics.btRigidBody; import bullet2.LinearMath.btVector3; import bullet2.LinearMath.btMatrix3x3; import bullet2.LinearMath.btAlignedAllocator; import bullet2.LinearMath.btTransformUtil; import bullet2.LinearMath.btTransform; import bullet2.LinearMath.btScalar; ///Until we get other contributions, only use SIMD on Windows, when using Visual Studio 2008 or later, and not double precision /+#ifdef BT_USE_SSE #define USE_SIMD 1 #endif // #ifdef USE_SIMD struct btSimdScalar { /*SIMD_FORCE_INLINE*/ btSimdScalar() { } /*SIMD_FORCE_INLINE*/ btSimdScalar(float fl) : m_vec128(_mm_set1_ps(fl)) { } /*SIMD_FORCE_INLINE*/ btSimdScalar(__m128 v128) : m_vec128(v128) { } union { __m128 m_vec128; float m_floats[4]; int m_ints[4]; btScalar m_unusedPadding; }; /*SIMD_FORCE_INLINE*/ __m128 get128() { return m_vec128; } /*SIMD_FORCE_INLINE*/ const __m128 get128() const { return m_vec128; } /*SIMD_FORCE_INLINE*/ void set128(__m128 v128) { m_vec128 = v128; } /*SIMD_FORCE_INLINE*/ operator __m128() { return m_vec128; } /*SIMD_FORCE_INLINE*/ operator const __m128() const { return m_vec128; } /*SIMD_FORCE_INLINE*/ operator float() const { return m_floats[0]; } }; ///@brief Return the elementwise product of two btSimdScalar /*SIMD_FORCE_INLINE*/ btSimdScalar operator*(const btSimdScalar& v1, const btSimdScalar& v2) { return btSimdScalar(_mm_mul_ps(v1.get128(), v2.get128())); } ///@brief Return the elementwise product of two btSimdScalar /*SIMD_FORCE_INLINE*/ btSimdScalar operator+(const btSimdScalar& v1, const btSimdScalar& v2) { return btSimdScalar(_mm_add_ps(v1.get128(), v2.get128())); } #else+/ //#define btSimdScalar btScalar alias btSimdScalar = btScalar; //#endif ///The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packed to increase cache coherence/performance. //ATTRIBUTE_ALIGNED16(struct) align(16) struct btSolverBody { //BT_DECLARE_ALIGNED_ALLOCATOR(); btTransform m_worldTransform; btVector3 m_deltaLinearVelocity; btVector3 m_deltaAngularVelocity; btVector3 m_angularFactor; btVector3 m_linearFactor; btVector3 m_invMass; btVector3 m_pushVelocity; btVector3 m_turnVelocity; btVector3 m_linearVelocity; btVector3 m_angularVelocity; btVector3 m_externalForceImpulse; btVector3 m_externalTorqueImpulse; btRigidBody* m_originalBody; void setWorldTransform(const ref btTransform worldTransform) { m_worldTransform = worldTransform; } ref btTransform getWorldTransform() return //const { return m_worldTransform; } /*SIMD_FORCE_INLINE*/ void getVelocityInLocalPointNoDelta(const ref btVector3 rel_pos, ref btVector3 velocity) //const { if (m_originalBody) velocity = m_linearVelocity + m_externalForceImpulse + (m_angularVelocity + m_externalTorqueImpulse).cross(rel_pos); else velocity.setValue(0, 0, 0); } /*SIMD_FORCE_INLINE*/ void getVelocityInLocalPointObsolete(const ref btVector3 rel_pos, ref btVector3 velocity) //const { if (m_originalBody) velocity = m_linearVelocity + m_deltaLinearVelocity + (m_angularVelocity + m_deltaAngularVelocity).cross(rel_pos); else velocity.setValue(0, 0, 0); } /*SIMD_FORCE_INLINE*/ void getAngularVelocity(ref btVector3 angVel) //const { if (m_originalBody) angVel = m_angularVelocity + m_deltaAngularVelocity; else angVel.setValue(0, 0, 0); } //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position /*SIMD_FORCE_INLINE*/ void applyImpulse(const ref btVector3 linearComponent, const ref btVector3 angularComponent, const btScalar impulseMagnitude) { if (m_originalBody) { m_deltaLinearVelocity += linearComponent * impulseMagnitude * m_linearFactor; m_deltaAngularVelocity += angularComponent * (impulseMagnitude * m_angularFactor); } } /*SIMD_FORCE_INLINE*/ void internalApplyPushImpulse(const ref btVector3 linearComponent, const ref btVector3 angularComponent, btScalar impulseMagnitude) { if (m_originalBody) { m_pushVelocity += linearComponent * impulseMagnitude * m_linearFactor; m_turnVelocity += angularComponent * (impulseMagnitude * m_angularFactor); } } ref btVector3 getDeltaLinearVelocity() return //const { return m_deltaLinearVelocity; } ref btVector3 getDeltaAngularVelocity() return //const { return m_deltaAngularVelocity; } ref btVector3 getPushVelocity() return //const { return m_pushVelocity; } ref btVector3 getTurnVelocity() return //const { return m_turnVelocity; } //////////////////////////////////////////////// ///some internal methods, don't use them ref btVector3 internalGetDeltaLinearVelocity() return { return m_deltaLinearVelocity; } ref btVector3 internalGetDeltaAngularVelocity() return { return m_deltaAngularVelocity; } ref btVector3 internalGetAngularFactor() return //const { return m_angularFactor; } ref btVector3 internalGetInvMass() return //const { return m_invMass; } void internalSetInvMass(const ref btVector3 invMass) { m_invMass = invMass; } ref btVector3 internalGetPushVelocity() return { return m_pushVelocity; } ref btVector3 internalGetTurnVelocity() return { return m_turnVelocity; } /*SIMD_FORCE_INLINE*/ void internalGetVelocityInLocalPointObsolete(const ref btVector3 rel_pos, ref btVector3 velocity) //const { velocity = m_linearVelocity + m_deltaLinearVelocity + (m_angularVelocity + m_deltaAngularVelocity).cross(rel_pos); } /*SIMD_FORCE_INLINE*/ void internalGetAngularVelocity(ref btVector3 angVel) //const { angVel = m_angularVelocity + m_deltaAngularVelocity; } //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position /*SIMD_FORCE_INLINE*/ void internalApplyImpulse(const ref btVector3 linearComponent, const ref btVector3 angularComponent, const btScalar impulseMagnitude) { if (m_originalBody) { m_deltaLinearVelocity += linearComponent * impulseMagnitude * m_linearFactor; m_deltaAngularVelocity += angularComponent * (impulseMagnitude * m_angularFactor); } } void writebackVelocity() { if (m_originalBody) { m_linearVelocity += m_deltaLinearVelocity; m_angularVelocity += m_deltaAngularVelocity; //m_originalBody->setCompanionId(-1); } } void writebackVelocityAndTransform(btScalar timeStep, btScalar splitImpulseTurnErp) { //(void)timeStep; if (m_originalBody) { m_linearVelocity += m_deltaLinearVelocity; m_angularVelocity += m_deltaAngularVelocity; //correct the position/orientation based on push/turn recovery btTransform newTransform; if (m_pushVelocity[0] != 0.0f || m_pushVelocity[1] != 0 || m_pushVelocity[2] != 0 || m_turnVelocity[0] != 0.0f || m_turnVelocity[1] != 0 || m_turnVelocity[2] != 0) { // btQuaternion orn = m_worldTransform.getRotation(); btTransformUtil.integrateTransform(m_worldTransform, m_pushVelocity, m_turnVelocity * splitImpulseTurnErp, timeStep, newTransform); m_worldTransform = newTransform; } //m_worldTransform.setRotation(orn); //m_originalBody->setCompanionId(-1); } } };
D
# Gitblit daemon configuration. # Uncomment properties to modify them. # Logs location. #GITBLIT_LOG=/var/log/gitblit/gitblit.log # User running the daemon. #GITBLIT_USER=gitblit # JVM arguments. #GITBLIT_JAVA_OPTS="-server -Xmx1024M" # Daemon start arguments. #GITBLIT_START_ARGS="" # Daemon stop arguments. #GITBLIT_STOP_ARGS="--stop"
D
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/Utilities/RFC1123.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/RFC1123.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/URL+HTTP.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Basic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/Forwarded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/MediaTypePreference.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPMessage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaderName.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPScheme.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPResponse.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookieValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPChunkedStream.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClientProtocolUpgrader.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServerResponder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Codable/HTTPMessageCoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Bearer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookies.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/String+IsIPAddress.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClient.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPRequest.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBody.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/Utilities/RFC1123~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/RFC1123.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/URL+HTTP.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Basic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/Forwarded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/MediaTypePreference.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPMessage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaderName.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPScheme.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPResponse.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookieValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPChunkedStream.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClientProtocolUpgrader.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServerResponder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Codable/HTTPMessageCoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Bearer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookies.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/String+IsIPAddress.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClient.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPRequest.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBody.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/Utilities/RFC1123~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/RFC1123.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/URL+HTTP.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Basic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/Forwarded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/MediaTypePreference.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPMessage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaderName.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPScheme.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPResponse.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookieValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPChunkedStream.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClientProtocolUpgrader.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServerResponder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Codable/HTTPMessageCoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Bearer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookies.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/String+IsIPAddress.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClient.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPRequest.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBody.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/Utilities/RFC1123~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/RFC1123.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/URL+HTTP.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Basic.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/Forwarded.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/MediaTypePreference.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPMessage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBodyRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaderName.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPScheme.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPResponse.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookieValue.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPChunkedStream.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClientProtocolUpgrader.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServerResponder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Codable/HTTPMessageCoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPHeaders+Bearer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPServer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/HTTPError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Cookies/HTTPCookies.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPHeaders.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Utilities/String+IsIPAddress.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Responder/HTTPClient.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Message/HTTPRequest.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/http/Sources/HTTP/Body/HTTPBody.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOZlib/include/CNIOZlib.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/** * Block Cipher Base Class * * Copyright: * (C) 1999-2009 Jack Lloyd * (C) 2014-2015 Etienne Cimon * * License: * Botan is released under the Simplified BSD License (see LICENSE.md) */ module botan.block.block_cipher; import botan.constants; public import botan.algo_base.transform; public import botan.algo_base.sym_algo; /** * This class represents a block cipher object. */ interface BlockCipher : SymmetricAlgorithm { public: /** * Returns: block size of this algorithm */ abstract size_t blockSize() const; /** * Returns: native parallelism of this cipher in blocks */ abstract @property size_t parallelism() const; /** * Returns: prefererred parallelism of this cipher in bytes */ final size_t parallelBytes() const { return parallelism * this.blockSize() * BOTAN_BLOCK_CIPHER_PAR_MULT; } /** * Encrypt a block. * * Params: * input = The plaintext block to be encrypted as a ubyte array. * output = The ubyte array designated to hold the encrypted block. * * Notes: Both arguments must be of length blockSize(). */ final void encrypt(const(ubyte)* input, ubyte* output) { encryptN(input, output, 1); } /** * Decrypt a block. * Params: * input = The ciphertext block to be decypted as a ubyte array. * output = The ubyte array designated to hold the decrypted block. * Notes: Both parameters must be of length blockSize(). */ final void decrypt(const(ubyte)* input, ubyte* output) { decryptN(input, output, 1); } /** * Encrypt a block. * Params: * block = the plaintext block to be encrypted * Notes: Must be of length blockSize(). Will hold the result when the function * has finished. */ final void encrypt(ubyte* block) { encryptN(cast(const(ubyte)*)block, block, 1); } /** * Decrypt a block. * Params: * block = the ciphertext block to be decrypted * Notes: Must be of length blockSize(). Will hold the result when the function * has finished. */ final void decrypt(ubyte* block) { decryptN(cast(const(ubyte)*)block, block, 1); } /** * Encrypt a block. * Params: * block = the plaintext block to be encrypted * Notes: Must be of length blockSize(). Will hold the result when the function * has finished. */ final void encrypt(ref ubyte[] block) in { assert(block.length == this.blockSize()); } do { encryptN(block.ptr, block.ptr, 1); } /** * Decrypt a block. * Params: * block = the ciphertext block to be decrypted * Notes: Must be of length blockSize(). Will hold the result when the function * has finished. */ final void decrypt(ref ubyte[] block) in { assert(block.length >= this.blockSize()); } do { decryptN(block.ptr, block.ptr, 1); } /** * Encrypt one or more blocks * Params: * block = the input/output buffer (multiple of blockSize()) */ final void encrypt(Alloc)(ref Vector!( ubyte, Alloc ) block) in { assert(block.length >= this.blockSize()); } do { return encryptN(block.ptr, block.ptr, block.length / this.blockSize()); } /** * Decrypt one or more blocks * Params: * block = the input/output buffer (multiple of blockSize()) */ final void decrypt(Alloc)(ref Vector!( ubyte, Alloc ) block) in { assert(block.length >= this.blockSize()); } do { return decryptN(block.ptr, block.ptr, block.length / this.blockSize()); } /** * Encrypt one or more blocks * Params: * input = the input buffer (multiple of blockSize()) * output = the output buffer (same size as input) */ final void encrypt(Alloc, Alloc2)(auto const ref Vector!( ubyte, Alloc ) input, ref Vector!( ubyte, Alloc2 ) output) in { assert(input.length >= this.blockSize()); } do { return encryptN(input.ptr, output.ptr, input.length / this.blockSize()); } /** * Decrypt one or more blocks * Params: * input = the input buffer (multiple of blockSize()) * output = the output buffer (same size as input) */ final void decrypt(Alloc, Alloc2)(auto const ref Vector!( ubyte, Alloc ) input, ref Vector!( ubyte, Alloc2 ) output) in { assert(input.length >= this.blockSize()); } do { return decryptN(input.ptr, output.ptr, input.length / this.blockSize()); } /** * Encrypt one or more blocks * Params: * input = the input buffer (multiple of blockSize()) * output = the output buffer (same size as input) */ final void encrypt(ubyte[] input, ref ubyte[] output) in { assert(input.length >= this.blockSize()); } do { return encryptN(input.ptr, output.ptr, input.length / blockSize()); } /** * Decrypt one or more blocks * Params: * input = the input buffer (multiple of blockSize()) * output = the output buffer (same size as input) */ final void decrypt(ubyte[] input, ref ubyte[] output) in { assert(input.length >= this.blockSize()); } do { return decryptN(input.ptr, output.ptr, input.length / this.blockSize()); } /** * Encrypt one or more blocks * Params: * input = the input buffer (multiple of blockSize()) * output = the output buffer (same size as input) * blocks = the number of blocks to process */ abstract void encryptN(const(ubyte)* input, ubyte* output, size_t blocks); /** * Decrypt one or more blocks * Params: * input = the input buffer (multiple of blockSize()) * output = the output buffer (same size as input) * blocks = the number of blocks to process */ abstract void decryptN(const(ubyte)* input, ubyte* output, size_t blocks); /** * Returns: new object representing the same algorithm as this */ abstract BlockCipher clone() const; final @disable BlockCipher dup() const; } /** * Represents a block cipher with a single fixed block size */ abstract class BlockCipherFixedParams(size_t BS, size_t KMIN, size_t KMAX = 0, size_t KMOD = 1) : BlockCipher, SymmetricAlgorithm { public: enum { BLOCK_SIZE = BS } override size_t blockSize() const { return BS; } KeyLengthSpecification keySpec() const { return KeyLengthSpecification(KMIN, KMAX, KMOD); } abstract void clear(); this() { clear(); } // TODO: Write some real constructors for each object. } static if (BOTAN_TEST): import botan.test; private import botan.libstate.libstate; import botan.algo_factory.algo_factory; import botan.codec.hex; import core.atomic; import memutils.hashmap; shared size_t total_tests; size_t blockTest(string algo, string key_hex, string in_hex, string out_hex) { const SecureVector!ubyte key = hexDecodeLocked(key_hex); const SecureVector!ubyte pt = hexDecodeLocked(in_hex); const SecureVector!ubyte ct = hexDecodeLocked(out_hex); AlgorithmFactory af = globalState().algorithmFactory(); const auto providers = af.providersOf(algo); size_t fails = 0; if (providers.empty) throw new Exception("Unknown block cipher " ~ algo); foreach (provider; providers[]) { atomicOp!"+="(total_tests, 1); const BlockCipher proto = af.prototypeBlockCipher(algo, provider); if (!proto) { logError("Unable to get " ~ algo ~ " from " ~ provider); ++fails; continue; } Unique!BlockCipher cipher = proto.clone(); cipher.setKey(key); SecureVector!ubyte buf = pt.clone; cipher.encrypt(buf); atomicOp!"+="(total_tests, 1); if (buf != ct) { logTrace(buf[], " Real"); logTrace(ct[], " Expected"); ++fails; buf = ct.clone; } cipher.decrypt(buf); atomicOp!"+="(total_tests, 1); if (buf != pt) { logTrace(buf[], " Real"); logTrace(pt[], " Expected"); ++fails; } } //logTrace("Finished ", algo, " Fails: ", fails); assert(fails == 0); return fails; } static if (BOTAN_HAS_TESTS && !SKIP_BLOCK_TEST) unittest { logDebug("Testing block_cipher.d ..."); size_t test_bc(string input) { logDebug("Testing file `" ~ input ~ " ..."); File vec = File(input, "r"); return runTestsBb(vec, "BlockCipher", "Out", true, (ref HashMap!(string, string) m) { return blockTest(m["BlockCipher"], m["Key"], m["In"], m["Out"]); }); } logTrace("Running tests ..."); size_t fails = runTestsInDir("test_data/block", &test_bc); testReport("block_cipher", total_tests, fails); }
D
import std.algorithm : splitter; import std.stdio; import std.range : put, take; import rx; void main() { auto signal = new EventSignal; auto client = getAsync("http://dlang.org"); client.map!(content => content.length) .doSubscribe((size_t len) => writeln("Content-Length: ", len), &signal.setSignal); signal.wait(); } Observable!(char[]) getAsync(const(char)[] url) { auto sub = new AsyncSubject!(char[]); import std.parallelism : task, taskPool; taskPool.put(task({ import std.net.curl : get; try { .put(sub, get(url)); sub.completed(); } catch (Exception e) { sub.failure(e); } })); return sub; } auto getDefer(const(char)[] url) { return defer!(char[])((Observer!(char[]) observer) { import std.net.curl : get; try { .put(observer, get(url)); observer.completed(); } catch (Exception e) { observer.failure(e); } return NopDisposable.instance; }).subscribeOn(new TaskPoolScheduler); }
D
//https://rosettacode.org/wiki/Magic_squares_of_doubly_even_order import std.stdio; void main() { int n=8; foreach(row; magicSquareDoublyEven(n)) { foreach(col; row) { writef("%2s ", col); } writeln; } writeln("\nMagic constant: ", (n*n+1)*n/2); } int[][] magicSquareDoublyEven(int n) { import std.exception; enforce(n>=4 && n%4 == 0, "Base must be a positive multiple of 4"); int bits = 0b1001_0110_0110_1001; int size = n * n; int mult = n / 4; // how many multiples of 4 int[][] result; result.length = n; foreach(i; 0..n) { result[i].length = n; } for (int r=0, i=0; r<n; r++) { for (int c=0; c<n; c++, i++) { int bitPos = c / mult + (r / mult) * 4; result[r][c] = (bits & (1 << bitPos)) != 0 ? i + 1 : size - i; } } return result; }
D
# FIXED PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/Profiles/SensorProfile/CC26xx/humidityservice.c PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/bcomdef.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/comdef.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/hal/target/CC2650TIRTOS/hal_types.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/hal/target/CC2650TIRTOS/../_common/cc26xx/_hal_types.h PROFILES/humidityservice.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/hal/include/hal_defs.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/host/linkdb.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/gatt.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/OSAL.h PROFILES/humidityservice.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/limits.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/OSAL_Memory.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/OSAL_Timers.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/icall/include/ICall.h PROFILES/humidityservice.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdbool.h PROFILES/humidityservice.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdlib.h PROFILES/humidityservice.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/linkage.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/att.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/l2cap.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/gatt_uuid.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/include/gattservapp.h PROFILES/humidityservice.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/string.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/Profiles/SensorProfile/CC26xx/humidityservice.h PROFILES/humidityservice.obj: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/Profiles/SensorProfile/CC26xx/st_util.h C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/Profiles/SensorProfile/CC26xx/humidityservice.c: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/bcomdef.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/comdef.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/hal/target/CC2650TIRTOS/hal_types.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/hal/target/CC2650TIRTOS/../_common/cc26xx/_hal_types.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/hal/include/hal_defs.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/host/linkdb.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/gatt.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/OSAL.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/limits.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/OSAL_Memory.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/osal/include/OSAL_Timers.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/icall/include/ICall.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdbool.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdlib.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/linkage.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/att.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/l2cap.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Components/ble/include/gatt_uuid.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/include/gattservapp.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/string.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/Profiles/SensorProfile/CC26xx/humidityservice.h: C:/ti/simplelink/ble_cc26xx_2_01_01_44627/Projects/ble/Profiles/SensorProfile/CC26xx/st_util.h:
D
import std.stdio; struct Rect(T) { public: bool intersects(ref const Rect!T rhs, ShortRect* overlap = null) { return false; } } alias FloatRect = Rect!float; alias ShortRect = Rect!short; void main() { }
D
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. SPDX-License-Identifier: curl Long: version Short: V Help: Show version number and quit Category: important curl Example: --version Added: 4.0 See-also: help manual Multi: custom --- Displays information about curl and the libcurl version it uses. The first line includes the full version of curl, libcurl and other 3rd party libraries linked with the executable. The second line (starts with "Release-Date:") shows the release date. The third line (starts with "Protocols:") shows all protocols that libcurl reports to support. The fourth line (starts with "Features:") shows specific features libcurl reports to offer. Available features include: .RS .IP "alt-svc" Support for the Alt-Svc: header is provided. .IP "AsynchDNS" This curl uses asynchronous name resolves. Asynchronous name resolves can be done using either the c-ares or the threaded resolver backends. .IP "brotli" Support for automatic brotli compression over HTTP(S). .IP "CharConv" curl was built with support for character set conversions (like EBCDIC) .IP "Debug" This curl uses a libcurl built with Debug. This enables more error-tracking and memory debugging etc. For curl-developers only! .IP "gsasl" The built-in SASL authentication includes extensions to support SCRAM because libcurl was built with libgsasl. .IP "GSS-API" GSS-API is supported. .IP "HSTS" HSTS support is present. .IP "HTTP2" HTTP/2 support has been built-in. .IP "HTTP3" HTTP/3 support has been built-in. .IP "HTTPS-proxy" This curl is built to support HTTPS proxy. .IP "IDN" This curl supports IDN - international domain names. .IP "IPv6" You can use IPv6 with this. .IP "Kerberos" Kerberos V5 authentication is supported. .IP "Largefile" This curl supports transfers of large files, files larger than 2GB. .IP "libz" Automatic decompression (via gzip, deflate) of compressed files over HTTP is supported. .IP "MultiSSL" This curl supports multiple TLS backends. .IP "NTLM" NTLM authentication is supported. .IP "NTLM_WB" NTLM delegation to winbind helper is supported. .IP "PSL" PSL is short for Public Suffix List and means that this curl has been built with knowledge about "public suffixes". .IP "SPNEGO" SPNEGO authentication is supported. .IP "SSL" SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S and so on. .IP "SSPI" SSPI is supported. .IP "TLS-SRP" SRP (Secure Remote Password) authentication is supported for TLS. .IP "TrackMemory" Debug memory tracking is supported. .IP "Unicode" Unicode support on Windows. .IP "UnixSockets" Unix sockets support is provided. .IP "zstd" Automatic decompression (via zstd) of compressed files over HTTP is supported. .RE .IP
D
/* * Copyright Andrej Mitrovic 2013 - 2020. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ module dtk.image; import dtk.interpreter; import dtk.utils; import dtk.widgets.widget; import std.exception; import std.file; import std.format; import std.path; /// class Image : Widget { this(string fileName) { enforce(fileName.exists, format("File name '%s' does not exist.", fileName.absolutePath)); enforce(fileName.isFile, format("File name '%s' is not a file.", fileName.absolutePath)); super(CreateFakeWidget.init, WidgetType.image); tclEvalFmt("image create photo %s -file %s", _name, fileName._tclEscape); } }
D
// --------------------------------------------------------- // NPC 'HLR_500_Palgur' // --------------------------------------------------------- instance HLR_500_Palgur (C_NPC) { //-------- primary data -------- name = "Palgur"; guild = GIL_HEALER; npctype = NPCTYPE_MAIN; level = 40; voice = 8; id = 500; //-------- attributes ---------- attribute [ATR_STRENGTH] = 50; attribute [ATR_DEXTERITY] = 75; attribute [ATR_MANA_MAX] = 150; attribute [ATR_MANA] = 150; attribute [ATR_HITPOINTS_MAX] = 250; attribute [ATR_HITPOINTS] = 250; attribute [ATR_REGENERATEMANA] = 0; attribute [ATR_REGENERATEHP] = 0; //-------- protection ---------- protection [PROT_EDGE] = 0; protection [PROT_BLUNT] = 0; protection [PROT_POINT] = 0; protection [PROT_FIRE] = 0; protection [PROT_MAGIC] = 0; protection [PROT_FALL] = 0; protection [PROT_FLY] = 0; protection [PROT_BARRIER] = 0; //-------- visuals ------------- Mdl_SetVisual (self, "humans.mds"); // basic animation file Mdl_ApplyOverlayMds (self, "Humans_Mage.mds"); // overlay animation file Mdl_SetVisualBody (self, "hum_body_naked0", 0, 0, "Hum_Head_Psionic", 8, 1, HLRS_ARMOR); B_Scale (self); //auto-matching scale with strength Mdl_SetModelFatness (self, 0); //-------- talents ------------- Npc_SetTalentSkill (self, NPC_TALENT_MAGE, 4); //-------- inventory ----------- CreateInvItem (self, ItFo_Potion_Health_02); CreateInvItem (self, ItFo_Potion_Mana_02); CreateInvItem (self, ItWr_Palgur); CreateInvItems (self, ItMi_Silver, 20); CreateInvItems (self, ItFo_Potion_Health_01, 3); CreateInvItems (self, ItFo_Potion_Mana_01, 3); CreateInvItems (self, ItFo_Ham, 3); CreateInvItems (self, ItMi_Salt, 10); CreateInvItems (self, ItPl_Swampweed, 3); CreateInvItems (self, ItPl_Stoneroot, 3); CreateInvItems (self, ItPl_OrcLeaf, 3); CreateInvItems (self, ItPl_MountainMoss, 3); EquipItem (self, ItAr_RuneSleep); //-------- ai ------------------ fight_tactic = FAI_HUMAN_MAGE; daily_routine = Rtn_start_500; senses_range = 2000; senses = SENSE_HEAR | SENSE_SEE; }; // --------------------------------------------------------- // daily routines // --------------------------------------------------------- func void Rtn_start_500 () { TA_PotionAlchemy (07, 00, 00, 00, "OCR_MEDICUS_6"); TA_Sleep (00, 00, 07, 00, "OCR_MEDICUS_4_BED2"); };
D
a shoe for a child or woman that has a strap around the ankle a sock that reaches just above the ankle an ornament worn around the ankle
D
extern(C) int printf(const char* fmt, ...); /***************************************/ void test1() { char[] a; int foo() { printf("foo\n"); a ~= "foo"; return 10; } foreach (i; 0 .. foo()) { printf("%d\n", i); a ~= cast(char)('0' + i); } assert(a == "foo0123456789"); foreach_reverse (i; 0 .. foo()) { printf("%d\n", i); a ~= cast(char)('0' + i); } assert(a == "foo0123456789foo9876543210"); } /***************************************/ // 2411 struct S2411 { int n; string s; } void test2411() { S2411 s; assert(s.n == 0); assert(s.s == ""); foreach (i, ref e; s.tupleof) { static if (i == 0) e = 10; static if (i == 1) e = "str"; } assert(s.n == 10); assert(s.s == "str"); } /***************************************/ // 2442 template canForeach(T, E) { enum canForeach = __traits(compiles, { foreach(a; new T) { static assert(is(typeof(a) == E)); } }); } void test2442() { struct S1 { int opApply(int delegate(ref const(int) v) dg) const { return 0; } int opApply(int delegate(ref int v) dg) { return 0; } } S1 ms1; const S1 cs1; foreach (x; ms1) { static assert(is(typeof(x) == int)); } foreach (x; cs1) { static assert(is(typeof(x) == const int)); } struct S2 { int opApply(int delegate(ref int v) dg) { return 0; } int opApply(int delegate(ref long v) dg) { return 0; } } S2 ms2; static assert(!__traits(compiles, { foreach ( x; ms2) {} })); // ambiguous static assert( __traits(compiles, { foreach (int x; ms2) {} })); struct S3 { int opApply(int delegate(ref int v) dg) const { return 0; } int opApply(int delegate(ref int v) dg) shared const { return 0; } } immutable S3 ms3; static assert(!__traits(compiles, { foreach (int x; ms3) {} })); // ambiguous // from https://github.com/D-Programming-Language/dmd/pull/120 static class C { int opApply(int delegate(ref int v) dg) { return 0; } int opApply(int delegate(ref const int v) dg) const { return 0; } int opApply(int delegate(ref immutable int v) dg) immutable { return 0; } int opApply(int delegate(ref shared int v) dg) shared { return 0; } int opApply(int delegate(ref shared const int v) dg) shared const { return 0; } } static class D { int opApply(int delegate(ref int v) dg) const { return 0; } } static class E { int opApply(int delegate(ref int v) dg) shared const { return 0; } } static assert( canForeach!( C , int )); static assert( canForeach!( const(C) , const(int) )); static assert( canForeach!( immutable(C) , immutable(int) )); static assert( canForeach!( shared(C) , shared(int) )); static assert( canForeach!(shared(const(C)), shared(const(int)))); static assert( canForeach!( D , int)); static assert( canForeach!( const(D) , int)); static assert( canForeach!( immutable(D) , int)); static assert(!canForeach!( shared(D) , int)); static assert(!canForeach!(shared(const(D)), int)); static assert(!canForeach!( E , int)); static assert(!canForeach!( const(E) , int)); static assert( canForeach!( immutable(E) , int)); static assert( canForeach!( shared(E) , int)); static assert( canForeach!(shared(const(E)), int)); } /***************************************/ // 2443 struct S2443 { int[] arr; int opApply(int delegate(size_t i, ref int v) dg) { int result = 0; foreach (i, ref x; arr) { if ((result = dg(i, x)) != 0) break; } return result; } } void test2443() { S2443 s; foreach (i, ref v; s) {} foreach (i, v; s) {} static assert(!__traits(compiles, { foreach (ref i, ref v; s) {} })); static assert(!__traits(compiles, { foreach (ref i, v; s) {} })); } /***************************************/ // 3187 class Collection { int opApply(int delegate(ref Object) a) { return 0; } } Object testForeach(Collection level1, Collection level2) { foreach (first; level1) { foreach (second; level2) return second; } return null; } void test3187() { testForeach(new Collection, new Collection); } /***************************************/ // 4090 void test4090a() { double[10] arr = 1; double tot = 0; static assert(!__traits(compiles, { foreach (immutable ref x; arr) {} })); foreach (const ref x; arr) { static assert(is(typeof(x) == const double)); tot += x; } foreach (immutable x; arr) { static assert(is(typeof(x) == immutable double)); tot += x; } assert(tot == 1*10 + 1*10); } void test4090b() { int tot = 0; static assert(!__traits(compiles, { foreach (immutable ref x; 1..11) {} })); foreach (const ref x; 1..11) { static assert(is(typeof(x) == const int)); tot += x; } foreach (immutable x; 1..11) { static assert(is(typeof(x) == immutable int)); tot += x; } assert(tot == 55 + 55); } /***************************************/ // 5605 struct MyRange { int theOnlyOne; @property bool empty() const { return true; } @property ref int front() { return theOnlyOne; } void popFront() {} } struct MyCollection { MyRange opSlice() const { return MyRange(); } } void test5605() { auto coll = MyCollection(); foreach (i; coll) { // <-- compilation error // ... } } /***************************************/ // 7004 void func7004(A...)(A args) { foreach (i, e; args){} // OK foreach (uint i, e; args){} // OK foreach (size_t i, e; args){} // NG } void test7004() { func7004(1, 3.14); } /***************************************/ // 7406 template TypeTuple7406(T...) { alias T TypeTuple7406; } template foobar7406(T) { enum foobar = 2; } void test7406() { foreach (sym; TypeTuple7406!(int, double)) // OK pragma(msg, sym.stringof); foreach (sym; TypeTuple7406!(foobar7406)) // OK pragma(msg, sym.stringof); foreach (sym; TypeTuple7406!(test7406)) // OK pragma(msg, sym.stringof); foreach (sym; TypeTuple7406!(int, foobar7406)) // Error: type int has no value pragma(msg, sym.stringof); foreach (sym; TypeTuple7406!(int, test7406)) // Error: type int has no value pragma(msg, sym.stringof); } /***************************************/ // 6659 void test6659() { static struct Iter { ~this() { ++_dtor; } bool opCmp(ref const Iter rhs) { return _pos == rhs._pos; } void opUnary(string op:"++")() { ++_pos; } size_t _pos; static size_t _dtor; } foreach (ref iter; Iter(0) .. Iter(10)) { assert(Iter._dtor == 0); } assert(Iter._dtor == 2); Iter._dtor = 0; // reset for (auto iter = Iter(0), limit = Iter(10); iter != limit; ++iter) { assert(Iter._dtor == 0); } assert(Iter._dtor == 2); } void test6659a() { auto value = 0; try { for ({scope(success) { assert(value == 1); value = 2;} } true; ) { value = 1; break; } assert(value == 2); } catch (Exception e) { assert(0); } assert(value == 2); } void test6659b() { auto value = 0; try { for ({scope(failure) value = 1;} true; ) { throw new Exception(""); } assert(0); } catch (Exception e) { assert(e); } assert(value == 1); } void test6659c() { auto value = 0; try { for ({scope(exit) value = 1;} true; ) { throw new Exception(""); } assert(0); } catch (Exception e) { assert(e); } assert(value == 1); } /***************************************/ // 7814 struct File7814 { ~this(){} } struct ByLine7814 { File7814 file; // foreach interface @property bool empty() const { return true; } @property char[] front() { return null; } void popFront(){} } void test7814() { int dummy; ByLine7814 f; foreach (l; f) { scope(failure) // 'failure' or 'success' fails, but 'exit' works dummy = -1; dummy = 0; } } /******************************************/ // 6652 void test6652() { size_t sum; foreach (i; 0 .. 10) sum += i++; // 0123456789 assert(sum == 45); sum = 0; foreach (ref i; 0 .. 10) sum += i++; // 02468 assert(sum == 20); sum = 0; foreach_reverse (i; 0 .. 10) sum += i--; // 9876543210 assert(sum == 45); sum = 0; foreach_reverse (ref i; 0 .. 10) sum += i--; // 97531 assert(sum == 25); enum ary = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; sum = 0; foreach (i, v; ary) { assert(i == v); sum += i++; // 0123456789 } assert(sum == 45); sum = 0; foreach (ref i, v; ary) { assert(i == v); sum += i++; // 02468 } assert(sum == 20); sum = 0; foreach_reverse (i, v; ary) { assert(i == v); sum += i--; // 9876543210 } assert(sum == 45); sum = 0; foreach_reverse (ref i, v; ary) { assert(i == v); sum += i--; // 97531 } assert(sum == 25); static struct Iter { ~this() { ++_dtorCount; } bool opCmp(ref const Iter rhs) { return _pos == rhs._pos; } void opUnary(string op)() if(op == "++" || op == "--") { mixin(op ~ q{_pos;}); } size_t _pos; static size_t _dtorCount; } Iter._dtorCount = sum = 0; foreach (v; Iter(0) .. Iter(10)) sum += v._pos++; // 0123456789 assert(sum == 45 && Iter._dtorCount == 12); Iter._dtorCount = sum = 0; foreach (ref v; Iter(0) .. Iter(10)) sum += v._pos++; // 02468 assert(sum == 20 && Iter._dtorCount == 2); // additional dtor calls due to unnecessary postdecrements Iter._dtorCount = sum = 0; foreach_reverse (v; Iter(0) .. Iter(10)) sum += v._pos--; // 9876543210 assert(sum == 45 && Iter._dtorCount >= 12); Iter._dtorCount = sum = 0; foreach_reverse (ref v; Iter(0) .. Iter(10)) sum += v._pos--; // 97531 assert(sum == 25 && Iter._dtorCount >= 2); } /***************************************/ // 8595 struct OpApply8595 { int opApply(int delegate(ref int) dg) { assert(0); } } string test8595() { foreach (elem; OpApply8595.init) { static assert(is(typeof(return) == string)); } assert(0); } /***************************************/ int main() { test1(); test2411(); test2442(); test2443(); test3187(); test4090a(); test4090b(); test5605(); test7004(); test7406(); test6659(); test6659a(); test6659b(); test6659c(); test7814(); test6652(); printf("Success\n"); return 0; }
D
module tests.ut.build; import unit_threaded; import reggae; import reggae.options; import std.array; void testIsLeaf() { Target("tgt").isLeaf.shouldBeTrue; Target("other", "", [Target("foo"), Target("bar")]).isLeaf.shouldBeFalse; Target("implicits", "", [], [Target("foo")]).isLeaf.shouldBeFalse; } void testInOut() { import reggae.config: gDefaultOptions; //Tests that specifying $in and $out in the command string gets substituted correctly { auto target = Target("foo", "createfoo -o $out $in", [Target("bar.txt"), Target("baz.txt")]); target.shellCommand(gDefaultOptions.withProjectPath("/path/to")).shouldEqual( "createfoo -o foo /path/to/bar.txt /path/to/baz.txt"); } { auto target = Target("tgt", "gcc -o $out $in", [ Target("src1.o", "gcc -c -o $out $in", [Target("src1.c")]), Target("src2.o", "gcc -c -o $out $in", [Target("src2.c")]) ], ); target.shellCommand(gDefaultOptions.withProjectPath("/path/to")).shouldEqual("gcc -o tgt src1.o src2.o"); } { auto target = Target(["proto.h", "proto.c"], "protocompile $out -i $in", [Target("proto.idl")]); target.shellCommand(gDefaultOptions.withProjectPath("/path/to")).shouldEqual( "protocompile proto.h proto.c -i /path/to/proto.idl"); } { auto target = Target("lib1.a", "ar -o$out $in", [Target(["foo1.o", "foo2.o"], "cmd", [Target("tmp")]), Target("bar.o"), Target("baz.o")]); target.shellCommand(gDefaultOptions.withProjectPath("/path/to")).shouldEqual( "ar -olib1.a foo1.o foo2.o /path/to/bar.o /path/to/baz.o"); } } void testProject() { import reggae.config: gDefaultOptions; auto target = Target("foo", "makefoo -i $in -o $out -p $project", [Target("bar"), Target("baz")]); target.shellCommand(gDefaultOptions.withProjectPath("/tmp")).shouldEqual("makefoo -i /tmp/bar /tmp/baz -o foo -p /tmp"); } void testMultipleOutputs() { import reggae.config: gDefaultOptions; auto target = Target(["foo.hpp", "foo.cpp"], "protocomp $in", [Target("foo.proto")]); target.rawOutputs.shouldEqual(["foo.hpp", "foo.cpp"]); target.shellCommand(gDefaultOptions.withProjectPath("myproj")).shouldEqual("protocomp myproj/foo.proto"); auto bld = Build(target); bld.targets.array[0].rawOutputs.shouldEqual(["foo.hpp", "foo.cpp"]); } void testInTopLevelObjDir() { auto theApp = Target("theapp"); auto dirName = topLevelDirName(theApp); auto fooObj = Target("foo.o", "", [Target("foo.c")]); fooObj.inTopLevelObjDirOf(dirName).shouldEqual( Target(".reggae/objs/theapp.objs/foo.o", "", [Target("foo.c")])); auto barObjInBuildDir = Target("$builddir/bar.o", "", [Target("bar.c")]); barObjInBuildDir.inTopLevelObjDirOf(dirName).shouldEqual( Target("bar.o", "", [Target("bar.c")])); auto leafTarget = Target("foo.c"); leafTarget.inTopLevelObjDirOf(dirName).shouldEqual(leafTarget); } void testMultipleOutputsImplicits() { auto protoSrcs = Target([`$builddir/gen/protocol.c`, `$builddir/gen/protocol.h`], `./compiler $in`, [Target(`protocol.proto`)]); auto protoObj = Target(`$builddir/bin/protocol.o`, `gcc -o $out -c $builddir/gen/protocol.c`, [], [protoSrcs]); auto protoD = Target(`$builddir/gen/protocol.d`, `echo "extern(C) " > $out; cat $builddir/gen/protocol.h >> $out`, [], [protoSrcs]); auto app = Target(`app`, `dmd -of$out $in`, [Target(`src/main.d`), protoObj, protoD]); auto build = Build(app); auto newProtoSrcs = Target([`gen/protocol.c`, `gen/protocol.h`], `./compiler $in`, [Target(`protocol.proto`)]); auto newProtoD = Target(`gen/protocol.d`, `echo "extern(C) " > $out; cat gen/protocol.h >> $out`, [], [newProtoSrcs]); build.targets.array.shouldEqual( [Target("app", "dmd -of$out $in", [Target("src/main.d"), Target("bin/protocol.o", "gcc -o $out -c gen/protocol.c", [], [newProtoSrcs]), newProtoD])] ); } void testRealTargetPath() { auto fooLib = Target("$project/foo.so", "dmd -of$out $in", [Target("src1.d"), Target("src2.d")]); auto barLib = Target("$builddir/bar.so", "dmd -of$out $in", [Target("src1.d"), Target("src2.d")]); auto symlink1 = Target("$project/weird/path/thingie1", "ln -sf $in $out", fooLib); auto symlink2 = Target("$project/weird/path/thingie2", "ln -sf $in $out", fooLib); auto symlinkBar = Target("$builddir/weird/path/thingie2", "ln -sf $in $out", fooLib); immutable dirName = "/made/up/dir"; realTargetPath(dirName, symlink1.rawOutputs[0]).shouldEqual("$project/weird/path/thingie1"); realTargetPath(dirName, symlink2.rawOutputs[0]).shouldEqual("$project/weird/path/thingie2"); realTargetPath(dirName, fooLib.rawOutputs[0]).shouldEqual("$project/foo.so"); realTargetPath(dirName, symlinkBar.rawOutputs[0]).shouldEqual("weird/path/thingie2"); realTargetPath(dirName, barLib.rawOutputs[0]).shouldEqual("bar.so"); } void testOptional() { enum foo = Target("foo", "dmd -of$out $in", Target("foo.d")); enum bar = Target("bar", "dmd -of$out $in", Target("bar.d")); optional(bar).target.shouldEqual(bar); mixin build!(foo, optional(bar)); auto build = buildFunc(); build.targets.array[1].shouldEqual(bar); } void testDiamondDeps() { auto src1 = Target("src1.d"); auto src2 = Target("src2.d"); auto obj1 = Target("obj1.o", "dmd -of$out -c $in", src1); auto obj2 = Target("obj2.o", "dmd -of$out -c $in", src2); auto fooLib = Target("$project/foo.so", "dmd -of$out $in", [obj1, obj2]); auto symlink1 = Target("$project/weird/path/thingie1", "ln -sf $in $out", fooLib); auto symlink2 = Target("$project/weird/path/thingie2", "ln -sf $in $out", fooLib); auto build = Build(symlink1, symlink2); auto newObj1 = Target(".reggae/objs/$project/foo.so.objs/obj1.o", "dmd -of$out -c $in", src1); auto newObj2 = Target(".reggae/objs/$project/foo.so.objs/obj2.o", "dmd -of$out -c $in", src2); auto newFooLib = Target("$project/foo.so", "dmd -of$out $in", [newObj1, newObj2]); auto newSymlink1 = Target("$project/weird/path/thingie1", "ln -sf $in $out", newFooLib); auto newSymlink2 = Target("$project/weird/path/thingie2", "ln -sf $in $out", newFooLib); build.range.array.shouldEqual([newObj1, newObj2, newFooLib, newSymlink1, newSymlink2]); } void testPhobosOptionalBug() { enum obj1 = Target("obj1.o", "dmd -of$out -c $in", Target("src1.d")); enum obj2 = Target("obj2.o", "dmd -of$out -c $in", Target("src2.d")); enum foo = Target("foo", "dmd -of$out $in", [obj1, obj2]); Target bar() { return Target("bar", "dmd -of$out $in", [obj1, obj2]); } mixin build!(foo, optional!(bar)); auto build = buildFunc(); auto fooObj1 = Target(".reggae/objs/foo.objs/obj1.o", "dmd -of$out -c $in", Target("src1.d")); auto fooObj2 = Target(".reggae/objs/foo.objs/obj2.o", "dmd -of$out -c $in", Target("src2.d")); auto newFoo = Target("foo", "dmd -of$out $in", [fooObj1, fooObj2]); auto barObj1 = Target(".reggae/objs/bar.objs/obj1.o", "dmd -of$out -c $in", Target("src1.d")); auto barObj2 = Target(".reggae/objs/bar.objs/obj2.o", "dmd -of$out -c $in", Target("src2.d")); auto newBar = Target("bar", "dmd -of$out $in", [barObj1, barObj2]); build.range.array.shouldEqual([fooObj1, fooObj2, newFoo, barObj1, barObj2, newBar]); } void testOutputsInProjectPath() { auto mkDir = Target("$project/foodir", "mkdir -p $out", [], []); mkDir.expandOutputs("/path/to/proj").shouldEqual(["/path/to/proj/foodir"]); } void testExpandOutputs() { auto foo = Target("$project/foodir", "mkdir -p $out", [], []); foo.expandOutputs("/path/to/proj").array.shouldEqual(["/path/to/proj/foodir"]); auto bar = Target("$builddir/foodir", "mkdir -p $out", [], []); bar.expandOutputs("/path/to/proj").array.shouldEqual(["foodir"]); } void testCommandBuilddir() { import reggae.config: gDefaultOptions; auto cmd = Command("dmd -of$builddir/ut_debug $in"); cmd.shellCommand(gDefaultOptions.withProjectPath("/path/to/proj"), Language.unknown, ["$builddir/ut_debug"], ["foo.d"]). shouldEqual("dmd -ofut_debug foo.d"); } void testBuilddirInTopLevelTarget() { auto ao = objectFile(SourceFile("a.c")); auto liba = Target("$builddir/liba.a", "ar rcs liba.a a.o", [ao]); mixin build!(liba); auto build = buildFunc(); build.targets[0].rawOutputs.shouldEqual(["liba.a"]); } void testOutputInBuildDir() { auto target = Target("$builddir/foo/bar", "cmd", [Target("foo.d"), Target("bar.d")]); target.expandOutputs("/path/to").shouldEqual(["foo/bar"]); } void testOutputInProjectDir() { auto target = Target("$project/foo/bar", "cmd", [Target("foo.d"), Target("bar.d")]); target.expandOutputs("/path/to").shouldEqual(["/path/to/foo/bar"]); } void testCmdInBuildDir() { auto target = Target("output", "cmd -I$builddir/include $in $out", [Target("foo.d"), Target("bar.d")]); target.shellCommand(gDefaultOptions.withProjectPath("/path/to")).shouldEqual("cmd -Iinclude /path/to/foo.d /path/to/bar.d output"); } void testCmdInProjectDir() { auto target = Target("output", "cmd -I$project/include $in $out", [Target("foo.d"), Target("bar.d")]); target.shellCommand(gDefaultOptions.withProjectPath("/path/to")).shouldEqual("cmd -I/path/to/include /path/to/foo.d /path/to/bar.d output"); } void testDepsInBuildDir() { auto target = Target("output", "cmd", [Target("$builddir/foo.d"), Target("$builddir/bar.d")]); target.dependenciesInProjectPath("/path/to").shouldEqual(["foo.d", "bar.d"]); } void testDepsInProjectDir() { auto target = Target("output", "cmd", [Target("$project/foo.d"), Target("$project/bar.d")]); target.dependenciesInProjectPath("/path/to").shouldEqual(["/path/to/foo.d", "/path/to/bar.d"]); } void testBuildWithOneDepInBuildDir() { auto target = Target("output", "cmd -o $out -c $in", Target("$builddir/input.d")); alias top = link!(ExeName("ut"), targetConcat!(target)); auto build = Build(top); build.targets[0].dependencyTargets[0].dependenciesInProjectPath("/path/to").shouldEqual(["input.d"]); } @("Replace concrete compiler with variables") unittest { immutable str = "\n" ~ "clang -o foo -c foo.c\n" ~ "clang++ -o foo -c foo.cpp\n" ~ "ldmd -offoo -c foo.d\n"; auto opts = Options(); opts.cCompiler = "clang"; opts.cppCompiler = "clang++"; opts.dCompiler = "ldmd"; str.replaceConcreteCompilersWithVars(opts).shouldEqual( "\n" ~ "$(CC) -o foo -c foo.c\n" ~ "$(CXX) -o foo -c foo.cpp\n" ~ "$(DC) -offoo -c foo.d\n" ); } @("optional targets should also sandbox their dependencies") unittest { auto med = Target("med", "medcmd -o $out $in", Target("input")); auto tgt = Target("output", "cmd -o $out $in", med); auto build = Build(optional(tgt)); build.targets.shouldEqual( [Target("output", "cmd -o $out $in", Target(".reggae/objs/output.objs/med", "medcmd -o $out $in", "input"))]); } @("input path with environment variable") unittest { auto build = Build(Target("app", "dmd -of$out $in", [Target("foo.d"), Target("$LIB/liblua.a")])); Options options; options.projectPath = "/proj"; build.targets[0].shellCommand(options).shouldEqual("dmd -ofapp /proj/foo.d $LIB/liblua.a"); build.targets[0].dependenciesInProjectPath(options.projectPath) .shouldEqual(["/proj/foo.d", "$LIB/liblua.a"]); }
D
module com.sun.jna.Structure; public class Structure { }
D
module app; import vibe.core.core; import vibe.core.log; import vibe.http.auth.basic_auth; import vibe.http.client; import vibe.http.router; import vibe.http.server; import vibe.web.auth; import vibe.web.rest; import std.algorithm : among; import std.datetime; import std.format : format; shared static this() { auto settings = new HTTPServerSettings; settings.port = 0; settings.bindAddresses = ["127.0.0.1"]; auto router = new URLRouter; router.registerRestInterface(new Service); immutable serverAddr = listenHTTP(settings, router).bindAddresses[0]; runTask({ scope (exit) exitEventLoop(); void test(string url, string user, HTTPStatus expected) nothrow { try requestHTTP("http://" ~ serverAddr.toString ~ url, (scope req) { if (user !is null) req.addBasicAuth(user, "secret"); }, (scope res) { res.dropBody(); assert(res.statusCode == expected, format("Unexpected status code for GET %s (%s): %s", url, user, res.statusCode)); }); catch (Exception e) assert(false, e.msg); } test("/public", null, HTTPStatus.ok); test("/any", null, HTTPStatus.unauthorized); test("/any", "stacy", HTTPStatus.ok); test("/any_a", null, HTTPStatus.unauthorized); test("/any_a", "stacy", HTTPStatus.ok); test("/admin", null, HTTPStatus.unauthorized); test("/admin", "admin", HTTPStatus.ok); test("/admin", "peter", HTTPStatus.forbidden); test("/admin", "stacy", HTTPStatus.forbidden); test("/admin_a", null, HTTPStatus.unauthorized); test("/admin_a", "admin", HTTPStatus.ok); test("/admin_a", "peter", HTTPStatus.forbidden); test("/admin_a", "stacy", HTTPStatus.forbidden); test("/member", "admin", HTTPStatus.forbidden); test("/member", "peter", HTTPStatus.ok); test("/member", "stacy", HTTPStatus.forbidden); test("/admin_member", "peter", HTTPStatus.ok); test("/admin_member", "admin", HTTPStatus.ok); test("/admin_member", "stacy", HTTPStatus.forbidden); test("/nobody", "peter", HTTPStatus.forbidden); test("/nobody", "admin", HTTPStatus.forbidden); test("/nobody", "stacy", HTTPStatus.forbidden); logInfo("All auth tests successful."); }); } struct Auth { string username; bool isAdmin() { return username == "admin"; } bool isMember() { return username == "peter"; } } @requiresAuth interface IService { @noAuth int getPublic(); @anyAuth int getAny(); @anyAuth int getAnyA(Auth auth); @auth(Role.admin) int getAdmin(); @auth(Role.admin) int getAdminA(Auth auth); @auth(Role.member) int getMember(); @auth(Role.admin | Role.member) int getAdminMember(); @auth(Role.admin & Role.member) int getNobody(); } class Service : IService { int getPublic() { return 42; } int getAny() { return 42; } int getAnyA(Auth auth) { assert(auth.username.among("admin", "peter", "stacy")); return 42; } int getAdmin() { return 42; } int getAdminA(Auth auth) { assert(auth.username == "admin"); return 42; } int getMember() { return 42; } int getAdminMember() { return 42; } int getNobody() { return 42; } Auth authenticate(HTTPServerRequest req, HTTPServerResponse res) { Auth ret; ret.username = performBasicAuth(req, res, "test", (user, pw) { return pw == "secret"; }); return ret; } }
D
/Users/hnakatani/Documents/その他/Learning/Rust/tutrial/10_2_trait/target/debug/traitt: /Users/hnakatani/Documents/その他/Learning/Rust/tutrial/10_2_trait/src/main.rs
D
module android.java.java.util.Date_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import1 = android.java.java.time.Instant_d_interface; import import2 = android.java.java.lang.Class_d_interface; import import0 = android.java.java.util.Date_d_interface; final class Date : IJavaObject { static immutable string[] _d_canCastTo = [ "java/io/Serializable", "java/lang/Cloneable", "java/lang/Comparable", ]; @Import this(arsd.jni.Default); @Import this(long); @Import this(int, int, int); @Import this(int, int, int, int, int); @Import this(int, int, int, int, int, int); @Import this(string); @Import IJavaObject clone(); @Import static long UTC(int, int, int, int, int, int); @Import static long parse(string); @Import int getYear(); @Import void setYear(int); @Import int getMonth(); @Import void setMonth(int); @Import int getDate(); @Import void setDate(int); @Import int getDay(); @Import int getHours(); @Import void setHours(int); @Import int getMinutes(); @Import void setMinutes(int); @Import int getSeconds(); @Import void setSeconds(int); @Import long getTime(); @Import void setTime(long); @Import bool before(import0.Date); @Import bool after(import0.Date); @Import bool equals(IJavaObject); @Import int compareTo(import0.Date); @Import int hashCode(); @Import @JavaName("toString") string toString_(); override string toString() { return arsd.jni.javaObjectToString(this); } @Import string toLocaleString(); @Import string toGMTString(); @Import int getTimezoneOffset(); @Import static import0.Date from(import1.Instant); @Import import1.Instant toInstant(); @Import int compareTo(IJavaObject); @Import import2.Class getClass(); @Import void notify(); @Import void notifyAll(); @Import void wait(long); @Import void wait(long, int); @Import void wait(); mixin IJavaObjectImplementation!(false); public static immutable string _javaParameterString = "Ljava/util/Date;"; }
D
import std.stdio; T[] forwardDifference(T)(T[] s, in int n) pure nothrow @nogc { foreach (immutable i; 0 .. n) s[0 .. $ - i - 1] = s[1 .. $ - i] - s[0 .. $ - i - 1]; return s[0 .. $ - n]; } void main() { immutable A = [90.5, 47, 58, 29, 22, 32, 55, 5, 55, 73.5]; foreach (immutable level; 0 .. A.length) forwardDifference(A.dup, level).writeln; }
D
module android.java.android.widget.GridLayout_LayoutParams_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import3 = android.java.android.widget.GridLayout_LayoutParams_d_interface; import import6 = android.java.java.lang.Class_d_interface; import import5 = android.java.android.util.AttributeSet_d_interface; import import2 = android.java.android.view.ViewGroup_MarginLayoutParams_d_interface; import import1 = android.java.android.view.ViewGroup_LayoutParams_d_interface; import import0 = android.java.android.widget.GridLayout_Spec_d_interface; import import4 = android.java.android.content.Context_d_interface; @JavaName("GridLayout$LayoutParams") final class GridLayout_LayoutParams : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import this(import0.GridLayout_Spec, import0.GridLayout_Spec); @Import this(arsd.jni.Default); @Import this(import1.ViewGroup_LayoutParams); @Import this(import2.ViewGroup_MarginLayoutParams); @Import this(import3.GridLayout_LayoutParams); @Import this(import4.Context, import5.AttributeSet); @Import void setGravity(int); @Import bool equals(IJavaObject); @Import int hashCode(); @Import void setMargins(int, int, int, int); @Import void setMarginStart(int); @Import int getMarginStart(); @Import void setMarginEnd(int); @Import int getMarginEnd(); @Import bool isMarginRelative(); @Import void setLayoutDirection(int); @Import int getLayoutDirection(); @Import void resolveLayoutDirection(int); @Import import6.Class getClass(); @Import @JavaName("toString") string toString_(); override string toString() { return arsd.jni.javaObjectToString(this); } @Import void notify(); @Import void notifyAll(); @Import void wait(long); @Import void wait(long, int); @Import void wait(); mixin IJavaObjectImplementation!(false); public static immutable string _javaParameterString = "Landroid/widget/GridLayout$LayoutParams;"; }
D
module d.gc.run; struct RunDesc { import d.gc.rbtree; Node!RunDesc node; // FIXME: Use anonymous enum when SDC supports them. union U { DirtyRunMisc dirty; SmallRunMisc small; } U misc; @property ref DirtyRunMisc dirty() { // FIXME: in contract auto pd = chunk.pages[runID]; assert(pd.free, "Expected free run"); assert(pd.dirty, "Expected dirty run"); return misc.dirty; } @property ref SmallRunMisc small() { // FIXME: in contract auto pd = chunk.pages[runID]; assert(pd.allocated, "Expected allocated run"); assert(pd.offset == 0, "Invalid run"); assert(pd.small, "Expected small run"); return misc.small; } @property auto chunk() { import d.gc.chunk, d.gc.spec; return cast(Chunk*) ((cast(size_t) &this) & ~ChunkAlignMask); } @property uint runID() { auto offset = (cast(uint) &this) - (cast(uint) &chunk.runs[0]); uint r = offset / RunDesc.sizeof; // FIXME: out contract import d.gc.chunk; assert(r < DataPages); return r; } } ptrdiff_t addrRunCmp(RunDesc* lhs, RunDesc* rhs) { auto l = cast(size_t) lhs; auto r = cast(size_t) rhs; // We need to compare that way to avoid integer overflow. return (l > r) - (l < r); } ptrdiff_t sizeAddrRunCmp(RunDesc* lhs, RunDesc* rhs) { import d.gc.sizeclass; int rBinID = rhs.chunk.pages[rhs.runID].binID; auto rsize = rhs.chunk.pages[rhs.runID].size; assert(rBinID == getBinID(rsize + 1) - 1); auto l = cast(size_t) lhs; int lBinID; import d.gc.spec; if (l & ~PageMask) { lBinID = lhs.chunk.pages[lhs.runID].binID; auto lsize = lhs.chunk.pages[lhs.runID].size; assert(lBinID == getBinID(lsize + 1) - 1); } else { lhs = null; lBinID = cast(int) (l & PageMask); } return (lBinID == rBinID) ? addrRunCmp(lhs, rhs) : lBinID - rBinID; } private: struct DirtyRunMisc { RunDesc* next; RunDesc* prev; } struct SmallRunMisc { ubyte binID; ushort freeSlots; ushort bitmapIndex; ushort header; uint[16] bitmap; uint allocate() { // TODO: in contracts. assert(freeSlots > 0); import sdc.intrinsics; uint hindex = countTrailingZeros(header); assert(hindex < 16, "Cannot allocate from that run"); auto bindex = countTrailingZeros(bitmap[hindex]); assert(bindex < 32, "Invalid bitmap"); // Use xor so we don't need to invert bits. // It is ok as we assert the bit is unset before. bitmap[hindex] ^= (1 << bindex); // If we unset all bits, unset header. if (bitmap[hindex] == 0) { header ^= cast(ushort) (1 << hindex); } // If we are GCing, mark the new allocation as live. if (bitmapIndex != 0) { import d.gc.chunk, d.gc.spec; auto chunk = cast(Chunk*) ((cast(size_t) &this) & ~ChunkAlignMask); assert(chunk.header.bitmap !is null); auto bPtr = chunk.header.bitmap + bitmapIndex + hindex; // This is live, don't collect it ! *bPtr = *bPtr | (1 << bindex); } freeSlots--; return hindex * 32 + bindex; } bool isFree(uint bit) const { // TODO: in contract. assert(bit < 512); auto hindex = bit / 32; auto bindex = bit % 32; // TODO: in contract. assert(hindex < 16); return !!(bitmap[hindex] & (1 << bindex)); } void free(uint bit) { // TODO: in contract. assert(bit < 512); assert(!isFree(bit), "Already freed"); auto hindex = bit / 32; auto bindex = bit % 32; // TODO: in contract. assert(hindex < 16); freeSlots++; header |= cast(ushort) (1 << hindex); bitmap[hindex] |= (1 << bindex); } }
D
module android.java.android.webkit.WebViewRenderProcess_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import0 = android.java.java.lang.Class_d_interface; final class WebViewRenderProcess : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import this(arsd.jni.Default); @Import bool terminate(); @Import import0.Class getClass(); @Import int hashCode(); @Import bool equals(IJavaObject); @Import @JavaName("toString") string toString_(); override string toString() { return arsd.jni.javaObjectToString(this); } @Import void notify(); @Import void notifyAll(); @Import void wait(long); @Import void wait(long, int); @Import void wait(); mixin IJavaObjectImplementation!(false); public static immutable string _javaParameterString = "Landroid/webkit/WebViewRenderProcess;"; }
D
import std.stdio; int main(string[] argv) { writeln("Hello D-World!"); writeln("Whaaaaaa!"); readln(); return 0; }
D
module voxelman.command.plugininfo; enum id = "voxelman.command"; enum semver = "0.5.0"; enum deps = []; enum clientdeps = []; enum serverdeps = [];
D
/** Copyright: Copyright (c) 2014 Andrey Penechko. License: a$(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: Andrey Penechko. */ module anchovy.gui.utils.widgetmanager; import anchovy.gui; //version = Debug_wman; alias WidgetCreator = Widget delegate(); alias LayoutCreator = ILayout delegate(); alias BehaviorCreator = IWidgetBehavior delegate(); struct WidgetManager { @disable this(); this(GuiContext context) { _context = context; } /// Returns widget found by given id. Widget getWidgetById(string id) { if (auto widget = id in _ids) { return *widget; } else return null; } void setGroupSelected(int groupId, Widget widget) { auto wasSelectedPtr = groupId in _groupSelections; Widget wasSelected = wasSelectedPtr ? *wasSelectedPtr : null; _groupSelections[groupId] = widget; if (wasSelected !is null) { wasSelected.handleEvent(new GroupSelectionEvent(widget)); } } Widget getGroupSelected(uint groupId) { if (auto selection = groupId in _groupSelections) { return *selection; } return null; } Widget createWidget(string type, Widget parent = null) { return createWidgetImpl(type, parent); } private: /// Stores widgets with id property. Widget[string] _ids; Widget[int] _groupSelections; GuiContext _context; //---------------------------- Helpers --------------------------------- Widget createWidgetImpl(string type, Widget parent) { Widget widget; IWidgetBehavior[] behaviors; void attachBehaviorProperties(Widget _widget) { //----------------------- Attaching behaviors properties --------------------------- if (auto factories = type in _context.behaviorFactories) { IWidgetBehavior behavior; foreach(factory; *factories) { behavior = factory(); behavior.attachPropertiesTo(_widget); behaviors ~= behavior; } } } //----------------------- Instatiating templates --------------------------- WidgetTemplate templ = _context.templateManager.getTemplate(type); if (templ) { //----------------------- Base type construction ----------------------- Widget baseWidget; if (templ.baseType != "widget") { baseWidget = createWidget(templ.baseType); } else { baseWidget = createBaseWidget(type); // Create using factory. attachBehaviorProperties(baseWidget); } baseWidget["context"] = _context; // widget may access context before construction ends. baseWidget.setProperty!("subwidgets", Widget[string])(null); //----------------------- Template construction ------------------------ // Recursively creates widgets as stated in template. widget is root of that tree. widget = createSubwidget(templ.tree, baseWidget, baseWidget); if (templ.container) { auto subwidgets = widget.getPropertyAs!("subwidgets", Widget[string]); auto container = subwidgets[templ.container]; if (container) { version(Debug_wman) writefln("Adding container %s", templ.container); widget["container"] = container; } } widget["template"] = templ; } else { // if there is no template, lets create regular one. widget = createBaseWidget(type); attachBehaviorProperties(widget); } // Set given type, even if no such template exists. // Helps to distinguish widgets. widget["type"] = type; // default style if (widget["style"] == Variant(null)) { widget["style"] = type; } widget["context"] = _context; // if widget attempts to override context. // adding parent if (parent !is null) { addChild(parent, widget); } else { widget["parent"] = null; } //----------------------- Attaching behaviors --------------------------- foreach(behavior; behaviors) { behavior.attachTo(widget); } widget["behaviors"] = behaviors; return widget; } Widget createBaseWidget(string type) { if (auto factory = type in _context.widgetFactories) { return _context.widgetFactories[type](); } else { return new Widget; } } import std.conv : parse; import std.string : munch; Variant parseProperty(string name, ref Variant value, Widget widget) { switch(name) { case "layout": version(Debug_wman) writeln("found layout property: ", value.get!string); if (auto factory = value.get!string in _context.layoutFactories) { auto result = Variant((*factory)()); return result; } writefln("Error: unknown layout '%s' found", value.get!string); break; case "minSize", "prefSize", "position": try { string nums = value.get!string; int w = parse!int(nums); munch(nums, " \t\n\r"); int h = parse!int(nums); return Variant(ivec2(w, h)); } catch (Exception e) { writefln("Error parsing %s %s from %s", name, e, value); } return Variant(ivec2(16, 16)); case "id": string id = value.get!string; if (id in _ids) { writeln("Duplicate id found: ", id, ", overriding..."); } _ids[id] = widget; return value; default: return value; } return value; } Widget createSubwidget(SubwidgetTemplate sub, Widget subwidget, Widget root) { //----------------------- Forwarding properties ------------------------ foreach(forwardedProperty; sub.forwardedProperties) { version(Debug_wman) writefln("forwarding %s.%s to %s.%s", root["type"], forwardedProperty.propertyName, subwidget["name"], forwardedProperty.targetPropertyName); root[forwardedProperty.propertyName] = subwidget.property(forwardedProperty.targetPropertyName); } //------------------------ Assigning properties ------------------------ foreach(propertyKey; sub.properties.byKey) { version(Debug_wman)writeln("new property ", propertyKey); Variant value = parseProperty(propertyKey, sub.properties[propertyKey], subwidget); version(Debug_wman)writeln("Parsed value ", value); version(Debug_wman)writefln("Assigning properties %s %s %s %s %s %s", propertyKey, value, subwidget["name"], subwidget["type"], root["name"], root["type"]); subwidget[propertyKey] = value; } Variant* name = "name" in sub.properties; if(name) { if (auto subtemplateName = name.peek!string) { Widget[string] subwidgets = root["subwidgets"].get!(Widget[string]); subwidgets[*subtemplateName] = subwidget; root["subwidgets"] = subwidgets; } } // Attach subwidgets root widget. subwidget["root"] = root; //------------------------ Creating subwidgets ------------------------- foreach(subtemplate; sub.subwidgets) { version(Debug_wman) writefln("%s: Adding subwidget %s", subwidget["name"], subtemplate.properties["type"].get!string); createSubwidget(subtemplate, createWidget(subtemplate.properties["type"].get!string, subwidget), root); } return subwidget; } }
D
/* Converted to D from gsl_matrix_short.h by htod * and edited by daniel truemper <truemped.dsource <with> hence22.org> */ module auxc.gsl.gsl_matrix_short; /* matrix/gsl_matrix_short.h * * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman, Brian Gough * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import tango.stdc.stdlib; import tango.stdc.stdio; public import auxc.gsl.gsl_types; public import auxc.gsl.gsl_errno; public import auxc.gsl.gsl_check_range; public import auxc.gsl.gsl_vector_short; extern (C): struct gsl_matrix_short { size_t size1; size_t size2; size_t tda; short *data; gsl_block_short *block; int owner; }; struct _gsl_matrix_short_view { gsl_matrix_short matrix; }; alias _gsl_matrix_short_view gsl_matrix_short_view; struct _gsl_matrix_short_const_view { gsl_matrix_short matrix; }; alias _gsl_matrix_short_const_view gsl_matrix_short_const_view; /* Allocation */ gsl_matrix_short * gsl_matrix_short_alloc(size_t n1, size_t n2); gsl_matrix_short * gsl_matrix_short_calloc(size_t n1, size_t n2); gsl_matrix_short * gsl_matrix_short_alloc_from_block(gsl_block_short *b, size_t offset, size_t n1, size_t n2, size_t d2); gsl_matrix_short * gsl_matrix_short_alloc_from_matrix(gsl_matrix_short *m, size_t k1, size_t k2, size_t n1, size_t n2); gsl_vector_short * gsl_vector_short_alloc_row_from_matrix(gsl_matrix_short *m, size_t i); gsl_vector_short * gsl_vector_short_alloc_col_from_matrix(gsl_matrix_short *m, size_t j); void gsl_matrix_short_free(gsl_matrix_short *m); /* Views */ _gsl_matrix_short_view gsl_matrix_short_submatrix(gsl_matrix_short *m, size_t i, size_t j, size_t n1, size_t n2); _gsl_vector_short_view gsl_matrix_short_row(gsl_matrix_short *m, size_t i); _gsl_vector_short_view gsl_matrix_short_column(gsl_matrix_short *m, size_t j); _gsl_vector_short_view gsl_matrix_short_diagonal(gsl_matrix_short *m); _gsl_vector_short_view gsl_matrix_short_subdiagonal(gsl_matrix_short *m, size_t k); _gsl_vector_short_view gsl_matrix_short_superdiagonal(gsl_matrix_short *m, size_t k); _gsl_matrix_short_view gsl_matrix_short_view_array(short *base, size_t n1, size_t n2); _gsl_matrix_short_view gsl_matrix_short_view_array_with_tda(short *base, size_t n1, size_t n2, size_t tda); _gsl_matrix_short_view gsl_matrix_short_view_vector(gsl_vector_short *v, size_t n1, size_t n2); _gsl_matrix_short_view gsl_matrix_short_view_vector_with_tda(gsl_vector_short *v, size_t n1, size_t n2, size_t tda); _gsl_matrix_short_const_view gsl_matrix_short_const_submatrix(gsl_matrix_short *m, size_t i, size_t j, size_t n1, size_t n2); _gsl_vector_short_const_view gsl_matrix_short_const_row(gsl_matrix_short *m, size_t i); _gsl_vector_short_const_view gsl_matrix_short_const_column(gsl_matrix_short *m, size_t j); _gsl_vector_short_const_view gsl_matrix_short_const_diagonal(gsl_matrix_short *m); _gsl_vector_short_const_view gsl_matrix_short_const_subdiagonal(gsl_matrix_short *m, size_t k); _gsl_vector_short_const_view gsl_matrix_short_const_superdiagonal(gsl_matrix_short *m, size_t k); _gsl_matrix_short_const_view gsl_matrix_short_const_view_array(short *base, size_t n1, size_t n2); _gsl_matrix_short_const_view gsl_matrix_short_const_view_array_with_tda(short *base, size_t n1, size_t n2, size_t tda); _gsl_matrix_short_const_view gsl_matrix_short_const_view_vector(gsl_vector_short *v, size_t n1, size_t n2); _gsl_matrix_short_const_view gsl_matrix_short_const_view_vector_with_tda(gsl_vector_short *v, size_t n1, size_t n2, size_t tda); /* Operations */ short gsl_matrix_short_get(gsl_matrix_short *m, size_t i, size_t j); void gsl_matrix_short_set(gsl_matrix_short *m, size_t i, size_t j, short x); short * gsl_matrix_short_ptr(gsl_matrix_short *m, size_t i, size_t j); short * gsl_matrix_short_const_ptr(gsl_matrix_short *m, size_t i, size_t j); void gsl_matrix_short_set_zero(gsl_matrix_short *m); void gsl_matrix_short_set_identity(gsl_matrix_short *m); void gsl_matrix_short_set_all(gsl_matrix_short *m, short x); int gsl_matrix_short_fread(FILE *stream, gsl_matrix_short *m); int gsl_matrix_short_fwrite(FILE *stream, gsl_matrix_short *m); int gsl_matrix_short_fscanf(FILE *stream, gsl_matrix_short *m); int gsl_matrix_short_fprintf(FILE *stream, gsl_matrix_short *m, char *format); int gsl_matrix_short_memcpy(gsl_matrix_short *dest, gsl_matrix_short *src); int gsl_matrix_short_swap(gsl_matrix_short *m1, gsl_matrix_short *m2); int gsl_matrix_short_swap_rows(gsl_matrix_short *m, size_t i, size_t j); int gsl_matrix_short_swap_columns(gsl_matrix_short *m, size_t i, size_t j); int gsl_matrix_short_swap_rowcol(gsl_matrix_short *m, size_t i, size_t j); int gsl_matrix_short_transpose(gsl_matrix_short *m); int gsl_matrix_short_transpose_memcpy(gsl_matrix_short *dest, gsl_matrix_short *src); short gsl_matrix_short_max(gsl_matrix_short *m); short gsl_matrix_short_min(gsl_matrix_short *m); void gsl_matrix_short_minmax(gsl_matrix_short *m, short *min_out, short *max_out); void gsl_matrix_short_max_index(gsl_matrix_short *m, size_t *imax, size_t *jmax); void gsl_matrix_short_min_index(gsl_matrix_short *m, size_t *imin, size_t *jmin); void gsl_matrix_short_minmax_index(gsl_matrix_short *m, size_t *imin, size_t *jmin, size_t *imax, size_t *jmax); int gsl_matrix_short_isnull(gsl_matrix_short *m); int gsl_matrix_short_add(gsl_matrix_short *a, gsl_matrix_short *b); int gsl_matrix_short_sub(gsl_matrix_short *a, gsl_matrix_short *b); int gsl_matrix_short_mul_elements(gsl_matrix_short *a, gsl_matrix_short *b); int gsl_matrix_short_div_elements(gsl_matrix_short *a, gsl_matrix_short *b); int gsl_matrix_short_scale(gsl_matrix_short *a, double x); int gsl_matrix_short_add_constant(gsl_matrix_short *a, double x); int gsl_matrix_short_add_diagonal(gsl_matrix_short *a, double x); /***********************************************************************/ /* The functions below are obsolete */ /***********************************************************************/ int gsl_matrix_short_get_row(gsl_vector_short *v, gsl_matrix_short *m, size_t i); int gsl_matrix_short_get_col(gsl_vector_short *v, gsl_matrix_short *m, size_t j); int gsl_matrix_short_set_row(gsl_matrix_short *m, size_t i, gsl_vector_short *v); int gsl_matrix_short_set_col(gsl_matrix_short *m, size_t j, gsl_vector_short *v); /* inline functions if you are using GCC */
D
// REQUIRED_ARGS: // PERMUTE_ARGS: -mcpu=native version (D_SIMD) { import core.simd; import core.stdc.string; import std.stdio; alias TypeTuple(T...) = T; /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=16087 static assert(void16.alignof == 16); static assert(double2.alignof == 16); static assert(float4.alignof == 16); static assert(byte16.alignof == 16); static assert(ubyte16.alignof == 16); static assert(short8.alignof == 16); static assert(ushort8.alignof == 16); static assert(int4.alignof == 16); static assert(uint4.alignof == 16); static assert(long2.alignof == 16); static assert(ulong2.alignof == 16); static assert(void16.sizeof == 16); static assert(double2.sizeof == 16); static assert(float4.sizeof == 16); static assert(byte16.sizeof == 16); static assert(ubyte16.sizeof == 16); static assert(short8.sizeof == 16); static assert(ushort8.sizeof == 16); static assert(int4.sizeof == 16); static assert(uint4.sizeof == 16); static assert(long2.sizeof == 16); static assert(ulong2.sizeof == 16); version (D_AVX) { static assert(void32.alignof == 32); static assert(double4.alignof == 32); static assert(float8.alignof == 32); static assert(byte32.alignof == 32); static assert(ubyte32.alignof == 32); static assert(short16.alignof == 32); static assert(ushort16.alignof == 32); static assert(int8.alignof == 32); static assert(uint8.alignof == 32); static assert(long4.alignof == 32); static assert(ulong4.alignof == 32); static assert(void32.sizeof == 32); static assert(double4.sizeof == 32); static assert(float8.sizeof == 32); static assert(byte32.sizeof == 32); static assert(ubyte32.sizeof == 32); static assert(short16.sizeof == 32); static assert(ushort16.sizeof == 32); static assert(int8.sizeof == 32); static assert(uint8.sizeof == 32); static assert(long4.sizeof == 32); static assert(ulong4.sizeof == 32); } /*****************************************/ void test1() { void16 v1 = void,v2 = void; byte16 b; v2 = b; v1 = v2; static assert(!__traits(compiles, v1 + v2)); static assert(!__traits(compiles, v1 - v2)); static assert(!__traits(compiles, v1 * v2)); static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); static assert(!__traits(compiles, v1 & v2)); static assert(!__traits(compiles, v1 | v2)); static assert(!__traits(compiles, v1 ^ v2)); static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); static assert(!__traits(compiles, ~v1)); static assert(!__traits(compiles, -v1)); static assert(!__traits(compiles, +v1)); static assert(!__traits(compiles, !v1)); static assert(!__traits(compiles, v1 += v2)); static assert(!__traits(compiles, v1 -= v2)); static assert(!__traits(compiles, v1 *= v2)); static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); static assert(!__traits(compiles, v1 &= v2)); static assert(!__traits(compiles, v1 |= v2)); static assert(!__traits(compiles, v1 ^= v2)); static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2() { byte16 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; static assert(!__traits(compiles, v1 * v2)); static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; static assert(!__traits(compiles, v1 *= v2)); static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2b() { ubyte16 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; static assert(!__traits(compiles, v1 * v2)); static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; static assert(!__traits(compiles, v1 *= v2)); static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2c() { short8 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; v1 = v2 * v3; static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; v1 *= v2; static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); v1 = v1 * 3; // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2d() { ushort8 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; v1 = v2 * v3; static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; v1 *= v2; static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2e() { int4 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; version (D_AVX) // SSE4.1 v1 = v2 * v3; else static assert(!__traits(compiles, v1 * v2)); static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; version (D_AVX) // SSE4.1 v1 *= v2; else static assert(!__traits(compiles, v1 *= v2)); static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2f() { uint4 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; version (D_AVX) // SSE4.1 v1 = v2 * v3; else static assert(!__traits(compiles, v1 * v2)); static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; version (D_AVX) // SSE4.1 v1 *= v2; else static assert(!__traits(compiles, v1 *= v2)); static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2g() { long2 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; static assert(!__traits(compiles, v1 * v2)); static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; static assert(!__traits(compiles, v1 *= v2)); static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2h() { ulong2 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; static assert(!__traits(compiles, v1 * v2)); static assert(!__traits(compiles, v1 / v2)); static assert(!__traits(compiles, v1 % v2)); v1 = v2 & v3; v1 = v2 | v3; v1 = v2 ^ v3; static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); v1 = ~v2; v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; static assert(!__traits(compiles, v1 *= v2)); static assert(!__traits(compiles, v1 /= v2)); static assert(!__traits(compiles, v1 %= v2)); v1 &= v2; v1 |= v2; v1 ^= v2; static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2i() { float4 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; v1 = v2 * v3; v1 = v2 / v3; static assert(!__traits(compiles, v1 % v2)); static assert(!__traits(compiles, v1 & v2)); static assert(!__traits(compiles, v1 | v2)); static assert(!__traits(compiles, v1 ^ v2)); static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); static assert(!__traits(compiles, ~v1)); v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; v1 *= v2; v1 /= v2; static assert(!__traits(compiles, v1 %= v2)); static assert(!__traits(compiles, v1 &= v2)); static assert(!__traits(compiles, v1 |= v2)); static assert(!__traits(compiles, v1 ^= v2)); static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ void test2j() { double2 v1,v2,v3; v1 = v2; v1 = v2 + v3; v1 = v2 - v3; v1 = v2 * v3; v1 = v2 / v3; static assert(!__traits(compiles, v1 % v2)); static assert(!__traits(compiles, v1 & v2)); static assert(!__traits(compiles, v1 | v2)); static assert(!__traits(compiles, v1 ^ v2)); static assert(!__traits(compiles, v1 ~ v2)); static assert(!__traits(compiles, v1 ^^ v2)); static assert(!__traits(compiles, v1 is v2)); static assert(!__traits(compiles, v1 !is v2)); static assert(!__traits(compiles, v1 == v2)); static assert(!__traits(compiles, v1 != v2)); static assert(!__traits(compiles, v1 < v2)); static assert(!__traits(compiles, v1 > v2)); static assert(!__traits(compiles, v1 <= v2)); static assert(!__traits(compiles, v1 >= v2)); static assert(!__traits(compiles, v1 <> v2)); static assert(!__traits(compiles, v1 !< v2)); static assert(!__traits(compiles, v1 !> v2)); static assert(!__traits(compiles, v1 !<> v2)); static assert(!__traits(compiles, v1 <>= v2)); static assert(!__traits(compiles, v1 !<= v2)); static assert(!__traits(compiles, v1 !>= v2)); static assert(!__traits(compiles, v1 !<>= v2)); static assert(!__traits(compiles, v1 << 1)); static assert(!__traits(compiles, v1 >> 1)); static assert(!__traits(compiles, v1 >>> 1)); static assert(!__traits(compiles, v1 && v2)); static assert(!__traits(compiles, v1 || v2)); static assert(!__traits(compiles, ~v1)); v1 = -v2; v1 = +v2; static assert(!__traits(compiles, !v1)); v1 += v2; v1 -= v2; v1 *= v2; v1 /= v2; static assert(!__traits(compiles, v1 %= v2)); static assert(!__traits(compiles, v1 &= v2)); static assert(!__traits(compiles, v1 |= v2)); static assert(!__traits(compiles, v1 ^= v2)); static assert(!__traits(compiles, v1 ~= v2)); static assert(!__traits(compiles, v1 ^^= v2)); static assert(!__traits(compiles, v1 <<= 1)); static assert(!__traits(compiles, v1 >>= 1)); static assert(!__traits(compiles, v1 >>>= 1)); // A cast from vector to non-vector is allowed only when the target is same size Tsarray. static assert(!__traits(compiles, cast(byte)v1)); // 1byte static assert(!__traits(compiles, cast(short)v1)); // 2byte static assert(!__traits(compiles, cast(int)v1)); // 4byte static assert(!__traits(compiles, cast(long)v1)); // 8byte static assert(!__traits(compiles, cast(float)v1)); // 4byte static assert(!__traits(compiles, cast(double)v1)); // 8byte static assert(!__traits(compiles, cast(int[2])v1)); // 8byte Tsarray static assert( __traits(compiles, cast(int[4])v1)); // 16byte Tsarray, OK static assert( __traits(compiles, cast(long[2])v1)); // 16byte Tsarray, OK } /*****************************************/ float4 test3() { float4 a; a = __simd(XMM.PXOR, a, a); return a; } /*****************************************/ void test4() { int4 c = 7; (cast(int[4])c)[3] = 4; (cast(int*)&c)[2] = 4; c.array[1] = 4; c.ptr[3] = 4; assert(c.length == 4); } /*****************************************/ void BaseTypeOfVector(T : __vector(T[N]), size_t N)(int i) { assert(is(T == int)); assert(N == 4); } void test7411() { BaseTypeOfVector!(__vector(int[4]))(3); } /*****************************************/ // 7951 float[4] test7951() { float4 v1; float4 v2; return cast(float[4])(v1+v2); } /*****************************************/ void test7951_2() { float[4] v1 = [1,2,3,4]; float[4] v2 = [1,2,3,4]; float4 f1, f2, f3; f1.array = v1; f2.array = v2; f3 = f1 + f2; } /*****************************************/ void test7949() { int[4] o = [1,2,3,4]; int4 v1; v1.array = o; int4 v2; v2.array = o; auto r = __simd(XMM.ADDPS, v1,v2); writeln(r.array); } /*****************************************/ immutable ulong2 gulong2 = 0x8000_0000_0000_0000; immutable uint4 guint4 = 0x8000_0000; immutable ushort8 gushort8 = 0x8000; immutable ubyte16 gubyte16 = 0x80; immutable long2 glong2 = 0x7000_0000_0000_0000; immutable int4 gint4 = 0x7000_0000; immutable short8 gshort8 = 0x7000; immutable byte16 gbyte16 = 0x70; immutable float4 gfloat4 = 4.0; immutable double2 gdouble2 = 8.0; void test7414() { immutable ulong2 lulong2 = 0x8000_0000_0000_0000; assert(memcmp(&lulong2, &gulong2, gulong2.sizeof) == 0); immutable uint4 luint4 = 0x8000_0000; assert(memcmp(&luint4, &guint4, guint4.sizeof) == 0); immutable ushort8 lushort8 = 0x8000; assert(memcmp(&lushort8, &gushort8, gushort8.sizeof) == 0); immutable ubyte16 lubyte16 = 0x80; assert(memcmp(&lubyte16, &gubyte16, gubyte16.sizeof) == 0); immutable long2 llong2 = 0x7000_0000_0000_0000; assert(memcmp(&llong2, &glong2, glong2.sizeof) == 0); immutable int4 lint4 = 0x7000_0000; assert(memcmp(&lint4, &gint4, gint4.sizeof) == 0); immutable short8 lshort8 = 0x7000; assert(memcmp(&lshort8, &gshort8, gshort8.sizeof) == 0); immutable byte16 lbyte16 = 0x70; assert(memcmp(&lbyte16, &gbyte16, gbyte16.sizeof) == 0); immutable float4 lfloat4 = 4.0; assert(memcmp(&lfloat4, &gfloat4, gfloat4.sizeof) == 0); immutable double2 ldouble2 = 8.0; assert(memcmp(&ldouble2, &gdouble2, gdouble2.sizeof) == 0); } /*****************************************/ void test7413() { byte16 b = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; assert(b.array[0] == 1); assert(b.array[1] == 2); assert(b.array[2] == 3); assert(b.array[3] == 4); assert(b.array[4] == 5); assert(b.array[5] == 6); assert(b.array[6] == 7); assert(b.array[7] == 8); assert(b.array[8] == 9); assert(b.array[9] == 10); assert(b.array[10] == 11); assert(b.array[11] == 12); assert(b.array[12] == 13); assert(b.array[13] == 14); assert(b.array[14] == 15); assert(b.array[15] == 16); ubyte16 ub = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; assert(ub.array[0] == 1); assert(ub.array[1] == 2); assert(ub.array[2] == 3); assert(ub.array[3] == 4); assert(ub.array[4] == 5); assert(ub.array[5] == 6); assert(ub.array[6] == 7); assert(ub.array[7] == 8); assert(ub.array[8] == 9); assert(ub.array[9] == 10); assert(ub.array[10] == 11); assert(ub.array[11] == 12); assert(ub.array[12] == 13); assert(ub.array[13] == 14); assert(ub.array[14] == 15); assert(ub.array[15] == 16); short8 s = [1,2,3,4,5,6,7,8]; assert(s.array[0] == 1); assert(s.array[1] == 2); assert(s.array[2] == 3); assert(s.array[3] == 4); assert(s.array[4] == 5); assert(s.array[5] == 6); assert(s.array[6] == 7); assert(s.array[7] == 8); ushort8 us = [1,2,3,4,5,6,7,8]; assert(us.array[0] == 1); assert(us.array[1] == 2); assert(us.array[2] == 3); assert(us.array[3] == 4); assert(us.array[4] == 5); assert(us.array[5] == 6); assert(us.array[6] == 7); assert(us.array[7] == 8); int4 i = [1,2,3,4]; assert(i.array[0] == 1); assert(i.array[1] == 2); assert(i.array[2] == 3); assert(i.array[3] == 4); uint4 ui = [1,2,3,4]; assert(ui.array[0] == 1); assert(ui.array[1] == 2); assert(ui.array[2] == 3); assert(ui.array[3] == 4); long2 l = [1,2]; assert(l.array[0] == 1); assert(l.array[1] == 2); ulong2 ul = [1,2]; assert(ul.array[0] == 1); assert(ul.array[1] == 2); float4 f = [1,2,3,4]; assert(f.array[0] == 1); assert(f.array[1] == 2); assert(f.array[2] == 3); assert(f.array[3] == 4); double2 d = [1,2]; assert(d.array[0] == 1); assert(d.array[1] == 2); } /*****************************************/ byte16 b = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; ubyte16 ub = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; short8 s = [1,2,3,4,5,6,7,8]; ushort8 us = [1,2,3,4,5,6,7,8]; int4 i = [1,2,3,4]; uint4 ui = [1,2,3,4]; long2 l = [1,2]; ulong2 ul = [1,2]; float4 f = [1,2,3,4]; double2 d = [1,2]; void test7413_2() { assert(b.array[0] == 1); assert(b.array[1] == 2); assert(b.array[2] == 3); assert(b.array[3] == 4); assert(b.array[4] == 5); assert(b.array[5] == 6); assert(b.array[6] == 7); assert(b.array[7] == 8); assert(b.array[8] == 9); assert(b.array[9] == 10); assert(b.array[10] == 11); assert(b.array[11] == 12); assert(b.array[12] == 13); assert(b.array[13] == 14); assert(b.array[14] == 15); assert(b.array[15] == 16); assert(ub.array[0] == 1); assert(ub.array[1] == 2); assert(ub.array[2] == 3); assert(ub.array[3] == 4); assert(ub.array[4] == 5); assert(ub.array[5] == 6); assert(ub.array[6] == 7); assert(ub.array[7] == 8); assert(ub.array[8] == 9); assert(ub.array[9] == 10); assert(ub.array[10] == 11); assert(ub.array[11] == 12); assert(ub.array[12] == 13); assert(ub.array[13] == 14); assert(ub.array[14] == 15); assert(ub.array[15] == 16); assert(s.array[0] == 1); assert(s.array[1] == 2); assert(s.array[2] == 3); assert(s.array[3] == 4); assert(s.array[4] == 5); assert(s.array[5] == 6); assert(s.array[6] == 7); assert(s.array[7] == 8); assert(us.array[0] == 1); assert(us.array[1] == 2); assert(us.array[2] == 3); assert(us.array[3] == 4); assert(us.array[4] == 5); assert(us.array[5] == 6); assert(us.array[6] == 7); assert(us.array[7] == 8); assert(i.array[0] == 1); assert(i.array[1] == 2); assert(i.array[2] == 3); assert(i.array[3] == 4); assert(ui.array[0] == 1); assert(ui.array[1] == 2); assert(ui.array[2] == 3); assert(ui.array[3] == 4); assert(l.array[0] == 1); assert(l.array[1] == 2); assert(ul.array[0] == 1); assert(ul.array[1] == 2); assert(f.array[0] == 1); assert(f.array[1] == 2); assert(f.array[2] == 3); assert(f.array[3] == 4); assert(d.array[0] == 1); assert(d.array[1] == 2); } /*****************************************/ float bug8060(float x) { int i = *cast(int*)&x; ++i; return *cast(float*)&i; } /*****************************************/ float4 test5(float4 a, float4 b) { a = __simd(XMM.ADDPD, a, b); a = __simd(XMM.ADDSS, a, b); a = __simd(XMM.ADDSD, a, b); a = __simd(XMM.ADDPS, a, b); a = __simd(XMM.PADDB, a, b); a = __simd(XMM.PADDW, a, b); a = __simd(XMM.PADDD, a, b); a = __simd(XMM.PADDQ, a, b); a = __simd(XMM.SUBPD, a, b); a = __simd(XMM.SUBSS, a, b); a = __simd(XMM.SUBSD, a, b); a = __simd(XMM.SUBPS, a, b); a = __simd(XMM.PSUBB, a, b); a = __simd(XMM.PSUBW, a, b); a = __simd(XMM.PSUBD, a, b); a = __simd(XMM.PSUBQ, a, b); a = __simd(XMM.MULPD, a, b); a = __simd(XMM.MULSS, a, b); a = __simd(XMM.MULSD, a, b); a = __simd(XMM.MULPS, a, b); a = __simd(XMM.PMULLW, a, b); a = __simd(XMM.DIVPD, a, b); a = __simd(XMM.DIVSS, a, b); a = __simd(XMM.DIVSD, a, b); a = __simd(XMM.DIVPS, a, b); a = __simd(XMM.PAND, a, b); a = __simd(XMM.POR, a, b); a = __simd(XMM.UCOMISS, a, b); a = __simd(XMM.UCOMISD, a, b); a = __simd(XMM.XORPS, a, b); a = __simd(XMM.XORPD, a, b); a = __simd_sto(XMM.STOSS, a, b); a = __simd_sto(XMM.STOSD, a, b); a = __simd_sto(XMM.STOD, a, b); a = __simd_sto(XMM.STOQ, a, b); a = __simd_sto(XMM.STOAPS, a, b); a = __simd_sto(XMM.STOAPD, a, b); a = __simd_sto(XMM.STODQA, a, b); a = __simd_sto(XMM.STOUPS, a, b); a = __simd_sto(XMM.STOUPD, a, b); a = __simd_sto(XMM.STODQU, a, b); a = __simd_sto(XMM.STOHPD, a, b); a = __simd_sto(XMM.STOHPS, a, b); a = __simd_sto(XMM.STOLPD, a, b); a = __simd_sto(XMM.STOLPS, a, b); a = __simd(XMM.LODSS, a); a = __simd(XMM.LODSD, a); a = __simd(XMM.LODAPS, a); a = __simd(XMM.LODAPD, a); a = __simd(XMM.LODDQA, a); a = __simd(XMM.LODUPS, a); a = __simd(XMM.LODUPD, a); a = __simd(XMM.LODDQU, a); a = __simd(XMM.LODD, a); a = __simd(XMM.LODQ, a); a = __simd(XMM.LODHPD, a); a = __simd(XMM.LODHPS, a); a = __simd(XMM.LODLPD, a); a = __simd(XMM.LODLPS, a); //MOVDQ2Q = 0xF20FD6, // MOVDQ2Q mmx, xmm F2 0F D6 /r /+ LODHPD = 0x660F16, // MOVHPD xmm, mem64 66 0F 16 /r STOHPD = 0x660F17, // MOVHPD mem64, xmm 66 0F 17 /r LODHPS = 0x0F16, // MOVHPS xmm, mem64 0F 16 /r STOHPS = 0x0F17, // MOVHPS mem64, xmm 0F 17 /r MOVLHPS = 0x0F16, // MOVLHPS xmm1, xmm2 0F 16 /r LODLPD = 0x660F12, // MOVLPD xmm, mem64 66 0F 12 /r STOLPD = 0x660F13, // MOVLPD mem64, xmm 66 0F 13 /r a = __simd(XMM.LODLPS, a, b); STOLPS = 0x0F13, // MOVLPS mem64, xmm 0F 13 /r MOVMSKPD = 0x660F50, // MOVMSKPD reg32, xmm 66 0F 50 /r MOVMSKPS = 0x0F50, // MOVMSKPS reg32, xmm 0F 50 /r MOVNTDQ = 0x660FE7, // MOVNTDQ mem128, xmm 66 0F E7 /r MOVNTI = 0x0FC3, // MOVNTI m32,r32 0F C3 /r // MOVNTI m64,r64 0F C3 /r MOVNTPD = 0x660F2B, // MOVNTPD mem128, xmm 66 0F 2B /r MOVNTPS = 0x0F2B, // MOVNTPS mem128, xmm 0F 2B /r //MOVNTQ = 0x0FE7, // MOVNTQ m64, mmx 0F E7 /r //MOVQ2DQ = 0xF30FD6, // MOVQ2DQ xmm, mmx F3 0F D6 /r +/ a = __simd(XMM.LODUPD, a, b); a = __simd_sto(XMM.STOUPD, a, b); a = __simd(XMM.LODUPS, a, b); a = __simd_sto(XMM.STOUPS, a, b); a = __simd(XMM.PACKSSDW, a, b); a = __simd(XMM.PACKSSWB, a, b); a = __simd(XMM.PACKUSWB, a, b); a = __simd(XMM.PADDSB, a, b); a = __simd(XMM.PADDSW, a, b); a = __simd(XMM.PADDUSB, a, b); a = __simd(XMM.PADDUSW, a, b); a = __simd(XMM.PANDN, a, b); a = __simd(XMM.PCMPEQB, a, b); a = __simd(XMM.PCMPEQD, a, b); a = __simd(XMM.PCMPEQW, a, b); a = __simd(XMM.PCMPGTB, a, b); a = __simd(XMM.PCMPGTD, a, b); a = __simd(XMM.PCMPGTW, a, b); a = __simd(XMM.PMADDWD, a, b); a = __simd(XMM.PSLLW, a, b); a = __simd_ib(XMM.PSLLW, a, cast(ubyte)0x7A); a = __simd(XMM.PSLLD, a, b); a = __simd_ib(XMM.PSLLD, a, cast(ubyte)0x7A); a = __simd(XMM.PSLLQ, a, b); a = __simd_ib(XMM.PSLLQ, a, cast(ubyte)0x7A); a = __simd(XMM.PSRAW, a, b); a = __simd_ib(XMM.PSRAW, a, cast(ubyte)0x7A); a = __simd(XMM.PSRAD, a, b); a = __simd_ib(XMM.PSRAD, a, cast(ubyte)0x7A); a = __simd(XMM.PSRLW, a, b); a = __simd_ib(XMM.PSRLW, a, cast(ubyte)0x7A); a = __simd(XMM.PSRLD, a, b); a = __simd_ib(XMM.PSRLD, a, cast(ubyte)0x7A); a = __simd(XMM.PSRLQ, a, b); a = __simd_ib(XMM.PSRLQ, a, cast(ubyte)0x7A); a = __simd(XMM.PSUBSB, a, b); a = __simd(XMM.PSUBSW, a, b); a = __simd(XMM.PSUBUSB, a, b); a = __simd(XMM.PSUBUSW, a, b); a = __simd(XMM.PUNPCKHBW, a, b); a = __simd(XMM.PUNPCKHDQ, a, b); a = __simd(XMM.PUNPCKHWD, a, b); a = __simd(XMM.PUNPCKLBW, a, b); a = __simd(XMM.PUNPCKLDQ, a, b); a = __simd(XMM.PUNPCKLWD, a, b); a = __simd(XMM.PXOR, a, b); a = __simd(XMM.ANDPD, a, b); a = __simd(XMM.ANDPS, a, b); a = __simd(XMM.ANDNPD, a, b); a = __simd(XMM.ANDNPS, a, b); a = __simd(XMM.CMPPD, a, b, 0x7A); a = __simd(XMM.CMPSS, a, b, 0x7A); a = __simd(XMM.CMPSD, a, b, 0x7A); a = __simd(XMM.CMPPS, a, b, 0x7A); a = __simd(XMM.CVTDQ2PD, a, b); a = __simd(XMM.CVTDQ2PS, a, b); a = __simd(XMM.CVTPD2DQ, a, b); //a = __simd(XMM.CVTPD2PI, a, b); a = __simd(XMM.CVTPD2PS, a, b); a = __simd(XMM.CVTPI2PD, a, b); a = __simd(XMM.CVTPI2PS, a, b); a = __simd(XMM.CVTPS2DQ, a, b); a = __simd(XMM.CVTPS2PD, a, b); //a = __simd(XMM.CVTPS2PI, a, b); //a = __simd(XMM.CVTSD2SI, a, b); //a = __simd(XMM.CVTSD2SI, a, b); a = __simd(XMM.CVTSD2SS, a, b); //a = __simd(XMM.CVTSI2SD, a, b); //a = __simd(XMM.CVTSI2SD, a, b); //a = __simd(XMM.CVTSI2SS, a, b); //a = __simd(XMM.CVTSI2SS, a, b); a = __simd(XMM.CVTSS2SD, a, b); //a = __simd(XMM.CVTSS2SI, a, b); //a = __simd(XMM.CVTSS2SI, a, b); //a = __simd(XMM.CVTTPD2PI, a, b); a = __simd(XMM.CVTTPD2DQ, a, b); a = __simd(XMM.CVTTPS2DQ, a, b); //a = __simd(XMM.CVTTPS2PI, a, b); //a = __simd(XMM.CVTTSD2SI, a, b); //a = __simd(XMM.CVTTSD2SI, a, b); //a = __simd(XMM.CVTTSS2SI, a, b); //a = __simd(XMM.CVTTSS2SI, a, b); a = __simd(XMM.MASKMOVDQU, a, b); //a = __simd(XMM.MASKMOVQ, a, b); a = __simd(XMM.MAXPD, a, b); a = __simd(XMM.MAXPS, a, b); a = __simd(XMM.MAXSD, a, b); a = __simd(XMM.MAXSS, a, b); a = __simd(XMM.MINPD, a, b); a = __simd(XMM.MINPS, a, b); a = __simd(XMM.MINSD, a, b); a = __simd(XMM.MINSS, a, b); a = __simd(XMM.ORPD, a, b); a = __simd(XMM.ORPS, a, b); a = __simd(XMM.PAVGB, a, b); a = __simd(XMM.PAVGW, a, b); a = __simd(XMM.PMAXSW, a, b); //a = __simd(XMM.PINSRW, a, b); a = __simd(XMM.PMAXUB, a, b); a = __simd(XMM.PMINSB, a, b); a = __simd(XMM.PMINUB, a, b); //a = __simd(XMM.PMOVMSKB, a, b); a = __simd(XMM.PMULHUW, a, b); a = __simd(XMM.PMULHW, a, b); a = __simd(XMM.PMULUDQ, a, b); a = __simd(XMM.PSADBW, a, b); a = __simd(XMM.PUNPCKHQDQ, a, b); a = __simd(XMM.PUNPCKLQDQ, a, b); a = __simd(XMM.RCPPS, a, b); a = __simd(XMM.RCPSS, a, b); a = __simd(XMM.RSQRTPS, a, b); a = __simd(XMM.RSQRTSS, a, b); a = __simd(XMM.SQRTPD, a, b); a = __simd(XMM.SHUFPD, a, b, 0xA7); a = __simd(XMM.SHUFPS, a, b, 0x7A); a = __simd(XMM.SQRTPS, a, b); a = __simd(XMM.SQRTSD, a, b); a = __simd(XMM.SQRTSS, a, b); a = __simd(XMM.UNPCKHPD, a, b); a = __simd(XMM.UNPCKHPS, a, b); a = __simd(XMM.UNPCKLPD, a, b); a = __simd(XMM.UNPCKLPS, a, b); a = __simd(XMM.PSHUFD, a, b, 0x7A); a = __simd(XMM.PSHUFHW, a, b, 0x7A); a = __simd(XMM.PSHUFLW, a, b, 0x7A); //a = __simd(XMM.PSHUFW, a, b, 0x7A); a = __simd_ib(XMM.PSLLDQ, a, cast(ubyte)0x7A); a = __simd_ib(XMM.PSRLDQ, a, cast(ubyte)0x7A); /**/ a = __simd(XMM.BLENDPD, a, b, 0x7A); a = __simd(XMM.BLENDPS, a, b, 0x7A); a = __simd(XMM.DPPD, a, b, 0x7A); a = __simd(XMM.DPPS, a, b, 0x7A); a = __simd(XMM.MPSADBW, a, b, 0x7A); a = __simd(XMM.PBLENDW, a, b, 0x7A); a = __simd(XMM.ROUNDPD, a, b, 0x7A); a = __simd(XMM.ROUNDPS, a, b, 0x7A); a = __simd(XMM.ROUNDSD, a, b, 0x7A); a = __simd(XMM.ROUNDSS, a, b, 0x7A); return a; } /*****************************************/ /+ // 9200 void bar9200(double[2] a) { assert(a[0] == 1); assert(a[1] == 2); } double2 * v9200(double2* a) { return a; } void test9200() { double2 a = [1, 2]; *v9200(&a) = a; bar9200(a.array); } +/ /*****************************************/ // 9304 and 9322 float4 foo9304(float4 a) { return -a; } void test9304() { auto a = foo9304([0, 1, 2, 3]); //writeln(a.array); assert(a.array == [0,-1,-2,-3]); } /*****************************************/ void test9910() { float4 f = [1, 1, 1, 1]; auto works = f + 3; auto bug = 3 + f; assert (works.array == [4,4,4,4]); assert (bug.array == [4,4,4,4]); // no property 'array' for type 'int' } /*****************************************/ bool normalize(double[] range, double sum = 1) { double s = 0; const length = range.length; foreach (e; range) { s += e; } if (s == 0) { return false; } return true; } void test12852() { double[3] range = [0.0, 0.0, 0.0]; assert(normalize(range[]) == false); range[1] = 3.0; assert(normalize(range[]) == true); } /*****************************************/ void test9449() { ubyte16[1] table; } /*****************************************/ void test9449_2() { float[4][2] m = [[2.0, 1, 3, 4], [5.0, 6, 7, 8]]; // segfault assert(m[0][0] == 2.0); assert(m[0][1] == 1); assert(m[0][2] == 3); assert(m[0][3] == 4); assert(m[1][0] == 5.0); assert(m[1][1] == 6); assert(m[1][2] == 7); assert(m[1][3] == 8); } /*****************************************/ // 13841 void test13841() { alias Vector16s = TypeTuple!( void16, byte16, short8, int4, long2, ubyte16, ushort8, uint4, ulong2, float4, double2); foreach (V1; Vector16s) { foreach (V2; Vector16s) { V1 v1 = void; V2 v2 = void; static if (is(V1 == V2)) { static assert( is(typeof(true ? v1 : v2) == V1)); } else { static assert(!is(typeof(true ? v1 : v2))); } } } } /*****************************************/ // 12776 void test12776() { alias Vector16s = TypeTuple!( void16, byte16, short8, int4, long2, ubyte16, ushort8, uint4, ulong2, float4, double2); foreach (V; Vector16s) { static assert(is(typeof( V .init) == V )); static assert(is(typeof( const(V).init) == const(V))); static assert(is(typeof( inout( V).init) == inout( V))); static assert(is(typeof( inout(const V).init) == inout(const V))); static assert(is(typeof(shared( V).init) == shared( V))); static assert(is(typeof(shared( const V).init) == shared( const V))); static assert(is(typeof(shared(inout V).init) == shared(inout V))); static assert(is(typeof(shared(inout const V).init) == shared(inout const V))); static assert(is(typeof( immutable(V).init) == immutable(V))); } } /*****************************************/ void foo13988(double[] arr) { static ulong repr(double d) { return *cast(ulong*)&d; } foreach (x; arr) assert(repr(arr[0]) == *cast(ulong*)&(arr[0])); } void test13988() { double[] arr = [3.0]; foo13988(arr); } /*****************************************/ // 15123 void test15123() { alias Vector16s = TypeTuple!( void16, byte16, short8, int4, long2, ubyte16, ushort8, uint4, ulong2, float4, double2); foreach (V; Vector16s) { auto x = V.init; } } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=15144 void test15144() { enum ubyte16 csXMM1 = ['a','b','c',0,0,0,0,0]; __gshared ubyte16 csXMM2 = ['a','b','c',0,0,0,0,0]; immutable ubyte16 csXMM3 = ['a','b','c',0,0,0,0,0]; version (D_PIC) { } else { asm @nogc nothrow { movdqa XMM0, [csXMM1]; movdqa XMM0, [csXMM2]; movdqa XMM0, [csXMM3]; } } } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=11585 ubyte16 test11585(ubyte16* d) { ubyte16 a; if (d is null) return a; return __simd(XMM.PCMPEQB, *d, *d); } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=13927 void test13927(ulong2 a) { ulong2 b = [long.min, long.min]; auto tmp = a - b; } /*****************************************/ int fooprefetch(byte a) { /* These should be run only if the CPUID PRFCHW * bit 0 of cpuid.{EAX = 7, ECX = 0}.ECX * Unfortunately, that bit isn't yet set by core.cpuid * so disable for the moment. */ version (none) { prefetch!(false, 0)(&a); prefetch!(false, 1)(&a); prefetch!(false, 2)(&a); prefetch!(false, 3)(&a); prefetch!(true, 0)(&a); prefetch!(true, 1)(&a); prefetch!(true, 2)(&a); prefetch!(true, 3)(&a); } return 3; } void testprefetch() { byte b; int i = fooprefetch(1); assert(i == 3); } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=16488 void foo_byte16(byte t, byte s) { byte16 f = s; auto p = cast(byte*)&f; foreach (i; 0 .. 16) assert(p[i] == s); } void foo_ubyte16(ubyte t, ubyte s) { ubyte16 f = s; auto p = cast(ubyte*)&f; foreach (i; 0 .. 16) assert(p[i] == s); } void foo_short8(short t, short s) { short8 f = s; auto p = cast(short*)&f; foreach (i; 0 .. 8) assert(p[i] == s); } void foo_ushort8(ushort t, ushort s) { ushort8 f = s; auto p = cast(ushort*)&f; foreach (i; 0 .. 8) assert(p[i] == s); } void foo_int4(int t, int s) { int4 f = s; auto p = cast(int*)&f; foreach (i; 0 .. 4) assert(p[i] == s); } void foo_uint4(uint t, uint s, uint u) { uint4 f = s; auto p = cast(uint*)&f; foreach (i; 0 .. 4) assert(p[i] == s); } void foo_long2(long t, long s, long u) { long2 f = s; auto p = cast(long*)&f; foreach (i; 0 .. 2) assert(p[i] == s); } void foo_ulong2(ulong t, ulong s) { ulong2 f = s; auto p = cast(ulong*)&f; foreach (i; 0 .. 2) assert(p[i] == s); } void foo_float4(float t, float s) { float4 f = s; auto p = cast(float*)&f; foreach (i; 0 .. 4) assert(p[i] == s); } void foo_double2(double t, double s, double u) { double2 f = s; auto p = cast(double*)&f; foreach (i; 0 .. 2) assert(p[i] == s); } void test16448() { foo_byte16(5, -10); foo_ubyte16(5, 11); foo_short8(5, -6); foo_short8(5, 7); foo_int4(5, -6); foo_uint4(5, 0x12345678, 22); foo_long2(5, -6, 1); foo_ulong2(5, 0x12345678_87654321L); foo_float4(5, -6); foo_double2(5, -6, 2); } /*****************************************/ version (D_AVX) { void foo_byte32(byte t, byte s) { byte32 f = s; auto p = cast(byte*)&f; foreach (i; 0 .. 32) assert(p[i] == s); } void foo_ubyte32(ubyte t, ubyte s) { ubyte32 f = s; auto p = cast(ubyte*)&f; foreach (i; 0 .. 32) assert(p[i] == s); } void foo_short16(short t, short s) { short16 f = s; auto p = cast(short*)&f; foreach (i; 0 .. 16) assert(p[i] == s); } void foo_ushort16(ushort t, ushort s) { ushort16 f = s; auto p = cast(ushort*)&f; foreach (i; 0 .. 16) assert(p[i] == s); } void foo_int8(int t, int s) { int8 f = s; auto p = cast(int*)&f; foreach (i; 0 .. 8) assert(p[i] == s); } void foo_uint8(uint t, uint s, uint u) { uint8 f = s; auto p = cast(uint*)&f; foreach (i; 0 .. 8) assert(p[i] == s); } void foo_long4(long t, long s, long u) { long4 f = s; auto p = cast(long*)&f; foreach (i; 0 .. 4) assert(p[i] == s); } void foo_ulong4(ulong t, ulong s) { ulong4 f = s; auto p = cast(ulong*)&f; foreach (i; 0 .. 4) assert(p[i] == s); } void foo_float8(float t, float s) { float8 f = s; auto p = cast(float*)&f; foreach (i; 0 .. 8) assert(p[i] == s); } void foo_double4(double t, double s, double u) { double4 f = s; auto p = cast(double*)&f; foreach (i; 0 .. 4) assert(p[i] == s); } void test16448_32() { foo_byte32(5, -10); foo_ubyte32(5, 11); foo_short16(5, -6); foo_short16(5, 7); foo_int8(5, -6); foo_uint8(5, 0x12345678, 22); foo_long4(5, -6, 1); foo_ulong4(5, 0x12345678_87654321L); foo_float8(5, -6); foo_double4(5, -6, 2); } } else { void test16448_32() { } } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=16703 float index(float4 f4, size_t i) { return f4[i]; //return (*cast(float[4]*)&f4)[2]; } float[4] slice(float4 f4) { return f4[]; } float slice2(float4 f4, size_t lwr, size_t upr, size_t i) { float[] fa = f4[lwr .. upr]; return fa[i]; } void test16703() { float4 f4 = [1,2,3,4]; assert(index(f4, 0) == 1); assert(index(f4, 1) == 2); assert(index(f4, 2) == 3); assert(index(f4, 3) == 4); float[4] fsa = slice(f4); assert(fsa == [1.0f,2,3,4]); assert(slice2(f4, 1, 3, 0) == 2); assert(slice2(f4, 1, 3, 1) == 3); } /*****************************************/ struct Sunsto { align (1): // make sure f4 is misaligned byte b; union { float4 f4; ubyte[16] a; } } ubyte[16] foounsto() { float4 vf = 6; Sunsto s; s.f4 = vf * 2; vf = s.f4; return s.a; } void testOPvecunsto() { auto a = foounsto(); assert(a == [0, 0, 64, 65, 0, 0, 64, 65, 0, 0, 64, 65, 0, 0, 64, 65]); } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=10447 void test10447() { immutable __vector(double[2]) a = [1.0, 2.0]; __vector(double[2]) r; r += a; r = r * a; } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=17237 version (D_AVX) { struct S17237 { bool a; struct { bool b; int8 c; } } static assert(S17237.a.offsetof == 0); static assert(S17237.b.offsetof == 32); static assert(S17237.c.offsetof == 64); } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=17344 void test17344() { __vector(int[4]) vec1 = 2, vec2 = vec1++; assert(cast(int[4])vec1 == [3, 3, 3, 3]); assert(cast(int[4])vec2 == [2, 2, 2, 2]); } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=17356 void test17356() { float4 a = 13, b = 0; __simd_sto(XMM.STOUPS, b, a); assert(b.array == [13, 13, 13, 13]); } /*****************************************/ // https://issues.dlang.org/show_bug.cgi?id=17695 void test17695(__vector(ubyte[16]) a) { auto b = -a; } /*****************************************/ int main() { test1(); test2(); test2b(); test2c(); test2d(); test2e(); test2f(); test2g(); test2h(); test2i(); test2j(); test3(); test4(); test7411(); test7951(); test7951_2(); test7949(); test7414(); test7413(); test7413_2(); // test9200(); test9304(); test9910(); test12852(); test9449(); test9449_2(); test13988(); testprefetch(); test16448(); test16448_32(); test16703(); testOPvecunsto(); test10447(); test17344(); test17356(); return 0; } } else { int main() { return 0; } }
D
module mach.io.file.attributes; private: version(Windows){ import core.sys.windows.winbase : GetFileAttributesW; import core.sys.windows.windows : DWORD; import core.sys.windows.winnt; } import std.internal.cstring : tempCString; import mach.io.file.common; public: /// https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx version(Windows){ struct Attributes{ alias Attr = DWORD; Attr attr; this(string path){ this(GetFileAttributesW(path.tempCString!FSChar())); } this(Attr attr){ this.attr = attr; } @property bool valid() const{ return this.attr != INVALID_FILE_ATTRIBUTES; } /// Get whether the file or directory is an archive, typically used to mark /// files for backup or removal. @property bool isarchive() const{ return (this.attr & FILE_ATTRIBUTE_ARCHIVE) != 0; } /// Set whether the file or directory is an archive, typically used to mark /// files for backup or removal. @property void isarchive(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_ARCHIVE; else this.attr |= FILE_ATTRIBUTE_ARCHIVE; } /// Get whether the file or directory is compressed. @property bool iscompressed() const{ return (this.attr & FILE_ATTRIBUTE_COMPRESSED) != 0; } /// Set whether the file or directory is compressed. @property void iscompressed(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_COMPRESSED; else this.attr |= FILE_ATTRIBUTE_COMPRESSED; } /// Reserved for system use, per Windows docs. @property bool isdevice() const{ return (this.attr & FILE_ATTRIBUTE_DEVICE) != 0; } /// ditto @property void isdevice(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_DEVICE; else this.attr |= FILE_ATTRIBUTE_DEVICE; } /// Get whether the handle identifies a directory. @property bool isdir() const{ return (this.attr & FILE_ATTRIBUTE_DIRECTORY) != 0; } /// Set whether the handle identifies a directory. @property void isdir(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_DIRECTORY; else this.attr |= FILE_ATTRIBUTE_DIRECTORY; } /// Get whether the handle identifies a file. /// Is the same as not(isdir). @property bool isfile() const{ return (this.attr & FILE_ATTRIBUTE_DIRECTORY) != 0; } /// Set whether the handle identifies a file. /// Is the same as not(isdir). @property void isfile(in bool value){ if(!value) this.attr &= ~FILE_ATTRIBUTE_DIRECTORY; else this.attr |= FILE_ATTRIBUTE_DIRECTORY; } /// Get whether the file or directory is encrypted. @property bool isencrypted() const{ return (this.attr & FILE_ATTRIBUTE_ENCRYPTED) != 0; } /// Set whether the file or directory is encrypted. @property void isencrypted(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_ENCRYPTED; else this.attr |= FILE_ATTRIBUTE_ENCRYPTED; } /// Get whether the file or directory is hidden, meaning it is not included /// in an ordinary directory listing. @property bool ishidden() const{ return (this.attr & FILE_ATTRIBUTE_HIDDEN) != 0; } /// Set whether the file or directory is hidden, meaning it is not included /// in an ordinary directory listing. @property void ishidden(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_HIDDEN; else this.attr |= FILE_ATTRIBUTE_HIDDEN; } /// Get whether the file does not have other attributes set. @property bool isnormal() const{ return (this.attr & FILE_ATTRIBUTE_NORMAL) != 0; } /// Set whether the file does not have other attributes set. @property void isnormal(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_NORMAL; else this.attr |= FILE_ATTRIBUTE_NORMAL; } /// Get whether the file or directory is indexed by the content indexing /// service. @property bool isindexed() const{ return (this.attr & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) == 0; } /// Set whether the file or directory is indexed by the content indexing /// service. @property void isindexed(in bool value){ if(!value) this.attr &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; else this.attr |= FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; } /// Get whether data of the file is not available immediately because the /// data was physically moved to offline storage. The attribute is used by /// Remote Storage and applications should not arbitrarily change this /// attribute. @property bool isoffline() const{ return (this.attr & FILE_ATTRIBUTE_OFFLINE) != 0; } /// Get whether data of the file is not available immediately because the /// data was physically moved to offline storage. The attribute is used by /// Remote Storage and applications should not arbitrarily change this /// attribute. @property void isoffline(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_OFFLINE; else this.attr |= FILE_ATTRIBUTE_OFFLINE; } /// Get whether the file is read-only. This attribute is not honored for /// directories. @property bool isreadonly() const{ return (this.attr & FILE_ATTRIBUTE_READONLY) != 0; } /// Set whether the file is read-only. This attribute is not honored for /// directories. @property void isreadonly(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_READONLY; else this.attr |= FILE_ATTRIBUTE_READONLY; } /// Get whether the handle identifies a file or directory having an /// associated reparse point, or a file that is a symbolic link. @property bool islink() const{ return (this.attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0; } /// Set whether the handle identifies a file or directory having an /// associated reparse point, or a file that is a symbolic link. @property void islink(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_REPARSE_POINT; else this.attr |= FILE_ATTRIBUTE_REPARSE_POINT; } /// Get whether the file is a sparse file. @property bool issparse() const{ return (this.attr & FILE_ATTRIBUTE_SPARSE_FILE) != 0; } /// Set whether the file is a sparse file. @property void issparse(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_SPARSE_FILE; else this.attr |= FILE_ATTRIBUTE_SPARSE_FILE; } /// Get whether the file or directory is used partially or exclusively by /// the operating system. @property bool issystem() const{ return (this.attr & FILE_ATTRIBUTE_SYSTEM) != 0; } /// Set whether the file or directory is used partially or exclusively by /// the operating system. @property void issystem(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_SYSTEM; else this.attr |= FILE_ATTRIBUTE_SYSTEM; } /// Get whether the file is being used for temporary storage and is /// expected to not be persisted and to be imminently closed. @property bool istemporary() const{ return (this.attr & FILE_ATTRIBUTE_TEMPORARY) != 0; } /// Set whether the file is being used for temporary storage and is /// expected to not be persisted and to be imminently closed. @property void istemporary(in bool value){ if(value) this.attr &= ~FILE_ATTRIBUTE_TEMPORARY; else this.attr |= FILE_ATTRIBUTE_TEMPORARY; } } }else{ struct Attributes{ this(Args...)(auto ref Args args){ assert(false, "Operation only meaningful on Windows platforms."); } void opDispatch(string name)(){ assert(false, "Operation only meaningful on Windows platforms."); } } }
D
func void OrcSlavePerc() { Npc_PercEnable(self,PERC_ASSESSDAMAGE,ZS_OrcSlave_AssessDamage); Npc_PercEnable(self,PERC_OBSERVEINTRUDER,B_OrcSlave_Quicklook); Npc_PercEnable(self,PERC_DRAWWEAPON,B_OrcSlave_Quicklook); Npc_PercEnable(self,PERC_ASSESSSURPRISE,B_OrcSlave_Quicklook); }; func void OrcDefaultPerc() { if(self.guild == gil_orcslave) { OrcSlavePerc(); return; } else { ObservingPerception(); }; }; func void OrcDefaultPercDoing() { if(self.guild == gil_orcslave) { OrcSlavePerc(); return; } else { OccupiedPerception(); }; }; func void OrcDeepSleepPerc() { if(self.guild == gil_orcslave) { OrcSlavePerc(); return; } else { DeepSleepPerception(); }; }; func void OrcLightSleepPerc() { if(self.guild == gil_orcslave) { OrcSlavePerc(); return; } else { LightSleepPerception(); }; };
D
import core.vararg; extern (C) int printf(const char*, ...); /***************************************************/ // lambda syntax check auto una(alias dg)(int n) { return dg(n); } auto bin(alias dg)(int n, int m) { return dg(n, m); } void test1() { assert(una!( a => a*2 )(2) == 4); assert(una!( ( a) => a*2 )(2) == 4); assert(una!( (int a) => a*2 )(2) == 4); assert(una!( ( a){ return a*2; } )(2) == 4); assert(una!( function ( a){ return a*2; } )(2) == 4); assert(una!( function int( a){ return a*2; } )(2) == 4); assert(una!( function (int a){ return a*2; } )(2) == 4); assert(una!( function int(int a){ return a*2; } )(2) == 4); assert(una!( delegate ( a){ return a*2; } )(2) == 4); assert(una!( delegate int( a){ return a*2; } )(2) == 4); assert(una!( delegate (int a){ return a*2; } )(2) == 4); assert(una!( delegate int(int a){ return a*2; } )(2) == 4); // partial parameter specialization syntax assert(bin!( ( a, b) => a*2+b )(2,1) == 5); assert(bin!( (int a, b) => a*2+b )(2,1) == 5); assert(bin!( ( a, int b) => a*2+b )(2,1) == 5); assert(bin!( (int a, int b) => a*2+b )(2,1) == 5); assert(bin!( ( a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( (int a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( ( a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( (int a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( function ( a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( function (int a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( function ( a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( function (int a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( function int( a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( function int(int a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( function int( a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( function int(int a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate ( a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate (int a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate ( a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate (int a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate int( a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate int(int a, b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate int( a, int b){ return a*2+b; } )(2,1) == 5); assert(bin!( delegate int(int a, int b){ return a*2+b; } )(2,1) == 5); } /***************************************************/ // on initializer void test2() { // explicit typed binding ignite parameter types inference int function(int) fn1 = a => a*2; assert(fn1(2) == 4); int function(int) fn2 = ( a){ return a*2; }; assert(fn2(2) == 4); int function(int) fn3 = function ( a){ return a*2; }; assert(fn3(2) == 4); int function(int) fn4 = function int( a){ return a*2; }; assert(fn4(2) == 4); int function(int) fn5 = function (int a){ return a*2; }; assert(fn5(2) == 4); int function(int) fn6 = function int(int a){ return a*2; }; assert(fn6(2) == 4); int delegate(int) dg1 = a => a*2; assert(dg1(2) == 4); int delegate(int) dg2 = ( a){ return a*2; }; assert(dg2(2) == 4); int delegate(int) dg3 = delegate ( a){ return a*2; }; assert(dg3(2) == 4); int delegate(int) dg4 = delegate int( a){ return a*2; }; assert(dg4(2) == 4); int delegate(int) dg5 = delegate (int a){ return a*2; }; assert(dg5(2) == 4); int delegate(int) dg6 = delegate int(int a){ return a*2; }; assert(dg6(2) == 4); // funciton/delegate mismatching always raises an error static assert(!__traits(compiles, { int function(int) xfg3 = delegate ( a){ return a*2; }; })); static assert(!__traits(compiles, { int function(int) xfg4 = delegate int( a){ return a*2; }; })); static assert(!__traits(compiles, { int function(int) xfg5 = delegate (int a){ return a*2; }; })); static assert(!__traits(compiles, { int function(int) xfg6 = delegate int(int a){ return a*2; }; })); static assert(!__traits(compiles, { int delegate(int) xdn3 = function ( a){ return a*2; }; })); static assert(!__traits(compiles, { int delegate(int) xdn4 = function int( a){ return a*2; }; })); static assert(!__traits(compiles, { int delegate(int) xdn5 = function (int a){ return a*2; }; })); static assert(!__traits(compiles, { int delegate(int) xdn6 = function int(int a){ return a*2; }; })); // auto binding requires explicit parameter types at least static assert(!__traits(compiles, { auto afn1 = a => a*2; })); static assert(!__traits(compiles, { auto afn2 = ( a){ return a*2; }; })); static assert(!__traits(compiles, { auto afn3 = function ( a){ return a*2; }; })); static assert(!__traits(compiles, { auto afn4 = function int( a){ return a*2; }; })); static assert(!__traits(compiles, { auto adg3 = delegate ( a){ return a*2; }; })); static assert(!__traits(compiles, { auto adg4 = delegate int( a){ return a*2; }; })); auto afn5 = function (int a){ return a*2; }; assert(afn5(2) == 4); auto afn6 = function int(int a){ return a*2; }; assert(afn6(2) == 4); auto adg5 = delegate (int a){ return a*2; }; assert(adg5(2) == 4); auto adg6 = delegate int(int a){ return a*2; }; assert(adg6(2) == 4); // partial specialized lambda string delegate(int, string) dg = (n, string s){ string r = ""; foreach (_; 0..n) r~=s; return r; }; assert(dg(2, "str") == "strstr"); } /***************************************************/ // on return statement void test3() { // inference matching system is same as on initializer int delegate(int) mul(int x) { return a => a * x; } assert(mul(5)(2) == 10); } /***************************************************/ // on function arguments auto foo4(int delegate(int) dg) { return dg(10); } auto foo4(int delegate(int, int) dg) { return dg(10, 20); } void nbar4fp(void function(int) fp) { } void nbar4dg(void delegate(int) dg) { } void tbar4fp(T,R)(R function(T) dg) { static assert(is(typeof(dg) == void function(int))); } void tbar4dg(T,R)(R delegate(T) dg) { static assert(is(typeof(dg) == void delegate(int))); } auto nbaz4(void function() fp) { return 1; } auto nbaz4(void delegate() dg) { return 2; } auto tbaz4(R)(R function() dg) { static assert(is(R == void)); return 1; } auto tbaz4(R)(R delegate() dg) { static assert(is(R == void)); return 2; } auto thoo4(T)(T lambda){ return lambda; } void tfun4a()(int function(int) a){} void tfun4b(T)(T function(T) a){} void tfun4c(T)(T f){} void test4() { int v; static void sfoo() {} void nfoo() {} // parameter type inference + overload resolution assert(foo4((a) => a * 2) == 20); assert(foo4((a,b) => a * 2 + b) == 40); // function/delegate inference nbar4fp((int x){ }); nbar4dg((int x){ }); tbar4fp((int x){ }); tbar4dg((int x){ }); // function/delegate inference + overload resolution assert(nbaz4({ }) == 1); assert(nbaz4({ v = 1; }) == 2); assert(nbaz4({ sfoo(); }) == 1); // Bugzilla 8836 assert(nbaz4({ nfoo(); }) == 2); assert(tbaz4({ }) == 1); assert(tbaz4({ v = 1; }) == 2); assert(tbaz4({ sfoo(); }) == 1); assert(tbaz4({ nfoo(); }) == 2); // template function deduction static assert(is(typeof(thoo4({ })) : void function())); static assert(is(typeof(thoo4({ v = 1; })) : void delegate())); tfun4a(a => a); static assert(!__traits(compiles, { tfun4b(a => a); })); static assert(!__traits(compiles, { tfun4c(a => a); })); } void fsvarg4(int function(int)[] a...){} void fcvarg4(int dummy, ...){} void tsvarg4a()(int function(int)[] a...){} void tsvarg4b(T)(T function(T)[] a...){} void tsvarg4c(T)(T [] a...){} void tcvarg4()(int dummy, ...){} void test4v() { fsvarg4(function(int a){ return a; }); // OK fsvarg4(a => a); // OK fcvarg4(0, function(int a){ return a; }); // OK static assert(!__traits(compiles, { fcvarg4(0, a => a); })); tsvarg4a(function(int a){ return a; }); // OK tsvarg4b(function(int a){ return a; }); // OK tsvarg4c(function(int a){ return a; }); // OK tsvarg4a(a => a); static assert(!__traits(compiles, { tsvarg4b(a => a); })); static assert(!__traits(compiles, { tsvarg4c(a => a); })); tcvarg4(0, function(int a){ return a; }); // OK static assert(!__traits(compiles, { tcvarg4(0, a => a); })); } // A lambda in function default argument should be deduced to delegate, by the // preparation inferType call in TypeFunction.semantic. void test4_findRoot(scope bool delegate(real lo, real hi) tolerance = (real a, real b) => false) {} /***************************************************/ // on CallExp::e1 void test5() { assert((a => a*2)(10) == 20); assert(( a, s){ return s~s; }(10, "str") == "strstr"); assert((int a, s){ return s~s; }(10, "str") == "strstr"); assert(( a, string s){ return s~s; }(10, "str") == "strstr"); assert((int a, string s){ return s~s; }(10, "str") == "strstr"); } /***************************************************/ // escape check to nested function symbols void checkNestedRef(alias dg)(bool isnested) { static if (is(typeof(dg) == delegate)) enum isNested = true; else static if ((is(typeof(dg) PF == F*, F) && is(F == function))) enum isNested = false; else static assert(0); assert(isnested == isNested); dg(); } void freeFunc(){} void test6() { static void localFunc(){} void nestedLocalFunc(){} checkNestedRef!({ })(false); checkNestedRef!({ freeFunc(); })(false); checkNestedRef!({ localFunc(); })(false); checkNestedRef!({ nestedLocalFunc(); })(true); checkNestedRef!({ void inner(){} inner(); })(false); checkNestedRef!({ auto f = &freeFunc; })(false); checkNestedRef!({ auto f = &localFunc; })(false); checkNestedRef!({ auto f = &nestedLocalFunc; })(true); checkNestedRef!({ void inner(){} auto f = &inner; })(false); } /***************************************************/ // on AssignExp::e2 void test7() { int function(int) fp; fp = a => a; fp = (int a) => a; fp = function(int a) => a; fp = function int(int a) => a; static assert(!__traits(compiles, { fp = delegate(int a) => a; })); static assert(!__traits(compiles, { fp = delegate int(int a) => a; })); int delegate(int) dg; dg = a => a; dg = (int a) => a; dg = delegate(int a) => a; dg = delegate int(int a) => a; static assert(!__traits(compiles, { dg = function(int a) => a; })); static assert(!__traits(compiles, { dg = function int(int a) => a; })); } /***************************************************/ // on StructLiteralExp::elements void test8() { struct S { int function(int) fp; } auto s1 = S(a => a); static assert(!__traits(compiles, { auto s2 = S((a, b) => a); })); } /***************************************************/ // on concat operation void test9() { int function(int)[] a2; a2 ~= x => x; } /***************************************************/ // on associative array key void test10() { int[int function()] aa; assert(!aa.remove(() => 1)); int[int function(int)] aa2; assert(!aa2.remove(x => 1)); } /***************************************************/ // on common type deduction void test11() { auto a1 = [x => x, (int x) => x * 2]; static assert(is(typeof(a1[0]) == int function(int) pure @safe nothrow @nogc)); assert(a1[0](10) == 10); assert(a1[1](10) == 20); //int n = 10; //auto a2 = [x => n, (int x) => x * 2]; //static assert(is(typeof(a2[0]) == int delegate(int) @safe nothrow)); //assert(a2[0](99) == 10); //assert(a2[1](10) == 20); int function(int) fp = true ? (x => x) : (x => x*2); assert(fp(10) == 10); int m = 10; int delegate(int) dg = true ? (x => x) : (x => m*2); assert(dg(10) == 10); } /***************************************************/ // 3235 void test3235() { // from TDPL auto f = (int i) {}; static if (is(typeof(f) _ == F*, F) && is(F == function)) {} else static assert(0); } /***************************************************/ // 6714 void foo6714x(int function (int, int) a){} void bar6714x(int delegate (int, int) a){} int bar6714y(double delegate(int, int) a){ return 1; } int bar6714y( int delegate(int, int) a){ return 2; } void test6714() { foo6714x((a, b) { return a + b; }); bar6714x((a, b) { return a + b; }); assert(bar6714y((a, b){ return 1.0; }) == 1); assert(bar6714y((a, b){ return 1.0f; }) == 1); assert(bar6714y((a, b){ return a; }) == 2); } /***************************************************/ // 7193 void test7193() { static assert(!__traits(compiles, { delete a => a; })); } /***************************************************/ // 7207 : on CastExp void test7202() { auto dg = cast(int function(int))(a => a); assert(dg(10) == 10); } /***************************************************/ // 7288 void test7288() { // 7288 -> OK auto foo() { int x; return () => { return x; }; } pragma(msg, typeof(&foo)); alias int delegate() pure nothrow @nogc @safe delegate() pure nothrow @nogc @safe delegate() pure nothrow @safe Dg; pragma(msg, Dg); static assert(is(typeof(&foo) == Dg)); // should pass } /***************************************************/ // 7499 void test7499() { int function(int)[] a1 = [ x => x ]; // 7499 int function(int)[][] a2 = [[x => x]]; // +a assert(a1[0] (10) == 10); assert(a2[0][0](10) == 10); } /***************************************************/ // 7500 void test7500() { alias immutable bool function(int[]) Foo; Foo f = a => true; } /***************************************************/ // 7525 void test7525() { { char[] delegate() a = { return null; }; int delegate() b = { return 1U; }; uint delegate() c = { return 1; }; float delegate() d = { return 1.0; }; double delegate() e = { return 1.0f; }; } { char[] delegate(int) a = (x){ return null; }; int delegate(int) b = (x){ return 1U; }; uint delegate(int) c = (x){ return 1; }; float delegate(int) d = (x){ return 1.0; }; double delegate(int) e = (x){ return 1.0f; }; } } /***************************************************/ // 7582 void test7582() { void delegate(int) foo; void delegate(int) foo2; foo = (a) { foo2 = (b) { }; }; } /***************************************************/ // 7649 void test7649() { void foo(int function(int) fp = x => 1) { assert(fp(1) == 1); } foo(); } /***************************************************/ // 7650 void test7650() { int[int function(int)] aa1 = [x=>x:1, x=>x*2:2]; foreach (k, v; aa1) { if (v == 1) assert(k(10) == 10); if (v == 2) assert(k(10) == 20); } int function(int)[int] aa2 = [1:x=>x, 2:x=>x*2]; assert(aa2[1](10) == 10); assert(aa2[2](10) == 20); int n = 10; int[int delegate(int)] aa3 = [x=>n+x:1, x=>n+x*2:2]; foreach (k, v; aa3) { if (v == 1) assert(k(10) == 20); if (v == 2) assert(k(10) == 30); } int delegate(int)[int] aa4 = [1:x=>n+x, 2:x=>n+x*2]; assert(aa4[1](10) == 20); assert(aa4[2](10) == 30); } /***************************************************/ // 7705 void test7705() { void foo1(void delegate(ref int ) dg){ int x=10; dg(x); } foo1((ref x){ pragma(msg, typeof(x)); assert(x == 10); }); static assert(!__traits(compiles, foo1((x){}) )); void foo2(void delegate(int, ...) dg){ dg(20, 3.14); } foo2((x,...){ pragma(msg, typeof(x)); assert(x == 20); }); void foo3(void delegate(int[]...) dg){ dg(1, 2, 3); } foo3((x ...){ pragma(msg, typeof(x)); assert(x == [1,2,3]); }); } /***************************************************/ // 7713 void foo7713(T)(T delegate(in Object) dlg) {} void test7713() { foo7713( (in obj) { return 15; } ); // line 6 } /***************************************************/ // 7743 auto foo7743a() { int x = 10; return () nothrow { return x; }; } auto foo7743b() { int x = 10; return () nothrow => x; } void test7743() { pragma(msg, typeof(&foo7743a)); static assert(is(typeof(&foo7743a) == int delegate() pure nothrow @nogc @safe function() pure nothrow @safe)); assert(foo7743a()() == 10); static assert(is(typeof(&foo7743b) == int delegate() pure nothrow @nogc @safe function() pure nothrow @safe)); assert(foo7743b()() == 10); } /***************************************************/ // 7761 enum dg7761 = (int a) pure => 2 * a; void test7761() { static assert(is(typeof(dg7761) == int function(int) pure @safe nothrow @nogc)); assert(dg7761(10) == 20); } /***************************************************/ // 7941 void test7941() { static assert(!__traits(compiles, { enum int c = function(){}; })); } /***************************************************/ // 8005 void test8005() { auto n = (a, int n = 2){ return n; }(1); assert(n == 2); } /***************************************************/ // test8198 void test8198() { T delegate(T) zero(T)(T delegate(T) f) { return x => x; } T delegate(T) delegate(T delegate(T)) succ(T)(T delegate(T) delegate(T delegate(T)) n) { return f => x => f(n(f)(x)); } uint delegate(uint) delegate(uint delegate(uint)) n = &zero!uint; foreach (i; 0..10) { assert(n(x => x + 1)(0) == i); n = succ(n); } } /***************************************************/ // 8226 immutable f8226 = (int x) => x * 2; void test8226() { assert(f8226(10) == 20); } /***************************************************/ // 8241 auto exec8241a(alias a = function(x) => x, T...)(T as) { return a(as); } auto exec8241b(alias a = (x) => x, T...)(T as) { return a(as); } void test8241() { exec8241a(2); exec8241b(2); } /***************************************************/ // 8242 template exec8242(alias a, T...) { auto func8242(T as) { return a(as); } } mixin exec8242!(x => x, int); mixin exec8242!((string x) => x, string); void test8242() { func8242(1); func8242(""); } /***************************************************/ // 8315 void test8315() { bool b; foo8315!(a => b)(); } void foo8315(alias pred)() if (is(typeof(pred(1)) == bool)) {} /***************************************************/ // 8397 void test8397() { void function(int) f; static assert(!is(typeof({ f = function(string x) {}; }))); } /***************************************************/ // 8496 void test8496() { alias extern (C) void function() Func; Func fp = (){}; fp = (){}; } /***************************************************/ // 8575 template tfunc8575(func...) { auto tfunc8575(U)(U u) { return func[0](u); } } auto bar8575(T)(T t) { return tfunc8575!(a => a)(t); } void foo8575a() { assert(bar8575(uint.init + 1) == +1); } void foo8575b() { assert(bar8575( int.init - 1) == -1); } void test8575() { foo8575a(); foo8575b(); } /***************************************************/ // 9153 void writeln9153(string s){} void test9153() { auto tbl1 = [ (string x) { writeln9153(x); }, (string x) { x ~= 'a'; }, ]; auto tbl2 = [ (string x) { x ~= 'a'; }, (string x) { writeln9153(x); }, ]; } /***************************************************/ // 9393 template ifThrown9393a(E) { void ifThrown9393a(T)(scope T delegate(E) errHandler) { } } void ifThrown9393b(E, T)(scope T delegate(E) errHandler) { } void foo9393(T)(void delegate(T) dg){ dg(T.init); } void foo9393()(void delegate(int) dg){ foo9393!int(dg); } void test9393() { ifThrown9393a!Exception(e => 10); ifThrown9393b!Exception(e => 10); foo9393((x){ assert(x == int.init); }); } /***************************************************/ // 9415 void test9415() { int z; typeof((int a){return z;}) dg; dg = (int a){return z;}; } /***************************************************/ // 9628 template TypeTuple9628(TL...) { alias TypeTuple9628 = TL; } void map9628(alias func)() { func(0); } void test9628() { auto items = [[10, 20], [30]]; size_t[] res; res = null; foreach (_; 0 .. 2) { foreach (sub; items) { map9628!(( i){ res ~= sub.length; }); map9628!((size_t i){ res ~= sub.length; }); } } assert(res == [2,2,1,1, 2,2,1,1]); res = null; foreach (_; TypeTuple9628!(0, 1)) { foreach (sub; items) { map9628!(( i){ res ~= sub.length; }); map9628!((size_t i){ res ~= sub.length; }); } } assert(res == [2,2,1,1, 2,2,1,1]); } /***************************************************/ // 9928 void test9928() { void* smth = (int x) { return x; }; } /***************************************************/ // 10133 ptrdiff_t countUntil10133(alias pred, R)(R haystack) { typeof(return) i; alias T = dchar; foreach (T elem; haystack) { if (pred(elem)) return i; ++i; } return -1; } bool func10133(string s)() if (countUntil10133!(x => x == 'x')(s) == 1) { return true; } bool func10133a(string s)() if (countUntil10133!(x => s == "x")(s) != -1) { return true; } bool func10133b(string s)() if (countUntil10133!(x => s == "x")(s) != -1) { return true; } void test10133() { func10133!("ax")(); func10133a!("x")(); static assert(!is(typeof(func10133a!("ax")()))); static assert(!is(typeof(func10133b!("ax")()))); func10133b!("x")(); } /***************************************************/ // 10219 void test10219() { interface I { } class C : I { } void test_dg(I delegate(C) dg) { C c = new C; void* cptr = cast(void*) c; void* iptr = cast(void*) cast(I) c; void* xptr = cast(void*) dg(c); assert(cptr != iptr); assert(cptr != xptr); // should pass assert(iptr == xptr); // should pass } C delegate(C c) dg = delegate C(C c) { return c; }; static assert(!__traits(compiles, { test_dg(dg); })); static assert(!__traits(compiles, { test_dg(delegate C(C c) { return c; }); })); static assert(!__traits(compiles, { I delegate(C) dg2 = dg; })); // creates I delegate(C) test_dg(c => c); test_dg(delegate(C c) => c); void test_fp(I function(C) fp) { C c = new C; void* cptr = cast(void*) c; void* iptr = cast(void*) cast(I) c; void* xptr = cast(void*) fp(c); assert(cptr != iptr); assert(cptr != xptr); // should pass assert(iptr == xptr); // should pass } C function(C c) fp = function C(C c) { return c; }; static assert(!__traits(compiles, { test_fp(fp); })); static assert(!__traits(compiles, { test_fp(function C(C c) { return c; }); })); static assert(!__traits(compiles, { I function(C) fp2 = fp; })); // creates I function(C) test_fp(c => c); test_fp(function(C c) => c); } /***************************************************/ // 10288 T foo10288(T)(T x) { void lambda() @trusted nothrow { x += 10; } lambda(); return x; } T bar10288(T)(T x) { () @trusted { x += 10; } (); return x; } T baz10288(T)(T arg) { static int g = 10; () @trusted { x += g; } (); return x; } void test10288() @safe pure nothrow { assert(foo10288(10) == 20); // OK assert(bar10288(10) == 20); // OK <- NG static assert(!__traits(compiles, baz10288(10))); } /***************************************************/ // 10666 struct S10666 { int val; ~this() {} } void foo10666(S10666 s1) { S10666 s2; /* Even if closureVars(s1 and s2) are accessed by directly called lambdas, * they won't escape the scope of this function. */ auto x1 = (){ return s1.val; }(); // OK auto x2 = (){ return s2.val; }(); // OK } /***************************************************/ // 11081 T ifThrown11081(E : Throwable, T)(T delegate(E) errorHandler) { return errorHandler(); } void test11081() { static if (__traits(compiles, ifThrown11081!Exception(e => 0))) { } static if (__traits(compiles, ifThrown11081!Exception(e => 0))) { } } /***************************************************/ // 11220 int parsePrimaryExp11220(int x) { parseAmbig11220!( (parsed){ x += 1; } )(); return 1; } typeof(handler(1)) parseAmbig11220(alias handler)() { return handler(parsePrimaryExp11220(1)); } /***************************************************/ // 11230 template map11230(fun...) { auto map11230(Range)(Range r) { return MapResult11230!(fun, Range)(r); } } struct MapResult11230(alias fun, R) { R _input; this(R input) { _input = input; } } class A11230 { A11230[] as; } class B11230 { A11230[] as; } class C11230 : A11230 {} C11230 visit11230(A11230 a) { a.as.map11230!(a => visit11230); return null; } C11230 visit11230(B11230 b) { b.as.map11230!(a => visit11230); return null; } C11230 visit11230() { return null; } /***************************************************/ // 10336 struct S10336 { template opDispatch(string name) { enum opDispatch = function(int x) { return x; }; } } void test10336() { S10336 s; assert(s.hello(12) == 12); } /***************************************************/ // 10928 struct D10928 { int x; ~this() @nogc {} } void f10928a(D10928 bar) { (){ bar.x++; }(); } void f10928b(D10928 bar) @nogc { (){ bar.x++; }(); } void test10928() { f10928a(D10928.init); f10928b(D10928.init); } /***************************************************/ // 11661 void test11661() { void delegate() dg = {}; // OK void function() fp = {}; // OK <- NG } /***************************************************/ // 11774 void f11774(T, R)(R delegate(T[]) dg) { T[] src; dg(src); } void test11774() { int[] delegate(int[]) dg = (int[] a) => a; f11774!int(dg); f11774!Object(a => a); f11774!int(dg); } /***************************************************/ // 12421 void test12421() { void test(string decl, bool polymorphic = true)() { // parse AliasDeclaration in Statement mixin("alias f = " ~ decl ~ ";"); assert(f(1) == 1); static if (polymorphic) assert(f("s") == "s"); // parse AliasDeclaration in DeclDefs mixin("template X() { alias g = " ~ decl ~ "; }"); alias g = X!().g; assert(g(1) == 1); static if (polymorphic) assert(g("s") == "s"); } test!(q{ x => x }); test!(q{ ( x) => x }); test!(q{ (int x) => x }, false); test!(q{ ( x){ return x; } }); test!(q{ (int x){ return x; } }, false); test!(q{ function ( x) => x }); test!(q{ function (int x) => x }, false); test!(q{ function int ( x) => x }, false); test!(q{ function int (int x) => x }, false); test!(q{ delegate ( x) => x }); test!(q{ delegate (int x) => x }, false); test!(q{ delegate int ( x) => x }, false); test!(q{ delegate int (int x) => x }, false); test!(q{ function ( x){ return x; } }); test!(q{ function (int x){ return x; } }, false); test!(q{ function int ( x){ return x; } }, false); test!(q{ function int (int x){ return x; } }, false); test!(q{ delegate ( x){ return x; } }); test!(q{ delegate (int x){ return x; } }, false); test!(q{ delegate int ( x){ return x; } }, false); test!(q{ delegate int (int x){ return x; } }, false); // This is problematic case, and should be disallowed in the future. alias f = x => y; int y = 10; assert(f(1) == 10);; } /***************************************************/ // 12508 interface A12508(T) { T getT(); } class C12508 : A12508!double { double getT() { return 1; } } void f12508(A12508!double delegate() dg) { auto a = dg(); assert(a !is null); assert(a.getT() == 1.0); // fails! } void t12508(T)(A12508!T delegate() dg) { auto a = dg(); assert(a !is null); assert(a.getT() == 1.0); // fails! } ref alias Dg12508 = A12508!double delegate(); void t12508(T)(Dg12508 dg) {} void test12508() { f12508({ return new C12508(); }); t12508({ return new C12508(); }); static assert(!__traits(compiles, x12508({ return new C12508(); }))); } /***************************************************/ // 13879 void test13879() { bool function(int)[2] funcs1 = (int x) => true; // OK assert(funcs1[0] is funcs1[1]); funcs1[0] = x => true; // OK bool function(int)[2] funcs2 = x => true; // OK <- Error assert(funcs2[0] is funcs2[1]); } /***************************************************/ // 14745 void test14745() { // qualified nested functions auto foo1() pure immutable { return 0; } auto foo2() pure const { return 0; } // qualified lambdas (== implicitly marked as delegate literals) auto lambda1 = () pure immutable { return 0; }; auto lambda2 = () pure const { return 0; }; static assert(is(typeof(lambda1) : typeof(&foo1))); static assert(is(typeof(lambda2) : typeof(&foo2))); // qualified delegate literals auto dg1 = delegate () pure immutable { return 0; }; auto dg2 = delegate () pure const { return 0; }; static assert(is(typeof(dg1) : typeof(&foo1))); static assert(is(typeof(dg2) : typeof(&foo2))); } /***************************************************/ int main() { test1(); test2(); test3(); test4(); test4v(); test5(); test6(); test7(); test8(); test9(); test10(); test11(); test3235(); test6714(); test7193(); test7202(); test7288(); test7499(); test7500(); test7525(); test7582(); test7649(); test7650(); test7705(); test7713(); test7743(); test7761(); test7941(); test8005(); test8198(); test8226(); test8241(); test8242(); test8315(); test8397(); test8496(); test8575(); test9153(); test9393(); test9415(); test9628(); test9928(); test10133(); test10219(); test10288(); test10336(); test10928(); test11661(); test11774(); test12421(); test12508(); test13879(); test14745(); printf("Success\n"); return 0; }
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range; void get(Args...)(ref Args args) { import std.traits, std.meta, std.typecons; static if (Args.length == 1) { alias Arg = Args[0]; static if (isArray!Arg) { static if (isSomeChar!(ElementType!Arg)) { args[0] = readln.chomp.to!Arg; } else { args[0] = readln.split.to!Arg; } } else static if (isTuple!Arg) { auto input = readln.split; static foreach (i; 0..Fields!Arg.length) { args[0][i] = input[i].to!(Fields!Arg[i]); } } else { args[0] = readln.chomp.to!Arg; } } else { auto input = readln.split; assert(input.length == Args.length); static foreach (i; 0..Args.length) { args[i] = input[i].to!(Args[i]); } } } void get_lines(Args...)(size_t N, ref Args args) { import std.traits, std.range; static foreach (i; 0..Args.length) { static assert(isArray!(Args[i])); args[i].length = N; } foreach (i; 0..N) { static if (Args.length == 1) { get(args[0][i]); } else { auto input = readln.split; static foreach (j; 0..Args.length) { args[j][i] = input[j].to!(ElementType!(Args[j])); } } } } alias P = Tuple!(int, "to", int , "c"); void main() { int N, M; get(N, M); auto G = new P[][N]; foreach (_; 0..M) { int u, v, c; get(u, v, c); G[u-1] ~= P(v-1, c); G[v-1] ~= P(u-1, c); } auto res = new int[](N); void walk(int i, int p, int x) { if (x > 0) { res[i] = x; foreach (n; G[i]) if (n.to != p && res[n.to] == 0) { if (n.c == x) { walk(n.to, i, -x); } else { walk(n.to, i, n.c); } } } else { res[i] = -1; bool[int] memo; memo[-x] = true; x = 1; while (x in memo) ++x; foreach (n; G[i]) if (n.to != p && res[n.to] == 0) { memo[n.c] = true; while (x in memo) ++x; walk(n.to, i, n.c); } res[i] = x; } } walk(0, -1, 0); writefln!"%(%d\n%)"(res); }
D
/* TEST_OUTPUT: --- fail_compilation/diag9148.d(19): Error: pure function 'diag9148.test9148a.foo' cannot access mutable static data 'g' fail_compilation/diag9148.d(23): Error: pure function 'diag9148.test9148a.bar' cannot access mutable static data 'g' fail_compilation/diag9148.d(24): Error: immutable function 'diag9148.test9148a.bar' cannot access mutable data 'x' fail_compilation/diag9148.d(31): Error: pure function 'diag9148.test9148a.S.foo' cannot access mutable static data 'g' fail_compilation/diag9148.d(35): Error: pure function 'diag9148.test9148a.S.bar' cannot access mutable static data 'g' fail_compilation/diag9148.d(36): Error: immutable function 'diag9148.test9148a.S.bar' cannot access mutable data 'x' --- */ void test9148a() pure { static int g; int x; void foo() /+pure+/ { g++; } void bar() immutable /+pure+/ { g++; x++; } struct S { void foo() /+pure+/ { g++; } void bar() immutable /+pure+/ { g++; x++; } } } /* TEST_OUTPUT: --- fail_compilation/diag9148.d(53): Error: static function diag9148.test9148b.foo cannot access frame of function diag9148.test9148b --- */ void test9148b() { int x; static void foo() pure { int y = x; } }
D
keep in a certain state, position, or activity continue a certain state, condition, or activity retain possession of stop (someone or something) from doing something or being in a certain state conform one's action or practice to stick to correctly or closely look after maintain by writing regular records supply with room and board allow to remain in a place or position or maintain a property or feature supply with necessities and support fail to spoil or rot behave as expected during of holidays or rites keep under control maintain in safety from injury, harm, or danger raise retain rights to store or keep customarily have as a supply maintain for use and service hold and prevent from leaving prevent (food) from rotting
D
instance RBL_311_Fisk (Npc_Default) { //-------- primary data -------- name = "Fisk"; npctype = NPCTYPE_MAIN; guild = GIL_RBL; level = 15; voice = 12; id = 311; //-------- abilities -------- attribute[ATR_STRENGTH] = 70; attribute[ATR_DEXTERITY] = 58; attribute[ATR_MANA_MAX] = 0; attribute[ATR_MANA] = 0; attribute[ATR_HITPOINTS_MAX] = 224; attribute[ATR_HITPOINTS] = 224; //-------- visuals -------- // animations Mdl_SetVisual (self,"HUMANS.MDS"); Mdl_ApplyOverlayMds (self,"Humans_Relaxed.mds"); // body mesh ,bdytex,skin,head mesh ,headtex,teethtex,ruestung Mdl_SetVisualBody (self,"hum_body_Naked0",0,3,"Hum_Head_Bald",10,2,RBL_ARMOR_M); B_Scale (self); Mdl_SetModelFatness(self,-1); Npc_SetAivar(self,AIV_IMPORTANT, TRUE); fight_tactic = FAI_HUMAN_STRONG; //-------- Talente -------- Npc_SetTalentSkill (self,NPC_TALENT_1H,1); //-------- inventory -------- EquipItem (self,RBL_MW_02); CreateInvItems (self,ItKeLockpick,10); //-------------Daily Routine------------- daily_routine = Rtn_start_311; }; FUNC VOID Rtn_start_311 () //H?ndler { TA_Boss (18,30,07,00,"FISKBARMAN"); TA_SitAround (07,00,08,30,"SIT_FOX"); TA_Stand (08,30,18,30,"FISKBARMAN"); }; FUNC VOID Rtn_Alarm_311 () { TA_KillingGRDs(08,00,07,59,"HC_WARRIOR18"); };
D
// FileSystem utilities import std.getopt; // For getting options from the commandline import std.string; import std.array; static import stdio = std.stdio; static import file = std.file; static import KFS = FileSystem; import Utilities; //debug = mkfs; //debug = args; int main(string[] args) { bool mkfs = false; string ls_path; string ll_path; string[] copy; string mkdir_path; string touch_path; size_t fs_size; string disk; int retval = 0; debug(args) stdio.stderr.writef("args pre-getopt: %s\n", args); arraySep = ","; getopt(args, "mkfs", &mkfs, "size", &fs_size, "disk", &disk, "ll", &ll_path, "ls", &ls_path, "copy", &copy, "mkdir", &mkdir_path, "touch", &touch_path ); debug(args) stdio.stderr.writef("args post-getopt: %s\n", args); if(mkfs && fs_size) { if(fs_size > 0 && disk.length) { stdio.stdout.writef("Creating new filesystem on disk [%s] of size [%d]\n", disk, fs_size); if(file.exists(disk)) throw(new Exception(format("Unwilling to destroy existing file in mkfs: [%s]\n", disk))); KFS.DISK = stdio.File(disk, "w+b"); KFS.mkfs(fs_size); KFS.DISK.close(); //stderr.writef("Closed DISK.name[%s]\n", DISK.name); } else { stdio.stderr.writef("Not enough arguments\n"); } } if (ll_path.length) { stdio.stderr.writef("Listing entries for %s\n", ll_path); KFS.DISK = stdio.File(disk, "r+b"); assert(KFS.isDir("/")); KFS.chdir(ll_path); foreach(e; KFS.dirEntries()) { stdio.writef("%s %d\n", e.name, e.size); } KFS.DISK.close(); } if (mkdir_path.length) { stdio.stderr.writef("KFS.mkdir: %s: ", mkdir_path); KFS.DISK = stdio.File(disk, "r+b"); try { KFS.chdir("/"); KFS.mkdir(mkdir_path); assert(KFS.isDir(mkdir_path)); } catch(Exception e) { stdio.stderr.writef("mkdir %s failed: %s\n", mkdir_path, e.msg); retval = 1; } KFS.DISK.close(); } if (touch_path.length) { stdio.stderr.writef("KFS.touch: %s\n", touch_path); KFS.DISK = stdio.File(disk, "r+b"); KFS.chdir("/"); KFS.touch(touch_path); assert(KFS.isFile(touch_path)); KFS.DISK.close(); } if (copy.length) { string copy_dest = "/"; if(copy.length > 1) { copy_dest = copy[$-1]; copy.length = copy.length - 1; } KFS.DISK = stdio.File(disk, "r+b"); foreach(copy_from; copy) { string copy_to; if(copy_dest[$-1] == '/') copy_to = copy_dest ~ copy_from; else copy_to = copy_dest; stdio.stderr.writef("Copy file from host %s->%s\n", copy_from, copy_to); try { //stdio.stderr.writef("Opening %s in \"r\" mode\n", copy_from); KFS.FileCompat infile = new KFS.FileCompat(stdio.File(copy_from, "r")); //stdio.stderr.writef("Opening %s in \"w+\" mode\n", copy_to); KFS.FileCompat outfile = new KFS.FileCompat(KFS.File(copy_to, "w+")); //stdio.stderr.writef("Done Opening files\n"); ByteCode[] bytes; bytes.length = cast(uint)(std.file.getSize(copy_from)); if(bytes.length) { infile.rawRead(bytes); outfile.rawWrite(bytes); } outfile.close(); infile.close(); } catch(Exception e) { stdio.stderr.writef("Opening %s failed: %s\n", copy_to, e.msg); retval = 1; } } KFS.DISK.close(); } stdio.stderr.writef("Done\n"); return retval; }
D
func void Equip_Bonus_HP(var int bonus) { self.attribute[ATR_HITPOINTS_MAX] += bonus; self.attribute[ATR_HITPOINTS] += bonus; }; func void UnEquip_Bonus_HP(var int antibonus) { self.attribute[ATR_HITPOINTS_MAX] -= antibonus; if(self.attribute[ATR_HITPOINTS] > (antibonus + 1)) { self.attribute[ATR_HITPOINTS] -= antibonus; } else { self.attribute[ATR_HITPOINTS] = 2; }; }; func void Equip_Bonus_Mana(var int bonus) { self.attribute[ATR_MANA_MAX] +=bonus; self.attribute[ATR_MANA] +=bonus; }; func void UnEquip_Bonus_Mana(var int antibonus) { self.attribute[ATR_MANA_MAX] -= antibonus; if(self.attribute[ATR_MANA] >= antibonus) { self.attribute[ATR_MANA] -= antibonus; } else { self.attribute[ATR_MANA] = 0; }; };
D
/Users/sid/Documents/iOS Dev/BullsEye/build/BullsEye.build/Debug-iphonesimulator/BullsEye.build/Objects-normal/x86_64/AboutViewController.o : /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/ViewController.swift /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/AboutViewController.swift /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sid/Documents/iOS Dev/BullsEye/build/BullsEye.build/Debug-iphonesimulator/BullsEye.build/Objects-normal/x86_64/AboutViewController~partial.swiftmodule : /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/ViewController.swift /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/AboutViewController.swift /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sid/Documents/iOS Dev/BullsEye/build/BullsEye.build/Debug-iphonesimulator/BullsEye.build/Objects-normal/x86_64/AboutViewController~partial.swiftdoc : /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/ViewController.swift /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/AboutViewController.swift /Users/sid/Documents/iOS\ Dev/BullsEye/BullsEye/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
D
/run/media/andreby/Docs/GithubCodes/learn_rust/actix-demo/target/debug/deps/actix_demo-46a6642b0ea801c8: src/main.rs /run/media/andreby/Docs/GithubCodes/learn_rust/actix-demo/target/debug/deps/actix_demo-46a6642b0ea801c8.d: src/main.rs src/main.rs:
D
module UnrealScript.UDKBase.UDKAIDecisionComponent; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.Engine.ActorComponent; extern(C++) interface UDKAIDecisionComponent : ActorComponent { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class UDKBase.UDKAIDecisionComponent")); } private static __gshared UDKAIDecisionComponent mDefaultProperties; @property final static UDKAIDecisionComponent DefaultProperties() { mixin(MGDPC("UDKAIDecisionComponent", "UDKAIDecisionComponent UDKBase.Default__UDKAIDecisionComponent")); } @property final { bool bTriggered() { mixin(MGBPC(88, 0x1)); } bool bTriggered(bool val) { mixin(MSBPC(88, 0x1)); } } }
D
/* Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ module derelict.opengl3.wext; //Just throwing s*it in here that GL rendersystem wants version(Windows): private { import std.string; import derelict.opengl3.types; import derelict.opengl3.constants; import derelict.opengl3.internal; import derelict.util.wintypes; } //Added. enum { //WGL_ARB_pixel_format WGL_DRAW_TO_WINDOW_ARB = 0x2001, WGL_ACCELERATION_ARB = 0x2003, WGL_SUPPORT_OPENGL_ARB = 0x2010, WGL_DOUBLE_BUFFER_ARB = 0x2011, WGL_PIXEL_TYPE_ARB = 0x2013, WGL_COLOR_BITS_ARB = 0x2014, WGL_RED_BITS_ARB = 0x2015, WGL_RED_SHIFT_ARB = 0x2016, WGL_GREEN_BITS_ARB = 0x2017, WGL_GREEN_SHIFT_ARB = 0x2018, WGL_BLUE_BITS_ARB = 0x2019, WGL_BLUE_SHIFT_ARB = 0x201A, WGL_ALPHA_BITS_ARB = 0x201B, WGL_DEPTH_BITS_ARB = 0x2022, WGL_STENCIL_BITS_ARB = 0x2023, WGL_FULL_ACCELERATION_ARB = 0x2027, WGL_TYPE_RGBA_ARB = 0x202B, //WGL_EXT_framebuffer_sRGB WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20A9, //WGL_ARB_multisample WGL_SAMPLE_BUFFERS_ARB = 0x2041, WGL_SAMPLES_ARB = 0x2042, //WGL_ARB_pixel_format_float WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0, //WGL_ARB_pbuffer WGL_DRAW_TO_PBUFFER_ARB = 0x202D, WGL_MAX_PBUFFER_PIXELS_ARB = 0x202E, WGL_MAX_PBUFFER_WIDTH_ARB = 0x202F, WGL_MAX_PBUFFER_HEIGHT_ARB = 0x2030, WGL_PBUFFER_LARGEST_ARB = 0x2033, WGL_PBUFFER_WIDTH_ARB = 0x2034, WGL_PBUFFER_HEIGHT_ARB = 0x2035, WGL_PBUFFER_LOST_ARB = 0x2036, } extern(Windows) { alias nothrow HPBUFFERARB function(HDC, int, int, int, const(int)*) da_wglCreatePbufferARB; alias nothrow BOOL function(HPBUFFERARB) da_wglDestroyPbufferARB; alias nothrow HDC function(HPBUFFERARB) da_wglGetPbufferDCARB; alias nothrow BOOL function(HPBUFFERARB, int, int*) da_wglQueryPbufferARB; alias nothrow int function(HPBUFFERARB, HDC) da_wglReleasePbufferDCARB; } __gshared { da_wglCreatePbufferARB wglCreatePbufferARB; da_wglDestroyPbufferARB wglDestroyPbufferARB; da_wglGetPbufferDCARB wglGetPbufferDCARB; da_wglQueryPbufferARB wglQueryPbufferARB; da_wglReleasePbufferDCARB wglReleasePbufferDCARB; } private __gshared bool _WGL_ARB_pbuffer; bool WGL_ARB_pbuffer() @property { return _WGL_ARB_pbuffer; } private void load_WGL_ARB_pbuffer() { try { bindGLFunc(cast(void**)&wglCreatePbufferARB, "wglCreatePbufferARB"); bindGLFunc(cast(void**)&wglDestroyPbufferARB, "wglDestroyPbufferARB"); bindGLFunc(cast(void**)&wglGetPbufferDCARB, "wglGetPbufferDCARB"); bindGLFunc(cast(void**)&wglQueryPbufferARB, "wglQueryPbufferARB"); bindGLFunc(cast(void**)&wglReleasePbufferDCARB, "wglReleasePbufferDCARB"); _WGL_ARB_pbuffer = true; } catch(Exception e) { _WGL_ARB_pbuffer = false; } } //WGL_ARB_pixel_format extern(Windows) { alias nothrow BOOL function(HDC, int, int, uint, const int *, int *) da_wglGetPixelFormatAttribivARB; alias nothrow BOOL function(HDC, int, int, uint, const int *, float *) da_wglGetPixelFormatAttribfvARB; //Already in wgl.d //alias nothrow BOOL function(HDC, const int *, const(float) *, uint, int *, uint *) da_wglChoosePixelFormatARB; } __gshared { da_wglGetPixelFormatAttribivARB wglGetPixelFormatAttribivARB; da_wglGetPixelFormatAttribfvARB wglGetPixelFormatAttribfvARB; } private __gshared bool _WGL_ARB_pixel_format; bool WGL_ARB_pixel_format() @property { return _WGL_ARB_pixel_format; } private void load_WGL_ARB_pixel_format() { try { bindGLFunc(cast(void**)&wglGetPixelFormatAttribivARB, "wglGetPixelFormatAttribivARB"); bindGLFunc(cast(void**)&wglGetPixelFormatAttribfvARB, "wglGetPixelFormatAttribfvARB"); _WGL_ARB_pixel_format = true; } catch(Exception e) { _WGL_ARB_pixel_format = false; } } //WGL_EXT_swap_control extern(Windows) { alias nothrow BOOL function(int) da_wglSwapIntervalEXT; alias nothrow int function() da_wglGetSwapIntervalEXT; } __gshared { da_wglSwapIntervalEXT wglSwapIntervalEXT; da_wglGetSwapIntervalEXT wglGetSwapIntervalEXT; } private __gshared bool _WGL_EXT_swap_control; bool WGL_EXT_swap_control() @property { return _WGL_EXT_swap_control; } private void load_WGL_EXT_swap_control() { try { bindGLFunc(cast(void**)&wglSwapIntervalEXT, "wglSwapIntervalEXT"); bindGLFunc(cast(void**)&wglGetSwapIntervalEXT, "wglGetSwapIntervalEXT"); _WGL_EXT_swap_control = true; } catch(Exception e) { _WGL_EXT_swap_control = false; } } package void loadWEXT(GLVersion glversion) { load_WGL_ARB_pbuffer(); load_WGL_ARB_pixel_format(); load_WGL_EXT_swap_control(); } /*bool isWExtSupported(GLVersion glversion, string name) { //auto extstr = to!string(glGetString(GL_EXTENSIONS)); auto extstr = to!string(wglGetExtensionsStringARB(hDC));//Also possible that ARB returns null, while EXT works auto index = extstr.indexOf(name); if(index != -1) { // It's possible that the extension name is actually a // substring of another extension. If not, then the // character following the name in the extenions string // should be a space (or possibly the null character). size_t idx = index + name.length; if(extstr[idx] == ' ' || extstr[idx] == '\0') return true; } return false; }*/
D
/Users/hernaniruegasvillarreal/Downloads/9.02/Build/Intermediates/Flappy\ Bird.build/Debug-iphonesimulator/Flappy\ Bird.build/Objects-normal/x86_64/GameScene.o : /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/GameScene.swift /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/GameViewController.swift /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/AppDelegate.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GameplayKit.swiftmodule /Users/hernaniruegasvillarreal/Downloads/9.02/Build/Intermediates/Flappy\ Bird.build/Debug-iphonesimulator/Flappy\ Bird.build/Objects-normal/x86_64/GameScene~partial.swiftmodule : /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/GameScene.swift /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/GameViewController.swift /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/AppDelegate.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GameplayKit.swiftmodule /Users/hernaniruegasvillarreal/Downloads/9.02/Build/Intermediates/Flappy\ Bird.build/Debug-iphonesimulator/Flappy\ Bird.build/Objects-normal/x86_64/GameScene~partial.swiftdoc : /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/GameScene.swift /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/GameViewController.swift /Users/hernaniruegasvillarreal/Downloads/9.02/Flappy\ Bird/AppDelegate.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GameplayKit.swiftmodule
D
import std.stdio; import std.c.stdio; /******************************************/ struct S { int opStar() { return 7; } } void test1() { S s; printf("%d\n", *s); assert(*s == 7); } /******************************************/ void test2() { double[1][2] bar; bar[0][0] = 1.0; bar[1][0] = 2.0; foo2(bar); } void foo2(T...)(T args) { foreach (arg; args[0 .. $]) { //writeln(arg); bar2!(typeof(arg))(&arg); } } void bar2(D)(const(void)* arg) { D obj = *cast(D*) arg; } /***************************************************/ void test3() { version (unittest) { printf("unittest!\n"); } else { printf("no unittest!\n"); } version (assert) { printf("assert!\n"); } else { printf("no assert!\n"); } } /***************************************************/ void test4() { immutable int maxi = 8; int[][maxi] neighbors = [ cast(int[])[ ], [ 0 ], [ 0, 1], [ 0, 2], [1, 2], [1, 2, 3, 4], [ 2, 3, 5], [ 4, 5, 6 ] ]; int[maxi] grid; // neighbors[0].length = 0; void place(int k, uint mask) { if(k<maxi) { for(uint m = 1, d = 1; d <= maxi; d++, m<<=1) if(!(mask & m)) { bool ok = true; int dif; foreach(nb; neighbors[k]) if((dif=grid[nb]-d)==1 || dif==-1) { ok = false; break; } if(ok) { grid[k] = d; place(k+1, mask | m); } } } else { printf(" %d\n%d %d %d\n%d %d %d\n %d\n\n", grid[0], grid[1], grid[2], grid[3], grid[4], grid[5], grid[6], grid[7]); } } place(0, 0); } /***************************************************/ struct S5 { enum S5 some_constant = {2}; int member; } void test5() { } /***************************************************/ struct S6 { int a, b, c; } struct T6 { S6 s; int b = 7; S6* opDot() { return &s; } } void test6() { T6 t; t.a = 4; t.b = 5; t.c = 6; assert(t.a == 4); assert(t.b == 5); assert(t.c == 6); assert(t.s.b == 0); assert(t.sizeof == 4*4); assert(t.init.sizeof == 4*4); } /***************************************************/ struct S7 { int a, b, c; } class C7 { S7 s; int b = 7; S7* opDot() { return &s; } } void test7() { C7 t = new C7(); t.a = 4; t.b = 5; t.c = 6; assert(t.a == 4); assert(t.b == 5); assert(t.c == 6); assert(t.s.b == 0); assert(t.sizeof == (void*).sizeof); assert(t.init is null); } /***************************************************/ void foo8(int n1 = __LINE__ + 0, int n2 = __LINE__, string s = __FILE__) { assert(n1 < n2); printf("n1 = %d, n2 = %d, s = %.*s\n", n1, n2, s.length, s.ptr); } void test8() { foo8(); } /***************************************************/ void foo9(int n1 = __LINE__ + 0, int n2 = __LINE__, string s = __FILE__)() { assert(n1 < n2); printf("n1 = %d, n2 = %d, s = %.*s\n", n1, n2, s.length, s.ptr); } void test9() { foo9(); } /***************************************************/ int foo10(char c) pure nothrow { return 1; } void test10() { int function(char c) fp; int function(char c) pure nothrow fq; fp = &foo10; fq = &foo10; } /***************************************************/ class Base11 {} class Derived11 : Base11 {} class MoreDerived11 : Derived11 {} int fun11(Base11) { return 1; } int fun11(Derived11) { return 2; } void test11() { MoreDerived11 m; auto i = fun11(m); assert(i == 2); } /***************************************************/ interface ABC {}; interface AB: ABC {}; interface BC: ABC {}; interface AC: ABC {}; interface A: AB, AC {}; interface B: AB, BC {}; interface C: AC, BC {}; int f12(AB ab) { return 1; } int f12(ABC abc) { return 2; } void test12() { A a; auto i = f12(a); assert(i == 1); } /***************************************************/ template Foo13(alias x) { enum bar = x + 1; } static assert(Foo13!(2+1).bar == 4); template Bar13(alias x) { enum bar = x; } static assert(Bar13!("abc").bar == "abc"); void test13() { } /***************************************************/ template Foo14(alias a) { alias Bar14!(a) Foo14; } int Bar14(alias a)() { return a.sizeof; } void test14() { auto i = Foo14!("hello")(); printf("i = %d\n", i); assert(i == "hello".sizeof); i = Foo14!(1)(); printf("i = %d\n", i); assert(i == 4); } /***************************************************/ auto foo15()(int x) { return 3 + x; } void test15() { auto bar()(int x) { return 5 + x; } printf("%d\n", foo15(4)); printf("%d\n", bar(4)); } /***************************************************/ int foo16(int x) { return 1; } int foo16(ref int x) { return 2; } void test16() { int y; auto i = foo16(y); printf("i == %d\n", i); assert(i == 2); i = foo16(3); assert(i == 1); } /***************************************************/ class A17 { } class B17 : A17 { } class C17 : B17 { } int foo17(A17, ref int x) { return 1; } int foo17(B17, ref int x) { return 2; } void test17() { C17 c; int y; auto i = foo17(c, y); printf("i == %d\n", i); assert(i == 2); } /***************************************************/ class C18 { void foo(int x) { foo("abc"); } void foo(string s) { } // this is hidden, but that's ok 'cuz no overlap void bar() { foo("abc"); } } class D18 : C18 { override void foo(int x) { } } void test18() { D18 d = new D18(); d.bar(); } /***************************************************/ int foo19(alias int a)() { return a; } void test19() { int y = 7; auto i = foo19!(y)(); printf("i == %d\n", i); assert(i == 7); i = foo19!(4)(); printf("i == %d\n", i); assert(i == 4); } /***************************************************/ template Foo20(int x) if (x & 1) { const int Foo20 = 6; } template Foo20(int x) if ((x & 1) == 0) { const int Foo20 = 7; } void test20() { int i = Foo20!(3); printf("%d\n", i); assert(i == 6); i = Foo20!(4); printf("%d\n", i); assert(i == 7); } /***************************************************/ template isArray21(T : U[], U) { static const isArray21 = 1; } template isArray21(T) { static const isArray21 = 0; } int foo21(T)(T x) if (isArray21!(T)) { return 1; } int foo21(T)(T x) if (!isArray21!(T)) { return 2; } void test21() { auto i = foo21(5); assert(i == 2); int[] a; i = foo21(a); assert(i == 1); } /***************************************************/ void test22() { immutable uint x, y; foreach (i; x .. y) {} } /***************************************************/ const bool foo23 = is(typeof(function void() { })); const bar23 = is(typeof(function void() { })); void test23() { assert(foo23 == true); assert(bar23 == true); } /***************************************************/ ref int foo24(int i) { static int x; x = i; return x; } void test24() { int x = foo24(3); assert(x == 3); } /***************************************************/ ref int foo25(int i) { static int x; x = i; return x; } int bar25(ref int x) { return x + 1; } void test25() { int x = bar25(foo25(3)); assert(x == 4); } /***************************************************/ static int x26; ref int foo26(int i) { x26 = i; return x26; } void test26() { int* p = &foo26(3); assert(*p == 3); } /***************************************************/ static int x27 = 3; ref int foo27(int i) { return x27; } void test27() { foo27(3) = 4; assert(x27 == 4); } /***************************************************/ ref int foo28(ref int x) { return x; } void test28() { int a; foo28(a); } /***************************************************/ void wyda(int[] a) { printf("aaa\n"); } void wyda(int[int] a) { printf("bbb\n"); } struct S29 { int[] a; void wyda() { a.wyda; a.wyda(); } } void test29() { int[] a; a.wyda; int[5] b; b.wyda; int[int] c; c.wyda; S29 s; s.wyda(); } /***************************************************/ void foo30(D)(D arg) if (isIntegral!D) { } struct S30(T) { } struct U30(int T) { } alias int myint30; void test30() { S30!myint30 u; S30!int s; S30!(int) t = s; // U30!3 v = s; } /***************************************************/ class A31 { void foo(int* p) { } } class B31 : A31 { override void foo(scope int* p) { } } void test31() { } /***************************************************/ void bar32() { } nothrow void foo32(int* p) { //try { bar32(); } catch (Object o) { } try { bar32(); } catch (Throwable o) { } try { bar32(); } catch (Exception o) { } } void test32() { int i; foo32(&i); } /***************************************************/ struct Integer { this(int i) { this.i = i; } this(long ii) { i = 3; } const int i; } void test33() { } /***************************************************/ void test34() { alias uint Uint; foreach(Uint u;1..10) {} for(Uint u=1;u<10;u++) {} } /***************************************************/ ref int foo35(bool condition, ref int lhs, ref int rhs) { if ( condition ) return lhs; return rhs; } ref int bar35()(bool condition, ref int lhs, ref int rhs) { if ( condition ) return lhs; return rhs; } void test35() { int a = 10, b = 11; foo35(a<b, a, b) = 42; printf("a = %d and b = %d\n", a, b); // a = 42 and b = 11 assert(a == 42 && b == 11); bar35(a<b, a, b) = 52; printf("a = %d and b = %d\n", a, b); assert(a == 42 && b == 52); } /***************************************************/ int foo36(T...)(T ts) if (T.length > 1) { return T.length; } int foo36(T...)(T ts) if (T.length <= 1) { return T.length * 7; } void test36() { auto i = foo36!(int,int)(1, 2); assert(i == 2); i = foo36(1, 2, 3); assert(i == 3); i = foo36(1); assert(i == 7); i = foo36(); assert(i == 0); } /***************************************************/ void test6685() { struct S { int x; }; with({ return S(); }()) { x++; } } /***************************************************/ struct A37(alias T) { } void foo37(X)(X x) if (is(X Y == A37!(U), alias U)) { } void bar37() {} void test37() { A37!(bar37) a2; foo37(a2); foo37!(A37!bar37)(a2); } /***************************************************/ struct A38 { this(this) { printf("B's copy\n"); } bool empty() {return false;} void popFront() {} int front() { return 1; } // ref A38 opSlice() { return this; } } void test38() { A38 a; int i; foreach (e; a) { if (++i == 100) break; } } /***************************************************/ alias int function() Fun39; alias ref int function() Gun39; static assert(!is(Fun39 == Gun39)); void test39() { } /***************************************************/ int x40; struct Proxy { ref int at(int i)() { return x40; } } void test40() { Proxy p; auto x = p.at!(1); } /***************************************************/ template Foo41(TList...) { alias TList Foo41; } alias Foo41!(immutable(ubyte)[], ubyte[]) X41; void test41() { } /***************************************************/ bool endsWith(A1, A2)(A1 longer, A2 shorter) { static if (is(typeof(longer[0 .. 0] == shorter))) { } else { } return false; } void test42() { char[] a; byte[] b; endsWith(a, b); } /***************************************************/ void f43(S...)(S s) if (S.length > 3) { } void test43() { f43(1, 2, 3, 4); } /***************************************************/ struct S44(int x = 1){} void fun()(S44!(1) b) { } void test44() { S44!() s; fun(s); } /***************************************************/ // 2006 void test2006() { string [][] aas = []; assert(aas.length == 0); aas ~= cast (string []) []; assert(aas.length == 1); aas = aas ~ cast (string []) []; assert(aas.length == 2); } /***************************************************/ // 8442 void test8442() { enum int[] fooEnum = []; immutable fooImmutable = fooEnum; } /***************************************************/ class A45 { int x; int f() { printf("A\n"); return 1; } } class B45 : A45 { override const int f() { printf("B\n"); return 2; } } void test45() { A45 y = new B45; int i = y.f; assert(i == 2); } /***************************************************/ void text10682() { ulong x = 1; ulong y = 2 ^^ x; } /***************************************************/ struct Test46 { int foo; } void test46() { enum Test46 test = {}; enum q = test.foo; } /***************************************************/ pure int double_sqr(int x) { int y = x; void do_sqr() { y *= y; } do_sqr(); return y; } void test47() { assert(double_sqr(10) == 100); } /***************************************************/ void sort(alias less)(string[] r) { bool pred() { return less("a", "a"); } .sort!(less)(r); } void foo48() { int[string] freqs; string[] words; sort!((a, b) { return freqs[a] > freqs[b]; })(words); sort!((string a, string b) { return freqs[a] > freqs[b]; })(words); //sort!(bool (a, b) { return freqs[a] > freqs[b]; })(words); //sort!(function (a, b) { return freqs[a] > freqs[b]; })(words); //sort!(function bool(a, b) { return freqs[a] > freqs[b]; })(words); sort!(delegate bool(string a, string b) { return freqs[a] > freqs[b]; })(words); } void test48() { } /***************************************************/ // 6408 static assert(!is(typeof(string[0..1].init))); static assert(is(typeof(string[].init) == string[])); static assert(is(typeof(string[][].init) == string[][])); static assert(is(typeof(string[][][].init) == string[][][])); static assert(is(typeof(string[1].init) == string[1])); static assert(is(typeof(string[1][1].init) == string[1][1])); static assert(is(typeof(string[1][1][1].init) == string[1][1][1])); static assert(is(typeof(string[string].init) == string[string])); static assert(is(typeof(string[string][string].init) == string[string][string])); static assert(is(typeof(string[string][string][string].init) == string[string][string][string])); template TT6408(T...) { alias T TT6408; } static assert(is(typeof(TT6408!(int, int)[].init) == TT6408!(int, int))); static assert(is(typeof(TT6408!(int, int)[0..$].init) == TT6408!(int, int))); static assert(is(typeof(TT6408!(int, int)[$-1].init) == int)); /***************************************************/ // 9409 template TT9409(T...) { alias T TT9409; } template idxTypes9409(Prefix...) { TT9409!((Prefix[$-1])) idxTypes9409; } alias idxTypes9409!(int) Types9409; /***************************************************/ struct S49 { static void* p; this( string name ) { printf( "(ctor) &%.*s.x = %p\n", name.length, name.ptr, &x ); p = cast(void*)&x; } invariant() {} int x; } void test49() { auto s = new S49("s2"); printf( "&s2.x = %p\n", &s.x ); assert(cast(void*)&s.x == S49.p); } /***************************************************/ auto max50(Ts...)(Ts args) if (Ts.length >= 2 && is(typeof(Ts[0].init > Ts[1].init ? Ts[1].init : Ts[0].init))) { static if (Ts.length == 2) return args[1] > args[0] ? args[1] : args[0]; else return max50(max50(args[0], args[1]), args[2 .. $]); } void test50() { assert(max50(4, 5) == 5); assert(max50(2.2, 4.5) == 4.5); assert(max50("Little", "Big") == "Little"); assert(max50(4, 5.5) == 5.5); assert(max50(5.5, 4) == 5.5); } /***************************************************/ void test51() { static immutable int[2] array = [ 42 ]; enum e = array[1]; static immutable int[1] array2 = [ 0: 42 ]; enum e2 = array2[0]; assert(e == 0); assert(e2 == 42); } /***************************************************/ enum ubyte[4] a52 = [5,6,7,8]; void test52() { int x=3; assert(a52[x]==8); } /***************************************************/ void test53() { size_t func2(immutable(void)[] t) { return 0; } } /***************************************************/ void foo54(void delegate(void[]) dg) { } void test54() { void func(void[] t) pure { } foo54(&func); // void func2(const(void)[] t) { } // foo54(&func2); } /***************************************************/ class Foo55 { synchronized void noop1() { } void noop2() shared { } } void test55() { auto foo = new shared(Foo55); foo.noop1(); foo.noop2(); } /***************************************************/ enum float one56 = 1 * 1; template X56(float E) { int X56 = 2; } alias X56!(one56 * one56) Y56; void test56() { assert(Y56 == 2); } /***************************************************/ void test57() { alias shared(int) T; assert (is(T == shared)); } /***************************************************/ struct A58 { int a,b; } void test58() { A58[2] rg=[{1,2},{5,6}]; assert(rg[0].a == 1); assert(rg[0].b == 2); assert(rg[1].a == 5); assert(rg[1].b == 6); } /***************************************************/ class A59 { const foo(int i) { return i; } } /***************************************************/ void test60() { enum real ONE = 1.0; real x; for (x=0.0; x<10.0; x+=ONE) printf("%Lg\n", x); printf("%Lg\n", x); assert(x == 10); } /***************************************************/ pure immutable(T)[] fooPT(T)(immutable(T)[] x, immutable(T)[] y){ immutable(T)[] fooState; immutable(T)[] bar(immutable(T)[] x){ fooState = "hello "; return x ~ y; } return fooState ~ bar(x); } void test61() { writeln(fooPT("p", "c")); } /***************************************************/ void test9577() { static int function(int)[] foo = [x => x]; foo[0](0); } /***************************************************/ int[3] foo62(int[3] a) { a[1]++; return a; } void test62() { int[3] b; b[0] = 1; b[1] = 2; b[2] = 3; auto c = foo62(b); assert(b[0] == 1); assert(b[1] == 2); assert(b[2] == 3); assert(c[0] == 1); assert(c[1] == 3); assert(c[2] == 3); } /***************************************************/ void test3927() { int[] array; assert(array.length++ == 0); assert(array.length == 1); assert(array.length-- == 1); assert(array.length == 0); } /***************************************************/ void test63() { int[3] b; b[0] = 1; b[1] = 2; b[2] = 3; auto c = b; b[1]++; assert(b[0] == 1); assert(b[1] == 3); assert(b[2] == 3); assert(c[0] == 1); assert(c[1] == 2); assert(c[2] == 3); } /***************************************************/ void test64() { int[3] b; b[0] = 1; b[1] = 2; b[2] = 3; int[3] c; c = b; b[1]++; assert(b[0] == 1); assert(b[1] == 3); assert(b[2] == 3); assert(c[0] == 1); assert(c[1] == 2); assert(c[2] == 3); } /***************************************************/ int[2] foo65(int[2] a) { a[1]++; return a; } void test65() { int[2] b; b[0] = 1; b[1] = 2; int[2] c = foo65(b); assert(b[0] == 1); assert(b[1] == 2); assert(c[0] == 1); assert(c[1] == 3); } /***************************************************/ int[1] foo66(int[1] a) { a[0]++; return a; } void test66() { int[1] b; b[0] = 1; int[1] c = foo66(b); assert(b[0] == 1); assert(c[0] == 2); } /***************************************************/ int[2] foo67(out int[2] a) { a[0] = 5; a[1] = 6; return a; } void test67() { int[2] b; b[0] = 1; b[1] = 2; int[2] c = foo67(b); assert(b[0] == 5); assert(b[1] == 6); assert(c[0] == 5); assert(c[1] == 6); } /***************************************************/ void test68() { digestToString(cast(ubyte[16])x"c3fcd3d76192e4007dfb496cca67e13b"); } void digestToString(const ubyte[16] digest) { assert(digest[0] == 0xc3); assert(digest[15] == 0x3b); } /***************************************************/ void test69() { digestToString69(cast(ubyte[16])x"c3fcd3d76192e4007dfb496cca67e13b"); } void digestToString69(ref const ubyte[16] digest) { assert(digest[0] == 0xc3); assert(digest[15] == 0x3b); } /***************************************************/ void test70() { digestToString70("1234567890123456"); } void digestToString70(ref const char[16] digest) { assert(digest[0] == '1'); assert(digest[15] == '6'); } /***************************************************/ void foo71(out shared int o) {} /***************************************************/ struct foo72 { int bar() shared { return 1; } } void test72() { shared foo72 f; auto x = f.bar; } /***************************************************/ class Foo73 { static if (is(typeof(this) T : shared T)) static assert(0); static if (is(typeof(this) U == shared U)) static assert(0); static if (is(typeof(this) U == const U)) static assert(0); static if (is(typeof(this) U == immutable U)) static assert(0); static if (is(typeof(this) U == const shared U)) static assert(0); static assert(!is(int == const)); static assert(!is(int == immutable)); static assert(!is(int == shared)); static assert(is(int == int)); static assert(is(const(int) == const)); static assert(is(immutable(int) == immutable)); static assert(is(shared(int) == shared)); static assert(is(const(shared(int)) == shared)); static assert(is(const(shared(int)) == const)); static assert(!is(const(shared(int)) == immutable)); static assert(!is(const(int) == immutable)); static assert(!is(const(int) == shared)); static assert(!is(shared(int) == const)); static assert(!is(shared(int) == immutable)); static assert(!is(immutable(int) == const)); static assert(!is(immutable(int) == shared)); } template Bar(T : T) { alias T Bar; } template Barc(T : const(T)) { alias T Barc; } template Bari(T : immutable(T)) { alias T Bari; } template Bars(T : shared(T)) { alias T Bars; } template Barsc(T : shared(const(T))) { alias T Barsc; } void test73() { auto f = new Foo73; alias int T; // 5*5 == 25 combinations, plus 2 for swapping const and shared static assert(is(Bar!(T) == T)); static assert(is(Bar!(const(T)) == const(T))); static assert(is(Bar!(immutable(T)) == immutable(T))); static assert(is(Bar!(shared(T)) == shared(T))); static assert(is(Bar!(shared(const(T))) == shared(const(T)))); static assert(is(Barc!(const(T)) == T)); static assert(is(Bari!(immutable(T)) == T)); static assert(is(Bars!(shared(T)) == T)); static assert(is(Barsc!(shared(const(T))) == T)); static assert(is(Barc!(T) == T)); static assert(is(Barc!(immutable(T)) == T)); static assert(is(Barc!(const(shared(T))) == shared(T))); static assert(is(Barsc!(immutable(T)) == T)); static assert(is(Bars!(const(shared(T))) == const(T))); static assert(is(Barsc!(shared(T)) == T)); Bars!(shared(const(T))) b; pragma(msg, typeof(b)); static assert(is(Bars!(shared(const(T))) == const(T))); static assert(is(Barc!(shared(const(T))) == shared(T))); static assert(!is(Bari!(T))); static assert(!is(Bari!(const(T)))); static assert(!is(Bari!(shared(T)))); static assert(!is(Bari!(const(shared(T))))); static assert(is(Barc!(shared(T)))); static assert(!is(Bars!(T))); static assert(!is(Bars!(const(T)))); static assert(!is(Bars!(immutable(T)))); static assert(!is(Barsc!(T))); static assert(!is(Barsc!(const(T)))); } /***************************************************/ pure nothrow { alias void function(int) A74; } alias void function(int) pure nothrow B74; alias pure nothrow void function(int) C74; void test74() { A74 a = null; B74 b = null; C74 c = null; a = b; a = c; } /***************************************************/ void test9212() { int[int] aa; foreach (const key, const val; aa) {} foreach (size_t key, size_t val; aa) {} } /***************************************************/ class A75 { pure static void raise(string s) { throw new Exception(s); } } void test75() { int x = 0; try { A75.raise("a"); } catch (Exception e) { x = 1; } assert(x == 1); } /***************************************************/ void test76() { int x, y; bool which; (which ? x : y) += 5; assert(y == 5); } /***************************************************/ void test77() { auto a = ["hello", "world"]; pragma(msg, typeof(a)); auto b = a; assert(a is b); assert(a == b); b = a.dup; assert(a == b); assert(a !is b); } /***************************************************/ void test78() { auto array = [0, 2, 4, 6, 8, 10]; array = array[0 .. $ - 2]; // Right-shrink by two elements assert(array == [0, 2, 4, 6]); array = array[1 .. $]; // Left-shrink by one element assert(array == [2, 4, 6]); array = array[1 .. $ - 1]; // Shrink from both sides assert(array == [4]); } /***************************************************/ void test79() { auto a = [87, 40, 10]; a ~= 42; assert(a == [87, 40, 10, 42]); a ~= [5, 17]; assert(a == [87, 40, 10, 42, 5, 17]); } /***************************************************/ void test6317() { int b = 12345; struct nested { int a; int fun() { return b; } } static assert(!__traits(compiles, { nested x = { 3, null }; })); nested g = { 7 }; auto h = nested(7); assert(g.fun() == 12345); assert(h.fun() == 12345); } /***************************************************/ void test80() { auto array = new int[10]; array.length += 1000; assert(array.length == 1010); array.length /= 10; assert(array.length == 101); array.length -= 1; assert(array.length == 100); array.length |= 1; assert(array.length == 101); array.length ^= 3; assert(array.length == 102); array.length &= 2; assert(array.length == 2); array.length *= 2; assert(array.length == 4); array.length <<= 1; assert(array.length == 8); array.length >>= 1; assert(array.length == 4); array.length >>>= 1; assert(array.length == 2); array.length %= 2; assert(array.length == 0); int[]* foo() { static int x; x++; assert(x == 1); auto p = &array; return p; } (*foo()).length += 2; assert(array.length == 2); } /***************************************************/ void test81() { int[3] a = [1, 2, 3]; int[3] b = a; a[1] = 42; assert(b[1] == 2); // b is an independent copy of a int[3] fun(int[3] x, int[3] y) { // x and y are copies of the arguments x[0] = y[0] = 100; return x; } auto c = fun(a, b); // c has type int[3] assert(c == [100, 42, 3]); assert(b == [1, 2, 3]); // b is unaffected by fun } /***************************************************/ void test82() { auto a1 = [ "Jane":10.0, "Jack":20, "Bob":15 ]; auto a2 = a1; // a1 and a2 refer to the same data a1["Bob"] = 100; // Changing a1 assert(a2["Bob"] == 100); //is same as changing a2 a2["Sam"] = 3.5; //and vice assert(a2["Sam"] == 3.5); // versa } /***************************************************/ void test7942() { string a = "a"; wstring b = "b"; dstring c = "c"; a ~= "a"c; static assert(!is(typeof(a ~= "b"w))); static assert(!is(typeof(a ~= "c"d))); static assert(!is(typeof(b ~= "a"c))); b ~= "b"w; static assert(!is(typeof(b ~= "c"d))); static assert(!is(typeof(c ~= "a"c))); static assert(!is(typeof(c ~= "b"w))); c ~= "c"d; assert(a == "aa"); assert(b == "bb"); assert(c == "cc"); } /***************************************************/ void bump(ref int x) { ++x; } void test83() { int x = 1; bump(x); assert(x == 2); } /***************************************************/ interface Test4174 { void func(T)() {} } /***************************************************/ auto foo84 = [1, 2.4]; void test84() { pragma(msg, typeof([1, 2.4])); static assert(is(typeof([1, 2.4]) == double[])); pragma(msg, typeof(foo84)); static assert(is(typeof(foo84) == double[])); } /***************************************************/ void test85() { dstring c = "V\u00E4rld"; c = c ~ '!'; assert(c == "V\u00E4rld!"); c = '@' ~ c; assert(c == "@V\u00E4rld!"); wstring w = "V\u00E4rld"; w = w ~ '!'; assert(w == "V\u00E4rld!"); w = '@' ~ w; assert(w == "@V\u00E4rld!"); string s = "V\u00E4rld"; s = s ~ '!'; assert(s == "V\u00E4rld!"); s = '@' ~ s; assert(s == "@V\u00E4rld!"); } /***************************************************/ void test86() { int[][] a = [ [1], [2,3], [4] ]; int[][] w = [ [1, 2], [3], [4, 5], [] ]; int[][] x = [ [], [1, 2], [3], [4, 5], [] ]; } /***************************************************/ // Bugzilla 3379 T1[] find(T1, T2)(T1[] longer, T2[] shorter) if (is(typeof(longer[0 .. 1] == shorter) : bool)) { while (longer.length >= shorter.length) { if (longer[0 .. shorter.length] == shorter) break; longer = longer[1 .. $]; } return longer; } auto max(T...)(T a) if (T.length == 2 && is(typeof(a[1] > a[0] ? a[1] : a[0])) || T.length > 2 && is(typeof(max(max(a[0], a[1]), a[2 .. $])))) { static if (T.length == 2) { return a[1] > a[0] ? a[1] : a[0]; } else { return max(max(a[0], a[1]), a[2 .. $]); } } // Cases which would ICE or segfault struct Bulldog(T){ static void cat(Frog)(Frog f) if (true) { } } void mouse(){ Bulldog!(int).cat(0); } void test87() { double[] d1 = [ 6.0, 1.5, 2.4, 3 ]; double[] d2 = [ 1.5, 2.4 ]; assert(find(d1, d2) == d1[1 .. $]); assert(find(d1, d2) == d1[1 .. $]); // Check for memory corruption assert(max(4, 5) == 5); assert(max(3, 4, 5) == 5); } /***************************************************/ template test4284(alias v) { enum test4284 = v.length == 0; } static assert(test4284!(cast(string)null)); static assert(test4284!(cast(string[])null)); /***************************************************/ struct S88 { void opDispatch(string s, T)(T i) { printf("S.opDispatch('%.*s', %d)\n", s.length, s.ptr, i); } } class C88 { void opDispatch(string s)(int i) { printf("C.opDispatch('%.*s', %d)\n", s.length, s.ptr, i); } } struct D88 { template opDispatch(string s) { enum int opDispatch = 8; } } void test88() { S88 s; s.opDispatch!("hello")(7); s.foo(7); auto c = new C88(); c.foo(8); D88 d; printf("d.foo = %d\n", d.foo); assert(d.foo == 8); } /***************************************************/ void test89() { static struct X { int x; int bar() { return x; } } X s; printf("%d\n", s.sizeof); assert(s.sizeof == 4); } /***************************************************/ struct S90 { void opDispatch( string name, T... )( T values ) { assert(values[0] == 3.14); } } void test90( ) { S90 s; s.opDispatch!("foo")( 3.14 ); s.foo( 3.14 ); } /***************************************************/ struct A7439(int r, int c) { alias r R; alias c C; alias float[R * C] Data; Data _data; alias _data this; this(Data ar){ _data = ar; } pure ref float opIndex(size_t rr, size_t cc){ return _data[cc + rr * C]; } } void test7439() { A7439!(2, 2) a = A7439!(2, 2)([8, 3, 2, 9]); a[0,0] -= a[0,0] * 2.0; } /***************************************************/ void foo91(uint line = __LINE__) { printf("%d\n", line); } void test91() { foo91(); printf("%d\n", __LINE__); } /***************************************************/ auto ref foo92(ref int x) { return x; } int bar92(ref int x) { return x; } void test92() { int x = 3; int i = bar92(foo92(x)); assert(i == 3); } /***************************************************/ struct Foo93 { public int foo() const { return 2; } } void test93() { const Foo93 bar = Foo93(); enum bla = bar.foo(); assert(bla == 2); } /***************************************************/ extern(C++) class C1687 { void func() {} } void test1687() { auto c = new C1687(); assert(c.__vptr[0] == (&c.func).funcptr); } /***************************************************/ struct Foo94 { int x, y; real z; } pure nothrow Foo94 makeFoo(const int x, const int y) { return Foo94(x, y, 3.0); } void test94() { auto f = makeFoo(1, 2); assert(f.x==1); assert(f.y==2); assert(f.z==3); } /***************************************************/ struct T95 { @disable this(this) { } } struct S95 { T95 t; } @disable void foo95() { } struct T95A { @disable this(this); } struct S95A { T95A t; } @disable void foo95A() { } void test95() { S95 s; S95 t; static assert(!__traits(compiles, t = s)); static assert(!__traits(compiles, foo95())); S95A u; S95A v; static assert(!__traits(compiles, v = u)); static assert(!__traits(compiles, foo95A())); } /***************************************************/ struct S96(alias init) { int[] content = init; } void test96() { S96!([12, 3]) s1; S96!([1, 23]) s2; writeln(s1.content); writeln(s2.content); assert(!is(typeof(s1) == typeof(s2))); } /***************************************************/ struct A97 { const bool opEquals(ref const A97) { return true; } ref A97 opUnary(string op)() if (op == "++") { return this; } } void test97() { A97 a, b; foreach (e; a .. b) { } } /***************************************************/ void test98() { auto a = new int[2]; // the name "length" should not pop up in an index expression static assert(!is(typeof(a[length - 1]))); } /***************************************************/ string s99; void bar99(string i) { } void function(string) foo99(string i) { return &bar99; } void test99() { foo99 (s99 ~= "a") (s99 ~= "b"); assert(s99 == "ab"); } /***************************************************/ // 5081 void test5081() { static pure immutable(int[]) x1() { int[] a = new int[](10); return a; } static pure immutable(int[]) x2(int len) { int[] a = new int[](len); return a; } static pure immutable(int[]) x3(immutable(int[]) org) { int[] a = new int[](org.length); return a; } immutable a1 = x1(); immutable a2 = x2(10); immutable a3 = x3([1,2]); static pure int[] y1() { return new int[](10); } immutable b1 = y1(); } /***************************************************/ void test100() { string s; /* Testing order of evaluation */ void delegate(string, string) fun(string) { s ~= "b"; return delegate void(string x, string y) { s ~= "e"; }; } fun(s ~= "a")(s ~= "c", s ~= "d"); assert(s == "abcde", s); } /***************************************************/ void test101() { int[] d1 = [ 6, 1, 2 ]; byte[] d2 = [ 6, 1, 2 ]; assert(d1 == d2); d2 ~= [ 6, 1, 2 ]; assert(d1 != d2); } /***************************************************/ void test5403() { struct S { static int front; enum back = "yes!"; bool empty; void popAny() { empty = true; } alias popAny popFront; alias popAny popBack; } S.front = 7; foreach(int i; S()) assert(i == 7); S.front = 2; foreach(i; S()) assert(i == 2); foreach_reverse(i; S()) assert(i == "yes!"); } /***************************************************/ static assert([1,2,3] == [1.0,2,3]); /***************************************************/ int transmogrify(uint) { return 1; } int transmogrify(long) { return 2; } void test103() { assert(transmogrify(42) == 1); } /***************************************************/ int foo104(int x) { int* p = &(x += 1); return *p; } int bar104(int *x) { int* p = &(*x += 1); return *p; } void test104() { auto i = foo104(1); assert(i == 2); i = bar104(&i); assert(i == 3); } /***************************************************/ ref int bump105(ref int x) { return ++x; } void test105() { int x = 1; bump105(bump105(x)); // two increments assert(x == 3); } /***************************************************/ pure int genFactorials(int n) { static pure int factorial(int n) { if (n==2) return 1; return factorial(2); } return factorial(n); } /***************************************************/ void test107() { int[6] a; writeln(a); writeln(a.init); assert(a.init == [0,0,0,0,0,0]); } /***************************************************/ class A109 {} void test109() { immutable(A109) b; A109 c; auto z = true ? b : c; //writeln(typeof(z).stringof); static assert(is(typeof(z) == const(A109))); } /***************************************************/ template Boo(T) {} struct Foo110(T, alias V = Boo!T) { pragma(msg, V.stringof); static const s = V.stringof; } alias Foo110!double B110; alias Foo110!int A110; static assert(B110.s == "Boo!double"); static assert(A110.s == "Boo!int"); /***************************************************/ int test11247() { static assert(is(byte[typeof(int.init).sizeof] == byte[4])); static assert(is(byte[typeof(return).sizeof] == byte[4])); return 0; } /***************************************************/ // 3716 void test111() { auto k1 = true ? [1,2] : []; // OK auto k2 = true ? [[1,2]] : [[]]; auto k3 = true ? [] : [[1,2]]; auto k4 = true ? [[[]]] : [[[1,2]]]; auto k5 = true ? [[[1,2]]] : [[[]]]; auto k6 = true ? [] : [[[]]]; static assert(!is(typeof(true ? [[[]]] : [[1,2]]))); // Must fail } /***************************************************/ // 658 void test658() { struct S { int i; } class C { int i; } S s; S* sp = &s; with (sp) i = 42; assert(s.i == 42); with (&s) i = 43; assert(s.i == 43); C c = new C; C* cp = &c; with (cp) i = 42; assert(c.i == 42); with (&c) i = 43; assert(c.i == 43); } /***************************************************/ void test3069() { ubyte id = 0; void[] v = [id] ~ [id]; } /***************************************************/ // 4303 template foo112() if (__traits(compiles,undefined)) { enum foo112 = false; } template foo112() if (true) { enum foo112 = true; } pragma(msg,__traits(compiles,foo112!())); static assert(__traits(compiles,foo112!())); const bool bar112 = foo112!(); /***************************************************/ struct File113 { this(int name) { } ~this() { } void opAssign(File113 rhs) { } struct ByLine { File113 file; this(int) { } } ByLine byLine() { return ByLine(1); } } auto filter113(File113.ByLine rs) { struct Filter { this(File113.ByLine r) { } } return Filter(rs); } void test113() { auto f = File113(1); auto rx = f.byLine(); auto file = filter113(rx); } /***************************************************/ template foo114(fun...) { auto foo114(int[] args) { return 1; } } pragma(msg, typeof(foo114!"a + b"([1,2,3]))); /***************************************************/ // Bugzilla 3935 struct Foo115 { void opBinary(string op)(Foo other) { pragma(msg, "op: " ~ op); assert(0); } } void test115() { Foo115 f; f = f; } /***************************************************/ // Bugzilla 2477 void foo116(T,)(T t) { T x; } void test116() { int[] data = [1,2,3,]; // OK data = [ 1,2,3, ]; // fails auto i = data[1,]; foo116!(int)(3); foo116!(int,)(3); foo116!(int,)(3,); } /***************************************************/ void test1891() { struct C { char[8] x = "helloabc"; } int main() { C* a = new C; C*[] b; b ~= new C; auto g = a ~ b; assert(g[0] && g[1] && g[0].x == g[1].x); return 0; } } /***************************************************/ // Bugzilla 4291 void test117() pure { mixin declareVariable; var = 42; mixin declareFunction; readVar(); } template declareVariable() { int var; } template declareFunction() { int readVar() { return var; } } /***************************************************/ // Bugzilla 4177 pure real log118(real x) { if (__ctfe) return 0.0; else return 1.0; } enum x118 = log118(4.0); void test118() {} /***************************************************/ void bug4465() { const a = 2 ^^ 2; int b = a; } /***************************************************/ pure void foo(int *p) { *p = 3; } pure void test120() { int i; foo(&i); assert(i == 3); } /***************************************************/ // 4866 immutable int[3] statik = [ 1, 2, 3 ]; enum immutable(int)[] dynamic = statik; static assert(is(typeof(dynamic) == immutable(int)[])); static if (! is(typeof(dynamic) == immutable(int)[])) { static assert(0); // (7) } pragma(msg, "!! ", typeof(dynamic)); /***************************************************/ // 2943 struct Foo2943 { int a; int b; alias b this; } void test122() { Foo2943 foo, foo2; foo.a = 1; foo.b = 2; foo2.a = 3; foo2.b = 4; foo2 = foo; assert(foo2.a == foo.a); } /***************************************************/ // 4641 struct S123 { int i; alias i this; } void test123() { S123[int] ss; ss[0] = S123.init; // This line causes Range Violation. } /***************************************************/ // 2451 struct Foo124 { int z = 3; void opAssign(Foo124 x) { z= 2;} } struct Bar124 { int z = 3; this(this){ z = 17; } } void test124() { Foo124[string] stuff; stuff["foo"] = Foo124.init; assert(stuff["foo"].z == 3); stuff["foo"] = Foo124.init; assert(stuff["foo"].z == 2); Bar124[string] stuff2; Bar124 q; stuff2["dog"] = q; assert(stuff2["dog"].z == 17); } /***************************************************/ void test3022() { static class Foo3022 { new(size_t) { assert(0); } } scope x = new Foo3022; } /***************************************************/ void doNothing() {} void bug5071(short d, ref short c) { assert(c==0x76); void closure() { auto c2 = c; auto d2 = d; doNothing(); } auto useless = &closure; } void test125() { short c = 0x76; bug5071(7, c); } /***************************************************/ struct Foo126 { static Foo126 opCall(in Foo126 _f) pure { return _f; } } /***************************************************/ void test796() { struct S { invariant() { throw new Exception(""); } } S* s; try { assert(s); } catch (Error) { } } /***************************************************/ void test7077() { if(0) mixin("auto x = 2;"); auto x = 1; } /***************************************************/ struct Tuple127(S...) { S expand; alias expand this; } alias Tuple127!(int, int) Foo127; void test127() { Foo127[] m_array; Foo127 f; m_array ~= f; } /***************************************************/ struct Bug4434 {} alias const Bug4434* IceConst4434; alias shared Bug4434* IceShared4434; alias shared Bug4434[] IceSharedArray4434; alias immutable Bug4434* IceImmutable4434; alias shared const Bug4434* IceSharedConst4434; alias int MyInt4434; alias const MyInt4434[3] IceConstInt4434; alias immutable string[] Bug4830; /***************************************************/ // 4254 void bub(const inout int other) {} void test128() { bub(1); } /***************************************************/ pure nothrow @safe auto bug4915a() { return 0; } pure nothrow @safe int bug4915b() { return bug4915a(); } void bug4915c() { pure nothrow @safe int d() { return 0; } int e() pure nothrow @safe { return d(); } } /***************************************************/ // 5164 static if (is(int Q == int, Z...)) { } /***************************************************/ // 5195 alias typeof(foo5195) food5195; const int * foo5195 = null; alias typeof(foo5195) good5195; static assert( is (food5195 == good5195)); /***************************************************/ version (Windows) { } else { int[0] var5332; void test5332() { auto x = var5332; } } /***************************************************/ // 5191 struct Foo129 { void add(T)(T value) nothrow { this.value += value; } this(int value) { this.value = value; } int value; } void test129() { auto foo = Foo129(5); assert(foo.value == 5); foo.add(2); writeln(foo.value); assert(foo.value == 7); foo.add(3); writeln(foo.value); assert(foo.value == 10); foo.add(3); writeln(foo.value); assert(foo.value == 13); void delegate (int) nothrow dg = &foo.add!(int); dg(7); assert(foo.value == 20); } /***************************************************/ // 6169 auto ctfefunc6169() { return ";"; } enum ctfefptr6169 = &ctfefunc6169; int ctfefunc6169a() { return 1; } template x6169(string c) { alias int x6169; } template TT6169(T...) { alias T TT6169; } @property ctfeprop6169() { return "g"; } void test6169() pure @safe { enum a = ctfefunc6169(); static b = ctfefunc6169(); x6169!(ctfefunc6169()) tt; mixin(ctfefunc6169()); static if(ctfefunc6169()) {} pragma(msg, ctfefunc6169()); enum xx { k = 0, j = ctfefunc6169a() } auto g = mixin('"' ~ ctfefunc6169() ~ '"'); //auto h = import("testx.d" ~ false ? ctfefunc() : ""); alias TT6169!(int, int)[ctfefunc6169a()..ctfefunc6169a()] i; alias TT6169!(int, int)[ctfefunc6169a()] j; int[ctfefunc6169a()+1] k; alias int[ctfefunc6169a()] l; switch(1) { //case ctfefunc6169a(): // Can't do this because of case variables case ctfefunc6169a()+1: .. case ctfefunc6169a()+2: default: break; } static assert(ctfefunc6169a()); void fun(int i : ctfefunc6169a() = ctfefunc6169a(), alias j)() if (ctfefunc6169a()) {} fun!(ctfefunc6169a(), ctfefunc6169())(); enum z = ctfefptr6169(); auto p = mixin(ctfeprop6169); } /***************************************************/ // 10506 void impureFunc10506() {} string join10506(RoR)(RoR ror) { impureFunc10506(); return ror[0] ~ ror[1]; } void test10506() pure { void foobar() {} mixin(["foo", "bar"].join10506()~";"); } /***************************************************/ const shared class C5107 { int x; } static assert(is(typeof(C5107.x) == const)); // okay static assert(is(typeof(C5107.x) == shared)); // fails! /***************************************************/ immutable struct S3598 { static void funkcja() { } } /***************************************************/ // 4211 @safe struct X130 { void func() { } } @safe class Y130 { void func() { } } @safe void test130() { X130 x; x.func(); auto y = new Y130; y.func(); } /***************************************************/ template Return(alias fun) { static if (is(typeof(fun) R == return)) alias R Return; } interface I4217 { int square(int n); real square(real n); } alias Return!( __traits(getOverloads, I4217, "square")[0] ) R4217; alias Return!( __traits(getOverloads, I4217, "square")[1] ) S4217; static assert(! is(R4217 == S4217)); /***************************************************/ // 5094 void test131() { S131 s; int[] conv = s; } struct S131 { @property int[] get() { return [1,2,3]; } alias get this; } /***************************************************/ struct S7545 { uint id; alias id this; } void test7545() { auto id = 0 ? S7545() : -1; } /***************************************************/ // 5020 void test132() { S132 s; if (!s) {} } struct S132 { bool cond; alias cond this; } /***************************************************/ // 5343 struct Tuple5343(Specs...) { Specs[0] field; } struct S5343(E) { immutable E x; } enum A5343{a,b,c} alias Tuple5343!(A5343) TA5343; alias S5343!(A5343) SA5343; /***************************************************/ // 5365 interface IFactory { void foo(); } class A133 { protected static class Factory : IFactory { void foo() { } } this() { _factory = createFactory(); } protected IFactory createFactory() { return new Factory; } private IFactory _factory; @property final IFactory factory() { return _factory; } alias factory this; } void test133() { IFactory f = new A133; f.foo(); // segfault } /***************************************************/ // 5365 class B134 { } class A134 { B134 _b; this() { _b = new B134; } B134 b() { return _b; } alias b this; } void test134() { auto a = new A134; B134 b = a; // b is null assert(a._b is b); // fails } /***************************************************/ // 5025 struct S135 { void delegate() d; } void test135() { shared S135[] s; if (0) s[0] = S135(); } /***************************************************/ // 5545 bool enforce136(bool value, lazy const(char)[] msg = null) { if(!value) { return false; } return value; } struct Perm { byte[3] perm; ubyte i; this(byte[] input) { foreach(elem; input) { enforce136(i < 3); perm[i++] = elem; std.stdio.stderr.writeln(i); // Never gets incremented. Stays at 0. } } } void test136() { byte[] stuff = [0, 1, 2]; auto perm2 = Perm(stuff); writeln(perm2.perm); // Prints [2, 0, 0] assert(perm2.perm[] == [0, 1, 2]); } /***************************************************/ // 4097 void foo4097() { } alias typeof(&foo4097) T4097; static assert(is(T4097 X : X*) && is(X == function)); static assert(!is(X)); /***************************************************/ // 5798 void assign9(ref int lhs) pure { lhs = 9; } void assign8(ref int rhs) pure { rhs = 8; } int test137(){ int a=1,b=2; assign8(b),assign9(a); assert(a == 9); assert(b == 8); // <-- fail assign9(b),assign8(a); assert(a == 8); assert(b == 9); // <-- fail return 0; } /***************************************************/ // 9366 static assert(!is(typeof((void[]).init ~ cast(void)0))); static assert(!is(typeof(cast(void)0 ~ (void[]).init))); /***************************************************/ struct Size138 { union { struct { int width; int height; } long size; } } enum Size138 foo138 = {2 ,5}; Size138 bar138 = foo138; void test138() { assert(bar138.width == 2); assert(bar138.height == 5); } /***************************************************/ void test3822() { import core.stdc.stdlib; int i = 0; void* ptr; while(i++ != 2) { auto p = alloca(2); assert(p != ptr); ptr = p; } } /***************************************************/ // 5939, 5940 template map(fun...) { auto map(double[] r) { struct Result { this(double[] input) { } } return Result(r); } } void test139() { double[] x; alias typeof(map!"a"(x)) T; T a = void; auto b = map!"a"(x); auto c = [map!"a"(x)]; T[3] d = void; } /***************************************************/ // 5966 string[] foo5966(string[] a) { a[0] = a[0][0..$]; return a; } enum var5966 = foo5966([""]); /***************************************************/ // 5975 int foo5975(wstring replace) { wstring value = ""; value ~= replace; return 1; } enum X5975 = foo5975("X"w); /***************************************************/ // 5965 template mapx(fun...) if (fun.length >= 1) { int mapx(Range)(Range r) { return 1; } } void test140() { int foo(int i) { return i; } int[] arr; auto x = mapx!( (int a){return foo(a);} )(arr); } /***************************************************/ void bug5976() { int[] barr; int * k; foreach (ref b; barr) { scope(failure) k = &b; k = &b; } } /***************************************************/ // 5771 struct S141 { this(A)(auto ref A a){} } void test141() { S141 s = S141(10); } /***************************************************/ class test5498_A {} class test5498_B : test5498_A {} class test5498_C : test5498_A {} static assert(is(typeof([test5498_B.init, test5498_C.init]) == test5498_A[])); /***************************************************/ // 3688 struct S142 { int v; this(int n) pure { v = n; } const bool opCast(T:bool)() { return true; } } void test142() { if (int a = 1) assert(a == 1); else assert(0); if (const int a = 2) assert(a == 2); else assert(0); if (immutable int a = 3) assert(a == 3); else assert(0); if (auto s = S142(10)) assert(s.v == 10); else assert(0); if (auto s = const(S142)(20)) assert(s.v == 20); else assert(0); if (auto s = immutable(S142)(30)) assert(s.v == 30); else assert(0); } /***************************************************/ // 6072 static assert({ if (int x = 5) {} return true; }()); /***************************************************/ // 5959 int n; void test143() { ref int f(){ return n; } // NG f() = 1; assert(n == 1); nothrow ref int f1(){ return n; } // OK f1() = 2; assert(n == 2); auto ref int f2(){ return n; } // OK f2() = 3; assert(n == 3); } /***************************************************/ // 6119 void startsWith(alias pred) () if (is(typeof(pred('c', 'd')) : bool)) { } void startsWith(alias pred) () if (is(typeof(pred('c', "abc")) : bool)) { } void test144() { startsWith!((a, b) { return a == b; })(); } /***************************************************/ void test145() { import std.c.stdio; printf("hello world 145\n"); } void test146() { test1(); static import std.c.stdio; std.c.stdio.printf("hello world 146\n"); } /***************************************************/ // 5856 struct X147 { void f() { writeln("X.f mutable"); } void f() const { writeln("X.f const"); } void g()() { writeln("X.g mutable"); } void g()() const { writeln("X.g const"); } void opOpAssign(string op)(int n) { writeln("X+= mutable"); } void opOpAssign(string op)(int n) const { writeln("X+= const"); } } void test147() { X147 xm; xm.f(); // prints "X.f mutable" xm.g(); // prints "X.g mutable" xm += 10; // should print "X+= mutable" (1) const(X147) xc; xc.f(); // prints "X.f const" xc.g(); // prints "X.g const" xc += 10; // should print "X+= const" (2) } /***************************************************/ void test3559() { static class A { int foo(int a) { return 0; } int foo(float a) { return 1; } int bar(float a) { return 1; } int bar(int a) { return 0; } } static class B : A { override int foo(float a) { return 2; } alias A.foo foo; alias A.bar bar; override int bar(float a) { return 2; } } { auto x = new A; auto f1 = cast(int delegate(int))&x.foo; auto f2 = cast(int delegate(float))&x.foo; int delegate(int) f3 = &x.foo; int delegate(float) f4 = &x.foo; assert(f1(0) == 0); assert(f2(0) == 1); assert(f3(0) == 0); assert(f4(0) == 1); } { auto x = new B; auto f1 = cast(int delegate(int))&x.foo; auto f2 = cast(int delegate(float))&x.foo; int delegate(int) f3 = &x.foo; int delegate(float) f4 = &x.foo; assert(f1(0) == 0); assert(f2(0) == 2); assert(f3(0) == 0); assert(f4(0) == 2); } { auto x = new A; auto f1 = cast(int delegate(int))&x.bar; auto f2 = cast(int delegate(float))&x.bar; int delegate(int) f3 = &x.bar; int delegate(float) f4 = &x.bar; assert(f1(0) == 0); assert(f2(0) == 1); assert(f3(0) == 0); assert(f4(0) == 1); } { auto x = new B; auto f1 = cast(int delegate(int))&x.bar; auto f2 = cast(int delegate(float))&x.bar; int delegate(int) f3 = &x.bar; int delegate(float) f4 = &x.bar; assert(f1(0) == 0); assert(f2(0) == 2); assert(f3(0) == 0); assert(f4(0) == 2); } } /***************************************************/ extern(C++) class C13182 { } void test13182() { scope C13182 c = new C13182(); } /***************************************************/ // 5897 struct A148{ int n; } struct B148{ int n, m; this(A148 a){ n = a.n, m = a.n*2; } } struct C148{ int n, m; static C148 opCall(A148 a) { C148 b; b.n = a.n, b.m = a.n*2; return b; } } void test148() { auto a = A148(10); auto b = cast(B148)a; assert(b.n == 10 && b.m == 20); auto c = cast(C148)a; assert(c.n == 10 && c.m == 20); } /***************************************************/ // 4969 class MyException : Exception { this() { super("An exception!"); } } void throwAway() { throw new MyException; } void cantthrow() nothrow { try throwAway(); catch(MyException me) assert(0); catch(Exception e) assert(0); } /***************************************************/ // 2356 void test2356() { int[3] x = [1,2,3]; printf("x[] = [%d %d %d]\n", x[0], x[1], x[2]); assert(x[0] == 1 && x[1] == 2 && x[2] == 3); struct S { static int pblit; int n; this(this) { ++pblit; printf("postblit: %d\n", n); } } S s2 = S(2); S[3] s = [S(1), s2, S(3)]; assert(s[0].n == 1 && s[1].n == 2 && s[2].n == 3); printf("s[].n = [%d %d %d]\n", s[0].n, s[1].n, s[2].n); assert(S.pblit == 1); ubyte[1024] v; v = typeof(v).init; printf("v[] = [%d %d %d, ..., %d]\n", v[0], v[1], v[2], v[$-1]); foreach (ref a; v) assert(a == 0); int n = 5; int[3] y = [n, n, n]; printf("y[] = [%d %d %d]\n", y[0], y[1], y[2]); assert(y[0] == 5 && y[1] == 5 && y[2] == 5); S[3] z = [s2, s2, s2]; assert(z[0].n == 2 && z[1].n == 2 && z[2].n == 2); printf("z[].n = [%d %d %d]\n", z[0].n, z[1].n, z[2].n); assert(S.pblit == 1 + 3); int[0] nsa0 = []; void[0] vsa0 = []; void foo(T)(T){} foo(vsa0); ref int[0] bar() { static int[1] sa; return *cast(int[0]*)&sa; } bar() = []; } /***************************************************/ // 11238 void test11238() { int[2] m; m[0] = 4,m[1] = 6; //printf("%d,%d\n", m[0], m[1]); assert(m[0] == 4 && m[1] == 6); m = [m[1], m[0]]; // swap assert(m[0] == 6 && m[1] == 4); //printf("%d,%d\n", m[0], m[1]); m = [m[1], m[0]]; // swap //printf("%d,%d\n", m[0], m[1]); assert(m[0] == 4 && m[1] == 6); } /***************************************************/ void test11805() { int i; i = 47; i = 1 && i; assert(i == 1); i = 0 || i; assert(i == 1); } /***************************************************/ class A2540 { int a; int foo() { return 0; } alias int X; } class B2540 : A2540 { int b; override super.X foo() { return 1; } alias this athis; alias this.b thisb; alias super.a supera; alias super.foo superfoo; alias this.foo thisfoo; } struct X2540 { alias this athis; } void test2540() { auto x = X2540.athis.init; static assert(is(typeof(x) == X2540)); B2540 b = new B2540(); assert(&b.a == &b.supera); assert(&b.b == &b.thisb); assert(b.thisfoo() == 1); } /***************************************************/ // 7295 struct S7295 { int member; @property ref int refCountedPayload() { return member; } alias refCountedPayload this; } void foo7295(S)(immutable S t, int qq) pure { } void foo7295(S)(S s) pure { } void bar7295() pure { S7295 b; foo7295(b); } /***************************************************/ // 5659 void test149() { import std.traits; char a; immutable(char) b; static assert(is(typeof(true ? a : b) == const(char))); static assert(is(typeof([a, b][0]) == const(char))); static assert(is(CommonType!(typeof(a), typeof(b)) == const(char))); } /***************************************************/ // 1373 void func1373a(){} static assert(typeof(func1373a).stringof == "void()"); static assert(typeof(func1373a).mangleof == "FZv"); static assert(!__traits(compiles, typeof(func1373a).alignof)); static assert(!__traits(compiles, typeof(func1373a).init)); static assert(!__traits(compiles, typeof(func1373a).offsetof)); void func1373b(int n){} static assert(typeof(func1373b).stringof == "void(int n)"); static assert(typeof(func1373b).mangleof == "FiZv"); static assert(!__traits(compiles, typeof(func1373b).alignof)); static assert(!__traits(compiles, typeof(func1373b).init)); static assert(!__traits(compiles, typeof(func1373b).offsetof)); /***************************************************/ void bar150(T)(T n) { } @safe void test150() { bar150(1); } /***************************************************/ void test5785() { static struct x { static int y; } assert(x.y !is 1); assert(x.y !in [1:0]); } /***************************************************/ void bar151(T)(T n) { } nothrow void test151() { bar151(1); } /***************************************************/ @property int coo() { return 1; } @property auto doo(int i) { return i; } @property int eoo() { return 1; } @property auto ref hoo(int i) { return i; } // 3359 int goo(int i) pure { return i; } auto ioo(int i) pure { return i; } auto ref boo(int i) pure nothrow { return i; } class A152 { auto hoo(int i) pure { return i; } const boo(int i) const { return i; } auto coo(int i) const { return i; } auto doo(int i) immutable { return i; } auto eoo(int i) shared { return i; } } // 4706 struct Foo152(T) { @property auto ref front() { return T.init; } @property void front(T num) {} } void test152() { Foo152!int foo; auto a = foo.front; foo.front = 2; } /***************************************************/ // 6733 void bug6733(int a, int b) pure nothrow { } void test6733() { int z = 1; bug6733(z++, z++); assert(z==3); } /***************************************************/ // 3799 void test153() { void bar() { } static assert(!__traits(isStaticFunction, bar)); } /***************************************************/ // 3632 void test154() { float f; assert(f is float.init); double d; assert(d is double.init); real r; assert(r is real.init); assert(float.nan is float.nan); assert(double.nan is double.nan); assert(real.nan is real.nan); } /***************************************************/ void test6545() { static int[] func() { auto a = [1, 2, 3]; auto b = [2, 3, 4]; auto c = [3, 4, 5]; a[] = b[] + c[]; return a; } auto a = func(); enum b = func(); assert(a == b); } /***************************************************/ // 3147 void test155() { byte b = 1; short s; int i; long l; s = b + b; b = s % b; s = s >> b; b = 1; b = i % b; b = b >> i; } /***************************************************/ // 2486 void test2486() { void foo(ref int[] arr) {} int[] arr = [1,2,3]; foo(arr); //OK static assert(!__traits(compiles, foo(arr[1..2]))); // should be NG struct S { int[] a; auto ref opSlice(){ return a[]; } // line 4 } S s; s[]; // opSlice should return rvalue static assert(is(typeof(&S.opSlice) == int[] function())); static assert(!__traits(compiles, foo(s[]))); // should be NG } /***************************************************/ // 2521 immutable int val = 23; const int val2 = 23; ref immutable(int) func2521_() { return val; } ref immutable(int) func2521_2() { return *&val; } ref immutable(int) func2521_3() { return func2521_; } ref const(int) func2521_4() { return val2; } ref const(int) func2521_5() { return val; } auto ref func2521_6() { return val; } ref func2521_7() { return val; } /***************************************************/ void test5554() { class MA { } class MB : MA { } class MC : MB { } class A { abstract MA foo(); } interface I { MB foo(); } class B : A { override MC foo() { return null; } } class C : B, I { override MC foo() { return null; } } } /***************************************************/ // 5962 struct S156 { auto g()(){ return 1; } const auto g()(){ return 2; } } void test156() { auto ms = S156(); assert(ms.g() == 1); auto cs = const(S156)(); assert(cs.g() == 2); } /***************************************************/ void test10724() { const(char)* s = "abc"[0..$-1]; assert(s[2] == '\0'); } /***************************************************/ void test6708(const ref int y) { immutable int x; test6708(x); } /***************************************************/ // 4258 struct Vec4258 { Vec4258 opOpAssign(string Op)(auto ref Vec4258 other) if (Op == "+") { return this; } Vec4258 opBinary(string Op:"+")(Vec4258 other) { Vec4258 result; return result += other; } } void test4258() { Vec4258 v; v += Vec4258() + Vec4258(); // line 12 } // regression fix test struct Foo4258 { // binary ++/-- int opPostInc()() if (false) { return 0; } // binary 1st int opAdd(R)(R rhs) if (false) { return 0; } int opAdd_r(R)(R rhs) if (false) { return 0; } // compare int opCmp(R)(R rhs) if (false) { return 0; } // binary-op assign int opAddAssign(R)(R rhs) if (false) { return 0; } } struct Bar4258 { // binary commutive 1 int opAdd_r(R)(R rhs) if (false) { return 0; } // binary-op assign int opOpAssign(string op, R)(R rhs) if (false) { return 0; } } struct Baz4258 { // binary commutive 2 int opAdd(R)(R rhs) if (false) { return 0; } } static assert(!is(typeof(Foo4258.init++))); static assert(!is(typeof(Foo4258.init + 1))); static assert(!is(typeof(1 + Foo4258.init))); static assert(!is(typeof(Foo4258.init < Foo4258.init))); static assert(!is(typeof(Foo4258.init += 1))); static assert(!is(typeof(Bar4258.init + 1))); static assert(!is(typeof(Bar4258.init += 1))); static assert(!is(typeof(1 + Baz4258.init))); /***************************************************/ // 4539 void test4539() { static assert(!__traits(compiles, "hello" = "red")); void foo1(ref string s){} void foo2(ref const char[10] s){} void foo3(ref char[5] s){} void foo4(ref const char[5] s) { assert(s[0] == 'h'); assert(s[4] == 'o'); } void foo5(ref const ubyte[5] s) { assert(s[0] == 0xc3); assert(s[4] == 0x61); } static assert(!__traits(compiles, foo1("hello"))); static assert(!__traits(compiles, foo2("hello"))); static assert(!__traits(compiles, foo3("hello"))); // same as test68, 69, 70 foo4("hello"); foo5(cast(ubyte[5])x"c3fcd3d761"); //import std.conv; //static assert(!__traits(compiles, parse!int("10") == 10)); } /***************************************************/ // 1471 void test1471() { int n; string bar = "BOOM"[n..$-1]; assert(bar == "BOO"); } /***************************************************/ deprecated @disable int bug6389; static assert(!is(typeof(bug6389 = bug6389))); /***************************************************/ void test10927() { static assert( (1+2i) ^^ 3 == -11 - 2i ); auto a = (1+2i) ^^ 3; } /***************************************************/ void test4963() { struct Value { byte a; }; Value single() { return Value(); } Value[] list; auto x = single() ~ list; } /***************************************************/ pure int test4031() { static const int x = 8; return x; } /***************************************************/ // 5437 template EnumMembers5437(E) { template TypeTuple(T...){ alias T TypeTuple; } alias TypeTuple!("A", "B") EnumMembers5437; } template IntValue5437() { int IntValue5437 = 10; } void test5437() { enum Foo { A, B } alias EnumMembers5437!Foo members; // OK enum n1 = members.length; // OK enum n2 = (EnumMembers5437!Foo).length; // NG, type -> symbol enum s1 = IntValue5437!().sizeof; // OK enum s2 = (IntValue5437!()).sizeof; // NG, type -> expression } /***************************************************/ // 1962 void test1962() { class C { abstract void x(); } assert(C.classinfo.create() is null); } /***************************************************/ // 6228 void test6228() { const(int)* ptr; const(int) temp; auto x = (*ptr) ^^ temp; } /***************************************************/ int test7544() { try { throw new Exception(""); } catch (Exception e) static assert(1); return 1; } static assert(test7544()); /***************************************************/ struct S6230 { int p; int q() const pure { return p; } void r() pure { p = 231; } } class C6230 { int p; int q() const pure { return p; } void r() pure { p = 552; } } int q6230(ref const S6230 s) pure { // <-- Currently OK return s.p; } int q6230(ref const C6230 c) pure { // <-- Currently OK return c.p; } void r6230(ref S6230 s) pure { s.p = 244; } void r6230(ref C6230 c) pure { c.p = 156; } bool test6230pure() pure { auto s = S6230(4); assert(s.p == 4); assert(q6230(s) == 4); assert(s.q == 4); auto c = new C6230; c.p = 6; assert(q6230(c) == 6); assert(c.q == 6); r6230(s); assert(s.p == 244); s.r(); assert(s.p == 231); r6230(c); assert(c.p == 156); c.r(); assert(c.p == 552); return true; } void test6230() { assert(test6230pure()); } /***************************************************/ void test6264() { struct S { auto opSlice() { return this; } } int[] a; S s; static assert(!is(typeof(a[] = s[]))); int*[] b; static assert(is(typeof(b[] = [new immutable(int)]))); char[] c = new char[](5); c[] = "hello"; } /***************************************************/ // 5046 void test5046() { auto va = S5046!("", int)(); auto vb = makeS5046!("", int)(); } struct S5046(alias p, T) { T s; T fun() { return s; } // (10) } S5046!(p, T) makeS5046(alias p, T)() { return typeof(return)(); } /***************************************************/ // 6335 struct S6335 { const int value; this()(int n){ value = n; } } void test6335() { S6335 s = S6335(10); } /***************************************************/ struct S6295(int N) { int[N] x; const nothrow pure @safe f() { return x.length; } } void test6295() { auto bar(T: S6295!(N), int N)(T x) { return x.f(); } S6295!4 x; assert(bar(x) == 4); } /***************************************************/ template TT4536(T...) { alias T TT4536; } void test4536() { auto x = TT4536!(int, long, [1, 2]).init; assert(x[0] is int.init); assert(x[1] is long.init); assert(x[2] is [1, 2].init); } /***************************************************/ struct S6284 { int a; } class C6284 { int a; } pure int bug6284a() { S6284 s = {4}; auto b = s.a; // ok with (s) { b += a; // should be ok. } return b; } pure int bug6284b() { auto s = new S6284; s.a = 4; auto b = s.a; with (*s) { b += a; } return b; } pure int bug6284c() { auto s = new C6284; s.a = 4; auto b = s.a; with (s) { b += a; } return b; } void test6284() { assert(bug6284a() == 8); assert(bug6284b() == 8); assert(bug6284c() == 8); } /***************************************************/ class C6293 { C6293 token; } void f6293(in C6293[] a) pure { auto x0 = a[0].token; assert(x0 is a[0].token.token.token); assert(x0 is (&x0).token); auto p1 = &x0 + 1; assert(x0 is (p1 - 1).token); int c = 0; assert(x0 is a[c].token); } void test6293() { auto x = new C6293; x.token = x; f6293([x]); } /***************************************************/ // 3733 class C3733 { int foo() { return 1; } int foo() shared { return 2; } int bar() { return foo(); } } void test3733() { auto c = new C3733(); assert(c.bar() == 1); } /***************************************************/ // 4392 class C4392 { int foo() const { return 1; } int foo() { return 2; } int bar() const { return foo(); } } void test4392() { auto c = new C4392(); assert(c.bar() == 1); } /***************************************************/ // 6220 void test6220() { struct Foobar { real x; real y; real z;}; switch("x") { foreach(i,member; __traits(allMembers, Foobar)) { case member : break; } default : break; } } /***************************************************/ // 5799 void test5799() { int a; int *u = &(a ? a : (a ? a : a)); assert(u == &a); } /***************************************************/ // 6529 enum Foo6529 : char { A='a' } ref const(Foo6529) func6529(const(Foo6529)[] arr){ return arr[0]; } /***************************************************/ void test783() { const arr = [ 1,2,3 ]; const i = 2; auto jhk = new int[arr[i]]; // "need size of rightmost array, not type arr[i]" } /***************************************************/ template X157(alias x) { alias x X157; } template Parent(alias foo) { alias X157!(__traits(parent, foo)) Parent; } template ParameterTypeTuple(alias foo) { static if (is(typeof(foo) P == function)) alias P ParameterTypeTuple; else static assert(0, "argument has no parameters"); } template Mfp(alias foo) { auto Mfp = function(Parent!foo self, ParameterTypeTuple!foo i) { return self.foo(i); }; } class C157 { int a = 3; int foo(int i, int y) { return i + a + y; } } void test157() { auto c = new C157(); auto mfp = Mfp!(C157.foo); auto i = mfp(c, 1, 7); assert(i == 11); } /***************************************************/ // 6473 struct Eins6473 { ~this() {} } struct Zwei6473 { void build(Eins6473 devices = Eins6473()) { } } void build(Eins6473 devices = Eins6473()) {} void test6473() { void build(Eins6473 devices = Eins6473()) {} } /***************************************************/ uint rol11417(uint n)(in uint x) { return x << n | x >> 32 - n; } uint ror11417(uint n)(in uint x) { return x >> n | x << 32 - n; } void test11417() { assert(rol11417!1(0x8000_0000) == 0x1); assert(ror11417!1(0x1) == 0x8000_0000); } /***************************************************/ void test6578() { static struct Foo { this(int x) pure {} } auto f1 = new const(Foo)(1); auto f2 = new immutable(Foo)(1); auto f3 = new shared(Foo)(1); auto f4 = const(Foo)(1); auto f5 = immutable(Foo)(1); auto f6 = shared(Foo)(1); static assert(is(typeof(f1) == const(Foo)*)); static assert(is(typeof(f2) == immutable(Foo)*)); static assert(is(typeof(f3) == shared(Foo)*)); static assert(is(typeof(f4) == const(Foo))); static assert(is(typeof(f5) == immutable(Foo))); static assert(is(typeof(f6) == shared(Foo))); static struct Bar { this(int x) const pure {} } auto g1 = new const(Bar)(1); auto g2 = new immutable(Bar)(1); auto g3 = new shared(Bar)(1); auto g4 = const(Bar)(1); auto g5 = immutable(Bar)(1); auto g6 = shared(Bar)(1); static assert(is(typeof(g1) == const(Bar)*)); static assert(is(typeof(g2) == immutable(Bar)*)); static assert(is(typeof(g3) == shared(Bar)*)); static assert(is(typeof(g4) == const(Bar))); static assert(is(typeof(g5) == immutable(Bar))); static assert(is(typeof(g6) == shared(Bar))); static struct Baz { this()(int x) const pure {} } auto h1 = new const(Baz)(1); auto h2 = new immutable(Baz)(1); auto h3 = new shared(const(Baz))(1); auto h4 = const(Baz)(1); auto h5 = immutable(Baz)(1); auto h6 = shared(const(Baz))(1); static assert(is(typeof(h1) == const(Baz)*)); static assert(is(typeof(h2) == immutable(Baz)*)); static assert(is(typeof(h3) == shared(const(Baz))*)); static assert(is(typeof(h4) == const(Baz))); static assert(is(typeof(h5) == immutable(Baz))); static assert(is(typeof(h6) == shared(const(Baz)))); } /***************************************************/ // 6630 void test6630() { static class B {} static class A { this() { b = new B(); } B b; alias b this; } void fun(A a) { a = null; assert(a is null); } auto a = new A; assert(a.b !is null); fun(a); assert(a !is null); assert(a.b !is null); } /***************************************************/ int i199 = 1; void test199() { label: { int i199 = 2; } assert(i199 == 1); } /***************************************************/ // 6690 T useLazy6690(T)(lazy T val) { return val; // val is converted to delegate call, but it is typed as int delegate() - not @safe! } void test6690() @safe { useLazy6690(0); // Error: safe function 'test6690' cannot call system function 'useLazy6690' } /***************************************************/ template Hoge6691() { immutable static int[int] dict; immutable static int value; static this() { dict = [1:1, 2:2]; value = 10; } } alias Hoge6691!() H6691; /***************************************************/ void test10626() { double[2] v, x; struct Y { double u; } double z; Y y; double[2] r = v[] * x[0]; //double[2] s = v[] * z++; //double[2] t = v[] * z--; double[2] a = v[] * ++z; double[2] b = v[] * --z; double[2] c = v[] * y.u; double[2] d = v[] * (x[] = 3, x[0]); double[2] e = v[] * (v[] ~ z)[0]; } /***************************************************/ // 2953 template Tuple2953(T...) { alias T Tuple2953; } template Range2953(int b) { alias Tuple2953!(1) Range2953; } void foo2953()() { Tuple2953!(int, int) args; foreach( x ; Range2953!(args.length) ){ } } void test2953() { foo2953!()(); } /***************************************************/ // 2997 abstract class B2997 { void foo(); } interface I2997 { void bar(); } abstract class C2997 : B2997, I2997 {} //pragma(msg, __traits(allMembers, C).stringof); void test2997() { enum ObjectMembers = ["toString","toHash","opCmp","opEquals","Monitor","factory"]; static assert([__traits(allMembers, C2997)] == ["foo"] ~ ObjectMembers ~ ["bar"]); } /***************************************************/ // 6596 extern (C) int function() pfunc6596; extern (C) int cfunc6596(){ return 0; } static assert(typeof(pfunc6596).stringof == "extern (C) int function()"); static assert(typeof(cfunc6596).stringof == "extern (C) int()"); /***************************************************/ // 4423 struct S4423 { this(string phrase, int num) { this.phrase = phrase; this.num = num; } int opCmp(const ref S4423 rhs) { if (phrase < rhs.phrase) return -1; else if (phrase > rhs.phrase) return 1; if (num < rhs.num) return -1; else if (num > rhs.num) return 1; return 0; } string phrase; int num; } enum E4423 : S4423 { a = S4423("hello", 1), b = S4423("goodbye", 45), c = S4423("world", 22), }; void test4423() { E4423 e; assert(e.phrase == "hello"); e = E4423.b; assert(e.phrase == "goodbye"); } /***************************************************/ // 4647 interface Timer { final int run() { printf("Timer.run()\n"); fun(); return 1; }; int fun(); } interface Application { final int run() { printf("Application.run()\n"); fun(); return 2; }; int fun(); } class TimedApp : Timer, Application { int funCalls; override int fun() { printf("TimedApp.fun()\n"); funCalls++; return 2; } } class SubTimedApp : TimedApp { int subFunCalls; override int fun() { printf("SubTimedApp.fun()\n"); subFunCalls++; return 1; } } void test4647() { //Test access to TimedApps base interfaces auto app = new TimedApp(); assert((cast(Application)app).run() == 2); assert((cast(Timer)app).run() == 1); assert(app.Timer.run() == 1); // error, no Timer property assert(app.Application.run() == 2); // error, no Application property assert(app.run() == 1); // This would call Timer.run() if the two calls // above were commented out assert(app.funCalls == 5); assert(app.TimedApp.fun() == 2); assert(app.funCalls == 6); //Test direct access to SubTimedApp interfaces auto app2 = new SubTimedApp(); assert((cast(Application)app2).run() == 2); assert((cast(Timer)app2).run() == 1); assert(app2.Application.run() == 2); assert(app2.Timer.run() == 1); assert(app2.funCalls == 0); assert(app2.subFunCalls == 4); assert(app2.fun() == 1); assert(app2.SubTimedApp.fun() == 1); assert(app2.funCalls == 0); assert(app2.subFunCalls == 6); //Test access to SubTimedApp interfaces via TimedApp auto app3 = new SubTimedApp(); (cast(Timer)cast(TimedApp)app3).run(); app3.TimedApp.Timer.run(); assert((cast(Application)cast(TimedApp)app3).run() == 2); assert((cast(Timer)cast(TimedApp)app3).run() == 1); assert(app3.TimedApp.Application.run() == 2); assert(app3.TimedApp.Timer.run() == 1); assert(app3.funCalls == 0); assert(app3.subFunCalls == 6); } /***************************************************/ template T1064(E...) { alias E T1064; } int[] var1064 = [ T1064!(T1064!(T1064!(1, 2), T1064!(), T1064!(3)), T1064!(4, T1064!(T1064!(T1064!(T1064!(5)))), T1064!(T1064!(T1064!(T1064!())))),6) ]; void test1064() { assert(var1064 == [1,2,3,4,5,6]); } /***************************************************/ // 5696 template Seq5696(T...){ alias T Seq5696; } template Pred5696(T) { alias T Pred5696; } // TOKtemplate template Scope5696(int n){ template X(T) { alias T X; } } // TOKimport T foo5696(T)(T x) { return x; } void test5696() { foreach (pred; Seq5696!(Pred5696, Pred5696)) { static assert(is(pred!int == int)); } foreach (scop; Seq5696!(Scope5696!0, Scope5696!1)) { static assert(is(scop.X!int == int)); } alias Seq5696!(foo5696, foo5696) funcs; assert(funcs[0](0) == 0); assert(funcs[1](1) == 1); foreach (i, fn; funcs) { assert(fn(i) == i); } } /***************************************************/ // 5933 int dummyfunc5933(); alias typeof(dummyfunc5933) FuncType5933; struct S5933a { auto x() { return 0; } } static assert(is(typeof(&S5933a.init.x) == int delegate())); struct S5933b { auto x() { return 0; } } static assert(is(typeof(S5933b.init.x) == FuncType5933)); struct S5933c { auto x() { return 0; } } static assert(is(typeof(&S5933c.x) == int function())); struct S5933d { auto x() { return 0; } } static assert(is(typeof(S5933d.x) == FuncType5933)); class C5933a { auto x() { return 0; } } static assert(is(typeof(&(new C5933b()).x) == int delegate())); class C5933b { auto x() { return 0; } } static assert(is(typeof((new C5933b()).x) == FuncType5933)); class C5933c { auto x() { return 0; } } static assert(is(typeof(&C5933c.x) == int function())); class C5933d { auto x() { return 0; } } static assert(is(typeof(C5933d.x) == FuncType5933)); /***************************************************/ // 6084 template TypeTuple6084(T...){ alias T TypeTuple6084; } void test6084() { int foo(int x)() { return x; } foreach(i; TypeTuple6084!(0)) foo!(i); } /***************************************************/ // 3133 void test3133() { short[2] x = [1,2]; int[1] y = cast(int[1])x; short[1] z = [1]; static assert(!__traits(compiles, y = cast(int[1])z)); } /***************************************************/ // 6763 template TypeTuple6763(TList...) { alias TList TypeTuple6763; } alias TypeTuple6763!(int) T6763; void f6763( T6763) { } /// void c6763(const T6763) { } ///T now is (const int) void r6763(ref T6763) { } ///T now is(ref const int) void i6763(in T6763) { } ///Uncomment to get an Assertion failure in 'mtype.c' void o6763(out T6763) { } ///ditto void test6763() { int n; f6763(0); //With D2: Error: function main.f ((ref const const(int) _param_0)) is not callable using argument types (int) c6763(0); r6763(n); static assert(!__traits(compiles, r6763(0))); i6763(0); o6763(n); static assert(!__traits(compiles, o6763(0))); // 6755 static assert(typeof(f6763).stringof == "void(int _param_0)"); static assert(typeof(c6763).stringof == "void(const(int) _param_0)"); static assert(typeof(r6763).stringof == "void(ref int _param_0)"); static assert(typeof(i6763).stringof == "void(const(int) _param_0)"); static assert(typeof(o6763).stringof == "void(out int _param_0)"); } /***************************************************/ // 6695 struct X6695 { void mfunc() { static assert(is(typeof(this) == X6695)); } void cfunc() const { static assert(is(typeof(this) == const(X6695))); } void ifunc() immutable { static assert(is(typeof(this) == immutable(X6695))); } void sfunc() shared { static assert(is(typeof(this) == shared(X6695))); } void scfunc() shared const { static assert(is(typeof(this) == shared(const(X6695)))); } void wfunc() inout { static assert(is(typeof(this) == inout(X6695))); } void swfunc() shared inout { static assert(is(typeof(this) == shared(inout(X6695)))); } static assert(is(typeof(this) == X6695)); } /***************************************************/ // 6087 template True6087(T) { immutable True6087 = true; } struct Foo6087 { static assert( True6087!(typeof(this)) ); } struct Bar6087 { static assert( is(typeof(this) == Bar6087) ); } /***************************************************/ // 6848 class Foo6848 {} class Bar6848 : Foo6848 { void func() immutable { static assert(is(typeof(this) == immutable(Bar6848))); // immutable(Bar6848) auto t = this; static assert(is(typeof(t) == immutable(Bar6848))); // immutable(Bar6848) static assert(is(typeof(super) == immutable(Foo6848))); // Foo6848 instead of immutable(Foo6848) auto s = super; static assert(is(typeof(s) == immutable(Foo6848))); // Foo6848 instead of immutable(Foo6848) } } /***************************************************/ version(none) { cent issue785; ucent issue785; } static assert(!is(cent) && !is(ucent)); static assert(!__traits(compiles, { cent x; })); /***************************************************/ // 6847 template True6847(T) { immutable True6847 = true; } class Foo6847 {} class Bar6847 : Foo6847 { static assert( True6847!(typeof(super)) ); static assert( is(typeof(super) == Foo6847) ); } /***************************************************/ // http://d.puremagic.com/issues/show_bug.cgi?id=6488 struct TickDuration { template to(T) if (__traits(isIntegral,T)) { const T to() { return 1; } } template to(T) if (__traits(isFloating,T)) { const T to() { return 0; } } const long seconds() { return to!(long)(); } } void test6488() { TickDuration d; d.seconds(); } /***************************************************/ // 6836 template map6836(fun...) if (fun.length >= 1) { auto map6836(Range)(Range r) { } } void test6836() { [1].map6836!"a"(); } /***************************************************/ string func12864() { return ['a', 'b', 'c']; } void test12864(string s) { switch (s) { case func12864(): break; default: break; } } /***************************************************/ void test5448() { int[int][] aaa = [[1: 2]]; int[string][] a2 = [["cc":0], ["DD":10]]; } /***************************************************/ // 6837 struct Ref6837a(T) { T storage; alias storage this; } struct Ref6837b(T) { T storage; @property ref T get(){ return storage; } alias get this; } int front6837(int[] arr){ return arr[0]; } void popFront6837(ref int[] arr){ arr = arr[1..$]; } void test6837() { assert([1,2,3].front6837 == 1); auto r1 = Ref6837a!(int[])([1,2,3]); assert(r1.front6837() == 1); // ng assert(r1.front6837 == 1); // ok r1.popFront6837(); // ng r1.storage.popFront6837(); // ok auto r2 = Ref6837b!(int[])([1,2,3]); assert(r2.front6837() == 1); // ng assert(r2.front6837 == 1); // ok r2.popFront6837(); // ng r2.get.popFront6837(); // ng r2.get().popFront6837(); // ok } /***************************************************/ // 6927 @property int[] foo6927() { return [1, 2]; } int[] bar6927(int[] a) { return a; } void test6927() { bar6927(foo6927); // OK foo6927.bar6927(); // line 9, Error } /***************************************************/ struct Foo6813(T) { Foo6813 Bar() { return Foo6813(_indices.abc()); } T _indices; } struct SortedRange(alias pred) { SortedRange abc() { return SortedRange(); } } void test6813() { auto ind = SortedRange!({ })(); auto a = Foo6813!(typeof(ind))(); } /***************************************************/ struct Interval6753{ int a,b; } @safe struct S6753 { int[] arr; @trusted @property auto byInterval() const { return cast(const(Interval6753)[])arr; } } /***************************************************/ // 6859 class Parent6859 { public: bool isHage() const @property; public: abstract void fuga() out { assert(isHage); } body { } } class Child6859 : Parent6859 { override bool isHage() const @property { return true; } override void fuga() { //nop } } void test6859() { auto t = new Child6859; t.fuga(); printf("done.\n"); } /***************************************************/ // 6910 template Test6910(alias i, B) { void fn() { foreach(t; B.Types) { switch(i) { case 0://IndexOf!(t, B.Types): { pragma(msg, __traits(allMembers, t)); pragma(msg, __traits(hasMember, t, "m")); static assert(__traits(hasMember, t, "m")); // test break; } default: {} } } } } void test6910() { static struct Bag(S...) { alias S Types; } static struct A { int m; } int i; alias Test6910!(i, Bag!(A)).fn func; } /***************************************************/ void fun12503() { string b = "abc"; try { try { b = null; return; } catch { } } finally { assert("abc" !is b); } } void test12503() { fun12503(); } /***************************************************/ // 6902 void test6902() { static assert(is(typeof({ return int.init; // int, long, real, etc. }))); int f() pure nothrow { assert(0); } alias int T() pure nothrow; static if(is(typeof(&f) DT == delegate)) { static assert(is(DT* == T*)); // ok // Error: static assert (is(pure nothrow int() == pure nothrow int())) is false static assert(is(DT == T)); } } /***************************************************/ // 6330 struct S6330 { void opAssign(S6330 s) @disable { assert(0); // This fails. } } void test6330() { S6330 s; S6330 s2; static assert(!is(typeof({ s2 = s; }))); } /***************************************************/ struct S8269 { bool dtor = false; ~this() { dtor = true; } } void test8269() { with(S8269()) { assert(!dtor); } } /***************************************************/ // 5311 class C5311 { private static int globalData; void breaksPure() pure const { static assert(!__traits(compiles, { globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { X.globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { this.globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { int a = this.globalData; })); } } static void breaksPure5311a(C5311 x) pure { static assert(!__traits(compiles, { x.globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { int a = x.globalData; })); } struct S5311 { private static int globalData; void breaksPure() pure const { static assert(!__traits(compiles, { globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { X.globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { this.globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { int a = this.globalData; })); } } static void breaksPure5311b(S5311 x) pure { static assert(!__traits(compiles, { x.globalData++; })); // SHOULD BE ERROR static assert(!__traits(compiles, { int a = x.globalData; })); } /***************************************************/ // 6868 @property bool empty6868(T)(in T[] a) @safe pure nothrow { return !a.length; } void test6868() { alias int[] Range; static if (is(char[1 + Range.empty6868])) // Line 9 enum bool isInfinite = true; char[0] s; // need } /***************************************************/ // 2856 struct foo2856 { static void opIndex(int i) { printf("foo\n"); } } struct bar2856(T) { static void opIndex(int i) { printf("bar\n"); } } void test2856() { foo2856[1]; bar2856!(float)[1]; // Error (# = __LINE__) alias bar2856!(float) B; B[1]; // Okay } /***************************************************/ // 3091 void test3091(inout int = 0) { struct Foo {} auto pm = new Foo; static assert(is( typeof( pm) == Foo * )); auto pc = new const Foo; static assert(is( typeof( pc) == const(Foo) * )); auto pw = new inout Foo; static assert(is( typeof( pw) == inout(Foo) * )); auto psm = new shared Foo; static assert(is( typeof(psm) == shared(Foo) * )); auto psc = new shared const Foo; static assert(is( typeof(psc) == shared(const(Foo))* )); auto psw = new shared inout Foo; static assert(is( typeof(psw) == shared(inout(Foo))* )); auto pi = new immutable Foo; static assert(is( typeof( pi) == immutable(Foo) * )); auto m = Foo(); static assert(is( typeof( m) == Foo )); auto c = const Foo(); static assert(is( typeof( c) == const(Foo) )); auto w = inout Foo(); static assert(is( typeof( w) == inout(Foo) )); auto sm = shared Foo(); static assert(is( typeof(sm) == shared(Foo) )); auto sc = shared const Foo(); static assert(is( typeof(sc) == shared(const(Foo)) )); auto sw = shared inout Foo(); static assert(is( typeof(sw) == shared(inout(Foo)) )); auto i = immutable Foo(); static assert(is( typeof( i) == immutable(Foo) )); } /***************************************************/ // 6837 template Id6837(T) { alias T Id6837; } static assert(is(Id6837!(shared const int) == shared const int)); static assert(is(Id6837!(shared inout int) == shared inout int)); /***************************************************/ // 6056 fixup template ParameterTypeTuple6056(func) { static if (is(func Fptr : Fptr*) && is(Fptr P == function)) alias P ParameterTypeTuple6056; else static assert(0, "argument has no parameters"); } extern(C) alias void function() fpw_t; alias void function(fpw_t fp) cb_t; void bar6056(ParameterTypeTuple6056!(cb_t) args) { pragma (msg, "TFunction1: " ~ typeof(args[0]).stringof); } extern(C) void foo6056() { } void test6056() { bar6056(&foo6056); } /***************************************************/ // 6356 int f6356()(int a) { return a*a; } alias f6356!() g6356; // comment this out to eliminate the errors pure nothrow @safe int i6356() { return f6356(1); } void test6356() { assert(i6356() == 1); } /***************************************************/ // 7108 static assert(!__traits(hasMember, int, "x")); static assert( __traits(hasMember, int, "init")); /***************************************************/ // 7073 void test7073() { string f(int[] arr...) { return ""; } } /***************************************************/ // 7150 struct A7150 { static int cnt; this(T)(T thing, int i) { this(thing, i > 0); // Error: constructor call must be in a constructor ++cnt; } this(T)(T thing, bool b) { ++cnt; } } void test7150() { auto a = A7150(5, 5); // Error: template instance constructtest.A.__ctor!(int) error instantiating assert(A7150.cnt == 2); } /***************************************************/ // 7159 alias void delegate() Void7159; class HomeController7159 { Void7159 foo() { return cast(Void7159)&HomeController7159.displayDefault; } auto displayDefault() { return 1; } } /***************************************************/ // 7160 class HomeController { static if (false) { mixin(q{ int a; }); } void foo() { foreach (m; __traits(derivedMembers, HomeController)) { } } } void test7160() {} /***************************************************/ // 7168 void test7168() { static class X { void foo(){} } static class Y : X { void bar(){} } enum ObjectMembers = ["toString","toHash","opCmp","opEquals","Monitor","factory"]; static assert([__traits(allMembers, X)] == ["foo"]~ObjectMembers); // pass static assert([__traits(allMembers, Y)] == ["bar", "foo"]~ObjectMembers); // fail static assert([__traits(allMembers, Y)] != ["bar", "foo"]); // fail } /***************************************************/ // 7170 T to7170(T)(string x) { return 1; } void test7170() { // auto i = to7170!int("1"); // OK auto j = "1".to7170!int(); // NG, Internal error: e2ir.c 683 } /***************************************************/ // 7196 auto foo7196(int x){return x;} auto foo7196(double x){return x;} void test7196() { auto x = (&foo7196)(1); // ok auto y = (&foo7196)(1.0); // fail } /***************************************************/ // 7285 int[2] spam7285() { int[2] ab; if (true) return (true) ? ab : [0, 0]; // Error else return (true) ? [0, 0] : ab; // OK } void test7285() { auto sa = spam7285(); } /***************************************************/ // 7321 void test7321() { static assert(is(typeof((){})==void function()pure nothrow @nogc @safe)); // ok static assert(is(typeof((){return;})==void function()pure nothrow @nogc @safe)); // fail } /***************************************************/ class A158 { pure void foo1() { } const void foo2() { } nothrow void foo3() { } @safe void foo4() { } } class B158 : A158 { override void foo1() { } override void foo2() const { } override void foo3() { } override void foo4() { } } /***************************************************/ // 9231 class B9231 { void foo() inout pure {} } class D9231 : B9231 { override void foo() inout {} } /***************************************************/ // 3282 class Base3282 { string f() { return "Base.f()"; } } class Derived3282 : Base3282 { override string f() { return "Derived.f()"; } /*override*/ string f() const { return "Derived.f() const"; } } void test3282() { auto x = new Base3282; assert(x.f() == "Base.f()"); auto y = new Derived3282; assert(y.f() == "Derived.f()");// calls "Derived.f() const", but it is expected that be called non-const. auto z = new const(Derived3282); assert(z.f() == "Derived.f() const"); } /***************************************************/ // 7534 class C7534 { int foo(){ return 1; } } class D7534 : C7534 { override int foo(){ return 2; } /*override*/ int foo() const { return 3; } // Error: D.foo multiple overrides of same function } void test7534() { C7534 mc = new C7534(); assert(mc.foo() == 1); D7534 md = new D7534(); assert(md.foo() == 2); mc = md; assert(mc.foo() == 2); const(D7534) cd = new const(D7534)(); assert(cd.foo() == 3); md = cast()cd; assert(md.foo() == 2); } /***************************************************/ // 7534 + return type covariance class X7534 {} class Y7534 : X7534 { int value; this(int n){ value = n; } } class V7534 { X7534 foo(){ return new X7534(); } } class W7534 : V7534 { override Y7534 foo(){ return new Y7534(1); } /*override*/ Y7534 foo() const { return new Y7534(2); } } void test7534cov() { auto mv = new V7534(); assert(typeid(mv.foo()) == typeid(X7534)); auto mw = new W7534(); assert(typeid(mw.foo()) == typeid(Y7534)); assert(mw.foo().value == 1); mv = mw; assert(typeid(mv.foo()) == typeid(Y7534)); assert((cast(Y7534)mv.foo()).value == 1); auto cw = new const(W7534)(); assert(typeid(cw.foo()) == typeid(Y7534)); assert(cw.foo().value == 2); } /***************************************************/ // 7562 static struct MyInt { private int value; mixin ProxyOf!value; } mixin template ProxyOf(alias a) { template X1(){} template X2(){} template X3(){} template X4(){} template X5(){} template X6(){} template X7(){} template X8(){} template X9(){} template X10(){} void test1(this X)(){} void test2(this Y)(){} } /***************************************************/ import core.stdc.stdlib; void test13427(void* buffer = alloca(100)) { } /***************************************************/ // 7583 template Tup7583(E...) { alias E Tup7583; } struct S7583 { Tup7583!(float, char) field; alias field this; this(int x) { } } int bug7583() { S7583[] arr; arr ~= S7583(0); return 1; } static assert (bug7583()); /***************************************************/ // 7618 void test7618(const int x = 1) { int func(ref int x) { return 1; } static assert(!__traits(compiles, func(x))); // Error: function test.foo.func (ref int _param_0) is not callable using argument types (const(int)) int delegate(ref int) dg = (ref int x) => 1; static assert(!__traits(compiles, dg(x))); // --> no error, bad! int function(ref int) fp = (ref int x) => 1; static assert(!__traits(compiles, fp(x))); // --> no error, bad! } /***************************************************/ // 7621 void test7621() { enum uint N = 4u; char[] A = "hello".dup; uint[immutable char[4u]] dict; dict[*cast(immutable char[4]*)(A[0 .. N].ptr)] = 0; // OK dict[*cast(immutable char[N]*)(A[0 .. N].ptr)] = 0; // line 6, error } /***************************************************/ // 7682 template ConstOf7682(T) { alias const(T) ConstOf7682; } bool pointsTo7682(S)(ref const S source) @trusted pure nothrow { return true; } void test7682() { shared(ConstOf7682!(int[])) x; // line A struct S3 { int[10] a; } shared(S3) sh3; shared(int[]) sh3sub = sh3.a[]; assert(pointsTo7682(sh3sub)); // line B } /***************************************************/ // 7735 void a7735(void[][] data...) { //writeln(data); assert(data.length == 1); b7735(data); } void b7735(void[][] data...) { //writeln(data); assert(data.length == 1); c7735(data); } void c7735(void[][] data...) { //writeln(data); assert(data.length == 1); } void test7735() { a7735([]); a7735([]); } /***************************************************/ // 7815 mixin template Helpers() { static if (is(Flags!Move)) { Flags!Move flags; } else { // DMD will happily instantiate the allegedly // non-existent Flags!This here. (!) pragma(msg, __traits(derivedMembers, Flags!Move)); } } template Flags(T) { mixin({ int defs = 1; foreach (name; __traits(derivedMembers, Move)) { defs++; } if (defs) { return "struct Flags { bool a; }"; } else { return ""; } }()); } struct Move { int a; mixin Helpers!(); } enum a7815 = Move.init.flags; /***************************************************/ struct A7823 { long a; enum A7823 b = {0}; } void test7823(A7823 a = A7823.b) { } /***************************************************/ // 7871 struct Tuple7871 { string field; alias field this; } //auto findSplitBefore(R1)(R1 haystack) auto findSplitBefore7871(string haystack) { return Tuple7871(haystack); } void test7871() { string line = `<bookmark href="https://stuff">`; auto a = findSplitBefore7871(line[0 .. $])[0]; } /***************************************************/ // 7906 void test7906() { static assert(!__traits(compiles, { enum s = [string.min]; })); } /***************************************************/ // 7907 template Id7907(E) { alias E Id7907; } template Id7907(alias E) { alias E Id7907; } void test7907() { static assert(!__traits(compiles, { alias Id7907!([string.min]) X; })); } /***************************************************/ // 1175 class A1175 { class I1 { } } class B1175 : A1175 { class I2 : I1 { } I1 getI() { return new I2; } } /***************************************************/ // 7983 class A7983 { void f() { g7983(this); } unittest { } } void g7983(T)(T a) { foreach (name; __traits(allMembers, T)) { pragma(msg, name); static if (__traits(compiles, &__traits(getMember, a, name))) { } } } /***************************************************/ // 8004 void test8004() { auto n = (int n = 10){ return n; }(); assert(n == 10); } /***************************************************/ // 8064 void test8064() { uint[5] arry; ref uint acc(size_t i) { return arry[i]; } auto arryacc = &acc; arryacc(3) = 5; // same error } /***************************************************/ // 8220 void foo8220(int){} static assert(!__traits(compiles, foo8220(typeof(0)))); // fail /***************************************************/ void func8105(in ref int x) { } void test8105() { } /***************************************************/ template ParameterTypeTuple159(alias foo) { static if (is(typeof(foo) P == __parameters)) alias P ParameterTypeTuple159; else static assert(0, "argument has no parameters"); } int func159(int i, long j = 7) { return 3; } alias ParameterTypeTuple159!func159 PT; int bar159(PT) { return 4; } pragma(msg, typeof(bar159)); pragma(msg, PT[1]); PT[1] boo159(PT[1..2] a) { return a[0]; } void test159() { assert(bar159(1) == 4); assert(boo159() == 7); } /***************************************************/ // 8283 struct Foo8283 { this(long) { } } struct FooContainer { Foo8283 value; } auto get8283() { union Buf { FooContainer result; } Buf buf = {}; return buf.result; } void test8283() { auto a = get8283(); } /***************************************************/ // 8395 struct S8395 { int v; this(T : long)(T x) { v = x * 2; } } void test8395() { S8395 ms = 6; assert(ms.v == 12); const S8395 cs = 7; assert(cs.v == 14); } /***************************************************/ // 5749 void test5749() { static struct A { A foo(int x, int i) { //printf("this = %p, %d: i=%d\n", &this, x, i); assert(i == x); return this; } A bar(int x, ref int i) { //printf("this = %p, %d: i=%d\n", &this, x, i); assert(i == x); return this; } } static int inc1(ref int i) { return ++i; } static ref int inc2(ref int i) { return ++i; } int i; A a; //printf("&a = %p\n", &a); i = 0; a.foo(1, ++i).foo(2, ++i); // OK <-- 2 1 i = 0; a.bar(1, ++i).bar(2, ++i); // OK <-- 2 2 i = 0; a.foo(1, inc1(i)).foo(2, inc1(i)); // OK <-- 2 1 i = 0; a.bar(1, inc2(i)).bar(2, inc2(i)); // OK <-- 2 2 //printf("\n"); A getVal() { static A a; return a; } i = 0; getVal().foo(1, ++i).foo(2, ++i); // OK <-- 2 1 i = 0; getVal().bar(1, ++i).bar(2, ++i); // OK <-- 2 2 i = 0; getVal().foo(1, inc1(i)).foo(2, inc1(i)); // OK <-- 2 1 i = 0; getVal().bar(1, inc2(i)).bar(2, inc2(i)); // OK <-- 2 2 //printf("\n"); ref A getRef() { static A a; return a; } i = 0; getRef().foo(1, ++i).foo(2, ++i); // OK <-- 2 1 i = 0; getRef().bar(1, ++i).bar(2, ++i); // OK <-- 2 2 i = 0; getRef().foo(1, inc1(i)).foo(2, inc1(i)); // OK <-- 2 1 i = 0; getRef().bar(1, inc2(i)).bar(2, inc2(i)); // OK <-- 2 2 } /***************************************************/ // 8396 void test8396() { static int g; static extern(C) int bar(int a, int b) { //printf("a = %d, b = %d\n", a, b); assert(b - a == 1); return ++g; } static auto getFunc(int n) { assert(++g == n); return &bar; } static struct Tuple { int _a, _b; } static Tuple foo(int n) { assert(++g == n); return Tuple(1, 2); } g = 0; assert(bar(foo(1).tupleof) == 2); g = 0; assert(getFunc(1)(foo(2).tupleof) == 3); } /***************************************************/ enum E160 : ubyte { jan = 1 } struct D160 { short _year = 1; E160 _month = E160.jan; ubyte _day = 1; this(int year, int month, int day) pure { _year = cast(short)year; _month = cast(E160)month; _day = cast(ubyte)day; } } struct T160 { ubyte _hour; ubyte _minute; ubyte _second; this(int hour, int minute, int second = 0) pure { _hour = cast(ubyte)hour; _minute = cast(ubyte)minute; _second = cast(ubyte)second; } } struct DT160 { D160 _date; T160 _tod; this(int year, int month, int day, int hour = 0, int minute = 0, int second = 0) pure { _date = D160(year, month, day); _tod = T160(hour, minute, second); } } void foo160(DT160 dateTime) { printf("test7 year %d, day %d\n", dateTime._date._year, dateTime._date._day); assert(dateTime._date._year == 1999); assert(dateTime._date._day == 6); } void test160() { auto dateTime = DT160(1999, 7, 6, 12, 30, 33); printf("test5 year %d, day %d\n", dateTime._date._year, dateTime._date._day); assert(dateTime._date._year == 1999); assert(dateTime._date._day == 6); foo160(DT160(1999, 7, 6, 12, 30, 33)); } /***************************************************/ // 8437 class Cgi8437 { struct PostParserState { UploadedFile piece; } static struct UploadedFile { string contentFilename; } } /***************************************************/ // 8665 auto foo8665a(bool val) { if (val) return 42; else return 1.5; } auto foo8665b(bool val) { if (!val) return 1.5; else return 42; } void test8665() { static assert(is(typeof(foo8665a(true)) == double)); static assert(is(typeof(foo8665b(false)) == double)); assert(foo8665a(true) == 42); // assertion failure assert(foo8665b(true) == 42); // assertion failure assert(foo8665a(false) == 1.5); assert(foo8665b(false) == 1.5); static assert(foo8665a(true) == 42); static assert(foo8665b(true) == 42); static assert(foo8665a(false) == 1.5); static assert(foo8665b(false) == 1.5); } /***************************************************/ int foo8108(int, int); int foo8108(int a, int b) { return a + b; } void test8108() { foo8108(1,2); } /***************************************************/ // 8360 struct Foo8360 { int value = 0; int check = 1337; this(int value) { assert(0); this.value = value; } ~this() { assert(0); assert(check == 1337); } string str() { assert(0); return "Foo"; } } Foo8360 makeFoo8360() { assert(0); return Foo8360(2); } void test8360() { size_t length = 0; // The message part 'makeFoo().str()' should not be evaluated at all. assert(length < 5, makeFoo8360().str()); } /***************************************************/ // 8361 struct Foo8361 { string bar = "hello"; ~this() {} } void test8361() { assert(true, Foo8361().bar); } /***************************************************/ // 6141 + 8526 void test6141() { static void takeADelegate(void delegate()) {} auto items = new int[1]; items[0] = 17; foreach (ref item; items) { // both asserts fail assert(item == 17); assert(&item == items.ptr); takeADelegate({ auto x = &item; }); } foreach(ref val; [3]) { auto dg = { int j = val; }; assert(&val != null); // Assertion failure assert(val == 3); } static void f(lazy int) {} int i = 0; auto dg = { int j = i; }; foreach(ref val; [3]) { f(val); assert(&val != null); // Assertion failure assert(val == 3); } } void test8526() { static void call(void delegate() dg) { dg(); } foreach (i, j; [0]) { call({ assert(i == 0); // fails, i is corrupted }); } foreach (n; 0..1) { call({ assert(n == 0); // fails, n is corrupted }); } } /***************************************************/ template ParameterTuple(alias func) { static if(is(typeof(func) P == __parameters)) alias P ParameterTuple; else static assert(0); } int foo161(ref float y); void test161() { alias PT = ParameterTuple!foo161; auto x = __traits(identifier, PT); assert(x == "y"); } /***************************************************/ // 7175 void test7175() { struct S { ubyte[0] arr; } S s; assert(s.arr.ptr !is null); assert(cast(void*)s.arr.ptr is cast(void*)&s); } /***************************************************/ // 8819 void test8819() { void[1] sa1 = (void[1]).init; assert((cast(ubyte*)sa1.ptr)[0] == 0); void[4] sa4 = [cast(ubyte)1,cast(ubyte)2,cast(ubyte)3,cast(ubyte)4]; assert((cast(ubyte*)sa4.ptr)[0] == 1); assert((cast(ubyte*)sa4.ptr)[1] == 2); assert((cast(ubyte*)sa4.ptr)[2] == 3); assert((cast(ubyte*)sa4.ptr)[3] == 4); auto sa22 = (void[2][2]).init; static assert(sa22.sizeof == ubyte.sizeof * 2 * 2); ubyte[4]* psa22 = cast(ubyte[4]*)sa22.ptr; assert((*psa22)[0] == 0); assert((*psa22)[1] == 0); assert((*psa22)[2] == 0); assert((*psa22)[3] == 0); } /***************************************************/ // 8897 class C8897 { static mixin M8897!(int); static class causesAnError {} } template M8897 ( E ) { } /***************************************************/ // 8917 void test8917() { int[3] a; int[3] a2; int[3] b = a[] + a2[]; } /***************************************************/ // 8945 struct S8945 // or `class`, or `union` { struct S0(T) { int i; } struct S1(T) { this(int){} } } void test8945() { auto cs0a = const S8945.S0!int(); // ok auto cs0b = const S8945.S0!int(1); // ok auto cs1 = const S8945.S1!int(1); // ok auto s0a = S8945.S0!int(); // Error: struct S0 does not overload () auto s0b = S8945.S0!int(1); // Error: struct S0 does not overload () auto s1 = S8945.S1!int(1); // Error: struct S1 does not overload () } /***************************************************/ struct S162 { static int generateMethodStubs( Class )() { int text; foreach( m; __traits( allMembers, Class ) ) { static if( is( typeof( mixin( m ) ) ) && is( typeof( mixin( m ) ) == function ) ) { pragma(msg, __traits( getOverloads, Class, m )); } } return text; } enum int ttt = generateMethodStubs!( S162 )(); float height(); int get( int ); int get( long ); void clear(); void draw( int ); void draw( long ); } /***************************************************/ void test163() { static class C { int x; int y; } immutable C c = new C(); shared C c2 = new C(); shared const C c3 = new C(); class D { int x; int y; } immutable D d; assert(!__traits(compiles, d = new D())); static struct S { int x; int y; } immutable S* s = new S(); shared S* s2 = new S(); shared const S* s3 = new S(); shared S* s4; assert(__traits(compiles, s4 = new immutable(S)())); struct T { int x; int y; } immutable T* t; assert(!__traits(compiles, t = new T())); immutable int* pi = new int(); immutable void* pv = new int(); immutable int[] ai = new int[1]; immutable void[] av = new int[2]; } /***************************************************/ struct S9000 { ubyte i = ubyte.max; } enum E9000 = S9000.init; /***************************************************/ mixin template DefineCoreType(string type) { struct Faulty { static int x; static void instance() { x = 3; } X164!() xxx; } } mixin DefineCoreType!(""); mixin template A164() { static this() { } } struct X164() { mixin A164!(); } /***************************************************/ // 9428 void test9428() { int[2][] items = [[1, 2]]; int[2] x = [3, 4]; auto r1 = items ~ [x]; assert(r1.length == 2); assert(r1[0][0] == 1); assert(r1[0][1] == 2); assert(r1[1][0] == 3); assert(r1[1][1] == 4); auto r2 = items ~ x; assert(r2.length == 2); assert(r2[0][0] == 1); assert(r2[0][1] == 2); assert(r2[1][0] == 3); assert(r2[1][1] == 4); auto r3 = [x] ~ items; assert(r3.length == 2); assert(r3[0][0] == 3); assert(r3[0][1] == 4); assert(r3[1][0] == 1); assert(r3[1][1] == 2); auto r4 = x ~ items; assert(r4.length == 2); assert(r4[0][0] == 3); assert(r4[0][1] == 4); assert(r4[1][0] == 1); assert(r4[1][1] == 2); } /***************************************************/ // 9477 template Tuple9477(T...) { alias T Tuple9477; } template Select9477(bool b, T, U) { static if (b) alias T Select9477; else alias U Select9477; } void test9477() { static bool isEq (T1, T2)(T1 s1, T2 s2) { return s1 == s2; } static bool isNeq(T1, T2)(T1 s1, T2 s2) { return s1 != s2; } // Must be outside the loop due to http://d.puremagic.com/issues/show_bug.cgi?id=9748 int order; // Must be outside the loop due to http://d.puremagic.com/issues/show_bug.cgi?id=9756 auto checkOrder(bool dyn, uint expected)() { assert(order==expected); order++; // Use temporary ("v") to work around http://d.puremagic.com/issues/show_bug.cgi?id=9402 auto v = cast(Select9477!(dyn, string, char[1]))"a"; return v; } foreach (b1; Tuple9477!(false, true)) foreach (b2; Tuple9477!(false, true)) { version (D_PIC) {} else // Work around http://d.puremagic.com/issues/show_bug.cgi?id=9754 { assert( isEq (cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[0]))"" )); assert(!isNeq(cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[0]))"" )); assert(!isEq (cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[1]))"a" )); assert( isNeq(cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[1]))"a" )); } assert( isEq (cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"a" )); assert(!isNeq(cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"a" )); assert(!isEq (cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"b" )); assert( isNeq(cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"b" )); assert(!isEq (cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[2]))"aa")); assert( isNeq(cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[2]))"aa")); // Note: order of evaluation was not followed before this patch // (thus, the test below will fail without the patch). // Although the specification mentions that as implementation-defined behavior, // I understand that this isn't by design, but rather an inconvenient aspect of DMD // that has been moved to the specification. order = 0; bool result = checkOrder!(b1, 0)() == checkOrder!(b2, 1)(); assert(result); assert(order == 2); } ubyte[64] a1, a2; foreach (T; Tuple9477!(void, ubyte, ushort, uint, ulong, char, wchar, dchar, float, double)) { auto s1 = cast(T[])(a1[]); auto s2 = cast(T[])(a2[]); assert(s1 == s2); a2[$-1]++; assert(s1 != s2); assert(s1[0..$-1]==s2[0..$-1]); a2[$-1]--; } } /***************************************************/ // 9504 struct Bar9504 { template Abc(T) { T y; } enum size_t num = 123; class Def {} } template GetSym9504(alias sym) { static assert(__traits(isSame, sym, Bar9504.Abc)); } template GetExp9504(size_t n) { static assert(n == Bar9504.num); } template GetTyp9504(T) { static assert(is(T == Bar9504.Def)); } alias GetSym9504!(typeof(Bar9504.init).Abc) X9504; // NG alias GetExp9504!(typeof(Bar9504.init).num) Y9504; // NG alias GetTyp9504!(typeof(Bar9504.init).Def) Z9504; Bar9504 test9504() { alias GetSym9504!(typeof(return).Abc) V9504; // NG alias GetExp9504!(typeof(return).num) W9504; // NG alias GetTyp9504!(typeof(return).Def) X9504; return Bar9504(); } /***************************************************/ // 9538 void test9538() { void*[1] x; auto ti = typeid(x.ptr); } /***************************************************/ // 9539 void test9539() { void f(int** ptr) { assert(**ptr == 10); } int* p = new int; *p = 10; int*[1] x = [p]; f(&x[0]); int*[] arr = [null]; static assert(!__traits(compiles, p = arr)); // bad! } /***************************************************/ // 9700 mixin template Proxy9700(alias a) { auto ref opOpAssign(string op, V)(V v) { return a += v; } // NG //auto ref opOpAssign(string op, V)(V v) { a += v; } // OK } struct MyInt9700 { int value; invariant() { assert(value >= 0); } mixin Proxy9700!value; } void test9700() { MyInt9700 a = { 2 }; a *= 3; // object.Error: Access Violation } /***************************************************/ // 9834 struct Event9834 { void delegate() dg; void set(void delegate() h) pure { dg = h; } // AV occurs void call() { dg(); } } void test9834() { Event9834 ev; auto a = new class { Object o; this() { o = new Object; ev.set((){ o.toString(); }); } }; ev.call(); } /***************************************************/ // 9859 void test9859(inout int[] arr) { auto dg1 = { foreach (i, e; arr) { } }; dg1(); void foo() { auto v = arr; auto w = arr[0]; } void bar(inout int i) { auto v = arr[i]; } auto dg2 = { auto dg = { void foo(T)() { auto dg = { auto dg = { auto v = arr; }; }; } foo!int; }; }; void qux(T)() { auto v = arr; auto dg1 = { auto v = arr; }; auto dg2 = { auto dg = { auto v = arr; }; }; } qux!int; } /***************************************************/ // 9912 template TypeTuple9912(Stuff...) { alias Stuff TypeTuple9912; } struct S9912 { int i; alias TypeTuple9912!i t; void testA() { auto x = t; } void testB() { auto x = t; } } /***************************************************/ // 9883 struct S9883 { @property size_t p9883(T)() { return 0; } } @property size_t p9883(T)() { return 0; } void test9883() { S9883 s; auto n1 = p9883!int; // OK auto n2 = s.p9883!int; // OK auto a1 = new int[p9883!int]; // Error: need size of rightmost array, not type p!(int) auto a2 = new int[s.p9883!int]; // Error: no property 'p!(int)' for type 'S' } /***************************************************/ // 10091 struct S10091 { enum e = "a"; } void test10091() { auto arr = cast(ubyte[1]) S10091.e; } /***************************************************/ void test12824() { label: static if (0) { } } /***************************************************/ // 9130 class S9130 { void bar() { } } import core.stdc.stdio : printf; struct Function { int[] ai = [1,2,3]; } @property void meta(alias m)() { static Function md; printf("length = %d\n", md.ai.length); printf("ptr = %p\n", md.ai.ptr); md.ai[0] = 0; } void test9130() { meta!(__traits(getOverloads, S9130, "bar")[0]); meta!(S9130.bar); } /***************************************************/ // 10390 class C10390 { this() { this.c = this; } C10390 c; } const c10390 = new C10390(); pragma(msg, c10390); /***************************************************/ // 10542 class B10542 { this() nothrow pure @safe { } } class D10542 : B10542 { } void test10542() nothrow pure @safe { new D10542; } /***************************************************/ // 10539 void test10539() { int[2][2] a; int* p1 = a.ptr.ptr; // OK <- error int* p2 = (*a.ptr).ptr; // OK assert(p1 is p2); } /***************************************************/ struct TimeOfDay { ubyte h, m, s; } __gshared byte glob; struct DateTime { this(ubyte _d, ubyte _m, ubyte _y, TimeOfDay _tod = TimeOfDay.init) { d = _d; m = _m; y = _y; tod = _tod; } TimeOfDay tod; ubyte d, m, y; } void test10634() { glob = 123; DateTime date1 = DateTime(0, 0, 0); DateTime date2; assert(date1 == date2); } /***************************************************/ immutable(char)[4] bar7254(int i) { if (i) { immutable(char)[4] r; return r; } else return "1234"; } void test7254() { assert(bar7254(0) == "1234"); } /***************************************************/ struct S11075() { int x = undefined_expr; } class C11075() { int x = undefined_expr; } interface I11075() { enum int x = undefined_expr; } void test11075() { static assert(!is(typeof(S11075!().x))); static assert(!is(typeof(S11075!().x))); static assert(!is(typeof(C11075!().x))); static assert(!is(typeof(C11075!().x))); static assert(!is(typeof(I11075!().x))); static assert(!is(typeof(I11075!().x))); } /***************************************************/ // 11181 void test11181() { auto a = ["a", "b"]; static assert(!is(typeof([a, "x"]))); static assert(!is(typeof(true ? a : "x"))); static assert(!is(typeof(true ? a[0 .. $] : "x"))); static assert(!is(typeof([a[0 .. $], "x"]))); } /***************************************************/ // 11317 void test11317() { auto ref uint fun() { return 0; } void test(ref uint x) {} static assert(!__traits(compiles, test(fun()))); assert(fun() == 0); } /***************************************************/ // 12153 void test12153() { int[1] i, j; bool b = true; (b ? i : j)[] = [4]; assert(i == [4]); } /***************************************************/ // 12498 string a12498() { string b; while (b) { } for (; b; ) { } return ""; } void test12498() { enum t = a12498(); string x = t; } /***************************************************/ // 12900 struct A12900 { char[1] b; } void test12900() { A12900 c; if (*c.b.ptr) return; } /***************************************************/ // 12937 void test12937() { void[1] sa2 = cast(void[])[cast(ubyte)1]; // ICE! assert((cast(ubyte[])sa2[])[0] == 1); } /***************************************************/ // 13154 void test13154() { int[3] ints = [2 , 1 , 0 , 1 ][0..3]; float[3] floats0 = [2f , 1f , 0f , 1f ][0..3]; float[3] floats1 = [2.0 , 1.0 , 0.0 , 1.0 ][0..3]; // fails! float[3] floats2 = [2.0f, 1.0f, 0.0f, 1.0f][0..3]; assert(ints == [2, 1, 0]); assert(floats0 == [2, 1, 0]); assert(floats1 == [2, 1, 0]); // fail! assert(floats1 != [0, 0, 0]); // fail! assert(floats2 == [2, 1, 0]); } /***************************************************/ // 13437 ubyte[4] foo13437() { return [1,2,3,4]; } void test13437() { auto n = cast(ubyte[4])foo13437()[]; // OK <- ICE: e2ir.c 4616 static assert(is(typeof(n) == ubyte[4])); assert(n == [1,2,3,4]); } /***************************************************/ // 13476 template ParameterTypeTuple13476(func...) { static if (is(typeof(*func[0]) P == function)) alias ParameterTypeTuple13476 = P; else static assert(0, "argument has no parameters"); } int flag13476; __gshared extern(C) void function(int) nothrow someFunc13476 = &Stub13476!someFunc13476; extern(C) auto Stub13476(alias func)(ParameterTypeTuple13476!func args) { ++flag13476; extern(C) void function(int) nothrow impl = (i) { }; return (func = impl)(args); } __gshared extern(C) void function(int) nothrow someFunc13476Alt = &Stub13476Alt!someFunc13476AltP; __gshared extern(C) void function(int) nothrow* someFunc13476AltP = &someFunc13476Alt; extern(C) auto Stub13476Alt(alias func)(int args) nothrow { ++flag13476; extern(C) void function(int) nothrow impl = (i) {}; return (*func = impl)(args); } void test13476() { assert(flag13476 == 0); someFunc13476(42); assert(flag13476 == 1); someFunc13476(43); assert(flag13476 == 1); someFunc13476Alt(42); assert(flag13476 == 2); someFunc13476Alt(43); assert(flag13476 == 2); } /***************************************************/ int main() { test1(); test2(); test3(); test4(); test5(); test6(); test7(); test8(); test9(); test10(); test11(); test12(); test13(); test14(); test15(); test16(); test17(); test18(); test19(); test20(); test21(); test22(); test23(); test24(); test25(); test26(); test27(); test28(); test29(); test30(); test31(); test32(); test33(); test34(); test35(); test36(); test37(); test38(); test39(); test40(); test41(); test42(); test43(); test44(); test45(); test46(); test47(); test48(); test49(); test796(); test50(); test51(); test52(); test53(); test54(); test55(); test56(); test57(); test58(); test60(); test61(); test62(); test63(); test64(); test65(); test66(); test67(); test68(); test69(); test70(); test5785(); test72(); test73(); test74(); test75(); test76(); test77(); test78(); test79(); test80(); test81(); test82(); test83(); test3559(); test84(); test85(); test2006(); test8442(); test86(); test87(); test2486(); test5554(); test88(); test7545(); test89(); test90(); test91(); test92(); test4536(); test93(); test94(); test95(); test5403(); test96(); test97(); test98(); test99(); test100(); test101(); test103(); test104(); test105(); test3927(); test107(); test109(); test111(); test113(); test115(); test116(); test117(); test3822(); test6545(); test118(); test5081(); test120(); test10724(); test122(); test123(); test124(); test125(); test3133(); test6763(); test127(); test128(); test1891(); test129(); test130(); test1064(); test131(); test132(); test133(); test134(); test135(); test136(); test137(); test138(); test1962(); test139(); test140(); test141(); test6317(); test142(); test143(); test144(); test145(); test146(); test147(); test6685(); test148(); test149(); test2356(); test11238(); test2540(); test150(); test151(); test152(); test153(); test154(); test155(); test156(); test658(); test4258(); test4539(); test4963(); test4031(); test5437(); test6230(); test6264(); test6284(); test6295(); test6293(); test5046(); test1471(); test6335(); test1687(); test6228(); test3733(); test4392(); test7942(); test6220(); test5799(); test157(); test6473(); test6630(); test6690(); test2953(); test2997(); test4423(); test4647(); test5696(); test6084(); test6488(); test6836(); test6837(); test6927(); test6733(); test6813(); test6859(); test3022(); test6910(); test6902(); test6330(); test6868(); test2856(); test3091(); test6056(); test6356(); test7073(); test7150(); test7160(); test7168(); test7170(); test7196(); test7285(); test7321(); test3282(); test7534(); test7534cov(); test7618(); test7621(); test11417(); test7682(); test7735(); test7823(); test7871(); test7906(); test7907(); test12503(); test8004(); test8064(); test8105(); test159(); test12824(); test8283(); test13182(); test8269(); test8395(); test13427(); test5749(); test8396(); test160(); test8665(); test8108(); test8360(); test9577(); test6141(); test199(); test8526(); test161(); test7175(); test8819(); test8917(); test8945(); test11805(); test163(); test9428(); test9477(); test9538(); test9700(); test9834(); test9883(); test10091(); test9130(); test10542(); test10539(); test10634(); test7254(); test11075(); test11181(); test11317(); test12153(); test12937(); test13154(); test13437(); test13476(); printf("Success\n"); return 0; }
D
/Users/tsu06/Documents/Repos/Stencil/.build/x86_64-apple-macosx10.10/debug/Stencil.build/Inheritence.swift.o : /Users/tsu06/Documents/Repos/Stencil/Sources/Inheritence.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Node.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Include.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Variable.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Template.swift /Users/tsu06/Documents/Repos/Stencil/Sources/IfTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/FilterTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/ForTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/NowTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/KeyPath.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Extension.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Expression.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Loader.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Parser.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Lexer.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Tokenizer.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Filters.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Errors.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Environment.swift /Users/tsu06/Documents/Repos/Stencil/Sources/_SwiftSupport.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Context.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/tsu06/Documents/Repos/Stencil/.build/x86_64-apple-macosx10.10/debug/PathKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/tsu06/Documents/Repos/Stencil/.build/x86_64-apple-macosx10.10/debug/Stencil.build/Inheritence~partial.swiftmodule : /Users/tsu06/Documents/Repos/Stencil/Sources/Inheritence.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Node.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Include.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Variable.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Template.swift /Users/tsu06/Documents/Repos/Stencil/Sources/IfTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/FilterTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/ForTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/NowTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/KeyPath.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Extension.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Expression.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Loader.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Parser.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Lexer.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Tokenizer.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Filters.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Errors.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Environment.swift /Users/tsu06/Documents/Repos/Stencil/Sources/_SwiftSupport.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Context.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/tsu06/Documents/Repos/Stencil/.build/x86_64-apple-macosx10.10/debug/PathKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/tsu06/Documents/Repos/Stencil/.build/x86_64-apple-macosx10.10/debug/Stencil.build/Inheritence~partial.swiftdoc : /Users/tsu06/Documents/Repos/Stencil/Sources/Inheritence.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Node.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Include.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Variable.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Template.swift /Users/tsu06/Documents/Repos/Stencil/Sources/IfTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/FilterTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/ForTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/NowTag.swift /Users/tsu06/Documents/Repos/Stencil/Sources/KeyPath.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Extension.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Expression.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Loader.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Parser.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Lexer.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Tokenizer.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Filters.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Errors.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Environment.swift /Users/tsu06/Documents/Repos/Stencil/Sources/_SwiftSupport.swift /Users/tsu06/Documents/Repos/Stencil/Sources/Context.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/tsu06/Documents/Repos/Stencil/.build/x86_64-apple-macosx10.10/debug/PathKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
instance PAL_6101_RITTER(Npc_Default) { name[0] = NAME_Ritter; guild = GIL_BDT; aivar[AIV_IgnoresFakeGuild] = TRUE; aivar[AIV_IgnoresArmor] = TRUE; id = 6101; voice = 4; flags = 0; npcType = NPCTYPE_PALMORA; aivar[AIV_DropDeadAndKill] = TRUE; B_SetAttributesToChapter(self,6); fight_tactic = FAI_HUMAN_MASTER; EquipItem(self,ItMw_2h_Pal_Sword_Etlu); B_CreateAmbientInv(self); B_SetNpcVisual(self,MALE,"Hum_Head_Fighter",Face_N_Tough_Okyl,BodyTex_N,ITAR_PAL_H_V1_NPC); Mdl_SetModelFatness(self,1.5); Mdl_ApplyOverlayMds(self,"Humans_Militia.mds"); B_GiveNpcTalents(self); B_SetFightSkills(self,100); daily_routine = rtn_start_6101; }; func void rtn_start_6101() { TA_Potion_Alchemy(8,0,16,0,"INSEL_BAUERNHAUS_194"); TA_Sit_Throne(16,0,21,0,"INSEL_BAUERNHAUS_148"); TA_Sleep(21,0,8,0,"INSEL_BAUERNHAUS_195"); };
D
/** * Contains traits for runtime internal usage. * * Copyright: Copyright Digital Mars 2014 -. * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). * Authors: Martin Nowak * Source: $(DRUNTIMESRC core/internal/_traits.d) */ module core.internal.traits; /// taken from std.typetuple.TypeTuple template TypeTuple(TList...) { alias TypeTuple = TList; } alias AliasSeq = TypeTuple; template FieldTypeTuple(T) { static if (is(T == struct) || is(T == union)) alias FieldTypeTuple = typeof(T.tupleof[0 .. $ - __traits(isNested, T)]); else static if (is(T == class)) alias FieldTypeTuple = typeof(T.tupleof); else { alias FieldTypeTuple = TypeTuple!T; } } T trustedCast(T, U)(auto ref U u) @trusted pure nothrow { return cast(T)u; } template Unconst(T) { static if (is(T U == immutable U)) alias Unconst = U; else static if (is(T U == inout const U)) alias Unconst = U; else static if (is(T U == inout U)) alias Unconst = U; else static if (is(T U == const U)) alias Unconst = U; else alias Unconst = T; } /// taken from std.traits.Unqual template Unqual(T) { version (none) // Error: recursive alias declaration @@@BUG1308@@@ { static if (is(T U == const U)) alias Unqual = Unqual!U; else static if (is(T U == immutable U)) alias Unqual = Unqual!U; else static if (is(T U == inout U)) alias Unqual = Unqual!U; else static if (is(T U == shared U)) alias Unqual = Unqual!U; else alias Unqual = T; } else // workaround { static if (is(T U == immutable U)) alias Unqual = U; else static if (is(T U == shared inout const U)) alias Unqual = U; else static if (is(T U == shared inout U)) alias Unqual = U; else static if (is(T U == shared const U)) alias Unqual = U; else static if (is(T U == shared U)) alias Unqual = U; else static if (is(T U == inout const U)) alias Unqual = U; else static if (is(T U == inout U)) alias Unqual = U; else static if (is(T U == const U)) alias Unqual = U; else alias Unqual = T; } } // Substitute all `inout` qualifiers that appears in T to `const` template substInout(T) { static if (is(T == immutable)) { alias substInout = T; } else static if (is(T : shared const U, U) || is(T : const U, U)) { // U is top-unqualified mixin("alias substInout = " ~ (is(T == shared) ? "shared " : "") ~ (is(T == const) || is(T == inout) ? "const " : "") // substitute inout to const ~ "substInoutForm!U;"); } else static assert(0); } private template substInoutForm(T) { static if (is(T == struct) || is(T == class) || is(T == union) || is(T == interface)) { alias substInoutForm = T; // prevent matching to the form of alias-this-ed type } else static if (is(T : V[K], K, V)) alias substInoutForm = substInout!V[substInout!K]; else static if (is(T : U[n], U, size_t n)) alias substInoutForm = substInout!U[n]; else static if (is(T : U[], U)) alias substInoutForm = substInout!U[]; else static if (is(T : U*, U)) alias substInoutForm = substInout!U*; else alias substInoutForm = T; } /// used to declare an extern(D) function that is defined in a different module template externDFunc(string fqn, T:FT*, FT) if (is(FT == function)) { static if (is(FT RT == return) && is(FT Args == function)) { import core.demangle : mangleFunc; enum decl = { string s = "extern(D) RT externDFunc(Args)"; foreach (attr; __traits(getFunctionAttributes, FT)) s ~= " " ~ attr; return s ~ ";"; }(); pragma(mangle, mangleFunc!T(fqn)) mixin(decl); } else static assert(0); } template staticIota(int beg, int end) { static if (beg + 1 >= end) { static if (beg >= end) { alias staticIota = TypeTuple!(); } else { alias staticIota = TypeTuple!(+beg); } } else { enum mid = beg + (end - beg) / 2; alias staticIota = TypeTuple!(staticIota!(beg, mid), staticIota!(mid, end)); } } private struct __InoutWorkaroundStruct {} @property T rvalueOf(T)(inout __InoutWorkaroundStruct = __InoutWorkaroundStruct.init); @property ref T lvalueOf(T)(inout __InoutWorkaroundStruct = __InoutWorkaroundStruct.init); // taken from std.traits.isAssignable template isAssignable(Lhs, Rhs = Lhs) { enum isAssignable = __traits(compiles, lvalueOf!Lhs = rvalueOf!Rhs) && __traits(compiles, lvalueOf!Lhs = lvalueOf!Rhs); } // taken from std.traits.isInnerClass template isInnerClass(T) if (is(T == class)) { static if (is(typeof(T.outer))) { template hasOuterMember(T...) { static if (T.length == 0) enum hasOuterMember = false; else enum hasOuterMember = T[0] == "outer" || hasOuterMember!(T[1 .. $]); } enum isInnerClass = __traits(isSame, typeof(T.outer), __traits(parent, T)) && !hasOuterMember!(__traits(allMembers, T)); } else enum isInnerClass = false; } template dtorIsNothrow(T) { enum dtorIsNothrow = is(typeof(function{T t=void;}) : void function() nothrow); } // taken from std.meta.allSatisfy template allSatisfy(alias F, T...) { static foreach (Ti; T) { static if (!is(typeof(allSatisfy) == bool) && // not yet defined !F!(Ti)) { enum allSatisfy = false; } } static if (!is(typeof(allSatisfy) == bool)) // if not yet defined { enum allSatisfy = true; } } // taken from std.meta.anySatisfy template anySatisfy(alias F, T...) { static foreach (Ti; T) { static if (!is(typeof(anySatisfy) == bool) && // not yet defined F!(Ti)) { enum anySatisfy = true; } } static if (!is(typeof(anySatisfy) == bool)) // if not yet defined { enum anySatisfy = false; } } // simplified from std.traits.maxAlignment template maxAlignment(U...) { static if (U.length == 0) static assert(0); else static if (U.length == 1) enum maxAlignment = U[0].alignof; else static if (U.length == 2) enum maxAlignment = U[0].alignof > U[1].alignof ? U[0].alignof : U[1].alignof; else { enum a = maxAlignment!(U[0 .. ($+1)/2]); enum b = maxAlignment!(U[($+1)/2 .. $]); enum maxAlignment = a > b ? a : b; } } // std.traits.Fields template Fields(T) { static if (is(T == struct) || is(T == union)) alias Fields = typeof(T.tupleof[0 .. $ - __traits(isNested, T)]); else static if (is(T == class)) alias Fields = typeof(T.tupleof); else alias Fields = TypeTuple!T; } // std.traits.hasElaborateDestructor template hasElaborateDestructor(S) { static if (__traits(isStaticArray, S) && S.length) { enum bool hasElaborateDestructor = hasElaborateDestructor!(typeof(S.init[0])); } else static if (is(S == struct)) { enum hasElaborateDestructor = __traits(hasMember, S, "__dtor") || anySatisfy!(.hasElaborateDestructor, Fields!S); } else { enum bool hasElaborateDestructor = false; } } // std.traits.hasElaborateCopyDestructor template hasElaborateCopyConstructor(S) { static if (__traits(isStaticArray, S) && S.length) { enum bool hasElaborateCopyConstructor = hasElaborateCopyConstructor!(typeof(S.init[0])); } else static if (is(S == struct)) { enum hasElaborateCopyConstructor = __traits(hasMember, S, "__xpostblit"); } else { enum bool hasElaborateCopyConstructor = false; } } template hasElaborateAssign(S) { static if (__traits(isStaticArray, S) && S.length) { enum bool hasElaborateAssign = hasElaborateAssign!(typeof(S.init[0])); } else static if (is(S == struct)) { enum hasElaborateAssign = is(typeof(S.init.opAssign(rvalueOf!S))) || is(typeof(S.init.opAssign(lvalueOf!S))) || anySatisfy!(.hasElaborateAssign, FieldTypeTuple!S); } else { enum bool hasElaborateAssign = false; } } // std.meta.Filter template Filter(alias pred, TList...) { static if (TList.length == 0) { alias Filter = TypeTuple!(); } else static if (TList.length == 1) { static if (pred!(TList[0])) alias Filter = TypeTuple!(TList[0]); else alias Filter = TypeTuple!(); } else { alias Filter = TypeTuple!( Filter!(pred, TList[ 0 .. $/2]), Filter!(pred, TList[$/2 .. $ ])); } } // std.meta.staticMap template staticMap(alias F, T...) { static if (T.length == 0) { alias staticMap = TypeTuple!(); } else static if (T.length == 1) { alias staticMap = TypeTuple!(F!(T[0])); } else { alias staticMap = TypeTuple!( staticMap!(F, T[ 0 .. $/2]), staticMap!(F, T[$/2 .. $ ])); } } // std.exception.assertCTFEable version (unittest) package(core) void assertCTFEable(alias dg)() { static assert({ cast(void) dg(); return true; }()); cast(void) dg(); }
D
/Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/DerivedData/CollectionViewTESST/Build/Intermediates/CollectionViewTESST.build/Debug-iphonesimulator/CollectionViewTESST.build/Objects-normal/i386/AppDelegate.o : /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/AppDelegate.swift /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/ChatRoom.swift /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/ChatCell.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/DerivedData/CollectionViewTESST/Build/Intermediates/CollectionViewTESST.build/Debug-iphonesimulator/CollectionViewTESST.build/Objects-normal/i386/AppDelegate~partial.swiftmodule : /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/AppDelegate.swift /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/ChatRoom.swift /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/ChatCell.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/DerivedData/CollectionViewTESST/Build/Intermediates/CollectionViewTESST.build/Debug-iphonesimulator/CollectionViewTESST.build/Objects-normal/i386/AppDelegate~partial.swiftdoc : /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/AppDelegate.swift /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/ChatRoom.swift /Users/Mrbochiballs1/MakeSchool/CollectionViewTESST/CollectionViewTESST/ChatCell.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule
D
INSTANCE Mod_941_PIR_Angus_AW (Npc_Default) { // ------ NSC ------ name = "Angus"; guild = GIL_NONE; id = 941; voice = 0; flags = FALSE; npctype = NPCTYPE_MAIN; // ------ Attribute ------ B_SetAttributesToChapter (self, 2); // ------ Kampf-Taktik ------ fight_tactic = FAI_HUMAN_NORMAL; // ------ Equippte Waffen ------ EquipItem (self, ItMw_Addon_PIR2hAxe); // ------ Inventory ------ CreateInvItems (self, ItRi_Addon_MorgansRing_Mission, 1); // ------ visuals ------ B_SetNpcVisual (self, MALE, "Hum_Head_FatBald", Face_N_NormalBart21, BodyTex_N, ITAR_PIR_M_Addon); Mdl_SetModelFatness (self, 1.3); Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds"); // ------ NSC-relevante Talente vergeben ------ B_GiveNpcTalents (self); // ------ Kampf-Talente ------ B_SetFightSkills (self,30); // ------ TA anmelden ------ daily_routine = Rtn_Belagert_941; }; FUNC VOID Rtn_Start_941 () { TA_Stand_Guarding (05,00,20,00,"ADW_PIRATECAMP_TOWER_01"); TA_Sleep (20,00,05,00,"ADW_PIRATECAMP_TOWER_BED"); }; FUNC VOID Rtn_Belagert_941 () { TA_Smalltalk_Piraten2 (08,00,20,00,"ADW_PIRATECAMP_CENTER"); TA_Sit_Campfire (20,00,08,00,"WP_PIR_04"); }; FUNC VOID Rtn_Saw_941 () { TA_Saw (05,00,20,00,"ADW_PIRATECAMP_BEACH_19"); TA_Saw (20,00,05,00,"ADW_PIRATECAMP_BEACH_19"); }; FUNC VOID Rtn_Sammeln_941 () { TA_Stand_WP (08,00,20,00,"ADW_PIRATECAMP_WAY_02"); TA_Stand_WP (20,00,08,00,"ADW_PIRATECAMP_WAY_02"); }; FUNC VOID Rtn_Artefakt_941 () { TA_RunToWP (08,00,20,00,"ADW_PIRATECAMP_WAY_06"); TA_RunToWP (20,00,08,00,"ADW_PIRATECAMP_WAY_06"); }; FUNC VOID Rtn_Beerdigung_941 () { TA_Stand_ArmsCrossed (08,00,20,00,"ADW_PIRATECAMP_BEACH_13"); TA_Stand_ArmsCrossed (20,00,08,00,"ADW_PIRATECAMP_BEACH_13"); }; FUNC VOID Rtn_Tot_941 () { TA_Stand_Guarding (05,00,20,00,"TOT"); TA_Stand_Guarding (20,00,05,00,"TOT"); };
D
//********************* // Zombie Prototype //********************* PROTOTYPE Mst_Default_SwampZombie(C_Npc) { //----- Monster ---- name = "Moorleiche"; guild = GIL_ZOMBIE; aivar[AIV_MM_REAL_ID] = ID_ZOMBIE; level = 6; //----- Attribute ---- attribute [ATR_STRENGTH] = Hlp_Random(51) + 100; // 100 - 150 attribute [ATR_DEXTERITY] = Hlp_Random(21); // 0 - 20 attribute [ATR_HITPOINTS_MAX] = Hlp_Random(101) + 200; // 200 - 300 attribute [ATR_HITPOINTS] = attribute[ATR_HITPOINTS_MAX]; attribute [ATR_MANA_MAX] = 0; attribute [ATR_MANA] = 0; //----- Protection ---- protection [PROT_BLUNT] = Hlp_Random(51)*1000 + 50000; // 50 - 100 protection [PROT_EDGE] = Hlp_Random(51)*1000 + 50000; // 50 - 100 protection [PROT_POINT] = Hlp_Random(51)*1000 + 50000; // 50 - 100 protection [PROT_FIRE] = Hlp_Random(51) + 50; // 50 - 100 protection [PROT_FLY] = 75; protection [PROT_MAGIC] = Hlp_Random(31) + 15; // 15 - 45 self.aivar[AIV_Damage] = self.attribute[ATR_HITPOINTS_MAX]; //----- Damage Type ---- damagetype = DAM_EDGE; // damage [DAM_INDEX_BLUNT] = 0; // damage [DAM_INDEX_EDGE] = 0; // damage [DAM_INDEX_POINT] = 0; // damage [DAM_INDEX_FIRE] = 0; // damage [DAM_INDEX_FLY] = 0; // damage [DAM_INDEX_MAGIC] = 0; //----- Kampf Taktik ---- fight_tactic = FAI_ZOMBIE; //----- Senses & Ranges ---- senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL; senses_range = PERC_DIST_MONSTER_ACTIVE_MAX; aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM; aivar[AIV_MM_FollowInWater] = FALSE; //----- Daily Routine ---- start_aistate = ZS_MM_AllScheduler; aivar[AIV_MM_RestStart] = OnlyRoutine; CreateInvItems (self, ItFoMuttonZombie, 1); }; //************* // Visuals //************* //------------------------------------------------------------- // Zwei Hautfarben mit jeweils zwei Gesichtstexturen //------------------------------------------------------------- func void B_SetVisuals_SwampZombie() { var int rnd; rnd = Hlp_Random(2); var int rnd2; rnd2 = Hlp_Random(2) + 2*rnd; Mdl_SetVisual (self, "SwampZombie.mds"); // Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR Mdl_SetVisualBody (self, "Zom_Body", 1, rnd, "Zom_Head", 5+rnd2, DEFAULT, -1); }; func void B_SetVisuals_SwampZombie2() { var int rnd; rnd = Hlp_Random(2); var int rnd2; rnd2 = Hlp_Random(2) + 2*rnd; Mdl_SetVisual (self, "SwampZombie.mds"); // Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR Mdl_SetVisualBody (self, "Zom_Body", 1, rnd, "Zom_Head", 5+rnd2, DEFAULT, ItAr_Hum_Dht2S_Armor); }; //*********** // Zombie01 //*********** INSTANCE SwampZombie (Mst_Default_SwampZombie) { B_SetVisuals_SwampZombie(); Npc_SetToFistMode(self); }; INSTANCE SwampZombie_Moor (Mst_Default_SwampZombie) { B_SetVisuals_SwampZombie(); Npc_SetToFistMode(self); }; INSTANCE SwampZombie_Moor2 (Mst_Default_SwampZombie) { B_SetVisuals_SwampZombie2(); Npc_SetToFistMode(self); };
D
/home/martogod/RustProgramms/QuestGiverRustGame/target/debug/deps/glob-918b5d1fb8a81879.rmeta: /home/martogod/.cargo/registry/src/github.com-1ecc6299db9ec823/glob-0.3.0/src/lib.rs /home/martogod/RustProgramms/QuestGiverRustGame/target/debug/deps/libglob-918b5d1fb8a81879.rlib: /home/martogod/.cargo/registry/src/github.com-1ecc6299db9ec823/glob-0.3.0/src/lib.rs /home/martogod/RustProgramms/QuestGiverRustGame/target/debug/deps/glob-918b5d1fb8a81879.d: /home/martogod/.cargo/registry/src/github.com-1ecc6299db9ec823/glob-0.3.0/src/lib.rs /home/martogod/.cargo/registry/src/github.com-1ecc6299db9ec823/glob-0.3.0/src/lib.rs:
D
module gamemath; import core.stdc.math: powf, sqrtf, fabs; import std.math; import std.range; import std.typecons; import bindbc.sdl; import dvector; import globals; @nogc nothrow: auto roundPoint(Point p, int N) pure { p.x = cast(int)(round(float(p.x)/float(N))*N); p.y = cast(int)(round(float(p.y)/float(N))*N); return p; } import std.algorithm: min, max; bool isPointInSegment(Point r, Point p, Point q) pure { return q.x <= max(p.x, r.x) && q.x >= min(p.x, r.x) && q.y <= max(p.y, r.y) && q.y >= min(p.y, r.y); } bool isPointOntheRail(R)(ref R rail, Point point) pure { if(rail.length){ for(int i = 0; i < rail.length-1; i++){ if(isPointInSegment(rail[i], rail[i+1], point)){ return true; } } if(isPointInSegment(rail[rail.length-1], rail[0], point)){ return true; } } return false; } bool isPointInPolygon(R)(Point point, ref R polygon) pure { auto prev = polygon.back; bool oddNodes = false; foreach (i; 0..polygon.length){ auto cur = polygon[i]; if (isPointInSegment(prev, cur, point)) return false; if (cur.y < point.y && prev.y >= point.y || prev.y < point.y && cur.y >= point.y) { if (cur.x + (point.y - cur.y) / (prev.y - cur.y) * (prev.x - cur.x) < point.x) { oddNodes = !oddNodes; } } prev = cur; } return oddNodes; } bool isPointOntheTrace(R)(ref R Rail, Point point) pure { if(!Rail.length) return false; bool res = false; for(size_t i=0; i<Rail.length-1; i++) if(isPointInSegment(Rail[i], Rail[i+1], point)) res = true; return res; } int belongWhichSegment(R)(ref R Rail, Point point) pure { for(size_t i=0; i<Rail.length-1; i++){ if(isPointInSegment(Rail[i], Rail[i+1], point)){ return cast(int)i; } } if(isPointInSegment(Rail[Rail.length-1], Rail[0], point)){ return cast(int)Rail.length-1; } return -1; } float polygonArea(R)(ref R vertices) pure { float area = 0; for (size_t i = 0; i < vertices.length; i++) { auto j = (i + 1) % vertices.length; area += float(vertices[i].x * vertices[j].y); area -= float(vertices[j].x * vertices[i].y); } return area / 2.0f; } bool is_clockwise(R)(ref R vertices) pure { return polygonArea(vertices) > 0; } void removeDuplicateVertices(R)(ref R Rail, ref R vertices) pure { // very stupid Dvector!size_t to_be_removed; for (size_t i=0; i<vertices.length; i++){ for (size_t ri=0; ri<Rail.length; ri++){ if(Rail[ri].x == vertices[i].x && Rail[ri].y == vertices[i].y){ to_be_removed.pushBack(ri); } } } if (to_be_removed.length > 0){ for (size_t i = to_be_removed.length -1; i >= 0; i--) Rail.remove(to_be_removed[i], 1); } to_be_removed.free; } bool inPoly(P, R)(P point, ref R Rail){ foreach(ref rp; Rail){ if(rp.x == point.x && rp.y == point.y) return true; } return false; } float dist(P)(P start, P end) { return sqrtf(powf(start.x - end.x, 2) + powf(start.y - end.y, 2)); } bool isEnemyOnTheTrace(const Circle c, ref Dvector!(Tuple!(Point, Point)) lines) { foreach(i; 0..lines.length){ immutable l1 = lines[i][0]; immutable l2 = lines[i][1]; immutable ret = islineCircleCollision( cast(float)l1.x, cast(float)l1.y, cast(float)l2.x, cast(float)l2.y, cast(float)c.pos.x, cast(float)c.pos.y, cast(float)c.radius); if(ret) return true; } return false; } private { bool islineCircleCollision(in float x1, in float y1, in float x2, in float y2, in float cx, in float cy, in float r) { bool inside1 = pointCircle(x1,y1, cx,cy,r); bool inside2 = pointCircle(x2,y2, cx,cy,r); if (inside1 || inside2) return true; float distX = x1 - x2; float distY = y1 - y2; float len = sqrtf( (distX*distX) + (distY*distY) ); float dot = ( ((cx-x1)*(x2-x1)) + ((cy-y1)*(y2-y1)) ) / (len*len); float closestX = x1 + (dot * (x2-x1)); float closestY = y1 + (dot * (y2-y1)); bool onSegment = linePoint(x1, y1, x2, y2, closestX, closestY); if (!onSegment) return false; distX = closestX - cx; distY = closestY - cy; float distance = sqrtf( (distX*distX) + (distY*distY) ); if (distance <= r) return true; return false; } bool pointCircle(in float px, in float py, in float cx, in float cy, in float r) { float distX = px - cx; float distY = py - cy; float distance = sqrtf( (distX*distX) + (distY*distY) ); if (distance <= r) return true; return false; } bool linePoint(in float x1, in float y1, in float x2, in float y2, in float px, in float py) { float d1 = sqrtf(cast(float)(powf(px-x1, 2) + powf(py-y1, 2))); float d2 = sqrtf(cast(float)(powf(px-x2, 2) + powf(py-y2, 2))); float lineLen = sqrtf(cast(float)(powf(x1-x2, 2) + powf(y1-y2, 2))); float buffer = 0.1; if (d1 + d2 >= lineLen-buffer && d1+d2 <= lineLen + buffer) return true; return false; } } bool collides(Circle circle1, Circle circle2) { const dx = circle1.pos.x - circle2.pos.x; const dy = circle1.pos.y - circle2.pos.y; const distance = sqrtf(cast(float)(dx * dx + dy * dy)); if(distance < circle1.radius + circle2.radius) return true; return false; }
D
# FIXED PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/profiles/roles/gapbondmgr.c PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/bcomdef.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/comdef.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdbool.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/inc/hal_defs.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/limits.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal_memory.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal_timers.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/icall/src/inc/icall.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdlib.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/linkage.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/inc/hal_assert.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal_snv.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/l2cap.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/sm.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/hci.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/controller/cc26xx_r2/inc/ll_common.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/drivers/rf/RF.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/drivers/dpl/ClockP.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stddef.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/drivers/dpl/SemaphoreP.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stddef.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/DeviceFamily.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_common_cmd.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_mailbox.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/string.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_prop_cmd.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_ble_cmd.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/cc26xx/rf_hal.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/controller/cc26xx_r2/inc/ll.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/controller/cc26xx_r2/inc/ll_scheduler.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/linkdb.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gatt.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/att.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gatt_uuid.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gattservapp.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gapgattserver.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/profiles/roles/gapbondmgr.h PROFILES/gapbondmgr.obj: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gap.h C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/profiles/roles/gapbondmgr.c: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/bcomdef.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/comdef.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdbool.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/inc/hal_defs.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/limits.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal_memory.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal_timers.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/icall/src/inc/icall.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdlib.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/linkage.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/inc/hal_assert.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/osal/src/inc/osal_snv.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/l2cap.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/sm.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/hci.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/controller/cc26xx_r2/inc/ll_common.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/drivers/rf/RF.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/drivers/dpl/ClockP.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stddef.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/drivers/dpl/SemaphoreP.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stddef.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/DeviceFamily.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_common_cmd.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_mailbox.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/string.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_prop_cmd.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/devices/cc26x0r2/driverlib/rf_ble_cmd.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/cc26xx/rf_hal.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/hal/src/target/_common/hal_types.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/controller/cc26xx_r2/inc/ll.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/controller/cc26xx_r2/inc/ll_scheduler.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/linkdb.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gatt.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/att.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gatt_uuid.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gattservapp.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gapgattserver.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/profiles/roles/gapbondmgr.h: C:/ti/simplelink_cc2640r2_sdk_1_50_00_58/source/ti/blestack/inc/gap.h:
D
module appbase.security.token; import core.thread; import std.bitmanip; import std.exception : enforce; import std.datetime; import std.concurrency; import std.base64; import crypto.rsa; import appbase.utils.utility; class Token { static ubyte[] generate(ulong userId, RSAKeyInfo publicKey) { ubyte[] token = new ubyte[ulong.sizeof + long.sizeof]; token.write!ulong(userId, 0); long ticks = currTimeTick(); token.write!long(ticks, ulong.sizeof); token ~= strToByte_hex(MD5(token)[0 .. 4]); token = RSA.encrypt(publicKey, token); insertCache(userId, token, ticks); return token; } static bool check(ulong userId, string token, RSAKeyInfo privateKey, const int tokenExpire) { scope(failure) { return false; } if (!cleanTaskRunning) { synchronized(Token.classinfo) { if (!cleanTaskRunning) { spawn(&cleanTask, tokenExpire); cleanTaskRunning = true; } } } ubyte[] _token = Base64.decode(token); if ((userId in pool) && (pool[userId].token == _token)) { return true; } ubyte[] data = RSA.decrypt(privateKey, _token); if (data.length < ulong.sizeof + long.sizeof + 2) { return false; } if (strToByte_hex(MD5(data[0 .. $ - 2])[0 .. 4]) != data[$ - 2 .. $]) { return false; } ulong _id = data.peek!ulong(0); if (_id != userId) { return false; } long ticks = data.peek!long(ulong.sizeof); if ((Clock.currTime() - currTimeFromTick(ticks)).total!"minutes" > tokenExpire) { return false; } insertCache(userId, _token, ticks); return true; } static string getTokenInPool(ulong userId) { if (userId !in pool) { return string.init; } return Base64.encode(pool[userId].token); } private: static void insertCache(ulong userId, in ubyte[] token, long ticks) { CacheTokenData cache; cache.token = token.dup; cache.ticks = ticks; pool[userId] = cache; } package: __gshared static CacheTokenData[ulong] pool; __gshared static bool cleanTaskRunning = false; } private: struct CacheTokenData { ubyte[] token; long ticks; } void cleanTask(const int tokenExpire) { while (true) { Thread.sleep(1.hours); synchronized(Token.classinfo) { foreach(userId, data; Token.pool) { if ((Clock.currTime() - currTimeFromTick(data.ticks)).total!"minutes" > tokenExpire) { Token.pool.remove(userId); } } } } }
D
/** * Enumerations * * Copyright: * (C) 1999-2007 Jack Lloyd * (C) 2014-2015 Etienne Cimon * * License: * Botan is released under the Simplified BSD License (see LICENSE.md) */ module botan.cert.x509.key_constraint; import botan.constants; //static if (BOTAN_HAS_X509_CERTIFICATES): import botan.asn1.ber_dec; import botan.pubkey.x509_key; import botan.pubkey.pk_keys; import botan.asn1.ber_dec; /** * X.509v3 Key Constraints. */ enum KeyConstraints { NO_CONSTRAINTS = 0, DIGITAL_SIGNATURE = 32768, NON_REPUDIATION = 16384, KEY_ENCIPHERMENT = 8192, DATA_ENCIPHERMENT = 4096, KEY_AGREEMENT = 2048, KEY_CERT_SIGN = 1024, CRL_SIGN = 512, ENCIPHER_ONLY = 256, DECIPHER_ONLY = 128 } /** * Create the key constraints for a specific public key. * Params: * pub_key = the public key from which the basic set of * constraints to be placed in the return value is derived * limits = additional limits that will be incorporated into the * return value * Returns: combination of key type specific constraints and * additional limits */ KeyConstraints findConstraints(in PublicKey pub_key, KeyConstraints limits) { const string name = pub_key.algoName; KeyConstraints constraints; if (name == "DH" || name == "ECDH") constraints |= KeyConstraints.KEY_AGREEMENT; if (name == "RSA" || name == "ElGamal") constraints |= KeyConstraints.KEY_ENCIPHERMENT | KeyConstraints.DATA_ENCIPHERMENT; if (name == "RSA" || name == "RW" || name == "NR" || name == "DSA" || name == "ECDSA") constraints |= KeyConstraints.DIGITAL_SIGNATURE | KeyConstraints.NON_REPUDIATION; if (limits) constraints &= limits; return constraints; } /* * Decode a BER encoded KeyUsage */ void decode(BERDecoder source, ref KeyConstraints key_usage) { BERObject obj = source.getNextObject(); if (obj.type_tag != ASN1Tag.BIT_STRING || obj.class_tag != ASN1Tag.UNIVERSAL) throw new BERBadTag("Bad tag for usage constraint", obj.type_tag, obj.class_tag); if (obj.value.length != 2 && obj.value.length != 3) throw new BERDecodingError("Bad size for BITSTRING in usage constraint"); if (obj.value[0] >= 8) throw new BERDecodingError("Invalid unused bits in usage constraint"); const ubyte mask = cast(const ubyte)(0xFF << obj.value[0]); obj.value[obj.value.length-1] &= mask; KeyConstraints usage; for (size_t j = 1; j != obj.value.length; ++j) usage |= cast(KeyConstraints)(obj.value[j] << 8); key_usage = usage; }
D
module spasm.bindings.domhighrestimestamp; import spasm.types; alias DOMHighResTimeStamp = double;
D
/* Written by Walter Bright * www.digitalmars.com * Placed into Public Domain */ /* NOTE: This file has been patched from the original DMD distribution to work with the GDC compiler. Modified by David Friedman, September 2004 */ // Information about the target operating system, environment, and CPU module std.system; const { // Operating system family enum Family { Win32 = 1, // Microsoft 32 bit Windows systems linux, // all linux systems Unix, // all other } version (Win32) { Family family = Family.Win32; } else version (linux) { Family family = Family.linux; } else version (Unix) { Family family = Family.Unix; } else { static assert(0); } // More specific operating system name enum OS { Windows95 = 1, Windows98, WindowsNT, Windows2000, RedHatLinux, } // Big-endian or Little-endian? enum Endian { BigEndian, LittleEndian } version(LittleEndian) { Endian endian = Endian.LittleEndian; } else { Endian endian = Endian.BigEndian; } } // The rest should get filled in dynamically at runtime OS os = OS.WindowsNT; // Operating system version as in // os_major.os_minor uint os_major = 4; uint os_minor = 0; // processor: i386
D
module dpq2.conv.to_d_types; @safe: import dpq2; import dpq2.conv.numeric: rawValueToNumeric; import dpq2.conv.time: binaryValueAs, TimeStampWithoutTZ; import dpq2.exception; import vibe.data.json: Json, parseJsonString; import vibe.data.bson: Bson; import std.traits; import std.uuid; import std.datetime; import std.traits: isScalarType; import std.bitmanip: bigEndianToNative; import std.conv: to; // Supported PostgreSQL binary types alias PGboolean = bool; /// boolean alias PGsmallint = short; /// smallint alias PGinteger = int; /// integer alias PGbigint = long; /// bigint alias PGreal = float; /// real alias PGdouble_precision = double; /// double precision alias PGtext = string; /// text alias PGnumeric = string; /// numeric represented as string alias PGbytea = const ubyte[]; /// bytea alias PGuuid = UUID; /// UUID alias PGdate = Date; /// Date (no time of day) alias PGtime_without_time_zone = TimeOfDay; /// Time of day (no date) alias PGtimestamp_without_time_zone = TimeStampWithoutTZ; /// Both date and time (no time zone) alias PGjson = Json; /// json or jsonb package void throwTypeComplaint(OidType receivedType, string expectedType, string file, size_t line) pure { throw new AnswerConvException( ConvExceptionType.NOT_IMPLEMENTED, "Format of the column ("~to!string(receivedType)~") doesn't match to D native "~expectedType, file, line ); } private alias VF = ValueFormat; private alias AE = AnswerConvException; private alias ET = ConvExceptionType; /// Returns cell value as native string type from text or binary formatted field @property string as(T)(in Value v) pure @trusted if(is(T == string)) { if(v.format == VF.BINARY) { if(!( v.oidType == OidType.Text || v.oidType == OidType.FixedString || v.oidType == OidType.Numeric || v.oidType == OidType.Json )) throwTypeComplaint(v.oidType, "Text, FixedString, Numeric or Json", __FILE__, __LINE__); if(v.oidType == OidType.Numeric) return rawValueToNumeric(v.data); } return valueAsString(v); } /// Returns value as D type value from binary formatted field @property T as(T)(in Value v) if(!is(T == string) && !is(T == Bson)) { if(!(v.format == VF.BINARY)) throw new AE(ET.NOT_BINARY, msg_NOT_BINARY, __FILE__, __LINE__); return binaryValueAs!T(v); } package: @property string valueAsString(in Value v) pure { return (cast(const(char[])) v.data).to!string; } /// Returns value as bytes from binary formatted field @property T binaryValueAs(T)(in Value v) if( is( T == const(ubyte[]) ) ) { if(!(v.oidType == OidType.ByteArray)) throwTypeComplaint(v.oidType, "ubyte[] or string", __FILE__, __LINE__); return v.data; } /// Returns cell value as native integer or decimal values /// /// Postgres type "numeric" is oversized and not supported by now @property T binaryValueAs(T)(in Value v) if( isNumeric!(T) ) { static if(isIntegral!(T)) if(!isNativeInteger(v.oidType)) throwTypeComplaint(v.oidType, "integral types", __FILE__, __LINE__); static if(isFloatingPoint!(T)) if(!isNativeFloat(v.oidType)) throwTypeComplaint(v.oidType, "floating point types", __FILE__, __LINE__); if(!(v.data.length == T.sizeof)) throw new AE(ET.SIZE_MISMATCH, to!string(v.oidType)~" length ("~to!string(v.data.length)~") isn't equal to native D type "~ to!string(typeid(T))~" size ("~to!string(T.sizeof)~")", __FILE__, __LINE__); ubyte[T.sizeof] s = v.data[0..T.sizeof]; return bigEndianToNative!(T)(s); } /// Returns UUID as native UUID value @property UUID binaryValueAs(T)(in Value v) if( is( T == UUID ) ) { if(!(v.oidType == OidType.UUID)) throwTypeComplaint(v.oidType, "UUID", __FILE__, __LINE__); if(!(v.data.length == 16)) throw new AE(ET.SIZE_MISMATCH, "Value length isn't equal to Postgres UUID size", __FILE__, __LINE__); UUID r; r.data = v.data; return r; } /// Returns boolean as native bool value @property bool binaryValueAs(T : bool)(in Value v) { if(!(v.oidType == OidType.Bool)) throwTypeComplaint(v.oidType, "bool", __FILE__, __LINE__); if(!(v.data.length == 1)) throw new AE(ET.SIZE_MISMATCH, "Value length isn't equal to Postgres boolean size", __FILE__, __LINE__); return v.data[0] != 0; } /// Returns Vibe.d's Json @property Json binaryValueAs(T)(in Value v) @trusted if( is( T == Json ) ) { Json res; switch(v.oidType) { case OidType.Json: // represent value as text and parse it into Json string t = v.valueAsString; res = parseJsonString(t); break; case OidType.Jsonb: assert(false, "Is not implemented"); //break; default: throwTypeComplaint(v.oidType, "json or jsonb", __FILE__, __LINE__); } return res; } public void _integration_test( string connParam ) @system { auto conn = new Connection(connParam); QueryParams params; params.resultFormat = ValueFormat.BINARY; { void testIt(T)(T nativeValue, string pgType, string pgValue) { params.sqlCommand = "SELECT "~pgValue~"::"~pgType~" as d_type_test_value"; auto answer = conn.execParams(params); immutable Value v = answer[0][0]; auto result = v.as!T; assert(result == nativeValue, "Received unexpected value\nreceived pgType="~to!string(v.oidType)~"\nexpected nativeType="~to!string(typeid(T))~ "\nsent pgValue="~pgValue~"\nexpected nativeValue="~to!string(nativeValue)~"\nresult="~to!string(result)); } alias C = testIt; // "C" means "case" C!PGboolean(true, "boolean", "true"); C!PGboolean(false, "boolean", "false"); C!PGsmallint(-32_761, "smallint", "-32761"); C!PGinteger(-2_147_483_646, "integer", "-2147483646"); C!PGbigint(-9_223_372_036_854_775_806, "bigint", "-9223372036854775806"); C!PGreal(-12.3456f, "real", "-12.3456"); C!PGdouble_precision(-1234.56789012345, "double precision", "-1234.56789012345"); C!PGtext("first line\nsecond line", "text", "'first line\nsecond line'"); C!PGtext("12345 ", "char(6)", "'12345'"); C!PGbytea([0x44, 0x20, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x00, 0x21], "bytea", r"E'\\x44 20 72 75 6c 65 73 00 21'"); // "D rules\x00!" (ASCII) C!PGuuid(UUID("8b9ab33a-96e9-499b-9c36-aad1fe86d640"), "uuid", "'8b9ab33a-96e9-499b-9c36-aad1fe86d640'"); // numeric testing C!PGnumeric("NaN", "numeric", "'NaN'"); const string[] numericTests = [ "42", "-42", "0", "0.0146328", "0.0007", "0.007", "0.07", "0.7", "7", "70", "700", "7000", "70000", "7.0", "70.0", "700.0", "7000.0", "70000.000", "2354877787627192443", "2354877787627192443.0", "2354877787627192443.00000", "-2354877787627192443.00000" ]; foreach(i, s; numericTests) C!PGnumeric(s, "numeric", s); // date and time testing C!PGdate(Date(2016, 01, 8), "date", "'January 8, 2016'"); C!PGtime_without_time_zone(TimeOfDay(12, 34, 56), "time without time zone", "'12:34:56'"); C!PGtimestamp_without_time_zone(TimeStampWithoutTZ(DateTime(1997, 12, 17, 7, 37, 16), FracSec.from!"usecs"(12)), "timestamp without time zone", "'1997-12-17 07:37:16.000012'"); C!PGtimestamp_without_time_zone(TimeStampWithoutTZ.max, "timestamp without time zone", "'infinity'"); C!PGtimestamp_without_time_zone(TimeStampWithoutTZ.min, "timestamp without time zone", "'-infinity'"); // json C!PGjson(Json(["float_value": Json(123.456), "text_str": Json("text string")]), "json", "'{\"float_value\": 123.456,\"text_str\": \"text string\"}'"); // json as string C!string("{\"float_value\": 123.456}", "json", "'{\"float_value\": 123.456}'"); // jsonb //C!PGjson(Json(["integer": Json(123), "float": Json(123.456), "text_string": Json("This is a text string")]), "jsonb", //"'{\"integer\": 123, \"float\": 123.456,\"text_string\": \"This is a text string\"}'"); } }
D
var int Lucia_ItemsGiven_Chapter_1; var int Lucia_ItemsGiven_Chapter_2; var int Lucia_ItemsGiven_Chapter_3; var int Lucia_ItemsGiven_Chapter_4; var int Lucia_ItemsGiven_Chapter_5; func void B_GiveTradeInv_Addon_Lucia(var C_Npc slf) { if((Kapitel >= 1) && (Lucia_ItemsGiven_Chapter_1 == FALSE)) { CreateInvItems(slf,ItFo_Booze,5); CreateInvItems(slf,ItFo_Addon_Rum,10); CreateInvItems(slf,ItFo_Addon_Grog,10); CreateInvItems(slf,ItMi_Flask,20); CreateInvItems(slf,itmi_textile,3); CreateInvItems(slf,itmi_amethyst,1); CreateInvItems(slf,ItRi_Dex_02,1); Lucia_ItemsGiven_Chapter_1 = TRUE; }; if((Kapitel >= 2) && (Lucia_ItemsGiven_Chapter_2 == FALSE)) { CreateInvItems(slf,ItFo_Booze,10); CreateInvItems(slf,ItFo_Addon_Rum,10); CreateInvItems(slf,ItFo_Addon_Grog,10); CreateInvItems(slf,ItFo_Beer,4); CreateInvItems(slf,ItMi_Flask,20); CreateInvItems(slf,itmi_textile,1); Lucia_ItemsGiven_Chapter_2 = TRUE; }; if((Kapitel >= 3) && (Lucia_ItemsGiven_Chapter_3 == FALSE)) { CreateInvItems(slf,ItFo_Booze,10); CreateInvItems(slf,ItFo_Addon_Rum,10); CreateInvItems(slf,ItFo_Addon_Grog,10); CreateInvItems(slf,ItFo_Beer,4); CreateInvItems(slf,ItMi_Flask,10); CreateInvItems(slf,itmi_textile,3); Lucia_ItemsGiven_Chapter_3 = TRUE; }; if((Kapitel >= 4) && (Lucia_ItemsGiven_Chapter_4 == FALSE)) { CreateInvItems(slf,ItFo_Booze,10); CreateInvItems(slf,ItFo_Addon_Rum,10); CreateInvItems(slf,ItFo_Addon_Grog,10); CreateInvItems(slf,ItFo_Beer,4); CreateInvItems(slf,ItMi_Flask,10); CreateInvItems(slf,itmi_textile,4); Lucia_ItemsGiven_Chapter_4 = TRUE; }; if((Kapitel >= 5) && (Lucia_ItemsGiven_Chapter_5 == FALSE)) { CreateInvItems(slf,ItFo_Booze,10); CreateInvItems(slf,ItFo_Addon_Rum,10); CreateInvItems(slf,ItFo_Addon_Grog,10); CreateInvItems(slf,ItFo_Beer,4); CreateInvItems(slf,ItMi_Flask,10); Lucia_ItemsGiven_Chapter_5 = TRUE; }; };
D
/** * The condition module provides a primitive for synchronized condition * checking. * * Copyright: Copyright Sean Kelly 2005 - 2009. * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Authors: Sean Kelly * Source: $(DRUNTIMESRC core/sync/_condition.d) */ /* Copyright Sean Kelly 2005 - 2009. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) */ module core.sync.condition; version(BareMetal) {} else: public import core.sync.exception; public import core.sync.mutex; public import core.time; version( Windows ) { private import core.sync.semaphore; private import core.sys.windows.windows; } else version( Posix ) { private import core.sync.config; private import core.stdc.errno; private import core.sys.posix.pthread; private import core.sys.posix.time; } else { static assert(false, "Platform not supported"); } //////////////////////////////////////////////////////////////////////////////// // Condition // // void wait(); // void notify(); // void notifyAll(); //////////////////////////////////////////////////////////////////////////////// /** * This class represents a condition variable as conceived by C.A.R. Hoare. As * per Mesa type monitors however, "signal" has been replaced with "notify" to * indicate that control is not transferred to the waiter when a notification * is sent. */ class Condition { //////////////////////////////////////////////////////////////////////////// // Initialization //////////////////////////////////////////////////////////////////////////// /** * Initializes a condition object which is associated with the supplied * mutex object. * * Params: * m = The mutex with which this condition will be associated. * * Throws: * SyncException on error. */ this( Mutex m ) { version( Windows ) { m_blockLock = CreateSemaphoreA( null, 1, 1, null ); if( m_blockLock == m_blockLock.init ) throw new SyncException( "Unable to initialize condition" ); scope(failure) CloseHandle( m_blockLock ); m_blockQueue = CreateSemaphoreA( null, 0, int.max, null ); if( m_blockQueue == m_blockQueue.init ) throw new SyncException( "Unable to initialize condition" ); scope(failure) CloseHandle( m_blockQueue ); InitializeCriticalSection( &m_unblockLock ); m_assocMutex = m; } else version( Posix ) { m_assocMutex = m; int rc = pthread_cond_init( &m_hndl, null ); if( rc ) throw new SyncException( "Unable to initialize condition" ); } } ~this() { version( Windows ) { BOOL rc = CloseHandle( m_blockLock ); assert( rc, "Unable to destroy condition" ); rc = CloseHandle( m_blockQueue ); assert( rc, "Unable to destroy condition" ); DeleteCriticalSection( &m_unblockLock ); } else version( Posix ) { int rc = pthread_cond_destroy( &m_hndl ); assert( !rc, "Unable to destroy condition" ); } } //////////////////////////////////////////////////////////////////////////// // General Properties //////////////////////////////////////////////////////////////////////////// /** * Gets the mutex associated with this condition. * * Returns: * The mutex associated with this condition. */ @property Mutex mutex() { return m_assocMutex; } //////////////////////////////////////////////////////////////////////////// // General Actions //////////////////////////////////////////////////////////////////////////// /** * Wait until notified. * * Throws: * SyncException on error. */ void wait() { version( Windows ) { timedWait( INFINITE ); } else version( Posix ) { int rc = pthread_cond_wait( &m_hndl, m_assocMutex.handleAddr() ); if( rc ) throw new SyncException( "Unable to wait for condition" ); } } /** * Suspends the calling thread until a notification occurs or until the * supplied time period has elapsed. * * Params: * val = The time to wait. * * In: * val must be non-negative. * * Throws: * SyncException on error. * * Returns: * true if notified before the timeout and false if not. */ bool wait( Duration val ) in { assert( !val.isNegative ); } body { version( Windows ) { auto maxWaitMillis = dur!("msecs")( uint.max - 1 ); while( val > maxWaitMillis ) { if( timedWait( cast(uint) maxWaitMillis.total!"msecs" ) ) return true; val -= maxWaitMillis; } return timedWait( cast(uint) val.total!"msecs" ); } else version( Posix ) { timespec t = void; mktspec( t, val ); int rc = pthread_cond_timedwait( &m_hndl, m_assocMutex.handleAddr(), &t ); if( !rc ) return true; if( rc == ETIMEDOUT ) return false; throw new SyncException( "Unable to wait for condition" ); } } /** * Notifies one waiter. * * Throws: * SyncException on error. */ void notify() { version( Windows ) { notify( false ); } else version( Posix ) { int rc = pthread_cond_signal( &m_hndl ); if( rc ) throw new SyncException( "Unable to notify condition" ); } } /** * Notifies all waiters. * * Throws: * SyncException on error. */ void notifyAll() { version( Windows ) { notify( true ); } else version( Posix ) { int rc = pthread_cond_broadcast( &m_hndl ); if( rc ) throw new SyncException( "Unable to notify condition" ); } } private: version( Windows ) { bool timedWait( DWORD timeout ) { int numSignalsLeft; int numWaitersGone; DWORD rc; rc = WaitForSingleObject( m_blockLock, INFINITE ); assert( rc == WAIT_OBJECT_0 ); m_numWaitersBlocked++; rc = ReleaseSemaphore( m_blockLock, 1, null ); assert( rc ); m_assocMutex.unlock(); scope(failure) m_assocMutex.lock(); rc = WaitForSingleObject( m_blockQueue, timeout ); assert( rc == WAIT_OBJECT_0 || rc == WAIT_TIMEOUT ); bool timedOut = (rc == WAIT_TIMEOUT); EnterCriticalSection( &m_unblockLock ); scope(failure) LeaveCriticalSection( &m_unblockLock ); if( (numSignalsLeft = m_numWaitersToUnblock) != 0 ) { if ( timedOut ) { // timeout (or canceled) if( m_numWaitersBlocked != 0 ) { m_numWaitersBlocked--; // do not unblock next waiter below (already unblocked) numSignalsLeft = 0; } else { // spurious wakeup pending!! m_numWaitersGone = 1; } } if( --m_numWaitersToUnblock == 0 ) { if( m_numWaitersBlocked != 0 ) { // open the gate rc = ReleaseSemaphore( m_blockLock, 1, null ); assert( rc ); // do not open the gate below again numSignalsLeft = 0; } else if( (numWaitersGone = m_numWaitersGone) != 0 ) { m_numWaitersGone = 0; } } } else if( ++m_numWaitersGone == int.max / 2 ) { // timeout/canceled or spurious event :-) rc = WaitForSingleObject( m_blockLock, INFINITE ); assert( rc == WAIT_OBJECT_0 ); // something is going on here - test of timeouts? m_numWaitersBlocked -= m_numWaitersGone; rc = ReleaseSemaphore( m_blockLock, 1, null ); assert( rc == WAIT_OBJECT_0 ); m_numWaitersGone = 0; } LeaveCriticalSection( &m_unblockLock ); if( numSignalsLeft == 1 ) { // better now than spurious later (same as ResetEvent) for( ; numWaitersGone > 0; --numWaitersGone ) { rc = WaitForSingleObject( m_blockQueue, INFINITE ); assert( rc == WAIT_OBJECT_0 ); } // open the gate rc = ReleaseSemaphore( m_blockLock, 1, null ); assert( rc ); } else if( numSignalsLeft != 0 ) { // unblock next waiter rc = ReleaseSemaphore( m_blockQueue, 1, null ); assert( rc ); } m_assocMutex.lock(); return !timedOut; } void notify( bool all ) { DWORD rc; EnterCriticalSection( &m_unblockLock ); scope(failure) LeaveCriticalSection( &m_unblockLock ); if( m_numWaitersToUnblock != 0 ) { if( m_numWaitersBlocked == 0 ) { LeaveCriticalSection( &m_unblockLock ); return; } if( all ) { m_numWaitersToUnblock += m_numWaitersBlocked; m_numWaitersBlocked = 0; } else { m_numWaitersToUnblock++; m_numWaitersBlocked--; } LeaveCriticalSection( &m_unblockLock ); } else if( m_numWaitersBlocked > m_numWaitersGone ) { rc = WaitForSingleObject( m_blockLock, INFINITE ); assert( rc == WAIT_OBJECT_0 ); if( 0 != m_numWaitersGone ) { m_numWaitersBlocked -= m_numWaitersGone; m_numWaitersGone = 0; } if( all ) { m_numWaitersToUnblock = m_numWaitersBlocked; m_numWaitersBlocked = 0; } else { m_numWaitersToUnblock = 1; m_numWaitersBlocked--; } LeaveCriticalSection( &m_unblockLock ); rc = ReleaseSemaphore( m_blockQueue, 1, null ); assert( rc ); } else { LeaveCriticalSection( &m_unblockLock ); } } // NOTE: This implementation uses Algorithm 8c as described here: // http://groups.google.com/group/comp.programming.threads/ // browse_frm/thread/1692bdec8040ba40/e7a5f9d40e86503a HANDLE m_blockLock; // auto-reset event (now semaphore) HANDLE m_blockQueue; // auto-reset event (now semaphore) Mutex m_assocMutex; // external mutex/CS CRITICAL_SECTION m_unblockLock; // internal mutex/CS int m_numWaitersGone = 0; int m_numWaitersBlocked = 0; int m_numWaitersToUnblock = 0; } else version( Posix ) { Mutex m_assocMutex; pthread_cond_t m_hndl; } } //////////////////////////////////////////////////////////////////////////////// // Unit Tests //////////////////////////////////////////////////////////////////////////////// version( unittest ) { private import core.thread; private import core.sync.mutex; private import core.sync.semaphore; void testNotify() { auto mutex = new Mutex; auto condReady = new Condition( mutex ); auto semDone = new Semaphore; auto synLoop = new Object; int numWaiters = 10; int numTries = 10; int numReady = 0; int numTotal = 0; int numDone = 0; int numPost = 0; void waiter() { for( int i = 0; i < numTries; ++i ) { synchronized( mutex ) { while( numReady < 1 ) { condReady.wait(); } --numReady; ++numTotal; } synchronized( synLoop ) { ++numDone; } semDone.wait(); } } auto group = new ThreadGroup; for( int i = 0; i < numWaiters; ++i ) group.create( &waiter ); for( int i = 0; i < numTries; ++i ) { for( int j = 0; j < numWaiters; ++j ) { synchronized( mutex ) { ++numReady; condReady.notify(); } } while( true ) { synchronized( synLoop ) { if( numDone >= numWaiters ) break; } Thread.yield(); } for( int j = 0; j < numWaiters; ++j ) { semDone.notify(); } } group.joinAll(); assert( numTotal == numWaiters * numTries ); } void testNotifyAll() { auto mutex = new Mutex; auto condReady = new Condition( mutex ); int numWaiters = 10; int numReady = 0; int numDone = 0; bool alert = false; void waiter() { synchronized( mutex ) { ++numReady; while( !alert ) condReady.wait(); ++numDone; } } auto group = new ThreadGroup; for( int i = 0; i < numWaiters; ++i ) group.create( &waiter ); while( true ) { synchronized( mutex ) { if( numReady >= numWaiters ) { alert = true; condReady.notifyAll(); break; } } Thread.yield(); } group.joinAll(); assert( numReady == numWaiters && numDone == numWaiters ); } void testWaitTimeout() { auto mutex = new Mutex; auto condReady = new Condition( mutex ); bool waiting = false; bool alertedOne = true; bool alertedTwo = true; void waiter() { synchronized( mutex ) { waiting = true; // we never want to miss the notification (30s) alertedOne = condReady.wait( dur!"seconds"(30) ); // but we don't want to wait long for the timeout (10ms) alertedTwo = condReady.wait( dur!"msecs"(10) ); } } auto thread = new Thread( &waiter ); thread.start(); while( true ) { synchronized( mutex ) { if( waiting ) { condReady.notify(); break; } } Thread.yield(); } thread.join(); assert( waiting ); assert( alertedOne ); assert( !alertedTwo ); } unittest { testNotify(); testNotifyAll(); testWaitTimeout(); } }
D
// Written in the D programming language. /** Functions that manipulate other functions. Macros: WIKI = Phobos/StdFunctional Copyright: Copyright Andrei Alexandrescu 2008 - 2009. License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(WEB erdani.org, Andrei Alexandrescu) Source: $(PHOBOSSRC std/_functional.d) */ /* Copyright Andrei Alexandrescu 2008 - 2009. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ module std.functional; import std.traits, std.typetuple; private template needOpCallAlias(alias fun) { /* Determine whether or not unaryFun and binaryFun need to alias to fun or * fun.opCall. Basically, fun is a function object if fun(...) compiles. We * want is(unaryFun!fun) (resp., is(binaryFun!fun)) to be true if fun is * any function object. There are 4 possible cases: * * 1) fun is the type of a function object with static opCall; * 2) fun is an instance of a function object with static opCall; * 3) fun is the type of a function object with non-static opCall; * 4) fun is an instance of a function object with non-static opCall. * * In case (1), is(unaryFun!fun) should compile, but does not if unaryFun * aliases itself to fun, because typeof(fun) is an error when fun itself * is a type. So it must be aliased to fun.opCall instead. All other cases * should be aliased to fun directly. */ static if (is(typeof(fun.opCall) == function)) { import std.traits : ParameterTypeTuple; enum needOpCallAlias = !is(typeof(fun)) && __traits(compiles, () { return fun(ParameterTypeTuple!fun.init); }); } else enum needOpCallAlias = false; } /** Transforms a string representing an expression into a unary function. The string must either use symbol name $(D a) as the parameter or provide the symbol via the $(D parmName) argument. If $(D fun) is not a string, $(D unaryFun) aliases itself away to $(D fun). */ template unaryFun(alias fun, string parmName = "a") { static if (is(typeof(fun) : string)) { static if (!fun._ctfeMatchUnary(parmName)) { import std.traits, std.typecons, std.typetuple; import std.algorithm, std.conv, std.exception, std.math, std.range, std.string; } auto unaryFun(ElementType)(auto ref ElementType __a) { mixin("alias " ~ parmName ~ " = __a ;"); return mixin(fun); } } else static if (needOpCallAlias!fun) { // Issue 9906 alias unaryFun = fun.opCall; } else { alias unaryFun = fun; } } /// unittest { // Strings are compiled into functions: alias isEven = unaryFun!("(a & 1) == 0"); assert(isEven(2) && !isEven(1)); } /+ Undocumented, will be removed December 2014+/ deprecated("Parameter byRef is obsolete. Please call unaryFun!(fun, parmName) directly.") template unaryFun(alias fun, bool byRef, string parmName = "a") { alias unaryFun = unaryFun!(fun, parmName); } unittest { static int f1(int a) { return a + 1; } static assert(is(typeof(unaryFun!(f1)(1)) == int)); assert(unaryFun!(f1)(41) == 42); int f2(int a) { return a + 1; } static assert(is(typeof(unaryFun!(f2)(1)) == int)); assert(unaryFun!(f2)(41) == 42); assert(unaryFun!("a + 1")(41) == 42); //assert(unaryFun!("return a + 1;")(41) == 42); int num = 41; assert(unaryFun!("a + 1", true)(num) == 42); // Issue 9906 struct Seen { static bool opCall(int n) { return true; } } static assert(needOpCallAlias!Seen); static assert(is(typeof(unaryFun!Seen(1)))); assert(unaryFun!Seen(1)); Seen s; static assert(!needOpCallAlias!s); static assert(is(typeof(unaryFun!s(1)))); assert(unaryFun!s(1)); struct FuncObj { bool opCall(int n) { return true; } } FuncObj fo; static assert(!needOpCallAlias!fo); static assert(is(typeof(unaryFun!fo))); assert(unaryFun!fo(1)); // Function object with non-static opCall can only be called with an // instance, not with merely the type. static assert(!is(typeof(unaryFun!FuncObj))); } /** Transforms a string representing an expression into a binary function. The string must either use symbol names $(D a) and $(D b) as the parameters or provide the symbols via the $(D parm1Name) and $(D parm2Name) arguments. If $(D fun) is not a string, $(D binaryFun) aliases itself away to $(D fun). */ template binaryFun(alias fun, string parm1Name = "a", string parm2Name = "b") { static if (is(typeof(fun) : string)) { static if (!fun._ctfeMatchBinary(parm1Name, parm2Name)) { import std.traits, std.typecons, std.typetuple; import std.algorithm, std.conv, std.exception, std.math, std.range, std.string; } auto binaryFun(ElementType1, ElementType2) (auto ref ElementType1 __a, auto ref ElementType2 __b) { mixin("alias "~parm1Name~" = __a ;"); mixin("alias "~parm2Name~" = __b ;"); return mixin(fun); } } else static if (needOpCallAlias!fun) { // Issue 9906 alias binaryFun = fun.opCall; } else { alias binaryFun = fun; } } /// unittest { alias less = binaryFun!("a < b"); assert(less(1, 2) && !less(2, 1)); alias greater = binaryFun!("a > b"); assert(!greater("1", "2") && greater("2", "1")); } unittest { static int f1(int a, string b) { return a + 1; } static assert(is(typeof(binaryFun!(f1)(1, "2")) == int)); assert(binaryFun!(f1)(41, "a") == 42); string f2(int a, string b) { return b ~ "2"; } static assert(is(typeof(binaryFun!(f2)(1, "1")) == string)); assert(binaryFun!(f2)(1, "4") == "42"); assert(binaryFun!("a + b")(41, 1) == 42); //@@BUG //assert(binaryFun!("return a + b;")(41, 1) == 42); // Issue 9906 struct Seen { static bool opCall(int x, int y) { return true; } } static assert(is(typeof(binaryFun!Seen))); assert(binaryFun!Seen(1,1)); struct FuncObj { bool opCall(int x, int y) { return true; } } FuncObj fo; static assert(!needOpCallAlias!fo); static assert(is(typeof(binaryFun!fo))); assert(unaryFun!fo(1,1)); // Function object with non-static opCall can only be called with an // instance, not with merely the type. static assert(!is(typeof(binaryFun!FuncObj))); } // skip all ASCII chars except a..z, A..Z, 0..9, '_' and '.'. private uint _ctfeSkipOp(ref string op) { if (!__ctfe) assert(false); import std.ascii : isASCII, isAlphaNum; immutable oldLength = op.length; while (op.length) { immutable front = op[0]; if(front.isASCII && !(front.isAlphaNum || front == '_' || front == '.')) op = op[1..$]; else break; } return oldLength != op.length; } // skip all digits private uint _ctfeSkipInteger(ref string op) { if (!__ctfe) assert(false); import std.ascii : isDigit; immutable oldLength = op.length; while (op.length) { immutable front = op[0]; if(front.isDigit) op = op[1..$]; else break; } return oldLength != op.length; } // skip name private uint _ctfeSkipName(ref string op, string name) { if (!__ctfe) assert(false); if (op.length >= name.length && op[0..name.length] == name) { op = op[name.length..$]; return 1; } return 0; } // returns 1 if $(D fun) is trivial unary function private uint _ctfeMatchUnary(string fun, string name) { if (!__ctfe) assert(false); import std.stdio; fun._ctfeSkipOp; for (;;) { immutable h = fun._ctfeSkipName(name) + fun._ctfeSkipInteger; if (h == 0) { fun._ctfeSkipOp; break; } else if (h == 1) { if(!fun._ctfeSkipOp) break; } else return 0; } return fun.length == 0; } unittest { static assert(!_ctfeMatchUnary("sqrt(ё)", "ё")); static assert(!_ctfeMatchUnary("ё.sqrt", "ё")); static assert(!_ctfeMatchUnary(".ё+ё", "ё")); static assert(!_ctfeMatchUnary("_ё+ё", "ё")); static assert(!_ctfeMatchUnary("ёё", "ё")); static assert(_ctfeMatchUnary("a+a", "a")); static assert(_ctfeMatchUnary("a + 10", "a")); static assert(_ctfeMatchUnary("4 == a", "a")); static assert(_ctfeMatchUnary("2==a", "a")); static assert(_ctfeMatchUnary("1 != a", "a")); static assert(_ctfeMatchUnary("a!=4", "a")); static assert(_ctfeMatchUnary("a< 1", "a")); static assert(_ctfeMatchUnary("434 < a", "a")); static assert(_ctfeMatchUnary("132 > a", "a")); static assert(_ctfeMatchUnary("123 >a", "a")); static assert(_ctfeMatchUnary("a>82", "a")); static assert(_ctfeMatchUnary("ё>82", "ё")); static assert(_ctfeMatchUnary("ё[ё(ё)]", "ё")); static assert(_ctfeMatchUnary("ё[21]", "ё")); } // returns 1 if $(D fun) is trivial binary function private uint _ctfeMatchBinary(string fun, string name1, string name2) { if (!__ctfe) assert(false); fun._ctfeSkipOp; for (;;) { immutable h = fun._ctfeSkipName(name1) + fun._ctfeSkipName(name2) + fun._ctfeSkipInteger; if (h == 0) { fun._ctfeSkipOp; break; } else if (h == 1) { if(!fun._ctfeSkipOp) break; } else return 0; } return fun.length == 0; } unittest { static assert(!_ctfeMatchBinary("sqrt(ё)", "ё", "b")); static assert(!_ctfeMatchBinary("ё.sqrt", "ё", "b")); static assert(!_ctfeMatchBinary(".ё+ё", "ё", "b")); static assert(!_ctfeMatchBinary("_ё+ё", "ё", "b")); static assert(!_ctfeMatchBinary("ёё", "ё", "b")); static assert(_ctfeMatchBinary("a+a", "a", "b")); static assert(_ctfeMatchBinary("a + 10", "a", "b")); static assert(_ctfeMatchBinary("4 == a", "a", "b")); static assert(_ctfeMatchBinary("2==a", "a", "b")); static assert(_ctfeMatchBinary("1 != a", "a", "b")); static assert(_ctfeMatchBinary("a!=4", "a", "b")); static assert(_ctfeMatchBinary("a< 1", "a", "b")); static assert(_ctfeMatchBinary("434 < a", "a", "b")); static assert(_ctfeMatchBinary("132 > a", "a", "b")); static assert(_ctfeMatchBinary("123 >a", "a", "b")); static assert(_ctfeMatchBinary("a>82", "a", "b")); static assert(_ctfeMatchBinary("ё>82", "ё", "q")); static assert(_ctfeMatchBinary("ё[ё(10)]", "ё", "q")); static assert(_ctfeMatchBinary("ё[21]", "ё", "q")); static assert(!_ctfeMatchBinary("sqrt(ё)+b", "b", "ё")); static assert(!_ctfeMatchBinary("ё.sqrt-b", "b", "ё")); static assert(!_ctfeMatchBinary(".ё+b", "b", "ё")); static assert(!_ctfeMatchBinary("_b+ё", "b", "ё")); static assert(!_ctfeMatchBinary("ba", "b", "a")); static assert(_ctfeMatchBinary("a+b", "b", "a")); static assert(_ctfeMatchBinary("a + b", "b", "a")); static assert(_ctfeMatchBinary("b == a", "b", "a")); static assert(_ctfeMatchBinary("b==a", "b", "a")); static assert(_ctfeMatchBinary("b != a", "b", "a")); static assert(_ctfeMatchBinary("a!=b", "b", "a")); static assert(_ctfeMatchBinary("a< b", "b", "a")); static assert(_ctfeMatchBinary("b < a", "b", "a")); static assert(_ctfeMatchBinary("b > a", "b", "a")); static assert(_ctfeMatchBinary("b >a", "b", "a")); static assert(_ctfeMatchBinary("a>b", "b", "a")); static assert(_ctfeMatchBinary("ё>b", "b", "ё")); static assert(_ctfeMatchBinary("b[ё(-1)]", "b", "ё")); static assert(_ctfeMatchBinary("ё[-21]", "b", "ё")); } //undocumented template safeOp(string S) if (S=="<"||S==">"||S=="<="||S==">="||S=="=="||S=="!=") { private bool unsafeOp(ElementType1, ElementType2)(ElementType1 a, ElementType2 b) pure if (isIntegral!ElementType1 && isIntegral!ElementType2) { alias T = CommonType!(ElementType1, ElementType2); return mixin("cast(T)a "~S~" cast(T)b"); } bool safeOp(T0, T1)(auto ref T0 a, auto ref T1 b) { static if (isIntegral!T0 && isIntegral!T1 && (mostNegative!T0 < 0) != (mostNegative!T1 < 0)) { static if (S == "<=" || S == "<") { static if (mostNegative!T0 < 0) immutable result = a < 0 || unsafeOp(a, b); else immutable result = b >= 0 && unsafeOp(a, b); } else { static if (mostNegative!T0 < 0) immutable result = a >= 0 && unsafeOp(a, b); else immutable result = b < 0 || unsafeOp(a, b); } } else { static assert (is(typeof(mixin("a "~S~" b"))), "Invalid arguments: Cannot compare types " ~ T0.stringof ~ " and " ~ T1.stringof ~ "."); immutable result = mixin("a "~S~" b"); } return result; } } unittest //check user defined types { import std.algorithm : equal; struct Foo { int a; auto opEquals(Foo foo) { return a == foo.a; } } assert(safeOp!"!="(Foo(1), Foo(2))); } /** Predicate that returns $(D_PARAM a < b). Correctly compares signed and unsigned integers, ie. -1 < 2U. */ alias lessThan = safeOp!"<"; pure @safe @nogc nothrow unittest { assert(lessThan(2, 3)); assert(lessThan(2U, 3U)); assert(lessThan(2, 3.0)); assert(lessThan(-2, 3U)); assert(lessThan(2, 3U)); assert(!lessThan(3U, -2)); assert(!lessThan(3U, 2)); assert(!lessThan(0, 0)); assert(!lessThan(0U, 0)); assert(!lessThan(0, 0U)); } /** Predicate that returns $(D_PARAM a > b). Correctly compares signed and unsigned integers, ie. 2U > -1. */ alias greaterThan = safeOp!">"; unittest { assert(!greaterThan(2, 3)); assert(!greaterThan(2U, 3U)); assert(!greaterThan(2, 3.0)); assert(!greaterThan(-2, 3U)); assert(!greaterThan(2, 3U)); assert(greaterThan(3U, -2)); assert(greaterThan(3U, 2)); assert(!greaterThan(0, 0)); assert(!greaterThan(0U, 0)); assert(!greaterThan(0, 0U)); } /** Predicate that returns $(D_PARAM a == b). Correctly compares signed and unsigned integers, ie. !(-1 == ~0U). */ alias equalTo = safeOp!"=="; unittest { assert(equalTo(0U, 0)); assert(equalTo(0, 0U)); assert(!equalTo(-1, ~0U)); } /** N-ary predicate that reverses the order of arguments, e.g., given $(D pred(a, b, c)), returns $(D pred(c, b, a)). */ template reverseArgs(alias pred) { auto reverseArgs(Args...)(auto ref Args args) if (is(typeof(pred(Reverse!args)))) { return pred(Reverse!args); } } unittest { alias gt = reverseArgs!(binaryFun!("a < b")); assert(gt(2, 1) && !gt(1, 1)); int x = 42; bool xyz(int a, int b) { return a * x < b / x; } auto foo = &xyz; foo(4, 5); alias zyx = reverseArgs!(foo); assert(zyx(5, 4) == foo(4, 5)); int abc(int a, int b, int c) { return a * b + c; } alias cba = reverseArgs!abc; assert(abc(91, 17, 32) == cba(32, 17, 91)); int a(int a) { return a * 2; } alias _a = reverseArgs!a; assert(a(2) == _a(2)); int b() { return 4; } alias _b = reverseArgs!b; assert(b() == _b()); } /** Binary predicate that reverses the order of arguments, e.g., given $(D pred(a, b)), returns $(D pred(b, a)). */ template binaryReverseArgs(alias pred) { auto binaryReverseArgs(ElementType1, ElementType2) (auto ref ElementType1 a, auto ref ElementType2 b) { return pred(b, a); } } unittest { alias gt = binaryReverseArgs!(binaryFun!("a < b")); assert(gt(2, 1) && !gt(1, 1)); int x = 42; bool xyz(int a, int b) { return a * x < b / x; } auto foo = &xyz; foo(4, 5); alias zyx = binaryReverseArgs!(foo); assert(zyx(5, 4) == foo(4, 5)); } /** Negates predicate $(D pred). */ template not(alias pred) { auto not(T...)(auto ref T args) { static if (is(typeof(!pred(args)))) return !pred(args); else static if (T.length == 1) return !unaryFun!pred(args); else static if (T.length == 2) return !binaryFun!pred(args); else static assert(0); } } /// unittest { import std.functional; import std.algorithm : find; import std.uni : isWhite; string a = " Hello, world!"; assert(find!(not!isWhite)(a) == "Hello, world!"); } unittest { assert(not!"a != 5"(5)); assert(not!"a != b"(5, 5)); assert(not!(() => false)()); assert(not!(a => a != 5)(5)); assert(not!((a, b) => a != b)(5, 5)); assert(not!((a, b, c) => a * b * c != 125 )(5, 5, 5)); } /** $(LINK2 http://en.wikipedia.org/wiki/Partial_application, Partially applies) $(D_PARAM fun) by tying its first argument to $(D_PARAM arg). Example: ---- int fun(int a, int b) { return a + b; } alias partial!(fun, 5) fun5; assert(fun5(6) == 11); ---- Note that in most cases you'd use an alias instead of a value assignment. Using an alias allows you to partially evaluate template functions without committing to a particular type of the function. */ template partial(alias fun, alias arg) { static if (is(typeof(fun) == delegate) || is(typeof(fun) == function)) { ReturnType!fun partial(ParameterTypeTuple!fun[1..$] args2) { return fun(arg, args2); } } else { auto partial(Ts...)(Ts args2) { static if (is(typeof(fun(arg, args2)))) { return fun(arg, args2); } else { static string errormsg() { string msg = "Cannot call '" ~ fun.stringof ~ "' with arguments " ~ "(" ~ arg.stringof; foreach(T; Ts) msg ~= ", " ~ T.stringof; msg ~= ")."; return msg; } static assert(0, errormsg()); } } } } /** Deprecated alias for $(D partial), kept for backwards compatibility */ deprecated("Please use std.functional.partial instead") alias curry = partial; // tests for partially evaluating callables unittest { static int f1(int a, int b) { return a + b; } assert(partial!(f1, 5)(6) == 11); int f2(int a, int b) { return a + b; } int x = 5; assert(partial!(f2, x)(6) == 11); x = 7; assert(partial!(f2, x)(6) == 13); static assert(partial!(f2, 5)(6) == 11); auto dg = &f2; auto f3 = &partial!(dg, x); assert(f3(6) == 13); static int funOneArg(int a) { return a; } assert(partial!(funOneArg, 1)() == 1); static int funThreeArgs(int a, int b, int c) { return a + b + c; } alias funThreeArgs1 = partial!(funThreeArgs, 1); assert(funThreeArgs1(2, 3) == 6); static assert(!is(typeof(funThreeArgs1(2)))); enum xe = 5; alias fe = partial!(f2, xe); static assert(fe(6) == 11); } // tests for partially evaluating templated/overloaded callables unittest { static auto add(A, B)(A x, B y) { return x + y; } alias add5 = partial!(add, 5); assert(add5(6) == 11); static assert(!is(typeof(add5()))); static assert(!is(typeof(add5(6, 7)))); // taking address of templated partial evaluation needs explicit type auto dg = &add5!(int); assert(dg(6) == 11); int x = 5; alias addX = partial!(add, x); assert(addX(6) == 11); static struct Callable { static string opCall(string a, string b) { return a ~ b; } int opCall(int a, int b) { return a * b; } double opCall(double a, double b) { return a + b; } } Callable callable; assert(partial!(Callable, "5")("6") == "56"); assert(partial!(callable, 5)(6) == 30); assert(partial!(callable, 7.0)(3.0) == 7.0 + 3.0); static struct TCallable { auto opCall(A, B)(A a, B b) { return a + b; } } TCallable tcallable; assert(partial!(tcallable, 5)(6) == 11); static assert(!is(typeof(partial!(tcallable, "5")(6)))); static A funOneArg(A)(A a) { return a; } alias funOneArg1 = partial!(funOneArg, 1); assert(funOneArg1() == 1); static auto funThreeArgs(A, B, C)(A a, B b, C c) { return a + b + c; } alias funThreeArgs1 = partial!(funThreeArgs, 1); assert(funThreeArgs1(2, 3) == 6); static assert(!is(typeof(funThreeArgs1(1)))); // @@ dmd BUG 6600 @@ // breaks completely unrelated unittest for toDelegate // static assert(is(typeof(dg_pure_nothrow) == int delegate() pure nothrow)); version (none) { auto dg2 = &funOneArg1!(); assert(dg2() == 1); } } /** Takes multiple functions and adjoins them together. The result is a $(XREF typecons, Tuple) with one element per passed-in function. Upon invocation, the returned tuple is the adjoined results of all functions. Note: In the special case where where only a single function is provided ($(D F.length == 1)), adjoin simply aliases to the single passed function ($(D F[0])). */ template adjoin(F...) if (F.length == 1) { alias adjoin = F[0]; } /// ditto template adjoin(F...) if (F.length > 1) { auto adjoin(V...)(auto ref V a) { import std.typecons : tuple; static if (F.length == 2) { return tuple(F[0](a), F[1](a)); } else static if (F.length == 3) { return tuple(F[0](a), F[1](a), F[2](a)); } else { import std.string : format; import std.range : iota; return mixin (q{tuple(%(F[%s](a)%|, %))}.format(iota(0, F.length))); } } } /// unittest { import std.functional, std.typecons; static bool f1(int a) { return a != 0; } static int f2(int a) { return a / 2; } auto x = adjoin!(f1, f2)(5); assert(is(typeof(x) == Tuple!(bool, int))); assert(x[0] == true && x[1] == 2); } unittest { import std.typecons; static bool F1(int a) { return a != 0; } auto x1 = adjoin!(F1)(5); static int F2(int a) { return a / 2; } auto x2 = adjoin!(F1, F2)(5); assert(is(typeof(x2) == Tuple!(bool, int))); assert(x2[0] && x2[1] == 2); auto x3 = adjoin!(F1, F2, F2)(5); assert(is(typeof(x3) == Tuple!(bool, int, int))); assert(x3[0] && x3[1] == 2 && x3[2] == 2); bool F4(int a) { return a != x1; } alias eff4 = adjoin!(F4); static struct S { bool delegate(int) store; int fun() { return 42 + store(5); } } S s; s.store = (int a) { return eff4(a); }; auto x4 = s.fun(); assert(x4 == 43); } unittest { import std.typetuple : staticMap; import std.typecons : Tuple, tuple; alias funs = staticMap!(unaryFun, "a", "a * 2", "a * 3", "a * a", "-a"); alias afun = adjoin!funs; assert(afun(5) == tuple(5, 10, 15, 25, -5)); static class C{} alias IC = immutable(C); IC foo(){return typeof(return).init;} Tuple!(IC, IC, IC, IC) ret1 = adjoin!(foo, foo, foo, foo)(); static struct S{int* p;} alias IS = immutable(S); IS bar(){return typeof(return).init;} enum Tuple!(IS, IS, IS, IS) ret2 = adjoin!(bar, bar, bar, bar)(); } // /*private*/ template NaryFun(string fun, string letter, V...) // { // static if (V.length == 0) // { // enum args = ""; // } // else // { // enum args = V[0].stringof~" "~letter~"; " // ~NaryFun!(fun, [letter[0] + 1], V[1..$]).args; // enum code = args ~ "return "~fun~";"; // } // alias Result = void; // } // unittest // { // writeln(NaryFun!("a * b * 2", "a", int, double).code); // } // /** // naryFun // */ // template naryFun(string fun) // { // //NaryFun!(fun, "a", V).Result // int naryFun(V...)(V values) // { // enum string code = NaryFun!(fun, "a", V).code; // mixin(code); // } // } // unittest // { // alias test = naryFun!("a + b"); // test(1, 2); // } /** Composes passed-in functions $(D fun[0], fun[1], ...) returning a function $(D f(x)) that in turn returns $(D fun[0](fun[1](...(x)))...). Each function can be a regular functions, a delegate, or a string. Example: ---- // First split a string in whitespace-separated tokens and then // convert each token into an integer assert(compose!(map!(to!(int)), split)("1 2 3") == [1, 2, 3]); ---- */ template compose(fun...) { static if (fun.length == 1) { alias compose = unaryFun!(fun[0]); } else static if (fun.length == 2) { // starch alias fun0 = unaryFun!(fun[0]); alias fun1 = unaryFun!(fun[1]); // protein: the core composition operation typeof({ E a; return fun0(fun1(a)); }()) compose(E)(E a) { return fun0(fun1(a)); } } else { // protein: assembling operations alias compose = compose!(fun[0], compose!(fun[1 .. $])); } } /** Pipes functions in sequence. Offers the same functionality as $(D compose), but with functions specified in reverse order. This may lead to more readable code in some situation because the order of execution is the same as lexical order. Example: ---- // Read an entire text file, split the resulting string in // whitespace-separated tokens, and then convert each token into an // integer int[] a = pipe!(readText, split, map!(to!(int)))("file.txt"); ---- */ alias pipe(fun...) = compose!(Reverse!(fun)); unittest { import std.conv : to; string foo(int a) { return to!(string)(a); } int bar(string a) { return to!(int)(a) + 1; } double baz(int a) { return a + 0.5; } assert(compose!(baz, bar, foo)(1) == 2.5); assert(pipe!(foo, bar, baz)(1) == 2.5); assert(compose!(baz, `to!(int)(a) + 1`, foo)(1) == 2.5); assert(compose!(baz, bar)("1"[]) == 2.5); assert(compose!(baz, bar)("1") == 2.5); // @@@BUG@@@ //assert(compose!(`a + 0.5`, `to!(int)(a) + 1`, foo)(1) == 2.5); } /** * $(LUCKY Memoizes) a function so as to avoid repeated * computation. The memoization structure is a hash table keyed by a * tuple of the function's arguments. There is a speed gain if the * function is repeatedly called with the same arguments and is more * expensive than a hash table lookup. For more information on memoization, refer to $(WEB docs.google.com/viewer?url=http%3A%2F%2Fhop.perl.plover.com%2Fbook%2Fpdf%2F03CachingAndMemoization.pdf, this book chapter). Example: ---- double transmogrify(int a, string b) { ... expensive computation ... } alias fastTransmogrify = memoize!transmogrify; unittest { auto slow = transmogrify(2, "hello"); auto fast = fastTransmogrify(2, "hello"); assert(slow == fast); } ---- Technically the memoized function should be pure because $(D memoize) assumes it will always return the same result for a given tuple of arguments. However, $(D memoize) does not enforce that because sometimes it is useful to memoize an impure function, too. */ template memoize(alias fun) { // alias Args = ParameterTypeTuple!fun; // Bugzilla 13580 ReturnType!fun memoize(ParameterTypeTuple!fun args) { alias Args = ParameterTypeTuple!fun; import std.typecons : Tuple; static ReturnType!fun[Tuple!Args] memo; auto t = Tuple!Args(args); if (auto p = t in memo) return *p; return memo[t] = fun(args); } } /// ditto template memoize(alias fun, uint maxSize) { // alias Args = ParameterTypeTuple!fun; // Bugzilla 13580 ReturnType!fun memoize(ParameterTypeTuple!fun args) { import std.typecons : tuple; static struct Value { ParameterTypeTuple!fun args; ReturnType!fun res; } static Value[] memo; static size_t[] initialized; if (!memo.length) { import core.memory; enum attr = GC.BlkAttr.NO_INTERIOR | (hasIndirections!Value ? 0 : GC.BlkAttr.NO_SCAN); memo = (cast(Value*)GC.malloc(Value.sizeof * maxSize, attr))[0 .. maxSize]; enum nwords = (maxSize + 8 * size_t.sizeof - 1) / (8 * size_t.sizeof); initialized = (cast(size_t*)GC.calloc(nwords * size_t.sizeof, attr | GC.BlkAttr.NO_SCAN))[0 .. nwords]; } import core.bitop : bts; import std.conv : emplace; size_t hash; foreach (ref arg; args) hash = hashOf(arg, hash); // cuckoo hashing immutable idx1 = hash % maxSize; if (!bts(initialized.ptr, idx1)) return emplace(&memo[idx1], args, fun(args)).res; else if (memo[idx1].args == args) return memo[idx1].res; // FNV prime immutable idx2 = (hash * 16777619) % maxSize; if (!bts(initialized.ptr, idx2)) emplace(&memo[idx2], memo[idx1]); else if (memo[idx2].args == args) return memo[idx2].res; else if (idx1 != idx2) memo[idx2] = memo[idx1]; memo[idx1] = Value(args, fun(args)); return memo[idx1].res; } } /** * To _memoize a recursive function, simply insert the memoized call in lieu of the plain recursive call. * For example, to transform the exponential-time Fibonacci implementation into a linear-time computation: */ unittest { ulong fib(ulong n) { return n < 2 ? 1 : memoize!fib(n - 2) + memoize!fib(n - 1); } assert(fib(10) == 89); } /** * To improve the speed of the factorial function, */ unittest { ulong fact(ulong n) { return n < 2 ? 1 : n * memoize!fact(n - 1); } assert(fact(10) == 3628800); } /** * This memoizes all values of $(D fact) up to the largest argument. To only cache the final * result, move $(D memoize) outside the function as shown below. */ unittest { ulong factImpl(ulong n) { return n < 2 ? 1 : n * factImpl(n - 1); } alias fact = memoize!factImpl; assert(fact(10) == 3628800); } /** * When the $(D maxSize) parameter is specified, memoize will used * a fixed size hash table to limit the number of cached entries. */ unittest { ulong fact(ulong n) { // Memoize no more than 8 values return n < 2 ? 1 : n * memoize!(fact, 8)(n - 1); } assert(fact(8) == 40320); // using more entries than maxSize will overwrite existing entries assert(fact(10) == 3628800); } unittest { import core.math; alias msqrt = memoize!(function double(double x) { return sqrt(x); }); auto y = msqrt(2.0); assert(y == msqrt(2.0)); y = msqrt(4.0); assert(y == sqrt(4.0)); // alias mrgb2cmyk = memoize!rgb2cmyk; // auto z = mrgb2cmyk([43, 56, 76]); // assert(z == mrgb2cmyk([43, 56, 76])); //alias mfib = memoize!fib; static ulong fib(ulong n) { alias mfib = memoize!fib; return n < 2 ? 1 : mfib(n - 2) + mfib(n - 1); } auto z = fib(10); assert(z == 89); static ulong fact(ulong n) { alias mfact = memoize!fact; return n < 2 ? 1 : n * mfact(n - 1); } assert(fact(10) == 3628800); // Issue 12568 static uint len2(const string s) { // Error alias mLen2 = memoize!len2; if (s.length == 0) return 0; else return 1 + mLen2(s[1 .. $]); } int _func(int x) { return 1; } alias func = memoize!(_func, 10); assert(func(int.init) == 1); assert(func(int.init) == 1); } private struct DelegateFaker(F) { import std.typecons; // for @safe static F castToF(THIS)(THIS x) @trusted { return cast(F) x; } /* * What all the stuff below does is this: *-------------------- * struct DelegateFaker(F) { * extern(linkage) * [ref] ReturnType!F doIt(ParameterTypeTuple!F args) [@attributes] * { * auto fp = cast(F) &this; * return fp(args); * } * } *-------------------- */ // We will use MemberFunctionGenerator in std.typecons. This is a policy // configuration for generating the doIt(). template GeneratingPolicy() { // Inform the genereator that we only have type information. enum WITHOUT_SYMBOL = true; // Generate the function body of doIt(). template generateFunctionBody(unused...) { enum generateFunctionBody = // [ref] ReturnType doIt(ParameterTypeTuple args) @attributes q{ // When this function gets called, the this pointer isn't // really a this pointer (no instance even really exists), but // a function pointer that points to the function to be called. // Cast it to the correct type and call it. auto fp = castToF(&this); return fp(args); }; } } // Type information used by the generated code. alias FuncInfo_doIt = FuncInfo!(F); // Generate the member function doIt(). mixin( std.typecons.MemberFunctionGenerator!(GeneratingPolicy!()) .generateFunction!("FuncInfo_doIt", "doIt", F) ); } /** * Convert a callable to a delegate with the same parameter list and * return type, avoiding heap allocations and use of auxiliary storage. * * Examples: * ---- * void doStuff() { * writeln("Hello, world."); * } * * void runDelegate(void delegate() myDelegate) { * myDelegate(); * } * * auto delegateToPass = toDelegate(&doStuff); * runDelegate(delegateToPass); // Calls doStuff, prints "Hello, world." * ---- * * BUGS: * $(UL * $(LI Does not work with $(D @safe) functions.) * $(LI Ignores C-style / D-style variadic arguments.) * ) */ auto toDelegate(F)(auto ref F fp) if (isCallable!(F)) { static if (is(F == delegate)) { return fp; } else static if (is(typeof(&F.opCall) == delegate) || (is(typeof(&F.opCall) V : V*) && is(V == function))) { return toDelegate(&fp.opCall); } else { alias DelType = typeof(&(new DelegateFaker!(F)).doIt); static struct DelegateFields { union { DelType del; //pragma(msg, typeof(del)); struct { void* contextPtr; void* funcPtr; } } } // fp is stored in the returned delegate's context pointer. // The returned delegate's function pointer points to // DelegateFaker.doIt. DelegateFields df; df.contextPtr = cast(void*) fp; DelegateFaker!(F) dummy; auto dummyDel = &dummy.doIt; df.funcPtr = dummyDel.funcptr; return df.del; } } unittest { static int inc(ref uint num) { num++; return 8675309; } uint myNum = 0; auto incMyNumDel = toDelegate(&inc); static assert(is(typeof(incMyNumDel) == int delegate(ref uint))); auto returnVal = incMyNumDel(myNum); assert(myNum == 1); interface I { int opCall(); } class C: I { int opCall() { inc(myNum); return myNum;} } auto c = new C; auto i = cast(I) c; auto getvalc = toDelegate(c); assert(getvalc() == 2); auto getvali = toDelegate(i); assert(getvali() == 3); struct S1 { int opCall() { inc(myNum); return myNum; } } static assert(!is(typeof(&s1.opCall) == delegate)); S1 s1; auto getvals1 = toDelegate(s1); assert(getvals1() == 4); struct S2 { static int opCall() { return 123456; } } static assert(!is(typeof(&S2.opCall) == delegate)); S2 s2; auto getvals2 =&S2.opCall; assert(getvals2() == 123456); /* test for attributes */ { static int refvar = 0xDeadFace; static ref int func_ref() { return refvar; } static int func_pure() pure { return 1; } static int func_nothrow() nothrow { return 2; } static int func_property() @property { return 3; } static int func_safe() @safe { return 4; } static int func_trusted() @trusted { return 5; } static int func_system() @system { return 6; } static int func_pure_nothrow() pure nothrow { return 7; } static int func_pure_nothrow_safe() pure @safe { return 8; } auto dg_ref = toDelegate(&func_ref); auto dg_pure = toDelegate(&func_pure); auto dg_nothrow = toDelegate(&func_nothrow); auto dg_property = toDelegate(&func_property); auto dg_safe = toDelegate(&func_safe); auto dg_trusted = toDelegate(&func_trusted); auto dg_system = toDelegate(&func_system); auto dg_pure_nothrow = toDelegate(&func_pure_nothrow); auto dg_pure_nothrow_safe = toDelegate(&func_pure_nothrow_safe); //static assert(is(typeof(dg_ref) == ref int delegate())); // [BUG@DMD] static assert(is(typeof(dg_pure) == int delegate() pure)); static assert(is(typeof(dg_nothrow) == int delegate() nothrow)); static assert(is(typeof(dg_property) == int delegate() @property)); //static assert(is(typeof(dg_safe) == int delegate() @safe)); static assert(is(typeof(dg_trusted) == int delegate() @trusted)); static assert(is(typeof(dg_system) == int delegate() @system)); static assert(is(typeof(dg_pure_nothrow) == int delegate() pure nothrow)); //static assert(is(typeof(dg_pure_nothrow_safe) == int delegate() @safe pure nothrow)); assert(dg_ref() == refvar); assert(dg_pure() == 1); assert(dg_nothrow() == 2); assert(dg_property() == 3); //assert(dg_safe() == 4); assert(dg_trusted() == 5); assert(dg_system() == 6); assert(dg_pure_nothrow() == 7); //assert(dg_pure_nothrow_safe() == 8); } /* test for linkage */ { struct S { extern(C) static void xtrnC() {} extern(D) static void xtrnD() {} } auto dg_xtrnC = toDelegate(&S.xtrnC); auto dg_xtrnD = toDelegate(&S.xtrnD); static assert(! is(typeof(dg_xtrnC) == typeof(dg_xtrnD))); } }
D
#!/usr/bin/env rdmd /** DMD builder Usage: ./build.d dmd detab, tolf, install targets - require the D Language Tools (detab.exe, tolf.exe) https://github.com/dlang/tools. zip target - requires Info-ZIP or equivalent (zip32.exe) http://www.info-zip.org/Zip.html#Downloads */ version(CoreDdoc) {} else: import std.algorithm, std.conv, std.datetime, std.exception, std.file, std.format, std.functional, std.getopt, std.path, std.process, std.range, std.stdio, std.string, std.traits; import std.parallelism : TaskPool, totalCPUs; const thisBuildScript = __FILE_FULL_PATH__.buildNormalizedPath; const srcDir = thisBuildScript.dirName; const compilerDir = srcDir.dirName; const dmdRepo = compilerDir.dirName; const testDir = compilerDir.buildPath("test"); shared bool verbose; // output verbose logging shared bool force; // always build everything (ignores timestamp checking) shared bool dryRun; /// dont execute targets, just print command to be executed __gshared int jobs; // Number of jobs to run in parallel __gshared string[string] env; __gshared string[][string] flags; __gshared typeof(sourceFiles()) sources; __gshared TaskPool taskPool; /// Array of build rules through which all other build rules can be reached immutable rootRules = [ &dmdDefault, &dmdPGO, &runDmdUnittest, &clean, &checkwhitespace, &runTests, &buildFrontendHeaders, &runCxxHeadersTest, &runCxxUnittest, &detab, &tolf, &zip, &html, &toolchainInfo, &style, &man, &installCopy, ]; int main(string[] args) { try { runMain(args); return 0; } catch (BuildException e) { writeln(e.msg); if (e.details) { writeln("DETAILS:\n"); writeln(e.details); } return 1; } } void runMain(string[] args) { jobs = totalCPUs; bool calledFromMake = false; auto res = getopt(args, "j|jobs", "Specifies the number of jobs (commands) to run simultaneously (default: %d)".format(totalCPUs), &jobs, "v|verbose", "Verbose command output", (cast(bool*) &verbose), "f|force", "Force run (ignore timestamps and always run all tests)", (cast(bool*) &force), "d|dry-run", "Print commands instead of executing them", (cast(bool*) &dryRun), "called-from-make", "Calling the build script from the Makefile", &calledFromMake ); void showHelp() { defaultGetoptPrinter(`./build.d <targets>... Examples -------- ./build.d dmd # build DMD ./build.d unittest # runs internal unittests ./build.d clean # remove all generated files ./build.d generated/linux/release/64/dmd.conf ./build.d dmd-pgo # builds dmd with PGO data, currently only LDC is supported Important variables: -------------------- HOST_DMD: Host D compiler to use for bootstrapping AUTO_BOOTSTRAP: Enable auto-boostrapping by downloading a stable DMD binary MODEL: Target architecture to build for (32,64) - defaults to the host architecture Build modes: ------------ BUILD: release (default) | debug (enabled a build with debug instructions) Opt-in build features: ENABLE_RELEASE: Optimized release build ENABLE_DEBUG: Add debug instructions and symbols (set if ENABLE_RELEASE isn't set) ENABLE_ASSERTS: Don't use -release if ENABLE_RELEASE is set ENABLE_LTO: Enable link-time optimizations ENABLE_UNITTEST: Build dmd with unittests (sets ENABLE_COVERAGE=1) ENABLE_PROFILE: Build dmd with a profiling recorder (D) ENABLE_COVERAGE Build dmd with coverage counting ENABLE_SANITIZERS Build dmd with sanitizer (e.g. ENABLE_SANITIZERS=address,undefined) Targets ------- ` ~ targetsHelp ~ ` The generated files will be in generated/$(OS)/$(BUILD)/$(MODEL) (` ~ env["G"] ~ `) Command-line parameters ----------------------- `, res.options); return; } // workaround issue https://issues.dlang.org/show_bug.cgi?id=13727 version (CRuntime_DigitalMars) { pragma(msg, "Warning: Parallel builds disabled because of Issue 13727!"); jobs = min(jobs, 1); // Fall back to a sequential build } if (jobs <= 0) abortBuild("Invalid number of jobs: %d".format(jobs)); taskPool = new TaskPool(jobs - 1); // Main thread is active too scope (exit) taskPool.finish(); scope (failure) taskPool.stop(); // parse arguments args.popFront; args2Environment(args); parseEnvironment; processEnvironment; processEnvironmentCxx; sources = sourceFiles; if (res.helpWanted) return showHelp; // Since we're ultimately outputting to a TTY, force colored output // A more proper solution would be to redirect DMD's output to this script's // output using `std.process`', but it's more involved and the following // "just works" version(Posix) // UPDATE: only when ANSII color codes are supported, that is. Don't do this on Windows. if (!flags["DFLAGS"].canFind("-color=off") && [env["HOST_DMD_RUN"], "-color=on", "-h"].tryRun().status == 0) flags["DFLAGS"] ~= "-color=on"; // default target if (!args.length) args = ["dmd"]; auto targets = predefinedTargets(args); // preprocess if (targets.length == 0) return showHelp; if (verbose) { log("================================================================================"); foreach (key, value; env) log("%s=%s", key, value); foreach (key, value; flags) log("%s=%-(%s %)", key, value); log("================================================================================"); } { File lockFile; if (calledFromMake) { // If called from make, use an interprocess lock so that parallel builds don't stomp on each other lockFile = File(env["GENERATED"].buildPath("build.lock"), "w"); lockFile.lock(); } scope (exit) { if (calledFromMake) { lockFile.unlock(); lockFile.close(); } } Scheduler.build(targets); } writeln("Success"); } /// Generate list of targets for use in the help message string targetsHelp() { string result = ""; foreach (rule; BuildRuleRange(rootRules.map!(a => a()).array)) { if (rule.name) { enum defaultPrefix = "\n "; result ~= rule.name; string prefix = defaultPrefix[1 + rule.name.length .. $]; void add(string msg) { result ~= format("%s%s", prefix, msg); prefix = defaultPrefix; } if (rule.description) add(rule.description); else if (rule.targets) { foreach (target; rule.targets) { add(target.relativePath); } } result ~= "\n"; } } return result; } /** D build rules ==================== The strategy of this script is to emulate what the Makefile is doing. Below all individual rules of DMD are defined. They have a target path, sources paths and an optional name. When a rule is needed either its command or custom commandFunction is executed. A rule will be skipped if all targets are older than all sources. This script is by default part of the sources and thus any change to the build script, will trigger a full rebuild. */ /// Returns: the rule that builds the lexer object file alias lexer = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule rule, string suffix, string[] extraFlags) => builder .name("lexer") .target(env["G"].buildPath("lexer" ~ suffix).objName) .sources(sources.lexer) .deps([ versionFile, sysconfDirFile, common(suffix, extraFlags) ]) .msg("(DC) LEXER" ~ suffix) .command([env["HOST_DMD_RUN"], "-c", "-of" ~ rule.target, "-vtls", "-J" ~ env["RES"]] .chain(flags["DFLAGS"], extraFlags, // source files need to have relative paths in order for the code coverage // .lst files to be named properly for CodeCov to find them rule.sources.map!(e => e.relativePath(compilerDir)) ).array ) ); /// Returns: the rule that generates the dmd.conf/sc.ini file in the output folder alias dmdConf = makeRule!((builder, rule) { string exportDynamic; version(OSX) {} else exportDynamic = " -L--export-dynamic"; version (Windows) { enum confFile = "sc.ini"; enum conf = `[Environment] DFLAGS="-I%@P%\..\..\..\..\druntime\import" "-I%@P%\..\..\..\..\..\phobos" LIB="%@P%\..\..\..\..\..\phobos" [Environment32] DFLAGS=%DFLAGS% -L/OPT:NOICF [Environment64] DFLAGS=%DFLAGS% -L/OPT:NOICF [Environment32mscoff] DFLAGS=%DFLAGS% -L/OPT:NOICF `; } else { enum confFile = "dmd.conf"; enum conf = `[Environment32] DFLAGS=-I%@P%/../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/32{exportDynamic} -fPIC [Environment64] DFLAGS=-I%@P%/../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/64{exportDynamic} -fPIC `; } builder .name("dmdconf") .target(env["G"].buildPath(confFile)) .msg("(TX) DMD_CONF") .commandFunction(() { const expConf = conf .replace("{exportDynamic}", exportDynamic) .replace("{BUILD}", env["BUILD"]) .replace("{OS}", env["OS"]); writeText(rule.target, expConf); }); }); /// Returns: the rule that builds the common object file alias common = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule rule, string suffix, string[] extraFlags) => builder .name("common") .target(env["G"].buildPath("common" ~ suffix).objName) .sources(sources.common) .msg("(DC) COMMON" ~ suffix) .command([ env["HOST_DMD_RUN"], "-c", "-of" ~ rule.target, ] .chain( flags["DFLAGS"], extraFlags, // source files need to have relative paths in order for the code coverage // .lst files to be named properly for CodeCov to find them rule.sources.map!(e => e.relativePath(compilerDir)) ).array) ); alias validateCommonBetterC = makeRule!((builder, rule) => builder .name("common-betterc") .description("Verify that common is -betterC compatible") .deps([ common("-betterc", ["-betterC"]) ]) ); /// Returns: the rule that builds the backend object file alias backend = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule rule, string suffix, string[] extraFlags) => builder .name("backend") .target(env["G"].buildPath("backend" ~ suffix).objName) .sources(sources.backend) .deps([ common(suffix, extraFlags) ]) .msg("(DC) BACKEND" ~ suffix) .command([ env["HOST_DMD_RUN"], "-c", "-of" ~ rule.target, ] .chain( ( // Only use -betterC when it doesn't break other features extraFlags.canFind("-unittest", env["COVERAGE_FLAG"]) || flags["DFLAGS"].canFind("-unittest", env["COVERAGE_FLAG"]) ) ? [] : ["-betterC"], flags["DFLAGS"], extraFlags, // source files need to have relative paths in order for the code coverage // .lst files to be named properly for CodeCov to find them rule.sources.map!(e => e.relativePath(compilerDir)) ).array) ); /// Returns: the rules that generate required string files: VERSION and SYSCONFDIR.imp alias versionFile = makeRule!((builder, rule) { alias contents = memoize!(() { if (dmdRepo.buildPath(".git").exists) { bool validVersionNumber(string version_) { // ensure tag has initial 'v' if (!version_.length || !version_[0] == 'v') return false; size_t i = 1; // validate full major version number for (; i < version_.length; i++) { if ('0' <= version_[i] && version_[i] <= '9') continue; else if (version_[i] == '.') break; return false; } // ensure tag has point if (i >= version_.length || version_[i++] != '.') return false; // only validate first digit of minor version number if ('0' > version_[i] || version_[i] > '9') return false; return true; } auto gitResult = tryRun([env["GIT"], "describe", "--dirty"]); if (gitResult.status == 0 && validVersionNumber(gitResult.output)) return gitResult.output.strip; } // version fallback return dmdRepo.buildPath("VERSION").readText; }); builder .target(env["G"].buildPath("VERSION")) .condition(() => !rule.target.exists || rule.target.readText != contents) .msg("(TX) VERSION") .commandFunction(() => writeText(rule.target, contents)); }); alias sysconfDirFile = makeRule!((builder, rule) => builder .target(env["G"].buildPath("SYSCONFDIR.imp")) .condition(() => !rule.target.exists || rule.target.readText != env["SYSCONFDIR"]) .msg("(TX) SYSCONFDIR") .commandFunction(() => writeText(rule.target, env["SYSCONFDIR"])) ); /// BuildRule to create a directory if it doesn't exist. alias directoryRule = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule rule, string dir) => builder .target(dir) .condition(() => !exists(dir)) .msg("mkdirRecurse '%s'".format(dir)) .commandFunction(() => mkdirRecurse(dir)) ); alias dmdSymlink = makeRule!((builder, rule) => builder .commandFunction((){ import std.process; version(Windows) { } else { spawnProcess(["ln", "-sf", env["DMD_PATH"], "./dmd"]); } }) ); /** BuildRule for the DMD executable. Params: extra_flags = Flags to apply to the main build but not the rules */ alias dmdExe = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule rule, string targetSuffix, string[] extraFlags, string[] depFlags) { const dmdSources = sources.dmd.all.chain(sources.root).array; string[] platformArgs; version (Windows) platformArgs = ["-L/STACK:16777216"]; auto lexer = lexer(targetSuffix, depFlags); auto backend = backend(targetSuffix, depFlags); auto common = common(targetSuffix, depFlags); builder // include lexer.o, common.o, and backend.o .sources(dmdSources.chain(lexer.targets, backend.targets, common.targets).array) .target(env["DMD_PATH"] ~ targetSuffix) .msg("(DC) DMD" ~ targetSuffix) .deps([versionFile, sysconfDirFile, lexer, backend, common]) .command([ env["HOST_DMD_RUN"], "-of" ~ rule.target, "-vtls", "-J" ~ env["RES"], ].chain(extraFlags, platformArgs, flags["DFLAGS"], // source files need to have relative paths in order for the code coverage // .lst files to be named properly for CodeCov to find them rule.sources.map!(e => e.relativePath(compilerDir)) ).array); }); alias dmdDefault = makeRule!((builder, rule) => builder .name("dmd") .description("Build dmd") .deps([dmdExe(null, null, null), dmdConf]) ); struct PGOState { //Does the host compiler actually support PGO, if not print a message static bool checkPGO(string x) { switch (env["HOST_DMD_KIND"]) { case "dmd": abortBuild(`DMD does not support PGO!`); break; case "ldc": return true; break; case "gdc": abortBuild(`PGO (or AutoFDO) builds are not yet supported for gdc`); break; default: assert(false, "Unknown host compiler kind: " ~ env["HOST_DMD_KIND"]); } assert(0); } this(string set) { hostKind = set; profDirPath = buildPath(env["G"], "dmd_profdata"); mkdirRecurse(profDirPath); } string profDirPath; string hostKind; string[] pgoGenerateFlags() const { switch(hostKind) { case "ldc": return ["-fprofile-instr-generate=" ~ pgoDataPath ~ "/data.%p.raw"]; default: return [""]; } } string[] pgoUseFlags() const { switch(hostKind) { case "ldc": return ["-fprofile-instr-use=" ~ buildPath(pgoDataPath(), "merged.data")]; default: return [""]; } } string pgoDataPath() const { return profDirPath; } } // Compiles the test runner alias testRunner = methodInit!(BuildRule, (rundBuilder, rundRule) => rundBuilder .msg("(DC) RUN.D") .sources([ testDir.buildPath( "run.d") ]) .target(env["GENERATED"].buildPath("run".exeName)) .command([ env["HOST_DMD_RUN"], "-of=" ~ rundRule.target, "-i", "-I" ~ testDir] ~ rundRule.sources)); alias dmdPGO = makeRule!((builder, rule) { const dmdKind = env["HOST_DMD_KIND"]; PGOState pgoState = PGOState(dmdKind); alias buildInstrumentedDmd = methodInit!(BuildRule, (rundBuilder, rundRule) => rundBuilder .msg("Built dmd with PGO instrumentation") .deps([dmdExe(null, pgoState.pgoGenerateFlags(), pgoState.pgoGenerateFlags()), dmdConf])); alias genDmdData = methodInit!(BuildRule, (rundBuilder, rundRule) => rundBuilder .msg("Compiling dmd testsuite to generate PGO data") .sources([ testDir.buildPath( "run.d") ]) .deps([buildInstrumentedDmd, testRunner]) .commandFunction({ // Run dmd test suite to get data const scope cmd = [ testRunner.targets[0], "compilable", "-j" ~ jobs.to!string ]; log("%-(%s %)", cmd); if (spawnProcess(cmd, null, Config.init, testDir).wait()) stderr.writeln("dmd tests failed! This will not end the PGO build because some data may have been gathered"); })); alias genPhobosData = methodInit!(BuildRule, (rundBuilder, rundRule) => rundBuilder .msg("Compiling phobos testsuite to generate PGO data") .deps([buildInstrumentedDmd]) .commandFunction({ // Run phobos unittests //TODO makefiles //generated/linux/release/64/unittest/test_runner builds the unittests without running them. const scope cmd = ["make", "-C", "../phobos", "-j" ~ jobs.to!string, "-fposix.mak", "generated/linux/release/64/unittest/test_runner", "DMD_DIR="~compilerDir]; log("%-(%s %)", cmd); if (spawnProcess(cmd, null, Config.init, compilerDir).wait()) stderr.writeln("Phobos Tests failed! This will not end the PGO build because some data may have been gathered"); })); alias finalDataMerge = methodInit!(BuildRule, (rundBuilder, rundRule) => rundBuilder .msg("Merging PGO data") .deps([genDmdData]) .commandFunction({ // Run dmd test suite to get data scope cmd = ["ldc-profdata", "merge", "--output=merged.data"]; import std.file : dirEntries; auto files = dirEntries(pgoState.pgoDataPath, "*.raw", SpanMode.shallow).map!(f => f.name); // Use a separate file to work around the windows command limit version (Windows) {{ const listFile = buildPath(env["G"], "pgo_file_list.txt"); File list = File(listFile, "w"); foreach (file; files) list.writeln(file); cmd ~= [ "--input-files=" ~ listFile ]; }} else cmd = chain(cmd, files).array; log("%-(%s %)", cmd); if (spawnProcess(cmd, null, Config.init, pgoState.pgoDataPath).wait()) abortBuild("Merge failed"); files.each!(f => remove(f)); })); builder .name("dmd-pgo") .description("Build dmd with PGO data collected from the dmd and phobos testsuites") .msg("Build with collected PGO data") .condition(() => PGOState.checkPGO(dmdKind)) .deps([finalDataMerge]) .commandFunction({ const extraFlags = pgoState.pgoUseFlags ~ "-wi"; const scope cmd = [thisExePath, "HOST_DMD="~env["HOST_DMD_RUN"], "ENABLE_RELEASE=1", "ENABLE_LTO=1", "DFLAGS="~extraFlags.join(" "), "--force", "-j"~jobs.to!string]; log("%-(%s %)", cmd); if (spawnProcess(cmd, null, Config.init).wait()) abortBuild("PGO Compilation failed"); }); } ); /// Run's the test suite (unittests & `run.d`) alias runTests = makeRule!((testBuilder, testRule) { // Reference header assumes Linux64 auto headerCheck = env["OS"] == "linux" && env["MODEL"] == "64" ? [ runCxxHeadersTest ] : null; testBuilder .name("test") .description("Run the test suite using test/run.d") .msg("(RUN) TEST") .deps([dmdDefault, runDmdUnittest, testRunner] ~ headerCheck) .commandFunction({ // Use spawnProcess to avoid output redirection for `command`s const scope cmd = [ testRunner.targets[0], "-j" ~ jobs.to!string ]; log("%-(%s %)", cmd); if (spawnProcess(cmd, null, Config.init, testDir).wait()) abortBuild("Tests failed!"); }); }); /// BuildRule to run the DMD unittest executable. alias runDmdUnittest = makeRule!((builder, rule) { auto dmdUnittestExe = dmdExe("-unittest", ["-version=NoMain", "-unittest", env["HOST_DMD_KIND"] == "gdc" ? "-fmain" : "-main"], ["-unittest"]); builder .name("unittest") .description("Run the dmd unittests") .msg("(RUN) DMD-UNITTEST") .deps([dmdUnittestExe]) .command(dmdUnittestExe.targets); }); /** BuildRule to run the DMD frontend header generation For debugging, use `./build.d cxx-headers DFLAGS="-debug=Debug_DtoH"` (clean before) */ alias buildFrontendHeaders = makeRule!((builder, rule) { const dmdSources = sources.dmd.frontend ~ sources.root ~ sources.common ~ sources.lexer; const dmdExeFile = dmdDefault.deps[0].target; builder .name("cxx-headers") .description("Build the C++ frontend headers ") .msg("(DMD) CXX-HEADERS") .deps([dmdDefault]) .target(env["G"].buildPath("frontend.h")) .command([dmdExeFile] ~ flags["DFLAGS"] .filter!(f => startsWith(f, "-debug=", "-version=", "-I", "-J")).array ~ // Ignore warnings because of invalid C++ identifiers in the source code ["-J" ~ env["RES"], "-c", "-o-", "-wi", "-HCf="~rule.target, // Enforce the expected target architecture "-m64", "-os=linux", ] ~ dmdSources); }); alias runCxxHeadersTest = makeRule!((builder, rule) { builder .name("cxx-headers-test") .description("Check that the C++ interface matches `src/dmd/frontend.h`") .msg("(TEST) CXX-HEADERS") .deps([buildFrontendHeaders]) .commandFunction(() { const cxxHeaderGeneratedPath = buildFrontendHeaders.target; const cxxHeaderReferencePath = env["D"].buildPath("frontend.h"); log("Comparing referenceHeader(%s) <-> generatedHeader(%s)", cxxHeaderReferencePath, cxxHeaderGeneratedPath); auto generatedHeader = cxxHeaderGeneratedPath.readText; auto referenceHeader = cxxHeaderReferencePath.readText; // Ignore carriage return to unify the expected newlines version (Windows) { generatedHeader = generatedHeader.replace("\r\n", "\n"); // \r added by OutBuffer referenceHeader = referenceHeader.replace("\r\n", "\n"); // \r added by Git's if autocrlf is enabled } if (generatedHeader != referenceHeader) { if (env.getNumberedBool("AUTO_UPDATE")) { generatedHeader.toFile(cxxHeaderReferencePath); writeln("NOTICE: Reference header file (" ~ cxxHeaderReferencePath ~ ") has been auto-updated."); } else { import core.runtime : Runtime; string message = "ERROR: Newly generated header file (" ~ cxxHeaderGeneratedPath ~ ") doesn't match with the reference header file (" ~ cxxHeaderReferencePath ~ ")\n"; auto diff = tryRun(["git", "diff", "--no-index", cxxHeaderReferencePath, cxxHeaderGeneratedPath], runDir).output; diff ~= "\n=============== The file `src/dmd/frontend.h` seems to be out of sync. This is likely because changes were made which affect the C++ interface used by GDC and LDC. Make sure that those changes have been properly reflected in the relevant header files (e.g. `src/dmd/scope.h` for changes in `src/dmd/dscope.d`). To update `frontend.h` and fix this error, run the following command: `" ~ Runtime.args[0] ~ " cxx-headers-test AUTO_UPDATE=1` Note that the generated code need not be valid, as the header generator (`src/dmd/dtoh.d`) is still under development. To read more about `frontend.h` and its usage, see src/README.md#cxx-headers-test "; abortBuild(message, diff); } } }); }); /// Runs the C++ unittest executable alias runCxxUnittest = makeRule!((runCxxBuilder, runCxxRule) { /// Compiles the C++ frontend test files alias cxxFrontend = methodInit!(BuildRule, (frontendBuilder, frontendRule) => frontendBuilder .name("cxx-frontend") .description("Build the C++ frontend") .msg("(CXX) CXX-FRONTEND") .sources(srcDir.buildPath("tests", "cxxfrontend.cc") ~ .sources.frontendHeaders ~ .sources.commonHeaders ~ .sources.rootHeaders /* Andrei ~ .sources.dmd.driver ~ .sources.dmd.frontend ~ .sources.root*/) .target(env["G"].buildPath("cxxfrontend").objName) // No explicit if since CXX_KIND will always be either g++ or clang++ .command([ env["CXX"], "-xc++", "-std=c++11", "-c", frontendRule.sources[0], "-o" ~ frontendRule.target, "-I" ~ env["D"] ] ~ flags["CXXFLAGS"]) ); alias cxxUnittestExe = methodInit!(BuildRule, (exeBuilder, exeRule) => exeBuilder .name("cxx-unittest") .description("Build the C++ unittests") .msg("(DC) CXX-UNITTEST") .deps([lexer(null, null), cxxFrontend]) .sources(sources.dmd.driver ~ sources.dmd.frontend ~ sources.root ~ sources.common) .target(env["G"].buildPath("cxx-unittest").exeName) .command([ env["HOST_DMD_RUN"], "-of=" ~ exeRule.target, "-vtls", "-J" ~ env["RES"], "-L-lstdc++", "-version=NoMain", "-version=NoBackend" ].chain( flags["DFLAGS"], exeRule.sources, exeRule.deps.map!(d => d.target) ).array) ); runCxxBuilder .name("cxx-unittest") .description("Run the C++ unittests") .msg("(RUN) CXX-UNITTEST"); version (Windows) runCxxBuilder .commandFunction({ abortBuild("Running the C++ unittests is not supported on Windows yet"); }); else runCxxBuilder .deps([cxxUnittestExe]) .command([cxxUnittestExe.target]); }); /// BuildRule that removes all generated files alias clean = makeRule!((builder, rule) => builder .name("clean") .description("Remove the generated directory") .msg("(RM) " ~ env["G"]) .commandFunction(delegate() { if (env["G"].exists) env["G"].rmdirRecurse; }) ); alias toolsRepo = makeRule!((builder, rule) => builder .target(env["TOOLS_DIR"]) .msg("(GIT) DLANG/TOOLS") .condition(() => !exists(rule.target)) .commandFunction(delegate() { auto toolsDir = env["TOOLS_DIR"]; version(Win32) // Win32-git seems to confuse C:\... as a relative path toolsDir = toolsDir.relativePath(compilerDir); run([env["GIT"], "clone", "--depth=1", env["GIT_HOME"] ~ "/tools", toolsDir]); }) ); alias checkwhitespace = makeRule!((builder, rule) => builder .name("checkwhitespace") .description("Check for trailing whitespace and tabs") .msg("(RUN) checkwhitespace") .deps([toolsRepo]) .sources(allRepoSources) .commandFunction(delegate() { const cmdPrefix = [env["HOST_DMD_RUN"], "-run", env["TOOLS_DIR"].buildPath("checkwhitespace.d")]; auto chunkLength = allRepoSources.length; version (Win32) chunkLength = 80; // avoid command-line limit on win32 foreach (nextSources; taskPool.parallel(allRepoSources.chunks(chunkLength), 1)) { const nextCommand = cmdPrefix ~ nextSources; run(nextCommand); } }) ); alias style = makeRule!((builder, rule) { const dscannerDir = env["GENERATED"].buildPath("dscanner"); alias dscannerRepo = methodInit!(BuildRule, (repoBuilder, repoRule) => repoBuilder .msg("(GIT) DScanner") .target(dscannerDir) .condition(() => !exists(dscannerDir)) .command([ // FIXME: Omitted --shallow-submodules because it requires a more recent // git version which is not available on buildkite env["GIT"], "clone", "--depth=1", "--recurse-submodules", "--branch=v0.11.0", "https://github.com/dlang-community/D-Scanner", dscannerDir ]) ); alias dscanner = methodInit!(BuildRule, (dscannerBuilder, dscannerRule) { dscannerBuilder .name("dscanner") .description("Build custom DScanner") .deps([dscannerRepo]); version (Windows) dscannerBuilder .msg("(CMD) DScanner") .target(dscannerDir.buildPath("bin", "dscanner".exeName)) .commandFunction(() { // The build script expects to be run inside dscannerDir run([dscannerDir.buildPath("build.bat")], dscannerDir); }); else dscannerBuilder .msg("(MAKE) DScanner") .target(dscannerDir.buildPath("dsc".exeName)) .command([ // debug build is faster but disable trace output env["MAKE"], "-C", dscannerDir, "debug", "DEBUG_VERSIONS=-version=StdLoggerDisableWarning" ]); }); builder .name("style") .description("Check for style errors using D-Scanner") .msg("(DSCANNER) dmd") .deps([dscanner]) // Disabled because we need to build a patched dscanner version // .command([ // "dub", "-q", "run", "-y", "dscanner", "--", "--styleCheck", "--config", // srcDir.buildPath(".dscanner.ini"), srcDir.buildPath("dmd"), "-I" ~ srcDir // ]) .command([ dscanner.target, "--styleCheck", "--config", srcDir.buildPath(".dscanner.ini"), srcDir.buildPath("dmd"), "-I" ~ srcDir ]); }); /// BuildRule to generate man pages alias man = makeRule!((builder, rule) { alias genMan = methodInit!(BuildRule, (genManBuilder, genManRule) => genManBuilder .target(env["G"].buildPath("gen_man")) .sources([ compilerDir.buildPath("docs", "gen_man.d"), env["D"].buildPath("cli.d")]) .command([ env["HOST_DMD_RUN"], "-I" ~ srcDir, "-of" ~ genManRule.target] ~ flags["DFLAGS"] ~ genManRule.sources) .msg(genManRule.command.join(" ")) ); const genManDir = env["GENERATED"].buildPath("docs", "man"); alias dmdMan = methodInit!(BuildRule, (dmdManBuilder, dmdManRule) => dmdManBuilder .target(genManDir.buildPath("man1", "dmd.1")) .deps([genMan, directoryRule(dmdManRule.target.dirName)]) .msg("(GEN_MAN) " ~ dmdManRule.target) .commandFunction(() { writeText(dmdManRule.target, genMan.target.execute.output); }) ); builder .name("man") .description("Generate and prepare man files") .deps([dmdMan].chain( "man1/dumpobj.1 man1/obj2asm.1 man5/dmd.conf.5".split .map!(e => methodInit!(BuildRule, (manFileBuilder, manFileRule) => manFileBuilder .target(genManDir.buildPath(e)) .sources([compilerDir.buildPath("docs", "man", e)]) .deps([directoryRule(manFileRule.target.dirName)]) .commandFunction(() => copyAndTouch(manFileRule.sources[0], manFileRule.target)) .msg("copy '%s' to '%s'".format(manFileRule.sources[0], manFileRule.target)) )) ).array); }); alias detab = makeRule!((builder, rule) => builder .name("detab") .description("Replace hard tabs with spaces") .command([env["DETAB"]] ~ allRepoSources) .msg("(DETAB) DMD") ); alias tolf = makeRule!((builder, rule) => builder .name("tolf") .description("Convert to Unix line endings") .command([env["TOLF"]] ~ allRepoSources) .msg("(TOLF) DMD") ); alias zip = makeRule!((builder, rule) => builder .name("zip") .target(srcDir.buildPath("dmdsrc.zip")) .description("Archive all source files") .sources(allBuildSources) .msg("ZIP " ~ rule.target) .commandFunction(() { if (exists(rule.target)) remove(rule.target); run([env["ZIP"], rule.target, thisBuildScript] ~ rule.sources); }) ); alias html = makeRule!((htmlBuilder, htmlRule) { htmlBuilder .name("html") .description("Generate html docs, requires DMD and STDDOC to be set"); static string d2html(string sourceFile) { const ext = sourceFile.extension(); assert(ext == ".d" || ext == ".di", sourceFile); const htmlFilePrefix = (sourceFile.baseName == "package.d") ? sourceFile[0 .. $ - "package.d".length - 1] : sourceFile[0 .. $ - ext.length]; return htmlFilePrefix ~ ".html"; } const stddocs = env.get("STDDOC", "").split(); auto docSources = .sources.common ~ .sources.root ~ .sources.lexer ~ .sources.dmd.all ~ env["D"].buildPath("frontend.d"); htmlBuilder.deps(docSources.chunks(1).map!(sourceArray => methodInit!(BuildRule, (docBuilder, docRule) { const source = sourceArray[0]; docBuilder .sources(sourceArray) .target(env["DOC_OUTPUT_DIR"].buildPath(d2html(source)[srcDir.length + 1..$] .replace(dirSeparator, "_"))) .deps([dmdDefault, versionFile, sysconfDirFile]) .command([ dmdDefault.deps[0].target, "-o-", "-c", "-Dd" ~ env["DOCSRC"], "-J" ~ env["RES"], "-I" ~ env["D"], srcDir.buildPath("project.ddoc") ] ~ stddocs ~ [ "-Df" ~ docRule.target, // Need to use a short relative path to make sure ddoc links are correct source.relativePath(runDir) ] ~ flags["DFLAGS"]) .msg("(DDOC) " ~ source); }) ).array); }); alias toolchainInfo = makeRule!((builder, rule) => builder .name("toolchain-info") .description("Show informations about used tools") .commandFunction(() { scope Appender!(char[]) app; void show(string what, string[] cmd) { const res = tryRun(cmd); const output = res.status != -1 ? res.output : "<Not available>"; app.formattedWrite("%s (%s): %s\n", what, cmd[0], output); } app.put("==== Toolchain Information ====\n"); version (Windows) show("SYSTEM", ["systeminfo"]); else show("SYSTEM", ["uname", "-a"]); show("MAKE", [env["MAKE"], "--version"]); version (Posix) show("SHELL", [env.getDefault("SHELL", nativeShell), "--version"]); // cmd.exe --version hangs show("HOST_DMD", [env["HOST_DMD_RUN"], "--version"]); version (Posix) show("HOST_CXX", [env["CXX"], "--version"]); show("ld", ["ld", "-v"]); show("gdb", ["gdb", "--version"]); app.put("==== Toolchain Information ====\n\n"); writeln(app.data); }) ); alias installCopy = makeRule!((builder, rule) => builder .name("install-copy") .description("Legacy alias for install") .deps([install]) ); alias install = makeRule!((builder, rule) { const dmdExeFile = dmdDefault.deps[0].target; auto sourceFiles = allBuildSources ~ [ env["D"].buildPath("README.md"), env["D"].buildPath("boostlicense.txt"), ]; builder .name("install") .description("Installs dmd into $(INSTALL)") .deps([dmdDefault]) .sources(sourceFiles) .commandFunction(() { version (Windows) { enum conf = "sc.ini"; enum bin = "bin"; } else { enum conf = "dmd.conf"; version (OSX) enum bin = "bin"; else const bin = "bin" ~ env["MODEL"]; } installRelativeFiles(env["INSTALL"].buildPath(env["OS"], bin), dmdExeFile.dirName, dmdExeFile.only, octal!755); version (Windows) installRelativeFiles(env["INSTALL"], compilerDir, sourceFiles); const scPath = buildPath(env["OS"], bin, conf); const iniPath = buildPath(compilerDir, "ini"); // The sources distributed alongside an official release only include the // configuration of the current OS at the root directory instead of the // whole `ini` folder in the project root. const confPath = iniPath.exists() ? buildPath(iniPath, scPath) : buildPath(dmdRepo, scPath); copyAndTouch(confPath, buildPath(env["INSTALL"], scPath)); version (Posix) copyAndTouch(sourceFiles[$-1], env["INSTALL"].buildPath("dmd-boostlicense.txt")); }); }); /** Goes through the target list and replaces short-hand targets with their expanded version. Special targets: - clean -> removes generated directory + immediately stops the builder Params: targets = the target list to process Returns: the expanded targets */ BuildRule[] predefinedTargets(string[] targets) { import std.functional : toDelegate; Appender!(BuildRule[]) newTargets; LtargetsLoop: foreach (t; targets) { t = t.buildNormalizedPath; // remove trailing slashes // check if `t` matches any rule names first foreach (rule; BuildRuleRange(rootRules.map!(a => a()).array)) { if (t == rule.name) { newTargets.put(rule); continue LtargetsLoop; } } switch (t) { case "all": // "all" must include dmd + dmd.conf newTargets ~= dmdDefault; break; default: // check this last, target paths should be checked after predefined names const tAbsolute = t.absolutePath.buildNormalizedPath; foreach (rule; BuildRuleRange(rootRules.map!(a => a()).array)) { foreach (ruleTarget; rule.targets) { if (ruleTarget.endsWith(t, tAbsolute)) { newTargets.put(rule); continue LtargetsLoop; } } } abortBuild("Target `" ~ t ~ "` is unknown."); } } return newTargets.data; } /// An input range for a recursive set of rules struct BuildRuleRange { private BuildRule[] next; private bool[BuildRule] added; this(BuildRule[] rules) { addRules(rules); } bool empty() const { return next.length == 0; } auto front() inout { return next[0]; } void popFront() { auto save = next[0]; next = next[1 .. $]; addRules(save.deps); } void addRules(BuildRule[] rules) { foreach (rule; rules) { if (!added.get(rule, false)) { next ~= rule; added[rule] = true; } } } } /// Sets the environment variables void parseEnvironment() { if (!verbose) verbose = "1" == env.getDefault("VERBOSE", null); // This block is temporary until we can remove the windows make files if ("DDEBUG" in environment) abortBuild("ERROR: the DDEBUG variable is deprecated!"); version (Windows) { // On windows, the OS environment variable is already being used by the system. // For example, on a default Windows7 system it's configured by the system // to be "Windows_NT". // // However, there are a good number of components in this repo and the other // repos that set this environment variable to "windows" without checking whether // it's already configured, i.e. // dmd\src\win32.mak (OS=windows) // druntime\win32.mak (OS=windows) // phobos\win32.mak (OS=windows) // // It's necessary to emulate the same behavior in this tool in order to make this // new tool compatible with existing tools. We can do this by also setting the // environment variable to "windows" whether or not it already has a value. // const os = env["OS"] = "windows"; } else const os = env.setDefault("OS", detectOS); auto build = env.setDefault("BUILD", "release"); enforce(build.among("release", "debug"), "BUILD must be 'debug' or 'release'"); if (build == "debug") env.setDefault("ENABLE_DEBUG", "1"); // detect Model auto model = env.setDefault("MODEL", detectModel); env["MODEL_FLAG"] = "-m" ~ env["MODEL"]; // detect PIC version(Posix) { // default to PIC if the host compiler supports, use PIC=1/0 to en-/disable PIC. // Note that shared libraries and C files are always compiled with PIC. bool pic = true; const picValue = env.getDefault("PIC", ""); switch (picValue) { case "": /** Keep the default **/ break; case "0": pic = false; break; case "1": pic = true; break; default: throw abortBuild(format("Variable 'PIC' should be '0', '1' or <empty> but got '%s'", picValue)); } version (X86) { // https://issues.dlang.org/show_bug.cgi?id=20466 static if (__VERSION__ < 2090) { pragma(msg, "Warning: PIC will be off by default for this build of DMD because of Issue 20466!"); pic = false; } } env["PIC_FLAG"] = pic ? "-fPIC" : ""; } else { env["PIC_FLAG"] = ""; } env.setDefault("GIT", "git"); env.setDefault("GIT_HOME", "https://github.com/dlang"); env.setDefault("SYSCONFDIR", "/etc"); env.setDefault("TMP", tempDir); env.setDefault("RES", srcDir.buildPath("dmd", "res")); env.setDefault("MAKE", "make"); version (Windows) enum installPref = ""; else enum installPref = ".."; env.setDefault("INSTALL", environment.get("INSTALL_DIR", compilerDir.buildPath(installPref, "install"))); env.setDefault("DOCSRC", compilerDir.buildPath("dlang.org")); env.setDefault("DOCDIR", srcDir); env.setDefault("DOC_OUTPUT_DIR", env["DOCDIR"]); auto d = env["D"] = srcDir.buildPath("dmd"); env["C"] = d.buildPath("backend"); env["COMMON"] = d.buildPath("common"); env["ROOT"] = d.buildPath("root"); env["EX"] = srcDir.buildPath("examples"); auto generated = env["GENERATED"] = dmdRepo.buildPath("generated"); auto g = env["G"] = generated.buildPath(os, build, model); mkdirRecurse(g); env.setDefault("TOOLS_DIR", compilerDir.dirName.buildPath("tools")); auto hostDmdDef = env.getDefault("HOST_DMD", null); if (hostDmdDef.length == 0) { const hostDmd = env.getDefault("HOST_DC", null); env["HOST_DMD"] = hostDmd.length ? hostDmd : "dmd"; } else // HOST_DMD may be defined in the environment env["HOST_DMD"] = hostDmdDef; // Auto-bootstrapping of a specific host compiler if (env.getNumberedBool("AUTO_BOOTSTRAP")) { auto hostDMDVer = env.getDefault("HOST_DMD_VER", "2.095.0"); writefln("Using Bootstrap compiler: %s", hostDMDVer); auto hostDMDRoot = env["G"].buildPath("host_dmd-"~hostDMDVer); auto hostDMDBase = hostDMDVer~"."~(os == "freebsd" ? os~"-"~model : os); auto hostDMDURL = "https://downloads.dlang.org/releases/2.x/"~hostDMDVer~"/dmd."~hostDMDBase; env["HOST_DMD"] = hostDMDRoot.buildPath("dmd2", os, os == "osx" ? "bin" : "bin"~model, "dmd"); env["HOST_DMD_PATH"] = env["HOST_DMD"]; // TODO: use dmd.conf from the host too (in case there's a global or user-level dmd.conf) env["HOST_DMD_RUN"] = env["HOST_DMD"]; if (!env["HOST_DMD"].exists) { writefln("Downloading DMD %s", hostDMDVer); auto curlFlags = "-fsSL --retry 5 --retry-max-time 120 --connect-timeout 5 --speed-time 30 --speed-limit 1024"; hostDMDRoot.mkdirRecurse; ("curl " ~ curlFlags ~ " " ~ hostDMDURL~".tar.xz | tar -C "~hostDMDRoot~" -Jxf - || rm -rf "~hostDMDRoot).spawnShell.wait; } } else { env["HOST_DMD_PATH"] = getHostDMDPath(env["HOST_DMD"]).strip.absolutePath; env["HOST_DMD_RUN"] = env["HOST_DMD_PATH"]; } if (!env["HOST_DMD_PATH"].exists) { abortBuild("No DMD compiler is installed. Try AUTO_BOOTSTRAP=1 or manually set the D host compiler with HOST_DMD"); } } /// Checks the environment variables and flags void processEnvironment() { import std.meta : AliasSeq; const os = env["OS"]; // Detect the host compiler kind and version const hostDmdInfo = [env["HOST_DMD_RUN"], `-Xi=compilerInfo`, `-Xf=-`].execute(); if (hostDmdInfo.status) // Failed, JSON output currently not supported for GDC { env["HOST_DMD_KIND"] = "gdc"; env["HOST_DMD_VERSION"] = "v2.076"; } else { /// Reads the content of a single field without parsing the entire JSON alias get = field => hostDmdInfo.output .findSplitAfter(field ~ `" : "`)[1] .findSplitBefore(`"`)[0]; const ver = env["HOST_DMD_VERSION"] = get(`version`)[1 .. "vX.XXX.X".length]; // Vendor was introduced in 2.080 if (ver < "2.080.1") { auto name = get("binary").baseName().stripExtension(); if (name == "ldmd2") name = "ldc"; else if (name == "gdmd") name = "gdc"; else enforce(name == "dmd", "Unknown compiler: " ~ name); env["HOST_DMD_KIND"] = name; } else { env["HOST_DMD_KIND"] = [ "Digital Mars D": "dmd", "LDC": "ldc", "GNU D": "gdc" ][get(`vendor`)]; } } env["DMD_PATH"] = env["G"].buildPath("dmd").exeName; env.setDefault("DETAB", "detab"); env.setDefault("TOLF", "tolf"); version (Windows) env.setDefault("ZIP", "zip32"); else env.setDefault("ZIP", "zip"); string[] dflags = ["-version=MARS", "-w", "-de", env["PIC_FLAG"], env["MODEL_FLAG"], "-J"~env["G"], "-I" ~ srcDir]; if (env["HOST_DMD_KIND"] != "gdc") dflags ~= ["-dip25"]; // gdmd doesn't support -dip25 // TODO: add support for dObjc auto dObjc = false; version(OSX) version(X86_64) dObjc = true; if (env.getNumberedBool("ENABLE_DEBUG")) { dflags ~= ["-g", "-debug"]; } if (env.getNumberedBool("ENABLE_RELEASE")) { dflags ~= ["-O", "-inline"]; if (!env.getNumberedBool("ENABLE_ASSERTS")) dflags ~= ["-release"]; } else { // add debug symbols for all non-release builds if (!dflags.canFind("-g")) dflags ~= ["-g"]; } if (env.getNumberedBool("ENABLE_LTO")) { switch (env["HOST_DMD_KIND"]) { case "dmd": stderr.writeln(`DMD does not support LTO! Ignoring ENABLE_LTO flag...`); break; case "ldc": dflags ~= "-flto=full"; // workaround missing druntime-ldc-lto on 32-bit releases // https://github.com/dlang/dmd/pull/14083#issuecomment-1125832084 if (env["MODEL"] != "32") dflags ~= "-defaultlib=druntime-ldc-lto"; break; case "gdc": dflags ~= "-flto"; break; default: assert(false, "Unknown host compiler kind: " ~ env["HOST_DMD_KIND"]); } } if (env.getNumberedBool("ENABLE_UNITTEST")) { dflags ~= ["-unittest"]; } if (env.getNumberedBool("ENABLE_PROFILE")) { dflags ~= ["-profile"]; } // Enable CTFE coverage for recent host compilers const cov = env["HOST_DMD_VERSION"] >= "2.094.0" ? "-cov=ctfe" : "-cov"; env["COVERAGE_FLAG"] = cov; if (env.getNumberedBool("ENABLE_COVERAGE")) { dflags ~= [ cov ]; } const sanitizers = env.getDefault("ENABLE_SANITIZERS", ""); if (!sanitizers.empty) { dflags ~= ["-fsanitize="~sanitizers]; } // Retain user-defined flags flags["DFLAGS"] = dflags ~= flags.get("DFLAGS", []); } /// Setup environment for a C++ compiler void processEnvironmentCxx() { // Windows requires additional work to handle e.g. Cygwin on Azure version (Windows) return; env.setDefault("CXX", "c++"); // env["CXX_KIND"] = detectHostCxx(); string[] warnings = [ "-Wall", "-Werror", "-Wno-narrowing", "-Wwrite-strings", "-Wcast-qual", "-Wno-format", "-Wmissing-format-attribute", "-Woverloaded-virtual", "-pedantic", "-Wno-long-long", "-Wno-variadic-macros", "-Wno-overlength-strings", ]; auto cxxFlags = warnings ~ [ "-g", "-fno-exceptions", "-fno-rtti", "-fno-common", "-fasynchronous-unwind-tables", "-DMARS=1", env["MODEL_FLAG"], env["PIC_FLAG"], ]; if (env.getNumberedBool("ENABLE_COVERAGE")) cxxFlags ~= "--coverage"; const sanitizers = env.getDefault("ENABLE_SANITIZERS", ""); if (!sanitizers.empty) cxxFlags ~= "-fsanitize=" ~ sanitizers; // Enable a temporary workaround in globals.h and rmem.h concerning // wrong name mangling using DMD. // Remove when the minimally required D version becomes 2.082 or later if (env["HOST_DMD_KIND"] == "dmd") { const output = run([ env["HOST_DMD_RUN"], "--version" ]); if (output.canFind("v2.079", "v2.080", "v2.081")) cxxFlags ~= "-DDMD_VERSION=2080"; } // Retain user-defined flags flags["CXXFLAGS"] = cxxFlags ~= flags.get("CXXFLAGS", []); } /// Returns: the host C++ compiler, either "g++" or "clang++" version (none) // Currently unused but will be needed at some point string detectHostCxx() { import std.meta: AliasSeq; const cxxVersion = [env["CXX"], "--version"].execute.output; alias GCC = AliasSeq!("g++", "gcc", "Free Software"); alias CLANG = AliasSeq!("clang"); const cxxKindIdx = cxxVersion.canFind(GCC, CLANG); enforce(cxxKindIdx, "Invalid CXX found: " ~ cxxVersion); return cxxKindIdx <= GCC.length ? "g++" : "clang++"; } //////////////////////////////////////////////////////////////////////////////// // D source files //////////////////////////////////////////////////////////////////////////////// /// Returns: all source files in the repository alias allRepoSources = memoize!(() => srcDir.dirEntries("*.{d,h,di}", SpanMode.depth).map!(e => e.name).array); /// Returns: all make/build files alias buildFiles = memoize!(() => "win32.mak posix.mak osmodel.mak build.d".split().map!(e => srcDir.buildPath(e)).array); /// Returns: all sources used in the build alias allBuildSources = memoize!(() => buildFiles ~ sources.dmd.all ~ sources.lexer ~ sources.common ~ sources.backend ~ sources.root ~ sources.commonHeaders ~ sources.frontendHeaders ~ sources.rootHeaders ); /// Returns: all source files for the compiler auto sourceFiles() { static struct DmdSources { string[] all, driver, frontend, glue, backendHeaders; } static struct Sources { DmdSources dmd; string[] lexer, common, root, backend, commonHeaders, frontendHeaders, rootHeaders; } static string[] fileArray(string dir, string files) { return files.split.map!(e => dir.buildPath(e)).array; } DmdSources dmd = { glue: fileArray(env["D"], " dmsc.d e2ir.d eh.d iasm.d iasmdmd.d iasmgcc.d glue.d objc_glue.d s2ir.d tocsym.d toctype.d tocvdebug.d todt.d toir.d toobj.d "), driver: fileArray(env["D"], "dinifile.d dmdparams.d gluelayer.d lib.d libelf.d libmach.d libmscoff.d libomf.d link.d mars.d scanelf.d scanmach.d scanmscoff.d scanomf.d vsoptions.d "), frontend: fileArray(env["D"], " access.d aggregate.d aliasthis.d apply.d argtypes_x86.d argtypes_sysv_x64.d argtypes_aarch64.d arrayop.d arraytypes.d astenums.d ast_node.d astcodegen.d asttypename.d attrib.d blockexit.d builtin.d canthrow.d chkformat.d cli.d clone.d compiler.d cond.d constfold.d cppmangle.d cppmanglewin.d cpreprocess.d ctfeexpr.d ctorflow.d dcast.d dclass.d declaration.d delegatize.d denum.d dimport.d dinterpret.d dmacro.d dmangle.d dmodule.d doc.d dscope.d dstruct.d dsymbol.d dsymbolsem.d dtemplate.d dtoh.d dversion.d escape.d expression.d expressionsem.d func.d hdrgen.d impcnvtab.d imphint.d importc.d init.d initsem.d inline.d inlinecost.d intrange.d json.d lambdacomp.d mtype.d mustuse.d nogc.d nspace.d ob.d objc.d opover.d optimize.d parse.d parsetimevisitor.d permissivevisitor.d printast.d safe.d sapply.d semantic2.d semantic3.d sideeffect.d statement.d statement_rewrite_walker.d statementsem.d staticassert.d staticcond.d stmtstate.d target.d templateparamsem.d traits.d transitivevisitor.d typesem.d typinf.d utils.d visitor.d foreachvar.d cparse.d "), backendHeaders: fileArray(env["C"], " cc.d cdef.d cgcv.d code.d cv4.d dt.d el.d global.d obj.d oper.d rtlsym.d code_x86.d iasm.d codebuilder.d ty.d type.d exh.d mach.d mscoff.d dwarf.d dwarf2.d xmm.d dlist.d melf.d "), }; foreach (member; __traits(allMembers, DmdSources)) { if (member != "all") dmd.all ~= __traits(getMember, dmd, member); } Sources sources = { dmd: dmd, frontendHeaders: fileArray(env["D"], " aggregate.h aliasthis.h arraytypes.h attrib.h compiler.h cond.h ctfe.h declaration.h dsymbol.h doc.h enum.h errors.h expression.h globals.h hdrgen.h identifier.h id.h import.h init.h json.h mangle.h module.h mtype.h nspace.h objc.h scope.h statement.h staticassert.h target.h template.h tokens.h version.h visitor.h "), lexer: fileArray(env["D"], " console.d entity.d errors.d file_manager.d globals.d id.d identifier.d lexer.d location.d tokens.d ") ~ fileArray(env["ROOT"], " array.d bitarray.d ctfloat.d file.d filename.d hash.d port.d region.d rmem.d rootobject.d stringtable.d utf.d "), common: fileArray(env["COMMON"], " bitfields.d file.d int128.d outbuffer.d string.d "), commonHeaders: fileArray(env["COMMON"], " outbuffer.h "), root: fileArray(env["ROOT"], " aav.d complex.d env.d longdouble.d man.d optional.d response.d speller.d string.d strtold.d "), rootHeaders: fileArray(env["ROOT"], " array.h bitarray.h complex_t.h ctfloat.h dcompat.h dsystem.h filename.h longdouble.h object.h optional.h port.h rmem.h root.h "), backend: fileArray(env["C"], " backend.d bcomplex.d evalu8.d divcoeff.d dvec.d go.d gsroa.d glocal.d gdag.d gother.d gflow.d out.d inliner.d gloop.d compress.d cgelem.d cgcs.d ee.d cod4.d cod5.d nteh.d blockopt.d mem.d cg.d cgreg.d dtype.d debugprint.d fp.d symbol.d symtab.d elem.d dcode.d cgsched.d cg87.d cgxmm.d cgcod.d cod1.d cod2.d cod3.d cv8.d dcgcv.d pdata.d util2.d var.d md5.d backconfig.d ph2.d drtlsym.d dwarfeh.d ptrntab.d dvarstats.d dwarfdbginf.d cgen.d os.d goh.d barray.d cgcse.d elpicpie.d machobj.d elfobj.d mscoffobj.d filespec.d newman.d cgobj.d aarray.d disasm86.d " ), }; return sources; } /** Downloads a file from a given URL Params: to = Location to store the file downloaded from = The URL to the file to download tries = The number of times to try if an attempt to download fails Returns: `true` if download succeeded */ bool download(string to, string from, uint tries = 3) { import std.net.curl : download, HTTP, HTTPStatusException; foreach(i; 0..tries) { try { log("Downloading %s ...", from); auto con = HTTP(from); download(from, to, con); if (con.statusLine.code == 200) return true; } catch(HTTPStatusException e) { if (e.status == 404) throw e; } log("Failed to download %s (Attempt %s of %s)", from, i + 1, tries); } return false; } /** Detects the host OS. Returns: a string from `{windows, osx,linux,freebsd,openbsd,netbsd,dragonflybsd,solaris}` */ string detectOS() { version(Windows) return "windows"; else version(OSX) return "osx"; else version(linux) return "linux"; else version(FreeBSD) return "freebsd"; else version(OpenBSD) return "openbsd"; else version(NetBSD) return "netbsd"; else version(DragonFlyBSD) return "dragonflybsd"; else version(Solaris) return "solaris"; else static assert(0, "Unrecognized or unsupported OS."); } /** Detects the host model Returns: 32, 64 or throws an Exception */ string detectModel() { string uname; if (detectOS == "solaris") uname = ["isainfo", "-n"].execute.output; else if (detectOS == "windows") { version (D_LP64) return "64"; // host must be 64-bit if this compiles else version (Windows) { import core.sys.windows.winbase; int is64; if (IsWow64Process(GetCurrentProcess(), &is64)) return is64 ? "64" : "32"; } } else uname = ["uname", "-m"].execute.output; if (uname.canFind("x86_64", "amd64", "64-bit", "64-Bit", "64 bit")) return "64"; if (uname.canFind("i386", "i586", "i686", "32-bit", "32-Bit", "32 bit")) return "32"; throw new Exception(`Cannot figure 32/64 model from "` ~ uname ~ `"`); } /** Gets the absolute path of the host's dmd executable Params: hostDmd = the command used to launch the host's dmd executable Returns: a string that is the absolute path of the host's dmd executable */ string getHostDMDPath(const string hostDmd) { version(Posix) return ["which", hostDmd].execute.output; else version(Windows) { if (hostDmd.canFind("/", "\\")) return hostDmd; return ["where", hostDmd].execute.output .lineSplitter.filter!(file => file != srcDir.buildPath("dmd.exe")).front; } else static assert(false, "Unrecognized or unsupported OS."); } /** Add the executable filename extension to the given `name` for the current OS. Params: name = the name to append the file extention to */ string exeName(const string name) { version(Windows) return name ~ ".exe"; return name; } /** Add the object file extension to the given `name` for the current OS. Params: name = the name to append the file extention to */ string objName(const string name) { version(Windows) return name ~ ".obj"; return name ~ ".o"; } /** Add the library file extension to the given `name` for the current OS. Params: name = the name to append the file extention to */ string libName(const string name) { version(Windows) return name ~ ".lib"; return name ~ ".a"; } /** Filter additional make-like assignments from args and add them to the environment e.g. ./build.d ARGS=foo sets env["ARGS"] = environment["ARGS"] = "foo". The variables DLFAGS and CXXFLAGS may contain flags intended for the respective compiler and set flags instead, e.g. ./build.d DFLAGS="-w -version=foo" results in flags["DFLAGS"] = ["-w", "-version=foo"]. Params: args = the command-line arguments from which the assignments will be removed */ void args2Environment(ref string[] args) { bool tryToAdd(string arg) { auto parts = arg.findSplit("="); if (!parts) return false; const key = parts[0]; const value = parts[2]; if (key.among("DFLAGS", "CXXFLAGS")) { flags[key] = value.split(); } else { environment[key] = value; env[key] = value; } return true; } args = args.filter!(a => !tryToAdd(a)).array; } /** Ensures that `env` contains a mapping for `key` and returns the associated value. Searches the process environment if it is missing and uses `default_` as a last fallback. Params: env = environment to check for `key` key = key to check for existence default_ = fallback value if `key` doesn't exist in the global environment Returns: the value associated to key */ string getDefault(ref string[string] env, string key, string default_) { if (auto ex = key in env) return *ex; if (key in environment) return environment[key]; else return default_; } /** Ensures that `env` contains a mapping for `key` and returns the associated value. Searches the process environment if it is missing and creates an appropriate entry in `env` using either the found value or `default_` as a fallback. Params: env = environment to write the check to key = key to check for existence and write into the new env default_ = fallback value if `key` doesn't exist in the global environment Returns: the value associated to key */ string setDefault(ref string[string] env, string key, string default_) { auto v = getDefault(env, key, default_); env[key] = v; return v; } /** Get the value of a build variable that should always be 0, 1 or empty. */ bool getNumberedBool(ref string[string] env, string varname) { const value = env.getDefault(varname, null); if (value.length == 0 || value == "0") return false; if (value == "1") return true; throw abortBuild(format("Variable '%s' should be '0', '1' or <empty> but got '%s'", varname, value)); } //////////////////////////////////////////////////////////////////////////////// // Mini build system //////////////////////////////////////////////////////////////////////////////// /** Checks whether any of the targets are older than the sources Params: targets = the targets to check sources = the source files to check against Returns: `true` if the target is up to date */ bool isUpToDate(R, S)(R targets, S sources) { if (force) return false; auto oldestTargetTime = SysTime.max; foreach (target; targets) { const time = target.timeLastModified.ifThrown(SysTime.init); if (time == SysTime.init) return false; oldestTargetTime = min(time, oldestTargetTime); } return sources.all!(s => s.timeLastModified.ifThrown(SysTime.init) <= oldestTargetTime); } /** Writes given the content to the given file. The content will only be written to the file specified in `path` if that file doesn't exist, or the content of the existing file is different from the given content. This makes sure the timestamp of the file is only updated when the content has changed. This will avoid rebuilding when the content hasn't changed. Params: path = the path to the file to write the content to content = the content to write to the file */ void updateIfChanged(const string path, const string content) { const existingContent = path.exists ? path.readText : ""; if (content != existingContent) writeText(path, content); } /** A rule has one or more sources and yields one or more targets. It knows how to build these target by invoking either the external command or the commandFunction. If a run fails, the entire build stops. */ class BuildRule { string target; // path to the resulting target file (if target is used, it will set targets) string[] targets; // list of all target files string[] sources; // list of all source files BuildRule[] deps; // dependencies to build before this one bool delegate() condition; // Optional condition to determine whether or not to run this rule string[] command; // the rule command void delegate() commandFunction; // a custom rule command which gets called instead of command string msg; // msg of the rule that is e.g. written to the CLI when it's executed string name; /// optional string that can be used to identify this rule string description; /// optional string to describe this rule rather than printing the target files /// Finish creating the rule by checking that it is configured properly void finalize() { if (target) { assert(!targets, "target and targets cannot both be set"); targets = [target]; } } /** Executes the rule Params: depUpdated = whether any dependency was built (skips isUpToDate) Returns: Whether the targets of this rule were (re)built **/ bool run(bool depUpdated = false) { if (condition !is null && !condition()) { log("Skipping build of %-(%s%) as its condition returned false", targets); return false; } if (!depUpdated && targets && targets.isUpToDate(this.sources.chain([thisBuildScript]))) { if (this.sources !is null) log("Skipping build of %-('%s' %)' because %s is newer than each of %-('%s' %)'", targets, targets.length > 1 ? "each of them" : "it", this.sources); return false; } // Display the execution of the rule if (msg) msg.writeln; if(dryRun) { scope writer = stdout.lockingTextWriter; if(commandFunction) { writer.put("\n => Executing commandFunction()"); if(name) writer.formattedWrite!" of %s"(name); if(targets.length) writer.formattedWrite!" to generate:\n%( - %s\n%)"(targets); writer.put('\n'); } if(command) writer.formattedWrite!"\n => %(%s %)\n\n"(command); } else { scope (failure) if (!verbose) dump(); if (commandFunction !is null) { commandFunction(); } else if (command.length) { command.run; } else // Do not automatically return true if the target has neither // command nor command function (e.g. dmdDefault) to avoid // unecessary rebuilds return depUpdated; } return true; } /// Writes relevant informations about this rule to stdout private void dump() { scope writer = stdout.lockingTextWriter; void write(T)(string fmt, T what) { static if (is(T : bool)) bool print = what; else bool print = what.length != 0; if (print) writer.formattedWrite(fmt, what); } writer.put("\nThe following operation failed:\n"); write("Name: %s\n", name); write("Description: %s\n", description); write("Dependencies: %-(\n -> %s%)\n\n", deps.map!(d => d.name ? d.name : d.target)); write("Sources: %-(\n -> %s%)\n\n", sources); write("Targets: %-(\n -> %s%)\n\n", targets); write("Command: %-(%s %)\n\n", command); write("CommandFunction: %-s\n\n", commandFunction ? "Yes" : null); writer.put("-----------------------------------------------------------\n"); } } /// Fake namespace containing all utilities to execute many rules in parallel abstract final class Scheduler { /** Builds the supplied targets in parallel using the global taskPool. Params: targets = rules to build **/ static void build(BuildRule[] targets) { // Create an execution plan to build all targets Context[BuildRule] contexts; Context[] topSorted, leaves; foreach(target; targets) findLeafs(target, contexts, topSorted, leaves); // Start all leaves in parallel, they will submit the remaining tasks recursively foreach (leaf; leaves) taskPool.put(leaf.task); // Await execution of all targets while executing pending tasks. The // topological order of tasks guarantees that every tasks was already // submitted to taskPool before we call workForce. foreach (context; topSorted) context.task.workForce(); } /** Recursively creates contexts instances for rule and all of its dependencies and stores them in contexts, tasks and leaves for further usage. Params: rule = current rule contexts = already created context instances tasks = context instances in topological order implied by Dependency.deps leaves = contexts of rules without dependencies Returns: the context belonging to rule **/ private static Context findLeafs(BuildRule rule, ref Context[BuildRule] contexts, ref Context[] all, ref Context[] leaves) { // This implementation is based on Tarjan's algorithm for topological sorting. auto context = contexts.get(rule, null); // Check whether the current node wasn't already visited if (context is null) { context = contexts[rule] = new Context(rule); // Leafs are rules without further dependencies if (rule.deps.empty) { leaves ~= context; } else { // Recursively visit all dependencies foreach (dep; rule.deps) { auto depContext = findLeafs(dep, contexts, all, leaves); depContext.requiredBy ~= context; } } // Append the current rule AFTER all dependencies all ~= context; } return context; } /// Metadata required for parallel execution private static class Context { import std.parallelism: createTask = task; alias Task = typeof(createTask(&Context.init.buildRecursive)); /// Task type BuildRule target; /// the rule to execute Context[] requiredBy; /// rules relying on this one shared size_t pendingDeps; /// amount of rules to be built shared bool depUpdated; /// whether any dependency of target was updated Task task; /// corresponding task /// Creates a new context for rule this(BuildRule rule) { this.target = rule; this.pendingDeps = rule.deps.length; this.task = createTask(&buildRecursive); } /** Builds the rule given by this context and schedules other rules requiring it (if the current was the last missing dependency) **/ private void buildRecursive() { import core.atomic: atomicLoad, atomicOp, atomicStore; /// Stores whether the current build is stopping because some step failed static shared bool aborting; if (atomicLoad(aborting)) return; // Abort but let other jobs finish scope (failure) atomicStore(aborting, true); // Build the current rule if (target.run(depUpdated)) { // Propagate that this rule's targets were (re)built foreach (parent; requiredBy) atomicStore(parent.depUpdated, true); } // Mark this rule as finished for all parent rules foreach (parent; requiredBy) { if (parent.pendingDeps.atomicOp!"-="(1) == 0) taskPool.put(parent.task); } } } } /** Initializes an object using a chain of method calls */ struct MethodInitializer(T) if (is(T == class)) // currenly only works with classes { private T obj; ref MethodInitializer opDispatch(string name)(typeof(__traits(getMember, T, name)) arg) { __traits(getMember, obj, name) = arg; return this; } } /** Create an object using a chain of method calls for each field. */ T methodInit(T, alias Func, Args...)(Args args) if (is(T == class)) // currently only works with classes { auto initializer = MethodInitializer!T(new T()); Func(initializer, initializer.obj, args); initializer.obj.finalize(); return initializer.obj; } /** Takes a lambda and returns a memoized function to build a rule object. The lambda takes a builder and a rule object. This differs from makeRuleWithArgs in that the function literal does not need explicit parameter types. */ alias makeRule(alias Func) = memoize!(methodInit!(BuildRule, Func)); /** Takes a lambda and returns a memoized function to build a rule object. The lambda takes a builder, rule object and any extra arguments needed to create the rule. This differs from makeRule in that the function literal must contain explicit parameter types. */ alias makeRuleWithArgs(alias Func) = memoize!(methodInit!(BuildRule, Func, Parameters!Func[2..$])); /** Logging primitive Params: spec = a format specifier args = the data to format to the log */ void log(T...)(string spec, T args) { if (verbose) writefln(spec, args); } /** Aborts the current build Params: msg = error message to display details = extra error details to display (e.g. a error diff) Throws: BuildException with the supplied message Returns: nothing but enables `throw abortBuild` to convey the resulting behavior */ BuildException abortBuild(string msg = "Build failed!", string details = "") { throw new BuildException(msg, details); } class BuildException : Exception { string details = ""; this(string msg, string details) { super(msg); this.details = details; } } /** The directory where all run commands are executed from. All relative file paths in a `run` command must be relative to `runDir`. */ alias runDir = compilerDir; /** Run a command which may not succeed and optionally log the invocation. Params: args = the command and command arguments to execute workDir = the commands working directory Returns: a tuple (status, output) */ auto tryRun(const(string)[] args, string workDir = runDir) { args = args.filter!(a => !a.empty).array; log("Run: %-(%s %)", args); try { return execute(args, null, Config.none, size_t.max, workDir); } catch (Exception e) // e.g. exececutable does not exist { return typeof(return)(-1, e.msg); } } /** Wrapper around execute that logs the execution and throws an exception for a non-zero exit code. Params: args = the command and command arguments to execute workDir = the commands working directory Returns: any output of the executed command */ string run(const string[] args, const string workDir = runDir) { auto res = tryRun(args, workDir); if (res.status) { string details; // Rerun with GDB if e.g. a segfault occurred // Limit this to executables within `generated` to not debug e.g. Git version (linux) if (res.status < 0 && args[0].startsWith(env["G"])) { // This should use --args to pass the command line parameters, but that // flag is only available since 7.1.1 and hence missing on some CI machines auto gdb = [ "gdb", "-batch", // "-q","-n", args[0], "-ex", "set backtrace limit 100", "-ex", format("run %-(%s %)", args[1..$]), "-ex", "bt", "-ex", "info args", "-ex", "info locals", ]; // Include gdb output as details (if GDB is available) const gdbRes = tryRun(gdb, workDir); if (gdbRes.status != -1) details = gdbRes.output; else log("Rerunning executable with GDB failed: %s", gdbRes.output); } abortBuild(res.output ? res.output : format("Last command failed with exit code %s", res.status), details); } return res.output; } /** Install `files` to `targetDir`. `files` in different directories but will be installed to the same relative location as they exist in the `sourceBase` directory. Params: targetDir = the directory to install files into sourceBase = the parent directory of all files. all files will be installed to the same relative directory in targetDir as they are from sourceBase files = the files to install. must be in sourceBase */ void installRelativeFiles(T)(string targetDir, string sourceBase, T files, uint attributes = octal!644) { struct FileToCopy { string name; string relativeName; string toString() { return relativeName; } } FileToCopy[][string] filesByDir; foreach (file; files) { assert(file.startsWith(sourceBase), "expected all files to be installed to be in '%s', but got '%s'".format(sourceBase, file)); const relativeFile = file.relativePath(sourceBase); filesByDir[relativeFile.dirName] ~= FileToCopy(file, relativeFile); } foreach (dirFilePair; filesByDir.byKeyValue) { const nextTargetDir = targetDir.buildPath(dirFilePair.key); writefln("copy these files %s from '%s' to '%s'", dirFilePair.value, sourceBase, nextTargetDir); mkdirRecurse(nextTargetDir); foreach (fileToCopy; dirFilePair.value) { std.file.copy(fileToCopy.name, targetDir.buildPath(fileToCopy.relativeName)); std.file.setAttributes(targetDir.buildPath(fileToCopy.relativeName), attributes); } } } /** Wrapper around std.file.copy that also updates the target timestamp. */ void copyAndTouch(const string from, const string to) { std.file.copy(from, to); const now = Clock.currTime; to.setTimes(now, now); } version (OSX) { // FIXME: Parallel executions hangs reliably on Mac (esp. the 'macair' // host used by the autotester) for unknown reasons outside of this script. pragma(msg, "Warning: Syncing file access because of OSX!"); // Wrap standard library functions to ensure mutually exclusive file access alias readText = fileAccess!(std.file.readText, string); alias writeText = fileAccess!(std.file.write, string, string); alias timeLastModified = fileAccess!(std.file.timeLastModified, string); import core.sync.mutex; __gshared Mutex fileAccessMutex; shared static this() { fileAccessMutex = new Mutex(); } auto fileAccess(alias dg, T...)(T args) { fileAccessMutex.lock_nothrow(); scope (exit) fileAccessMutex.unlock_nothrow(); return dg(args); } } else { alias writeText = std.file.write; }
D
// Written in the D programming language. /** * Templates with which to manipulate type tuples (also known as type lists). * * Some operations on type tuples are built in to the language, * such as TL[$(I n)] which gets the $(I n)th type from the * type tuple. TL[$(I lwr) .. $(I upr)] returns a new type * list that is a slice of the old one. * * References: * Based on ideas in Table 3.1 from * $(LINK2 http://amazon.com/exec/obidos/ASIN/0201704315/ref=ase_classicempire/102-2957199-2585768, * Modern C++ Design), * Andrei Alexandrescu (Addison-Wesley Professional, 2001) * Macros: * WIKI = Phobos/StdTypeTuple * * Copyright: Copyright Digital Mars 2005 - 2009. * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. * Authors: $(WEB digitalmars.com, Walter Bright) * Source: $(PHOBOSSRC std/_typetuple.d) */ /* Copyright Digital Mars 2005 - 2009. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ module std.typetuple; import std.traits; /** * Creates a typetuple out of a sequence of zero or more types. * Example: * --- * import std.typetuple; * alias TypeTuple!(int, double) TL; * * int foo(TL td) // same as int foo(int, double); * { * return td[0] + cast(int)td[1]; * } * --- * * Example: * --- * TypeTuple!(TL, char) * // is equivalent to: * TypeTuple!(int, double, char) * --- */ template TypeTuple(TList...) { alias TList TypeTuple; } /** * Returns the index of the first occurrence of type T in the * sequence of zero or more types TList. * If not found, -1 is returned. * Example: * --- * import std.typetuple; * import std.stdio; * * void foo() * { * writefln("The index of long is %s", * staticIndexOf!(long, TypeTuple!(int, long, double))); * // prints: The index of long is 1 * } * --- */ template staticIndexOf(T, TList...) { enum staticIndexOf = genericIndexOf!(T, TList).index; } /// Ditto template staticIndexOf(alias T, TList...) { enum staticIndexOf = genericIndexOf!(T, TList).index; } // [internal] private template genericIndexOf(args...) if (args.length >= 1) { alias Alias!(args[0]) e; alias args[1 .. $] tuple; static if (tuple.length) { alias Alias!(tuple[0]) head; alias tuple[1 .. $] tail; static if (isSame!(e, head)) { enum index = 0; } else { enum next = genericIndexOf!(e, tail).index; enum index = (next == -1) ? -1 : 1 + next; } } else { enum index = -1; } } unittest { static assert(staticIndexOf!( byte, byte, short, int, long) == 0); static assert(staticIndexOf!(short, byte, short, int, long) == 1); static assert(staticIndexOf!( int, byte, short, int, long) == 2); static assert(staticIndexOf!( long, byte, short, int, long) == 3); static assert(staticIndexOf!( char, byte, short, int, long) == -1); static assert(staticIndexOf!( -1, byte, short, int, long) == -1); static assert(staticIndexOf!(void) == -1); static assert(staticIndexOf!("abc", "abc", "def", "ghi", "jkl") == 0); static assert(staticIndexOf!("def", "abc", "def", "ghi", "jkl") == 1); static assert(staticIndexOf!("ghi", "abc", "def", "ghi", "jkl") == 2); static assert(staticIndexOf!("jkl", "abc", "def", "ghi", "jkl") == 3); static assert(staticIndexOf!("mno", "abc", "def", "ghi", "jkl") == -1); static assert(staticIndexOf!( void, "abc", "def", "ghi", "jkl") == -1); static assert(staticIndexOf!(42) == -1); static assert(staticIndexOf!(void, 0, "void", void) == 2); static assert(staticIndexOf!("void", 0, void, "void") == 2); } /// Kept for backwards compatibility alias staticIndexOf IndexOf; /** * Returns a typetuple created from TList with the first occurrence, * if any, of T removed. * Example: * --- * Erase!(long, int, long, double, char) * // is the same as: * TypeTuple!(int, double, char) * --- */ // template Erase(T, TList...) // { // static if (TList.length == 0) // alias TList Erase; // else static if (is(T == TList[0])) // alias TList[1 .. $] Erase; // else // alias TypeTuple!(TList[0], Erase!(T, TList[1 .. $])) Erase; // } template Erase(T, TList...) { alias GenericErase!(T, TList).result Erase; } /// Ditto template Erase(alias T, TList...) { alias GenericErase!(T, TList).result Erase; } // [internal] private template GenericErase(args...) if (args.length >= 1) { alias Alias!(args[0]) e; alias args[1 .. $] tuple; static if (tuple.length) { alias Alias!(tuple[0]) head; alias tuple[1 .. $] tail; static if (isSame!(e, head)) alias tail result; else alias TypeTuple!(head, GenericErase!(e, tail).result) result; } else { alias TypeTuple!() result; } } unittest { static assert(Pack!(Erase!(int, short, int, int, 4)). equals!(short, int, 4)); static assert(Pack!(Erase!(1, real, 3, 1, 4, 1, 5, 9)). equals!(real, 3, 4, 1, 5, 9)); } /** * Returns a typetuple created from TList with the all occurrences, * if any, of T removed. * Example: * --- * alias TypeTuple!(int, long, long, int) TL; * * EraseAll!(long, TL) * // is the same as: * TypeTuple!(int, int) * --- */ template EraseAll(T, TList...) { alias GenericEraseAll!(T, TList).result EraseAll; } /// Ditto template EraseAll(alias T, TList...) { alias GenericEraseAll!(T, TList).result EraseAll; } // [internal] private template GenericEraseAll(args...) if (args.length >= 1) { alias Alias!(args[0]) e; alias args[1 .. $] tuple; static if (tuple.length) { alias Alias!(tuple[0]) head; alias tuple[1 .. $] tail; alias GenericEraseAll!(e, tail).result next; static if (isSame!(e, head)) alias next result; else alias TypeTuple!(head, next) result; } else { alias TypeTuple!() result; } } unittest { static assert(Pack!(EraseAll!(int, short, int, int, 4)). equals!(short, 4)); static assert(Pack!(EraseAll!(1, real, 3, 1, 4, 1, 5, 9)). equals!(real, 3, 4, 5, 9)); } /** * Returns a typetuple created from TList with the all duplicate * types removed. * Example: * --- * alias TypeTuple!(int, long, long, int, float) TL; * * NoDuplicates!(TL) * // is the same as: * TypeTuple!(int, long, float) * --- */ template NoDuplicates(TList...) { static if (TList.length == 0) alias TList NoDuplicates; else alias TypeTuple!(TList[0], NoDuplicates!(EraseAll!(TList[0], TList[1 .. $]))) NoDuplicates; } unittest { static assert( Pack!( NoDuplicates!(1, int, 1, NoDuplicates, int, NoDuplicates, real)) .equals!(1, int, NoDuplicates, real)); } /** * Returns a typetuple created from TList with the first occurrence * of type T, if found, replaced with type U. * Example: * --- * alias TypeTuple!(int, long, long, int, float) TL; * * Replace!(long, char, TL) * // is the same as: * TypeTuple!(int, char, long, int, float) * --- */ template Replace(T, U, TList...) { alias GenericReplace!(T, U, TList).result Replace; } /// Ditto template Replace(alias T, U, TList...) { alias GenericReplace!(T, U, TList).result Replace; } /// Ditto template Replace(T, alias U, TList...) { alias GenericReplace!(T, U, TList).result Replace; } /// Ditto template Replace(alias T, alias U, TList...) { alias GenericReplace!(T, U, TList).result Replace; } // [internal] private template GenericReplace(args...) if (args.length >= 2) { alias Alias!(args[0]) from; alias Alias!(args[1]) to; alias args[2 .. $] tuple; static if (tuple.length) { alias Alias!(tuple[0]) head; alias tuple[1 .. $] tail; static if (isSame!(from, head)) alias TypeTuple!(to, tail) result; else alias TypeTuple!(head, GenericReplace!(from, to, tail).result) result; } else { alias TypeTuple!() result; } } unittest { static assert(Pack!(Replace!(byte, ubyte, short, byte, byte, byte)). equals!(short, ubyte, byte, byte)); static assert(Pack!(Replace!(1111, byte, 2222, 1111, 1111, 1111)). equals!(2222, byte, 1111, 1111)); static assert(Pack!(Replace!(byte, 1111, short, byte, byte, byte)). equals!(short, 1111, byte, byte)); static assert(Pack!(Replace!(1111, "11", 2222, 1111, 1111, 1111)). equals!(2222, "11", 1111, 1111)); } /** * Returns a typetuple created from TList with all occurrences * of type T, if found, replaced with type U. * Example: * --- * alias TypeTuple!(int, long, long, int, float) TL; * * ReplaceAll!(long, char, TL) * // is the same as: * TypeTuple!(int, char, char, int, float) * --- */ template ReplaceAll(T, U, TList...) { alias GenericReplaceAll!(T, U, TList).result ReplaceAll; } /// Ditto template ReplaceAll(alias T, U, TList...) { alias GenericReplaceAll!(T, U, TList).result ReplaceAll; } /// Ditto template ReplaceAll(T, alias U, TList...) { alias GenericReplaceAll!(T, U, TList).result ReplaceAll; } /// Ditto template ReplaceAll(alias T, alias U, TList...) { alias GenericReplaceAll!(T, U, TList).result ReplaceAll; } // [internal] private template GenericReplaceAll(args...) if (args.length >= 2) { alias Alias!(args[0]) from; alias Alias!(args[1]) to; alias args[2 .. $] tuple; static if (tuple.length) { alias Alias!(tuple[0]) head; alias tuple[1 .. $] tail; alias GenericReplaceAll!(from, to, tail).result next; static if (isSame!(from, head)) alias TypeTuple!(to, next) result; else alias TypeTuple!(head, next) result; } else { alias TypeTuple!() result; } } unittest { static assert(Pack!(ReplaceAll!(byte, ubyte, byte, short, byte, byte)). equals!(ubyte, short, ubyte, ubyte)); static assert(Pack!(ReplaceAll!(1111, byte, 1111, 2222, 1111, 1111)). equals!(byte, 2222, byte, byte)); static assert(Pack!(ReplaceAll!(byte, 1111, byte, short, byte, byte)). equals!(1111, short, 1111, 1111)); static assert(Pack!(ReplaceAll!(1111, "11", 1111, 2222, 1111, 1111)). equals!("11", 2222, "11", "11")); } /** * Returns a typetuple created from TList with the order reversed. * Example: * --- * alias TypeTuple!(int, long, long, int, float) TL; * * Reverse!(TL) * // is the same as: * TypeTuple!(float, int, long, long, int) * --- */ template Reverse(TList...) { static if (TList.length == 0) alias TList Reverse; else alias TypeTuple!(Reverse!(TList[1 .. $]), TList[0]) Reverse; } /** * Returns the type from TList that is the most derived from type T. * If none are found, T is returned. * Example: * --- * class A { } * class B : A { } * class C : B { } * alias TypeTuple!(A, C, B) TL; * * MostDerived!(Object, TL) x; // x is declared as type C * --- */ template MostDerived(T, TList...) { static if (TList.length == 0) alias T MostDerived; else static if (is(TList[0] : T)) alias MostDerived!(TList[0], TList[1 .. $]) MostDerived; else alias MostDerived!(T, TList[1 .. $]) MostDerived; } /** * Returns the typetuple TList with the types sorted so that the most * derived types come first. * Example: * --- * class A { } * class B : A { } * class C : B { } * alias TypeTuple!(A, C, B) TL; * * DerivedToFront!(TL) * // is the same as: * TypeTuple!(C, B, A) * --- */ template DerivedToFront(TList...) { static if (TList.length == 0) alias TList DerivedToFront; else alias TypeTuple!(MostDerived!(TList[0], TList[1 .. $]), DerivedToFront!(ReplaceAll!(MostDerived!(TList[0], TList[1 .. $]), TList[0], TList[1 .. $]))) DerivedToFront; } /** Evaluates to $(D TypeTuple!(F!(T[0]), F!(T[1]), ..., F!(T[$ - 1]))). Example: ---- alias staticMap!(Unqual, int, const int, immutable int) T; static assert(is(T == TypeTuple!(int, int, int))); ---- */ template staticMap(alias F, T...) { static if (T.length == 0) { alias TypeTuple!() staticMap; } else { alias TypeTuple!(F!(T[0]), staticMap!(F, T[1 .. $])) staticMap; } } unittest { // empty alias staticMap!(Unqual) Empty; static assert(Empty.length == 0); // single alias staticMap!(Unqual, const int) Single; static assert(is(Single == TypeTuple!int)); alias staticMap!(Unqual, int, const int, immutable int) T; static assert(is(T == TypeTuple!(int, int, int))); } /** Evaluates to $(D F!(T[0]) && F!(T[1]) && ... && F!(T[$ - 1])). Example: ---- static assert(!allSatisfy!(isIntegral, int, double)); static assert(allSatisfy!(isIntegral, int, long)); ---- */ template allSatisfy(alias F, T...) { static if (T.length == 0) { enum bool allSatisfy = true; } else static if (T.length == 1) { alias F!(T[0]) allSatisfy; } else { enum bool allSatisfy = F!(T[0]) && allSatisfy!(F, T[1 .. $]); } } unittest { static assert(!allSatisfy!(isIntegral, int, double)); static assert(allSatisfy!(isIntegral, int, long)); } /** Evaluates to $(D F!(T[0]) || F!(T[1]) || ... || F!(T[$ - 1])). Example: ---- static assert(!anySatisfy!(isIntegral, string, double)); static assert(anySatisfy!(isIntegral, int, double)); ---- */ template anySatisfy(alias F, T...) { static if(T.length == 0) { enum bool anySatisfy = false; } else static if (T.length == 1) { alias F!(T[0]) anySatisfy; } else { enum bool anySatisfy = F!(T[0]) || anySatisfy!(F, T[1 .. $]); } } unittest { static assert(!anySatisfy!(isIntegral, string, double)); static assert(anySatisfy!(isIntegral, int, double)); } // : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : // private: /* * [internal] With the builtin alias declaration, you cannot declare * aliases of, for example, literal values. You can alias anything * including literal values via this template. */ private { // symbols and literal values template Alias(alias a) { static if (__traits(compiles, { alias a x; })) alias a Alias; else static if (__traits(compiles, { enum x = a; })) enum Alias = a; else static assert(0, "Cannot alias " ~ a.stringof); } // types and tuples template Alias(a...) { alias a Alias; } } unittest { enum abc = 1; static assert(__traits(compiles, { alias Alias!(123) a; })); static assert(__traits(compiles, { alias Alias!(abc) a; })); static assert(__traits(compiles, { alias Alias!(int) a; })); static assert(__traits(compiles, { alias Alias!(1,abc,int) a; })); } /* * [internal] Returns true if a and b are the same thing, or false if * not. Both a and b can be types, literals, or symbols. * * How: When: * is(a == b) - both are types * a == b - both are literals (true literals, enums) * __traits(isSame, a, b) - other cases (variables, functions, * templates, etc.) */ private template isSame(ab...) if (ab.length == 2) { static if (__traits(compiles, expectType!(ab[0]), expectType!(ab[1]))) { enum isSame = is(ab[0] == ab[1]); } else static if (!__traits(compiles, expectType!(ab[0])) && !__traits(compiles, expectType!(ab[1])) && __traits(compiles, expectBool!(ab[0] == ab[1]))) { static if (!__traits(compiles, &ab[0]) || !__traits(compiles, &ab[1])) enum isSame = (ab[0] == ab[1]); else enum isSame = __traits(isSame, ab[0], ab[1]); } else { enum isSame = __traits(isSame, ab[0], ab[1]); } } private template expectType(T) {} private template expectBool(bool b) {} unittest { static assert( isSame!(int, int)); static assert(!isSame!(int, short)); enum a = 1, b = 1, c = 2, s = "a", t = "a"; static assert( isSame!(1, 1)); static assert( isSame!(a, 1)); static assert( isSame!(a, b)); static assert(!isSame!(b, c)); static assert( isSame!("a", "a")); static assert( isSame!(s, "a")); static assert( isSame!(s, t)); static assert(!isSame!(1, "1")); static assert(!isSame!(a, "a")); static assert( isSame!(isSame, isSame)); static assert(!isSame!(isSame, a)); static assert(!isSame!(byte, a)); static assert(!isSame!(short, isSame)); static assert(!isSame!(a, int)); static assert(!isSame!(long, isSame)); static immutable X = 1, Y = 1, Z = 2; static assert( isSame!(X, X)); static assert(!isSame!(X, Y)); static assert(!isSame!(Y, Z)); int foo(); int bar(); real baz(int); static assert( isSame!(foo, foo)); static assert(!isSame!(foo, bar)); static assert(!isSame!(bar, baz)); static assert( isSame!(baz, baz)); static assert(!isSame!(foo, 0)); int x, y; real z; static assert( isSame!(x, x)); static assert(!isSame!(x, y)); static assert(!isSame!(y, z)); static assert( isSame!(z, z)); static assert(!isSame!(x, 0)); } /* * [internal] Confines a tuple within a template. */ private template Pack(T...) { alias T tuple; // For convenience template equals(U...) { static if (T.length == U.length) { static if (T.length == 0) enum equals = true; else enum equals = isSame!(T[0], U[0]) && Pack!(T[1 .. $]).equals!(U[1 .. $]); } else { enum equals = false; } } } unittest { static assert( Pack!(1, int, "abc").equals!(1, int, "abc")); static assert(!Pack!(1, int, "abc").equals!(1, int, "cba")); } /++ Filters a $(D TypeTuple) using a template predicate. Returns a $(D TypeTuple) of the elements which satisfy the predicate. Examples: -------------------- static assert(is(Filter!(isNarrowString, string, wstring, dchar[], char[], dstring, int) == TypeTuple!(string, wstring, char[]))); static assert(is(Filter!(isUnsigned, int, byte, ubyte, dstring, dchar, uint, ulong) == TypeTuple!(ubyte, uint, ulong))); -------------------- +/ template Filter(alias pred, TList...) { static if(TList.length == 0) alias TypeTuple!() Filter; else static if(pred!(TList[0])) alias TypeTuple!(TList[0], Filter!(pred, TList[1 .. $])) Filter; else alias Filter!(pred, TList[1 .. $]) Filter; } //Verify Examples unittest { static assert(is(Filter!(isNarrowString, string, wstring, dchar[], char[], dstring, int) == TypeTuple!(string, wstring, char[]))); static assert(is(Filter!(isUnsigned, int, byte, ubyte, dstring, dchar, uint, ulong) == TypeTuple!(ubyte, uint, ulong))); } unittest { static assert(is(Filter!(isPointer, int, void*, char[], int*) == TypeTuple!(void*, int*))); static assert(is(Filter!isPointer == TypeTuple!())); }
D
/** * * Copyright: Copyright Digital Mars 2011 - 2012. * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). * Authors: Martin Nowak */ /* Copyright Digital Mars 2011. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) */ module rt.tlsgc; import core.stdc.stdlib; static import rt.lifetime, rt.sections; /** * Per thread record to store thread associated data for garbage collection. */ struct Data { typeof(rt.sections.initTLSRanges()) tlsRanges; rt.lifetime.BlkInfo** blockInfoCache; } /** * Initialization hook, called FROM each thread. No assumptions about * module initialization state should be made. */ void* init() nothrow @nogc { auto data = cast(Data*).malloc(Data.sizeof); import core.exception; if ( data is null ) core.exception.onOutOfMemoryError(); *data = Data.init; // do module specific initialization data.tlsRanges = rt.sections.initTLSRanges(); data.blockInfoCache = &rt.lifetime.__blkcache_storage; return data; } /** * Finalization hook, called FOR each thread. No assumptions about * module initialization state should be made. */ void destroy(void* data) nothrow @nogc { // do module specific finalization rt.sections.finiTLSRanges((cast(Data*)data).tlsRanges); .free(data); } alias void delegate(void* pstart, void* pend) nothrow ScanDg; /** * GC scan hook, called FOR each thread. Can be used to scan * additional thread local memory. */ void scan(void* data, scope ScanDg dg) nothrow { // do module specific marking rt.sections.scanTLSRanges((cast(Data*)data).tlsRanges, dg); } alias int delegate(void* addr) nothrow IsMarkedDg; /** * GC sweep hook, called FOR each thread. Can be used to free * additional thread local memory or associated data structures. Note * that only memory allocated from the GC can have marks. */ void processGCMarks(void* data, scope IsMarkedDg dg) nothrow { // do module specific sweeping rt.lifetime.processGCMarks(*(cast(Data*)data).blockInfoCache, dg); }
D
/Users/slitovchenko/Documents/Smack/DerivedData/Smack/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate.o : /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/MultipartFormData.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Timeline.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Alamofire.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Response.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/TaskDelegate.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/SessionDelegate.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ParameterEncoding.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Validation.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ResponseSerialization.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/SessionManager.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/AFError.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Notifications.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Result.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Request.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/slitovchenko/Documents/Smack/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/slitovchenko/Documents/Smack/DerivedData/Smack/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/slitovchenko/Documents/Smack/DerivedData/Smack/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate~partial.swiftmodule : /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/MultipartFormData.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Timeline.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Alamofire.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Response.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/TaskDelegate.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/SessionDelegate.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ParameterEncoding.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Validation.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ResponseSerialization.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/SessionManager.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/AFError.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Notifications.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Result.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Request.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/slitovchenko/Documents/Smack/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/slitovchenko/Documents/Smack/DerivedData/Smack/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/slitovchenko/Documents/Smack/DerivedData/Smack/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate~partial.swiftdoc : /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/MultipartFormData.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Timeline.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Alamofire.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Response.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/TaskDelegate.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/SessionDelegate.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ParameterEncoding.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Validation.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ResponseSerialization.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/SessionManager.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/AFError.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Notifications.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Result.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/Request.swift /Users/slitovchenko/Documents/Smack/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/slitovchenko/Documents/Smack/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/slitovchenko/Documents/Smack/DerivedData/Smack/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/* REQUIRED_ARGS: -m64 PERMUTE_ARGS: TEST_OUTPUT: --- fail_compilation/test16381.d(16): Error: `foo()` is not an lvalue --- */ // https://issues.dlang.org/show_bug.cgi?id=16381 __vector(float[4]) foo(); void bar() { float g = foo().ptr[0]; }
D
//Автор Кристофер Миллер. Переработано для Динрус Виталием Кулич. //Библиотека визуальных конпонентов VIZ (первоначально DFL). module viz.timer; private import viz.common, viz.app; /*export*/ class Таймер // docmain { /*export*/ //СобОбработчик тик; Событие!(Таймер, АргиСоб) тик; проц включен(бул on) // setter { if(on) старт(); else стоп(); } бул включен() // getter { return timerId != 0; } final проц интервал(т_мера timeout) // setter { if(!timeout) throw new ВизИскл("Неправильный интервал таймера"); if(this._timeout != timeout) { this._timeout = timeout; if(timerId) { // I don't know if this is the correct behavior. // Reset the timer for the new timeout... стоп(); старт(); } } } final т_мера интервал() // getter { return _timeout; } final проц старт() { if(timerId) return; assert(_timeout > 0); timerId = SetTimer(пусто, 0, _timeout, &процТаймера); if(!timerId) throw new ВизИскл("Не удаётся запустить таймер"); всеТаймеры[timerId] = this; } final проц стоп() { if(timerId) { //delete всеТаймеры[timerId]; всеТаймеры.remove(timerId); KillTimer(пусто, timerId); timerId = 0; } } this() { } this(проц delegate(Таймер) дг) { this(); if(дг) { this._dg = дг; тик ~= &_dgcall; } } this(проц delegate(Объект, АргиСоб) дг) { assert(дг !is пусто); this(); тик ~= дг; } this(проц delegate(Таймер, АргиСоб) дг) { assert(дг !is пусто); this(); тик ~= дг; } ~this() { вымести(); } проц вымести() { стоп(); } проц наТик(АргиСоб ea) { тик(this, ea); } private: DWORD _timeout = 100; UINT timerId = 0; проц delegate(Таймер) _dg; проц _dgcall(Объект отправитель, АргиСоб ea) { assert(_dg !is пусто); _dg(this); } } private: Таймер[UINT] всеТаймеры; extern(Windows) проц процТаймера(УОК уок, UINT uMsg, UINT idEvent, DWORD dwTime) { try { if(idEvent in всеТаймеры) { всеТаймеры[idEvent].наТик(АргиСоб.пуст); } else { debug(APP_PRINT) скажиф("Неизвестный таймер 0x%X.\n", idEvent); } } catch(Объект e) { Приложение.приИсклНити(e); } }
D
the line at which the sky and Earth appear to meet the range of interest or activity that can be anticipated a specific layer or stratum of soil or subsoil in a vertical cross section of land the great circle on the celestial sphere whose plane passes through the sensible horizon and the center of the Earth
D
instance DIA_ORLAN_EXIT(C_INFO) { npc = bau_970_orlan; nr = 999; condition = dia_orlan_exit_condition; information = dia_orlan_exit_info; permanent = TRUE; description = DIALOG_ENDE; }; func int dia_orlan_exit_condition() { return TRUE; }; func void dia_orlan_exit_info() { AI_StopProcessInfos(self); }; instance DIA_ORLAN_WEIN(C_INFO) { npc = bau_970_orlan; nr = 3; condition = dia_orlan_wein_condition; information = dia_orlan_wein_info; permanent = FALSE; description = "Přinesl jsem víno z kláštera."; }; func int dia_orlan_wein_condition() { if((MIS_GORAXWEIN == LOG_RUNNING) && (Npc_HasItems(other,itfo_wine) >= 12)) { return TRUE; }; }; func void dia_orlan_wein_info() { AI_Output(other,self,"DIA_Orlan_Wein_15_00"); //Přinesl jsem víno z kláštera. AI_Output(self,other,"DIA_Orlan_Wein_05_01"); //Výborně. To je to, na co jsem čekal. AI_Output(self,other,"DIA_Orlan_Wein_05_02"); //Už jsem přistoupil na Goraxovu cenu. Hned teď ti dám 100 zlatých. Info_ClearChoices(dia_orlan_wein); Info_AddChoice(dia_orlan_wein,"Dobrá, tak mi dej to zlato.",dia_orlan_wein_ja); Info_AddChoice(dia_orlan_wein,"Ty se mě snažíš napálit?",dia_orlan_wein_nein); }; func void dia_orlan_wein_ja() { AI_Output(other,self,"DIA_Orlan_Wein_JA_15_00"); //Dobrá, tak mi dej to zlato. AI_Output(self,other,"DIA_Orlan_Wein_JA_05_01"); //Tady máš. Bylo mi potěšením s tebou obchodovat. b_giveinvitems(self,other,itmi_gold,100); b_giveinvitems(other,self,itfo_wine,12); Info_ClearChoices(dia_orlan_wein); }; func void dia_orlan_wein_nein() { AI_Output(other,self,"DIA_Orlan_Wein_NEIN_15_00"); //Pokoušíš se mě obrat? Cena je 240 zlatých. AI_Output(self,other,"DIA_Orlan_Wein_NEIN_05_01"); //Gorax tě snad varoval, ne? Dobrá, možná bychom na tom mohli vydělat oba. Hele - dám ti za to víno 100 zlatých. AI_Output(self,other,"DIA_Orlan_Wein_NEIN_05_02"); //Řekneš Goraxovi, že jsem tě natáhl, a já ti dám ČTYŘI magické svitky. Info_ClearChoices(dia_orlan_wein); Info_AddChoice(dia_orlan_wein,"Hej, prostě mi dej 240 zlatých.",dia_orlan_wein_nie); Info_AddChoice(dia_orlan_wein,"Dobrá, to zní docela férově. Dej mi ty svitky.",dia_orlan_wein_okay); Info_AddChoice(dia_orlan_wein,"Co to je za svitky?",dia_orlan_wein_was); }; func void dia_orlan_wein_nie() { AI_Output(other,self,"DIA_Orlan_Wein_Nie_15_00"); //Hej, prostě mi dej 240 zlatých. AI_Output(self,other,"DIA_Orlan_Wein_Nie_05_01"); //Copak na tom nechceš vydělat, co? (povzdych) Dobrá, tady je zlato. b_giveinvitems(self,other,itmi_gold,240); b_giveinvitems(other,self,itfo_wine,12); Info_ClearChoices(dia_orlan_wein); }; func void dia_orlan_wein_okay() { var string text; text = ConcatStrings("4",PRINT_ITEMSERHALTEN); PrintScreen(text,-1,-1,FONT_SCREENSMALL,2); b_giveinvitems(self,other,itmi_gold,100); AI_Output(other,self,"DIA_Orlan_Wein_Okay_15_00"); //Dobrá, to zní docela férově. Dej mi ty svitky. AI_Output(self,other,"DIA_Orlan_Wein_Okay_05_01"); //Tady jsou svitky a zlato. b_giveinvitems(other,self,itfo_wine,12); CreateInvItems(hero,itsc_light,2); CreateInvItems(hero,itsc_lightheal,1); CreateInvItems(hero,itsc_sumgobskel,1); Info_ClearChoices(dia_orlan_wein); }; func void dia_orlan_wein_was() { AI_Output(other,self,"DIA_Orlan_Wein_Was_15_00"); //Co to je za svitky? AI_Output(self,other,"DIA_Orlan_Wein_Was_05_01"); //Netuším - o tomhle já nic nevím. Jsou od hosta, co... ehm... je tady zapomněl, jo. }; instance DIA_ORLAN_WERBISTDU(C_INFO) { npc = bau_970_orlan; nr = 2; condition = dia_orlan_werbistdu_condition; information = dia_orlan_werbistdu_info; description = "Kdo jsi?"; }; func int dia_orlan_werbistdu_condition() { return TRUE; }; func void dia_orlan_werbistdu_info() { AI_Output(other,self,"DIA_Orlan_WERBISTDU_15_00"); //Kdo jsi? AI_Output(self,other,"DIA_Orlan_WERBISTDU_05_01"); //Jsem Orlan, majitel téhle skromné hospody. AI_Output(self,other,"DIA_Orlan_WERBISTDU_05_02"); //Co sháníš, cizinče? Možná pořádný meč, nebo snad kus dobrého brnění? AI_Output(self,other,"DIA_Orlan_WERBISTDU_05_03"); //Doušek něčeho dobrého z venkovských palíren, nebo jen nějakou informaci? AI_Output(self,other,"DIA_Orlan_WERBISTDU_05_04"); //Můžu ti to nabídnou všechno a dokonce ještě víc, pokud jsou tvé mince pravé. }; instance DIA_ADDON_ORLAN_GREG(C_INFO) { npc = bau_970_orlan; nr = 5; condition = dia_addon_orlan_greg_condition; information = dia_addon_orlan_greg_info; description = "Znáš toho chlápka s páskou přes oko?"; }; func int dia_addon_orlan_greg_condition() { if((SC_SAWGREGINTAVERNE == TRUE) && (KAPITEL <= 3) && Npc_KnowsInfo(other,dia_orlan_werbistdu)) { return TRUE; }; }; func void dia_addon_orlan_greg_info() { AI_Output(other,self,"DIA_Addon_Orlan_Greg_15_00"); //Znáš toho chlápka s páskou přes oko? AI_Output(self,other,"DIA_Addon_Orlan_Greg_05_01"); //Už jsem ho tu jednou viděl - takový hrubián. AI_Output(self,other,"DIA_Addon_Orlan_Greg_05_02"); //Ubytoval se v jednom z mých pokojů. Měl s sebou obrovskou truhlu. AI_Output(self,other,"DIA_Addon_Orlan_Greg_05_03"); //Až když jsem mu to několikrát připomínal, tak mi konečně zaplatil nájem za pokoj - vůbec s tím nespěchal. AI_Output(self,other,"DIA_Addon_Orlan_Greg_05_04"); //A pak byl jednou prostě pryč. I se svou truhlou. Už nechci nic mít s lidmi jako on. }; instance DIA_ADDON_ORLAN_RANGER(C_INFO) { npc = bau_970_orlan; nr = 2; condition = dia_addon_orlan_ranger_condition; information = dia_addon_orlan_ranger_info; description = "Zdá se mi to nebo fakt zíráš na můj prsten?"; }; func int dia_addon_orlan_ranger_condition() { if(Npc_KnowsInfo(other,dia_orlan_werbistdu) && (SCISWEARINGRANGERRING == TRUE)) { return TRUE; }; }; func void dia_addon_orlan_ranger_info() { AI_Output(other,self,"DIA_Addon_Orlan_Ranger_15_00"); //Zdá se mi to nebo fakt zíráš na můj prsten? AI_Output(self,other,"DIA_Addon_Orlan_Ranger_05_01"); //Nejsem si jistý co s tím. ORLAN_KNOWSSCASRANGER = TRUE; Info_ClearChoices(dia_addon_orlan_ranger); Info_AddChoice(dia_addon_orlan_ranger,"Člověče! Patřím ke 'Kruhu Vody'!",dia_addon_orlan_ranger_idiot); Info_AddChoice(dia_addon_orlan_ranger,"Je to akvamarín. Už jsi někdy nějaký viděl?",dia_addon_orlan_ranger_aqua); }; func void dia_addon_orlan_ranger_aqua() { AI_Output(other,self,"DIA_Addon_Orlan_Ranger_Aqua_15_00"); //Je to akvamarín. Už jsi někdy nějaký viděl? AI_Output(self,other,"DIA_Addon_Orlan_Ranger_Aqua_05_01"); //Jo. Vítej na velitelství, bratře Kruhu. if(Npc_KnowsInfo(other,dia_addon_orlan_nomeeting)) { AI_Output(self,other,"DIA_Addon_Orlan_Ranger_Aqua_05_02"); //... i když se nazdáš být nejchytřejší ... }; AI_Output(self,other,"DIA_Addon_Orlan_Ranger_Aqua_05_03"); //Co pro tebe můžu udělat? Info_ClearChoices(dia_addon_orlan_ranger); b_giveplayerxp(XP_AMBIENT); }; func void dia_addon_orlan_ranger_idiot() { AI_Output(other,self,"DIA_Addon_Orlan_Ranger_Lares_15_00"); //Člověče! Patřím ke 'Kruhu Vody'! AI_Output(self,other,"DIA_Addon_Orlan_Ranger_Lares_05_01"); //Vidím, vidím. Vypadá to, jako by zjistili, že jsou to správní pitomci ... AI_Output(self,other,"DIA_Addon_Orlan_Ranger_Lares_05_02"); //Co chceš? Info_ClearChoices(dia_addon_orlan_ranger); }; instance DIA_ADDON_ORLAN_TELEPORTSTEIN(C_INFO) { npc = bau_970_orlan; nr = 2; condition = dia_addon_orlan_teleportstein_condition; information = dia_addon_orlan_teleportstein_info; description = "Už jsi někdy použil teleportarční kámen?"; }; func int dia_addon_orlan_teleportstein_condition() { if((ORLAN_KNOWSSCASRANGER == TRUE) && (SCUSED_TELEPORTER == TRUE)) { return TRUE; }; }; func void dia_addon_orlan_teleportstein_info() { AI_Output(other,self,"DIA_Addon_Orlan_Teleportstein_15_00"); //Už jsi někdy použil teleportační kámen? AI_Output(self,other,"DIA_Addon_Orlan_Teleportstein_05_01"); //Zbláznil ses? Dokud mi mágové Vody neřeknou, že je to bezpečné, nepřiblížím se na 10 kroků. AI_Output(self,other,"DIA_Addon_Orlan_Teleportstein_05_02"); //Pověřili mě, abych schoval jeden z těch teleportačních kámenů a to je přesně to, co chci udělat. b_giveplayerxp(XP_AMBIENT); Info_ClearChoices(dia_addon_orlan_teleportstein); Info_AddChoice(dia_addon_orlan_teleportstein,"Můžu se na ten teleportarční kámen mrknout?",dia_addon_orlan_teleportstein_sehen); Info_AddChoice(dia_addon_orlan_teleportstein,"Kde je přesně ten teleportační kámen?",dia_addon_orlan_teleportstein_wo); }; func void dia_addon_orlan_teleportstein_sehen() { AI_Output(other,self,"DIA_Addon_Orlan_Teleportstein_sehen_15_00"); //Můžu se na ten teleportační kámen mrknout? AI_Output(self,other,"DIA_Addon_Orlan_Teleportstein_sehen_05_01"); //Pro mě za mě. Tady je klíč. Zatarasil jsem vchod. CreateInvItems(self,itke_orlan_teleportstation,1); b_giveinvitems(self,other,itke_orlan_teleportstation,1); Log_CreateTopic(TOPIC_ADDON_TELEPORTSNW,LOG_MISSION); Log_SetTopicStatus(TOPIC_ADDON_TELEPORTSNW,LOG_RUNNING); b_logentry(TOPIC_ADDON_TELEPORTSNW,"Orlan zamkl teleportační kámen v jeskyni na jihozápad od jeho hospody."); }; func void dia_addon_orlan_teleportstein_wo() { AI_Output(other,self,"DIA_Addon_Orlan_Teleportstein_wo_15_00"); //Kde je přesně ten teleportační kámen? AI_Output(self,other,"DIA_Addon_Orlan_Teleportstein_wo_05_01"); //Kousek na jih od mojí hospody. Tam ho našli mágové Vody. }; instance DIA_ADDON_ORLAN_NOMEETING(C_INFO) { npc = bau_970_orlan; nr = 2; condition = dia_addon_orlan_nomeeting_condition; information = dia_addon_orlan_nomeeting_info; description = "Jsem zde uveden do 'Kruhu Vody'!"; }; func int dia_addon_orlan_nomeeting_condition() { if(Npc_KnowsInfo(other,dia_orlan_werbistdu) && !Npc_KnowsInfo(other,dia_addon_orlan_ranger) && (SCISWEARINGRANGERRING == FALSE) && (MIS_ADDON_LARES_COMETORANGERMEETING == LOG_RUNNING)) { return TRUE; }; }; func void dia_addon_orlan_nomeeting_info() { AI_Output(other,self,"DIA_Addon_Orlan_NoMeeting_15_00"); //Jsem zde uveden do 'Kruhu Vody'! AI_Output(self,other,"DIA_Addon_Orlan_NoMeeting_05_01"); //(štiplavě) Nevidím prsten. Chceš něco k pití? }; instance DIA_ADDON_ORLAN_WHENRANGERMEETING(C_INFO) { npc = bau_970_orlan; nr = 5; condition = dia_addon_orlan_whenrangermeeting_condition; information = dia_addon_orlan_whenrangermeeting_info; description = "Slyšel jsem něco o srazu 'Kruhu' ve tvé hospodě."; }; func int dia_addon_orlan_whenrangermeeting_condition() { if((MIS_ADDON_LARES_COMETORANGERMEETING == LOG_RUNNING) && Npc_KnowsInfo(other,dia_addon_orlan_ranger)) { return TRUE; }; }; func void dia_addon_orlan_whenrangermeeting_info() { AI_Output(other,self,"DIA_Addon_Orlan_WhenRangerMeeting_15_00"); //Slyšel jsem něco o srazu 'Kruhu' ve tvé hospodě. AI_Output(self,other,"DIA_Addon_Orlan_WhenRangerMeeting_05_01"); //To je pravda. Měl by každou chvíli začít. AI_Output(self,other,"DIA_Addon_Orlan_WhenRangerMeeting_05_02"); //Zajímalo by mě, co je zdrželo. b_giveplayerxp(XP_AMBIENT); b_addon_orlan_rangersreadyforcoming(); self.flags = 0; Info_ClearChoices(dia_addon_orlan_whenrangermeeting); Info_AddChoice(dia_addon_orlan_whenrangermeeting,"Jsem si jistý, že se brzy objeví.",dia_addon_orlan_whenrangermeeting_theycome); Info_AddChoice(dia_addon_orlan_whenrangermeeting,"Ten sraz je dneska?",dia_addon_orlan_whenrangermeeting_today); }; func void dia_addon_orlan_whenrangermeeting_today() { AI_Output(other,self,"DIA_Addon_Orlan_WhenRangerMeeting_Today_15_00"); //Ten sraz je dneska? AI_Output(self,other,"DIA_Addon_Orlan_WhenRangerMeeting_Today_05_01"); //Pokud si to dobře pamatuju tak ano. AI_Output(self,other,"DIA_Addon_Orlan_WhenRangerMeeting_Today_05_02"); //Doufám, že zase přijdou pozdě. b_makerangerreadyformeetingall(); Info_ClearChoices(dia_addon_orlan_whenrangermeeting); Info_AddChoice(dia_addon_orlan_whenrangermeeting,"(Více)",dia_addon_orlan_whenrangermeeting_los); }; func void dia_addon_orlan_whenrangermeeting_theycome() { AI_Output(other,self,"DIA_Addon_Orlan_WhenRangerMeeting_theyCome_15_00"); //Jsem si jistý, že se brzy objeví. AI_Output(self,other,"DIA_Addon_Orlan_WhenRangerMeeting_theyCome_05_01"); //Uvidíme. b_makerangerreadyformeetingall(); Info_ClearChoices(dia_addon_orlan_whenrangermeeting); Info_AddChoice(dia_addon_orlan_whenrangermeeting,"(Více)",dia_addon_orlan_whenrangermeeting_los); }; func void dia_addon_orlan_whenrangermeeting_los() { AI_StopProcessInfos(self); b_addon_orlan_comingranger(); }; instance DIA_ORLAN_RUESTUNG(C_INFO) { npc = bau_970_orlan; nr = 5; condition = dia_orlan_ruestung_condition; information = dia_orlan_ruestung_info; permanent = TRUE; description = "Jaký druh zbroje mi můžeš nabídnout?"; }; var int dia_orlan_ruestung_noperm; func int dia_orlan_ruestung_condition() { if(Npc_KnowsInfo(other,dia_orlan_werbistdu) && (DIA_ORLAN_RUESTUNG_NOPERM == FALSE) && (hero.guild == GIL_NONE)) { return TRUE; }; }; func void dia_orlan_ruestung_info() { AI_Output(other,self,"DIA_Orlan_RUESTUNG_15_00"); //Jaký druh zbroje mi můžeš nabídnout? AI_Output(self,other,"DIA_Orlan_RUESTUNG_05_01"); //Mám tady jeden velmi pěkný kousek, který se ti určitě bude líbit. Info_ClearChoices(dia_orlan_ruestung); Info_AddChoice(dia_orlan_ruestung,DIALOG_BACK,dia_orlan_ruestung_back); Info_AddChoice(dia_orlan_ruestung,"Kožená zbroj. Ochrana: zbraně 25, šípy 20, oheň 5 (250 zlaťáků)",dia_orlan_ruestung_buy); }; func void dia_orlan_ruestung_buy() { AI_Output(other,self,"DIA_Orlan_RUESTUNG_Buy_15_00"); //Chtěl bych si koupit lehkou zbroj. if(b_giveinvitems(other,self,itmi_gold,VALUE_ITAR_LEATHER_L)) { AI_Output(self,other,"DIA_Orlan_RUESTUNG_Buy_05_01"); //Moudré rozhodnutí. CreateInvItems(self,itar_leather_l,1); b_giveinvitems(self,other,itar_leather_l,1); AI_EquipBestArmor(other); DIA_ORLAN_RUESTUNG_NOPERM = TRUE; } else { AI_Output(self,other,"DIA_Orlan_RUESTUNG_Buy_05_02"); //Promiň. Dokud nemáš peníze, žádné obchody nebudou. }; Info_ClearChoices(dia_orlan_ruestung); }; func void dia_orlan_ruestung_back() { AI_Output(other,self,"DIA_Orlan_RUESTUNG_BACK_15_00"); //Budu o tom přemýšlet. AI_Output(self,other,"DIA_Orlan_RUESTUNG_BACK_05_01"); //Jak chceš. Ale neotálej příliš dlouho. Info_ClearChoices(dia_orlan_ruestung); }; instance DIA_ORLAN_TRADE(C_INFO) { npc = bau_970_orlan; nr = 70; condition = dia_orlan_trade_condition; information = dia_orlan_trade_info; trade = TRUE; permanent = TRUE; description = "Ukaž mi své zboží."; }; func int dia_orlan_trade_condition() { if(Npc_KnowsInfo(other,dia_orlan_werbistdu)) { return TRUE; }; }; func void dia_orlan_trade_info() { AI_Output(other,self,"DIA_Orlan_TRADE_15_00"); //Ukaž mi své zboží. b_givetradeinv(self); if((SC_ISRANGER == TRUE) || (ORLAN_KNOWSSCASRANGER == TRUE) || (SCISWEARINGRANGERRING == TRUE)) { AI_Output(self,other,"DIA_Addon_Orlan_TRADE_05_00"); //Samozřejmě, bratře kruhu. ORLAN_KNOWSSCASRANGER = TRUE; } else if((hero.guild == GIL_PAL) || (hero.guild == GIL_KDF)) { AI_Output(self,other,"DIA_Orlan_TRADE_05_01"); //Samozřejmě. Je to pro mě velká čest, přijmout tak důležitý úkol. } else if((hero.guild == GIL_SLD) || (hero.guild == GIL_DJG) || (hero.guild == GIL_MIL)) { AI_Output(self,other,"DIA_Orlan_TRADE_05_02"); //Zajisté, pane. } else { AI_Output(self,other,"DIA_Orlan_TRADE_05_03"); //Pokud na to máš. }; }; instance DIA_ORLAN_HOTELZIMMER(C_INFO) { npc = bau_970_orlan; nr = 6; condition = dia_orlan_hotelzimmer_condition; information = dia_orlan_hotelzimmer_info; permanent = TRUE; description = "Kolik si účtuješ za pokoj?"; }; var int orlan_scgothotelzimmer; var int orlan_scgothotelzimmerday; func int dia_orlan_hotelzimmer_condition() { if(Npc_KnowsInfo(other,dia_orlan_werbistdu) && (ORLAN_SCGOTHOTELZIMMER == FALSE)) { return TRUE; }; }; func void dia_orlan_hotelzimmer_info() { AI_Output(other,self,"DIA_Orlan_HotelZimmer_15_00"); //Kolik si účtuješ za pokoj? if((hero.guild == GIL_PAL) || (hero.guild == GIL_KDF) || (SC_ISRANGER == TRUE) || (SCISWEARINGRANGERRING == TRUE) || (ORLAN_KNOWSSCASRANGER == TRUE)) { if((SC_ISRANGER == TRUE) || (SCISWEARINGRANGERRING == TRUE) || (ORLAN_KNOWSSCASRANGER == TRUE)) { AI_Output(self,other,"DIA_Addon_Orlan_HotelZimmer_05_00"); //Pro bratra 'Kruhu'? Vůbec nic. ORLAN_RANGERHELPZIMMER = TRUE; ORLAN_KNOWSSCASRANGER = TRUE; } else if(hero.guild == GIL_PAL) { AI_Output(self,other,"DIA_Orlan_HotelZimmer_05_01"); //Pro královy rytíře mám vždycky volný pokoj. Samozřejmě zdarma. } else { AI_Output(self,other,"DIA_Orlan_HotelZimmer_05_02"); //Nikdy bych si nedovolil brát peníze od zástupců Innose. }; AI_Output(self,other,"DIA_Orlan_HotelZimmer_05_03"); //Tady je klíč od hořejších pokojů. Jeden z nich si zaber. CreateInvItems(self,itke_orlan_hotelzimmer,1); b_giveinvitems(self,other,itke_orlan_hotelzimmer,1); ORLAN_SCGOTHOTELZIMMER = TRUE; ORLAN_SCGOTHOTELZIMMERDAY = Wld_GetDay(); } else { AI_Output(self,other,"DIA_Orlan_HotelZimmer_05_04"); //Dej mi 50 zlatých na týden a můžeš si vybrat některý z pokojů. Info_ClearChoices(dia_orlan_hotelzimmer); Info_AddChoice(dia_orlan_hotelzimmer,"To je zatraceně drahé.",dia_orlan_hotelzimmer_nein); Info_AddChoice(dia_orlan_hotelzimmer,"Dobrá. Tady jsou prachy.",dia_orlan_hotelzimmer_ja); }; }; func void dia_orlan_hotelzimmer_ja() { if(b_giveinvitems(other,self,itmi_gold,50)) { AI_Output(other,self,"DIA_Orlan_HotelZimmer_ja_15_00"); //Dobrá. Tady jsou prachy. AI_Output(self,other,"DIA_Orlan_HotelZimmer_ja_05_01"); //Tady máš klíč. Pokoje jsou nahoře nad schody. Ale moc to tam nezamaž a plať včas, jasné? CreateInvItems(self,itke_orlan_hotelzimmer,1); b_giveinvitems(self,other,itke_orlan_hotelzimmer,1); ORLAN_SCGOTHOTELZIMMERDAY = Wld_GetDay(); ORLAN_SCGOTHOTELZIMMER = TRUE; } else { AI_Output(self,other,"DIA_Orlan_HotelZimmer_ja_05_02"); //Nemáš 50. Nejdřív peníze, pak zábava. }; Info_ClearChoices(dia_orlan_hotelzimmer); }; func void dia_orlan_hotelzimmer_nein() { AI_Output(other,self,"DIA_Orlan_HotelZimmer_nein_15_00"); //Tak to je zatraceně drahý. AI_Output(self,other,"DIA_Orlan_HotelZimmer_nein_05_01"); //Tak to by ses měl poohlédnout po něčem jiném, příteli. Info_ClearChoices(dia_orlan_hotelzimmer); }; var int orlan_angriffwegenmiete; instance DIA_ORLAN_MIETEFAELLIG(C_INFO) { npc = bau_970_orlan; nr = 10; condition = dia_orlan_mietefaellig_condition; information = dia_orlan_mietefaellig_info; important = TRUE; permanent = TRUE; }; var int dia_orlan_mietefaellig_nomore; func int dia_orlan_mietefaellig_condition() { if((SC_ISRANGER == TRUE) || (ORLAN_RANGERHELPZIMMER == TRUE)) { return FALSE; }; if((ORLAN_ANGRIFFWEGENMIETE == TRUE) && (DIA_ORLAN_MIETEFAELLIG_NOMORE == FALSE)) { if(self.aivar[AIV_LASTFIGHTAGAINSTPLAYER] == FIGHT_LOST) { return FALSE; }; if(self.aivar[AIV_LASTFIGHTAGAINSTPLAYER] == FIGHT_WON) { ORLAN_SCGOTHOTELZIMMERDAY = Wld_GetDay(); ORLAN_ANGRIFFWEGENMIETE = FALSE; return FALSE; }; }; if((ORLAN_SCGOTHOTELZIMMER == TRUE) && (ORLAN_SCGOTHOTELZIMMERDAY <= (Wld_GetDay() - 7)) && (DIA_ORLAN_MIETEFAELLIG_NOMORE == FALSE)) { return TRUE; }; }; func void dia_orlan_mietefaellig_info() { if((hero.guild == GIL_PAL) || (hero.guild == GIL_KDF)) { AI_Output(self,other,"DIA_Orlan_MieteFaellig_05_00"); //(úlisně) Jsem potěšen tvou ctihodnou návštěvou. Zůstaň tu tak dlouho, jak budeš chtít. Je to pro mě čest. DIA_ORLAN_MIETEFAELLIG_NOMORE = TRUE; } else { AI_Output(self,other,"DIA_Orlan_MieteFaellig_05_01"); //Kdy konečně dostanu nájem? Info_ClearChoices(dia_orlan_mietefaellig); Info_AddChoice(dia_orlan_mietefaellig,"Zapomeň na to, už ti nedám ani zlámanou grešli.",dia_orlan_mietefaellig_nein); Info_AddChoice(dia_orlan_mietefaellig,"Tady je tvých 50 zlatých.",dia_orlan_mietefaellig_ja); }; }; var int dia_orlan_mietefaellig_onetime; func void dia_orlan_mietefaellig_ja() { AI_Output(other,self,"DIA_Orlan_MieteFaellig_ja_15_00"); //Tady je tvých 50 zlatých. if(b_giveinvitems(other,self,itmi_gold,50)) { AI_Output(self,other,"DIA_Orlan_MieteFaellig_ja_05_01"); //Fajn, už bylo načase. if(DIA_ORLAN_MIETEFAELLIG_ONETIME == FALSE) { AI_Output(self,other,"DIA_Orlan_MieteFaellig_ja_05_02"); //Kde ses celý den toulal? AI_Output(other,self,"DIA_Orlan_MieteFaellig_ja_15_03"); //Do toho ti nic není. AI_Output(self,other,"DIA_Orlan_MieteFaellig_ja_05_04"); //Mmh. Dobrá, stejně to není moje věc. DIA_ORLAN_MIETEFAELLIG_ONETIME = TRUE; }; ORLAN_SCGOTHOTELZIMMERDAY = Wld_GetDay(); Info_ClearChoices(dia_orlan_mietefaellig); } else { AI_Output(self,other,"DIA_Orlan_MieteFaellig_ja_05_05"); //Hele, pokoušíš se mě podvést? Nemáš dost peněz ani na to, abys zaplatil tohle jídlo. Já ti ukážu, ty, ty... AI_StopProcessInfos(self); b_attack(self,other,AR_NONE,1); }; }; func void dia_orlan_mietefaellig_nein() { AI_Output(other,self,"DIA_Orlan_MieteFaellig_nein_15_00"); //Zapomeň na to. Už ti nezaplatím. AI_Output(self,other,"DIA_Orlan_MieteFaellig_nein_05_01"); //Fajn, já ti ukážu, ty mizernej podvodníku. ORLAN_ANGRIFFWEGENMIETE = TRUE; Info_ClearChoices(dia_orlan_mietefaellig); AI_StopProcessInfos(self); b_attack(self,other,AR_NONE,1); }; instance DIA_ORLAN_WETTKAMPFLAEUFT(C_INFO) { npc = bau_970_orlan; nr = 7; condition = dia_orlan_wettkampflaeuft_condition; information = dia_orlan_wettkampflaeuft_info; important = TRUE; }; func int dia_orlan_wettkampflaeuft_condition() { if((DIA_RANDOLPH_ICHGEBEDIRGELD_NOPERM == TRUE) && (MIS_RUKHAR_WETTKAMPF_DAY <= (Wld_GetDay() - 2))) { return TRUE; }; }; func void dia_orlan_wettkampflaeuft_info() { AI_Output(self,other,"DIA_Orlan_WETTKAMPFLAEUFT_05_00"); //Tak přece ses ukázal. Čekal jsem na tebe. AI_Output(other,self,"DIA_Orlan_WETTKAMPFLAEUFT_15_01"); //Co se stalo? AI_Output(self,other,"DIA_Orlan_WETTKAMPFLAEUFT_05_02"); //Soutěž v pití skončila. AI_Output(other,self,"DIA_Orlan_WETTKAMPFLAEUFT_15_03"); //Kdo vyhrál? if((Mob_HasItems("CHEST_RUKHAR",itfo_booze) == FALSE) && (Mob_HasItems("CHEST_RUKHAR",itfo_water) == TRUE)) { AI_Output(self,other,"DIA_Orlan_WETTKAMPFLAEUFT_05_04"); //Tentokrát Randolph. Rukhar musel mít špatnej den. } else { AI_Output(self,other,"DIA_Orlan_WETTKAMPFLAEUFT_05_05"); //Rukhar to už zase Randolphovi nandal. To se dalo jen očekávat. RUKHAR_WON_WETTKAMPF = TRUE; }; if((hero.guild != GIL_PAL) && (hero.guild != GIL_KDF)) { AI_Output(self,other,"DIA_Orlan_WETTKAMPFLAEUFT_05_06"); //Tak dobrá, doufám, že to bylo naposledy. O takovéhle pozdvižení ve svém domě nestojím, zapište si to všichni za uši. }; b_giveplayerxp(XP_RUKHAR_WETTKAMPFVORBEI); AI_StopProcessInfos(self); Npc_ExchangeRoutine(self,"Start"); b_startotherroutine(randolph,"Start"); if(Hlp_IsValidNpc(rukhar)) { if(RUKHAR_WON_WETTKAMPF == TRUE) { b_startotherroutine(rukhar,"WettkampfRukharWon"); } else { b_startotherroutine(rukhar,"WettkampfRukharLost"); }; }; MIS_RUKHAR_WETTKAMPF = LOG_SUCCESS; b_giveplayerxp(XP_AMBIENT); }; instance DIA_ORLAN_EINGEBROCKT(C_INFO) { npc = bau_970_orlan; nr = 8; condition = dia_orlan_eingebrockt_condition; information = dia_orlan_eingebrockt_info; important = TRUE; }; func int dia_orlan_eingebrockt_condition() { if((DIA_RANDOLPH_ICHGEBEDIRGELD_NOPERM == TRUE) && (MIS_RUKHAR_WETTKAMPF == LOG_RUNNING)) { return TRUE; }; }; func void dia_orlan_eingebrockt_info() { AI_Output(self,other,"DIA_Orlan_EINGEBROCKT_05_00"); //Tos mě dostal do pěkné kaše. Teď abych Rukharovi ještě nalil. AI_Output(other,self,"DIA_Orlan_EINGEBROCKT_15_01"); //Proč? AI_Output(self,other,"DIA_Orlan_EINGEBROCKT_05_02"); //Dokud si tady pořádá ty své soutěže, je lepší, aby se o tom nikdo z venku nedozvěděl. Není to dobré pro obchod, jasný? }; instance DIA_ORLAN_PERM(C_INFO) { npc = bau_970_orlan; nr = 99; condition = dia_orlan_perm_condition; information = dia_orlan_perm_info; permanent = TRUE; description = "Jak to jde s hospodou?"; }; func int dia_orlan_perm_condition() { if(Npc_KnowsInfo(other,dia_orlan_werbistdu)) { return TRUE; }; }; func void dia_orlan_perm_info() { AI_Output(other,self,"DIA_Orlan_Perm_15_00"); //Jak to jde s hospodou? if(KAPITEL <= 2) { AI_Output(self,other,"DIA_Orlan_Perm_05_01"); //Už to bylo lepší, však víš. AI_Output(self,other,"DIA_Orlan_Perm_05_02"); //Lidé už nesahají do svých měšců tak ochotně, jak by měli. } else if(KAPITEL >= 3) { AI_Output(self,other,"DIA_Orlan_Perm_05_03"); //Snad ty černí mágové brzy odtáhnou, jinak můžu hospodu zavřít. AI_Output(self,other,"DIA_Orlan_Perm_05_04"); //Už se skoro nikdo neodváží zajít až sem. }; }; instance DIA_ORLAN_MINENANTEIL(C_INFO) { npc = bau_970_orlan; nr = 3; condition = dia_orlan_minenanteil_condition; information = dia_orlan_minenanteil_info; description = "Prodáváš důlní akcie?"; }; func int dia_orlan_minenanteil_condition() { if((hero.guild == GIL_KDF) && (MIS_SERPENTES_MINENANTEIL_KDF == LOG_RUNNING) && Npc_KnowsInfo(other,dia_orlan_werbistdu)) { return TRUE; }; }; func void dia_orlan_minenanteil_info() { AI_Output(other,self,"DIA_Orlan_Minenanteil_15_00"); //Prodáváš důlní akcie? AI_Output(self,other,"DIA_Orlan_Minenanteil_05_01"); //Jasně. Ode mě dostaneš všechno, tedy pokud na to máš. b_giveplayerxp(XP_AMBIENT); }; instance DIA_ORLAN_PICKPOCKET(C_INFO) { npc = bau_970_orlan; nr = 900; condition = dia_orlan_pickpocket_condition; information = dia_orlan_pickpocket_info; permanent = TRUE; description = PICKPOCKET_100; }; func int dia_orlan_pickpocket_condition() { return c_beklauen(89,260); }; func void dia_orlan_pickpocket_info() { Info_ClearChoices(dia_orlan_pickpocket); Info_AddChoice(dia_orlan_pickpocket,DIALOG_BACK,dia_orlan_pickpocket_back); Info_AddChoice(dia_orlan_pickpocket,DIALOG_PICKPOCKET,dia_orlan_pickpocket_doit); }; func void dia_orlan_pickpocket_doit() { b_beklauen(); Info_ClearChoices(dia_orlan_pickpocket); }; func void dia_orlan_pickpocket_back() { Info_ClearChoices(dia_orlan_pickpocket); };
D
module org.apache.jcs; public import org.apache.jcs.JCS;
D
import core.stdc.stdlib; import std.stdio; import std.getopt; import dyaml; Node Data; void configure(string[] arguments) { GetoptResult parsedArguments; string config; parsedArguments = getopt( arguments, "c|config", &config); if (parsedArguments.helpWanted) { defaultGetoptPrinter("Usage:", parsedArguments.options); exit(0); } Node root = Loader.fromFile(config).load(); Data = root["data"]; }
D
/Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/App.build/Objects-normal/x86_64/Friend.o : /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Friend.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Pokemon.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Setup/Config+Setup.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Setup/Droplet+Setup.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Controllers/PostController.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Routes/Routes.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Post.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/URI.framework/Modules/URI.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/JSON.framework/Modules/JSON.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SMTP.framework/Modules/SMTP.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/HTTP.framework/Modules/HTTP.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/TLS.framework/Modules/TLS.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/FormData.framework/Modules/FormData.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/libc.framework/Modules/libc.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Node.framework/Modules/Node.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Cache.framework/Modules/Cache.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/PathIndexable.framework/Modules/PathIndexable.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Console.framework/Modules/Console.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SQLite.framework/Modules/SQLite.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Routing.framework/Modules/Routing.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Random.framework/Modules/Random.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Crypto.framework/Modules/Crypto.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/FluentProvider.framework/Modules/FluentProvider.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Vapor.framework/Modules/Vapor.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Branches.framework/Modules/Branches.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Cookies.framework/Modules/Cookies.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Configs.framework/Modules/Configs.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Sessions.framework/Modules/Sessions.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Sockets.framework/Modules/Sockets.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/WebSockets.framework/Modules/WebSockets.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Fluent.framework/Modules/Fluent.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/BCrypt.framework/Modules/BCrypt.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Multipart.framework/Modules/Multipart.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Transport.framework/Modules/Transport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CHTTP/module.modulemap /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/App.build/Objects-normal/x86_64/Friend~partial.swiftmodule : /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Friend.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Pokemon.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Setup/Config+Setup.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Setup/Droplet+Setup.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Controllers/PostController.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Routes/Routes.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Post.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/URI.framework/Modules/URI.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/JSON.framework/Modules/JSON.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SMTP.framework/Modules/SMTP.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/HTTP.framework/Modules/HTTP.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/TLS.framework/Modules/TLS.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/FormData.framework/Modules/FormData.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/libc.framework/Modules/libc.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Node.framework/Modules/Node.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Cache.framework/Modules/Cache.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/PathIndexable.framework/Modules/PathIndexable.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Console.framework/Modules/Console.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SQLite.framework/Modules/SQLite.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Routing.framework/Modules/Routing.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Random.framework/Modules/Random.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Crypto.framework/Modules/Crypto.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/FluentProvider.framework/Modules/FluentProvider.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Vapor.framework/Modules/Vapor.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Branches.framework/Modules/Branches.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Cookies.framework/Modules/Cookies.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Configs.framework/Modules/Configs.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Sessions.framework/Modules/Sessions.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Sockets.framework/Modules/Sockets.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/WebSockets.framework/Modules/WebSockets.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Fluent.framework/Modules/Fluent.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/BCrypt.framework/Modules/BCrypt.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Multipart.framework/Modules/Multipart.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Transport.framework/Modules/Transport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CHTTP/module.modulemap /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/cansoykarafakili/Desktop/Hello/build/Intermediates/Hello.build/Debug/App.build/Objects-normal/x86_64/Friend~partial.swiftdoc : /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Friend.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Pokemon.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Setup/Config+Setup.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Setup/Droplet+Setup.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Controllers/PostController.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Routes/Routes.swift /Users/cansoykarafakili/Desktop/Hello/Sources/App/Models/Post.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/URI.framework/Modules/URI.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/JSON.framework/Modules/JSON.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SMTP.framework/Modules/SMTP.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/HTTP.framework/Modules/HTTP.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/TLS.framework/Modules/TLS.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/FormData.framework/Modules/FormData.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/libc.framework/Modules/libc.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Node.framework/Modules/Node.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Cache.framework/Modules/Cache.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/PathIndexable.framework/Modules/PathIndexable.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Console.framework/Modules/Console.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/SQLite.framework/Modules/SQLite.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Routing.framework/Modules/Routing.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Random.framework/Modules/Random.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Crypto.framework/Modules/Crypto.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/FluentProvider.framework/Modules/FluentProvider.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Vapor.framework/Modules/Vapor.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Branches.framework/Modules/Branches.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Cookies.framework/Modules/Cookies.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Configs.framework/Modules/Configs.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Sessions.framework/Modules/Sessions.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Sockets.framework/Modules/Sockets.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/WebSockets.framework/Modules/WebSockets.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Fluent.framework/Modules/Fluent.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/BCrypt.framework/Modules/BCrypt.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Multipart.framework/Modules/Multipart.swiftmodule/x86_64.swiftmodule /Users/cansoykarafakili/Desktop/Hello/build/Products/Debug/Transport.framework/Modules/Transport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/cansoykarafakili/Desktop/Hello/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CHTTP/module.modulemap /Users/cansoykarafakili/Desktop/Hello/Hello.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
/Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/HTTP.build/Utilities/RFC1123.swift.o : /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/RFC1123.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/URL+HTTP.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPHeaders+Basic.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/Forwarded.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/MediaTypePreference.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBodyStorage.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPMessage.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBodyRepresentable.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPHeaderName.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPScheme.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPResponse.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Cookies/HTTPCookieValue.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPChunkedStream.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPClientProtocolUpgrader.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPServerResponder.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Codable/HTTPMessageCoder.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPHeaders+Bearer.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPServer.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPError.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Cookies/HTTPCookies.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPHeaders.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Exports.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPClient.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPRequest.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBody.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /usr/local/Cellar/libressl/2.7.4/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.4/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rsa.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.4/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ec.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.4/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.4/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl.h /Users/nice/HelloWord/.build/checkouts/swift-nio-ssl.git-8502154137117992337/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bn.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.4/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.4/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.4/include/openssl/buffer.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.4/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslv.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/nice/HelloWord/.build/checkouts/swift-nio-zlib-support.git--6556802241718767980/module.modulemap /Users/nice/HelloWord/.build/checkouts/swift-nio-ssl-support.git--3664958863524920767/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/HTTP.build/RFC1123~partial.swiftmodule : /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/RFC1123.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/URL+HTTP.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPHeaders+Basic.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/Forwarded.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/MediaTypePreference.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBodyStorage.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPMessage.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBodyRepresentable.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPHeaderName.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPScheme.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPResponse.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Cookies/HTTPCookieValue.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPChunkedStream.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPClientProtocolUpgrader.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPServerResponder.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Codable/HTTPMessageCoder.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPHeaders+Bearer.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPServer.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPError.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Cookies/HTTPCookies.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPHeaders.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Exports.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPClient.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPRequest.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBody.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /usr/local/Cellar/libressl/2.7.4/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.4/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rsa.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.4/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ec.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.4/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.4/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl.h /Users/nice/HelloWord/.build/checkouts/swift-nio-ssl.git-8502154137117992337/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bn.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.4/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.4/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.4/include/openssl/buffer.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.4/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslv.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/nice/HelloWord/.build/checkouts/swift-nio-zlib-support.git--6556802241718767980/module.modulemap /Users/nice/HelloWord/.build/checkouts/swift-nio-ssl-support.git--3664958863524920767/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/HTTP.build/RFC1123~partial.swiftdoc : /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/RFC1123.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/URL+HTTP.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPHeaders+Basic.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/Forwarded.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/MediaTypePreference.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBodyStorage.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPMessage.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBodyRepresentable.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPHeaderName.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPScheme.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPResponse.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Cookies/HTTPCookieValue.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPChunkedStream.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPClientProtocolUpgrader.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPServerResponder.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Codable/HTTPMessageCoder.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPHeaders+Bearer.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPServer.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Utilities/HTTPError.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Cookies/HTTPCookies.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPHeaders.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Exports.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Responder/HTTPClient.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Message/HTTPRequest.swift /Users/nice/HelloWord/.build/checkouts/http.git-5443068064906198988/Sources/HTTP/Body/HTTPBody.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /usr/local/Cellar/libressl/2.7.4/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.4/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.4/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rsa.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.4/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ec.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.4/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.4/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.4/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.4/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.4/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ssl.h /Users/nice/HelloWord/.build/checkouts/swift-nio-ssl.git-8502154137117992337/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.4/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bn.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.4/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.4/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.4/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.4/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.4/include/openssl/buffer.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.4/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.4/include/openssl/opensslv.h /Users/nice/HelloWord/.build/checkouts/swift-nio.git-5005363973595484456/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/nice/HelloWord/.build/checkouts/swift-nio-zlib-support.git--6556802241718767980/module.modulemap /Users/nice/HelloWord/.build/checkouts/swift-nio-ssl-support.git--3664958863524920767/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/nice/HelloWord/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/** * HibernateD - Object-Relation Mapping for D programming language, with interface similar to Hibernate. * * Hibernate documentation can be found here: * $(LINK http://hibernate.org/docs)$(BR) * * Source file hibernated/core.d. * * This module contains HQL query parser and HQL to SQL transform implementation. * * Copyright: Copyright 2013 * License: $(LINK www.boost.org/LICENSE_1_0.txt, Boost License 1.0). * Author: Vadim Lopatin */ module hibernated.query; import std.ascii; import std.algorithm; import std.exception; import std.array; import std.string; import std.conv; import std.stdio; import std.variant; import ddbc.core; import hibernated.annotations; import hibernated.metadata; import hibernated.type; import hibernated.core; import hibernated.dialect; import hibernated.dialects.mysqldialect; enum JoinType { InnerJoin, LeftJoin, } class FromClauseItem { string entityName; const EntityInfo entity; string entityAlias; string sqlAlias; int startColumn; int selectedColumns; // for JOINs JoinType joinType = JoinType.InnerJoin; bool fetch; FromClauseItem base; const PropertyInfo baseProperty; string pathString; int index; int selectIndex; string getFullPath() { if (base is null) return entityAlias; return base.getFullPath() ~ "." ~ baseProperty.propertyName; } this(const EntityInfo entity, string entityAlias, JoinType joinType, bool fetch, FromClauseItem base = null, const PropertyInfo baseProperty = null) { this.entityName = entity.name; this.entity = entity; this.joinType = joinType; this.fetch = fetch; this.base = base; this.baseProperty = baseProperty; this.selectIndex = -1; } } class FromClause { FromClauseItem[] items; FromClauseItem add(const EntityInfo entity, string entityAlias, JoinType joinType, bool fetch, FromClauseItem base = null, const PropertyInfo baseProperty = null) { FromClauseItem item = new FromClauseItem(entity, entityAlias, joinType, fetch, base, baseProperty); item.entityAlias = entityAlias is null ? "_a" ~ to!string(items.length + 1) : entityAlias; item.sqlAlias = "_t" ~ to!string(items.length + 1); item.index = cast(int)items.length; item.pathString = item.getFullPath(); items ~= item; return item; } @property size_t length() { return items.length; } string getSQL() { return ""; } @property FromClauseItem first() { return items[0]; } FromClauseItem opIndex(int index) { enforceEx!HibernatedException(index >= 0 && index < items.length, "FromClause index out of range: " ~ to!string(index)); return items[index]; } FromClauseItem opIndex(string aliasName) { return findByAlias(aliasName); } bool hasAlias(string aliasName) { foreach(ref m; items) { if (m.entityAlias == aliasName) return true; } return false; } FromClauseItem findByAlias(string aliasName) { foreach(ref m; items) { if (m.entityAlias == aliasName) return m; } throw new QuerySyntaxException("Cannot find FROM alias by name " ~ aliasName); } FromClauseItem findByPath(string path) { foreach(ref m; items) { if (m.pathString == path) return m; } return null; } } struct OrderByClauseItem { FromClauseItem from; PropertyInfo prop; bool asc; } struct SelectClauseItem { FromClauseItem from; PropertyInfo prop; } class QueryParser { string query; EntityMetaData metadata; Token[] tokens; FromClause fromClause; //FromClauseItem[] fromClause; string[] parameterNames; OrderByClauseItem[] orderByClause; SelectClauseItem[] selectClause; Token whereClause; // AST for WHERE expression this(EntityMetaData metadata, string query) { this.metadata = metadata; this.query = query; fromClause = new FromClause(); //writeln("tokenizing query: " ~ query); tokens = tokenize(query); //writeln("parsing query: " ~ query); parse(); //writeln("parsing done"); } void parse() { processParameterNames(0, cast(int)tokens.length); // replace pairs {: Ident} with single Parameter token int len = cast(int)tokens.length; //writeln("Query tokens: " ~ to!string(len)); int fromPos = findKeyword(KeywordType.FROM); int selectPos = findKeyword(KeywordType.SELECT); int wherePos = findKeyword(KeywordType.WHERE); int orderPos = findKeyword(KeywordType.ORDER); enforceEx!QuerySyntaxException(fromPos >= 0, "No FROM clause in query " ~ query); enforceEx!QuerySyntaxException(selectPos <= 0, "SELECT clause should be first - invalid query " ~ query); enforceEx!QuerySyntaxException(wherePos == -1 || wherePos > fromPos, "Invalid WHERE position in query " ~ query); enforceEx!QuerySyntaxException(orderPos == -1 || (orderPos < tokens.length - 2 && tokens[orderPos + 1].keyword == KeywordType.BY), "Invalid ORDER BY in query " ~ query); enforceEx!QuerySyntaxException(orderPos == -1 || orderPos > fromPos, "Invalid ORDER BY position in query " ~ query); int fromEnd = len; if (orderPos >= 0) fromEnd = orderPos; if (wherePos >= 0) fromEnd = wherePos; int whereEnd = wherePos < 0 ? -1 : (orderPos >= 0 ? orderPos : len); int orderEnd = orderPos < 0 ? -1 : len; parseFromClause(fromPos + 1, fromEnd); if (selectPos == 0 && selectPos < fromPos - 1) parseSelectClause(selectPos + 1, fromPos); else defaultSelectClause(); bool selectedEntities = validateSelectClause(); if (wherePos >= 0 && whereEnd > wherePos) parseWhereClause(wherePos + 1, whereEnd); if (orderPos >= 0 && orderEnd > orderPos) parseOrderClause(orderPos + 2, orderEnd); if (selectedEntities) { processAutoFetchReferences(); prepareSelectFields(); } } private void prepareSelectFields() { int startColumn = 1; for (int i=0; i < fromClause.length; i++) { FromClauseItem item = fromClause[i]; if (!item.fetch) continue; int count = item.entity.metadata.getFieldCount(item.entity, false); if (count > 0) { item.startColumn = startColumn; item.selectedColumns = count; startColumn += count; } } } private void processAutoFetchReferences() { FromClauseItem a = selectClause[0].from; a.fetch = true; processAutoFetchReferences(a); } private FromClauseItem ensureItemFetched(FromClauseItem a, const PropertyInfo p) { FromClauseItem res; string path = a.pathString ~ "." ~ p.propertyName; //writeln("ensureItemFetched " ~ path); res = fromClause.findByPath(path); if (res is null) { // autoadd join assert(p.referencedEntity !is null); res = fromClause.add(p.referencedEntity, null, p.nullable ? JoinType.LeftJoin : JoinType.InnerJoin, true, a, p); } else { // force fetch res.fetch = true; } bool selectFound = false; foreach(s; selectClause) { if (s.from == res) { selectFound = true; break; } } if (!selectFound) { SelectClauseItem item; item.from = res; item.prop = null; selectClause ~= item; } return res; } private bool isBackReferenceProperty(FromClauseItem a, const PropertyInfo p) { if (a.base is null) return false; auto baseEntity = a.base.entity; assert(baseEntity !is null); if (p.referencedEntity != baseEntity) return false; if (p.referencedProperty !is null && p.referencedProperty == a.baseProperty) return true; if (a.baseProperty.referencedProperty !is null && p == a.baseProperty.referencedProperty) return true; return false; } private void processAutoFetchReferences(FromClauseItem a) { foreach (p; a.entity.properties) { if (p.lazyLoad) continue; if (p.oneToOne && !isBackReferenceProperty(a, p)) { FromClauseItem res = ensureItemFetched(a, p); processAutoFetchReferences(res); } } } private void updateEntity(const EntityInfo entity, string name) { foreach(t; tokens) { if (t.type == TokenType.Ident && t.text == name) { t.entity = cast(EntityInfo)entity; t.type = TokenType.Entity; } } } private void updateAlias(const EntityInfo entity, string name) { foreach(t; tokens) { if (t.type == TokenType.Ident && t.text == name) { t.entity = cast(EntityInfo)entity; t.type = TokenType.Alias; } } } private void splitCommaDelimitedList(int start, int end, void delegate(int, int) callback) { //writeln("SPLIT " ~ to!string(start) ~ " .. " ~ to!string(end)); int len = cast(int)tokens.length; int p = start; for (int i = start; i < end; i++) { if (tokens[i].type == TokenType.Comma || i == end - 1) { enforceEx!QuerySyntaxException(tokens[i].type != TokenType.Comma || i != end - 1, "Invalid comma at end of list" ~ errorContext(tokens[start])); int endp = i < end - 1 ? i : end; enforceEx!QuerySyntaxException(endp > p, "Invalid comma delimited list" ~ errorContext(tokens[start])); callback(p, endp); p = i + 1; } } } private int parseFieldRef(int start, int end, ref string[] path) { int pos = start; while (pos < end) { if (tokens[pos].type == TokenType.Ident || tokens[pos].type == TokenType.Alias) { enforceEx!QuerySyntaxException(path.length == 0 || tokens[pos].type != TokenType.Alias, "Alias is allowed only as first item" ~ errorContext(tokens[pos])); path ~= tokens[pos].text; pos++; if (pos == end || tokens[pos].type != TokenType.Dot) return pos; if (pos == end - 1 || tokens[pos + 1].type != TokenType.Ident) return pos; pos++; } else { break; } } enforceEx!QuerySyntaxException(tokens[pos].type != TokenType.Dot, "Unexpected dot at end in field list" ~ errorContext(tokens[pos])); enforceEx!QuerySyntaxException(path.length > 0, "Empty field list" ~ errorContext(tokens[pos])); return pos; } private void parseFirstFromClause(int start, int end, out int pos) { enforceEx!QuerySyntaxException(start < end, "Invalid FROM clause " ~ errorContext(tokens[start])); // minimal support: // Entity // Entity alias // Entity AS alias enforceEx!QuerySyntaxException(tokens[start].type == TokenType.Ident, "Entity name identifier expected in FROM clause" ~ errorContext(tokens[start])); string entityName = cast(string)tokens[start].text; auto ei = metadata.findEntity(entityName); updateEntity(ei, entityName); string aliasName = null; int p = start + 1; if (p < end && tokens[p].type == TokenType.Keyword && tokens[p].keyword == KeywordType.AS) p++; if (p < end) { enforceEx!QuerySyntaxException(tokens[p].type == TokenType.Ident, "Alias name identifier expected in FROM clause" ~ errorContext(tokens[p])); aliasName = cast(string)tokens[p].text; p++; } if (aliasName != null) updateAlias(ei, aliasName); fromClause.add(ei, aliasName, JoinType.InnerJoin, false); pos = p; } void appendFromClause(Token context, string[] path, string aliasName, JoinType joinType, bool fetch) { int p = 0; enforceEx!QuerySyntaxException(fromClause.hasAlias(path[p]), "Unknown alias " ~ path[p] ~ " in FROM clause" ~ errorContext(context)); FromClauseItem baseClause = findFromClauseByAlias(path[p]); //string pathString = path[p]; p++; while(true) { auto baseEntity = baseClause.entity; enforceEx!QuerySyntaxException(p < path.length, "Property name expected in FROM clause" ~ errorContext(context)); string propertyName = path[p++]; auto property = baseEntity[propertyName]; auto referencedEntity = property.referencedEntity; assert(referencedEntity !is null); enforceEx!QuerySyntaxException(!property.simple, "Simple property " ~ propertyName ~ " cannot be used in JOIN" ~ errorContext(context)); enforceEx!QuerySyntaxException(!property.embedded, "Embedded property " ~ propertyName ~ " cannot be used in JOIN" ~ errorContext(context)); bool last = (p == path.length); FromClauseItem item = fromClause.add(referencedEntity, last ? aliasName : null, joinType, fetch, baseClause, property); if (last && aliasName !is null) updateAlias(referencedEntity, item.entityAlias); baseClause = item; if (last) break; } } void parseFromClause(int start, int end) { int p = start; parseFirstFromClause(start, end, p); while (p < end) { Token context = tokens[p]; JoinType joinType = JoinType.InnerJoin; if (tokens[p].keyword == KeywordType.LEFT) { joinType = JoinType.LeftJoin; p++; } else if (tokens[p].keyword == KeywordType.INNER) { p++; } enforceEx!QuerySyntaxException(p < end && tokens[p].keyword == KeywordType.JOIN, "Invalid FROM clause" ~ errorContext(tokens[p])); p++; enforceEx!QuerySyntaxException(p < end, "Invalid FROM clause - incomplete JOIN" ~ errorContext(tokens[p])); bool fetch = false; if (tokens[p].keyword == KeywordType.FETCH) { fetch = true; p++; enforceEx!QuerySyntaxException(p < end, "Invalid FROM clause - incomplete JOIN" ~ errorContext(tokens[p])); } string[] path; p = parseFieldRef(p, end, path); string aliasName; bool hasAS = false; if (p < end && tokens[p].keyword == KeywordType.AS) { p++; hasAS = true; } enforceEx!QuerySyntaxException(p < end && tokens[p].type == TokenType.Ident, "Invalid FROM clause - no alias in JOIN" ~ errorContext(tokens[p])); aliasName = tokens[p].text; p++; appendFromClause(context, path, aliasName, joinType, fetch); } enforceEx!QuerySyntaxException(p == end, "Invalid FROM clause" ~ errorContext(tokens[p])); } // in pairs {: Ident} replace type of ident with Parameter void processParameterNames(int start, int end) { for (int i = start; i < end; i++) { if (tokens[i].type == TokenType.Parameter) { parameterNames ~= cast(string)tokens[i].text; } } } FromClauseItem findFromClauseByAlias(string aliasName) { return fromClause.findByAlias(aliasName); } void addSelectClauseItem(string aliasName, string[] propertyNames) { //writeln("addSelectClauseItem alias=" ~ aliasName ~ " properties=" ~ to!string(propertyNames)); FromClauseItem from = aliasName == null ? fromClause.first : findFromClauseByAlias(aliasName); SelectClauseItem item; item.from = from; item.prop = null; EntityInfo ei = cast(EntityInfo)from.entity; if (propertyNames.length > 0) { item.prop = cast(PropertyInfo)ei.findProperty(propertyNames[0]); propertyNames.popFront(); while (item.prop.embedded) { //writeln("Embedded property " ~ item.prop.propertyName ~ " of type " ~ item.prop.referencedEntityName); ei = cast(EntityInfo)item.prop.referencedEntity; enforceEx!QuerySyntaxException(propertyNames.length > 0, "@Embedded field property name should be specified when selecting " ~ aliasName ~ "." ~ item.prop.propertyName); item.prop = cast(PropertyInfo)ei.findProperty(propertyNames[0]); propertyNames.popFront(); } } enforceEx!QuerySyntaxException(propertyNames.length == 0, "Extra field names in SELECT clause in query " ~ query); selectClause ~= item; //insertInPlace(selectClause, 0, item); } void addOrderByClauseItem(string aliasName, string propertyName, bool asc) { FromClauseItem from = aliasName == null ? fromClause.first : findFromClauseByAlias(aliasName); OrderByClauseItem item; item.from = from; item.prop = cast(PropertyInfo)from.entity.findProperty(propertyName); item.asc = asc; orderByClause ~= item; //insertInPlace(orderByClause, 0, item); } void parseOrderByClauseItem(int start, int end) { // for each comma delimited item // in current version it can only be // {property} or {alias . property} optionally followed by ASC or DESC //writeln("ORDER BY ITEM: " ~ to!string(start) ~ " .. " ~ to!string(end)); bool asc = true; if (tokens[end - 1].type == TokenType.Keyword && tokens[end - 1].keyword == KeywordType.ASC) { end--; } else if (tokens[end - 1].type == TokenType.Keyword && tokens[end - 1].keyword == KeywordType.DESC) { asc = false; end--; } enforceEx!QuerySyntaxException(start < end, "Empty ORDER BY clause item" ~ errorContext(tokens[start])); if (start == end - 1) { // no alias enforceEx!QuerySyntaxException(tokens[start].type == TokenType.Ident, "Property name expected in ORDER BY clause" ~ errorContext(tokens[start])); addOrderByClauseItem(null, cast(string)tokens[start].text, asc); } else if (start == end - 3) { enforceEx!QuerySyntaxException(tokens[start].type == TokenType.Alias, "Entity alias expected in ORDER BY clause" ~ errorContext(tokens[start])); enforceEx!QuerySyntaxException(tokens[start + 1].type == TokenType.Dot, "Dot expected after entity alias in ORDER BY clause" ~ errorContext(tokens[start])); enforceEx!QuerySyntaxException(tokens[start + 2].type == TokenType.Ident, "Property name expected after entity alias in ORDER BY clause" ~ errorContext(tokens[start])); addOrderByClauseItem(cast(string)tokens[start].text, cast(string)tokens[start + 2].text, asc); } else { //writeln("range: " ~ to!string(start) ~ " .. " ~ to!string(end)); enforceEx!QuerySyntaxException(false, "Invalid ORDER BY clause (expected {property [ASC | DESC]} or {alias.property [ASC | DESC]} )" ~ errorContext(tokens[start])); } } void parseSelectClauseItem(int start, int end) { // for each comma delimited item // in current version it can only be // {property} or {alias . property} //writeln("SELECT ITEM: " ~ to!string(start) ~ " .. " ~ to!string(end)); enforceEx!QuerySyntaxException(tokens[start].type == TokenType.Ident || tokens[start].type == TokenType.Alias, "Property name or alias expected in SELECT clause in query " ~ query ~ errorContext(tokens[start])); string aliasName; int p = start; if (tokens[p].type == TokenType.Alias) { //writeln("select clause alias: " ~ tokens[p].text ~ " query: " ~ query); aliasName = cast(string)tokens[p].text; p++; enforceEx!QuerySyntaxException(p == end || tokens[p].type == TokenType.Dot, "SELECT clause item is invalid (only [alias.]field{[.field2]}+ allowed) " ~ errorContext(tokens[start])); if (p < end - 1 && tokens[p].type == TokenType.Dot) p++; } else { //writeln("select clause non-alias: " ~ tokens[p].text ~ " query: " ~ query); } string[] fieldNames; while (p < end && tokens[p].type == TokenType.Ident) { fieldNames ~= tokens[p].text; p++; if (p > end - 1 || tokens[p].type != TokenType.Dot) break; // skipping dot p++; } //writeln("parseSelectClauseItem pos=" ~ to!string(p) ~ " end=" ~ to!string(end)); enforceEx!QuerySyntaxException(p >= end, "SELECT clause item is invalid (only [alias.]field{[.field2]}+ allowed) " ~ errorContext(tokens[start])); addSelectClauseItem(aliasName, fieldNames); } void parseSelectClause(int start, int end) { enforceEx!QuerySyntaxException(start < end, "Invalid SELECT clause" ~ errorContext(tokens[start])); splitCommaDelimitedList(start, end, &parseSelectClauseItem); } void defaultSelectClause() { addSelectClauseItem(fromClause.first.entityAlias, null); } bool validateSelectClause() { enforceEx!QuerySyntaxException(selectClause != null && selectClause.length > 0, "Invalid SELECT clause"); int aliasCount = 0; int fieldCount = 0; foreach(a; selectClause) { if (a.prop !is null) fieldCount++; else aliasCount++; } enforceEx!QuerySyntaxException((aliasCount == 1 && fieldCount == 0) || (aliasCount == 0 && fieldCount > 0), "You should either use single entity alias or one or more properties in SELECT clause. Don't mix objects with primitive fields"); return aliasCount > 0; } void parseWhereClause(int start, int end) { enforceEx!QuerySyntaxException(start < end, "Invalid WHERE clause" ~ errorContext(tokens[start])); whereClause = new Token(tokens[start].pos, TokenType.Expression, tokens, start, end); //writeln("before convert fields:\n" ~ whereClause.dump(0)); convertFields(whereClause.children); //writeln("after convertFields before convertIsNullIsNotNull:\n" ~ whereClause.dump(0)); convertIsNullIsNotNull(whereClause.children); //writeln("after convertIsNullIsNotNull\n" ~ whereClause.dump(0)); convertUnaryPlusMinus(whereClause.children); //writeln("after convertUnaryPlusMinus\n" ~ whereClause.dump(0)); foldBraces(whereClause.children); //writeln("after foldBraces\n" ~ whereClause.dump(0)); foldOperators(whereClause.children); //writeln("after foldOperators\n" ~ whereClause.dump(0)); dropBraces(whereClause.children); //writeln("after dropBraces\n" ~ whereClause.dump(0)); } void foldBraces(ref Token[] items) { while (true) { if (items.length == 0) return; int lastOpen = -1; int firstClose = -1; for (int i=0; i<items.length; i++) { if (items[i].type == TokenType.OpenBracket) { lastOpen = i; } if (items[i].type == TokenType.CloseBracket) { firstClose = i; break; } } if (lastOpen == -1 && firstClose == -1) return; //writeln("folding braces " ~ to!string(lastOpen) ~ " .. " ~ to!string(firstClose)); enforceEx!QuerySyntaxException(lastOpen >= 0 && lastOpen < firstClose, "Unpaired braces in WHERE clause" ~ errorContext(tokens[lastOpen])); Token folded = new Token(items[lastOpen].pos, TokenType.Braces, items, lastOpen + 1, firstClose); // size_t oldlen = items.length; // int removed = firstClose - lastOpen; replaceInPlace(items, lastOpen, firstClose + 1, [folded]); // assert(items.length == oldlen - removed); foldBraces(folded.children); } } static void dropBraces(ref Token[] items) { foreach (t; items) { if (t.children.length > 0) dropBraces(t.children); } for (int i=0; i<items.length; i++) { if (items[i].type != TokenType.Braces) continue; if (items[i].children.length == 1) { Token t = items[i].children[0]; replaceInPlace(items, i, i + 1, [t]); } } } void convertIsNullIsNotNull(ref Token[] items) { for (int i = cast(int)items.length - 2; i >= 0; i--) { if (items[i].type != TokenType.Operator || items[i + 1].type != TokenType.Keyword) continue; if (items[i].operator == OperatorType.IS && items[i + 1].keyword == KeywordType.NULL) { Token folded = new Token(items[i].pos,OperatorType.IS_NULL, "IS NULL"); replaceInPlace(items, i, i + 2, [folded]); i-=2; } } for (int i = cast(int)items.length - 3; i >= 0; i--) { if (items[i].type != TokenType.Operator || items[i + 1].type != TokenType.Operator || items[i + 2].type != TokenType.Keyword) continue; if (items[i].operator == OperatorType.IS && items[i + 1].operator == OperatorType.NOT && items[i + 2].keyword == KeywordType.NULL) { Token folded = new Token(items[i].pos, OperatorType.IS_NOT_NULL, "IS NOT NULL"); replaceInPlace(items, i, i + 3, [folded]); i-=3; } } } void convertFields(ref Token[] items) { while(true) { int p = -1; for (int i=0; i<items.length; i++) { if (items[i].type != TokenType.Ident && items[i].type != TokenType.Alias) continue; p = i; break; } if (p == -1) return; // found identifier at position p string[] idents; int lastp = p; idents ~= items[p].text; for (int i=p + 1; i < items.length - 1; i+=2) { if (items[i].type != TokenType.Dot) break; enforceEx!QuerySyntaxException(i < items.length - 1 && items[i + 1].type == TokenType.Ident, "Syntax error in WHERE condition - no property name after . " ~ errorContext(items[p])); lastp = i + 1; idents ~= items[i + 1].text; } string fullName; FromClauseItem a; if (items[p].type == TokenType.Alias) { a = findFromClauseByAlias(idents[0]); idents.popFront(); } else { // use first FROM clause if alias is not specified a = fromClause.first; } string aliasName = a.entityAlias; EntityInfo ei = cast(EntityInfo)a.entity; enforceEx!QuerySyntaxException(idents.length > 0, "Syntax error in WHERE condition - alias w/o property name: " ~ aliasName ~ errorContext(items[p])); PropertyInfo pi; fullName = aliasName; while(true) { string propertyName = idents[0]; idents.popFront(); fullName ~= "." ~ propertyName; pi = cast(PropertyInfo)ei.findProperty(propertyName); while (pi.embedded) { // loop to allow nested @Embedded enforceEx!QuerySyntaxException(idents.length > 0, "Syntax error in WHERE condition - @Embedded property reference should include reference to @Embeddable property " ~ aliasName ~ errorContext(items[p])); propertyName = idents[0]; idents.popFront(); pi = cast(PropertyInfo)pi.referencedEntity.findProperty(propertyName); fullName = fullName ~ "." ~ propertyName; } if (idents.length == 0) break; if (idents.length > 0) { // more field names string pname = idents[0]; enforceEx!QuerySyntaxException(pi.referencedEntity !is null, "Unexpected extra field name " ~ pname ~ " - property " ~ propertyName ~ " doesn't content subproperties " ~ errorContext(items[p])); ei = cast(EntityInfo)pi.referencedEntity; FromClauseItem newClause = fromClause.findByPath(fullName); if (newClause is null) { // autogenerate FROM clause newClause = fromClause.add(ei, null, pi.nullable ? JoinType.LeftJoin : JoinType.InnerJoin, false, a, pi); } a = newClause; } } enforceEx!QuerySyntaxException(idents.length == 0, "Unexpected extra field name " ~ idents[0] ~ errorContext(items[p])); //writeln("full name = " ~ fullName); Token t = new Token(items[p].pos, TokenType.Field, fullName); t.entity = cast(EntityInfo)ei; t.field = cast(PropertyInfo)pi; t.from = a; replaceInPlace(items, p, lastp + 1, [t]); } } static void convertUnaryPlusMinus(ref Token[] items) { foreach (t; items) { if (t.children.length > 0) convertUnaryPlusMinus(t.children); } for (int i=0; i<items.length; i++) { if (items[i].type != TokenType.Operator) continue; OperatorType op = items[i].operator; if (op == OperatorType.ADD || op == OperatorType.SUB) { // convert + and - to unary form if necessary if (i == 0 || !items[i - 1].isExpression()) { items[i].operator = (op == OperatorType.ADD) ? OperatorType.UNARY_PLUS : OperatorType.UNARY_MINUS; } } } } string errorContext(Token token) { return " near `" ~ query[token.pos .. $] ~ "` in query `" ~ query ~ "`"; } void foldCommaSeparatedList(Token braces) { // fold inside braces Token[] items = braces.children; int start = 0; Token[] list; for (int i=0; i <= items.length; i++) { if (i == items.length || items[i].type == TokenType.Comma) { enforceEx!QuerySyntaxException(i > start, "Empty item in comma separated list" ~ errorContext(items[i])); enforceEx!QuerySyntaxException(i != items.length - 1, "Empty item in comma separated list" ~ errorContext(items[i])); Token item = new Token(items[start].pos, TokenType.Expression, braces.children, start, i); foldOperators(item.children); enforceEx!QuerySyntaxException(item.children.length == 1, "Invalid expression in list item" ~ errorContext(items[i])); list ~= item.children[0]; start = i + 1; } } enforceEx!QuerySyntaxException(list.length > 0, "Empty list" ~ errorContext(items[0])); braces.type = TokenType.CommaDelimitedList; braces.children = list; } void foldOperators(ref Token[] items) { foreach (t; items) { if (t.children.length > 0) foldOperators(t.children); } while (true) { // int bestOpPosition = -1; int bestOpPrecedency = -1; OperatorType t = OperatorType.NONE; for (int i=0; i<items.length; i++) { if (items[i].type != TokenType.Operator) continue; int p = operatorPrecedency(items[i].operator); if (p > bestOpPrecedency) { bestOpPrecedency = p; bestOpPosition = i; t = items[i].operator; } } if (bestOpPrecedency == -1) return; //writeln("Found op " ~ items[bestOpPosition].toString() ~ " at position " ~ to!string(bestOpPosition) ~ " with priority " ~ to!string(bestOpPrecedency)); if (t == OperatorType.NOT || t == OperatorType.UNARY_PLUS || t == OperatorType.UNARY_MINUS) { // fold unary enforceEx!QuerySyntaxException(bestOpPosition < items.length && items[bestOpPosition + 1].isExpression(), "Syntax error in WHERE condition " ~ errorContext(items[bestOpPosition])); Token folded = new Token(items[bestOpPosition].pos, t, items[bestOpPosition].text, items[bestOpPosition + 1]); replaceInPlace(items, bestOpPosition, bestOpPosition + 2, [folded]); } else if (t == OperatorType.IS_NULL || t == OperatorType.IS_NOT_NULL) { // fold unary enforceEx!QuerySyntaxException(bestOpPosition > 0 && items[bestOpPosition - 1].isExpression(), "Syntax error in WHERE condition " ~ errorContext(items[bestOpPosition])); Token folded = new Token(items[bestOpPosition - 1].pos, t, items[bestOpPosition].text, items[bestOpPosition - 1]); replaceInPlace(items, bestOpPosition - 1, bestOpPosition + 1, [folded]); } else if (t == OperatorType.BETWEEN) { // fold X BETWEEN A AND B enforceEx!QuerySyntaxException(bestOpPosition > 0, "Syntax error in WHERE condition - no left arg for BETWEEN operator"); enforceEx!QuerySyntaxException(bestOpPosition < items.length - 1, "Syntax error in WHERE condition - no min bound for BETWEEN operator " ~ errorContext(items[bestOpPosition])); enforceEx!QuerySyntaxException(bestOpPosition < items.length - 3, "Syntax error in WHERE condition - no max bound for BETWEEN operator " ~ errorContext(items[bestOpPosition])); enforceEx!QuerySyntaxException(items[bestOpPosition + 2].operator == OperatorType.AND, "Syntax error in WHERE condition - no max bound for BETWEEN operator" ~ errorContext(items[bestOpPosition])); Token folded = new Token(items[bestOpPosition - 1].pos, t, items[bestOpPosition].text, items[bestOpPosition - 1]); folded.children ~= items[bestOpPosition + 1]; folded.children ~= items[bestOpPosition + 3]; replaceInPlace(items, bestOpPosition - 1, bestOpPosition + 4, [folded]); } else if (t == OperatorType.IN) { // fold X IN (A, B, ...) enforceEx!QuerySyntaxException(bestOpPosition > 0, "Syntax error in WHERE condition - no left arg for IN operator"); enforceEx!QuerySyntaxException(bestOpPosition < items.length - 1, "Syntax error in WHERE condition - no value list for IN operator " ~ errorContext(items[bestOpPosition])); enforceEx!QuerySyntaxException(items[bestOpPosition + 1].type == TokenType.Braces, "Syntax error in WHERE condition - no value list in braces for IN operator" ~ errorContext(items[bestOpPosition])); Token folded = new Token(items[bestOpPosition - 1].pos, t, items[bestOpPosition].text, items[bestOpPosition - 1]); folded.children ~= items[bestOpPosition + 1]; foldCommaSeparatedList(items[bestOpPosition + 1]); replaceInPlace(items, bestOpPosition - 1, bestOpPosition + 2, [folded]); // fold value list //writeln("IN operator found: " ~ folded.dump(3)); } else { // fold binary enforceEx!QuerySyntaxException(bestOpPosition > 0, "Syntax error in WHERE condition - no left arg for binary operator " ~ errorContext(items[bestOpPosition])); enforceEx!QuerySyntaxException(bestOpPosition < items.length - 1, "Syntax error in WHERE condition - no right arg for binary operator " ~ errorContext(items[bestOpPosition])); //writeln("binary op " ~ items[bestOpPosition - 1].toString() ~ " " ~ items[bestOpPosition].toString() ~ " " ~ items[bestOpPosition + 1].toString()); enforceEx!QuerySyntaxException(items[bestOpPosition - 1].isExpression(), "Syntax error in WHERE condition - wrong type of left arg for binary operator " ~ errorContext(items[bestOpPosition])); enforceEx!QuerySyntaxException(items[bestOpPosition + 1].isExpression(), "Syntax error in WHERE condition - wrong type of right arg for binary operator " ~ errorContext(items[bestOpPosition])); Token folded = new Token(items[bestOpPosition - 1].pos, t, items[bestOpPosition].text, items[bestOpPosition - 1], items[bestOpPosition + 1]); auto oldlen = items.length; replaceInPlace(items, bestOpPosition - 1, bestOpPosition + 2, [folded]); assert(items.length == oldlen - 2); } } } void parseOrderClause(int start, int end) { enforceEx!QuerySyntaxException(start < end, "Invalid ORDER BY clause" ~ errorContext(tokens[start])); splitCommaDelimitedList(start, end, &parseOrderByClauseItem); } /// returns position of keyword in tokens array, -1 if not found int findKeyword(KeywordType k, int startFrom = 0) { for (int i = startFrom; i < tokens.length; i++) { if (tokens[i].type == TokenType.Keyword && tokens[i].keyword == k) return i; } return -1; } int addSelectSQL(Dialect dialect, ParsedQuery res, string tableName, bool first, const EntityInfo ei) { int colCount = 0; for(int j = 0; j < ei.getPropertyCount(); j++) { PropertyInfo f = cast(PropertyInfo)ei.getProperty(j); string fieldName = f.columnName; if (f.embedded) { // put embedded cols here colCount += addSelectSQL(dialect, res, tableName, first && colCount == 0, f.referencedEntity); continue; } else if (f.oneToOne) { } else { } if (fieldName is null) continue; if (!first || colCount > 0) { res.appendSQL(", "); } else first = false; res.appendSQL(tableName ~ "." ~ dialect.quoteIfNeeded(fieldName)); colCount++; } return colCount; } void addSelectSQL(Dialect dialect, ParsedQuery res) { res.appendSQL("SELECT "); bool first = true; assert(selectClause.length > 0); int colCount = 0; foreach(i, s; selectClause) { s.from.selectIndex = cast(int)i; } if (selectClause[0].prop is null) { // object alias is specified: add all properties of object //writeln("selected entity count: " ~ to!string(selectClause.length)); res.setEntity(selectClause[0].from.entity); for(int i = 0; i < fromClause.length; i++) { FromClauseItem from = fromClause[i]; if (!from.fetch) continue; string tableName = from.sqlAlias; assert(from !is null); assert(from.entity !is null); colCount += addSelectSQL(dialect, res, tableName, colCount == 0, from.entity); } } else { // individual fields specified res.setEntity(null); foreach(a; selectClause) { string fieldName = a.prop.columnName; string tableName = a.from.sqlAlias; if (!first) { res.appendSQL(", "); } else first = false; res.appendSQL(tableName ~ "." ~ dialect.quoteIfNeeded(fieldName)); colCount++; } } res.setColCount(colCount); res.setSelect(selectClause); } void addFromSQL(Dialect dialect, ParsedQuery res) { res.setFromClause(fromClause); res.appendSpace(); res.appendSQL("FROM "); res.appendSQL(dialect.quoteIfNeeded(fromClause.first.entity.tableName) ~ " AS " ~ fromClause.first.sqlAlias); for (int i = 1; i < fromClause.length; i++) { FromClauseItem join = fromClause[i]; FromClauseItem base = join.base; assert(join !is null && base !is null); res.appendSpace(); assert(join.baseProperty !is null); if (join.baseProperty.manyToMany) { string joinTableAlias = base.sqlAlias ~ join.sqlAlias; res.appendSQL(join.joinType == JoinType.LeftJoin ? "LEFT JOIN " : "INNER JOIN "); res.appendSQL(dialect.quoteIfNeeded(join.baseProperty.joinTable.tableName) ~ " AS " ~ joinTableAlias); res.appendSQL(" ON "); res.appendSQL(base.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(base.entity.getKeyProperty().columnName)); res.appendSQL("="); res.appendSQL(joinTableAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.baseProperty.joinTable.column1)); res.appendSpace(); res.appendSQL(join.joinType == JoinType.LeftJoin ? "LEFT JOIN " : "INNER JOIN "); res.appendSQL(dialect.quoteIfNeeded(join.entity.tableName) ~ " AS " ~ join.sqlAlias); res.appendSQL(" ON "); res.appendSQL(joinTableAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.baseProperty.joinTable.column2)); res.appendSQL("="); res.appendSQL(join.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.entity.getKeyProperty().columnName)); } else { res.appendSQL(join.joinType == JoinType.LeftJoin ? "LEFT JOIN " : "INNER JOIN "); res.appendSQL(dialect.quoteIfNeeded(join.entity.tableName) ~ " AS " ~ join.sqlAlias); res.appendSQL(" ON "); //writeln("adding ON"); if (join.baseProperty.oneToOne) { assert(join.baseProperty.columnName !is null || join.baseProperty.referencedProperty !is null); if (join.baseProperty.columnName !is null) { //writeln("fk is in base"); res.appendSQL(base.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.baseProperty.columnName)); res.appendSQL("="); res.appendSQL(join.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.entity.getKeyProperty().columnName)); } else { //writeln("fk is in join"); res.appendSQL(base.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(base.entity.getKeyProperty().columnName)); res.appendSQL("="); res.appendSQL(join.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.baseProperty.referencedProperty.columnName)); } } else if (join.baseProperty.manyToOne) { assert(join.baseProperty.columnName !is null, "ManyToOne should have JoinColumn as well"); //writeln("fk is in base"); res.appendSQL(base.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.baseProperty.columnName)); res.appendSQL("="); res.appendSQL(join.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.entity.getKeyProperty().columnName)); } else if (join.baseProperty.oneToMany) { res.appendSQL(base.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(base.entity.getKeyProperty().columnName)); res.appendSQL("="); res.appendSQL(join.sqlAlias); res.appendSQL("."); res.appendSQL(dialect.quoteIfNeeded(join.baseProperty.referencedProperty.columnName)); } else { // TODO: support other relations throw new QuerySyntaxException("Invalid relation type in join"); } } } } void addWhereCondition(Token t, int basePrecedency, Dialect dialect, ParsedQuery res) { if (t.type == TokenType.Expression) { addWhereCondition(t.children[0], basePrecedency, dialect, res); } else if (t.type == TokenType.Field) { string tableName = t.from.sqlAlias; string fieldName = t.field.columnName; res.appendSpace(); res.appendSQL(tableName ~ "." ~ dialect.quoteIfNeeded(fieldName)); } else if (t.type == TokenType.Number) { res.appendSpace(); res.appendSQL(t.text); } else if (t.type == TokenType.String) { res.appendSpace(); res.appendSQL(dialect.quoteSqlString(t.text)); } else if (t.type == TokenType.Parameter) { res.appendSpace(); res.appendSQL("?"); res.addParam(t.text); } else if (t.type == TokenType.CommaDelimitedList) { bool first = true; for (int i=0; i<t.children.length; i++) { if (!first) res.appendSQL(", "); else first = false; addWhereCondition(t.children[i], 0, dialect, res); } } else if (t.type == TokenType.OpExpr) { int currentPrecedency = operatorPrecedency(t.operator); bool needBraces = currentPrecedency < basePrecedency; if (needBraces) res.appendSQL("("); switch(t.operator) { case OperatorType.LIKE: case OperatorType.EQ: case OperatorType.NE: case OperatorType.LT: case OperatorType.GT: case OperatorType.LE: case OperatorType.GE: case OperatorType.MUL: case OperatorType.ADD: case OperatorType.SUB: case OperatorType.DIV: case OperatorType.AND: case OperatorType.OR: case OperatorType.IDIV: case OperatorType.MOD: // binary op if (!needBraces) res.appendSpace(); addWhereCondition(t.children[0], currentPrecedency, dialect, res); res.appendSpace(); res.appendSQL(t.text); res.appendSpace(); addWhereCondition(t.children[1], currentPrecedency, dialect, res); break; case OperatorType.UNARY_PLUS: case OperatorType.UNARY_MINUS: case OperatorType.NOT: // unary op if (!needBraces) res.appendSpace(); res.appendSQL(t.text); res.appendSpace(); addWhereCondition(t.children[0], currentPrecedency, dialect, res); break; case OperatorType.IS_NULL: case OperatorType.IS_NOT_NULL: addWhereCondition(t.children[0], currentPrecedency, dialect, res); res.appendSpace(); res.appendSQL(t.text); res.appendSpace(); break; case OperatorType.BETWEEN: if (!needBraces) res.appendSpace(); addWhereCondition(t.children[0], currentPrecedency, dialect, res); res.appendSQL(" BETWEEN "); addWhereCondition(t.children[1], currentPrecedency, dialect, res); res.appendSQL(" AND "); addWhereCondition(t.children[2], currentPrecedency, dialect, res); break; case OperatorType.IN: if (!needBraces) res.appendSpace(); addWhereCondition(t.children[0], currentPrecedency, dialect, res); res.appendSQL(" IN ("); addWhereCondition(t.children[1], currentPrecedency, dialect, res); res.appendSQL(")"); break; case OperatorType.IS: default: enforceEx!QuerySyntaxException(false, "Unexpected operator" ~ errorContext(t)); break; } if (needBraces) res.appendSQL(")"); } } void addWhereSQL(Dialect dialect, ParsedQuery res) { if (whereClause is null) return; res.appendSpace(); res.appendSQL("WHERE "); addWhereCondition(whereClause, 0, dialect, res); } void addOrderBySQL(Dialect dialect, ParsedQuery res) { if (orderByClause.length == 0) return; res.appendSpace(); res.appendSQL("ORDER BY "); bool first = true; // individual fields specified foreach(a; orderByClause) { string fieldName = a.prop.columnName; string tableName = a.from.sqlAlias; if (!first) { res.appendSQL(", "); } else first = false; res.appendSQL(tableName ~ "." ~ dialect.quoteIfNeeded(fieldName)); if (!a.asc) res.appendSQL(" DESC"); } } ParsedQuery makeSQL(Dialect dialect) { ParsedQuery res = new ParsedQuery(query); addSelectSQL(dialect, res); addFromSQL(dialect, res); addWhereSQL(dialect, res); addOrderBySQL(dialect, res); return res; } } enum KeywordType { NONE, SELECT, FROM, WHERE, ORDER, BY, ASC, DESC, JOIN, INNER, OUTER, LEFT, RIGHT, FETCH, AS, LIKE, IN, IS, NOT, NULL, AND, OR, BETWEEN, DIV, MOD, } KeywordType isKeyword(string str) { return isKeyword(str.dup); } KeywordType isKeyword(char[] str) { char[] s = toUpper(str); if (s=="SELECT") return KeywordType.SELECT; if (s=="FROM") return KeywordType.FROM; if (s=="WHERE") return KeywordType.WHERE; if (s=="ORDER") return KeywordType.ORDER; if (s=="BY") return KeywordType.BY; if (s=="ASC") return KeywordType.ASC; if (s=="DESC") return KeywordType.DESC; if (s=="JOIN") return KeywordType.JOIN; if (s=="INNER") return KeywordType.INNER; if (s=="OUTER") return KeywordType.OUTER; if (s=="LEFT") return KeywordType.LEFT; if (s=="RIGHT") return KeywordType.RIGHT; if (s=="FETCH") return KeywordType.FETCH; if (s=="LIKE") return KeywordType.LIKE; if (s=="IN") return KeywordType.IN; if (s=="IS") return KeywordType.IS; if (s=="NOT") return KeywordType.NOT; if (s=="NULL") return KeywordType.NULL; if (s=="AS") return KeywordType.AS; if (s=="AND") return KeywordType.AND; if (s=="OR") return KeywordType.OR; if (s=="BETWEEN") return KeywordType.BETWEEN; if (s=="DIV") return KeywordType.DIV; if (s=="MOD") return KeywordType.MOD; return KeywordType.NONE; } unittest { assert(isKeyword("Null") == KeywordType.NULL); assert(isKeyword("from") == KeywordType.FROM); assert(isKeyword("SELECT") == KeywordType.SELECT); assert(isKeyword("blabla") == KeywordType.NONE); } enum OperatorType { NONE, // symbolic EQ, // == NE, // != <> LT, // < GT, // > LE, // <= GE, // >= MUL,// * ADD,// + SUB,// - DIV,// / // from keywords LIKE, IN, IS, NOT, AND, OR, BETWEEN, IDIV, MOD, UNARY_PLUS, UNARY_MINUS, IS_NULL, IS_NOT_NULL, } OperatorType isOperator(KeywordType t) { switch (t) { case KeywordType.LIKE: return OperatorType.LIKE; case KeywordType.IN: return OperatorType.IN; case KeywordType.IS: return OperatorType.IS; case KeywordType.NOT: return OperatorType.NOT; case KeywordType.AND: return OperatorType.AND; case KeywordType.OR: return OperatorType.OR; case KeywordType.BETWEEN: return OperatorType.BETWEEN; case KeywordType.DIV: return OperatorType.IDIV; case KeywordType.MOD: return OperatorType.MOD; default: return OperatorType.NONE; } } int operatorPrecedency(OperatorType t) { switch(t) { case OperatorType.EQ: return 5; // == case OperatorType.NE: return 5; // != <> case OperatorType.LT: return 5; // < case OperatorType.GT: return 5; // > case OperatorType.LE: return 5; // <= case OperatorType.GE: return 5; // >= case OperatorType.MUL: return 10; // * case OperatorType.ADD: return 9; // + case OperatorType.SUB: return 9; // - case OperatorType.DIV: return 10; // / // from keywords case OperatorType.LIKE: return 11; case OperatorType.IN: return 12; case OperatorType.IS: return 13; case OperatorType.NOT: return 6; // ??? case OperatorType.AND: return 4; case OperatorType.OR: return 3; case OperatorType.BETWEEN: return 7; // ??? case OperatorType.IDIV: return 10; case OperatorType.MOD: return 10; case OperatorType.UNARY_PLUS: return 15; case OperatorType.UNARY_MINUS: return 15; case OperatorType.IS_NULL: return 15; case OperatorType.IS_NOT_NULL: return 15; default: return -1; } } OperatorType isOperator(string s, ref int i) { int len = cast(int)s.length; char ch = s[i]; char ch2 = i < len - 1 ? s[i + 1] : 0; //char ch3 = i < len - 2 ? s[i + 2] : 0; if (ch == '=' && ch2 == '=') { i++; return OperatorType.EQ; } // == if (ch == '!' && ch2 == '=') { i++; return OperatorType.NE; } // != if (ch == '<' && ch2 == '>') { i++; return OperatorType.NE; } // <> if (ch == '<' && ch2 == '=') { i++; return OperatorType.LE; } // <= if (ch == '>' && ch2 == '=') { i++; return OperatorType.GE; } // >= if (ch == '=') return OperatorType.EQ; // = if (ch == '<') return OperatorType.LT; // < if (ch == '>') return OperatorType.GT; // < if (ch == '*') return OperatorType.MUL; // < if (ch == '+') return OperatorType.ADD; // < if (ch == '-') return OperatorType.SUB; // < if (ch == '/') return OperatorType.DIV; // < return OperatorType.NONE; } enum TokenType { Keyword, // WHERE Ident, // ident Number, // 25 13.5e-10 String, // 'string' Operator, // == != <= >= < > + - * / Dot, // . OpenBracket, // ( CloseBracket, // ) Comma, // , Entity, // entity name Field, // field name of some entity Alias, // alias name of some entity Parameter, // ident after : // types of compound AST nodes Expression, // any expression Braces, // ( tokens ) CommaDelimitedList, // tokens, ... , tokens OpExpr, // operator expression; current token == operator, children = params } class Token { int pos; TokenType type; KeywordType keyword = KeywordType.NONE; OperatorType operator = OperatorType.NONE; string text; string spaceAfter; EntityInfo entity; PropertyInfo field; FromClauseItem from; Token[] children; this(int pos, TokenType type, string text) { this.pos = pos; this.type = type; this.text = text; } this(int pos, KeywordType keyword, string text) { this.pos = pos; this.type = TokenType.Keyword; this.keyword = keyword; this.text = text; } this(int pos, OperatorType op, string text) { this.pos = pos; this.type = TokenType.Operator; this.operator = op; this.text = text; } this(int pos, TokenType type, Token[] base, int start, int end) { this.pos = pos; this.type = type; this.children = new Token[end - start]; for (int i = start; i < end; i++) children[i - start] = base[i]; } // unary operator expression this(int pos, OperatorType type, string text, Token right) { this.pos = pos; this.type = TokenType.OpExpr; this.operator = type; this.text = text; this.children = new Token[1]; this.children[0] = right; } // binary operator expression this(int pos, OperatorType type, string text, Token left, Token right) { this.pos = pos; this.type = TokenType.OpExpr; this.text = text; this.operator = type; this.children = new Token[2]; this.children[0] = left; this.children[1] = right; } bool isExpression() { return type==TokenType.Expression || type==TokenType.Braces || type==TokenType.OpExpr || type==TokenType.Parameter || type==TokenType.Field || type==TokenType.String || type==TokenType.Number; } bool isCompound() { return this.type >= TokenType.Expression; } string dump(int level) { string res; for (int i=0; i<level; i++) res ~= " "; res ~= toString() ~ "\n"; foreach (c; children) res ~= c.dump(level + 1); return res; } override string toString() { switch (type) { case TokenType.Keyword: // WHERE case TokenType.Ident: return "`" ~ text ~ "`"; // ident case TokenType.Number: return "" ~ text; // 25 13.5e-10 case TokenType.String: return "'" ~ text ~ "'"; // 'string' case TokenType.Operator: return "op:" ~ text; // == != <= >= < > + - * / case TokenType.Dot: return "."; // . case TokenType.OpenBracket: return "("; // ( case TokenType.CloseBracket: return ")"; // ) case TokenType.Comma: return ","; // , case TokenType.Entity: return "entity: " ~ entity.name; // entity name case TokenType.Field: return from.entityAlias ~ "." ~ field.propertyName; // field name of some entity case TokenType.Alias: return "alias: " ~ text; // alias name of some entity case TokenType.Parameter: return ":" ~ text; // ident after : // types of compound AST nodes case TokenType.Expression: return "expr"; // any expression case TokenType.Braces: return "()"; // ( tokens ) case TokenType.CommaDelimitedList: return ",,,"; // tokens, ... , tokens case TokenType.OpExpr: return "" ~ text; default: return "UNKNOWN"; } } } Token[] tokenize(string s) { Token[] res; int startpos = 0; int state = 0; int len = cast(int)s.length; for (int i=0; i<len; i++) { char ch = s[i]; char ch2 = i < len - 1 ? s[i + 1] : 0; char ch3 = i < len - 2 ? s[i + 2] : 0; string text; bool quotedIdent = ch == '`'; startpos = i; OperatorType op = isOperator(s, i); if (op != OperatorType.NONE) { // operator res ~= new Token(startpos, op, s[startpos .. i + 1]); } else if (ch == ':' && (isAlpha(ch2) || ch2=='_')) { // parameter name i++; // && state == 0 for(int j=i; j<len; j++) { if (isAlphaNum(s[j])) { text ~= s[j]; i = j; } else { break; } } enforceEx!QuerySyntaxException(text.length > 0, "Invalid parameter name near " ~ cast(string)s[startpos .. $]); res ~= new Token(startpos, TokenType.Parameter, text); } else if (isAlpha(ch) || ch=='_' || quotedIdent) { // identifier or keyword if (quotedIdent) { i++; enforceEx!QuerySyntaxException(i < len - 1, "Invalid quoted identifier near " ~ cast(string)s[startpos .. $]); } // && state == 0 for(int j=i; j<len; j++) { if (isAlphaNum(s[j])) { text ~= s[j]; i = j; } else { break; } } enforceEx!QuerySyntaxException(text.length > 0, "Invalid quoted identifier near " ~ cast(string)s[startpos .. $]); if (quotedIdent) { enforceEx!QuerySyntaxException(i < len - 1 && s[i + 1] == '`', "Invalid quoted identifier near " ~ cast(string)s[startpos .. $]); i++; } KeywordType keywordId = isKeyword(text); if (keywordId != KeywordType.NONE && !quotedIdent) { OperatorType keywordOp = isOperator(keywordId); if (keywordOp != OperatorType.NONE) res ~= new Token(startpos, keywordOp, text); // operator keyword else res ~= new Token(startpos, keywordId, text); } else res ~= new Token(startpos, TokenType.Ident, text); } else if (isWhite(ch)) { // whitespace for(int j=i; j<len; j++) { if (isWhite(s[j])) { text ~= s[j]; i = j; } else { break; } } // don't add whitespace to lexer results as separate token // add as spaceAfter if (res.length > 0) { res[$ - 1].spaceAfter = text; } } else if (ch == '\'') { // string constant i++; for(int j=i; j<len; j++) { if (s[j] != '\'') { text ~= s[j]; i = j; } else { break; } } enforceEx!QuerySyntaxException(i < len - 1 && s[i + 1] == '\'', "Unfinished string near " ~ cast(string)s[startpos .. $]); i++; res ~= new Token(startpos, TokenType.String, text); } else if (isDigit(ch) || (ch == '.' && isDigit(ch2))) { // numeric constant if (ch == '.') { // .25 text ~= '.'; i++; for(int j = i; j<len; j++) { if (isDigit(s[j])) { text ~= s[j]; i = j; } else { break; } } } else { // 123 for(int j=i; j<len; j++) { if (isDigit(s[j])) { text ~= s[j]; i = j; } else { break; } } // .25 if (i < len - 1 && s[i + 1] == '.') { text ~= '.'; i++; for(int j = i; j<len; j++) { if (isDigit(s[j])) { text ~= s[j]; i = j; } else { break; } } } } if (i < len - 1 && toLower(s[i + 1]) == 'e') { text ~= s[i+1]; i++; if (i < len - 1 && (s[i + 1] == '-' || s[i + 1] == '+')) { text ~= s[i+1]; i++; } enforceEx!QuerySyntaxException(i < len - 1 && isDigit(s[i]), "Invalid number near " ~ cast(string)s[startpos .. $]); for(int j = i; j<len; j++) { if (isDigit(s[j])) { text ~= s[j]; i = j; } else { break; } } } enforceEx!QuerySyntaxException(i >= len - 1 || !isAlpha(s[i]), "Invalid number near " ~ cast(string)s[startpos .. $]); res ~= new Token(startpos, TokenType.Number, text); } else if (ch == '.') { res ~= new Token(startpos, TokenType.Dot, "."); } else if (ch == '(') { res ~= new Token(startpos, TokenType.OpenBracket, "("); } else if (ch == ')') { res ~= new Token(startpos, TokenType.CloseBracket, ")"); } else if (ch == ',') { res ~= new Token(startpos, TokenType.Comma, ","); } else { enforceEx!QuerySyntaxException(false, "Invalid character near " ~ cast(string)s[startpos .. $]); } } return res; } unittest { Token[] tokens; tokens = tokenize("SELECT a From User a where a.flags = 12 AND a.name='john' ORDER BY a.idx ASC"); assert(tokens.length == 23); assert(tokens[0].type == TokenType.Keyword); assert(tokens[2].type == TokenType.Keyword); assert(tokens[5].type == TokenType.Keyword); assert(tokens[5].text == "where"); assert(tokens[10].type == TokenType.Number); assert(tokens[10].text == "12"); assert(tokens[16].type == TokenType.String); assert(tokens[16].text == "john"); assert(tokens[22].type == TokenType.Keyword); assert(tokens[22].text == "ASC"); } class ParameterValues { Variant[string] values; int[][string]params; int[string]unboundParams; this(int[][string]params) { this.params = params; foreach(key, value; params) { unboundParams[key] = 1; } } void setParameter(string name, Variant value) { enforceEx!QueryParameterException((name in params) !is null, "Attempting to set unknown parameter " ~ name); unboundParams.remove(name); values[name] = value; } void checkAllParametersSet() { if (unboundParams.length == 0) return; string list; foreach(key, value; unboundParams) { if (list.length > 0) list ~= ", "; list ~= key; } enforceEx!QueryParameterException(false, "Parameters " ~ list ~ " not set"); } void applyParams(DataSetWriter ds) { foreach(key, indexes; params) { Variant value = values[key]; foreach(i; indexes) ds.setVariant(i, value); } } } class ParsedQuery { private string _hql; private string _sql; private int[][string]params; // contains 1-based indexes of ? ? ? placeholders in SQL for param by name private int paramIndex = 1; private FromClause _from; private SelectClauseItem[] _select; private EntityInfo _entity; private int _colCount = 0; this(string hql) { _hql = hql; } @property string hql() { return _hql; } @property string sql() { return _sql; } @property const(EntityInfo)entity() { return _entity; } @property int colCount() { return _colCount; } @property FromClause from() { return _from; } @property SelectClauseItem[] select() { return _select; } void setEntity(const EntityInfo entity) { _entity = cast(EntityInfo)entity; } void setFromClause(FromClause from) { _from = from; } void setSelect(SelectClauseItem[] items) { _select = items; } void setColCount(int cnt) { _colCount = cnt; } void addParam(string paramName) { if ((paramName in params) is null) { params[paramName] = [paramIndex++]; } else { params[paramName] ~= [paramIndex++]; } } int[] getParam(string paramName) { if ((paramName in params) is null) { throw new HibernatedException("Parameter " ~ paramName ~ " not found in query " ~ _hql); } else { return params[paramName]; } } void appendSQL(string sql) { _sql ~= sql; } void appendSpace() { if (_sql.length > 0 && _sql[$ - 1] != ' ') _sql ~= ' '; } ParameterValues createParams() { return new ParameterValues(params); } } unittest { ParsedQuery q = new ParsedQuery("FROM User where id = :param1 or id = :param2"); q.addParam("param1"); // 1 q.addParam("param2"); // 2 q.addParam("param1"); // 3 q.addParam("param1"); // 4 q.addParam("param3"); // 5 q.addParam("param2"); // 6 assert(q.getParam("param1") == [1,3,4]); assert(q.getParam("param2") == [2,6]); assert(q.getParam("param3") == [5]); } unittest { //writeln("query unittest"); import hibernated.tests; EntityMetaData schema = new SchemaInfoImpl!(User, Customer, AccountType, Address, Person, MoreInfo, EvenMoreInfo, Role); QueryParser parser = new QueryParser(schema, "SELECT a FROM User AS a WHERE id = :Id AND name != :skipName OR name IS NULL AND a.flags IS NOT NULL ORDER BY name, a.flags DESC"); assert(parser.parameterNames.length == 2); //writeln("param1=" ~ parser.parameterNames[0]); //writeln("param2=" ~ parser.parameterNames[1]); assert(parser.parameterNames[0] == "Id"); assert(parser.parameterNames[1] == "skipName"); assert(parser.fromClause.length == 1); assert(parser.fromClause.first.entity.name == "User"); assert(parser.fromClause.first.entityAlias == "a"); assert(parser.selectClause.length == 1); assert(parser.selectClause[0].prop is null); assert(parser.selectClause[0].from.entity.name == "User"); assert(parser.orderByClause.length == 2); assert(parser.orderByClause[0].prop.propertyName == "name"); assert(parser.orderByClause[0].from.entity.name == "User"); assert(parser.orderByClause[0].asc == true); assert(parser.orderByClause[1].prop.propertyName == "flags"); assert(parser.orderByClause[1].from.entity.name == "User"); assert(parser.orderByClause[1].asc == false); parser = new QueryParser(schema, "SELECT a FROM User AS a WHERE ((id = :Id) OR (name LIKE 'a%' AND flags = (-5 + 7))) AND name != :skipName AND flags BETWEEN 2*2 AND 42/5 ORDER BY name, a.flags DESC"); assert(parser.whereClause !is null); //writeln(parser.whereClause.dump(0)); Dialect dialect = new MySQLDialect(); assert(dialect.quoteSqlString("abc") == "'abc'"); assert(dialect.quoteSqlString("a'b'c") == "'a\\'b\\'c'"); assert(dialect.quoteSqlString("a\nc") == "'a\\nc'"); parser = new QueryParser(schema, "FROM User AS u WHERE id = :Id and u.name like '%test%'"); ParsedQuery q = parser.makeSQL(dialect); //writeln(parser.whereClause.dump(0)); //writeln(q.hql ~ "\n=>\n" ~ q.sql); //writeln(q.hql); //writeln(q.sql); parser = new QueryParser(schema, "SELECT a FROM Person AS a LEFT JOIN a.moreInfo as b LEFT JOIN b.evenMore c WHERE a.id = :Id AND b.flags > 0 AND c.flags > 0"); assert(parser.fromClause.hasAlias("a")); assert(parser.fromClause.hasAlias("b")); assert(parser.fromClause.findByAlias("a").entityName == "Person"); assert(parser.fromClause.findByAlias("b").entityName == "MoreInfo"); assert(parser.fromClause.findByAlias("b").joinType == JoinType.LeftJoin); assert(parser.fromClause.findByAlias("c").entityName == "EvenMoreInfo"); // indirect JOIN parser = new QueryParser(schema, "SELECT a FROM Person a WHERE a.id = :Id AND a.moreInfo.evenMore.flags > 0"); assert(parser.fromClause.hasAlias("a")); assert(parser.fromClause.length == 3); assert(parser.fromClause[0].entity.tableName == "person"); assert(parser.fromClause[1].entity.tableName == "person_info"); assert(parser.fromClause[1].joinType == JoinType.InnerJoin); assert(parser.fromClause[1].pathString == "a.moreInfo"); assert(parser.fromClause[2].entity.tableName == "person_info2"); assert(parser.fromClause[2].joinType == JoinType.LeftJoin); assert(parser.fromClause[2].pathString == "a.moreInfo.evenMore"); // indirect JOIN, no alias parser = new QueryParser(schema, "FROM Person WHERE id = :Id AND moreInfo.evenMore.flags > 0"); assert(parser.fromClause.length == 3); assert(parser.fromClause[0].entity.tableName == "person"); assert(parser.fromClause[0].fetch == true); //writeln("select fields [" ~ to!string(parser.fromClause[0].startColumn) ~ ", " ~ to!string(parser.fromClause[0].selectedColumns) ~ "]"); //writeln("select fields [" ~ to!string(parser.fromClause[1].startColumn) ~ ", " ~ to!string(parser.fromClause[1].selectedColumns) ~ "]"); //writeln("select fields [" ~ to!string(parser.fromClause[2].startColumn) ~ ", " ~ to!string(parser.fromClause[2].selectedColumns) ~ "]"); assert(parser.fromClause[0].selectedColumns == 4); assert(parser.fromClause[1].entity.tableName == "person_info"); assert(parser.fromClause[1].joinType == JoinType.InnerJoin); assert(parser.fromClause[1].pathString == "_a1.moreInfo"); assert(parser.fromClause[1].fetch == true); assert(parser.fromClause[1].selectedColumns == 2); assert(parser.fromClause[2].entity.tableName == "person_info2"); assert(parser.fromClause[2].joinType == JoinType.LeftJoin); assert(parser.fromClause[2].pathString == "_a1.moreInfo.evenMore"); assert(parser.fromClause[2].fetch == true); assert(parser.fromClause[2].selectedColumns == 3); q = parser.makeSQL(dialect); //writeln(q.hql); //writeln(q.sql); parser = new QueryParser(schema, "FROM User WHERE id in (1, 2, (3 - 1 * 25) / 2, 4 + :Id, 5)"); //writeln(parser.whereClause.dump(0)); q = parser.makeSQL(dialect); //writeln(q.hql); //writeln(q.sql); parser = new QueryParser(schema, "FROM Customer WHERE users.id = 1"); q = parser.makeSQL(dialect); // writeln(q.hql); // writeln(q.sql); assert(q.sql == "SELECT _t1.id, _t1.name, _t1.zip, _t1.city, _t1.street_address, _t1.account_type_fk FROM customers AS _t1 LEFT JOIN users AS _t2 ON _t1.id=_t2.customer_fk WHERE _t2.id = 1"); parser = new QueryParser(schema, "FROM Customer WHERE id = 1"); q = parser.makeSQL(dialect); // writeln(q.hql); // writeln(q.sql); assert(q.sql == "SELECT _t1.id, _t1.name, _t1.zip, _t1.city, _t1.street_address, _t1.account_type_fk FROM customers AS _t1 WHERE _t1.id = 1"); parser = new QueryParser(schema, "FROM User WHERE roles.id = 1"); q = parser.makeSQL(dialect); //writeln(q.hql); //writeln(q.sql); assert(q.sql == "SELECT _t1.id, _t1.name, _t1.flags, _t1.comment, _t1.customer_fk FROM users AS _t1 LEFT JOIN role_users AS _t1_t2 ON _t1.id=_t1_t2.user_fk LEFT JOIN role AS _t2 ON _t1_t2.role_fk=_t2.id WHERE _t2.id = 1"); parser = new QueryParser(schema, "FROM Role WHERE users.id = 1"); q = parser.makeSQL(dialect); // writeln(q.hql); // writeln(q.sql); assert(q.sql == "SELECT _t1.id, _t1.name FROM role AS _t1 LEFT JOIN role_users AS _t1_t2 ON _t1.id=_t1_t2.role_fk LEFT JOIN users AS _t2 ON _t1_t2.user_fk=_t2.id WHERE _t2.id = 1"); parser = new QueryParser(schema, "FROM User WHERE customer.id = 1"); q = parser.makeSQL(dialect); // writeln(q.hql); // writeln(q.sql); assert(q.sql == "SELECT _t1.id, _t1.name, _t1.flags, _t1.comment, _t1.customer_fk FROM users AS _t1 LEFT JOIN customers AS _t2 ON _t1.customer_fk=_t2.id WHERE _t2.id = 1"); parser = new QueryParser(schema, "SELECT a2 FROM User AS a1 JOIN a1.roles AS a2 WHERE a1.id = 1"); q = parser.makeSQL(dialect); //writeln(q.hql); //writeln(q.sql); assert(q.sql == "SELECT _t2.id, _t2.name FROM users AS _t1 INNER JOIN role_users AS _t1_t2 ON _t1.id=_t1_t2.user_fk INNER JOIN role AS _t2 ON _t1_t2.role_fk=_t2.id WHERE _t1.id = 1"); parser = new QueryParser(schema, "SELECT a2 FROM Customer AS a1 JOIN a1.users AS a2 WHERE a1.id = 1"); q = parser.makeSQL(dialect); //writeln(q.hql); //writeln(q.sql); assert(q.sql == "SELECT _t2.id, _t2.name, _t2.flags, _t2.comment, _t2.customer_fk FROM customers AS _t1 INNER JOIN users AS _t2 ON _t1.id=_t2.customer_fk WHERE _t1.id = 1"); }
D
/Users/petercernak/vapor/TILApp/Build/Intermediates.noindex/TILApp.build/Debug/SQL.build/Objects-normal/x86_64/SQLColumnDefinition.o : /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBind.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLJoinMethod.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLAlterTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSerializable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDataType.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLUpdate.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDelete.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBoolLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDefaultLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLJoin.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLExpression.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelectExpression.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCollation.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLForeignKeyAction.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLConnection.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDirection.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLFunction.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnDefinition.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLAlterTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPredicateBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLUpdateBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDeleteBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelectBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLInsertBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLRawBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateIndexBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryEncoder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryFetcher.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLIndexModifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLError.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBinaryOperator.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/Exports.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelect.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDistinct.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLFunctionArgument.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableConstraint.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnConstraint.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLInsert.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateIndex.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropIndex.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLGroupBy.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLOrderBy.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLForeignKey.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPrimaryKey.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQuery.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/DatabaseKit.framework/Modules/DatabaseKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOAtomics/include/cpp_magic.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIODarwin/include/c_nio_darwin.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOAtomics/include/c-atomics.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOLinux/include/c_nio_linux.h /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--6538424668019974428/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/petercernak/vapor/TILApp/Build/Intermediates.noindex/TILApp.build/Debug/SQL.build/Objects-normal/x86_64/SQLColumnDefinition~partial.swiftmodule : /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBind.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLJoinMethod.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLAlterTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSerializable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDataType.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLUpdate.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDelete.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBoolLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDefaultLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLJoin.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLExpression.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelectExpression.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCollation.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLForeignKeyAction.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLConnection.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDirection.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLFunction.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnDefinition.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLAlterTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPredicateBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLUpdateBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDeleteBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelectBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLInsertBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLRawBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateIndexBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryEncoder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryFetcher.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLIndexModifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLError.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBinaryOperator.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/Exports.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelect.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDistinct.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLFunctionArgument.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableConstraint.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnConstraint.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLInsert.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateIndex.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropIndex.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLGroupBy.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLOrderBy.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLForeignKey.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPrimaryKey.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQuery.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/DatabaseKit.framework/Modules/DatabaseKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOAtomics/include/cpp_magic.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIODarwin/include/c_nio_darwin.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOAtomics/include/c-atomics.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOLinux/include/c_nio_linux.h /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--6538424668019974428/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/petercernak/vapor/TILApp/Build/Intermediates.noindex/TILApp.build/Debug/SQL.build/Objects-normal/x86_64/SQLColumnDefinition~partial.swiftdoc : /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBind.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLJoinMethod.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLAlterTable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSerializable.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDataType.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLUpdate.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDelete.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBoolLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDefaultLiteral.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLJoin.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLExpression.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelectExpression.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCollation.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLForeignKeyAction.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLConnection.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDirection.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLFunction.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnDefinition.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLAlterTableBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPredicateBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLUpdateBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDeleteBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelectBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLInsertBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLRawBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateIndexBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryBuilder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryEncoder.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQueryFetcher.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLIndexModifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnIdentifier.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLError.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLBinaryOperator.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/Exports.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLSelect.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDistinct.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLFunctionArgument.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLTableConstraint.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLColumnConstraint.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLInsert.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLCreateIndex.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLDropIndex.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLGroupBy.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLOrderBy.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLForeignKey.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLPrimaryKey.swift /Users/petercernak/vapor/TILApp/.build/checkouts/sql.git--5031097865152321144/Sources/SQL/SQLQuery.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Users/petercernak/vapor/TILApp/Build/Products/Debug/DatabaseKit.framework/Modules/DatabaseKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOAtomics/include/cpp_magic.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIODarwin/include/c_nio_darwin.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOAtomics/include/c-atomics.h /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio.git--2128188973977302459/Sources/CNIOLinux/include/c_nio_linux.h /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/petercernak/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--6538424668019974428/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/petercernak/vapor/TILApp/TILApp.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
// ************************************************** // EXIT // ************************************************** instance DIA_Fortuno_EXIT(C_INFO) { npc = NOV_1357_Fortuno; nr = 999; condition = DIA_Fortuno_EXIT_Condition; information = DIA_Fortuno_EXIT_Info; permanent = 1; description = DIALOG_ENDE; }; func int DIA_Fortuno_EXIT_Condition() { return 1; }; func void DIA_Fortuno_EXIT_Info() { AI_StopProcessInfos(self); }; // ************************************************** // Erste Begrüssung // ************************************************** instance DIA_Fortuno_Greet(C_INFO) { npc = NOV_1357_Fortuno; nr = 1; condition = DIA_Fortuno_Greet_Condition; information = DIA_Fortuno_Greet_Info; permanent = 0; important = 1; }; func int DIA_Fortuno_Greet_Condition() { if (Npc_GetDistToNpc(self,other)<=ZivilAnquatschDist) { return 1; }; }; func void DIA_Fortuno_Greet_Info() { // AI_Output(self,other,"DIA_Fortuno_Greet_05_00"); //Come closer! Every newcomer to this place receives a gift of welcome! // AI_Output(self,other,"DIA_Fortuno_Greet_05_00"); //Tritt näher! Hier gibt es ein Willkommensgeschenk für jeden Neuen! AI_Output(self,other,"DIA_Fortuno_Greet_05_00"); //Pojď blíž! Každý nový příchozí dostane na přivítanou dárek! }; // ************************************************** // Was ist das Geschenk? // ************************************************** var int Fortuno_RationDay; // ************************************************** instance DIA_Fortuno_GetGeschenk(C_INFO) { npc = NOV_1357_Fortuno; nr = 1; condition = DIA_Fortuno_GetGeschenk_Condition; information = DIA_Fortuno_GetGeschenk_Info; permanent = 0; // description = "What have you got for me?"; // description = "Was hast du für mich?"; description = "Co pro mě máš?"; }; func int DIA_Fortuno_GetGeschenk_Condition() { return 1; }; func void DIA_Fortuno_GetGeschenk_Info() { // AI_Output(other,self,"DIA_Fortuno_GetGeschenk_15_00"); //What have you got for me? // AI_Output(other,self,"DIA_Fortuno_GetGeschenk_15_00"); //Was hast du für mich? AI_Output(other,self,"DIA_Fortuno_GetGeschenk_15_00"); //Co pro mě máš? // AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_01"); //Here, take three rolls of swampweed. It's Northern Dark. Good stuff. // AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_01"); //Hier, nimm drei Rollen Sumpfkraut. Es ist Schwarzer Weiser. Gutes Zeug. AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_01"); //Tady jsou tři roličky drogy z bažin. Je to Severní soumrak. Dobrý materiál. // AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_02"); //You can have more of it every day, but if you want more than your daily ration, well, you need to pay. // AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_02"); //Du kannst jeden Tag mehr davon haben, aber wenn du mehr als deine tägliche Ration willst, musst du zahlen. AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_02"); //Každý den můžeš dostat další, ale pokud budeš chtít víc než denní příděl, musíš zaplatit. // AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_03"); //If you find berries and herbs on the paths between the camps, you can bring them to me. I'll buy them off you. // AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_03"); //Falls du auf deinem Weg zwischen den Lagern Kräuter und Beeren findest, bring sie zu mir. Ich werde sie dir abkaufen. AI_Output(self,other,"DIA_Fortuno_GetGeschenk_05_03"); //Když najdeš na cestě mezi tábory bobule a byliny, můžeš mi je přinést a já je od tebe koupím. CreateInvItems(self,itmijoint_2, 3); B_GiveInvItems(self,other,itmijoint_2, 3); Fortuno_RationDay = Wld_GetDay(); Log_CreateTopic(GE_TraderPSI,LOG_NOTE); // B_LogEntry(GE_TraderPSI,"Fortuno deals with herbs underneath the alchemy lab."); // B_LogEntry(GE_TraderPSI,"Fortuno handelt unter dem Alchemielabor mit Kräutern"); B_LogEntry(GE_TraderPSI,"Fortuno obchoduje s bylinami pod alchymistickou dílnou."); }; // ************************************************** // Tägliche Ration // ************************************************** instance DIA_Fortuno_DailyRation(C_INFO) { npc = NOV_1357_Fortuno; nr = 3; condition = DIA_Fortuno_DailyRation_Condition; information = DIA_Fortuno_DailyRation_Info; permanent = 1; // description = "I've come to collect my daily ration."; // description = "Ich will mir meine tägliche Ration abholen."; description = "Přišel jsem si vyzvednout svůj denní příděl."; }; func int DIA_Fortuno_DailyRation_Condition() { if (Npc_KnowsInfo(hero,DIA_Fortuno_GetGeschenk)) { return 1; }; }; func void DIA_Fortuno_DailyRation_Info() { // AI_Output(other,self,"DIA_Fortuno_DailyRation_15_00"); //I've come to collect my daily ration. // AI_Output(other,self,"DIA_Fortuno_DailyRation_15_00"); //Ich will mir meine tägliche Ration abholen. AI_Output(other,self,"DIA_Fortuno_DailyRation_15_00"); //Přišel jsem si vyzvednout svůj denní příděl. if (Fortuno_RationDay!=Wld_GetDay()) { // AI_Output(self,other,"DIA_Fortuno_DailyRation_05_01"); //Here, take it. Three of the Northern Dark - but don't smoke them all at once. // AI_Output(self,other,"DIA_Fortuno_DailyRation_05_01"); //Hier nimm. 3 Schwarzer Weiser - aber nicht alle auf einmal rauchen. AI_Output(self,other,"DIA_Fortuno_DailyRation_05_01"); //Tady je. Třikrát Severní soumrak - nevykuř ale všechno najednou. CreateInvItems(self,itmijoint_2, 3); B_GiveInvItems(self,other,itmijoint_2, 3); Fortuno_RationDay = Wld_GetDay(); } else { // AI_Output(self,other,"DIA_Fortuno_DailyRation_05_02"); //You've already had your daily ration. If you want more, come back tomorrow or buy something. // AI_Output(self,other,"DIA_Fortuno_DailyRation_05_02"); //Du hattest deine Tagesration schon. Wenn du mehr willst, komm morgen wieder oder kauf was. AI_Output(self,other,"DIA_Fortuno_DailyRation_05_02"); //Už jsi svůj denní příděl dostal. Jestli chceš další, musíš přijít zítra nebo si něco koupit. }; }; // ************************************************** // TRADE // ************************************************** instance DIA_Fortuno_BuyJoints(C_INFO) { npc = NOV_1357_Fortuno; nr = 4; condition = DIA_Fortuno_BuyJoints_Condition; information = DIA_Fortuno_BuyJoints_Info; permanent = 1; // description = "I want to trade."; // description = "Ich will handeln."; description = "Chci obchodovat."; Trade = 1; }; func int DIA_Fortuno_BuyJoints_Condition() { if (Npc_KnowsInfo(hero,DIA_Fortuno_GetGeschenk)) { return 1; }; }; func void DIA_Fortuno_BuyJoints_Info() { // AI_Output(other,self,"DIA_Fortuno_BuyJoints_15_00"); //I want to trade. // AI_Output(other,self,"DIA_Fortuno_BuyJoints_15_00"); //Ich will handeln. AI_Output(other,self,"DIA_Fortuno_BuyJoints_15_00"); //Chci obchodovat. // AI_Output(self,other,"DIA_Fortuno_BuyJoints_05_01"); //What do you want from me? Or do you want to sell something? // AI_Output(self,other,"DIA_Fortuno_BuyJoints_05_01"); //Was willst du haben? Oder willst du was verkaufen? AI_Output(self,other,"DIA_Fortuno_BuyJoints_05_01"); //Co ode mě chceš? Nebo chceš něco prodat? };
D
/* my own hash function, is not optimal template Hashable(string) { uint hash(ref string Data) { uint i; uint Hash = 0x5FA7; for( i = 0; i < Data.length; i++ ) { uint Temp; uint Bit; Temp = cast(uint)Data[i]; if( i & 1 ) { Hash ^= Temp; } else { // rol Hash to left Bit = (Hash>>31) & 1; Hash <<= 1; Hash |= Bit; // xor it Hash ^= Temp; } } return Hash; } } */ // from http://stackoverflow.com/questions/2624192/good-hash-function-for-strings template Hashable(string) { uint hash(ref string Data) { uint Hash = 7; foreach( uint Char; Data) { Hash = Hash*31 + Char; } return Hash; } } template Hashtable(KeyType, ValueType, uint Size) { public class Hashtable { private BucketContent[Size] Content; public this() { uint i; for( i = 0; i < Size; i++ ) { this.Content[i] = null; } } public void add(KeyType Key, ValueType Value) { uint HashIndex; BucketContent ActualBucketContent; HashIndex = Hashable!KeyType.hash(Key); HashIndex %= Size; ActualBucketContent = this.Content[HashIndex]; if( ActualBucketContent is null ) { // if the Bucket is not created until now we create it this.Content[HashIndex] = new BucketContent(); this.Content[HashIndex].Value = Value; this.Content[HashIndex].Key = Key; this.Content[HashIndex].Next = null; return; } // else we search for the end and append a new Content for(;;) { if( ActualBucketContent.Next is null ) { break; } ActualBucketContent = ActualBucketContent.Next; } ActualBucketContent.Next = new BucketContent(); ActualBucketContent.Next.Next = null; ActualBucketContent.Next.Key = Key; ActualBucketContent.Next.Value = Value; return; } // returns also the Value for the Key if it was found, if not, "Value" is undefined! public bool contains(KeyType Key, ref ValueType Value) { uint HashIndex; BucketContent ActualBucketContent; HashIndex = Hashable!KeyType.hash(Key); HashIndex %= Size; ActualBucketContent = this.Content[HashIndex]; for(;;) { if( ActualBucketContent is null ) { return false; } if( ActualBucketContent.Key == Key ) { Value = ActualBucketContent.Value; return true; } ActualBucketContent = ActualBucketContent.Next; } // never reached return false; } } private class BucketContent { public KeyType Key; // can't be null public ValueType Value; // can't be null // can be null if the chain ends here public BucketContent Next; } } import std.stdio : writeln; /* Code for testing void main() { Hashtable!(string, uint, 512) Table = new Hashtable!(string, uint, 512)(); bool Success; uint ReturnValue; if( Table.contains("check", ReturnValue) ) { writeln("Test: check not contained failed!"); return; } Table.add("check", 1337); if( !Table.contains("check", ReturnValue) ) { writeln("Test: check contained failed!"); return; } } */
D
import std.stdio; void main(string[] args){ writeln("Hello world (from D)!"); }
D
/Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/Build/Intermediates/tarea3PickerView.build/Debug-iphonesimulator/tarea3PickerView.build/Objects-normal/x86_64/FirstViewController.o : /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/SecondViewController.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/AppDelegate.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/FirstViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/Build/Intermediates/tarea3PickerView.build/Debug-iphonesimulator/tarea3PickerView.build/Objects-normal/x86_64/FirstViewController~partial.swiftmodule : /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/SecondViewController.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/AppDelegate.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/FirstViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/Build/Intermediates/tarea3PickerView.build/Debug-iphonesimulator/tarea3PickerView.build/Objects-normal/x86_64/FirstViewController~partial.swiftdoc : /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/SecondViewController.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/AppDelegate.swift /Users/hernaniruegasvillarreal/Documents/TEC/semestre-8/dispositivos-moviles/segundo-parcial/tarea3PickerView/tarea3PickerView/FirstViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
D
/// File descriptor management module mecca.lib.io; // Licensed under the Boost license. Full copyright information in the AUTHORS file import core.sys.posix.unistd; public import core.sys.posix.fcntl : O_ACCMODE, O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_DSYNC, O_RSYNC, O_SYNC, O_NOCTTY; /* O_NOATIME, O_NOFOLLOW not included because not defined */ import core.sys.posix.fcntl; import std.algorithm : min, move; import std.conv; import std.traits; import mecca.lib.exception; import mecca.lib.memory; import mecca.lib.string; import mecca.log; import mecca.platform.x86; private extern(C) nothrow @trusted @nogc { int pipe2(ref int[2], int flags); } version(linux) { static if( __traits(compiles, O_CLOEXEC) ) { enum O_CLOEXEC = core.sys.posix.fcntl.O_CLOEXEC; } else { enum O_CLOEXEC = 0x80000; } } /** * File descriptor wrapper * * This wrapper's main purpose is to protect the fd against leakage. It does not actually $(I do) anything. */ struct FD { private: enum InvalidFd = -1; int fd = InvalidFd; public: @disable this(this); /** * Initialize from an OS file descriptor. * * Params: * fd = OS handle of file to wrap. */ this(int fd) nothrow @safe @nogc { ASSERT!"FD initialized with an invalid FD %s"(fd>=0, fd); this.fd = fd; } /** * Open a new file. * * Parameters: * Same as for the `open`(2) command; */ this(string path, int flags, mode_t mode = octal!666) @trusted @nogc { fd = .open(path.toStringzNGC, flags | O_CLOEXEC, mode); errnoEnforceNGC(fd>=0, "File open failed"); } ~this() nothrow @safe @nogc { close(); } /** * Wrapper for adopting an fd immediately after being returned from external function * * The usage should be `FD fd = FD.adopt!"open"( .open("/path/to/file", O_RDWR) );` * * Throws: * ErrnoException in case fd is invalid */ @notrace static FD adopt(string errorMsg)(int fd) @safe @nogc { errnoEnforceNGC(fd>=0, errorMsg); return FD(fd); } /** * Call an OS function that accepts an FD as the first argument. * * Parameters: * The parameters are the arguments that OS function accepts without the first one (the file descriptor). * * Returns: * Whatever the original OS function returns. */ auto osCall(alias F, T...)(T args) nothrow @nogc if( is( Parameters!F[0]==int ) ) { import mecca.lib.reflection : as; static assert( fullyQualifiedName!F != fullyQualifiedName!(.close), "Do not try to close the fd directly. Use FD.close instead." ); ReturnType!F res; as!"nothrow @nogc"({ res = F(fd, args); }); return res; } /// @safe read auto read(void[] buffer) @trusted @nogc { return checkedCall!(core.sys.posix.unistd.read, "read failed")(buffer.ptr, buffer.length); } /// @safe write auto write(const void[] buffer) @trusted @nogc { return checkedCall!(core.sys.posix.unistd.write, "write failed")(buffer.ptr, buffer.length); } /** * Run an fd based function and throw if it fails * * This function behave the same as `osCall`, except if the return is -1, it will throw an ErrnoException */ auto checkedCall(alias F, string errorMessage, T...)(T args) @system @nogc if( is( Parameters!F[0]==int ) ) { auto ret = osCall!F(args); errnoEnforceNGC(ret!=-1, errorMessage); return ret; } /** * Close the OS handle prematurely. * * Closes the OS handle. This happens automatically on struct destruction. It is only necessary to call this method if you wish to close * the underlying FD before the struct goes out of scope. * * Throws: * Nothing. There is nothing useful to do if close fails. */ void close() nothrow @safe @nogc { if( fd != InvalidFd ) { .close(fd); } fd = InvalidFd; } /** * Obtain the underlying OS handle * * This returns the underlying OS handle for use directly with OS calls. * * Warning: * Do not use this function to directly call the close system call. Doing so may lead to quite difficult to debug problems across your * program. If another part of the program gets the same FD number, it can be quite difficult to find out what went wrong. */ @property int fileNo() pure nothrow @safe @nogc { return fd; } /** * Report whether the FD currently holds a valid fd * * Additional_Details: * Hold stick near centre of its length. Moisten pointed end in mouth. Insert in tooth space, blunt end next to gum. Use gentle in-out * motion. * * See_Also: * <a href="http://hitchhikers.wikia.com/wiki/Wonko_the_Sane">Wonko the sane</a> * * Returns: true if valid */ @property bool isValid() pure const nothrow @safe @nogc { return fd != InvalidFd; } /** Duplicate an FD * * Does the same as the `dup` system call. * * Returns: * An FD representing a duplicate of the current FD. */ @notrace FD dup() @trusted @nogc { import fcntl = core.sys.posix.fcntl; static if( __traits(compiles, fcntl.F_DUPFD_CLOEXEC) ) { enum F_DUPFD_CLOEXEC = fcntl.F_DUPFD_CLOEXEC; } else { version(linux) { enum F_DUPFD_CLOEXEC = 1030; } } int newFd = osCall!(fcntl.fcntl)( F_DUPFD_CLOEXEC, 0 ); errnoEnforceNGC(newFd!=-1, "Failed to duplicate FD"); return FD( newFd ); } } /** * create an unnamed pipe pair * * Params: * readEnd = `FD` struct to receive the reading (output) end of the pipe * writeEnd = `FD` struct to receive the writing (input) end of the pipe */ void createPipe(out FD readEnd, out FD writeEnd) @trusted @nogc { int[2] pipeRawFD; errnoEnforceNGC( pipe2(pipeRawFD, O_CLOEXEC )>=0, "OS pipe creation failed" ); readEnd = FD( pipeRawFD[0] ); writeEnd = FD( pipeRawFD[1] ); } unittest { import core.stdc.errno; import core.sys.posix.fcntl; import std.conv; int fd1copy, fd2copy; { auto fd = FD.adopt!"open"(open("/tmp/meccaUTfile1", O_CREAT|O_RDWR|O_TRUNC, octal!666)); fd1copy = fd.fileNo; fd.osCall!write("Hello, world\n".ptr, 13); // The following line should not compile: // fd.osCall!(.close)(); unlink("/tmp/meccaUTfile1"); fd = FD.adopt!"open"( open("/tmp/meccaUTfile2", O_CREAT|O_RDWR|O_TRUNC, octal!666) ); fd2copy = fd.fileNo; unlink("/tmp/meccaUTfile2"); } assert( .close(fd1copy)<0 && errno==EBADF, "FD1 was not closed" ); assert( .close(fd2copy)<0 && errno==EBADF, "FD2 was not closed" ); } /// A wrapper to perform buffered IO over another IO type struct BufferedIO(T) { enum MIN_BUFF_SIZE = 128; private: MmapArray!ubyte rawMemory; void[] readBuffer, writeBuffer; size_t readBufferSize; public T fd; // Declared public so it is visible through alias this public: // BufferedIO is not copyable even if T is copyable (which it typically won't be) @disable this(this); /** Construct an initialized buffered IO object * * `fd` is the FD object to wrap. Other arguments are the same as for the `open` call. */ this(T fd, size_t bufferSize) { this.open(bufferSize); this.fd = move(fd); } this(T fd, size_t readBufferSize, size_t writeBufferSize) { this.open(readBufferSize, writeBufferSize); this.fd = move(fd); } /// Struct destructor /// /// Warning: /// $(B The destructor does not flush outstanding writes). This is because it might be called from an exception /// context where such flushes are not possible. Adding `scope(success) io.flush();` is recommended. ~this() @safe @nogc { closeNoFlush(); // No point in closing the underlying FD. Its own destructor should do that. } /** * Prepare the buffers. * * The first form sets the same buffer size for both read and write operations. The second sets the read and write * buffer sizes independently. */ void open(size_t bufferSize) @safe @nogc { open( bufferSize, bufferSize ); } /// ditto void open(size_t readBufferSize, size_t writeBufferSize) @safe @nogc { ASSERT!"BufferedIO.open called twice"( rawMemory.closed ); assertGE( readBufferSize, MIN_BUFF_SIZE, "readBufferSize not big enough" ); assertGE( writeBufferSize, MIN_BUFF_SIZE, "writeBufferSize not big enough" ); // Round readBufferSize to a multiple of the cacheline size, so that the write buffer be cache aligned readBufferSize += CACHE_LINE_SIZE-1; readBufferSize -= readBufferSize % CACHE_LINE_SIZE; size_t total = readBufferSize + writeBufferSize; // Round size up to next page total += SYS_PAGE_SIZE - 1; total -= total % SYS_PAGE_SIZE; rawMemory.allocate( total, false ); // We do NOT want the GC to scan this area size_t added = total - readBufferSize - writeBufferSize; added /= 2; added -= added % CACHE_LINE_SIZE; this.readBufferSize = readBufferSize + added; readBuffer = null; writeBuffer = null; } /** Close the buffered IO * * This flushes all outstanding writes, closes the underlying FD and releases the buffers. */ void close() { flush(); closeNoFlush(); fd.close(); } /// Perform @safe buffered read /// /// Notice that if there is data already in the buffers, that data is what will be returned, even if the read /// requested more (partial result). auto read(ARGS...)(void[] buffer, ARGS args) @trusted @nogc { size_t cachedLength = min(buffer.length, readBuffer.length); if( cachedLength>0 ) { // Data already in buffer buffer[0..cachedLength][] = readBuffer[0..cachedLength][]; readBuffer = readBuffer[cachedLength..$]; return cachedLength; } cachedLength = fd.read(rawReadBuffer, args); readBuffer = rawReadBuffer[0..cachedLength]; if( cachedLength==0 ) return 0; // Call ourselves again. Since the buffer is now not empty, the call should succeed without performing the // actual underlying read again. return read(buffer, args); } /// Perform @safe buffered write /// /// Function does not return until all data is either written to FD or buffered void write(ARGS...)(const(void)[] buffer, ARGS args) @trusted @nogc { if( buffer.length>rawWriteBuffer.length ) { // Buffer is big - write it directly to save on copies flush(args); DBG_ASSERT!"write buffer is not empty after flush"(writeBuffer.length == 0); while( buffer.length>0 ) { auto numWritten = fd.write(buffer, args); buffer = buffer[numWritten..$]; } return; } while( buffer.length>0 ) { size_t start = writeBuffer.length; size_t writeSize = rawWriteBuffer.length - start; writeSize = min(writeSize, buffer.length); writeBuffer = rawWriteBuffer[0 .. start+writeSize]; writeBuffer[start..$][] = buffer[0..writeSize][]; buffer = buffer[writeSize..$]; if( writeBuffer.length==rawWriteBuffer.length ) flush(args); } } /// Flush the write buffers void flush(ARGS...)(ARGS args) @trusted @nogc { scope(failure) { /* In case of mid-op failure, writeBuffer might end up not at the start of rawBuffer, which violates * invariants assumed elsewhere in the code. */ auto len = writeBuffer.length; // Source and destination buffers may overlap, so we cannot use slice operation for the copy foreach( i, d; cast(ubyte[])writeBuffer ) (cast(ubyte[])rawWriteBuffer)[i] = d; writeBuffer = rawWriteBuffer[0..len]; } while( writeBuffer.length>0 ) { auto numWritten = fd.write(writeBuffer, args); writeBuffer = writeBuffer[numWritten..$]; } } /** Attach an underlying FD to the buffered IO instance * * Instance must be open and not already attached */ ref BufferedIO opAssign(T fd) { ASSERT!"Attaching fd to an open buffered IO"(!fd.isValid); ASSERT!"Trying to attach an fd to a closed BufferedIO"( !rawMemory.closed ); move(fd, this.fd); return this; } alias fd this; private: size_t writeBufferSize() const pure nothrow @safe @nogc { return rawMemory.length - readBufferSize; } @property void[] rawReadBuffer() pure nothrow @safe @nogc { DBG_ASSERT!"Did not call open"(readBufferSize!=0); DBG_ASSERT!"readBufferSize greater than total raw memory. %s<%s"( readBufferSize<rawMemory.length, readBufferSize, rawMemory.length ); return rawMemory[0..readBufferSize]; } @property void[] rawWriteBuffer() pure nothrow @safe @nogc { DBG_ASSERT!"readBufferSize greater than total raw memory. %s<%s"( readBufferSize<rawMemory.length, readBufferSize, rawMemory.length ); return rawMemory[readBufferSize..$]; } @notrace void closeNoFlush() @safe @nogc { if( writeBuffer.length!=0 ) { ERROR!"Closing BufferedIO while it still has unflushed data to write"(); } rawMemory.free(); readBufferSize = 0; readBuffer = null; writeBuffer = null; } } unittest { enum TestSize = 32000; enum ReadBuffSize = 2000; enum WriteBuffSize = 2000; ubyte[] reference; uint numReads, numWrites; struct MockFD { uint readOffset, writeOffset; bool opened = true; ssize_t read(void[] buffer) @nogc { auto len = min(buffer.length, reference.length - readOffset); buffer[0..len] = reference[readOffset..readOffset+len][]; readOffset += len; if( len>0 ) numReads++; return len; } size_t write(const void[] buffer) @nogc { foreach(datum; cast(ubyte[])buffer) { assertEQ(datum, cast(ubyte)(reference[writeOffset]+1)); writeOffset++; } numWrites++; return buffer.length; } @property bool isValid() const @nogc { return opened; } void close() @nogc { opened = false; } } BufferedIO!MockFD fd; import std.random; auto seed = unpredictableSeed; scope(failure) ERROR!"Test failed with seed %s"(seed); auto rand = Random(seed); reference.length = TestSize; foreach(ref d; reference) { d = uniform!ubyte(rand); } fd.open(ReadBuffSize, WriteBuffSize); ubyte[17] buffer; ssize_t numRead; size_t total; while( (numRead = fd.read(buffer))>0 ) { total+=numRead; buffer[0..numRead][] += 1; fd.write(buffer[0..numRead]); } fd.flush(); assertEQ(total, TestSize, "Incorrect total number of bytes processed"); assertEQ(fd.readOffset, TestSize, "Did not read correct number of bytes"); assertEQ(fd.writeOffset, TestSize, "Did not write correct number of bytes"); assertEQ(numReads, 16); assertEQ(numWrites, 16); }
D
func void zs_cook() { printdebugnpc(PD_TA_FRAME,"ZS_Cook"); b_setperception(self); if(!c_bodystatecontains(self,BS_MOBINTERACT)) { AI_SetWalkMode(self,NPC_WALK); if(Hlp_StrCmp(Npc_GetNearestWP(self),self.wp) == 0) { AI_GotoWP(self,self.wp); }; AI_UseMob(self,"CAULDRON",1); }; }; func void zs_cook_loop() { var int randomizer; printdebugnpc(PD_TA_LOOP,"ZS_Cook_Loop"); randomizer = Hlp_Random(20); if(Npc_GetStateTime(self) >= (100 + randomizer)) { b_interruptmob("COOK"); }; AI_Wait(self,1); }; func void zs_cook_end() { printdebugnpc(PD_TA_FRAME,"ZS_Cook_End"); AI_UseMob(self,"CAULDRON",-1); };
D
module windows.deviceaccess; public import system; public import windows.com; extern(Windows): const GUID IID_IDeviceRequestCompletionCallback = {0x999BAD24, 0x9ACD, 0x45BB, [0x86, 0x69, 0x2A, 0x2F, 0xC0, 0x28, 0x8B, 0x04]}; @GUID(0x999BAD24, 0x9ACD, 0x45BB, [0x86, 0x69, 0x2A, 0x2F, 0xC0, 0x28, 0x8B, 0x04]); interface IDeviceRequestCompletionCallback : IUnknown { HRESULT Invoke(HRESULT requestResult, uint bytesReturned); } const GUID IID_IDeviceIoControl = {0x9EEFE161, 0x23AB, 0x4F18, [0x9B, 0x49, 0x99, 0x1B, 0x58, 0x6A, 0xE9, 0x70]}; @GUID(0x9EEFE161, 0x23AB, 0x4F18, [0x9B, 0x49, 0x99, 0x1B, 0x58, 0x6A, 0xE9, 0x70]); interface IDeviceIoControl : IUnknown { HRESULT DeviceIoControlSync(uint ioControlCode, char* inputBuffer, uint inputBufferSize, char* outputBuffer, uint outputBufferSize, uint* bytesReturned); HRESULT DeviceIoControlAsync(uint ioControlCode, char* inputBuffer, uint inputBufferSize, char* outputBuffer, uint outputBufferSize, IDeviceRequestCompletionCallback requestCompletionCallback, uint* cancelContext); HRESULT CancelOperation(uint cancelContext); } const GUID IID_ICreateDeviceAccessAsync = {0x3474628F, 0x683D, 0x42D2, [0xAB, 0xCB, 0xDB, 0x01, 0x8C, 0x65, 0x03, 0xBC]}; @GUID(0x3474628F, 0x683D, 0x42D2, [0xAB, 0xCB, 0xDB, 0x01, 0x8C, 0x65, 0x03, 0xBC]); interface ICreateDeviceAccessAsync : IUnknown { HRESULT Cancel(); HRESULT Wait(uint timeout); HRESULT Close(); HRESULT GetResult(const(Guid)* riid, void** deviceAccess); } @DllImport("deviceaccess.dll") HRESULT CreateDeviceAccessInstance(const(wchar)* deviceInterfacePath, uint desiredAccess, ICreateDeviceAccessAsync* createAsync);
D
import std.stdio; import std.variant; import std.algorithm; import std.conv; import std.range; import std.array; import parser; import visitor; import typedecl; import Record; import utils; import FunctionSig; import TemplateInstantiator; import Namespace; // CLosures and struct member functions can be implemented in exactly the same // way. The 'this' pointer and the environment pointer for closures are // identical, as long as the pointer points to a block of memory where each // variable is allocated. That is, a struct reference pointer is simply a // pointer to memory where each member is allocated sequentially. If the // environment pointer follows the same pattern, then the implementation for // each is the same, and perhaps building the datastructures for handling them // in the compiler can be the same as well debug (FUNCTION_TYPECHECK_TRACE) { string traceIndent; string tracer(string funcName) { return ` string mixin_funcName = "` ~ funcName ~ `"; writeln( traceIndent, "Entered: ", mixin_funcName, ", L: ", node.data["LINE"].get!uint, ", C: ", node.data["COLUMN"].get!uint ); traceIndent ~= " "; scope(success) { traceIndent = traceIndent[0..$-2]; writeln( traceIndent, "Exiting: ", mixin_funcName, ", L: ", node.data["LINE"].get!uint, ", C: ", node.data["COLUMN"].get!uint ); } `; } } struct SymbolScope { VarTypePair*[string] decls; auto format() { return decls.values.map!(a => a.format).join(", "); } } auto format(SymbolScope[] symbols) { string str = ""; string indent = ""; foreach (symbolScope; symbols[0..$-1]) { str ~= indent ~ symbolScope.format ~ "\n"; indent ~= " "; } if (symbols.length > 0) { str ~= indent ~ symbols[$-1].format; } return str; } struct FunctionScope { SymbolScope[] syms; } struct ScopeLookupResult { ulong funcIndex; ulong symIndex; bool nonlocal; bool success; this (ulong funcIndex, ulong symIndex, bool nonlocal, bool success) { this.funcIndex = funcIndex; this.symIndex = symIndex; this.nonlocal = nonlocal; this.success = success; } } auto scopeLookup(FunctionScope[] funcScopes, string id) { bool nonlocal = false; foreach_reverse (i, funcScope; funcScopes) { foreach_reverse (j, symScope; funcScope.syms) { if (id in symScope.decls) { if (i < funcScopes.length - 1) { nonlocal = true; } return new ScopeLookupResult(i, j, nonlocal, true); } } } return new ScopeLookupResult(0, 0, false, false); } void updateIfClosedOver(FunctionScope[] funcScopes, string id) { auto lookup = funcScopes.scopeLookup(id); if (lookup.success && lookup.nonlocal) { funcScopes[lookup.funcIndex].syms[lookup.symIndex] .decls[id] .closedOver = true; } } debug (TYPECHECK) void dumpDecls(VarTypePair*[] decls) { foreach (decl; decls) { decl.format.writeln; } } auto format(TypeEnum tag) { final switch (tag) { case TypeEnum.VOID: return "VOID"; case TypeEnum.LONG: return "LONG"; case TypeEnum.INT: return "INT"; case TypeEnum.SHORT: return "SHORT"; case TypeEnum.BYTE: return "BYTE"; case TypeEnum.FLOAT: return "FLOAT"; case TypeEnum.DOUBLE: return "DOUBLE"; case TypeEnum.CHAR: return "CHAR"; case TypeEnum.BOOL: return "BOOL"; case TypeEnum.STRING: return "STRING"; case TypeEnum.SET: return "SET"; case TypeEnum.HASH: return "HASH"; case TypeEnum.ARRAY: return "ARRAY"; case TypeEnum.AGGREGATE: return "AGGREGATE"; case TypeEnum.TUPLE: return "TUPLE"; case TypeEnum.FUNCPTR: return "FUNCPTR"; case TypeEnum.STRUCT: return "STRUCT"; case TypeEnum.VARIANT: return "VARIANT"; case TypeEnum.CHAN: return "CHAN"; } } class FunctionBuilder : Visitor { private RecordBuilder records; private string id; private FuncSig*[] toplevelFuncs; private FuncSig*[] importedFuncSigs; private FuncSig*[] funcSigs; private FuncSig*[] callSigs; private FuncSig* curFuncCallSig; private string[] idTuple; private VarTypePair*[] funcArgs; // The higher the index, the deeper the scope private FunctionScope[] funcScopes; private SymbolScope[][] elseIfScopes; private VarTypePair*[] decls; private Type* lvalue; private Type* matchType; private uint insideSlice; private string[] foreachArgs; private uint[string] stackVarAllocSize; private string curFuncName; private Type* curVariant; private string curConstructor; private bool skipTemplatedFuncDef; private ProgramNode topNode; private uint insideLoop; private bool unittestBlock; private Type* arrayExpectedType; private TopLevelContext* topContext; mixin TypeVisitors; FuncSig*[] getCompilableFuncSigs() { // Get all functions that have a compilable function body, AND // which are not base function templates, ie, have a mangled name return toplevelFuncs.filter!(a => a.funcDefNode !is null) .filter!(a => a.templateParams.length == 0 || (a.funcName.length >= 3 && a.funcName[0..2] == "__")) .filter!(a => !a.isUnittest) .array; } FuncSig*[] getExternFuncSigs() { return toplevelFuncs.filter!(a => a.funcDefNode is null) .array ~ importedFuncSigs; } FuncSig*[] getUnittests() { return toplevelFuncs.filter!(a => a.isUnittest) .array; } // TODO update this so templated functions are handled correctly, ie, their // mangled names void updateFuncSigStackVarAllocSize() { foreach (sig; toplevelFuncs) { if (sig.funcName == curFuncName) { if (sig.funcName in stackVarAllocSize) { sig.stackVarAllocSize = stackVarAllocSize[curFuncName]; } else { sig.stackVarAllocSize = 0; } } } } this (ProgramNode node, RecordBuilder records, FuncSig*[] sigs, FuncSig*[] importedFuncSigs, TopLevelContext* topContext) { this.topNode = node; this.records = records; this.toplevelFuncs = sigs; this.importedFuncSigs = importedFuncSigs; this.unittestBlock = false; this.topContext = topContext; builderStack.length++; for (auto i = 0; i < node.children.length; i++) { if (cast(UnittestBlockNode)node.children[i]) { node.children[i].accept(this); } else if (cast(FuncDefNode)node.children[i]) { node.children[i].accept(this); } } insideSlice = 0; } void visit(UnittestBlockNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("UnittestBlockNode")); if (!this.topContext.unittests) { return; } this.curFuncName = node.data["UNITTEST_NAME"].get!string; funcScopes.length++; funcScopes[$-1].syms.length++; this.unittestBlock = true; node.children[0].accept(this); this.unittestBlock = false; funcScopes.length--; updateFuncSigStackVarAllocSize(); } void visit(FuncDefNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FuncDefNode")); funcScopes.length++; funcScopes[$-1].syms.length++; // Visit FuncSignatureNode skipTemplatedFuncDef = false; node.children[0].accept(this); if (skipTemplatedFuncDef) { return; } // Visit FuncBodyBlocksNode node.children[1].accept(this); funcScopes.length--; updateFuncSigStackVarAllocSize(); } void visit(FuncSignatureNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FuncSignatureNode")); // Visit IdentifierNode, populate 'id' node.children[0].accept(this); auto funcName = id; this.curFuncName = funcName; if ((cast(TemplateTypeParamsNode)node.children[1]).children.length > 0) { // This is a templated function, so we don't try to typecheck it // until it's been instantiated skipTemplatedFuncDef = true; return; } this.stackVarAllocSize[curFuncName] = 0; auto lookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, funcName ); if (lookup.success) { funcSigs ~= lookup.sig; foreach (arg; lookup.sig.funcArgs) { stackVarAllocSize[curFuncName] += arg.type .size .stackAlignSize; funcScopes[$-1].syms[$-1].decls[arg.varName] = arg; } } // It must be an inner function definition else { } } void visit(IdentifierNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IdentifierNode")); id = (cast(ASTTerminal)node.children[0]).token; } void visit(IdTupleNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IdTupleNode")); idTuple = []; foreach (child; node.children) { child.accept(this); idTuple ~= id; } } void visit(FuncBodyBlocksNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FuncBodyBlocksNode")); foreach (child; node.children) { child.accept(this); } } void visit(BareBlockNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("BareBlockNode")); funcScopes[$-1].syms.length++; foreach (child; node.children) { child.accept(this); } debug (TYPECHECK) funcScopes[$-1].syms.format.writeln; funcScopes[$-1].syms.length--; } void visit(FuncDefOrStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FuncDefOrStmtNode")); node.children[0].accept(this); } void visit(StatementNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("StatementNode")); // Reset state arrayExpectedType = null; node.children[0].accept(this); } void visit(AssertStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("AssertStmtNode")); if (this.topContext.release) { return; } node.children[0].accept(this); auto exprType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (exprType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Assert statements expect a boolean expr as the first arg" ); } if (node.children.length > 1) { node.children[1].accept(this); auto strType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (strType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Assert statements expect a string expr as the second arg" ); } } } void visit(ReturnStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ReturnStmtNode")); if (this.unittestBlock) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot 'return' from a 'unittest' block" ); } if (node.children.length > 0) { node.children[0].accept(this); auto returnType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!returnType.cmp(funcSigs[$-1].returnType.copy)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Wrong type for return in function [" ~ funcSigs[$-1].funcName ~ "]:\n" ~ " Expects: " ~ funcSigs[$-1].returnType.format ~ "\n" ~ " But got: " ~ returnType.format ); } } } void visit(BoolExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("BoolExprNode")); node.children[0].accept(this); node.data["type"] = builderStack[$-1][$-1]; } void visit(OrTestNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("OrTestNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 1; i < node.children.length; i++) { node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (resultType.tag != TypeEnum.BOOL || nextType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-bool type in LOGIC-OR" ); } } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(AndTestNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("AndTestNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 1; i < node.children.length; i++) { node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (resultType.tag != TypeEnum.BOOL || nextType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-bool type in LOGIC-AND" ); } } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(NotTestNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("NotTestNode")); node.children[0].accept(this); if (typeid(node.children[0]) == typeid(NotTestNode)) { if (builderStack[$-1][$-1].tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot negate non-bool type" ); } } node.data["type"] = builderStack[$-1][$-1]; } void visit(ComparisonNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ComparisonNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; Type* chainCompare = null; if (node.children.length > 1) { auto op = (cast(ASTTerminal)node.children[1]).token; node.children[2].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; final switch (op) { case "<=": case ">=": case "<": case ">": case "==": case "!=": if (resultType.isNumeric && nextType.isNumeric) {} else if (resultType.cmp(nextType) && (resultType.tag == TypeEnum.CHAR || resultType.tag == TypeEnum.BOOL || resultType.tag == TypeEnum.STRING)) {} else { throw new Exception( errorHeader(node) ~ "\n" ~ "Mismatched types for equality cmp\n" ~ "Left Type : " ~ resultType.format ~ "\n" ~ "Right Type: " ~ nextType.format ); } break; case "<in>": if (resultType.tag != TypeEnum.SET || nextType.tag != TypeEnum.SET || !resultType.set.setType.cmp(nextType.set.setType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Mismatched types in `<in>` op\n" ~ "Left Type : " ~ resultType.format ~ "\n" ~ "Right Type: " ~ nextType.format ); } break; case "in": if (nextType.tag != TypeEnum.SET || !nextType.set.setType.cmp(resultType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Mismatched types in `in` op\n" ~ "Left Type : " ~ resultType.format ~ "\n" ~ "Right Type: " ~ nextType.format ); } break; } node.data["lefttype"] = resultType; node.data["righttype"] = nextType; auto boolType = new Type(); boolType.tag = TypeEnum.BOOL; resultType = boolType; } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(ExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ExprNode")); node.children[0].accept(this); node.data["type"] = builderStack[$-1][$-1]; } void visit(OrExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("OrExprNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 1; i < node.children.length; i++) { node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!resultType.isIntegral || !nextType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-integral type in BIT-OR operation" ); } } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(XorExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("XorExprNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 1; i < node.children.length; i++) { node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!resultType.isIntegral || !nextType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-integral type in BIT-XOR operation" ); } } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(AndExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("AndExprNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 1; i < node.children.length; i++) { node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!resultType.isIntegral || !nextType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-integral type in BIT-AND operation" ); } } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(ShiftExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ShiftExprNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 2; i < node.children.length; i += 2) { node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!resultType.isIntegral || !nextType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-integral type in shift operation" ); } } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(SumExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("SumExprNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 2; i < node.children.length; i += 2) { auto op = (cast(ASTTerminal)node.children[i-1]).token; node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; final switch (op) { case "+": case "-": resultType = promoteNumeric( resultType, nextType, node.children[i-1] ); break; case "<|>": case "<&>": case "<^>": case "<->": if (!resultType.cmp(nextType) || resultType.tag != TypeEnum.SET || nextType.tag != TypeEnum.SET) { throw new Exception( errorHeader(node) ~ "\n" ~ "Type mismatch in set operation." ); } break; case "~": if (resultType.tag == TypeEnum.STRING) { if (nextType.tag == TypeEnum.ARRAY) { if (nextType.array.arrayType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append string to array of " ~ "non-strings." ); } auto arrayType = new ArrayType(); arrayType.arrayType = nextType.array.arrayType; auto type = new Type(); type.tag = TypeEnum.ARRAY; type.array = arrayType; resultType = type; } // We can only append a string or a char to a string, and // the end result is always a string else if (nextType.tag != TypeEnum.CHAR && nextType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "String append without char or string." ); } } else if (nextType.tag == TypeEnum.STRING) { if (resultType.tag == TypeEnum.ARRAY) { if (resultType.array.arrayType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append string to array of " ~ "non-strings." ); } } else { // We can only append a string or a char to a string, // and the end result is always a string if (resultType.tag != TypeEnum.CHAR && resultType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "String append without char or string." ); } resultType = nextType.copy; } } else if (resultType.cmp(nextType)) { if (resultType.tag == TypeEnum.ARRAY) { // Result type remains the same, we're appending to like // arrays together } else { // Result type is the type of appending two non-array // types together, to create a two-element array auto arrayType = new ArrayType(); arrayType.arrayType = resultType; auto type = new Type(); type.tag = TypeEnum.ARRAY; type.array = arrayType; resultType = type; } } // If the types are not the same, then one of them must be the // array wrapper of the other type else { if (resultType.tag == TypeEnum.ARRAY) { if (!resultType.array.arrayType.cmp(nextType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append type to unlike array type\n" ~ "Left : " ~ resultType.format ~ "\n" ~ "Right: " ~ nextType.format ); } } else if (nextType.tag == TypeEnum.ARRAY) { if (!nextType.array.arrayType.cmp(resultType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append type to unlike array type\n" ~ "Left : " ~ resultType.format ~ "\n" ~ "Right: " ~ nextType.format ); } resultType = nextType; } else { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append two unlike, non-array types.\n" ~ "Left : " ~ resultType.format ~ "\n" ~ "Right: " ~ nextType.format ); } } } // Set the type of the result of the _expression_, as in the 'op' // node. This is particularly important for complex append expr's, // like "1 ~ 2 ~ 3 ~ 4" so that we can see that after "1 ~ 2", we're // actually appending "3" and "4" each to the array result of the // previous step node.children[i-1].data["type"] = resultType; } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(ProductExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ProductExprNode")); node.children[0].accept(this); auto resultType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; for (auto i = 2; i < node.children.length; i += 2) { auto op = (cast(ASTTerminal)node.children[i-1]).token; node.children[i].accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!resultType.isNumeric || !nextType.isNumeric) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot perform " ~ op ~ " on non-arith." ); } if (op == "%" && (resultType.isFloat || nextType.isFloat)) { throw new Exception( errorHeader(node) ~ "\n" ~ "% (modulus) undefined for float types." ); } resultType = promoteNumeric( resultType, nextType, node.children[i-1] ); } builderStack[$-1] ~= resultType; node.data["type"] = builderStack[$-1][$-1]; } void visit(ValueNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ValueNode")); FuncSig* localFuncSig; if (typeid(node.children[0]) == typeid(IdentifierNode)) { node.children[0].accept(this); auto name = id; auto varLookup = funcScopes.scopeLookup(name); auto funcLookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, name ); auto variant = variantFromConstructor(records, name); if (!varLookup.success && !funcLookup.success && variant is null) { throw new Exception( errorHeader(node) ~ "\n" ~ "No variable, function, or variant constructor [" ~ name ~ "]" ); } else if (varLookup.success) { funcScopes.updateIfClosedOver(name); auto varType = funcScopes[varLookup.funcIndex] .syms[varLookup.symIndex] .decls[name] .type; // Check if the var is a function ptr, and if it is, set // curFuncCallSig appropriately, as well as recording the func // ptr sig for the code generator if (varType.tag == TypeEnum.FUNCPTR) { auto funcSigFromPtr = new FuncSig(); VarTypePair*[] dummyPairs; foreach (var; varType.funcPtr.funcArgs) { auto pair = new VarTypePair(); pair.type = var; pair.varName = "__NULL_NAME__"; dummyPairs ~= pair; } funcSigFromPtr.funcArgs = dummyPairs; funcSigFromPtr.returnType = varType.funcPtr.returnType; funcSigFromPtr.funcName = ""; curFuncCallSig = funcSigFromPtr; node.data["funcptrsig"] = varType; } builderStack[$-1] ~= varType; } else if (funcLookup.success) { curFuncCallSig = funcLookup.sig; localFuncSig = curFuncCallSig; auto funcPtr = new FuncPtrType(); funcPtr.funcArgs = funcLookup.sig.funcArgs .map!(a => a.type) .array; funcPtr.returnType = funcLookup.sig.returnType; auto wrap = new Type; wrap.tag = TypeEnum.FUNCPTR; wrap.funcPtr = funcPtr; builderStack[$-1] ~= wrap; } else if (variant !is null) { if (variant.templateParams.length > 0) { if (node.children.length == 1 || cast(TemplateInstanceMaybeTrailerNode) (cast(TrailerNode)node.children[1]).children[0] is null) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot instantiate templated variant " ~ "constructor [" ~ name ~ "] of variant [" ~ variant.format ~ "] without a template instantiation" ); } } curVariant = new Type(); curVariant.tag = TypeEnum.VARIANT; curVariant.variantDef = variant; curConstructor = name; builderStack[$-1] ~= curVariant; } if (node.children.length > 1) { node.children[1].accept(this); if (localFuncSig !is null && localFuncSig.templateParams.length > 0 && callSigs.length > 0) { auto newIdNode = new IdentifierNode(); auto terminal = new ASTTerminal( callSigs[$-1].funcName, 0 ); callSigs.length--; newIdNode.children ~= terminal; node.children[0] = newIdNode; } } } else { foreach (child; node.children) { child.accept(this); } } auto resolvedType = builderStack[$-1][$-1]; // Remove from our collected list the placeholder type for '[]', which // is temporarily type '[]void' until it is resolved later if (resolvedType.tag == TypeEnum.ARRAY && resolvedType.array.arrayType.tag == TypeEnum.VOID ) { } else if (resolvedType.isHeapType) { // Collect all types known to the entire program. This collection is // used, at the very least, to generate the marking functions for // each type, for garbage collection topContext.allEncounteredTypes[ resolvedType.formatMangle() ] = resolvedType; } node.data["type"] = resolvedType; } void visit(ParenExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ParenExprNode")); node.children[0].accept(this); node.data["type"] = builderStack[$-1][$-1]; } void visit(NumberNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("NumberNode")); node.children[0].accept(this); node.data["type"] = builderStack[$-1][$-1]; } void visit(IntNumNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IntNumNode")); auto valType = new Type(); valType.tag = TypeEnum.INT; builderStack[$-1] ~= valType; } void visit(FloatNumNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FloatNumNode")); auto valType = new Type(); valType.tag = TypeEnum.FLOAT; builderStack[$-1] ~= valType; } void visit(CharLitNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CharLitNode")); auto valType = new Type(); valType.tag = TypeEnum.CHAR; builderStack[$-1] ~= valType; } void visit(StringLitNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("StringLitNode")); auto valType = new Type(); valType.tag = TypeEnum.STRING; builderStack[$-1] ~= valType; } void visit(BooleanLiteralNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("BooleanLiteralNode")); auto valType = new Type(); valType.tag = TypeEnum.BOOL; builderStack[$-1] ~= valType; } void visit(StructConstructorNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("StructConstructorNode")); node.children[0].accept(this); auto structName = id; auto i = 1; // Instantiate the actual struct type, including template arguments auto aggregate = new AggregateType(); aggregate.typeName = structName; if (cast(TemplateInstantiationNode)node.children[1]) { i = 2; builderStack.length++; node.children[1].accept(this); aggregate.templateInstantiations = builderStack[$-1]; builderStack.length--; } auto structDef = instantiateAggregate(records, aggregate, node); Type*[string] membersActual; foreach (member; structDef.structDef.members) { membersActual[member.name] = member.type.normalize(records, node); } auto memberNamesActual = membersActual.keys .sort; Type*[string] memberAssigns; for (; i < node.children.length; i += 2) { node.children[i].accept(this); auto memberName = id; if (memberName !in membersActual) { throw new Exception( errorHeader(node) ~ "\n" ~ "Struct " ~ structName ~ " does not contain member " ~ memberName ); } if (membersActual[memberName].tag == TypeEnum.ARRAY) { arrayExpectedType = membersActual[memberName]; } node.children[i+1].accept(this); auto valType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (memberName in memberAssigns) { throw new Exception( errorHeader(node) ~ "\n" ~ "A struct member must appear only once in a constructor" ); } memberAssigns[memberName] = valType; } auto memberNamesAssigned = memberAssigns.keys .sort; if (memberNamesAssigned.sort .setSymmetricDifference(memberNamesActual.sort) .walkLength > 0) { throw new Exception( errorHeader(node) ~ "\n" ~ "Incorrect struct member arguments in constructor" ); } foreach (key; memberAssigns.keys) { auto assignedType = memberAssigns[key]; auto expectedType = membersActual[key]; // Handle case of instantiating array as "[]" if (assignedType.tag == TypeEnum.ARRAY && assignedType.array.arrayType.tag == TypeEnum.VOID && expectedType.tag == TypeEnum.ARRAY) { assert(false, "Unreachable"); } if (!assignedType.cmp(expectedType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Type mismatch in struct constructor:\n" ~ " Member [" ~ key ~ "]\n" ~ " Expects type: " ~ expectedType.format ~ "\n" ~ " But got type: " ~ assignedType.format ); } } node.data["type"] = structDef; builderStack[$-1] ~= structDef; } void visit(StructMemberConstructorNode node) {} void visit(ArrayLiteralNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ArrayLiteralNode")); auto arrayType = new ArrayType(); auto type = new Type(); if (node.children.length == 0) { if (arrayExpectedType == null) { assert(false, "Unreachable"); } arrayType = arrayExpectedType.array.copy; arrayExpectedType = null; } else { node.children[0].accept(this); auto valType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; foreach (child; node.children[1..$]) { child.accept(this); auto nextType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!valType.cmp(nextType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-uniform type in array literal" ); } } arrayType.arrayType = valType; } type.tag = TypeEnum.ARRAY; type.array = arrayType; builderStack[$-1] ~= type; node.data["type"] = builderStack[$-1][$-1]; } void visit(VariableTypePairNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("VariableTypePairNode")); // Visit IdentifierNode, populate 'id' node.children[0].accept(this); auto varName = id; // Visit TypeIdNode node.children[1].accept(this); auto varType = builderStack[$-1][$-1]; if (varType.tag == TypeEnum.ARRAY) { arrayExpectedType = varType; } builderStack[$-1] = builderStack[$-1][0..$-1]; if (varType.tag == TypeEnum.AGGREGATE || varType.tag == TypeEnum.STRUCT || varType.tag == TypeEnum.VARIANT) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot declare but not initialize struct or variant types.\n" ~ " For [" ~ varName ~ ": " ~ varType.format ~ ";]\n" ~ " Use the appropriate value constructor" ); } auto pair = new VarTypePair(); pair.varName = varName; pair.type = varType; funcScopes[$-1].syms[$-1].decls[varName] = pair; decls ~= pair; // Remove from our collected list the placeholder type for '[]', which // is temporarily type '[]void' until it is resolved later if (varType.tag == TypeEnum.ARRAY && varType.array.arrayType.tag == TypeEnum.VOID ) { } else if (varType.isHeapType) { // Collect all types known to the entire program. This collection is // used, at the very least, to generate the marking functions for // each type, for garbage collection topContext.allEncounteredTypes[ varType.formatMangle() ] = varType; } node.data["pair"] = pair; this.stackVarAllocSize[curFuncName] += varType.size .stackAlignSize; } void visit(VariableTypePairTupleNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("VariableTypePairTupleNode")); foreach (child; node.children) { child.accept(this); } } void visit(DeclarationNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("DeclarationNode")); node.children[0].accept(this); decls = []; } void visit(DeclAssignmentNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("DeclAssignmentNode")); node.children[0].accept(this); node.children[1].accept(this); auto varType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (varType.tag == TypeEnum.TUPLE) { auto tupleTypes = varType.tuple.types; if (tupleTypes.length != decls.length) { throw new Exception( errorHeader(node) ~ "\n" ~ "Tuple member count mismatch." ); } foreach (decl, varType; lockstep(decls, tupleTypes)) { if (!decl.type.cmp(varType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Type mismatch in tuple unpack." ); } } } else { if (varType.tag == TypeEnum.ARRAY && varType.array.arrayType.tag == TypeEnum.VOID && decls[$-1].type.tag == TypeEnum.ARRAY) { varType = decls[$-1].type.copy; } if (!decls[$-1].type.cmp(varType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Type mismatch in decl assignment.\n" ~ "Expects: " ~ decls[$-1].type.format ~ "\n" ~ "But got: " ~ varType.format ); } } foreach (decl; decls) { this.stackVarAllocSize[curFuncName] += decl.type .size .stackAlignSize; } } void visit(AssignExistingNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("AssignExistingNode")); node.children[0].accept(this); auto left = lvalue; if (left.tag == TypeEnum.ARRAY) { arrayExpectedType = left; } auto op = (cast(ASTTerminal)node.children[1]).token; node.children[2].accept(this); auto varType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; // Cover the case of assigning an empty array literal if (varType.tag == TypeEnum.ARRAY && varType.array.arrayType.tag == TypeEnum.VOID && left.tag == TypeEnum.ARRAY) { varType = left.copy; } final switch (op) { case "=": if (!left.cmp(varType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Type mismatch in assign-existing\n" ~ " Expects: " ~ left.format ~ "\n" ~ " But got: " ~ varType.format ); } break; case "+=": case "-=": case "/=": case "*=": if (!left.isNumeric || !varType.isNumeric) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-numeric type in arithmetic assign-eq" ); } break; case "%=": if (!left.isIntegral || !varType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-integral type in mod-assign-eq" ); } break; case "~=": if (left.tag == TypeEnum.STRING) { if ( varType.tag != TypeEnum.STRING && varType.tag != TypeEnum.CHAR ) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append-equal type [" ~ varType.format ~ "] onto string" ); } } else if (left.tag != TypeEnum.ARRAY) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append-equal to non-array type" ); } else if (varType.tag == TypeEnum.ARRAY) { if (left.cmp(varType)) { break; } throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append unlike array types" ); } else if (!left.array.arrayType.cmp(varType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot append type to unlike array type" ); } break; } } void visit(DeclTypeInferNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("DeclTypeInferNode")); node.children[0].accept(this); Type*[] stackTypes; if (typeid(node.children[0]) == typeid(IdTupleNode)) { string[] varNames = idTuple; node.children[1].accept(this); auto varTuple = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (varTuple.tag != TypeEnum.TUPLE) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-Tuple type!" ); } auto tupleTypes = varTuple.tuple.types; if (tupleTypes.length != varNames.length) { throw new Exception( errorHeader(node) ~ "\n" ~ "Tuple member count mismatch." ); } foreach (varName, varType; lockstep(varNames, tupleTypes)) { if (varType.tag == TypeEnum.ARRAY && varType.array.arrayType.tag == TypeEnum.VOID) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot infer contained type of empty array literal" ); } auto pair = new VarTypePair(); pair.varName = varName; pair.type = varType; funcScopes[$-1].syms[$-1].decls[varName] = pair; } stackTypes ~= tupleTypes; } else if (typeid(node.children[0]) == typeid(IdentifierNode)) { string varName = id; node.children[1].accept(this); auto varType = builderStack[$-1][$-1]; if (varType.tag == TypeEnum.ARRAY && varType.array.arrayType.tag == TypeEnum.VOID) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot infer contained type of empty array literal" ); } builderStack[$-1] = builderStack[$-1][0..$-1]; auto pair = new VarTypePair(); pair.varName = varName; pair.type = varType; funcScopes[$-1].syms[$-1].decls[varName] = pair; stackTypes ~= varType; } foreach (type; stackTypes) { this.stackVarAllocSize[curFuncName] += type.size .stackAlignSize; } } void visit(AssignmentNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("AssignmentNode")); node.children[0].accept(this); } void visit(ValueTupleNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ValueTupleNode")); Type*[] types; foreach (child; node.children) { child.accept(this); types ~= builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; } auto tuple = new TupleType(); tuple.types = types; auto type = new Type; type.tag = TypeEnum.TUPLE; type.tuple = tuple; node.data["type"] = type; builderStack[$-1] ~= type; } void visit(LorRValueNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("LorRValueNode")); node.children[0].accept(this); string varName = id; funcScopes.updateIfClosedOver(varName); auto lookup = funcScopes.scopeLookup(varName); if (!lookup.success) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot assign to undeclared variable." ); } auto varType = funcScopes[lookup.funcIndex].syms[lookup.symIndex] .decls[varName] .type; lvalue = varType.normalize(records, node); node.data["type"] = lvalue; if (node.children.length > 1) { node.children[1].accept(this); } } void visit(LorRTrailerNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("LorRTrailerNode")); node.data["parenttype"] = lvalue; if (cast(IdentifierNode)node.children[0]) { if (lvalue.tag != TypeEnum.STRUCT) { throw new Exception( errorHeader(node) ~ "\n" ~ "Member access only valid on struct type" ); } node.children[0].accept(this); auto memberName = id; bool found = false; foreach (member; lvalue.structDef.members) { if (memberName == member.name) { found = true; lvalue = member.type.normalize(records, node); node.data["type"] = lvalue; } } if (!found) { throw new Exception( errorHeader(node) ~ "\n" ~ memberName ~ " is not member of struct" ); } if (node.children.length > 1) { node.children[1].accept(this); } } else if (cast(SingleIndexNode)node.children[0]) { if (lvalue.tag == TypeEnum.STRING) { throw new Exception( "Cannot lvalue index immutable type [string].\n" ~ "Consider using [stringToChars()] and " ~ "[charsToString()] in [std.conv]" ); } else if (lvalue.tag != TypeEnum.ARRAY) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot lvalue index non-array type [" ~ lvalue.format ~ "]" ); } insideSlice++; node.children[0].accept(this); insideSlice--; lvalue = lvalue.array.arrayType.normalize(records, node); node.data["type"] = lvalue; if (node.children.length > 1) { node.children[1].accept(this); } } } void visit(SlicingNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("SlicingNode")); insideSlice++; auto arrayType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (arrayType.tag != TypeEnum.ARRAY && arrayType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot slice non-array, non-string type." ); } node.children[0].accept(this); auto sliceType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; // If it's not a range, then it's a single index, meaning a single // instance of what the array type contains if (sliceType.tag != TypeEnum.TUPLE) { // If it's a string, then the single index type is char if (arrayType.tag == TypeEnum.STRING) { auto charType = new Type(); charType.tag = TypeEnum.CHAR; builderStack[$-1] ~= charType; } else { builderStack[$-1] ~= arrayType.array.arrayType; } } // Otherwise, it's a range, meaning the outgoing type is just the // array type again else { builderStack[$-1] ~= arrayType; } insideSlice--; } void visit(SingleIndexNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("SingleIndexNode")); node.children[0].accept(this); auto indexType = builderStack[$-1][$-1]; if (!indexType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Index type must be integral." ); } } void visit(IndexRangeNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IndexRangeNode")); node.children[0].accept(this); } void visit(StartToIndexRangeNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("StartToIndexRangeNode")); node.children[0].accept(this); auto indexType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!indexType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Index type must be integral." ); } auto indexEnd = new Type(); indexEnd.tag = TypeEnum.LONG; auto range = new TupleType(); range.types = [indexType] ~ [indexEnd]; auto wrap = new Type(); wrap.tag = TypeEnum.TUPLE; wrap.tuple = range; builderStack[$-1] ~= wrap; } void visit(IndexToEndRangeNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IndexToEndRangeNode")); node.children[0].accept(this); auto indexType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!indexType.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Index type must be integral." ); } auto indexEnd = new Type(); indexEnd.tag = TypeEnum.LONG; auto range = new TupleType(); range.types = [indexType] ~ [indexEnd]; auto wrap = new Type(); wrap.tag = TypeEnum.TUPLE; wrap.tuple = range; builderStack[$-1] ~= wrap; } void visit(IndexToIndexRangeNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IndexToIndexRangeNode")); node.children[0].accept(this); auto indexStart = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!indexStart.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Index type must be integral." ); } node.children[1].accept(this); auto indexEnd = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (!indexEnd.isIntegral) { throw new Exception( errorHeader(node) ~ "\n" ~ "Index type must be integral." ); } auto range = new TupleType(); range.types = [indexStart] ~ [indexEnd]; auto wrap = new Type(); wrap.tag = TypeEnum.TUPLE; wrap.tuple = range; builderStack[$-1] ~= wrap; } void visit(TrailerNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("TrailerNode")); node.children[0].accept(this); } void visit(DynArrAccessNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("DynArrAccessNode")); // The type of the array we're indexing node.data["parenttype"] = builderStack[$-1][$-1]; node.children[0].accept(this); // The type yielded after indexing node.data["type"] = builderStack[$-1][$-1]; if (node.children.length > 1) { node.children[1].accept(this); } } void visit(TemplateInstanceMaybeTrailerNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("TemplateInstanceMaybeTrailerNode")); builderStack.length++; node.children[0].accept(this); auto templateInstantiations = builderStack[$-1]; builderStack.length--; if (curFuncCallSig !is null) { auto instantiator = new TemplateInstantiator(records); curFuncCallSig = instantiator.instantiateFunction( curFuncCallSig, templateInstantiations ); auto funcLookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, curFuncCallSig.funcName ); if (!funcLookup.success) { toplevelFuncs ~= curFuncCallSig; // Add this instantiated, templated function to the end of the // abstract syntax tree, effectively bringing it into existence, // and allowing it to get typechecked later topNode.children ~= curFuncCallSig.funcDefNode; } callSigs ~= curFuncCallSig; } else if (curVariant !is null) { Type*[string] mappings; foreach (name, type; lockstep(curVariant.variantDef.templateParams, templateInstantiations)) { mappings[name] = type; } curVariant = curVariant.instantiateTypeTemplate( mappings, records, node ); // If this is a template instantation of a templated constructor // that contains no member values, add the type to the stack if (node.children.length == 1) { // Take off the preliminary variant from the type stack, that // was placed there in the ValueNode visit() function in case // it was a value-less variant constructor builderStack[$-1] = builderStack[$-1][0..$-1]; builderStack[$-1] ~= curVariant; } } if (node.children.length > 1) { node.children[1].accept(this); } } void visit(SliceLengthSentinelNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("SliceLengthSentinelNode")); if (insideSlice < 1) { throw new Exception( errorHeader(node) ~ "\n" ~ "$ operator only valid inside slice" ); } auto valType = new Type(); valType.tag = TypeEnum.INT; builderStack[$-1] ~= valType; } void visit(UserTypeNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("UserTypeNode")); node.children[0].accept(this); string userTypeName = id; auto aggregate = new AggregateType(); aggregate.typeName = userTypeName; if (node.children.length > 1) { builderStack.length++; node.children[1].accept(this); aggregate.templateInstantiations = builderStack[$-1]; builderStack.length--; } auto wrap = new Type(); wrap.tag = TypeEnum.AGGREGATE; wrap.aggregate = aggregate; auto normalized = normalize(wrap, records, node); builderStack[$-1] ~= normalized; } void visit(FuncCallTrailerNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FuncCallTrailerNode")); node.data["funcsig"] = curFuncCallSig; node.children[0].accept(this); if (node.children.length > 1) { node.children[1].accept(this); } } void visit(FuncCallArgListNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FuncCallArgListNode")); // If we get here, then either curFuncCallSig is valid, or the top type // in the builder stack is using UFCS. if (curFuncCallSig !is null) { node.data["case"] = "funccall"; auto funcSig = curFuncCallSig; curFuncCallSig = null; auto funcArgs = funcSig.funcArgs; if (funcArgs.length != node.children.length) { if (funcSig.funcName != "") { throw new Exception( errorHeader(node) ~ "\n" ~ "Incorrect number of arguments passed for call of " ~ "function [" ~ funcSig.funcName ~ "]" ); } else { throw new Exception( errorHeader(node) ~ "\n" ~ "Incorrect number of arguments passed for call of " ~ "function ptr with signature:\n" ~ " " ~ funcSig.format ); } } foreach (i, child, argExpected; lockstep(node.children, funcArgs)) { argExpected.type = normalize(argExpected.type, records, node); if (argExpected.type.tag == TypeEnum.ARRAY) { arrayExpectedType = argExpected.type; } child.accept(this); auto argPassed = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; // Reconcile case of having passed a "[]" as an array literal // for this argument to the function if (argPassed.tag == TypeEnum.ARRAY && argPassed.array.arrayType.tag == TypeEnum.VOID && argExpected.type.tag == TypeEnum.ARRAY) { assert(false, "Unreachable"); } if (!argPassed.cmp(argExpected.type)) { if (funcSig.funcName != "") { throw new Exception( errorHeader(node) ~ "\n" ~ "Mismatch between expected and passed arg type " ~ "for call of function [" ~ funcSig.funcName ~ "]" ~ "\n" ~ " Expects: " ~ argExpected.type.format ~ "\n" ~ " But got: " ~ argPassed.format ~ "\n" ~ "in arg position [" ~ i.to!string ~ "]" ); } else { throw new Exception( errorHeader(node) ~ "\n" ~ "Mismatch between expected and passed arg type " ~ "for call of function\nptr with signature:\n" ~ " " ~ funcSig.format ~ "\n" ~ " Expects: " ~ argExpected.type.format ~ "\n" ~ " But got: " ~ argPassed.format ~ "\n" ~ "in arg position [" ~ i.to!string ~ "]" ); } } } builderStack[$-1] ~= funcSig.returnType; } else if (curVariant !is null) { node.data["case"] = "variant"; node.data["parenttype"] = curVariant; node.data["constructor"] = curConstructor; auto variant = curVariant; curVariant = null; auto member = variant.variantDef.getMember(curConstructor); if (member.constructorElems.tag == TypeEnum.VOID) { throw new Exception( errorHeader(node) ~ "\n" ~ "Constructor [" ~ curConstructor ~ "] of variant [" ~ variant.variantDef.format ~ "] cannot have value arguments" ); } auto expectedTypes = member.constructorElems .tuple .types; foreach (child, typeExpected; lockstep(node.children, expectedTypes)) { typeExpected = normalize(typeExpected, records, node); if (typeExpected.tag == TypeEnum.ARRAY) { arrayExpectedType = typeExpected; } child.accept(this); auto typeGot = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; // Reconcile case of passing empty array literal "[]" as value // in instantiating this variant constructor if (typeGot.tag == TypeEnum.ARRAY && typeGot.array.arrayType.tag == TypeEnum.VOID && typeExpected.tag == TypeEnum.ARRAY) { assert(false, "Unreachable"); } if (!typeExpected.cmp(typeGot)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Mismatch between expected and passed variant " ~ "constructor instantiation type: \n" ~ " Expected: " ~ typeExpected.formatFull ~ "\n" ~ " Got: " ~ typeGot.formatFull ); } } // Take off the preliminary variant from the type stack, that // was placed there in the ValueNode visit() function in case // it was a value-less variant constructor builderStack[$-1] = builderStack[$-1][0..$-1]; builderStack[$-1] ~= variant; } else { assert(false, "Unreachable"); } } void visit(FuncCallNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FuncCallNode")); node.children[0].accept(this); auto name = id; auto varLookup = funcScopes.scopeLookup(name); auto funcLookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, name ); if (!funcLookup.success && !varLookup.success) { throw new Exception( errorHeader(node) ~ "\n" ~ "No function or function ptr [" ~ name ~ "]." ); } else if (varLookup.success) { auto varType = funcScopes[varLookup.funcIndex] .syms[varLookup.symIndex] .decls[name] .type; // Check if the var is a function ptr, and if it is, set // curFuncCallSig appropriately, as well as recording the func // ptr sig for the code generator if (varType.tag != TypeEnum.FUNCPTR) { throw new Exception( errorHeader(node) ~ "\n" ~ "Variable [" ~ name ~ "] expected to be function ptr, " ~ "but is type: " ~ " " ~ varType.format ); } if (!cast(FuncCallArgListNode)node.children[1]) { throw new Exception( errorHeader(node) ~ "\n" ~ "Function ptrs cannot be instantiated as templates" ); } auto funcSigFromPtr = new FuncSig(); VarTypePair*[] dummyPairs; foreach (var; varType.funcPtr.funcArgs) { auto pair = new VarTypePair(); pair.type = var; pair.varName = "__NULL_NAME__"; dummyPairs ~= pair; } funcSigFromPtr.funcArgs = dummyPairs; funcSigFromPtr.returnType = varType.funcPtr.returnType; funcSigFromPtr.funcName = ""; curFuncCallSig = funcSigFromPtr; node.data["funcptrsig"] = varType; node.children[1].accept(this); } else if (funcLookup.success) { curFuncCallSig = funcLookup.sig; if (curFuncCallSig.templateParams.length > 0 && !cast(TemplateInstantiationNode)node.children[1]) { throw new Exception( errorHeader(node) ~ "\n" ~ "Template [" ~ name ~ "] must be instantiated with type " ~ "arguments" ); } if (cast(TemplateInstantiationNode)node.children[1]) { builderStack.length++; node.children[1].accept(this); auto templateInstantiations = builderStack[$-1]; builderStack.length--; auto instantiator = new TemplateInstantiator(records); curFuncCallSig = instantiator.instantiateFunction( curFuncCallSig, templateInstantiations ); node.data["funcsig"] = curFuncCallSig; auto existsLookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, curFuncCallSig.funcName ); if (!existsLookup.success) { toplevelFuncs ~= curFuncCallSig; // Add this instantiated, templated function to the end of the // abstract syntax tree, effectively bringing it into existence, // and allowing it to get typechecked later topNode.children ~= curFuncCallSig.funcDefNode; } auto newIdNode = new IdentifierNode(); auto terminal = new ASTTerminal( curFuncCallSig.funcName, 0 ); newIdNode.children ~= terminal; node.children[0] = newIdNode; node.children[2].accept(this); } else { node.data["funcsig"] = curFuncCallSig; node.children[1].accept(this); } } } void visit(DotAccessNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("DotAccessNode")); // Need to cover four cases: // First is handling the case of simply accessing a member value of the // type we're dot-accessing into. // Second, need to handle the case of accessing a member method of the // type. // Third, need to handle UFCS. // Fourth, need to handle compiler-supported members, like ".length" node.children[0].accept(this); auto name = id; auto curType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; node.data["type"] = curType.copy; curType = normalize(curType, records, node); // If the dot-access is with a struct, then we need to check if this is // any of all three of member method, member value, or UFCS (if the // function isn't a member function, but still takes the struct type // as it's first argument) if (curType.tag == TypeEnum.STRUCT) { // First check to see if it's a data member bool found = false; foreach (member; curType.structDef.members) { if (name == member.name) { found = true; builderStack[$-1] ~= member.type.copy; } } if (!found) { throw new Exception( errorHeader(node) ~ "\n" ~ name ~ " is not member of struct" ); } // TODO check to see if it's a UFCS call or a member function call if (node.children.length > 1) { node.children[1].accept(this); } } else if (curType.tag == TypeEnum.ARRAY || curType.tag == TypeEnum.STRING) { // We're accessing the length property of arrays and strings if (name == "length") { auto longType = new Type(); longType.tag = TypeEnum.INT; builderStack[$-1] ~= longType; } // TODO handle the case of UFCS else { } } // It's some other type, meaning this must be UFCS else { auto funcLookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, name ); if (!funcLookup.success) { throw new Exception( errorHeader(node) ~ "\n" ~ "No function[" ~ name ~ "]." ); } curFuncCallSig = funcLookup.sig; node.children[1].accept(this); // TODO Finish this. Gotta actually determine whether the UFCS call // works } } void visit(IfStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IfStmtNode")); funcScopes[$-1].syms.length++; // CondAssignmentsNode node.children[0].accept(this); // BoolExprNode or IsExprNode node.children[1].accept(this); auto boolType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (boolType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-bool expr in if statement expr." ); } // BareBlockNode node.children[2].accept(this); // ElseIfsNode node.children[3].accept(this); // Do we have an optional EndBlocksNode? if (node.children.length > 4) { // Store all of the scopes opened by any "else if" children. We // can't guarantee that any but the initial actual if-stmt cond- // assignments were executed for `coda` or `then`, but of course we // can guarantee that they're all in scope for `else`, so store the // stack of variables for EndBlocks processing auto numScopes = (cast(ElseIfsNode)( node.children[3] )).children.length; elseIfScopes ~= [funcScopes[$-1].syms[$-numScopes..$]]; funcScopes[$-1].syms.length -= numScopes; // EndBlocksNode node.children[4].accept(this); elseIfScopes.length--; } funcScopes[$-1].syms.length--; } void visit(ElseIfsNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ElseIfsNode")); foreach (child; node.children) { child.accept(this); } } void visit(ElseIfStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ElseIfStmtNode")); funcScopes[$-1].syms.length++; // CondAssignmentsNode node.children[0].accept(this); // BoolExprNode or IsExprNode node.children[1].accept(this); auto boolType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (boolType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-bool expr in if statement expr." ); } // BareBlockNode node.children[2].accept(this); } void visit(BreakStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("BreakStmtNode")); if (insideLoop == 0) { throw new Exception( errorHeader(node) ~ "\n" ~ "'break' disallowed outside of a loop scope" ); } } void visit(ContinueStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ContinueStmtNode")); if (insideLoop == 0) { throw new Exception( errorHeader(node) ~ "\n" ~ "'continue' disallowed outside of a loop scope" ); } } void visit(WhileStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("WhileStmtNode")); insideLoop++; funcScopes[$-1].syms.length++; auto nodeIndex = 0; // CondAssignmentsNode node.children[nodeIndex].accept(this); nodeIndex++; // BoolExprNode node.children[nodeIndex].accept(this); nodeIndex++; auto boolType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (boolType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-bool expr in while statement expr." ); } // BareBlockNode node.children[nodeIndex].accept(this); nodeIndex++; insideLoop--; // EndBlocksNode if (node.children.length > nodeIndex) { node.children[nodeIndex].accept(this); nodeIndex++; } funcScopes[$-1].syms.length--; } void visit(CondAssignmentsNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CondAssignmentsNode")); foreach (child; node.children) { child.accept(this); } } void visit(CondAssignNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CondAssignNode")); node.children[0].accept(this); } void visit(ForeachStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ForeachStmtNode")); insideLoop++; // Open scope for condassignments, which will be closed after // any `then`/`else`/`coda` blocks funcScopes[$-1].syms.length++; auto nodeIndex = 0; // CondAssignmentsNode node.children[nodeIndex].accept(this); nodeIndex++; // ForeachArgsNode node.children[nodeIndex].accept(this); nodeIndex++; // BoolExprNode node.children[nodeIndex].accept(this); nodeIndex++; auto loopType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; node.data["type"] = loopType; node.data["argnames"] = foreachArgs; Type*[] loopTypes; if (loopType.tag == TypeEnum.ARRAY || loopType.tag == TypeEnum.STRING) { loopTypes ~= loopType; } else if (loopType.tag == TypeEnum.TUPLE) { foreach (type; loopType.tuple.types) { if (type.tag != TypeEnum.ARRAY && type.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot loop over non-array/string types in loop " ~ "tuple" ); } loopTypes ~= type; } } else { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot loop over non-array types" ); } if (foreachArgs.length != loopTypes.length && foreachArgs.length - 1 != loopTypes.length) { throw new Exception( errorHeader(node) ~ "\n" ~ "Foreach args must match loop types in number, plus optional " ~ "index counter" ); } // Add the loop variables to the scope funcScopes[$-1].syms.length++; auto varUpdateArgs = foreachArgs; bool hasIndex = false; if (foreachArgs.length > loopTypes.length) { hasIndex = true; auto indexVarName = foreachArgs[0]; // Skip the index arg for the following loop varUpdateArgs = foreachArgs[1..$]; auto pair = new VarTypePair(); pair.varName = indexVarName; auto indexType = new Type(); indexType.tag = TypeEnum.INT; pair.type = indexType; funcScopes[$-1].syms[$-1].decls[indexVarName] = pair; this.stackVarAllocSize[curFuncName] += indexType.size .stackAlignSize; } node.data["hasindex"] = hasIndex; foreach (varName, type; lockstep(varUpdateArgs, loopTypes)) { auto pair = new VarTypePair(); pair.varName = varName; if (type.tag == TypeEnum.ARRAY) { pair.type = type.array.arrayType; this.stackVarAllocSize[curFuncName] += type.array .arrayType .size .stackAlignSize; } else if (type.tag == TypeEnum.STRING) { auto charWrap = new Type(); charWrap.tag = TypeEnum.CHAR; pair.type = charWrap; this.stackVarAllocSize[curFuncName] += charWrap.size .stackAlignSize; } funcScopes[$-1].syms[$-1].decls[varName] = pair; } // StatementNode node.children[nodeIndex].accept(this); nodeIndex++; // Remove loop variables from scope funcScopes[$-1].syms.length--; insideLoop--; // EndBlocksNode if (node.children.length > nodeIndex) { node.children[nodeIndex].accept(this); nodeIndex++; } // Remove condassignment variables from scope funcScopes[$-1].syms.length--; } void visit(ForeachArgsNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ForeachArgsNode")); foreachArgs = []; foreach (child; node.children) { child.accept(this); foreachArgs ~= id; } } void visit(MatchStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("MatchStmtNode")); funcScopes[$-1].syms.length++; // CondAssignmentsNode node.children[0].accept(this); // BoolExprNode node.children[1].accept(this); auto matchTypeSave = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; auto matchArmEndIndex = (cast(EndBlocksNode)(node.children[$-1])) ? node.children.length - 1 : node.children.length; // MatchWhenNode+ foreach (child; node.children[2..matchArmEndIndex]) { funcScopes[$-1].syms.length++; matchType = matchTypeSave; child.accept(this); funcScopes[$-1].syms.length--; } // EndBlocksNode if (matchArmEndIndex < node.children.length) { funcScopes[$-1].syms.length++; node.children[$-1].accept(this); funcScopes[$-1].syms.length--; } funcScopes[$-1].syms.length--; } void visit(MatchWhenNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("MatchWhenNode")); // PatternNode node.children[0].accept(this); auto stmtIndex = 1; // Add scope for variable bindings in match expression and guard // clauses funcScopes[$-1].syms.length++; if (node.children.length > 1 && cast(CondAssignmentsNode)node.children[1]) { stmtIndex = 3; // CondAssignmentsNode node.children[1].accept(this); // BoolExprNode node.children[2].accept(this); auto boolType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (boolType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-bool expr in match guard clause expr." ); } } // StatementNode node.children[stmtIndex].accept(this); funcScopes[$-1].syms.length--; } void visit(PatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("PatternNode")); node.children[0].accept(this); } void visit(DestructVariantPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("DestructVariantPatternNode")); if (matchType.tag == TypeEnum.AGGREGATE) { matchType = instantiateAggregate( records, matchType.aggregate, node ); } node.data["type"] = matchType; if (matchType.tag != TypeEnum.VARIANT) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not variant type." ); } auto matchTypeSave = matchType; matchType = normalizeVariantDefs(records, matchType.variantDef, node); // IdentifierNode node.children[0].accept(this); auto constructorName = id; // Try to grab the constructor with the same name. We'll get an array // with either that one member element, or it will be empty auto members = matchType.variantDef .members .filter!(a => a.constructorName == constructorName) .array; if (members.length == 0) { throw new Exception( errorHeader(node) ~ "\n" ~ "Variant constructor does not exist" ); } auto member = members[0]; if (member.constructorElems.tag == TypeEnum.VOID) { throw new Exception( errorHeader(node) ~ "\n" ~ "Variant constructor [" ~ constructorName ~ "] of variant [" ~ matchType.variantDef.format ~ "]\nin `match` does not " ~ "contain any values to deconstruct" ); } if (member.constructorElems.tuple.types.length != node.children[1..$].length) { throw new Exception( errorHeader(node) ~ "\n" ~ "Pattern sub-element quantity mismatch" ); } foreach (child, subtype; lockstep(node.children[1..$], member.constructorElems.tuple.types)) { matchType = subtype.normalize(records, node); child.accept(this); } matchType = matchTypeSave; } void visit(StructPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("StructPatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.STRUCT) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not struct type." ); } auto matchTypeSave = matchType; auto i = 0; // If the second node is an identifier node, then that means the first // node is the optional identifier node indicating the struct name, // which is purely sugar for the user, but we gotta verify it if (cast(IdentifierNode)node.children[1]) { i = 1; node.children[0].accept(this); auto structName = id; if (matchType.structDef.name != structName) { throw new Exception( errorHeader(node) ~ "\n" ~ "Wrong optional struct name in match" ); } } Type*[string] members; foreach (member; matchType.structDef.members) { members[member.name] = member.type; } bool[string] accessed; for (; i < node.children.length; i += 2) { node.children[i].accept(this); auto memberName = id; if (memberName !in members) { throw new Exception( errorHeader(node) ~ "\n" ~ "Struct deconstruction match with unknown member:\n" ~ " [" ~ memberName ~ "]\n" ~ " expecting member from struct: " ~ matchTypeSave.structDef.format ); } if (memberName in accessed) { throw new Exception( errorHeader(node) ~ "\n" ~ "Multiple match clauses for member\n" ~ " [" ~ memberName ~ "]\n" ~ " in struct: " ~ matchTypeSave.structDef.format ); } accessed[memberName] = true; matchType = members[memberName]; node.children[i+1].accept(this); } matchType = matchTypeSave; } void visit(BoolPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("BoolPatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not bool type." ); } } void visit(StringPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("StringPatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not string type." ); } } void visit(CharPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CharPatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.CHAR) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not char type." ); } } void visit(IntPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IntPatternNode")); node.data["type"] = matchType; if (!isIntegral(matchType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not integer type." ); } } void visit(FloatPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("FloatPatternNode")); node.data["type"] = matchType; if (!isFloat(matchType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not floating type." ); } } void visit(TuplePatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("TuplePatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.TUPLE) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not tuple type." ); } auto matchTypeSave = matchType; if (matchType.tuple.types.length != node.children.length) { throw new Exception( errorHeader(node) ~ "\n" ~ "Bad tuple match unpack: element quantity mismatch" ); } foreach (child, subtype; lockstep(node.children, matchType.tuple.types)) { matchType = subtype; child.accept(this); } matchType = matchTypeSave; } void visit(ArrayEmptyPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ArrayPatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.ARRAY) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not array type." ); } } void visit(ArrayPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ArrayPatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.ARRAY && matchType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not array or string type." ); } auto matchTypeSave = matchType; auto endIndex = node.children.length; if (cast(IdentifierNode)node.children[$-1]) { // Move back before the ".." token endIndex = endIndex - 2; node.children[$-1].accept(this); auto restName = id; auto pair = new VarTypePair(); pair.varName = restName; pair.type = matchTypeSave; funcScopes[$-1].syms[$-1].decls[restName] = pair; this.stackVarAllocSize[curFuncName] += pair.type .size .stackAlignSize; } else if (cast(ASTTerminal)node.children[$-1]) { // Move back before the ".." token endIndex = endIndex - 1; } if (matchType.tag == TypeEnum.ARRAY) { matchType = matchType.array.arrayType; } else if (matchType.tag == TypeEnum.STRING) { auto charType = new Type(); charType.tag = TypeEnum.CHAR; matchType = charType; } foreach (child; node.children[0..endIndex]) { child.accept(this); } matchType = matchTypeSave; } void visit(ArrayTailPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ArrayTailPatternNode")); node.data["type"] = matchType; if (matchType.tag != TypeEnum.ARRAY && matchType.tag != TypeEnum.STRING) { throw new Exception( errorHeader(node) ~ "\n" ~ "Must match on " ~ matchType.tag.format ~ ", not array or string type." ); } auto matchTypeSave = matchType; auto startIndex = 0; if (cast(IdentifierNode)node.children[0]) { // Move past identifier node startIndex = startIndex + 1; node.children[0].accept(this); auto restName = id; auto pair = new VarTypePair(); pair.varName = restName; pair.type = matchTypeSave; funcScopes[$-1].syms[$-1].decls[restName] = pair; this.stackVarAllocSize[curFuncName] += pair.type .size .stackAlignSize; } if (matchType.tag == TypeEnum.ARRAY) { matchType = matchType.array.arrayType; } else if (matchType.tag == TypeEnum.STRING) { auto charType = new Type(); charType.tag = TypeEnum.CHAR; matchType = charType; } foreach (child; node.children[startIndex..$]) { child.accept(this); } matchType = matchTypeSave; } void visit(WildcardPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("WildcardPatternNode")); } void visit(VarOrBareVariantPatternNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("VarOrBareVariantPatternNode")); node.data["type"] = matchType; // IdentifierNode node.children[0].accept(this); auto var = id; auto maybeVariantDef = variantFromConstructor(records, var); if (maybeVariantDef !is null) { if (matchType.tag != TypeEnum.VARIANT) { throw new Exception( errorHeader(node) ~ "\n" ~ "Matched type is not variant type, but got constructor:\n" ~ " " ~ var ~ "\n" ~ " for variant: " ~ maybeVariantDef.format ); } if (!matchType.variantDef.isMember(var)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Constructor for wrong variant definition:\n" ~ " Expects: " ~ matchType.format ~ "\n" ~ " But got: " ~ maybeVariantDef.format ); } auto member = matchType.variantDef.getMember(var); if (member.constructorElems.tag != TypeEnum.VOID) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot have empty variant match on non-empty constructor" ); } } // Is a variable binding else { auto pair = new VarTypePair(); pair.varName = var; pair.type = matchType; funcScopes[$-1].syms[$-1].decls[var] = pair; this.stackVarAllocSize[curFuncName] += pair.type .size .stackAlignSize; } } // Note that we must cater to the whims of updating // this.stackVarAllocSize[curFuncName] with the stack sizes of each variable // declared in this expression void visit(IsExprNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("IsExprNode")); // BoolExprNode node.children[0].accept(this); auto exprType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; // IdentifierNode node.children[1].accept(this); auto constructorName = id; auto variantDef = variantFromConstructor(records, constructorName); if (exprType.tag != TypeEnum.VARIANT) { throw new Exception( errorHeader(node) ~ "\n" ~ "Left side of `is` expression must be a variant type" ); } if (variantDef !is null) { if (!exprType.variantDef.isMember(constructorName)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Right side of `is` expression must be a valid " ~ "constructor for the left side variant type" ); } auto member = exprType.variantDef .getMember(constructorName); if (member.constructorElems.tag == TypeEnum.VOID && node.children[2..$].length > 0) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot bind variables in empty constructor" ); } if (member.constructorElems.tag != TypeEnum.VOID) { if (member.constructorElems.tuple.types.length != node.children[2..$].length) { throw new Exception( errorHeader(node) ~ "\n" ~ "Pattern sub-element quantity mismatch" ); } foreach (child, subtype; lockstep(node.children[2..$], member.constructorElems.tuple.types)) { // Foreach type in the binding expression that is not a // wildcard, bind the variable for use in the if statement if (cast(IdentifierNode)child) { child.accept(this); auto varBind = id; auto pair = new VarTypePair(); pair.varName = varBind; pair.type = subtype.normalize(records, node); stackVarAllocSize[curFuncName] += subtype.size .stackAlignSize; funcScopes[$-1].syms[$-1].decls[varBind] = pair; } } } auto boolType = new Type(); boolType.tag = TypeEnum.BOOL; builderStack[$-1] ~= boolType; } else { throw new Exception( errorHeader(node) ~ "\n" ~ "Variant constructor " ~ constructorName ~ " does not exist" ); } node.data["type"] = exprType; node.data["constructor"] = constructorName; } void visit(VariantIsMatchNode node) {} void visit(IdOrWildcardNode node) {} // Note that in the syntax BoolExpr <-= BoolExpr, the left expression must // yield a chan-type that contains the same type as the type of the right // expression void visit(ChanWriteNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ChanWriteNode")); // BoolExprNode node.children[0].accept(this); auto leftType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; // BoolExprNode node.children[1].accept(this); auto rightType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (leftType.tag != TypeEnum.CHAN) { throw new Exception( errorHeader(node) ~ "\n" ~ "Can't chan-write to non-channel" ); } else if (!leftType.chan.chanType.cmp(rightType)) { throw new Exception( errorHeader(node) ~ "\n" ~ "Can't chan-write mismatched types" ); } } void visit(ChanReadNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ChanReadNode")); node.children[0].accept(this); auto type = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (type.tag != TypeEnum.CHAN) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot chan-read from non-channel" ); } builderStack[$-1] ~= type.chan.chanType.copy; node.data["type"] = type.chan.chanType.copy; } void visit(SpawnStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("SpawnStmtNode")); node.children[0].accept(this); auto name = id; auto funcLookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, name ); if (!funcLookup.success) { throw new Exception( errorHeader(node) ~ "\n" ~ "No function [" ~ name ~ "] to spawn" ); } curFuncCallSig = funcLookup.sig; if (curFuncCallSig.templateParams.length > 0 && !cast(TemplateInstantiationNode)node.children[1]) { throw new Exception( errorHeader(node) ~ "\n" ~ "Template [" ~ name ~ "] must be instantiated to spawn" ); } if (cast(TemplateInstantiationNode)node.children[1]) { builderStack.length++; node.children[1].accept(this); auto templateInstantiations = builderStack[$-1]; builderStack.length--; auto instantiator = new TemplateInstantiator(records); curFuncCallSig = instantiator.instantiateFunction( curFuncCallSig, templateInstantiations ); if (curFuncCallSig.returnType.tag != TypeEnum.VOID) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot spawn non-void function" ); } auto existsLookup = funcSigLookup( toplevelFuncs ~ importedFuncSigs, curFuncCallSig.funcName ); if (!existsLookup.success) { toplevelFuncs ~= curFuncCallSig; // Add this instantiated, templated function to the end of the // abstract syntax tree, effectively bringing it into existence, // and allowing it to get typechecked later topNode.children ~= curFuncCallSig.funcDefNode; } auto newIdNode = new IdentifierNode(); auto terminal = new ASTTerminal( curFuncCallSig.funcName, 0 ); newIdNode.children ~= terminal; node.data["sig"] = curFuncCallSig; node.children[0] = newIdNode; node.children[2].accept(this); } else { if (curFuncCallSig.returnType.tag != TypeEnum.VOID) { throw new Exception( errorHeader(node) ~ "\n" ~ "Cannot spawn non-void function" ); } node.data["sig"] = curFuncCallSig; node.children[1].accept(this); } } void visit(YieldStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("YieldStmtNode")); } void visit(ForStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ForStmtNode")); insideLoop++; funcScopes[$-1].syms.length++; // CondAssignmentsNode node.children[0].accept(this); auto nodeIndex = 1; // Try BoolExprNode if (cast(BoolExprNode)node.children[nodeIndex]) { // BoolExprNode node.children[nodeIndex].accept(this); auto boolType = builderStack[$-1][$-1]; builderStack[$-1] = builderStack[$-1][0..$-1]; if (boolType.tag != TypeEnum.BOOL) { throw new Exception( errorHeader(node) ~ "\n" ~ "Non-bool expr in for bool expr." ); } nodeIndex++; } if (cast(ForUpdateStmtNode)node.children[nodeIndex]) { node.children[nodeIndex].accept(this); nodeIndex++; } // BareBlockNode node.children[nodeIndex].accept(this); insideLoop--; nodeIndex++; // EndBlocksNode if (node.children.length > nodeIndex) { node.children[nodeIndex].accept(this); nodeIndex++; } funcScopes[$-1].syms.length--; } void visit(ForUpdateStmtNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ForUpdateStmtNode")); foreach (child; node.children) { child.accept(this); } } void visit(EndBlocksNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("EndBlocksNode")); node.children[0].accept(this); } void visit(ThenElseCodaNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ThenElseCodaNode")); node.children[0].accept(this); node.children[1].accept(this); node.children[2].accept(this); } void visit(ThenCodaElseNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ThenCodaElseNode")); node.children[0].accept(this); node.children[1].accept(this); node.children[2].accept(this); } void visit(ElseThenCodaNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ElseThenCodaNode")); node.children[0].accept(this); node.children[1].accept(this); node.children[2].accept(this); } void visit(ElseCodaThenNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ElseCodaThenNode")); node.children[0].accept(this); node.children[1].accept(this); node.children[2].accept(this); } void visit(CodaElseThenNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CodaElseThenNode")); node.children[0].accept(this); node.children[1].accept(this); node.children[2].accept(this); } void visit(CodaThenElseNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CodaThenElseNode")); node.children[0].accept(this); node.children[1].accept(this); node.children[2].accept(this); } void visit(ThenElseNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ThenElseNode")); node.children[0].accept(this); node.children[1].accept(this); } void visit(ThenCodaNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ThenCodaNode")); node.children[0].accept(this); node.children[1].accept(this); } void visit(ElseThenNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ElseThenNode")); node.children[0].accept(this); node.children[1].accept(this); } void visit(ElseCodaNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ElseCodaNode")); node.children[0].accept(this); node.children[1].accept(this); } void visit(CodaThenNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CodaThenNode")); node.children[0].accept(this); node.children[1].accept(this); } void visit(CodaElseNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CodaElseNode")); node.children[0].accept(this); node.children[1].accept(this); } void visit(ThenBlockNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ThenBlockNode")); node.children[0].accept(this); } void visit(ElseBlockNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("ElseBlockNode")); // If the immediate parent of this end blocks node was an if-stmt, // restore all of the else-if cond-assign variables into the scope if (cast(IfStmtNode)(node.parent.parent)) { funcScopes[$-1].syms ~= elseIfScopes[$-1]; } node.children[0].accept(this); if (cast(IfStmtNode)(node.parent.parent)) { funcScopes[$-1].syms.length -= elseIfScopes[$-1].length; } } void visit(CodaBlockNode node) { debug (FUNCTION_TYPECHECK_TRACE) mixin(tracer("CodaBlockNode")); node.children[0].accept(this); } void visit(LambdaNode node) {} void visit(LambdaArgsNode node) {} void visit(StructFunctionNode node) {} void visit(InBlockNode node) {} void visit(OutBlockNode node) {} void visit(ReturnModBlockNode node) {} void visit(BodyBlockNode node) {} void visit(InterfaceDefNode node) {} void visit(InterfaceBodyNode node) {} void visit(InterfaceEntryNode node) {} void visit(ASTTerminal node) {} void visit(AssignExistingOpNode node) {} void visit(StorageClassNode node) {} void visit(ConstClassNode node) {} void visit(ExternStructDeclNode node) {} void visit(ExternFuncDeclNode node) {} void visit(ImportStmtNode node) {} void visit(ImportLitNode node) {} void visit(FuncDefArgListNode node) {} void visit(FuncSigArgNode node) {} void visit(FuncReturnTypeNode node) {} void visit(StructDefNode node) {} void visit(StructBodyNode node) {} void visit(StructEntryNode node) {} void visit(VariantDefNode node) {} void visit(VariantBodyNode node) {} void visit(VariantEntryNode node) {} void visit(CompOpNode node) {} void visit(SumOpNode node) {} void visit(SpNode node) {} void visit(ProgramNode node) {} }
D
module diesel.minitrace; public import std.typecons : scoped; import std.string : toz = toStringz; extern(C) void mtr_init(const char *json_file); // Shuts down minitrace cleanly, flushing the trace buffer. extern(C) void mtr_shutdown(); // Lets you enable and disable Minitrace at runtime. // May cause strange discontinuities in the output. // Minitrace is enabled on startup by default. extern(C) void mtr_start(); extern(C) void mtr_stop(); // Flushes the collected data to disk, clearing the buffer for new data. extern(C) void mtr_flush(); // Returns the current time in seconds. Used internally by Minitrace. No caching. extern(C) double mtr_time_s(); // Registers a handler that will flush the trace on Ctrl+C. // Works on Linux and MacOSX, and in Win32 console applications. extern(C) void mtr_register_sigint_handler(); // Commented-out types will be supported in the future. enum mtr_arg_type { MTR_ARG_TYPE_NONE = 0, MTR_ARG_TYPE_INT = 1, // I // MTR_ARG_TYPE_FLOAT = 2, // TODO // MTR_ARG_TYPE_DOUBLE = 3, // TODO MTR_ARG_TYPE_STRING_CONST = 8, // C MTR_ARG_TYPE_STRING_COPY = 9, // MTR_ARG_TYPE_JSON_COPY = 10, } // Only use the macros to call these. extern(C) void internal_mtr_raw_event(const char *category, const char *name, char ph, void *id); extern(C) void internal_mtr_raw_event_arg(const char *category, const char *name, char ph, void *id, mtr_arg_type arg_type, const char *arg_name, void *arg_value); // c - category. Can be filtered by in trace viewer (or at least that's the intention). // A good use is to pass __FILE__, there are macros further below that will do it for you. // n - name. Pass __FUNCTION__ in most cases, unless you are marking up parts of one. // Scopes. In C++, use MTR_SCOPE. In C, always match them within the same scope. //#define MTR_BEGIN(c, n) internal_mtr_raw_event(c, n, 'B', 0) //#define MTR_END(c, n) internal_mtr_raw_event(c, n, 'E', 0) //#define MTR_SCOPE(c, n) MTRScopedTrace ____mtr_scope(c, n) //#define MTR_SCOPE_LIMIT(c, n, l) MTRScopedTraceLimit ____mtr_scope(c, n, l) @trusted struct ScopedTrace { import core.stdc.string; static ScopedTrace opCall(string c = __FILE__, string n = __FUNCTION__) { ScopedTrace s; const char *cp = strdup(toz(c)); const char *sp = strdup(toz(n)); internal_mtr_raw_event(cp, sp, 'B', null); return s; } ~this() { internal_mtr_raw_event(cp, sp, 'E', null); } const char *cp; const char *sp; } mixin template MTR_SCOPE() { import std.typecons : scoped; auto x = scoped!ScopedTrace(__FILE__, __FUNCTION__); } void MTR_BEGIN(string c = __FILE__, string n = __FUNCTION__)() { internal_mtr_raw_event(toz(c), toz(n), 'B', null); } void MTR_END(string c = __FILE__, string n = __FUNCTION__)() { internal_mtr_raw_event(toz(c), toz(n), 'E', null); } void MTR_META_PROCESS_NAME(const char *n) { internal_mtr_raw_event_arg("", "process_name", 'M', null, mtr_arg_type.MTR_ARG_TYPE_STRING_COPY, "name", cast(void *)(n)); } void MTR_META_THREAD_NAME(const char *n) { internal_mtr_raw_event_arg("", "thread_name", 'M', null, mtr_arg_type.MTR_ARG_TYPE_STRING_COPY, "name", cast(void *)(n)); }
D
a sudden and decisive change of government illegally or by force a brilliant and notable success
D
/Users/aakash/Desktop/Xcode\ Projects/TempApp/build/TempApp.build/Debug-iphonesimulator/TempApp.build/Objects-normal/x86_64/WeatherViewController.o : /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherData.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/SceneDelegate.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/AppDelegate.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherModel.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherManager.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Controller/WeatherViewController.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreLocation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/aakash/Desktop/Xcode\ Projects/TempApp/build/TempApp.build/Debug-iphonesimulator/TempApp.build/Objects-normal/x86_64/WeatherViewController~partial.swiftmodule : /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherData.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/SceneDelegate.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/AppDelegate.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherModel.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherManager.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Controller/WeatherViewController.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreLocation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/aakash/Desktop/Xcode\ Projects/TempApp/build/TempApp.build/Debug-iphonesimulator/TempApp.build/Objects-normal/x86_64/WeatherViewController~partial.swiftdoc : /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherData.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/SceneDelegate.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/AppDelegate.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherModel.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Model/WeatherManager.swift /Users/aakash/Desktop/Xcode\ Projects/TempApp/TempApp/Controller/WeatherViewController.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreLocation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/Users/olegp/Desktop/XCoordinatorPlayground/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Scan.o : /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Deprecated.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Cancelable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObserverType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Reactive.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/RecursiveLock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Errors.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/AtomicInt.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Event.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/First.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/Platform.Linux.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/olegp/Desktop/XCoordinatorPlayground/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/olegp/Desktop/XCoordinatorPlayground/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/olegp/Desktop/XCoordinatorPlayground/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Scan~partial.swiftmodule : /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Deprecated.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Cancelable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObserverType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Reactive.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/RecursiveLock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Errors.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/AtomicInt.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Event.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/First.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/Platform.Linux.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/olegp/Desktop/XCoordinatorPlayground/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/olegp/Desktop/XCoordinatorPlayground/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/olegp/Desktop/XCoordinatorPlayground/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Scan~partial.swiftdoc : /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Deprecated.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Cancelable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObserverType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Reactive.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/RecursiveLock.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Errors.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/AtomicInt.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Event.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/First.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Rx.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/Platform/Platform.Linux.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/olegp/Desktop/XCoordinatorPlayground/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/olegp/Desktop/XCoordinatorPlayground/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/olegp/Desktop/XCoordinatorPlayground/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/* Copyright (c) 1996 Blake McBride 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. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef _MSC_VER #if _MSC_VER > 1200 #define _CRT_SECURE_NO_DEPRECATE #define _POSIX_ #endif #endif #include <windows.h> #include <sql.h> #include <sqlext.h> #include <ctype.h> #include <string.h> #include <malloc.h> /* for gFldSetFile */ #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <io.h> #include "dynsql.h" #include "../Windows/demo.h" #include "sqlparse.h" #define TYPE_NONE 0 #define TYPE_SELECT 1 #define TYPE_INSERT 2 #define Streq(a,b) !strcmp((a),(b)) #define Strne(a,b) strcmp((a),(b)) #ifndef WIN32 #define SQL_WCHAR (-8) #define SQL_WVARCHAR (-9) #define SQL_WLONGVARCHAR (-10) #define SQL_GUID (-11) #endif #define BUF_SIZE 4000 #define LAZY_SELECT 1 #define LAZY_SELECTONE 2 #define DB_ERROR_MESSAGE_SIZE 1024 defclass Statement : PropertyList { iDatabase; HSTMT iStmt; iCols; /* dictionary of result column names and StatementInfo objects */ iColList; /* LinkObject of columns (in order) */ int iTType; /* 1=select, 2=insert, etc. */ int iDBMS; int iDoneFirst; UWORD iRowStatus; char iTable[100]; iErrors; /* error codes to return instead of catching */ iDialogs; // Attached dialogs int iStmtAlreadyClosed; object iTag; /* arbitrary tag object associated with the statement */ int iPos; // current record number (one origin) int iEof; // -1=prior to first record, 0=valid record, 1=past end int iAutoDisposeTag; int iSingleTable; iTP; // transaction processing object int iDataSync; /* Lazy load */ int iLazyLoad; iLazyStatement; ifun iLazyFun; int iLazyType; iTableList; // iTable contains the first table, this contains the rest. int iVarTextChanged; int iReadOnly; int iLockEnableWrites; iLastSelect; int iIgnoreAllErrors; int iReturnAllErrors; int iErrorState; char iInternalState[10]; long iInternalNativeCode; // Cursor stuff int iUseCursors; iCursorFile; int iRecordsRead; int iRecordLength; int iOracleSQLStatistics; ifun iRecordTestFunction; // Field History stuff iFH_Table; /* Name of table to store history in */ iFH_Tables; /* StringDictionary by Table name */ long iUserID; iSpecialFH_Tables; ifun iSpecialAuditHandler; class: int cNumbStatements; int cSaveLastSelect; // Timing stuff FILE *cLFP; LARGE_INTEGER cFreq; LARGE_INTEGER cCount; LARGE_INTEGER cEnd; unsigned long cSeq; char *cBuf; int cBufSiz; RETCODE cRet; char cEmsg[DB_ERROR_MESSAGE_SIZE]; }; char *lcase(char *v); extern char *fix_sql(char *s); static char *fix_statement(char *s, int dbms); static void begin_log(void); static void end_log(void); static void print_log(char *fun, char *stmt, char *org); static char *query_buffer(int reclen); private imeth int pTrapError(object self, object es, int err); private imeth char *pFldGetVarText(object si, char *fld, char *vttbl); private imeth pFldSetVarText(object si, char *fld, char *str, char *vttbl); private imeth char *pGetVarTextTable(object self, object si, char *fld); private imeth int pSelectWATCOMPrimaryKeyFields(object self, char *table, char *oname); private imeth int pSelectWATCOMForeignKeys(object self, char *table, char *oname); private imeth int pSelectWATCOMReferencedBy(object self, char *table, char *oname); private imeth int pSelectWATCOMIndexes(object self, char *table, char *oname); private imeth int pSelectMSSQLIndexes(object self, char *table, char *oname); private imeth int pSelectWATCOMTriggers(object self, char *table, char type, char *oname); private imeth int pSelectMSSQLTriggers(object self, char *table, char type, char *oname); private imeth int pSelectWATCOMColumns(object self, char *table, char *oname, int byname); private imeth int pSelectMSSQLColumns(object self, char *table, char *oname, int byname); private imeth int pSelectMYSQLIndexes(object self, char *table, char *oname); private imeth int pSelectORACLEPrimaryKeyFields(object self, char *table, char *oname); #define BEGIN_LOG() if (cLFP) begin_log() #define END_LOG() if (cLFP) end_log() #define PRINT_LOG(fun, stmt, org) if (cLFP) print_log(fun, stmt, org) cvmeth vNew(db, fht, fhts, long userID) { object obj = gNew(super); ivType *iv = ivPtr(obj); static char err[] = "vNew::Statement Error"; DEMO_CHK_MAX; #ifndef _WIN32 TableInfo; // to fix some sort of link bug with MSC 16 bit #endif iDBMS = gDBMS_type(db); iFH_Table = fht; iFH_Tables = fhts; iUserID = userID; if (iTP = gGetTP(db)) iDataSync = 1; iDatabase = db; iStmt = SQL_NULL_HSTMT; cRet = SQLAllocStmt(gHDBC(db), &iStmt); if (cRet) vError(self, err); gAddStatement(db, obj); cNumbStatements++; return obj; } imeth object gGCDispose : GCDispose() { if (iStmt != SQL_NULL_HSTMT) cRet = SQLFreeStmt(iStmt, SQL_DROP); cNumbStatements--; return gDispose(super); } char *lcase(char *v) { char *b = v; for ( ; *v ; ++v) if (isupper(*v)) *v = tolower(*v); return b; } private imeth char *pGetOwnerName(object self, char* oname) { char *to = (oname && *oname) ? oname : NULL; if (!to && iDBMS == DBMS_ORACLE) to = gUserName(iDatabase); return to; } char *lcname(char *name) { static char buf[100]; strcpy(buf, name); return lcase(buf); } private imeth pUnattachDialog(object self, object dlg, int remove_from_list) { object ctls; // A StringDictionary of controls object seq, i, ctl, si; char *cname; // if (IsObj(dlg) && (gIsKindOf(dlg, Dialog) || gIsKindOf(dlg, Window))) // I do this to disassociate this class with the Window and Dialog classes if (IsObj(dlg) && (gIsKindOf(dlg, gFindClass(Class, "Dialog")) || gIsKindOf(dlg, gFindClass(Class, "Window")))) if (ctls = gControls(dlg)) for (seq = gSequence(ctls) ; i = gNext(seq) ; ) { ctl = gValue(i); cname = gName(ctl); if (!cname || !*cname) continue; si = gFindValueStr(iCols, lcname(cname)); if (si && gGetSI(ctl) == si && gGetValue(si) == gValue(ctl)) { gUnattach(ctl); gSetSI(ctl, NULL); } } if (remove_from_list && iDialogs) { object lnkval; int done = 0; for (seq = gSequenceLinks(iDialogs); !done && (lnkval = gNext(seq)); ) if (dlg == gValue(lnkval)) { gDispose(lnkval); done = 1; } if (lnkval) gDispose(seq); } return self; } imeth object gDispose, gDeepDispose () { if (iDialogs) { object seq, dlg; for (seq = gSequence(iDialogs); dlg = gNext(seq); ) pUnattachDialog(self, dlg, 0); iDialogs = gDispose(iDialogs); } if (iCols) gDispose(iCols); if (iColList) gDeepDispose(iColList); if (iTableList) gDeepDispose(iTableList); if (iErrors) gDeepDispose(iErrors); if (iTag && iAutoDisposeTag) gDeepDispose(iTag); if (iCursorFile) gDispose(iCursorFile); gDisposePropertyList(self); if (iLastSelect) gDispose(iLastSelect); if (iLazyStatement) gDispose(iLazyStatement); GCDispose(self); gRemoveStatement(iDatabase, self); return NULL; } cmeth int gSize() { return cNumbStatements; } imeth HSTMT gHSTMT() { return iStmt; } imeth char *gGetErrorMessage() { char state[100]; SQLError(gHENV(iDatabase), gHDBC(iDatabase), iStmt, state, NULL, cEmsg, sizeof cEmsg, NULL); return cEmsg; } imeth char *gGetErrorState() { SDWORD native; if (*iInternalState) return iInternalState; SQLError(gHENV(iDatabase), gHDBC(iDatabase), iStmt, iInternalState, &native, cEmsg, sizeof cEmsg, NULL); iInternalNativeCode=native; return iInternalState; } imeth long gGetNativeErrorCode() { return iInternalNativeCode; } ivmeth vError(char *fmt, ...) { char buf1[256]; MAKE_REST(fmt); vsprintf(buf1, fmt, _rest_); vError(super, "%s\n%s\n%s\n%ld", buf1, cEmsg, gGetErrorState(self), gGetNativeErrorCode(self)); return self; } cmeth char *gGetErrorMessage : c_emsg() { return cEmsg; } imeth int gGetErrorCode() { return cRet; } cmeth int gGetErrorCode : c_ecode () { return cRet; } imeth gRemoveVarText(object self, object flds) { if (flds) { object seq, sa; long id; for (seq=gSequence(flds) ; sa = gNext(seq) ; ) if (id = gFldGetLong(self, gStringKey(sa))) gDeleteVarText(iDatabase, gStringValue(gValue(sa)), id); } return self; } /* Return 0 Doesn't have from keyword 1 Has from keyword This function assumes that a valid delete statement has been passed in. */ static int get_delete_table(char *table, char *cmd) { char *p, *t; *table = '\0'; for (p = cmd + 7 ; *p && isspace(*p) ; p++); for (t = table ; *p && !isspace(*p) ; p++, t++) *t = *p; *t = '\0'; if (stricmp(table, "from")) return 0; for ( ; *p && isspace(*p) ; p++); for (t = table ; *p && !isspace(*p) ; p++, t++) *t = *p; *t = '\0'; return 1; } static int get_update_table(char *table, char *cmd) { char *p, *t; *table = '\0'; for (p = cmd + 7 ; *p && isspace(*p) ; p++); for (t = table ; *p && !isspace(*p) ; p++, t++) *t = *p; *t = '\0'; return 1; } static int get_insert_table(char *table, char *cmd) { char *p, *t; *table = '\0'; for (p = cmd + 7 ; *p && isspace(*p) ; p++); for (t = table ; *p && !isspace(*p) ; p++, t++) *t = *p; *t = '\0'; if (stricmp(table, "into")) return 0; for ( ; *p && isspace(*p) ; p++); for (t = table ; *p && !isspace(*p) ; p++, t++) *t = *p; *t = '\0'; return 1; } extern long Date_ymd(long date, int *year, int *month, int *day); #define MAX_PARAMS 300 private imeth int runPreparedStatement(char *cmd) { char *cmdstart=cmd; int bufsize=strlen(cmdstart)+1; char *buf; //should be smaller than cmd always char *idx; int top=0; int r=0; char *params[MAX_PARAMS]; int loop; SQLLEN nts=(SQLLEN)SQL_NTS; if (iDBMS == DBMS_ORACLE || strnicmp(cmd, "SELECT", 6) && strnicmp(cmd, "INSERT", 6) && strnicmp(cmd, "UPDATE", 6) && strnicmp(cmd, "DELETE", 6)) { char *p = fix_statement(cmd, iDBMS); r = SQLExecDirect(iStmt, p, SQL_NTS); free(p); return r; } idx = buf = malloc(bufsize*2); //should be smaller than cmd always while (*cmd) { if (top >= MAX_PARAMS) { //too many parameters, abort r=1; break; } //if I am in any kind of select, then I need to just copy until I hit the from or the end of the statement if (!strnicmp(cmd, "SELECT ", 7)) { while (*cmd && strnicmp(cmd, " FROM ", 6)) *idx++ = *cmd++; continue; } if ((*cmd >= 'a' && *cmd <= 'z') || (*cmd >= 'A' && *cmd <= 'Z')) { do { *idx++ = *cmd++; } while ((*cmd>='a'&&*cmd<='z')||(*cmd>='A'&&*cmd<='Z')||(*cmd=='_')||(*cmd>='0'&&*cmd<='9')||(*cmd=='.')); continue; } else if (*cmd == '\'') { int pos=0; params[top] = malloc(bufsize); *idx++ = '?'; *idx++ = ' '; do { cmd++; params[top][pos++] = *cmd; } while (*cmd && *cmd != '\''); params[top][pos-1] = 0; top++; } else if (*cmd == '~') { int pos=0; params[top] = malloc(bufsize); *idx++ = '?'; *idx++ = ' '; do { cmd++; params[top][pos++]=*cmd; } while (*cmd && *cmd!='~'); params[top][pos-1]=0; top++; } else if (*cmd == '{') { do { *idx++ = *cmd++; } while (*cmd && *cmd!='}'); *idx++ = *cmd++; continue; } else if (*cmd >= '0' && *cmd<='9' || *cmd == '-' || *cmd == '.') { int pos=0; params[top] = malloc(bufsize); *idx++ = '?'; *idx++ = ' '; do { params[top][pos++] = *cmd++; } while (*cmd >= '0' && *cmd <= '9' || *cmd == '.'); params[top++][pos]=0; cmd--; } else *idx++ = *cmd; if (*cmd) cmd++; } *idx = '\0'; if (!r) r = SQLPrepare(iStmt, buf, SQL_NTS); if (r) { //If I can't prepare the statement, just run it as it was char *p = fix_statement(cmdstart, iDBMS); r = SQLExecDirect(iStmt, p, SQL_NTS); free(p); goto end; } for (loop=0 ; loop<top ; loop++) r=SQLBindParameter(iStmt,(SQLUSMALLINT)(loop+1),(SQLSMALLINT)SQL_PARAM_INPUT,(SQLSMALLINT)SQL_C_CHAR,(SQLSMALLINT)SQL_VARCHAR,(SQLUINTEGER)0,(SQLSMALLINT)0,params[loop], (SQLINTEGER)(strlen(params[loop])+1), &nts); r = SQLExecute(iStmt); SQLFreeStmt(iStmt, SQL_RESET_PARAMS); if (r) { //If I can't run the statement, just run it as it was char *p = fix_statement(cmdstart, iDBMS); //Clean the query up all the way before we try to use it again SQLFreeStmt(iStmt, SQL_CLOSE); SQLFreeStmt(iStmt, SQL_UNBIND); r = SQLExecDirect(iStmt, p, SQL_NTS); free(p); } end: for (loop=0 ; loop < top ; loop++) free(params[loop]); free(buf); return r; } imeth int gExecute(char *cmd) { int r; char tname[100]; int tries = 0; if (iReadOnly) return 0; while (*cmd == ' ') cmd++; if (!strnicmp("delete ", cmd, 7)) { // Delete VarText first int hasFrom = get_delete_table(tname, cmd); object flds = gGetVarTextFields(iDatabase, tname); char *cp = hasFrom ? "" : "from "; if (flds) { object stmt = gNewNonCacheStatement(iDatabase); char tbuf[1024]; gReturnAllErrors(stmt, 1); sprintf(tbuf, "select * %s%s", cp, cmd + 7); if (!gDBSelect(stmt, tbuf)) while (!gNextRecord(stmt)) gRemoveVarText(stmt, flds); gDispose(stmt); } gSetChanged(iDatabase); } else if (!strnicmp("update ", cmd, 7)) { get_update_table(tname, cmd); gSetChanged(iDatabase); } else if (!strnicmp("insert ", cmd, 7)) { get_insert_table(tname, cmd); gSetChanged(iDatabase); } else *tname = '\0'; // again: gEndSQL(self); BEGIN_LOG(); // Read this thing and get a prepared style statement from it r = runPreparedStatement(self, cmd); END_LOG(); PRINT_LOG("gExecute", cmd, cmd); if (r == 1 && iDBMS == DBMS_POSTGRES) r = 0; if (r && pTrapError(self, iErrors, r)) { char state[6], buf[1024]; SQLError(gHENV(iDatabase), gHDBC(iDatabase), iStmt, state, NULL, buf, sizeof buf, NULL); // if it is a drop command or it is not any of the below states if (!strnicmp("drop ", cmd, 5) || // Oracle returns 42S11 or S1000 if you create an index on a field which already has an index // for example if it was declared as a primary key !strnicmp("create index", cmd, 12) && iDBMS == DBMS_ORACLE && Streq(state, "42S11") || !strnicmp("create index", cmd, 12) && iDBMS == DBMS_ORACLE && Streq(state, "S1000") || Streq(state, "42000") && iDBMS == DBMS_WATCOM // bug in SqlAnywhere 5.x // S1000 in Oracle indicates inserting NULL into a not null column // Streq(state, "S1000") && iDBMS == DBMS_POSTGRES I don't remember why this was needed ) r = 0; // ignore the error else if (!strnicmp("insert ", cmd, 7) && Streq(state, "23000")) { return 23000; // I know the gTPExecute is being avoided } else if (iIgnoreAllErrors) { return 0; } else if (Streq(state, "40001") && ++tries <= 3) goto again; else vError(super, "gExecute::Statement error %d, %s %s in query %s", r, state, buf, cmd); } if (iDataSync && iTP && !r) gTPExecute(iTP, tname, cmd); return r; } private imeth void updateOrgValues() { object si, seq, pk, key; #if 0 if (iSingleTable && *iTable) if (iDataSync) for (seq = gSequence(iCols) ; si = gNext(seq) ; ) gUpdateOriginalValue(gValue(si)); else if ((pk = gGetPrimaryKey(iDatabase, iTable)) && gSize(pk)) for (seq=gSequence(pk) ; key = gNext(seq) ; ) { si = gFindValueStr(iCols, gStringValue(key)); if (si) gUpdateOriginalValue(si); } #else for (seq = gSequence(iCols) ; si = gNext(seq) ; ) gUpdateOriginalValue(gValue(si)); #endif iVarTextChanged = 0; } private imeth void cursor_write(int rec) // rec is zero origin { object seq, si; if (!iCursorFile) if (!iUseCursors) return; else if (!(iCursorFile = gOpenTempFile(BufferedTempFile))) gError(Object, "Error opening ODBC cursor file"); if (!gSeek(iCursorFile, rec * iRecordLength) && rec) gError(Object, "ODBC Cursor seek error."); for (seq=gSequence(iColList) ; si = gNext(seq) ; ) if (!gCursorWrite(si, iCursorFile)) gError(Object, "ODBC Cursor write error."); if (rec == iRecordsRead) iRecordsRead++; } imeth int gRecordCount() { return iRecordsRead; } private imeth void cursor_read(int rec) // rec is zero origin { object seq, si; if (!iCursorFile) return; if (!gSeek(iCursorFile, rec * iRecordLength) && rec) gError(Object, "ODBC Cursor seek error."); for (seq=gSequence(iColList) ; si = gNext(seq) ; ) if (!gCursorRead(si, iCursorFile)) gError(Object, "ODBC Cursor read error."); } private imeth int bindCols(char *err) { RETCODE r; SWORD n, type, scale, nulls; UWORD i; SQLULEN prec; char cname[100]; object si; int size; r = SQLNumResultCols(iStmt, &n); if (r) if (iIgnoreAllErrors) { iErrorState = 1; return -1; } else vError(self, err); iCols = gNewWithInt(StringDictionary, 101); iColList = gNew(LinkObject); iRecordLength = 0; for (i=1 ; i <= n ; i++) { r = SQLDescribeCol(iStmt, i, cname, sizeof(cname)-1, NULL, &type, &prec, &scale, &nulls); // Handle inconsistancies in WATCOM before and after ver 5.5.01 if (!strcmp(cname, "count(*)") || !strcmp(cname, "\"count\"(*)")) strcpy(cname, "count"); if (!r) si = gNewSelect(StatementInfo, self, iStmt, (int) i, lcase(cname), type, prec, scale, nulls, &r, iDBMS, &size); if (r || !si) if (iIgnoreAllErrors) { iErrorState = 1; return -1; } else vError(self, err); gAddStr(iCols, cname, si); gAddLast(iColList, si); // if (type != SQL_GUID) iRecordLength += size; } iTType = TYPE_SELECT; return r; } /* Return 1 single table select 0 multiple table select Basically, we assume that if there exists a comma or JOIN between the FROM and a WHERE or ORDER then it is a multi-table select. */ #define INC cmd++, len-- static int get_table(char *table, char *cmd, object *tlist) { int len = strlen(cmd); int rval = 1; char tbl[100]; char *tp; *table = '\0'; while (len > 6) if ((cmd[0] == ' ' || cmd[0] == '\t') && (cmd[1] == 'f' || cmd[1] == 'F') && (cmd[2] == 'r' || cmd[2] == 'R') && (cmd[3] == 'o' || cmd[3] == 'O') && (cmd[4] == 'm' || cmd[4] == 'M') && (cmd[5] == ' ' || cmd[5] == '\t')) { cmd += 6; while (*cmd == ' ' || *cmd == '\t') INC; for ( ; *cmd && *cmd != ' ' && *cmd != '\t' && *cmd != ',' ; INC) *table++ = tolower(*cmd); *table = '\0'; break; } else INC; for ( ; *cmd ; INC) { while (cmd[0] == ',') { *tbl = '\0'; cmd++; while (*cmd == ' ' || *cmd == '\t') INC; for (tp = tbl ; *cmd && *cmd != ' ' && *cmd != '\t' && *cmd != ',' ; INC) *tp++ = tolower(*cmd); *tp = '\0'; if (!*tlist) *tlist = gNew(LinkObject); gAddLast(*tlist, gNewWithStr(String, tbl)); rval = 0; } if (len > 7) { if ((cmd[0] == ' ' || cmd[0] == '\t') && (cmd[1] == 'w' || cmd[1] == 'W') && (cmd[2] == 'h' || cmd[2] == 'H') && (cmd[3] == 'e' || cmd[3] == 'E') && (cmd[4] == 'r' || cmd[4] == 'R') && (cmd[5] == 'e' || cmd[5] == 'E') && (cmd[6] == ' ' || cmd[6] == '\t')) break; if ((cmd[0] == ' ' || cmd[0] == '\t') && (cmd[1] == 'o' || cmd[1] == 'O') && (cmd[2] == 'r' || cmd[2] == 'R') && (cmd[3] == 'd' || cmd[3] == 'D') && (cmd[4] == 'e' || cmd[4] == 'E') && (cmd[5] == 'r' || cmd[5] == 'R') && (cmd[6] == ' ' || cmd[6] == '\t')) break; if ((cmd[0] == ' ' || cmd[0] == '\t') && (cmd[1] == 'j' || cmd[1] == 'J') && (cmd[2] == 'o' || cmd[2] == 'O') && (cmd[3] == 'i' || cmd[3] == 'I') && (cmd[4] == 'n' || cmd[4] == 'N') && (cmd[5] == ' ' || cmd[5] == '\t')) { *tbl = '\0'; cmd += 6; while (*cmd == ' ' || *cmd == '\t') INC; for (tp = tbl ; *cmd && *cmd != ' ' && *cmd != '\t' ; INC) *tp++ = tolower(*cmd); *tp = '\0'; if (!*tlist) *tlist = gNew(LinkObject); gAddLast(*tlist, gNewWithStr(String, tbl)); rval = 0; } } } return rval; } #if 0 //imeth int gDBSelect, gExecuteWithBind (char *cmd) { RETCODE r; static char err[] = "gDBSelect::Statement Error"; char *p; DEMO_CHK_MAX; gEndSQL(self); BEGIN_LOG(); r = SQLExecDirect(iStmt, p=fix_statement(cmd, iDBMS), SQL_NTS); END_LOG(); PRINT_LOG("gDBSelect", p, cmd); free(p); if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) vError(self, err); iSingleTable = get_table(iTable, cmd, &iTableList); return !r || r == SQL_SUCCESS_WITH_INFO ? bindCols(self, err): -1; } #else private imeth int DBSelect (char *cmd, int useCursors) { RETCODE r; static char err[] = "gDBSelect::Statement Error"; int tries = 0; DEMO_CHK_MAX; gEndSQL(self); gEnterCriticalSection(iDatabase); if (cSaveLastSelect) if (iLastSelect) gChangeStrValue(iLastSelect, cmd); else iLastSelect = gNewWithStr(String, cmd); if (iDBMS == DBMS_MSSQL) useCursors = 1; iUseCursors = useCursors; // p = fix_statement(cmd, iDBMS); again: BEGIN_LOG(); r=runPreparedStatement(self,cmd); END_LOG(); PRINT_LOG("gDBSelect", cmd, cmd); if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) { char state[10]; if (iIgnoreAllErrors) { iErrorState = 1; gLeaveCriticalSection(iDatabase); return 0; } else { char state[6], buf[180]; char *tmpBuf; SQLError(gHENV(iDatabase), gHDBC(iDatabase), iStmt, state, NULL, buf, sizeof buf, NULL); if (Streq(state, "40001") && ++tries <= 3) { gEndSQL(self); goto again; } vError(super, "gDBSelect statement error %d, %s %s in query %s", r, state, buf, cmd); } } iSingleTable = get_table(iTable, cmd, &iTableList); if (!r || r == SQL_SUCCESS_WITH_INFO) { r = bindCols(self, err); if (iDBMS == DBMS_MSSQL) { int r=0; while (!r) { r = SQLFetch(iStmt); if (!r && (!iRecordTestFunction || iRecordTestFunction(self))) cursor_write(self, iPos++); } if (r != SQL_NO_DATA_FOUND && !iIgnoreAllErrors) vError(self, "gDBSelect cursor load"); SQLFreeStmt(iStmt, SQL_CLOSE); SQLFreeStmt(iStmt, SQL_UNBIND); iStmtAlreadyClosed = 1; if (r == SQL_NO_DATA_FOUND) iPos = 0; else if (iIgnoreAllErrors) { gLeaveCriticalSection(iDatabase); return 0; } } gLeaveCriticalSection(iDatabase); return r; } else { gLeaveCriticalSection(iDatabase); return -1; } } imeth int gDBSelect, gExecuteWithBind, gDBSelectDNC (char *cmd) { return DBSelect(self, cmd, 1); } imeth int gDBSelectNC(char *cmd) { return DBSelect(self, cmd, 0); } imeth int gLazyDBSelect, gLazyExecuteWithBind (ifun fun, char *cmd) { iLazyLoad = 1; if (iLazyStatement) gDispose(iLazyStatement); iLazyStatement = gNewWithStr(String, cmd); iLazyFun = fun; iLazyType = LAZY_SELECT; return 0; } imeth int gLazyDBSelectOne(ifun fun, char *cmd) { iLazyLoad = 1; if (iLazyStatement) gDispose(iLazyStatement); iLazyStatement = gNewWithStr(String, cmd); iLazyFun = fun; iLazyType = LAZY_SELECTONE; return 0; } private imeth int pDoLazyLoad() { object ss; char *cmd; int r = 0; if (!iLazyLoad) return r; ss = iLazyStatement; iLazyStatement = NULL; iLazyLoad = 0; switch (iLazyType) { case LAZY_SELECT: if ((r=gDBSelect(self, cmd=gStringValue(ss))) && iLazyFun) { iLazyFun(self); r = gDBSelect(self, cmd); if (r == SQL_NO_DATA_FOUND) r = 0; } break; case LAZY_SELECTONE: if ((r=gDBSelectOne(self, cmd=gStringValue(ss))) && iLazyFun) { iLazyFun(self); r = gDBSelectOne(self, cmd); if (r == SQL_NO_DATA_FOUND) r = 0; } break; } gDispose(ss); return r; } #define LAZY_LOAD if (iLazyLoad && pDoLazyLoad(self)) vError(self, "LazySelect Error") #endif imeth int gDoLazyLoad() { return pDoLazyLoad(self); } private imeth int DBSelectOne(char *cmd, int useCursors) { UDWORD crow; int r = DBSelect(self, cmd, useCursors); if (r) return r; if (iErrorState) return -1; if (iDBMS == DBMS_MSSQL) { if (iRecordsRead) { cursor_read(self, 0); iPos = 1; iEof = 0; updateOrgValues(self); } else return SQL_NO_DATA_FOUND; } else { do { r = SQLFetch(iStmt); } while (!r && iRecordTestFunction && !iRecordTestFunction(self)); if (r && r != SQL_NO_DATA_FOUND && pTrapError(self, iErrors, r)) if (iIgnoreAllErrors) { iErrorState = 1; return -1; } else vError(self, "gDBSelectOne"); if (!r) { cursor_write(self, iPos++); iEof = 0; updateOrgValues(self); } } return r; } imeth int gDBSelectOne, gDBSelectOneDNC (char *cmd) { return DBSelectOne(self, cmd, 1); } imeth int gDBSelectOneNC(char *cmd) { return DBSelectOne(self, cmd, 0); } private imeth pUpdateVarText(object self) { object seq, si; for (seq=gSequence(iColList) ; si = gNext(seq) ; ) gWriteVarText(si); return self; } private imeth pUndoVarText(object self) { object seq, si; for (seq=gSequence(iColList) ; si = gNext(seq) ; ) gUndoVarText(si); return self; } #if 0 // This insert mechanism depends on the iTables field of the Database class //imeth int gInsert(char *table) { RETCODE r; object ti; gEndSQL(self); ti = gGetTable(iDatabase, table); if (!ti) return -1; if (!cBuf) cBuf = malloc(cBufSiz=2048); if (!cBuf) return -1; gMakeInsert(ti, cBuf); r = SQLPrepare(iStmt, cBuf, SQL_NTS); if (r) return r; iCols = gNewWithInt(StringDictionary, 101); iColList = gNew(LinkObject); gBindColumns(ti, self, iStmt, iCols); iTType = TYPE_INSERT; return r; } //imeth int gAddRecord() { if (iTType != TYPE_INSERT) return -1; return SQLExecute(iStmt); } #else private imeth int pInsert(char *table, int r) { UDWORD crow; if (iErrorState) return 0; if (iDBMS == DBMS_MSSQL) return r; // The following lines _are_ required! /* if (!r) r = SQLFetch(iStmt); if (r && r != SQL_NO_DATA_FOUND && pTrapError(self, iErrors, r)) if (iIgnoreAllErrors) { iErrorState = 1; return 0; } else vError(self, "gInsert: Error %d on table '%s'", r, table); */ return r; } private imeth int makeBlankRow(char *cmd) { object columns,dbTable,cit,seq; int colNum=0; int i=0; if (iCols) gDeepDispose(iCols); if (iColList) gDispose(iColList); iCols = gNewWithInt(StringDictionary, 101); //I'm expecting to have a column object iColList = gNew(LinkObject); iRecordLength = 0; //get the columns from the database iSingleTable = get_table(iTable, cmd, &iTableList); dbTable=gGetTable(iDatabase,iTable); columns=gColumns(dbTable); //this is a string dictionary of column info objs for (seq=gSequence(columns) ; IsObj(seq) && ( cit = gNext(seq)) ; ) { object ci=gValue(cit); char *name=lcase(gName(ci)); object statementinfo; RETCODE r; int cize; SWORD scale, nulls; int prec; SWORD colType=gType(ci); i++; scale=gColumnScale(ci); nulls=gIsNullable(ci); prec=gSize(ci); statementinfo = gNewSelect(StatementInfo, self, iStmt, (int) gNumber(ci), name, colType, prec, scale, nulls, &r, iDBMS, &cize); gAddStr(iCols, name, statementinfo); gAddLast(iColList, statementinfo); iRecordLength+=cize; } iTType = TYPE_SELECT; //pretend I did this with a select return 0; } imeth int gInsert(char *table) { char cmd[100]; int r=0; object tablelist; sprintf(cmd, "select * from %s where 1=2", table); makeBlankRow(self,cmd); //r = DBSelect(self, cmd, 0); return pInsert(self, table, r); } static void updateFields(ivType *iv) { object seq, i; for (seq = gSequence(iCols) ; i = gNext(seq) ; ) gUpdate(gValue(i)); } imeth gClear() { object seq, i; if (iCols) for (seq = gSequence(iCols) ; i = gNext(seq) ; ) gClear(gValue(i)); iVarTextChanged = 0; return self; } #define GO_END \ while (*p) { \ p++; \ if (++n > QUERY_BUFFER_SIZE + iRecordLength) \ vError(self, "QueryBuffer overflow"); \ } private imeth char *make_addrec() { char *buf = query_buffer(iRecordLength*3); char *p; object seq, si, trc = gGetTable(CacheResult, iTable), cc; int add_comma = 0, n=0; sprintf(p=buf, "INSERT INTO %s (", iTable); for (seq=gSequence(iColList) ; si = gNext(seq) ; ) { if (add_comma) strcat(buf, ", "); else add_comma = 1; strcat(buf, gName(si)); } add_comma = 0; strcat(buf,") VALUES ("); GO_END; if (trc && (cc = gFindValueStr(trc, "*"))) { gInvalidateResultCache(CacheResult, trc, cc); trc = NULL; } for (seq=gSequence(iColList) ; si = gNext(seq) ; ) { if (add_comma) { *p++ = ','; *p++ = ' '; n += 2; } else add_comma = 1; gFormatField(si, p); if (trc && (cc = gFindValueStr(trc, gName(si)))) gInvalidateResultCache(CacheResult, trc, cc); GO_END; } strcpy(p, ")"); GO_END; return buf; } private imeth void audit_addrec() { char *fn, *buf=NULL, *buf2=NULL, *p; object seq, si, stmt=NULL, kseq, fld; object auditList = iFH_Tables ? gFindValueStr(iFH_Tables, iTable) : NULL; int usingSpecialAuditList = 0; if (!auditList) { auditList = iSpecialFH_Tables ? gFindValueStr(iSpecialFH_Tables, iTable) : NULL; usingSpecialAuditList = 1; } if (!auditList) return; for (seq=gSequence(iColList) ; si = gNext(seq) ; ) if (gHasData(si)) { fn = gName(si); if (gFindStr(auditList, fn)) { if (!buf) { buf = query_buffer(iRecordLength); buf2 = query_buffer(iRecordLength); stmt = gNewStatement(iDatabase); for (p=buf, kseq=gSequence(gGetPrimaryKey(iDatabase, iTable)) ; fld = gNext(kseq) ; ) { gFormatFixedLengthField(gFindValueStr(iCols, gStringValue(fld)), p); for (; *p ; p++); } } if (!usingSpecialAuditList) { object now = gNow(iDatabase); gInsert(stmt, gStringValue(iFH_Table)); gFldSetString(stmt, "TableName", iTable); gFldSetChar(stmt, "ChangeType", 'A'); gFldSetString(stmt, "KeyData", buf); gChangeValue(gFldGetValue(stmt, "ChangeTime"), now); gDispose(now); gUpdate(gGetField(stmt, "ChangeTime")); gFldSetLong(stmt, "UserID", iUserID); gFldSetString(stmt, "FieldName", gName(si)); gFldSetString(stmt, "FieldValue", gFormatFixedLengthField(si, buf2)); gAddRecord(stmt); } else { if (iSpecialAuditHandler) iSpecialAuditHandler(iTable, 'A', buf, iUserID, gName(si), gFormatFixedLengthField(si, buf2), self); } } } if (stmt) gDispose(stmt); if (buf) free(buf); if (buf2) free(buf2); } imeth int gAddRecord() { int r; if (iReadOnly || iErrorState) return 0; if (iTType != TYPE_SELECT) return -1; if (iDBMS == DBMS_ACCESS) updateFields(iv); if (iVarTextChanged) pUpdateVarText(self); if (1 || iDBMS == DBMS_SYBASE || iDBMS == DBMS_MYSQL || iDBMS == DBMS_MSSQL) { char *buf = make_addrec(self); object stmt = gStatement(iDatabase); int ds = gEnableTP(stmt, 0); int ro = gIsReadOnly(stmt); if (ro) gEnableWrites(stmt); r = gExecute(stmt, buf); free(buf); gEnableTP(stmt, ds); if (ro) gDisableWrites(stmt); } else { char *p; BEGIN_LOG(); r = SQL_ADD_RECORD(iStmt, 1); // argument must be 1 to work when file is empty END_LOG(); if (cLFP) { char *t; p = make_addrec(self); PRINT_LOG("gAddRecord", t=fix_statement(p, iDBMS), p); free(p); free(t); } } if (r && pTrapError(self, iErrors, r)) { char state[6], buf[128]; if (iVarTextChanged) pUndoVarText(self); if ((1 || iDBMS == DBMS_SYBASE || iDBMS == DBMS_MYSQL || iDBMS == DBMS_MSSQL) && r == 23000) return 1; SQLError(gHENV(iDatabase), gHDBC(iDatabase), iStmt, state, NULL, buf, sizeof buf, NULL); if (iDBMS != DBMS_ACCESS && strcmp(state, "23000")) if (iIgnoreAllErrors) return 0; else vError(super, "gAddRecord error %s %s", state, buf); else if (iDBMS == DBMS_ACCESS && strcmp(state, "S1000") && strcmp(state, "01004")) if (iIgnoreAllErrors) return 0; else vError(super, "gAddRecord error %s %s", state, buf); } if (!r && iDataSync && iTP) gTPAdd(iTP, self); if (!r && iFH_Tables) audit_addrec(self); return r; } imeth int gAddRecordWithAutoInc(char *table, char *field, char *where, char *order) { object stmt; int r; long id, seq; char select[256], mutex[256], sequence[256]; sprintf(mutex, "AutoInc Lock - %s", table); lcase(mutex+13); if (gCreateMutex(iDatabase, mutex, NULL, 60000, 60000, 250)) return -1; // error - can't create mutex lock sprintf(sequence, "AutoInc - %s", table); lcase(sequence+8); seq = gNextNumber(iDatabase, sequence); stmt = gNewNonCacheStatement(iDatabase); gReturnAllErrors(stmt, 1); sprintf(select, "select MAX(%s) as mmax from %s %s", field, table, where ? where : ""); r = gDBSelectOneNC(stmt, select); id = r ? seq : gFldGetLong(stmt, "mmax") + 1L; if (id < seq) id = seq; if (id > seq) gSetLastNumber(iDatabase, sequence, id); gFldSetLong(self, field, id); r = gAddRecord(self); gDisposeMutex(iDatabase, mutex); gDispose(stmt); return r; } #endif imeth gGetField(char *fld) { return iCols ? gFindValueStr(iCols, lcname(fld)) : NULL; } imeth gFldGetValue(char *fld) { object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetValue: No field '%s'", fld); return si ? gGetValue(si) : si; } imeth void *gFldGetPointer(char *fld) { object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetPointer: No field '%s'", fld); return si ? gPointerValue(si) : NULL; } imeth char *gFldGetStringNoStrip(char *fld) { char *cp; char *vttbl; object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetString: No field '%s'", fld); if (vttbl = pGetVarTextTable(self, si, fld)) cp = pFldGetVarText(self, si, fld, vttbl); else cp = gStringValue(gGetValue(si)); return cp; } imeth char *gFldGetString(char *fld) { char *cp; char *vttbl; object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetString: No field '%s'", fld); if (vttbl = pGetVarTextTable(self, si, fld)) cp = pFldGetVarText(self, si, fld, vttbl); else cp = gStringValue(gStripRight(gGetValue(si))); return cp; } imeth char *gFldGetStringXML(char *fld) { char *cp; char *vttbl; object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetString: No field '%s'", fld); if (vttbl = pGetVarTextTable(self, si, fld)) pFldGetVarText(self, si, fld, vttbl); cp = gStringValueXML(si); return cp; } imeth char *gFldToFile(char *fld, char *file) { char *cp; int h; object si; si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldToFile: No field '%s'", fld); h = open(file, O_BINARY | O_CREAT | O_TRUNC | O_WRONLY, _S_IREAD | _S_IWRITE); if (gType(si) == SQL_LONGVARBINARY) { long size; if (!gFldGetBinary(self, fld, &size, &cp) && size) { write(h, cp, size); free(cp); } else cp = NULL; } else { cp = gFldGetString(self, fld); write(h, cp, strlen(cp)); } close(h); return cp; } imeth char gFldGetChar(char *fld) { object val, si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetChar: No field '%s'", fld); else val = gGetValue(si); if (gIsKindOf(val, String)) if (!gSize(val)) return '\0'; else return gCharValueAt(val, 0); else return gCharValue(val); } imeth short gFldGetShort(char *fld) { object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetShort: No field '%s'", fld); return si ? gShortValue(gGetValue(si)) : 0; } imeth unsigned short gFldGetUnsignedShort(char *fld) { object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetUnsignedShort: No field '%s'", fld); return si ? gUnsignedShortValue(gGetValue(si)) : 0; } imeth long gFldGetLong(char *fld) { object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetLong: No field '%s'", fld); return si ? gLongValue(gGetValue(si)) : 0L; } imeth double gFldGetDouble(char *fld) { object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetDouble: No field '%s'", fld); return si ? gDoubleValue(gGetValue(si)) : 0; } imeth gFldGetDateTime(char *fld, long *dt, long *tm) { object si; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "DB field access without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldGetDateTime: No field '%s'", fld); else gDateTimeValues(gGetValue(si), dt, tm); return si ? self : NULL; } imeth gFldSetString(char *fld, char *str) { char *vttbl; object si; if (iErrorState) return self; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetString: No field '%s'", fld); if (vttbl = pGetVarTextTable(self, si, fld)) pFldSetVarText(self, si, fld, str, vttbl); else { int maxlen = gSize(si); if (strlen(str) > maxlen) { char *buf = (char *) malloc(maxlen + 1); int i; if (!buf) gError(Object, "Out of memory."); for (i = 0 ; i < maxlen ; i++) buf[i] = str[i]; buf[i] = '\0'; gChangeStrValue(gGetValueToPut(si), buf); free(buf); } else gChangeStrValue(gGetValueToPut(si), str); } gSetNotNull(si); return self; } imeth gFldSetFromFile(char *fld, char *file) { char *vttbl, *str; object si; int h; struct stat sb; if (iErrorState) return self; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetFromFile: No field '%s'", fld); h = open(file, O_BINARY | O_RDONLY); if (h == -1) vError(Object, "gFldSetFromFile: file '%s' not found.", file); fstat(h, &sb); if (gType(si) == SQL_LONGVARBINARY) { str = malloc(sb.st_size); if (!str) gError(Object, "Out of memory."); read(h, str, sb.st_size); gFldSetBinary(self, fld, sb.st_size, str); free(str); } else { if (vttbl = pGetVarTextTable(self, si, fld)) { str = malloc(sb.st_size+1); if (!str) gError(Object, "Out of memory."); read(h, str, sb.st_size); str[sb.st_size] = '\0'; pFldSetVarText(self, si, fld, str, vttbl); free(str); } else { int maxlen = gSize(si); object val = gGetValueToPut(si); if (maxlen > MAX_LONG_VARCHAR_LENGTH) maxlen = MAX_LONG_VARCHAR_LENGTH; if (maxlen < sb.st_size) vError(Object, "gFldSetFromFile: File '%s' exceeds max length of %ld bytes (is %ld bytes).", file, maxlen, (long) sb.st_size); str = gStringValue(val); read(h, str, sb.st_size); str[sb.st_size] = '\0'; gUpdateLength(val); } } close(h); gSetNotNull(si); return self; } imeth gFldSetDateTime(char *fld, long dt, long tm) { object si; LAZY_LOAD; if (iErrorState) return self; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetDateTime: No field '%s'", fld); gChangeDateTimeValues(gGetValueToPut(si), dt, tm); gUpdate(si); // for dates and times gSetNotNull(si); return self; } imeth gFldSetChar(char *fld, int val) { object obj, si; if (iErrorState) return self; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetChar: No field '%s'", fld); obj = gGetValueToPut(si); if (gIsKindOf(obj, String)) { char buf[2]; buf[0] = (char) val; buf[1] = '\0'; gChangeStrValue(obj, buf); } else gChangeCharValue(obj, val); gSetNotNull(si); return self; } imeth gFldSetShort(char *fld, int val) { object si; if (iErrorState) return self; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetShort: No field '%s'", fld); gChangeShortValue(gGetValueToPut(si), val); gSetNotNull(si); return self; } imeth gFldSetUnsignedShort(char *fld, unsigned val) { object si; if (iErrorState) return self; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetUnsignedShort: No field '%s'", fld); gChangeUShortValue(gGetValueToPut(si), val); gSetNotNull(si); return self; } imeth gFldSetLong(char *fld, long val) { object si; if (iErrorState) return self; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetLong: No field '%s'", fld); gChangeLongValue(gGetValueToPut(si), val); gUpdate(si); // for dates and times gSetNotNull(si); return self; } imeth gFldSetDouble(char *fld, double val) { object si; if (iErrorState) return self; LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetDouble: No field '%s'", fld); if (_isnan(val)) vError(Object, "gFldSetDouble: Field '%s' passed NAN", fld); gChangeDoubleValue(gGetValueToPut(si), val); gSetNotNull(si); return self; } imeth gFldSetNull(char *fld) { object si; if (iErrorState) return self; // LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetNull: No field '%s'", fld); gSetNull(si); return self; } imeth gFldSetNotNull(char *fld) { object si; if (iErrorState) return self; // LAZY_LOAD; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetNotNull: No field '%s'", fld); gSetNotNull(si); return self; } private imeth char *make_select_field(char *bfld, int *fn) { char *buf, *p; object seq, si, pk, kseq, fld; int add_comma = 0, n=0; pk = gGetPrimaryKey(iDatabase, iTable); if (!pk || !gSize(pk)) if (iIgnoreAllErrors) return NULL; else vError(self, "Can't get binary field %s when no primary key declared", iTable); *fn = 1; strcpy(p=buf=query_buffer(iRecordLength), "SELECT "); GO_END; for (add_comma=0, kseq=gSequence(pk) ; fld = gNext(kseq) ; ) { if (add_comma) { strcpy(p, ", "); GO_END; } else add_comma = 1; strcpy(p, gStringValue(fld)); GO_END; (*fn)++; } sprintf(p, ", %s FROM %s WHERE ", bfld, iTable); GO_END; for (add_comma=0, kseq=gSequence(pk) ; fld = gNext(kseq) ; ) { char *sf; if (add_comma) { strcpy(p, " AND "); GO_END; } else add_comma = 1; strcpy(p, sf=gStringValue(fld)); strcat(p, " = "); GO_END; gFormatOrgField(gFindValueStr(iCols, sf), p); GO_END; } return buf; } private imeth char *make_update_field(char *bfld) { char *buf, *p; object seq, si, pk, kseq, fld; int add_comma = 0, n=0; pk = gGetPrimaryKey(iDatabase, iTable); if (!pk || !gSize(pk)) if (iIgnoreAllErrors) return NULL; else vError(self, "Can't get binary field %s when no primary key declared", iTable); sprintf(p=buf=query_buffer(iRecordLength), "UPDATE %s SET %s=? WHERE ", iTable, bfld); GO_END; for (add_comma=0, kseq=gSequence(pk) ; fld = gNext(kseq) ; ) { char *sf; if (add_comma) { strcpy(p, " AND "); GO_END; } else add_comma = 1; strcpy(p, sf=gStringValue(fld)); strcat(p, " = "); GO_END; gFormatOrgField(gFindValueStr(iCols, sf), p); GO_END; } return buf; } #define ERR_RTN if (iIgnoreAllErrors) { \ iErrorState = 1; \ gDispose(stmt); \ gLeaveCriticalSection(iDatabase); \ return -1; \ } else \ vError(stmt, fun) imeth int gFldSetBinary(char *fld, long size, char *val) { object si, stmt; char *cmd; int r; HSTMT h; static char fun[] = "gFldSetBinary"; char * t; if (iErrorState) return iErrorState; if (iTType != TYPE_SELECT) gError(Object, "Set DB field without select"); if (iReadOnly) return 0; si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetBinary: No field '%s'", fld); stmt = gNewStatement(iDatabase); gEnterCriticalSection(iDatabase); cmd = make_update_field(self, fld); t=fix_statement(cmd, iDBMS); r = SQLPrepare(h=gHSTMT(stmt), t, SQL_NTS); free(t); free(cmd); if (!r) { SQLLEN pcbVal = SQL_LEN_DATA_AT_EXEC(size); PTR pToken; r = SQLBindParameter(h, (UWORD) 1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY, 0, 0, (PTR) 1, 0, &pcbVal); if (r) ERR_RTN; r = SQLExecute(h); if (r != SQL_NEED_DATA) ERR_RTN; r = SQLParamData(h, &pToken); if (r != SQL_NEED_DATA) ERR_RTN; r = SQLPutData(h, val, size); if (r) ERR_RTN; r = SQLParamData(h, &pToken); if (r) ERR_RTN; } gDispose(stmt); gLeaveCriticalSection(iDatabase); gSetNotNull(si); return r; } imeth int gFldGetBinary(char *fld, long *size, char **val) { object si, stmt; char *cmd, c; int r, fn; HSTMT h; SQLLEN pcbVal; static char fun[] = "gFldGetBinary"; char * t; *val = NULL; *size = 0; if (iErrorState) return iErrorState; if (iTType != TYPE_SELECT) gError(Object, "Get DB field without select"); si = gFindValueStr(iCols, lcname(fld)); if (!si) vError(Object, "gFldSetBinary: No field '%s'", fld); stmt = gNewStatement(iDatabase); gEnterCriticalSection(iDatabase); cmd = make_select_field(self, fld, &fn); t=fix_statement(cmd, iDBMS); r = SQLExecDirect(h=gHSTMT(stmt), t, SQL_NTS); free(t); free(cmd); if (!r || r == SQL_SUCCESS_WITH_INFO) { r = SQLFetch(h); if (r && r != SQL_NO_DATA_FOUND && pTrapError(self, iErrors, r)) ERR_RTN; r = SQLGetData(h, (UWORD) fn, SQL_C_BINARY, &c, 1, &pcbVal); if (r == SQL_SUCCESS_WITH_INFO) { // have data bigger than 1 byte *size = pcbVal; *val = malloc(*size+1); **val = c; r = SQLGetData(h, (UWORD) fn, SQL_C_BINARY, *val+1, *size-1, &pcbVal); (*val)[*size] = '\0'; if (r) ERR_RTN; } else if (!r && pcbVal == 1) { // only 1 byte long and got it *size = pcbVal; *val = malloc(*size+1); **val = c; (*val)[*size] = '\0'; } else if (!r && pcbVal <= 0) { // no data } else ERR_RTN; } else ERR_RTN; gDispose(stmt); gLeaveCriticalSection(iDatabase); return r; } private imeth void check_cache() { object seq, si, trc = gGetTable(CacheResult, iTable), cc; if (trc) if (cc = gFindValueStr(trc, "*")) gInvalidateResultCache(CacheResult, trc, cc); else for (seq=gSequence(iColList) ; si = gNext(seq) ; ) if (cc = gFindValueStr(trc, gName(si))) gInvalidateResultCache(CacheResult, trc, cc); } private imeth char *make_delete() { char *buf; char *p; object pk, kseq, fld; int add_comma = 0, n=0; pk = gGetPrimaryKey(iDatabase, iTable); if (!pk || !gSize(pk)) if (iIgnoreAllErrors) return NULL; else vError(self, "Can't update %s when no primary key declared", iTable); sprintf(p=buf=query_buffer(iRecordLength), "DELETE FROM %s WHERE ", iTable); GO_END; for (kseq=gSequence(pk) ; fld = gNext(kseq) ; ) { char *sf; if (add_comma) { strcpy(p, " AND "); GO_END; } else add_comma = 1; strcpy(p, sf=gStringValue(fld)); strcat(p, " = "); GO_END; gFormatOrgField(gFindValueStr(iCols, sf), p); GO_END; } return buf; } private imeth void audit_delete() { char *fn, *buf=NULL, *buf2=NULL, *p; object seq, si, stmt=NULL, kseq, fld; object auditList = iFH_Tables ? gFindValueStr(iFH_Tables, iTable) : NULL; int usingSpecialAuditList = 0; if (!auditList) { auditList = iSpecialFH_Tables ? gFindValueStr(iSpecialFH_Tables, iTable) : NULL; usingSpecialAuditList = 1; } if (!auditList) return; for (seq=gSequence(iColList) ; si = gNext(seq) ; ) if (gHasData(si)) { fn = gName(si); if (gFindStr(auditList, fn)) { if (!buf) { buf = query_buffer(iRecordLength); buf2 = query_buffer(iRecordLength); stmt = gNewStatement(iDatabase); for (p=buf, kseq=gSequence(gGetPrimaryKey(iDatabase, iTable)) ; fld = gNext(kseq) ; ) { gFormatFixedLengthField(gFindValueStr(iCols, gStringValue(fld)), p); for (; *p ; p++); } } if (!usingSpecialAuditList) { object now = gNow(iDatabase); gInsert(stmt, gStringValue(iFH_Table)); gFldSetString(stmt, "TableName", iTable); gFldSetChar(stmt, "ChangeType", 'D'); gFldSetString(stmt, "KeyData", buf); gChangeValue(gFldGetValue(stmt, "ChangeTime"), now); gDispose(now); gUpdate(gGetField(stmt, "ChangeTime")); gFldSetLong(stmt, "UserID", iUserID); gFldSetString(stmt, "FieldName", gName(si)); gFldSetString(stmt, "FieldValue", gFormatFixedLengthField(si, buf2)); gAddRecord(stmt); } else { if (iSpecialAuditHandler) iSpecialAuditHandler(iTable, 'D', buf, iUserID, gName(si), gFormatFixedLengthField(si, buf2), self); } } } if (stmt) gDispose(stmt); if (buf) free(buf); if (buf2) free(buf2); } imeth int gDeleteRecord() { int r; if (iReadOnly) return 0; if (iTType != TYPE_SELECT) gError(Object, "gDeleteRecord without Select"); check_cache(self); if (1 || iDBMS == DBMS_SYBASE || iDBMS == DBMS_MYSQL || iDBMS == DBMS_MSSQL) { char *buf = make_delete(self); object stmt; int ds, ro, rae; if (!buf) return 0; stmt = gStatement(iDatabase); rae = gReturnAllErrors(stmt, 1); ds = gEnableTP(stmt, 0); ro = gIsReadOnly(stmt); if (ro) gEnableWrites(stmt); r = gExecute(stmt, buf); if (r) { strcpy(iInternalState, gGetErrorState(stmt)); iInternalNativeCode = gGetNativeErrorCode(stmt); } free(buf); gEnableTP(stmt, ds); if (ro) gDisableWrites(stmt); gReturnAllErrors(stmt, rae); } else { char *p; BEGIN_LOG(); r = SQL_DELETE_RECORD(iStmt, 1); END_LOG(); if (cLFP) { char * t; p = make_delete(self); PRINT_LOG("gDeleteRecord", t=fix_statement(p, iDBMS), p); if (p) free(p); free(t); } } if (r && pTrapError(self, iErrors, r)) if (iIgnoreAllErrors) return 0; else vError(self, "gDeleteRecord"); gRemoveVarText(self, gGetVarTextFields(iDatabase, iTable)); if (iDataSync && iTP) gTPDelete(iTP, self); if (!r && iFH_Tables) audit_delete(self); return r; /* char cursor[30], cmd[128]; if (iTType != TYPE_SELECT) return -1; SQL_POSITION_TO(iStmt, 1); SQLGetCursorName(iStmt, cursor, (SWORD) sizeof cursor, NULL); sprintf(cmd, "delete where current of %s", cursor); return SQLExecDirect(iStmt, cmd, SQL_NTS); */ } imeth int gFieldsChanged() { object seq, si, old, newv, trc, cc, cc2; int res = 1; if (iTType != TYPE_SELECT) return 0; trc = gGetTable(CacheResult, iTable); cc2 = trc ? gFindValueStr(trc, "*") : NULL; for (seq=gSequence(iColList) ; si = gNext(seq) ; ) { old = gOriginalValue(si); newv = gGetValueToPut(si); if (old && gCompare(old, newv)) { res = 0; if (!trc) { gDispose(seq); break; } if (trc && cc2) { gInvalidateResultCache(CacheResult, trc, cc2); trc = NULL; gDispose(seq); break; } if (cc = gFindValueStr(trc, gName(si))) gInvalidateResultCache(CacheResult, trc, cc); } if (iVarTextChanged && gVarTextChanged(si)) { res = 0; if (!trc) { gDispose(seq); break; } if (trc && cc2) { gInvalidateResultCache(CacheResult, trc, cc2); trc = NULL; gDispose(seq); break; } if (cc = gFindValueStr(trc, gName(si))) gInvalidateResultCache(CacheResult, trc, cc); } } return !res; } private imeth pRestoreOriginalValues(object self) { object si, seq; for (seq = gSequence(iCols) ; si = gNext(seq) ; ) gRestoreOriginalValue(gValue(si)); iVarTextChanged = 0; return self; } private imeth char *make_update(int exit) { char *buf; char *p; object seq, si, pk, kseq, fld, old, newv; int add_comma = 0, n=0, nfields=0; pk = gGetPrimaryKey(iDatabase, iTable); if (!pk || !gSize(pk)) if (iIgnoreAllErrors) return NULL; else vError(self, "Can't update %s when no primary key declared", iTable); sprintf(p=buf=query_buffer(iRecordLength), "UPDATE %s SET ", iTable); GO_END; for (seq=gSequence(iColList) ; si = gNext(seq) ; ) if (gType(si) != SQL_LONGVARBINARY) { if (exit) { old = gOriginalValue(si); newv = gGetValueToPut(si); } else newv = si; // any value so following test works if (newv && (!exit || !old || gCompare(old, newv))) { if (add_comma) { *p++ = ','; *p++ = ' '; n += 2; } else add_comma = 1; strcpy(p, gName(si)); strcat(p, " = "); GO_END; gFormatField(si, p); GO_END; nfields++; } } if (!nfields && exit) { free(buf); return NULL; } strcpy(p, " WHERE "); GO_END; for (add_comma=0, kseq=gSequence(pk) ; fld = gNext(kseq) ; ) { char *sf; if (add_comma) { strcpy(p, " AND "); GO_END; } else add_comma = 1; strcpy(p, sf=gStringValue(fld)); strcat(p, " = "); GO_END; gFormatOrgField(gFindValueStr(iCols, sf), p); GO_END; } return buf; } private imeth void audit_update() { char *fn, *buf=NULL, *buf2=NULL, *p; object seq, si, stmt=NULL, pk, kseq, fld, old, newv; object auditList = iFH_Tables ? gFindValueStr(iFH_Tables, iTable) : NULL; int exit = 1; int usingSpecialAuditList = 0; if (!auditList) { auditList = iSpecialFH_Tables ? gFindValueStr(iSpecialFH_Tables, iTable) : NULL; usingSpecialAuditList = 1; } if (!auditList) return; for (seq=gSequence(iColList) ; si = gNext(seq) ; ) if (gType(si) != SQL_LONGVARBINARY) { if (exit) { old = gOriginalValue(si); newv = gGetValueToPut(si); } else newv = si; // any value so following test works if (newv && (!exit || !old || gCompare(old, newv))) { char *fn; fn = gName(si); if (gFindStr(auditList, fn)) { if (!buf) { buf = query_buffer(iRecordLength); buf2 = query_buffer(iRecordLength); stmt = gNewStatement(iDatabase); for (p=buf, kseq=gSequence(gGetPrimaryKey(iDatabase, iTable)) ; fld = gNext(kseq) ; ) { gFormatFixedLengthField(gFindValueStr(iCols, gStringValue(fld)), p); for (; *p ; p++); } } if (!usingSpecialAuditList) { object now = gNow(iDatabase); gInsert(stmt, gStringValue(iFH_Table)); gFldSetString(stmt, "TableName", iTable); gFldSetChar(stmt, "ChangeType", 'C'); gFldSetString(stmt, "KeyData", buf); gChangeValue(gFldGetValue(stmt, "ChangeTime"), now); gDispose(now); gUpdate(gGetField(stmt, "ChangeTime")); gFldSetLong(stmt, "UserID", iUserID); gFldSetString(stmt, "FieldName", gName(si)); gFldSetString(stmt, "FieldValue", gFormatFixedLengthField(si, buf2)); gAddRecord(stmt); } else { if (iSpecialAuditHandler) iSpecialAuditHandler(iTable, 'C', buf, iUserID, gName(si), gFormatFixedLengthField(si, buf2), self); } } } } if (stmt) gDispose(stmt); if (buf) free(buf); if (buf2) free(buf2); } imeth int gUpdateRecord() { int r; if (iLazyLoad) return 0; if (iReadOnly) { pRestoreOriginalValues(self); if (iDialogs) { object seq, dlg; for (seq = gSequence(iDialogs); dlg = gNext(seq); ) if (IsObj(dlg)) gUpdate(dlg); } return 0; } if (iTType != TYPE_SELECT) gError(Object, "gUpdateRecord without Select"); // if (iDataSync && iTP) if (!gFieldsChanged(self)) return 0; if (iDBMS == DBMS_ACCESS) updateFields(iv); if (iVarTextChanged) pUpdateVarText(self); if (1 || iDBMS == DBMS_SYBASE || iDBMS == DBMS_MYSQL || iDBMS == DBMS_MSSQL || iDBMS == DBMS_WATCOM && gDBMS_version(iDatabase) > 6.9) { char *buf = make_update(self, 1); object stmt = gStatement(iDatabase); int ds = gEnableTP(stmt, 0); int ro = gIsReadOnly(stmt); int rae = gReturnAllErrors(stmt, 1); if (ro) gEnableWrites(stmt); if (buf) { r = gExecute(stmt, buf); if (r) { strcpy(iInternalState, gGetErrorState(stmt)); iInternalNativeCode = gGetNativeErrorCode(stmt); } free(buf); } else r = 0; gEnableTP(stmt, ds); if (ro) gDisableWrites(stmt); gReturnAllErrors(stmt, rae); } else { char *p; BEGIN_LOG(); r = SQL_UPDATE_RECORD(iStmt, 1); END_LOG(); if (cLFP) { char * t; p = make_update(self, 0); PRINT_LOG("gUpdateRecord", t=fix_statement(p, iDBMS), p); if (p) free(p); free(t); } } if (r && pTrapError(self, iErrors, r)) { if (iVarTextChanged) pUndoVarText(self); if (iIgnoreAllErrors) return 0; else vError(self, "gUpdateRecord"); } if (iDataSync && iTP) gTPChange(iTP, self); if (!r) { cursor_write(self, iPos - 1); if (iFH_Tables) audit_update(self); updateOrgValues(self); } return r; } #if 0 #define istart(x) (isalpha(x)) #define irest(x) (isalnum(x) || (x) == '_') static char *parse_insert(char *cmd, char *field) { if (!strnicmp("insert", cmd, 6)) while (*cmd && *cmd != '(') cmd++; while (*cmd && !istart(*cmd) && *cmd != ')') cmd++; if (!*cmd || *cmd == ')') return NULL; while (irest(*cmd)) *field++ = *cmd++; *field = '\0'; return cmd; } //imeth int gAssociateCol(char *cname, void *field, SWORD type, int sz) { object f; RETCODE r; SDWORD len; if (iTType == TYPE_NONE || !iCols) return -1; f = gFindValueStr(iCols, cname); if (!f) return -2; if (iTType == TYPE_SELECT) return SQLBindCol(iStmt, (UWORD) gShortValue(f), type, field, (SDWORD) sz, NULL); else if (iTType == TYPE_INSERT) { UWORD i = gShortValue(f); SWORD stype; UDWORD prec; SWORD scale; r = SQLDescribeParam(iStmt, i, &stype, &prec, &scale, NULL); if (r) return r; if (type == SQL_C_CHAR) len = SQL_NTS; else len = 0; #if ODBCVER < 0x0200 return SQLSetParam(iStmt, i, type, stype, prec, scale, field, &len); #else return SQLBindParameter(iStmt, i, SQL_PARAM_INPUT, type, stype, prec, scale, field, 0, &len); #endif } } #endif imeth int gEndSQL() { RETCODE r; if (iDialogs) { object seq, dlg; for (seq = gSequence(iDialogs); dlg = gNext(seq); ) pUnattachDialog(self, dlg, 0); iDialogs = gDispose(iDialogs); } if (iCursorFile) iCursorFile = gDispose(iCursorFile); iRecordsRead = 0; iRecordLength = 0; iDoneFirst = 0; iPos = 0; iEof = -1; iLazyLoad = 0; iOracleSQLStatistics = 0; if (iLazyStatement) iLazyStatement = gDispose(iLazyStatement); if (iTType == TYPE_INSERT) { r = SQLTransact(gHENV(iDatabase), gHDBC(iDatabase), SQL_COMMIT); SQLFreeStmt(iStmt, SQL_RESET_PARAMS); } if (!iStmtAlreadyClosed) { r = SQLFreeStmt(iStmt, SQL_CLOSE); if (iTType == TYPE_SELECT) SQLFreeStmt(iStmt, SQL_UNBIND); } else iStmtAlreadyClosed = 0; if (iCols) iCols = gDispose(iCols); if (iColList) iColList = gDeepDispose(iColList); if (iTableList) iTableList = gDeepDispose(iTableList); iTType = TYPE_NONE; *iTable = '\0'; iVarTextChanged = 0; iErrorState = 0; *iInternalState = '\0'; return r; } imeth int gNextRecord() { UDWORD crow; int r=0; LAZY_LOAD; if (iErrorState) return 1; if (iTType != TYPE_SELECT) gError(Object, "gNextRecord without Select"); *iInternalState = '\0'; if (iPos >= iRecordsRead) { if (iDBMS == DBMS_MSSQL || iOracleSQLStatistics) r = SQL_NO_DATA_FOUND; else do { r = SQLFetch(iStmt); } while (!r && iRecordTestFunction && !iRecordTestFunction(self)); if (r && r != SQL_NO_DATA_FOUND && pTrapError(self, iErrors, r)) if (iIgnoreAllErrors) return 1; else vError(self, "gNextRecord"); if (!r) { cursor_write(self, iPos++); iEof = 0; updateOrgValues(self); } else { if (!iEof) iPos++; iEof = 1; } } else { cursor_read(self, iPos++); iEof = 0; updateOrgValues(self); } return r; } imeth int gPrevRecord() { UDWORD crow; int r=0; if (iErrorState) return 1; if (iTType != TYPE_SELECT) gError(Object, "gPrevRecord without Select"); if (iPos <= 1) { iPos = 0; return SQL_NO_DATA_FOUND; } cursor_read(self, iPos - 2); iPos--; updateOrgValues(self); iEof = 0; return r; } imeth int gFirstRecord() { LAZY_LOAD; if (iErrorState) return 1; if (iTType != TYPE_SELECT) gError(Object, "gFirstRecord without Select"); if (iRecordsRead) { cursor_read(self, 0); iPos = 1; updateOrgValues(self); return 0; } else return gNextRecord(self); } imeth int gLastRecord() { UDWORD crow; int r=0; LAZY_LOAD; if (iErrorState) return 1; if (iTType != TYPE_SELECT) return -1; gError(Object, "gLastRecord is not implemented."); return r; } imeth int gRereadRecord() { if (iErrorState) return 1; if (iTType != TYPE_SELECT) gError(Object, "gRereadRecord without Select"); if (!iPos) gError(Object, "gReadRecord when no record originally read."); cursor_read(self, iPos-1); updateOrgValues(self); return 0; } imeth int gSetAbsPos(long pos) // pos is one origin { UDWORD crow; int r=0; LAZY_LOAD; if (iErrorState) return 1; if (iTType != TYPE_SELECT) gError(Object, "gSetAbsPos without Select"); if (pos <= iRecordsRead) { cursor_read(self, (int) pos - 1); iPos = pos; } else { iPos = iRecordsRead; while (pos > iPos && !r) { if (iDBMS == DBMS_MSSQL) r = SQL_NO_DATA_FOUND; else do { r = SQLFetch(iStmt); } while (!r && iRecordTestFunction && !iRecordTestFunction(self)); if (r && r != SQL_NO_DATA_FOUND && pTrapError(self, iErrors, r)) if (iIgnoreAllErrors) return 1; else vError(self, "gSetAbsPos"); if (!r) { cursor_write(self, iPos++); iEof = 0; } else { if (!iEof) iPos++; iEof = 1; } } } if (!r) updateOrgValues(self); return r; } imeth int gSetRelPos(long pos) { return gSetAbsPos(self, iPos + pos); } imeth gDatabase() { return iDatabase; } #define QUOTE '\'' #define NORMAL_STATE 1 #define COMMENT_STATE 2 #define QUOTE_STATE 3 #define MULTICOMMENT_STATE 4 #define INSERT(x) \ { \ if (len == mx) { \ mx += 100; \ buf = Tnrealloc(char, mx, buf); \ } \ buf[len++] = x; \ } #define UN_INSERT \ { \ if (len) \ len--; \ } #define RESET ps = len = 0 #define GETC if ((c = getc(fp)) == EOF) goto end; if (c == '\n') linenum++ #define UNGETC if (c == '\n') linenum--; ungetc(c, fp) private imeth pExecuteWithErrorObj(object self, char *cmd, long linenum) { object rval = NULL; int r = gExecute(self, cmd); if (r) { char buf[25]; char *state = gGetErrorState(self); char *dberr = c_emsg(Statement); object sobj; if (!strnicmp("insert ", cmd, 7) && atoi(state) == 23000) r = 1; if (linenum > 1) sprintf(buf, "Line %ld:\n", linenum - 1); sobj = gNewWithStr(String, buf); gAppend(sobj, (object) dberr); gAppend(sobj, (object) "\n\nSQL Command: "); gAppend(sobj, (object) cmd); rval = gNewWithIntObj(IntegerAssociation, r, sobj); } return rval; } imeth int gExecuteWithError(object self, char *cmd, char *errbuf, int sz, long linenum) { object rval = pExecuteWithErrorObj(self, cmd, linenum); int r = 0; if (rval) { object sobj = gValue(rval); r = gIntKey(rval); if (gSize(sobj) >= sz) gTake(sobj, sz - 1); strcpy(errbuf, gStringValue(sobj)); gDeepDispose(rval); } return r; } // errormode: 0 = error out of system // 1 = stop processing and return single error data // 2 = continue processing and return list of errors private imeth object pExecuteFile(object self, char *file, int errormode) { object rval = NULL; int pig; FILE *fp; char *buf; int len=0, mx=100, c, state = NORMAL_STATE, res = 0; int ps = 0; /* previous space */ int nesting = 0; /* level of comments */ char file2[80]; object tmp; char gobuf[3]; int gbi = 0; /* index into gobuf */ long linenum = 1; strcpy(file2, file); fp = fopen(file2, "r"); if (!fp) { sprintf(file2, "%s.sql", file); fp = fopen(file2, "r"); if (!fp) { switch (errormode) { case 2: rval = gNew(LinkObject); gAddLast(rval, gNewWithIntObj(IntegerAssociation, -1, vSprintf(String, "Can't open \"%s\".", file))); break; case 1: rval = gNewWithIntObj(IntegerAssociation, -1, vSprintf(String, "Can't open \"%s\".", file)); break; default: rval = gNewWithLong(LongInteger, -1L); break; return rval; } } } if (errormode) pig = gReturnAllErrors(self, 1); buf = Tnalloc(char, mx); while (!res) { GETC; switch (state) { case NORMAL_STATE: if (c == ';') { // INSERT(c); INSERT('\0'); switch (errormode) { case 2: tmp = pExecuteWithErrorObj(self, buf, linenum); if (tmp) { if (!rval) rval = gNew(LinkObject); gAddLast(rval, tmp); } break; case 1: rval = pExecuteWithErrorObj(self, buf, linenum); if (rval) res = gIntKey(rval); break; default: res = gExecute(self, buf); break; } RESET; gbi = 0; } else if (c == QUOTE) { ps = 0; INSERT(c); state = QUOTE_STATE; gbi = 0; } else if (c == '-') { GETC; gbi = 0; if (c == '-') state = COMMENT_STATE; else { ps = 0; UNGETC; INSERT('-'); } } else if (c == '{') { gbi = 0; nesting = 1; state = MULTICOMMENT_STATE; } else if (c == ' ' || c == '\t' || c == '\r' || c == '\n') { if (gbi == 2 && tolower(gobuf[0]) == 'g' && tolower(gobuf[1]) == 'o') { UN_INSERT; UN_INSERT; INSERT('\0'); switch (errormode) { case 2: tmp = pExecuteWithErrorObj(self, buf, linenum); if (tmp) { if (!rval) rval = gNew(LinkObject); gAddLast(rval, tmp); } break; case 1: rval = pExecuteWithErrorObj(self, buf, linenum); if (rval) res = gIntKey(rval); break; default: res = gExecute(self, buf); break; } RESET; } else if (!ps && len) { ps = 1; INSERT(' '); } gbi = 0; #if 0 } else if (isalpha(c)) { char word[80]; int i = 0; do { word[i++] = c; GETC; } while (isalnum(c)); UNGETC; word[i] = '\0'; if (iDBMS == DBMS_SYBASE) { if (!stricmp(word, "date")) strcpy(word, "datetime"); } ps = 0; for (i=0 ; word[i] ; i++) INSERT(word[i]); #endif } else { ps = 0; if (!isalnum(c)) gbi = 0; else if (gbi < 3) gobuf[gbi++] = c; INSERT(c); } break; case COMMENT_STATE: if (c == '\n') state = NORMAL_STATE; break; case QUOTE_STATE: INSERT(c); if (c == QUOTE) { GETC; if (c != QUOTE) { UNGETC; state = NORMAL_STATE; } else INSERT(c); } break; case MULTICOMMENT_STATE: if (c == '}') { if (!--nesting) state = NORMAL_STATE; } else if (c == '{') nesting++; break; } } end: if (!res && gbi == 2 && tolower(gobuf[0]) == 'g' && tolower(gobuf[1]) == 'o') { UN_INSERT; UN_INSERT; INSERT('\0'); switch (errormode) { case 2: tmp = pExecuteWithErrorObj(self, buf, linenum); if (tmp) { if (!rval) rval = gNew(LinkObject); gAddLast(rval, tmp); } break; case 1: rval = pExecuteWithErrorObj(self, buf, linenum); if (rval) res = gIntKey(rval); break; default: res = gExecute(self, buf); break; } } free((void*)buf); fclose(fp); if (errormode) gReturnAllErrors(self, pig); gEndSQL(self); return rval; } imeth int gExecuteFile(char *file) { object tmp = pExecuteFile(self, file, 0); int rval = !!tmp; if (tmp) gDeepDispose(tmp); return rval; } imeth int gExecuteFileWithError(char *file, char *errbuf, int sz) { object tmp = pExecuteFile(self, file, 1); int rval = tmp ? gIntKey(tmp) : 0; object sobj = tmp ? gValue(tmp) : NULL; if (errbuf) { *errbuf = '\0'; if (sobj) { if (gSize(sobj) >= sz) gTake(sobj, sz - 1); strcpy(errbuf, gStringValue(sobj)); } } if (tmp) gDeepDispose(tmp); return rval; } imeth gExecuteFileReturnAllErrors(char *file) { return pExecuteFile(self, file, 2); } imeth gAttachDialog(dlg) { object ctls; // A StringDictionary of controls object seq, i, ctl, si; char *cname; LAZY_LOAD; ctls = gControls(dlg); for (seq = gSequence(ctls) ; i = gNext(seq) ; ) { ctl = gValue(i); if (!gAutoAttach(ctl, -1)) continue; cname = gName(ctl); if (!cname || !*cname) continue; si = gFindValueStr(iCols, lcname(cname)); if (si) { static object tc; if (!tc) tc = gFindClass(Class, "TextControl"); gAttach(ctl, gGetValue(si)); if (ClassOf(ctl) == tc) { if (!gGetMinLength(ctl) && gAllowNulls(si) == SQL_NO_NULLS) gTextRange(ctl, 1, -gSize(si)); else gMaxLength(ctl, -gSize(si)); } gSetSI(ctl, si); } } if (!iDialogs) iDialogs = gNew(LinkObject); gAddLast(iDialogs, dlg); return self; } imeth gUnattachDialog(dlg) { return pUnattachDialog(self, dlg, 1); } imeth gAssociateCtl(char *cname, ctl) { object si; static object tc; LAZY_LOAD; if (!tc) tc = gFindClass(Class, "TextControl"); si = gFindValueStr(iCols, lcname(cname)); if (!si) return NULL; gAttach(ctl, gGetValue(si)); if (ClassOf(ctl) == tc) { if (!gGetMinLength(ctl) && gAllowNulls(si) == SQL_NO_NULLS) gTextRange(ctl, 1, -gSize(si)); else gMaxLength(ctl, -gSize(si)); } gSetSI(ctl, si); return self; } imeth int gDBMS_type() { return iDBMS; } imeth int gSelectColumns(char *tname, char *oname) { RETCODE r; static char err[] = "gSelectColumns::Statement Error"; char *to = pGetOwnerName(self, oname); gEndSQL(self); gEnterCriticalSection(iDatabase); switch (iDBMS) { case DBMS_MSSQL: return pSelectMSSQLColumns(self, tname, oname, 0); break; } iUseCursors = 1; r = SQLColumns(iStmt, NULL, 0, to, (SWORD) (to ? SQL_NTS : 0), tname, SQL_NTS, NULL, 0); if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) vError(self, err); r = !r || r == SQL_SUCCESS_WITH_INFO ? bindCols(self, err): -1; gLeaveCriticalSection(iDatabase); return r; } imeth int gSelectColumnsByName(char *tname, char *oname) { RETCODE r; static char err[] = "gSelectColumns::Statement Error"; char *to = pGetOwnerName(self, oname); gEndSQL(self); gEnterCriticalSection(iDatabase); switch (iDBMS) { case DBMS_WATCOM: return pSelectWATCOMColumns(self, tname, oname, 1); break; case DBMS_MSSQL: return pSelectMSSQLColumns(self, tname, oname, 1); break; } r = SQLColumns(iStmt, NULL, 0, to, (SWORD) (to ? SQL_NTS : 0), tname, SQL_NTS, NULL, 0); if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) vError(self, err); r = !r || r == SQL_SUCCESS_WITH_INFO ? bindCols(self, err): -1; gLeaveCriticalSection(iDatabase); return r; } /* We have a MSSQL specific select for this here because Microsoft will auto-generate tables (ie: dtproperties) that will show up as a user table, even though we didn't create it. The select in pSelectMSSQLTables only brings back tables we created. */ private imeth int pSelectMSSQLTables(object self, char *oname) { char *cmd = "select TABLE_QUALIFIER = convert(sysname,db_name()), " "TABLE_CAT = convert(sysname,db_name()), " "TABLE_OWNER = convert(sysname,user_name(o.uid)), " "TABLE_SCHEM = convert(sysname,user_name(o.uid)), " "TABLE_NAME = convert(sysname,o.name), " "TABLE_TYPE = case when objectproperty(id, 'IsUserTable') = 1 " "and objectproperty(id, 'IsMSShipped') = 0 then 'TABLE' " "when objectproperty(id, 'IsView') = 1 then 'VIEW' " "else 'SYSTEM TABLE' END, " "REMARKS = convert(varchar(254),null) " "from sysobjects o " "where objectproperty(id, 'IsView') = 1 " "or objectproperty(id, 'IsTable') = 1 %s" "order by TABLE_SCHEM, TABLE_QUALIFIER, TABLE_CAT, TABLE_OWNER"; char where[256], ecmd[1024]; if (oname && *oname) sprintf(where, "and user_name(o.uid) = '%s' ", oname); else *where = '\0'; sprintf(ecmd, cmd, where); return SQLExecDirect(iStmt, ecmd, SQL_NTS); } imeth int gSelectTables(char *oname) { RETCODE r; static char err[] = "gSelectTables::Statement Error"; char *to = pGetOwnerName(self, oname); gEndSQL(self); iUseCursors = 1; gEnterCriticalSection(iDatabase); if (iDBMS == DBMS_MSSQL) r = pSelectMSSQLTables(self, oname); else r = SQLTables(iStmt, NULL, 0, to, (SWORD) (to ? SQL_NTS : 0), NULL, 0, "TABLE", SQL_NTS); if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) vError(self, err); if (!r || r == SQL_SUCCESS_WITH_INFO) { r = bindCols(self, err); if (iDBMS == DBMS_MSSQL) { int r=0; while (!r) { r = SQLFetch(iStmt); if (!r) cursor_write(self, iPos++); } if (r != SQL_NO_DATA_FOUND && !iIgnoreAllErrors) vError(self, "gDBSelect cursor load"); SQLFreeStmt(iStmt, SQL_CLOSE); SQLFreeStmt(iStmt, SQL_UNBIND); iStmtAlreadyClosed = 1; if (r == SQL_NO_DATA_FOUND) iPos = 0; else if (iIgnoreAllErrors) { gLeaveCriticalSection(iDatabase); return 0; } } gLeaveCriticalSection(iDatabase); return r; } else { gLeaveCriticalSection(iDatabase); return -1; } } imeth gColumns() { return iColList; } imeth gTables() { return iTableList; } imeth gColumnDictionary() { return iCols; } private imeth int pTrapError(object self, object es, int err) { object eo; int r; if (iReturnAllErrors) return 0; if (!es) return 1; eo = gNewWithInt(ShortInteger, err); r = !gFind(es, eo); gDispose(eo); return r; } imeth gReturnError(int err) { object eo, ret; if (!iErrors) iErrors = gNew(Set); eo = gNewWithInt(ShortInteger, err); ret = gAdd(iErrors, eo); if (!ret) gDispose(eo); return self; } static void replace(char *str, char *from, char *to) { int flen = strlen(from); int tlen = strlen(to); int slen = strlen(str) + 1; if (flen != tlen) { memmove(str, str+flen, slen = slen - flen); memmove(str+tlen, str, slen); } memcpy(str, to, tlen); } #define CH '~' static char *fix_statement(char *s, int dbms) { int inquote = 0, len; static int mlen = 0; static char *buf; char *b; object tmpString; int i; char tmpBuf[16]; char *t=malloc(strlen(s) * 2);//Don't change s! Strcpy(t,s); s=t; b=s; while (*s) { while (*s && *s != CH) if (inquote) { if (*s == QUOTE) if (s[1] == QUOTE) s += 2; else { s++; inquote = 0; } else s++; } else if (*s == QUOTE) { s++; inquote = 1; } else if (isalpha(*s)) { char word[80], *start = s; int i = 0; while (isalnum(*s) || *s == '_') { *s = tolower(*s);// Sybase server has mixed case only so we'll downcase everything word[i++] = *s++; } word[i] = '\0'; if (dbms == DBMS_SYBASE) { if (!stricmp(word, "date")) replace(start, "date", "datetime"); } } else ++s; if (*s == CH) { *s++ = QUOTE; for ( ; *s && *s != CH ; s++) if (*s == QUOTE) { ++s; memmove(s+1, s, strlen(s)+1); *s = QUOTE; } if (*s == CH) *s++ = QUOTE; } } if (dbms == DBMS_ORACLE) return TranslateToOracle(b); return b; } imeth gCopyCorresponding(from) { ivType *iv2; object seq, node, si, si2; char *cname; object fromCols; // ChkArgTyp(from, 2, CLASS); LAZY_LOAD; if (gDoLazyLoad(from)) vError(self, "LazySelect Error"); // iv2 = ivPtr(from); // if (!iv2->iCols) // return NULL; if (!(fromCols=gColumnDictionary(from))) return NULL; for (seq=gSequence(iCols) ; node=gNext(seq) ; ) { si = gValue(node); if (gType(si) != SQL_LONGVARBINARY) { cname = gStringKey(node); // si2 = gFindValueStr(iv2->iCols, cname); si2 = gFindValueStr(fromCols, cname); if (si2) { char *vttbl = pGetVarTextTable(self, si, cname); char *vttbl2 = gGetVarTextTable2(from, si2, cname); if (vttbl && vttbl2) pFldSetVarText(self, si, cname, gFldGetVarText(from, si2, cname, vttbl2), vttbl); else if (!vttbl && !vttbl2) gCopyCorresponding(si, si2); } } } return self; } ivmeth int vDBSelect, vExecuteWithBind, vDBSelectDNC (char *fmt, ...) { char *buf = Tnalloc(char, BUF_SIZE); int r; MAKE_REST(fmt); vsprintf(buf, fmt, _rest_); r = gExecuteWithBind(self, buf); free(buf); return r; } ivmeth int vLazyDBSelect, vLazyExecuteWithBind (ifun fun, char *fmt, ...) { char *buf = Tnalloc(char, BUF_SIZE); int r; MAKE_REST(fmt); vsprintf(buf, fmt, _rest_); r = gLazyDBSelect(self, fun, buf); free(buf); return r; } ivmeth int vDBSelectOne, vDBSelectOneDNC (char *fmt, ...) { char *buf = Tnalloc(char, BUF_SIZE); int r; MAKE_REST(fmt); vsprintf(buf, fmt, _rest_); r = gDBSelectOne(self, buf); free(buf); return r; } ivmeth int vLazyDBSelectOne(ifun fun, char *fmt, ...) { char *buf = Tnalloc(char, BUF_SIZE); int r; MAKE_REST(fmt); vsprintf(buf, fmt, _rest_); r = gLazyDBSelectOne(self, fun, buf); free(buf); return r; } ivmeth int vExecute(char *fmt, ...) { char *buf = Tnalloc(char, BUF_SIZE); int r; MAKE_REST(fmt); vsprintf(buf, fmt, _rest_); r = gExecute(self, buf); free(buf); return r; } imeth char *gName() { return iTable; } imeth gSetTag(tag) { object ptag = iTag; iTag = tag; if (ptag && iAutoDisposeTag) return gDeepDispose(ptag); else return ptag; } imeth gGetTag() { return iTag; } imeth int gSelectPrimaryKeyFields(char *table, char *oname) { char ostr[256]; gEndSQL(self); switch (iDBMS) { case DBMS_WATCOM: return pSelectWATCOMPrimaryKeyFields(self, table, oname); case DBMS_SYBASE: case DBMS_MSSQL: if (oname && *oname) sprintf(ostr, ", '%s'", oname); else *ostr = '\0'; if (vExecuteWithBind(self, "sp_pkeys '%s'%s", table, ostr)) return 1; if (gNextRecord(self)) return 1; gPrevRecord(self); // so next gNextRecord reads the first record return 0; case DBMS_MYSQL: return pSelectMYSQLIndexes(self, table, oname); case DBMS_ORACLE: return pSelectORACLEPrimaryKeyFields(self, table, oname); } return 1; } private imeth int pSelectMYSQLIndexes(object self, char *table, char *oname) { char buf[128]; sprintf(buf, "show index from %s", table); return gDBSelect(self, buf); } private imeth int pSelectORACLEPrimaryKeyFields(object self, char *table, char *oname) { RETCODE r; static char err[] = "gSelectPrimaryKeys::Statement Error"; char *to = pGetOwnerName(self, oname); gEndSQL(self); iUseCursors = 1; r = SQLPrimaryKeys(iStmt, NULL, 0, to, (SWORD) (to ? SQL_NTS : 0), table, SQL_NTS); if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) vError(self, err); if (!r || r == SQL_SUCCESS_WITH_INFO) { return bindCols(self, err); } else return -1; } private imeth int pSelectWATCOMPrimaryKeyFields(object self, char *table, char *oname) { char jstr[256] = ""; char ostr[512] = ""; char onstr[256] = ""; char *cmd; if (oname && *oname) { object eo, ret; if (!iErrors) iErrors = gNew(Set); eo = gNewWithInt(ShortInteger, SQL_ERROR); ret = gAdd(iErrors, eo); if (!ret) gDispose(eo); if (!gDBSelectOne(self, "select * from sysuserperm")) { strcpy(jstr, "join sysuserperm on sysuserperm.user_id = systable.creator "); sprintf(ostr, "and sysuserperm.user_name = '%s' ", oname); } if (ret) gDeepDisposeObj(iErrors, eo); sprintf(onstr, ", '%s'", oname); } cmd = "select table_name, column_name from SYSINDEX join SYSIXCOL " "on SYSINDEX.table_id = SYSIXCOL.table_id and " "SYSINDEX.index_id = SYSIXCOL.index_id join SYSCOLUMN " "on SYSCOLUMN.table_id = SYSINDEX.table_id and " "SYSCOLUMN.column_id = SYSIXCOL.column_id " "join systable on systable.table_id = sysindex.table_id %s" "where SYSINDEX.index_Name = 'PK_%s' %s" "order by SYSIXCOL.sequence"; if (vDBSelectOne(self, cmd, jstr, table, ostr)) { if (vExecuteWithBind(self, "sp_pkeys '%s'%s", table, onstr)) return 1; if (gNextRecord(self)) return 1; gPrevRecord(self); // so next gNextRecord reads the first record return 0; } return vDBSelect(self, cmd, jstr, table, ostr); } imeth int gSelectReferencedBy(char *table, char *oname) { char ostr[256]; gEndSQL(self); switch (iDBMS) { case DBMS_WATCOM: return pSelectWATCOMReferencedBy(self, table, oname); break; case DBMS_MSSQL: if (oname && *oname) sprintf(ostr, ", '%s'", oname); else *ostr = '\0'; if (vExecuteWithBind(self, "sp_fkeys '%s'%s", table, ostr)) return 1; if (gNextRecord(self)) return 1; return vExecuteWithBind(self, "sp_fkeys '%s'%s", table, ostr); break; } return 1; } private imeth int pSelectWATCOMReferencedBy(object self, char *table, char *oname) { char ostr[512]; char *cmd; if (oname && *oname) sprintf(ostr, "and sysuserperm.user_name = '%s' ", oname); else *ostr = '\0'; cmd = "select sysforeignkey.role as fk_name, foreigntbl.table_name as fktable_name, " "reftbl.table_name as pktable_name, foreignsc.column_name as fkcolumn_name, " "primarysc.column_name as pkcolumn_name from sysfkcol join sysforeignkey " "on sysfkcol.foreign_table_id = sysforeignkey.foreign_table_id and " "sysfkcol.foreign_key_id = sysforeignkey.foreign_key_id " "join systable as foreigntbl on foreigntbl.table_id = sysforeignkey.foreign_table_id " "join systable as reftbl on reftbl.table_id = sysforeignkey.primary_table_id " "join syscolumn as primarysc on primarysc.table_id = sysforeignkey.primary_table_id " "and primarysc.column_id = sysfkcol.primary_column_id " "join syscolumn as foreignsc on foreignsc.table_id = sysforeignkey.foreign_table_id " "and foreignsc.column_id = sysfkcol.foreign_column_id " "join sysuserperm on sysuserperm.user_id = foreigntbl.creator " "where reftbl.table_name = '%s' %s" "order by fk_name, fktable_name, foreignsc.column_id"; if (vDBSelectOne(self, cmd, table, ostr)) return 1; return vDBSelect(self, cmd, table, ostr); } imeth int gSelectForeignKeys(char *table, char *oname) { char ostr[256]; gEndSQL(self); switch (iDBMS) { case DBMS_WATCOM: return pSelectWATCOMForeignKeys(self, table, oname); break; case DBMS_MSSQL: if (oname && *oname) sprintf(ostr, ", '%s'", oname); else *ostr = '\0'; if (vExecuteWithBind(self, "sp_fkeys null, null, null, '%s'%s", table, ostr)) return 1; if (gNextRecord(self)) return 1; return vExecuteWithBind(self, "sp_fkeys null, null, null, '%s'%s", table, ostr); break; } return 1; } private imeth int pSelectWATCOMForeignKeys(object self, char *table, char *oname) { char ostr[512]; char *cmd; if (oname && *oname) sprintf(ostr, "and sysuserperm.user_name = '%s' ", oname); else *ostr = '\0'; cmd = "select sysforeignkey.role as fk_name, foreigntbl.table_name as fktable_name, " "reftbl.table_name as pktable_name, foreignsc.column_name as fkcolumn_name, " "primarysc.column_name as pkcolumn_name from sysfkcol join sysforeignkey " "on sysfkcol.foreign_table_id = sysforeignkey.foreign_table_id and " "sysfkcol.foreign_key_id = sysforeignkey.foreign_key_id " "join systable as foreigntbl on foreigntbl.table_id = sysforeignkey.foreign_table_id " "join systable as reftbl on reftbl.table_id = sysforeignkey.primary_table_id " "join syscolumn as primarysc on primarysc.table_id = sysforeignkey.primary_table_id " "and primarysc.column_id = sysfkcol.primary_column_id " "join syscolumn as foreignsc on foreignsc.table_id = sysforeignkey.foreign_table_id " "and foreignsc.column_id = sysfkcol.foreign_column_id " "join sysuserperm on sysuserperm.user_id = foreigntbl.creator " "where foreigntbl.table_name = '%s' %s" "order by fk_name, fktable_name, foreignsc.column_id"; if (vDBSelectOne(self, cmd, table, ostr)) return 1; return vDBSelect(self, cmd, table, ostr); } imeth int gSelectIndexes(char *table, char *oname) { gEndSQL(self); switch (iDBMS) { case DBMS_WATCOM: return pSelectWATCOMIndexes(self, table, oname); break; case DBMS_MSSQL: return pSelectMSSQLIndexes(self, table, oname); break; } return 1; } private imeth int pSelectWATCOMIndexes(object self, char *table, char *oname) { char ostr[512]; char *cmd; if (oname && *oname) sprintf(ostr, "and ixtable_owner = '%s' ", oname); else *ostr = '\0'; cmd = "select systable.table_name as ixtable_name, " "sysuserperm.user_name as ixtable_owner, " "sysindex.index_name ix_name, sysixcol.\"order\" ix_order, " "substr('NYY', locate('NUY', sysindex.\"unique\"), 1) ix_unique, " "syscolumn.column_name as ixcolumn_name from systable " "join sysindex on systable.table_id = sysindex.table_id " "join sysixcol on sysindex.table_id = sysixcol.table_id and " "sysixcol.index_id = sysindex.index_id " "join syscolumn on syscolumn.table_id = sysixcol.table_id and " "syscolumn.column_id = sysixcol.column_id " "join sysuserperm on sysuserperm.user_id = systable.creator " "where systable.table_name = '%s' and ix_name <> 'PK_%s' %s" "order by ixtable_name, ix_name, sysixcol.sequence"; if (vDBSelectOne(self, cmd, table, table, ostr)) return 1; return vDBSelect(self, cmd, table, table, ostr); } private imeth int pSelectMSSQLIndexes(object self, char *table, char *oname) { char ostr[512]; char *cmd; if (oname && *oname) sprintf(ostr, "and u.name = '%s' ", oname); else *ostr = '\0'; cmd = "select ixtable_name = convert(varchar(32),o.name), " "ixcolumn_name = convert(varchar(32),c.name), " "ix_sequence = convert(smallint,c1.colid), " "ix_unique = SUBSTRING('NNY', (i.status & 2) + 1, 1), " "ix_name = convert(varchar(32),i.name), 'A' ix_order, " "ixtable_owner = convert(varchar(32), user_name(o.uid)) " "from sysindexes i, syscolumns c, sysobjects o, syscolumns c1, sysusers u " "where o.id = object_id('%s') and o.id = c.id and o.id = i.id " "and c.name = index_col (o.name, i.indid, c1.colid) and u.uid = o.uid " "and c1.colid <= i.keycnt and c1.id = object_id('loan_main') " "and indexproperty(o.id, i.name, 'IsAutoStatistics') = 0 " "and indexproperty(o.id, i.name, 'IsStatistics') = 0 and i.indid > 1 %s" "order by ixtable_name, ix_name, ix_sequence"; if (vDBSelectOne(self, cmd, table, ostr)) return 1; return vDBSelect(self, cmd, table, ostr); } imeth int gSelectTriggers(char *table, char type, char *oname) { gEndSQL(self); switch (iDBMS) { case DBMS_WATCOM: return pSelectWATCOMTriggers(self, table, type, oname); break; case DBMS_MSSQL: return pSelectMSSQLTriggers(self, table, type, oname); break; } return 1; } private imeth int pSelectWATCOMTriggers(object self, char *table, char type, char *oname) { char ostr[512]; char *cmd; if (oname && *oname) sprintf(ostr, "and trtable_owner = '%s' ", oname); else *ostr = '\0'; cmd = "select o.table_name trtable_name, u.user_name trtable_owner, " "t.trigger_name tr_name, t.event trevent_type, " "t.trigger_defn tr_text, t.trigger_order tr_order " "from systable o join systrigger t on o.table_id = t.table_id " "join sysuserperm u on o.creator = u.user_id " "where o.table_name = '%s' and t.event = '%c' %s" "order by o.table_name, t.event"; if (vDBSelectOne(self, cmd, table, type, ostr)) return 1; return vDBSelect(self, cmd, table, type, ostr); } private imeth int pSelectMSSQLTriggers(object self, char *table, char type, char *oname) { char *tfld; char ostr[512]; char *cmd; if (oname && *oname) sprintf(ostr, "and u.name = '%s' ", oname); else *ostr = '\0'; cmd = "select o.name trtable_name, '%s_%c' tr_name, " "'%c' trevent_type, c.colid tr_order, c.text tr_text, " "user_name(o.uid) trtable_owner " "from sysobjects o join syscomments c on c.id = %s " "join sysusers u on o.uid = u.uid " "where o.name = '%s' %s" "order by c.colid"; switch (type) { case 'I': // Insert case 'i': tfld = "o.instrig"; break; case 'D': // Delete case 'd': tfld = "o.deltrig"; break; case 'U': // Update case 'u': tfld = "o.updtrig"; break; default: return 1; break; } if (vDBSelectOne(self, cmd, table, type, type, tfld, table, ostr)) return 1; return vDBSelect(self, cmd, table, type, type, tfld, table, ostr); } private imeth int pSelectWATCOMColumns(object self, char *table, char *oname, int byname) { char ostr[512]; char *cmd; char *order = byname ? "order by table_owner, table_name, column_name" : ""; if (oname && *oname) sprintf(ostr, "and u.user_name like '%s' ", oname); else *ostr = '\0'; cmd = "select current database table_qualifier, " "u.user_name table_owner, " "table_name, " "column_name, " "d.type_id data_type, " "ifnull(c.user_type,d.domain_name, " "(select type_name from SYS.SYSUSERTYPE " "where type_id=c.user_type)) type_name, " "isnull(d.\"precision\",width) \"precision\", " "width length, " "scale, " "if locate(d.domain_name,'char')=0 " "and locate(d.domain_name,'binary')=0 " "and locate(d.domain_name,'time')=0 " "and locate(d.domain_name,'date')=0 then " "10 else null endif radix, " "if nulls='Y' then 1 else 0 endif nullable, " "null remarks, " "c.domain_id ss_data_type, " "column_id colid " "from SYS.SYSCOLUMN as c,SYS.SYSTABLE as t,SYS.SYSDOMAIN as d " ",SYS.SYSUSERPERMS as u " "where c.table_id=t.table_id " "and t.table_name like '%s' " "and t.creator=u.user_id %s" "and c.domain_id=d.domain_id %s"; if (vDBSelectOne(self, cmd, table, ostr, order)) return 1; return vDBSelect(self, cmd, table, ostr, order); } private imeth int pSelectMSSQLColumns(object self, char *table, char *oname, int byname) { long tid; char ostr[512]; char *cmd; char *order = byname ? "order by table_owner, table_name, column_name" : "order by 17"; float ver = gDBMS_version(iDatabase); if (oname && *oname) sprintf(ostr, "and u.name = '%s' ", oname); else *ostr = '\0'; if (ver >= 7.00) cmd = "SELECT TABLE_QUALIFIER = convert(sysname,DB_NAME()), " "TABLE_OWNER = convert(sysname,USER_NAME(o.uid)), " "TABLE_NAME = convert(sysname,o.name), " "COLUMN_NAME = convert(sysname,c.name), " "d.DATA_TYPE, " "rtrim(substring('integer smallintchar varchar datetimedouble double ', " "charindex(convert (sysname,case " "when t.xusertype > 255 then t.name " "else d.TYPE_NAME end) ,'int smallintchar varchar datetimereal float '), 8)) " "TYPE_NAME, " "convert(int,case " "when d.DATA_TYPE in (6,7) then d.data_precision " "else OdbcPrec(c.xtype,c.length,c.xprec) " "end) \"PRECISION\", convert(int,case " "when type_name(d.ss_dtype) IN ('numeric','decimal') then " "OdbcPrec(c.xtype,c.length,c.xprec)+2 else isnull(d.length, c.length) end) LENGTH, " "SCALE = convert(smallint, OdbcScale(c.xtype,c.xscale)), d.RADIX, " "NULLABLE = convert(smallint, ColumnProperty (c.id, c.name, 'AllowsNull')), " "REMARKS = convert(varchar(254),null), " "COLUMN_DEF = text, " "d.SQL_DATA_TYPE, d.SQL_DATETIME_SUB, " "CHAR_OCTET_LENGTH = isnull(d.length, c.length)+d.charbin, " "ORDINAL_POSITION = convert(int,c.colid), " "IS_NULLABLE = convert(varchar(254), " "substring('NO YES',(ColumnProperty (c.id, c.name, 'AllowsNull')*3)+1,3)), " "SS_DATA_TYPE = c.type " "FROM sysobjects o, master.dbo.spt_datatype_info d, systypes t, sysusers u, syscolumns c " "LEFT OUTER JOIN syscomments m on c.cdefault = m.id AND m.colid = 1 " "WHERE o.id = %ld AND c.id = o.id AND t.xtype = d.ss_dtype " "AND c.length = isnull(d.fixlen, c.length) AND (d.ODBCVer is null or d.ODBCVer = 2) " "AND o.type <> 'P' " "AND isnull(d.AUTO_INCREMENT,0) = isnull(ColumnProperty (c.id, c.name, 'IsIdentity'),0) " "AND c.xusertype = t.xusertype %s%s"; else cmd = "SELECT TABLE_QUALIFIER = convert(varchar(32),DB_NAME()), " "TABLE_OWNER = convert(varchar(32),USER_NAME(o.uid)), " "TABLE_NAME = convert(varchar(32),o.name), " "COLUMN_NAME = convert(varchar(32),c.name), " "d.DATA_TYPE, " "rtrim(substring('integer smallintchar varchar datetimedouble double ', " "charindex(convert (varchar(30),case " "when t.usertype > 100 or t.usertype in (18,80) then t.name " "else d.TYPE_NAME end) ,'int smallintchar varchar datetimereal float '), 8)) " "TYPE_NAME, " "convert(int,case " "when d.DATA_TYPE in (6,7) then d.data_precision " "else isnull(convert(int,c.prec), 2147483647) " "end) \"PRECISION\", convert(int,case " "when d.ss_dtype IN (106, 108, 55, 63) then " "c.prec+2 else isnull(d.length, c.length) end) LENGTH, " "SCALE = convert(smallint, c.scale), d.RADIX, NULLABLE = " "convert(smallint, convert(bit, c.status&8)), " "REMARKS = convert(varchar(254),null), /* Remarks are NULL */ " "COLUMN_DEF = convert(varchar(254),substring(text,2,datalength(text)-2)), " "d.SQL_DATA_TYPE, d.SQL_DATETIME_SUB, " "CHAR_OCTET_LENGTH = isnull(convert(int,c.prec), 2147483647)+d.charbin, " "ORDINAL_POSITION = convert(int,c.colid), " "IS_NULLABLE = convert(varchar(254),rtrim(substring('NO YES',(c.status&8)+1,3))), " "SS_DATA_TYPE = c.type " "FROM syscolumns c, sysobjects o, syscomments m, sysusers u, " "master.dbo.spt_datatype_info d, systypes t " "WHERE o.id = %ld AND c.id = o.id AND t.type = d.ss_dtype and u.uid = o.uid " "AND c.length = isnull(d.fixlen, c.length) AND (d.ODBCVer is null or d.ODBCVer = 2) " "AND o.type <> 'P' AND isnull(d.AUTO_INCREMENT,0) = (c.status&128)/128 " "AND c.usertype = t.usertype AND c.cdefault *= m.id AND m.colid = 1 %s%s"; if (vDBSelectOne(self, "select id from sysobjects where name = '%s'", table)) return 1; tid = gFldGetLong(self, "id"); if (vDBSelectOne(self, cmd, tid, ostr, order)) return 1; return vDBSelect(self, cmd, tid, ostr, order); } imeth gNow() { gEndSQL(self); return gNow(iDatabase); } private imeth char *pFldGetVarText(object si, char *fld, char *vttbl) { object vtobj; gSetColVarText(si, NULL, vttbl); vtobj = gGetColVarText(si); return vtobj ? gStringValue(vtobj) : ""; } private imeth pFldSetVarText(object si, char *fld, char *str, char *vttbl) { char *cp = str ? str : ""; iVarTextChanged = 1; gSetColVarText(si, cp, vttbl); gSetNotNull(si); return self; } imeth int gEnableTP(int flg) { int old = iDataSync; iDataSync = flg; return old; } private imeth char *pGetVarTextTable(object self, object si, char *fld) { object cls = gClass(si); char *cp = NULL; if ((cls == LongInteger || cls == ShortInteger)) if (!(cp = gGetVarTextTable(iDatabase, iTable, fld)) && iTableList) { object seq, tn; for (seq=gSequence(iTableList) ; !cp && (tn = gNext(seq)) ; ) if (cp = gGetVarTextTable(iDatabase, gStringValue(tn), fld)) gDispose(seq); } return cp; } imeth char *gFldGetVarText(object si, char *fld, char *vttbl) { return pFldGetVarText(self,si,fld,vttbl); } imeth gFldSetVarText(object si, char *fld, char *str, char *vttbl) { return pFldSetVarText(self,si,fld,str,vttbl); } imeth char *gGetVarTextTable2(object self, object si, char *fld) { return pGetVarTextTable(self,si,fld); } imeth gEnableWrites() { if (!iLockEnableWrites) iReadOnly = 0; return self; } imeth int gIsReadOnly() { return iReadOnly; } imeth gDisableWrites() { if (!iLockEnableWrites) iReadOnly = 1; return self; } imeth gLockEnableWrites() { iLockEnableWrites = 1; return self; } imeth int gIgnoreAllErrors(int v) { int r = iIgnoreAllErrors; iIgnoreAllErrors = v; return r; } imeth int gReturnAllErrors(int v) { int r = iReturnAllErrors; iReturnAllErrors = v; return r; } imeth char *gLastSelect() { return iLastSelect ? gStringValue(iLastSelect) : NULL; } imeth int gGetCursorPosition() { return iPos; } cmeth int gSaveLastSelect(int mode) { int pmode = cSaveLastSelect; cSaveLastSelect = mode; return pmode; } static char *query_buffer(int reclen) { char *p = malloc(QUERY_BUFFER_SIZE+reclen); if (!p) gError(Object, "Out of memory."); return p; } cmeth gLogODBC(char *file) { if (cLFP) { fclose(cLFP); cLFP = NULL; } if (file) cLFP = fopen(file, "w"); cSeq = 0UL; #ifdef _WIN32 if (!cFreq.QuadPart) QueryPerformanceFrequency(&cFreq); #endif return self; } static void begin_log(void) { QueryPerformanceCounter(&cCount); } static void end_log(void) { QueryPerformanceCounter(&cEnd); } #if 1 static void print_log(char *fun, char *stmt, char *org) { #ifdef _WIN32 if (stmt == org || !strcmp(stmt, org)) fprintf(cLFP, "%6.3f\t%9lu\t%s\t%s | SAME\n", (double)(cEnd.QuadPart - cCount.QuadPart) / (double) cFreq.QuadPart, ++cSeq, fun, stmt); else fprintf(cLFP, "%6.3f\t%9lu\t%s\t%s | %s\n", (double)(cEnd.QuadPart - cCount.QuadPart) / (double) cFreq.QuadPart, ++cSeq, fun, stmt, org); // fflush(cLFP); #endif } #else static void print_log(char *fun, char *stmt, char *org) { #ifdef _WIN32 if (stmt == org || !strcmp(stmt, org)) fprintf(cLFP, "%s\n", stmt); else fprintf(cLFP, "%s\n", stmt); // fflush(cLFP); #endif } #endif cmeth gPrintODBCLog(char *fun, char *msg) { BEGIN_LOG(); END_LOG(); PRINT_LOG(fun, msg, msg); return self; } static char *centerStrip(char *s) { int i, j, flg; if (!s) return s; for (j = i = 0, flg = 1; s[i]; i++) if (flg) if (isspace(s[i])) j++; else flg = 0; i -= j + 1; if (j) memmove(s, s + j, i + 2); for (; i >= 0 && isspace(s[i]); i--); s[i + 1] = '\0'; return s; } static void addMSSQLCols(object idxobj, char *keys) { char *p = keys; char col[100]; char *cp, *tp; int desc; while (*p) { cp = col; while (*p && *p != ',') *cp++ = *p++; *cp = '\0'; if (*col) { if (tp = strstr(col, "(-)")) { desc = 1; *tp = '\0'; } else desc = 0; gAddStr(idxobj, lcase(centerStrip(col)), gNewWithInt(ShortInteger, desc)); } if (*p) p++; } } static object loadMSSQLColOrders(object stmt, char *tbl) { object rval = gNew(StringDictionary); object idxobj; char buf[256]; int prev = gReturnAllErrors(stmt, 1); int r; sprintf(buf, "sp_helpindex %s", tbl); r = gExecute(stmt, buf); gReturnAllErrors(stmt, prev); if (!r) { gExecuteWithBind(stmt, buf); while (!gNextRecord(stmt)) { idxobj = gNew(StringDictionary); strcpy(buf, gFldGetString(stmt, "index_name")); gAddStr(rval, lcase(buf), idxobj); addMSSQLCols(idxobj, gFldGetString(stmt, "index_keys")); } } return rval; } static object loadOracleColOrders(object stmt, char *tbl) { object rval = gNew(StringDictionary); object idxobj, tobj; char buf[256], *p, buf2[256]; int len; vDBSelect(stmt, "SELECT C.INDEX_NAME, COLUMN_NAME, COLUMN_EXPRESSION FROM USER_IND_COLUMNS C " "JOIN USER_IND_EXPRESSIONS E " "ON E.INDEX_NAME = C.INDEX_NAME " "AND E.COLUMN_POSITION = C.COLUMN_POSITION " "WHERE C.TABLE_NAME = ~%s~", tbl); while (!gNextRecord(stmt)) { strcpy(buf, gFldGetString(stmt, "index_name")); if (!(idxobj = gFindValueStr(rval, lcase(buf)))) { idxobj = gNew(StringDictionary); gAddStr(rval, buf, idxobj); } strcpy(buf, gFldGetString(stmt, "column_expression")); len = strlen(buf); if (len > 1) { buf[strlen(buf) - 1] = '\0'; p = buf + 1; } else p = buf; strcpy(buf2, gFldGetString(stmt, "column_name")); gAddStr(idxobj, lcase(buf2), gNewWithStr(String, lcase(centerStrip(p)))); } return rval; } imeth int gSQLStatistics(char *tname, char *oname) { RETCODE r; static char err[] = "gSQLStatistics::Statement Error"; char *schema = pGetOwnerName(self, oname); int dbtype = gDBMS_type(iDatabase); object colorders = NULL; char idxname[100], colname[100]; if (dbtype == DBMS_MSSQL) colorders = loadMSSQLColOrders(self, tname); else if (dbtype == DBMS_ORACLE) colorders = loadOracleColOrders(self, tname); gEndSQL(self); gEnterCriticalSection(iDatabase); iUseCursors = 1; if (dbtype == DBMS_ORACLE) { char cmd[2048], *p; sprintf(cmd, "SELECT '' AS TABLE_CAT, " "T1.TABLE_OWNER AS TABLE_SCHEM, " "T1.TABLE_NAME, " "CASE WHEN T1.UNIQUENESS = 'UNIQUE' THEN 0 ELSE 1 END AS NON_UNIQUE, " "T1.TABLE_OWNER AS INDEX_QUALIFIER, " "T1.INDEX_NAME, " "3 AS TYPE, " "T2.COLUMN_POSITION AS ORDINAL_POSITION, " "T2.COLUMN_NAME, " "CASE WHEN T2.DESCEND = 'DESC' THEN 'D' ELSE 'A' END AS ASC_OR_DESC, " "NULL AS CARDINALITY, " "NULL AS PAGES, " "NULL AS FILTER_CONDITION " "FROM USER_INDEXES T1 " "JOIN USER_IND_COLUMNS T2 " "ON T2.INDEX_NAME = T1.INDEX_NAME " "WHERE T1.TABLE_OWNER = ~%s~ AND T1.TABLE_NAME = ~%s~ " "ORDER BY T1.INDEX_NAME, T1.TABLE_OWNER, T1.TABLE_NAME, T2.COLUMN_POSITION", schema, tname); p = fix_statement(cmd, iDBMS); r = SQLExecDirect(iStmt, p, SQL_NTS); free(p); } else r = SQLStatistics(iStmt, NULL, 0, schema, (SWORD) (schema ? SQL_NTS : 0), tname, SQL_NTS, SQL_INDEX_ALL, SQL_ENSURE); if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) vError(self, err); if (!r || r == SQL_SUCCESS_WITH_INFO) { SWORD n, type, scale, nulls; UWORD i; SQLLEN prec; char cname[100]; object si; int size; float odbc_ver = gODBC_version(iDatabase); object namecol, colcol, adcol; r = SQLNumResultCols(iStmt, &n); if (r) if (iIgnoreAllErrors) { iErrorState = 1; r = -1; } else vError(self, err); iCols = gNewWithInt(StringDictionary, 101); iColList = gNew(LinkObject); iRecordLength = 0; for (i=1 ; i <= n ; i++) { r = SQLDescribeCol(iStmt, i, cname, sizeof(cname)-1, NULL, &type, &prec, &scale, &nulls); // Convert ODBC 2.0 column names to ODBC 3.0 names for consistency if (!stricmp(cname, "table_qualifier")) strcpy(cname, "table_cat"); else if (!stricmp(cname, "table_owner")) strcpy(cname, "table_schem"); else if (!stricmp(cname, "seq_in_index")) strcpy(cname, "ordinal_position"); else if (!stricmp(cname, "collation")) strcpy(cname, "asc_or_desc"); if (!r) si = gNewSelect(StatementInfo, self, iStmt, (int) i, lcase(cname), type, prec, scale, nulls, &r, iDBMS, &size); if (r || !si) if (iIgnoreAllErrors) { iErrorState = 1; if (colorders) gDeepDispose(colorders); return -1; } else vError(self, err); if (iDBMS == DBMS_MSSQL || iDBMS == DBMS_ORACLE) { if (!stricmp(cname, "asc_or_desc")) adcol = si; else if (!stricmp(cname, "index_name")) namecol = si; else if (!stricmp(cname, "column_name")) colcol = si; } gAddStr(iCols, cname, si); gAddLast(iColList, si); // if (type != SQL_GUID) iRecordLength += size; } iTType = TYPE_SELECT; // r = bindCols(self, err); if (iDBMS == DBMS_MSSQL || iDBMS == DBMS_ORACLE) { int r=0; object idxobj, colobj; iOracleSQLStatistics = (iDBMS == DBMS_ORACLE); while (!r) { r = SQLFetch(iStmt); if (!r) { gToLower(gGetValue(namecol)); gToLower(gGetValue(colcol)); strcpy(idxname, gStringValue(gStripRight(gGetValue(namecol)))); strcpy(colname, gStringValue(gStripRight(gGetValue(colcol)))); if (iDBMS == DBMS_MSSQL && namecol && colcol && adcol && (idxobj = gFindValueStr(colorders, lcase(idxname))) && (colobj = gFindValueStr(idxobj, lcase(colname)))) gChangeStrValue(gGetValueToPut(adcol), gShortValue(colobj) ? "D" : "A"); else if (iDBMS == DBMS_ORACLE && namecol && colcol && adcol && (idxobj = gFindValueStr(colorders, lcase(idxname))) && (colobj = gFindValueStr(idxobj, lcase(colname)))) { gChangeStrValue(gGetValueToPut(colcol), gStringValue(colobj)); gChangeStrValue(gGetValueToPut(adcol), "D"); } cursor_write(self, iPos++); } } if (r != SQL_NO_DATA_FOUND && !iIgnoreAllErrors) vError(self, "gSQLStatistics cursor load"); SQLFreeStmt(iStmt, SQL_CLOSE); SQLFreeStmt(iStmt, SQL_UNBIND); iStmtAlreadyClosed = 1; if (r == SQL_NO_DATA_FOUND) iPos = 0; else if (iIgnoreAllErrors) { gLeaveCriticalSection(iDatabase); if (colorders) gDeepDispose(colorders); return 0; } } } else r = -1; gLeaveCriticalSection(iDatabase); if (colorders) gDeepDispose(colorders); return r; } imeth int gSQLForeignKeys(char *tname, char *oname, int refby) { RETCODE r; static char err[] = "gSQLForeignKeys::Statement Error"; char *schema = pGetOwnerName(self, oname); int dbtype = gDBMS_type(iDatabase); if (dbtype == DBMS_ORACLE) { if (!refby) return vDBSelect(self, "SELECT '' AS PKTABLE_CAT, " "F1.R_OWNER AS PKTABLE_SCHEM, " "P1.TABLE_NAME AS PKTABLE_NAME, " "P2.COLUMN_NAME AS PKCOLUMN_NAME, " "'' AS FKTABLE_CAT, " "F1.OWNER AS FKTABLE_SCHEM, " "F1.TABLE_NAME AS FKTABLE_NAME, " "F2.COLUMN_NAME AS FKCOLUMN_NAME, " "F2.POSITION AS KEY_SEQ, " "0 AS UPDATE_RULE, " "CASE WHEN F1.DELETE_RULE = 'NO ACTION' THEN 3 ELSE 0 END AS DELETE_RULE, " "F1.CONSTRAINT_NAME AS FK_NAME, " "F1.R_CONSTRAINT_NAME AS PK_NAME " "FROM USER_CONSTRAINTS F1 " "JOIN USER_CONSTRAINTS P1 " "ON P1.CONSTRAINT_NAME = F1.R_CONSTRAINT_NAME " "JOIN USER_CONS_COLUMNS F2 " "ON F2.CONSTRAINT_NAME = F1.CONSTRAINT_NAME " "JOIN USER_CONS_COLUMNS P2 " "ON P2.CONSTRAINT_NAME = F1.R_CONSTRAINT_NAME " "AND P2.POSITION = F2.POSITION " "WHERE F1.OWNER = ~%s~ AND F1.TABLE_NAME = ~%s~ " "ORDER BY F1.CONSTRAINT_NAME, F1.OWNER, F1.TABLE_NAME, F2.POSITION", schema, tname); // This is commented out because it is slower than SQLForeignKeys // The problem is with getting the FKCOLUMN_NAME field. That join is slow. // I'm leaving it here for future reference. // return vDBSelect(self, "SELECT '' AS PKTABLE_CAT, " // "P1.OWNER AS PKTABLE_SCHEM, " // "P1.TABLE_NAME AS PKTABLE_NAME, " // "P2.COLUMN_NAME AS PKCOLUMN_NAME, " // "'' AS FKTABLE_CAT, " // "F1.OWNER AS FKTABLE_SCHEM, " // "F1.TABLE_NAME AS FKTABLE_NAME, " // "F2.COLUMN_NAME AS FKCOLUMN_NAME, " // "P2.POSITION AS KEY_SEQ, " // "0 AS UPDATE_RULE, " // "CASE WHEN F1.DELETE_RULE = 'NO ACTION' THEN 3 ELSE 0 END AS DELETE_RULE, " // "F1.CONSTRAINT_NAME AS FK_NAME, " // "F1.R_CONSTRAINT_NAME AS PK_NAME " // "FROM USER_CONSTRAINTS P1 " // "JOIN USER_CONSTRAINTS F1 " // "ON F1.R_CONSTRAINT_NAME = P1.CONSTRAINT_NAME " // "JOIN USER_CONS_COLUMNS P2 " // "ON P2.CONSTRAINT_NAME = P1.CONSTRAINT_NAME " // "JOIN USER_CONS_COLUMNS F2 " // "ON F2.CONSTRAINT_NAME = F1.CONSTRAINT_NAME " // "AND F2.POSITION = P2.POSITION " // "WHERE P1.OWNER = ~%s~ AND P1.TABLE_NAME = ~%s~ " // "ORDER BY F1.CONSTRAINT_NAME, P1.OWNER, P1.TABLE_NAME, P2.POSITION", // schema, tname); } gEndSQL(self); gEnterCriticalSection(iDatabase); iUseCursors = 1; if (refby) { // if (dbtype == DBMS_MSSQL) { // char cmd[256]; // if (schema) // sprintf(cmd, "sp_fkeys %s, %s", tname, schema); // else // sprintf(cmd, "sp_fkeys %s", tname); // r = SQLExecDirect(iStmt, cmd, SQL_NTS); // } else r = SQLForeignKeys(iStmt, NULL, 0, schema, (SWORD) (schema ? SQL_NTS : 0), tname, SQL_NTS, NULL, 0, NULL, 0, NULL, 0); } else { // if (dbtype == DBMS_MSSQL) { // char cmd[256]; // if (schema) // sprintf(cmd, "sp_fkeys NULL, NULL, NULL, %s, %s", tname, schema); // else // sprintf(cmd, "sp_fkeys NULL, NULL, NULL, %s", tname); // r = SQLExecDirect(iStmt, cmd, SQL_NTS); // } else r = SQLForeignKeys(iStmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0, schema, (SWORD) (schema ? SQL_NTS : 0), tname, SQL_NTS); } if (r && r != SQL_SUCCESS_WITH_INFO && pTrapError(self, iErrors, r)) vError(self, err); if (!r || r == SQL_SUCCESS_WITH_INFO) { SWORD n, type, scale, nulls; UWORD i; SQLLEN prec; char cname[100]; object si; int size; float odbc_ver = gODBC_version(iDatabase); r = SQLNumResultCols(iStmt, &n); if (r) if (iIgnoreAllErrors) { iErrorState = 1; r = -1; } else vError(self, err); iCols = gNewWithInt(StringDictionary, 101); iColList = gNew(LinkObject); iRecordLength = 0; for (i=1 ; i <= n ; i++) { r = SQLDescribeCol(iStmt, i, cname, sizeof(cname)-1, NULL, &type, &prec, &scale, &nulls); // Convert ODBC 2.0 column names to ODBC 3.0 names for consistency if (!stricmp(cname, "pktable_qualifier")) strcpy(cname, "pktable_cat"); else if (!stricmp(cname, "pktable_owner")) strcpy(cname, "pktable_schem"); else if (!stricmp(cname, "fktable_qualifier")) strcpy(cname, "fktable_cat"); else if (!stricmp(cname, "fktable_owner")) strcpy(cname, "fktable_schem"); if (!r) si = gNewSelect(StatementInfo, self, iStmt, (int) i, lcase(cname), type, prec, scale, nulls, &r, iDBMS, &size); if (r || !si) if (iIgnoreAllErrors) { iErrorState = 1; return -1; } else vError(self, err); gAddStr(iCols, cname, si); gAddLast(iColList, si); // if (type != SQL_GUID) iRecordLength += size; } iTType = TYPE_SELECT; // r = bindCols(self, err); if (iDBMS == DBMS_MSSQL) { int r=0; while (!r) { r = SQLFetch(iStmt); if (!r) cursor_write(self, iPos++); } if (r != SQL_NO_DATA_FOUND && !iIgnoreAllErrors) vError(self, "gSQLForeignKeys cursor load"); SQLFreeStmt(iStmt, SQL_CLOSE); SQLFreeStmt(iStmt, SQL_UNBIND); iStmtAlreadyClosed = 1; if (r == SQL_NO_DATA_FOUND) iPos = 0; else if (iIgnoreAllErrors) { gLeaveCriticalSection(iDatabase); return 0; } } } else r = -1; gLeaveCriticalSection(iDatabase); return r; } imeth ifun gSetRecordTestFunction(ifun fun) { ifun old = iRecordTestFunction; iRecordTestFunction = fun; return old; } imeth gGetStatement() { return self; } imeth gSetSpecialAuditInfo(ifun fun, object dict) { iSpecialFH_Tables = dict; iSpecialAuditHandler = fun; return self; }
D
instance Info_SFB_2_Pre(C_Info) { nr = 1; condition = Info_SFB_2_Pre_Condition; information = Info_SFB_2_Pre_Info; permanent = 0; important = 1; }; func int Info_SFB_2_Pre_Condition() { return 1; }; func void Info_SFB_2_Pre_Info() { AI_Output(self,other,"Info_SFB_2_EinerVonEuchWerden_02_00"); //Что тебе нужно? Я не хочу неприятностей. }; instance Info_SFB_2_EXIT(C_Info) { nr = 999; condition = Info_SFB_2_EXIT_Condition; information = Info_SFB_2_EXIT_Info; permanent = 1; description = "ЗАКОНЧИТЬ РАЗГОВОР"; }; func int Info_SFB_2_EXIT_Condition() { return 1; }; func void Info_SFB_2_EXIT_Info() { AI_StopProcessInfos(self); }; instance Info_SFB_2_EinerVonEuchWerden(C_Info) { nr = 4; condition = Info_SFB_2_EinerVonEuchWerden_Condition; information = Info_SFB_2_EinerVonEuchWerden_Info; permanent = 1; description = "Что мне сделать, чтобы присоединиться к вам?"; }; func int Info_SFB_2_EinerVonEuchWerden_Condition() { if(Npc_GetTrueGuild(other) == GIL_None) { return TRUE; }; }; func void Info_SFB_2_EinerVonEuchWerden_Info() { AI_Output(other,self,"Info_SFB_2_EinerVonEuchWerden_15_00"); //Что мне сделать, чтобы присоединиться к вам? AI_Output(self,other,"Info_SFB_2_EinerVonEuchWerden_02_01"); //Я не смогу тебе помочь. Я человек невлиятельный. Поговори с Суини. }; instance Info_SFB_2_WichtigePersonen(C_Info) { nr = 3; condition = Info_SFB_2_WichtigePersonen_Condition; information = Info_SFB_2_WichtigePersonen_Info; permanent = 1; description = "Кто здесь всем управляет?"; }; func int Info_SFB_2_WichtigePersonen_Condition() { return 1; }; func void Info_SFB_2_WichtigePersonen_Info() { AI_Output(other,self,"Info_SFB_2_WichtigePersonen_15_00"); //Кто здесь всем управляет? AI_Output(self,other,"Info_SFB_2_WichtigePersonen_02_01"); //Здесь, в Лощине, господствуют наемники, но в Новом лагере все несколько иначе. AI_Output(self,other,"Info_SFB_2_WichtigePersonen_02_02"); //Думай сам, кого не стоит наживать себе в качестве врагов. }; instance Info_SFB_2_DasLager(C_Info) { nr = 2; condition = Info_SFB_2_DasLager_Condition; information = Info_SFB_2_DasLager_Info; permanent = 1; description = "Я хочу больше узнать о лагере."; }; func int Info_SFB_2_DasLager_Condition() { return 1; }; func void Info_SFB_2_DasLager_Info() { AI_Output(other,self,"Info_SFB_2_DasLager_15_00"); //Я хочу больше узнать о лагере. AI_Output(self,other,"Info_SFB_2_DasLager_02_01"); //Не знаю, чем и помочь тебе. Ты лучше поговори с Суини или с наемниками. }; instance Info_SFB_2_DieLage(C_Info) { nr = 1; condition = Info_SFB_2_DieLage_Condition; information = Info_SFB_2_DieLage_Info; permanent = 1; description = "Как здесь живется?"; }; func int Info_SFB_2_DieLage_Condition() { return 1; }; func void Info_SFB_2_DieLage_Info() { AI_Output(other,self,"Info_SFB_2_DieLage_15_00"); //Как здесь живется? AI_Output(self,other,"Info_SFB_2_DieLage_02_01"); //Я не жалуюсь. Мы все должны делать одно дело. AI_Output(self,other,"Info_SFB_2_DieLage_02_02"); //По крайней мере, лучше работать здесь, чем в Старом лагере. AI_Output(self,other,"Info_SFB_2_DieLage_02_03"); //Ты из Старого лагеря? AI_Output(self,other,"Info_SFB_2_DieLage_02_04"); //Если ты из Старого лагеря, запомни: я не хочу неприятностей! AI_StopProcessInfos(self); }; func void B_AssignAmbientInfos_SFB_2(var C_Npc slf) { Info_SFB_2_Pre.npc = Hlp_GetInstanceID(slf); Info_SFB_2_EXIT.npc = Hlp_GetInstanceID(slf); Info_SFB_2_EinerVonEuchWerden.npc = Hlp_GetInstanceID(slf); Info_SFB_2_WichtigePersonen.npc = Hlp_GetInstanceID(slf); Info_SFB_2_DasLager.npc = Hlp_GetInstanceID(slf); Info_SFB_2_DieLage.npc = Hlp_GetInstanceID(slf); };
D
/******************************************************************************* * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Port to the D programming language: * Frank Benoit <benoit@tionex.de> *******************************************************************************/ module org.eclipse.swt.internal.image.GIFFileFormat; public import org.eclipse.swt.internal.image.FileFormat; public import org.eclipse.swt.graphics.PaletteData; import org.eclipse.swt.internal.image.LEDataInputStream; import org.eclipse.swt.internal.image.LZWCodec; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.ImageLoaderEvent; import org.eclipse.swt.graphics.ImageLoader; import java.lang.all; final class GIFFileFormat : FileFormat { String signature; int screenWidth, screenHeight, backgroundPixel, bitsPerPixel, defaultDepth; int disposalMethod = 0; int delayTime = 0; int transparentPixel = -1; int repeatCount = 1; static const int GIF_APPLICATION_EXTENSION_BLOCK_ID = 0xFF; static const int GIF_GRAPHICS_CONTROL_BLOCK_ID = 0xF9; static const int GIF_PLAIN_TEXT_BLOCK_ID = 0x01; static const int GIF_COMMENT_BLOCK_ID = 0xFE; static const int GIF_EXTENSION_BLOCK_ID = 0x21; static const int GIF_IMAGE_BLOCK_ID = 0x2C; static const int GIF_TRAILER_ID = 0x3B; static const byte[] GIF89a = cast(byte[])"GIF89a"; static const byte[] NETSCAPE2_0 = cast(byte[])"NETSCAPE2.0"; /** * Answer a palette containing numGrays * shades of gray, ranging from black to white. */ static PaletteData grayRamp(int numGrays) { int n = numGrays - 1; RGB[] colors = new RGB[numGrays]; for (int i = 0; i < numGrays; i++) { int intensity = cast(byte)((i * 3) * 256 / n); colors[i] = new RGB(intensity, intensity, intensity); } return new PaletteData(colors); } override bool isFileFormat(LEDataInputStream stream) { try { byte[3] signature; stream.read(signature); stream.unread(signature); return signature[0] is 'G' && signature[1] is 'I' && signature[2] is 'F'; } catch (Exception e) { return false; } } /** * Load the GIF image(s) stored in the input stream. * Return an array of ImageData representing the image(s). */ override ImageData[] loadFromByteStream() { byte[3] signature; byte[3] versionBytes; byte[7] block; try { inputStream.read(signature); if (!(signature[0] is 'G' && signature[1] is 'I' && signature[2] is 'F')) SWT.error(SWT.ERROR_INVALID_IMAGE); inputStream.read(versionBytes); inputStream.read(block); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } screenWidth = (block[0] & 0xFF) | ((block[1] & 0xFF) << 8); loader.logicalScreenWidth = screenWidth; screenHeight = (block[2] & 0xFF) | ((block[3] & 0xFF) << 8); loader.logicalScreenHeight = screenHeight; byte bitField = block[4]; backgroundPixel = block[5] & 0xFF; //aspect = block[6] & 0xFF; bitsPerPixel = ((bitField >> 4) & 0x07) + 1; defaultDepth = (bitField & 0x7) + 1; PaletteData palette = null; if ((bitField & 0x80) !is 0) { // Global palette. //sorted = (bitField & 0x8) !is 0; palette = readPalette(1 << defaultDepth); } else { // No global palette. //sorted = false; backgroundPixel = -1; defaultDepth = bitsPerPixel; } loader.backgroundPixel = backgroundPixel; getExtensions(); int id = readID(); ImageData[] images = new ImageData[0]; while (id is GIF_IMAGE_BLOCK_ID) { ImageData image = readImageBlock(palette); if (loader.hasListeners()) { loader.notifyListeners(new ImageLoaderEvent(loader, image, 3, true)); } ImageData[] oldImages = images; images = new ImageData[oldImages.length + 1]; System.arraycopy(oldImages, 0, images, 0, oldImages.length); images[images.length - 1] = image; //images ~= image; try { /* Read the 0-byte terminator at the end of the image. */ id = inputStream.read(); if (id > 0) { /* We read the terminator earlier. */ byte[1] arr; arr[0] = cast(byte) id; inputStream.unread( arr ); } } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } getExtensions(); id = readID(); } return images; } /** * Read and return the next block or extension identifier from the file. */ int readID() { try { return inputStream.read(); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } return -1; } /** * Read extensions until an image descriptor appears. * In the future, if we care about the extensions, they * should be properly grouped with the image data before * which they appeared. Right now, the interesting parts * of some extensions are kept, but the rest is discarded. * Throw an error if an error occurs. */ void getExtensions() { int id = readID(); while (id !is GIF_IMAGE_BLOCK_ID && id !is GIF_TRAILER_ID && id > 0) { if (id is GIF_EXTENSION_BLOCK_ID) { readExtension(); } else { SWT.error(SWT.ERROR_INVALID_IMAGE); } id = readID(); } if (id is GIF_IMAGE_BLOCK_ID || id is GIF_TRAILER_ID) { try { byte[1] arr; arr[0] = cast(byte) id; inputStream.unread(arr); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } } } /** * Read a control extension. * Return the extension block data. */ byte[] readExtension() { int extensionID = readID(); if (extensionID is GIF_COMMENT_BLOCK_ID) return readCommentExtension(); if (extensionID is GIF_PLAIN_TEXT_BLOCK_ID) return readPlainTextExtension(); if (extensionID is GIF_GRAPHICS_CONTROL_BLOCK_ID) return readGraphicsControlExtension(); if (extensionID is GIF_APPLICATION_EXTENSION_BLOCK_ID) return readApplicationExtension(); // Otherwise, we don't recognize the block. If the // field size is correct, we can just skip over // the block contents. try { int extSize = inputStream.read(); if (extSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } byte[] ext = new byte[extSize]; inputStream.read(ext, 0, extSize); return ext; } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); return null; } } /** * We have just read the Comment extension identifier * from the input stream. Read in the rest of the comment * and return it. GIF comment blocks are variable size. */ byte[] readCommentExtension() { try { byte[] comment = new byte[0]; byte[] block = new byte[255]; int size = inputStream.read(); while ((size > 0) && (inputStream.read(block, 0, size) !is -1)) { byte[] oldComment = comment; comment = new byte[oldComment.length + size]; System.arraycopy(oldComment, 0, comment, 0, oldComment.length); System.arraycopy(block, 0, comment, oldComment.length, size); //comment ~= block[ 0 .. size ]; size = inputStream.read(); } return comment; } catch (Exception e) { SWT.error(SWT.ERROR_IO, e); return null; } } /** * We have just read the PlainText extension identifier * from the input stream. Read in the plain text info and text, * and return the text. GIF plain text blocks are variable size. */ byte[] readPlainTextExtension() { try { // Read size of block = 0x0C. inputStream.read(); // Read the text information (x, y, width, height, colors). byte[] info = new byte[12]; inputStream.read(info); // Read the text. byte[] text = new byte[0]; byte[] block = new byte[255]; int size = inputStream.read(); while ((size > 0) && (inputStream.read(block, 0, size) !is -1)) { byte[] oldText = text; text = new byte[oldText.length + size]; System.arraycopy(oldText, 0, text, 0, oldText.length); System.arraycopy(block, 0, text, oldText.length, size); //text ~= block[ 0 .. size ]; size = inputStream.read(); } return text; } catch (Exception e) { SWT.error(SWT.ERROR_IO, e); return null; } } /** * We have just read the GraphicsControl extension identifier * from the input stream. Read in the control information, store * it, and return it. */ byte[] readGraphicsControlExtension() { try { // Read size of block = 0x04. inputStream.read(); // Read the control block. byte[] controlBlock = new byte[4]; inputStream.read(controlBlock); byte bitField = controlBlock[0]; // Store the user input field. //userInput = (bitField & 0x02) !is 0; // Store the disposal method. disposalMethod = (bitField >> 2) & 0x07; // Store the delay time. delayTime = (controlBlock[1] & 0xFF) | ((controlBlock[2] & 0xFF) << 8); // Store the transparent color. if ((bitField & 0x01) !is 0) { transparentPixel = controlBlock[3] & 0xFF; } else { transparentPixel = -1; } // Read block terminator. inputStream.read(); return controlBlock; } catch (Exception e) { SWT.error(SWT.ERROR_IO, e); return null; } } /** * We have just read the Application extension identifier * from the input stream. Read in the rest of the extension, * look for and store 'number of repeats', and return the data. */ byte[] readApplicationExtension() { try { // Read size of block = 0x0B. inputStream.read(); // Read application identifier. byte[] application = new byte[8]; inputStream.read(application); // Read authentication code. byte[] authentication = new byte[3]; inputStream.read(authentication); // Read application data. byte[] data = new byte[0]; byte[] block = new byte[255]; int size = inputStream.read(); while ((size > 0) && (inputStream.read(block, 0, size) !is -1)) { byte[] oldData = data; data = new byte[oldData.length + size]; System.arraycopy(oldData, 0, data, 0, oldData.length); System.arraycopy(block, 0, data, oldData.length, size); //data ~= block[ 0 .. size ]; size = inputStream.read(); } // Look for the NETSCAPE 'repeat count' field for an animated GIF. bool netscape = application[0] is 'N' && application[1] is 'E' && application[2] is 'T' && application[3] is 'S' && application[4] is 'C' && application[5] is 'A' && application[6] is 'P' && application[7] is 'E'; bool authentic = authentication[0] is '2' && authentication[1] is '.' && authentication[2] is '0'; if (netscape && authentic && data[0] is 01) { //$NON-NLS-1$ //$NON-NLS-2$ repeatCount = (data[1] & 0xFF) | ((data[2] & 0xFF) << 8); loader.repeatCount = repeatCount; } return data; } catch (Exception e) { SWT.error(SWT.ERROR_IO, e); return null; } } /** * Return a DeviceIndependentImage representing the * image block at the current position in the input stream. * Throw an error if an error occurs. */ ImageData readImageBlock(PaletteData defaultPalette) { int depth; PaletteData palette; byte[] block = new byte[9]; try { inputStream.read(block); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } int left = (block[0] & 0xFF) | ((block[1] & 0xFF) << 8); int top = (block[2] & 0xFF) | ((block[3] & 0xFF) << 8); int width = (block[4] & 0xFF) | ((block[5] & 0xFF) << 8); int height = (block[6] & 0xFF) | ((block[7] & 0xFF) << 8); byte bitField = block[8]; bool interlaced = (bitField & 0x40) !is 0; //bool sorted = (bitField & 0x20) !is 0; if ((bitField & 0x80) !is 0) { // Local palette. depth = (bitField & 0x7) + 1; palette = readPalette(1 << depth); } else { // No local palette. depth = defaultDepth; palette = defaultPalette; } /* Work around: Ignore the case where a GIF specifies an * invalid index for the transparent pixel that is larger * than the number of entries in the palette. */ if (transparentPixel > 1 << depth) { transparentPixel = -1; } // Promote depth to next highest supported value. if (!(depth is 1 || depth is 4 || depth is 8)) { if (depth < 4) depth = 4; else depth = 8; } if (palette is null) { palette = grayRamp(1 << depth); } int initialCodeSize = -1; try { initialCodeSize = inputStream.read(); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } if (initialCodeSize < 0) { SWT.error(SWT.ERROR_INVALID_IMAGE); } ImageData image = ImageData.internal_new( width, height, depth, palette, 4, null, 0, null, null, -1, transparentPixel, SWT.IMAGE_GIF, left, top, disposalMethod, delayTime); LZWCodec codec = new LZWCodec(); codec.decode(inputStream, loader, image, interlaced, initialCodeSize); return image; } /** * Read a palette from the input stream. */ PaletteData readPalette(int numColors) { byte[] bytes = new byte[numColors * 3]; try { if (inputStream.read(bytes) !is bytes.length) SWT.error(SWT.ERROR_INVALID_IMAGE); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } RGB[] colors = new RGB[numColors]; for (int i = 0; i < numColors; i++) colors[i] = new RGB(bytes[i*3] & 0xFF, bytes[i*3+1] & 0xFF, bytes[i*3+2] & 0xFF); return new PaletteData(colors); } override void unloadIntoByteStream(ImageLoader loader) { /* Step 1: Acquire GIF parameters. */ ImageData[] data = loader.data; int frameCount = cast(int)/*64bit*/data.length; bool multi = frameCount > 1; ImageData firstImage = data[0]; int logicalScreenWidth = multi ? loader.logicalScreenWidth : firstImage.width; int logicalScreenHeight = multi ? loader.logicalScreenHeight : firstImage.height; int backgroundPixel = loader.backgroundPixel; int depth = firstImage.depth; PaletteData palette = firstImage.palette; RGB[] colors = palette.getRGBs(); short globalTable = 1; /* Step 2: Check for validity and global/local color map. */ if (!(depth is 1 || depth is 4 || depth is 8)) { SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH); } for (int i=0; i<frameCount; i++) { if (data[i].palette.isDirect) { SWT.error(SWT.ERROR_INVALID_IMAGE); } if (multi) { if (!(data[i].height <= logicalScreenHeight && data[i].width <= logicalScreenWidth && data[i].depth is depth)) { SWT.error(SWT.ERROR_INVALID_IMAGE); } if (globalTable is 1) { RGB[] rgbs = data[i].palette.getRGBs(); if (rgbs.length !is colors.length) { globalTable = 0; } else { for (int j=0; j<colors.length; j++) { if (!(rgbs[j].red is colors[j].red && rgbs[j].green is colors[j].green && rgbs[j].blue is colors[j].blue)) globalTable = 0; } } } } } try { /* Step 3: Write the GIF89a Header and Logical Screen Descriptor. */ outputStream.write(GIF89a); int bitField = globalTable*128 + (depth-1)*16 + depth-1; outputStream.writeShort(cast(short)logicalScreenWidth); outputStream.writeShort(cast(short)logicalScreenHeight); outputStream.write(bitField); outputStream.write(backgroundPixel); outputStream.write(0); // Aspect ratio is 1:1 } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } /* Step 4: Write Global Color Table if applicable. */ if (globalTable is 1) { writePalette(palette, depth); } /* Step 5: Write Application Extension if applicable. */ if (multi) { int repeatCount = loader.repeatCount; try { outputStream.write(GIF_EXTENSION_BLOCK_ID); outputStream.write(GIF_APPLICATION_EXTENSION_BLOCK_ID); outputStream.write(NETSCAPE2_0.length); outputStream.write(NETSCAPE2_0); outputStream.write(3); // Three bytes follow outputStream.write(1); // Extension type outputStream.writeShort(cast(short) repeatCount); outputStream.write(0); // Block terminator } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } } for (int frame=0; frame<frameCount; frame++) { /* Step 6: Write Graphics Control Block for each frame if applicable. */ if (multi || data[frame].transparentPixel !is -1) { writeGraphicsControlBlock(data[frame]); } /* Step 7: Write Image Header for each frame. */ int x = data[frame].x; int y = data[frame].y; int width = data[frame].width; int height = data[frame].height; try { outputStream.write(GIF_IMAGE_BLOCK_ID); byte[] block = new byte[9]; block[0] = cast(byte)(x & 0xFF); block[1] = cast(byte)((x >> 8) & 0xFF); block[2] = cast(byte)(y & 0xFF); block[3] = cast(byte)((y >> 8) & 0xFF); block[4] = cast(byte)(width & 0xFF); block[5] = cast(byte)((width >> 8) & 0xFF); block[6] = cast(byte)(height & 0xFF); block[7] = cast(byte)((height >> 8) & 0xFF); block[8] = cast(byte)(globalTable is 0 ? (depth-1) | 0x80 : 0x00); outputStream.write(block); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } /* Step 8: Write Local Color Table for each frame if applicable. */ if (globalTable is 0) { writePalette(data[frame].palette, depth); } /* Step 9: Write the actual data for each frame. */ try { outputStream.write(depth); // Minimum LZW Code size } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } (new LZWCodec()).encode(outputStream, data[frame]); } /* Step 10: Write GIF terminator. */ try { outputStream.write(0x3B); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } } /** * Write out a GraphicsControlBlock to describe * the specified device independent image. */ void writeGraphicsControlBlock(ImageData image) { try { outputStream.write(GIF_EXTENSION_BLOCK_ID); outputStream.write(GIF_GRAPHICS_CONTROL_BLOCK_ID); byte[] gcBlock = new byte[4]; gcBlock[0] = 0; gcBlock[1] = 0; gcBlock[2] = 0; gcBlock[3] = 0; if (image.transparentPixel !is -1) { gcBlock[0] = cast(byte)0x01; gcBlock[3] = cast(byte)image.transparentPixel; } if (image.disposalMethod !is 0) { gcBlock[0] |= cast(byte)((image.disposalMethod & 0x07) << 2); } if (image.delayTime !is 0) { gcBlock[1] = cast(byte)(image.delayTime & 0xFF); gcBlock[2] = cast(byte)((image.delayTime >> 8) & 0xFF); } outputStream.write(cast(byte)gcBlock.length); outputStream.write(gcBlock); outputStream.write(0); // Block terminator } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } } /** * Write the specified palette to the output stream. */ void writePalette(PaletteData palette, int depth) { byte[] bytes = new byte[(1 << depth) * 3]; int offset = 0; for (int i = 0; i < palette.colors.length; i++) { RGB color = palette.colors[i]; bytes[offset] = cast(byte)color.red; bytes[offset + 1] = cast(byte)color.green; bytes[offset + 2] = cast(byte)color.blue; offset += 3; } try { outputStream.write(bytes); } catch (IOException e) { SWT.error(SWT.ERROR_IO, e); } } }
D
module android.java.android.telecom.RemoteConnection; public import android.java.android.telecom.RemoteConnection_d_interface; import arsd.jni : ImportExportImpl; mixin ImportExportImpl!RemoteConnection; import import5 = android.java.java.lang.CharSequence; import import4 = android.java.android.net.Uri; import import10 = android.java.android.telecom.RemoteConference; import import11 = android.java.java.lang.Class; import import3 = android.java.android.telecom.StatusHints; import import7 = android.java.android.os.Bundle; import import2 = android.java.android.telecom.DisconnectCause; import import6 = android.java.android.telecom.RemoteConnection_VideoProvider; import import9 = android.java.java.util.List;
D
# FIXED Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/sysctl.c Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Inc_Drivers.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/COM_cpu01/Include/DEF_Global.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Init_HW.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Config_GPIO.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Config_CAN.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/can.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/FIFO.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/inc/hw_types.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/debug.h Comun/driverlib/sysctl.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/sysctl.h C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/sysctl.c: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Inc_Drivers.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/COM_cpu01/Include/DEF_Global.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Init_HW.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Config_GPIO.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/Config_CAN.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/can.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/Drivers/Include/FIFO.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/inc/hw_types.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/debug.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/driverlib/sysctl.h:
D
import concepts; private interface DatabaseDriver { void foo(); } private enum isDatabaseDriver(T) = implements!(T, DatabaseDriver); final class SQLite3 : DatabaseDriver { void foo() { } } static assert(isDatabaseDriver!SQLite3);
D
/Users/volchan/code/volchan/udemy/rust/chat_server/target/rls/debug/deps/chat_server-6cdcb8b4c1f618f5.rmeta: src/main.rs /Users/volchan/code/volchan/udemy/rust/chat_server/target/rls/debug/deps/chat_server-6cdcb8b4c1f618f5.d: src/main.rs src/main.rs:
D
//################################################# // // Nutzungshinweise: // //################################################# /************************************************* // Idee //************************************************ Die hier vorgestellten Funktionen ermöglichen es, für alle Npcs in der Welt oder alle Npcs in der KI-Glocke eine beliebige Funktion aufzurufen. //************************************************ // Setup //************************************************ Eine aktuelle Version von Ikarus wird benötigt. Ikarus gibt es hier: http://forum.worldofplayers.de/forum/threads/969446-Skriptpaket-Ikarus-3 Die Datei, die du grade liest, ist nach Ikarus zu parsen. //************************************************ // Funktionen //************************************************ func void DoForAll (var func function) func void DoForSphere (var func function) "function" muss eine Funktion sein, die einen Parameter vom Typ C_NPC nimmt und nichts zurückgibt. DoForAll ruft function für jeden Npc auf, der in der Welt existiert. DoForSphere ruft function für jeden Npc in der KI-Glocke auf (also im Radius von ~40 Meter um die Kamera) Beispiel: ************************** func void foo() { DoForSphere(SayHi); }; func void SayHi(var C_NPC slf) { PrintDebug(ConcatStrings (slf.name, " sagt Hallo!")); }; ************************** Eine mögliche Anwendung für DoForAll wäre ein Schwierigkeitsgradsystem, dass, wenn der Schwierigkeitsgrad verändert wird, alle Npcs anpassen muss. ######### Broadcasts ######### Eine einfache Abwandlung dieser Funktionen ist der Broadcast. Die Idee ist hierbei, dass ein Npc, der "Caster", eine Nachricht an alle anderen Npcs sendet, die dann bei jedem Npc verarbeitet wird. Beispielsweise könnte ein Npc, der einen Massenheilzauber spricht, dies "broadcasten" und die Npcs reagieren darauf, indem sie ihre Lebensenergie auffüllen (wenn sie in der selben Partei kämpfen wie der Caster). Grundsätzlich ergeben sich durch Broadcasts mannigfache Möglichkeiten für Flächenzauber. Broadcasts können auch Wahrnehmungen sinnvoll ergänzen und helfen eine Situation zu überblicken. Etwa könnte ein Monster, bevor es den Spieler angreift erstmal einen "durchzählen!"-Broadcast herausschicken, indem sich alle Freunde des Monsters "melden". So könnte ein Wolf, der alleine ist, fliehen (vielleicht sogar zu einem Rudel in der Nähe); ein Wolf, der im Rudel steht dagegen mutiger sein. Ein Troll, der den Spieler kommen sieht, könnte das allen Npcs mitteilen, woraufhin vielleicht Goblins in der Umgebung bei ihm Schutz suchen. Doch nun zur Funktion: func void Broadcast (var C_NPC caster, var func function) function muss eine Funktion sein, die zwei C_NPC Parameter entgegennimmt und nichts zurückgibt. Dann wird function(npc, caster) für jeden Npc aufgerufen, der folgende Bedingungen erfüllt: 1.) Er ist in der KI-Glocke 2.) Er ist nicht tot (HP != 0). Es gibt eine erweiterte ("EXtended") Version von Broadcast mit folgender Signatur: func void BroadcastEx(var C_NPC caster, var func function, var int excludeCaster, var int includeDead, var int includeShrinked) Sind die drei zusätzlichen Parameter 0, so verhält sich BroadcastEx genau wie Broadcast. Ansonsten beeinflussen die drei Parameter folgendes, wenn sie nicht Null sind: excludeCaster: function wird nicht für den Caster aufgerufen (das heißt der Caster benachrichtigt sich nicht selbst) includeDead: Auch tote Npcs werden benachrichtigt (Bedingung 2. wird also ignoriert) includeShrinked: Auch Npcs außerhalb der KI-Glocke (die daher nur in einer abgespeckten Version in der Welt existieren (kein aktives Visual)) werden benachrichtigt. (das heißt Bedingung 1. wird ignoriert). Beispiel: ************************** var int friendCount; //Gibt Anzahl Freunde von slf zurück, die in der KI-Glocke sind. func int CountFriends(var C_NPC slf) { friendCount = 0; Broadcast(slf, CountFrieds_Sub); return friendCount; }; //Hilfsfunktion: func void CountFrieds_Sub(var C_NPC slf, var C_NPC caster) { if (Npc_GetPermAttitude(slf, caster) == ATT_FRIENDLY) { friendCount += 1; }; }; ************************** Anmerkung: Schachteln der Funktionen ist nicht erlaubt. Das heißt während eine Ausführung von DoForAll / DoForSphere läuft, darf keine weitere gestartet werden. */ //################################################# // // Implementierung // //################################################# //************************************************ // The Core: Iterating through Lists. //************************************************ func void _BC_ForAll(var int funcID, var int sphereOnly) { MEM_InitAll(); //safety, don't know if user did it. var int busy; if (busy) { MEM_Error("Broadcast-System: Nesting is not allowed!"); return; }; busy = true; var C_NPC slfBak; slfBak = Hlp_GetNpc(self); var C_NPC othBak; othBak = Hlp_GetNpc(other); if (sphereOnly) { /* to speed things up (and do the filtering) * we only search the (small) active Vob List */ var int i; i = 0; var int loop; loop = MEM_StackPos.position; if (i < MEM_World.activeVobList_numInArray) { var int vob; vob = MEM_ReadIntArray(MEM_World.activeVobList_array, i); if (Hlp_Is_oCNpc(vob)) { var C_NPC npc; npc = MEM_PtrToInst(vob); MEM_PushInstParam(npc); MEM_CallByID(funcID); }; i += 1; MEM_StackPos.position = loop; }; } else { /* walk through the entire Npc List (possibly large). */ var int listPtr; listPtr = MEM_World.voblist_npcs; loop = MEM_StackPos.position; if (listPtr) { vob = MEM_ReadInt(listPtr + 4); if (Hlp_Is_oCNpc(vob)) { npc = MEM_PtrToInst(vob); MEM_PushInstParam(npc); MEM_CallByID(funcID); }; listPtr = MEM_ReadInt(listPtr + 8); MEM_StackPos.position = loop; }; }; self = Hlp_GetNpc(slfbak); other = Hlp_GetNpc(othbak); busy = false; }; func void DoForAll (var func _) { var MEMINT_HelperClass symb; var int theHandlerInt; theHandlerInt = MEM_ReadInt(MEM_ReadIntArray(contentSymbolTableAddress, symb - 1) + zCParSymbol_content_offset); _BC_ForAll(theHandlerInt, 0); }; func void DoForSphere(var func _) { var MEMINT_HelperClass symb; var int theHandlerInt; theHandlerInt = MEM_ReadInt(MEM_ReadIntArray(contentSymbolTableAddress, symb - 1) + zCParSymbol_content_offset); _BC_ForAll(theHandlerInt, 1); }; //************************************************ // Building on that: The Broadcast //************************************************ var int _BC_funcID; var int _BC_CasterPtr; var C_NPC _BC_Caster; var int _BC_ExcludeCaster; var int _BC_SendToDead; func void _BC_CallAssessFunc(var C_NPC slf) { //ignore dead, unless they are explicitly included if (!slf.attribute[ATR_HITPOINTS] && !_BC_SendToDead) { return; }; //ignore caster if this is wanted if (_BC_ExcludeCaster) { if (_BC_CasterPtr == MEM_InstToPtr(slf)) { return; }; }; MEM_PushInstParam(slf); MEM_PushInstParam(_BC_Caster); MEM_CallByID(_BC_funcID); }; func void _BC_Broadcast(var C_NPC caster, var int funcID, var int excludeCaster, var int includeDead, var int includeShrinked) { _BC_ExcludeCaster = excludeCaster; _BC_Caster = Hlp_GetNpc(caster); _BC_CasterPtr = MEM_InstToPtr(caster); _BC_SendToDead = includeDead; _BC_funcID = funcID; if (includeShrinked) { DoForAll(_BC_CallAssessFunc); } else { DoForSphere(_BC_CallAssessFunc); }; }; func void Broadcast (var C_NPC caster, var func _) { var MEMINT_HelperClass symb; var int reactionFuncID; reactionFuncID = MEM_ReadInt(MEM_ReadIntArray(contentSymbolTableAddress, symb - 1) + zCParSymbol_content_offset); _BC_Broadcast(caster, reactionFuncID, 0, 0, 0); }; func void BroadcastEx(var C_NPC caster, var func _, var int excludeCaster, var int includeDead, var int includeShrinked) { var MEMINT_HelperClass symb; var int reactionFuncID; reactionFuncID = MEM_ReadInt(MEM_ReadIntArray(contentSymbolTableAddress, symb - 4) + zCParSymbol_content_offset); _BC_Broadcast(caster, reactionFuncID, excludeCaster, includeDead, includeShrinked); };
D
/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Port to the D programming language: * Frank Benoit <benoit@tionex.de> *******************************************************************************/ module dwtx.draw2d.text.FlowContainerLayout; import dwt.dwthelper.utils; import dwtx.dwtxhelper.Collection; import dwtx.draw2d.Figure; import dwtx.draw2d.text.FlowFigureLayout; import dwtx.draw2d.text.FlowBox; import dwtx.draw2d.text.LineBox; import dwtx.draw2d.text.FlowContext; import dwtx.draw2d.text.FlowFigure; /** * A layout for FlowFigures with children. * * <P>WARNING: This class is not intended to be subclassed by clients. * @author hudsonr * @since 2.1 */ public abstract class FlowContainerLayout : FlowFigureLayout , FlowContext { /** * the current line */ LineBox currentLine; /** * @see dwtx.draw2d.text.FlowFigureLayout#FlowFigureLayout(FlowFigure) */ protected this(FlowFigure flowFigure) { super(flowFigure); } /** * Adds the given box the current line and clears the context's state. * @see dwtx.draw2d.text.FlowContext#addToCurrentLine(FlowBox) */ public void addToCurrentLine(FlowBox child) { getCurrentLine().add(child); setContinueOnSameLine(false); } /** * Flush anything pending and free all temporary data used during layout. */ protected void cleanup() { currentLine = null; } /** * Used by getCurrentLine(). */ protected abstract void createNewLine(); /** * Called after {@link #layoutChildren()} when all children have been laid out. This * method exists to flush the last line. */ protected abstract void flush(); /** * FlowBoxes shouldn't be added directly to the current line. Use * {@link #addToCurrentLine(FlowBox)} for that. * @see dwtx.draw2d.text.FlowContext#getCurrentLine() */ LineBox getCurrentLine() { if (currentLine is null) createNewLine(); return currentLine; } /** * @see FlowContext#getRemainingLineWidth() */ public int getRemainingLineWidth() { return getCurrentLine().getAvailableWidth(); } /** * @see FlowContext#isCurrentLineOccupied() */ public bool isCurrentLineOccupied() { return currentLine !is null && currentLine.isOccupied(); } /** * @see FlowFigureLayout#layout() */ protected void layout() { preLayout(); layoutChildren(); flush(); cleanup(); } /** * Layout all children. */ protected void layoutChildren() { List children = getFlowFigure().getChildren(); for (int i = 0; i < children.size(); i++) { Figure f = cast(Figure)children.get(i); if (forceChildInvalidation(f)) f.invalidate(); f.validate(); } } bool forceChildInvalidation(Figure f) { return true; } /** * Called before layoutChildren() to setup any necessary state. */ protected abstract void preLayout(); }
D
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ module flow.engine.impl.cmd.GetDataObjectsCmd; import hunt.collection; import hunt.collection.HashMap; import hunt.collection.Map; import flow.bpmn.model.BpmnModel; import flow.bpmn.model.SubProcess; import flow.bpmn.model.ValuedDataObject; import flow.common.api.FlowableIllegalArgumentException; import flow.common.api.FlowableObjectNotFoundException; import flow.common.interceptor.Command; import flow.common.interceptor.CommandContext; import flow.engine.DynamicBpmnConstants; import flow.engine.compatibility.Flowable5CompatibilityHandler; import flow.engine.impl.DataObjectImpl; //import flow.engine.impl.context.BpmnOverrideContext; import flow.engine.impl.persistence.entity.ExecutionEntity; import flow.engine.impl.util.CommandContextUtil; //import flow.engine.impl.util.Flowable5Util; import flow.engine.impl.util.ProcessDefinitionUtil; import flow.engine.runtime.DataObject; import flow.engine.runtime.Execution; import flow.variable.service.api.persistence.entity.VariableInstance; import hunt.Exceptions; //import com.fasterxml.jackson.databind.JsonNode; //import com.fasterxml.jackson.databind.node.ObjectNode; class GetDataObjectsCmd : Command!(Map!(string, DataObject)) { protected string executionId; protected Collection!string dataObjectNames; protected bool isLocal; protected string locale; protected bool withLocalizationFallback; this(string executionId, Collection!string dataObjectNames, bool isLocal) { this.executionId = executionId; this.dataObjectNames = dataObjectNames; this.isLocal = isLocal; } this(string executionId, Collection!string dataObjectNames, bool isLocal, string locale, bool withLocalizationFallback) { this.executionId = executionId; this.dataObjectNames = dataObjectNames; this.isLocal = isLocal; this.locale = locale; this.withLocalizationFallback = withLocalizationFallback; } public Map!(string, DataObject) execute(CommandContext commandContext) { // Verify existence of execution if (executionId is null) { throw new FlowableIllegalArgumentException("executionId is null"); } ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager(commandContext).findById(executionId); if (execution is null) { throw new FlowableObjectNotFoundException("execution " ~ executionId ~ " doesn't exist"); } Map!(string, VariableInstance) variables = null; if (dataObjectNames is null || dataObjectNames.isEmpty()) { // Fetch all if (isLocal) { variables = execution.getVariableInstancesLocal(); } else { variables = execution.getVariableInstances(); } } else { // Fetch specific collection of variables if (isLocal) { variables = execution.getVariableInstancesLocal(dataObjectNames, false); } else { variables = execution.getVariableInstances(dataObjectNames, false); } } //if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, execution.getProcessDefinitionId())) { // Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler(); // variables = compatibilityHandler.getExecutionVariableInstances(executionId, dataObjectNames, isLocal); // //} else { // // if (dataObjectNames is null || dataObjectNames.isEmpty()) { // // Fetch all // if (isLocal) { // variables = execution.getVariableInstancesLocal(); // } else { // variables = execution.getVariableInstances(); // } // // } else { // // Fetch specific collection of variables // if (isLocal) { // variables = execution.getVariableInstancesLocal(dataObjectNames, false); // } else { // variables = execution.getVariableInstances(dataObjectNames, false); // } // } //} Map!(string, DataObject) dataObjects = null; if (variables !is null) { dataObjects = new HashMap!(string, DataObject)(variables.size()); foreach (MapEntry!(string, VariableInstance) entry ; variables) { string name = entry.getKey(); VariableInstance variableEntity = entry.getValue(); ExecutionEntity executionEntity = CommandContextUtil.getExecutionEntityManager(commandContext).findById(variableEntity.getExecutionId()); while (!executionEntity.isScope()) { executionEntity = executionEntity.getParent(); } BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(execution.getProcessDefinitionId()); ValuedDataObject foundDataObject = null; if (executionEntity.getParentId() is null) { foreach (ValuedDataObject dataObject ; bpmnModel.getMainProcess().getDataObjects()) { if (dataObject.getName() == (variableEntity.getName())) { foundDataObject = dataObject; break; } } } else { SubProcess subProcess = cast(SubProcess) bpmnModel.getFlowElement(executionEntity.getActivityId()); foreach (ValuedDataObject dataObject ; subProcess.getDataObjects()) { if (dataObject.getName() == (variableEntity.getName())) { foundDataObject = dataObject; break; } } } string localizedName = null; string localizedDescription = null; if (locale !is null && foundDataObject !is null) { implementationMissing(false); //ObjectNode languageNode = BpmnOverrideContext.getLocalizationElementProperties(locale, foundDataObject.getId(), // execution.getProcessDefinitionId(), withLocalizationFallback); // //if (languageNode !is null) { // JsonNode nameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME); // if (nameNode !is null) { // localizedName = nameNode.asText(); // } // JsonNode descriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION); // if (descriptionNode !is null) { // localizedDescription = descriptionNode.asText(); // } //} } if (foundDataObject !is null) { dataObjects.put(name, new DataObjectImpl(variableEntity.getId(), variableEntity.getProcessInstanceId(), variableEntity.getExecutionId(), variableEntity.getName(), variableEntity.getValue(), foundDataObject.getDocumentation(), foundDataObject.getType(), localizedName, localizedDescription, foundDataObject.getId())); } } } return dataObjects; } }
D
module emul.m68k.instructions.pea; import emul.m68k.instructions.common; package nothrow: void addPeaInstructions(ref Instruction[ushort] ret) pure { foreach(v; TupleRange!(0,readAddressModes.length)) { enum mode = readAddressModes[v]; if(addressModeTraits!mode.Control) { const instr = 0x4840 | mode; ret.addInstruction(Instruction("pea",cast(ushort)instr,0x2,&peaImpl!mode)); } } } private: void peaImpl(ubyte Mode)(ref Cpu cpu) { addressMode!(uint,AddressModeType.ReadAddress,Mode,(ref cpu,val) { cpu.state.SP -= uint.sizeof; cpu.setMemValue(cpu.state.SP, val); })(cpu); }
D
a sedimentary rock formed by the deposition of successive layers of clay
D