code
stringlengths
3
10M
language
stringclasses
31 values
/* * Copyright (c) 2004-2009 Derelict Developers * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the names 'Derelict', 'DerelictGL', nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ module derelict.opengl.extension.arb.shadow; private { import derelict.opengl.gltypes; import derelict.opengl.gl; import derelict.util.wrapper; } private bool enabled = false; struct ARBShadow { static bool load(char[] extString) { if(extString.findStr("GL_ARB_shadow") != -1) { enabled = true; return true; } return false; } static bool isEnabled() { return enabled; } } version(DerelictGL_NoExtensionLoaders) { } else { static this() { DerelictGL.registerExtensionLoader(&ARBShadow.load); } } enum : GLenum { GL_TEXTURE_COMPARE_MODE_ARB = 0x884C, GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D, GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E, }
D
instance Info_Xardas_OT(C_Info) { npc = KDF_406_OTXardas; condition = Info_Xardas_OT_Condition; information = Info_Xardas_OT_Info; important = 1; permanent = 0; }; func int Info_Xardas_OT_Condition() { if(Npc_GetDistToWP(self,"TPL_331") < 1000) { return TRUE; }; }; func void Info_Xardas_OT_Info() { AI_Output(self,other,"Info_Xardas_OT_14_01"); //Nie mamy wiele czasu, więc słuchaj uważnie. AI_Output(other,self,"Info_Xardas_OT_15_02"); //Jak się tu... AI_Output(self,other,"Info_Xardas_OT_14_03"); //Śniący jest już blisko. Wykorzystałem całą swoją moc, żeby się tu dostać. AI_Output(self,other,"Info_Xardas_OT_14_04"); //Przetłumaczyłem starożytne przepowiednie Orków i odkryłem o co chodzi z pięcioma sercami. AI_Output(self,other,"Info_Xardas_OT_14_05"); //Pięć serc należących do kapłanów, których pokonałeś, złożono w pięciu kapliczkach. AI_Output(self,other,"Info_Xardas_OT_14_06"); //Kapliczki można otworzyć, ale tylko starożytne sztylety kapłanów są w stanie je zniszczyć. AI_Output(self,other,"Info_Xardas_OT_14_07"); //Musisz przebić serca kapłanów pięcioma sztyletami. Tylko w ten sposób uda ci się wygnać Śniącego z tego świata. AI_Output(other,self,"Info_Xardas_OT_15_08"); //Rozumiem! AI_Output(self,other,"Info_Xardas_OT_14_09"); //Spiesz się. Przebudzenie demona odbędzie się już wkrótce. Szalony Cor Kalom i jego poplecznicy są już tutaj. AI_Output(self,other,"Info_Xardas_OT_14_10"); //Zebrali się w krypcie Śniącego. AI_Output(other,self,"Info_Xardas_OT_15_11"); //Przelałem już zbyt dużo krwi! Nie pozwolę, by ktoś mnie teraz powstrzymał. AI_Output(self,other,"Info_Xardas_OT_14_12"); //Śniący staje się potężniejszy z każdą minutą, nie mogę... AI_Output(other,self,"Info_Xardas_OT_15_13"); //Co się z tobą dzieje? AI_Output(self,other,"Info_Xardas_OT_14_14"); //Ja... muszę... Npc_ExchangeRoutine(self,"DRAINED"); Log_CreateTopic(CH6_Sleeper,LOG_MISSION); Log_SetTopicStatus(CH6_Sleeper,LOG_RUNNING); B_LogEntry(CH6_Sleeper,"Zbliża się ostateczne rozstrzygnięcie. Jestem już bardzo blisko leża Śniącego. Xardas pojawił się niespodziewanie, udzielając mi rad przed zbliżającą się walką. Muszę przebić serca pięciu orkowych kapłanów pięcioma mieczami, które mam ze sobą. To jedyny sposób na pokonanie Śniącego. Brzmi podejrzanie łatwo..."); AI_StopProcessInfos(self); };
D
/** * Contains all implicitly declared types and variables. * * Copyright: Copyright Digital Mars 2000 - 2011. * License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). * Authors: Walter Bright, Sean Kelly * * Copyright Digital Mars 2000 - 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 object; private { extern(C) void rt_finalize(void *ptr, bool det=true); } alias typeof(int.sizeof) size_t; alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t; alias ptrdiff_t sizediff_t; //For backwards compatibility only. alias size_t hash_t; //For backwards compatibility only. alias bool equals_t; //For backwards compatibility only. alias immutable(char)[] string; alias immutable(wchar)[] wstring; alias immutable(dchar)[] dstring; class Object { string toString(); size_t toHash() @trusted nothrow; int opCmp(Object o); bool opEquals(Object o) { return this is o; } interface Monitor { void lock(); void unlock(); } static Object factory(string classname); } bool opEquals(const Object lhs, const Object rhs) { // A hack for the moment. return opEquals(cast()lhs, cast()rhs); } bool opEquals(Object lhs, Object rhs) { // If aliased to the same object or both null => equal if (lhs is rhs) return true; // If either is null => non-equal if (lhs is null || rhs is null) return false; // If same exact type => one call to method opEquals if (typeid(lhs) is typeid(rhs) || !__ctfe && typeid(lhs).opEquals(typeid(rhs))) /* CTFE doesn't like typeid much. 'is' works, but opEquals doesn't (issue 7147). But CTFE also guarantees that equal TypeInfos are always identical. So, no opEquals needed during CTFE. */ { return lhs.opEquals(rhs); } // General case => symmetric calls to method opEquals return lhs.opEquals(rhs) && rhs.opEquals(lhs); } void setSameMutex(shared Object ownee, shared Object owner); struct Interface { TypeInfo_Class classinfo; void*[] vtbl; size_t offset; // offset to Interface 'this' from Object 'this' } struct OffsetTypeInfo { size_t offset; TypeInfo ti; } class TypeInfo { override string toString() const pure @safe nothrow; override size_t toHash() @trusted const; override int opCmp(Object o); override bool opEquals(Object o); size_t getHash(in void* p) @trusted nothrow const; bool equals(in void* p1, in void* p2) const; int compare(in void* p1, in void* p2) const; @property size_t tsize() nothrow pure const @safe @nogc; void swap(void* p1, void* p2) const; @property inout(TypeInfo) next() nothrow pure inout @nogc; const(void)[] init() nothrow pure const @safe @nogc; // TODO: make this a property, but may need to be renamed to diambiguate with T.init... @property uint flags() nothrow pure const @safe @nogc; // 1: // has possible pointers into GC memory const(OffsetTypeInfo)[] offTi() const; void destroy(void* p) const; void postblit(void* p) const; @property size_t talign() nothrow pure const @safe @nogc; version (X86_64) int argTypes(out TypeInfo arg1, out TypeInfo arg2) @safe nothrow; @property immutable(void)* rtInfo() nothrow pure const @safe @nogc; } class TypeInfo_Typedef : TypeInfo { TypeInfo base; string name; void[] m_init; } class TypeInfo_Enum : TypeInfo_Typedef { } class TypeInfo_Pointer : TypeInfo { TypeInfo m_next; } class TypeInfo_Array : TypeInfo { override string toString() const; override bool opEquals(Object o); override size_t getHash(in void* p) @trusted const; override bool equals(in void* p1, in void* p2) const; override int compare(in void* p1, in void* p2) const; override @property size_t tsize() nothrow pure const; override void swap(void* p1, void* p2) const; override @property inout(TypeInfo) next() nothrow pure inout; override @property uint flags() nothrow pure const; override @property size_t talign() nothrow pure const; version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2); TypeInfo value; } class TypeInfo_StaticArray : TypeInfo { TypeInfo value; size_t len; } class TypeInfo_AssociativeArray : TypeInfo { TypeInfo value; TypeInfo key; } class TypeInfo_Vector : TypeInfo { TypeInfo base; } class TypeInfo_Function : TypeInfo { TypeInfo next; string deco; } class TypeInfo_Delegate : TypeInfo { TypeInfo next; string deco; } class TypeInfo_Class : TypeInfo { @property auto info() @safe nothrow pure const { return this; } @property auto typeinfo() @safe nothrow pure const { return this; } byte[] m_init; // class static initializer string name; // class name void*[] vtbl; // virtual function pointer table Interface[] interfaces; TypeInfo_Class base; void* destructor; void function(Object) classInvariant; enum ClassFlags : uint { isCOMclass = 0x1, noPointers = 0x2, hasOffTi = 0x4, hasCtor = 0x8, hasGetMembers = 0x10, hasTypeInfo = 0x20, isAbstract = 0x40, isCPPclass = 0x80, hasDtor = 0x100, } ClassFlags m_flags; void* deallocator; OffsetTypeInfo[] m_offTi; void* defaultConstructor; immutable(void)* m_RTInfo; // data for precise GC static const(TypeInfo_Class) find(in char[] classname); Object create() const; } alias TypeInfo_Class ClassInfo; class TypeInfo_Interface : TypeInfo { ClassInfo info; } class TypeInfo_Struct : TypeInfo { string name; void[] m_init; @safe pure nothrow { uint function(in void*) xtoHash; bool function(in void*, in void*) xopEquals; int function(in void*, in void*) xopCmp; string function(in void*) xtoString; enum StructFlags : uint { hasPointers = 0x1, isDynamicType = 0x2, // built at runtime, needs type info in xdtor } StructFlags m_flags; } union { void function(void*) xdtor; void function(void*, const TypeInfo_Struct ti) xdtorti; } void function(void*) xpostblit; uint m_align; version (X86_64) { TypeInfo m_arg1; TypeInfo m_arg2; } immutable(void)* m_RTInfo; } class TypeInfo_Tuple : TypeInfo { TypeInfo[] elements; } class TypeInfo_Const : TypeInfo { TypeInfo next; } class TypeInfo_Invariant : TypeInfo_Const { } class TypeInfo_Shared : TypeInfo_Const { } class TypeInfo_Inout : TypeInfo_Const { } abstract class MemberInfo { @property string name() nothrow pure; } class MemberInfo_field : MemberInfo { this(string name, TypeInfo ti, size_t offset); override @property string name() nothrow pure; @property TypeInfo typeInfo() nothrow pure; @property size_t offset() nothrow pure; } class MemberInfo_function : MemberInfo { enum { Virtual = 1, Member = 2, Static = 4, } this(string name, TypeInfo ti, void* fp, uint flags); override @property string name() nothrow pure; @property TypeInfo typeInfo() nothrow pure; @property void* fp() nothrow pure; @property uint flags() nothrow pure; } struct ModuleInfo { uint _flags; uint _index; version (all) { deprecated("ModuleInfo cannot be copy-assigned because it is a variable-sized struct.") void opAssign(in ModuleInfo m) { _flags = m._flags; _index = m._index; } } else { @disable this(); @disable this(this) const; } const: @property uint index() nothrow pure; @property uint flags() nothrow pure; @property void function() tlsctor() nothrow pure; @property void function() tlsdtor() nothrow pure; @property void* xgetMembers() nothrow pure; @property void function() ctor() nothrow pure; @property void function() dtor() nothrow pure; @property void function() ictor() nothrow pure; @property void function() unitTest() nothrow pure; @property immutable(ModuleInfo*)[] importedModules() nothrow pure; @property TypeInfo_Class[] localClasses() nothrow pure; @property string name() nothrow pure; static int opApply(scope int delegate(ModuleInfo*) dg); } class Throwable : Object { interface TraceInfo { int opApply(scope int delegate(ref const(char[]))) const; int opApply(scope int delegate(ref size_t, ref const(char[]))) const; string toString() const; } string msg; string file; size_t line; TraceInfo info; Throwable next; @nogc @safe pure nothrow this(string msg, Throwable next = null); @nogc @safe pure nothrow this(string msg, string file, size_t line, Throwable next = null); override string toString(); void toString(scope void delegate(in char[]) sink) const; } class Exception : Throwable { @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { super(msg, file, line, next); } @nogc @safe pure nothrow this(string msg, Throwable next, string file = __FILE__, size_t line = __LINE__) { super(msg, file, line, next); } } class Error : Throwable { @nogc @safe pure nothrow this(string msg, Throwable next = null) { super(msg, next); bypassedException = null; } @nogc @safe pure nothrow this(string msg, string file, size_t line, Throwable next = null) { super(msg, file, line, next); bypassedException = null; } Throwable bypassedException; } extern (C) { // from druntime/src/rt/aaA.d // size_t _aaLen(in void* p) pure nothrow @nogc; private void* _aaGetY(void** paa, const TypeInfo_AssociativeArray ti, in size_t valuesize, in void* pkey) pure nothrow; // inout(void)* _aaGetRvalueX(inout void* p, in TypeInfo keyti, in size_t valuesize, in void* pkey); inout(void)[] _aaValues(inout void* p, in size_t keysize, in size_t valuesize, const TypeInfo tiValArray) pure nothrow; inout(void)[] _aaKeys(inout void* p, in size_t keysize, const TypeInfo tiKeyArray) pure nothrow; void* _aaRehash(void** pp, in TypeInfo keyti) pure nothrow; // alias _dg_t = extern(D) int delegate(void*); // int _aaApply(void* aa, size_t keysize, _dg_t dg); // alias _dg2_t = extern(D) int delegate(void*, void*); // int _aaApply2(void* aa, size_t keysize, _dg2_t dg); private struct AARange { void* impl; size_t idx; } AARange _aaRange(void* aa) pure nothrow @nogc; bool _aaRangeEmpty(AARange r) pure nothrow @nogc; void* _aaRangeFrontKey(AARange r) pure nothrow @nogc; void* _aaRangeFrontValue(AARange r) pure nothrow @nogc; void _aaRangePopFront(ref AARange r) pure nothrow @nogc; /* _d_assocarrayliteralTX marked as pure, because aaLiteral can be called from pure code. This is a typesystem hole, however this is existing hole. Early compiler didn't check purity of toHash or postblit functions, if key is a UDT thus copiler allowed to create AA literal with keys, which have impure unsafe toHash methods. */ void* _d_assocarrayliteralTX(const TypeInfo_AssociativeArray ti, void[] keys, void[] values) pure; } void* aaLiteral(Key, Value)(Key[] keys, Value[] values) @trusted pure { return _d_assocarrayliteralTX(typeid(Value[Key]), *cast(void[]*)&keys, *cast(void[]*)&values); } alias AssociativeArray(Key, Value) = Value[Key]; T rehash(T : Value[Key], Value, Key)(T aa) { _aaRehash(cast(void**)&aa, typeid(Value[Key])); return aa; } T rehash(T : Value[Key], Value, Key)(T* aa) { _aaRehash(cast(void**)aa, typeid(Value[Key])); return *aa; } T rehash(T : shared Value[Key], Value, Key)(T aa) { _aaRehash(cast(void**)&aa, typeid(Value[Key])); return aa; } T rehash(T : shared Value[Key], Value, Key)(T* aa) { _aaRehash(cast(void**)aa, typeid(Value[Key])); return *aa; } V[K] dup(T : V[K], K, V)(T aa) { // Bug10720 - check whether V is copyable static assert(is(typeof({ V v = aa[K.init]; })), "cannot call " ~ T.stringof ~ ".dup because " ~ V.stringof ~ " is not copyable"); V[K] result; //foreach (k, ref v; aa) // result[k] = v; // Bug13701 - won't work if V is not mutable ref V duplicateElem(ref K k, ref const V v) @trusted pure nothrow { import core.stdc.string : memcpy; void* pv = _aaGetY(cast(void**)&result, typeid(V[K]), V.sizeof, &k); memcpy(pv, &v, V.sizeof); return *cast(V*)pv; } if (auto postblit = _getPostblit!V()) { foreach (k, ref v; aa) postblit(duplicateElem(k, v)); } else { foreach (k, ref v; aa) duplicateElem(k, v); } return result; } V[K] dup(T : V[K], K, V)(T* aa) { return (*aa).dup; } auto byKey(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc { static struct Result { AARange r; pure nothrow @nogc: @property bool empty() { return _aaRangeEmpty(r); } @property ref Key front() { return *cast(Key*)_aaRangeFrontKey(r); } void popFront() { _aaRangePopFront(r); } @property Result save() { return this; } } return Result(_aaRange(cast(void*)aa)); } auto byKey(T : Value[Key], Value, Key)(T *aa) pure nothrow @nogc { return (*aa).byKey(); } auto byValue(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc { static struct Result { AARange r; pure nothrow @nogc: @property bool empty() { return _aaRangeEmpty(r); } @property ref Value front() { return *cast(Value*)_aaRangeFrontValue(r); } void popFront() { _aaRangePopFront(r); } @property Result save() { return this; } } return Result(_aaRange(cast(void*)aa)); } auto byValue(T : Value[Key], Value, Key)(T *aa) pure nothrow @nogc { return (*aa).byValue(); } Key[] keys(T : Value[Key], Value, Key)(T aa) @property { auto a = cast(void[])_aaKeys(cast(inout(void)*)aa, Key.sizeof, typeid(Key[])); auto res = *cast(Key[]*)&a; _doPostblit(res); return res; } Key[] keys(T : Value[Key], Value, Key)(T *aa) @property { return (*aa).keys; } Value[] values(T : Value[Key], Value, Key)(T aa) @property { auto a = cast(void[])_aaValues(cast(inout(void)*)aa, Key.sizeof, Value.sizeof, typeid(Value[])); auto res = *cast(Value[]*)&a; _doPostblit(res); return res; } Value[] values(T : Value[Key], Value, Key)(T *aa) @property { return (*aa).values; } auto byKeyValue(T : Value[Key], Value, Key)(T aa) pure nothrow @nogc @property { static struct Result { AARange r; pure nothrow @nogc: @property bool empty() { return _aaRangeEmpty(r); } @property auto front() @trusted { static struct Pair { private Key* keyp; private Value* valp; @property ref inout(Key) key() inout { return *keyp; } @property ref inout(Value) value() inout { return *valp; } } return Pair(cast(Key*)_aaRangeFrontKey(r), cast(Value*)_aaRangeFrontValue(r)); } void popFront() { _aaRangePopFront(r); } @property Result save() { return this; } } return Result(_aaRange(cast(void*)aa)); } inout(V) get(K, V)(inout(V[K]) aa, K key, lazy inout(V) defaultValue) { auto p = key in aa; return p ? *p : defaultValue; } inout(V) get(K, V)(inout(V[K])* aa, K key, lazy inout(V) defaultValue) { return (*aa).get(key, defaultValue); } private void _destructRecurse(S)(ref S s) if (is(S == struct)) { import core.internal.traits : hasElaborateDestructor; static if (__traits(hasMember, S, "__dtor")) s.__dtor(); foreach_reverse (i, ref field; s.tupleof) { static if (hasElaborateDestructor!(typeof(field))) _destructRecurse(field); } } private void _destructRecurse(E, size_t n)(ref E[n] arr) { import core.internal.traits : hasElaborateDestructor; static if (hasElaborateDestructor!E) { foreach_reverse (ref elem; arr) _destructRecurse(elem); } } private string _genFieldPostblit(S)() { import core.internal.traits : hasElaborateCopyConstructor; import core.internal.traits : FieldNameTuple; string code; foreach(fieldName; FieldNameTuple!S) { static if(hasElaborateCopyConstructor!(typeof(__traits(getMember, S.init, fieldName)))) { code ~= ` _postblitRecurse(s.` ~ fieldName ~ `); scope(failure) _destructRecurse(s. ` ~ fieldName ~ `); `; } } return code; } // Public and explicitly undocumented void _postblitRecurse(S)(ref S s) if (is(S == struct)) { mixin(_genFieldPostblit!S()); static if (__traits(hasMember, S, "__postblit")) s.__postblit(); } // Ditto void _postblitRecurse(E, size_t n)(ref E[n] arr) { import core.internal.traits : hasElaborateCopyConstructor; static if (hasElaborateCopyConstructor!E) { size_t i; scope(failure) { for (; i != 0; --i) { _destructRecurse(arr[i - 1]); // What to do if this throws? } } for (i = 0; i < arr.length; ++i) _postblitRecurse(arr[i]); } } void destroy(T)(T obj) if (is(T == class)) { rt_finalize(cast(void*)obj); } void destroy(T)(T obj) if (is(T == interface)) { destroy(cast(Object)obj); } void destroy(T)(ref T obj) if (is(T == struct)) { _destructRecurse(obj); () @trusted { auto buf = (cast(ubyte*) &obj)[0 .. T.sizeof]; auto init = cast(ubyte[])typeid(T).init(); if (init.ptr is null) // null ptr means initialize to 0s buf[] = 0; else buf[] = init[]; } (); } void destroy(T : U[n], U, size_t n)(ref T obj) if (!is(T == struct)) { obj[] = U.init; } void destroy(T)(ref T obj) if (!is(T == struct) && !is(T == interface) && !is(T == class) && !_isStaticArray!T) { obj = T.init; } template _isStaticArray(T : U[N], U, size_t N) { enum bool _isStaticArray = true; } template _isStaticArray(T) { enum bool _isStaticArray = false; } private { extern (C) void _d_arrayshrinkfit(TypeInfo ti, void[] arr) nothrow; extern (C) size_t _d_arraysetcapacity(TypeInfo ti, size_t newcapacity, void *arrptr) pure nothrow; } @property size_t capacity(T)(T[] arr) pure nothrow { return _d_arraysetcapacity(typeid(T[]), 0, cast(void *)&arr); } size_t reserve(T)(ref T[] arr, size_t newcapacity) pure nothrow @trusted { return _d_arraysetcapacity(typeid(T[]), newcapacity, cast(void *)&arr); } auto ref inout(T[]) assumeSafeAppend(T)(auto ref inout(T[]) arr) nothrow { _d_arrayshrinkfit(typeid(T[]), *(cast(void[]*)&arr)); return arr; } bool _ArrayEq(T1, T2)(T1[] a1, T2[] a2) { if (a1.length != a2.length) return false; foreach(i, a; a1) { if (a != a2[i]) return false; } return true; } /** Calculates the hash value of $(D arg) with $(D seed) initial value. Result may be non-equals with $(D typeid(T).getHash(&arg)) The $(D seed) value may be used for hash chaining: ---- struct Test { int a; string b; MyObject c; size_t toHash() const @safe pure nothrow { size_t hash = a.hashOf(); hash = b.hashOf(hash); size_t h1 = c.myMegaHash(); hash = h1.hashOf(hash); //Mix two hash values return hash; } } ---- */ size_t hashOf(T)(auto ref T arg, size_t seed = 0) { import core.internal.hash; return core.internal.hash.hashOf(arg, seed); } bool _xopEquals(in void* ptr, in void* ptr); bool _xopCmp(in void* ptr, in void* ptr); void __ctfeWrite(T...)(auto ref T) {} void __ctfeWriteln(T...)(auto ref T values) { __ctfeWrite(values, "\n"); } template RTInfo(T) { enum RTInfo = cast(void*)0x12345678; } /// Provide the .dup array property. @property auto dup(T)(T[] a) if (!is(const(T) : T)) { import core.internal.traits : Unconst; static assert(is(T : Unconst!T), "Cannot implicitly convert type "~T.stringof~ " to "~Unconst!T.stringof~" in dup."); // wrap unsafe _dup in @trusted to preserve @safe postblit static if (__traits(compiles, (T b) @safe { T a = b; })) return _trustedDup!(T, Unconst!T)(a); else return _dup!(T, Unconst!T)(a); } /// ditto // const overload to support implicit conversion to immutable (unique result, see DIP29) @property T[] dup(T)(const(T)[] a) if (is(const(T) : T)) { // wrap unsafe _dup in @trusted to preserve @safe postblit static if (__traits(compiles, (T b) @safe { T a = b; })) return _trustedDup!(const(T), T)(a); else return _dup!(const(T), T)(a); } /// ditto @property T[] dup(T:void)(const(T)[] a) @trusted { if (__ctfe) assert(0, "Cannot dup a void[] array at compile time."); return cast(T[])_rawDup(a); } /// Provide the .idup array property. @property immutable(T)[] idup(T)(T[] a) { static assert(is(T : immutable(T)), "Cannot implicitly convert type "~T.stringof~ " to immutable in idup."); // wrap unsafe _dup in @trusted to preserve @safe postblit static if (__traits(compiles, (T b) @safe { T a = b; })) return _trustedDup!(T, immutable(T))(a); else return _dup!(T, immutable(T))(a); } /// ditto @property immutable(T)[] idup(T:void)(const(T)[] a) { return .dup(a); } private U[] _trustedDup(T, U)(T[] a) @trusted { return _dup!(T, U)(a); } private U[] _dup(T, U)(T[] a) // pure nothrow depends on postblit { if (__ctfe) { U[] res; foreach (ref e; a) res ~= e; return res; } a = _rawDup(a); auto res = *cast(typeof(return)*)&a; _doPostblit(res); return res; } private extern (C) void[] _d_newarrayU(const TypeInfo ti, size_t length) pure nothrow; private inout(T)[] _rawDup(T)(inout(T)[] a) { import core.stdc.string : memcpy; void[] arr = _d_newarrayU(typeid(T[]), a.length); memcpy(arr.ptr, cast(void*)a.ptr, T.sizeof * a.length); return *cast(inout(T)[]*)&arr; } private template _PostBlitType(T) { // assume that ref T and void* are equivalent in abi level. static if (is(T == struct)) alias _PostBlitType = typeof(function (ref T t){ T a = t; }); else alias _PostBlitType = typeof(delegate (ref T t){ T a = t; }); } // Returns null, or a delegate to call postblit of T private auto _getPostblit(T)() @trusted pure nothrow @nogc { // infer static postblit type, run postblit if any static if (is(T == struct)) { import core.internal.traits : Unqual; // use typeid(Unqual!T) here to skip TypeInfo_Const/Shared/... return cast(_PostBlitType!T)typeid(Unqual!T).xpostblit; } else if ((&typeid(T).postblit).funcptr !is &TypeInfo.postblit) { return cast(_PostBlitType!T)&typeid(T).postblit; } else return null; } private void _doPostblit(T)(T[] arr) { // infer static postblit type, run postblit if any if (auto postblit = _getPostblit!T()) { foreach (ref elem; arr) postblit(elem); } }
D
/// Dealing with query arguments module dpq2.args; @safe: public import dpq2.conv.from_d_types; public import dpq2.conv.from_bson; import dpq2.value; import dpq2.oids: Oid; import std.conv: to; import std.string: toStringz; /// Query parameters struct QueryParams { string sqlCommand; /// SQL command ValueFormat resultFormat = ValueFormat.BINARY; /// Result value format private Value[] _args; // SQL command arguments /// SQL command arguments @property void args(Value[] vargs) { _args = vargs; } /// ditto @property ref inout (Value[]) args() inout pure return { return _args; } /// Fills out arguments from array /// /// Useful for simple text-only query params /// Postgres infers a data type for the parameter in the same way it would do for an untyped literal string. @property void argsFromArray(in string[] arr) { _args.length = arr.length; foreach(i, ref a; _args) a = toValue(arr[i], ValueFormat.TEXT); } /// Fills out arguments from variadic arguments void argsVariadic(Targs ...)(Targs t_args) { _args.length = t_args.length; static foreach(i, T; Targs) { _args[i] = toValue!T(t_args[i]); } } /// Access to prepared statement name /// /// Use it to prepare queries // FIXME: it is need to check in debug mode what sqlCommand is used in "SQL command" or "prepared statement" mode @property string preparedStatementName() const { return sqlCommand; } /// ditto @property void preparedStatementName(string s){ sqlCommand = s; } } unittest { QueryParams qp; qp.argsVariadic(123, "asd", true); assert(qp.args[0] == 123.toValue); assert(qp.args[1] == "asd".toValue); assert(qp.args[2] == true.toValue); } /// Used as parameters by PQexecParams-like functions package struct InternalQueryParams { private { const(string)* sqlCommand; Oid[] oids; int[] formats; int[] lengths; const(ubyte)*[] values; } ValueFormat resultFormat; this(const QueryParams* qp) pure { sqlCommand = &qp.sqlCommand; resultFormat = qp.resultFormat; oids = new Oid[qp.args.length]; formats = new int[qp.args.length]; lengths = new int[qp.args.length]; values = new const(ubyte)* [qp.args.length]; for(int i = 0; i < qp.args.length; ++i) { oids[i] = qp.args[i].oidType; formats[i] = qp.args[i].format; if(!qp.args[i].isNull) { lengths[i] = qp.args[i].data.length.to!int; immutable ubyte[] zeroLengthArg = [123]; // fake value, isn't used as argument if(qp.args[i].data.length == 0) values[i] = &zeroLengthArg[0]; else values[i] = &qp.args[i].data[0]; } } } /// Values used by PQexecParams-like functions const(char)* command() pure const { return cast(const(char)*) (*sqlCommand).toStringz; } /// ditto const(char)* stmtName() pure const { return command(); } /// ditto int nParams() pure const { return values.length.to!int; } /// ditto const(Oid)* paramTypes() pure { if(oids.length == 0) return null; else return &oids[0]; } /// ditto const(ubyte*)* paramValues() pure { if(values.length == 0) return null; else return &values[0]; } /// ditto const(int)* paramLengths() pure { if(lengths.length == 0) return null; else return &lengths[0]; } /// ditto const(int)* paramFormats() pure { if(formats.length == 0) return null; else return &formats[0]; } }
D
instance Mod_1201_SLD_Soeldner_NW (Npc_Default) { // ------ NSC ------ name = NAME_SOELDNER; guild = GIL_mil; id = 1201; voice = 0; flags = 2; //NPC_FLAG_IMMORTAL oder 0 npctype = NPCTYPE_nw_soeldner; // ------ Attribute ------ B_SetAttributesToChapter (self, 4); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6) // ------ Kampf-Taktik ------ fight_tactic = FAI_HUMAN_STRONG; // MASTER / STRONG / COWARD // ------ Equippte Waffen ------ EquipItem (self, ItMw_GrobesKurzschwert); EquipItem (self, ItRw_Sld_Bow); // ------ Inventory ------ B_CreateAmbientInv (self); // ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_L_Tough01, BodyTex_L, ITAR_SLD_L); Mdl_SetModelFatness (self, 0); Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds"); // Tired / Militia / Mage / Arrogance / Relaxed // ------ NSC-relevante Talente vergeben ------ B_GiveNpcTalents (self); // ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt B_SetFightSkills (self, 50); //Grenzen für Talent-Level liegen bei 30 und 60 // ------ TA anmelden ------ daily_routine = Rtn_Start_1201; }; FUNC VOID Rtn_Start_1201 () { TA_Stand_Guarding (08,00,22,00,"NW_BIGFARM_VORPOSTEN1_02"); TA_Stand_Guarding (22,00,08,00,"NW_BIGFARM_VORPOSTEN1_02"); }; FUNC VOID Rtn_Dung_1201 () { TA_Sleep (07,30,23,30,"NW_BIGFARM_HOUSE_08"); TA_Sleep (23,30,07,30,"NW_BIGFARM_HOUSE_08"); }; FUNC VOID Rtn_Hexen_1201() { TA_Stand_WP (08,00,20,00,"NW_BIGFARM_CROSS"); TA_Stand_WP (20,00,08,00,"NW_BIGFARM_CROSS"); }; FUNC VOID Rtn_Diener_1201() { TA_RunToWP (08,00,20,00,"NW_FARM4_WOOD_MONSTER_MORE_03"); TA_RunToWP (20,00,08,00,"NW_FARM4_WOOD_MONSTER_MORE_03"); }; FUNC VOID Rtn_Knucker_1201() { TA_RunToWP (08,00,20,00,"WP_DRAGON_KNUCKERUNDCO_SMALLTALK"); TA_RunToWP (20,00,08,00,"WP_DRAGON_KNUCKERUNDCO_SMALLTALK"); }; FUNC VOID Rtn_Daemonisch_1201() { TA_Stand_Eating (08,00,20,00,"NW_BIGFARM_KITCHEN_09"); TA_Stand_Eating (20,00,08,00,"NW_BIGFARM_KITCHEN_09"); };
D
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.build/Data/TemplateDataEncoder.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSource.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Uppercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Lowercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Capitalize.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateTag.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConditional.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateCustom.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateExpression.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Var.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/ViewRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/TemplateError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIterator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Contains.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/DateFormat.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConstant.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Comment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Print.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Count.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Raw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateRaw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/View.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntax.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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 /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.build/TemplateDataEncoder~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSource.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Uppercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Lowercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Capitalize.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateTag.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConditional.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateCustom.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateExpression.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Var.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/ViewRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/TemplateError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIterator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Contains.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/DateFormat.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConstant.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Comment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Print.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Count.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Raw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateRaw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/View.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntax.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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 /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.build/TemplateDataEncoder~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateData.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSource.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Uppercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Lowercase.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Capitalize.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateTag.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConditional.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateCustom.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateExpression.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Var.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/ViewRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/TemplateError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateIterator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Contains.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/DateFormat.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateConstant.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Comment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Print.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Count.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/TagContext.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/Tag/Raw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateRaw.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/View.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/template-kit.git-6616349092713276412/Sources/TemplateKit/AST/TemplateSyntax.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.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 /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIODarwin/include/c_nio_darwin.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.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
// Written in the D programming language. /++ $(SECTION Overview) $(P The $(D std.uni) module provides an implementation of fundamental Unicode algorithms and data structures. This doesn't include UTF encoding and decoding primitives, see $(XREF _utf, decode) and $(XREF _utf, encode) in std.utf for this functionality. ) $(P All primitives listed operate on Unicode characters and sets of characters. For functions which operate on ASCII characters and ignore Unicode $(CHARACTERS), see $(LINK2 std_ascii.html, std.ascii). For definitions of Unicode $(CHARACTER), $(CODEPOINT) and other terms used throughout this module see the $(S_LINK Terminology, terminology) section below. ) $(P The focus of this module is the core needs of developing Unicode-aware applications. To that effect it provides the following optimized primitives: ) $(UL $(LI Character classification by category and common properties: $(LREF isAlpha), $(LREF isWhite) and others. ) $(LI Case-insensitive string comparison ($(LREF sicmp), $(LREF icmp)). ) $(LI Converting text to any of the four normalization forms via $(LREF normalize). ) $(LI Decoding ($(LREF decodeGrapheme)) and iteration ($(LREF byGrapheme), $(LREF graphemeStride)) by user-perceived characters, that is by $(LREF Grapheme) clusters. ) $(LI Decomposing and composing of individual character(s) according to canonical or compatibility rules, see $(LREF compose) and $(LREF decompose), including the specific version for Hangul syllables $(LREF composeJamo) and $(LREF decomposeHangul). ) ) $(P It's recognized that an application may need further enhancements and extensions, such as less commonly known algorithms, or tailoring existing ones for region specific needs. To help users with building any extra functionality beyond the core primitives, the module provides: ) $(UL $(LI $(LREF CodepointSet), a type for easy manipulation of sets of characters. Besides the typical set algebra it provides an unusual feature: a D source code generator for detection of $(CODEPOINTS) in this set. This is a boon for meta-programming parser frameworks, and is used internally to power classification in small sets like $(LREF isWhite). ) $(LI A way to construct optimal packed multi-stage tables also known as a special case of $(LUCKY Trie). The functions $(LREF codepointTrie), $(LREF codepointSetTrie) construct custom tries that map dchar to value. The end result is a fast and predictable $(BIGOH 1) lookup that powers functions like $(LREF isAlpha) and $(LREF combiningClass), but for user-defined data sets. ) $(LI Generally useful building blocks for customized normalization: $(LREF combiningClass) for querying combining class and $(LREF allowedIn) for testing the Quick_Check property of a given normalization form. ) $(LI Access to a large selection of commonly used sets of $(CODEPOINTS). $(S_LINK Unicode properties, Supported sets) include Script, Block and General Category. The exact contents of a set can be observed in the CLDR utility, on the $(WEB www.unicode.org/cldr/utility/properties.jsp, property index) page of the Unicode website. See $(LREF unicode) for easy and (optionally) compile-time checked set queries. ) ) $(SECTION Synopsis) --- import std.uni; void main() { // initialize code point sets using script/block or property name // now 'set' contains code points from both scripts. auto set = unicode("Cyrillic") | unicode("Armenian"); // same thing but simpler and checked at compile-time auto ascii = unicode.ASCII; auto currency = unicode.Currency_Symbol; // easy set ops auto a = set & ascii; assert(a.empty); // as it has no intersection with ascii a = set | ascii; auto b = currency - a; // subtract all ASCII, Cyrillic and Armenian // some properties of code point sets assert(b.length > 45); // 46 items in Unicode 6.1, even more in 6.2 // testing presence of a code point in a set // is just fine, it is O(logN) assert(!b['$']); assert(!b['\u058F']); // Armenian dram sign assert(b['¥']); // building fast lookup tables, these guarantee O(1) complexity // 1-level Trie lookup table essentially a huge bit-set ~262Kb auto oneTrie = toTrie!1(b); // 2-level far more compact but typically slightly slower auto twoTrie = toTrie!2(b); // 3-level even smaller, and a bit slower yet auto threeTrie = toTrie!3(b); assert(oneTrie['£']); assert(twoTrie['£']); assert(threeTrie['£']); // build the trie with the most sensible trie level // and bind it as a functor auto cyrillicOrArmenian = toDelegate(set); auto balance = find!(cyrillicOrArmenian)("Hello ընկեր!"); assert(balance == "ընկեր!"); // compatible with bool delegate(dchar) bool delegate(dchar) bindIt = cyrillicOrArmenian; // Normalization string s = "Plain ascii (and not only), is always normalized!"; assert(s is normalize(s));// is the same string string nonS = "A\u0308ffin"; // A ligature auto nS = normalize(nonS); // to NFC, the W3C endorsed standard assert(nS == "Äffin"); assert(nS != nonS); string composed = "Äffin"; assert(normalize!NFD(composed) == "A\u0308ffin"); // to NFKD, compatibility decomposition useful for fuzzy matching/searching assert(normalize!NFKD("2¹⁰") == "210"); } --- $(SECTION Terminology) $(P The following is a list of important Unicode notions and definitions. Any conventions used specifically in this module alone are marked as such. The descriptions are based on the formal definition as found in $(WEB http://www.unicode.org/versions/Unicode6.2.0/ch03.pdf, chapter three of The Unicode Standard Core Specification.) ) $(P $(DEF Abstract character) A unit of information used for the organization, control, or representation of textual data. Note that: $(UL $(LI When representing data, the nature of that data is generally symbolic as opposed to some other kind of data (for example, visual).) $(LI An abstract character has no concrete form and should not be confused with a $(S_LINK Glyph, glyph).) $(LI An abstract character does not necessarily correspond to what a user thinks of as a “character” and should not be confused with a $(LREF Grapheme).) $(LI The abstract characters encoded (see Encoded character) are known as Unicode abstract characters.) $(LI Abstract characters not directly encoded by the Unicode Standard can often be represented by the use of combining character sequences.) ) ) $(P $(DEF Canonical decomposition) The decomposition of a character or character sequence that results from recursively applying the canonical mappings found in the Unicode Character Database and these described in Conjoining Jamo Behavior (section 12 of $(WEB www.unicode.org/uni2book/ch03.pdf, Unicode Conformance)). ) $(P $(DEF Canonical composition) The precise definition of the Canonical composition is the algorithm as specified in $(WEB www.unicode.org/uni2book/ch03.pdf, Unicode Conformance) section 11. Informally it's the process that does the reverse of the canonical decomposition with the addition of certain rules that e.g. prevent legacy characters from appearing in the composed result. ) $(P $(DEF Canonical equivalent) Two character sequences are said to be canonical equivalents if their full canonical decompositions are identical. ) $(P $(DEF Character) Typically differs by context. For the purpose of this documentation the term $(I character) implies $(I encoded character), that is, a code point having an assigned abstract character (a symbolic meaning). ) $(P $(DEF Code point) Any value in the Unicode codespace; that is, the range of integers from 0 to 10FFFF (hex). Not all code points are assigned to encoded characters. ) $(P $(DEF Code unit) The minimal bit combination that can represent a unit of encoded text for processing or interchange. Depending on the encoding this could be: 8-bit code units in the UTF-8 ($(D char)), 16-bit code units in the UTF-16 ($(D wchar)), and 32-bit code units in the UTF-32 ($(D dchar)). $(I Note that in UTF-32, a code unit is a code point and is represented by the D $(D dchar) type.) ) $(P $(DEF Combining character) A character with the General Category of Combining Mark(M). $(UL $(LI All characters with non-zero canonical combining class are combining characters, but the reverse is not the case: there are combining characters with a zero combining class. ) $(LI These characters are not normally used in isolation unless they are being described. They include such characters as accents, diacritics, Hebrew points, Arabic vowel signs, and Indic matras. ) ) ) $(P $(DEF Combining class) A numerical value used by the Unicode Canonical Ordering Algorithm to determine which sequences of combining marks are to be considered canonically equivalent and which are not. ) $(P $(DEF Compatibility decomposition) The decomposition of a character or character sequence that results from recursively applying both the compatibility mappings and the canonical mappings found in the Unicode Character Database, and those described in Conjoining Jamo Behavior no characters can be further decomposed. ) $(P $(DEF Compatibility equivalent) Two character sequences are said to be compatibility equivalents if their full compatibility decompositions are identical. ) $(P $(DEF Encoded character) An association (or mapping) between an abstract character and a code point. ) $(P $(DEF Glyph) The actual, concrete image of a glyph representation having been rasterized or otherwise imaged onto some display surface. ) $(P $(DEF Grapheme base) A character with the property Grapheme_Base, or any standard Korean syllable block. ) $(P $(DEF Grapheme cluster) Defined as the text between grapheme boundaries as specified by Unicode Standard Annex #29, $(WEB www.unicode.org/reports/tr29/, Unicode text segmentation). Important general properties of a grapheme: $(UL $(LI The grapheme cluster represents a horizontally segmentable unit of text, consisting of some grapheme base (which may consist of a Korean syllable) together with any number of nonspacing marks applied to it. ) $(LI A grapheme cluster typically starts with a grapheme base and then extends across any subsequent sequence of nonspacing marks. A grapheme cluster is most directly relevant to text rendering and processes such as cursor placement and text selection in editing, but may also be relevant to comparison and searching. ) $(LI For many processes, a grapheme cluster behaves as if it was a single character with the same properties as its grapheme base. Effectively, nonspacing marks apply $(I graphically) to the base, but do not change its properties. ) ) $(P This module defines a number of primitives that work with graphemes: $(LREF Grapheme), $(LREF decodeGrapheme) and $(LREF graphemeStride). All of them are using $(I extended grapheme) boundaries as defined in the aforementioned standard annex. ) ) $(P $(DEF Nonspacing mark) A combining character with the General Category of Nonspacing Mark (Mn) or Enclosing Mark (Me). ) $(P $(DEF Spacing mark) A combining character that is not a nonspacing mark.) $(SECTION Normalization) $(P The concepts of $(S_LINK Canonical equivalent, canonical equivalent) or $(S_LINK Compatibility equivalent, compatibility equivalent) characters in the Unicode Standard make it necessary to have a full, formal definition of equivalence for Unicode strings. String equivalence is determined by a process called normalization, whereby strings are converted into forms which are compared directly for identity. This is the primary goal of the normalization process, see the function $(LREF normalize) to convert into any of the four defined forms. ) $(P A very important attribute of the Unicode Normalization Forms is that they must remain stable between versions of the Unicode Standard. A Unicode string normalized to a particular Unicode Normalization Form in one version of the standard is guaranteed to remain in that Normalization Form for implementations of future versions of the standard. ) $(P The Unicode Standard specifies four normalization forms. Informally, two of these forms are defined by maximal decomposition of equivalent sequences, and two of these forms are defined by maximal $(I composition) of equivalent sequences. $(UL $(LI Normalization Form D (NFD): The $(S_LINK Canonical decomposition, canonical decomposition) of a character sequence.) $(LI Normalization Form KD (NFKD): The $(S_LINK Compatibility decomposition, compatibility decomposition) of a character sequence.) $(LI Normalization Form C (NFC): The canonical composition of the $(S_LINK Canonical decomposition, canonical decomposition) of a coded character sequence.) $(LI Normalization Form KC (NFKC): The canonical composition of the $(S_LINK Compatibility decomposition, compatibility decomposition) of a character sequence) ) ) $(P The choice of the normalization form depends on the particular use case. NFC is the best form for general text, since it's more compatible with strings converted from legacy encodings. NFKC is the preferred form for identifiers, especially where there are security concerns. NFD and NFKD are the most useful for internal processing. ) $(SECTION Construction of lookup tables) $(P The Unicode standard describes a set of algorithms that depend on having the ability to quickly look up various properties of a code point. Given the the codespace of about 1 million $(CODEPOINTS), it is not a trivial task to provide a space-efficient solution for the multitude of properties.) $(P Common approaches such as hash-tables or binary search over sorted code point intervals (as in $(LREF InversionList)) are insufficient. Hash-tables have enormous memory footprint and binary search over intervals is not fast enough for some heavy-duty algorithms. ) $(P The recommended solution (see Unicode Implementation Guidelines) is using multi-stage tables that are an implementation of the $(WEB http://en.wikipedia.org/wiki/Trie, Trie) data structure with integer keys and a fixed number of stages. For the remainder of the section this will be called a fixed trie. The following describes a particular implementation that is aimed for the speed of access at the expense of ideal size savings. ) $(P Taking a 2-level Trie as an example the principle of operation is as follows. Split the number of bits in a key (code point, 21 bits) into 2 components (e.g. 15 and 8). The first is the number of bits in the index of the trie and the other is number of bits in each page of the trie. The layout of the trie is then an array of size 2^^bits-of-index followed an array of memory chunks of size 2^^bits-of-page/bits-per-element. ) $(P The number of pages is variable (but not less then 1) unlike the number of entries in the index. The slots of the index all have to contain a number of a page that is present. The lookup is then just a couple of operations - slice the upper bits, lookup an index for these, take a page at this index and use the lower bits as an offset within this page. Assuming that pages are laid out consequently in one array at $(D pages), the pseudo-code is: ) --- auto elemsPerPage = (2 ^^ bits_per_page) / Value.sizeOfInBits; pages[index[n >> bits_per_page]][n & (elemsPerPage - 1)]; --- $(P Where if $(D elemsPerPage) is a power of 2 the whole process is a handful of simple instructions and 2 array reads. Subsequent levels of the trie are introduced by recursing on this notion - the index array is treated as values. The number of bits in index is then again split into 2 parts, with pages over 'current-index' and the new 'upper-index'. ) $(P For completeness a level 1 trie is simply an array. The current implementation takes advantage of bit-packing values when the range is known to be limited in advance (such as $(D bool)). See also $(LREF BitPacked) for enforcing it manually. The major size advantage however comes from the fact that multiple $(B identical pages on every level are merged) by construction. ) $(P The process of constructing a trie is more involved and is hidden from the user in a form of the convenience functions $(LREF codepointTrie), $(LREF codepointSetTrie) and the even more convenient $(LREF toTrie). In general a set or built-in AA with $(D dchar) type can be turned into a trie. The trie object in this module is read-only (immutable); it's effectively frozen after construction. ) $(SECTION Unicode properties) $(P This is a full list of Unicode properties accessible through $(LREF unicode) with specific helpers per category nested within. Consult the $(WEB www.unicode.org/cldr/utility/properties.jsp, CLDR utility) when in doubt about the contents of a particular set.) $(P General category sets listed below are only accessible with the $(LREF unicode) shorthand accessor.) $(BOOKTABLE $(B General category ), $(TR $(TH Abb.) $(TH Long form) $(TH Abb.) $(TH Long form)$(TH Abb.) $(TH Long form)) $(TR $(TD L) $(TD Letter) $(TD Cn) $(TD Unassigned) $(TD Po) $(TD Other_Punctuation)) $(TR $(TD Ll) $(TD Lowercase_Letter) $(TD Co) $(TD Private_Use) $(TD Ps) $(TD Open_Punctuation)) $(TR $(TD Lm) $(TD Modifier_Letter) $(TD Cs) $(TD Surrogate) $(TD S) $(TD Symbol)) $(TR $(TD Lo) $(TD Other_Letter) $(TD N) $(TD Number) $(TD Sc) $(TD Currency_Symbol)) $(TR $(TD Lt) $(TD Titlecase_Letter) $(TD Nd) $(TD Decimal_Number) $(TD Sk) $(TD Modifier_Symbol)) $(TR $(TD Lu) $(TD Uppercase_Letter) $(TD Nl) $(TD Letter_Number) $(TD Sm) $(TD Math_Symbol)) $(TR $(TD M) $(TD Mark) $(TD No) $(TD Other_Number) $(TD So) $(TD Other_Symbol)) $(TR $(TD Mc) $(TD Spacing_Mark) $(TD P) $(TD Punctuation) $(TD Z) $(TD Separator)) $(TR $(TD Me) $(TD Enclosing_Mark) $(TD Pc) $(TD Connector_Punctuation) $(TD Zl) $(TD Line_Separator)) $(TR $(TD Mn) $(TD Nonspacing_Mark) $(TD Pd) $(TD Dash_Punctuation) $(TD Zp) $(TD Paragraph_Separator)) $(TR $(TD C) $(TD Other) $(TD Pe) $(TD Close_Punctuation) $(TD Zs) $(TD Space_Separator)) $(TR $(TD Cc) $(TD Control) $(TD Pf) $(TD Final_Punctuation) $(TD -) $(TD Any)) $(TR $(TD Cf) $(TD Format) $(TD Pi) $(TD Initial_Punctuation) $(TD -) $(TD ASCII)) ) $(P Sets for other commonly useful properties that are accessible with $(LREF unicode):) $(BOOKTABLE $(B Common binary properties), $(TR $(TH Name) $(TH Name) $(TH Name)) $(TR $(TD Alphabetic) $(TD Ideographic) $(TD Other_Uppercase)) $(TR $(TD ASCII_Hex_Digit) $(TD IDS_Binary_Operator) $(TD Pattern_Syntax)) $(TR $(TD Bidi_Control) $(TD ID_Start) $(TD Pattern_White_Space)) $(TR $(TD Cased) $(TD IDS_Trinary_Operator) $(TD Quotation_Mark)) $(TR $(TD Case_Ignorable) $(TD Join_Control) $(TD Radical)) $(TR $(TD Dash) $(TD Logical_Order_Exception) $(TD Soft_Dotted)) $(TR $(TD Default_Ignorable_Code_Point) $(TD Lowercase) $(TD STerm)) $(TR $(TD Deprecated) $(TD Math) $(TD Terminal_Punctuation)) $(TR $(TD Diacritic) $(TD Noncharacter_Code_Point) $(TD Unified_Ideograph)) $(TR $(TD Extender) $(TD Other_Alphabetic) $(TD Uppercase)) $(TR $(TD Grapheme_Base) $(TD Other_Default_Ignorable_Code_Point) $(TD Variation_Selector)) $(TR $(TD Grapheme_Extend) $(TD Other_Grapheme_Extend) $(TD White_Space)) $(TR $(TD Grapheme_Link) $(TD Other_ID_Continue) $(TD XID_Continue)) $(TR $(TD Hex_Digit) $(TD Other_ID_Start) $(TD XID_Start)) $(TR $(TD Hyphen) $(TD Other_Lowercase) ) $(TR $(TD ID_Continue) $(TD Other_Math) ) ) $(P Bellow is the table with block names accepted by $(LREF unicode.block). Note that the shorthand version $(LREF unicode) requires "In" to be prepended to the names of blocks so as to disambiguate scripts and blocks.) $(BOOKTABLE $(B Blocks), $(TR $(TD Aegean Numbers) $(TD Ethiopic Extended) $(TD Mongolian)) $(TR $(TD Alchemical Symbols) $(TD Ethiopic Extended-A) $(TD Musical Symbols)) $(TR $(TD Alphabetic Presentation Forms) $(TD Ethiopic Supplement) $(TD Myanmar)) $(TR $(TD Ancient Greek Musical Notation) $(TD General Punctuation) $(TD Myanmar Extended-A)) $(TR $(TD Ancient Greek Numbers) $(TD Geometric Shapes) $(TD New Tai Lue)) $(TR $(TD Ancient Symbols) $(TD Georgian) $(TD NKo)) $(TR $(TD Arabic) $(TD Georgian Supplement) $(TD Number Forms)) $(TR $(TD Arabic Extended-A) $(TD Glagolitic) $(TD Ogham)) $(TR $(TD Arabic Mathematical Alphabetic Symbols) $(TD Gothic) $(TD Ol Chiki)) $(TR $(TD Arabic Presentation Forms-A) $(TD Greek and Coptic) $(TD Old Italic)) $(TR $(TD Arabic Presentation Forms-B) $(TD Greek Extended) $(TD Old Persian)) $(TR $(TD Arabic Supplement) $(TD Gujarati) $(TD Old South Arabian)) $(TR $(TD Armenian) $(TD Gurmukhi) $(TD Old Turkic)) $(TR $(TD Arrows) $(TD Halfwidth and Fullwidth Forms) $(TD Optical Character Recognition)) $(TR $(TD Avestan) $(TD Hangul Compatibility Jamo) $(TD Oriya)) $(TR $(TD Balinese) $(TD Hangul Jamo) $(TD Osmanya)) $(TR $(TD Bamum) $(TD Hangul Jamo Extended-A) $(TD Phags-pa)) $(TR $(TD Bamum Supplement) $(TD Hangul Jamo Extended-B) $(TD Phaistos Disc)) $(TR $(TD Basic Latin) $(TD Hangul Syllables) $(TD Phoenician)) $(TR $(TD Batak) $(TD Hanunoo) $(TD Phonetic Extensions)) $(TR $(TD Bengali) $(TD Hebrew) $(TD Phonetic Extensions Supplement)) $(TR $(TD Block Elements) $(TD High Private Use Surrogates) $(TD Playing Cards)) $(TR $(TD Bopomofo) $(TD High Surrogates) $(TD Private Use Area)) $(TR $(TD Bopomofo Extended) $(TD Hiragana) $(TD Rejang)) $(TR $(TD Box Drawing) $(TD Ideographic Description Characters) $(TD Rumi Numeral Symbols)) $(TR $(TD Brahmi) $(TD Imperial Aramaic) $(TD Runic)) $(TR $(TD Braille Patterns) $(TD Inscriptional Pahlavi) $(TD Samaritan)) $(TR $(TD Buginese) $(TD Inscriptional Parthian) $(TD Saurashtra)) $(TR $(TD Buhid) $(TD IPA Extensions) $(TD Sharada)) $(TR $(TD Byzantine Musical Symbols) $(TD Javanese) $(TD Shavian)) $(TR $(TD Carian) $(TD Kaithi) $(TD Sinhala)) $(TR $(TD Chakma) $(TD Kana Supplement) $(TD Small Form Variants)) $(TR $(TD Cham) $(TD Kanbun) $(TD Sora Sompeng)) $(TR $(TD Cherokee) $(TD Kangxi Radicals) $(TD Spacing Modifier Letters)) $(TR $(TD CJK Compatibility) $(TD Kannada) $(TD Specials)) $(TR $(TD CJK Compatibility Forms) $(TD Katakana) $(TD Sundanese)) $(TR $(TD CJK Compatibility Ideographs) $(TD Katakana Phonetic Extensions) $(TD Sundanese Supplement)) $(TR $(TD CJK Compatibility Ideographs Supplement) $(TD Kayah Li) $(TD Superscripts and Subscripts)) $(TR $(TD CJK Radicals Supplement) $(TD Kharoshthi) $(TD Supplemental Arrows-A)) $(TR $(TD CJK Strokes) $(TD Khmer) $(TD Supplemental Arrows-B)) $(TR $(TD CJK Symbols and Punctuation) $(TD Khmer Symbols) $(TD Supplemental Mathematical Operators)) $(TR $(TD CJK Unified Ideographs) $(TD Lao) $(TD Supplemental Punctuation)) $(TR $(TD CJK Unified Ideographs Extension A) $(TD Latin-1 Supplement) $(TD Supplementary Private Use Area-A)) $(TR $(TD CJK Unified Ideographs Extension B) $(TD Latin Extended-A) $(TD Supplementary Private Use Area-B)) $(TR $(TD CJK Unified Ideographs Extension C) $(TD Latin Extended Additional) $(TD Syloti Nagri)) $(TR $(TD CJK Unified Ideographs Extension D) $(TD Latin Extended-B) $(TD Syriac)) $(TR $(TD Combining Diacritical Marks) $(TD Latin Extended-C) $(TD Tagalog)) $(TR $(TD Combining Diacritical Marks for Symbols) $(TD Latin Extended-D) $(TD Tagbanwa)) $(TR $(TD Combining Diacritical Marks Supplement) $(TD Lepcha) $(TD Tags)) $(TR $(TD Combining Half Marks) $(TD Letterlike Symbols) $(TD Tai Le)) $(TR $(TD Common Indic Number Forms) $(TD Limbu) $(TD Tai Tham)) $(TR $(TD Control Pictures) $(TD Linear B Ideograms) $(TD Tai Viet)) $(TR $(TD Coptic) $(TD Linear B Syllabary) $(TD Tai Xuan Jing Symbols)) $(TR $(TD Counting Rod Numerals) $(TD Lisu) $(TD Takri)) $(TR $(TD Cuneiform) $(TD Low Surrogates) $(TD Tamil)) $(TR $(TD Cuneiform Numbers and Punctuation) $(TD Lycian) $(TD Telugu)) $(TR $(TD Currency Symbols) $(TD Lydian) $(TD Thaana)) $(TR $(TD Cypriot Syllabary) $(TD Mahjong Tiles) $(TD Thai)) $(TR $(TD Cyrillic) $(TD Malayalam) $(TD Tibetan)) $(TR $(TD Cyrillic Extended-A) $(TD Mandaic) $(TD Tifinagh)) $(TR $(TD Cyrillic Extended-B) $(TD Mathematical Alphanumeric Symbols) $(TD Transport And Map Symbols)) $(TR $(TD Cyrillic Supplement) $(TD Mathematical Operators) $(TD Ugaritic)) $(TR $(TD Deseret) $(TD Meetei Mayek) $(TD Unified Canadian Aboriginal Syllabics)) $(TR $(TD Devanagari) $(TD Meetei Mayek Extensions) $(TD Unified Canadian Aboriginal Syllabics Extended)) $(TR $(TD Devanagari Extended) $(TD Meroitic Cursive) $(TD Vai)) $(TR $(TD Dingbats) $(TD Meroitic Hieroglyphs) $(TD Variation Selectors)) $(TR $(TD Domino Tiles) $(TD Miao) $(TD Variation Selectors Supplement)) $(TR $(TD Egyptian Hieroglyphs) $(TD Miscellaneous Mathematical Symbols-A) $(TD Vedic Extensions)) $(TR $(TD Emoticons) $(TD Miscellaneous Mathematical Symbols-B) $(TD Vertical Forms)) $(TR $(TD Enclosed Alphanumerics) $(TD Miscellaneous Symbols) $(TD Yijing Hexagram Symbols)) $(TR $(TD Enclosed Alphanumeric Supplement) $(TD Miscellaneous Symbols and Arrows) $(TD Yi Radicals)) $(TR $(TD Enclosed CJK Letters and Months) $(TD Miscellaneous Symbols And Pictographs) $(TD Yi Syllables)) $(TR $(TD Enclosed Ideographic Supplement) $(TD Miscellaneous Technical) ) $(TR $(TD Ethiopic) $(TD Modifier Tone Letters) ) ) $(P Bellow is the table with script names accepted by $(LREF unicode.script) and by the shorthand version $(LREF unicode):) $(BOOKTABLE $(B Scripts), $(TR $(TD Arabic) $(TD Hanunoo) $(TD Old_Italic)) $(TR $(TD Armenian) $(TD Hebrew) $(TD Old_Persian)) $(TR $(TD Avestan) $(TD Hiragana) $(TD Old_South_Arabian)) $(TR $(TD Balinese) $(TD Imperial_Aramaic) $(TD Old_Turkic)) $(TR $(TD Bamum) $(TD Inherited) $(TD Oriya)) $(TR $(TD Batak) $(TD Inscriptional_Pahlavi) $(TD Osmanya)) $(TR $(TD Bengali) $(TD Inscriptional_Parthian) $(TD Phags_Pa)) $(TR $(TD Bopomofo) $(TD Javanese) $(TD Phoenician)) $(TR $(TD Brahmi) $(TD Kaithi) $(TD Rejang)) $(TR $(TD Braille) $(TD Kannada) $(TD Runic)) $(TR $(TD Buginese) $(TD Katakana) $(TD Samaritan)) $(TR $(TD Buhid) $(TD Kayah_Li) $(TD Saurashtra)) $(TR $(TD Canadian_Aboriginal) $(TD Kharoshthi) $(TD Sharada)) $(TR $(TD Carian) $(TD Khmer) $(TD Shavian)) $(TR $(TD Chakma) $(TD Lao) $(TD Sinhala)) $(TR $(TD Cham) $(TD Latin) $(TD Sora_Sompeng)) $(TR $(TD Cherokee) $(TD Lepcha) $(TD Sundanese)) $(TR $(TD Common) $(TD Limbu) $(TD Syloti_Nagri)) $(TR $(TD Coptic) $(TD Linear_B) $(TD Syriac)) $(TR $(TD Cuneiform) $(TD Lisu) $(TD Tagalog)) $(TR $(TD Cypriot) $(TD Lycian) $(TD Tagbanwa)) $(TR $(TD Cyrillic) $(TD Lydian) $(TD Tai_Le)) $(TR $(TD Deseret) $(TD Malayalam) $(TD Tai_Tham)) $(TR $(TD Devanagari) $(TD Mandaic) $(TD Tai_Viet)) $(TR $(TD Egyptian_Hieroglyphs) $(TD Meetei_Mayek) $(TD Takri)) $(TR $(TD Ethiopic) $(TD Meroitic_Cursive) $(TD Tamil)) $(TR $(TD Georgian) $(TD Meroitic_Hieroglyphs) $(TD Telugu)) $(TR $(TD Glagolitic) $(TD Miao) $(TD Thaana)) $(TR $(TD Gothic) $(TD Mongolian) $(TD Thai)) $(TR $(TD Greek) $(TD Myanmar) $(TD Tibetan)) $(TR $(TD Gujarati) $(TD New_Tai_Lue) $(TD Tifinagh)) $(TR $(TD Gurmukhi) $(TD Nko) $(TD Ugaritic)) $(TR $(TD Han) $(TD Ogham) $(TD Vai)) $(TR $(TD Hangul) $(TD Ol_Chiki) $(TD Yi)) ) $(P Bellow is the table of names accepted by $(LREF unicode.hangulSyllableType).) $(BOOKTABLE $(B Hangul syllable type), $(TR $(TH Abb.) $(TH Long form)) $(TR $(TD L) $(TD Leading_Jamo)) $(TR $(TD LV) $(TD LV_Syllable)) $(TR $(TD LVT) $(TD LVT_Syllable) ) $(TR $(TD T) $(TD Trailing_Jamo)) $(TR $(TD V) $(TD Vowel_Jamo)) ) References: $(WEB www.digitalmars.com/d/ascii-table.html, ASCII Table), $(WEB en.wikipedia.org/wiki/Unicode, Wikipedia), $(WEB www.unicode.org, The Unicode Consortium), $(WEB www.unicode.org/reports/tr15/, Unicode normalization forms), $(WEB www.unicode.org/reports/tr29/, Unicode text segmentation) $(WEB www.unicode.org/uni2book/ch05.pdf, Unicode Implementation Guidelines) $(WEB www.unicode.org/uni2book/ch03.pdf, Unicode Conformance) Trademarks: Unicode(tm) is a trademark of Unicode, Inc. Macros: WIKI=Phobos/StdUni Copyright: Copyright 2013 - License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: Dmitry Olshansky Source: $(PHOBOSSRC std/_uni.d) Standards: $(WEB www.unicode.org/versions/Unicode6.2.0/, Unicode v6.2) Macros: SECTION = <h3><a id="$1">$0</a></h3> DEF = <div><a id="$1"><i>$0</i></a></div> S_LINK = <a href="#$1">$+</a> CODEPOINT = $(S_LINK Code point, code point) CODEPOINTS = $(S_LINK Code point, code points) CHARACTER = $(S_LINK Character, character) CHARACTERS = $(S_LINK Character, characters) CLUSTER = $(S_LINK Grapheme cluster, grapheme cluster) +/ module std.uni; static import std.ascii; import std.traits, std.range, std.algorithm, std.conv, std.typetuple, std.exception, core.stdc.stdlib; import std.array; //@@BUG UFCS doesn't work with 'local' imports import core.bitop; import std.typecons; // debug = std_uni; debug(std_uni) import std.stdio; private: version(std_uni_bootstrap){} else { import std.internal.unicode_tables; // generated file } void copyBackwards(T)(T[] src, T[] dest) { assert(src.length == dest.length); for(size_t i=src.length; i-- > 0; ) dest[i] = src[i]; } void copyForward(T)(T[] src, T[] dest) { assert(src.length == dest.length); for(size_t i=0; i<src.length; i++) dest[i] = src[i]; } // TODO: update to reflect all major CPUs supporting unaligned reads version(X86) enum hasUnalignedReads = true; else version(X86_64) enum hasUnalignedReads = true; else enum hasUnalignedReads = false; // better be safe then sorry public enum dchar lineSep = '\u2028'; /// Constant $(CODEPOINT) (0x2028) - line separator. public enum dchar paraSep = '\u2029'; /// Constant $(CODEPOINT) (0x2029) - paragraph separator. // test the intro example unittest { // initialize code point sets using script/block or property name // set contains code points from both scripts. auto set = unicode("Cyrillic") | unicode("Armenian"); // or simpler and statically-checked look auto ascii = unicode.ASCII; auto currency = unicode.Currency_Symbol; // easy set ops auto a = set & ascii; assert(a.empty); // as it has no intersection with ascii a = set | ascii; auto b = currency - a; // subtract all ASCII, Cyrillic and Armenian // some properties of code point sets assert(b.length > 45); // 46 items in Unicode 6.1, even more in 6.2 // testing presence of a code point in a set // is just fine, it is O(logN) assert(!b['$']); assert(!b['\u058F']); // Armenian dram sign assert(b['¥']); // building fast lookup tables, these guarantee O(1) complexity // 1-level Trie lookup table essentially a huge bit-set ~262Kb auto oneTrie = toTrie!1(b); // 2-level far more compact but typically slightly slower auto twoTrie = toTrie!2(b); // 3-level even smaller, and a bit slower yet auto threeTrie = toTrie!3(b); assert(oneTrie['£']); assert(twoTrie['£']); assert(threeTrie['£']); // build the trie with the most sensible trie level // and bind it as a functor auto cyrillicOrArmenian = toDelegate(set); auto balance = find!(cyrillicOrArmenian)("Hello ընկեր!"); assert(balance == "ընկեր!"); // compatible with bool delegate(dchar) bool delegate(dchar) bindIt = cyrillicOrArmenian; // Normalization string s = "Plain ascii (and not only), is always normalized!"; assert(s is normalize(s));// is the same string string nonS = "A\u0308ffin"; // A ligature auto nS = normalize(nonS); // to NFC, the W3C endorsed standard assert(nS == "Äffin"); assert(nS != nonS); string composed = "Äffin"; assert(normalize!NFD(composed) == "A\u0308ffin"); // to NFKD, compatibility decomposition useful for fuzzy matching/searching assert(normalize!NFKD("2¹⁰") == "210"); } enum lastDchar = 0x10FFFF; auto force(T, F)(F from) if(isIntegral!T && !is(T == F)) { assert(from <= T.max && from >= T.min); return cast(T)from; } auto force(T, F)(F from) if(isBitPacked!T && !is(T == F)) { assert(from <= 2^^bitSizeOf!T-1); return T(cast(TypeOfBitPacked!T)from); } auto force(T, F)(F from) if(is(T == F)) { return from; } // cheap algorithm grease ;) auto adaptIntRange(T, F)(F[] src) { //@@@BUG when in the 9 hells will map be copyable again?! static struct ConvertIntegers { private F[] data; @property T front() { return force!T(data.front); } void popFront(){ data.popFront(); } @property bool empty()const { return data.empty; } @property size_t length()const { return data.length; } auto opSlice(size_t s, size_t e) { return ConvertIntegers(data[s..e]); } @property size_t opDollar(){ return data.length; } } return ConvertIntegers(src); } // repeat X times the bit-pattern in val assuming it's length is 'bits' size_t replicateBits(size_t times, size_t bits)(size_t val) { static if(times == 1) return val; else static if(bits == 1) { static if(times == size_t.sizeof*8) return val ? size_t.max : 0; else return val ? (1<<times)-1 : 0; } else static if(times % 2) return (replicateBits!(times-1, bits)(val)<<bits) | val; else return replicateBits!(times/2, bits*2)((val<<bits) | val); } unittest // for replicate { size_t m = 0b111; size_t m2 = 0b01; foreach(i; TypeTuple!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) { assert(replicateBits!(i, 3)(m)+1 == (1<<(3*i))); assert(replicateBits!(i, 2)(m2) == iota(0, i).map!"2^^(2*a)"().reduce!"a+b"()); } } // multiple arrays squashed into one memory block struct MultiArray(Types...) { this(size_t[] sizes...) { size_t full_size; foreach(i, v; Types) { full_size += spaceFor!(bitSizeOf!v)(sizes[i]); sz[i] = sizes[i]; static if(i >= 1) offsets[i] = offsets[i-1] + spaceFor!(bitSizeOf!(Types[i-1]))(sizes[i-1]); } storage = new size_t[full_size]; } this(const(size_t)[] raw_offsets, const(size_t)[] raw_sizes, const(size_t)[] data)const { offsets[] = raw_offsets[]; sz[] = raw_sizes[]; storage = data; } @property auto slice(size_t n)()inout pure nothrow { auto ptr = raw_ptr!n; return packedArrayView!(Types[n])(ptr, sz[n]); } @property auto ptr(size_t n)()inout pure nothrow { auto ptr = raw_ptr!n; return inout(PackedPtr!(Types[n]))(ptr); } template length(size_t n) { @property size_t length()const{ return sz[n]; } @property void length(size_t new_size) { if(new_size > sz[n]) {// extend size_t delta = (new_size - sz[n]); sz[n] += delta; delta = spaceFor!(bitSizeOf!(Types[n]))(delta); storage.length += delta;// extend space at end // raw_slice!x must follow resize as it could be moved! // next stmts move all data past this array, last-one-goes-first static if(n != dim-1) { auto start = raw_ptr!(n+1); // len includes delta size_t len = (storage.ptr+storage.length-start); copyBackwards(start[0..len-delta], start[delta..len]); start[0..delta] = 0; // offsets are used for raw_slice, ptr etc. foreach(i; n+1..dim) offsets[i] += delta; } } else if(new_size < sz[n]) {// shrink size_t delta = (sz[n] - new_size); sz[n] -= delta; delta = spaceFor!(bitSizeOf!(Types[n]))(delta); // move all data past this array, forward direction static if(n != dim-1) { auto start = raw_ptr!(n+1); size_t len = (storage.ptr+storage.length-start); copyForward(start[0..len-delta], start[delta..len]); // adjust offsets last, they affect raw_slice foreach(i; n+1..dim) offsets[i] -= delta; } storage.length -= delta; } // else - NOP } } @property size_t bytes(size_t n=size_t.max)() const { static if(n == size_t.max) return storage.length*size_t.sizeof; else static if(n != Types.length-1) return (raw_ptr!(n+1)-raw_ptr!n)*size_t.sizeof; else return (storage.ptr+storage.length - raw_ptr!n)*size_t.sizeof; } void store(OutRange)(scope OutRange sink) const if(isOutputRange!(OutRange, char)) { import std.format; formattedWrite(sink, "[%( 0x%x, %)]", offsets[]); formattedWrite(sink, ", [%( 0x%x, %)]", sz[]); formattedWrite(sink, ", [%( 0x%x, %)]", storage); } private: @property auto raw_ptr(size_t n)()inout { static if(n == 0) return storage.ptr; else { return storage.ptr+offsets[n]; } } enum dim = Types.length; size_t[dim] offsets;// offset for level x size_t[dim] sz;// size of level x alias bitWidth = staticMap!(bitSizeOf, Types); size_t[] storage; } unittest { enum dg = (){ // sizes are: // lvl0: 3, lvl1 : 2, lvl2: 1 auto m = MultiArray!(int, ubyte, int)(3,2,1); static void check(size_t k, T)(ref T m, int n) { foreach(i; 0..n) assert(m.slice!(k)[i] == i+1, text("level:",i," : ",m.slice!(k)[0..n])); } static void checkB(size_t k, T)(ref T m, int n) { foreach(i; 0..n) assert(m.slice!(k)[i] == n-i, text("level:",i," : ",m.slice!(k)[0..n])); } static void fill(size_t k, T)(ref T m, int n) { foreach(i; 0..n) m.slice!(k)[i] = force!ubyte(i+1); } static void fillB(size_t k, T)(ref T m, int n) { foreach(i; 0..n) m.slice!(k)[i] = force!ubyte(n-i); } m.length!1 = 100; fill!1(m, 100); check!1(m, 100); m.length!0 = 220; fill!0(m, 220); check!1(m, 100); check!0(m, 220); m.length!2 = 17; fillB!2(m, 17); checkB!2(m, 17); check!0(m, 220); check!1(m, 100); m.length!2 = 33; checkB!2(m, 17); fillB!2(m, 33); checkB!2(m, 33); check!0(m, 220); check!1(m, 100); m.length!1 = 195; fillB!1(m, 195); checkB!1(m, 195); checkB!2(m, 33); check!0(m, 220); auto marr = MultiArray!(BitPacked!(uint, 4), BitPacked!(uint, 6))(20, 10); marr.length!0 = 15; marr.length!1 = 30; fill!1(marr, 30); fill!0(marr, 15); check!1(marr, 30); check!0(marr, 15); return 0; }; enum ct = dg(); auto rt = dg(); } unittest {// more bitpacking tests alias Bitty = MultiArray!(BitPacked!(size_t, 3) , BitPacked!(size_t, 4) , BitPacked!(size_t, 3) , BitPacked!(size_t, 6) , bool); alias fn1 = sliceBits!(13, 16); alias fn2 = sliceBits!( 9, 13); alias fn3 = sliceBits!( 6, 9); alias fn4 = sliceBits!( 0, 6); static void check(size_t lvl, MA)(ref MA arr){ for(size_t i = 0; i< arr.length!lvl; i++) assert(arr.slice!(lvl)[i] == i, text("Mismatch on lvl ", lvl, " idx ", i, " value: ", arr.slice!(lvl)[i])); } static void fillIdx(size_t lvl, MA)(ref MA arr){ for(size_t i = 0; i< arr.length!lvl; i++) arr.slice!(lvl)[i] = i; } Bitty m1; m1.length!4 = 10; m1.length!3 = 2^^6; m1.length!2 = 2^^3; m1.length!1 = 2^^4; m1.length!0 = 2^^3; m1.length!4 = 2^^16; for(size_t i = 0; i< m1.length!4; i++) m1.slice!(4)[i] = i % 2; fillIdx!1(m1); check!1(m1); fillIdx!2(m1); check!2(m1); fillIdx!3(m1); check!3(m1); fillIdx!0(m1); check!0(m1); check!3(m1); check!2(m1); check!1(m1); for(size_t i=0; i < 2^^16; i++) { m1.slice!(4)[i] = i % 2; m1.slice!(0)[fn1(i)] = fn1(i); m1.slice!(1)[fn2(i)] = fn2(i); m1.slice!(2)[fn3(i)] = fn3(i); m1.slice!(3)[fn4(i)] = fn4(i); } for(size_t i=0; i < 2^^16; i++) { assert(m1.slice!(4)[i] == i % 2); assert(m1.slice!(0)[fn1(i)] == fn1(i)); assert(m1.slice!(1)[fn2(i)] == fn2(i)); assert(m1.slice!(2)[fn3(i)] == fn3(i)); assert(m1.slice!(3)[fn4(i)] == fn4(i)); } } size_t spaceFor(size_t _bits)(size_t new_len) pure nothrow { enum bits = _bits == 1 ? 1 : ceilPowerOf2(_bits);// see PackedArrayView static if(bits > 8*size_t.sizeof) { static assert(bits % (size_t.sizeof*8) == 0); return new_len * bits/(8*size_t.sizeof); } else { enum factor = size_t.sizeof*8/bits; return (new_len+factor-1)/factor; // rounded up } } template isBitPackableType(T) { enum isBitPackableType = isBitPacked!T || isIntegral!T || is(T == bool) || isSomeChar!T; } //============================================================================ template PackedArrayView(T) if((is(T dummy == BitPacked!(U, sz), U, size_t sz) && isBitPackableType!U) || isBitPackableType!T) { private enum bits = bitSizeOf!T; alias PackedArrayView = PackedArrayViewImpl!(T, bits > 1 ? ceilPowerOf2(bits) : 1); } //unsafe and fast access to a chunk of RAM as if it contains packed values template PackedPtr(T) if((is(T dummy == BitPacked!(U, sz), U, size_t sz) && isBitPackableType!U) || isBitPackableType!T) { private enum bits = bitSizeOf!T; alias PackedPtr = PackedPtrImpl!(T, bits > 1 ? ceilPowerOf2(bits) : 1); } @trusted struct PackedPtrImpl(T, size_t bits) { pure nothrow: static assert(isPowerOf2(bits)); this(inout(size_t)* ptr)inout { origin = ptr; } private T simpleIndex(size_t n) inout { auto q = n / factor; auto r = n % factor; return cast(T)((origin[q] >> bits*r) & mask); } private void simpleWrite(TypeOfBitPacked!T val, size_t n) in { static if(isIntegral!T) assert(val <= mask); } body { auto q = n / factor; auto r = n % factor; size_t tgt_shift = bits*r; size_t word = origin[q]; origin[q] = (word & ~(mask<<tgt_shift)) | (cast(size_t)val << tgt_shift); } static if(factor == bytesPerWord// can safely pack by byte || factor == 1 // a whole word at a time || ((factor == bytesPerWord/2 || factor == bytesPerWord/4) && hasUnalignedReads)) // this needs unaligned reads { static if(factor == bytesPerWord) alias U = ubyte; else static if(factor == bytesPerWord/2) alias U = ushort; else static if(factor == bytesPerWord/4) alias U = uint; else static if(size_t.sizeof == 8 && factor == bytesPerWord/8) alias U = ulong; T opIndex(size_t idx) inout { return __ctfe ? simpleIndex(idx) : cast(inout(T))(cast(U*)origin)[idx]; } static if(isBitPacked!T) // lack of user-defined implicit conversion { void opIndexAssign(T val, size_t idx) { return opIndexAssign(cast(TypeOfBitPacked!T)val, idx); } } void opIndexAssign(TypeOfBitPacked!T val, size_t idx) { if(__ctfe) simpleWrite(val, idx); else (cast(U*)origin)[idx] = cast(U)val; } } else { T opIndex(size_t n) inout { return simpleIndex(n); } static if(isBitPacked!T) // lack of user-defined implicit conversion { void opIndexAssign(T val, size_t idx) { return opIndexAssign(cast(TypeOfBitPacked!T)val, idx); } } void opIndexAssign(TypeOfBitPacked!T val, size_t n) { return simpleWrite(val, n); } } private: // factor - number of elements in one machine word enum factor = size_t.sizeof*8/bits, mask = 2^^bits-1; enum bytesPerWord = size_t.sizeof; size_t* origin; } // data is packed only by power of two sized packs per word, // thus avoiding mul/div overhead at the cost of ultimate packing // this construct doesn't own memory, only provides access, see MultiArray for usage @trusted struct PackedArrayViewImpl(T, size_t bits) { pure nothrow: this(inout(size_t)* origin, size_t offset, size_t items) inout { ptr = inout(PackedPtr!(T))(origin); ofs = offset; limit = items; } bool zeros(size_t s, size_t e) in { assert(s <= e); } body { s += ofs; e += ofs; size_t pad_s = roundUp(s); if ( s >= e) { foreach (i; s..e) if(ptr[i]) return false; return true; } size_t pad_e = roundDown(e); size_t i; for(i=s; i<pad_s; i++) if(ptr[i]) return false; // all in between is x*factor elements for(size_t j=i/factor; i<pad_e; i+=factor, j++) if(ptr.origin[j]) return false; for(; i<e; i++) if(ptr[i]) return false; return true; } T opIndex(size_t idx) inout in { assert(idx < limit); } body { return ptr[ofs + idx]; } static if(isBitPacked!T) // lack of user-defined implicit conversion { void opIndexAssign(T val, size_t idx) { return opIndexAssign(cast(TypeOfBitPacked!T)val, idx); } } void opIndexAssign(TypeOfBitPacked!T val, size_t idx) in { assert(idx < limit); } body { ptr[ofs + idx] = val; } static if(isBitPacked!T) // lack of user-defined implicit conversions { void opSliceAssign(T val, size_t start, size_t end) { opSliceAssign(cast(TypeOfBitPacked!T)val, start, end); } } void opSliceAssign(TypeOfBitPacked!T val, size_t start, size_t end) in { assert(start <= end); assert(end <= limit); } body { // account for ofsetted view start += ofs; end += ofs; // rounded to factor granularity size_t pad_start = roundUp(start);// rounded up if(pad_start >= end) //rounded up >= then end of slice { //nothing to gain, use per element assignment foreach(i; start..end) ptr[i] = val; return; } size_t pad_end = roundDown(end); // rounded down size_t i; for(i=start; i<pad_start; i++) ptr[i] = val; // all in between is x*factor elements if(pad_start != pad_end) { size_t repval = replicateBits!(factor, bits)(val); for(size_t j=i/factor; i<pad_end; i+=factor, j++) ptr.origin[j] = repval;// so speed it up by factor } for(; i<end; i++) ptr[i] = val; } auto opSlice(size_t from, size_t to)inout in { assert(from <= to); assert(ofs + to <= limit); } body { return typeof(this)(ptr.origin, ofs + from, to - from); } auto opSlice(){ return opSlice(0, length); } bool opEquals(T)(auto ref T arr) const { if(limit != arr.limit) return false; size_t s1 = ofs, s2 = arr.ofs; size_t e1 = s1 + limit, e2 = s2 + limit; if(s1 % factor == 0 && s2 % factor == 0 && length % factor == 0) { return ptr.origin[s1/factor .. e1/factor] == arr.ptr.origin[s2/factor .. e2/factor]; } for(size_t i=0;i<limit; i++) if(this[i] != arr[i]) return false; return true; } @property size_t length()const{ return limit; } private: auto roundUp()(size_t val){ return (val+factor-1)/factor*factor; } auto roundDown()(size_t val){ return val/factor*factor; } // factor - number of elements in one machine word enum factor = size_t.sizeof*8/bits; PackedPtr!(T) ptr; size_t ofs, limit; } private struct SliceOverIndexed(T) { enum assignableIndex = is(typeof((){ T.init[0] = Item.init; })); enum assignableSlice = is(typeof((){ T.init[0..0] = Item.init; })); auto opIndex(size_t idx)const in { assert(idx < to - from); } body { return (*arr)[from+idx]; } static if(assignableIndex) void opIndexAssign(Item val, size_t idx) in { assert(idx < to - from); } body { (*arr)[from+idx] = val; } auto opSlice(size_t a, size_t b) { return typeof(this)(from+a, from+b, arr); } // static if(assignableSlice) void opSliceAssign(T)(T val, size_t start, size_t end) { (*arr)[start+from .. end+from] = val; } auto opSlice() { return typeof(this)(from, to, arr); } @property size_t length()const { return to-from;} auto opDollar()const { return length; } @property bool empty()const { return from == to; } @property auto front()const { return (*arr)[from]; } static if(assignableIndex) @property void front(Item val) { (*arr)[from] = val; } @property auto back()const { return (*arr)[to-1]; } static if(assignableIndex) @property void back(Item val) { (*arr)[to-1] = val; } @property auto save() inout { return this; } void popFront() { from++; } void popBack() { to--; } bool opEquals(T)(auto ref T arr) const { if(arr.length != length) return false; for(size_t i=0; i <length; i++) if(this[i] != arr[i]) return false; return true; } private: alias Item = typeof(T.init[0]); size_t from, to; T* arr; } static assert(isRandomAccessRange!(SliceOverIndexed!(int[]))); // BUG? forward reference to return type of sliceOverIndexed!Grapheme SliceOverIndexed!(const(T)) sliceOverIndexed(T)(size_t a, size_t b, const(T)* x) if(is(Unqual!T == T)) { return SliceOverIndexed!(const(T))(a, b, x); } // BUG? inout is out of reach //...SliceOverIndexed.arr only parameters or stack based variables can be inout SliceOverIndexed!T sliceOverIndexed(T)(size_t a, size_t b, T* x) if(is(Unqual!T == T)) { return SliceOverIndexed!T(a, b, x); } unittest { int[] idxArray = [2, 3, 5, 8, 13]; auto sliced = sliceOverIndexed(0, idxArray.length, &idxArray); assert(!sliced.empty); assert(sliced.front == 2); sliced.front = 1; assert(sliced.front == 1); assert(sliced.back == 13); sliced.popFront(); assert(sliced.front == 3); assert(sliced.back == 13); sliced.back = 11; assert(sliced.back == 11); sliced.popBack(); assert(sliced.front == 3); assert(sliced[$-1] == 8); sliced = sliced[]; assert(sliced[0] == 3); assert(sliced.back == 8); sliced = sliced[1..$]; assert(sliced.front == 5); sliced = sliced[0..$-1]; assert(sliced[$-1] == 5); int[] other = [2, 5]; assert(sliced[] == sliceOverIndexed(1, 2, &other)); sliceOverIndexed(0, 2, &idxArray)[0..2] = -1; assert(idxArray[0..2] == [-1, -1]); uint[] nullArr = null; auto nullSlice = sliceOverIndexed(0, 0, &idxArray); assert(nullSlice.empty); } private auto packedArrayView(T)(inout(size_t)* ptr, size_t items) @trusted pure nothrow { return inout(PackedArrayView!T)(ptr, 0, items); } //============================================================================ // Partially unrolled binary search using Shar's method //============================================================================ private import std.math : pow; string genUnrolledSwitchSearch(size_t size) { assert(isPowerOf2(size)); string code = `auto power = bsr(m)+1; switch(power){`; size_t i = bsr(size); foreach_reverse(val; 0..bsr(size)) { auto v = 2^^val; code ~= ` case pow: if(pred(range[idx+m], needle)) idx += m; goto case; `.replace("m", to!string(v)) .replace("pow", to!string(i)); i--; } code ~= ` case 0: if(pred(range[idx], needle)) idx += 1; goto default; `; code ~= ` default: }`; return code; } bool isPowerOf2(size_t sz) @safe pure nothrow { return (sz & (sz-1)) == 0; } size_t uniformLowerBound(alias pred, Range, T)(Range range, T needle) if(is(T : ElementType!Range)) { assert(isPowerOf2(range.length)); size_t idx = 0, m = range.length/2; while(m != 0) { if(pred(range[idx+m], needle)) idx += m; m /= 2; } if(pred(range[idx], needle)) idx += 1; return idx; } size_t switchUniformLowerBound(alias pred, Range, T)(Range range, T needle) if(is(T : ElementType!Range)) { assert(isPowerOf2(range.length)); size_t idx = 0, m = range.length/2; enum max = 1<<10; while(m >= max) { if(pred(range[idx+m], needle)) idx += m; m /= 2; } mixin(genUnrolledSwitchSearch(max)); return idx; } // size_t floorPowerOf2(size_t arg) @safe pure nothrow { assert(arg > 1); // else bsr is undefined return 1<<bsr(arg-1); } size_t ceilPowerOf2(size_t arg) @safe pure nothrow { assert(arg > 1); // else bsr is undefined return 1<<bsr(arg-1)+1; } template sharMethod(alias uniLowerBound) { size_t sharMethod(alias _pred="a<b", Range, T)(Range range, T needle) if(is(T : ElementType!Range)) { import std.functional; alias pred = binaryFun!_pred; if(range.length == 0) return 0; if(isPowerOf2(range.length)) return uniLowerBound!pred(range, needle); size_t n = floorPowerOf2(range.length); if(pred(range[n-1], needle)) {// search in another 2^^k area that fully covers the tail of range size_t k = ceilPowerOf2(range.length - n + 1); return range.length - k + uniLowerBound!pred(range[$-k..$], needle); } else return uniLowerBound!pred(range[0..n], needle); } } alias sharLowerBound = sharMethod!uniformLowerBound; alias sharSwitchLowerBound = sharMethod!switchUniformLowerBound; unittest { auto stdLowerBound(T)(T[] range, T needle) { return assumeSorted(range).lowerBound(needle).length; } immutable MAX = 5*1173; auto arr = array(iota(5, MAX, 5)); assert(arr.length == MAX/5-1); foreach(i; 0..MAX+5) { auto std = stdLowerBound(arr, i); assert(std == sharLowerBound(arr, i)); assert(std == sharSwitchLowerBound(arr, i)); } arr = []; auto std = stdLowerBound(arr, 33); assert(std == sharLowerBound(arr, 33)); assert(std == sharSwitchLowerBound(arr, 33)); } //============================================================================ @safe: // hope to see simillar stuff in public interface... once Allocators are out //@@@BUG moveFront and friends? dunno, for now it's POD-only @trusted size_t genericReplace(Policy=void, T, Range) (ref T dest, size_t from, size_t to, Range stuff) { size_t delta = to - from; size_t stuff_end = from+stuff.length; if(stuff.length > delta) {// replace increases length delta = stuff.length - delta;// now, new is > old by delta static if(is(Policy == void)) dest.length = dest.length+delta;//@@@BUG lame @property else dest = Policy.realloc(dest, dest.length+delta); auto rem = copy(retro(dest[to..dest.length-delta]) , retro(dest[to+delta..dest.length])); assert(rem.empty); copy(stuff, dest[from..stuff_end]); } else if(stuff.length == delta) { copy(stuff, dest[from..to]); } else {// replace decreases length by delta delta = delta - stuff.length; copy(stuff, dest[from..stuff_end]); auto rem = copy(dest[to..dest.length] , dest[stuff_end..dest.length-delta]); static if(is(Policy == void)) dest.length = dest.length - delta;//@@@BUG lame @property else dest = Policy.realloc(dest, dest.length-delta); assert(rem.empty); } return stuff_end; } // Simple storage manipulation policy @trusted public struct GcPolicy { static T[] dup(T)(const T[] arr) { return arr.dup; } static T[] alloc(T)(size_t size) { return new T[size]; } static T[] realloc(T)(T[] arr, size_t sz) { arr.length = sz; return arr; } static void replaceImpl(T, Range)(ref T[] dest, size_t from, size_t to, Range stuff) { replaceInPlace(dest, from, to, stuff); } static void append(T, V)(ref T[] arr, V value) if(!isInputRange!V) { arr ~= force!T(value); } static void append(T, V)(ref T[] arr, V value) if(isInputRange!V) { insertInPlace(arr, arr.length, value); } static void destroy(T)(ref T arr) if(isDynamicArray!T && is(Unqual!T == T)) { version(bug10929) //@@@BUG@@@ { debug { arr[] = cast(typeof(T.init[0]))(0xdead_beef); } arr = null; } } static void destroy(T)(ref T arr) if(isDynamicArray!T && !is(Unqual!T == T)) { arr = null; } } // ditto @trusted struct ReallocPolicy { static T[] dup(T)(const T[] arr) { auto result = alloc!T(arr.length); result[] = arr[]; return result; } static T[] alloc(T)(size_t size) { auto ptr = cast(T*)enforce(malloc(T.sizeof*size), "out of memory on C heap"); return ptr[0..size]; } static T[] realloc(T)(T[] arr, size_t size) { if(!size) { destroy(arr); return null; } auto ptr = cast(T*)enforce(core.stdc.stdlib.realloc( arr.ptr, T.sizeof*size), "out of memory on C heap"); return ptr[0..size]; } static void replaceImpl(T, Range)(ref T[] dest, size_t from, size_t to, Range stuff) { genericReplace!(ReallocPolicy)(dest, from, to, stuff); } static void append(T, V)(ref T[] arr, V value) if(!isInputRange!V) { arr = realloc(arr, arr.length+1); arr[$-1] = force!T(value); } static void append(T, V)(ref T[] arr, V value) if(isInputRange!V && hasLength!V) { arr = realloc(arr, arr.length+value.length); copy(value, arr[$-value.length..$]); } static void destroy(T)(ref T[] arr) { if(arr.ptr) free(arr.ptr); arr = null; } } //build hack alias _RealArray = Uint24Array!ReallocPolicy; unittest { with(ReallocPolicy) { bool test(T, U, V)(T orig, size_t from, size_t to, U toReplace, V result, string file = __FILE__, size_t line = __LINE__) { { replaceImpl(orig, from, to, toReplace); scope(exit) destroy(orig); if(!equalS(orig, result)) return false; } return true; } static T[] arr(T)(T[] args... ) { return dup(args); } assert(test(arr([1, 2, 3, 4]), 0, 0, [5, 6, 7], [5, 6, 7, 1, 2, 3, 4])); assert(test(arr([1, 2, 3, 4]), 0, 2, cast(int[])[], [3, 4])); assert(test(arr([1, 2, 3, 4]), 0, 4, [5, 6, 7], [5, 6, 7])); assert(test(arr([1, 2, 3, 4]), 0, 2, [5, 6, 7], [5, 6, 7, 3, 4])); assert(test(arr([1, 2, 3, 4]), 2, 3, [5, 6, 7], [1, 2, 5, 6, 7, 4])); } } /** Tests if T is some kind a set of code points. Intended for template constraints. */ public template isCodepointSet(T) { static if(is(T dummy == InversionList!(Args), Args...)) enum isCodepointSet = true; else enum isCodepointSet = false; } /** Tests if $(D T) is a pair of integers that implicitly convert to $(D V). The following code must compile for any pair $(D T): --- (T x){ V a = x[0]; V b = x[1];} --- The following must not compile: --- (T x){ V c = x[2];} --- */ public template isIntegralPair(T, V=uint) { enum isIntegralPair = is(typeof((T x){ V a = x[0]; V b = x[1];})) && !is(typeof((T x){ V c = x[2]; })); } /** The recommended default type for set of $(CODEPOINTS). For details, see the current implementation: $(LREF InversionList). */ public alias CodepointSet = InversionList!GcPolicy; //@@@BUG: std.typecons tuples depend on std.format to produce fields mixin // which relies on std.uni.isGraphical and this chain blows up with Forward reference error // hence below doesn't seem to work // public alias CodepointInterval = Tuple!(uint, "a", uint, "b"); /** The recommended type of $(XREF _typecons, Tuple) to represent [a, b$(RPAREN) intervals of $(CODEPOINTS). As used in $(LREF InversionList). Any interval type should pass $(LREF isIntegralPair) trait. */ public struct CodepointInterval { uint[2] _tuple; alias _tuple this; this(uint low, uint high) { _tuple[0] = low; _tuple[1] = high; } bool opEquals(T)(T val) const { return this[0] == val[0] && this[1] == val[1]; } @property ref uint a(){ return _tuple[0]; } @property ref uint b(){ return _tuple[1]; } } //@@@BUG another forward reference workaround @trusted bool equalS(R1, R2)(R1 lhs, R2 rhs) { for(;;){ if(lhs.empty) return rhs.empty; if(rhs.empty) return false; if(lhs.front != rhs.front) return false; lhs.popFront(); rhs.popFront(); } } /** $(P $(D InversionList) is a set of $(CODEPOINTS) represented as an array of open-right [a, b$(RPAREN) intervals (see $(LREF CodepointInterval) above). The name comes from the way the representation reads left to right. For instance a set of all values [10, 50$(RPAREN), [80, 90$(RPAREN), plus a singular value 60 looks like this: ) --- 10, 50, 60, 61, 80, 90 --- $(P The way to read this is: start with negative meaning that all numbers smaller then the next one are not present in this set (and positive - the contrary). Then switch positive/negative after each number passed from left to right. ) $(P This way negative spans until 10, then positive until 50, then negative until 60, then positive until 61, and so on. As seen this provides a space-efficient storage of highly redundant data that comes in long runs. A description which Unicode $(CHARACTER) properties fit nicely. The technique itself could be seen as a variation on $(LUCKY RLE encoding). ) $(P Sets are value types (just like $(D int) is) thus they are never aliased. ) Example: --- auto a = CodepointSet('a', 'z'+1); auto b = CodepointSet('A', 'Z'+1); auto c = a; a = a | b; assert(a == CodepointSet('A', 'Z'+1, 'a', 'z'+1)); assert(a != c); --- $(P See also $(LREF unicode) for simpler construction of sets from predefined ones. ) $(P Memory usage is 6 bytes per each contiguous interval in a set. The value semantics are achieved by using the $(WEB http://en.wikipedia.org/wiki/Copy-on-write, COW) technique and thus it's $(RED not) safe to cast this type to $(D_KEYWORD shared). ) Note: $(P It's not recommended to rely on the template parameters or the exact type of a current $(CODEPOINT) set in $(D std.uni). The type and parameters may change when the standard allocators design is finalized. Use $(LREF isCodepointSet) with templates or just stick with the default alias $(LREF CodepointSet) throughout the whole code base. ) */ @trusted public struct InversionList(SP=GcPolicy) { public: /** Construct from another code point set of any type. */ this(Set)(Set set) if(isCodepointSet!Set) { uint[] arr; foreach(v; set.byInterval) { arr ~= v.a; arr ~= v.b; } data = Uint24Array!(SP)(arr); } /** Construct a set from a forward range of code point intervals. */ this(Range)(Range intervals) if(isForwardRange!Range && isIntegralPair!(ElementType!Range)) { auto flattened = roundRobin(intervals.save.map!"a[0]"(), intervals.save.map!"a[1]"()); data = Uint24Array!(SP)(flattened); sanitize(); //enforce invariant: sort intervals etc. } /** Construct a set from plain values of code point intervals. Example: --- import std.algorithm; auto set = CodepointSet('a', 'z'+1, 'а', 'я'+1); foreach(v; 'a'..'z'+1) assert(set[v]); // Cyrillic lowercase interval foreach(v; 'а'..'я'+1) assert(set[v]); //specific order is not required, intervals may interesect auto set2 = CodepointSet('а', 'я'+1, 'a', 'd', 'b', 'z'+1); //the same end result assert(set2.byInterval.equal(set.byInterval)); --- */ this()(uint[] intervals...) in { assert(intervals.length % 2 == 0, "Odd number of interval bounds [a, b)!"); for(uint i=0; i<intervals.length/2; i++) { auto a = intervals[2*i], b = intervals[2*i+1]; assert(a < b, text("illegal interval [a, b): ", a, " > ", b)); } } body { data = Uint24Array!(SP)(intervals); sanitize(); //enforce invariant: sort intervals etc. } /** Get range that spans all of the $(CODEPOINT) intervals in this $(LREF InversionList). Example: --- import std.algorithm, std.typecons; auto set = CodepointSet('A', 'D'+1, 'a', 'd'+1); set.byInterval.equal([tuple('A', 'E'), tuple('a', 'e')]); --- */ @property auto byInterval() { return Intervals!(typeof(data))(data); } /** Tests the presence of code point $(D val) in this set. Example: --- auto gothic = unicode.Gothic; // Gothic letter ahsa assert(gothic['\U00010330']); // no ascii in Gothic obviously assert(!gothic['$']); --- */ bool opIndex(uint val) const { // the <= ensures that searching in interval of [a, b) for 'a' you get .length == 1 // return assumeSorted!((a,b) => a<=b)(data[]).lowerBound(val).length & 1; return sharSwitchLowerBound!"a<=b"(data[], val) & 1; } /// Number of $(CODEPOINTS) in this set @property size_t length() { size_t sum = 0; foreach(iv; byInterval) { sum += iv.b - iv.a; } return sum; } // bootstrap full set operations from 4 primitives (suitable as a template mixin): // addInterval, skipUpTo, dropUpTo & byInterval iteration //============================================================================ public: /** $(P Sets support natural syntax for set algebra, namely: ) $(BOOKTABLE , $(TR $(TH Operator) $(TH Math notation) $(TH Description) ) $(TR $(TD &) $(TD a ∩ b) $(TD intersection) ) $(TR $(TD |) $(TD a ∪ b) $(TD union) ) $(TR $(TD -) $(TD a ∖ b) $(TD subtraction) ) $(TR $(TD ~) $(TD a ~ b) $(TD symmetric set difference i.e. (a ∪ b) \ (a ∩ b)) ) ) Example: --- auto lower = unicode.LowerCase; auto upper = unicode.UpperCase; auto ascii = unicode.ASCII; assert((lower & upper).empty); // no intersection auto lowerASCII = lower & ascii; assert(lowerASCII.byCodepoint.equal(iota('a', 'z'+1))); // throw away all of the lowercase ASCII assert((ascii - lower).length == 128 - 26); auto onlyOneOf = lower ~ ascii; assert(!onlyOneOf['Δ']); // not ASCII and not lowercase assert(onlyOneOf['$']); // ASCII and not lowercase assert(!onlyOneOf['a']); // ASCII and lowercase assert(onlyOneOf['я']); // not ASCII but lowercase // throw away all cased letters from ASCII auto noLetters = ascii - (lower | upper); assert(noLetters.length == 128 - 26*2); --- */ This opBinary(string op, U)(U rhs) if(isCodepointSet!U || is(U:dchar)) { static if(op == "&" || op == "|" || op == "~") {// symmetric ops thus can swap arguments to reuse r-value static if(is(U:dchar)) { auto tmp = this; mixin("tmp "~op~"= rhs; "); return tmp; } else { static if(is(Unqual!U == U)) { // try hard to reuse r-value mixin("rhs "~op~"= this;"); return rhs; } else { auto tmp = this; mixin("tmp "~op~"= rhs;"); return tmp; } } } else static if(op == "-") // anti-symmetric { auto tmp = this; tmp -= rhs; return tmp; } else static assert(0, "no operator "~op~" defined for Set"); } /// The 'op=' versions of the above overloaded operators. ref This opOpAssign(string op, U)(U rhs) if(isCodepointSet!U || is(U:dchar)) { static if(op == "|") // union { static if(is(U:dchar)) { this.addInterval(rhs, rhs+1); return this; } else return this.add(rhs); } else static if(op == "&") // intersection return this.intersect(rhs);// overloaded else static if(op == "-") // set difference return this.sub(rhs);// overloaded else static if(op == "~") // symmetric set difference { auto copy = this & rhs; this |= rhs; this -= copy; return this; } else static assert(0, "no operator "~op~" defined for Set"); } /** Tests the presence of codepoint $(D ch) in this set, the same as $(LREF opIndex). */ bool opBinaryRight(string op: "in", U)(U ch) const if(is(U : dchar)) { return this[ch]; } /// unittest { assert('я' in unicode.Cyrillic); assert(!('z' in unicode.Cyrillic)); } /// Obtains a set that is the inversion of this set. See also $(LREF inverted). auto opUnary(string op: "!")() { return this.inverted; } /** A range that spans each $(CODEPOINT) in this set. Example: --- import std.algorithm; auto set = unicode.ASCII; set.byCodepoint.equal(iota(0, 0x80)); --- */ @property auto byCodepoint() { @trusted static struct CodepointRange { this(This set) { r = set.byInterval; if(!r.empty) cur = r.front.a; } @property dchar front() const { return cast(dchar)cur; } @property bool empty() const { return r.empty; } void popFront() { cur++; while(cur >= r.front.b) { r.popFront(); if(r.empty) break; cur = r.front.a; } } private: uint cur; typeof(This.init.byInterval) r; } return CodepointRange(this); } /** $(P Obtain textual representation of this set in from of open-right intervals and feed it to $(D sink). ) $(P Used by various standard formatting facilities such as $(XREF _format, formattedWrite), $(XREF _stdio, write), $(XREF _stdio, writef), $(XREF _conv, to) and others. ) Example: --- import std.conv; assert(unicode.ASCII.to!string == "[0..128$(RPAREN)"); --- */ void toString(scope void delegate (const(char)[]) sink) { import std.format; auto range = byInterval; if(range.empty) return; auto val = range.front; formattedWrite(sink, "[%d..%d)", val.a, val.b); range.popFront(); foreach(i; range) formattedWrite(sink, " [%d..%d)", i.a, i.b); } /** Add an interval [a, b$(RPAREN) to this set. Example: --- CodepointSet someSet; someSet.add('0', '5').add('A','Z'+1); someSet.add('5', '9'+1); assert(someSet['0']); assert(someSet['5']); assert(someSet['9']); assert(someSet['Z']); --- */ ref add()(uint a, uint b) { addInterval(a, b); return this; } private: ref intersect(U)(U rhs) if(isCodepointSet!U) { Marker mark; foreach( i; rhs.byInterval) { mark = this.dropUpTo(i.a, mark); mark = this.skipUpTo(i.b, mark); } this.dropUpTo(uint.max, mark); return this; } ref intersect()(dchar ch) { foreach(i; byInterval) if(i.a <= ch && ch < i.b) return this = This.init.add(ch, ch+1); this = This.init; return this; } /// unittest { assert(unicode.Cyrillic.intersect('-').byInterval.empty); } ref sub()(dchar ch) { return subChar(ch); } // same as the above except that skip & drop parts are swapped ref sub(U)(U rhs) if(isCodepointSet!U) { uint top; Marker mark; foreach(i; rhs.byInterval) { mark = this.skipUpTo(i.a, mark); mark = this.dropUpTo(i.b, mark); } return this; } ref add(U)(U rhs) if(isCodepointSet!U) { Marker start; foreach(i; rhs.byInterval) { start = addInterval(i.a, i.b, start); } return this; } // end of mixin-able part //============================================================================ public: /** Obtains a set that is the inversion of this set. See the '!' $(LREF opUnary) for the same but using operators. Example: --- set = unicode.ASCII; // union with the inverse gets all of the code points in the Unicode assert((set | set.inverted).length == 0x110000); // no intersection with the inverse assert((set & set.inverted).empty); --- */ @property auto inverted() { InversionList inversion = this; if(inversion.data.length == 0) { inversion.addInterval(0, lastDchar+1); return inversion; } if(inversion.data[0] != 0) genericReplace(inversion.data, 0, 0, [0]); else genericReplace(inversion.data, 0, 1, cast(uint[])null); if(data[data.length-1] != lastDchar+1) genericReplace(inversion.data, inversion.data.length, inversion.data.length, [lastDchar+1]); else genericReplace(inversion.data, inversion.data.length-1, inversion.data.length, cast(uint[])null); return inversion; } /** Generates string with D source code of unary function with name of $(D funcName) taking a single $(D dchar) argument. If $(D funcName) is empty the code is adjusted to be a lambda function. The function generated tests if the $(CODEPOINT) passed belongs to this set or not. The result is to be used with string mixin. The intended usage area is aggressive optimization via meta programming in parser generators and the like. Note: Use with care for relatively small or regular sets. It could end up being slower then just using multi-staged tables. Example: --- import std.stdio; // construct set directly from [a, b) intervals auto set = CodepointSet(10, 12, 45, 65, 100, 200); writeln(set); writeln(set.toSourceCode("func")); --- The above outputs something along the lines of: --- bool func(dchar ch) { if(ch < 45) { if(ch == 10 || ch == 11) return true; return false; } else if (ch < 65) return true; else { if(ch < 100) return false; if(ch < 200) return true; return false; } } --- */ string toSourceCode(string funcName="") { import std.string; enum maxBinary = 3; static string linearScope(R)(R ivals, string indent) { string result = indent~"{\n"; string deeper = indent~" "; foreach(ival; ivals) { auto span = ival[1] - ival[0]; assert(span != 0); if(span == 1) { result ~= format("%sif(ch == %s) return true;\n", deeper, ival[0]); } else if(span == 2) { result ~= format("%sif(ch == %s || ch == %s) return true;\n", deeper, ival[0], ival[0]+1); } else { if(ival[0] != 0) // dchar is unsigned and < 0 is useless result ~= format("%sif(ch < %s) return false;\n", deeper, ival[0]); result ~= format("%sif(ch < %s) return true;\n", deeper, ival[1]); } } result ~= format("%sreturn false;\n%s}\n", deeper, indent); // including empty range of intervals return result; } static string binaryScope(R)(R ivals, string indent) { // time to do unrolled comparisons? if(ivals.length < maxBinary) return linearScope(ivals, indent); else return bisect(ivals, ivals.length/2, indent); } // not used yet if/elsebinary search is far better with DMD as of 2.061 // and GDC is doing fine job either way static string switchScope(R)(R ivals, string indent) { string result = indent~"switch(ch){\n"; string deeper = indent~" "; foreach(ival; ivals) { if(ival[0]+1 == ival[1]) { result ~= format("%scase %s: return true;\n", deeper, ival[0]); } else { result ~= format("%scase %s: .. case %s: return true;\n", deeper, ival[0], ival[1]-1); } } result ~= deeper~"default: return false;\n"~indent~"}\n"; return result; } static string bisect(R)(R range, size_t idx, string indent) { string deeper = indent ~ " "; // bisect on one [a, b) interval at idx string result = indent~"{\n"; // less branch, < a result ~= format("%sif(ch < %s)\n%s", deeper, range[idx][0], binaryScope(range[0..idx], deeper)); // middle point, >= a && < b result ~= format("%selse if (ch < %s) return true;\n", deeper, range[idx][1]); // greater or equal branch, >= b result ~= format("%selse\n%s", deeper, binaryScope(range[idx+1..$], deeper)); return result~indent~"}\n"; } string code = format("bool %s(dchar ch) @safe pure nothrow\n", funcName.empty ? "function" : funcName); auto range = byInterval.array(); // special case first bisection to be on ASCII vs beyond auto tillAscii = countUntil!"a[0] > 0x80"(range); if(tillAscii <= 0) // everything is ASCII or nothing is ascii (-1 & 0) code ~= binaryScope(range, ""); else code ~= bisect(range, tillAscii, ""); return code; } /** True if this set doesn't contain any $(CODEPOINTS). Example: --- CodepointSet emptySet; assert(emptySet.length == 0); assert(emptySet.empty); --- */ @property bool empty() const { return data.length == 0; } private: alias This = typeof(this); alias Marker = size_t; // a random-access range of integral pairs static struct Intervals(Range) { this(Range sp) { slice = sp; start = 0; end = sp.length; } this(Range sp, size_t s, size_t e) { slice = sp; start = s; end = e; } @property auto front()const { uint a = slice[start]; uint b = slice[start+1]; return CodepointInterval(a, b); } //may break sorted property - but we need std.sort to access it //hence package protection attribute package @property auto front(CodepointInterval val) { slice[start] = val.a; slice[start+1] = val.b; } @property auto back()const { uint a = slice[end-2]; uint b = slice[end-1]; return CodepointInterval(a, b); } //ditto about package package @property auto back(CodepointInterval val) { slice[end-2] = val.a; slice[end-1] = val.b; } void popFront() { start += 2; } void popBack() { end -= 2; } auto opIndex(size_t idx) const { uint a = slice[start+idx*2]; uint b = slice[start+idx*2+1]; return CodepointInterval(a, b); } //ditto about package package auto opIndexAssign(CodepointInterval val, size_t idx) { slice[start+idx*2] = val.a; slice[start+idx*2+1] = val.b; } auto opSlice(size_t s, size_t e) { return Intervals(slice, s*2+start, e*2+start); } @property size_t length()const { return slice.length/2; } @property bool empty()const { return start == end; } @property auto save(){ return this; } private: size_t start, end; Range slice; } // called after construction from intervals // to make sure invariants hold void sanitize() { if (data.length == 0) return; alias Ival = CodepointInterval; //intervals wrapper for a _range_ over packed array auto ivals = Intervals!(typeof(data[]))(data[]); sort!("a.a < b.a", SwapStrategy.stable)(ivals); // what follows is a variation on stable remove // differences: // - predicate is binary, and is tested against // the last kept element (at 'i'). // - predicate mutates lhs (merges rhs into lhs) size_t len = ivals.length; size_t i = 0; size_t j = 1; while (j < len) { if (ivals[i].b >= ivals[j].a) { ivals[i] = Ival(ivals[i].a, max(ivals[i].b, ivals[j].b)); j++; } else //unmergable { // check if there is a hole after merges // (in the best case we do 0 writes to ivals) if (j != i+1) ivals[i+1] = ivals[j]; //copy over i++; j++; } } len = i + 1; for (size_t k=0; k + 1 < len; k++) { assert(ivals[k].a < ivals[k].b); assert(ivals[k].b < ivals[k+1].a); } data.length = len * 2; } // special case for normal InversionList ref subChar(dchar ch) { auto mark = skipUpTo(ch); if(mark != data.length && data[mark] == ch && data[mark-1] == ch) { // it has split, meaning that ch happens to be in one of intervals data[mark] = data[mark]+1; } return this; } // Marker addInterval(int a, int b, Marker hint=Marker.init) in { assert(a <= b, text(a, " > ", b)); } body { auto range = assumeSorted(data[]); size_t pos; size_t a_idx = range.lowerBound(a).length; if(a_idx == range.length) { // [---+++----++++----++++++] // [ a b] data.append([a, b]); return data.length-1; } size_t b_idx = range[a_idx..range.length].lowerBound(b).length+a_idx; uint[] to_insert; debug(std_uni) { writefln("a_idx=%d; b_idx=%d;", a_idx, b_idx); } if(b_idx == range.length) { // [-------++++++++----++++++-] // [ s a b] if(a_idx & 1)// a in positive { to_insert = [ b ]; } else// a in negative { to_insert = [a, b]; } genericReplace(data, a_idx, b_idx, to_insert); return a_idx+to_insert.length-1; } uint top = data[b_idx]; debug(std_uni) { writefln("a_idx=%d; b_idx=%d;", a_idx, b_idx); writefln("a=%s; b=%s; top=%s;", a, b, top); } if(a_idx & 1) {// a in positive if(b_idx & 1)// b in positive { // [-------++++++++----++++++-] // [ s a b ] to_insert = [top]; } else // b in negative { // [-------++++++++----++++++-] // [ s a b ] if(top == b) { assert(b_idx+1 < data.length); pos = genericReplace(data, a_idx, b_idx+2, [data[b_idx+1]]); return pos; } to_insert = [b, top ]; } } else { // a in negative if(b_idx & 1) // b in positive { // [----------+++++----++++++-] // [ a b ] to_insert = [a, top]; } else// b in negative { // [----------+++++----++++++-] // [ a s b ] if(top == b) { assert(b_idx+1 < data.length); pos = genericReplace(data, a_idx, b_idx+2, [a, data[b_idx+1] ]); return pos; } to_insert = [a, b, top]; } } pos = genericReplace(data, a_idx, b_idx+1, to_insert); debug(std_uni) { writefln("marker idx: %d; length=%d", pos, data[pos], data.length); writeln("inserting ", to_insert); } return pos; } // Marker dropUpTo(uint a, Marker pos=Marker.init) in { assert(pos % 2 == 0); // at start of interval } body { auto range = assumeSorted!"a<=b"(data[pos..data.length]); if(range.empty) return pos; size_t idx = pos; idx += range.lowerBound(a).length; debug(std_uni) { writeln("dropUpTo full length=", data.length); writeln(pos,"~~~", idx); } if(idx == data.length) return genericReplace(data, pos, idx, cast(uint[])[]); if(idx & 1) { // a in positive //[--+++----++++++----+++++++------...] // |<---si s a t genericReplace(data, pos, idx, [a]); } else { // a in negative //[--+++----++++++----+++++++-------+++...] // |<---si s a t genericReplace(data, pos, idx, cast(uint[])[]); } return pos; } // Marker skipUpTo(uint a, Marker pos=Marker.init) out(result) { assert(result % 2 == 0);// always start of interval //(may be 0-width after-split) } body { assert(data.length % 2 == 0); auto range = assumeSorted!"a<=b"(data[pos..data.length]); size_t idx = pos+range.lowerBound(a).length; if(idx >= data.length) // could have Marker point to recently removed stuff return data.length; if(idx & 1)// inside of interval, check for split { uint top = data[idx]; if(top == a)// no need to split, it's end return idx+1; uint start = data[idx-1]; if(a == start) return idx-1; // split it up genericReplace(data, idx, idx+1, [a, a, top]); return idx+1; // avoid odd index } return idx; } Uint24Array!SP data; }; @system unittest { // test examples import std.algorithm, std.typecons; auto set = CodepointSet('A', 'D'+1, 'a', 'd'+1); set.byInterval.equalS([tuple('A', 'E'), tuple('a', 'e')]); set = unicode.ASCII; assert(set.byCodepoint.equalS(iota(0, 0x80))); set = CodepointSet('a', 'z'+1, 'а', 'я'+1); foreach(v; 'a'..'z'+1) assert(set[v]); // Cyrillic lowercase interval foreach(v; 'а'..'я'+1) assert(set[v]); //specific order is not required, intervals may interesect auto set2 = CodepointSet('а', 'я'+1, 'a', 'd', 'b', 'z'+1); assert(set2.byInterval.equal(set.byInterval)); auto gothic = unicode.Gothic; // Gothic letter ahsa assert(gothic['\U00010330']); // no ascii in Gothic obviously assert(!gothic['$']); CodepointSet emptySet; assert(emptySet.length == 0); assert(emptySet.empty); set = unicode.ASCII; // union with the inverse gets all of code points in the Unicode assert((set | set.inverted).length == 0x110000); // no intersection with inverse assert((set & set.inverted).empty); CodepointSet someSet; someSet.add('0', '5').add('A','Z'+1); someSet.add('5', '9'+1); assert(someSet['0']); assert(someSet['5']); assert(someSet['9']); assert(someSet['Z']); auto lower = unicode.LowerCase; auto upper = unicode.UpperCase; auto ascii = unicode.ASCII; assert((lower & upper).empty); // no intersection auto lowerASCII = lower & ascii; assert(lowerASCII.byCodepoint.equalS(iota('a', 'z'+1))); // throw away all of the lowercase ASCII assert((ascii - lower).length == 128 - 26); auto onlyOneOf = lower ~ ascii; assert(!onlyOneOf['Δ']); // not ASCII and not lowercase assert(onlyOneOf['$']); // ASCII and not lowercase assert(!onlyOneOf['a']); // ASCII and lowercase assert(onlyOneOf['я']); // not ASCII but lowercase auto noLetters = ascii - (lower | upper); assert(noLetters.length == 128 - 26*2); import std.conv; assert(unicode.ASCII.to!string() == "[0..128)"); } // pedantic version for ctfe, and aligned-access only architectures @trusted uint safeRead24(const ubyte* ptr, size_t idx) pure nothrow { idx *= 3; version(LittleEndian) return ptr[idx] + (cast(uint)ptr[idx+1]<<8) + (cast(uint)ptr[idx+2]<<16); else return (cast(uint)ptr[idx]<<16) + (cast(uint)ptr[idx+1]<<8) + ptr[idx+2]; } // ditto @trusted void safeWrite24(ubyte* ptr, uint val, size_t idx) pure nothrow { idx *= 3; version(LittleEndian) { ptr[idx] = val & 0xFF; ptr[idx+1] = (val>>8) & 0xFF; ptr[idx+2] = (val>>16) & 0xFF; } else { ptr[idx] = (val>>16) & 0xFF; ptr[idx+1] = (val>>8) & 0xFF; ptr[idx+2] = val & 0xFF; } } // unaligned x86-like read/write functions @trusted uint unalignedRead24(const ubyte* ptr, size_t idx) pure nothrow { uint* src = cast(uint*)(ptr+3*idx); version(LittleEndian) return *src & 0xFF_FFFF; else return *src >> 8; } // ditto @trusted void unalignedWrite24(ubyte* ptr, uint val, size_t idx) pure nothrow { uint* dest = cast(uint*)(cast(ubyte*)ptr + 3*idx); version(LittleEndian) *dest = val | (*dest & 0xFF00_0000); else *dest = (val<<8) | (*dest & 0xFF); } uint read24(const ubyte* ptr, size_t idx) pure nothrow { static if(hasUnalignedReads) return __ctfe ? safeRead24(ptr, idx) : unalignedRead24(ptr, idx); else return safeRead24(ptr, idx); } void write24(ubyte* ptr, uint val, size_t idx) pure nothrow { static if(hasUnalignedReads) return __ctfe ? safeWrite24(ptr, val, idx) : unalignedWrite24(ptr, val, idx); else return safeWrite24(ptr, val, idx); } // Packed array of 24-bit integers, COW semantics. @trusted struct Uint24Array(SP=GcPolicy) { this(Range)(Range range) if(isInputRange!Range && hasLength!Range) { length = range.length; copy(range, this[]); } this(Range)(Range range) if(isForwardRange!Range && !hasLength!Range) { auto len = walkLength(range.save); length = len; copy(range, this[]); } this(this) { if(!empty) { refCount = refCount + 1; } } ~this() { if(!empty) { auto cnt = refCount; if(cnt == 1) SP.destroy(data); else refCount = cnt - 1; } } // no ref-count for empty U24 array @property bool empty() const { return data.length == 0; } // report one less then actual size @property size_t length() const { return data.length ? (data.length-4)/3 : 0; } //+ an extra slot for ref-count @property void length(size_t len) { if(len == 0) { if(!empty) freeThisReference(); return; } immutable bytes = len*3+4; // including ref-count if(empty) { data = SP.alloc!ubyte(bytes); refCount = 1; return; } auto cur_cnt = refCount; if(cur_cnt != 1) // have more references to this memory { refCount = cur_cnt - 1; auto new_data = SP.alloc!ubyte(bytes); // take shrinking into account auto to_copy = min(bytes, data.length)-4; copy(data[0..to_copy], new_data[0..to_copy]); data = new_data; // before setting refCount! refCount = 1; } else // 'this' is the only reference { // use the realloc (hopefully in-place operation) data = SP.realloc(data, bytes); refCount = 1; // setup a ref-count in the new end of the array } } alias opDollar = length; // Read 24-bit packed integer uint opIndex(size_t idx)const { return read24(data.ptr, idx); } // Write 24-bit packed integer void opIndexAssign(uint val, size_t idx) in { assert(!empty && val <= 0xFF_FFFF); } body { auto cnt = refCount; if(cnt != 1) dupThisReference(cnt); write24(data.ptr, val, idx); } // auto opSlice(size_t from, size_t to) { return sliceOverIndexed(from, to, &this); } /// auto opSlice(size_t from, size_t to) const { return sliceOverIndexed(from, to, &this); } // length slices before the ref count auto opSlice() { return opSlice(0, length); } // length slices before the ref count auto opSlice() const { return opSlice(0, length); } void append(Range)(Range range) if(isInputRange!Range && hasLength!Range && is(ElementType!Range : uint)) { size_t nl = length + range.length; length = nl; copy(range, this[nl-range.length..nl]); } void append()(uint val) { length = length + 1; this[$-1] = val; } bool opEquals()(auto const ref Uint24Array rhs)const { if(empty ^ rhs.empty) return false; // one is empty and the other isn't return empty || data[0..$-4] == rhs.data[0..$-4]; } private: // ref-count is right after the data @property uint refCount() const { return read24(data.ptr, length); } @property void refCount(uint cnt) in { assert(cnt <= 0xFF_FFFF); } body { write24(data.ptr, cnt, length); } void freeThisReference() { auto count = refCount; if(count != 1) // have more references to this memory { // dec shared ref-count refCount = count - 1; data = []; } else SP.destroy(data); version(bug10929) assert(!data.ptr); else data = null; } void dupThisReference(uint count) in { assert(!empty && count != 1 && count == refCount); } body { // dec shared ref-count refCount = count - 1; // copy to the new chunk of RAM auto new_data = SP.alloc!ubyte(data.length); // bit-blit old stuff except the counter copy(data[0..$-4], new_data[0..$-4]); data = new_data; // before setting refCount! refCount = 1; // so that this updates the right one } ubyte[] data; } @trusted unittest// Uint24 tests //@@@BUG@@ iota is system ?! { void funcRef(T)(ref T u24) { u24.length = 2; u24[1] = 1024; T u24_c = u24; assert(u24[1] == 1024); u24.length = 0; assert(u24.empty); u24.append([1, 2]); assert(equalS(u24[], [1, 2])); u24.append(111); assert(equalS(u24[], [1, 2, 111])); assert(!u24_c.empty && u24_c[1] == 1024); u24.length = 3; copy(iota(0, 3), u24[]); assert(equalS(u24[], iota(0, 3))); assert(u24_c[1] == 1024); } void func2(T)(T u24) { T u24_2 = u24; T u24_3; u24_3 = u24_2; assert(u24_2 == u24_3); assert(equalS(u24[], u24_2[])); assert(equalS(u24_2[], u24_3[])); funcRef(u24_3); assert(equalS(u24_3[], iota(0, 3))); assert(!equalS(u24_2[], u24_3[])); assert(equalS(u24_2[], u24[])); u24_2 = u24_3; assert(equalS(u24_2[], iota(0, 3))); // to test that passed arg is intact outside // plus try out opEquals u24 = u24_3; u24 = T.init; u24_3 = T.init; assert(u24.empty); assert(u24 == u24_3); assert(u24 != u24_2); } foreach(Policy; TypeTuple!(GcPolicy, ReallocPolicy)) { alias Range = typeof(Uint24Array!Policy.init[]); alias U24A = Uint24Array!Policy; static assert(isForwardRange!Range); static assert(isBidirectionalRange!Range); static assert(isOutputRange!(Range, uint)); static assert(isRandomAccessRange!(Range)); auto arr = U24A([42u, 36, 100]); assert(arr[0] == 42); assert(arr[1] == 36); arr[0] = 72; arr[1] = 0xFE_FEFE; assert(arr[0] == 72); assert(arr[1] == 0xFE_FEFE); assert(arr[2] == 100); U24A arr2 = arr; assert(arr2[0] == 72); arr2[0] = 11; // test COW-ness assert(arr[0] == 72); assert(arr2[0] == 11); // set this to about 100M to stress-test COW memory management foreach(v; 0..10_000) func2(arr); assert(equalS(arr[], [72, 0xFE_FEFE, 100])); auto r2 = U24A(iota(0, 100)); assert(equalS(r2[], iota(0, 100)), text(r2[])); copy(iota(10, 170, 2), r2[10..90]); assert(equalS(r2[], chain(iota(0, 10), iota(10, 170, 2), iota(90, 100))) , text(r2[])); } } version(unittest) { private alias AllSets = TypeTuple!(InversionList!GcPolicy, InversionList!ReallocPolicy); } @trusted unittest// core set primitives test { foreach(CodeList; AllSets) { CodeList a; //"plug a hole" test a.add(10, 20).add(25, 30).add(15, 27); assert(a == CodeList(10, 30), text(a)); auto x = CodeList.init; x.add(10, 20).add(30, 40).add(50, 60); a = x; a.add(20, 49);//[10, 49) [50, 60) assert(a == CodeList(10, 49, 50 ,60)); a = x; a.add(20, 50); assert(a == CodeList(10, 60), text(a)); // simple unions, mostly edge effects x = CodeList.init; x.add(10, 20).add(40, 60); a = x; a.add(10, 25); //[10, 25) [40, 60) assert(a == CodeList(10, 25, 40, 60)); a = x; a.add(5, 15); //[5, 20) [40, 60) assert(a == CodeList(5, 20, 40, 60)); a = x; a.add(0, 10); // [0, 20) [40, 60) assert(a == CodeList(0, 20, 40, 60)); a = x; a.add(0, 5); // prepand assert(a == CodeList(0, 5, 10, 20, 40, 60), text(a)); a = x; a.add(5, 20); assert(a == CodeList(5, 20, 40, 60)); a = x; a.add(3, 37); assert(a == CodeList(3, 37, 40, 60)); a = x; a.add(37, 65); assert(a == CodeList(10, 20, 37, 65)); // some tests on helpers for set intersection x = CodeList.init.add(10, 20).add(40, 60).add(100, 120); a = x; auto m = a.skipUpTo(60); a.dropUpTo(110, m); assert(a == CodeList(10, 20, 40, 60, 110, 120), text(a.data[])); a = x; a.dropUpTo(100); assert(a == CodeList(100, 120), text(a.data[])); a = x; m = a.skipUpTo(50); a.dropUpTo(140, m); assert(a == CodeList(10, 20, 40, 50), text(a.data[])); a = x; a.dropUpTo(60); assert(a == CodeList(100, 120), text(a.data[])); } } //test constructor to work with any order of intervals @system unittest //@@@BUG@@@ iota is @system { import std.conv, std.range, std.algorithm; //ensure constructor handles bad ordering and overlap auto c1 = CodepointSet('а', 'я'+1, 'А','Я'+1); foreach(ch; chain(iota('а', 'я'+1), iota('А','Я'+1))) assert(ch in c1, to!string(ch)); //contiguos assert(CodepointSet(1000, 1006, 1006, 1009) .byInterval.equal([tuple(1000, 1009)])); //contains assert(CodepointSet(900, 1200, 1000, 1100) .byInterval.equal([tuple(900, 1200)])); //intersect left assert(CodepointSet(900, 1100, 1000, 1200) .byInterval.equal([tuple(900, 1200)])); //intersect right assert(CodepointSet(1000, 1200, 900, 1100) .byInterval.equal([tuple(900, 1200)])); //ditto with extra items at end assert(CodepointSet(1000, 1200, 900, 1100, 800, 850) .byInterval.equal([tuple(800, 850), tuple(900, 1200)])); assert(CodepointSet(900, 1100, 1000, 1200, 800, 850) .byInterval.equal([tuple(800, 850), tuple(900, 1200)])); //"plug a hole" test auto c2 = CodepointSet(20, 40, 60, 80, 100, 140, 150, 200, 40, 60, 80, 100, 140, 150 ); assert(c2.byInterval.equal([tuple(20, 200)])); auto c3 = CodepointSet( 20, 40, 60, 80, 100, 140, 150, 200, 0, 10, 15, 100, 10, 20, 200, 220); assert(c3.byInterval.equal([tuple(0, 140), tuple(150, 220)])); } @trusted unittest { // full set operations foreach(CodeList; AllSets) { CodeList a, b, c, d; //"plug a hole" a.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b.add(40, 60).add(80, 100).add(140, 150); c = a | b; d = b | a; assert(c == CodeList(20, 200), text(CodeList.stringof," ", c)); assert(c == d, text(c," vs ", d)); b = CodeList.init.add(25, 45).add(65, 85).add(95,110).add(150, 210); c = a | b; //[20,45) [60, 85) [95, 140) [150, 210) d = b | a; assert(c == CodeList(20, 45, 60, 85, 95, 140, 150, 210), text(c)); assert(c == d, text(c," vs ", d)); b = CodeList.init.add(10, 20).add(30,100).add(145,200); c = a | b;//[10, 140) [145, 200) d = b | a; assert(c == CodeList(10, 140, 145, 200)); assert(c == d, text(c," vs ", d)); b = CodeList.init.add(0, 10).add(15, 100).add(10, 20).add(200, 220); c = a | b;//[0, 140) [150, 220) d = b | a; assert(c == CodeList(0, 140, 150, 220)); assert(c == d, text(c," vs ", d)); a = CodeList.init.add(20, 40).add(60, 80); b = CodeList.init.add(25, 35).add(65, 75); c = a & b; d = b & a; assert(c == CodeList(25, 35, 65, 75), text(c)); assert(c == d, text(c," vs ", d)); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(25, 35).add(65, 75).add(110, 130).add(160, 180); c = a & b; d = b & a; assert(c == CodeList(25, 35, 65, 75, 110, 130, 160, 180), text(c)); assert(c == d, text(c," vs ", d)); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(10, 30).add(60, 120).add(135, 160); c = a & b;//[20, 30)[60, 80) [100, 120) [135, 140) [150, 160) d = b & a; assert(c == CodeList(20, 30, 60, 80, 100, 120, 135, 140, 150, 160),text(c)); assert(c == d, text(c, " vs ",d)); assert((c & a) == c); assert((d & b) == d); assert((c & d) == d); b = CodeList.init.add(40, 60).add(80, 100).add(140, 200); c = a & b; d = b & a; assert(c == CodeList(150, 200), text(c)); assert(c == d, text(c, " vs ",d)); assert((c & a) == c); assert((d & b) == d); assert((c & d) == d); assert((a & a) == a); assert((b & b) == b); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(30, 60).add(75, 120).add(190, 300); c = a - b;// [30, 40) [60, 75) [120, 140) [150, 190) d = b - a;// [40, 60) [80, 100) [200, 300) assert(c == CodeList(20, 30, 60, 75, 120, 140, 150, 190), text(c)); assert(d == CodeList(40, 60, 80, 100, 200, 300), text(d)); assert(c - d == c, text(c-d, " vs ", c)); assert(d - c == d, text(d-c, " vs ", d)); assert(c - c == CodeList.init); assert(d - d == CodeList.init); a = CodeList.init.add(20, 40).add( 60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(10, 50).add(60, 160).add(190, 300); c = a - b;// [160, 190) d = b - a;// [10, 20) [40, 50) [80, 100) [140, 150) [200, 300) assert(c == CodeList(160, 190), text(c)); assert(d == CodeList(10, 20, 40, 50, 80, 100, 140, 150, 200, 300), text(d)); assert(c - d == c, text(c-d, " vs ", c)); assert(d - c == d, text(d-c, " vs ", d)); assert(c - c == CodeList.init); assert(d - d == CodeList.init); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(10, 30).add(45, 100).add(130, 190); c = a ~ b; // [10, 20) [30, 40) [45, 60) [80, 130) [140, 150) [190, 200) d = b ~ a; assert(c == CodeList(10, 20, 30, 40, 45, 60, 80, 130, 140, 150, 190, 200), text(c)); assert(c == d, text(c, " vs ", d)); } } @system: unittest// vs single dchar { CodepointSet a = CodepointSet(10, 100, 120, 200); assert(a - 'A' == CodepointSet(10, 65, 66, 100, 120, 200), text(a - 'A')); assert((a & 'B') == CodepointSet(66, 67)); } unittest// iteration & opIndex { import std.typecons; foreach(CodeList; TypeTuple!(InversionList!(ReallocPolicy))) { auto arr = "ABCDEFGHIJKLMabcdefghijklm"d; auto a = CodeList('A','N','a', 'n'); assert(equalS(a.byInterval, [tuple(cast(uint)'A', cast(uint)'N'), tuple(cast(uint)'a', cast(uint)'n')] ), text(a.byInterval)); // same @@@BUG as in issue 8949 ? version(bug8949) { assert(equalS(retro(a.byInterval), [tuple(cast(uint)'a', cast(uint)'n'), tuple(cast(uint)'A', cast(uint)'N')] ), text(retro(a.byInterval))); } auto achr = a.byCodepoint; assert(equalS(achr, arr), text(a.byCodepoint)); foreach(ch; a.byCodepoint) assert(a[ch]); auto x = CodeList(100, 500, 600, 900, 1200, 1500); assert(equalS(x.byInterval, [ tuple(100, 500), tuple(600, 900), tuple(1200, 1500)]), text(x.byInterval)); foreach(ch; x.byCodepoint) assert(x[ch]); static if(is(CodeList == CodepointSet)) { auto y = CodeList(x.byInterval); assert(equalS(x.byInterval, y.byInterval)); } assert(equalS(CodepointSet.init.byInterval, cast(Tuple!(uint, uint)[])[])); assert(equalS(CodepointSet.init.byCodepoint, cast(dchar[])[])); } } //============================================================================ // Generic Trie template and various ways to build it //============================================================================ // debug helper to get a shortened array dump auto arrayRepr(T)(T x) { if(x.length > 32) { return text(x[0..16],"~...~", x[x.length-16..x.length]); } else return text(x); } /** Maps $(D Key) to a suitable integer index within the range of $(D size_t). The mapping is constructed by applying predicates from $(D Prefix) left to right and concatenating the resulting bits. The first (leftmost) predicate defines the most significant bits of the resulting index. */ template mapTrieIndex(Prefix...) { size_t mapTrieIndex(Key)(Key key) if(isValidPrefixForTrie!(Key, Prefix)) { alias p = Prefix; size_t idx; foreach(i, v; p[0..$-1]) { idx |= p[i](key); idx <<= p[i+1].bitSize; } idx |= p[$-1](key); return idx; } } /* $(D TrieBuilder) is a type used for incremental construction of $(LREF Trie)s. See $(LREF buildTrie) for generic helpers built on top of it. */ @trusted struct TrieBuilder(Value, Key, Args...) if(isBitPackableType!Value && isValidArgsForTrie!(Key, Args)) { private: // last index is not stored in table, it is used as an offset to values in a block. static if(is(Value == bool))// always pack bool alias V = BitPacked!(Value, 1); else alias V = Value; static auto deduceMaxIndex(Preds...)() { size_t idx = 1; foreach(v; Preds) idx *= 2^^v.bitSize; return idx; } static if(is(typeof(Args[0]) : Key)) // Args start with upper bound on Key { alias Prefix = Args[1..$]; enum lastPageSize = 2^^Prefix[$-1].bitSize; enum translatedMaxIndex = mapTrieIndex!(Prefix)(Args[0]); enum roughedMaxIndex = (translatedMaxIndex + lastPageSize-1)/lastPageSize*lastPageSize; // check warp around - if wrapped, use the default deduction rule enum maxIndex = roughedMaxIndex < translatedMaxIndex ? deduceMaxIndex!(Prefix)() : roughedMaxIndex; } else { alias Prefix = Args; enum maxIndex = deduceMaxIndex!(Prefix)(); } alias getIndex = mapTrieIndex!(Prefix); enum lastLevel = Prefix.length-1; struct ConstructState { size_t idx_zeros, idx_ones; } // iteration over levels of Trie, each indexes its own level and thus a shortened domain size_t[Prefix.length] indices; // default filler value to use Value defValue; // this is a full-width index of next item size_t curIndex; // all-zeros page index, all-ones page index (+ indicator if there is such a page) ConstructState[Prefix.length] state; // the table being constructed MultiArray!(idxTypes!(Key, fullBitSize!(Prefix), Prefix[0..$]), V) table; @disable this(); //shortcut for index variable at level 'level' @property ref idx(size_t level)(){ return indices[level]; } // this function assumes no holes in the input so // indices are going one by one void addValue(size_t level, T)(T val, size_t numVals) { alias j = idx!level; enum pageSize = 1<<Prefix[level].bitSize; if(numVals == 0) return; auto ptr = table.slice!(level); if(numVals == 1) { static if(level == Prefix.length-1) ptr[j] = val; else {// can incur narrowing conversion assert(j < ptr.length); ptr[j] = force!(typeof(ptr[j]))(val); } j++; if(j % pageSize == 0) spillToNextPage!level(ptr); return; } // longer row of values // get to the next page boundary size_t nextPB = (j + pageSize) & ~(pageSize-1); size_t n = nextPB - j;// can fill right in this page if(numVals < n) //fits in current page { ptr[j..j+numVals] = val; j += numVals; return; } static if(level != 0)//on the first level it always fits { numVals -= n; //write till the end of current page ptr[j..j+n] = val; j += n; //spill to the next page spillToNextPage!level(ptr); // page at once loop if(state[level].idx_zeros != size_t.max && val == T.init) { alias NextIdx = typeof(table.slice!(level-1)[0]); addValue!(level-1)(force!NextIdx(state[level].idx_zeros), numVals/pageSize); ptr = table.slice!level; //table structure might have changed numVals %= pageSize; } else { while(numVals >= pageSize) { numVals -= pageSize; ptr[j..j+pageSize] = val; j += pageSize; spillToNextPage!level(ptr); } } if(numVals) { // the leftovers, an incomplete page ptr[j..j+numVals] = val; j += numVals; } } } void spillToNextPage(size_t level, Slice)(ref Slice ptr) { // last level (i.e. topmost) has 1 "page" // thus it need not to add a new page on upper level static if(level != 0) spillToNextPageImpl!(level)(ptr); } // this can re-use the current page if duplicate or allocate a new one // it also makes sure that previous levels point to the correct page in this level void spillToNextPageImpl(size_t level, Slice)(ref Slice ptr) { alias NextIdx = typeof(table.slice!(level-1)[0]); NextIdx next_lvl_index; enum pageSize = 1<<Prefix[level].bitSize; assert(idx!level % pageSize == 0); auto last = idx!level-pageSize; auto slice = ptr[idx!level - pageSize..idx!level]; size_t j; for(j=0; j<last; j+=pageSize) { if(ptr[j..j+pageSize] == slice) { // get index to it, reuse ptr space for the next block next_lvl_index = force!NextIdx(j/pageSize); version(none) { writefln("LEVEL(%s) page maped idx: %s: 0..%s ---> [%s..%s]" ,level ,indices[level-1], pageSize, j, j+pageSize); writeln("LEVEL(", level , ") mapped page is: ", slice, ": ", arrayRepr(ptr[j..j+pageSize])); writeln("LEVEL(", level , ") src page is :", ptr, ": ", arrayRepr(slice[0..pageSize])); } idx!level -= pageSize; // reuse this page, it is duplicate break; } } if(j == last) { L_allocate_page: next_lvl_index = force!NextIdx(idx!level/pageSize - 1); if(state[level].idx_zeros == size_t.max && ptr.zeros(j, j+pageSize)) { state[level].idx_zeros = next_lvl_index; } // allocate next page version(none) { writefln("LEVEL(%s) page allocated: %s" , level, arrayRepr(slice[0..pageSize])); writefln("LEVEL(%s) index: %s ; page at this index %s" , level , next_lvl_index , arrayRepr( table.slice!(level) [pageSize*next_lvl_index..(next_lvl_index+1)*pageSize] )); } table.length!level = table.length!level + pageSize; } L_know_index: // for the previous level, values are indices to the pages in the current level addValue!(level-1)(next_lvl_index, 1); ptr = table.slice!level; //re-load the slice after moves } // idx - full-width index to fill with v (full-width index != key) // fills everything in the range of [curIndex, idx) with filler void putAt(size_t idx, Value v) { assert(idx >= curIndex); size_t numFillers = idx - curIndex; addValue!lastLevel(defValue, numFillers); addValue!lastLevel(v, 1); curIndex = idx + 1; } // ditto, but sets the range of [idxA, idxB) to v void putRangeAt(size_t idxA, size_t idxB, Value v) { assert(idxA >= curIndex); assert(idxB >= idxA); size_t numFillers = idxA - curIndex; addValue!lastLevel(defValue, numFillers); addValue!lastLevel(v, idxB - idxA); curIndex = idxB; // open-right } enum errMsg = "non-monotonic prefix function(s), an unsorted range or "~ "duplicate key->value mapping"; public: /** Construct a builder, where $(D filler) is a value to indicate empty slots (or "not found" condition). */ this(Value filler) { curIndex = 0; defValue = filler; // zeros-page index, ones-page index foreach(ref v; state) v = ConstructState(size_t.max, size_t.max); table = typeof(table)(indices); // one page per level is a bootstrap minimum foreach(i; Sequence!(0, Prefix.length)) table.length!i = (1<<Prefix[i].bitSize); } /** Put a value $(D v) into interval as mapped by keys from $(D a) to $(D b). All slots prior to $(D a) are filled with the default filler. */ void putRange(Key a, Key b, Value v) { auto idxA = getIndex(a), idxB = getIndex(b); // indexes of key should always grow enforce(idxB >= idxA && idxA >= curIndex, errMsg); putRangeAt(idxA, idxB, v); } /** Put a value $(D v) into slot mapped by $(D key). All slots prior to $(D key) are filled with the default filler. */ void putValue(Key key, Value v) { auto idx = getIndex(key); enforce(idx >= curIndex, text(errMsg, " ", idx)); putAt(idx, v); } /// Finishes construction of Trie, yielding an immutable Trie instance. auto build() { static if(maxIndex != 0) // doesn't cover full range of size_t { assert(curIndex <= maxIndex); addValue!lastLevel(defValue, maxIndex - curIndex); } else { if(curIndex != 0 // couldn't wrap around || (Prefix.length != 1 && indices[lastLevel] == 0)) // can be just empty { addValue!lastLevel(defValue, size_t.max - curIndex); addValue!lastLevel(defValue, 1); } // else curIndex already completed the full range of size_t by wrapping around } return Trie!(V, Key, maxIndex, Prefix)(table); } } /* $(P A generic Trie data-structure for a fixed number of stages. The design goal is optimal speed with smallest footprint size. ) $(P It's intentionally read-only and doesn't provide constructors. To construct one use a special builder, see $(LREF TrieBuilder) and $(LREF buildTrie). ) */ @trusted public struct Trie(Value, Key, Args...) if(isValidPrefixForTrie!(Key, Args) || (isValidPrefixForTrie!(Key, Args[1..$]) && is(typeof(Args[0]) : size_t))) { static if(is(typeof(Args[0]) : size_t)) { enum maxIndex = Args[0]; enum hasBoundsCheck = true; alias Prefix = Args[1..$]; } else { enum hasBoundsCheck = false; alias Prefix = Args; } private this()(typeof(_table) table) { _table = table; } // only for constant Tries constructed from precompiled tables private this()(const(size_t)[] offsets, const(size_t)[] sizes, const(size_t)[] data) const { _table = typeof(_table)(offsets, sizes, data); } /* $(P Lookup the $(D key) in this $(D Trie). ) $(P The lookup always succeeds if key fits the domain provided during construction. The whole domain defined is covered so instead of not found condition the sentinel (filler) value could be used. ) $(P See $(LREF buildTrie), $(LREF TrieBuilder) for how to define a domain of $(D Trie) keys and the sentinel value. ) Note: Domain range-checking is only enabled in debug builds and results in assertion failure. */ // templated to auto-detect pure, @safe and nothrow TypeOfBitPacked!Value opIndex()(Key key) const { static if(hasBoundsCheck) assert(mapTrieIndex!Prefix(key) < maxIndex); size_t idx; alias p = Prefix; idx = cast(size_t)p[0](key); foreach(i, v; p[0..$-1]) idx = cast(size_t)((_table.ptr!i[idx]<<p[i+1].bitSize) + p[i+1](key)); return _table.ptr!(p.length-1)[idx]; } @property size_t bytes(size_t n=size_t.max)() const { return _table.bytes!n; } @property size_t pages(size_t n)() const { return (bytes!n+2^^(Prefix[n].bitSize-1)) /2^^Prefix[n].bitSize; } void store(OutRange)(scope OutRange sink) const if(isOutputRange!(OutRange, char)) { _table.store(sink); } private: MultiArray!(idxTypes!(Key, fullBitSize!(Prefix), Prefix[0..$]), Value) _table; } // create a tuple of 'sliceBits' that slice the 'top' of bits into pieces of sizes 'sizes' // left-to-right, the most significant bits first template GetBitSlicing(size_t top, sizes...) { static if(sizes.length > 0) alias GetBitSlicing = TypeTuple!(sliceBits!(top - sizes[0], top), GetBitSlicing!(top - sizes[0], sizes[1..$])); else alias GetBitSlicing = TypeTuple!(); } template callableWith(T) { template callableWith(alias Pred) { static if(!is(typeof(Pred(T.init)))) enum callableWith = false; else { alias Result = typeof(Pred(T.init)); enum callableWith = isBitPackableType!(TypeOfBitPacked!(Result)); } } } /* Check if $(D Prefix) is a valid set of predicates for $(D Trie) template having $(D Key) as the type of keys. This requires all predicates to be callable, take single argument of type $(D Key) and return unsigned value. */ template isValidPrefixForTrie(Key, Prefix...) { enum isValidPrefixForTrie = allSatisfy!(callableWith!Key, Prefix); // TODO: tighten the screws } /* Check if $(D Args) is a set of maximum key value followed by valid predicates for $(D Trie) template having $(D Key) as the type of keys. */ template isValidArgsForTrie(Key, Args...) { static if(Args.length > 1) { enum isValidArgsForTrie = isValidPrefixForTrie!(Key, Args) || (isValidPrefixForTrie!(Key, Args[1..$]) && is(typeof(Args[0]) : Key)); } else enum isValidArgsForTrie = isValidPrefixForTrie!Args; } @property size_t sumOfIntegerTuple(ints...)() { size_t count=0; foreach(v; ints) count += v; return count; } /** A shorthand for creating a custom multi-level fixed Trie from a $(D CodepointSet). $(D sizes) are numbers of bits per level, with the most significant bits used first. Note: The sum of $(D sizes) must be equal 21. See_Also: $(LREF toTrie), which is even simpler. Example: --- { import std.stdio; auto set = unicode("Number"); auto trie = codepointSetTrie!(8, 5, 8)(set); writeln("Input code points to test:"); foreach(line; stdin.byLine) { int count=0; foreach(dchar ch; line) if(trie[ch])// is number count++; writefln("Contains %d number code points.", count); } } --- */ public template codepointSetTrie(sizes...) if(sumOfIntegerTuple!sizes == 21) { auto codepointSetTrie(Set)(Set set) if(isCodepointSet!Set) { auto builder = TrieBuilder!(bool, dchar, lastDchar+1, GetBitSlicing!(21, sizes))(false); foreach(ival; set.byInterval) builder.putRange(ival[0], ival[1], true); return builder.build(); } } /// Type of Trie generated by codepointSetTrie function. public template CodepointSetTrie(sizes...) if(sumOfIntegerTuple!sizes == 21) { alias Prefix = GetBitSlicing!(21, sizes); alias CodepointSetTrie = typeof(TrieBuilder!(bool, dchar, lastDchar+1, Prefix)(false).build()); } /** A slightly more general tool for building fixed $(D Trie) for the Unicode data. Specifically unlike $(D codepointSetTrie) it's allows creating mappings of $(D dchar) to an arbitrary type $(D T). Note: Overload taking $(D CodepointSet)s will naturally convert only to bool mapping $(D Trie)s. Example: --- // pick characters from the Greek script auto set = unicode.Greek; // a user-defined property (or an expensive function) // that we want to look up static uint luckFactor(dchar ch) { // here we consider a character lucky // if its code point has a lot of identical hex-digits // e.g. arabic letter DDAL (\u0688) has a "luck factor" of 2 ubyte[6] nibbles; // 6 4-bit chunks of code point uint value = ch; foreach(i; 0..6) { nibbles[i] = value & 0xF; value >>= 4; } uint luck; foreach(n; nibbles) luck = cast(uint)max(luck, count(nibbles[], n)); return luck; } // only unsigned built-ins are supported at the moment alias LuckFactor = BitPacked!(uint, 3); // create a temporary associative array (AA) LuckFactor[dchar] map; foreach(ch; set.byCodepoint) map[ch] = luckFactor(ch); // bits per stage are chosen randomly, fell free to optimize auto trie = codepointTrie!(LuckFactor, 8, 5, 8)(map); // from now on the AA is not needed foreach(ch; set.byCodepoint) assert(trie[ch] == luckFactor(ch)); // verify // CJK is not Greek, thus it has the default value assert(trie['\u4444'] == 0); // and here is a couple of quite lucky Greek characters: // Greek small letter epsilon with dasia assert(trie['\u1F11'] == 3); // Ancient Greek metretes sign assert(trie['\U00010181'] == 3); --- */ public template codepointTrie(T, sizes...) if(sumOfIntegerTuple!sizes == 21) { alias Prefix = GetBitSlicing!(21, sizes); static if(is(TypeOfBitPacked!T == bool)) { auto codepointTrie(Set)(in Set set) if(isCodepointSet!Set) { return codepointSetTrie(set); } } auto codepointTrie()(T[dchar] map, T defValue=T.init) { return buildTrie!(T, dchar, Prefix)(map, defValue); } // unsorted range of pairs auto codepointTrie(R)(R range, T defValue=T.init) if(isInputRange!R && is(typeof(ElementType!R.init[0]) : T) && is(typeof(ElementType!R.init[1]) : dchar)) { // build from unsorted array of pairs // TODO: expose index sorting functions for Trie return buildTrie!(T, dchar, Prefix)(range, defValue, true); } } unittest // codepointTrie example { // pick characters from the Greek script auto set = unicode.Greek; // a user-defined property (or an expensive function) // that we want to look up static uint luckFactor(dchar ch) { // here we consider a character lucky // if its code point has a lot of identical hex-digits // e.g. arabic letter DDAL (\u0688) has a "luck factor" of 2 ubyte[6] nibbles; // 6 4-bit chunks of code point uint value = ch; foreach(i; 0..6) { nibbles[i] = value & 0xF; value >>= 4; } uint luck; foreach(n; nibbles) luck = cast(uint)max(luck, count(nibbles[], n)); return luck; } // only unsigned built-ins are supported at the moment alias LuckFactor = BitPacked!(uint, 3); // create a temporary associative array (AA) LuckFactor[dchar] map; foreach(ch; set.byCodepoint) map[ch] = LuckFactor(luckFactor(ch)); // bits per stage are chosen randomly, fell free to optimize auto trie = codepointTrie!(LuckFactor, 8, 5, 8)(map); // from now on the AA is not needed foreach(ch; set.byCodepoint) assert(trie[ch] == luckFactor(ch)); // verify // CJK is not Greek, thus it has the default value assert(trie['\u4444'] == 0); // and here is a couple of quite lucky Greek characters: // Greek small letter epsilon with dasia assert(trie['\u1F11'] == 3); // Ancient Greek metretes sign assert(trie['\U00010181'] == 3); } /// Type of Trie as generated by codepointTrie function. public template CodepointTrie(T, sizes...) if(sumOfIntegerTuple!sizes == 21) { alias Prefix = GetBitSlicing!(21, sizes); alias CodepointTrie = typeof(TrieBuilder!(T, dchar, lastDchar+1, Prefix)(T.init).build()); } // @@@BUG multiSort can's access private symbols from uni public template cmpK0(alias Pred) { import std.typecons; static bool cmpK0(Value, Key) (Tuple!(Value, Key) a, Tuple!(Value, Key) b) { return Pred(a[1]) < Pred(b[1]); } } /* The most general utility for construction of $(D Trie)s short of using $(D TrieBuilder) directly. Provides a number of convenience overloads. $(D Args) is tuple of maximum key value followed by predicates to construct index from key. Alternatively if the first argument is not a value convertible to $(D Key) then the whole tuple of $(D Args) is treated as predicates and the maximum Key is deduced from predicates. */ public template buildTrie(Value, Key, Args...) if(isValidArgsForTrie!(Key, Args)) { static if(is(typeof(Args[0]) : Key)) // prefix starts with upper bound on Key { alias Prefix = Args[1..$]; } else alias Prefix = Args; alias getIndex = mapTrieIndex!(Prefix); // for multi-sort template GetComparators(size_t n) { static if(n > 0) alias GetComparators = TypeTuple!(GetComparators!(n-1), cmpK0!(Prefix[n-1])); else alias GetComparators = TypeTuple!(); } /* Build $(D Trie) from a range of a Key-Value pairs, assuming it is sorted by Key as defined by the following lambda: ------ (a, b) => mapTrieIndex!(Prefix)(a) < mapTrieIndex!(Prefix)(b) ------ Exception is thrown if it's detected that the above order doesn't hold. In other words $(LREF mapTrieIndex) should be a monotonically increasing function that maps $(D Key) to an integer. See also: $(XREF _algorithm, sort), $(XREF _range, SortedRange), $(XREF _algorithm, setUnion). */ auto buildTrie(Range)(Range range, Value filler=Value.init) if(isInputRange!Range && is(typeof(Range.init.front[0]) : Value) && is(typeof(Range.init.front[1]) : Key)) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(v; range) builder.putValue(v[1], v[0]); return builder.build(); } /* If $(D Value) is bool (or BitPacked!(bool, x)) then it's possible to build $(D Trie) from a range of open-right intervals of $(D Key)s. The requirement on the ordering of keys (and the behavior on the violation of it) is the same as for Key-Value range overload. Intervals denote ranges of !$(D filler) i.e. the opposite of filler. If no filler provided keys inside of the intervals map to true, and $(D filler) is false. */ auto buildTrie(Range)(Range range, Value filler=Value.init) if(is(TypeOfBitPacked!Value == bool) && isInputRange!Range && is(typeof(Range.init.front[0]) : Key) && is(typeof(Range.init.front[1]) : Key)) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(ival; range) builder.putRange(ival[0], ival[1], !filler); return builder.build(); } auto buildTrie(Range)(Range range, Value filler, bool unsorted) if(isInputRange!Range && is(typeof(Range.init.front[0]) : Value) && is(typeof(Range.init.front[1]) : Key)) { alias Comps = GetComparators!(Prefix.length); if(unsorted) multiSort!(Comps)(range); return buildTrie(range, filler); } /* If $(D Value) is bool (or BitPacked!(bool, x)) then it's possible to build $(D Trie) simply from an input range of $(D Key)s. The requirement on the ordering of keys (and the behavior on the violation of it) is the same as for Key-Value range overload. Keys found in range denote !$(D filler) i.e. the opposite of filler. If no filler provided keys map to true, and $(D filler) is false. */ auto buildTrie(Range)(Range range, Value filler=Value.init) if(is(TypeOfBitPacked!Value == bool) && isInputRange!Range && is(typeof(Range.init.front) : Key)) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(v; range) builder.putValue(v, !filler); return builder.build(); } /* If $(D Key) is unsigned integer $(D Trie) could be constructed from array of values where array index serves as key. */ auto buildTrie()(Value[] array, Value filler=Value.init) if(isUnsigned!Key) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(idx, v; array) builder.putValue(idx, v); return builder.build(); } /* Builds $(D Trie) from associative array. */ auto buildTrie(Key, Value)(Value[Key] map, Value filler=Value.init) { auto range = array(zip(map.values, map.keys)); return buildTrie(range, filler, true); // sort it } } /++ Convenience function to construct optimal configurations for packed Trie from any $(D set) of $(CODEPOINTS). The parameter $(D level) indicates the number of trie levels to use, allowed values are: 1, 2, 3 or 4. Levels represent different trade-offs speed-size wise. $(P Level 1 is fastest and the most memory hungry (a bit array). ) $(P Level 4 is the slowest and has the smallest footprint. ) See the $(S_LINK Synopsis, Synopsis) section for example. Note: Level 4 stays very practical (being faster and more predictable) compared to using direct lookup on the $(D set) itself. +/ public auto toTrie(size_t level, Set)(Set set) if(isCodepointSet!Set) { static if(level == 1) return codepointSetTrie!(21)(set); else static if(level == 2) return codepointSetTrie!(10, 11)(set); else static if(level == 3) return codepointSetTrie!(8, 5, 8)(set); else static if(level == 4) return codepointSetTrie!(6, 4, 4, 7)(set); else static assert(false, "Sorry, toTrie doesn't support levels > 4, use codepointSetTrie directly"); } /** $(P Builds a $(D Trie) with typically optimal speed-size trade-off and wraps it into a delegate of the following type: $(D bool delegate(dchar ch)). ) $(P Effectively this creates a 'tester' lambda suitable for algorithms like std.algorithm.find that take unary predicates. ) See the $(S_LINK Synopsis, Synopsis) section for example. */ public auto toDelegate(Set)(Set set) if(isCodepointSet!Set) { // 3 is very small and is almost as fast as 2-level (due to CPU caches?) auto t = toTrie!3(set); return (dchar ch) => t[ch]; } /** $(P Opaque wrapper around unsigned built-in integers and code unit (char/wchar/dchar) types. Parameter $(D sz) indicates that the value is confined to the range of [0, 2^^sz$(RPAREN). With this knowledge it can be packed more tightly when stored in certain data-structures like trie. ) Note: $(P The $(D BitPacked!(T, sz)) is implicitly convertible to $(D T) but not vise-versa. Users have to ensure the value fits in the range required and use the $(D cast) operator to perform the conversion.) */ struct BitPacked(T, size_t sz) if(isIntegral!T || is(T:dchar)) { enum bitSize = sz; T _value; alias _value this; } /* Depending on the form of the passed argument $(D bitSizeOf) returns the amount of bits required to represent a given type or a return type of a given functor. */ template bitSizeOf(Args...) if(Args.length == 1) { alias T = Args[0]; static if(__traits(compiles, { size_t val = T.bitSize; })) //(is(typeof(T.bitSize) : size_t)) { enum bitSizeOf = T.bitSize; } else static if(is(ReturnType!T dummy == BitPacked!(U, bits), U, size_t bits)) { enum bitSizeOf = bitSizeOf!(ReturnType!T); } else { enum bitSizeOf = T.sizeof*8; } } /** Tests if $(D T) is some instantiation of $(LREF BitPacked)!(U, x) and thus suitable for packing. */ template isBitPacked(T) { static if(is(T dummy == BitPacked!(U, bits), U, size_t bits)) enum isBitPacked = true; else enum isBitPacked = false; } /** Gives the type $(D U) from $(LREF BitPacked)!(U, x) or $(D T) itself for every other type. */ template TypeOfBitPacked(T) { static if(is(T dummy == BitPacked!(U, bits), U, size_t bits)) alias TypeOfBitPacked = U; else alias TypeOfBitPacked = T; } /* Wrapper, used in definition of custom data structures from $(D Trie) template. Applying it to a unary lambda function indicates that the returned value always fits within $(D bits) of bits. */ struct assumeSize(alias Fn, size_t bits) { enum bitSize = bits; static auto ref opCall(T)(auto ref T arg) { return Fn(arg); } } /* A helper for defining lambda function that yields a slice of certain bits from an unsigned integral value. The resulting lambda is wrapped in assumeSize and can be used directly with $(D Trie) template. */ struct sliceBits(size_t from, size_t to) { //for now bypass assumeSize, DMD has trouble inlining it enum bitSize = to-from; static auto opCall(T)(T x) out(result) { assert(result < (1<<to-from)); } body { static assert(from < to); return (x >> from) & ((1<<(to-from))-1); } } uint low_8(uint x) { return x&0xFF; } @safe pure nothrow uint midlow_8(uint x){ return (x&0xFF00)>>8; } alias lo8 = assumeSize!(low_8, 8); alias mlo8 = assumeSize!(midlow_8, 8); static assert(bitSizeOf!lo8 == 8); static assert(bitSizeOf!(sliceBits!(4, 7)) == 3); static assert(bitSizeOf!(BitPacked!(uint, 2)) == 2); template Sequence(size_t start, size_t end) { static if(start < end) alias Sequence = TypeTuple!(start, Sequence!(start+1, end)); else alias Sequence = TypeTuple!(); } //---- TRIE TESTS ---- unittest { static trieStats(TRIE)(TRIE t) { version(std_uni_stats) { import std.stdio; writeln("---TRIE FOOTPRINT STATS---"); foreach(i; Sequence!(0, t.table.dim) ) { writefln("lvl%s = %s bytes; %s pages" , i, t.bytes!i, t.pages!i); } writefln("TOTAL: %s bytes", t.bytes); version(none) { writeln("INDEX (excluding value level):"); foreach(i; Sequence!(0, t.table.dim-1) ) writeln(t.table.slice!(i)[0..t.table.length!i]); } writeln("---------------------------"); } } //@@@BUG link failure, lambdas not found by linker somehow (in case of trie2) // alias lo8 = assumeSize!(8, function (uint x) { return x&0xFF; }); // alias next8 = assumeSize!(7, function (uint x) { return (x&0x7F00)>>8; }); alias CodepointSet Set; auto set = Set('A','Z','a','z'); auto trie = buildTrie!(bool, uint, 256, lo8)(set.byInterval);// simple bool array for(int a='a'; a<'z';a++) assert(trie[a]); for(int a='A'; a<'Z';a++) assert(trie[a]); for(int a=0; a<'A'; a++) assert(!trie[a]); for(int a ='Z'; a<'a'; a++) assert(!trie[a]); trieStats(trie); auto redundant2 = Set( 1, 18, 256+2, 256+111, 512+1, 512+18, 768+2, 768+111); auto trie2 = buildTrie!(bool, uint, 1024, mlo8, lo8)(redundant2.byInterval); trieStats(trie2); foreach(e; redundant2.byCodepoint) assert(trie2[e], text(cast(uint)e, " - ", trie2[e])); foreach(i; 0..1024) { assert(trie2[i] == (i in redundant2)); } auto redundant3 = Set( 2, 4, 6, 8, 16, 2+16, 4+16, 16+6, 16+8, 16+16, 2+32, 4+32, 32+6, 32+8, ); enum max3 = 256; // sliceBits auto trie3 = buildTrie!(bool, uint, max3, sliceBits!(6,8), sliceBits!(4,6), sliceBits!(0,4) )(redundant3.byInterval); trieStats(trie3); foreach(i; 0..max3) assert(trie3[i] == (i in redundant3), text(cast(uint)i)); auto redundant4 = Set( 10, 64, 64+10, 128, 128+10, 256, 256+10, 512, 1000, 2000, 3000, 4000, 5000, 6000 ); enum max4 = 2^^16; auto trie4 = buildTrie!(bool, size_t, max4, sliceBits!(13, 16), sliceBits!(9, 13), sliceBits!(6, 9) , sliceBits!(0, 6) )(redundant4.byInterval); foreach(i; 0..max4){ if(i in redundant4) assert(trie4[i], text(cast(uint)i)); } trieStats(trie4); alias mapToS = mapTrieIndex!(useItemAt!(0, char)); string[] redundantS = ["tea", "start", "orange"]; redundantS.sort!((a,b) => mapToS(a) < mapToS(b))(); auto strie = buildTrie!(bool, string, useItemAt!(0, char))(redundantS); // using first char only assert(redundantS == ["orange", "start", "tea"]); assert(strie["test"], text(strie["test"])); assert(!strie["aea"]); assert(strie["s"]); // a bit size test auto a = array(map!(x => to!ubyte(x))(iota(0, 256))); auto bt = buildTrie!(bool, ubyte, sliceBits!(7, 8), sliceBits!(5, 7), sliceBits!(0, 5))(a); trieStats(bt); foreach(i; 0..256) assert(bt[cast(ubyte)i]); } template useItemAt(size_t idx, T) if(isIntegral!T || is(T: dchar)) { size_t impl(in T[] arr){ return arr[idx]; } alias useItemAt = assumeSize!(impl, 8*T.sizeof); } template useLastItem(T) { size_t impl(in T[] arr){ return arr[$-1]; } alias useLastItem = assumeSize!(impl, 8*T.sizeof); } template fullBitSize(Prefix...) { static if(Prefix.length > 0) enum fullBitSize = bitSizeOf!(Prefix[0])+fullBitSize!(Prefix[1..$]); else enum fullBitSize = 0; } template idxTypes(Key, size_t fullBits, Prefix...) { static if(Prefix.length == 1) {// the last level is value level, so no index once reduced to 1-level alias idxTypes = TypeTuple!(); } else { // Important note on bit packing // Each level has to hold enough of bits to address the next one // The bottom level is known to hold full bit width // thus it's size in pages is full_bit_width - size_of_last_prefix // Recourse on this notion alias idxTypes = TypeTuple!( idxTypes!(Key, fullBits - bitSizeOf!(Prefix[$-1]), Prefix[0..$-1]), BitPacked!(typeof(Prefix[$-2](Key.init)), fullBits - bitSizeOf!(Prefix[$-1])) ); } } //============================================================================ @trusted int comparePropertyName(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) { alias low = std.ascii.toLower; return cmp( a.map!(x => low(x))() .filter!(x => !isWhite(x) && x != '-' && x != '_')(), b.map!(x => low(x))() .filter!(x => !isWhite(x) && x != '-' && x != '_')() ); } bool propertyNameLess(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) { return comparePropertyName(a, b) < 0; } //============================================================================ // Utilities for compression of Unicode code point sets //============================================================================ @safe void compressTo(uint val, ref ubyte[] arr) pure nothrow { // not optimized as usually done 1 time (and not public interface) if(val < 128) arr ~= cast(ubyte)val; else if(val < (1<<13)) { arr ~= (0b1_00<<5) | cast(ubyte)(val>>8); arr ~= val & 0xFF; } else { assert(val < (1<<21)); arr ~= (0b1_01<<5) | cast(ubyte)(val>>16); arr ~= (val >> 8) & 0xFF; arr ~= val & 0xFF; } } @safe uint decompressFrom(const(ubyte)[] arr, ref size_t idx) pure { uint first = arr[idx++]; if(!(first & 0x80)) // no top bit -> [0..127] return first; uint extra = ((first>>5) & 1) + 1; // [1, 2] uint val = (first & 0x1F); enforce(idx + extra <= arr.length, "bad code point interval encoding"); foreach(j; 0..extra) val = (val<<8) | arr[idx+j]; idx += extra; return val; } package ubyte[] compressIntervals(Range)(Range intervals) if(isInputRange!Range && isIntegralPair!(ElementType!Range)) { ubyte[] storage; uint base = 0; // RLE encode foreach(val; intervals) { compressTo(val[0]-base, storage); base = val[0]; if(val[1] != lastDchar+1) // till the end of the domain so don't store it { compressTo(val[1]-base, storage); base = val[1]; } } return storage; } unittest { auto run = [tuple(80, 127), tuple(128, (1<<10)+128)]; ubyte[] enc = [cast(ubyte)80, 47, 1, (0b1_00<<5) | (1<<2), 0]; assert(compressIntervals(run) == enc); auto run2 = [tuple(0, (1<<20)+512+1), tuple((1<<20)+512+4, lastDchar+1)]; ubyte[] enc2 = [cast(ubyte)0, (0b1_01<<5) | (1<<4), 2, 1, 3]; // odd length-ed assert(compressIntervals(run2) == enc2); size_t idx = 0; assert(decompressFrom(enc, idx) == 80); assert(decompressFrom(enc, idx) == 47); assert(decompressFrom(enc, idx) == 1); assert(decompressFrom(enc, idx) == (1<<10)); idx = 0; assert(decompressFrom(enc2, idx) == 0); assert(decompressFrom(enc2, idx) == (1<<20)+512+1); assert(equalS(decompressIntervals(compressIntervals(run)), run)); assert(equalS(decompressIntervals(compressIntervals(run2)), run2)); } // Creates a range of $(D CodepointInterval) that lazily decodes compressed data. @safe package auto decompressIntervals(const(ubyte)[] data) { return DecompressedIntervals(data); } @trusted struct DecompressedIntervals { const(ubyte)[] _stream; size_t _idx; CodepointInterval _front; this(const(ubyte)[] stream) { _stream = stream; popFront(); } @property CodepointInterval front() { assert(!empty); return _front; } void popFront() { if(_idx == _stream.length) { _idx = size_t.max; return; } uint base = _front[1]; _front[0] = base + decompressFrom(_stream, _idx); if(_idx == _stream.length)// odd length ---> till the end _front[1] = lastDchar+1; else { base = _front[0]; _front[1] = base + decompressFrom(_stream, _idx); } } @property bool empty() const { return _idx == size_t.max; } @property DecompressedIntervals save() { return this; } } static assert(isInputRange!DecompressedIntervals); static assert(isForwardRange!DecompressedIntervals); //============================================================================ version(std_uni_bootstrap){} else { // helper for looking up code point sets @trusted ptrdiff_t findUnicodeSet(alias table, C)(in C[] name) { auto range = assumeSorted!((a,b) => propertyNameLess(a,b)) (table.map!"a.name"()); size_t idx = range.lowerBound(name).length; if(idx < range.length && comparePropertyName(range[idx], name) == 0) return idx; return -1; } // another one that loads it @trusted bool loadUnicodeSet(alias table, Set, C)(in C[] name, ref Set dest) { auto idx = findUnicodeSet!table(name); if(idx >= 0) { dest = Set(asSet(table[idx].compressed)); return true; } return false; } @trusted bool loadProperty(Set=CodepointSet, C) (in C[] name, ref Set target) { alias ucmp = comparePropertyName; // conjure cumulative properties by hand if(ucmp(name, "L") == 0 || ucmp(name, "Letter") == 0) { target |= asSet(uniProps.Lu); target |= asSet(uniProps.Ll); target |= asSet(uniProps.Lt); target |= asSet(uniProps.Lo); target |= asSet(uniProps.Lm); } else if(ucmp(name,"LC") == 0 || ucmp(name,"Cased Letter")==0) { target |= asSet(uniProps.Ll); target |= asSet(uniProps.Lu); target |= asSet(uniProps.Lt);// Title case } else if(ucmp(name, "M") == 0 || ucmp(name, "Mark") == 0) { target |= asSet(uniProps.Mn); target |= asSet(uniProps.Mc); target |= asSet(uniProps.Me); } else if(ucmp(name, "N") == 0 || ucmp(name, "Number") == 0) { target |= asSet(uniProps.Nd); target |= asSet(uniProps.Nl); target |= asSet(uniProps.No); } else if(ucmp(name, "P") == 0 || ucmp(name, "Punctuation") == 0) { target |= asSet(uniProps.Pc); target |= asSet(uniProps.Pd); target |= asSet(uniProps.Ps); target |= asSet(uniProps.Pe); target |= asSet(uniProps.Pi); target |= asSet(uniProps.Pf); target |= asSet(uniProps.Po); } else if(ucmp(name, "S") == 0 || ucmp(name, "Symbol") == 0) { target |= asSet(uniProps.Sm); target |= asSet(uniProps.Sc); target |= asSet(uniProps.Sk); target |= asSet(uniProps.So); } else if(ucmp(name, "Z") == 0 || ucmp(name, "Separator") == 0) { target |= asSet(uniProps.Zs); target |= asSet(uniProps.Zl); target |= asSet(uniProps.Zp); } else if(ucmp(name, "C") == 0 || ucmp(name, "Other") == 0) { target |= asSet(uniProps.Co); target |= asSet(uniProps.Lo); target |= asSet(uniProps.No); target |= asSet(uniProps.So); target |= asSet(uniProps.Po); } else if(ucmp(name, "graphical") == 0){ target |= asSet(uniProps.Alphabetic); target |= asSet(uniProps.Mn); target |= asSet(uniProps.Mc); target |= asSet(uniProps.Me); target |= asSet(uniProps.Nd); target |= asSet(uniProps.Nl); target |= asSet(uniProps.No); target |= asSet(uniProps.Pc); target |= asSet(uniProps.Pd); target |= asSet(uniProps.Ps); target |= asSet(uniProps.Pe); target |= asSet(uniProps.Pi); target |= asSet(uniProps.Pf); target |= asSet(uniProps.Po); target |= asSet(uniProps.Zs); target |= asSet(uniProps.Sm); target |= asSet(uniProps.Sc); target |= asSet(uniProps.Sk); target |= asSet(uniProps.So); } else if(ucmp(name, "any") == 0) target = Set(0,0x110000); else if(ucmp(name, "ascii") == 0) target = Set(0,0x80); else return loadUnicodeSet!(uniProps.tab)(name, target); return true; } // CTFE-only helper for checking property names at compile-time @safe bool isPrettyPropertyName(C)(in C[] name) { auto names = [ "L", "Letters", "LC", "Cased Letter", "M", "Mark", "N", "Number", "P", "Punctuation", "S", "Symbol", "Z", "Separator", "Graphical", "any", "ascii" ]; auto x = find!(x => comparePropertyName(x, name) == 0)(names); return !x.empty; } // ditto, CTFE-only, not optimized @safe private static bool findSetName(alias table, C)(in C[] name) { return findUnicodeSet!table(name) >= 0; } template SetSearcher(alias table, string kind) { /// Run-time checked search. static auto opCall(C)(in C[] name) if(is(C : dchar)) { CodepointSet set; if(loadUnicodeSet!table(name, set)) return set; throw new Exception("No unicode set for "~kind~" by name " ~name.to!string()~" was found."); } /// Compile-time checked search. static @property auto opDispatch(string name)() { static if(findSetName!table(name)) { CodepointSet set; loadUnicodeSet!table(name, set); return set; } else static assert(false, "No unicode set for "~kind~" by name " ~name~" was found."); } } /** A single entry point to lookup Unicode $(CODEPOINT) sets by name or alias of a block, script or general category. It uses well defined standard rules of property name lookup. This includes fuzzy matching of names, so that 'White_Space', 'white-SpAce' and 'whitespace' are all considered equal and yield the same set of white space $(CHARACTERS). */ @safe public struct unicode { /** Performs the lookup of set of $(CODEPOINTS) with compile-time correctness checking. This short-cut version combines 3 searches: across blocks, scripts, and common binary properties. Note that since scripts and blocks overlap the usual trick to disambiguate is used - to get a block use $(D unicode.InBlockName), to search a script use $(D unicode.ScriptName). See also $(LREF block), $(LREF script) and (not included in this search) $(LREF hangulSyllableType). Example: --- auto ascii = unicode.ASCII; assert(ascii['A']); assert(ascii['~']); assert(!ascii['\u00e0']); // matching is case-insensitive assert(ascii == unicode.ascII); assert(!ascii['à']); // underscores, '-' and whitespace in names are ignored too auto latin = unicode.in_latin1_Supplement; assert(latin['à']); assert(!latin['$']); // BTW Latin 1 Supplement is a block, hence "In" prefix assert(latin == unicode("In Latin 1 Supplement")); import std.exception; // run-time look up throws if no such set is found assert(collectException(unicode("InCyrilliac"))); --- */ static @property auto opDispatch(string name)() { static if(findAny(name)) return loadAny(name); else static assert(false, "No unicode set by name "~name~" was found."); } /** The same lookup across blocks, scripts, or binary properties, but performed at run-time. This version is provided for cases where $(D name) is not known beforehand; otherwise compile-time checked $(LREF opDispatch) is typically a better choice. See the $(S_LINK Unicode properties, table of properties) for available sets. */ static auto opCall(C)(in C[] name) if(is(C : dchar)) { return loadAny(name); } /** Narrows down the search for sets of $(CODEPOINTS) to all Unicode blocks. See also $(S_LINK Unicode properties, table of properties). Note: Here block names are unambiguous as no scripts are searched and thus to search use simply $(D unicode.block.BlockName) notation. See $(S_LINK Unicode properties, table of properties) for available sets. Example: --- // use .block for explicitness assert(unicode.block.Greek_and_Coptic == unicode.InGreek_and_Coptic); --- */ struct block { mixin SetSearcher!(blocks.tab, "block"); } /** Narrows down the search for sets of $(CODEPOINTS) to all Unicode scripts. See the $(S_LINK Unicode properties, table of properties) for available sets. Example: --- auto arabicScript = unicode.script.arabic; auto arabicBlock = unicode.block.arabic; // there is an intersection between script and block assert(arabicBlock['؁']); assert(arabicScript['؁']); // but they are different assert(arabicBlock != arabicScript); assert(arabicBlock == unicode.inArabic); assert(arabicScript == unicode.arabic); --- */ struct script { mixin SetSearcher!(scripts.tab, "script"); } /** Fetch a set of $(CODEPOINTS) that have the given hangul syllable type. Other non-binary properties (once supported) follow the same notation - $(D unicode.propertyName.propertyValue) for compile-time checked access and $(D unicode.propertyName(propertyValue)) for run-time checked one. See the $(S_LINK Unicode properties, table of properties) for available sets. Example: --- // L here is syllable type not Letter as in unicode.L short-cut auto leadingVowel = unicode.hangulSyllableType("L"); // check that some leading vowels are present foreach(vowel; '\u1110'..'\u115F') assert(leadingVowel[vowel]); assert(leadingVowel == unicode.hangulSyllableType.L); --- */ struct hangulSyllableType { mixin SetSearcher!(hangul.tab, "hangul syllable type"); } private: alias ucmp = comparePropertyName; static bool findAny(string name) { return isPrettyPropertyName(name) || findSetName!(uniProps.tab)(name) || findSetName!(scripts.tab)(name) || (ucmp(name[0..2],"In") == 0 && findSetName!(blocks.tab)(name[2..$])); } static auto loadAny(Set=CodepointSet, C)(in C[] name) { Set set; bool loaded = loadProperty(name, set) || loadUnicodeSet!(scripts.tab)(name, set) || (ucmp(name[0..2],"In") == 0 && loadUnicodeSet!(blocks.tab)(name[2..$], set)); if(loaded) return set; throw new Exception("No unicode set by name "~name.to!string()~" was found."); } // FIXME: re-disable once the compiler is fixed // Disabled to prevent the mistake of creating instances of this pseudo-struct. //@disable ~this(); } unittest { auto ascii = unicode.ASCII; assert(ascii['A']); assert(ascii['~']); assert(!ascii['\u00e0']); // matching is case-insensitive assert(ascii == unicode.ascII); assert(!ascii['à']); // underscores, '-' and whitespace in names are ignored too auto latin = unicode.Inlatin1_Supplement; assert(latin['à']); assert(!latin['$']); // BTW Latin 1 Supplement is a block, hence "In" prefix assert(latin == unicode("In Latin 1 Supplement")); import std.exception; // R-T look up throws if no such set is found assert(collectException(unicode("InCyrilliac"))); assert(unicode.block.Greek_and_Coptic == unicode.InGreek_and_Coptic); // L here is explicitly syllable type not "Letter" as in unicode.L auto leadingVowel = unicode.hangulSyllableType("L"); // check that some leading vowels are present foreach(vowel; '\u1110'..'\u115F'+1) assert(leadingVowel[vowel]); assert(leadingVowel == unicode.hangulSyllableType.L); auto arabicScript = unicode.script.arabic; auto arabicBlock = unicode.block.arabic; // there is an intersection between script and block assert(arabicBlock['؁']); assert(arabicScript['؁']); // but they are different assert(arabicBlock != arabicScript); assert(arabicBlock == unicode.inArabic); assert(arabicScript == unicode.arabic); } unittest { assert(unicode("InHebrew") == asSet(blocks.Hebrew)); assert(unicode("separator") == (asSet(uniProps.Zs) | asSet(uniProps.Zl) | asSet(uniProps.Zp))); assert(unicode("In-Kharoshthi") == asSet(blocks.Kharoshthi)); } enum EMPTY_CASE_TRIE = ushort.max;// from what gen_uni uses internally // control - '\r' enum controlSwitch = ` case '\u0000':..case '\u0008':case '\u000E':..case '\u001F':case '\u007F':..case '\u0084':case '\u0086':..case '\u009F': case '\u0009':..case '\u000C': case '\u0085': `; // TODO: redo the most of hangul stuff algorithmically in case of Graphemes too // kill unrolled switches private static bool isRegionalIndicator(dchar ch) { return ch >= '\U0001F1E6' && ch <= '\U0001F1FF'; } template genericDecodeGrapheme(bool getValue) { alias graphemeExtend = graphemeExtendTrie; alias spacingMark = mcTrie; static if(getValue) alias Value = Grapheme; else alias Value = void; Value genericDecodeGrapheme(Input)(ref Input range) { enum GraphemeState { Start, CR, RI, L, V, LVT } static if(getValue) Grapheme grapheme; auto state = GraphemeState.Start; enum eat = q{ static if(getValue) grapheme ~= ch; range.popFront(); }; dchar ch; assert(!range.empty, "Attempting to decode grapheme from an empty " ~ Input.stringof); while(!range.empty) { ch = range.front; final switch(state) with(GraphemeState) { case Start: mixin(eat); if(ch == '\r') state = CR; else if(isRegionalIndicator(ch)) state = RI; else if(isHangL(ch)) state = L; else if(hangLV[ch] || isHangV(ch)) state = V; else if(hangLVT[ch]) state = LVT; else if(isHangT(ch)) state = LVT; else { switch(ch) { mixin(controlSwitch); goto L_End; default: goto L_End_Extend; } } break; case CR: if(ch == '\n') mixin(eat); goto L_End_Extend; case RI: if(isRegionalIndicator(ch)) mixin(eat); else goto L_End_Extend; break; case L: if(isHangL(ch)) mixin(eat); else if(isHangV(ch) || hangLV[ch]) { state = V; mixin(eat); } else if(hangLVT[ch]) { state = LVT; mixin(eat); } else goto L_End_Extend; break; case V: if(isHangV(ch)) mixin(eat); else if(isHangT(ch)) { state = LVT; mixin(eat); } else goto L_End_Extend; break; case LVT: if(isHangT(ch)) { mixin(eat); } else goto L_End_Extend; break; } } L_End_Extend: while(!range.empty) { ch = range.front; // extend & spacing marks if(!graphemeExtend[ch] && !spacingMark[ch]) break; mixin(eat); } L_End: static if(getValue) return grapheme; } } @trusted: public: // Public API continues /++ Returns the length of grapheme cluster starting at $(D index). Both the resulting length and the $(D index) are measured in $(S_LINK Code unit, code units). Example: --- // ASCII as usual is 1 code unit, 1 code point etc. assert(graphemeStride(" ", 1) == 1); // A + combing ring above string city = "A\u030Arhus"; size_t first = graphemeStride(city, 0); assert(first == 3); //\u030A has 2 UTF-8 code units assert(city[0..first] == "A\u030A"); assert(city[first..$] == "rhus"); --- +/ size_t graphemeStride(C)(in C[] input, size_t index) if(is(C : dchar)) { auto src = input[index..$]; auto n = src.length; genericDecodeGrapheme!(false)(src); return n - src.length; } // for now tested separately see test_grapheme.d unittest { assert(graphemeStride(" ", 1) == 1); // A + combing ring above string city = "A\u030Arhus"; size_t first = graphemeStride(city, 0); assert(first == 3); //\u030A has 2 UTF-8 code units assert(city[0..first] == "A\u030A"); assert(city[first..$] == "rhus"); } /++ Reads one full grapheme cluster from an input range of dchar $(D inp). For examples see the $(LREF Grapheme) below. Note: This function modifies $(D inp) and thus $(D inp) must be an L-value. +/ Grapheme decodeGrapheme(Input)(ref Input inp) if(isInputRange!Input && is(Unqual!(ElementType!Input) == dchar)) { return genericDecodeGrapheme!true(inp); } unittest { Grapheme gr; string s = " \u0020\u0308 "; gr = decodeGrapheme(s); assert(gr.length == 1 && gr[0] == ' '); gr = decodeGrapheme(s); assert(gr.length == 2 && equalS(gr[0..2], " \u0308")); s = "\u0300\u0308\u1100"; assert(equalS(decodeGrapheme(s)[], "\u0300\u0308")); assert(equalS(decodeGrapheme(s)[], "\u1100")); s = "\u11A8\u0308\uAC01"; assert(equalS(decodeGrapheme(s)[], "\u11A8\u0308")); assert(equalS(decodeGrapheme(s)[], "\uAC01")); } /++ $(P Iterate a string by grapheme.) $(P Useful for doing string manipulation that needs to be aware of graphemes.) See_Also: $(LREF byCodePoint) +/ auto byGrapheme(Range)(Range range) if(isInputRange!Range && is(Unqual!(ElementType!Range) == dchar)) { // TODO: Bidirectional access static struct Result { private Range _range; private Grapheme _front; bool empty() @property { return _front.length == 0; } Grapheme front() @property { return _front; } void popFront() { _front = _range.empty ? Grapheme.init : _range.decodeGrapheme(); } static if(isForwardRange!Range) { Result save() @property { return Result(_range.save, _front); } } } auto result = Result(range); result.popFront(); return result; } /// unittest { auto text = "noe\u0308l"; // noël using e + combining diaeresis assert(text.walkLength == 5); // 5 code points auto gText = text.byGrapheme; assert(gText.walkLength == 4); // 4 graphemes assert(gText.take(3).equal("noe\u0308".byGrapheme)); assert(gText.drop(3).equal("l".byGrapheme)); } // For testing non-forward-range input ranges version(unittest) private static struct InputRangeString { private string s; bool empty() @property { return s.empty; } dchar front() @property { return s.front; } void popFront() { s.popFront(); } } unittest { assert("".byGrapheme.walkLength == 0); auto reverse = "le\u0308on"; assert(reverse.walkLength == 5); auto gReverse = reverse.byGrapheme; assert(gReverse.walkLength == 4); foreach(text; TypeTuple!("noe\u0308l"c, "noe\u0308l"w, "noe\u0308l"d)) { assert(text.walkLength == 5); static assert(isForwardRange!(typeof(text))); auto gText = text.byGrapheme; static assert(isForwardRange!(typeof(gText))); assert(gText.walkLength == 4); assert(gText.array.retro.equal(gReverse)); } auto nonForwardRange = InputRangeString("noe\u0308l").byGrapheme; static assert(!isForwardRange!(typeof(nonForwardRange))); assert(nonForwardRange.walkLength == 4); } /++ $(P Lazily transform a range of $(LREF Grapheme)s to a range of code points.) $(P Useful for converting the result to a string after doing operations on graphemes.) $(P Acts as the identity function when given a range of code points.) +/ // TODO: Propagate bidirectional access auto byCodePoint(Range)(Range range) if(isInputRange!Range && is(Unqual!(ElementType!Range) == Grapheme)) { static struct Result { private Range _range; private size_t i = 0; bool empty() @property { return _range.empty; } dchar front() @property { return _range.front[i]; } void popFront() { ++i; if(i >= _range.front.length) { _range.popFront(); i = 0; } } static if(isForwardRange!Range) { Result save() @property { return Result(_range.save, i); } } } return Result(range); } /// Ditto Range byCodePoint(Range)(Range range) if(isInputRange!Range && is(Unqual!(ElementType!Range) == dchar)) { return range; } /// unittest { import std.string : text; string s = "noe\u0308l"; // noël // reverse it and convert the result to a string string reverse = s.byGrapheme .array .retro .byCodePoint .text; assert(reverse == "le\u0308on"); // lëon } unittest { assert("".byGrapheme.byCodePoint.equal("")); string text = "noe\u0308l"; static assert(is(typeof(text.byCodePoint) == string)); auto gText = InputRangeString(text).byGrapheme; static assert(!isForwardRange!(typeof(gText))); auto cpText = gText.byCodePoint; static assert(!isForwardRange!(typeof(cpText))); assert(cpText.walkLength == text.walkLength); } /++ $(P A structure designed to effectively pack $(CHARACTERS) of a $(CLUSTER). ) $(P $(D Grapheme) has value semantics so 2 copies of a $(D Grapheme) always refer to distinct objects. In most actual scenarios a $(D Grapheme) fits on the stack and avoids memory allocation overhead for all but quite long clusters. ) Example: --- import std.algorithm; string bold = "ku\u0308hn"; // note that decodeGrapheme takes parameter by ref // slicing a grapheme yields a range of dchar assert(decodeGrapheme(bold)[].equal("k")); // the next grapheme is 2 characters long auto wideOne = decodeGrapheme(bold); assert(wideOne.length == 2); assert(wideOne[].equal("u\u0308")); // the usual range manipulation is possible assert(wideOne[].filter!isMark.equal("\u0308")); --- $(P See also $(LREF decodeGrapheme), $(LREF graphemeStride). ) +/ @trusted struct Grapheme { public: this(C)(in C[] chars...) if(is(C : dchar)) { this ~= chars; } this(Input)(Input seq) if(!isDynamicArray!Input && isInputRange!Input && is(ElementType!Input : dchar)) { this ~= seq; } /// Gets a $(CODEPOINT) at the given index in this cluster. dchar opIndex(size_t index) const pure nothrow { assert(index < length); return read24(isBig ? ptr_ : small_.ptr, index); } /++ Writes a $(CODEPOINT) $(D ch) at given index in this cluster. Warning: Use of this facility may invalidate grapheme cluster, see also $(LREF Grapheme.valid). Example: --- auto g = Grapheme("A\u0302"); assert(g[0] == 'A'); assert(g.valid); g[1] = '~'; // ASCII tilda is not a combining mark assert(g[1] == '~'); assert(!g.valid); --- +/ void opIndexAssign(dchar ch, size_t index) pure nothrow { assert(index < length); write24(isBig ? ptr_ : small_.ptr, ch, index); } /++ Random-access range over Grapheme's $(CHARACTERS). Warning: Invalidates when this Grapheme leaves the scope, attempts to use it then would lead to memory corruption. +/ @system auto opSlice(size_t a, size_t b) pure nothrow { return sliceOverIndexed(a, b, &this); } /// ditto @system auto opSlice() pure nothrow { return sliceOverIndexed(0, length, &this); } /// Grapheme cluster length in $(CODEPOINTS). @property size_t length() const pure nothrow { return isBig ? len_ : slen_ & 0x7F; } /++ Append $(CHARACTER) $(D ch) to this grapheme. Warning: Use of this facility may invalidate grapheme cluster, see also $(D valid). Example: --- auto g = Grapheme("A"); assert(g.valid); g ~= '\u0301'; assert(g[].equal("A\u0301")); assert(g.valid); g ~= "B"; // not a valid grapheme cluster anymore assert(!g.valid); // still could be useful though assert(g[].equal("A\u0301B")); --- See also $(LREF Grapheme.valid) below. +/ ref opOpAssign(string op)(dchar ch) { static if(op == "~") { if(!isBig) { if(slen_ + 1 > small_cap) convertToBig();// & fallthrough to "big" branch else { write24(small_.ptr, ch, smallLength); slen_++; return this; } } assert(isBig); if(len_ + 1 > cap_) { cap_ += grow; ptr_ = cast(ubyte*)enforce(realloc(ptr_, 3*(cap_+1))); } write24(ptr_, ch, len_++); return this; } else static assert(false, "No operation "~op~" defined for Grapheme"); } /// Append all $(CHARACTERS) from the input range $(D inp) to this Grapheme. ref opOpAssign(string op, Input)(Input inp) if(isInputRange!Input && is(ElementType!Input : dchar)) { static if(op == "~") { foreach(dchar ch; inp) this ~= ch; return this; } else static assert(false, "No operation "~op~" defined for Grapheme"); } /++ True if this object contains valid extended grapheme cluster. Decoding primitives of this module always return a valid $(D Grapheme). Appending to and direct manipulation of grapheme's $(CHARACTERS) may render it no longer valid. Certain applications may chose to use Grapheme as a "small string" of any $(CODEPOINTS) and ignore this property entirely. +/ @property bool valid()() /*const*/ { auto r = this[]; genericDecodeGrapheme!false(r); return r.length == 0; } this(this) { if(isBig) {// dup it auto raw_cap = 3*(cap_+1); auto p = cast(ubyte*)enforce(malloc(raw_cap)); p[0..raw_cap] = ptr_[0..raw_cap]; ptr_ = p; } } ~this() { if(isBig) { free(ptr_); } } private: enum small_bytes = ((ubyte*).sizeof+3*size_t.sizeof-1); // "out of the blue" grow rate, needs testing // (though graphemes are typically small < 9) enum grow = 20; enum small_cap = small_bytes/3; enum small_flag = 0x80, small_mask = 0x7F; // 16 bytes in 32bits, should be enough for the majority of cases union { struct { ubyte* ptr_; size_t cap_; size_t len_; size_t padding_; } struct { ubyte[small_bytes] small_; ubyte slen_; } } void convertToBig() { size_t k = smallLength; ubyte* p = cast(ubyte*)enforce(malloc(3*(grow+1))); for(int i=0; i<k; i++) write24(p, read24(small_.ptr, i), i); // now we can overwrite small array data ptr_ = p; len_ = slen_; assert(grow > len_); cap_ = grow; setBig(); } void setBig(){ slen_ |= small_flag; } @property size_t smallLength() pure nothrow { return slen_ & small_mask; } @property ubyte isBig() const pure nothrow { return slen_ & small_flag; } } static assert(Grapheme.sizeof == size_t.sizeof*4); // verify the example unittest { import std.algorithm; string bold = "ku\u0308hn"; // note that decodeGrapheme takes parameter by ref auto first = decodeGrapheme(bold); assert(first.length == 1); assert(first[0] == 'k'); // the next grapheme is 2 characters long auto wideOne = decodeGrapheme(bold); // slicing a grapheme yields a random-access range of dchar assert(wideOne[].equalS("u\u0308")); assert(wideOne.length == 2); static assert(isRandomAccessRange!(typeof(wideOne[]))); // all of the usual range manipulation is possible assert(wideOne[].filter!isMark().equalS("\u0308")); auto g = Grapheme("A"); assert(g.valid); g ~= '\u0301'; assert(g[].equalS("A\u0301")); assert(g.valid); g ~= "B"; // not a valid grapheme cluster anymore assert(!g.valid); // still could be useful though assert(g[].equalS("A\u0301B")); } unittest { auto g = Grapheme("A\u0302"); assert(g[0] == 'A'); assert(g.valid); g[1] = '~'; // ASCII tilda is not a combining mark assert(g[1] == '~'); assert(!g.valid); } unittest { // not valid clusters (but it just a test) auto g = Grapheme('a', 'b', 'c', 'd', 'e'); assert(g[0] == 'a'); assert(g[1] == 'b'); assert(g[2] == 'c'); assert(g[3] == 'd'); assert(g[4] == 'e'); g[3] = 'Й'; assert(g[2] == 'c'); assert(g[3] == 'Й', text(g[3], " vs ", 'Й')); assert(g[4] == 'e'); assert(!g.valid); g ~= 'ц'; g ~= '~'; assert(g[0] == 'a'); assert(g[1] == 'b'); assert(g[2] == 'c'); assert(g[3] == 'Й'); assert(g[4] == 'e'); assert(g[5] == 'ц'); assert(g[6] == '~'); assert(!g.valid); Grapheme copy = g; copy[0] = 'X'; copy[1] = '-'; assert(g[0] == 'a' && copy[0] == 'X'); assert(g[1] == 'b' && copy[1] == '-'); assert(equalS(g[2..g.length], copy[2..copy.length])); copy = Grapheme("АБВГДЕЁЖЗИКЛМ"); assert(equalS(copy[0..8], "АБВГДЕЁЖ"), text(copy[0..8])); copy ~= "xyz"; assert(equalS(copy[13..15], "xy"), text(copy[13..15])); assert(!copy.valid); Grapheme h; foreach(dchar v; iota(cast(int)'A', cast(int)'Z'+1).map!"cast(dchar)a"()) h ~= v; assert(equalS(h[], iota(cast(int)'A', cast(int)'Z'+1))); } /++ $(P Does basic case-insensitive comparison of strings $(D str1) and $(D str2). This function uses simpler comparison rule thus achieving better performance then $(LREF icmp). However keep in mind the warning below.) Warning: This function only handles 1:1 $(CODEPOINT) mapping and thus is not sufficient for certain alphabets like German, Greek and few others. Example: --- assert(sicmp("Август", "авгусТ") == 0); // Greek also works as long as there is no 1:M mapping in sight assert(sicmp("ΌΎ", "όύ") == 0); // things like the following won't get matched as equal // Greek small letter iota with dialytika and tonos assert(sicmp("ΐ", "\u03B9\u0308\u0301") != 0); // while icmp has no problem with that assert(icmp("ΐ", "\u03B9\u0308\u0301") == 0); assert(icmp("ΌΎ", "όύ") == 0); --- +/ int sicmp(S1, S2)(S1 str1, S2 str2) if(isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar) && isForwardRange!S2 && is(Unqual!(ElementType!S2) == dchar)) { import std.utf : decode; alias sTable = simpleCaseTable; size_t ridx=0; foreach(dchar lhs; str1) { if(ridx == str2.length) return 1; dchar rhs = std.utf.decode(str2, ridx); int diff = lhs - rhs; if(!diff) continue; size_t idx = simpleCaseTrie[lhs]; size_t idx2 = simpleCaseTrie[rhs]; // simpleCaseTrie is packed index table if(idx != EMPTY_CASE_TRIE) { if(idx2 != EMPTY_CASE_TRIE) {// both cased chars // adjust idx --> start of bucket idx = idx - sTable[idx].n; idx2 = idx2 - sTable[idx2].n; if(idx == idx2)// one bucket, equivalent chars continue; else// not the same bucket diff = sTable[idx].ch - sTable[idx2].ch; } else diff = sTable[idx - sTable[idx].n].ch - rhs; } else if(idx2 != EMPTY_CASE_TRIE) { diff = lhs - sTable[idx2 - sTable[idx2].n].ch; } // one of chars is not cased at all return diff; } return ridx == str2.length ? 0 : -1; } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { int sicmp(const(char)[] str1, const(char)[] str2) { return sicmp!(const(char)[], const(char)[])(str1, str2); } int sicmp(const(wchar)[] str1, const(wchar)[] str2) { return sicmp!(const(wchar)[], const(wchar)[])(str1, str2); } int sicmp(const(dchar)[] str1, const(dchar)[] str2) { return sicmp!(const(dchar)[], const(dchar)[])(str1, str2); } } private int fullCasedCmp(Range)(dchar lhs, dchar rhs, ref Range rtail) @trusted pure /*TODO nothrow*/ { alias fTable = fullCaseTable; size_t idx = fullCaseTrie[lhs]; // fullCaseTrie is packed index table if(idx == EMPTY_CASE_TRIE) return lhs; size_t start = idx - fTable[idx].n; size_t end = fTable[idx].size + start; assert(fTable[start].entry_len == 1); for(idx=start; idx<end; idx++) { auto entryLen = fTable[idx].entry_len; if(entryLen == 1) { if(fTable[idx].seq[0] == rhs) { return 0; } } else {// OK it's a long chunk, like 'ss' for German dstring seq = fTable[idx].seq[0..entryLen]; if(rhs == seq[0] && rtail.skipOver(seq[1..$])) { // note that this path modifies rtail // iff we managed to get there return 0; } } } return fTable[start].seq[0]; // new remapped character for accurate diffs } /++ $(P Does case insensitive comparison of $(D str1) and $(D str2). Follows the rules of full case-folding mapping. This includes matching as equal german ß with "ss" and other 1:M $(CODEPOINT) mappings unlike $(LREF sicmp). The cost of $(D icmp) being pedantically correct is slightly worse performance. ) Example: --- assert(icmp("Rußland", "Russland") == 0); assert(icmp("ᾩ -> \u1F70\u03B9", "\u1F61\u03B9 -> ᾲ") == 0); --- +/ int icmp(S1, S2)(S1 str1, S2 str2) if(isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar) && isForwardRange!S2 && is(Unqual!(ElementType!S2) == dchar)) { for(;;) { if(str1.empty) return str2.empty ? 0 : -1; dchar lhs = str1.front; if(str2.empty) return 1; dchar rhs = str2.front; str1.popFront(); str2.popFront(); int diff = lhs - rhs; if(!diff) continue; // first try to match lhs to <rhs,right-tail> sequence int cmpLR = fullCasedCmp(lhs, rhs, str2); if(!cmpLR) continue; // then rhs to <lhs,left-tail> sequence int cmpRL = fullCasedCmp(rhs, lhs, str1); if(!cmpRL) continue; // cmpXX contain remapped codepoints // to obtain stable ordering of icmp diff = cmpLR - cmpRL; return diff; } } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { int icmp(const(char)[] str1, const(char)[] str2) { return icmp!(const(char)[], const(char)[])(str1, str2); } int icmp(const(wchar)[] str1, const(wchar)[] str2) { return icmp!(const(wchar)[], const(wchar)[])(str1, str2); } int icmp(const(dchar)[] str1, const(dchar)[] str2) { return icmp!(const(dchar)[], const(dchar)[])(str1, str2); } } unittest { assertCTFEable!( { foreach(cfunc; TypeTuple!(icmp, sicmp)) { foreach(S1; TypeTuple!(string, wstring, dstring)) foreach(S2; TypeTuple!(string, wstring, dstring)) { assert(cfunc("".to!S1(), "".to!S2()) == 0); assert(cfunc("A".to!S1(), "".to!S2()) > 0); assert(cfunc("".to!S1(), "0".to!S2()) < 0); assert(cfunc("abc".to!S1(), "abc".to!S2()) == 0); assert(cfunc("abcd".to!S1(), "abc".to!S2()) > 0); assert(cfunc("abc".to!S1(), "abcd".to!S2()) < 0); assert(cfunc("Abc".to!S1(), "aBc".to!S2()) == 0); assert(cfunc("авГуст".to!S1(), "АВгУСТ".to!S2()) == 0); // Check example: assert(cfunc("Август".to!S1(), "авгусТ".to!S2()) == 0); assert(cfunc("ΌΎ".to!S1(), "όύ".to!S2()) == 0); } // check that the order is properly agnostic to the case auto strs = [ "Apple", "ORANGE", "orAcle", "amp", "banana"]; sort!((a,b) => cfunc(a,b) < 0)(strs); assert(strs == ["amp", "Apple", "banana", "orAcle", "ORANGE"]); } assert(icmp("ßb", "ssa") > 0); // Check example: assert(icmp("Russland", "Rußland") == 0); assert(icmp("ᾩ -> \u1F70\u03B9", "\u1F61\u03B9 -> ᾲ") == 0); assert(icmp("ΐ"w, "\u03B9\u0308\u0301") == 0); assert(sicmp("ΐ", "\u03B9\u0308\u0301") != 0); //bugzilla 11057 assert( icmp("K", "L") < 0 ); }); } /++ $(P Returns the $(S_LINK Combining class, combining class) of $(D ch).) Example: --- // shorten the code alias CC = combiningClass; // combining tilda assert(CC('\u0303') == 230); // combining ring below assert(CC('\u0325') == 220); // the simple consequence is that "tilda" should be // placed after a "ring below" in a sequence --- +/ ubyte combiningClass(dchar ch) { return combiningClassTrie[ch]; } unittest { foreach(ch; 0..0x80) assert(combiningClass(ch) == 0); assert(combiningClass('\u05BD') == 22); assert(combiningClass('\u0300') == 230); assert(combiningClass('\u0317') == 220); assert(combiningClass('\u1939') == 222); } /// Unicode character decomposition type. enum UnicodeDecomposition { /// Canonical decomposition. The result is canonically equivalent sequence. Canonical, /** Compatibility decomposition. The result is compatibility equivalent sequence. Note: Compatibility decomposition is a $(B lossy) conversion, typically suitable only for fuzzy matching and internal processing. */ Compatibility }; /** Shorthand aliases for character decomposition type, passed as a template parameter to $(LREF decompose). */ enum { Canonical = UnicodeDecomposition.Canonical, Compatibility = UnicodeDecomposition.Compatibility }; /++ Try to canonically compose 2 $(CHARACTERS). Returns the composed $(CHARACTER) if they do compose and dchar.init otherwise. The assumption is that $(D first) comes before $(D second) in the original text, usually meaning that the first is a starter. Note: Hangul syllables are not covered by this function. See $(D composeJamo) below. Example: --- assert(compose('A','\u0308') == '\u00C4'); assert(compose('A', 'B') == dchar.init); assert(compose('C', '\u0301') == '\u0106'); // note that the starter is the first one // thus the following doesn't compose assert(compose('\u0308', 'A') == dchar.init); --- +/ public dchar compose(dchar first, dchar second) { import std.internal.unicode_comp; size_t packed = compositionJumpTrie[first]; if(packed == ushort.max) return dchar.init; // unpack offset and length size_t idx = packed & composeIdxMask, cnt = packed >> composeCntShift; // TODO: optimize this micro binary search (no more then 4-5 steps) auto r = compositionTable[idx..idx+cnt].map!"a.rhs"().assumeSorted(); auto target = r.lowerBound(second).length; if(target == cnt) return dchar.init; auto entry = compositionTable[idx+target]; if(entry.rhs != second) return dchar.init; return entry.composed; } /++ Returns a full $(S_LINK Canonical decomposition, Canonical) (by default) or $(S_LINK Compatibility decomposition, Compatibility) decomposition of $(CHARACTER) $(D ch). If no decomposition is available returns a $(LREF Grapheme) with the $(D ch) itself. Note: This function also decomposes hangul syllables as prescribed by the standard. See also $(LREF decomposeHangul) for a restricted version that takes into account only hangul syllables but no other decompositions. Example: --- import std.algorithm; assert(decompose('Ĉ')[].equal("C\u0302")); assert(decompose('D')[].equal("D")); assert(decompose('\uD4DC')[].equal("\u1111\u1171\u11B7")); assert(decompose!Compatibility('¹').equal("1")); --- +/ public Grapheme decompose(UnicodeDecomposition decompType=Canonical)(dchar ch) { import std.internal.unicode_decomp; static if(decompType == Canonical) { alias table = decompCanonTable; alias mapping = canonMappingTrie; } else static if(decompType == Compatibility) { alias table = decompCompatTable; alias mapping = compatMappingTrie; } ushort idx = mapping[ch]; if(!idx) // not found, check hangul arithmetic decomposition return decomposeHangul(ch); auto decomp = table[idx..$].until(0); return Grapheme(decomp); } unittest { // verify examples assert(compose('A','\u0308') == '\u00C4'); assert(compose('A', 'B') == dchar.init); assert(compose('C', '\u0301') == '\u0106'); // note that the starter is the first one // thus the following doesn't compose assert(compose('\u0308', 'A') == dchar.init); import std.algorithm; assert(decompose('Ĉ')[].equalS("C\u0302")); assert(decompose('D')[].equalS("D")); assert(decompose('\uD4DC')[].equalS("\u1111\u1171\u11B7")); assert(decompose!Compatibility('¹')[].equalS("1")); } //---------------------------------------------------------------------------- // Hangul specific composition/decomposition enum jamoSBase = 0xAC00; enum jamoLBase = 0x1100; enum jamoVBase = 0x1161; enum jamoTBase = 0x11A7; enum jamoLCount = 19, jamoVCount = 21, jamoTCount = 28; enum jamoNCount = jamoVCount * jamoTCount; enum jamoSCount = jamoLCount * jamoNCount; // Tests if $(D ch) is a Hangul leading consonant jamo. bool isJamoL(dchar ch) { // first cmp rejects ~ 1M code points above leading jamo range return ch < jamoLBase+jamoLCount && ch >= jamoLBase; } // Tests if $(D ch) is a Hangul vowel jamo. bool isJamoT(dchar ch) { // first cmp rejects ~ 1M code points above trailing jamo range // Note: ch == jamoTBase doesn't indicate trailing jamo (TIndex must be > 0) return ch < jamoTBase+jamoTCount && ch > jamoTBase; } // Tests if $(D ch) is a Hangul trailnig consonant jamo. bool isJamoV(dchar ch) { // first cmp rejects ~ 1M code points above vowel range return ch < jamoVBase+jamoVCount && ch >= jamoVBase; } int hangulSyllableIndex(dchar ch) { int idxS = cast(int)ch - jamoSBase; return idxS >= 0 && idxS < jamoSCount ? idxS : -1; } // internal helper: compose hangul syllables leaving dchar.init in holes void hangulRecompose(dchar[] seq) { for(size_t idx = 0; idx + 1 < seq.length; ) { if(isJamoL(seq[idx]) && isJamoV(seq[idx+1])) { int indexL = seq[idx] - jamoLBase; int indexV = seq[idx+1] - jamoVBase; int indexLV = indexL * jamoNCount + indexV * jamoTCount; if(idx + 2 < seq.length && isJamoT(seq[idx+2])) { seq[idx] = jamoSBase + indexLV + seq[idx+2] - jamoTBase; seq[idx+1] = dchar.init; seq[idx+2] = dchar.init; idx += 3; } else { seq[idx] = jamoSBase + indexLV; seq[idx+1] = dchar.init; idx += 2; } } else idx++; } } //---------------------------------------------------------------------------- public: /** Decomposes a Hangul syllable. If $(D ch) is not a composed syllable then this function returns $(LREF Grapheme) containing only $(D ch) as is. Example: --- import std.algorithm; assert(decomposeHangul('\uD4DB')[].equal("\u1111\u1171\u11B6")); --- */ Grapheme decomposeHangul(dchar ch) { int idxS = cast(int)ch - jamoSBase; if(idxS < 0 || idxS >= jamoSCount) return Grapheme(ch); int idxL = idxS / jamoNCount; int idxV = (idxS % jamoNCount) / jamoTCount; int idxT = idxS % jamoTCount; int partL = jamoLBase + idxL; int partV = jamoVBase + idxV; if(idxT > 0) // there is a trailling consonant (T); <L,V,T> decomposition return Grapheme(partL, partV, jamoTBase + idxT); else // <L, V> decomposition return Grapheme(partL, partV); } /++ Try to compose hangul syllable out of a leading consonant ($(D lead)), a $(D vowel) and optional $(D trailing) consonant jamos. On success returns the composed LV or LVT hangul syllable. If any of $(D lead) and $(D vowel) are not a valid hangul jamo of the respective $(CHARACTER) class returns dchar.init. Example: --- assert(composeJamo('\u1111', '\u1171', '\u11B6') == '\uD4DB'); // leaving out T-vowel, or passing any codepoint // that is not trailing consonant composes an LV-syllable assert(composeJamo('\u1111', '\u1171') == '\uD4CC'); assert(composeJamo('\u1111', '\u1171', ' ') == '\uD4CC'); assert(composeJamo('\u1111', 'A') == dchar.init); assert(composeJamo('A', '\u1171') == dchar.init); --- +/ dchar composeJamo(dchar lead, dchar vowel, dchar trailing=dchar.init) { if(!isJamoL(lead)) return dchar.init; int indexL = lead - jamoLBase; if(!isJamoV(vowel)) return dchar.init; int indexV = vowel - jamoVBase; int indexLV = indexL * jamoNCount + indexV * jamoTCount; dchar syllable = jamoSBase + indexLV; return isJamoT(trailing) ? syllable + (trailing - jamoTBase) : syllable; } unittest { static void testDecomp(UnicodeDecomposition T)(dchar ch, string r) { Grapheme g = decompose!T(ch); assert(equalS(g[], r), text(g[], " vs ", r)); } testDecomp!Canonical('\u1FF4', "\u03C9\u0301\u0345"); testDecomp!Canonical('\uF907', "\u9F9C"); testDecomp!Compatibility('\u33FF', "\u0067\u0061\u006C"); testDecomp!Compatibility('\uA7F9', "\u0153"); // check examples assert(decomposeHangul('\uD4DB')[].equalS("\u1111\u1171\u11B6")); assert(composeJamo('\u1111', '\u1171', '\u11B6') == '\uD4DB'); assert(composeJamo('\u1111', '\u1171') == '\uD4CC'); // leave out T-vowel assert(composeJamo('\u1111', '\u1171', ' ') == '\uD4CC'); assert(composeJamo('\u1111', 'A') == dchar.init); assert(composeJamo('A', '\u1171') == dchar.init); } /** Enumeration type for normalization forms, passed as template parameter for functions like $(LREF normalize). */ enum NormalizationForm { NFC, NFD, NFKC, NFKD } enum { /** Shorthand aliases from values indicating normalization forms. */ NFC = NormalizationForm.NFC, ///ditto NFD = NormalizationForm.NFD, ///ditto NFKC = NormalizationForm.NFKC, ///ditto NFKD = NormalizationForm.NFKD }; /++ Returns $(D input) string normalized to the chosen form. Form C is used by default. For more information on normalization forms see the $(S_LINK Normalization, normalization section). Note: In cases where the string in question is already normalized, it is returned unmodified and no memory allocation happens. Example: --- // any encoding works wstring greet = "Hello world"; assert(normalize(greet) is greet); // the same exact slice // An example of a character with all 4 forms being different: // Greek upsilon with acute and hook symbol (code point 0x03D3) assert(normalize!NFC("ϓ") == "\u03D3"); assert(normalize!NFD("ϓ") == "\u03D2\u0301"); assert(normalize!NFKC("ϓ") == "\u038E"); assert(normalize!NFKD("ϓ") == "\u03A5\u0301"); --- +/ inout(C)[] normalize(NormalizationForm norm=NFC, C)(inout(C)[] input) { auto anchors = splitNormalized!norm(input); if(anchors[0] == input.length && anchors[1] == input.length) return input; dchar[] decomposed; decomposed.reserve(31); ubyte[] ccc; ccc.reserve(31); auto app = appender!(C[])(); do { app.put(input[0..anchors[0]]); foreach(dchar ch; input[anchors[0]..anchors[1]]) static if(norm == NFD || norm == NFC) { foreach(dchar c; decompose!Canonical(ch)[]) decomposed ~= c; } else // NFKD & NFKC { foreach(dchar c; decompose!Compatibility(ch)[]) decomposed ~= c; } ccc.length = decomposed.length; size_t firstNonStable = 0; ubyte lastClazz = 0; foreach(idx, dchar ch; decomposed) { auto clazz = combiningClass(ch); ccc[idx] = clazz; if(clazz == 0 && lastClazz != 0) { // found a stable code point after unstable ones sort!("a[0] < b[0]", SwapStrategy.stable) (zip(ccc[firstNonStable..idx], decomposed[firstNonStable..idx])); firstNonStable = decomposed.length; } else if(clazz != 0 && lastClazz == 0) { // found first unstable code point after stable ones firstNonStable = idx; } lastClazz = clazz; } sort!("a[0] < b[0]", SwapStrategy.stable) (zip(ccc[firstNonStable..$], decomposed[firstNonStable..$])); static if(norm == NFC || norm == NFKC) { size_t idx = 0; auto first = countUntil(ccc, 0); if(first >= 0) // no starters?? no recomposition { for(;;) { auto second = recompose(first, decomposed, ccc); if(second == decomposed.length) break; first = second; } // 2nd pass for hangul syllables hangulRecompose(decomposed); } } static if(norm == NFD || norm == NFKD) app.put(decomposed); else { auto clean = remove!("a == dchar.init", SwapStrategy.stable)(decomposed); app.put(decomposed[0 .. clean.length]); } // reset variables decomposed.length = 0; decomposed.assumeSafeAppend(); ccc.length = 0; ccc.assumeSafeAppend(); input = input[anchors[1]..$]; // and move on anchors = splitNormalized!norm(input); }while(anchors[0] != input.length); app.put(input[0..anchors[0]]); return cast(inout(C)[])app.data; } unittest { assert(normalize!NFD("abc\uF904def") == "abc\u6ED1def", text(normalize!NFD("abc\uF904def"))); assert(normalize!NFKD("2¹⁰") == "210", normalize!NFKD("2¹⁰")); assert(normalize!NFD("Äffin") == "A\u0308ffin"); // check example // any encoding works wstring greet = "Hello world"; assert(normalize(greet) is greet); // the same exact slice // An example of a character with all 4 forms being different: // Greek upsilon with acute and hook symbol (code point 0x03D3) assert(normalize!NFC("ϓ") == "\u03D3"); assert(normalize!NFD("ϓ") == "\u03D2\u0301"); assert(normalize!NFKC("ϓ") == "\u038E"); assert(normalize!NFKD("ϓ") == "\u03A5\u0301"); } // canonically recompose given slice of code points, works in-place and mutates data private size_t recompose(size_t start, dchar[] input, ubyte[] ccc) { assert(input.length == ccc.length); int accumCC = -1;// so that it's out of 0..255 range bool foundSolidStarter = false; // writefln("recomposing %( %04x %)", input); // first one is always a starter thus we start at i == 1 size_t i = start+1; for(; ; ) { if(i == input.length) break; int curCC = ccc[i]; // In any character sequence beginning with a starter S // a character C is blocked from S if and only if there // is some character B between S and C, and either B // is a starter or it has the same or higher combining class as C. //------------------------ // Applying to our case: // S is input[0] // accumCC is the maximum CCC of characters between C and S, // as ccc are sorted // C is input[i] if(curCC > accumCC) { dchar comp = compose(input[start], input[i]); if(comp != dchar.init) { input[start] = comp; input[i] = dchar.init;// put a sentinel // current was merged so its CCC shouldn't affect // composing with the next one } else { // if it was a starter then accumCC is now 0, end of loop accumCC = curCC; if(accumCC == 0) break; } } else{ // ditto here accumCC = curCC; if(accumCC == 0) break; } i++; } return i; } // returns tuple of 2 indexes that delimit: // normalized text, piece that needs normalization and // the rest of input starting with stable code point private auto splitNormalized(NormalizationForm norm, C)(const(C)[] input) { auto result = input; ubyte lastCC = 0; foreach(idx, dchar ch; input) { static if(norm == NFC) if(ch < 0x0300) { lastCC = 0; continue; } ubyte CC = combiningClass(ch); if(lastCC > CC && CC != 0) { return seekStable!norm(idx, input); } if(notAllowedIn!norm(ch)) { return seekStable!norm(idx, input); } lastCC = CC; } return tuple(input.length, input.length); } private auto seekStable(NormalizationForm norm, C)(size_t idx, in C[] input) { import std.utf : codeLength; auto br = input[0..idx]; size_t region_start = 0;// default for(;;) { if(br.empty)// start is 0 break; dchar ch = br.back; if(combiningClass(ch) == 0 && allowedIn!norm(ch)) { region_start = br.length - std.utf.codeLength!C(ch); break; } br.popFront(); } ///@@@BUG@@@ can't use find: " find is a nested function and can't be used..." size_t region_end=input.length;// end is $ by default foreach(i, dchar ch; input[idx..$]) { if(combiningClass(ch) == 0 && allowedIn!norm(ch)) { region_end = i+idx; break; } } // writeln("Region to normalize: ", input[region_start..region_end]); return tuple(region_start, region_end); } /** Tests if dchar $(D ch) is always allowed (Quick_Check=YES) in normalization form $(D norm). --- // e.g. Cyrillic is always allowed, so is ASCII assert(allowedIn!NFC('я')); assert(allowedIn!NFD('я')); assert(allowedIn!NFKC('я')); assert(allowedIn!NFKD('я')); assert(allowedIn!NFC('Z')); --- */ public bool allowedIn(NormalizationForm norm)(dchar ch) { return !notAllowedIn!norm(ch); } // not user friendly name but more direct private bool notAllowedIn(NormalizationForm norm)(dchar ch) { static if(norm == NFC) alias qcTrie = nfcQCTrie; else static if(norm == NFD) alias qcTrie = nfdQCTrie; else static if(norm == NFKC) alias qcTrie = nfkcQCTrie; else static if(norm == NFKD) alias qcTrie = nfkdQCTrie; else static assert("Unknown normalization form "~norm); return qcTrie[ch]; } unittest { assert(allowedIn!NFC('я')); assert(allowedIn!NFD('я')); assert(allowedIn!NFKC('я')); assert(allowedIn!NFKD('я')); assert(allowedIn!NFC('Z')); } } version(std_uni_bootstrap) { // old version used for bootstrapping of gen_uni.d that generates // up to date optimal versions of all of isXXX functions @safe pure nothrow public bool isWhite(dchar c) { return std.ascii.isWhite(c) || c == lineSep || c == paraSep || c == '\u0085' || c == '\u00A0' || c == '\u1680' || c == '\u180E' || (c >= '\u2000' && c <= '\u200A') || c == '\u202F' || c == '\u205F' || c == '\u3000'; } } else { // trusted -> avoid bounds check @trusted pure nothrow ushort toLowerIndex(dchar c) { alias trie = toLowerIndexTrie; return trie[c]; } // trusted -> avoid bounds check @trusted pure nothrow dchar toLowerTab(size_t idx) { return toLowerTable[idx]; } // trusted -> avoid bounds check @trusted pure nothrow ushort toTitleIndex(dchar c) { alias trie = toTitleIndexTrie; return trie[c]; } // trusted -> avoid bounds check @trusted pure nothrow dchar toTitleTab(size_t idx) { return toTitleTable[idx]; } // trusted -> avoid bounds check @trusted pure nothrow ushort toUpperIndex(dchar c) { alias trie = toUpperIndexTrie; return trie[c]; } // trusted -> avoid bounds check @trusted pure nothrow dchar toUpperTab(size_t idx) { return toUpperTable[idx]; } public: /++ Whether or not $(D c) is a Unicode whitespace $(CHARACTER). (general Unicode category: Part of C0(tab, vertical tab, form feed, carriage return, and linefeed characters), Zs, Zl, Zp, and NEL(U+0085)) +/ @safe pure nothrow public bool isWhite(dchar c) { return isWhiteGen(c); // call pregenerated binary search } /++ Return whether $(D c) is a Unicode lowercase $(CHARACTER). +/ @safe pure nothrow bool isLower(dchar c) { if(std.ascii.isASCII(c)) return std.ascii.isLower(c); return lowerCaseTrie[c]; } @safe unittest { foreach(v; 0..0x80) assert(std.ascii.isLower(v) == isLower(v)); assert(isLower('я')); assert(isLower('й')); assert(!isLower('Ж')); // Greek HETA assert(!isLower('\u0370')); assert(isLower('\u0371')); assert(!isLower('\u039C')); // capital MU assert(isLower('\u03B2')); // beta // from extended Greek assert(!isLower('\u1F18')); assert(isLower('\u1F00')); foreach(v; unicode.lowerCase.byCodepoint) assert(isLower(v) && !isUpper(v)); } /++ Return whether $(D c) is a Unicode uppercase $(CHARACTER). +/ @safe pure nothrow bool isUpper(dchar c) { if(std.ascii.isASCII(c)) return std.ascii.isUpper(c); return upperCaseTrie[c]; } @safe unittest { foreach(v; 0..0x80) assert(std.ascii.isLower(v) == isLower(v)); assert(!isUpper('й')); assert(isUpper('Ж')); // Greek HETA assert(isUpper('\u0370')); assert(!isUpper('\u0371')); assert(isUpper('\u039C')); // capital MU assert(!isUpper('\u03B2')); // beta // from extended Greek assert(!isUpper('\u1F00')); assert(isUpper('\u1F18')); foreach(v; unicode.upperCase.byCodepoint) assert(isUpper(v) && !isLower(v)); } /++ If $(D c) is a Unicode uppercase $(CHARACTER), then its lowercase equivalent is returned. Otherwise $(D c) is returned. Warning: certain alphabets like German and Greek have no 1:1 upper-lower mapping. Use overload of toLower which takes full string instead. +/ @safe pure nothrow dchar toLower(dchar c) { // optimize ASCII case if(c < 0xAA) { if(c < 'A') return c; if(c <= 'Z') return c + 32; return c; } size_t idx = toLowerIndex(c); if(idx < MAX_SIMPLE_LOWER) { return toLowerTab(idx); } return c; } //TODO: Hidden for now, needs better API. //Other transforms could use better API as well, but this one is a new primitive. @safe pure nothrow private dchar toTitlecase(dchar c) { // optimize ASCII case if(c < 0xAA) { if(c < 'a') return c; if(c <= 'z') return c - 32; return c; } size_t idx = toTitleIndex(c); if(idx < MAX_SIMPLE_TITLE) { return toTitleTab(idx); } return c; } private alias UpperTriple = TypeTuple!(toUpperIndex, MAX_SIMPLE_UPPER, toUpperTab); private alias LowerTriple = TypeTuple!(toLowerIndex, MAX_SIMPLE_LOWER, toLowerTab); // generic toUpper/toLower on whole string, creates new or returns as is private S toCase(alias indexFn, uint maxIdx, alias tableFn, S)(S s) @trusted pure if(isSomeString!S) { foreach(i, dchar cOuter; s) { ushort idx = indexFn(cOuter); if(idx == ushort.max) continue; auto result = appender!S(s[0..i]); result.reserve(s.length); foreach(dchar c; s[i .. $]) { idx = indexFn(c); if(idx == ushort.max) result.put(c); else if(idx < maxIdx) { c = tableFn(idx); result.put(c); } else { auto val = tableFn(idx); // unpack length + codepoint uint len = val>>24; result.put(cast(dchar)(val & 0xFF_FFFF)); foreach(j; idx+1..idx+len) result.put(tableFn(j)); } } return result.data; } return s; } // TODO: helper, I wish std.utf was more flexible (and stright) private size_t encodeTo(char[] buf, size_t idx, dchar c) @trusted pure { if (c <= 0x7F) { buf[idx] = cast(char)c; idx++; } else if (c <= 0x7FF) { buf[idx] = cast(char)(0xC0 | (c >> 6)); buf[idx+1] = cast(char)(0x80 | (c & 0x3F)); idx += 2; } else if (c <= 0xFFFF) { buf[idx] = cast(char)(0xE0 | (c >> 12)); buf[idx+1] = cast(char)(0x80 | ((c >> 6) & 0x3F)); buf[idx+2] = cast(char)(0x80 | (c & 0x3F)); idx += 3; } else if (c <= 0x10FFFF) { buf[idx] = cast(char)(0xF0 | (c >> 18)); buf[idx+1] = cast(char)(0x80 | ((c >> 12) & 0x3F)); buf[idx+2] = cast(char)(0x80 | ((c >> 6) & 0x3F)); buf[idx+3] = cast(char)(0x80 | (c & 0x3F)); idx += 4; } else assert(0); return idx; } unittest { char[] s = "abcd".dup; size_t i = 0; i = encodeTo(s, i, 'X'); assert(s == "Xbcd"); i = encodeTo(s, i, cast(dchar)'\u00A9'); assert(s == "X\xC2\xA9d"); } // TODO: helper, I wish std.utf was more flexible (and stright) private size_t encodeTo(wchar[] buf, size_t idx, dchar c) @trusted pure { import std.utf; if (c <= 0xFFFF) { if (0xD800 <= c && c <= 0xDFFF) throw (new UTFException("Encoding an isolated surrogate code point in UTF-16")).setSequence(c); buf[idx] = cast(wchar)c; idx++; } else if (c <= 0x10FFFF) { buf[idx] = cast(wchar)((((c - 0x10000) >> 10) & 0x3FF) + 0xD800); buf[idx+1] = cast(wchar)(((c - 0x10000) & 0x3FF) + 0xDC00); idx += 2; } else assert(0); return idx; } private size_t encodeTo(dchar[] buf, size_t idx, dchar c) @trusted pure { buf[idx] = c; idx++; return idx; } private void toCaseInPlace(alias indexFn, uint maxIdx, alias tableFn, C)(ref C[] s) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { import std.utf; size_t curIdx = 0; size_t destIdx = 0; alias slowToCase = toCaseInPlaceAlloc!(indexFn, maxIdx, tableFn); size_t lastUnchanged = 0; // in-buffer move of bytes to a new start index // the trick is that it may not need to copy at all static size_t moveTo(C[] str, size_t dest, size_t from, size_t to) { // Interestingly we may just bump pointer for a while // then have to copy if a re-cased char was smaller the original // later we may regain pace with char that got bigger // In the end it sometimes flip-flops between the 2 cases below if(dest == from) return to; // got to copy foreach(C c; str[from..to]) str[dest++] = c; return dest; } while(curIdx != s.length) { size_t startIdx = curIdx; dchar ch = decode(s, curIdx); // TODO: special case for ASCII auto caseIndex = indexFn(ch); if(caseIndex == ushort.max) // unchanged, skip over { continue; } else if(caseIndex < maxIdx) // 1:1 codepoint mapping { // previous cased chars had the same length as uncased ones // thus can just adjust pointer destIdx = moveTo(s, destIdx, lastUnchanged, startIdx); lastUnchanged = curIdx; dchar cased = tableFn(caseIndex); auto casedLen = codeLength!C(cased); if(casedLen + destIdx > curIdx) // no place to fit cased char { // switch to slow codepath, where we allocate return slowToCase(s, startIdx, destIdx); } else { destIdx = encodeTo(s, destIdx, cased); } } else // 1:m codepoint mapping, slow codepath { destIdx = moveTo(s, destIdx, lastUnchanged, startIdx); lastUnchanged = curIdx; return slowToCase(s, startIdx, destIdx); } assert(destIdx <= curIdx); } if(lastUnchanged != s.length) { destIdx = moveTo(s, destIdx, lastUnchanged, s.length); } s = s[0..destIdx]; } // helper to precalculate size of case-converted string private template toCaseLength(alias indexFn, uint maxIdx, alias tableFn) { size_t toCaseLength(C)(in C[] str) { import std.utf; size_t codeLen = 0; size_t lastNonTrivial = 0; size_t curIdx = 0; while(curIdx != str.length) { size_t startIdx = curIdx; dchar ch = decode(str, curIdx); ushort caseIndex = indexFn(ch); if(caseIndex == ushort.max) continue; else if(caseIndex < maxIdx) { codeLen += startIdx - lastNonTrivial; lastNonTrivial = curIdx; dchar cased = tableFn(caseIndex); codeLen += codeLength!C(cased); } else { codeLen += startIdx - lastNonTrivial; lastNonTrivial = curIdx; auto val = tableFn(caseIndex); auto len = val>>24; dchar cased = val & 0xFF_FFFF; codeLen += codeLength!C(cased); foreach(j; caseIndex+1..caseIndex+len) codeLen += codeLength!C(tableFn(j)); } } if(lastNonTrivial != str.length) codeLen += str.length - lastNonTrivial; return codeLen; } } unittest { import std.conv; alias toLowerLength = toCaseLength!(LowerTriple); assert(toLowerLength("abcd") == 4); assert(toLowerLength("аБВгд456") == 10+3); } // slower code path that preallocates and then copies // case-converted stuf to the new string private template toCaseInPlaceAlloc(alias indexFn, uint maxIdx, alias tableFn) { void toCaseInPlaceAlloc(C)(ref C[] s, size_t curIdx, size_t destIdx) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { import std.utf : decode; alias caseLength = toCaseLength!(indexFn, maxIdx, tableFn); auto trueLength = destIdx + caseLength(s[curIdx..$]); C[] ns = new C[trueLength]; ns[0..destIdx] = s[0..destIdx]; size_t lastUnchanged = curIdx; while(curIdx != s.length) { size_t startIdx = curIdx; // start of current codepoint dchar ch = decode(s, curIdx); auto caseIndex = indexFn(ch); if(caseIndex == ushort.max) // skip over { continue; } else if(caseIndex < maxIdx) // 1:1 codepoint mapping { dchar cased = tableFn(caseIndex); auto toCopy = startIdx - lastUnchanged; ns[destIdx .. destIdx+toCopy] = s[lastUnchanged .. startIdx]; lastUnchanged = curIdx; destIdx += toCopy; destIdx = encodeTo(ns, destIdx, cased); } else // 1:m codepoint mapping, slow codepath { auto toCopy = startIdx - lastUnchanged; ns[destIdx .. destIdx+toCopy] = s[lastUnchanged .. startIdx]; lastUnchanged = curIdx; destIdx += toCopy; auto val = tableFn(caseIndex); // unpack length + codepoint uint len = val>>24; destIdx = encodeTo(ns, destIdx, cast(dchar)(val & 0xFF_FFFF)); foreach(j; caseIndex+1..caseIndex+len) destIdx = encodeTo(ns, destIdx, tableFn(j)); } } if(lastUnchanged != s.length) { auto toCopy = s.length - lastUnchanged; ns[destIdx..destIdx+toCopy] = s[lastUnchanged..$]; destIdx += toCopy; } assert(ns.length == destIdx); s = ns; } } /++ Converts $(D s) to lowercase (by performing Unicode lowercase mapping) in place. For a few characters string length may increase after the transformation, in such a case the function reallocates exactly once. If $(D s) does not have any uppercase characters, then $(D s) is unaltered. +/ void toLowerInPlace(C)(ref C[] s) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { toCaseInPlace!(LowerTriple)(s); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { void toLowerInPlace(ref char[] s) { toLowerInPlace!char(s); } void toLowerInPlace(ref wchar[] s) { toLowerInPlace!wchar(s); } void toLowerInPlace(ref dchar[] s) { toLowerInPlace!dchar(s); } } /++ Converts $(D s) to uppercase (by performing Unicode uppercase mapping) in place. For a few characters string length may increase after the transformation, in such a case the function reallocates exactly once. If $(D s) does not have any lowercase characters, then $(D s) is unaltered. +/ void toUpperInPlace(C)(ref C[] s) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { toCaseInPlace!(UpperTriple)(s); } // overloads for the most common cases to reduce compile time/code size @safe pure /*TODO nothrow*/ { void toUpperInPlace(ref char[] s) { toUpperInPlace!char(s); } void toUpperInPlace(ref wchar[] s) { toUpperInPlace!wchar(s); } void toUpperInPlace(ref dchar[] s) { toUpperInPlace!dchar(s); } } /++ Returns a string which is identical to $(D s) except that all of its characters are converted to lowercase (by preforming Unicode lowercase mapping). If none of $(D s) characters were affected, then $(D s) itself is returned. +/ S toLower(S)(S s) @trusted pure if(isSomeString!S) { return toCase!(LowerTriple)(s); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { string toLower(string s) { return toLower!string(s); } wstring toLower(wstring s) { return toLower!wstring(s); } dstring toLower(dstring s) { return toLower!dstring(s); } } @trusted unittest //@@@BUG std.format is not @safe { import std.string : format; foreach(ch; 0..0x80) assert(std.ascii.toLower(ch) == toLower(ch)); assert(toLower('Я') == 'я'); assert(toLower('Δ') == 'δ'); foreach(ch; unicode.upperCase.byCodepoint) { dchar low = ch.toLower(); assert(low == ch || isLower(low), format("%s -> %s", ch, low)); } assert(toLower("АЯ") == "ая"); assert("\u1E9E".toLower == "\u00df"); assert("\u00df".toUpper == "SS"); } //bugzilla 9629 unittest { wchar[] test = "hello þ world"w.dup; auto piece = test[6..7]; toUpperInPlace(piece); assert(test == "hello Þ world"); } unittest { string s1 = "FoL"; string s2 = toLower(s1); assert(cmp(s2, "fol") == 0, s2); assert(s2 != s1); char[] s3 = s1.dup; toLowerInPlace(s3); assert(s3 == s2); s1 = "A\u0100B\u0101d"; s2 = toLower(s1); s3 = s1.dup; assert(cmp(s2, "a\u0101b\u0101d") == 0); assert(s2 !is s1); toLowerInPlace(s3); assert(s3 == s2); s1 = "A\u0460B\u0461d"; s2 = toLower(s1); s3 = s1.dup; assert(cmp(s2, "a\u0461b\u0461d") == 0); assert(s2 !is s1); toLowerInPlace(s3); assert(s3 == s2); s1 = "\u0130"; s2 = toLower(s1); s3 = s1.dup; assert(s2 == "i\u0307"); assert(s2 !is s1); toLowerInPlace(s3); assert(s3 == s2); // Test on wchar and dchar strings. assert(toLower("Some String"w) == "some string"w); assert(toLower("Some String"d) == "some string"d); } /++ If $(D c) is a Unicode lowercase $(CHARACTER), then its uppercase equivalent is returned. Otherwise $(D c) is returned. Warning: Certain alphabets like German and Greek have no 1:1 upper-lower mapping. Use overload of toUpper which takes full string instead. +/ @safe pure nothrow dchar toUpper(dchar c) { // optimize ASCII case if(c < 0xAA) { if(c < 'a') return c; if(c <= 'z') return c - 32; return c; } size_t idx = toUpperIndex(c); if(idx < MAX_SIMPLE_UPPER) { return toUpperTab(idx); } return c; } @trusted unittest { import std.string : format; foreach(ch; 0..0x80) assert(std.ascii.toUpper(ch) == toUpper(ch)); assert(toUpper('я') == 'Я'); assert(toUpper('δ') == 'Δ'); foreach(ch; unicode.lowerCase.byCodepoint) { dchar up = ch.toUpper(); assert(up == ch || isUpper(up), format("%s -> %s", ch, up)); } } /++ Returns a string which is identical to $(D s) except that all of its characters are converted to uppercase (by preforming Unicode uppercase mapping). If none of $(D s) characters were affected, then $(D s) itself is returned. +/ S toUpper(S)(S s) @trusted pure if(isSomeString!S) { return toCase!(UpperTriple)(s); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { string toUpper(string s) { return toUpper!string(s); } wstring toUpper(wstring s) { return toUpper!wstring(s); } dstring toUpper(dstring s) { return toUpper!dstring(s); } } unittest { string s1 = "FoL"; string s2; char[] s3; s2 = toUpper(s1); s3 = s1.dup; toUpperInPlace(s3); assert(s3 == s2, s3); assert(cmp(s2, "FOL") == 0); assert(s2 !is s1); s1 = "a\u0100B\u0101d"; s2 = toUpper(s1); s3 = s1.dup; toUpperInPlace(s3); assert(s3 == s2); assert(cmp(s2, "A\u0100B\u0100D") == 0); assert(s2 !is s1); s1 = "a\u0460B\u0461d"; s2 = toUpper(s1); s3 = s1.dup; toUpperInPlace(s3); assert(s3 == s2); assert(cmp(s2, "A\u0460B\u0460D") == 0); assert(s2 !is s1); } unittest { static void doTest(C)(const(C)[] s, const(C)[] trueUp, const(C)[] trueLow) { import std.string : format; string diff = "src: %( %x %)\nres: %( %x %)\ntru: %( %x %)"; auto low = s.toLower() , up = s.toUpper(); auto lowInp = s.dup, upInp = s.dup; lowInp.toLowerInPlace(); upInp.toUpperInPlace(); assert(low == trueLow, format(diff, low, trueLow)); assert(up == trueUp, format(diff, up, trueUp)); assert(lowInp == trueLow, format(diff, cast(ubyte[])s, cast(ubyte[])lowInp, cast(ubyte[])trueLow)); assert(upInp == trueUp, format(diff, cast(ubyte[])s, cast(ubyte[])upInp, cast(ubyte[])trueUp)); } foreach(S; TypeTuple!(dstring, wstring, string)) { S easy = "123"; S good = "abCФеж"; S awful = "\u0131\u023f\u2126"; S wicked = "\u0130\u1FE2"; auto options = [easy, good, awful, wicked]; S[] lower = ["123", "abcфеж", "\u0131\u023f\u03c9", "i\u0307\u1Fe2"]; S[] upper = ["123", "ABCФЕЖ", "I\u2c7e\u2126", "\u0130\u03A5\u0308\u0300"]; foreach(val; TypeTuple!(easy, good)) { auto e = val.dup; auto g = e; e.toUpperInPlace(); assert(e is g); e.toLowerInPlace(); assert(e is g); } foreach(i, v; options) { doTest(v, upper[i], lower[i]); } // a few combinatorial runs foreach(i; 0..options.length) foreach(j; i..options.length) foreach(k; j..options.length) { auto sample = options[i] ~ options[j] ~ options[k]; auto sample2 = options[k] ~ options[j] ~ options[i]; doTest(sample, upper[i] ~ upper[j] ~ upper[k], lower[i] ~ lower[j] ~ lower[k]); doTest(sample2, upper[k] ~ upper[j] ~ upper[i], lower[k] ~ lower[j] ~ lower[i]); } } } /++ Returns whether $(D c) is a Unicode alphabetic $(CHARACTER) (general Unicode category: Alphabetic). +/ @safe pure nothrow bool isAlpha(dchar c) { // optimization if(c < 0xAA) { size_t x = c - 'A'; if(x <= 'Z' - 'A') return true; else { x = c - 'a'; if(x <= 'z'-'a') return true; } return false; } return alphaTrie[c]; } @safe unittest { auto alpha = unicode("Alphabetic"); foreach(ch; alpha.byCodepoint) assert(isAlpha(ch)); foreach(ch; 0..0x4000) assert((ch in alpha) == isAlpha(ch)); } /++ Returns whether $(D c) is a Unicode mark (general Unicode category: Mn, Me, Mc). +/ @safe pure nothrow bool isMark(dchar c) { return markTrie[c]; } @safe unittest { auto mark = unicode("Mark"); foreach(ch; mark.byCodepoint) assert(isMark(ch)); foreach(ch; 0..0x4000) assert((ch in mark) == isMark(ch)); } /++ Returns whether $(D c) is a Unicode numerical $(CHARACTER) (general Unicode category: Nd, Nl, No). +/ @safe pure nothrow bool isNumber(dchar c) { return numberTrie[c]; } @safe unittest { auto n = unicode("N"); foreach(ch; n.byCodepoint) assert(isNumber(ch)); foreach(ch; 0..0x4000) assert((ch in n) == isNumber(ch)); } /++ Returns whether $(D c) is a Unicode punctuation $(CHARACTER) (general Unicode category: Pd, Ps, Pe, Pc, Po, Pi, Pf). +/ @safe pure nothrow bool isPunctuation(dchar c) { return punctuationTrie[c]; } unittest { assert(isPunctuation('\u0021')); assert(isPunctuation('\u0028')); assert(isPunctuation('\u0029')); assert(isPunctuation('\u002D')); assert(isPunctuation('\u005F')); assert(isPunctuation('\u00AB')); assert(isPunctuation('\u00BB')); foreach(ch; unicode("P").byCodepoint) assert(isPunctuation(ch)); } /++ Returns whether $(D c) is a Unicode symbol $(CHARACTER) (general Unicode category: Sm, Sc, Sk, So). +/ @safe pure nothrow bool isSymbol(dchar c) { return symbolTrie[c]; } unittest { import std.string; assert(isSymbol('\u0024')); assert(isSymbol('\u002B')); assert(isSymbol('\u005E')); assert(isSymbol('\u00A6')); foreach(ch; unicode("S").byCodepoint) assert(isSymbol(ch), format("%04x", ch)); } /++ Returns whether $(D c) is a Unicode space $(CHARACTER) (general Unicode category: Zs) Note: This doesn't include '\n', '\r', \t' and other non-space $(CHARACTER). For commonly used less strict semantics see $(LREF isWhite). +/ @safe pure nothrow bool isSpace(dchar c) { return isSpaceGen(c); } unittest { assert(isSpace('\u0020')); auto space = unicode.Zs; foreach(ch; space.byCodepoint) assert(isSpace(ch)); foreach(ch; 0..0x1000) assert(isSpace(ch) == space[ch]); } /++ Returns whether $(D c) is a Unicode graphical $(CHARACTER) (general Unicode category: L, M, N, P, S, Zs). +/ @safe pure nothrow bool isGraphical(dchar c) { return graphicalTrie[c]; } unittest { auto set = unicode("Graphical"); import std.string; foreach(ch; set.byCodepoint) assert(isGraphical(ch), format("%4x", ch)); foreach(ch; 0..0x4000) assert((ch in set) == isGraphical(ch)); } /++ Returns whether $(D c) is a Unicode control $(CHARACTER) (general Unicode category: Cc). +/ @safe pure nothrow bool isControl(dchar c) { return isControlGen(c); } unittest { assert(isControl('\u0000')); assert(isControl('\u0081')); assert(!isControl('\u0100')); auto cc = unicode.Cc; foreach(ch; cc.byCodepoint) assert(isControl(ch)); foreach(ch; 0..0x1000) assert(isControl(ch) == cc[ch]); } /++ Returns whether $(D c) is a Unicode formatting $(CHARACTER) (general Unicode category: Cf). +/ @safe pure nothrow bool isFormat(dchar c) { return isFormatGen(c); } unittest { assert(isFormat('\u00AD')); foreach(ch; unicode("Format").byCodepoint) assert(isFormat(ch)); } // code points for private use, surrogates are not likely to change in near feature // if need be they can be generated from unicode data as well /++ Returns whether $(D c) is a Unicode Private Use $(CODEPOINT) (general Unicode category: Co). +/ @safe pure nothrow bool isPrivateUse(dchar c) { return (0x00_E000 <= c && c <= 0x00_F8FF) || (0x0F_0000 <= c && c <= 0x0F_FFFD) || (0x10_0000 <= c && c <= 0x10_FFFD); } /++ Returns whether $(D c) is a Unicode surrogate $(CODEPOINT) (general Unicode category: Cs). +/ @safe pure nothrow bool isSurrogate(dchar c) { return (0xD800 <= c && c <= 0xDFFF); } /++ Returns whether $(D c) is a Unicode high surrogate (lead surrogate). +/ @safe pure nothrow bool isSurrogateHi(dchar c) { return (0xD800 <= c && c <= 0xDBFF); } /++ Returns whether $(D c) is a Unicode low surrogate (trail surrogate). +/ @safe pure nothrow bool isSurrogateLo(dchar c) { return (0xDC00 <= c && c <= 0xDFFF); } /++ Returns whether $(D c) is a Unicode non-character i.e. a $(CODEPOINT) with no assigned abstract character. (general Unicode category: Cn) +/ @safe pure nothrow bool isNonCharacter(dchar c) { return nonCharacterTrie[c]; } unittest { auto set = unicode("Cn"); foreach(ch; set.byCodepoint) assert(isNonCharacter(ch)); } private: // load static data from pre-generated tables into usable datastructures @safe auto asSet(const (ubyte)[] compressed) { return CodepointSet(decompressIntervals(compressed)); } @safe pure nothrow auto asTrie(T...)(in TrieEntry!T e) { return const(CodepointTrie!T)(e.offsets, e.sizes, e.data); } @safe pure nothrow @property { // It's important to use auto return here, so that the compiler // only runs semantic on the return type if the function gets // used. Also these are functions rather than templates to not // increase the object size of the caller. auto lowerCaseTrie() { static immutable res = asTrie(lowerCaseTrieEntries); return res; } auto upperCaseTrie() { static immutable res = asTrie(upperCaseTrieEntries); return res; } auto simpleCaseTrie() { static immutable res = asTrie(simpleCaseTrieEntries); return res; } auto fullCaseTrie() { static immutable res = asTrie(fullCaseTrieEntries); return res; } auto alphaTrie() { static immutable res = asTrie(alphaTrieEntries); return res; } auto markTrie() { static immutable res = asTrie(markTrieEntries); return res; } auto numberTrie() { static immutable res = asTrie(numberTrieEntries); return res; } auto punctuationTrie() { static immutable res = asTrie(punctuationTrieEntries); return res; } auto symbolTrie() { static immutable res = asTrie(symbolTrieEntries); return res; } auto graphicalTrie() { static immutable res = asTrie(graphicalTrieEntries); return res; } auto nonCharacterTrie() { static immutable res = asTrie(nonCharacterTrieEntries); return res; } //normalization quick-check tables auto nfcQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfcQCTrieEntries); return res; } auto nfdQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfdQCTrieEntries); return res; } auto nfkcQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfkcQCTrieEntries); return res; } auto nfkdQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfkdQCTrieEntries); return res; } //grapheme breaking algorithm tables auto mcTrie() { import std.internal.unicode_grapheme; static immutable res = asTrie(mcTrieEntries); return res; } auto graphemeExtendTrie() { import std.internal.unicode_grapheme; static immutable res = asTrie(graphemeExtendTrieEntries); return res; } auto hangLV() { import std.internal.unicode_grapheme; static immutable res = asTrie(hangulLVTrieEntries); return res; } auto hangLVT() { import std.internal.unicode_grapheme; static immutable res = asTrie(hangulLVTTrieEntries); return res; } // tables below are used for composition/decomposition auto combiningClassTrie() { import std.internal.unicode_comp; static immutable res = asTrie(combiningClassTrieEntries); return res; } auto compatMappingTrie() { import std.internal.unicode_decomp; static immutable res = asTrie(compatMappingTrieEntries); return res; } auto canonMappingTrie() { import std.internal.unicode_decomp; static immutable res = asTrie(canonMappingTrieEntries); return res; } auto compositionJumpTrie() { import std.internal.unicode_comp; static immutable res = asTrie(compositionJumpTrieEntries); return res; } //case conversion tables auto toUpperIndexTrie() { static immutable res = asTrie(toUpperIndexTrieEntries); return res; } auto toLowerIndexTrie() { static immutable res = asTrie(toLowerIndexTrieEntries); return res; } auto toTitleIndexTrie() { static immutable res = asTrie(toTitleIndexTrieEntries); return res; } } }// version(!std_uni_bootstrap)
D
module android.java.android.provider.VoicemailContract_Voicemails; public import android.java.android.provider.VoicemailContract_Voicemails_d_interface; import arsd.jni : ImportExportImpl; mixin ImportExportImpl!VoicemailContract_Voicemails; import import1 = android.java.java.lang.Class; import import0 = android.java.android.net.Uri;
D
/Users/shawngong/Centa/.build/debug/Fluent.build/Query/Filter.swift.o : /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Database/Database.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Database/Driver.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Entity/Entity.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Filters.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Group.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Sort.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/MemoryDriver.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Database+Preparation.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Migration.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Preparation.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/PreparationError.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Action.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Comparison.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Filter.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Group.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Join.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Limit.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Query.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Scope.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Sort.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Children.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Parent.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/RelationError.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Siblings.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Database+Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Creator.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Field.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Modifier.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL+Query.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL+Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQLSerializer.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Utilities/Fluent+Node.swift /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/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /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/Dispatch.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/shawngong/Centa/.build/debug/Node.swiftmodule /Users/shawngong/Centa/.build/debug/PathIndexable.swiftmodule /Users/shawngong/Centa/.build/debug/Polymorphic.swiftmodule /Users/shawngong/Centa/.build/debug/Fluent.build/Filter~partial.swiftmodule : /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Database/Database.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Database/Driver.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Entity/Entity.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Filters.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Group.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Sort.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/MemoryDriver.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Database+Preparation.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Migration.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Preparation.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/PreparationError.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Action.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Comparison.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Filter.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Group.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Join.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Limit.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Query.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Scope.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Sort.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Children.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Parent.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/RelationError.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Siblings.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Database+Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Creator.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Field.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Modifier.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL+Query.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL+Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQLSerializer.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Utilities/Fluent+Node.swift /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/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /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/Dispatch.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/shawngong/Centa/.build/debug/Node.swiftmodule /Users/shawngong/Centa/.build/debug/PathIndexable.swiftmodule /Users/shawngong/Centa/.build/debug/Polymorphic.swiftmodule /Users/shawngong/Centa/.build/debug/Fluent.build/Filter~partial.swiftdoc : /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Database/Database.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Database/Driver.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Entity/Entity.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Filters.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Group.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/Memory+Sort.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Memory/MemoryDriver.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Database+Preparation.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Migration.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/Preparation.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Preparation/PreparationError.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Action.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Comparison.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Filter.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Group.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Join.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Limit.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Query.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Scope.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Query/Sort.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Children.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Parent.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/RelationError.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Relations/Siblings.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Database+Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Creator.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Field.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema+Modifier.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Schema/Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/GeneralSQLSerializer.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL+Query.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL+Schema.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQL.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/SQL/SQLSerializer.swift /Users/shawngong/Centa/Packages/Fluent-1.4.0/Sources/Fluent/Utilities/Fluent+Node.swift /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/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /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/Dispatch.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/shawngong/Centa/.build/debug/Node.swiftmodule /Users/shawngong/Centa/.build/debug/PathIndexable.swiftmodule /Users/shawngong/Centa/.build/debug/Polymorphic.swiftmodule
D
/* * Copyright (c) 2004-2008 Derelict Developers * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the names 'Derelict', 'DerelictGL', nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ module derelict.opengl.extension.ext.texture_buffer_object; private { import derelict.opengl.gltypes; import derelict.opengl.gl; import derelict.opengl.extension.loader; import derelict.util.wrapper; } private bool enabled = false; struct EXTTextureBufferObject { static bool load(char[] extString) { if(extString.findStr("GL_EXT_texture_buffer_object") == -1) return false; if(!glBindExtFunc(cast(void**)&glTexBufferEXT, "glTexBufferEXT")) return false; enabled = true; return true; } static bool isEnabled() { return enabled; } } version(DerelictGL_NoExtensionLoaders) { } else { static this() { DerelictGL.registerExtensionLoader(&EXTTextureBufferObject.load); } } enum : GLenum { GL_TEXTURE_BUFFER_EXT = 0x8C2A, GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B, GL_TEXTURE_BINDING_BUFFER_EXT = 0x8C2C, GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D, GL_TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E, } extern(System): typedef void function(GLenum,GLenum,GLuint) pfglTexBufferEXT; pfglTexBufferEXT glTexBufferEXT;
D
propose a toast to greet in a friendly way express commendation of become noticeable honor with a military ceremony, as when honoring dead soldiers recognize with a gesture prescribed by a military regulation
D
module android.java.android.net.DnsResolver_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import2 = android.java.java.util.concurrent.Executor_d_interface; import import1 = android.java.android.net.Network_d_interface; import import0 = android.java.android.net.DnsResolver_d_interface; import import5 = android.java.java.lang.Class_d_interface; import import3 = android.java.android.os.CancellationSignal_d_interface; import import4 = android.java.android.net.DnsResolver_Callback_d_interface; final class DnsResolver : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import static import0.DnsResolver getInstance(); @Import void rawQuery(import1.Network, byte, int, import2.Executor, import3.CancellationSignal, import4.DnsResolver_Callback[]); @Import void rawQuery(import1.Network, string, int, int, int, import2.Executor, import3.CancellationSignal, import4.DnsResolver_Callback); @Import void query(import1.Network, string, int, import2.Executor, import3.CancellationSignal, import4.DnsResolver_Callback); @Import void query(import1.Network, string, int, int, import2.Executor, import3.CancellationSignal, import4.DnsResolver_Callback); @Import import5.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/net/DnsResolver;"; }
D
/* Copyright (c) 2013-2018 Timur Gafarov 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 dmech.hashtable; import dlib.core.ownership; import dlib.core.memory; class HashTable(T, K): Owner { struct Entry(T) { K key; T value; bool valid = false; } const size_t size; Entry!(T)[] table; this(Owner o, size_t size) { super(o); this.size = size; table = New!(Entry!(T)[])(size); } T* get(K key) { uint hash = (key % size); while (table[hash].valid && table[hash].key != key) hash = (hash + 1) % size; if (!table[hash].valid) return null; else return &table[hash].value; } void set(K key, T value) { uint hash = (key % size); while (table[hash].valid && table[hash].key != key) hash = (hash + 1) % size; table[hash] = Entry!(T)(key, value, true); } void remove(K key) { uint hash = (key % size); while (table[hash].valid && table[hash].key != key) hash = (hash + 1) % size; table[hash].valid = false; } int opApply(int delegate(ref T) func) { int result = 0; foreach(ref entry; table) { if (entry.valid) { result = func(entry.value); if (result) break; } } return result; } ~this() { Delete(table); } }
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric; void main() { auto T = readln.chomp.to!int; int s; foreach (i; 0..200) { auto j = i%20; auto k = i/20; if ((k%2 == 0 && j == T-1) || (k%2 == 1 && j == 20-T)) { s += i+1; } } writeln(s); }
D
module android.java.android.provider.ContactsContract_DataColumns_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import0 = android.java.java.lang.Class_d_interface; @JavaName("ContactsContract$DataColumns") final class ContactsContract_DataColumns : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @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/provider/ContactsContract$DataColumns;"; }
D
// D import file generated from 'gamelib\vector.d' module gamelib.vector; import std.conv; import std.stdio; import mylib.vector2d; public import mylib.vector2d; alias Vector2d Vector; alias IntVector2d IntVector;
D
module xf.loader.Loader; /+private { import rg.Node : RgNode = Node; }+/ abstract class Loader { abstract void load(char[] filename); /+ // I must've been drunk while coding this ... :S it obviously needs to be changed // because the generic 'Loader' should not know about 'RgNodes'.......... RgNode[] rgNodes() { assert (false); return null; } //abstract SgNode[] sgNodes();+/ }
D
/** * Bindings for symbols and defines in `mach-o/stab.h` * * This file gives definitions supplementing <nlist.h> for permanent symbol * table entries of Mach-O files. Modified from the BSD definitions. The * modifications from the original definitions were changing what the values of * what was the n_other field (an unused field) which is now the n_sect field. * These modifications are required to support symbols in an arbitrary number of * sections not just the three sections (text, data and bss) in a BSD file. * The values of the defined constants have NOT been changed. * * These must have one of the N_STAB bits on. The n_value fields are subject * to relocation according to the value of their n_sect field. So for types * that refer to things in sections the n_sect field must be filled in with the * proper section ordinal. For types that are not to have their n_value field * relocatated the n_sect field must be NO_SECT. * * This file was created based on the MacOSX 10.15 SDK. * * Copyright: * D Language Foundation 2020 * Some documentation was extracted from the C headers * and is the property of Apple Inc. * * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). * Authors: Mathias 'Geod24' Lang * Source: $(DRUNTIMESRC core/sys/darwin/mach/_nlist.d) */ module core.sys.darwin.mach.stab; extern(C): nothrow: @nogc: pure: /** * Symbolic debugger symbols. * * The comments give the conventional use for * ``` * .stabs "n_name", n_type, n_sect, n_desc, n_value * ``` * * where n_type is the defined constant and not listed in the comment. Other * fields not listed are zero. n_sect is the section ordinal the entry is * refering to. */ enum { N_GSYM = 0x20, /// global symbol: name,,NO_SECT,type,0 N_FNAME = 0x22, /// procedure name (f77 kludge): name,,NO_SECT,0,0 N_FUN = 0x24, /// procedure: name,,n_sect,linenumber,address N_STSYM = 0x26, /// static symbol: name,,n_sect,type,address N_LCSYM = 0x28, /// .lcomm symbol: name,,n_sect,type,address N_BNSYM = 0x2e, /// begin nsect sym: 0,,n_sect,0,address N_AST = 0x32, /// AST file path: name,,NO_SECT,0,0 N_OPT = 0x3c, /// emitted with gcc2_compiled and in gcc source N_RSYM = 0x40, /// register sym: name,,NO_SECT,type,register N_SLINE = 0x44, /// src line: 0,,n_sect,linenumber,address N_ENSYM = 0x4e, /// end nsect sym: 0,,n_sect,0,address N_SSYM = 0x60, /// structure elt: name,,NO_SECT,type,struct_offset N_SO = 0x64, /// source file name: name,,n_sect,0,address /** * Object file name: name,,(see below),0,st_mtime * * Historically N_OSO set n_sect to 0. * The N_OSO n_sect may instead hold the low byte of the cpusubtype value * from the Mach-O header. */ N_OSO = 0x66, N_LSYM = 0x80, /// local sym: name,,NO_SECT,type,offset N_BINCL = 0x82, /// include file beginning: name,,NO_SECT,0,sum N_SOL = 0x84, /// #included file name: name,,n_sect,0,address N_PARAMS = 0x86, /// compiler parameters: name,,NO_SECT,0,0 N_VERSION = 0x88, /// compiler version: name,,NO_SECT,0,0 N_OLEVEL = 0x8A, /// compiler -O level: name,,NO_SECT,0,0 N_PSYM = 0xa0, /// parameter: name,,NO_SECT,type,offset N_EINCL = 0xa2, /// include file end: name,,NO_SECT,0,0 N_ENTRY = 0xa4, /// alternate entry: name,,n_sect,linenumber,address N_LBRAC = 0xc0, /// left bracket: 0,,NO_SECT,nesting level,address N_EXCL = 0xc2, /// deleted include file: name,,NO_SECT,0,sum N_RBRAC = 0xe0, /// right bracket: 0,,NO_SECT,nesting level,address N_BCOMM = 0xe2, /// begin common: name,,NO_SECT,0,0 N_ECOMM = 0xe4, /// end common: name,,n_sect,0,0 N_ECOML = 0xe8, /// end common (local name): 0,,n_sect,0,address N_LENG = 0xfe, /// second stab entry with length information // For the berkeley pascal compiler, pc(1): N_PC = 0x30, /// global pascal symbol: name,,NO_SECT,subtype,line }
D
module android.java.java.lang.InheritableThreadLocal_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import0 = android.java.java.lang.ThreadLocal_d_interface; import import1 = android.java.java.util.function_.Supplier_d_interface; import import2 = android.java.java.lang.Class_d_interface; final class InheritableThreadLocal : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import this(arsd.jni.Default); @Import static import0.ThreadLocal withInitial(import1.Supplier); @Import IJavaObject get(); @Import void set(IJavaObject); @Import void remove(); @Import import2.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 = "Ljava/lang/InheritableThreadLocal;"; }
D
@safe pure: class X { this(int x) @safe pure { this.x = x; } int x; } class Y : X { this(int x) @safe pure { super(x); } int x; } static void fm(X[] xs) {} static void fc(const(X)[] xs) {} static void fi(immutable(X)[] xs) {} static void f2m(X[2] xs) {} static void f2mr(ref X[2] xs) {} void test() { Y[] y = [new Y(42), new Y(43)]; immutable(Y)[] yi = [new Y(42), new Y(43)]; static assert(!__traits(compiles, { fm(y); })); fc(y); fc(yi); fi(yi); Y[2] y2 = [new Y(42), new Y(43)]; f2m(y2); static assert(!__traits(compiles, { f2mr(y2); })); }
D
/Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Routing.build/RouteBuilder+RouteCollection.swift.o : /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/Branch.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/ParametersContainer.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder+RouteCollection.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder+RouteGroup.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteCollection.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteGroup+RouteBuilder.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteGroup.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/Router.swift /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/SwiftOnoneSupport.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Core.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/ObjectiveC.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/libc.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Node.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/PathIndexable.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Polymorphic.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Routing.build/RouteBuilder+RouteCollection~partial.swiftmodule : /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/Branch.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/ParametersContainer.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder+RouteCollection.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder+RouteGroup.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteCollection.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteGroup+RouteBuilder.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteGroup.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/Router.swift /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/SwiftOnoneSupport.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Core.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/ObjectiveC.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/libc.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Node.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/PathIndexable.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Polymorphic.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Routing.build/RouteBuilder+RouteCollection~partial.swiftdoc : /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/Branch.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/ParametersContainer.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder+RouteCollection.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder+RouteGroup.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteBuilder.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteCollection.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteGroup+RouteBuilder.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/RouteGroup.swift /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/Packages/Routing-1.0.1/Sources/Routing/Router.swift /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/SwiftOnoneSupport.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Core.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/ObjectiveC.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/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/libc.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Node.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/PathIndexable.swiftmodule /Users/mohammadazam/Documents/Projects/StoryTellersAPICode/StoryTellersAPI/.build/debug/Polymorphic.swiftmodule
D
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.0 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ module vtkParallelCoordinatesHistogramRepresentation; static import vtkd_im; static import core.stdc.config; static import std.conv; static import std.string; static import std.conv; static import std.string; static import vtkObjectBase; static import SWIGTYPE_p_double; static import vtkParallelCoordinatesRepresentation; class vtkParallelCoordinatesHistogramRepresentation : vtkParallelCoordinatesRepresentation.vtkParallelCoordinatesRepresentation { private void* swigCPtr; public this(void* cObject, bool ownCObject) { super(vtkd_im.vtkParallelCoordinatesHistogramRepresentation_Upcast(cObject), ownCObject); swigCPtr = cObject; } public static void* swigGetCPtr(vtkParallelCoordinatesHistogramRepresentation obj) { return (obj is null) ? null : obj.swigCPtr; } mixin vtkd_im.SwigOperatorDefinitions; public override void dispose() { synchronized(this) { if (swigCPtr !is null) { if (swigCMemOwn) { swigCMemOwn = false; throw new object.Exception("C++ destructor does not have public access"); } swigCPtr = null; super.dispose(); } } } public static vtkParallelCoordinatesHistogramRepresentation New() { void* cPtr = vtkd_im.vtkParallelCoordinatesHistogramRepresentation_New(); vtkParallelCoordinatesHistogramRepresentation ret = (cPtr is null) ? null : new vtkParallelCoordinatesHistogramRepresentation(cPtr, false); return ret; } public static int IsTypeOf(string type) { auto ret = vtkd_im.vtkParallelCoordinatesHistogramRepresentation_IsTypeOf((type ? std.string.toStringz(type) : null)); return ret; } public static vtkParallelCoordinatesHistogramRepresentation SafeDownCast(vtkObjectBase.vtkObjectBase o) { void* cPtr = vtkd_im.vtkParallelCoordinatesHistogramRepresentation_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o)); vtkParallelCoordinatesHistogramRepresentation ret = (cPtr is null) ? null : new vtkParallelCoordinatesHistogramRepresentation(cPtr, false); return ret; } public vtkParallelCoordinatesHistogramRepresentation NewInstance() const { void* cPtr = vtkd_im.vtkParallelCoordinatesHistogramRepresentation_NewInstance(cast(void*)swigCPtr); vtkParallelCoordinatesHistogramRepresentation ret = (cPtr is null) ? null : new vtkParallelCoordinatesHistogramRepresentation(cPtr, false); return ret; } alias vtkParallelCoordinatesRepresentation.vtkParallelCoordinatesRepresentation.NewInstance NewInstance; public void SetUseHistograms(int arg0) { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_SetUseHistograms(cast(void*)swigCPtr, arg0); } public int GetUseHistograms() { auto ret = vtkd_im.vtkParallelCoordinatesHistogramRepresentation_GetUseHistograms(cast(void*)swigCPtr); return ret; } public void UseHistogramsOn() { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_UseHistogramsOn(cast(void*)swigCPtr); } public void UseHistogramsOff() { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_UseHistogramsOff(cast(void*)swigCPtr); } public void SetShowOutliers(int arg0) { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_SetShowOutliers(cast(void*)swigCPtr, arg0); } public int GetShowOutliers() { auto ret = vtkd_im.vtkParallelCoordinatesHistogramRepresentation_GetShowOutliers(cast(void*)swigCPtr); return ret; } public void ShowOutliersOn() { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_ShowOutliersOn(cast(void*)swigCPtr); } public void ShowOutliersOff() { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_ShowOutliersOff(cast(void*)swigCPtr); } public void SetHistogramLookupTableRange(double _arg1, double _arg2) { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_SetHistogramLookupTableRange__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2); } public void SetHistogramLookupTableRange(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_SetHistogramLookupTableRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg)); } public double* GetHistogramLookupTableRange() { auto ret = cast(double*)vtkd_im.vtkParallelCoordinatesHistogramRepresentation_GetHistogramLookupTableRange__SWIG_0(cast(void*)swigCPtr); return ret; } public void GetHistogramLookupTableRange(double* _arg1, double* _arg2) { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_GetHistogramLookupTableRange__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2); if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve(); } public void GetHistogramLookupTableRange(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_GetHistogramLookupTableRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg)); } public void SetPreferredNumberOfOutliers(int arg0) { vtkd_im.vtkParallelCoordinatesHistogramRepresentation_SetPreferredNumberOfOutliers(cast(void*)swigCPtr, arg0); } public int GetPreferredNumberOfOutliers() { auto ret = vtkd_im.vtkParallelCoordinatesHistogramRepresentation_GetPreferredNumberOfOutliers(cast(void*)swigCPtr); return ret; } }
D
/mnt/c/Users/zeliwang/hello_world/digital_signature/target/release/deps/bstr-09f767f2b8ec9509.rmeta: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/lib.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ascii.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstr.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstring.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/scalar.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/cow.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_slice.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_vec.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/impls.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/io.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/byte_frequencies.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/prefilter.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/twoway.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/grapheme.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/sentence.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/whitespace.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/word.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/utf8.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.littleendian.dfa /mnt/c/Users/zeliwang/hello_world/digital_signature/target/release/deps/libbstr-09f767f2b8ec9509.rlib: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/lib.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ascii.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstr.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstring.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/scalar.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/cow.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_slice.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_vec.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/impls.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/io.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/byte_frequencies.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/prefilter.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/twoway.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/grapheme.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/sentence.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/whitespace.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/word.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/utf8.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.littleendian.dfa /mnt/c/Users/zeliwang/hello_world/digital_signature/target/release/deps/bstr-09f767f2b8ec9509.d: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/lib.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ascii.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstr.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstring.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/scalar.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/cow.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_slice.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_vec.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/impls.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/io.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/byte_frequencies.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/prefilter.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/twoway.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/grapheme.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/sentence.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/whitespace.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/word.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/utf8.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.littleendian.dfa /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/lib.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ascii.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstr.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/bstring.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/mod.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/byteset/scalar.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/cow.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_slice.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/ext_vec.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/impls.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/io.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/mod.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/byte_frequencies.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/prefilter.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/search/twoway.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/mod.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/mod.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/grapheme.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/sentence.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/whitespace.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/word.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/utf8.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/grapheme_break_rev.littleendian.dfa: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/regional_indicator_rev.littleendian.dfa: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/sentence_break_fwd.littleendian.dfa: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/simple_word_fwd.littleendian.dfa: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bstr-0.2.7/src/unicode/fsm/word_break_fwd.littleendian.dfa:
D
// This file is written in D programming language /** * The example demonstrates basic daemonize features. Described * daemon responds to SIGTERM and SIGHUP signals. * * If SIGTERM is received, daemon terminates. If SIGHUP is received, * daemon prints "Hello World!" message to logg. * * Daemon will auto-terminate after 5 minutes of running. * * Copyright: © 2014 Anton Gushcha * License: Subject to the terms of the MIT license, as written in the included LICENSE file. * Authors: NCrashed <ncrashed@gmail.com> */ module example01; import std.datetime; import std.experimental.logger; import daemonize.d; // First you need to describe your daemon via template alias daemon = Daemon!( "DaemonizeExample1", // unique name // Setting associative map signal -> callbacks KeyValueList!( // You can bind same delegate for several signals by Composition template // delegate can take additional argument to know which signal is caught Composition!(Signal.Terminate, Signal.Quit, Signal.Shutdown, Signal.Stop), (logger, signal) { logger.info("Exiting..."); return false; // returning false will terminate daemon }, Composition!(Signal.HangUp,Signal.Pause,Signal.Continue), (logger) { logger.info("Hello World!"); return true; // continue execution } ), // Main function where your code is (logger, shouldExit) { // will stop the daemon in 5 minutes auto time = MonoTime.currTime + 5.dur!"minutes"; while(!shouldExit() && time > MonoTime.currTime) { } logger.info("Exiting main function!"); return 0; } ); int main() { // For windows is important to use absolute path for logging version(Windows) string logFilePath = "C:\\logfile.log"; else string logFilePath = "logfile.log"; return buildDaemon!daemon.run(new FileLogger(logFilePath)); }
D
/* * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. * * 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 hunt.quartz.ee.jta.JTAJobRunShell; // import javax.transaction.Status; // import javax.transaction.SystemException; // import javax.transaction.UserTransaction; import hunt.quartz.Scheduler; import hunt.quartz.Exceptions; import hunt.quartz.core.JobRunShell; import hunt.quartz.spi.TriggerFiredBundle; import hunt.Exceptions; import hunt.logging; /** * <p> * An extension of <code>{@link hunt.quartz.core.JobRunShell}</code> that * begins an XA transaction before executing the Job, and commits (or * rolls-back) the transaction after execution completes. * </p> * * @see hunt.quartz.core.JobRunShell * * @author James House */ // class JTAJobRunShell : JobRunShell { // /* // * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * // * Data members. // * // * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // */ // private int transactionTimeout; // // private UserTransaction ut; // /* // * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * // * Constructors. // * // * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // */ // /** // * <p> // * Create a JTAJobRunShell instance with the given settings. // * </p> // */ // this(Scheduler scheduler, TriggerFiredBundle bndle) { // super(scheduler, bndle); // this.transactionTimeout = null; // } // /** // * <p> // * Create a JTAJobRunShell instance with the given settings. // * </p> // */ // this(Scheduler scheduler, TriggerFiredBundle bndle, int timeout) { // super(scheduler, bndle); // this.transactionTimeout = timeout; // } // /* // * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * // * Interface. // * // * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // */ // override // protected void begin() { // // Don't get a new UserTransaction w/o making sure we cleaned up the old // // one. This is necessary because there are paths through JobRunShell.run() // // where begin() can be called multiple times w/o complete being called in // // between. // cleanupUserTransaction(); // bool beganSuccessfully = false; // try { // trace("Looking up UserTransaction."); // implementationMissing(false); // // ut = UserTransactionHelper.lookupUserTransaction(); // // if (transactionTimeout !is null) { // // ut.setTransactionTimeout(transactionTimeout); // // } // // trace("Beginning UserTransaction."); // // ut.begin(); // beganSuccessfully = true; // } catch (SchedulerException se) { // throw se; // } catch (Exception nse) { // throw new SchedulerException( // "JTAJobRunShell could not start UserTransaction.", nse); // } finally { // if (beganSuccessfully == false) { // cleanupUserTransaction(); // } // } // } // override // protected void complete(bool successfulExecution) { // if (ut is null) { // return; // } // try { // try { // if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) { // trace("UserTransaction marked for rollback only."); // successfulExecution = false; // } // } catch (SystemException e) { // throw new SchedulerException( // "JTAJobRunShell could not read UserTransaction status.", e); // } // if (successfulExecution) { // try { // trace("Committing UserTransaction."); // ut.commit(); // } catch (Exception nse) { // throw new SchedulerException( // "JTAJobRunShell could not commit UserTransaction.", nse); // } // } else { // try { // trace("Rolling-back UserTransaction."); // ut.rollback(); // } catch (Exception nse) { // throw new SchedulerException( // "JTAJobRunShell could not rollback UserTransaction.", // nse); // } // } // } finally { // cleanupUserTransaction(); // } // } // /** // * Override passivate() to ensure we always cleanup the UserTransaction. // */ // override // void passivate() { // cleanupUserTransaction(); // super.passivate(); // } // private void cleanupUserTransaction() { // if (ut !is null) { // UserTransactionHelper.returnUserTransaction(ut); // ut = null; // } // } // }
D
/******************************************************************************* Helper struct for node-side suspendable requests which behave as follows: * Operate on a single channel. * Send a stream of data, broken down into individual messages. * The stream can be suspended, resumed, and stopped by the client. These actions are known as "state changes". * While a state change is in progress, the client is unable to request another state change. * All state changes are acknowledged by the node by sending a special ACK message to the client. The struct handles all state change logic and communication with the client. Request specifics such as codes and messages sent back and forth between the client and node are left deliberately abstract and must be provided by the request implementation which uses this helper. Copyright: Copyright (c) 2016-2017 sociomantic labs GmbH. All rights reserved License: Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. *******************************************************************************/ deprecated module swarm.neo.node.helper.SuspendableRequest; /// ditto deprecated("Adapt your request to use RequestEventDispatcher and multiple fibers " "instead") public struct SuspendableRequest { import ocean.transition; import swarm.neo.node.RequestOnConn; /*************************************************************************** Enum defining the states in which the handler of a suspendable request may be. ***************************************************************************/ public enum State { /// Sending data to the client Sending, /// Suspended, waiting for the client to send a message to resume the /// request Suspended, /// Waiting for more data to be available for sending WaitingForData, /// Request finished Exit } /*************************************************************************** Enum defining the actions which a message received from the client may trigger. ***************************************************************************/ public enum ReceivedMessageAction { /// The received message was of an unknown type Undefined, /// The received message indicates that the request should be suspended Suspend, /// The received message indicates that the request should be resumed Resume, /// The received message indicates that the request should end Exit } /*************************************************************************** Event dispatcher for this request-on-conn. ***************************************************************************/ private RequestOnConn.EventDispatcher conn; /*************************************************************************** The maximum number of records that should be sent in a row before yielding. ***************************************************************************/ private const uint yield_send_count = 10; /*************************************************************************** Flag set when the fiber is suspended in waitForData() waiting for either a message to be received from the client or data to be ready to send. When this flag is true, a call to dataReady() will resume the waiting fiber. ***************************************************************************/ private bool fiber_suspended_waiting_for_data; /*************************************************************************** Alias for a delegate which handles a received message and returns a decision on what action need be taken. ***************************************************************************/ private alias ReceivedMessageAction delegate ( Const!(void)[] received ) ReceivedMessageDg; /*************************************************************************** Initialises this instance. Params: conn = event dispatcher for this request-on-conn ***************************************************************************/ public void initialise ( RequestOnConn.EventDispatcher conn ) in { assert(conn !is null); } body { this.conn = conn; } /*************************************************************************** Indicates that data is now ready to send. If the suspendable request is in the state of waiting for data to be ready (see waitForData()), the fiber will be resumed, triggering a state change to state Sending. ***************************************************************************/ public void dataReady ( RequestOnConn connection, uint data_ready_code ) { if ( this.fiber_suspended_waiting_for_data ) connection.resumeFiber(data_ready_code); } /*************************************************************************** If the channel being processed is removed, we have to end the request and send a special message to the client, informing them of this. This method sends the specified "channel removed" message to the client, ignoring messages received from the client in the meantime (the request is ending, so we don't care about control messages from the client). The fiber should not be resumed by data ready events. Params: channel_removed_msg = code to send to client to inform it that the channel has been removed ***************************************************************************/ public void sendChannelRemoved ( ubyte channel_removed_msg ) { bool send_interrupted; do { send_interrupted = false; this.conn.sendReceive( ( in void[] msg ) {send_interrupted = true;}, ( conn.Payload payload ) { payload.add(channel_removed_msg); } ); this.conn.flush(); } while ( send_interrupted ); } /*************************************************************************** Sends data (returned by the provided delegate) to the client, until the delegate specifies that the loop should end. Every this.yield_send_count records, the fiber yields, allowing other requests to be handled. Messages received by the client, while sending data or yielding, are handled by a second delegate. Params: iterate = delegate which returns a data item to be sent or null, if there is currently nothing to send. It also tells, via an out argument, whether the sending should continue or end. (Note that, if the delegate returns an item *and* specifies that the sending should end, the returned item is sent first, before exiting this method.) handle_received_message = delegate to which received messages are passed. The return value determines whether the request continues sending, suspends, or exits. ack = code to send to the client indicating ACK data_msg = code to send to the client indicating a data message. This code is sent at the start of a message payload, followed by a data item Returns: the next state to enter (normally WaitingForData; may be Suspended or Exit) Throws: ProtocolError, if handle_received_message returns Undefined (it's important that the caller does not swallow this exception) ***************************************************************************/ public State sendData ( Const!(void)[] delegate ( out bool keep_going ) iterate, ReceivedMessageDg handle_received_message, ubyte ack, ubyte data_msg ) { uint records_sent_without_yielding = 0; bool keep_going; do { // Call the iteration delegate, to determine whether another item is // ready to send and/or whether we should exit the loop. auto data = iterate(keep_going); bool received_msg; ReceivedMessageAction msg_action; // Send current data item, if necessary if ( data !is null ) { this.conn.sendReceive( ( in void[] received ) { msg_action = handle_received_message(received); received_msg = true; }, ( conn.Payload payload ) { payload.add(data_msg); payload.addArray(data); } ); // Handle messages received while sending. if ( received_msg ) { // sendReceive() was interrupted while sending, so send again. // The client should not send any message until it has received // the Ack. this.conn.send( ( conn.Payload payload ) { payload.addConstant(data_msg); payload.addArray(data); } ); // Ack the received control message. this.sendAck(ack); with ( ReceivedMessageAction ) switch ( msg_action ) { case Suspend: return State.Suspended; case Exit: return State.Exit; case Resume: // Meaningless but harmless break; default: throw this.conn.shutdownWithProtocolError( "Unexpected control message while sending data"); } } } // Yield after iterating some data items. received_msg = false; auto resume_code = this.conn.periodicYieldReceiveAndHandleEvents( records_sent_without_yielding, this.yield_send_count, ( in void[] received ) { msg_action = handle_received_message(received); received_msg = true; } ); assert(resume_code <= 0, "Unexpected fiber resume code when yielding/waiting for control message"); // Handle messages received while yielding. if ( received_msg ) { // Ack the received control message. this.sendAck(ack); with ( ReceivedMessageAction ) switch ( msg_action ) { case Suspend: return State.Suspended; case Exit: return State.Exit; case Resume: // Meaningless but harmless break; default: throw this.conn.shutdownWithProtocolError( "Unexpected control message while yielded"); } } } while ( keep_going ); return State.WaitingForData; } /*************************************************************************** Waits for control messages from the client, until a state change (either resume or exit) is requested. Params: handle_received_message = delegate to which received messages are passed. The return value determines whether the request remains suspended, resumes, or exits. ack = code to send to the client indicating ACK Returns: the next state to enter (normally Sending; may be Exit) Throws: ProtocolError, if handle_received_message returns Undefined (it's important that the caller does not swallow this exception) ***************************************************************************/ // The request is suspended waiting for a state change public State waitForControlMessage ( ReceivedMessageDg handle_received_message, ubyte ack ) { ReceivedMessageAction msg_action; do { int resume_code = this.conn.receiveAndHandleEvents( ( in void[] received ) { msg_action = handle_received_message(received); } ); assert(resume_code == this.conn.FiberResumeCode.Received, "Unexpected fiber resume code when waiting for control message"); // Ack the received control message. this.sendAck(ack); } while ( msg_action == ReceivedMessageAction.Suspend ); with ( ReceivedMessageAction ) switch ( msg_action ) { case Suspend: assert(false); // Should not have exited the while loop case Exit: return State.Exit; case Resume: return State.Sending; default: throw this.conn.shutdownWithProtocolError( "Unexpected control message while waiting for control message"); } assert(false); } /*************************************************************************** Waits for data to be ready to send or a control message to arrive from the client. Params: handle_received_message = delegate to which received messages are passed. The return value determines whether the request continues waiting, suspends, or exits. data_ready_code = resume code expected when the fiber is resumed because data is now ready ack = code to send to the client indicating ACK Returns: the next state to enter (normally Sending; may be Suspended or Exit) Throws: ProtocolError, if handle_received_message returns Undefined (it's important that the caller does not swallow this exception) ***************************************************************************/ public State waitForData ( ReceivedMessageDg handle_received_message, uint data_ready_code, ubyte ack ) { ReceivedMessageAction msg_action; do { int resume_code; this.fiber_suspended_waiting_for_data = true; try { resume_code = this.conn.receiveAndHandleEvents( ( in void[] received ) { msg_action = handle_received_message(received); } ); } finally { this.fiber_suspended_waiting_for_data = false; } // Fiber was resumed with the data ready code. if ( resume_code > 0 ) // positive code => user code => must be data ready { assert(resume_code == data_ready_code, "Unexpected fiber resume code when waiting for data"); return State.Sending; } // A control message was received from the client. assert(resume_code == this.conn.FiberResumeCode.Received, "Unexpected fiber resume code when waiting for data"); // Ack the received control message. this.sendAck(ack); } while ( msg_action == ReceivedMessageAction.Resume ); with ( ReceivedMessageAction ) switch ( msg_action ) { case Suspend: return State.Suspended; case Exit: return State.Exit; case Resume: assert(false); // Should have not exited the while loop default: throw this.conn.shutdownWithProtocolError( "Unexpected control message while waiting for data"); } assert(false); } /*************************************************************************** Sends an `Ack` message to the client. The client is expected to not send a message in the mean time or a protocol error is raised. Params: ack = code to send to the client indicating ACK ***************************************************************************/ private void sendAck ( ubyte ack ) { this.conn.send( ( conn.Payload payload ) { payload.add(ack); } ); this.conn.flush(); } }
D
/Users/miladmehrpoo/Desktop/Helloworld/.build/debug/Socks.build/Socks.swift.o : /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/Socks.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/SynchronousTCPServer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/SynchronousUDPServer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/TCPClient.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/UDPClient.swift /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/SwiftOnoneSupport.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/SocksCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/Socks.build/Socks~partial.swiftmodule : /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/Socks.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/SynchronousTCPServer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/SynchronousUDPServer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/TCPClient.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/UDPClient.swift /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/SwiftOnoneSupport.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/SocksCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/Socks.build/Socks~partial.swiftdoc : /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/Socks.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/SynchronousTCPServer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/SynchronousUDPServer.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/TCPClient.swift /Users/miladmehrpoo/Desktop/Helloworld/Packages/Socks-1.0.1/Sources/Socks/UDPClient.swift /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/SwiftOnoneSupport.swiftmodule /Users/miladmehrpoo/Desktop/Helloworld/.build/debug/SocksCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule
D
/Users/nickbajaj/Documents/Projects/RideShareApp/Split-fqkbqupnqwmnoybwxcytaezmlswq/Build/Intermediates/Split.build/Debug-iphonesimulator/Split.build/Objects-normal/x86_64/SignInViewController.o : /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/setUpProfile.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/AppDelegate.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/DBProvider.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/mainPageViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/myPageViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/SignInViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/SignUpViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/postTripViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/menuViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/Authenticator.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/supportedColleges.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/Constants.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/Firebase/Core/Sources/Firebase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/Firebase/Core/Sources/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/RideShareApp/Split-fqkbqupnqwmnoybwxcytaezmlswq/Build/Intermediates/Split.build/Debug-iphonesimulator/Split.build/Objects-normal/x86_64/SignInViewController~partial.swiftmodule : /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/setUpProfile.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/AppDelegate.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/DBProvider.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/mainPageViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/myPageViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/SignInViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/SignUpViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/postTripViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/menuViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/Authenticator.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/supportedColleges.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/Constants.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/Firebase/Core/Sources/Firebase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/Firebase/Core/Sources/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/RideShareApp/Split-fqkbqupnqwmnoybwxcytaezmlswq/Build/Intermediates/Split.build/Debug-iphonesimulator/Split.build/Objects-normal/x86_64/SignInViewController~partial.swiftdoc : /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/setUpProfile.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/AppDelegate.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/DBProvider.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/mainPageViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/myPageViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/SignInViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/SignUpViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/postTripViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/menuViewController.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/Authenticator.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/supportedColleges.swift /Users/nickbajaj/Documents/Projects/AppIdeaOne/AppIdeaOne/Constants.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/Firebase/Core/Sources/Firebase.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/Firebase/Core/Sources/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/nickbajaj/Documents/Projects/AppIdeaOne/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap
D
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Authentication.build/Token/TokenAuthenticatable.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/AuthenticationCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Authenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Basic/BasicAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Password/PasswordAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Token/TokenAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/SessionAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Bearer/BearerAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Utilities/GuardMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Basic/BasicAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Token/TokenAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Bearer/BearerAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/AuthenticationSessionsMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/RedirectMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/AuthenticationProvider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Password/PasswordVerifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Utilities/AuthenticationError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Validation.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOSHA1/include/c_nio_sha1.h /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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-ssl.git--4203122085816746094/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CCryptoOpenSSL/include/c_crypto_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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-ssl-support.git--7591788603050871532/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CBase32/include/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CBcrypt/include/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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Authentication.build/TokenAuthenticatable~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/AuthenticationCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Authenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Basic/BasicAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Password/PasswordAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Token/TokenAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/SessionAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Bearer/BearerAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Utilities/GuardMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Basic/BasicAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Token/TokenAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Bearer/BearerAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/AuthenticationSessionsMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/RedirectMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/AuthenticationProvider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Password/PasswordVerifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Utilities/AuthenticationError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Validation.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOSHA1/include/c_nio_sha1.h /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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-ssl.git--4203122085816746094/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CCryptoOpenSSL/include/c_crypto_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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-ssl-support.git--7591788603050871532/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CBase32/include/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CBcrypt/include/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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Authentication.build/TokenAuthenticatable~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/AuthenticationCache.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Authenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Basic/BasicAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Password/PasswordAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Token/TokenAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/SessionAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Bearer/BearerAuthenticatable.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Utilities/GuardMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Basic/BasicAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Token/TokenAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Bearer/BearerAuthenticationMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/AuthenticationSessionsMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Persist/RedirectMiddleware.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/AuthenticationProvider.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Password/PasswordVerifier.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Utilities/AuthenticationError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/auth.git-6422525414104458182/Sources/Authentication/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/lb/Documents/Project/LearnVapor/.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Validation.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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.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/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOSHA1/include/c_nio_sha1.h /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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-ssl.git--4203122085816746094/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CCryptoOpenSSL/include/c_crypto_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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.4/include/openssl/err.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/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/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.4/include/openssl/x509_vfy.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-ssl-support.git--7591788603050871532/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CBase32/include/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/checkouts/crypto.git--6549914863907898371/Sources/CBcrypt/include/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
/++ A small extension module to [arsd.minigui] that adds functions for creating widgets and windows from short XML descriptions. If you choose to use this, it will require [arsd.dom] to be compiled into your project too. --- import arsd.minigui_xml; Window window = createWindowFromXml(` <MainWindow> <Button label="Hi!" /> </MainWindow> `); --- To add custom widgets to the minigui_xml factory, you need to register them with FIXME. You can attach some events right in the XML using attributes. The attribute names are `onEVENTNAME` or `ondirectEVENTNAME` and the values are one of the following three value types: $(LIST * If it starts with `&`, it is a delegate you need to register using the FIXME function. * If it starts with `(`, it is a string passed to the [arsd.dom.querySelector] function to get an element reference * Otherwise, it tries to call a script function (if scripting is available). ) Keep in mind For example, to make a page widget that changes based on a drop down selection, you may: ```xml <DropDownSelection onchange="$(+PageWidget).setCurrentTab"> <option>Foo</option> <option>Bar</option> </DropDownSelection> <PageWidget name="mypage"> <!-- contents elided --> </PageWidget> ``` That will create a select widget that when it changes, it will look for the next PageWidget sibling (that's the meaning of `+PageWidget`, see css selector syntax for more) and call its `setCurrentTab` method. Since the function knows `setCurrentTab` takes an integer, it will automatically pull the `intValue` member out of the event and pass it to the method. The given XML is the same as the following D: --- auto select = new DropDownSelection(parent); select.addOption("Foo"); select.addOption("Bar"); auto page = new PageWidget(parent); page.name = "mypage"; select.addEventListener("change", (Event event) { page.setCurrentTab(event.intValue); }); --- +/ module minigui_xml; public import arsd.minigui; public import arsd.minigui : Event; import arsd.dom; import std.conv; import std.exception; import std.functional : toDelegate; import std.string : strip; import std.traits; private template ident(T...) { static if(is(T[0])) alias ident = T[0]; else alias ident = void; } enum ParseContinue { recurse, next, abort } alias WidgetFactory = ParseContinue delegate(Widget parent, Element element, out Widget result); alias WidgetTextHandler = void delegate(Widget widget, string text); WidgetFactory[string] widgetFactoryFunctions; WidgetTextHandler[string] widgetTextHandlers; void delegate(string eventName, Widget, Event, string content) xmlScriptEventHandler; static this() { xmlScriptEventHandler = toDelegate(&nullScriptEventHandler); } void nullScriptEventHandler(string eventName, Widget w, Event e, string) { import std.stdio : stderr; stderr.writeln("Ignoring event ", eventName, " ", e, " on widget ", w.elementName, " because xmlScriptEventHandler is not set"); } private bool startsWith(T)(T[] doesThis, T[] startWithThis) { return doesThis.length >= startWithThis.length && doesThis[0 .. startWithThis.length] == startWithThis; } private bool isLower(char c) { return c >= 'a' && c <= 'z'; } private bool isUpper(char c) { return c >= 'A' && c <= 'Z'; } private char assumeLowerToUpper(char c) { return cast(char)(c - 'a' + 'A'); } private char assumeUpperToLower(char c) { return cast(char)(c - 'A' + 'a'); } string hyphenate(string argname) { int hyphen; foreach (i, char c; argname) if (c.isUpper && (i == 0 || !argname[i - 1].isUpper)) hyphen++; if (hyphen == 0) return argname; char[] ret = new char[argname.length + hyphen]; int i; bool prevUpper; foreach (char c; argname) { bool upper = c.isUpper; if (upper) { if (!prevUpper) ret[i++] = '-'; ret[i++] = c.assumeUpperToLower; } else { ret[i++] = c; } prevUpper = upper; } assert(i == ret.length); return cast(string) ret; } string unhyphen(string argname) { int hyphen; foreach (i, char c; argname) if (c == '-' && (i == 0 || argname[i - 1] != '-')) hyphen++; if (hyphen == 0) return argname; char[] ret = new char[argname.length - hyphen]; int i; char prev; foreach (char c; argname) { if (c != '-') { if (prev == '-' && c.isLower) ret[i++] = c.assumeLowerToUpper; else ret[i++] = c; } prev = c; } assert(i == ret.length); return cast(string) ret; } void initMinigui(Modules...)() { import std.traits; import std.conv; static foreach (alias Module; Modules) { pragma(msg, Module.stringof); appendMiniguiModule!Module; } } void appendMiniguiModule(alias Module, string prefix = null)() { foreach(memberName; __traits(allMembers, Module)) static if(!__traits(isDeprecated, __traits(getMember, Module, memberName))) { alias Member = ident!(__traits(getMember, Module, memberName)); static if(is(Member == class) && !isAbstractClass!Member && is(Member : Widget) && __traits(getProtection, Member) != "private") { widgetFactoryFunctions[prefix ~ memberName] = (Widget parent, Element element, out Widget widget) { static if(is(Member : Dialog)) { widget = new Member(); } else static if(is(Member : Menu)) { widget = new Menu(null, null); } else static if(is(Member : Window)) { widget = new Member("test"); } else { string[string] args = element.attributes; enum paramNames = ParameterIdentifierTuple!(__traits(getMember, Member, "__ctor")); Parameters!(__traits(getMember, Member, "__ctor")) params; static assert(paramNames.length, Member); bool[cast(int)paramNames.length - 1] requiredParams; static foreach (idx, param; params[0 .. $-1]) {{ enum hyphenated = paramNames[idx].hyphenate; if (auto arg = hyphenated in args) { enforce(!requiredParams[idx], "May pass required parameter " ~ hyphenated ~ " only exactly once"); requiredParams[idx] = true; static if(is(typeof(param) == MemoryImage)) { } else static if(is(typeof(param) == Color)) { params[idx] = Color.fromString(*arg); } else params[idx] = to!(typeof(param))(*arg); } else { enforce(false, "Missing required parameter " ~ hyphenated ~ " for Widget " ~ memberName); assert(false); } }} params[$-1] = parent; auto member = new Member(params); widget = member; foreach (argName, argValue; args) { if (argName.startsWith("on-")) { auto eventName = argName[3 .. $].unhyphen; widget.addEventListener(eventName, (event) { xmlScriptEventHandler(eventName, member, event, argValue); }); } else { argName = argName.unhyphen; switch (argName) { static foreach (idx, param; params[0 .. $-1]) { case paramNames[idx]: } break; static if (is(typeof(Member.addParameter))) { default: member.addParameter(argName, argValue); break; } else { // TODO: add generic parameter setting here (iterate by UDA maybe) default: enforce(false, "Unknown parameter " ~ argName ~ " for Widget " ~ memberName); assert(false); } } } } } return ParseContinue.recurse; }; enum hasText = is(typeof(Member.text) == string) || is(typeof(Member.text()) == string); enum hasContent = is(typeof(Member.content) == string) || is(typeof(Member.content()) == string); enum hasLabel = is(typeof(Member.label) == string) || is(typeof(Member.label()) == string); static if (hasText || hasContent || hasLabel) { enum member = hasText ? "text" : hasContent ? "content" : hasLabel ? "label" : null; widgetTextHandlers[memberName] = (Widget widget, string text) { auto w = cast(Member)widget; assert(w, "Called widget text handler with widget of type " ~ typeid(widget).name ~ " but it was registered for " ~ memberName ~ " which is incompatible"); mixin("w.", member, " = w.", member, " ~ text;"); }; } // TODO: might want to check for child methods/structs that register as child nodes } } } /// Widget makeWidgetFromString(string xml, Widget parent) { auto document = new Document(xml, true, true); auto r = document.root; return miniguiWidgetFromXml(r, parent); } /// Window createWindowFromXml(string xml) { return createWindowFromXml(new Document(xml, true, true)); } /// Window createWindowFromXml(Document document) { auto r = document.root; return cast(Window) miniguiWidgetFromXml(r, null); } /// Widget miniguiWidgetFromXml(Element element, Widget parent) { Widget w; miniguiWidgetFromXml(element, parent, w); return w; } /// ParseContinue miniguiWidgetFromXml(Element element, Widget parent, out Widget w) { assert(widgetFactoryFunctions !is null, "No widget factories have been registered, register them using initMinigui!(arsd.minigui); at startup"); if (auto factory = element.tagName in widgetFactoryFunctions) { auto c = (*factory)(parent, element, w); if (c == ParseContinue.recurse) { c = ParseContinue.next; Widget dummy; foreach (child; element.children) if (miniguiWidgetFromXml(child, w, dummy) == ParseContinue.abort) { c = ParseContinue.abort; break; } } return c; } else if (element.tagName == "#text") { string text = element.nodeValue.strip; if (text.length) { assert(parent, "got xml text without parent, make sure you only pass elements!"); if (auto factory = parent.elementName in widgetTextHandlers) (*factory)(parent, text); else { import std.stdio : stderr; stderr.writeln("WARN: no text handler for widget ", parent.elementName, " ~= ", [text]); } } return ParseContinue.next; } else { enforce(false, "Unknown tag " ~ element.tagName); assert(false); } } string elementName(Widget w) { if (w is null) return null; auto name = typeid(w).name; foreach_reverse (i, char c; name) if (c == '.') return name[i + 1 .. $]; return name; }
D
module userauth.services.twitter; import userauth.api; class GoogleAuthService : UserAuthService { string generateAuthMixin() { assert(false); } void registerRoutes(UrlRouter router, string path_prefix) { assert(false); } }
D
// import std.c.time; import std.stdio; import std.concurrency; import core.time; import std.algorithm; import std.random; struct CancelMessage {} struct Noeud { Tid tid; // thread_ID int lid; // logical_ID } void receiveAllFinalization(Noeud [] childTid) { for (int i = 0; i < childTid.length; ++i) { receiveOnly!CancelMessage(); } } void spawnedFunc(int myId, int n) { Noeud neighbor, localNeighbor; int[] vectHorloge = new int[n]; for (int i = 0; i < n; i++) { vectHorloge[i] = 0; } int scalHorloge = 1; vectHorloge[myId] = 1; writeln("Child process: I am number ", myId, ", my scalHorloge is ", scalHorloge); writeln("Child process: I am number ", myId, ", my vectHorloge is ", vectHorloge); // waiting for the reception of information sent by the father receive((immutable(Noeud) neighbor) { localNeighbor = cast(Noeud)neighbor; }); scalHorloge++; vectHorloge[myId]++; writeln("Child process: I am number ", myId, ", my scalHorloge is ", scalHorloge); writeln("Child process: I am number ", myId, ", my vectHorloge is ", vectHorloge); // WORK: print your id and your neighbor id writeln("Child process: I am number ", myId, ", my neighbor id is ", localNeighbor.lid); if (myId == 3) { // Noeud initiateur du comptage send(localNeighbor.tid, 1, scalHorloge, cast(shared) new int[1]); // Le noeud 3 envoie 1 à son voisin } // Comptage for (int t = 0; t < 2; t++) { // 0 -> comptage en cours, 1 -> comptage terminé if (myId == 3 && t == 0) { continue; // Déjà fait avec le send } receive((int count, int precScalHorloge, shared int[] precVectHorloge) { scalHorloge = max(++scalHorloge, ++precScalHorloge); for (int i = 0; i < precVectHorloge.length; i++) { if (precVectHorloge[i] > vectHorloge[i]) { vectHorloge[i] = precVectHorloge[i]; } } vectHorloge[myId]++; string compteMsg = t == 0 ? ", le compte en est à " : ", le compte final en est à "; writeln("Child process: I am number ", myId, compteMsg, count); writeln("Child process: I am number ", myId, ", my scalHorloge is ", scalHorloge); writeln("Child process: I am number ", myId, ", my vectHorloge is ", vectHorloge); send(localNeighbor.tid, t == 0 ? ++count : count, scalHorloge, cast(shared) vectHorloge); // Continue de compter OU communique le compte }); } // Avec cette technique il y a 2 * n messages échangés pour compter les noeuds // end of your code send(ownerTid, CancelMessage()); } int[] getRandomIds(int n) { int[] ids = new int[n]; Random random = Random(unpredictableSeed); // prod // Random random = Random(42); // debug for (int i = 0; i < n; ++i) { ids[i] = i; } ids = ids.randomShuffle(random); writeln("ids ", ids); return ids; } void main() { // number of child processes int n = 10; // int n = 32678; // core.thread.threadbase.ThreadError@src/core/thread/threadbase.d(1219): Error creating thread // int n = 32677; // Fonctionne // spawn threads (child processes) Noeud[] childTid = new Noeud[n]; int[] ids = getRandomIds(n); for (int i = 0; i < n; ++i) { childTid[i].tid = spawn(&spawnedFunc, ids[i], n); childTid[i].lid = ids[i]; } // create an unidirectional ring for (int i = 0; i < n; ++i) { // id of neighbor // WORK: correct this part of code const int nextIndex = (i + 1) % n; // Question 2 // const int nextId = ids[nextIndex]; // end of your code immutable(Noeud) id_suiv = cast(immutable)childTid[nextIndex]; // send id_suiv to childTid[i].tid send(childTid[i].tid, id_suiv); } // wait for all completions receiveAllFinalization(childTid); }
D
module fluentd.bundle.bytecode.interpreter; import fluentd.bundle.compiled_bundle: CompiledPattern; import fluentd.bundle.errors: isErrorHandler; import fluentd.bundle.value; string format(EH)(CompiledPattern pattern, scope const Value[string] args, scope EH onError) if (isErrorHandler!EH) in { assert(onError !is null, "Error handler must not be `null`"); } do { import std.traits: isUnsafe; import fluentd.bundle.bytecode.interpreter.vm: execute; static if (isUnsafe!({ onError(); })) () @system { }(); return execute(pattern.bundle, pattern.address, args, () @trusted { onError(); }); } string format(EH)(CompiledPattern pattern, scope EH onError) if (isErrorHandler!EH) { return format(pattern, null, onError); }
D
// PERMUTE_ARGS: -inline template compiles(int T) { bool compiles = true; } alias TypeTuple(T...) = T; /************************************************** 3901 Arbitrary struct assignment, ref return **************************************************/ struct ArrayRet { int x; } int arrayRetTest(int z) { ArrayRet[6] w; int q = (w[3].x = z); return q; } static assert(arrayRetTest(51) == 51); // Bugzilla 3842 -- must not segfault int ice3842(int z) { ArrayRet w; return arrayRetTest((*(&w)).x); } static assert(true || is(typeof(compiles!(ice3842(51))))); int arrayret2() { int[5] a; int[3] b; b[] = a[1 .. $-1] = 5; return b[1]; } static assert(arrayret2() == 5); struct DotVarTest { ArrayRet z; } struct DotVarTest2 { ArrayRet z; DotVarTest p; } int dotvar1() { DotVarTest w; w.z.x = 3; return w.z.x; } static assert(dotvar1() == 3); int dotvar2() { DotVarTest2[4] m; m[2].z.x = 3; m[1].p.z.x = 5; return m[2].z.x + 7; } static assert(dotvar2() == 10); struct RetRefStruct { int x; char c; } // Return value reference tests, for D2 only. ref RetRefStruct reffunc1(ref RetRefStruct a) { int y = a.x; return a; } ref RetRefStruct reffunc2(ref RetRefStruct a) { RetRefStruct z = a; return reffunc1(a); } ref int reffunc7(ref RetRefStruct aa) { return reffunc1(aa).x; } ref int reffunc3(ref int a) { return a; } struct RefTestStruct { RetRefStruct r; ref RefTestStruct reffunc4(ref RetRefStruct[3] a) { return this; } ref int reffunc6() { return this.r.x; } } ref RetRefStruct reffunc5(ref RetRefStruct[3] a) { int t = 1; for (int i = 0; i < 10; ++i) { if (i == 7) ++t; } return a[reffunc3(t)]; } int retRefTest1() { RetRefStruct b = RetRefStruct(0, 'a'); reffunc1(b).x = 3; return b.x - 1; } int retRefTest2() { RetRefStruct b = RetRefStruct(0, 'a'); reffunc2(b).x = 3; RetRefStruct[3] z; RefTestStruct w; w.reffunc4(z).reffunc4(z).r.x = 4; assert(w.r.x == 4); w.reffunc6() = 218; assert(w.r.x == 218); z[2].x = 3; int q = 4; int u = reffunc5(z).x + reffunc3(q); assert(u == 7); reffunc5(z).x += 7; assert(z[2].x == 10); RetRefStruct m = RetRefStruct(7, 'c'); m.x = 6; reffunc7(m) += 3; assert(m.x == 9); return b.x - 1; } int retRefTest3() { RetRefStruct b = RetRefStruct(0, 'a'); auto deleg = function (RetRefStruct a){ return a; }; typeof(deleg)[3] z; z[] = deleg; auto y = deleg(b).x + 27; b.x = 5; assert(y == 27); y = z[1](b).x + 22; return y - 1; } int retRefTest4() { RetRefStruct b = RetRefStruct(0, 'a'); reffunc3(b.x) = 218; assert(b.x == 218); return b.x; } static assert(retRefTest1() == 2); static assert(retRefTest2() == 2); static assert(retRefTest3() == 26); static assert(retRefTest4() == 218); /************************************************** Bug 7887 assign to returned reference **************************************************/ bool test7887() { ref int f(ref int x) { return x; } int a; f(a) = 42; return (a == 42); } static assert(test7887()); /************************************************** Bug 7473 struct non-ref **************************************************/ struct S7473 { int i; } static assert({ S7473 s = S7473(1); assert(s.i == 1); bug7473(s); assert(s.i == 1); return true; }()); void bug7473(S7473 s) { s.i = 2; } struct S7473b { S7473 m; } static assert({ S7473b s = S7473b(S7473(7)); assert(s.m.i == 7); bug7473b(s); assert(s.m.i == 7); return true; }()); void bug7473b(S7473b s) { s.m.i = 2; } /************************************************** Bug 4389 **************************************************/ int bug4389() { string s; dchar c = '\u2348'; s ~= c; assert(s.length == 3); dchar d = 'D'; s ~= d; assert(s.length == 4); s = ""; s ~= c; assert(s.length == 3); s ~= d; assert(s.length == 4); string z; wchar w = '\u0300'; z ~= w; assert(z.length == 2); z = ""; z ~= w; assert(z.length == 2); return 1; } static assert(bug4389()); // ICE(constfold.c) int ice4389() { string s; dchar c = '\u2348'; s ~= c; s = s ~ "xxx"; return 1; } static assert(ice4389()); // ICE(expression.c) string ice4390() { string s; dchar c = '`'; s ~= c; s ~= c; return s; } static assert(mixin(ice4390()) == ``); // bug 5248 (D1 + D2) struct Leaf5248 { string Compile_not_ovloaded() { return "expression"; } } struct Matrix5248 { Leaf5248 Right; string Compile() { return Right.Compile_not_ovloaded(); } }; static assert(Matrix5248().Compile()); /************************************************** 4837 >>>= **************************************************/ bool bug4837() { ushort x = 0x89AB; x >>>= 4; assert(x == 0x89A); byte y = 0x7C; y >>>= 2; assert(y == 0x1F); return true; } static assert(bug4837()); /************************************************** 10252 shift out of range **************************************************/ int lshr10252(int shift) { int a = 5; return a << shift; } int rshr10252(int shift) { int a = 5; return a >> shift; } int ushr10252(int shift) { int a = 5; return a >>> shift; } static assert( is(typeof(compiles!(lshr10252( 4))))); static assert(!is(typeof(compiles!(lshr10252(60))))); static assert( is(typeof(compiles!(rshr10252( 4))))); static assert(!is(typeof(compiles!(rshr10252(80))))); static assert( is(typeof(compiles!(ushr10252( 2))))); static assert(!is(typeof(compiles!(ushr10252(60))))); /************************************************** 1982 CTFE null problems **************************************************/ enum a1982 = [1, 2, 3]; static assert(a1982 !is null); string foo1982() { return null; } static assert(foo1982() is null); static assert(!foo1982().length); static assert(null is null); /************************************************** 7988 CTFE return values should be allowed in compile-time expressions **************************************************/ class X7988 { int y; this() { y = 2; } } static assert((new X7988).y == 2); /************************************************** 8253 ICE: calling of member function of non-CTFE class variable **************************************************/ class Bug8253 { bool j() { return true; } } Bug8253 m8253; static assert(!is(typeof(compiles!(m8253.j())))); /************************************************** 8285 Issue with slice returned from CTFE function **************************************************/ string foo8285() { string s = "ab"; return s[0 .. $]; } template T8285b(string s) { } template T8285a() { enum s = foo8285(); alias T8285b!(s) t2; } int bar8285() { alias T8285a!() t1; return 0; } int baz8285(int x) { return 0; } static assert(baz8285(bar8285()) == 0); // test case 2 string xbar8285() { string s = "ab"; return s[0 .. $]; } template xT8285a() { enum xT8285a = xbar8285()[0 .. $]; } string xbaz8285() { return xT8285a!(); } string xfoo8285(string s) { return s; } static assert(xfoo8285(xbaz8285()) == "ab"); /************************************************** 'this' parameter bug revealed during refactoring **************************************************/ int thisbug1(int x) { return x; } struct ThisBug1 { int m = 1; int wut() { return thisbug1(m); } } int thisbug2() { ThisBug1 spec; return spec.wut(); } static assert(thisbug2()); /************************************************** 6972 ICE with cast()cast()assign **************************************************/ int bug6972() { ubyte n = 6; n /= 2u; return n; } static assert(bug6972() == 3); /************************************************** Bug 6164 **************************************************/ size_t bug6164() { int[] ctfe2(int n) { int[] r = []; if (n != 0) r ~= [1] ~ ctfe2(n - 1); return r; } return ctfe2(2).length; } static assert(bug6164() == 2); /************************************************** Interpreter code coverage tests **************************************************/ int cov1(int a) { a %= 15382; a /= 5; a = ~ a; bool c = (a == 0); bool b = true && c; assert(b == 0); b = false && c; assert(b == 0); b = false || c; assert(b == 0); a ^= 0x45349; a = ~ a; a &= 0xFF3F; a >>>= 1; a = a ^ 0x7393; a = a >> 1; a = a >>> 1; a = a | 0x010101; return a; } static assert(cov1(534564) == 71589); int cov2() { int i = 0; do { goto DOLABEL; DOLABEL: if (i != 0) { goto IFLABEL; IFLABEL: switch(i) { case 3: break; case 6: goto SWITCHLABEL; SWITCHLABEL: i = 27; goto case 3; default: assert(0); } return i; } i = 6; } while(true); return 88; // unreachable } static assert(cov2() == 27); template CovTuple(T...) { alias T CovTuple; } alias CovTuple!(int, long) TCov3; int cov3(TCov3 t) { TCov3 s; s = t; assert(s[0] == 1); assert(s[1] == 2); return 7; } static assert(cov3(1, 2) == 7); int badassert1(int z) { assert(z == 5, "xyz"); return 1; } size_t badslice1(int[] z) { return z[0 .. 3].length; } size_t badslice2(int[] z) { return z[0 .. badassert1(1)].length; } size_t badslice3(int[] z) { return z[badassert1(1) .. 2].length; } static assert(!is(typeof(compiles!(badassert1(67))))); static assert( is(typeof(compiles!(badassert1(5))))); static assert(!is(typeof(compiles!(badslice1([1,2]))))); static assert(!is(typeof(compiles!(badslice2([1,2]))))); static assert(!is(typeof(compiles!(badslice3([1,2,3]))))); /*******************************************/ int bug7894() { for (int k = 0; k < 2; ++k) { goto Lagain; Lagain: ; } int m = 1; do { ++m; goto Ldo; Ldo: ; } while (m < 3); assert(m == 3); return 1; } static assert(bug7894()); /*******************************************/ size_t bug5524(int x, int[] more...) { int[0] zz; assert(zz.length == 0); return 7 + more.length + x; } static assert(bug5524(3) == 10); // 5722 static assert(("" ~ "\&copy;"[0]).length == 1); const char[] null5722 = null; static assert((null5722 ~ "\&copy;"[0]).length == 1); static assert(("\&copy;"[0] ~ null5722).length == 1); /******************************************* * Tests for CTFE Array support. * Including bugs 1330, 3801, 3835, 4050, * 4051, 5147, and major functionality *******************************************/ char[] bug1330StringIndex() { char[] blah = "foo".dup; assert(blah == "foo"); char[] s = blah[0 .. 2]; blah[0] = 'h'; assert(s == "ho"); s[0] = 'm'; return blah; } static assert(bug1330StringIndex() == "moo"); static assert(bug1330StringIndex() == "moo"); // check we haven't clobbered any string literals int[] bug1330ArrayIndex() { int[] blah = [1,2,3]; int[] s = blah; s = blah[0 .. 2]; int z = blah[0] = 6; assert(z == 6); assert(blah[0] == 6); assert(s[0] == 6); assert(s == [6, 2]); s[1] = 4; assert(z == 6); return blah; } static assert(bug1330ArrayIndex() == [6, 4, 3]); static assert(bug1330ArrayIndex() == [6, 4, 3]); // check we haven't clobbered any literals char[] bug1330StringSliceAssign() { char[] blah = "food".dup; assert(blah == "food"); char[] s = blah[1 .. 4]; blah[0 .. 2] = "hc"; assert(s == "cod"); s[0 .. 2] = ['a', 'b']; // Mix string + array literal assert(blah == "habd"); s[0 .. 2] = "mq"; return blah; } static assert(bug1330StringSliceAssign() == "hmqd"); static assert(bug1330StringSliceAssign() == "hmqd"); int[] bug1330ArraySliceAssign() { int[] blah = [1, 2, 3, 4]; int[] s = blah[1 .. 4]; blah[0 .. 2] = [7, 9]; assert(s == [9, 3, 4]); s[0 .. 2] = [8, 15]; return blah; } static assert(bug1330ArraySliceAssign() == [7, 8, 15, 4]); int[] bug1330ArrayBlockAssign() { int[] blah = [1, 2, 3, 4, 5]; int[] s = blah[1 .. 4]; blah[0 .. 2] = 17; assert(s == [17, 3, 4]); s[0 .. 2] = 9; return blah; } static assert(bug1330ArrayBlockAssign() == [17, 9, 9, 4, 5]); char[] bug1330StringBlockAssign() { char[] blah = "abcde".dup; char[] s = blah[1 .. 4]; blah[0 .. 2] = 'x'; assert(s == "xcd"); s[0 .. 2] = 'y'; return blah; } static assert(bug1330StringBlockAssign() == "xyyde"); int assignAA(int x) { int[int] aa; int[int] cc = aa; assert(cc.values.length == 0); assert(cc.keys.length == 0); aa[1] = 2; aa[x] = 6; int[int] bb = aa; assert(bb.keys.length == 2); assert(cc.keys.length == 0); // cc is not affected to aa, because it is null aa[500] = 65; assert(bb.keys.length == 3); // but bb is affected by changes to aa return aa[1] + aa[x]; } static assert(assignAA(12) == 8); template Compileable(int z) { bool OK; } int arraybounds(int j, int k) { int[] xxx = [1, 2, 3, 4, 5]; int[] s = xxx[1 .. $]; s = s[j .. k]; // slice of slice return s[$ - 1]; } static assert(!is(typeof(Compileable!(arraybounds(1, 14))))); static assert(!is(typeof(Compileable!(arraybounds(15, 3))))); static assert(arraybounds(2, 4) == 5); int arraybounds2(int j, int k) { int[] xxx = [1, 2, 3, 4, 5]; int[] s = xxx[j .. k]; // direct slice return 1; } static assert(!is(typeof(Compileable!(arraybounds2(1, 14))))); static assert(!is(typeof(Compileable!(arraybounds2(15, 3))))); static assert(arraybounds2(2, 4) == 1); int bug5147a() { int[1][2] a = 37; return a[0][0]; } static assert(bug5147a() == 37); int bug5147b() { int[4][2][3][17] a = 37; return a[0][0][0][0]; } static assert(bug5147b() == 37); int setlen() { int[][] zzz; zzz.length = 2; zzz[0].length = 10; assert(zzz.length == 2); assert(zzz[0].length == 10); assert(zzz[1].length == 0); return 2; } static assert(setlen() == 2); int[1][1] bug5147() { int[1][1] a = 1; return a; } static assert(bug5147() == [[1]]); enum int[1][1] enum5147 = bug5147(); static assert(enum5147 == [[1]]); immutable int[1][1] bug5147imm = bug5147(); // Index referencing int[2][2] indexref1() { int[2][2] a = 2; a[0] = 7; int[][] b = [null, null]; b[0 .. $] = a[0][0 .. 2]; assert(b[0][0] == 7); assert(b[0][1] == 7); int[] w; w = a[0]; assert(w[0] == 7); w[0 .. $] = 5; assert(a[0] != [7, 7]); assert(a[0] == [5, 5]); assert(b[0] == [5, 5]); return a; } int[2][2] indexref2() { int[2][2] a = 2; a[0] = 7; int[][2] b = null; b[0 .. $] = a[0]; assert(b[0][0] == 7); assert(b[0][1] == 7); assert(b == [[7, 7], [7, 7]]); int[] w; w = a[0]; assert(w[0] == 7); w[0 .. $] = 5; assert(a[0] != [7, 7]); assert(a[0] == [5, 5]); assert(b[0] == [5, 5]); return a; } int[2][2] indexref3() { int[2][2] a = 2; a[0]=7; int[][2] b = [null, null]; b[0 .. $] = a[0]; assert(b[0][0] == 7); assert(b[0][1] == 7); int[] w; w = a[0]; assert(w[0] == 7); w[0 .. $] = 5; assert(a[0] != [7, 7]); assert(a[0] == [5, 5]); assert(b[0] == [5, 5]); return a; } int[2][2] indexref4() { int[2][2] a = 2; a[0] = 7; int[][2] b =[[1, 2, 3], [1, 2, 3]]; // wrong code b[0] = a[0]; assert(b[0][0] == 7); assert(b[0][1] == 7); int[] w; w = a[0]; //[0 .. $]; assert(w[0] == 7); w[0 .. $] = 5; assert(a[0] != [7, 7]); assert(a[0] == [5, 5]); assert(b[0] == [5, 5]); return a; } static assert(indexref1() == [[5, 5], [2, 2]]); static assert(indexref2() == [[5, 5], [2, 2]]); static assert(indexref3() == [[5, 5], [2, 2]]); static assert(indexref4() == [[5, 5], [2, 2]]); int staticdynamic() { int[2][1] a = 2; assert(a == [[2, 2]]); int[][1] b = a[0][0 .. 1]; assert(b[0] == [2]); auto k = b[0]; auto m = a[0][0 .. 1]; assert(k == [2]); assert(m == k); return 0; } static assert(staticdynamic() == 0); int[] crashing() { int[12] cra; return (cra[2 .. $] = 3); } static assert(crashing()[9] == 3); int chainassign() { int[4] x = 6; int[] y = new int[4]; auto k = (y[] = (x[] = 2)); return k[0]; } static assert(chainassign() == 2); // index assignment struct S3801 { char c; int[3] arr; this(int x, int y) { c = 'x'; arr[0] = x; arr[1] = y; } } int bug3801() { S3801 xxx = S3801(17, 67); int[] w = xxx.arr; xxx.arr[1] = 89; assert(xxx.arr[0] == 17); assert(w[1] == 89); assert(w == [17, 89, 0]); return xxx.arr[1]; } enum : S3801 { bug3801e = S3801(17, 18) } static assert(bug3801e.arr == [17, 18, 0]); immutable S3801 bug3801u = S3801(17, 18); static assert(bug3801u.arr == [17, 18, 0]); static assert(bug3801() == 89); int bug3835() { int[4] arr; arr[] = 19; arr[0] = 4; int kk; foreach (ref el; arr) { el += 10; kk = el; } assert(arr[2] == 29); arr[0] += 3; return arr[0]; } static assert(bug3835() == 17); auto bug5852(const(string) s) { string[] r; r ~= s; assert(r.length == 1); return r[0].length; } static assert(bug5852("abc") == 3); // 7217 struct S7217 { int[] arr; } bool f7217() { auto s = S7217(); auto t = s.arr; return true; } static assert(f7217()); /******************************************* Set array length *******************************************/ static assert( { struct W { int[] z; } W w; w.z.length = 2; assert(w.z.length == 2); w.z.length = 6; assert(w.z.length == 6); return true; }()); // 7185 char[].length = n bool bug7185() { auto arr = new char[2]; auto arr2 = new char[2]; arr2[] = "ab"; arr.length = 1; arr2.length = 7; assert(arr.length == 1); assert(arr2.length == 7); assert(arr2[0 .. 2] == "ab"); return true; } static assert(bug7185()); bool bug9908() { static const int[3] sa = 1; return sa == [1, 1, 1]; } static assert(bug9908()); /******************************************* 6934 *******************************************/ struct Struct6934 { int[] x = [1, 2]; } void bar6934(ref int[] p) { p[0] = 12; assert(p[0] == 12); p[0 .. 1] = 17; assert(p[0] == 17); p = p[1 .. $]; } int bug6934() { Struct6934 q; bar6934(q.x); int[][] y = [[2, 5], [3, 6, 8]]; bar6934(y[0]); return 1; } static assert(bug6934()); /******************************************* Bug 5671 *******************************************/ static assert(['a', 'b'] ~ "c" == "abc"); /******************************************* 8624 *******************************************/ int evil8624() { long m = 0x1_0000_0000L; assert(m != 0); long[] a = [0x1_0000_0000L]; long[] b = [0x4_0000_0000L]; assert(a[] != b[]); return 1; } static assert(evil8624()); /******************************************* 8644 array literal >,< *******************************************/ int bug8644() { auto m = "a"; auto z = ['b']; auto c = "b7"; auto d = ['b', '6']; assert(m < z); assert(z > m); assert(z <= c); assert(c > z); assert(c > d); assert(d >= d); return true; } static assert(bug8644()); /******************************************* Bug 6159 *******************************************/ struct A6159 {} static assert({ return A6159.init is A6159.init; }()); static assert({ return [1] is [1]; }()); /******************************************* Bug 5685 *******************************************/ string bug5685() { return "xxx"; } struct Bug5865 { void test1() { enum file2 = (bug5685())[0 .. $]; } } /******************************************* 6235 - Regression ICE on $ in template *******************************************/ struct Bug6235(R) { enum XXX = is(typeof(R.init[0 .. $]) : const ubyte[]); } Bug6235!(ubyte[]) bug6235; /******************************************* 8673 ICE *******************************************/ enum dollar8673 = [0][(() => $ - 1)()]; /******************************************* Bug 5840 *******************************************/ struct Bug5840 { string g; int w; } int bug5840(int u) { // check for clobbering Bug5840 x = void; x.w = 4; x.g = "3gs"; if (u == 1) bug5840(2); if (u == 2) { x.g = "abc"; x.w = 3465; } else { assert(x.g == "3gs"); assert(x.w == 4); } return 56; } static assert(bug5840(1) == 56); /******************************************* 7810 *******************************************/ int bug7810() { int[1][3] x = void; x[0] = [2]; x[1] = [7]; assert(x[0][0] == 2); char[1][3] y = void; y[0] = "a"; y[1] = "b"; assert(y[0][0] == 'a'); return 1; } static assert(bug7810()); struct Bug7810 { int w; } int bug7810b(T)(T[] items...) { assert(items[0] == Bug7810(20)); return 42; } static assert(bug7810b(Bug7810(20), Bug7810(10)) == 42); /******************************************* std.datetime ICE (30 April 2011) *******************************************/ struct TimeOfDayZ { public: this(int hour) { } invariant() { } } const testTODsThrownZ = TimeOfDayZ(0); /******************************************* Bug 5954 *******************************************/ struct Bug5954 { int x; this(int xx) { this.x = xx; } } void bug5954() { enum f = Bug5954(10); static assert(f.x == 10); } /******************************************* Bug 5972 *******************************************/ int bug5972() { char[] z = "abc".dup; char[][] a = [null, null]; a[0] = z[0 .. 2]; char[] b = a[0]; assert(b == "ab"); a[0][1] = 'q'; assert(a[0] == "aq"); assert(b == "aq"); assert(b[1] == 'q'); //a[0][0 .. $ - 1][0 .. $] = a[0][0 .. $ - 1][0 .. $]; // overlap return 56; } static assert(bug5972() == 56); /******************************************* 2.053beta [CTFE]ICE 'global errors' *******************************************/ int wconcat(wstring replace) { wstring value; value = "A"w; value = value ~ replace; return 1; } static assert(wconcat("X"w)); /******************************************* 10397 string concat *******************************************/ static assert(!is(typeof(compiles!("abc" ~ undefined)))); static assert(!is(typeof(compiles!(otherundefined ~ "abc")))); /******************************************* 9634 struct concat *******************************************/ struct Bug9634 { int raw; } bool bug9634() { Bug9634[] jr = [Bug9634(42)]; Bug9634[] ir = null ~ jr; Bug9634[] kr = jr ~ null; Bug9634[] mr = jr ~ jr; jr[0].raw = 6; assert(ir[0].raw == 42); assert(kr[0].raw == 42); assert(jr[0].raw == 6); assert(&mr[0] != &mr[1]); return true; } static assert(bug9634()); /******************************************* Bug 4001: A Space Oddity *******************************************/ int space() { return 4001; } void oddity4001(int q) { const int bowie = space(); static assert(space() == 4001); static assert(bowie == 4001); } /******************************************* Bug 3779 *******************************************/ static const bug3779 = ["123"][0][$ - 1]; /******************************************* Bug 8893 ICE with bad struct literal *******************************************/ struct Foo8893 { char[3] data; } int bar8893(Foo8893 f) { return f.data[0]; } static assert(!is(typeof(compiles!(bar8893(Foo8893(['a','b'])))))); /******************************************* non-Cow struct literals *******************************************/ struct Zadok { int[3] z; char[4] s = void; ref int[] fog(ref int[] q) { return q; } int bfg() { z[0] = 56; auto zs = z[]; fog(zs) = [56, 6, 8]; assert(z[0] == 56); assert(z[1] == 61); assert(z[2] == 61); assert(zs[0] == 56); assert(zs[1] == 6); return zs[2]; } } struct Vug { Zadok p; int[] other; } int quop() { int[] heap = new int[5]; heap[] = 738; Zadok pong; pong.z = 3; int[] w = pong.z; assert(w[0] == 3); Zadok phong; phong.z = 61; pong = phong; assert(w[0] == 61); Vug b = Vug(Zadok(17, "abcd")); b = Vug(Zadok(17, "abcd"), heap); b.other[2] = 78; assert(heap[2] == 78); char[] y = b.p.s; assert(y[2] == 'c'); phong.s = ['z','x','f', 'g']; w = b.p.z; assert(y[2] == 'c'); assert(w[0] == 17); b.p = phong; assert(y[2] == 'f'); Zadok wok = Zadok(6, "xyzw"); b.p = wok; assert(y[2] == 'z'); b.p = phong; assert(w[0] == 61); Vug q; q.p = pong; return pong.bfg(); } static assert(quop() == 8); static assert(quop() == 8); // check for clobbering /************************************************** Bug 5676 tuple assign of struct that has void opAssign **************************************************/ struct S5676 { int x; void opAssign(S5676 rhs) { x = rhs.x; } } struct Tup5676(E...) { E g; void foo(E values) { g = values; } } bool ice5676() { Tup5676!(S5676) q; q.foo(S5676(3)); assert(q.g[0].x == 3); return true; } static assert(ice5676()); /************************************************** Bug 5682 Wrong CTFE with operator overloading **************************************************/ struct A { int n; auto opBinary(string op : "*")(A rhs) { return A(n * rhs.n); } } A foo(A[] lhs, A[] rhs) { A current; for (size_t k = 0; k < rhs.length; ++k) { current = lhs[k] * rhs[k]; } return current; } auto test() { return foo([A(1), A(2)], [A(3), A(4)]); } static assert(test().n == 8); /************************************************** Attempt to modify a read-only string literal **************************************************/ struct Xarg { char[] s; } int zfs(int n) { char[] m = "exy".dup; if (n == 1) { // it's OK to cast to const, then cast back string ss = cast(string)m; m = cast(char[])ss; m[2]='q'; return 56; } auto q = Xarg(cast(char[])"abc"); assert(q.s[1] == 'b'); if (n == 2) q.s[1] = 'p'; else if (n == 3) q.s[0 .. $] = 'p'; char* w = &q.s[2]; if (n == 4) *w = 'z'; return 76; } static assert(!is(typeof(compiles!(zfs(2))))); static assert(!is(typeof(compiles!(zfs(3))))); static assert(!is(typeof(compiles!(zfs(4))))); static assert( is(typeof(compiles!(zfs(1))))); static assert( is(typeof(compiles!(zfs(5))))); /************************************************** .dup must protect string literals **************************************************/ string mutateTheImmutable(immutable string _s) { char[] s = _s.dup; foreach (ref c; s) c = 'x'; return s.idup; } string doharm(immutable string _name) { return mutateTheImmutable(_name[2 .. $].idup); } enum victimLiteral = "CL_INVALID_CONTEXT"; enum thug = doharm(victimLiteral); static assert(victimLiteral == "CL_INVALID_CONTEXT"); /************************************************** Use $ in a slice of a dotvar slice **************************************************/ int sliceDollar() { Xarg z; z.s = new char[20]; z.s[] = 'b'; z.s = z.s[2 .. $ - 2]; z.s[$ - 2] = 'c'; return z.s[$ - 2]; } static assert(sliceDollar() == 'c'); /************************************************** Variation of 5972 which caused segfault **************************************************/ int bug5972crash() { char[] z = "abc".dup; char[][] a = [null, null]; a[0] = z[0 .. 2]; a[0][1] = 'q'; return 56; } static assert(bug5972crash() == 56); /************************************************** String slice assignment through ref parameter **************************************************/ void popft(A)(ref A a) { a = a[1 .. $]; } int sdfgasf() { auto scp = "abc".dup; popft(scp); return 1; } static assert(sdfgasf() == 1); /************************************************** 8830 slice of slice.ptr **************************************************/ string bug8830(string s) { auto ss = s[1 .. $]; return ss.ptr[0 .. 2]; } static assert(bug8830("hello") == "el"); /************************************************** 8608 ICE **************************************************/ void bug8608(ref int m) {} void test8608() { int z; int foo(bool b) { if (b) bug8608(z); return 1; } static assert( is(typeof(compiles!(foo(false))))); static assert(!is(typeof(compiles!(foo(true) )))); } /************************************************** Bug 7770 **************************************************/ immutable char[] foo7770 = "abcde"; int bug7770a(string a) { return 1; } bool bug7770b(char c) { return true; } static assert(bug7770a(foo7770[0 .. $])); static assert(bug7770b(foo7770[$ - 2])); void baz7770() { static assert(bug7770a(foo7770[0 .. $])); static assert(bug7770b(foo7770[$ - 2])); } /************************************************** 8601 ICE **************************************************/ dchar bug8601(dstring s) { dstring w = s[1 .. $]; return w[0]; } enum dstring e8601 = [cast(dchar)'o', 'n']; static assert(bug8601(e8601) == 'n'); /************************************************** Bug 6015 **************************************************/ struct Foo6015 { string field; } bool func6015(string input) { Foo6015 foo; foo.field = input[0 .. $]; assert(foo.field == "test"); foo.field = "test2"; assert(foo.field != "test"); assert(foo.field == "test2"); return true; } static assert(func6015("test")); /************************************************** Bug 6001 **************************************************/ void bug6001e(ref int[] s) { int[] r = s; s ~= 0; } bool bug6001f() { int[] s; bug6001e(s); return true; } static assert(bug6001f()); // Assignment to AAs void blah(int[char] as) { auto k = [6: as]; as = k[6]; } int blaz() { int[char] q; blah(q); return 67; } static assert(blaz() == 67); void bug6001g(ref int[] w) { w = [88]; bug6001e(w); w[0] = 23; } bool bug6001h() { int[] s; bug6001g(s); assert(s.length == 2); assert(s[1] == 0); assert(s[0] == 23); return true; } static assert(bug6001h()); /************************************************** 10243 wrong code *&arr as ref parameter 10551 wrong code (&arr)[0] as ref parameter **************************************************/ void bug10243(ref int n) { n = 3; } void bug10551(int* p) { bug10243(p[0]); } bool test10243() { int[1] arr; bug10243(*arr.ptr); assert(arr[0] == 3); int[1] arr2; bug10551(arr2.ptr); assert(arr2[0] == 3); int v; bug10551(&v); assert(v == 3); return true; } static assert(test10243()); /************************************************** Bug 4910 **************************************************/ int bug4910(int a) { return a; } static int var4910; static assert(!is(typeof(Compiles!(bug4910(var4910))))); static assert(bug4910(123)); /************************************************** Bug 5845 - Regression(2.041) **************************************************/ void test5845(ulong cols) {} uint solve(bool niv, ref ulong cols) { if (niv) solve(false, cols); else test5845(cols); return 65; } ulong nqueen(int n) { ulong cols = 0; return solve(true, cols); } static assert(nqueen(2) == 65); /************************************************** Bug 5258 **************************************************/ struct Foo5258 { int x; } void bar5258(int n, ref Foo5258 fong) { if (n) bar5258(n - 1, fong); else fong.x++; } int bug5258() { Foo5258 foo5258 = Foo5258(); bar5258(1, foo5258); return 45; } static assert(bug5258() == 45); struct Foo5258b { int[2] r; } void baqopY(int n, ref int[2] fongo) { if (n) baqopY(n - 1, fongo); else fongo[0]++; } int bug5258b() { Foo5258b qq; baqopY(1, qq.r); return 618; } static assert(bug5258b() == 618); // Notice that this case involving reassigning the dynamic array struct Foo5258c { int[] r; } void baqop(int n, ref int[] fongo) { if (n) baqop(n - 1, fongo); else { fongo = new int[20]; fongo[0]++; } } size_t bug5258c() { Foo5258c qq; qq.r = new int[30]; baqop(1, qq.r); return qq.r.length; } static assert(bug5258c() == 20); /************************************************** Bug 6049 **************************************************/ struct Bug6049 { int m; this(int x) { m = x; } invariant() { } } const Bug6049[] foo6049 = [Bug6049(6), Bug6049(17)]; static assert(foo6049[0].m == 6); /************************************************** Bug 6052 **************************************************/ struct Bug6052 { int a; } bool bug6052() { Bug6052[2] arr; for (int i = 0; i < 2; ++ i) { Bug6052 el = {i}; Bug6052 ek = el; arr[i] = el; el.a = i + 2; assert(ek.a == i); // ok assert(arr[i].a == i); // fail } assert(arr[1].a == 1); // ok assert(arr[0].a == 0); // fail return true; } static assert(bug6052()); bool bug6052b() { int[][1] arr; int[1] z = [7]; arr[0] = z; assert(arr[0][0] == 7); arr[0] = z; z[0] = 3; assert(arr[0][0] == 3); return true; } static assert(bug6052b()); struct Bug6052c { int x; this(int a) { x = a; } } int bug6052c() { Bug6052c[] pieces = []; for (int c = 0; c < 2; ++ c) pieces ~= Bug6052c(c); assert(pieces[1].x == 1); assert(pieces[0].x == 0); return 1; } static assert(bug6052c() == 1); static assert(bug6052c() == 1); static assert({ Bug6052c[] pieces = []; pieces.length = 2; int c = 0; pieces[0] = Bug6052c(c); ++c; pieces[1] = Bug6052c(c); assert(pieces[0].x == 0); return true; }()); static assert({ int[1][] pieces = []; pieces.length = 2; for (int c = 0; c < 2; ++ c) pieces[c][0] = c; assert(pieces[1][0] == 1); assert(pieces[0][0] == 0); return true; }()); static assert({ Bug6052c[] pieces = []; for (int c = 0; c < 2; ++ c) pieces ~= Bug6052c(c); assert(pieces[1].x == 1); assert(pieces[0].x == 0); return true; }()); static assert({ int[1] z = 7; int[1][] pieces = [z,z]; pieces[1][0]=3; assert(pieces[0][0] == 7); pieces = pieces ~ [z,z]; pieces[3][0] = 16; assert(pieces[2][0] == 7); pieces = [z,z] ~ pieces; pieces[5][0] = 16; assert(pieces[4][0] == 7); return true; }()); /************************************************** Bug 6749 **************************************************/ struct CtState { string code; } CtState bug6749() { CtState[] pieces; CtState r = CtState("correct"); pieces ~= r; r = CtState("clobbered"); return pieces[0]; } static assert(bug6749().code == "correct"); /************************************************** Index + slice assign to function returns **************************************************/ int[] funcRetArr(int[] a) { return a; } int testFuncRetAssign() { int[] x = new int[20]; funcRetArr(x)[2] = 4; assert(x[2] == 4); funcRetArr(x)[] = 27; assert(x[15] == 27); return 5; } static assert(testFuncRetAssign() == 5); int keyAssign() { int[int] pieces; pieces[3] = 1; pieces.keys[0] = 4; pieces.values[0] = 27; assert(pieces[3] == 1); return 5; } static assert(keyAssign() == 5); /************************************************** Bug 6054 -- AA literals **************************************************/ enum x6054 = { auto p = { int[string] pieces; pieces[['a'].idup] = 1; return pieces; }(); return p; }(); /************************************************** Bug 6077 **************************************************/ enum bug6077 = { string s; string t; return s ~ t; }(); /************************************************** Bug 6078 -- Pass null array by ref **************************************************/ struct Foo6078 { int[] bar; } static assert({ Foo6078 f; int i; foreach (ref e; f.bar) { i += e; } return i; }() == 0); int bug6078(ref int[] z) { int[] q = z; return 2; } static assert({ Foo6078 f; return bug6078(f.bar); }() == 2); /************************************************** Bug 6079 -- Array bounds checking **************************************************/ static assert(!is(typeof(compiles!({ int[] x = [1, 2, 3, 4]; x[4] = 1; return true; }() )))); /************************************************** Bug 6100 **************************************************/ struct S6100 { int a; } S6100 init6100(int x) { S6100 s = S6100(x); return s; } static const S6100[2] s6100a = [init6100(1), init6100(2)]; static assert(s6100a[0].a == 1); /************************************************** Bug 4825 -- failed with -inline **************************************************/ int a4825() { int r; return r; } int b4825() { return a4825(); } void c4825() { void d() { auto e = b4825(); } static const int f = b4825(); } /************************************************** Bug 5708 -- failed with -inline **************************************************/ string b5708(string s) { return s; } string a5708(string s) { return b5708(s); } void bug5708() { void m() { a5708("lit"); } static assert(a5708("foo") == "foo"); static assert(a5708("bar") == "bar"); } /************************************************** Bug 6120 -- failed with -inline **************************************************/ struct Bug6120(T) { this(int x) { } } static assert({ auto s = Bug6120!int(0); return true; }()); /************************************************** Bug 6123 -- failed with -inline **************************************************/ struct Bug6123(T) { void f() {} // can also trigger if the struct is normal but f is template } static assert({ auto piece = Bug6123!int(); piece.f(); return true; }()); /************************************************** Bug 6053 -- ICE involving pointers **************************************************/ static assert({ int* a = null; assert(a is null); assert(a == null); return true; }()); static assert({ int b; int* a = &b; assert(a !is null); *a = 7; assert(b == 7); assert(*a == 7); return true; }()); int dontbreak6053() { auto q = &dontbreak6053; void caz() {} auto tr = &caz; return 5; } static assert(dontbreak6053()); static assert({ int a; *(&a) = 15; assert(a == 15); assert(*(&a) == 15); return true; }()); static assert({ int a = 5, b = 6, c = 2; assert(*(c ? &a : &b) == 5); assert(*(!c ? &a : &b) == 6); return true; }()); static assert({ int a, b, c; (c ? a : b) = 1; return true; }()); static assert({ int a, b, c = 1; int* p = &a; (c ? *p : b) = 51; assert(a == 51); return true; }()); /************************************************** Pointer arithmetic, dereference, and comparison **************************************************/ // dereference null pointer static assert(!is(typeof(compiles!({ int a, b, c = 1; int* p; (c ? *p : b) = 51; return 6; }() )))); static assert(!is(typeof(compiles!({ int* a = null; assert(*a != 6); return 72; }() )))); // cannot <, > compare pointers to different arrays static assert(!is(typeof(compiles!({ int[5] a, b; bool c = (&a[0] > &b[0]); return 72; }() )))); // can ==, is, !is, != compare pointers for different arrays static assert({ int[5] a; int[5] b; assert(!(&a[0] == &b[0])); assert(&a[0] != &b[0]); assert(!(&a[0] is &b[0])); assert(&a[0] !is &b[0]); return 72; }()); static assert({ int[5] a; a[0] = 25; a[1] = 5; int* b = &a[1]; assert(*b == 5); *b = 34; int c = *b; *b += 6; assert(b == &a[1]); assert(b != &a[0]); assert(&a[0] < &a[1]); assert(&a[0] <= &a[1]); assert(!(&a[0] >= &a[1])); assert(&a[4] > &a[0]); assert(c == 34); assert(*b == 40); assert(a[1] == 40); return true; }()); static assert({ int[12] x; int* p = &x[10]; int* q = &x[4]; return p - q; }() == 6); static assert({ int[12] x; int* p = &x[10]; int* q = &x[4]; q = p; assert(p == q); q = &x[4]; assert(p != q); q = q + 6; assert(q is p); return 6; }() == 6); static assert({ int[12] x; int[] y = x[2 .. 8]; int* p = &y[4]; int* q = &x[6]; assert(p == q); p = &y[5]; assert(p > q); p = p + 5; // OK, as long as we don't dereference assert(p > q); return 6; }() == 6); static assert({ char[12] x; const(char)* p = "abcdef"; const (char)* q = p; q = q + 2; assert(*q == 'c'); assert(q > p); assert(q - p == 2); assert(p - q == -2); q = &x[7]; p = &x[1]; assert(q>p); return 6; }() == 6); // Relations involving null pointers bool nullptrcmp() { // null tests void* null1 = null, null2 = null; int x = 2; void* p = &x; assert(null1 == null2); assert(null1 is null2); assert(null1 <= null2); assert(null1 >= null2); assert(!(null1 > null2)); assert(!(null2 > null1)); assert(null1 != p); assert(null1 !is p); assert(p != null1); assert(p !is null1); assert(null1 <= p); assert(p >= null2); assert(p > null1); assert(!(null1 > p)); return true; } static assert(nullptrcmp()); /************************************************** 10840 null pointer in dotvar **************************************************/ struct Data10840 { bool xxx; } struct Bug10840 { Data10840* _data; } bool bug10840(int n) { Bug10840 stack; if (n == 1) { // detect deref through null pointer return stack._data.xxx; } // Wrong-code for ?: return stack._data ? false : true; } static assert(bug10840(0)); static assert(!is(typeof(Compileable!(bug10840(1))))); /************************************************** 8216 ptr inside a pointer range **************************************************/ // Four-pointer relations. Return true if [p1 .. p2] points inside [q1 .. q2] // (where the end points dont coincide). bool ptr4cmp(void* p1, void* p2, void* q1, void* q2) { // Each compare can be written with <, <=, >, or >=. // Either && or || can be used, giving 32 permutations. // Additionally each compare can be negated with !, yielding 128 in total. bool b1 = (p1 > q1 && p2 <= q2); bool b2 = (p1 > q1 && p2 < q2); bool b3 = (p1 >= q1 && p2 <= q2); bool b4 = (p1 >= q1 && p2 < q2); bool b5 = (q1 <= p1 && q2 > p2); bool b6 = (q1 <= p1 && q2 >= p2); bool b7 = (p2 <= q2 && p1 > q1); bool b8 = (!(p1 <= q1) && p2 <= q2); bool b9 = (!(p1 <= q1) && !(p2 > q2)); bool b10 = (!!!(p1 <= q1) && !(p2 > q2)); assert(b1 == b2 && b1 == b3 && b1 == b4 && b1 == b5 && b1 == b6); assert(b1 == b7 && b1 == b8 && b1 == b9 && b1 == b10); bool c1 = (p1 <= q1 || p2 > q2); assert(c1 == !b1); bool c2 = (p1 < q1 || p2 >= q2); bool c3 = (!(q1 <= p1) || !(q2 >= p2)); assert(c1 == c2 && c1 == c3); return b1; } bool bug8216() { int[4] a; int[13] b; int v; int* p = &v; assert(!ptr4cmp(&a[0], &a[3], p, p)); assert(!ptr4cmp(&b[2], &b[9], &a[1], &a[2])); assert(!ptr4cmp(&b[1], &b[9], &b[2], &b[8])); assert( ptr4cmp(&b[2], &b[8], &b[1], &b[9])); return 1; } static assert(bug8216()); /************************************************** 6517 ptr++, ptr-- **************************************************/ int bug6517() { int[] arr = [1, 2, 3]; auto startp = arr.ptr; auto endp = arr.ptr + arr.length; for (; startp < endp; startp++) {} startp = arr.ptr; assert(startp++ == arr.ptr); assert(startp != arr.ptr); assert(startp-- != arr.ptr); assert(startp == arr.ptr); return 84; } static assert(bug6517() == 84); /************************************************** Out-of-bounds pointer assignment and deference **************************************************/ int ptrDeref(int ofs, bool wantDeref) { int[5] a; int* b = &a[0]; b = b + ofs; // OK if (wantDeref) return *b; // out of bounds return 72; } static assert(!is(typeof(compiles!(ptrDeref(-1, true))))); static assert( is(typeof(compiles!(ptrDeref(4, true))))); static assert( is(typeof(compiles!(ptrDeref(5, false))))); static assert(!is(typeof(compiles!(ptrDeref(5, true))))); static assert(!is(typeof(compiles!(ptrDeref(6, false))))); static assert(!is(typeof(compiles!(ptrDeref(6, true))))); /************************************************** Pointer += **************************************************/ static assert({ int[12] x; int zzz; assert(&zzz); int* p = &x[10]; int* q = &x[4]; q = p; assert(p == q); q = &x[4]; assert(p != q); q += 4; assert(q == &x[8]); q = q - 2; q = q + 4; assert(q is p); return 6; }() == 6); /************************************************** Reduced version of bug 5615 **************************************************/ const(char)[] passthrough(const(char)[] x) { return x; } sizediff_t checkPass(Char1)(const(Char1)[] s) { const(Char1)[] balance = s[1 .. $]; return passthrough(balance).ptr - s.ptr; } static assert(checkPass("foobar") == 1); /************************************************** Pointers must not escape from CTFE **************************************************/ struct Toq { const(char)* m; } Toq ptrRet(bool b) { string x = "abc"; return Toq(b ? x[0 .. 1].ptr : null); } static assert(is(typeof(compiles!({ enum Toq boz = ptrRet(false); // OK - ptr is null Toq z = ptrRet(true); // OK -- ptr doesn't escape return 4; }() )))); static assert(!is(typeof(compiles!({ enum Toq boz = ptrRet(true); // fail - ptr escapes return 4; }() )))); /************************************************** Pointers to struct members **************************************************/ struct Qoz { int w; int[3] yof; } static assert({ int[3] gaz; gaz[2] = 3156; Toq z = ptrRet(true); auto p = z.m; assert(*z.m == 'a'); assert(*p == 'a'); auto q = &z.m; assert(*q == p); assert(**q == 'a'); Qoz g = Qoz(2, [5, 6, 7]); auto r = &g.w; assert(*r == 2); r = &g.yof[1]; assert(*r == 6); g.yof[0] = 15; ++r; assert(*r == 7); r -= 2; assert(*r == 15); r = &gaz[0]; r += 2; assert(*r == 3156); return *p; }() == 'a'); struct AList { AList* next; int value; static AList* newList() { AList[] z = new AList[1]; return &z[0]; } static AList* make(int i, int j) { auto r = newList(); r.next = (new AList[1]).ptr; r.value = 1; AList* z = r.next; (*z).value = 2; r.next.value = j; assert(r.value == 1); assert(r.next.value == 2); r.next.next = &(new AList[1])[0]; assert(r.next.next != null); assert(r.next.next); r.next.next.value = 3; assert(r.next.next.value == 3); r.next.next = newList(); r.next.next.value = 9; return r; } static int checkList() { auto r = make(1,2); assert(r.value == 1); assert(r.next.value == 2); assert(r.next.next.value == 9); return 2; } } static assert(AList.checkList() == 2); /************************************************** 7194 pointers as struct members **************************************************/ struct S7194 { int* p, p2; } int f7194() { assert(S7194().p == null); assert(!S7194().p); assert(S7194().p == S7194().p2); S7194 s = S7194(); assert(!s.p); assert(s.p == null); assert(s.p == s.p2); int x; s.p = &x; s.p2 = s.p; assert(s.p == &x); return 0; } int g7194() { auto s = S7194(); assert(s.p); // should fail return 0; } static assert(f7194() == 0); static assert(!is(typeof(compiles!(g7194())))); /************************************************** 7248 recursive struct pointers in array **************************************************/ struct S7248 { S7248* ptr; } bool bug7248() { S7248[2] sarr; sarr[0].ptr = &sarr[1]; sarr[0].ptr = null; S7248* t = sarr[0].ptr; return true; } static assert(bug7248()); /************************************************** 7216 calling a struct pointer member **************************************************/ struct S7216 { S7216* p; int t; void f() { } void g() { ++t; } } bool bug7216() { S7216 s0, s1; s1.t = 6; s0.p = &s1; s0.p.f(); s0.p.g(); assert(s1.t == 7); return true; } static assert(bug7216()); /************************************************** 10858 Wrong code with array of pointers **************************************************/ bool bug10858() { int*[4] x; x[0] = null; assert(x[0] == null); return true; } static assert(bug10858()); /************************************************** 12528 - painting inout type for value type literals **************************************************/ inout(T)[] dup12528(T)(inout(T)[] a) { inout(T)[] res; foreach (ref e; a) res ~= e; return res; } enum arr12528V1 = dup12528([0]); enum arr12528V2 = dup12528([0, 1]); static assert(arr12528V1 == [0]); static assert(arr12528V2 == [0, 1]); enum arr12528C1 = dup12528([new immutable Object]); enum arr12528C2 = dup12528([new immutable Object, new immutable Object]); static assert(arr12528C1.length == 1); static assert(arr12528C2.length == 2 && arr12528C2[0] !is arr12528C2[1]); /************************************************** 9745 Allow pointers to static variables **************************************************/ shared int x9745; shared int[5] y9745; shared(int)* bug9745(int m) { auto k = &x9745; auto j = &x9745; auto p = &y9745[0]; auto q = &y9745[3]; assert(j - k == 0); assert(j == k); assert(q - p == 3); --q; int a = 0; assert(p + 2 == q); if (m == 7) { auto z1 = y9745[0 .. 2]; // slice global pointer } if (m == 8) p[1] = 7; // modify through a pointer if (m == 9) a = p[1]; // read from a pointer if (m == 0) return &x9745; return &y9745[1]; } int test9745(int m) { bug9745(m); // type painting shared int* w = bug9745(0); return 1; } shared int* w9745a = bug9745(0); shared int* w9745b = bug9745(1); static assert( is(typeof(compiles!(test9745(6))))); static assert(!is(typeof(compiles!(test9745(7))))); static assert(!is(typeof(compiles!(test9745(8))))); static assert(!is(typeof(compiles!(test9745(9))))); // pointers cast from an absolute address // (mostly applies to fake pointers, eg Windows HANDLES) bool test9745b() { void* b6 = cast(void*)0xFEFEFEFE; void* b7 = cast(void*)0xFEFEFEFF; assert(b6 is b6); assert(b7 != b6); return true; } static assert(test9745b()); /************************************************** 9364 ICE with pointer to local struct **************************************************/ struct S9364 { int i; } bool bug9364() { S9364 s; auto k = (&s).i; return 1; } static assert(bug9364()); /************************************************** 10251 Pointers to const globals **************************************************/ static const int glob10251 = 7; const(int)* bug10251() { return &glob10251; } static a10251 = &glob10251; // OK static b10251 = bug10251(); /************************************************** 4065 [CTFE] AA "in" operator doesn't work **************************************************/ bool bug4065(string s) { enum int[string] aa = ["aa":14, "bb":2]; int* p = s in aa; if (s == "aa") assert(*p == 14); else if (s == "bb") assert(*p == 2); else assert(!p); int[string] zz; assert(!("xx" in zz)); bool c = !p; return cast(bool)(s in aa); } static assert(!bug4065("xx")); static assert( bug4065("aa")); static assert( bug4065("bb")); /************************************************** 12689 - assigning via pointer from 'in' expression **************************************************/ int g12689() { int[int] aa; aa[1] = 13; assert(*(1 in aa) == 13); *(1 in aa) = 42; return aa[1]; } static assert(g12689() == 42); /************************************************** Pointers in ? : **************************************************/ static assert({ int[2] x; int* p = &x[1]; return p ? true: false; }()); /************************************************** Pointer slicing **************************************************/ int ptrSlice() { auto arr = new int[5]; int* x = &arr[0]; int[] y = x[0 .. 5]; x[1 .. 3] = 6; ++x; x[1 .. 3] = 14; assert(arr[1] == 6); assert(arr[2] == 14); //x[-1 .. 4] = 5; // problematic because negative lower boundary will throw RangeError in runtime (x - 1)[0 .. 3] = 5; int[] z = arr[1 .. 2]; z.length = 4; z[$ - 1] = 17; assert(arr.length == 5); return 2; } static assert(ptrSlice() == 2); /************************************************** 6344 - create empty slice from null pointer **************************************************/ static assert({ char* c = null; auto m = c[0 .. 0]; return true; }()); /************************************************** 8365 - block assignment of enum arrays **************************************************/ enum E8365 { first = 7, second, third, fourth } static assert({ E8365[2] x; return x[0]; }() == E8365.first); static assert({ E8365[2][2] x; return x[0][0]; }() == E8365.first); static assert({ E8365[2][2][2] x; return x[0][0][0]; }() == E8365.first); /************************************************** 4448 - labelled break + continue **************************************************/ int bug4448() { int n = 2; L1: do { switch(n) { case 5: return 7; default: n = 5; break L1; } int w = 7; } while (0); return 3; } static assert(bug4448() == 3); int bug4448b() { int n = 2; L1: for (n = 2; n < 5; ++n) { for (int m = 1; m < 6; ++m) { if (n < 3) { assert(m == 1); continue L1; } } break; } return 3; } static assert(bug4448b() == 3); /************************************************** 6985 - non-constant case **************************************************/ int bug6985(int z) { int q = z * 2 - 6; switch(z) { case q: q = 87; break; default: } return q; } static assert(bug6985(6) == 87); /************************************************** 6281 - [CTFE] A null pointer '!is null' returns 'true' **************************************************/ static assert(!{ auto p = null; return p !is null; }()); static assert(!{ auto p = null; return p != null; }()); /************************************************** 6331 - evaluate SliceExp on if condition **************************************************/ bool bug6331(string s) { if (s[0 .. 1]) return true; return false; } static assert(bug6331("str")); /************************************************** 6283 - assign to AA with slice as index **************************************************/ static assert({ immutable p = "pp"; int[string] pieces = [p: 0]; pieces["qq"] = 1; return true; }()); static assert({ immutable renames = [0: "pp"]; int[string] pieces; pieces[true ? renames[0] : "qq"] = 1; pieces["anything"] = 1; return true; }()); static assert({ immutable qq = "qq"; string q = qq; int[string] pieces = ["a":1]; pieces[q] = 0; string w = "ab"; int z = pieces[w[0 .. 1]]; assert(z == 1); return true; }()); /************************************************** 6282 - dereference 'in' of an AA **************************************************/ static assert({ int[] w = new int[4]; w[2] = 6; auto c = [5: w]; auto kk = (*(5 in c))[2]; (*(5 in c))[2] = 8; (*(5 in c))[1 .. $ - 2] = 4; auto a = [4:"1"]; auto n = *(4 in a); return n; }() == "1"); /************************************************** 6337 - member function call on struct literal **************************************************/ struct Bug6337 { int k; void six() { k = 6; } int ctfe() { six(); return k; } } static assert(Bug6337().ctfe() == 6); /************************************************** 6603 call manifest function pointer **************************************************/ int f6603(int a) { return a + 5; } enum bug6603 = &f6603; static assert(bug6603(6) == 11); /************************************************** 6375 **************************************************/ struct D6375 { int[] arr; } A6375 a6375(int[] array) { return A6375(array); } struct A6375 { D6375* _data; this(int[] arr) { _data = new D6375; _data.arr = arr; } int[] data() { return _data.arr; } } static assert({ int[] a = [1, 2]; auto app2 = a6375(a); auto data = app2.data(); return true; }()); /************************************************** 6280 Converting pointers to bool **************************************************/ static assert({ if ((0 in [0:0])) {} if ((0 in [0:0]) && (0 in [0:0])) {} return true; }()); /************************************************** 6276 ~= **************************************************/ struct Bug6276 { int[] i; } static assert({ Bug6276 foo; foo.i ~= 1; foo.i ~= 2; return true; }()); /************************************************** 6374 ptr[n] = x, x = ptr[n] **************************************************/ static assert({ int[] arr = [1]; arr.ptr[0] = 2; auto k = arr.ptr[0]; assert(k == 2); return arr[0]; }() == 2); /************************************************** 6306 recursion and local variables **************************************************/ void recurse6306() { bug6306(false); } bool bug6306(bool b) { int x = 0; if (b) recurse6306(); assert(x == 0); x = 1; return true; } static assert(bug6306(true)); /************************************************** 6386 ICE on unsafe pointer cast **************************************************/ static assert(!is(typeof(compiles!({ int x = 123; int* p = &x; float z; float* q = cast(float*)p; return true; }() )))); static assert({ int[] x = [123, 456]; int* p = &x[0]; auto m = cast(const(int)*)p; auto q = p; return *q; }()); /************************************************** 6420 ICE on dereference of invalid pointer **************************************************/ static assert({ // Should compile, but pointer can't be dereferenced int x = 123; int* p = cast(int*)x; auto q = cast(char*)x; auto r = cast(char*)323; // Valid const-changing cast const float *m = cast(immutable float*)[1.2f,2.4f,3f]; return true; }() ); static assert(!is(typeof(compiles!({ int x = 123; int* p = cast(int*)x; int a = *p; return true; }() )))); static assert(!is(typeof(compiles!({ int* p = cast(int*)123; int a = *p; return true; }() )))); static assert(!is(typeof(compiles!({ auto k = cast(int*)45; *k = 1; return true; }() )))); static assert(!is(typeof(compiles!({ *cast(float*)"a" = 4.0; return true; }() )))); static assert(!is(typeof(compiles!({ float f = 2.8; long *p = &f; return true; }() )))); static assert(!is(typeof(compiles!({ long *p = cast(long*)[1.2f, 2.4f, 3f]; return true; }() )))); /************************************************** 6250 deref pointers to array **************************************************/ int[]* simple6250(int[]* x) { return x; } void swap6250(int[]* lhs, int[]* rhs) { int[] kk = *lhs; assert(simple6250(lhs) == lhs); lhs = simple6250(lhs); assert(kk[0] == 18); assert((*lhs)[0] == 18); assert((*rhs)[0] == 19); *lhs = *rhs; assert((*lhs)[0] == 19); *rhs = kk; assert(*rhs == kk); assert(kk[0] == 18); assert((*rhs)[0] == 18); } int ctfeSort6250() { int[][2] x; int[3] a = [17, 18, 19]; x[0] = a[1 .. 2]; x[1] = a[2 .. $]; assert(x[0][0] == 18); assert(x[0][1] == 19); swap6250(&x[0], &x[1]); assert(x[0][0] == 19); assert(x[1][0] == 18); a[1] = 57; assert(x[0][0] == 19); return x[1][0]; } static assert(ctfeSort6250() == 57); /************************************************** 6672 circular references in array **************************************************/ void bug6672(ref string lhs, ref string rhs) { auto tmp = lhs; lhs = rhs; rhs = tmp; } static assert({ auto kw = ["a"]; bug6672(kw[0], kw[0]); return true; }()); void slice6672(ref string[2] agg, ref string lhs) { agg[0 .. $] = lhs; } static assert({ string[2] kw = ["a", "b"]; slice6672(kw, kw[0]); assert(kw[0] == "a"); assert(kw[1] == "a"); return true; }()); // an unrelated rejects-valid bug static assert({ string[2] kw = ["a", "b"]; kw[0 .. 2] = "x"; return true; }()); void bug6672b(ref string lhs, ref string rhs) { auto tmp = lhs; assert(tmp == "a"); lhs = rhs; assert(tmp == "a"); rhs = tmp; } static assert({ auto kw=["a", "b"]; bug6672b(kw[0], kw[1]); assert(kw[0] == "b"); assert(kw[1] == "a"); return true; }()); /************************************************** 6399 (*p).length = n **************************************************/ struct A6399 { int[] arr; int subLen() { arr = [1, 2, 3, 4, 5]; arr.length -= 1; return cast(int)arr.length; } } static assert({ A6399 a; return a.subLen(); }() == 4); /************************************************** 7789 (*p).length++ where *p is null **************************************************/ struct S7789 { size_t foo() { _ary.length += 1; return _ary.length; } int[] _ary; } static assert(S7789().foo()); /************************************************** 6418 member named 'length' **************************************************/ struct Bug6418 { size_t length() { return 189; } } static assert(Bug6418.init.length == 189); /************************************************** 4021 rehash **************************************************/ bool bug4021() { int[int] aa = [1: 1]; aa.rehash; return true; } static assert(bug4021()); /************************************************** 11629 crash on AA.rehash **************************************************/ struct Base11629 { alias T = ubyte, Char = char; alias String = immutable(Char)[]; const Char[T] toChar; this(int _dummy) { Char[T] toCharTmp = [0:'A']; toChar = toCharTmp.rehash; } } enum ct11629 = Base11629(4); /************************************************** 3512 foreach (dchar; string) 6558 foreach (int, dchar; string) **************************************************/ bool test3512() { string s = "öhai"; int q = 0; foreach (wchar c; s) { if (q == 2) assert(c == 'a'); ++q; } assert(q == 4); // _aApplycd1 foreach (dchar c; s) { ++q; if (c == 'h') break; } assert(q == 6); // _aApplycw2 foreach (int i, wchar c; s) { assert(i >= 0 && i < s.length); } // _aApplycd2 foreach (int i, dchar c; s) { assert(i >= 0 && i < s.length); } wstring w = "xüm"; // _aApplywc1 foreach (char c; w) { ++q; } assert(q == 10); // _aApplywd1 foreach (dchar c; w) { ++q; } assert(q == 13); // _aApplywc2 foreach (int i, char c; w) { assert(i >= 0 && i < w.length); } // _aApplywd2 foreach (int i, dchar c; w) { assert(i >= 0 && i < w.length); } dstring d = "yäq"; // _aApplydc1 q = 0; foreach (char c; d) { ++q; } assert(q == 4); // _aApplydw1 q = 0; foreach (wchar c; d) { ++q; } assert(q == 3); // _aApplydc2 foreach (int i, char c; d) { assert(i >= 0 && i < d.length); } // _aApplydw2 foreach (int i, wchar c; d) { assert(i >= 0 && i < d.length); } dchar[] dr = "squop"d.dup; foreach (int n, char c; dr) { if (n == 2) break; assert(c != 'o'); } // _aApplyRdc1 foreach_reverse (char c; dr) {} // _aApplyRdw1 foreach_reverse (wchar c; dr) {} // _aApplyRdc2 foreach_reverse (int n, char c; dr) { if (n == 4) break; assert(c != 'o'); } // _aApplyRdw2 foreach_reverse (int i, wchar c; dr) { assert(i >= 0 && i < dr.length); } q = 0; wstring w2 = ['x', 'ü', 'm']; // foreach over array literals foreach_reverse (int n, char c; w2) { ++q; if (c == 'm') assert(n == 2 && q == 1); if (c == 'x') assert(n == 0 && q == 4); } return true; } static assert(test3512()); /************************************************** 6510 ICE only with -inline **************************************************/ struct Stack6510 { struct Proxy { void shrink() {} } Proxy stack; void pop() { stack.shrink(); } } int bug6510() { static int used() { Stack6510 junk; junk.pop(); return 3; } return used(); } void test6510() { static assert(bug6510() == 3); } /************************************************** 6511 arr[] shouldn't make a copy **************************************************/ T bug6511(T)() { T[1] a = [1]; a[] += a[]; return a[0]; } static assert(bug6511!ulong() == 2); static assert(bug6511!long() == 2); /************************************************** 6512 new T[][] **************************************************/ bool bug6512(int m) { auto x = new int[2][][](m, 5); assert(x.length == m); assert(x[0].length == 5); assert(x[0][0].length == 2); foreach (i; 0.. m) foreach (j; 0 .. 5) foreach (k; 0 .. 2) x[i][j][k] = k + j*10 + i*100; foreach (i; 0.. m) foreach (j; 0 .. 5) foreach (k; 0 .. 2) assert(x[i][j][k] == k + j*10 + i*100); return true; } static assert(bug6512(3)); /************************************************** 6516 ICE(constfold.c) **************************************************/ dstring bug6516() { return cast(dstring)new dchar[](0); } static assert(bug6516() == ""d); /************************************************** 6727 ICE(interpret.c) **************************************************/ const(char)* ice6727(const(char)* z) { return z; } static assert({ auto q = ice6727("a".dup.ptr); return true; }()); /************************************************** 6721 Cannot get pointer to start of char[] **************************************************/ static assert({ char[] c1 = "".dup; auto p = c1.ptr; string c2 = ""; auto p2 = c2.ptr; return 6; }() == 6); /************************************************** 6693 Assign to null AA **************************************************/ struct S6693 { int[int] m; } static assert({ int[int][int] aaa; aaa[3][1] = 4; int[int][3] aab; aab[2][1] = 4; S6693 s; s.m[2] = 4; return 6693; }() == 6693); /************************************************** 7602 Segfault AA.keys on null AA **************************************************/ string[] test7602() { int[string] array; return array.keys; } enum bug7602 = test7602(); /************************************************** 6739 Nested AA assignment **************************************************/ static assert({ int[int][int][int] aaa; aaa[3][1][6] = 14; return aaa[3][1][6]; }() == 14); static assert({ int[int][int] aaa; aaa[3][1] = 4; aaa[3][3] = 3; aaa[1][5] = 9; auto kk = aaa[1][5]; return kk; }() == 9); /************************************************** 6751 ref AA assignment **************************************************/ void bug6751(ref int[int] aa) { aa[1] = 2; } static assert({ int[int] aa; bug6751(aa); assert(aa[1] == 2); return true; }()); void bug6751b(ref int[int][int] aa) { aa[1][17] = 2; } struct S6751 { int[int][int] aa; int[int] bb; } static assert({ S6751 s; bug6751b(s.aa); assert(s.aa[1][17] == 2); return true; }()); static assert({ S6751 s; s.aa[7][56] = 57; bug6751b(s.aa); assert(s.aa[1][17] == 2); assert(s.aa[7][56] == 57); bug6751c(s.aa); assert(s.aa.keys.length == 1); assert(s.aa.values.length == 1); return true; }()); static assert({ S6751 s; s.bb[19] = 97; bug6751(s.bb); assert(s.bb[1] == 2); assert(s.bb[19] == 97); return true; }()); void bug6751c(ref int[int][int] aa) { aa = [38: [56 : 77]]; } /************************************************** 7790 AA foreach ref **************************************************/ struct S7790 { size_t id; } size_t bug7790(S7790[string] tree) { foreach (k, ref v; tree) v.id = 1; return tree["a"].id; } static assert(bug7790(["a":S7790(0)]) == 1); /************************************************** 6765 null AA.length **************************************************/ static assert({ int[int] w; return w.length; }() == 0); /************************************************** 6769 AA.keys, AA.values with -inline **************************************************/ static assert({ double[char[3]] w = ["abc" : 2.3]; double[] z = w.values; return w.keys.length; }() == 1); /************************************************** 4022 AA.get **************************************************/ static assert({ int[int] aa = [58: 13]; int r = aa.get(58, 1000); assert(r == 13); r = aa.get(59, 1000); return r; }() == 1000); /************************************************** 6775 AA.opApply **************************************************/ static assert({ int[int] aa = [58: 17, 45:6]; int valsum = 0; int keysum = 0; foreach (m; aa) // aaApply { valsum += m; } assert(valsum == 17 + 6); valsum = 0; foreach (n, m; aa) // aaApply2 { valsum += m; keysum += n; } assert(valsum == 17 + 6); assert(keysum == 58 + 45); // Check empty AA valsum = 0; int[int] bb; foreach (m; bb) { ++valsum; } assert(valsum == 0); return true; }()); /************************************************** 7890 segfault struct with AA field **************************************************/ struct S7890 { int[int] tab; } S7890 bug7890() { S7890 foo; foo.tab[0] = 0; return foo; } enum e7890 = bug7890(); /************************************************** AA.remove **************************************************/ static assert({ int[int] aa = [58: 17, 45:6]; aa.remove(45); assert(aa.length == 1); aa.remove(7); assert(aa.length == 1); aa.remove(58); assert(aa.length == 0); return true; }()); /************************************************** try, finally **************************************************/ static assert({ int n = 0; try { n = 1; } catch (Exception e) {} assert(n == 1); try { n = 2; } catch (Exception e) {} finally { assert(n == 2); n = 3; } assert(n == 3); return true; }()); /************************************************** 6800 bad pointer casts **************************************************/ bool badpointer(int k) { int m = 6; int* w = &m; assert(*w == 6); int[3] a = [17, 2, 21]; int* w2 = &a[2]; assert(*w2 == 21); // cast int* to uint* is OK uint* u1 = cast(uint*)w; assert(*u1 == 6); uint* u2 = cast(uint*)w2; assert(*u2 == 21); uint* u3 = cast(uint*)&m; assert(*u3 == 6); // cast int* to void* is OK void* v1 = cast(void*)w; void* v3 = &m; void* v4 = &a[0]; // cast from void* back to int* is OK int* t3 = cast(int*)v3; assert(*t3 == 6); int* t4 = cast(int*)v4; assert(*t4 == 17); // cast from void* to uint* is OK uint* t1 = cast(uint*)v1; assert(*t1 == 6); // and check that they're real pointers m = 18; assert(*t1 == 18); assert(*u3 == 18); int** p = &w; if (k == 1) // bad reinterpret double *d1 = cast(double*)w; if (k == 3) // bad reinterpret char* d3 = cast(char*)w2; if (k == 4) { void* q1 = cast(void*)p; // OK-void is int* void* *q = cast(void**)p; // OK-void is int } if (k == 5) void*** q = cast(void***)p; // bad: too many * if (k == 6) // bad reinterpret through void* double* d1 = cast(double*)v1; if (k == 7) double* d7 = cast(double*)v4; if (k == 8) ++v4; // can't do pointer arithmetic on void* return true; } static assert(badpointer(4)); static assert(!is(typeof(compiles!(badpointer(1))))); static assert( is(typeof(compiles!(badpointer(2))))); static assert(!is(typeof(compiles!(badpointer(3))))); static assert( is(typeof(compiles!(badpointer(4))))); static assert(!is(typeof(compiles!(badpointer(5))))); static assert(!is(typeof(compiles!(badpointer(6))))); static assert(!is(typeof(compiles!(badpointer(7))))); static assert(!is(typeof(compiles!(badpointer(8))))); /************************************************** 10211 Allow casts S**->D**, when S*->D* is OK **************************************************/ int bug10211() { int m = 7; int* x = &m; int** y = &x; assert(**y == 7); uint* p = cast(uint*)x; uint** q = cast(uint**)y; return 1; } static assert(bug10211()); /************************************************** 10568 CTFE rejects function pointer safety casts **************************************************/ @safe void safetyDance() {} int isItSafeToDance() { void function() @trusted yourfriends = &safetyDance; void function() @safe nofriendsOfMine = yourfriends; return 1; } static assert(isItSafeToDance()); /************************************************** 12296 CTFE rejects const compatible AA pointer cast **************************************************/ int test12296() { immutable x = [5 : 4]; auto aa = &x; const(int[int])* y = aa; return 1; } static assert(test12296()); /************************************************** 9170 Allow reinterpret casts float<->int **************************************************/ int f9170(float x) { return *(cast(int*)&x); } float i9170(int x) { return *(cast(float*)&x); } float u9170(uint x) { return *(cast(float*)&x); } int f9170arr(float[] x) { return *(cast(int*)&(x[1])); } long d9170(double x) { return *(cast(long*)&x); } int fref9170(ref float x) { return *(cast(int*)&x); } long dref9170(ref double x) { return *(cast(long*)&x); } bool bug9170() { float f = 1.25; double d = 1.25; assert(f9170(f) == 0x3FA0_0000); assert(fref9170(f) == 0x3FA0_0000); assert(d9170(d) == 0x3FF4_0000_0000_0000L); assert(dref9170(d) == 0x3FF4_0000_0000_0000L); float [3] farr = [0, 1.25, 0]; assert(f9170arr(farr) == 0x3FA0_0000); int i = 0x3FA0_0000; assert(i9170(i) == 1.25); uint u = 0x3FA0_0000; assert(u9170(u) == 1.25); return true; } static assert(bug9170()); /************************************************** 6792 ICE with pointer cast of indexed array **************************************************/ struct S6792 { int i; } static assert({ { void* p; p = [S6792(1)].ptr; S6792 s = *(cast(S6792*)p); assert(s.i == 1); } { void*[] ary; ary ~= [S6792(2)].ptr; S6792 s = *(cast(S6792*)ary[0]); assert(s.i == 2); } { void*[7] ary; ary[6]= [S6792(2)].ptr; S6792 s = *(cast(S6792*)ary[6]); assert(s.i == 2); } { void* p; p = [S6792(1)].ptr; void*[7] ary; ary[5]= p; S6792 s = *(cast(S6792*)ary[5]); assert(s.i == 1); } { S6792*[string] aa; aa["key"] = [S6792(3)].ptr; const(S6792) s = *(cast(const(S6792)*)aa["key"]); assert(s.i == 3); } { S6792[string] blah; blah["abc"] = S6792(6); S6792*[string] aa; aa["kuy"] = &blah["abc"]; const(S6792) s = *(cast(const(S6792)*)aa["kuy"]); assert(s.i == 6); void*[7] ary; ary[5]= &blah["abc"]; S6792 t = *(cast(S6792*)ary[5]); assert(t.i == 6); int q = 6; ary[3]= &q; int gg = *(cast(int*)(ary[3])); } return true; }()); /************************************************** 7780 array cast **************************************************/ int bug7780(int testnum) { int[] y = new int[2]; y[0] = 2000000; if (testnum == 1) { void[] x = y; return (cast(byte[])x)[1]; } if (testnum == 2) { int[] x = y[0 .. 1]; return (cast(byte[])x)[1]; } return 1; } static assert( is(typeof(compiles!(bug7780(0))))); static assert(!is(typeof(compiles!(bug7780(1))))); static assert(!is(typeof(compiles!(bug7780(2))))); /************************************************** 14028 - static array pointer that refers existing array elements. **************************************************/ int test14028a(size_t ofs)(bool ct) { int[4] a; int[2]* p; int num = ofs; if (ct) p = cast(int[2]*)&a[ofs]; // SymOffExp else p = cast(int[2]*)&a[num]; // CastExp + AddrExp // pointers comparison assert(cast(void*)a.ptr <= cast(void*)p); assert(cast(void*)a.ptr <= cast(void*)&(*p)[0]); assert(cast(void*)&a[0] <= cast(void*)p); return 1; } static assert(test14028a!0(true)); static assert(test14028a!0(false)); static assert(test14028a!3(true)); static assert(test14028a!3(false)); static assert(!is(typeof(compiles!(test14028a!4(true))))); static assert(!is(typeof(compiles!(test14028a!4(false))))); int test14028b(int num) { int[4] a; int[2]* p; if (num == 1) { p = cast(int[2]*)&a[0]; // &a[0..2]; (*p)[0] = 1; // a[0] = 1 (*p)[1] = 2; // a[1] = 2 assert(a == [1,2,0,0]); p = p + 1; // &a[0] -> &a[2] (*p)[0] = 3; // a[2] = 3 (*p)[1] = 4; // a[3] = 4 assert(a == [1,2,3,4]); } if (num == 2) { p = cast(int[2]*)&a[1]; // &a[1..3]; (*p)[0] = 1; // a[1] = 1 p = p + 1; // &a[1..3] -> &a[3..5] (*p)[0] = 2; // a[3] = 2 assert(a == [0,1,0,2]); } if (num == 3) { p = cast(int[2]*)&a[1]; // &a[1..3]; (*p)[0] = 1; // a[1] = 1 p = p + 1; // &a[1..3] -> &a[3..5] (*p)[0] = 2; // a[3] = 2 (*p)[1] = 3; // a[4] = 3 (CTFE error) } if (num == 4) { p = cast(int[2]*)&a[0]; // &a[0..2]; p = p + 1; // &a[0..2] -> &a[2..4] p = p + 1; // &a[2..4] -> &a[4..6] (ok) } if (num == 5) { p = cast(int[2]*)&a[1]; // &a[1..3]; p = p + 2; // &a[1..3] -> &a[5..7] (CTFE error) } return 1; } static assert(test14028b(1)); static assert(test14028b(2)); static assert(!is(typeof(compiles!(test14028b(3))))); static assert(test14028b(4)); static assert(!is(typeof(compiles!(test14028b(5))))); /************************************************** 10275 cast struct literals to immutable **************************************************/ struct Bug10275 { uint[] ivals; } Bug10275 bug10275() { return Bug10275([1, 2, 3]); } int test10275() { immutable(Bug10275) xxx = cast(immutable(Bug10275))bug10275(); return 1; } static assert(test10275()); /************************************************** 6851 passing pointer by argument **************************************************/ void set6851(int* pn) { *pn = 20; } void bug6851() { int n = 0; auto pn = &n; *pn = 10; assert(n == 10); set6851(&n); } static assert({ bug6851(); return true; }()); /************************************************** 7876 **************************************************/ int* bug7876(int n) { int x; auto ptr = &x; if (n == 2) ptr = null; return ptr; } struct S7876 { int* p; } S7876 bug7876b(int n) { int x; S7876 s; s.p = &x; if (n == 11) s.p = null; return s; } int test7876(int n) { if (n >= 10) { S7876 m = bug7876b(n); return 1; } int* p = bug7876(n); return 1; } static assert( is(typeof(compiles!(test7876(2))))); static assert(!is(typeof(compiles!(test7876(0))))); static assert( is(typeof(compiles!(test7876(11))))); static assert(!is(typeof(compiles!(test7876(10))))); /************************************************** 11824 **************************************************/ int f11824(T)() { T[] arr = new T[](1); T* getAddr(ref T a) { return &a; } getAddr(arr[0]); return 1; } static assert(f11824!int()); // OK static assert(f11824!(int[])()); // OK <- NG /************************************************** 6817 if converted to &&, only with -inline **************************************************/ static assert({ void toggle() { bool b; if (b) b = false; } toggle(); return true; }()); /************************************************** cast to void **************************************************/ static assert({ cast(void)(71); return true; }()); /************************************************** 6816 nested function can't access this **************************************************/ struct S6816 { size_t foo() { return (){ return value +1 ; }(); } size_t value; } enum s6816 = S6816().foo(); /************************************************** 7277 ICE nestedstruct.init.tupleof **************************************************/ struct Foo7277 { int a; int func() { int b; void nested() { b = 7; a = 10; } nested(); return a+b; } } static assert(Foo7277().func() == 17); /************************************************** 10217 ICE. CTFE version of 9315 **************************************************/ bool bug10217() { struct S { int i; void bar() {} } auto yyy = S.init.tupleof[$ - 1]; assert(!yyy); return 1; } static assert(bug10217()); /************************************************** 8276 ICE **************************************************/ void bug8676(int n) { const int X1 = 4 + n; const int X2 = 4; int X3 = 4; int bar1() { return X1; } int bar2() { return X2; } int bar3() { return X3; } static assert(!is(typeof(compiles!(bar1())))); static assert( is(typeof(compiles!(bar2())))); static assert(!is(typeof(compiles!(bar3())))); } /************************************************** classes and interfaces **************************************************/ interface SomeInterface { int daz(); float bar(char); int baz(); } interface SomeOtherInterface { int xxx(); } class TheBase : SomeInterface, SomeOtherInterface { int q = 88; int rad = 61; int a = 14; int somebaseclassfunc() { return 28; } int daz() { return 0; } int baz() { return 0; } int xxx() { return 762; } int foo() { return q; } float bar(char c) { return 3.6; } } class SomeClass : TheBase, SomeInterface { int gab = 9; int fab; int a = 17; int b = 23; override int foo() { return gab + a; } override float bar(char c) { return 2.6; } int something() { return 0; } override int daz() { return 0; } override int baz() { return 0; } } class Unrelated : TheBase { this(int x) { a = x; } } auto classtest1(int n) { SomeClass c = new SomeClass; assert(c.a == 17); assert(c.q == 88); TheBase d = c; assert(d.a == 14); assert(d.q == 88); if (n == 7) { // bad cast -- should fail Unrelated u = cast(Unrelated)d; assert(u is null); } SomeClass e = cast(SomeClass)d; d.q = 35; assert(c.q == 35); assert(c.foo() == 9 + 17); ++c.a; assert(c.foo() == 9 + 18); assert(d.foo() == 9 + 18); d = new TheBase; SomeInterface fc = c; SomeOtherInterface ot = c; assert(fc.bar('x') == 2.6); assert(ot.xxx() == 762); fc = d; ot = d; assert(fc.bar('x') == 3.6); assert(ot.xxx() == 762); Unrelated u2 = new Unrelated(7); assert(u2.a == 7); return 6; } static assert(classtest1(1)); static assert(classtest1(2)); static assert(classtest1(7)); // bug 7154 // can't initialize enum with not null class SomeClass classtest2(int n) { return n == 5 ? (new SomeClass) : null; } static assert( is(typeof((){ enum const(SomeClass) xx = classtest2(2);}()))); static assert(!is(typeof((){ enum const(SomeClass) xx = classtest2(5);}()))); class RecursiveClass { int x; this(int n) { x = n; } RecursiveClass b; void doit() { b = new RecursiveClass(7); b.x = 2;} } int classtest3() { RecursiveClass x = new RecursiveClass(17); x.doit(); RecursiveClass y = x.b; assert(y.x == 2); assert(x.x == 17); return 1; } static assert(classtest3()); /************************************************** 12016 class cast and qualifier reinterpret **************************************************/ class B12016 { } class C12016 : B12016 { } bool f12016(immutable B12016 b) { assert(b); return true; } static assert(f12016(new immutable C12016)); /************************************************** 10610 ice immutable implicit conversion **************************************************/ class Bug10610(T) { int baz() immutable { return 1; } static immutable(Bug10610!T) min = new Bug10610!T(); } void ice10610() { alias T10610 = Bug10610!(int); static assert (T10610.min.baz()); } /************************************************** 13141 regression fix caused by 10610 **************************************************/ struct MapResult13141(alias pred) { int[] range; @property empty() { return range.length == 0; } @property front() { return pred(range[0]); } void popFront() { range = range[1 .. $]; } } string[] array13141(R)(R r) { typeof(return) result; foreach (e; r) result ~= e; return result; } //immutable string[] splitterNames = [4].map!(e => "4").array(); immutable string[] splitterNames13141 = MapResult13141!(e => "4")([4]).array13141(); /************************************************** 11587 AA compare **************************************************/ static assert([1:2, 3:4] == [3:4, 1:2]); /************************************************** 14325 more AA comparisons **************************************************/ static assert([1:1] != [1:2, 2:1]); // OK static assert([1:1] != [1:2]); // OK static assert([1:1] != [2:1]); // OK <- Error static assert([1:1, 2:2] != [3:3, 4:4]); // OK <- Error /************************************************** 7147 typeid() **************************************************/ static assert({ TypeInfo xxx = typeid(Object); TypeInfo yyy = typeid(new Error("xxx")); return true; }()); int bug7147(int n) { Error err = n ? new Error("xxx") : null; TypeInfo qqq = typeid(err); return 1; } // Must not segfault if class is null static assert(!is(typeof(compiles!(bug7147(0))))); static assert( is(typeof(compiles!(bug7147(1))))); /************************************************** 14123 - identity TypeInfo objects **************************************************/ static assert({ bool eq(TypeInfo t1, TypeInfo t2) { return t1 is t2; } class C {} struct S {} assert( eq(typeid(C), typeid(C))); assert(!eq(typeid(C), typeid(Object))); assert( eq(typeid(S), typeid(S))); assert(!eq(typeid(S), typeid(int))); assert( eq(typeid(int), typeid(int))); assert(!eq(typeid(int), typeid(long))); Object o = new Object; Object c = new C; assert( eq(typeid(o), typeid(o))); assert(!eq(typeid(c), typeid(o))); assert(!eq(typeid(o), typeid(S))); return 1; }()); /************************************************** 6885 wrong code with new array **************************************************/ struct S6885 { int p; } int bug6885() { auto array = new double[1][2]; array[1][0] = 6; array[0][0] = 1; assert(array[1][0] == 6); auto barray = new S6885[2]; barray[1].p = 5; barray[0].p = 2; assert(barray[1].p == 5); return 1; } static assert(bug6885()); /************************************************** 6886 ICE with new array of dynamic arrays **************************************************/ int bug6886() { auto carray = new int[][2]; carray[1] = [6]; carray[0] = [4]; assert(carray[1][0] == 6); return 1; } static assert(bug6886()); /************************************************** 10198 Multidimensional struct block initializer **************************************************/ struct Block10198 { int val[3][4]; } int bug10198() { Block10198 pp = Block10198(67); assert(pp.val[2][3] == 67); assert(pp.val[1][3] == 67); return 1; } static assert(bug10198()); /************************************************** 14440 Multidimensional block initialization should create distinct arrays for each elements **************************************************/ struct Matrix14440(E, size_t row, size_t col) { E[col][row] array2D; @safe pure nothrow this(E[row * col] numbers...) { foreach (r; 0 .. row) { foreach (c; 0 .. col) { array2D[r][c] = numbers[r * col + c]; } } } } void test14440() { // Replace 'enum' with 'auto' here and it will work fine. enum matrix = Matrix14440!(int, 3, 3)( 1, 2, 3, 4, 5, 6, 7, 8, 9 ); static assert(matrix.array2D[0][0] == 1); static assert(matrix.array2D[0][1] == 2); static assert(matrix.array2D[0][2] == 3); static assert(matrix.array2D[1][0] == 4); static assert(matrix.array2D[1][1] == 5); static assert(matrix.array2D[1][2] == 6); static assert(matrix.array2D[2][0] == 7); static assert(matrix.array2D[2][1] == 8); static assert(matrix.array2D[2][2] == 9); } /**************************************************** * Exception chaining tests from xtest46.d ****************************************************/ class A75 { pure static void raise(string s) { throw new Exception(s); } } int test75() { int x = 0; try { A75.raise("a"); } catch (Exception e) { x = 1; } assert(x == 1); return 1; } static assert(test75()); /**************************************************** * Exception chaining tests from test4.d ****************************************************/ int test4_test54() { int status = 0; try { try { status++; assert(status == 1); throw new Exception("first"); } finally { status++; assert(status == 2); status++; throw new Exception("second"); } } catch (Exception e) { assert(e.msg == "first"); assert(e.next.msg == "second"); } return true; } static assert(test4_test54()); void foo55() { try { Exception x = new Exception("second"); throw x; } catch (Exception e) { assert(e.msg == "second"); } } int test4_test55() { int status = 0; try { try { status++; assert(status == 1); Exception x = new Exception("first"); throw x; } finally { status++; assert(status == 2); status++; foo55(); } } catch (Exception e) { assert(e.msg == "first"); assert(status == 3); } return 1; } static assert(test4_test55()); /**************************************************** * Exception chaining tests from eh.d ****************************************************/ void bug1513outer() { int result1513; void bug1513a() { throw new Exception("d"); } void bug1513b() { try { try { bug1513a(); } finally { result1513 |= 4; throw new Exception("f"); } } catch (Exception e) { assert(e.msg == "d"); assert(e.next.msg == "f"); assert(!e.next.next); } } void bug1513c() { try { try { throw new Exception("a"); } finally { result1513 |= 1; throw new Exception("b"); } } finally { bug1513b(); result1513 |= 2; throw new Exception("c"); } } void bug1513() { result1513 = 0; try { bug1513c(); } catch (Exception e) { assert(result1513 == 7); assert(e.msg == "a"); assert(e.next.msg == "b"); assert(e.next.next.msg == "c"); } } bug1513(); } void collideone() { try { throw new Exception("x"); } finally { throw new Exception("y"); } } void doublecollide() { try { try { try { throw new Exception("p"); } finally { throw new Exception("q"); } } finally { collideone(); } } catch (Exception e) { assert(e.msg == "p"); assert(e.next.msg == "q"); assert(e.next.next.msg == "x"); assert(e.next.next.next.msg == "y"); assert(!e.next.next.next.next); } } void collidetwo() { try { try { throw new Exception("p2"); } finally { throw new Exception("q2"); } } finally { collideone(); } } void collideMixed() { int works = 6; try { try { try { throw new Exception("e"); } finally { throw new Error("t"); } } catch (Exception f) { // Doesn't catch, because Error is chained to it. works += 2; } } catch (Error z) { works += 4; assert(z.msg == "t"); // Error comes first assert(z.next is null); assert(z.bypassedException.msg == "e"); } assert(works == 10); } class AnotherException : Exception { this(string s) { super(s); } } void multicollide() { try { try { try { try { throw new Exception("m2"); } finally { throw new AnotherException("n2"); } } catch (AnotherException s) { // Not caught -- we needed to catch the root cause "m2", not // just the collateral "n2" (which would leave m2 uncaught). assert(0); } } finally { collidetwo(); } } catch (Exception f) { assert(f.msg == "m2"); assert(f.next.msg == "n2"); Throwable e = f.next.next; assert(e.msg == "p2"); assert(e.next.msg == "q2"); assert(e.next.next.msg == "x"); assert(e.next.next.next.msg == "y"); assert(!e.next.next.next.next); } } int testsFromEH() { bug1513outer(); doublecollide(); collideMixed(); multicollide(); return 1; } static assert(testsFromEH()); /************************************************** With + synchronized statements + bug 6901 **************************************************/ struct With1 { int a; int b; } class Foo6 { } class Foo32 { struct Bar { int x; } } class Base56 { private string myfoo; private string mybar; // Get/set properties that will be overridden. void foo(string s) { myfoo = s; } string foo() { return myfoo; } // Get/set properties that will not be overridden. void bar(string s) { mybar = s; } string bar() { return mybar; } } class Derived56 : Base56 { alias Base56.foo foo; // Bring in Base56's foo getter. override void foo(string s) { super.foo = s; } // Override foo setter. } int testwith() { With1 x = With1(7); with (x) { a = 2; } assert(x.a == 2); // from test11.d Foo6 foo6 = new Foo6(); with (foo6) { int xx; xx = 4; } with (new Foo32) { Bar z; z.x = 5; } Derived56 d = new Derived56; with (d) { foo = "hi"; d.foo = "hi"; bar = "hi"; assert(foo == "hi"); assert(d.foo == "hi"); assert(bar == "hi"); } int w = 7; synchronized { ++w; } assert(w == 8); return 1; } static assert(testwith()); /************************************************** 9236 ICE switch with(EnumType) **************************************************/ enum Command9236 { Char, Any, }; bool bug9236(Command9236 cmd) { int n = 0; with (Command9236) switch (cmd) { case Any: n = 1; break; default: n = 2; } assert(n == 1); switch (cmd) with (Command9236) { case Any: return true; default: return false; } } static assert(bug9236(Command9236.Any)); /************************************************** 6416 static struct declaration **************************************************/ static assert({ static struct S { int y = 7; } S a; a.y += 6; assert(a.y == 13); return true; }()); /************************************************** 10499 static template struct declaration **************************************************/ static assert({ static struct Result() {} return true; }()); /************************************************** 13757 extern(C) alias declaration **************************************************/ static assert({ alias FP1 = extern(C) int function(); alias extern(C) int function() FP2; return true; }()); /************************************************** 6522 opAssign + foreach ref **************************************************/ struct Foo6522 { bool b = false; void opAssign(int x) { this.b = true; } } bool foo6522() { Foo6522[1] array; foreach (ref item; array) item = 1; return true; } static assert(foo6522()); /************************************************** 7245 pointers + foreach ref **************************************************/ int bug7245(int testnum) { int[3] arr; arr[0] = 4; arr[1] = 6; arr[2] = 8; int* ptr; foreach (i, ref p; arr) { if (i == 1) ptr = &p; if (testnum == 1) p = 5; } return *ptr; } static assert(bug7245(0) == 6); static assert(bug7245(1) == 5); /************************************************** 8498 modifying foreach 7658 foreach ref 8539 nested funcs, ref param, -inline **************************************************/ int bug8498() { foreach (ref i; 0 .. 5) { assert(i == 0); i = 100; } return 1; } static assert(bug8498()); string bug7658() { string[] children = ["0"]; foreach (ref child; children) child = "1"; return children[0]; } static assert(bug7658() == "1"); int bug8539() { static void one(ref int x) { x = 1; } static void go() { int y; one(y); assert(y == 1); // fails with -inline } go(); return 1; } static assert(bug8539()); /************************************************** 7874, 13297, 13740 - better lvalue handling **************************************************/ int bug7874(int x){ return ++x = 1; } static assert(bug7874(0) == 1); // ---- struct S13297 { int* p; } void f13297(ref int* p) { p = cast(int*) 1; assert(p); // passes } static assert( { S13297 s; f13297(s.p); return s.p != null; // false }()); // ---- class R13740 { int e; bool empty = false; @property ref front() { return e; } void popFront() { empty = true; } } static assert({ auto r = new R13740(); foreach (ref e; r) e = 42; assert(r.e == 42); /* fails in CTFE */ return true; }()); /************************************************** 6919 **************************************************/ void bug6919(int* val) { *val = 1; } void test6919() { int n; bug6919(&n); assert(n == 1); } static assert({ test6919(); return true; }()); void bug6919b(string* val) { *val = "1"; } void test6919b() { string val; bug6919b(&val); assert(val == "1"); } static assert({ test6919b(); return true; }()); /************************************************** 6995 **************************************************/ struct Foo6995 { static size_t index(size_t v)() { return v; } } static assert(Foo6995.index!(27)() == 27); /************************************************** 7043 ref with -inline **************************************************/ int bug7043(S)(ref int x) { return x; } static assert({ int i = 416; return bug7043!(char)(i); }() == 416); /************************************************** 6037 recursive ref **************************************************/ void bug6037(ref int x, bool b) { int w = 3; if (b) { bug6037(w, false); assert(w == 6); } else { x = 6; assert(w == 3); // fails } } int bug6037outer() { int q; bug6037(q, true); return 401; } static assert(bug6037outer() == 401); /************************************************** 14299 - [REG2.067a], more than one depth of recursive call with ref **************************************************/ string gen14299(int max, int idx, ref string name) { string ret; name = [cast(char)(idx + '0')]; ret ~= name; if (idx < max) { string subname; ret ~= gen14299(max, idx + 1, subname); } ret ~= name; return ret; } string test14299(int max) { string n; return gen14299(max, 0, n); } static assert(test14299(1) == "0110"); // OK <- fail static assert(test14299(2) == "012210"); // OK <- ICE static assert(test14299(3) == "01233210"); static assert(test14299(4) == "0123443210"); static assert(test14299(5) == "012345543210"); /************************************************** 7940 wrong code for complicated assign **************************************************/ struct Bug7940 { int m; } struct App7940 { Bug7940[] x; } int bug7940() { Bug7940[2] y; App7940 app; app.x = y[0 .. 1]; app.x[0].m = 12; assert(y[0].m == 12); assert(app.x[0].m == 12); return 1; } static assert(bug7940()); /************************************************** 10298 wrong code for struct array literal init **************************************************/ struct Bug10298 { int m; } int bug10298() { Bug10298[1] y = [Bug10298(78)]; y[0].m = 6; assert(y[0].m == 6); // Root cause Bug10298[1] x; x[] = [cast(const Bug10298)(Bug10298(78))]; assert(x[0].m == 78); return 1; } static assert(bug10298()); /************************************************** 7266 dotvar ref parameters **************************************************/ struct S7266 { int a; } bool bug7266() { S7266 s; s.a = 4; bar7266(s.a); assert(s.a == 5); out7266(s.a); assert(s.a == 7); return true; } void bar7266(ref int b) { b = 5; assert(b == 5); } void out7266(out int b) { b = 7; assert(b == 7); } static assert(bug7266()); /************************************************** 9982 dotvar assign through pointer **************************************************/ struct Bug9982 { int a; } int test9982() { Bug9982 x; int*q = &x.a; *q = 99; assert(x.a == 99); return 1; } static assert(test9982()); // 9982, rejects-valid case struct SS9982 { Bug9982 s2; this(Bug9982 s1) { s2.a = 6; emplace9982(&s2, s1); assert(s2.a == 3); } } void emplace9982(Bug9982* chunk, Bug9982 arg) { *chunk = arg; } enum s9982 = Bug9982(3); enum p9982 = SS9982(s9982); /************************************************** 11618 dotvar assign through casted pointer **************************************************/ struct Tuple11618(T...) { T field; alias field this; } static assert({ Tuple11618!(immutable dchar) result = void; auto addr = cast(dchar*)&result[0]; *addr = dchar.init; return (result[0] == dchar.init); }()); /************************************************** 7143 'is' for classes **************************************************/ class C7143 { int x; } int bug7143(int test) { C7143 c = new C7143; C7143 d = new C7143; if (test == 1) { if (c) return c.x + 8; return -1; } if (test == 2) { if (c is null) return -1; return c.x + 45; } if (test == 3) { if (c is c) return 58; } if (test == 4) { if (c !is c) return -1; else return 48; } if (test == 6) d = c; if (test == 5 || test == 6) { if (c is d) return 188; else return 48; } return -1; } static assert(bug7143(1) == 8); static assert(bug7143(2) == 45); static assert(bug7143(3) == 58); static assert(bug7143(4) == 48); static assert(bug7143(5) == 48); static assert(bug7143(6) == 188); /************************************************** 7147 virtual function calls from base class **************************************************/ class A7147 { int foo() { return 0; } int callfoo() { return foo(); } } class B7147 : A7147 { override int foo() { return 1; } } int test7147() { A7147 a = new B7147; return a.callfoo(); } static assert(test7147() == 1); /************************************************** 7158 **************************************************/ class C7158 { bool b() { return true; } } struct S7158 { C7158 c; } bool test7158() { S7158 s = S7158(new C7158); return s.c.b; } static assert(test7158()); /************************************************** 8484 **************************************************/ class C8484 { int n; int b() { return n + 3; } } struct S { C8484 c; } int t8484(ref C8484 c) { return c.b(); } int test8484() { auto s = S(new C8484); s.c.n = 4; return t8484(s.c); } static assert(test8484() == 7); /************************************************** 7419 **************************************************/ struct X7419 { double x; this(double x) { this.x = x; } } void bug7419() { enum x = { auto p = X7419(3); return p.x; }(); static assert(x == 3); } /************************************************** 9445 ice **************************************************/ template c9445(T...) { } void ice9445(void delegate() expr, void function() f2) { static assert(!is(typeof(c9445!(f2())))); static assert(!is(typeof(c9445!(expr())))); } /************************************************** 10452 delegate == **************************************************/ struct S10452 { bool func() { return true; } } struct Outer10452 { S10452 inner; } class C10452 { bool func() { return true; } } bool delegate() ref10452(ref S10452 s) { return &s.func; } bool test10452() { bool delegate() bar = () { return true; }; assert(bar !is null); assert(bar is bar); S10452 bag; S10452[6] bad; Outer10452 outer; C10452 tag = new C10452; auto rat = &outer.inner.func; assert(rat == rat); auto tat = &tag.func; assert(tat == tat); auto bat = &outer.inner.func; auto mat = &bad[2].func; assert(mat is mat); assert(rat == bat); auto zat = &bag.func; auto cat = &bag.func; assert(zat == zat); assert(zat == cat); auto drat = ref10452(bag); assert(cat == drat); assert(drat == drat); drat = ref10452(bad[2]); assert( drat == mat); assert(tat != rat); assert(zat != rat); assert(rat != cat); assert(zat != bar); assert(tat != cat); cat = bar; assert(cat == bar); return true; } static assert(test10452()); /************************************************** 7162 and 4711 **************************************************/ void f7162() { } bool ice7162() { false && f7162(); false || f7162(); false && f7162(); // bug 4711 true && f7162(); return true; } static assert(ice7162()); /************************************************** 8857, only with -inline (creates an &&) **************************************************/ struct Result8857 { char[] next; } void bug8857()() { Result8857 r; r.next = null; if (true) { auto next = r.next; } } static assert({ bug8857(); return true; }()); /************************************************** 7527 **************************************************/ struct Bug7527 { char[] data; } int bug7527() { auto app = Bug7527(); app.data.ptr[0 .. 1] = "x"; return 1; } static assert(!is(typeof(compiles!(bug7527())))); /************************************************** 7527 **************************************************/ int bug7380; static assert(!is(typeof( compiles!( (){ return &bug7380; }() )))); /************************************************** 7165 **************************************************/ struct S7165 { int* ptr; bool f() const { return !!ptr; } } static assert(!S7165().f()); /************************************************** 7187 **************************************************/ int[] f7187() { return [0]; } int[] f7187b(int n) { return [0]; } int g7187(int[] r) { auto t = r[0 .. 0]; return 1; } static assert(g7187(f7187())); static assert(g7187(f7187b(7))); struct S7187 { const(int)[] field; } const(int)[] f7187c() { auto s = S7187([0]); return s.field; } bool g7187c(const(int)[] r) { auto t = r[0 .. 0]; return true; } static assert(g7187c(f7187c())); /************************************************** 6933 struct destructors **************************************************/ struct Bug6933 { int x = 3; ~this() { } } int test6933() { Bug6933 q; assert(q.x == 3); return 3; } static assert(test6933()); /************************************************** 7197 **************************************************/ int foo7197(int[] x...) { return 1; } template bar7197(y...) { enum int bar7197 = foo7197(y); } enum int bug7197 = 7; static assert(bar7197!(bug7197)); /************************************************** Enum string compare **************************************************/ enum EScmp : string { a = "aaa" } bool testEScmp() { EScmp x = EScmp.a; assert(x < "abc"); return true; } static assert(testEScmp()); /************************************************** 7667 **************************************************/ bool baz7667(int[] vars...) { return true; } struct S7667 { static void his(int n) { static assert(baz7667(2)); } } bool bug7667() { S7667 unused; unused.his(7); return true; } enum e7667 = bug7667(); /************************************************** 7536 **************************************************/ bool bug7536(string expr) { return true; } void vop() { const string x7536 = "x"; static assert(bug7536(x7536)); } /************************************************** 6681 unions **************************************************/ struct S6681 { this(int a, int b) { this.a = b; this.b = a; } union { ulong g; struct { int a, b; }; } } static immutable S6681 s6681 = S6681(0, 1); bool bug6681(int test) { S6681 x = S6681(0, 1); x.g = 5; auto u = &x.g; auto v = &x.a; long w = *u; int z; assert(w == 5); if (test == 4) z = *v; // error x.a = 2; // invalidate g, and hence u. if (test == 1) w = *u; // error z = *v; assert(z == 2); x.g = 6; w = *u; assert(w == 6); if (test == 3) z = *v; return true; } static assert(bug6681(2)); static assert(!is(typeof(compiles!(bug6681(1))))); static assert(!is(typeof(compiles!(bug6681(3))))); static assert(!is(typeof(compiles!(bug6681(4))))); /************************************************** 9113 ICE with struct in union **************************************************/ union U9113 { struct M { int y; } int xx; } int bug9113(T)() { U9113 x; x.M.y = 10; // error, need 'this' return 1; } static assert(!is(typeof(compiles!(bug9113!(int)())))); /************************************************** Creation of unions **************************************************/ union UnionTest1 { int x; float y; } int uniontest1() { UnionTest1 u = UnionTest1(1); return 1; } static assert(uniontest1()); /************************************************** 6438 void **************************************************/ struct S6438 { int a; int b = void; } void fill6438(int[] arr, int testnum) { if (testnum == 2) { auto u = arr[0]; } foreach (ref x; arr) x = 7; auto r = arr[0]; S6438[2] s; auto p = &s[0].b; if (testnum == 3) { auto v = *p; } } bool bug6438(int testnum) { int[4] stackSpace = void; fill6438(stackSpace[], testnum); assert(stackSpace == [7, 7, 7, 7]); return true; } static assert( is(typeof(compiles!(bug6438(1))))); static assert(!is(typeof(compiles!(bug6438(2))))); static assert(!is(typeof(compiles!(bug6438(3))))); /************************************************** 10994 void static array members **************************************************/ struct Bug10994 { ubyte[2] buf = void; } static bug10994 = Bug10994.init; /************************************************** 10937 struct inside union **************************************************/ struct S10937 { union { ubyte[1] a; struct { ubyte b; } } this(ubyte B) { if (B > 6) this.b = B; else this.a[0] = B; } } enum test10937 = S10937(7); enum west10937 = S10937(2); /************************************************** 13831 **************************************************/ struct Vector13831() { } struct Coord13831 { union { struct { short x; } Vector13831!() vector; } } struct Chunk13831 { this(Coord13831) { coord = coord; } Coord13831 coord; static const Chunk13831* unknownChunk = new Chunk13831(Coord13831()); } /************************************************** 7732 **************************************************/ struct AssociativeArray { int* impl; int f() { if (impl !is null) auto x = *impl; return 1; } } int test7732() { AssociativeArray aa; return aa.f; } static assert(test7732()); /************************************************** 7784 **************************************************/ struct Foo7784 { void bug() { tab["A"] = Bar7784(&this); auto pbar = "A" in tab; auto bar = *pbar; } Bar7784[string] tab; } struct Bar7784 { Foo7784* foo; int val; } bool ctfe7784() { auto foo = Foo7784(); foo.bug(); return true; } static assert(ctfe7784()); /************************************************** 7781 **************************************************/ static assert(({ return; }(), true)); /************************************************** 7785 **************************************************/ bool bug7785(int n) { int val = 7; auto p = &val; if (n == 2) { auto ary = p[0 .. 1]; } auto x = p[0]; val = 6; assert(x == 7); if (n == 3) p[0 .. 1] = 1; return true; } static assert(bug7785(1)); static assert(!is(typeof(compiles!(bug7785(2))))); static assert(!is(typeof(compiles!(bug7785(3))))); /************************************************** 7987 **************************************************/ class C7987 { int m; } struct S7987 { int* p; C7987 c; } bool bug7987() { int[7] q; int[][2] b = q[0 .. 5]; assert(b == b); assert(b is b); C7987 c1 = new C7987; C7987 c2 = new C7987; S7987 s, t; s.p = &q[0]; t.p = &q[1]; assert(s != t); s.p = &q[1]; /*assert(s == t);*/ assert(s.p == t.p); s.c = c1; t.c = c2; /*assert(s != t);*/ assert(s.c !is t.c); assert(s !is t); s.c = c2; /*assert(s == t);*/ assert(s.p == t.p && s.c is t.c); assert(s is t); return true; } static assert(bug7987()); /************************************************** 10579 typeinfo.func() must not segfault **************************************************/ static assert(!is(typeof(compiles!(typeid(int).toString.length)))); class Bug10579 { int foo() { return 1; } } Bug10579 uninitialized10579; static assert(!is(typeof(compiles!(uninitialized10579.foo())))); /************************************************** 10804 mixin ArrayLiteralExp typed string **************************************************/ void test10804() { String identity(String)(String a) { return a; } string cfun() { char[] s; s.length = 8 + 2 + (2) + 1 + 2; s[] = "identity(`Ω`c)"c[]; return cast(string)s; // Return ArrayLiteralExp as the CTFE result } { enum a1 = "identity(`Ω`c)"c; enum a2 = cfun(); static assert(cast(ubyte[])mixin(a1) == [0xCE, 0xA9]); static assert(cast(ubyte[])mixin(a2) == [0xCE, 0xA9]); // should pass } wstring wfun() { wchar[] s; s.length = 8 + 2 + (2) + 1 + 2; s[] = "identity(`\U0002083A`w)"w[]; return cast(wstring)s; // Return ArrayLiteralExp as the CTFE result } { enum a1 = "identity(`\U0002083A`w)"w; enum a2 = wfun(); static assert(cast(ushort[])mixin(a1) == [0xD842, 0xDC3A]); static assert(cast(ushort[])mixin(a2) == [0xD842, 0xDC3A]); } dstring dfun() { dchar[] s; s.length = 8 + 2 + (1) + 1 + 2; s[] = "identity(`\U00101000`d)"d[]; return cast(dstring)s; // Return ArrayLiteralExp as the CTFE result } { enum a1 = "identity(`\U00101000`d)"d; enum a2 = dfun(); static assert(cast(uint[])mixin(a1) == [0x00101000]); static assert(cast(uint[])mixin(a2) == [0x00101000]); } } /******************************************************/ struct B73 {} struct C73 { B73 b; } C73 func73() { C73 b = void; b.b = B73(); return b; } C73 test73 = func73(); /******************************************************/ struct S74 { int n[1]; static S74 test(){ S74 ret = void; ret.n[0] = 0; return ret; } } enum Test74 = S74.test(); /******************************************************/ static bool bug8865() in { int x = 0; label: foreach (i; (++x) .. 3) { if (i == 1) continue label; // doesn't work. else break label; // doesn't work. } } out { int x = 0; label: foreach (i; (++x) .. 3) { if (i == 1) continue label; // doesn't work. else break label; // doesn't work. } } body { int x = 0; label: foreach (i; (++x) .. 3) { if (i == 1) continue label; // works. else break label; // works. } return true; } static assert(bug8865()); /******************************************************/ // 15450 labeled foreach + continue/break static assert({ L1: foreach (l; [0]) continue L1; L2: foreach (l; [0]) break L2; return true; }()); struct Test75 { this(int) pure {} } /******************************************************/ static assert( __traits(compiles, { static shared(Test75*) t75 = new shared(Test75)(0); return t75; })); static assert( __traits(compiles, { static shared(Test75)* t75 = new shared(Test75)(0); return t75; })); static assert( __traits(compiles, { static __gshared Test75* t75 = new Test75(0); return t75; })); static assert( __traits(compiles, { static const(Test75*) t75 = new const(Test75)(0); return t75; })); static assert( __traits(compiles, { static immutable Test75* t75 = new immutable(Test75)(0); return t75; })); static assert(!__traits(compiles, { static Test75* t75 = new Test75(0); return t75; })); /+ static assert(!__traits(compiles, { enum t75 = new shared(Test75)(0); return t75; })); static assert(!__traits(compiles, { enum t75 = new Test75(0); return t75; })); static assert(!__traits(compiles, { enum shared(Test75)* t75 = new shared(Test75)(0); return t75; })); static assert(!__traits(compiles, { enum Test75* t75 = new Test75(0); return t75; })); static assert( __traits(compiles, { enum t75 = new const(Test75)(0); return t75;})); static assert( __traits(compiles, { enum t75 = new immutable(Test75)(0); return t75;})); static assert( __traits(compiles, { enum const(Test75)* t75 = new const(Test75)(0); return t75;})); static assert( __traits(compiles, { enum immutable(Test75)* t75 = new immutable(Test75)(0); return t75;})); +/ /******************************************************/ class Test76 { this(int) pure {} } /+ static assert(!__traits(compiles, { enum t76 = new shared(Test76)(0); return t76;})); static assert(!__traits(compiles, { enum t76 = new Test76(0); return t76;})); static assert(!__traits(compiles, { enum shared(Test76) t76 = new shared(Test76)(0); return t76;})); static assert(!__traits(compiles, { enum Test76 t76 = new Test76(0); return t76;})); static assert( __traits(compiles, { enum t76 = new const(Test76)(0); return t76;})); static assert( __traits(compiles, { enum t76 = new immutable(Test76)(0); return t76;})); static assert( __traits(compiles, { enum const(Test76) t76 = new const(Test76)(0); return t76;})); static assert( __traits(compiles, { enum immutable(Test76) t76 = new immutable(Test76)(0); return t76;})); +/ /******************************************************/ static assert( __traits(compiles, { static shared Test76 t76 = new shared(Test76)(0); return t76; })); static assert( __traits(compiles, { static shared(Test76) t76 = new shared(Test76)(0); return t76; })); static assert( __traits(compiles, { static __gshared Test76 t76 = new Test76(0); return t76; })); static assert( __traits(compiles, { static const Test76 t76 = new const(Test76)(0); return t76; })); static assert( __traits(compiles, { static immutable Test76 t76 = new immutable Test76(0); return t76; })); static assert(!__traits(compiles, { static Test76 t76 = new Test76(0); return t76; })); /***** Bug 5678 *********************************/ struct Bug5678 { this(int) {} } static assert(!__traits(compiles, { enum const(Bug5678)* b5678 = new const(Bug5678)(0); return b5678; })); /************************************************** 10782 run semantic2 for class field **************************************************/ enum e10782 = 0; class C10782 { int x = e10782; } string f10782() { auto c = new C10782(); return ""; } mixin(f10782()); /************************************************** 10929 NRVO support in CTFE **************************************************/ struct S10929 { this(this) { postblitCount++; } ~this() { dtorCount++; } int payload; int dtorCount; int postblitCount; } auto makeS10929() { auto s = S10929(42, 0, 0); return s; } bool test10929() { auto s = makeS10929(); assert(s.postblitCount == 0); assert(s.dtorCount == 0); return true; }; static assert(test10929()); /************************************************** 9245 - support postblit call on array assignments **************************************************/ bool test9245() { int postblits = 0; struct S { this(this) { ++postblits; } } S s; S[2] a; assert(postblits == 0); { S[2] arr = s; assert(postblits == 2); arr[] = s; assert(postblits == 4); postblits = 0; S[2] arr2 = arr; assert(postblits == 2); arr2 = arr; assert(postblits == 4); postblits = 0; const S[2] constArr = s; assert(postblits == 2); postblits = 0; const S[2] constArr2 = arr; assert(postblits == 2); postblits = 0; } { S[2][2] arr = s; assert(postblits == 4); arr[] = a; assert(postblits == 8); postblits = 0; S[2][2] arr2 = arr; assert(postblits == 4); arr2 = arr; assert(postblits == 8); postblits = 0; const S[2][2] constArr = s; assert(postblits == 4); postblits = 0; const S[2][2] constArr2 = arr; assert(postblits == 4); postblits = 0; } return true; } static assert(test9245()); /************************************************** 12906 don't call postblit on blit initializing **************************************************/ struct S12906 { this(this) { assert(0); } } static assert({ S12906[1] arr; return true; }()); /************************************************** 11510 support overlapped field access in CTFE **************************************************/ struct S11510 { union { size_t x; int* y; // pointer field } } bool test11510() { S11510 s; s.y = [1,2,3].ptr; // writing overlapped pointer field is OK assert(s.y[0 .. 3] == [1,2,3]); // reading valid field is OK s.x = 10; assert(s.x == 10); // There's no reinterpretation between S.x and S.y return true; } static assert(test11510()); /************************************************** 11534 - subtitude inout **************************************************/ struct MultiArray11534 { void set(size_t[] sizes...) { storage = new size_t[5]; } @property auto raw_ptr() inout { return storage.ptr + 1; } size_t[] storage; } enum test11534 = () { auto m = MultiArray11534(); m.set(3,2,1); auto start = m.raw_ptr; //this trigger the bug //auto start = m.storage.ptr + 1; //this obviously works return 0; }(); /************************************************** 11941 - Regression of 11534 fix **************************************************/ void takeConst11941(const string[]) {} string[] identity11941(string[] x) { return x; } bool test11941a() { struct S { string[] a; } S s; takeConst11941(identity11941(s.a)); s.a ~= []; return true; } static assert(test11941a()); bool test11941b() { struct S { string[] a; } S s; takeConst11941(identity11941(s.a)); s.a ~= "foo"; /* Error refers to this line (15), */ string[] b = s.a[]; /* but only when this is here. */ return true; } static assert(test11941b()); /************************************************** 11535 - element-wise assignment from string to ubyte array literal **************************************************/ struct Hash11535 { ubyte[6] _buffer; void put(scope const(ubyte)[] data...) { uint i = 0, index = 0; auto inputLen = data.length; (&_buffer[index])[0 .. inputLen - i] = (&data[i])[0 .. inputLen - i]; } } auto md5_digest11535(T...)(scope const T data) { Hash11535 hash; hash.put(cast(const(ubyte[]))data[0]); return hash._buffer; } static assert(md5_digest11535(`TEST`) == [84, 69, 83, 84, 0, 0]); /************************************************** 11540 - goto label + try-catch-finally / with statement **************************************************/ static assert(() { // enter to TryCatchStatement.body { bool c = false; try { if (c) // need to bypass front-end optimization throw new Exception(""); else { goto Lx; L1: c = true; } } catch (Exception e) {} Lx: if (!c) goto L1; } // jump inside TryCatchStatement.body { bool c = false; try { if (c) // need to bypass front-end optimization throw new Exception(""); else goto L2; L2: ; } catch (Exception e) {} } // exit from TryCatchStatement.body { bool c = false; try { if (c) // need to bypass front-end optimization throw new Exception(""); else goto L3; } catch (Exception e) {} c = true; L3: assert(!c); } return 1; }()); static assert(() { // enter to TryCatchStatement.catches which has no exception variable { bool c = false; goto L1; try { c = true; } catch (Exception/* e*/) { L1: ; } assert(c == false); } // jump inside TryCatchStatement.catches { bool c = false; try { throw new Exception(""); } catch (Exception e) { goto L2; c = true; L2: ; } assert(c == false); } // exit from TryCatchStatement.catches { bool c = false; try { throw new Exception(""); } catch (Exception e) { goto L3; c = true; } L3: assert(c == false); } return 1; }()); static assert(() { // enter forward to TryFinallyStatement.body { bool c = false; goto L0; c = true; try { L0: ; } finally {} assert(!c); } // enter back to TryFinallyStatement.body { bool c = false; try { goto Lx; L1: c = true; } finally { } Lx: if (!c) goto L1; } // jump inside TryFinallyStatement.body { try { goto L2; L2: ; } finally {} } // exit from TryFinallyStatement.body { bool c = false; try { goto L3; } finally {} c = true; L3: assert(!c); } // enter in / exit out from finally block is rejected in semantic analysis // jump inside TryFinallyStatement.finalbody { bool c = false; try { } finally { goto L4; c = true; L4: assert(c == false); } } return 1; }()); static assert(() { { bool c = false; with (Object.init) { goto L2; c = true; L2: ; } assert(c == false); } { bool c = false; with (Object.init) { goto L3; c = true; } L3: assert(c == false); } return 1; }()); /************************************************** 11627 - cast dchar to char at compile time on AA assignment **************************************************/ bool test11627() { char[ubyte] toCharTmp; dchar letter = 'A'; //char c = cast(char)letter; // OK toCharTmp[0] = cast(char)letter; // NG return true; } static assert(test11627()); /************************************************** 11664 - ignore function local static variables **************************************************/ bool test11664() { static int x; static int y = 1; return true; } static assert(test11664()); /************************************************** 12110 - operand of dereferencing does not need to be an lvalue **************************************************/ struct SliceOverIndexed12110 { Uint24Array12110* arr; @property front(uint val) { arr.dupThisReference(); } } struct Uint24Array12110 { ubyte[] data; this(ubyte[] range) { data = range; SliceOverIndexed12110(&this).front = 0; assert(data.length == range.length * 2); } void dupThisReference() { auto new_data = new ubyte[data.length * 2]; data = new_data; } } static m12110 = Uint24Array12110([0x80]); /************************************************** 12310 - heap allocation for built-in sclar types **************************************************/ bool test12310() { auto p1 = new int, p2 = p1; assert(*p1 == 0); assert(*p2 == 0); *p1 = 10; assert(*p1 == 10); assert(*p2 == 10); auto q1 = new int(3), q2 = q1; assert(*q1 == 3); assert(*q2 == 3); *q1 = 20; assert(*q1 == 20); assert(*q2 == 20); return true; } static assert(test12310()); /************************************************** 12499 - initialize TupleDeclaraion in CTFE **************************************************/ auto f12499() { //Initialize 3 ints to 5. TypeTuple!(int, int, int) a = 5; return a[0]; //Error: variable _a_field_0 cannot be read at compile time } static assert(f12499() == 5); /************************************************** 12602 - slice in struct literal members **************************************************/ struct Result12602 { uint[] source; } auto wrap12602a(uint[] r) { return Result12602(r); } auto wrap12602b(uint[] r) { Result12602 x; x.source = r; return x; } auto testWrap12602a() { uint[] dest = [1, 2, 3, 4]; auto ra = wrap12602a(dest[0 .. 2]); auto rb = wrap12602a(dest[2 .. 4]); foreach (i; 0 .. 2) rb.source[i] = ra.source[i]; assert(ra.source == [1,2]); assert(rb.source == [1,2]); assert(&ra.source[0] == &dest[0]); assert(&rb.source[0] == &dest[2]); assert(dest == [1,2,1,2]); return dest; } auto testWrap12602b() { uint[] dest = [1, 2, 3, 4]; auto ra = wrap12602b(dest[0 .. 2]); auto rb = wrap12602b(dest[2 .. 4]); foreach (i; 0 .. 2) rb.source[i] = ra.source[i]; assert(ra.source == [1,2]); assert(rb.source == [1,2]); assert(&ra.source[0] == &dest[0]); assert(&rb.source[0] == &dest[2]); assert(dest == [1,2,1,2]); return dest; } auto testWrap12602c() { uint[] dest = [1, 2, 3, 4]; auto ra = Result12602(dest[0 .. 2]); auto rb = Result12602(dest[2 .. 4]); foreach (i; 0 .. 2) rb.source[i] = ra.source[i]; assert(ra.source == [1,2]); assert(rb.source == [1,2]); assert(&ra.source[0] == &dest[0]); assert(&rb.source[0] == &dest[2]); assert(dest == [1,2,1,2]); return dest; } auto testWrap12602d() { uint[] dest = [1, 2, 3, 4]; Result12602 ra; ra.source = dest[0 .. 2]; Result12602 rb; rb.source = dest[2 .. 4]; foreach (i; 0 .. 2) rb.source[i] = ra.source[i]; assert(ra.source == [1,2]); assert(rb.source == [1,2]); assert(&ra.source[0] == &dest[0]); assert(&rb.source[0] == &dest[2]); assert(dest == [1,2,1,2]); return dest; } static assert(testWrap12602a() == [1,2,1,2]); static assert(testWrap12602b() == [1,2,1,2]); static assert(testWrap12602c() == [1,2,1,2]); static assert(testWrap12602d() == [1,2,1,2]); /************************************************** 12677 - class type initializing from DotVarExp **************************************************/ final class C12677 { TypeTuple!(Object, int[]) _test; this() { auto t0 = _test[0]; // auto t1 = _test[1]; // assert(t0 is null); assert(t1 is null); } } struct S12677 { auto f = new C12677(); } /************************************************** 12851 - interpret function local const static array **************************************************/ void test12851() { const int[5] arr; alias staticZip = TypeTuple!(arr[0]); } /************************************************** 13630 - indexing and setting array element via pointer **************************************************/ struct S13630(T) { T[3] arr; this(A...)(auto ref in A args) { auto p = arr.ptr; foreach (ref v; args) { *p = 0; } } } enum s13630 = S13630!float(1); /************************************************** 13827 **************************************************/ struct Matrix13827(T, uint N) { private static defaultMatrix() { T arr[N]; return arr; } union { T[N] A = defaultMatrix; T[N] flat; } this(A...)(auto ref in A args) { uint k; foreach (ref v; args) flat[k++] = cast(T)v; } } enum m13827 = Matrix13827!(int, 3)(1, 2, 3); /************************************************** 13847 - support DotTypeExp **************************************************/ class B13847 { int foo() { return 1; } } class C13847 : B13847 { override int foo() { return 2; } final void test(int n) { assert(foo() == n); assert(B13847.foo() == 1); assert(C13847.foo() == 2); assert(this.B13847.foo() == 1); assert(this.C13847.foo() == 2); } } class D13847 : C13847 { override int foo() { return 3; } } static assert({ C13847 c = new C13847(); c.test(2); assert(c.B13847.foo() == 1); assert(c.C13847.foo() == 2); D13847 d = new D13847(); d.test(3); assert(d.B13847.foo() == 1); assert(d.C13847.foo() == 2); assert(d.D13847.foo() == 3); c = d; c.test(3); assert(c.B13847.foo() == 1); assert(c.C13847.foo() == 2); return true; }()); /************************************************** 12495 - cast from string to immutable(ubyte)[] **************************************************/ string getStr12495() { char[1] buf = void; // dummy starting point. string s = cast(string)buf[0..0]; // empty slice, .ptr points mutable. assert(buf.ptr == s.ptr); s ~= 'a'; // this should allocate. assert(buf.ptr != s.ptr); return s.idup; // this should allocate again, and // definitly point immutable memory. } auto indexOf12495(string s) { auto p1 = s.ptr; auto p2 = (cast(immutable(ubyte)[])s).ptr; assert(cast(void*)p1 == cast(void*)p2); // OK <- fails return cast(void*)p2 - cast(void*)p1; // OK <- "cannot subtract pointers ..." } static assert(indexOf12495(getStr12495()) == 0); /************************************************** 13992 - Repainting pointer arithmetic result **************************************************/ enum hash13992 = hashOf13992("abcd".ptr); @trusted hashOf13992(const void* buf) { auto data = cast(const(ubyte)*) buf; size_t hash; data += 2; // problematic pointer arithmetic hash += *data; // CTFE internal issue was shown by the dereference return hash; } /************************************************** 13739 - Precise copy for ArrayLiteralExp elements **************************************************/ static assert( { int[] a1 = [13]; int[][] a2 = [a1]; assert(a2[0] is a1); // OK assert(a2[0].ptr is a1.ptr); // OK <- NG a1[0] = 1; assert(a2[0][0] == 1); // OK <- NG a2[0][0] = 2; assert(a1[0] == 2); // OK <- NG return 1; }()); /************************************************** 14463 - ICE on slice assignment without postblit **************************************************/ struct Boo14463 { private int[1] c; this(int[] x) { c = x; } } immutable Boo14463 a14463 = Boo14463([1]); /************************************************** 13295 - Don't copy struct literal in VarExp::interpret() **************************************************/ struct S13295 { int n; } void f13295(ref const S13295 s) { *cast(int*) &s.n = 1; assert(s.n == 1); // OK <- fail } static assert( { S13295 s; f13295(s); return s.n == 1; // true <- false }()); int foo14061(int[] a) { foreach (immutable x; a) { auto b = a ~ x; return b == [1, 1]; } return 0; } static assert(foo14061([1])); /************************************************** 14024 - CTFE version **************************************************/ bool test14024() { string op; struct S { char x = 'x'; this(this) { op ~= x-0x20; } // upper case ~this() { op ~= x; } // lower case } S[4] mem; ref S[2] slice(int a, int b) { return mem[a .. b][0 .. 2]; } op = null; mem[0].x = 'a'; mem[1].x = 'b'; mem[2].x = 'x'; mem[3].x = 'y'; slice(0, 2) = slice(2, 4); // [ab] = [xy] assert(op == "XaYb", op); op = null; mem[0].x = 'x'; mem[1].x = 'y'; mem[2].x = 'a'; mem[3].x = 'b'; slice(2, 4) = slice(0, 2); // [ab] = [xy] assert(op == "XaYb", op); op = null; mem[0].x = 'a'; mem[1].x = 'b'; mem[2].x = 'c'; slice(0, 2) = slice(1, 3); // [ab] = [bc] assert(op == "BaCb", op); op = null; mem[0].x = 'x'; mem[1].x = 'y'; mem[2].x = 'z'; slice(1, 3) = slice(0, 2); // [yz] = [xy] assert(op == "YzXy", op); return true; } static assert(test14024()); /************************************************** 14304 - cache of static immutable value **************************************************/ immutable struct Bug14304 { string s_name; alias s_name this; string fun()() { return "fun"; } } class Buggy14304 { static string fun(string str)() { return str; } static immutable val = immutable Bug14304("val"); } void test14304() { enum kt = Buggy14304.fun!(Buggy14304.val); static assert(kt == "val"); enum bt = Buggy14304.val.fun(); static assert(bt == "fun"); } /************************************************** 14371 - evaluate BinAssignExp as lvalue **************************************************/ int test14371() { int x; ++(x += 1); return x; } static assert(test14371() == 2); /************************************************** 7151 - [CTFE] cannot compare classes with == **************************************************/ bool test7151() { auto a = new Object; return a == a && a != new Object; } static assert(test7151()); /************************************************** 12603 - [CTFE] goto does not correctly call dtors **************************************************/ struct S12603 { this(uint* dtorCalled) { *dtorCalled = 0; this.dtorCalled = dtorCalled; } @disable this(); ~this() { ++*dtorCalled; } uint* dtorCalled; } auto numDtorCallsByGotoWithinScope() { uint dtorCalled; { S12603 s = S12603(&dtorCalled); assert(dtorCalled == 0); goto L_abc; L_abc: assert(dtorCalled == 0); } assert(dtorCalled == 1); return dtorCalled; } static assert(numDtorCallsByGotoWithinScope() == 1); auto numDtorCallsByGotoOutOfScope() { uint dtorCalled; { S12603 s = S12603(&dtorCalled); assert(dtorCalled == 0); goto L_abc; } L_abc: assert(dtorCalled == 1); return dtorCalled; } static assert(numDtorCallsByGotoOutOfScope() == 1); uint numDtorCallsByGotoDifferentScopeAfter() { uint dtorCalled; { S12603 s = S12603(&dtorCalled); assert(dtorCalled == 0); } assert(dtorCalled == 1); goto L_abc; L_abc: assert(dtorCalled == 1); return dtorCalled; } static assert(numDtorCallsByGotoDifferentScopeAfter() == 1); auto numDtorCallsByGotoDifferentScopeBefore() { uint dtorCalled; assert(dtorCalled == 0); goto L_abc; L_abc: assert(dtorCalled == 0); { S12603 s = S12603(&dtorCalled); assert(dtorCalled == 0); } assert(dtorCalled == 1); return dtorCalled; } static assert(numDtorCallsByGotoDifferentScopeBefore() == 1); struct S12603_2 { ~this() { dtorCalled = true; } bool dtorCalled = false; } auto structInCaseScope() { auto charsets = S12603_2(); switch(1) { case 0: auto set = charsets; break; default: break; } return charsets.dtorCalled; } static assert(!structInCaseScope()); /************************************************** 15233 - ICE in TupleExp, Copy On Write bug **************************************************/ alias TT15233(stuff ...) = stuff; struct Tok15233 {} enum tup15233 = TT15233!(Tok15233(), "foo"); static assert(tup15233[0] == Tok15233()); static assert(tup15233[1] == "foo"); /************************************************** 15251 - void cast in ForStatement.increment **************************************************/ int test15251() { for (ubyte lwr = 19; lwr != 20; cast(void)++lwr) // have to to be evaluated with ctfeNeedNothing {} return 1; } static assert(test15251()); /************************************************** 15998 - Sagfault caused by memory corruption **************************************************/ immutable string[2] foo15998 = ["",""]; immutable string[2][] bar15998a = foo15998 ~ baz15998; immutable string[2][] bar15998b = baz15998 ~ foo15998; auto baz15998() { immutable(string[2])[] r; return r; } static assert(bar15998a == [["", ""]]); static assert(bar15998b == [["", ""]]);
D
module Dgame.Internal.d2c; private: //import Dgame.Internal.Error; import Dgame.Internal.m3; char[] heapBuffer; char[256] stackBuffer = void; @nogc char* make_buffer(size_t len) nothrow { if (stackBuffer.length > len) return stackBuffer.ptr; if (heapBuffer.length > len) return heapBuffer.ptr; //print_fmt("(Re)Order heap buffer: %d\n", len + 1); heapBuffer = remake(heapBuffer, len + 1); return heapBuffer.ptr; } public: @nogc static ~this() nothrow { //print_fmt("Free heap buffer: %d\n", heapBuffer.length); unmake(heapBuffer); } @nogc const(char)* toStringz(string text) nothrow { if (text.length == 0) return null; if (text[$ - 1] == '\0') return text.ptr; char* ptr = make_buffer(text.length); ptr[0 .. text.length] = text[]; ptr[text.length] = '\0'; return ptr; }
D
/** License: 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. Authors: Alexandru Ermicioi **/ module aermicioi.aedi.container.prototype_container; import aermicioi.aedi.container.container; import aermicioi.aedi.storage.object_storage; import aermicioi.aedi.util.typecons : Pair, pair; import aermicioi.aedi.factory.factory; import aermicioi.aedi.exception; import aermicioi.aedi.container.factory; import std.range.interfaces; /** Prototype container. Instantiates a new object using passed ObjectFactory implementation, on each request of it by some part of an application. **/ @safe class PrototypeContainer : ConfigurableContainer { private { ObjectStorage!(ObjectFactory, string) factories; ObjectStorage!(Object[], string) proxies; } public { /** * Default constructor for PrototypeContainer **/ this() { this.factories = new ObjectStorage!(ObjectFactory, string); this.proxies = new ObjectStorage!(Object[], string); } /** * Set object factory * * Params: * object = factory for a object that is to be managed by prototype container. * key = identity of factory * Returns: * typeof(this) **/ PrototypeContainer set(ObjectFactory object, string key) { this.factories.set(new ExceptionChainingObjectFactory(new InProcessObjectFactoryDecorator(object), key), key); return this; } /** * Remove an object factory from container. * * Params: * key = identity of factory to be removed * Returns: * typeof(this) **/ PrototypeContainer remove(string key) { if (this.proxies.has(key)) { import std.algorithm : each; this.proxies.get(key).each!((proxy) => this.factories.get(key).destruct(proxy)); } this.factories.remove(key); this.proxies.remove(key); return this; } /** * Get object created by a factory identified by key * * Params: * key = identity of factory * Returns: * Object **/ Object get(string key) { if (this.factories.has(key)) { Object obj = this.factories.get(key).factory(); Object[] proxies; if (this.proxies.has(key)) { proxies = this.proxies.get(key); } this.proxies.set(proxies ~ obj, key); return obj; } throw new NotFoundException("Component ${identity} not found", key); } /** * Check if an object factory for it exists in container. * * Params: * key = identity of factory * Returns: * bool **/ bool has(in string key) inout { return this.factories.has(key); } /** Sets up the internal state of container. Sets up the internal state of container (Ex, for singleton container it will spawn all objects that locator contains). **/ PrototypeContainer instantiate() { return this; } /** Destruct all managed components. Destruct all managed components. The method denotes the end of container lifetime, and therefore destruction of all managed components by it. **/ PrototypeContainer terminate() { import std.algorithm : each; foreach (pair; this.proxies.contents.byKeyValue) { pair.value.each!((proxy) => this.factories.get(pair.key).destruct(proxy)); } (() @trusted scope => this.proxies.contents.clear)(); return this; } /** Alias a key to an alias_. Params: key = the originial identity which is to be aliased. alias_ = the alias of identity. Returns: this **/ PrototypeContainer link(string key, string alias_) { this.factories.link(key, alias_); return this; } /** Removes alias. Params: alias_ = alias to remove. Returns: this **/ PrototypeContainer unlink(string alias_) { this.factories.unlink(alias_); return this; } /** Resolve an alias to original identity, if possible. Params: key = alias of original identity Returns: Type the last identity in alias chain. **/ const(string) resolve(in string key) const { return this.factories.resolve(key); } /** Get factory for constructed component identified by identity. Get factory for constructed component identified by identity. Params: identity = the identity of component that factory constructs. Throws: NotFoundException when factory for it is not found. Returns: ObjectFactory the factory for constructed component. **/ ObjectFactory getFactory(string identity) { return this.factories.get(identity); } /** Get all factories available in container. Get all factories available in container. Returns: InputRange!(Pair!(ObjectFactory, string)) a pair of factory => identity. **/ InputRange!(Pair!(ObjectFactory, string)) getFactories() { import std.algorithm : map; return this.factories.contents.byKeyValue.map!( a => Pair!(ObjectFactory, string)(a.value, a.key) ).inputRangeObject; } } }
D
module UnrealScript.Engine.ForceFieldShapeCapsule; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.Engine.ForceFieldShape; extern(C++) interface ForceFieldShapeCapsule : ForceFieldShape { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.ForceFieldShapeCapsule")); } private static __gshared ForceFieldShapeCapsule mDefaultProperties; @property final static ForceFieldShapeCapsule DefaultProperties() { mixin(MGDPC("ForceFieldShapeCapsule", "ForceFieldShapeCapsule Engine.Default__ForceFieldShapeCapsule")); } static struct Functions { private static __gshared { ScriptFunction mGetHeight; ScriptFunction mGetRadius; ScriptFunction mFillBySphere; ScriptFunction mFillByBox; ScriptFunction mFillByCapsule; ScriptFunction mFillByCylinder; ScriptFunction mGetDrawComponent; } public @property static final { ScriptFunction GetHeight() { mixin(MGF("mGetHeight", "Function Engine.ForceFieldShapeCapsule.GetHeight")); } ScriptFunction GetRadius() { mixin(MGF("mGetRadius", "Function Engine.ForceFieldShapeCapsule.GetRadius")); } ScriptFunction FillBySphere() { mixin(MGF("mFillBySphere", "Function Engine.ForceFieldShapeCapsule.FillBySphere")); } ScriptFunction FillByBox() { mixin(MGF("mFillByBox", "Function Engine.ForceFieldShapeCapsule.FillByBox")); } ScriptFunction FillByCapsule() { mixin(MGF("mFillByCapsule", "Function Engine.ForceFieldShapeCapsule.FillByCapsule")); } ScriptFunction FillByCylinder() { mixin(MGF("mFillByCylinder", "Function Engine.ForceFieldShapeCapsule.FillByCylinder")); } ScriptFunction GetDrawComponent() { mixin(MGF("mGetDrawComponent", "Function Engine.ForceFieldShapeCapsule.GetDrawComponent")); } } } // ERROR: Unsupported object class 'ComponentProperty' for the property named 'Shape'! final: float GetHeight() { ubyte params[4]; params[] = 0; (cast(ScriptObject)this).ProcessEvent(Functions.GetHeight, params.ptr, cast(void*)0); return *cast(float*)params.ptr; } float GetRadius() { ubyte params[4]; params[] = 0; (cast(ScriptObject)this).ProcessEvent(Functions.GetRadius, params.ptr, cast(void*)0); return *cast(float*)params.ptr; } void FillBySphere(float Radius) { ubyte params[4]; params[] = 0; *cast(float*)params.ptr = Radius; (cast(ScriptObject)this).ProcessEvent(Functions.FillBySphere, params.ptr, cast(void*)0); } void FillByBox(Vector Extent) { ubyte params[12]; params[] = 0; *cast(Vector*)params.ptr = Extent; (cast(ScriptObject)this).ProcessEvent(Functions.FillByBox, params.ptr, cast(void*)0); } void FillByCapsule(float Height, float Radius) { ubyte params[8]; params[] = 0; *cast(float*)params.ptr = Height; *cast(float*)&params[4] = Radius; (cast(ScriptObject)this).ProcessEvent(Functions.FillByCapsule, params.ptr, cast(void*)0); } void FillByCylinder(float BottomRadius, float TopRadius, float Height, float HeightOffset) { ubyte params[16]; params[] = 0; *cast(float*)params.ptr = BottomRadius; *cast(float*)&params[4] = TopRadius; *cast(float*)&params[8] = Height; *cast(float*)&params[12] = HeightOffset; (cast(ScriptObject)this).ProcessEvent(Functions.FillByCylinder, params.ptr, cast(void*)0); } // ERROR: Unknown object class 'Class Core.ComponentProperty'! void* GetDrawComponent() { ubyte params[4]; params[] = 0; (cast(ScriptObject)this).ProcessEvent(Functions.GetDrawComponent, params.ptr, cast(void*)0); return *cast( // ERROR: Unknown object class 'Class Core.ComponentProperty'! void**)params.ptr; } }
D
// Written in the D programming language /** * D constrains integral types to specific sizes. But efficiency of different sizes varies from machine to machine, pointer sizes vary, and the maximum integer size varies. <b>stdint</b> offers a portable way of trading off size vs efficiency, in a manner compatible with the <tt>stdint.h</tt> definitions in C. The exact aliases are types of exactly the specified number of bits. The at least aliases are at least the specified number of bits large, and can be larger. The fast aliases are the fastest integral type supported by the processor that is at least as wide as the specified number of bits. The aliases are: <table border=1 cellspacing=0 cellpadding=5> <th>Exact Alias <th>Description <th>At Least Alias <th>Description <th>Fast Alias <th>Description <tr> <td>int8_t <td>exactly 8 bits signed <td>int_least8_t <td>at least 8 bits signed <td>int_fast8_t <td>fast 8 bits signed <tr> <td>uint8_t <td>exactly 8 bits unsigned <td>uint_least8_t <td>at least 8 bits unsigned <td>uint_fast8_t <td>fast 8 bits unsigned <tr> <td>int16_t <td>exactly 16 bits signed <td>int_least16_t <td>at least 16 bits signed <td>int_fast16_t <td>fast 16 bits signed <tr> <td>uint16_t <td>exactly 16 bits unsigned <td>uint_least16_t <td>at least 16 bits unsigned <td>uint_fast16_t <td>fast 16 bits unsigned <tr> <td>int32_t <td>exactly 32 bits signed <td>int_least32_t <td>at least 32 bits signed <td>int_fast32_t <td>fast 32 bits signed <tr> <td>uint32_t <td>exactly 32 bits unsigned <td>uint_least32_t <td>at least 32 bits unsigned <td>uint_fast32_t <td>fast 32 bits unsigned <tr> <td>int64_t <td>exactly 64 bits signed <td>int_least64_t <td>at least 64 bits signed <td>int_fast64_t <td>fast 64 bits signed <tr> <td>uint64_t <td>exactly 64 bits unsigned <td>uint_least64_t <td>at least 64 bits unsigned <td>uint_fast64_t <td>fast 64 bits unsigned </table> The ptr aliases are integral types guaranteed to be large enough to hold a pointer without losing bits: <table border=1 cellspacing=0 cellpadding=5> <th>Alias <th>Description <tr> <td>intptr_t <td>signed integral type large enough to hold a pointer <tr> <td>uintptr_t <td>unsigned integral type large enough to hold a pointer </table> The max aliases are the largest integral types: <table border=1 cellspacing=0 cellpadding=5> <th>Alias <th>Description <tr> <td>intmax_t <td>the largest signed integral type <tr> <td>uintmax_t <td>the largest unsigned integral type </table> * Authors: Walter Bright, www.digitalmars.com * License: Public Domain * Macros: * WIKI=Phobos/StdStdint */ module std.stdint; /* Exact sizes */ alias byte int8_t; alias ubyte uint8_t; alias short int16_t; alias ushort uint16_t; alias int int32_t; alias uint uint32_t; alias long int64_t; alias ulong uint64_t; /* At least sizes */ alias byte int_least8_t; alias ubyte uint_least8_t; alias short int_least16_t; alias ushort uint_least16_t; alias int int_least32_t; alias uint uint_least32_t; alias long int_least64_t; alias ulong uint_least64_t; /* Fastest minimum width sizes */ alias byte int_fast8_t; alias ubyte uint_fast8_t; alias int int_fast16_t; alias uint uint_fast16_t; alias int int_fast32_t; alias uint uint_fast32_t; alias long int_fast64_t; alias ulong uint_fast64_t; /* Integer pointer holders */ alias int intptr_t; alias uint uintptr_t; /* Greatest width integer types */ alias long intmax_t; alias ulong uintmax_t;
D
/++ DAuth - Salted Hashed Password Library for D Core package +/ module dauth.core; import std.algorithm; import std.array; import ascii = std.ascii; import std.base64; import std.conv; import std.digest.crc; import std.digest.md; import std.digest.ripemd; import std.digest.sha; import std.exception; import std.functional; import std.random; import std.range; import std.traits; import std.typecons; import dauth.random : randomSalt; import dauth.hashdrbg; // Only use dauth.sha if SHA-2 isn't in Phobos (ie, DMD 2.065 and below) static if(!is(std.digest.sha.SHA512)) { import dauth.sha; private alias SHA1 = dauth.sha.SHA1; private alias SHA1Digest = dauth.sha.SHA1Digest; private alias sha1Of = dauth.sha.sha1Of; } version(DAuth_Unittest) { version(DAuth_Unittest_Quiet) {} else version = Loud_Unittest; version(Loud_Unittest) import std.stdio; void unitlog(string str) { version(Loud_Unittest) { writeln("unittest DAuth: ", str); stdout.flush(); } } } version(DAuth_AllowWeakSecurity) {} else { version = DisallowWeakSecurity; } alias Salt = ubyte[]; /// Salt type alias Salter(TDigest) = void delegate(ref TDigest, Password, Salt); /// Convenience alias for salter delegates. alias DefaultCryptoRand = HashDRBGStream!(SHA512, "DAuth"); /// Default is Hash_DRBG using SHA-512 alias DefaultDigest = SHA512; /// Default is SHA-512 alias DefaultDigestClass = WrapperDigest!DefaultDigest; /// OO-style version of 'DefaultDigest'. alias TokenBase64 = Base64Impl!('-', '_', '~'); /// Implementation of Base64 engine used for tokens. /++ Default implementation of 'digestCodeOfObj' for DAuth-style hash strings. See 'Hash!(TDigest).toString' for more info. +/ string defaultDigestCodeOfObj(Digest digest) { if (cast( CRC32Digest )digest) return "CRC32"; else if(cast( MD5Digest )digest) return "MD5"; else if(cast( RIPEMD160Digest )digest) return "RIPEMD160"; else if(cast( SHA1Digest )digest) return "SHA1"; else if(cast( SHA224Digest )digest) return "SHA224"; else if(cast( SHA256Digest )digest) return "SHA256"; else if(cast( SHA384Digest )digest) return "SHA384"; else if(cast( SHA512Digest )digest) return "SHA512"; else if(cast( SHA512_224Digest )digest) return "SHA512_224"; else if(cast( SHA512_256Digest )digest) return "SHA512_256"; else throw new UnknownDigestException("Unknown digest type"); } /++ Default implementation of 'digestFromCode' for DAuth-style hash strings. See 'parseHash' for more info. +/ Digest defaultDigestFromCode(string digestCode) { switch(digestCode) { case "CRC32": return new CRC32Digest(); case "MD5": return new MD5Digest(); case "RIPEMD160": return new RIPEMD160Digest(); case "SHA1": return new SHA1Digest(); case "SHA224": return new SHA224Digest(); case "SHA256": return new SHA256Digest(); case "SHA384": return new SHA384Digest(); case "SHA512": return new SHA512Digest(); case "SHA512_224": return new SHA512_224Digest(); case "SHA512_256": return new SHA512_256Digest(); default: throw new UnknownDigestException("Unknown digest code"); } } /++ Default implementation of 'digestCodeOfObj' for Unix crypt-style hash strings. See 'Hash!(TDigest).toString' for more info. +/ string defaultDigestCryptCodeOfObj(Digest digest) { if (cast( MD5Digest )digest) return "1"; else if(cast( SHA256Digest )digest) return "5"; else if(cast( SHA512Digest )digest) return "6"; else throw new UnknownDigestException("Unknown digest type"); } /++ Default implementation of 'digestFromCode' for Unix crypt-style hash strings. See 'parseHash' for more info. +/ Digest defaultDigestFromCryptCode(string digestCode) { switch(digestCode) { case "": throw new UnknownDigestException(`Old crypt-DES not currently supported`); case "1": return new MD5Digest(); case "5": return new SHA256Digest(); case "6": return new SHA512Digest(); default: throw new UnknownDigestException("Unknown digest code"); } } /// Default salter for 'makeHash' and 'isSameHash'. void defaultSalter(TDigest)(ref TDigest digest, Password password, Salt salt) if(isAnyDigest!TDigest) { digest.put(cast(immutable(ubyte)[])salt); digest.put(password.data); } /++ Note, this only checks Phobos's RNG's and digests, and only by type. This works on a blacklist basis - it blindly accepts any Phobos-compatible RNG or digest it does not know about. This is only supplied as a convenience. It is always your own responsibility to select an appropriate algorithm for your own needs. And yes, unfortunately, this does currently rule out all RNG's and digests currently in Phobos (as of v2.065). They are all known to be fairly weak for password-hashing purposes, even SHA1 which despite being heavily used has known security flaws. For random number generators, you should use a CPRNG (cryptographically secure pseudorandom number generator): $(LINK http://en.wikipedia.org/wiki/Cryptographically_secure_pseudo-random_number_generator ) For digests, you should use one of the SHA-2 algorithms (for example, SHA512) or, better yet, an established "key stretching" algorithm ( $(LINK http://en.wikipedia.org/wiki/Key_stretching#History) ), intended for password hashing. These contain deliberate inefficiencies that cannot be optimized away even with massive parallelization (such as a GPU cluster). These are NOT too inefficient to use for even high-traffic authentication, but they do thwart the parallelized brute force attacks that algorithms used for streaming data encryption, such as SHA, are increasingly susceptible to. $(LINK https://crackstation.net/hashing-security.htm) +/ bool isKnownWeak(T)() if(isDigest!T || isSomeRandom!T) { return is(T == CRC32) || is(T == MD5) || is(T == RIPEMD160) || is(T == SHA1) || // Requires to-be-released DMD 2.066: //__traits(isSame, TemplateOf!T, LinearCongruentialEngine) || //__traits(isSame, TemplateOf!T, MersenneTwisterEngine) || //__traits(isSame, TemplateOf!T, XorshiftEngine); is(T == MinstdRand0) || is(T == MinstdRand) || is(T == Mt19937) || is(T == Xorshift32) || is(T == Xorshift64) || is(T == Xorshift96) || is(T == Xorshift128) || is(T == Xorshift160) || is(T == Xorshift192) || is(T == Xorshift); } ///ditto bool isKnownWeak(T)(T digest) if(is(T : Digest)) { return cast(CRC32Digest)digest || cast(MD5Digest)digest || cast(RIPEMD160Digest)digest || cast(SHA1Digest)digest; } private void validateStrength(T)() if(isDigest!T || isSomeRandom!T) { version(DisallowWeakSecurity) { static if(isKnownWeak!T()) { pragma(msg, "ERROR: "~T.stringof~" - "~KnownWeakException.message); static assert(false); } } } private void validateStrength(Digest digest) { version(DisallowWeakSecurity) { enforce(!isKnownWeak(digest), new KnownWeakException(defaultDigestCodeOfObj(digest))); } } /++ Thrown whenever a digest type cannot be determined. For example, when the provided (or default) 'digestCodeOfObj' or 'digestFromCode' delegates fail to find a match. Or when passing isSameHash a Hash!Digest with a null 'digest' member (which prevents it from determining the correct digest to match with). +/ class UnknownDigestException : Exception { this(string msg) { super(msg); } } /++ Thrown when a known-weak algortihm or setting it attempted, UNLESS compiled with '-version=DAuth_AllowWeakSecurity' +/ class KnownWeakException : Exception { static enum message = "This is known to be weak for salted password hashing. "~ "If you understand and accept the risks, you can force DAuth "~ "to allow it with -version=DAuth_AllowWeakSecurity"; this(string algoName) { super(algoName ~ " - " ~ message); } } /++ Like std.digest.digest.isDigest, but also accepts OO-style digests (ie. classes deriving from interface std.digest.digest.Digest) +/ template isAnyDigest(TDigest) { enum isAnyDigest = isDigest!TDigest || is(TDigest : Digest); } version(DAuth_Unittest) unittest { struct Foo {} static assert(isAnyDigest!SHA1); static assert(isAnyDigest!SHA1Digest); static assert(isAnyDigest!SHA256); static assert(isAnyDigest!SHA256Digest); static assert(!isAnyDigest!Foo); static assert(!isAnyDigest!Object); } /++ Like std.digest.digest.DigestType, but also accepts OO-style digests (ie. classes deriving from interface std.digest.digest.Digest) +/ template AnyDigestType(TDigest) { static assert(isAnyDigest!TDigest, TDigest.stringof ~ " is not a template-style or OO-style digest (fails isAnyDigest!T)"); static if(isDigest!TDigest) alias AnyDigestType = DigestType!TDigest; else alias AnyDigestType = ubyte[]; } version(DAuth_Unittest) unittest { struct Foo {} static assert( is(AnyDigestType!SHA1 == ubyte[20]) ); static assert( is(AnyDigestType!SHA1Digest == ubyte[]) ); static assert( is(AnyDigestType!SHA512 == ubyte[64]) ); static assert( is(AnyDigestType!SHA512Digest == ubyte[]) ); static assert( !is(AnyDigestType!Foo) ); static assert( !is(AnyDigestType!Object) ); } /// Tests if the type is an instance of struct Hash(some digest) template isHash(T) { enum isHash = is( Hash!(TemplateArgsOf!(T)[0]) == T ); } version(DAuth_Unittest) unittest { struct Foo {} struct Bar(T) { T digest; } static assert( isHash!(Hash!SHA1) ); static assert( isHash!(Hash!SHA1Digest) ); static assert( isHash!(Hash!SHA512) ); static assert( isHash!(Hash!SHA512Digest) ); static assert( !isHash!Foo ); static assert( !isHash!(Bar!int) ); static assert( !isHash!(Bar!Object) ); static assert( !isHash!(Bar!SHA1) ); static assert( !isHash!(Bar!SHA1Digest) ); } /// Retreive the digest type of a struct Hash(some digest) template DigestOf(T) if(isHash!T) { alias DigestOf = TemplateArgsOf!(T)[0]; } version(DAuth_Unittest) unittest { static assert(is( DigestOf!(Hash!SHA1 ) == SHA1 )); static assert(is( DigestOf!(Hash!SHA512) == SHA512)); static assert(is( DigestOf!(Hash!Digest) == Digest)); } string getDigestCode(TDigest)(string delegate(Digest) digestCodeOfObj, TDigest digest) if(isAnyDigest!TDigest) { static if(is(TDigest : Digest)) return digestCodeOfObj(digest); else { auto digestObj = new WrapperDigest!TDigest(); return digestCodeOfObj(digestObj); } } /++ A reference-counted type for passwords. The memory containing the password is automatically zeroed-out when there are no more references or when a new password is assigned. If you keep any direct references to Password.data, be aware it may get cleared. Create a Password via functions 'toPassword' or 'dupPassword'. The payload is a private struct that supports the following: --------------------------------------------------------- @property ubyte[] data(): Retrieve the actual plaintext password @property size_t length() const: Retrieve the password length void opAssign(PasswordData rhs): Assignment void opAssign(ubyte[] rhs): Assignment ~this(): Destructor --------------------------------------------------------- +/ alias Password = RefCounted!PasswordData; /// Payload of Password private struct PasswordData { private ubyte[] _data; @property ubyte[] data() { return _data; } @property size_t length() const { return _data.length; } void opAssign(PasswordData rhs) { opAssign(rhs._data); } void opAssign(ubyte[] rhs) { clear(); this._data = rhs; } ~this() { clear(); } private void clear() { _data[] = 0; } } /++ Constructs a Password from a ubyte[]. Mainly provided for syntactic consistency with 'toPassword(char[])'. +/ Password toPassword(ubyte[] password) { return Password(password); } /++ Constructs a Password from a char[] so you don't have to cast to ubyte[], and don't accidentally cast away immutability. +/ Password toPassword(char[] password) { return Password(cast(ubyte[])password); } /++ This function exists as a convenience in case you need it, HOWEVER it's recommended to design your code so you DON'T need to use this (use toPassword instead): Using this to create a Password cannot protect the in-memory data of your original string because a string's data is immutable (this function must .dup the memory). While immutability usually improves safety, you should avoid ever storing unhashed passwords in immutables because they cannot be reliably zero-ed out. +/ Password dupPassword(string password) { return toPassword(password.dup); } /++ Contains all the relevant information for a salted hash. Note the digest type can be obtained via DigestOf!(SomeHashType). +/ struct Hash(TDigest) if(isAnyDigest!TDigest) { Salt salt; /// The salt that was used. /++ The hash of the salted password. To obtain a printable DB-friendly string, pass this to std.digest.digest.toHexString. +/ AnyDigestType!TDigest hash; /// The digest that was used for hashing. TDigest digest; /++ Encodes the digest, salt and hash into a convenient forward-compatible string format, ready for insertion into a database. To support additional digests besides the built-in (Phobos's CRC32, MD5, RIPEMD160 and SHA), supply a custom delegate for digestCodeOfObj. Your custom digestCodeOfObj only needs to handle OO-style digests. As long as the OO-style digests were created using Phobos's WrapperDigest template, the template-style version will be handled automatically. You can defer to DAuth's defaultDigestCodeOfObj to handle the built-in digests. Example: ------------------- import std.digest.digest; import dauth; struct BBQ42 {...} static assert(isDigest!BBQ42); alias BBQ42Digest = WrapperDigest!BBQ42; string customDigestCodeOfObj(Digest digest) { if (cast(BBQ42Digest)digest) return "BBQ42"; else if(cast(FAQ17Digest)digest) return "FAQ17"; else return defaultDigestCodeOfObj(digest); } void doStuff(Hash!BBQ42 hash) { writeln( hash.toString(&customDigestCodeOfObj) ); } ------------------- Optional_Params: digestCodeOfObj - Default value is 'toDelegate(&defaultDigestCodeOfObj)' +/ string toString(string delegate(Digest) digestCodeOfObj = toDelegate(&defaultDigestCodeOfObj)) { Appender!string sink; toString(sink, digestCodeOfObj); return sink.data; } ///ditto void toString(Sink)(ref Sink sink, string delegate(Digest) digestCodeOfObj = toDelegate(&defaultDigestCodeOfObj)) if(isOutputRange!(Sink, const(char))) { sink.put('['); sink.put(getDigestCode(digestCodeOfObj, digest)); sink.put(']'); Base64.encode(salt, sink); sink.put('$'); Base64.encode(hash, sink); } /++ Just like toString, but instead of standard DAuth-style format, the output string is in the crypt(3)-style format. The crypt(3) format does not support all hash types, and DAuth doesn't necessarily support all possible forms of crypt(3) hashes (although it does strive to support as many as possible). DAuth currently supports crypt(3)-style format for MD5, SHA256 and SHA512 hashes. Other hashes (unless manually handled by a custom digestCodeOfObj) will cause an UnknownDigestException to be thrown. The default digestCodeOfObj for this function is defaultDigestCryptCodeOfObj. Optional_Params: digestCodeOfObj - Default value is 'toDelegate(&defaultDigestCryptCodeOfObj)' See also: $(LINK https://en.wikipedia.org/wiki/Crypt_%28C%29) +/ string toCryptString(string delegate(Digest) digestCodeOfObj = toDelegate(&defaultDigestCryptCodeOfObj)) { Appender!string sink; toCryptString(sink, digestCodeOfObj); return sink.data; } ///ditto void toCryptString(Sink)(ref Sink sink, string delegate(Digest) digestCodeOfObj = toDelegate(&defaultDigestCryptCodeOfObj)) if(isOutputRange!(Sink, const(char))) { sink.put('$'); sink.put(getDigestCode(digestCodeOfObj, digest)); sink.put('$'); Base64.encode(salt, sink); sink.put('$'); Base64.encode(hash, sink); } } /++ Generates a salted password using any Phobos-compatible digest, default being SHA-512. (Note: An established "key stretching" algorithm ( $(LINK http://en.wikipedia.org/wiki/Key_stretching#History) ) would be an even better choice of digest since they provide better protection against highly-parallelized (ex: GPU) brute-force attacks. But SHA-512, as an SHA-2 algorithm, is still considered cryptographically secure.) Supports both template-style and OO-style digests. See the documentation of std.digest.digest for details. Salt is optional. It will be generated at random if not provided. Normally, the salt and password are combined as (psuedocode) 'salt~password'. There is no cryptographic benefit to combining the salt and password any other way. However, if you need to support an alternate method for compatibility purposes, you can do so by providing a custom salter delegate. See the implementation of DAuth's defaultSalter to see how to do this. If using an OO-style Digest, then digest MUST be non-null. Otherwise, an UnknownDigestException will be thrown. Optional_Params: salt - Default value is 'randomSalt()' salter - Default value is 'toDelegate(&defaultSalter!TDigest)' +/ Hash!TDigest makeHash(TDigest = DefaultDigest) (Password password, Salt salt = randomSalt(), Salter!TDigest salter = toDelegate(&defaultSalter!TDigest)) if(isDigest!TDigest) { validateStrength!TDigest(); TDigest digest; return makeHashImpl!TDigest(digest, password, salt, salter); } ///ditto Hash!TDigest makeHash(TDigest = DefaultDigest)(Password password, Salter!TDigest salter) if(isDigest!TDigest) { validateStrength!TDigest(); TDigest digest; return makeHashImpl(digest, password, randomSalt(), salter); } ///ditto Hash!Digest makeHash()(Digest digest, Password password, Salt salt = randomSalt(), Salter!Digest salter = toDelegate(&defaultSalter!Digest)) { enforce(digest, new UnknownDigestException("digest was null, don't know what digest to use")); validateStrength(digest); return makeHashImpl!Digest(digest, password, salt, salter); } ///ditto Hash!Digest makeHash()(Digest digest, Password password, Salter!Digest salter) { enforce(digest, new UnknownDigestException("digest was null, don't know what digest to use")); validateStrength(digest); return makeHashImpl!Digest(digest, password, randomSalt(), salter); } private Hash!TDigest makeHashImpl(TDigest) (ref TDigest digest, Password password, Salt salt, Salter!TDigest salter) if(isAnyDigest!TDigest) { Hash!TDigest ret; ret.digest = digest; ret.salt = salt; static if(isDigest!TDigest) // template-based digest ret.digest.start(); else ret.digest.reset(); // OO-based digest salter(ret.digest, password, salt); ret.hash = ret.digest.finish(); return ret; } /++ Parses a string that was encoded by Hash.toString. Only OO-style digests are used since the digest is specified in the string and therefore only known at runtime. Throws ConvException if the string is malformed. To support additional digests besides the built-in (Phobos's CRC32, MD5, RIPEMD160 and SHA), supply a custom delegate for digestFromDAuthCode. You can defer to DAuth's defaultDigestFromCode to handle the built-in digests. Similarly, to extend crypt(3)-style to support additional digests beyond DAuth's crypt(3) support, supply a custom delegate for digestFromCryptCode. The default implementation is defaultDigestFromCryptCode. Example: ------------------- import std.digest.digest; import dauth; struct BBQ42 {...} static assert(isDigest!BBQ42); alias BBQ42Digest = WrapperDigest!BBQ42; Digest customDigestFromCode(string digestCode) { switch(digestCode) { case "BBQ42": return new BBQ42Digest(); case "FAQ17": return new FAQ17Digest(); default: return defaultDigestFromCode(digestCode); } } void doStuff(string hashString) { auto hash = parseHash(hashString, &customDigestFromCode); } ------------------- Optional_Params: digestFromDAuthCode - Default value is 'toDelegate(&defaultDigestFromCode)' digestFromCryptCode - Default value is 'toDelegate(&defaultDigestFromCryptCode)' +/ Hash!Digest parseHash(string str, Digest delegate(string) digestFromDAuthCode = toDelegate(&defaultDigestFromCode), Digest delegate(string) digestFromCryptCode = toDelegate(&defaultDigestFromCryptCode)) { enforceEx!ConvException(!str.empty); if(str[0] == '[') return parseDAuthHash(str, digestFromDAuthCode); else if(str[0] == '$' || str.length == 13) return parseCryptHash(str, digestFromCryptCode); throw new ConvException("Hash string is neither valid DAuth-style nor crypt-style"); } ///ditto Hash!Digest parseDAuthHash(string str, Digest delegate(string) digestFromDAuthCode = toDelegate(&defaultDigestFromCode)) { // No need to mess with UTF auto bytes = cast(immutable(ubyte)[]) str; // Parse '[' enforceEx!ConvException(!bytes.empty); enforceEx!ConvException(bytes.front == cast(ubyte)'['); bytes.popFront(); // Parse digest code auto splitRBracket = bytes.findSplit([']']); enforceEx!ConvException( !splitRBracket[0].empty && !splitRBracket[1].empty && !splitRBracket[2].empty ); auto digestCode = splitRBracket[0]; bytes = splitRBracket[2]; // Split salt and hash auto splitDollar = bytes.findSplit(['$']); enforceEx!ConvException( !splitDollar[0].empty && !splitDollar[1].empty && !splitDollar[2].empty ); auto salt = splitDollar[0]; auto hash = splitDollar[2]; // Construct Hash Hash!Digest result; result.salt = Base64.decode(salt); result.hash = Base64.decode(hash); result.digest = digestFromDAuthCode(cast(string)digestCode); return result; } ///ditto Hash!Digest parseCryptHash(string str, Digest delegate(string) digestFromCryptCode = toDelegate(&defaultDigestFromCryptCode)) { // No need to mess with UTF auto bytes = cast(immutable(ubyte)[]) str; enforceEx!ConvException(!bytes.empty); // Old crypt-DES style? if(bytes[0] != cast(ubyte)'$' && bytes.length == 13) { auto salt = bytes[0..2]; auto hash = bytes[2..$]; // Construct Hash Hash!Digest result; result.salt = salt.dup; result.hash = hash.dup; result.digest = digestFromCryptCode(null); return result; } // Parse initial '$' enforceEx!ConvException(bytes.front == cast(ubyte)'$'); bytes.popFront(); // Split digest code, salt and hash auto parts = bytes.splitter('$').array(); enforceEx!ConvException(parts.length == 3); auto digestCode = parts[0]; auto salt = parts[1]; auto hash = parts[2]; // Construct Hash Hash!Digest result; result.salt = Base64.decode(salt); result.hash = Base64.decode(hash); result.digest = digestFromCryptCode(cast(string)digestCode); return result; } /++ Validates a password against an existing salted hash. If sHash is a Hash!Digest, then sHash.digest MUST be non-null. Otherwise this function will have no other way to determine what digest to match against, and an UnknownDigestException will be thrown. Optional_Params: salter - Default value is 'toDelegate(&defaultSalter!TDigest)' digest - Default value is 'new DefaultDigestClass()' +/ bool isSameHash(TDigest = DefaultDigest)(Password password, Hash!TDigest sHash, Salter!TDigest salter = toDelegate(&defaultSalter!TDigest)) if(isDigest!TDigest) { auto testHash = makeHash!TDigest(password, sHash.salt, salter); return lengthConstantEquals(testHash.hash, sHash.hash); } ///ditto bool isSameHash(TDigest = Digest)(Password password, Hash!TDigest sHash, Salter!Digest salter = toDelegate(&defaultSalter!Digest)) if(is(TDigest : Digest)) { Hash!Digest testHash; if(sHash.digest) testHash = makeHash(sHash.digest, password, sHash.salt, salter); else { static if(is(TDigest == Digest)) throw new UnknownDigestException("Cannot determine digest from a Hash!Digest with a null 'digest' member."); else testHash = makeHash(new TDigest(), password, sHash.salt, salter); } return lengthConstantEquals(testHash.hash, sHash.hash); } ///ditto bool isSameHash(TDigest = DefaultDigest) (Password password, DigestType!TDigest hash, Salt salt, Salter!TDigest salter = toDelegate(&defaultSalter!TDigest)) if(isDigest!TDigest) { auto testHash = makeHash!TDigest(password, salt, salter); return lengthConstantEquals(testHash.hash, hash); } ///ditto bool isSameHash()(Password password, ubyte[] hash, Salt salt, Digest digest = new DefaultDigestClass(), Salter!Digest salter = toDelegate(&defaultSalter!Digest)) { auto testHash = makeHash(digest, password, salt, salter); return lengthConstantEquals(testHash.hash, hash); } ///ditto bool isSameHash()(Password password, ubyte[] hash, Salt salt, Salter!Digest salter) { auto testHash = makeHash(new DefaultDigestClass(), password, salt, salter); return lengthConstantEquals(testHash.hash, hash); } /++ Alias for backwards compatibility. isPasswordCorrect will become deprecated in a future version. Use isSameHash instead. +/ alias isPasswordCorrect = isSameHash; version(DAuth_Unittest) unittest { // For validity of sanity checks, these sha/md5 and base64 strings // were NOT generated using Phobos. auto plainText1 = dupPassword("hello world"); enum md5Hash1 = cast(ubyte[16]) x"5eb63bbbe01eeed093cb22bb8f5acdc3"; enum md5Hash1Base64 = "XrY7u+Ae7tCTyyK7j1rNww=="; enum sha1Hash1 = cast(ubyte[20]) x"2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"; enum sha1Hash1Base64 = "Kq5sNclPz7QV2+lfQIuc6R7oRu0="; enum sha512Hash1 = cast(ubyte[64]) x"309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f"; enum sha512Hash1Base64 = "MJ7MSJwS1utMxA9QyQLytNDtd+5RGnx6m808qG1M2G+YndNbxf9JlnDaNCVbRbDP2DDoH2Bdz33FVC6TrpzXbw=="; auto plainText2 = dupPassword("some salt"); enum md5Hash2 = cast(ubyte[16]) x"befbc24b5c6a74591c0d8e6397b8a398"; enum md5Hash2Base64 = "vvvCS1xqdFkcDY5jl7ijmA=="; enum sha1Hash2 = cast(ubyte[20]) x"78bc8b0e186b0aa698f12dc27736b492e4dacfc8"; enum sha1Hash2Base64 = "eLyLDhhrCqaY8S3Cdza0kuTaz8g="; enum sha512Hash2 = cast(ubyte[64]) x"637246608760dc79f00d3ad4fd26c246bb217e10f811cdbf6fe602c3981e98b8cadacadc452808ae393ac46e8a7e967aa99711d7fd7ed6c055264787f8043693"; enum sha512Hash2Base64 = "Y3JGYIdg3HnwDTrU/SbCRrshfhD4Ec2/b+YCw5gemLjK2srcRSgIrjk6xG6KfpZ6qZcR1/1+1sBVJkeH+AQ2kw=="; unitlog("Sanity checking unittest's data"); assert(md5Of(plainText1.data) == md5Hash1); assert(md5Of(plainText2.data) == md5Hash2); assert(sha1Of(plainText1.data) == sha1Hash1); assert(sha1Of(plainText2.data) == sha1Hash2); assert(sha512Of(plainText1.data) == sha512Hash1); assert(sha512Of(plainText2.data) == sha512Hash2); assert(Base64.encode(md5Hash1) == md5Hash1Base64); assert(Base64.encode(md5Hash2) == md5Hash2Base64); assert(Base64.encode(sha1Hash1) == sha1Hash1Base64); assert(Base64.encode(sha1Hash2) == sha1Hash2Base64); assert(Base64.encode(sha512Hash1) == sha512Hash1Base64); assert(Base64.encode(sha512Hash2) == sha512Hash2Base64); unitlog("Testing Hash.toString"); Hash!SHA1 result1; result1.hash = cast(AnyDigestType!SHA1) sha1Hash1; result1.salt = cast(Salt) sha1Hash2; assert( result1.toString() == text("[SHA1]", sha1Hash2Base64, "$", sha1Hash1Base64) ); Hash!MD5 result1_md5; result1_md5.hash = cast(AnyDigestType!MD5) md5Hash1; result1_md5.salt = cast(Salt) md5Hash2; assert( result1_md5.toString() == text("[MD5]", md5Hash2Base64, "$", md5Hash1Base64) ); Hash!SHA512 result1_512; result1_512.hash = cast(AnyDigestType!SHA512) sha512Hash1; result1_512.salt = cast(Salt) sha512Hash2; assert( result1_512.toString() == text("[SHA512]", sha512Hash2Base64, "$", sha512Hash1Base64) ); unitlog("Testing Hash.toString - crypt(3)"); assertThrown!UnknownDigestException( result1.toCryptString() ); assert( result1_md5.toCryptString() == text("$1$", md5Hash2Base64, "$", md5Hash1Base64) ); assert( result1_512.toCryptString() == text("$6$", sha512Hash2Base64, "$", sha512Hash1Base64) ); unitlog("Testing makeHash([digest,] pass, salt [, salter])"); void altSalter(TDigest)(ref TDigest digest, Password password, Salt salt) { // Reverse order digest.put(password.data); digest.put(cast(immutable(ubyte)[])salt); } auto result2 = makeHash!SHA1(plainText1, cast(Salt)sha1Hash2[]); auto result2AltSalter = makeHash!SHA1(plainText1, cast(Salt)sha1Hash2[], &altSalter!SHA1); auto result3 = makeHash(new SHA1Digest(), plainText1, cast(Salt)sha1Hash2[]); auto result3AltSalter = makeHash(new SHA1Digest(), plainText1, cast(Salt)sha1Hash2[], &altSalter!Digest); assert(result2.salt == result3.salt); assert(result2.hash == result3.hash); assert(result2.toString() == result3.toString()); assert(result2.toString() == makeHash!SHA1(plainText1, cast(Salt)sha1Hash2[]).toString()); assert(result2.salt == result1.salt); assert(result2AltSalter.salt == result3AltSalter.salt); assert(result2AltSalter.hash == result3AltSalter.hash); assert(result2AltSalter.toString() == result3AltSalter.toString()); assert(result2AltSalter.toString() == makeHash!SHA1(plainText1, cast(Salt)sha1Hash2[], &altSalter!SHA1).toString()); assert(result2.salt == result2AltSalter.salt); assert(result2.hash != result2AltSalter.hash); assert(result2.toString() != result2AltSalter.toString()); auto result2_512 = makeHash!SHA512(plainText1, cast(Salt)sha512Hash2[]); auto result2_512AltSalter = makeHash!SHA512(plainText1, cast(Salt)sha512Hash2[], &altSalter!SHA512); auto result3_512 = makeHash(new SHA512Digest(), plainText1, cast(Salt)sha512Hash2[]); auto result3_512AltSalter = makeHash(new SHA512Digest(), plainText1, cast(Salt)sha512Hash2[], &altSalter!Digest); assert(result2_512.salt == result3_512.salt); assert(result2_512.hash == result3_512.hash); assert(result2_512.toString() == result3_512.toString()); assert(result2_512.toString() == makeHash!SHA512(plainText1, cast(Salt)sha512Hash2[]).toString()); assert(result2_512.salt == result1_512.salt); assert(result2_512AltSalter.salt == result3_512AltSalter.salt); assert(result2_512AltSalter.hash == result3_512AltSalter.hash); assert(result2_512AltSalter.toString() == result3_512AltSalter.toString()); assert(result2_512AltSalter.toString() == makeHash!SHA512(plainText1, cast(Salt)sha512Hash2[], &altSalter!SHA512).toString()); assert(result2_512.salt == result2_512AltSalter.salt); assert(result2_512.hash != result2_512AltSalter.hash); assert(result2_512.toString() != result2_512AltSalter.toString()); assertThrown!UnknownDigestException( makeHash(cast(SHA1Digest)null, plainText1, cast(Salt)sha1Hash2[]) ); assertThrown!UnknownDigestException( makeHash(cast(Digest)null, plainText1, cast(Salt)sha1Hash2[]) ); unitlog("Testing makeHash(pass)"); import dauth.random : randomPassword; auto resultRand1 = makeHash!SHA1(randomPassword()); auto resultRand2 = makeHash!SHA1(randomPassword()); assert(resultRand1.salt != result1.salt); assert(resultRand1.salt != resultRand2.salt); assert(resultRand1.hash != resultRand2.hash); unitlog("Testing parseHash()"); auto result2Parsed = parseDAuthHash( result2_512.toString() ); assert(result2_512.salt == result2Parsed.salt); assert(result2_512.hash == result2Parsed.hash); assert(result2_512.toString() == result2Parsed.toString()); assert(makeHash(result2Parsed.digest, plainText1, result2Parsed.salt) == result2Parsed); assertThrown!ConvException(parseDAuthHash( result2_512.toCryptString() )); assert(parseHash( result2_512.toString() ).salt == parseDAuthHash( result2_512.toString() ).salt); assert(parseHash( result2_512.toString() ).hash == parseDAuthHash( result2_512.toString() ).hash); assert(parseHash( result2_512.toString() ).toString() == parseDAuthHash( result2_512.toString() ).toString()); assert(parseHash( result2_512.toString() ).toCryptString() == parseDAuthHash( result2_512.toString() ).toCryptString()); unitlog("Testing parseHash() - crypt(3)"); auto result2ParsedCrypt = parseCryptHash( result2_512.toCryptString() ); assert(result2_512.salt == result2ParsedCrypt.salt); assert(result2_512.hash == result2ParsedCrypt.hash); assert(result2_512.toString() == result2ParsedCrypt.toString()); assert(makeHash(result2ParsedCrypt.digest, plainText1, result2ParsedCrypt.salt) == result2ParsedCrypt); assertThrown!ConvException(parseCryptHash( result2_512.toString() )); assert(parseHash( result2_512.toCryptString() ).salt == parseCryptHash( result2_512.toCryptString() ).salt); assert(parseHash( result2_512.toCryptString() ).hash == parseCryptHash( result2_512.toCryptString() ).hash); assert(parseHash( result2_512.toCryptString() ).toString() == parseCryptHash( result2_512.toCryptString() ).toString()); assert(parseHash( result2_512.toCryptString() ).toCryptString() == parseCryptHash( result2_512.toCryptString() ).toCryptString()); auto desCryptHash = "sa5JEXtYx/rm6"; assertThrown!UnknownDigestException( parseHash(desCryptHash) ); assert(collectExceptionMsg( parseHash(desCryptHash) ).canFind("DES")); unitlog("Testing isSameHash"); assert(isSameHash (plainText1, result2)); assert(isSameHash!SHA1(plainText1, result2.hash, result2.salt)); assert(isSameHash (plainText1, result2.hash, result2.salt, new SHA1Digest())); assert(isSameHash!SHA1(plainText1, result2AltSalter, &altSalter!SHA1)); assert(isSameHash!SHA1(plainText1, result2AltSalter.hash, result2AltSalter.salt, &altSalter!SHA1)); assert(isSameHash (plainText1, result2AltSalter.hash, result2AltSalter.salt, new SHA1Digest(), &altSalter!Digest)); assert(!isSameHash (dupPassword("bad pass"), result2)); assert(!isSameHash!SHA1(dupPassword("bad pass"), result2.hash, result2.salt)); assert(!isSameHash (dupPassword("bad pass"), result2.hash, result2.salt, new SHA1Digest())); assert(!isSameHash!SHA1(dupPassword("bad pass"), result2AltSalter, &altSalter!SHA1)); assert(!isSameHash!SHA1(dupPassword("bad pass"), result2AltSalter.hash, result2AltSalter.salt, &altSalter!SHA1)); assert(!isSameHash (dupPassword("bad pass"), result2AltSalter.hash, result2AltSalter.salt, new SHA1Digest(), &altSalter!Digest)); Hash!SHA1Digest ooHashSHA1Digest; ooHashSHA1Digest.salt = result2.salt; ooHashSHA1Digest.hash = result2.hash; ooHashSHA1Digest.digest = new SHA1Digest(); assert( isSameHash(plainText1, ooHashSHA1Digest) ); ooHashSHA1Digest.digest = null; assert( isSameHash(plainText1, ooHashSHA1Digest) ); Hash!Digest ooHashDigest; ooHashDigest.salt = result2.salt; ooHashDigest.hash = result2.hash; ooHashDigest.digest = new SHA1Digest(); assert( isSameHash(plainText1, ooHashDigest) ); ooHashDigest.digest = null; assertThrown!UnknownDigestException( isSameHash(plainText1, ooHashDigest) ); assert( isSameHash(plainText1, parseHash(result2.toString())) ); auto wrongSalt = result2; wrongSalt.salt = wrongSalt.salt[4..$-1]; assert(!isSameHash (plainText1, wrongSalt)); assert(!isSameHash!SHA1(plainText1, wrongSalt.hash, wrongSalt.salt)); assert(!isSameHash (plainText1, wrongSalt.hash, wrongSalt.salt, new SHA1Digest())); Hash!MD5 wrongDigest; wrongDigest.salt = result2.salt; wrongDigest.hash = cast(ubyte[16])result2.hash[0..16]; assert(!isSameHash (plainText1, wrongDigest)); assert(!isSameHash!MD5(plainText1, wrongDigest.hash, wrongDigest.salt)); assert(!isSameHash (plainText1, wrongDigest.hash, wrongDigest.salt, new MD5Digest())); } /++ Compare two arrays in "length-constant" time. This thwarts timing-based attacks by guaranteeing all comparisons (of a given length) take the same amount of time. See the section "Why does the hashing code on this page compare the hashes in "length-constant" time?" at: $(LINK https://crackstation.net/hashing-security.htm) +/ bool lengthConstantEquals(ubyte[] a, ubyte[] b) { auto diff = a.length ^ b.length; for(int i = 0; i < a.length && i < b.length; i++) diff |= a[i] ^ b[i]; return diff == 0; } // Borrowed from Phobos (TemplateArgsOf only exists in DMD 2.066 and up). package template DAuth_TemplateArgsOf(alias T : Base!Args, alias Base, Args...) { alias DAuth_TemplateArgsOf = Args; } package template DAuth_TemplateArgsOf(T : Base!Args, alias Base, Args...) { alias DAuth_TemplateArgsOf = Args; } static assert(is( DAuth_TemplateArgsOf!( Hash!SHA1 )[0] == SHA1 )); static assert(is( DAuth_TemplateArgsOf!( Hash!Digest )[0] == Digest )); private struct dummy(T) {} static if(!is(std.traits.TemplateArgsOf!(dummy!int))) private alias TemplateArgsOf = DAuth_TemplateArgsOf;
D
<?xml version="1.0" encoding="ASCII" standalone="no"?> <di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0"> <pageList> <availablePage> <emfPageIdentifier href="VAR_21_BeT-9264717454.notation#_copSALmGEeKQQp7P9cQvNQ"/> </availablePage> </pageList> <sashModel currentSelection="//@sashModel/@windows.0/@children.0"> <windows> <children xsi:type="di:TabFolder"> <children> <emfPageIdentifier href="VAR_21_BeT-9264717454.notation#_copSALmGEeKQQp7P9cQvNQ"/> </children> </children> </windows> </sashModel> </di:SashWindowsMngr>
D
/** * Windows API header module * * Translated from MinGW Windows headers * * Authors: Stewart Gordon * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Source: $(DRUNTIMESRC core/sys/windows/_rassapi.d) */ module core.sys.windows.rassapi; version (Windows): import core.sys.windows.lmcons, core.sys.windows.windef; // FIXME: check types of constants enum size_t RASSAPI_MAX_PHONENUMBER_SIZE = 128, RASSAPI_MAX_MEDIA_NAME = 16, RASSAPI_MAX_PORT_NAME = 16, RASSAPI_MAX_DEVICE_NAME = 128, RASSAPI_MAX_DEVICETYPE_NAME = 16, RASSAPI_MAX_PARAM_KEY_SIZE = 32; enum RASPRIV_NoCallback = 0x01; enum RASPRIV_AdminSetCallback = 0x02; enum RASPRIV_CallerSetCallback = 0x04; enum RASPRIV_DialinPrivilege = 0x08; enum RASPRIV_CallbackType = 0x07; enum { RAS_MODEM_OPERATIONAL = 1, RAS_MODEM_NOT_RESPONDING, RAS_MODEM_HARDWARE_FAILURE, RAS_MODEM_INCORRECT_RESPONSE, RAS_MODEM_UNKNOWN // = 5 } enum { RAS_PORT_NON_OPERATIONAL = 1, RAS_PORT_DISCONNECTED, RAS_PORT_CALLING_BACK, RAS_PORT_LISTENING, RAS_PORT_AUTHENTICATING, RAS_PORT_AUTHENTICATED, RAS_PORT_INITIALIZING // = 7 } enum { MEDIA_UNKNOWN, MEDIA_SERIAL, MEDIA_RAS10_SERIAL, MEDIA_X25, MEDIA_ISDN } enum USER_AUTHENTICATED = 0x0001; enum MESSENGER_PRESENT = 0x0002; enum PPP_CLIENT = 0x0004; enum GATEWAY_ACTIVE = 0x0008; enum REMOTE_LISTEN = 0x0010; enum PORT_MULTILINKED = 0x0020; enum size_t RAS_IPADDRESSLEN = 15, RAS_IPXADDRESSLEN = 22, RAS_ATADDRESSLEN = 32; // FIXME: should these be grouped together? enum { RASDOWNLEVEL = 10, RASADMIN_35 = 35, RASADMIN_CURRENT = 40 } alias ULONG IPADDR; enum RAS_PARAMS_FORMAT { ParamNumber = 0, ParamString } union RAS_PARAMS_VALUE { DWORD Number; struct _String { DWORD Length; PCHAR Data; } _String String; } struct RAS_PARAMETERS { CHAR[RASSAPI_MAX_PARAM_KEY_SIZE] P_Key = 0; RAS_PARAMS_FORMAT P_Type; BYTE P_Attributes; RAS_PARAMS_VALUE P_Value; } struct RAS_USER_0 { BYTE bfPrivilege; WCHAR[RASSAPI_MAX_PHONENUMBER_SIZE + 1] szPhoneNumber = 0; } alias RAS_USER_0* PRAS_USER_0; struct RAS_PORT_0 { WCHAR[RASSAPI_MAX_PORT_NAME] wszPortName = 0; WCHAR[RASSAPI_MAX_DEVICETYPE_NAME] wszDeviceType = 0; WCHAR[RASSAPI_MAX_DEVICE_NAME] wszDeviceName = 0; WCHAR[RASSAPI_MAX_MEDIA_NAME] wszMediaName = 0; DWORD reserved; DWORD Flags; WCHAR[UNLEN + 1] wszUserName = 0; WCHAR[NETBIOS_NAME_LEN] wszComputer = 0; DWORD dwStartSessionTime; // seconds from 1/1/1970 WCHAR[DNLEN + 1] wszLogonDomain = 0; BOOL fAdvancedServer; } alias RAS_PORT_0* PRAS_PORT_0; struct RAS_PPP_NBFCP_RESULT { DWORD dwError; DWORD dwNetBiosError; CHAR[NETBIOS_NAME_LEN + 1] szName = 0; WCHAR[NETBIOS_NAME_LEN + 1] wszWksta = 0; } struct RAS_PPP_IPCP_RESULT { DWORD dwError; WCHAR[RAS_IPADDRESSLEN + 1] wszAddress = 0; } struct RAS_PPP_IPXCP_RESULT { DWORD dwError; WCHAR[RAS_IPXADDRESSLEN + 1] wszAddress = 0; } struct RAS_PPP_ATCP_RESULT { DWORD dwError; WCHAR[RAS_ATADDRESSLEN + 1] wszAddress = 0; } struct RAS_PPP_PROJECTION_RESULT { RAS_PPP_NBFCP_RESULT nbf; RAS_PPP_IPCP_RESULT ip; RAS_PPP_IPXCP_RESULT ipx; RAS_PPP_ATCP_RESULT at; } struct RAS_PORT_1 { RAS_PORT_0 rasport0; DWORD LineCondition; DWORD HardwareCondition; DWORD LineSpeed; WORD NumStatistics; WORD NumMediaParms; DWORD SizeMediaParms; RAS_PPP_PROJECTION_RESULT ProjResult; } alias RAS_PORT_1* PRAS_PORT_1; struct RAS_PORT_STATISTICS { DWORD dwBytesXmited; DWORD dwBytesRcved; DWORD dwFramesXmited; DWORD dwFramesRcved; DWORD dwCrcErr; DWORD dwTimeoutErr; DWORD dwAlignmentErr; DWORD dwHardwareOverrunErr; DWORD dwFramingErr; DWORD dwBufferOverrunErr; DWORD dwBytesXmitedUncompressed; DWORD dwBytesRcvedUncompressed; DWORD dwBytesXmitedCompressed; DWORD dwBytesRcvedCompressed; DWORD dwPortBytesXmited; DWORD dwPortBytesRcved; DWORD dwPortFramesXmited; DWORD dwPortFramesRcved; DWORD dwPortCrcErr; DWORD dwPortTimeoutErr; DWORD dwPortAlignmentErr; DWORD dwPortHardwareOverrunErr; DWORD dwPortFramingErr; DWORD dwPortBufferOverrunErr; DWORD dwPortBytesXmitedUncompressed; DWORD dwPortBytesRcvedUncompressed; DWORD dwPortBytesXmitedCompressed; DWORD dwPortBytesRcvedCompressed; } alias RAS_PORT_STATISTICS* PRAS_PORT_STATISTICS; struct RAS_SERVER_0 { WORD TotalPorts; WORD PortsInUse; DWORD RasVersion; } alias RAS_SERVER_0* PRAS_SERVER_0; extern (Windows) { DWORD RasAdminServerGetInfo(const(WCHAR)*, PRAS_SERVER_0); DWORD RasAdminGetUserAccountServer(const(WCHAR)*, const(WCHAR)*, LPWSTR); DWORD RasAdminUserGetInfo(const(WCHAR)*, const(WCHAR)*, PRAS_USER_0); DWORD RasAdminUserSetInfo(const(WCHAR)*, const(WCHAR)*, PRAS_USER_0); DWORD RasAdminPortEnum(WCHAR*, PRAS_PORT_0*, WORD*); DWORD RasAdminPortGetInfo(const(WCHAR)*, const(WCHAR)*, RAS_PORT_1*, RAS_PORT_STATISTICS*, RAS_PARAMETERS**); DWORD RasAdminPortClearStatistics(const(WCHAR)*, const(WCHAR)*); DWORD RasAdminPortDisconnect(const(WCHAR)*, const(WCHAR)*); DWORD RasAdminFreeBuffer(PVOID); DWORD RasAdminGetErrorString(UINT, WCHAR*, DWORD); BOOL RasAdminAcceptNewConnection(RAS_PORT_1*, RAS_PORT_STATISTICS*, RAS_PARAMETERS*); VOID RasAdminConnectionHangupNotification(RAS_PORT_1*, RAS_PORT_STATISTICS*, RAS_PARAMETERS*); DWORD RasAdminGetIpAddressForUser (WCHAR*, WCHAR*, IPADDR*, BOOL*); VOID RasAdminReleaseIpAddress (WCHAR*, WCHAR*,IPADDR*); DWORD RasAdminGetUserParms(WCHAR*, PRAS_USER_0); DWORD RasAdminSetUserParms(WCHAR*, DWORD, PRAS_USER_0); }
D
/home/thodges/Workspace/Rust/rust_by_example/chapter05/aliasing/target/debug/deps/aliasing-e7b5226ab06f458f: src/main.rs /home/thodges/Workspace/Rust/rust_by_example/chapter05/aliasing/target/debug/deps/aliasing-e7b5226ab06f458f.d: src/main.rs src/main.rs:
D
# FIXED PROFILES/gapbondmgr.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/profiles/roles/gapbondmgr.c PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/bcomdef.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/comdef.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/../_common/cc26xx/_hal_types.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdint.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_defs.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/limits.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/yvals.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdarg.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/linkage.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/_lock.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Memory.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Timers.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/icall/src/inc/ICall.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdbool.h PROFILES/gapbondmgr.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdlib.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_assert.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal_snv.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/l2cap.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/sm.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/linkdb.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gatt.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/att.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gatt_uuid.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gattservapp.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gapgattserver.h PROFILES/gapbondmgr.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/profiles/roles/gapbondmgr.h PROFILES/gapbondmgr.obj: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gap.h C:/ti/simplelink/ble_sdk_2_02_01_18/src/profiles/roles/gapbondmgr.c: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/bcomdef.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/comdef.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/../_common/cc26xx/_hal_types.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdint.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_defs.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/limits.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/yvals.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdarg.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/linkage.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/_lock.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Memory.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Timers.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/icall/src/inc/ICall.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdbool.h: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_5.2.9/include/stdlib.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_assert.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal_snv.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/l2cap.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/sm.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/linkdb.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gatt.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/att.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gatt_uuid.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gattservapp.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gapgattserver.h: C:/ti/simplelink/ble_sdk_2_02_01_18/src/profiles/roles/gapbondmgr.h: c:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/gap.h:
D
module adrdox.main; __gshared string skeletonFile = "skeleton.html"; __gshared string outputDirectory = "generated-docs"; __gshared bool writePrivateDocs = false; __gshared bool documentInternal = false; __gshared bool documentUndocumented = false; /* Glossary feature: little short links that lead somewhere else. FIXME: it should be able to handle bom. consider core/thread.d the unittest example is offset. FIXME: * make sure there's a link to the source for everything * search * package index without needing to build everything at once * version specifiers * prettified constraints */ import dparse.parser; import dparse.lexer; import dparse.ast; import arsd.dom; import arsd.docgen.comment; import std.algorithm :sort, canFind; import std.string; import std.conv : to; // returns empty string if file not found string findStandardFile(bool dofail=true) (string stdfname) { import std.file : exists, thisExePath; import std.path : buildPath, dirName; if (!stdfname.exists) { if (stdfname.length && stdfname[0] != '/') { string newname = buildPath(thisExePath.dirName, stdfname); if (newname.exists) return newname; } static if (dofail) throw new Exception("standard file '" ~stdfname ~ "' not found!"); } return stdfname; } void copyStandardFileTo(bool timecheck=true) (string destname, string stdfname) { import std.file; if (exists(destname)) { static if (timecheck) { if (timeLastModified(destname) >= timeLastModified(findStandardFile(stdfname))) return; } else { return; } } copy(findStandardFile(stdfname), destname); } __gshared string[string] directoriesForPackage; string getDirectoryForPackage(string packageName) { if(packageName.indexOf("/") != -1) return ""; // not actually a D package! if(packageName.indexOf("#") != -1) return ""; // not actually a D package! string bestMatch = ""; int bestMatchDots = -1; import std.path; foreach(pkg, dir; directoriesForPackage) { if(globMatch!(CaseSensitive.yes)(packageName, pkg)) { int cnt; foreach(ch; pkg) if(ch == '.') cnt++; if(cnt > bestMatchDots) { bestMatch = dir; bestMatchDots = cnt; } } } return bestMatch; } // FIXME: make See Also automatically list dittos that are not overloads enum skip_undocumented = true; static bool sorter(Decl a, Decl b) { if(a.declarationType == b.declarationType) return (blogMode && a.declarationType == "Article") ? (b.name < a.name) : (a.name < b.name); else if(a.declarationType == "module" || b.declarationType == "module") // always put modules up top return (a.declarationType == "module" ? "aaaaaa" : a.declarationType) < (b.declarationType == "module" ? "aaaaaa" : b.declarationType); else return a.declarationType < b.declarationType; } void annotatedPrototype(T)(T decl, MyOutputRange output) { static if(is(T == TemplateDecl)) { auto td = cast(TemplateDecl) decl; auto epony = td.eponymousMember; if(epony) { if(auto e = cast(FunctionDecl) epony) { doFunctionDec(e, output); return; } } } auto classDec = decl.astNode; auto f = new MyFormatter!(typeof(output))(output, decl); void writePrototype() { output.putTag("<div class=\"aggregate-prototype\">"); if(decl.parent !is null && !decl.parent.isModule) { output.putTag("<div class=\"parent-prototype\">"); decl.parent.getSimplifiedPrototype(output); output.putTag("</div><div>"); } writeAttributes(f, output, decl.attributes); output.putTag("<span class=\"builtin-type\">"); output.put(decl.declarationType); output.putTag("</span>"); output.put(" "); output.put(decl.name); output.put(" "); foreach(idx, ir; decl.inheritsFrom()) { if(idx == 0) output.put(" : "); else output.put(", "); if(ir.decl is null) output.put(ir.plainText); else output.putTag(`<a class="xref parent-class" href=`~ir.decl.link~`>`~ir.decl.name~`</a> `); } if(classDec.templateParameters) f.format(classDec.templateParameters); if(classDec.constraint) f.format(classDec.constraint); // FIXME: invariant if(decl.children.length) { output.put(" {"); foreach(child; decl.children) { if((child.isPrivate() && !writePrivateDocs)) continue; // I want to show undocumented plain data members (if not private) // since they might be used as public fields or in ctors for simple // structs, but I'll skip everything else undocumented. if(!child.isDocumented() && (cast(VariableDecl) child) is null) continue; output.putTag("<div class=\"aggregate-member\">"); if(child.isDocumented()) output.putTag("<a href=\""~child.link~"\""); child.getAggregatePrototype(output); if(child.isDocumented()) output.putTag("</a>"); output.putTag("</div>"); } output.put("}"); } if(decl.parent !is null && !decl.parent.isModule) { output.putTag("</div>"); } output.putTag("</div>"); } writeOverloads!writePrototype(decl, output); } void doEnumDecl(T)(T decl, Element content) { auto enumDec = decl.astNode; static if(is(typeof(enumDec) == const(AnonymousEnumDeclaration))) { if(enumDec.members.length == 0) return; auto name = enumDec.members[0].name.text; auto type = enumDec.baseType; auto members = enumDec.members; } else { auto name = enumDec.name.text; auto type = enumDec.type; const(EnumMember)[] members; if(enumDec.enumBody) members = enumDec.enumBody.enumMembers; } static if(is(typeof(enumDec) == const(AnonymousEnumDeclaration))) { // undocumented anonymous enums get a pass if any of // their members are documented because that's what dmd does... // FIXME maybe bool foundOne = false; foreach(member; members) { if(member.comment.length) { foundOne = true; break; } } if(!foundOne && skip_undocumented) return; } else { if(enumDec.comment.length == 0 && skip_undocumented) return; } /* auto f = new MyFormatter!(typeof(output))(output); if(type) { output.putTag("<div class=\"base-type\">"); f.format(type); output.putTag("</div>"); } */ content.addChild("h2", "Values").attrs.id = "values"; auto table = content.addChild("table").addClass("enum-members"); table.appendHtml("<tr><th>Value</th><th>Meaning</th></tr>"); foreach(member; members) { auto memberComment = formatDocumentationComment(preprocessComment(member.comment, decl), decl); auto tr = table.addChild("tr"); tr.addClass("enum-member"); tr.attrs.id = member.name.text; auto td = tr.addChild("td"); if(member.isDisabled) { td.addChild("span", "@disable").addClass("enum-disabled"); td.addChild("br"); } if(member.type) { td.addChild("span", toHtml(member.type)).addClass("enum-type"); } td.addChild("a", member.name.text, "#" ~ member.name.text).addClass("enum-member-name"); if(member.assignExpression) { td.addChild("span", toHtml(member.assignExpression)).addClass("enum-member-value"); } auto ea = td.addChild("div", "", "enum-attributes"); foreach(attribute; member.atAttributes) { ea.addChild("div", toHtml(attribute)); } // type // assignExpression td = tr.addChild("td"); td.innerHTML = memberComment; if(member.deprecated_) { auto p = td.prependChild(Element.make("div", Element.make("span", member.deprecated_.stringLiterals.length ? "Deprecated: " : "Deprecated", "deprecated-label"))).addClass("enum-deprecated"); foreach(sl; member.deprecated_.stringLiterals) p.addChild("span", sl.text[1 .. $-1]); } // I might write to parent list later if I can do it all semantically inside the anonymous enum // since these names are introduced into the parent scope i think it is justified to list them there // maybe. } } void doFunctionDec(T)(T decl, MyOutputRange output) { auto functionDec = decl.astNode; //if(!decl.isDocumented() && skip_undocumented) //return; string[] conceptsFound; auto f = new MyFormatter!(typeof(output))(output, decl); /+ auto comment = parseDocumentationComment(dittoSupport(functionDec, functionDec.comment), fullyQualifiedName ~ name); if(auto ptr = name in overloadChain[$-1]) { *ptr += 1; name ~= "." ~ to!string(*ptr); } else { overloadChain[$-1][name] = 1; overloadNodeChain[$-1] = cast() functionDec; } const(ASTNode)[] overloadsList; if(auto overloads = overloadNodeChain[$-1] in additionalModuleInfo.overloadsOf) { overloadsList = *overloads; } if(dittoChain[$-1]) if(auto dittos = dittoChain[$-1] in additionalModuleInfo.dittos) { auto list = *dittos; outer: foreach(item; list) { if(item is functionDec) continue; // already listed as a formal overload which means we // don't need to list it again under see also foreach(ol; overloadsList) if(ol is item) continue outer; string linkHtml; linkHtml ~= `<a href="`~htmlEncode(linkMapping[item])~`">` ~ htmlEncode(nameMapping[item]) ~ `</a>`; comment.see_alsos ~= linkHtml; } } descendInto(name); output.putTag("<h1><span class=\"entity-name\">" ~ name ~ "</span> "~typeString~"</h1>"); writeBreadcrumbs(); output.putTag("<div class=\"function-declaration\">"); comment.writeSynopsis(output); +/ void writeFunctionPrototype() { string outputStr; auto originalOutput = output; MyOutputRange output = MyOutputRange(&outputStr); auto f = new MyFormatter!(typeof(output))(output); output.putTag("<div class=\"function-prototype\">"); //output.putTag(`<a href="http://dpldocs.info/reading-prototypes" id="help-link">?</a>`); if(decl.parent !is null && !decl.parent.isModule) { output.putTag("<div class=\"parent-prototype\">"); decl.parent.getSimplifiedPrototype(output); output.putTag("</div><div>"); } writeAttributes(f, output, decl.attributes); static if( !is(typeof(functionDec) == const(Constructor)) && !is(typeof(functionDec) == const(Postblit)) && !is(typeof(functionDec) == const(Destructor)) ) { output.putTag("<div class=\"return-type\">"); if (functionDec.hasAuto && functionDec.hasRef) output.putTag(`<a class="lang-feature" href="http://dpldocs.info/auto-ref-function-return-prototype">auto ref</a> `); else { if (functionDec.hasAuto) output.putTag(`<a class="lang-feature" href="http://dpldocs.info/auto-function-return-prototype">auto</a> `); if (functionDec.hasRef) output.putTag(`<a class="lang-feature" href="http://dpldocs.info/ref-function-return-prototype">ref</a> `); } if (functionDec.returnType !is null) f.format(functionDec.returnType); output.putTag("</div>"); } output.putTag("<div class=\"function-name\">"); output.put(decl.name); output.putTag("</div>"); foreach(attr; decl.astNode.memberFunctionAttributes) { f.format(attr); output.put(" "); } output.putTag("<div class=\"template-parameters\">"); if (functionDec.templateParameters !is null) f.format(functionDec.templateParameters); output.putTag("</div>"); output.putTag("<div class=\"runtime-parameters\">"); f.format(functionDec.parameters); output.putTag("</div>"); if(functionDec.constraint !is null) { output.putTag("<div class=\"template-constraint\">"); f.format(functionDec.constraint); output.putTag("</div>"); } if(functionDec.functionBody !is null) { // FIXME: list inherited contracts output.putTag("<div class=\"function-contracts\">"); import dparse.formatter; auto f2 = new Formatter!(typeof(output))(output); if(functionDec.functionBody.inStatement) { output.putTag("<div class=\"in-contract\">"); f2.format(functionDec.functionBody.inStatement); output.putTag("</div>"); } if(functionDec.functionBody.outStatement) { output.putTag("<div class=\"out-contract\">"); f2.format(functionDec.functionBody.outStatement); output.putTag("</div>"); } output.putTag("</div>"); } //output.put(" : "); //output.put(to!string(functionDec.name.line)); if(decl.parent !is null && !decl.parent.isModule) { output.putTag("</div>"); decl.parent.writeTemplateConstraint(output); } output.putTag("</div>"); originalOutput.putTag(linkUpHtml(outputStr, decl)); } writeOverloads!writeFunctionPrototype(decl, output); } void writeOverloads(alias writePrototype, D : Decl)(D decl, ref MyOutputRange output) { auto overloadsList = decl.getImmediateDocumentedOverloads(); // I'm treating dittos similarly to overloads if(overloadsList.length == 1) { overloadsList = decl.getDittos(); } else { foreach(ditto; decl.getDittos()) { if(!overloadsList.canFind(ditto)) overloadsList ~= ditto; } } if(overloadsList.length > 1) { import std.conv; output.putTag("<ol class=\"overloads\">"); foreach(idx, item; overloadsList) { assert(item.parent !is null); string cn; Decl epony; if(auto t = cast(TemplateDecl) item) epony = t.eponymousMember; if(item !is decl && decl !is epony) cn = "overload-option"; else cn = "active-overload-option"; if(item.name != decl.name) cn ~= " ditto-option"; output.putTag("<li class=\""~cn~"\">"); //if(item is decl) //writeFunctionPrototype(); //} else { { if(item !is decl) output.putTag(`<a href="`~item.link~`">`); output.putTag("<span class=\"overload-signature\">"); item.getSimplifiedPrototype(output); output.putTag("</span>"); if(item !is decl) output.putTag(`</a>`); } if(item is decl || decl is epony) writePrototype(); output.putTag("</li>"); } output.putTag("</ol>"); } else { writePrototype(); } } void writeAttributes(F, W)(F formatter, W writer, const(VersionOrAttribute)[] attrs) { writer.putTag("<div class=\"attributes\">"); IdType protection; foreach (a; attrs) { if (a.attr && isProtection(a.attr.attribute.type)) protection = a.attr.attribute.type; } switch (protection) { case tok!"private": writer.put("private "); break; case tok!"package": writer.put("package "); break; case tok!"protected": writer.put("protected "); break; case tok!"export": writer.put("export "); break; case tok!"public": // see below default: // I'm not printing public so this is commented intentionally // public is the default state of documents so saying it outright // is kinda just a waste of time IMO. //writer.put("public "); break; } foreach (a; attrs) { if(auto fakeAttr = cast(FakeAttribute) a) { writer.putTag(fakeAttr.toHTML()); writer.put(" "); continue; } // skipping auto because it is already handled as the return value if (!isProtection(a.attr.attribute.type) && a.attr.attribute.type != tok!"auto") { formatter.format(a.attr); writer.put(" "); } } writer.putTag("</div>"); } class VersionOrAttribute { const(Attribute) attr; this(const(Attribute) attr) { this.attr = attr; } const(VersionOrAttribute) invertedClone() const { return new VersionOrAttribute(attr); } } class FakeAttribute : VersionOrAttribute { this() { super(null); } abstract string toHTML() const; } class VersionFakeAttribute : FakeAttribute { string cond; bool inverted; this(string condition, bool inverted = false) { cond = condition; this.inverted = inverted; } override const(VersionFakeAttribute) invertedClone() const { return new VersionFakeAttribute(cond, !inverted); } override string toHTML() const { auto element = Element.make("span"); element.addChild("span", "version", "lang-feature"); element.appendText("("); if(inverted) element.appendText("!"); element.addChild("span", cond); element.appendText(")"); return element.toString; } } void putSimplfiedReturnValue(MyOutputRange output, const FunctionDeclaration decl) { if (decl.hasAuto && decl.hasRef) output.putTag(`<span class="lang-feature">auto ref</span> `); else { if (decl.hasAuto) output.putTag(`<span class="lang-feature">auto</span> `); if (decl.hasRef) output.putTag(`<span class="lang-feature">ref</span> `); } if (decl.returnType !is null) output.putTag(toHtml(decl.returnType).source); } void putSimplfiedArgs(T)(MyOutputRange output, const T decl) { // FIXME: do NOT show default values here if(decl.parameters) output.putTag(toHtml(decl.parameters).source); } string specialPreprocess(string comment, Decl decl) { switch(specialPreprocessor) { case "dwt": // translate Javadoc to adrdox // @see, @exception/@throws, @param, @return // @author, @version, @since, @deprecated // {@link thing} // one line desc is until the first <p> // html tags are allowed in javadoc // links go class#member(args) // the (args) and class are optional string parseIdentifier(ref string s, bool allowHash = false) { int end = 0; while(end < s.length && ( (s[end] >= 'A' && s[end] <= 'Z') || (s[end] >= 'a' && s[end] <= 'z') || (s[end] >= '0' && s[end] <= '9') || s[end] == '_' || s[end] == '.' || (allowHash && s[end] == '#') )) { end++; } auto i = s[0 .. end]; s = s[end .. $]; return i; } // javadoc is basically html with @ stuff, so start by parsing that (presumed) tag soup auto document = new Document("<root>" ~ comment ~ "</root>"); string newComment; string fixupJavaReference(string r) { if(r.length == 0) return r; if(r[0] == '#') r = r[1 .. $]; // local refs in adrdox need no special sigil r = r.replace("#", "."); auto idx = r.indexOf("("); if(idx != -1) r = r[0 .. idx]; return r; } void translate(Element element) { if(element.nodeType == NodeType.Text) { foreach(line; element.nodeValue.splitLines(KeepTerminator.yes)) { auto s = line.strip; if(s.length && s[0] == '@') { s = s[1 .. $]; auto ident = parseIdentifier(s); switch(ident) { case "author": case "deprecated": case "version": case "since": line = ident ~ ": " ~ s ~ "\n"; break; case "return": case "returns": line = "Returns: " ~ s ~ "\n"; break; case "exception": case "throws": while(s.length && s[0] == ' ') s = s[1 .. $]; auto p = parseIdentifier(s); line = "Throws: [" ~ p ~ "]" ~ s ~ "\n"; break; case "param": while(s.length && s[0] == ' ') s = s[1 .. $]; auto p = parseIdentifier(s); line = "Params:\n" ~ p ~ " = " ~ s ~ "\n"; break; case "see": while(s.length && s[0] == ' ') s = s[1 .. $]; auto p = parseIdentifier(s, true); if(p.length) line = "See_Also: [" ~ fixupJavaReference(p) ~ "]" ~ "\n"; else line = "See_Also: " ~ s ~ "\n"; break; default: // idk, leave it alone. } } newComment ~= line; } } else { if(element.tagName == "code") { newComment ~= "`"; // FIXME: what about ` inside code? newComment ~= element.innerText; // .replace("`", "``"); newComment ~= "`"; } else if(element.tagName == "p") { newComment ~= "\n\n"; foreach(child; element.children) translate(child); newComment ~= "\n\n"; } else if(element.tagName == "a") { newComment ~= "${LINK2 " ~ element.href ~ ", " ~ element.innerText ~ "}"; } else { newComment ~= "${" ~ element.tagName.toUpper ~ " "; foreach(child; element.children) translate(child); newComment ~= "}"; } } } foreach(child; document.root.children) translate(child); comment = newComment; break; case "gtk": // translate gtk syntax and names to our own string gtkObjectToDClass(string name) { if(name.length == 0) return null; int pkgEnd = 1; while(pkgEnd < name.length && !(name[pkgEnd] >= 'A' && name[pkgEnd] <= 'Z')) pkgEnd++; auto pkg = name[0 .. pkgEnd].toLower; auto mod = name[pkgEnd .. $]; auto t = pkg ~ "." ~ mod; if(t in modulesByName) return t ~ "." ~ mod; if(auto c = mod in allClasses) return c.fullyQualifiedName; return null; } string trimFirstThing(string name) { if(name.length == 0) return null; int pkgEnd = 1; while(pkgEnd < name.length && !(name[pkgEnd] >= 'A' && name[pkgEnd] <= 'Z')) pkgEnd++; return name[pkgEnd .. $]; } string formatForDisplay(string name) { auto parts = name.split("."); // gtk.Application.Application.member // we want to take out the repeated one - slot [1] string disp; if(parts.length > 2) foreach(idx, part; parts) { if(idx == 1) continue; if(idx) { disp ~= "."; } disp ~= part; } else disp = name; return disp; } import std.regex : regex, replaceAll, Captures; // gtk references to adrdox reference; punt it to the search engine string magic(Captures!string m) { string s = m.hit; s = s[1 .. $]; // trim off # auto orig = s; auto name = s; string displayOverride; string additional; auto idx = s.indexOf(":"); if(idx != -1) { // colon means it is an attribute or a signal auto property = s[idx + 1 .. $]; s = s[0 .. idx]; if(property.length && property[0] == ':') { // is a signal property = property[1 .. $]; additional = ".addOn"; displayOverride = property; } else { // is a property additional = ".get"; displayOverride = property; } bool justSawDash = true; foreach(ch; property) { if(justSawDash && ch >= 'a' && ch <= 'z') { additional ~= cast(char) (cast(int) ch - 32); } else if(ch == '-') { // intentionally blank } else { additional ~= ch; } if(ch == '-') { justSawDash = true; } else { justSawDash = false; } } } else { idx = s.indexOf("."); if(idx != -1) { // dot is either a tailing period or a Struct.field if(idx == s.length - 1) s = s[0 .. $ - 1]; // tailing period else { auto structField = s[idx + 1 .. $]; s = s[0 .. idx]; additional = "." ~ structField; // FIXME? } } } auto dClass = gtkObjectToDClass(s); bool plural = false; if(dClass is null && s.length && s[$-1] == 's') { s = s[0 .. $-1]; dClass = gtkObjectToDClass(s); plural = true; } if(dClass !is null) s = dClass; s ~= additional; if(displayOverride.length) return "[" ~ s ~ "|"~displayOverride~"]"; else return "[" ~ s ~ "|"~formatForDisplay(s)~(plural ? "s" : "") ~ "]"; } // gtk function to adrdox d ref string magic2(Captures!string m) { if(m.hit == "main()") return "`"~m.hit~"`"; // special case string s = m.hit[0 .. $-2]; // trim off the () auto orig = m.hit; // these tend to go package_class_method_snake string gtkType; gtkType ~= s[0] | 32; s = s[1 .. $]; bool justSawUnderscore = false; string dType; bool firstUnderscore = true; while(s.length) { if(s[0] == '_') { justSawUnderscore = true; if(!firstUnderscore) { auto dc = gtkObjectToDClass(gtkType); if(dc !is null) { dType = dc; s = s[1 .. $]; break; } } firstUnderscore = false; } else if(justSawUnderscore) { gtkType ~= s[0] & ~32; justSawUnderscore = false; } else gtkType ~= s[0]; s = s[1 .. $]; } if(dType.length) { justSawUnderscore = false; string gtkMethod = ""; while(s.length) { if(s[0] == '_') { justSawUnderscore = true; } else if(justSawUnderscore) { gtkMethod ~= s[0] & ~32; justSawUnderscore = false; } else gtkMethod ~= s[0]; s = s[1 .. $]; } auto dispName = dType[dType.lastIndexOf(".") + 1 .. $] ~ "." ~ gtkMethod; return "[" ~ dType ~ "." ~ gtkMethod ~ "|" ~ dispName ~ "]"; } return "`" ~ orig ~ "`"; } // cut off spam at the end of headers comment = replaceAll(comment, regex(r"(## [A-Za-z0-9 ]+)##.*$", "gm"), "$1"); // translate see also header into ddoc style as a special case comment = replaceAll(comment, regex(r"## See Also.*$", "gm"), "See_Also:\n"); // name lookup comment = replaceAll!magic(comment, regex(r"#[A-Za-z0-9_:\-\.]+", "g")); // gtk params to inline code comment = replaceAll(comment, regex(r"@([A-Za-z0-9_:]+)", "g"), "`$1`"); // constants too comment = replaceAll(comment, regex(r"%([A-Za-z0-9_:]+)", "g"), "`$1`"); // and functions comment = replaceAll!magic2(comment, regex(r"([A-Za-z0-9_]+)\(\)", "g")); // their code blocks comment = replace(comment, `|[<!-- language="C" -->`, "```c\n"); comment = replace(comment, `]|`, "\n```"); break; default: return comment; } return comment; } struct HeaderLink { string text; string url; } string[string] pseudoFiles; bool usePseudoFiles = false; Document writeHtml(Decl decl, bool forReal, bool gzip, string headerTitle, HeaderLink[] headerLinks) { if(!decl.docsShouldBeOutputted) return null; auto title = decl.name; bool justDocs = false; if(auto mod = cast(ModuleDecl) decl) { if(mod.justDocsTitle !is null) { title = mod.justDocsTitle; justDocs = true; } } if(decl.parent !is null && !decl.parent.isModule) { title = decl.parent.name ~ "." ~ title; } auto document = new Document(); import std.file; document.parseUtf8(readText(findStandardFile(skeletonFile)), true, true); document.title = title ~ " (" ~ decl.fullyQualifiedName ~ ")"; if(headerTitle.length) document.requireSelector("#logotype span").innerText = headerTitle; if(headerLinks.length) { auto n = document.requireSelector("#page-header nav"); foreach(l; headerLinks) if(l.text.length && l.url.length) n.addChild("a", l.text, l.url); } auto content = document.requireElementById("page-content"); auto comment = decl.parsedDocComment; content.addChild("h1", title); auto breadcrumbs = content.addChild("div").addClass("breadcrumbs"); //breadcrumbs.prependChild(Element.make("a", decl.name, decl.link).addClass("current breadcrumb")); { auto p = decl.parent; while(p) { if(p.fakeDecl && p.name == "index") break; // cut off package names that would be repeated auto name = (p.isModule && p.parent) ? lastDotOnly(p.name) : p.name; breadcrumbs.prependChild(Element.make("a", name, p.link(true)).addClass("breadcrumb")); p = p.parent; } } if(blogMode && decl.isArticle) { // FIXME: kinda a hack there auto mod = cast(ModuleDecl) decl; if(mod.name.startsWith("Blog.Posted_")) content.addChild("span", decl.name.replace("Blog.Posted_", "Posted ").replace("_", "-")).addClass("date-posted"); } string s; MyOutputRange output = MyOutputRange(&s); comment.writeSynopsis(output); content.addChild("div", Html(s)); s = null; decl.getAnnotatedPrototype(output); content.addChild("div", Html(s), "annotated-prototype"); Element lastDt; string dittoedName; string dittoedComment; void handleChildDecl(Element dl, Decl child, bool enableLinking = true) { auto cc = child.parsedDocComment; string sp; MyOutputRange or = MyOutputRange(&sp); child.getSimplifiedPrototype(or); auto printableName = child.name; if(child.isArticle) { auto mod = cast(ModuleDecl) child; printableName = mod.justDocsTitle; } else { if(child.isModule && child.parent && child.parent.isModule) { if(printableName.startsWith(child.parent.name)) printableName = printableName[child.parent.name.length + 1 .. $]; } } auto newDt = Element.make("dt", Element.make("a", printableName, child.link)); auto st = newDt.addChild("div", Html(sp)).addClass("simplified-prototype"); st.style.maxWidth = to!string(st.innerText.length * 11 / 10) ~ "ch"; if(child.isDitto && child.comment == dittoedComment && lastDt !is null) { // ditto'd names don't need to be written again if(child.name == dittoedName) { if(sp == lastDt.requireSelector(".simplified-prototype").innerHTML) return; // no need to say the same thing twice // same name, but different prototype. Cut the repetition. newDt.requireSelector("a").removeFromTree(); } lastDt.addSibling(newDt); } else { dl.addChild(newDt); auto dd = dl.addChild("dd", Html(formatDocumentationComment(enableLinking ? cc.ddocSummary : preprocessComment(child.comment, child), child))); foreach(e; dd.querySelectorAll("h1, h2, h3, h4, h5, h6")) e.stripOut; dittoedComment = child.comment; } lastDt = newDt; dittoedName = child.name; } Decl[] ctors; Decl[] members; ModuleDecl[] articles; Decl[] submodules; ImportDecl[] imports; if(forReal) foreach(child; decl.children) { if(!child.docsShouldBeOutputted) continue; if(child.isConstructor()) ctors ~= child; else if(child.isArticle) articles ~= cast(ModuleDecl) child; else if(child.isModule) submodules ~= child; else if(cast(DestructorDecl) child) {} // intentionally blank else if(cast(PostblitDecl) child) {} // intentionally blank else if(auto c = cast(ImportDecl) child) imports ~= c; else members ~= child; } if(decl.disabledDefaultConstructor) { content.addChild("h2", "Disabled Default Constructor").id = "disabled-default-constructor"; auto div = content.addChild("div"); div.addChild("p", "A disabled default is present on this object. To use it, use one of the other constructors or a factory function."); } if(ctors.length) { content.addChild("h2", "Constructors").id = "constructors"; auto dl = content.addChild("dl").addClass("member-list constructors"); foreach(child; ctors) { if(child is decl.disabledDefaultConstructor) continue; handleChildDecl(dl, child); writeHtml(child, forReal, gzip, headerTitle, headerLinks); } } if(auto dtor = decl.destructor) { content.addChild("h2", "Destructor").id = "destructor"; auto dl = content.addChild("dl").addClass("member-list"); if(dtor.isDocumented) handleChildDecl(dl, dtor); else content.addChild("p", "A destructor is present on this object, but not explicitly documented in the source."); //writeHtml(dtor, forReal, gzip, headerTitle, headerLinks); } if(auto postblit = decl.postblit) { content.addChild("h2", "Postblit").id = "postblit"; auto dl = content.addChild("dl").addClass("member-list"); if(postblit.isDisabled()) content.addChild("p", "Copying this object is disabled."); if(postblit.isDocumented) handleChildDecl(dl, postblit); else content.addChild("p", "A postblit is present on this object, but not explicitly documented in the source."); //writeHtml(dtor, forReal, gzip, headerTitle, headerLinks); } if(articles.length) { content.addChild("h2", "Articles").id = "articles"; auto dl = content.addChild("dl").addClass("member-list articles"); foreach(child; articles.sort!((a,b) => (blogMode ? (b.name < a.name) : (a.name < b.name)))) { handleChildDecl(dl, child); } } if(submodules.length) { content.addChild("h2", "Modules").id = "modules"; auto dl = content.addChild("dl").addClass("member-list native"); foreach(child; submodules.sort!((a,b) => a.name < b.name)) { handleChildDecl(dl, child); // i actually want submodules to be controlled on the command line too. //if(!usePseudoFiles) // with pseudofiles, we can generate child modules on demand too, so avoid recursive everything on root request //writeHtml(child, forReal, gzip, headerTitle, headerLinks); } } if(auto at = decl.aliasThis) { content.addChild("h2", "Alias This").id = "alias-this"; auto div = content.addChild("div"); div.addChild("a", at.name, at.link); if(decl.aliasThisComment.length) { auto memberComment = formatDocumentationComment(preprocessComment(decl.aliasThisComment, decl), decl); auto dc = div.addChild("div").addClass("documentation-comment"); dc.innerHTML = memberComment; } } if(imports.length) { content.addChild("h2", "Public Imports").id = "public-imports"; auto div = content.addChild("div"); foreach(imp; imports) { auto dl = content.addChild("dl").addClass("member-list native"); handleChildDecl(dl, imp, false); } } if(members.length) { content.addChild("h2", "Members").id = "members"; void outputMemberList(Decl[] members, string header, string idPrefix, string headerPrefix) { Element dl; string lastType; foreach(child; members.sort!sorter) { if(child.declarationType != lastType) { auto hdr = content.addChild(header, headerPrefix ~ pluralize(child.declarationType).capitalize, "member-list-header hide-from-toc"); hdr.id = idPrefix ~ child.declarationType; dl = content.addChild("dl").addClass("member-list native"); lastType = child.declarationType; } handleChildDecl(dl, child); writeHtml(child, forReal, gzip, headerTitle, headerLinks); } } foreach(section; comment.symbolGroupsOrder) { auto memberComment = formatDocumentationComment(preprocessComment(comment.symbolGroups[section], decl), decl); string sectionPrintable = section.replace("_", " ").capitalize; // these count as user headers to move toward TOC - section groups are user defined so it makes sense auto hdr = content.addChild("h3", sectionPrintable, "member-list-header user-header"); hdr.id = "group-" ~ section; auto dc = content.addChild("div").addClass("documentation-comment"); dc.innerHTML = memberComment; if(auto hdr2 = dc.querySelector("> div:only-child > h2:first-child, > div:only-child > h3:first-child")) { hdr.innerHTML = hdr2.innerHTML; hdr2.removeFromTree; } Decl[] subList; for(int i = 0; i < members.length; i++) { auto member = members[i]; if(member.parsedDocComment.group == section) { subList ~= member; members[i] = members[$-1]; members = members[0 .. $-1]; i--; } } outputMemberList(subList, "h4", section ~ "-", sectionPrintable ~ " "); } if(members.length) { if(comment.symbolGroupsOrder.length) { auto hdr = content.addChild("h3", "Other", "member-list-header"); hdr.id = "group-other"; outputMemberList(members, "h4", "other-", "Other "); } else { outputMemberList(members, "h3", "", ""); } } } auto irList = decl.inheritsFrom; if(irList.length) { auto h2 = content.addChild("h2", "Inherited Members"); h2.id = "inherited-members"; bool hasAnyListing = false; foreach(ir; irList) { if(ir.decl is null) continue; auto h3 = content.addChild("h3", "From " ~ ir.decl.name); h3.id = "inherited-from-" ~ ir.decl.fullyQualifiedName; auto dl = content.addChild("dl").addClass("member-list inherited"); bool hadListing = false; foreach(child; ir.decl.children) { if(!child.docsShouldBeOutputted) continue; if(!child.isConstructor()) { handleChildDecl(dl, child); hadListing = true; hasAnyListing = true; } } if(!hadListing) { h3.removeFromTree(); dl.removeFromTree(); } } if(!hasAnyListing) h2.removeFromTree(); } decl.addSupplementalData(content); s = null; if(auto fd = cast(FunctionDeclaration) decl.getAstNode()) comment.writeDetails(output, fd, decl.getProcessedUnittests()); else if(auto fd = cast(Constructor) decl.getAstNode()) comment.writeDetails(output, fd, decl.getProcessedUnittests()); else if(auto fd = cast(TemplateDeclaration) decl.getAstNode()) comment.writeDetails(output, fd, decl.getProcessedUnittests()); else if(auto fd = cast(EponymousTemplateDeclaration) decl.getAstNode()) comment.writeDetails(output, fd, decl.getProcessedUnittests()); else if(auto fd = cast(AliasDecl) decl) { if(fd.initializer) comment.writeDetails(output, fd.initializer, decl.getProcessedUnittests()); else comment.writeDetails(output, decl, decl.getProcessedUnittests()); } else comment.writeDetails(output, decl, decl.getProcessedUnittests()); content.addChild("div", Html(s)); if(forReal) { auto nav = document.requireElementById("page-nav"); Decl[] navArray; string[string] inNavArray; if(decl.parent) { auto iterate = decl.parent.children; if(!decl.isModule && decl.parent.isModule && decl.parent.children.length == 1) { // we are an only child of a module, show the module's nav instead if(decl.parent.parent !is null) iterate = decl.parent.parent.children; } foreach(child; iterate) { if(cast(ImportDecl) child) continue; // do not document public imports here, they belong only on the inside if(child.docsShouldBeOutputted) { // strip overloads from sidebar if(child.name !in inNavArray) { navArray ~= child; inNavArray[child.name] = ""; } } } } else { /+ commented pending removal // this is for building the module nav when doing an incremental // rebuild. It loads the index.xml made with the special option below. static bool attemptedXmlLoad; static ModuleDecl[] indexedModules; if(!attemptedXmlLoad) { import std.file; if(std.file.exists("index.xml")) { auto idx = new XmlDocument(readText("index.xml")); foreach(d; idx.querySelectorAll("listing > decl")) indexedModules ~= new ModuleDecl(d.requireSelector("name").innerText); } attemptedXmlLoad = true; } auto tm = cast(ModuleDecl) decl; if(tm !is null) foreach(im; indexedModules) if(im.packageName == tm.packageName) navArray ~= im; +/ } { auto p = decl.parent; while(p) { // cut off package names that would be repeated auto name = (p.isModule && p.parent) ? lastDotOnly(p.name) : p.name; if(name == "index" && p.fakeDecl) break; nav.prependChild(Element.make("a", name, p.link(true))).addClass("parent"); p = p.parent; } } import std.algorithm; sort!sorter(navArray); Element list; string lastType; foreach(item; navArray) { if(item.declarationType != lastType) { nav.addChild("span", pluralize(item.declarationType)).addClass("type-separator"); list = nav.addChild("ul"); lastType = item.declarationType; } string name; if(item.isArticle) { auto mod = cast(ModuleDecl) item; name = mod.justDocsTitle; } else { // cut off package names that would be repeated name = (item.isModule && item.parent) ? lastDotOnly(item.name) : item.name; } auto n = list.addChild("li").addChild("a", name, item.link).addClass(item.declarationType.replace(" ", "-")); if(item.name == decl.name || name == decl.name) n.addClass("current"); } if(justDocs) { if(auto d = document.querySelector("#details")) d.removeFromTree; } auto toc = Element.make("div"); toc.id = "table-of-contents"; auto current = toc; int lastLevel; tree: foreach(header; document.root.tree) { int level; switch(header.tagName) { case "h2": level = 2; break; case "h3": level = 3; break; case "h4": level = 4; break; case "h5:": level = 5; break; case "h6": level = 6; break; default: break; } if(level == 0) continue; bool addToIt = true; if(header.hasClass("hide-from-toc")) addToIt = false; Element addTo; if(addToIt) { auto parentCheck = header; while(parentCheck) { if(parentCheck.hasClass("adrdox-sample")) continue tree; parentCheck = parentCheck.parentNode; } if(level > lastLevel) { current = current.addChild("ol"); current.addClass("heading-level-" ~ to!string(level)); } else if(level < lastLevel) { while(current && !current.hasClass("heading-level-" ~ to!string(level))) current = current.parentNode; if(current is null) { import std.stdio; writeln("WARNING: TOC broken on " ~ decl.name); goto skip_toc; } assert(current !is null); } lastLevel = level; addTo = current; if(addTo.tagName != "ol") addTo = addTo.parentNode; } if(!header.hasAttribute("id")) header.attrs.id = toId(header.innerText); if(header.querySelector(" > *") is null) { auto selfLink = Element.make("a", header.innerText, "#" ~ header.attrs.id); selfLink.addClass("header-anchor"); header.innerHTML = selfLink.toString(); } if(addToIt) addTo.addChild("li", Element.make("a", header.innerText, "#" ~ header.attrs.id)); } if(auto d = document.querySelector("#more-link")) { if(document.querySelectorAll(".user-header:not(.hide-from-toc)").length > 2) d.replaceWith(toc); } skip_toc: {} if(auto a = document.querySelector(".annotated-prototype")) outer: foreach(c; a.querySelectorAll(".parameters-list")) { auto p = c.parentNode; while(p) { if(p.hasClass("lambda-expression")) continue outer; p = p.parentNode; } c.addClass("toplevel"); } // for line numbering foreach(pre; document.querySelectorAll("pre.highlighted, pre.block-code[data-language!=\"\"]")) { addLineNumbering(pre); } string overloadLink; string declLink = decl.link(true, &overloadLink); if(usePseudoFiles) { pseudoFiles[declLink] = document.toString(); if(overloadLink.length) pseudoFiles[overloadLink] = redirectToOverloadHtml(declLink); } else { writeFile(outputDirectory ~ declLink, document.toString(), gzip); if(overloadLink.length) writeFile(outputDirectory ~ overloadLink, redirectToOverloadHtml(declLink), gzip); } import std.stdio; writeln("WRITTEN TO ", declLink); } return document; } string redirectToOverloadHtml(string what) { return `<script>location.href = '`~what~`';</script> <a href="`~what~`">Continue to overload</a>`; } void addLineNumbering(Element pre, bool id = false) { if(pre.hasClass("with-line-wrappers")) return; string html; int count; foreach(idx, line; pre.innerHTML.splitLines) { auto num = to!string(idx + 1); auto href = "L"~num; if(id) html ~= "<a class=\"br\""~(id ? " id=\""~href~"\"" : "")~" href=\"#"~href~"\">"~num~" </a>"; else html ~= "<span class=\"br\">"~num~" </span>"; html ~= line; html ~= "\n"; count++; } if(count < 5) return; // no point cluttering the display with the sample is so small you can eyeball it instantly anyway pre.innerHTML = html.stripRight; pre.addClass("with-line-wrappers"); if(count >= 10000) pre.addClass("ten-thousand-lines"); else if(count >= 1000) pre.addClass("thousand-lines"); } string lastDotOnly(string s) { auto idx = s.lastIndexOf("."); if(idx == -1) return s; return s[idx + 1 .. $]; } struct InheritanceResult { Decl decl; // may be null string plainText; //const(BaseClass) ast; } Decl[] declsByUda(string uda, Decl start = null) { if(start is null) { assert(0); // cross-module search not implemented here } Decl[] list; if(start.hasUda(uda)) list ~= start; foreach(child; start.children) list ~= declsByUda(uda, child); return list; } abstract class Decl { bool fakeDecl = false; bool alreadyGenerated = false; abstract string name(); abstract string comment(); abstract string rawComment(); abstract string declarationType(); abstract const(ASTNode) getAstNode(); abstract int lineNumber(); //abstract string sourceCode(); abstract void getAnnotatedPrototype(MyOutputRange); abstract void getSimplifiedPrototype(MyOutputRange); DocComment parsedDocComment_; final @property DocComment parsedDocComment() { if(parsedDocComment_ is DocComment.init) parsedDocComment_ = parseDocumentationComment(comment, this); return parsedDocComment_; } void getAggregatePrototype(MyOutputRange r) { getSimplifiedPrototype(r); r.put(";"); } /* virtual */ void addSupplementalData(Element) {} // why is this needed?!?!?!?!? override int opCmp(Object o) { return cast(int)cast(void*)this - cast(int)cast(void*)o; } Decl parentModule() { auto p = this; while(p) { if(p.isModule()) return p; p = p.parent; } assert(0); } Decl previousSibling() { if(parent is null) return null; Decl prev; foreach(child; parent.children) { if(child is this) return prev; prev = child; } return null; } bool isDocumented() { // this shouldn't be needed anymore cuz the recursive check below does a better job //if(this.isModule) //return true; // allow undocumented modules because then it will at least descend into documented children // skip modules with "internal" because they are usually not meant // to be publicly documented anyway { auto mod = this.parentModule.name; if(mod.indexOf(".internal") != -1 && !documentInternal) return false; } if(documentUndocumented) return true; if(comment.length) // hack return comment.length > 0; // cool, not a hack // if it has any documented children, we want to pretend this is documented too // since then it will be possible to navigate to it foreach(child; children) if(child.docsShouldBeOutputted()) return true; // what follows is all filthy hack // the C bindings in druntime are not documented, but // we want them to show up. So I'm gonna hack it. /* auto mod = this.parentModule.name; if(mod.startsWith("core")) return true; */ return false; } bool isStatic() { foreach (a; attributes) { if(a.attr && a.attr.attribute.type == tok!"static") return true; // gshared also implies static (though note that shared does not!) if(a.attr && a.attr.attribute.type == tok!"__gshared") return true; } return false; } bool isPrivate() { IdType protection; foreach (a; attributes) { if (a.attr && isProtection(a.attr.attribute.type)) protection = a.attr.attribute.type; } return protection == tok!"private"; } bool docsShouldBeOutputted() { if((!this.isPrivate || writePrivateDocs) && this.isDocumented) return true; else if(this.comment.indexOf("$(ALWAYS_DOCUMENT)") != -1) return true; return false; } final bool hasUda(string name) { foreach(a; attributes) if(a.attr && a.attr.atAttribute && a.attr.atAttribute.identifier.text == name) return true; return false; } // FIXME: isFinal and isVirtual // FIXME: it would be nice to inherit documentation from interfaces too. bool isProperty() { foreach (a; attributes) { if(a.attr && a.attr.atAttribute && a.attr.atAttribute.identifier.text == "property") return true; } return false; } bool isAggregateMember() { return parent ? !parent.isModule : false; // FIXME? } // does NOT look for aliased overload sets, just ones right in this scope // includes this in the return (plus eponymous check). Check if overloaded with .length > 1 Decl[] getImmediateDocumentedOverloads() { Decl[] ret; if(this.parent !is null) { foreach(child; this.parent.children) { if(((cast(ImportDecl) child) is null) && child.name == this.name && child.docsShouldBeOutputted()) ret ~= child; } if(auto t = cast(TemplateDecl) this.parent) if(this is t.eponymousMember) { foreach(i; t.getImmediateDocumentedOverloads()) if(i !is t) ret ~= i; } } return ret; } Decl[] getDittos() { if(this.parent is null) return null; size_t lastNonDitto; foreach(idx, child; this.parent.children) { if(!child.isDitto()) lastNonDitto = idx; if(child is this) { break; } } size_t stop = lastNonDitto; foreach(idx, child; this.parent.children[lastNonDitto + 1 .. $]) if(child.isDitto()) stop = idx + lastNonDitto + 1 + 1; // one +1 is offset of begin, other is to make sure it is inclusive else break; return this.parent.children[lastNonDitto .. stop]; } string link(bool forFile = false, string* masterOverloadName = null) { auto linkTo = this; if(!forFile && this.isModule && this.children.length == 1) { linkTo = this.children[0]; } auto n = linkTo.fullyQualifiedName(); auto overloads = linkTo.getImmediateDocumentedOverloads(); if(overloads.length > 1) { int number = 1; int goodNumber; foreach(overload; overloads) { if(overload is this) { goodNumber = number; break; } number++; } if(goodNumber) number = goodNumber; else number = 1; if(masterOverloadName !is null) *masterOverloadName = n.idup; import std.conv : text; n ~= text(".", number); } n ~= ".html"; if(masterOverloadName !is null) *masterOverloadName ~= ".html"; if(!forFile) { string d = getDirectoryForPackage(linkTo.fullyQualifiedName()); if(d.length) { n = d ~ n; if(masterOverloadName !is null) *masterOverloadName = d ~ *masterOverloadName; } } return n; } string[] parentNameList() { string[] fqn = [name()]; auto p = parent; while(p) { fqn = p.name() ~ fqn; p = p.parent; } return fqn; } string fullyQualifiedName() { string fqn = name(); if(isModule) return fqn; auto p = parent; while(p) { fqn = p.name() ~ "." ~ fqn; if(p.isModule) break; // do NOT want package names in here p = p.parent; } return fqn; } final InheritanceResult[] inheritsFrom() { if(!inheritsFromProcessed) foreach(ref i; _inheritsFrom) if(this.parent && i.plainText.length) { i.decl = this.parent.lookupName(i.plainText); } inheritsFromProcessed = true; return _inheritsFrom; } InheritanceResult[] _inheritsFrom; bool inheritsFromProcessed = false; Decl[string] nameTable; bool nameTableBuilt; Decl[string] buildNameTable(string[] excludeModules = null) { if(!nameTableBuilt) { lookup: foreach(mod; this.importedModules) { if(!mod.publicImport) continue; if(auto modDeclPtr = mod.name in modulesByName) { auto modDecl = *modDeclPtr; foreach(imod; excludeModules) if(imod == modDeclPtr.name) break lookup; auto tbl = modDecl.buildNameTable(excludeModules ~ this.parentModule.name); foreach(k, v; tbl) nameTable[k] = v; } } foreach(child; children) nameTable[child.name] = child; nameTableBuilt = true; } return nameTable; } // the excludeModules is meant to prevent circular lookups Decl lookupName(string name, bool lookUp = true, string[] excludeModules = null) { if(importedModules.length == 0 || importedModules[$-1].name != "object") addImport("object", false); if(name.length == 0) return null; string originalFullName = name; auto subject = this; if(name[0] == '.') { // global scope operator while(subject && !subject.isModule) subject = subject.parent; name = name[1 .. $]; originalFullName = originalFullName[1 .. $]; } auto firstDotIdx = name.indexOf("."); if(firstDotIdx != -1) { subject = subject.lookupName(name[0 .. firstDotIdx]); name = name[firstDotIdx + 1 .. $]; } if(subject) while(subject) { auto table = subject.buildNameTable(); if(name in table) return table[name]; if(lookUp) // at the top level, we also need to check private imports lookup: foreach(mod; subject.importedModules) { if(mod.publicImport) continue; // handled by the name table auto lookupInsideModule = originalFullName; if(auto modDeclPtr = mod.name in modulesByName) { auto modDecl = *modDeclPtr; foreach(imod; excludeModules) if(imod == modDeclPtr.name) break lookup; //import std.stdio; writeln(modDecl.name, " ", lookupInsideModule); auto located = modDecl.lookupName(lookupInsideModule, false, excludeModules ~ this.parentModule.name); if(located !is null) return located; } } if(!lookUp || subject.isModule) subject = null; else subject = subject.parent; } else { // FIXME? // fully qualified name from this module subject = this; if(originalFullName.startsWith(this.parentModule.name ~ ".")) { // came from here! auto located = this.parentModule.lookupName(originalFullName[this.parentModule.name.length + 1 .. $]); if(located !is null) return located; } else while(subject !is null) { foreach(mod; subject.importedModules) { if(originalFullName.startsWith(mod.name ~ ".")) { // fully qualified name from this module auto lookupInsideModule = originalFullName[mod.name.length + 1 .. $]; if(auto modDeclPtr = mod.name in modulesByName) { auto modDecl = *modDeclPtr; auto located = modDecl.lookupName(lookupInsideModule, mod.publicImport); if(located !is null) return located; } } } if(lookUp && subject.isModule) subject = null; else subject = subject.parent; } } return null; } final Decl lookupName(const IdentifierOrTemplateInstance ic, bool lookUp = true) { auto subject = this; if(ic.templateInstance) return null; // FIXME return lookupName(ic.identifier.text, lookUp); } final Decl lookupName(const IdentifierChain ic) { auto subject = this; assert(ic.identifiers.length); // FIXME: leading dot? foreach(idx, ident; ic.identifiers) { subject = subject.lookupName(ident.text, idx == 0); if(subject is null) return null; } return subject; } final Decl lookupName(const IdentifierOrTemplateChain ic) { auto subject = this; assert(ic.identifiersOrTemplateInstances.length); // FIXME: leading dot? foreach(idx, ident; ic.identifiersOrTemplateInstances) { subject = subject.lookupName(ident, idx == 0); if(subject is null) return null; } return subject; } final Decl lookupName(const Symbol ic) { // FIXME dot return lookupName(ic.identifierOrTemplateChain); } Decl parent; Decl[] children; void writeTemplateConstraint(MyOutputRange output); const(VersionOrAttribute)[] attributes; void addChild(Decl decl) { decl.parent = this; children ~= decl; } struct ImportedModule { string name; bool publicImport; } ImportedModule[] importedModules; void addImport(string moduleName, bool isPublic) { importedModules ~= ImportedModule(moduleName, isPublic); } struct Unittest { const(dparse.ast.Unittest) ut; string code; string comment; } Unittest[] unittests; void addUnittest(const(dparse.ast.Unittest) ut, const(ubyte)[] code, string comment) { int slicePoint = 0; foreach(idx, b; code) { if(b == ' ' || b == '\t' || b == '\r') slicePoint++; else if(b == '\n') { slicePoint++; break; } else { slicePoint = 0; break; } } code = code[slicePoint .. $]; unittests ~= Unittest(ut, unittestCodeToString(code), comment); } string unittestCodeToString(const(ubyte)[] code) { auto excludeString = cast(const(ubyte[])) "// exclude from docs"; bool replacementMade; import std.algorithm.searching; auto idx = code.countUntil(excludeString); while(idx != -1) { int before = cast(int) idx; int after = cast(int) idx; while(before > 0 && code[before] != '\n') before--; while(after < code.length && code[after] != '\n') after++; code = code[0 .. before] ~ code[after .. $]; replacementMade = true; idx = code.countUntil(excludeString); } if(!replacementMade) return (cast(char[]) code).idup; // needs to be unique else return cast(string) code; // already copied above, so it is unique } struct ProcessedUnittest { string code; string comment; bool embedded; } bool _unittestsProcessed; ProcessedUnittest[] _processedUnittests; ProcessedUnittest[] getProcessedUnittests() { if(_unittestsProcessed) return _processedUnittests; _unittestsProcessed = true; // source, comment ProcessedUnittest[] ret; Decl start = this; if(isDitto()) { foreach(child; this.parent.children) { if(child is this) break; if(!child.isDitto()) start = child; } } bool started = false; if(this.parent) foreach(child; this.parent.children) { if(started) { if(!child.isDitto()) break; } else { if(child is start) started = true; } if(started) foreach(test; child.unittests) if(test.comment.length) ret ~= ProcessedUnittest(test.code, test.comment); } else foreach(test; this.unittests) if(test.comment.length) ret ~= ProcessedUnittest(test.code, test.comment); _processedUnittests = ret; return ret; } override string toString() { string s; s ~= super.toString() ~ " " ~ this.name(); foreach(child; children) { s ~= "\n"; auto p = parent; while(p) { s ~= "\t"; p = p.parent; } s ~= child.toString(); } return s; } abstract bool isDitto(); bool isModule() { return false; } bool isArticle() { return false; } bool isConstructor() { return false; } bool aliasThisPresent; Token aliasThisToken; string aliasThisComment; Decl aliasThis() { if(!aliasThisPresent) return null; else return lookupName(aliasThisToken.text, false); } DestructorDecl destructor() { foreach(child; children) if(auto dd = cast(DestructorDecl) child) return dd; return null; } PostblitDecl postblit() { foreach(child; children) if(auto dd = cast(PostblitDecl) child) return dd; return null; } abstract bool isDisabled(); ConstructorDecl disabledDefaultConstructor() { foreach(child; children) if(child.isConstructor() && child.isDisabled()) { auto ctor = cast(ConstructorDecl) child; if(ctor.astNode.parameters || ctor.astNode.parameters.parameters.length == 0) return ctor; } return null; } } class ModuleDecl : Decl { mixin CtorFrom!Module defaultMixins; string justDocsTitle; override bool isModule() { return true; } override bool isArticle() { return justDocsTitle.length > 0; } override string declarationType() { return isArticle() ? "Article" : "module"; } version(none) override void getSimplifiedPrototype(MyOutputRange r) { if(isArticle()) r.put(justDocsTitle); else defaultMixins.getSimplifiedPrototype(r); } ubyte[] originalSource; string packageName() { auto it = this.name(); auto idx = it.lastIndexOf("."); if(idx == -1) return null; return it[0 .. idx]; } } class AliasDecl : Decl { mixin CtorFrom!AliasDeclaration; this(const(AliasDeclaration) ad, const(VersionOrAttribute)[] attributes) { this.attributes = attributes; this.astNode = ad; this.initializer = null; // deal with the type and initializer list and storage classes } const(AliasInitializer) initializer; this(const(AliasDeclaration) ad, const(AliasInitializer) init, const(VersionOrAttribute)[] attributes) { this.attributes = attributes; this.astNode = ad; this.initializer = init; // deal with init } override string name() { if(initializer is null) return toText(astNode.identifierList); else return initializer.name.text; } override void getAnnotatedPrototype(MyOutputRange output) { void cool() { output.putTag("<div class=\"declaration-prototype\">"); if(parent !is null && !parent.isModule) { output.putTag("<div class=\"parent-prototype\""); parent.getSimplifiedPrototype(output); output.putTag("</div><div>"); getPrototype(output, true); output.putTag("</div>"); } else { getPrototype(output, true); } output.putTag("</div>"); } writeOverloads!cool(this, output); } override void getSimplifiedPrototype(MyOutputRange output) { getPrototype(output, false); } void getPrototype(MyOutputRange output, bool link) { // FIXME: storage classes? if(link) { auto f = new MyFormatter!(typeof(output))(output, this); writeAttributes(f, output, this.attributes); } output.putTag("<span class=\"builtin-type\">alias</span> "); output.putTag("<span class=\"name\">"); output.put(name); output.putTag("</span>"); if(initializer && initializer.templateParameters) { output.putTag(toHtml(initializer.templateParameters).source); } output.put(" = "); if(initializer) { if(link) output.putTag(toLinkedHtml(initializer.type, this).source); else output.putTag(toHtml(initializer.type).source); } if(astNode.type) { if(link) { auto t = toText(astNode.type); auto decl = lookupName(t); if(decl is null) goto nulldecl; output.putTag(getReferenceLink(t, decl).toString); } else { nulldecl: output.putTag(toHtml(astNode.type).source); } } } } class VariableDecl : Decl { mixin CtorFrom!VariableDeclaration; const(Declarator) declarator; this(const(Declarator) declarator, const(VariableDeclaration) astNode, const(VersionOrAttribute)[] attributes) { this.astNode = astNode; this.declarator = declarator; this.attributes = attributes; this.ident = Token.init; this.initializer = null; } const(Token) ident; const(Initializer) initializer; this(const(VariableDeclaration) astNode, const(Token) ident, const(Initializer) initializer, const(VersionOrAttribute)[] attributes, bool isEnum) { this.declarator = null; this.attributes = attributes; this.astNode = astNode; this.ident = ident; this.isEnum = isEnum; this.initializer = initializer; } bool isEnum; override string name() { if(declarator) return declarator.name.text; else return ident.text; } override string rawComment() { string it = astNode.comment; auto additional = (declarator ? declarator.comment : astNode.autoDeclaration.comment); if(additional != it) it ~= additional; return it; } override void getAnnotatedPrototype(MyOutputRange output) { output.putTag("<div class=\"declaration-prototype\">"); if(parent !is null && !parent.isModule) { output.putTag("<div class=\"parent-prototype\""); parent.getSimplifiedPrototype(output); output.putTag("</div><div>"); getSimplifiedPrototypeInternal(output, true); output.putTag("</div>"); } else { getSimplifiedPrototypeInternal(output, true); } output.putTag("</div>"); } override void getSimplifiedPrototype(MyOutputRange output) { getSimplifiedPrototypeInternal(output, false); } final void getSimplifiedPrototypeInternal(MyOutputRange output, bool link) { foreach(sc; astNode.storageClasses) { output.putTag(toHtml(sc).source); output.put(" "); } if(astNode.type) { if(link) { auto html = toHtml(astNode.type).source; auto txt = toText(astNode.type); auto typeDecl = lookupName(txt); if(typeDecl is null || !typeDecl.docsShouldBeOutputted) goto plain; output.putTag("<a title=\""~typeDecl.fullyQualifiedName~"\" href=\""~typeDecl.link~"\">" ~ html ~ "</a>"); } else { plain: output.putTag(toHtml(astNode.type).source); } } else output.putTag("<span class=\"builtin-type\">"~(isEnum ? "enum" : "auto")~"</span>"); output.put(" "); output.putTag("<span class=\"name\">"); output.put(name); output.putTag("</span>"); if(declarator && declarator.templateParameters) output.putTag(toHtml(declarator.templateParameters).source); if(link) { if(initializer !is null) { output.put(" = "); output.putTag(toHtml(initializer).source); } } output.put(";"); } override void getAggregatePrototype(MyOutputRange output) { auto f = new MyFormatter!(typeof(output))(output); writeAttributes(f, output, attributes); getSimplifiedPrototypeInternal(output, false); } override string declarationType() { return (isStatic() ? "static variable" : (isEnum ? "manifest constant" : "variable")); } } class FunctionDecl : Decl { mixin CtorFrom!FunctionDeclaration; override void getAnnotatedPrototype(MyOutputRange output) { doFunctionDec(this, output); } override Decl lookupName(string name, bool lookUp = true, string[] excludeModules = null) { // is it a param or template param? If so, return that. foreach(param; astNode.parameters.parameters) { if (param.name.type != tok!"") if(param.name.text == name) { return null; // it is local, but we don't have a decl.. } } if(astNode.templateParameters && astNode.templateParameters.templateParameterList && astNode.templateParameters.templateParameterList.items) foreach(param; astNode.templateParameters.templateParameterList.items) { auto paramName = ""; if(param.templateTypeParameter) paramName = param.templateTypeParameter.identifier.text; else if(param.templateValueParameter) paramName = param.templateValueParameter.identifier.text; else if(param.templateAliasParameter) paramName = param.templateAliasParameter.identifier.text; else if(param.templateTupleParameter) paramName = param.templateTupleParameter.identifier.text; if(paramName.length && paramName == name) { return null; // it is local, but we don't have a decl.. } } if(lookUp) return super.lookupName(name, lookUp, excludeModules); else return null; } override string declarationType() { return isProperty() ? "property" : (isStatic() ? "static function" : "function"); } override void getAggregatePrototype(MyOutputRange output) { if(isStatic()) { output.putTag("<span class=\"storage-class\">static</span> "); } getSimplifiedPrototype(output); output.put(";"); } override void getSimplifiedPrototype(MyOutputRange output) { foreach(sc; astNode.storageClasses) { output.putTag(toHtml(sc).source); output.put(" "); } if(isProperty() && (paramCount == 0 || paramCount == 1 || (paramCount == 2 && !isAggregateMember))) { if((paramCount == 1 && isAggregateMember()) || (paramCount == 2 && !isAggregateMember())) { // setter output.putTag(toHtml(astNode.parameters.parameters[0].type).source); output.put(" "); output.putTag("<span class=\"name\">"); output.put(name); output.putTag("</span>"); output.put(" [@property setter]"); } else { // getter putSimplfiedReturnValue(output, astNode); output.put(" "); output.putTag("<span class=\"name\">"); output.put(name); output.putTag("</span>"); output.put(" [@property getter]"); } } else { putSimplfiedReturnValue(output, astNode); output.put(" "); output.putTag("<span class=\"name\">"); output.put(name); output.putTag("</span>"); putSimplfiedArgs(output, astNode); } } int paramCount() { return cast(int) astNode.parameters.parameters.length; } } class ConstructorDecl : Decl { mixin CtorFrom!Constructor; override void getAnnotatedPrototype(MyOutputRange output) { doFunctionDec(this, output); } override void getSimplifiedPrototype(MyOutputRange output) { output.putTag("<span class=\"lang-feature name\">"); output.put("this"); output.putTag("</span>"); putSimplfiedArgs(output, astNode); } override bool isConstructor() { return true; } } class DestructorDecl : Decl { mixin CtorFrom!Destructor; override void getSimplifiedPrototype(MyOutputRange output) { output.putTag("<span class=\"lang-feature name\">"); output.put("~this"); output.putTag("</span>"); output.put("()"); } } class PostblitDecl : Decl { mixin CtorFrom!Postblit; override void getSimplifiedPrototype(MyOutputRange output) { if(isDisabled) { output.putTag("<span class=\"builtin-type\">"); output.put("@disable"); output.putTag("</span>"); output.put(" "); } output.putTag("<span class=\"lang-feature name\">"); output.put("this(this)"); output.putTag("</span>"); } } class ImportDecl : Decl { mixin CtorFrom!ImportDeclaration; bool isPublic; string newName; string oldName; override string link(bool forFile = false, string* useless = null) { string d; if(!forFile) { d = getDirectoryForPackage(oldName); } return d ~ oldName ~ ".html"; } // I also want to document undocumented public imports, since they also spam up the namespace override bool docsShouldBeOutputted() { return isPublic; } override string name() { return newName.length ? newName : oldName; } override string declarationType() { return "import"; } override void getSimplifiedPrototype(MyOutputRange output) { if(isPublic) output.putTag("<span class=\"builtin-type\">public</span> "); output.putTag(toHtml(astNode).source); } } class MixedInTemplateDecl : Decl { mixin CtorFrom!TemplateMixinExpression; override string declarationType() { return "mixin"; } override void getSimplifiedPrototype(MyOutputRange output) { output.putTag(toHtml(astNode).source); } } class StructDecl : Decl { mixin CtorFrom!StructDeclaration; override void getAnnotatedPrototype(MyOutputRange output) { annotatedPrototype(this, output); } } class UnionDecl : Decl { mixin CtorFrom!UnionDeclaration; override void getAnnotatedPrototype(MyOutputRange output) { annotatedPrototype(this, output); } } class ClassDecl : Decl { mixin CtorFrom!ClassDeclaration; override void getAnnotatedPrototype(MyOutputRange output) { annotatedPrototype(this, output); } } class InterfaceDecl : Decl { mixin CtorFrom!InterfaceDeclaration; override void getAnnotatedPrototype(MyOutputRange output) { annotatedPrototype(this, output); } } class TemplateDecl : Decl { mixin CtorFrom!TemplateDeclaration; Decl eponymousMember() { foreach(child; this.children) if(child.name == this.name) return child; return null; } override void getAnnotatedPrototype(MyOutputRange output) { annotatedPrototype(this, output); } } class EponymousTemplateDecl : Decl { mixin CtorFrom!EponymousTemplateDeclaration; /* Decl eponymousMember() { foreach(child; this.children) if(child.name == this.name) return child; return null; } */ override string declarationType() { return "enum"; } override void getAnnotatedPrototype(MyOutputRange output) { annotatedPrototype(this, output); } } class MixinTemplateDecl : Decl { mixin CtorFrom!TemplateDeclaration; // MixinTemplateDeclaration does nothing interesting except this.. override void getAnnotatedPrototype(MyOutputRange output) { annotatedPrototype(this, output); } override string declarationType() { return "mixin template"; } } class EnumDecl : Decl { mixin CtorFrom!EnumDeclaration; override void addSupplementalData(Element content) { doEnumDecl(this, content); } } class AnonymousEnumDecl : Decl { mixin CtorFrom!AnonymousEnumDeclaration; override string name() { assert(astNode.members.length > 0); auto name = astNode.members[0].name.text; return name; } override void addSupplementalData(Element content) { doEnumDecl(this, content); } override string declarationType() { return "enum"; } } mixin template CtorFrom(T) { const(T) astNode; static if(!is(T == VariableDeclaration) && !is(T == AliasDeclaration)) this(const(T) astNode, const(VersionOrAttribute)[] attributes) { this.astNode = astNode; this.attributes = attributes; static if(is(typeof(astNode) == const(ClassDeclaration)) || is(typeof(astNode) == const(InterfaceDeclaration))) { if(astNode.baseClassList) foreach(idx, baseClass; astNode.baseClassList.items) { auto bc = toText(baseClass); InheritanceResult ir = InheritanceResult(null, bc); _inheritsFrom ~= ir; } } } static if(is(T == Module)) { // this is so I can load this from the index... kinda a hack // it should only be used in limited circumstances private string _name; private this(string name) { this._name = name; this.astNode = null; } } override const(T) getAstNode() { return astNode; } override int lineNumber() { static if(__traits(compiles, astNode.name.line)) return cast(int) astNode.name.line; else static if(__traits(compiles, astNode.line)) return cast(int) astNode.line; else static if(__traits(compiles, astNode.declarators[0].name.line)) { if(astNode.declarators.length) return cast(int) astNode.declarators[0].name.line; } else static if(is(typeof(astNode) == const(Module))) { return 0; } else static assert(0, typeof(astNode).stringof); return 0; } override void writeTemplateConstraint(MyOutputRange output) { static if(__traits(compiles, astNode.constraint)) { if(astNode.constraint) { auto f = new MyFormatter!(typeof(output))(output); output.putTag("<div class=\"template-constraint\">"); f.format(astNode.constraint); output.putTag("</div>"); } } } override string name() { static if(is(T == Constructor)) return "this"; else static if(is(T == Destructor)) return "~this"; else static if(is(T == Postblit)) return "this(this)"; else static if(is(T == Module)) return _name is null ? .format(astNode.moduleDeclaration.moduleName) : _name; else static if(is(T == AnonymousEnumDeclaration)) { assert(0); } // overridden above else static if(is(T == AliasDeclaration)) { assert(0); } // overridden above else static if(is(T == VariableDeclaration)) {assert(0);} // not compiled, overridden above else static if(is(T == ImportDeclaration)) {assert(0);} // not compiled, overridden above else static if(is(T == MixinTemplateDeclaration)) { return astNode.templateDeclaration.name.text; } else static if(is(T == StructDeclaration) || is(T == UnionDeclaration)) if(astNode.name.text.length) return astNode.name.text; else return "__anonymous"; else static if(is(T == TemplateMixinExpression)) { return astNode.identifier.text.length ? astNode.identifier.text : "__anonymous"; } else return astNode.name.text; } override string comment() { static if(is(T == Module)) return astNode.moduleDeclaration.comment; else { if(isDitto()) { auto ps = previousSibling; while(ps && ps.rawComment.length == 0) ps = ps.previousSibling; return ps ? ps.comment : rawComment(); } else return rawComment(); } } override void getAnnotatedPrototype(MyOutputRange) {} override void getSimplifiedPrototype(MyOutputRange output) { output.putTag("<span class=\"builtin-type\">"); output.put(declarationType()); output.putTag("</span>"); output.put(" "); output.putTag("<span class=\"name\">"); output.put(name); output.putTag("</span>"); static if(__traits(compiles, astNode.templateParameters)) { if(astNode.templateParameters) { output.putTag("<span class=\"template-params\">"); output.put(toText(astNode.templateParameters)); output.putTag("</span>"); } } } override string declarationType() { import std.string:toLower; return toLower(typeof(this).stringof[0 .. $-4]); } override bool isDitto() { static if(is(T == Module)) return false; else { import std.string; auto l = strip(toLower(preprocessComment(rawComment, this))); if(l.length && l[$-1] == '.') l = l[0 .. $-1]; return l == "ditto"; } } override string rawComment() { static if(is(T == Module)) return astNode.moduleDeclaration.comment; else static if(is(T == MixinTemplateDeclaration)) return astNode.templateDeclaration.comment; else return astNode.comment; } override bool isDisabled() { foreach(attribute; attributes) if(attribute.attr && attribute.attr.atAttribute && attribute.attr.atAttribute.identifier.text == "disable") return true; static if(__traits(compiles, astNode.memberFunctionAttributes)) foreach(attribute; astNode.memberFunctionAttributes) if(attribute && attribute.atAttribute && attribute.atAttribute.identifier.text == "disable") return true; return false; } } ClassDecl[string] allClasses; class Looker : ASTVisitor { alias visit = ASTVisitor.visit; const(ubyte)[] fileBytes; string originalFileName; this(const(ubyte)[] fileBytes, string fileName) { this.fileBytes = fileBytes; this.originalFileName = fileName; } ModuleDecl root; private Decl[] stack; Decl previousSibling() { auto s = stack[$-1]; if(s.children.length) return s.children[$-1]; return s; // probably a documented unittest of the module itself } void visitInto(D, T)(const(T) t) { auto d = new D(t, attributes[$-1]); stack[$-1].addChild(d); stack ~= d; t.accept(this); stack = stack[0 .. $-1]; static if(is(D == ClassDecl)) allClasses[d.name] = d; } override void visit(const Module mod) { pushAttributes(); root = new ModuleDecl(mod, attributes[$-1]); stack ~= root; mod.accept(this); assert(stack.length == 1); } override void visit(const FunctionDeclaration dec) { stack[$-1].addChild(new FunctionDecl(dec, attributes[$-1])); } override void visit(const Constructor dec) { stack[$-1].addChild(new ConstructorDecl(dec, attributes[$-1])); } override void visit(const TemplateMixinExpression dec) { stack[$-1].addChild(new MixedInTemplateDecl(dec, attributes[$-1])); } override void visit(const Postblit dec) { stack[$-1].addChild(new PostblitDecl(dec, attributes[$-1])); } override void visit(const Destructor dec) { stack[$-1].addChild(new DestructorDecl(dec, attributes[$-1])); } override void visit(const StructDeclaration dec) { visitInto!StructDecl(dec); } override void visit(const ClassDeclaration dec) { visitInto!ClassDecl(dec); } override void visit(const UnionDeclaration dec) { visitInto!UnionDecl(dec); } override void visit(const InterfaceDeclaration dec) { visitInto!InterfaceDecl(dec); } override void visit(const TemplateDeclaration dec) { visitInto!TemplateDecl(dec); } override void visit(const EponymousTemplateDeclaration dec) { visitInto!EponymousTemplateDecl(dec); } override void visit(const MixinTemplateDeclaration dec) { visitInto!MixinTemplateDecl(dec.templateDeclaration); } override void visit(const EnumDeclaration dec) { visitInto!EnumDecl(dec); } override void visit(const AliasThisDeclaration dec) { stack[$-1].aliasThisPresent = true; stack[$-1].aliasThisToken = dec.identifier; stack[$-1].aliasThisComment = dec.comment; } override void visit(const AnonymousEnumDeclaration dec) { // we can't do anything with an empty anonymous enum, we need a name from somewhere if(dec.members.length) visitInto!AnonymousEnumDecl(dec); } override void visit(const VariableDeclaration dec) { if (dec.autoDeclaration) { foreach (idx, ident; dec.autoDeclaration.identifiers) { stack[$-1].addChild(new VariableDecl(dec, ident, dec.autoDeclaration.initializers[idx], attributes[$-1], dec.isEnum)); } } else foreach (const Declarator d; dec.declarators) { stack[$-1].addChild(new VariableDecl(d, dec, attributes[$-1])); /* if (variableDeclaration.type !is null) { auto f = new MyFormatter!(typeof(app))(app); f.format(variableDeclaration.type); } output.putTag(app.data); output.put(" "); output.put(d.name.text); comment.writeDetails(output); writeToParentList("variable " ~ cast(string)app.data ~ " ", name, comment.synopsis, "variable"); ascendOutOf(name); */ } } override void visit(const AliasDeclaration dec) { if(dec.initializers.length) { // alias a = b foreach(init; dec.initializers) stack[$-1].addChild(new AliasDecl(dec, init, attributes[$-1])); } else { // alias b a; // might include a type... stack[$-1].addChild(new AliasDecl(dec, attributes[$-1])); } } override void visit(const Unittest ut) { //import std.stdio; writeln(fileBytes.length, " ", ut.blockStatement.startLocation, " ", ut.blockStatement.endLocation); previousSibling.addUnittest( ut, fileBytes[ut.blockStatement.startLocation + 1 .. ut.blockStatement.endLocation], // trim off the opening and closing {} ut.comment ); } override void visit(const ImportDeclaration id) { bool isPublic = false; foreach(a; attributes[$-1]) { if (a.attr && isProtection(a.attr.attribute.type)) if(a.attr.attribute.type == tok!"public") { isPublic = true; break; } } void handleSingleImport(const SingleImport si) { auto newName = si.rename.text; auto oldName = ""; foreach(idx, ident; si.identifierChain.identifiers) { if(idx) oldName ~= "."; oldName ~= ident.text; } stack[$-1].addImport(oldName, isPublic); // FIXME: handle the rest like newName for the import lookups auto nid = new ImportDecl(id, attributes[$-1]); stack[$-1].addChild(nid); nid.isPublic = isPublic; nid.oldName = oldName; nid.newName = newName; } foreach(si; id.singleImports) { handleSingleImport(si); } if(id.importBindings && id.importBindings.singleImport) handleSingleImport(id.importBindings.singleImport); // FIXME: handle bindings } override void visit(const StructBody sb) { pushAttributes(); sb.accept(this); popAttributes(); } // FIXME ???? override void visit(const VersionCondition sb) { attributes[$-1] ~= new VersionFakeAttribute(toText(sb.token)); sb.accept(this); } override void visit(const BlockStatement bs) { pushAttributes(); bs.accept(this); popAttributes(); } override void visit(const ConditionalDeclaration bs) { pushAttributes(); size_t previousConditions; if(bs.compileCondition) { previousConditions = attributes[$-1].length; bs.compileCondition.accept(this); } if(bs.trueDeclarations) foreach(td; bs.trueDeclarations) td.accept(this); if(bs.falseDeclaration) { auto slice = attributes[$-1][previousConditions .. $]; attributes[$-1] = attributes[$-1][0 .. previousConditions]; foreach(cond; slice) attributes[$-1] ~= cond.invertedClone; bs.falseDeclaration.accept(this); } popAttributes(); } override void visit(const Declaration dec) { auto originalAttributes = attributes[$ - 1]; foreach(a; dec.attributes) attributes[$ - 1] ~= new VersionOrAttribute(a); dec.accept(this); if (dec.attributeDeclaration is null) attributes[$ - 1] = originalAttributes; } override void visit(const AttributeDeclaration dec) { attributes[$ - 1] ~= new VersionOrAttribute(dec.attribute); } void pushAttributes() { attributes.length = attributes.length + 1; } void popAttributes() { attributes = attributes[0 .. $ - 1]; } const(VersionOrAttribute)[][] attributes; } string format(const IdentifierChain identifierChain) { string r; foreach(count, ident; identifierChain.identifiers) { if (count) r ~= ("."); r ~= (ident.text); } return r; } import std.algorithm : startsWith, findSplitBefore; import std.string : strip; //Decl[][string] packages; __gshared ModuleDecl[string] modulesByName; __gshared string specialPreprocessor; // simplified ".gitignore" processor final class GitIgnore { string[] masks; // on each new dir, empty line is added to masks void loadGlobalGitIgnore () { import std.path; import std.stdio; try { foreach (string s; File("~/.gitignore_global".expandTilde).byLineCopy) { if (isComment(s)) continue; masks ~= trim(s); } } catch (Exception e) {} // sorry try { foreach (string s; File("~/.adrdoxignore_global".expandTilde).byLineCopy) { if (isComment(s)) continue; masks ~= trim(s); } } catch (Exception e) {} // sorry } void loadGitIgnore (const(char)[] dir) { import std.path; import std.stdio; masks ~= null; try { foreach (string s; File(buildPath(dir, ".gitignore").expandTilde).byLineCopy) { if (isComment(s)) continue; masks ~= trim(s); } } catch (Exception e) {} // sorry try { foreach (string s; File(buildPath(dir, ".adrdoxignore").expandTilde).byLineCopy) { if (isComment(s)) continue; masks ~= trim(s); } } catch (Exception e) {} // sorry } // unload latest gitignore void unloadGitIgnore () { auto ol = masks.length; while (masks.length > 0 && masks[$-1] !is null) masks = masks[0..$-1]; if (masks.length > 0 && masks[$-1] is null) masks = masks[0..$-1]; if (masks.length != ol) { //writeln("removed ", ol-masks.length, " lines"); masks.assumeSafeAppend; //hack! } } bool match (string fname) { import std.path; import std.stdio; if (masks.length == 0) return false; //writeln("gitignore checking: <", fname, ">"); bool xmatch (string path, string mask) { if (mask.length == 0 || path.length == 0) return false; import std.string : indexOf; if (mask.indexOf('/') < 0) return path.baseName.globMatch(mask); int xpos = cast(int)path.length-1; while (xpos >= 0) { while (xpos > 0 && path[xpos] != '/') --xpos; if (mask[0] == '/') { if (xpos+1 < path.length && path[xpos+1..$].globMatch(mask)) return true; } else { if (path[xpos..$].globMatch(mask)) return true; } --xpos; } return false; } string curname = fname.baseName; int pos = cast(int)masks.length-1; // local dir matching while (pos >= 0 && masks[pos] !is null) { //writeln(" [", masks[pos], "]"); if (xmatch(curname, masks[pos])) { //writeln(" LOCAL HIT: [", masks[pos], "]: <", curname, ">"); return true; } if (masks[pos][0] == '/' && xmatch(curname, masks[pos][1..$])) return true; --pos; } curname = fname; while (pos >= 0) { if (masks[pos] !is null) { //writeln(" [", masks[pos], "]"); if (xmatch(curname, masks[pos])) { //writeln(" HIT: [", masks[pos], "]: <", curname, ">"); return true; } } --pos; } return false; } static: inout(char)[] trim (inout(char)[] s) { while (s.length > 0 && s[0] <= ' ') s = s[1..$]; while (s.length > 0 && s[$-1] <= ' ') s = s[0..$-1]; return s; } bool isComment (const(char)[] s) { s = trim(s); return (s.length == 0 || s[0] == '#'); } } string[] scanFiles (string basedir) { import std.file : isDir; import std.path; if(basedir == "-") return ["-"]; string[] res; auto gi = new GitIgnore(); gi.loadGlobalGitIgnore(); void scanSubDir(bool checkdir=true) (string dir) { import std.file; static if (checkdir) { string d = dir; if (d.length > 1 && d[$-1] == '/') d = d[0..$-1]; if (gi.match(d)) { //writeln("DIR SKIP: <", dir, ">"); return; } } gi.loadGitIgnore(dir); scope(exit) gi.unloadGitIgnore(); foreach (DirEntry de; dirEntries(dir, SpanMode.shallow)) { try { if (de.isDir) { scanSubDir(de.name); continue; } if (de.baseName.length == 0) continue; // just in case if (de.baseName[0] == '.') continue; // skip hidden files if (!de.baseName.globMatch("*.d")) continue; if (/*de.isFile &&*/ !gi.match(de.name)) { //writeln(de.name); res ~= de.name; } } catch (Exception e) {} // some checks (like `isDir`) can throw } } basedir = basedir.expandTilde.absolutePath; if (basedir.isDir) { scanSubDir!false(basedir); } else { res ~= basedir; } return res; } void writeFile(string filename, string content, bool gzip) { import std.zlib; import std.file; if(gzip) { auto compress = new Compress(HeaderFormat.gzip); auto data = compress.compress(content); data ~= compress.flush(); std.file.write(filename ~ ".gz", data); } else { std.file.write(filename, content); } } __gshared bool generatingSource; __gshared bool blogMode = false; void main(string[] args) { import std.stdio; import std.path : buildPath; import std.getopt; static import std.file; LexerConfig config; StringCache stringCache = StringCache(128); config.stringBehavior = StringBehavior.source; config.whitespaceBehavior = WhitespaceBehavior.include; ModuleDecl[] moduleDecls; ModuleDecl[] moduleDeclsGenerate; ModuleDecl[string] moduleDeclsGenerateByName; bool makeHtml = true; bool makeSearchIndex = false; string[] preloadArgs; string[] linkReferences; bool annotateSource = false; string locateSymbol = null; bool gzip; bool copyStandardFiles = true; string headerTitle; string[] headerLinks; HeaderLink[] headerLinksParsed; bool skipExisting = false; string[] globPathInput; int jobs = 0; auto opt = getopt(args, std.getopt.config.passThrough, std.getopt.config.bundling, "load", "Load for automatic cross-referencing, but do not generate for it", &preloadArgs, "link-references", "A file defining global link references", &linkReferences, "skeleton|s", "Location of the skeleton file, change to your use case, Default: skeleton.html", &skeletonFile, "directory|o", "Output directory of the html files", &outputDirectory, "write-private-docs|p", "Include documentation for `private` members (default: false)", &writePrivateDocs, "write-internal-modules", "Include documentation for modules named `internal` (default: false)", &documentInternal, "locate-symbol", "Locate a symbol in the passed file", &locateSymbol, "genHtml|h", "Generate html, default: true", &makeHtml, "genSource|u", "Generate annotated source", &annotateSource, "genSearchIndex|i", "Generate search index, default: false", &makeSearchIndex, "gzip|z", "Gzip generated files as they are created", &gzip, "copy-standard-files", "Copy standard JS/CSS files into target directory (default: true)", &copyStandardFiles, "blog-mode", "Use adrdox as a static site generator for a blog", &blogMode, "header-title", "Title to put on the page header", &headerTitle, "header-link", "Link to add to the header (text=url)", &headerLinks, "document-undocumented", "Generate documentation even for undocumented symbols", &documentUndocumented, "skip-existing", "Skip file generation for modules where the html already exists in the output dir", &skipExisting, "special-preprocessor", "Run a special preprocessor on comments. Only supported right now are gtk and dwt", &specialPreprocessor, "jobs|j", "Number of generation jobs to run at once (default=dependent on number of cpu cores", &jobs, "package-path", "Path to be prefixed to links for a particular D package namespace (package_pattern=link_prefix)", &globPathInput); foreach(gpi; globPathInput) { auto idx = gpi.indexOf("="); string pathGlob; string dir; if(idx != -1) { pathGlob = gpi[0 .. idx]; dir = gpi[idx + 1 .. $]; } else { pathGlob = gpi; } directoriesForPackage[pathGlob] = dir; } generatingSource = annotateSource; if (outputDirectory[$-1] != '/') outputDirectory ~= '/'; if (opt.helpWanted || args.length == 1) { defaultGetoptPrinter("A better D documentation generator\nCopyright © Adam D. Ruppe 2016-2018\n" ~ "Syntax: " ~ args[0] ~ " /path/to/your/package\n", opt.options); return; } foreach(l; headerLinks) { auto idx = l.indexOf("="); if(idx == -1) continue; HeaderLink lnk; lnk.text = l[0 .. idx].strip; lnk.url = l[idx + 1 .. $].strip; headerLinksParsed ~= lnk; } if(locateSymbol is null) { import std.file; if (!exists(skeletonFile) && findStandardFile!false("skeleton-default.html").length) copyStandardFileTo!false(skeletonFile, "skeleton-default.html"); if (!exists(outputDirectory)) mkdir(outputDirectory); if(copyStandardFiles) { copyStandardFileTo(outputDirectory ~ "style.css", "style.css"); copyStandardFileTo(outputDirectory ~ "script.js", "script.js"); copyStandardFileTo(outputDirectory ~ "search-docs.js", "search-docs.js"); } /* if(!exists(skeletonFile) && exists("skeleton-default.html")) copy("skeleton-default.html", skeletonFile); if(!exists(outputDirectory)) mkdir(outputDirectory); if(!exists(outputDirectory ~ "style.css") || (timeLastModified(outputDirectory ~ "style.css") < timeLastModified("style.css"))) copy("style.css", outputDirectory ~ "style.css"); if(!exists(outputDirectory ~ "script.js") || (timeLastModified(outputDirectory ~ "script.js") < timeLastModified("script.js"))) copy("script.js", outputDirectory ~ "script.js"); */ } // FIXME: maybe a zeroth path just grepping for a module declaration in located files // and making a mapping of module names, package listing, and files. // cuz reading all of Phobos takes several seconds. Then they can parse it fully lazily. static void generateAnnotatedSource(ModuleDecl mod, bool gzip) { import std.file; auto annotatedSourceDocument = new Document(); annotatedSourceDocument.parseUtf8(readText(skeletonFile), true, true); string fixupLink(string s) { if(!s.startsWith("http") && !s.startsWith("/")) return "../" ~ s; return s; } foreach(ele; annotatedSourceDocument.querySelectorAll("a, link, script[src], form")) if(ele.tagName == "link") ele.attrs.href = "../" ~ ele.attrs.href; else if(ele.tagName == "form") ele.attrs.action = "../" ~ ele.attrs.action; else if(ele.tagName == "a") ele.attrs.href = fixupLink(ele.attrs.href); else ele.attrs.src = "../" ~ ele.attrs.src; auto code = Element.make("pre", Html(linkUpHtml(highlight(cast(string) mod.originalSource), mod, "../", true))).addClass("d_code highlighted"); addLineNumbering(code.requireSelector("pre"), true); auto content = annotatedSourceDocument.requireElementById("page-content"); content.addChild(code); auto nav = annotatedSourceDocument.requireElementById("page-nav"); void addDeclNav(Element nav, Decl decl) { auto li = nav.addChild("li"); if(decl.docsShouldBeOutputted) li.addChild("a", "[Docs] ", fixupLink(decl.link)).addClass("docs"); li.addChild("a", decl.name, "#L" ~ to!string(decl.lineNumber == 0 ? 1 : decl.lineNumber)); if(decl.children.length) nav = li.addChild("ul"); foreach(child; decl.children) addDeclNav(nav, child); } auto sn = nav.addChild("div").setAttribute("id", "source-navigation"); addDeclNav(sn.addChild("div").addClass("list-holder").addChild("ul"), mod); annotatedSourceDocument.title = mod.name ~ " source code"; if(!usePseudoFiles && !exists(outputDirectory ~ "source")) mkdir(outputDirectory ~ "source"); if(usePseudoFiles) pseudoFiles["source/" ~ mod.name ~ ".d.html"] = annotatedSourceDocument.toString(); else writeFile(outputDirectory ~ "source/" ~ mod.name ~ ".d.html", annotatedSourceDocument.toString(), gzip); } void process(string arg, bool generate) { try { if(locateSymbol is null) writeln("First pass processing ", arg); import std.file; ubyte[] b; if(arg == "-") { foreach(chunk; stdin.byChunk(4096)) b ~= chunk; } else b = cast(ubyte[]) read(arg); config.fileName = arg; auto tokens = getTokensForParser(b, config, &stringCache); import std.path : baseName; auto m = parseModule(tokens, baseName(arg)); auto sweet = new Looker(b, baseName(arg)); sweet.visit(m); ModuleDecl existingDecl; auto mod = cast(ModuleDecl) sweet.root; { mod.originalSource = b; if(mod.astNode.moduleDeclaration is null) throw new Exception("you must have a module declaration for this to work on it"); if(b.startsWith(cast(ubyte[])"// just docs:")) sweet.root.justDocsTitle = (cast(string) b["// just docs:".length .. $].findSplitBefore(['\n'])[0].idup).strip; if(sweet.root.name !in modulesByName) { moduleDecls ~= mod; existingDecl = mod; assert(mod !is null); modulesByName[sweet.root.name] = mod; } else { existingDecl = modulesByName[sweet.root.name]; } } if(generate) { if(sweet.root.name !in moduleDeclsGenerateByName) { moduleDeclsGenerateByName[sweet.root.name] = existingDecl; moduleDeclsGenerate ~= existingDecl; if(annotateSource) { generateAnnotatedSource(mod, gzip); } } } //packages[sweet.root.packageName] ~= sweet.root; } catch (Throwable t) { writeln(t.toString()); } } args = args[1 .. $]; // remove program name foreach(arg; linkReferences) { import std.file; loadGlobalLinkReferences(readText(arg)); } string[] generateFiles; foreach (arg; args) generateFiles ~= scanFiles(arg); /* foreach(argIdx, arg; args) { if(arg != "-" && std.file.isDir(arg)) foreach(string name; std.file.dirEntries(arg, "*.d", std.file.SpanMode.breadth)) generateFiles ~= name; else generateFiles ~= arg; } */ args = generateFiles; //{ import std.stdio; foreach (fn; args) writeln(fn); } assert(0); // Process them all first so name-lookups have more chance of working foreach(argIdx, arg; preloadArgs) { if(std.file.isDir(arg)) { foreach(string name; std.file.dirEntries(arg, "*.d", std.file.SpanMode.breadth)) { bool g = false; if(locateSymbol is null) foreach(idx, a; args) { if(a == name) { g = true; args[idx] = args[$-1]; args = args[0 .. $-1]; break; } } process(name, g); } } else { bool g = false; if(locateSymbol is null) foreach(idx, a; args) { if(a == arg) { g = true; args[idx] = args[$-1]; args = args[0 .. $-1]; break; } } process(arg, g); } } foreach(argIdx, arg; args) { process(arg, locateSymbol is null ? true : false); } if(locateSymbol !is null) { auto decl = moduleDecls[0].lookupName(locateSymbol); if(decl is null) writeln("not found ", locateSymbol); else writeln(decl.lineNumber); return; } // create dummy packages for those not found in the source // this makes linking far more sane, without requiring package.d // everywhere (though I still strongly recommending you write them!) // I'm using for instead of foreach so I can append in the loop // and keep it going for(size_t i = 0; i < moduleDecls.length; i++ ) { auto decl = moduleDecls[i]; auto pkg = decl.packageName; if(decl.name == "index") continue; // avoid infinite recursion if(pkg is null) pkg = "index";//continue; // to create an index.html listing all top level things if(pkg !in modulesByName) { writeln("Making FAKE package for ", pkg); config.fileName = "dummy"; auto b = cast(ubyte[]) (`/++ +/ module `~pkg~`; `); auto tokens = getTokensForParser(b, config, &stringCache); auto m = parseModule(tokens, "dummy"); auto sweet = new Looker(b, "dummy"); sweet.visit(m); auto mod = cast(ModuleDecl) sweet.root; mod.fakeDecl = true; moduleDecls ~= mod; modulesByName[pkg] = mod; // only generate a fake one if the real one isn't already there // like perhaps the real one was generated before but just not loaded // this time. if(!std.file.exists(outputDirectory ~ mod.link)) moduleDeclsGenerate ~= mod; } } // add modules to their packages, if possible foreach(decl; moduleDecls) { auto pkg = decl.packageName; if(decl.name == "index") continue; // avoid infinite recursion if(pkg.length == 0) { //continue; pkg = "index"; } if(auto a = pkg in modulesByName) { (*a).addChild(decl); } else assert(0, pkg ~ " " ~ decl.toString); // it should have make a fake package above } version(with_http_server) { import arsd.cgi; void serveFiles(Cgi cgi) { import std.file; string file = cgi.requestUri; auto slash = file.lastIndexOf("/"); bool wasSource = file.indexOf("source/") != -1; if(slash != -1) file = file[slash + 1 .. $]; if(wasSource) file = "source/" ~ file; if(file == "style.css") { cgi.setResponseContentType("text/css"); cgi.write(readText(findStandardFile("style.css")), true); return; } else if(file == "script.js") { cgi.setResponseContentType("text/javascript"); cgi.write(readText(findStandardFile("script.js")), true); return; } else if(file == "search-docs.js") { cgi.setResponseContentType("text/javascript"); cgi.write(readText(findStandardFile("search-docs.js")), true); return; } else { if(file.length == 0) { if("index" !in pseudoFiles) writeHtml(modulesByName["index"], true, false, headerTitle, headerLinksParsed); cgi.write(pseudoFiles["index"], true); return; } else { auto of = file; if(file !in pseudoFiles) { ModuleDecl* declPtr; file = file[0 .. $-5]; // cut off ".html" if(wasSource) { file = file["source/".length .. $]; file = file[0 .. $-2]; // cut off ".d" } while((declPtr = file in modulesByName) is null) { auto idx = file.lastIndexOf("."); if(idx == -1) break; file = file[0 .. idx]; } if(declPtr !is null) { if(wasSource) { generateAnnotatedSource(*declPtr, false); } else { if(!(*declPtr).alreadyGenerated) writeHtml(*declPtr, true, false, headerTitle, headerLinksParsed); (*declPtr).alreadyGenerated = true; } } } file = of; if(file in pseudoFiles) cgi.write(pseudoFiles[file], true); else { cgi.setResponseStatus("404 Not Found"); cgi.write("404 " ~ file, true); } return; } } cgi.setResponseStatus("404 Not Found"); cgi.write("404", true); } mixin CustomCgiMain!(Cgi, serveFiles); processPoolSize = 1; usePseudoFiles = true; writeln("\n\nListening on http port 8999...."); cgiMainImpl(["server", "--port", "8999"]); return; } import std.parallelism; if(jobs > 1) defaultPoolThreads = jobs; if(makeHtml) { bool[string] alreadyTried; void helper(size_t idx, ModuleDecl decl) { //if(decl.parent && moduleDeclsGenerate.canFind(decl.parent)) //continue; // it will be written in the list of children. actually i want to do it all here. // FIXME: make search index in here if we can if(!skipExisting || !std.file.exists(outputDirectory ~ decl.link(true) ~ (gzip ?".gz":""))) { if(decl.name in alreadyTried) return; alreadyTried[decl.name] = true; writeln("Generating HTML for ", decl.name); writeHtml(decl, true, gzip, headerTitle, headerLinksParsed); } writeln(idx + 1, "/", moduleDeclsGenerate.length, " completed"); } if(jobs == 1) foreach(idx, decl; moduleDeclsGenerate) { helper(idx, decl); } else foreach(idx, decl; parallel(moduleDeclsGenerate)) { helper(idx, decl); } } if(makeSearchIndex) { // we need the listing and the search index FileProxy index; int id; static import std.file; // write out the landing page for JS search, // see the comment in the source of that html // for more details writeFile(outputDirectory ~ "search-docs.html", import("search-docs.html"), gzip); // the search index is a HTML page containing some script // and the index XML. See the source of search-docs.js for more info. index = FileProxy(buildPath(outputDirectory, "search-results.html"), gzip); auto skeletonDocument = new Document(); skeletonDocument.parseUtf8(std.file.readText(skeletonFile), true, true); auto skeletonText = skeletonDocument.toString(); auto idx = skeletonText.indexOf("</body>"); if(idx == -1) throw new Exception("skeleton missing body element"); // write out the skeleton... index.writeln(skeletonText[0 .. idx]); // and then the data container for the xml index.writeln(`<script type="text/xml" id="search-index-container">`); index.writeln("<adrdox>"); index.writeln("<listing>"); foreach(decl; moduleDeclsGenerate) { writeln("Listing ", decl.name); writeIndexXml(decl, index, id); } index.writeln("</listing>"); id = 0; // also making the search index foreach(decl; moduleDeclsGenerate) { if(decl.fakeDecl) continue; writeln("Generating search for ", decl.name); generateSearchIndex(decl, id); } writeln("Writing search..."); index.writeln("<index>"); foreach(term, arr; searchTerms) { index.write("<term value=\""~xmlEntitiesEncode(term)~"\">"); foreach(item; arr) { index.write("<result decl=\""~to!string(item.declId)~"\" score=\""~to!string(item.score)~"\" />"); } index.writeln("</term>"); } index.writeln("</index>"); index.writeln("</adrdox>"); // finish the container index.writeln("</script>"); // write the script that runs the search index.writeln("<script src=\"search-docs.js\"></script>"); // and close the skeleton index.writeln("</body></html>"); index.close(); } //import std.stdio; //writeln("press any key to continue"); //readln(); } struct FileProxy { import std.zlib; File f; // it will inherit File's refcounting Compress compress; // and compress is gc'd anyway so copying the ref means same object! bool gzip; this(string filename, bool gzip) { f = File(filename ~ (gzip ? ".gz" : ""), gzip ? "wb" : "wt"); if(gzip) compress = new Compress(HeaderFormat.gzip); this.gzip = gzip; } void writeln(string s) { if(gzip) f.rawWrite(compress.compress(s ~ "\n")); else f.writeln(s); } void write(string s) { if(gzip) f.rawWrite(compress.compress(s)); else f.write(s); } void close() { if(gzip) f.rawWrite(compress.flush()); f.close(); } } struct SearchResult { int declId; int score; } string[] splitIdentifier(string name) { string[] ret; bool isUpper(dchar c) { return c >= 'A' && c <= 'Z'; } bool breakOnNext; dchar lastChar; foreach(dchar ch; name) { if(ch == '_') { breakOnNext = true; continue; } if(breakOnNext || ret.length == 0 || (isUpper(ch) && !isUpper(lastChar))) { if(ret.length == 0 || ret[$-1].length) ret ~= ""; } breakOnNext = false; ret[$-1] ~= ch; lastChar = ch; } return ret; } SearchResult[][string] searchTerms; void generateSearchIndex(Decl decl, ref int id) { if(!decl.docsShouldBeOutputted) return; // this needs to match the id in index.xml! auto tid = ++id; // exact match on FQL is always a great match searchTerms[decl.fullyQualifiedName] ~= SearchResult(tid, 50); if(decl.name != "this") { // exact match on specific name is worth something too searchTerms[decl.name] ~= SearchResult(tid, 25); if(decl.isModule) { // module names like std.stdio should match stdio strongly, // and std is ok too. I will break them by dot and give diminsihing // returns. int score = 25; foreach_reverse(part; decl.name.split(".")) { searchTerms[part] ~= SearchResult(tid, score); score -= 10; if(score <= 0) break; } } // and so is fuzzy match if(decl.name != decl.name.toLower) searchTerms[decl.name.toLower] ~= SearchResult(tid, 15); // and so is partial word match auto splitNames = splitIdentifier(decl.name); if(splitNames.length) { foreach(name; splitNames) { searchTerms[name] ~= SearchResult(tid, 6); if(name != name.toLower) searchTerms[name.toLower] ~= SearchResult(tid, 3); } } } // and we want to match parent names, though worth less. Decl parent = decl.parent; while(parent !is null) { searchTerms[parent.name] ~= SearchResult(tid, 5); if(parent.name != parent.name.toLower) searchTerms[parent.name.toLower] ~= SearchResult(tid, 2); auto splitNames = splitIdentifier(parent.name); if(splitNames.length) { foreach(name; splitNames) { searchTerms[name] ~= SearchResult(tid, 3); if(name != name.toLower) searchTerms[name.toLower] ~= SearchResult(tid, 2); } } parent = parent.parent; } Document document; //if(decl.fullyQualifiedName in generatedDocuments) //document = generatedDocuments[decl.fullyQualifiedName]; //else document = writeHtml(decl, false, false, null, null); assert(document !is null); // FIXME: pulling this from the generated html is a bit inefficient. // tags are worth a lot foreach(tag; document.querySelectorAll(".tag")) searchTerms[tag.attrs.name] ~= SearchResult(tid, to!int(tag.attrs.value.length ? tag.attrs.value : "0")); // and other names that are referenced are worth quite a bit. foreach(tag; document.querySelectorAll(".xref")) searchTerms[tag.innerText] ~= SearchResult(tid, tag.hasClass("parent-class") ? 10 : 5); foreach(tag; document.querySelectorAll("a[data-ident][title]")) searchTerms[tag.dataset.ident] ~= SearchResult(tid, 3); foreach(tag; document.querySelectorAll("a.hid[title]")) searchTerms[tag.innerText] ~= SearchResult(tid, 3); // and full-text search import ps = PorterStemmer; ps.PorterStemmer s; bool[const(char)[]] wordsUsed; foreach(tag; document.querySelectorAll(".documentation-comment")) { foreach(word; getWords(tag.innerText)) { auto w = s.stem(word.toLower); if(w.isIrrelevant()) continue; if(w in wordsUsed) continue; wordsUsed[w] = true; searchTerms[s.stem(word.toLower)] ~= SearchResult(tid, 1); } } foreach(child; decl.children) generateSearchIndex(child, id); } bool isIrrelevant(in char[] s) { foreach(w; irrelevantWordList) if(w == s) return true; return false; } // These are common words in English, which I'm generally // ignoring because they happen so often that they probably // aren't relevant keywords import std.meta; alias irrelevantWordList = AliasSeq!( "the", "of", "and", "a", "to", "in", "is", "you", "that", "it", "he", "was", "for", "on", "are", "as", "with", "his", "they", "I", "at", "be", "this", "have", "from", "or", "one", "had", "by", "word", "but", "not", "what", "all", "were", "we", "when", "your", "can", "said", "there", "use", "an", "each", "which", "she", "do", "how", "their", "if", "will", "up", "other", "about", "out", "many", "then", "them", "these", "so", "some", "her", "would", "make", "like", "him", "into", "time", "has", "look", "two", "more", "write", "go", "see", "number", "no", "way", "could", "people", "my", "than", "first", "water", "been", "call", "who", "its", "now", "find", "long", "down", "day", "did", "get", "come", "made", "may", "part", ); string[] getWords(string text) { string[] words; string currentWord; import std.uni; foreach(dchar ch; text) { if(!isAlpha(ch)) { if(currentWord.length) words ~= currentWord; currentWord = null; } else { currentWord ~= ch; } } return words; } import std.stdio : File; void writeIndexXml(Decl decl, FileProxy index, ref int id) { //import std.stdio;writeln(decl.fullyQualifiedName, " ", decl.isPrivate, " ", decl.isDocumented); if(!decl.docsShouldBeOutputted) return; auto cc = decl.parsedDocComment; // the id needs to match the search index! index.write("<decl id=\"" ~ to!string(++id) ~ "\" type=\""~decl.declarationType~"\">"); index.write("<name>" ~ xmlEntitiesEncode(decl.name) ~ "</name>"); index.write("<desc>" ~ xmlEntitiesEncode(formatDocumentationComment(cc.ddocSummary, decl)) ~ "</desc>"); index.write("<link>" ~ xmlEntitiesEncode(decl.link) ~ "</link>"); foreach(child; decl.children) writeIndexXml(child, index, id); index.write("</decl>"); } string pluralize(string word, int count = 2, string pluralWord = null) { if(word.length == 0) return word; if(count == 1) return word; // it isn't actually plural if(pluralWord !is null) return pluralWord; switch(word[$ - 1]) { case 's': case 'a', 'i', 'o', 'u': return word ~ "es"; case 'f': return word[0 .. $-1] ~ "ves"; case 'y': return word[0 .. $-1] ~ "ies"; default: return word ~ "s"; } } Html toLinkedHtml(T)(const T t, Decl decl) { import dparse.formatter; string s; struct Foo { void put(in char[] a) { s ~= a; } } Foo output; auto f = new MyFormatter!(typeof(output))(output); f.format(t); return Html(linkUpHtml(s, decl)); } string linkUpHtml(string s, Decl decl, string base = "", bool linkToSource = false) { auto document = new Document("<root>" ~ s ~ "</root>", true, true); // additional cross referencing we weren't able to do at lower level foreach(ident; document.querySelectorAll("*:not(a) [data-ident]:not(:has(a)), .hid")) { // since i modify the tree in the loop, i recheck that we still match the selector if(ident.parentNode is null) continue; if(ident.tagName == "a" || (ident.parentNode && ident.parentNode.tagName == "a")) continue; string i = ident.hasAttribute("data-ident") ? ident.dataset.ident : ident.innerText; auto n = ident.nextSibling; while(n && n.nodeValue == ".") { i ~= "."; auto txt = n; n = n.nextSibling; // the span, ideally if(n is null) break; if(n && (n.hasAttribute("data-ident") || n.hasClass("hid"))) { txt.removeFromTree(); i ~= n.hasAttribute("data-ident") ? n.dataset.ident : n.innerText; auto span = n; n = n.nextSibling; span.removeFromTree; } } //ident.dataset.ident = i; ident.innerText = i; auto found = decl.lookupName(i); string hash; if(found is null) { auto lastPieceIdx = i.lastIndexOf("."); if(lastPieceIdx != -1) { found = decl.lookupName(i[0 .. lastPieceIdx]); if(found) hash = "#" ~ i[lastPieceIdx + 1 .. $]; } } if(found) { auto overloads = found.getImmediateDocumentedOverloads(); if(overloads.length) found = overloads[0]; } void linkToDoc() { if(found && found.docsShouldBeOutputted) { ident.attrs.title = found.fullyQualifiedName; ident.tagName = "a"; ident.href = base ~ found.link ~ hash; } } if(linkToSource) { if(found && linkToSource && found.parentModule) { ident.attrs.title = found.fullyQualifiedName; ident.tagName = "a"; ident.href = found.parentModule.name ~ ".d.html#L" ~ to!string(found.lineNumber); } } else { linkToDoc(); } } return document.root.innerHTML; } Html toHtml(T)(const T t) { import dparse.formatter; string s; struct Foo { void put(in char[] a) { s ~= a; } } Foo output; auto f = new Formatter!(typeof(output))(output); f.format(t); return Html("<tt class=\"highlighted\">"~highlight(s)~"</tt>"); } string toText(T)(const T t) { import dparse.formatter; string s; struct Foo { void put(in char[] a) { s ~= a; } } Foo output; auto f = new Formatter!(typeof(output))(output); f.format(t); return s; } string toId(string txt) { string id; bool justSawSpace; foreach(ch; txt) { if(ch < 127) { if(ch >= 'A' && ch <= 'Z') { id ~= ch + 32; } else if(ch == ' ') { if(!justSawSpace) id ~= '-'; } else { id ~= ch; } } else { id ~= ch; } justSawSpace = ch == ' '; } return id.strip; } /* This file contains code from https://github.com/economicmodeling/harbored/ Those portions are Copyright 2014 Economic Modeling Specialists, Intl., written by Brian Schott, made available under the following license: 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. */
D
/Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/build/OTVDraft.build/Debug-iphonesimulator/OTVDraft.build/Objects-normal/x86_64/ImageModifiers.o : /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/SceneDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/AppDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/OTVModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/URLImageModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/StreamerModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Viewmodel/OTVViewModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeTabBar.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ViewRouter.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ImageModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/TextModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/OTVView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/URLImageView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/HomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeHomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/MerchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeAllView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/CustomTabBarView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeStreamerView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitterView.swift /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/CoreData.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/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/os.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/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.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.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.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.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/build/OTVDraft.build/Debug-iphonesimulator/OTVDraft.build/Objects-normal/x86_64/ImageModifiers~partial.swiftmodule : /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/SceneDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/AppDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/OTVModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/URLImageModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/StreamerModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Viewmodel/OTVViewModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeTabBar.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ViewRouter.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ImageModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/TextModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/OTVView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/URLImageView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/HomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeHomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/MerchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeAllView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/CustomTabBarView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeStreamerView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitterView.swift /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/CoreData.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/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/os.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/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.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.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.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.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/build/OTVDraft.build/Debug-iphonesimulator/OTVDraft.build/Objects-normal/x86_64/ImageModifiers~partial.swiftdoc : /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/SceneDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/AppDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/OTVModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/URLImageModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/StreamerModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Viewmodel/OTVViewModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeTabBar.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ViewRouter.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ImageModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/TextModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/OTVView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/URLImageView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/HomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeHomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/MerchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeAllView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/CustomTabBarView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeStreamerView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitterView.swift /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/CoreData.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/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/os.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/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.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.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.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.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/build/OTVDraft.build/Debug-iphonesimulator/OTVDraft.build/Objects-normal/x86_64/ImageModifiers~partial.swiftsourceinfo : /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/SceneDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/AppDelegate.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/OTVModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/URLImageModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Model/StreamerModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/Viewmodel/OTVViewModel.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeTabBar.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ViewRouter.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/ImageModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/TextModifiers.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/OTVView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/util/URLImageView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/HomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeHomeView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/MerchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitchView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeAllView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/CustomTabBarView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/Youtube/YoutubeStreamerView.swift /Users/Kewlwasabi/Documents/HOME/Dev/IOS/OTVDraft/OTVDraft/View/TwitterView.swift /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/CoreData.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/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/os.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/SwiftUI.swiftmodule/x86_64-apple-ios-simulator.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.5.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.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.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
// PERMUTE_ARGS: // REQUIRED_ARGS: -d -preview=dip1000 extern(C) int printf(const char*, ...); class Eh : Exception { this() { super("Eh thrown"); } } /********************************************/ class Foo { static int x; this() { assert(x == 0); x++; printf("Foo.this()\n"); throw new Eh(); assert(0); } ~this() { printf("Foo.~this()\n"); } } void test1() { try { scope Foo f = new Foo(); assert(0); } catch (Eh) { assert(Foo.x == 1); Foo.x++; } finally { assert(Foo.x == 2); Foo.x++; } assert(Foo.x == 3); } /********************************************/ void test2() { int x; { scope (exit) { printf("test1\n"); assert(x == 3); x = 4; } scope (exit) { printf("test2\n"); assert(x == 2); x = 3; } scope (exit) { printf("test3\n"); assert(x == 1); x = 2; } printf("test4\n"); assert(x == 0); x = 1; } assert(x == 4); } /********************************************/ void test3() { int x; { scope (success) { printf("test1\n"); assert(x == 3); x = 4; } scope (success) { printf("test2\n"); assert(x == 2); x = 3; } scope (success) { printf("test3\n"); assert(x == 1); x = 2; } printf("test4\n"); assert(x == 0); x = 1; } assert(x == 4); } /********************************************/ void test4() { int x; try { scope (exit) { printf("test1\n"); assert(x == 3); x = 4; } scope (exit) { printf("test2\n"); assert(x == 2); x = 3; } x = 2; throw new Eh; scope (exit) { printf("test3\n"); assert(x == 1); x = 2; } printf("test4\n"); assert(x == 0); x = 1; } catch (Eh e) { } assert(x == 4); } /********************************************/ void test5() { int x; try { scope (success) { printf("test1\n"); assert(x == 3); x = 4; } scope (success) { printf("test2\n"); assert(x == 2); x = 3; } x = 2; throw new Eh; scope (success) { printf("test3\n"); assert(x == 1); x = 2; } printf("test4\n"); assert(x == 0); x = 1; } catch (Eh e) { } assert(x == 2); } /********************************************/ void test6() { int x; scope (failure) { assert(0); } try { scope (failure) { printf("test1\n"); assert(x == 3); x = 4; } scope (failure) { printf("test2\n"); assert(x == 2); x = 3; } x = 2; throw new Eh; scope (failure) { printf("test3\n"); assert(x == 1); x = 2; } printf("test4\n"); assert(x == 0); x = 1; } catch (Eh e) { } assert(x == 4); } /********************************************/ void test7() { int i; int x; void foo() { scope (success) { assert(x == 1); x = 2; } i = 2; if (i == 2) return; } i = 1; x = 1; foo(); assert(x == 2); } /********************************************/ void test8() { int i; { version (all) { scope (exit) i += 2; } assert(i == 0); i += 1; printf("betty\n"); } assert(i == 3); } /********************************************/ char[] r9; int scp( int n ) { if( n==0 ) return 0; scope(exit) { printf("%d",n); r9 ~= cast(char)(n + '0'); } return scp(n-1); } void test9() { scp(5); assert(r9 == "12345"); } /********************************************/ alias real T; T readMessageBegin() { return 3.0; } T bar10() { return 8.0; } T foo10() { // Send RPC request, etc. readMessageBegin(); scope (exit) readMessageEnd(); T result = bar10(); // Read message off the wire. return result; } void test10() { if (foo10() != 8.0) assert(0); } T readMessageEnd() { static T d; d = 4.0; d = (((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d)))))/((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d)))))+((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d)))))/((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))))*(((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d)))))/((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d)))))+((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d)))))/((((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d))))+(((d-(2*d))+(d-(2*d)))*((d-(2*d))+(d-(2*d)))))); return 4.0; } /********************************************/ void test7435() { scope(failure) debug printf("error\n"); printf("do something\n"); } /********************************************/ char[] dup12()(char[] a) // although inferred pure, don't infer a is 'return' { char[] res; foreach (ref e; a) {} return res; } char[] foo12() { char[10] buf; return dup12(buf); } /********************************************/ void test7049() @safe { int count = 0; @safe void foo() { scope (failure) { count++; } scope (failure) { count++; } throw new Exception("failed"); } try { foo(); } catch(Exception e) { } assert(count == 2); } /********************************************/ // https://issues.dlang.org/show_bug.cgi?id=16747 void test16747() @safe { scope o = new Object(); } /********************************************/ void bar11(int*, int*) { } void test11() { static int* p; static int i; bar11(p, &i); } /********************************************/ // https://issues.dlang.org/show_bug.cgi?id=17432 int test17432(scope int delegate() dg) { return dg(); } // stripped down version of std.traits.Parameters template Parameters(alias func) { static if (is(typeof(func) P == function)) alias Parameters = P; else static assert(0, "unsupported"); } alias op = Parameters!(test17432)[0]; enum typeString = op.stringof; static assert(typeString == "int delegate()"); // no scope added? mixin(typeString ~ " dg;"); alias ty = typeof(dg); static assert(op.stringof == ty.stringof); static assert(op.mangleof == ty.mangleof); void test17432_2()(scope void delegate () dg) { dg(); } static assert(typeof(&test17432_2!()).stringof == "void function(scope void delegate() dg) @system"); /********************************************/ byte typify13(T)(byte val) { return val; } alias INT8_C13 = typify13!byte; /********************************************/ template test14(T) { alias test14 = int; } test14!(char[] function(return char[])) x14; /********************************************/ // https://issues.dlang.org/show_bug.cgi?id=17935 struct ByChunk(IO) { @safe: ~this() scope {} ubyte[] buf; IO io; } struct IO { ~this() @safe @nogc scope {} } @safe @nogc void test17395() { ubyte[256] buf; auto chunks = ByChunk!IO(buf[], IO()); chunks.__xdtor(); // auto-generated inclusive (fields and struct) dtor } /********************************************/ // https://issues.dlang.org/show_bug.cgi?id=20569 void test20569() @safe { static struct S { int value; int* pointer; } /* explicit `scope`: */ scope S s1; scope int* p1 = &s1.value; /* inferred `scope`: */ int x; S s2 = S(0, &x); int* p2 = &s2.value; } /********************************************/ void main() { test1(); test2(); test3(); test4(); test5(); test6(); test7(); test8(); test9(); test10(); test7435(); test7049(); test16747(); test11(); test17395(); test20569(); printf("Success\n"); }
D
/******************************************************************************* * Copyright (c) 2000, 2006 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.text.edits.MultiTextEdit; import org.eclipse.text.edits.MalformedTreeException; import org.eclipse.text.edits.TextEditGroup; import org.eclipse.text.edits.RangeMarker; import org.eclipse.text.edits.TextEditCopier; import org.eclipse.text.edits.UndoEdit; import org.eclipse.text.edits.InsertEdit; import org.eclipse.text.edits.MoveSourceEdit; import org.eclipse.text.edits.MoveTargetEdit; import org.eclipse.text.edits.CopyTargetEdit; import org.eclipse.text.edits.TextEditProcessor; import org.eclipse.text.edits.TextEditVisitor; import org.eclipse.text.edits.TextEdit; import org.eclipse.text.edits.TreeIterationInfo; import org.eclipse.text.edits.TextEditMessages; import org.eclipse.text.edits.CopySourceEdit; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.text.edits.EditDocument; import org.eclipse.text.edits.UndoCollector; import org.eclipse.text.edits.ISourceModifier; import org.eclipse.text.edits.CopyingRangeMarker; import org.eclipse.text.edits.DeleteEdit; import java.lang.all; import java.util.List; import java.util.Set; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; /** * A multi-text edit can be used to aggregate several edits into * one edit. The edit itself doesn't modify a document. * <p> * Clients are allowed to implement subclasses of a multi-text * edit.Subclasses must implement <code>doCopy()</code> to ensure * the a copy of the right type is created. Not implementing * <code>doCopy()</code> in subclasses will result in an assertion * failure during copying. * * @since 3.0 */ public class MultiTextEdit : TextEdit { private bool fDefined; /** * Creates a new <code>MultiTextEdit</code>. The range * of the edit is determined by the range of its children. * * Adding this edit to a parent edit sets its range to the * range covered by its children. If the edit doesn't have * any children its offset is set to the parent's offset * and its length is set to 0. */ public this() { super(0, Integer.MAX_VALUE); fDefined= false; } /** * Creates a new </code>MultiTextEdit</code> for the given * range. Adding a child to this edit which isn't covered * by the given range will result in an exception. * * @param offset the edit's offset * @param length the edit's length. * @see TextEdit#addChild(TextEdit) * @see TextEdit#addChildren(TextEdit[]) */ public this(int offset, int length) { super(offset, length); fDefined= true; } /* * Copy constructor. */ protected this(MultiTextEdit other) { super(other); } /** * Checks the edit's integrity. * <p> * Note that this method <b>should only be called</b> by the edit * framework and not by normal clients.</p> *<p> * This default implementation does nothing. Subclasses may override * if needed.</p> * * @exception MalformedTreeException if the edit isn't in a valid state * and can therefore not be executed */ protected void checkIntegrity() { // does nothing } /** * {@inheritDoc} */ final bool isDefined() { if (fDefined) return true; return hasChildren(); } /** * {@inheritDoc} */ public final int getOffset() { if (fDefined) return super.getOffset(); List/*<TextEdit>*/ children= internalGetChildren(); if (children is null || children.size() is 0) return 0; // the children are already sorted return (cast(TextEdit)children.get(0)).getOffset(); } /** * {@inheritDoc} */ public final int getLength() { if (fDefined) return super.getLength(); List/*<TextEdit>*/ children= internalGetChildren(); if (children is null || children.size() is 0) return 0; // the children are already sorted TextEdit first= cast(TextEdit)children.get(0); TextEdit last= cast(TextEdit)children.get(children.size() - 1); return last.getOffset() - first.getOffset() + last.getLength(); } /** * {@inheritDoc} */ public final bool covers(TextEdit other) { if (fDefined) return super.covers(other); // an undefined multiple text edit covers everything return true; } /* * @see org.eclipse.text.edits.TextEdit#canZeroLengthCover() */ protected bool canZeroLengthCover() { return true; } /* * @see TextEdit#copy */ protected TextEdit doCopy() { Assert.isTrue(MultiTextEdit.classinfo is this.classinfo, "Subclasses must reimplement copy0"); //$NON-NLS-1$ return new MultiTextEdit(this); } /* * @see TextEdit#accept0 */ protected void accept0(TextEditVisitor visitor) { bool visitChildren= visitor.visit(this); if (visitChildren) { acceptChildren(visitor); } } /* * @see org.eclipse.text.edits.TextEdit#adjustOffset(int) * @since 3.1 */ void adjustOffset(int delta) { if (fDefined) super.adjustOffset(delta); } /* * @see org.eclipse.text.edits.TextEdit#adjustLength(int) * @since 3.1 */ void adjustLength(int delta) { if (fDefined) super.adjustLength(delta); } /* * @see TextEdit#performConsistencyCheck */ void performConsistencyCheck(TextEditProcessor processor, IDocument document) { checkIntegrity(); } /* * @see TextEdit#performDocumentUpdating */ int performDocumentUpdating(IDocument document) { fDelta= 0; return fDelta; } /* * @see TextEdit#deleteChildren */ bool deleteChildren() { return false; } void aboutToBeAdded(TextEdit parent) { defineRegion(parent.getOffset()); } void defineRegion(int parentOffset) { if (fDefined) return; if (hasChildren()) { IRegion region= getCoverage(getChildren()); internalSetOffset(region.getOffset()); internalSetLength(region.getLength()); } else { internalSetOffset(parentOffset); internalSetLength(0); } fDefined= true; } /* * @see org.eclipse.text.edits.TextEdit#internalToString(java.lang.StringBuffer, int) * @since 3.3 */ void internalToString(StringBuffer buffer, int indent) { super.internalToString(buffer, indent); if (! fDefined) buffer.append(" [undefined]"); //$NON-NLS-1$ } }
D
const string MOBNAME_CRATE = "Crate"; const string MOBNAME_CHEST = "Chest"; const string MOBNAME_BED = "Bed"; const string MOBNAME_DOOR = "Door"; const string MOBNAME_CAMPFIRE = ""; const string MOBNAME_TORCH = ""; const string MOBNAME_TORCHHOLDER = ""; const string MOBNAME_BARBQ_SCAV = ""; const string MOBNAME_BARBQ_SHEEP = ""; const string MOBNAME_BENCH = ""; const string MOBNAME_ANVIL = "Anvil"; const string MOBNAME_BUCKET = "Water Bucket"; const string MOBNAME_FORGE = "Forge Fire"; const string MOBNAME_GRINDSTONE = "Whetstone"; const string MOBNAME_WHEEL = "Winch"; const string MOBNAME_LAB = "Alchemist's Bench"; const string MOBNAME_BOOKSTAND = "Bookstand"; const string MOBNAME_BOOKSBOARD = "Bookstand"; const string MOBNAME_CHAIR = ""; const string MOBNAME_CAULDRON = "Cauldron"; const string MOBNAME_SEAT = ""; const string MOBNAME_THRONE = ""; const string MOBNAME_PAN = "Pan"; const string MOBNAME_REPAIR = ""; const string MOBNAME_WATERPIPE = "Water Pipe"; const string MOBNAME_SWITCH = "Switch"; const string MOBNAME_ORE = "Lump of Ore"; const string MOBNAME_WINEMAKER = ""; const string MOBNAME_ORCDRUM = ""; const string MOBNAME_STOVE = "Stove"; const string MOBNAME_INNOS = "Statue of Innos"; const string MOBNAME_RUNEMAKER = "Rune Table"; const string MOBNAME_SAW = "Tree Saw"; const string MOBNAME_ARMCHAIR = "Armchair"; const string MOBNAME_LIBRARYLEVER = "Lamp"; const string MOBNAME_SECRETSWITCH = ""; const string MOBNAME_BIBLIOTHEK = "Library"; const string MOBNAME_VORRATSKAMMER = "Larder"; const string MOBNAME_SCHATZKAMMER = "Treasury"; const string MOBNAME_IGARAZ = "Igaraz' Chest"; const string MOBNAME_ALMANACH = "Almanac"; const string MOBNAME_CITY = "To Khorinis"; const string MOBNAME_TAVERN = "To Tavern"; const string MOBNAME_GR_PEASANT = "To Landowner"; const string MOBNAME_MONASTERY = "To Monastery"; const string MOBNAME_PASSOW = "To Pass"; const string MOBNAME_CITY2 = "To Tavern"; const string MOBNAME_LIGHTHOUSE = "To Lighthouse"; const string MOBNAME_MONASTERY2 = "To Tavern"; const string MOBNAME_PRISON = "To Prison Colony"; const string MOBNAME_GR_PEASANT2 = "To Tavern"; const string MOBNAME_INCITY01 = "To Harbor"; const string MOBNAME_INCITY02 = "To Marketplace"; const string MOBNAME_INCITY03 = "To Upper Quarter"; const string MOBNAME_INCITY04 = "To Merchants' Street"; const string MOBNAME_INCITY05 = "To Temple Square"; const string MOBNAME_BOW_01 = "Bowmaker 'Deadly Arrow'"; const string MOBNAME_MIX_01 = "Matteo's Store"; const string MOBNAME_MIX_02 = "Halvor's Fish Store 'Slimy Skate'"; const string MOBNAME_SMITH_01 = "The Glowing Anvil"; const string MOBNAME_BAR_01 = "Tavern 'Pegleg'"; const string MOBNAME_BAR_02 = "Tavern 'Happy Fatted Calf'"; const string MOBNAME_Hotel_01 = "Inn 'The Sleepy Moneybag'"; const string MOBNAME_Hotel_02 = "The Red Lantern"; const string MOBNAME_TAVERN_01 = "The Dead Harpy"; const string MOBNAME_SALANDRIL = "Salandril's Potions"; const string MOBNAME_GRAVETEAM_01 = "Snoelk - 'Oh look, a switch'"; const string MOBNAME_GRAVETEAM_02 = "Oelk - 'NOOOOOOOOO'"; const string MOBNAME_GRAVETEAM_03 = "Hodges - 'Everything will be fine'"; const string MOBNAME_GRAVETEAM_04 = "Hosh - 'What a shit'"; const string MOBNAME_GRAVETEAM_05 = "Chase - 'Whaddaya make of that?'"; const string MOBNAME_GRAVETEAM_06 = "Björn - 'We're going for it!'"; const string MOBNAME_GRAVETEAM_07 = "Michael - 'Just resting my eyes...'"; const string MOBNAME_GRAVETEAM_08 = "Kairo - 'Just a sec!'"; const string MOBNAME_GRAVETEAM_09 = "Uncle Cruncle - 'Finally he found the scorpion man'"; const string MOBNAME_GRAVETEAM_10 = "NicoDE - 'Hello, world!'"; const string MOBNAME_GRAVETEAM_11 = "Sascha - 'The player doesn't know why he's going there...'"; const string MOBNAME_GRAVETEAM_12 = "Andre - 'Do those sails fall fast or slow?'"; const string MOBNAME_GRAVETEAM_13 = "Mihai - 'Yeah, I can show you something...'"; const string MOBNAME_GRAVETEAM_14 = "Uwe - 'What level you in with that paladin'"; const string MOBNAME_GRAVE_01 = "Baron Heinrich von Stahl 551 - 589 'Came, saw and conked out'"; const string MOBNAME_GRAVE_02 = "Bertran 465 - 480 'I always fancied eating toadstools'"; const string MOBNAME_GRAVE_03 = "Isolde 525 - 550"; const string MOBNAME_GRAVE_04 = "Unknown"; const string MOBNAME_GRAVE_05 = "Dex Cantionis 325 - 431 'I've had stomach cramps for days'"; const string MOBNAME_GRAVE_06 = "Uthar Lichtbringer 205 - 532"; const string MOBNAME_GRAVE_07 = "Yasmin 510 - 546"; const string MOBNAME_GRAVE_08 = "Onurb 634 - 579 - 'Etlepmerkegmu red'"; const string MOBNAME_GRAVE_09 = "Unknown Soldier"; const string MOBNAME_GRAVE_10 = "Mighty Alien Dwarf 2894-3787 - 'It's all fake! Believe me...'"; const string MOBNAME_GRAVE_11 = "Theodor 220 - 310 - 'May his spirit be free'"; const string MOBNAME_GRAVE_12 = "Veranim Sadea 390 - 'The underworld was his alone'"; const string MOBNAME_GRAVE_13 = "Serano Ukara 234 - 298 'The guardian of the tower'"; const string MOBNAME_GRAVE_14 = "Victimo Sorn 456 - 512 'Only Phoenix stopped him'"; const string MOBNAME_GRAVE_15 = " +432 'They called him Heristun, he came from the sea'"; const string MOBNAME_GRAVE_16 = "Ernesto Ortoj 350 - 410 'I will always be with you'"; const string MOBNAME_GRAVE_17 = "Arthag Amashrog 730 - 756"; const string MOBNAME_GRAVE_18 = "Iotar 721 - 762"; const string MOBNAME_GRAVE_19 = "Midos 757 - 759"; const string MOBNAME_GRAVE_20 = "Oskar Sorn 703 - 736"; const string MOBNAME_GRAVE_21 = "Marta Ukara 732 - 771"; const string MOBNAME_GRAVE_22 = "Wilfied Ukara 722 - 764"; const string MOBNAME_GRAVE_23 = "Viktorus Stahl 741 - 755"; const string MOBNAME_GRAVE_24 = "Seb 725 - 773"; const string MOBNAME_GRAVE_25 = "Unknown"; const string MOBNAME_GRAVE_26 = "Mart Mulgo 721 - 779"; const string MOBNAME_GRAVE_27 = "Zahra 713 - 752"; const string MOBNAME_GRAVE_28 = "Baron Simbus of Kahr 120 - 212"; const string MOBNAME_GRAVE_29 = "Count Anieb of Waldfried 117 - 212"; const string MOBNAME_GRAVE_30 = "Count Lazar of Siegburg 156 - 212"; const string MOBNAME_GRAVE_31 = "Swordfighter Asub Ukara 145 - 212"; const string MOBNAME_GRAVE_32 = "Swordfighter Dietmar Ukara 112 - 212"; const string MOBNAME_GRAVE_33 = "Honor Guard Uthar Seranis 178 - 212"; const string MOBNAME_ADDON_SOCKEL = "Pedestal"; const string MOBNAME_ADDON_FORTUNO = "Fortuno's chest"; const string MOBNAME_ADDON_IDOL = "Statue of Beliar"; const string MOBNAME_ADDON_GOLD = "Gold nugget"; const string MOBNAME_ADDON_STONEBOOK = "Lectern"; const string MOBNAME_ADDON_ORNAMENT = "Ring-shaped device"; const string MOBNAME_ADDON_ORNAMENTSWITCH = "Switch"; const string MOBNAME_ADDON_WACKELBAUM = "Wobbly tree"; const string NAME_ADDON_TengronsRing = "Tengron's ring."; const string NAME_ADDON_CASSIASBELOHNUNGSRING = "Ring of Life Force"; const string MOBNAME_ADDON_TELEPORT_01 = "To Temple Portal"; const string MOBNAME_ADDON_TELEPORT_02 = "To Bandit Camp"; const string MOBNAME_ADDON_TELEPORT_03 = "To Swamp"; const string MOBNAME_ADDON_TELEPORT_04 = "To Valley"; const string MOBNAME_ADDON_TELEPORT_05 = "To Canyon"; const string TXT_GUILDS[66] = { "Guildless", "Paladin", "Militia", "Citizen", "Magician", "Novice", "Dragon Hunter", "Mercenary", "Farmer", "Bandit", "Convict", "Seeker", "Land Dweller", "Pirate", "Water Mage", "D", "", "Meatbug", "Sheep", "Goblin", "Goblin Skeleton", "S. Goblin Skeleton", "Scavenger", "Giant Rat", "Field Raider", "Bloodfly", "Lizard", "Wolf", "S. Wolf", "Minecrawler", "Lurker", "Skeleton", "S. Skeleton", "Skeleton Mage", "Zombie", "Snapper", "Shadowbeast", "Skeleton Monster", "Harpy", "Stone Golem", "Fire Golem", "Ice Golem", "S. Golem", "Demon", "S. Demon", "Troll", "Swampshark", "Dragon", "Molerat", "Alligator", "Swamp Golem", "Guard", "Stone Puma", "A", "Guard", "Zombie", "", "", "", "Orc", "Orc", "Undead Orc", "Draconian", "X", "Y", "Z" }; const string TXT_SPELLS[100] = { "Holy Light", "Lesser Healing", "Holy Arrow", "Medium Healing", "Harm Evil", "Greater Healing", "Destroy Evil", "Teleport", "To Harbor City", "To Monastery", "To Landowner", "To Xardas", "To Pass of Khorinis", "To Valley of Mines Pass", "To Castle", "To Old Demon Tower", "To Tavern", "TXT_SPL_TELEPORT_3", "Light", "Fire Arrow", "Ice Arrow", "Heal Light Wounds", "Goblin Skeleton", "Fireball", "Small Lightning", "Summon Wolf", "Wind Fist", "Sleep", "Heal Medium Wounds", "Lightning", "Large Fireball", "Skeleton", "Fear", "Ice Block", "Ball Lightning", "Create Golem", "Destroy Undead", "Large Fire Storm", "Small Fire Storm", "Ice Wave", "Demon", "Total Healing", "Fire Rain", "Breath of Death", "Mass Destruction", "Army of Darkness", "Shrink", "Sheep", "Scavenger", "Giant Rat", "Field Raider", "Wolf", "Lizard", "Snapper", "Warg", "Fire Lizard", "Lurker", "Shadowbeast", "Dragon Snapper", "Oblivion", "Holy Missile", "TXT_SPL_DEATHBOLT", "TXT_SPL_DEATHBALL", "TXT_SPL_CONCUSSIONBOLT", "TXT_SPL_RESERVED_64", "TXT_SPL_RESERVED_65", "TXT_SPL_RESERVED_66", "TXT_SPL_RESERVED_67", "TXT_SPL_RESERVED_68", "TXT_SPL_RESERVED_69", "Storm", "Dust Devil", "Waterfist", "Ice Lance", "Inflate People", "Geyser", "Water Wall", "TXT_SPL_RESERVED_77", "TXT_SPL_RESERVED_78", "TXT_SPL_RESERVED_79", "Insect Plague", "Insect Swarm", "Root Snare", "Earthquake", "Create Guardian", "Beliar's Wrath", "Steal Energy", "Cry of the Dead", "Create Zombie", "Summon Mud", "TXT_SPL_RESERVED_90", "TXT_SPL_RESERVED_91", "TXT_SPL_RESERVED_92", "TXT_SPL_RESERVED_93", "TXT_SPL_RESERVED_94", "TXT_SPL_RESERVED_95", "TXT_SPL_RESERVED_96", "TXT_SPL_RESERVED_97", "TXT_SPL_RESERVED_98", "TXT_SPL_RESERVED_99" }; const string NAME_SPL_PalLight = "Holy Light"; const string NAME_SPL_PalLightHeal = "Small Healing"; const string NAME_SPL_PalHolyBolt = "Holy Arrow"; const string NAME_SPL_PalMediumHeal = "Medium Healing"; const string NAME_SPL_PalRepelEvil = "Banish Evil"; const string NAME_SPL_PalFullHeal = "Large Healing"; const string NAME_SPL_PalDestroyEvil = "Destroy Evil"; const string NAME_SPL_PalTeleportSecret = "Teleport"; const string NAME_SPL_TeleportSeaport = "Teleport to Harbor City"; const string NAME_SPL_TeleportMonastery = "Teleport to Monastery"; const string NAME_SPL_TeleportFarm = "Teleport to Landlord"; const string NAME_SPL_TeleportXardas = "Teleport to Xardas"; const string NAME_SPL_TeleportPassNW = "Teleport to Pass of Khorinis"; const string NAME_SPL_TeleportPassOW = "Teleport to Valley of Mines Pass"; const string NAME_SPL_TeleportOC = "Teleport to Castle"; const string NAME_SPL_TeleportOWDemonTower = "Teleport to Ancient Demon Tower"; const string NAME_SPL_TeleportTaverne = "Teleport to Tavern"; const string NAME_SPL_Teleport_3 = "NAME_SPL_TELEPORT_3"; const string NAME_SPL_LIGHT = "Light"; const string NAME_SPL_Firebolt = "Fire Arrow"; const string NAME_SPL_Icebolt = "Ice Arrow"; const string NAME_SPL_LightHeal = "Heal Light Wounds"; const string NAME_SPL_SummonGoblinSkeleton = "Create Goblin Skeleton"; const string NAME_SPL_InstantFireball = "Fireball"; const string NAME_SPL_Zap = "Small Lightning"; const string NAME_SPL_SummonWolf = "Summon Wolf"; const string NAME_SPL_WINDFIST = "Wind Fist"; const string NAME_SPL_Sleep = "Sleep"; const string NAME_SPL_MediumHeal = "Heal Medium Wounds"; const string NAME_SPL_Firestorm = "Small Fire Storm"; const string NAME_SPL_SummonSkeleton = "Create Skeleton"; const string NAME_SPL_Fear = "Fear"; const string NAME_SPL_IceCube = "Ice Block"; const string NAME_SPL_ChargeZap = "Ball Lightning"; const string NAME_SPL_LightningFlash = "Lightning"; const string NAME_SPL_SummonGolem = "Awaken Golem"; const string NAME_SPL_DestroyUndead = "Destroy Undead"; const string NAME_SPL_ChargeFireball = "Large Fireball"; const string NAME_SPL_Pyrokinesis = "Large Fire Storm"; const string NAME_SPL_IceWave = "Ice Wave"; const string NAME_SPL_SummonDemon = "Summon Demon"; const string NAME_SPL_FullHeal = "Heal Heavy Wounds"; const string NAME_SPL_Firerain = "Fire Rain"; const string NAME_SPL_BreathOfDeath = "Breath of Death"; const string NAME_SPL_MassDeath = "Wave of Death"; const string NAME_SPL_ArmyOfDarkness = "Army of Darkness"; const string NAME_SPL_Shrink = "Shrink Monster"; const string NAME_SPL_TrfSheep = "Transform into Sheep"; const string NAME_SPL_TrfScavenger = "Transform into Scavenger"; const string NAME_SPL_TrfGiantRat = "Transform into Giant Rat"; const string NAME_SPL_TrfGiantBug = "Transform into Field Raider"; const string NAME_SPL_TrfWolf = "Transform into Wolf"; const string NAME_SPL_TrfWaran = "Transform into Lizard"; const string NAME_SPL_TrfSnapper = "Transform into Snapper"; const string NAME_SPL_TrfWarg = "Transform into Warg"; const string NAME_SPL_TrfFireWaran = "Transform into Fire Lizard"; const string NAME_SPL_TrfLurker = "Transform into Lurker"; const string NAME_SPL_TrfShadowbeast = "Transform into Shadowbeast"; const string NAME_SPL_TrfDragonSnapper = "Transform into Dragon Snapper"; const string NAME_SPL_Charm = "Oblivion"; const string NAME_SPL_MasterOfDisaster = "Holy Missile"; const string NAME_SPL_Deathbolt = "NAME_SPL_DEATHBOLT"; const string NAME_SPL_Deathball = "NAME_SPL_DEATHBALL"; const string NAME_SPL_ConcussionBolt = "NAME_SPL_CONCUSSIONBOLT"; const string NAME_SPL_Reserved_64 = "NAME_SPL_RESERVED_64"; const string NAME_SPL_Reserved_65 = "NAME_SPL_RESERVED_65"; const string NAME_SPL_Reserved_66 = "NAME_SPL_RESERVED_66"; const string NAME_SPL_Reserved_67 = "NAME_SPL_RESERVED_67"; const string NAME_SPL_Reserved_68 = "NAME_SPL_RESERVED_68"; const string NAME_SPL_Reserved_69 = "NAME_SPL_RESERVED_69"; const string NAME_SPL_Thunderstorm = "Storm"; const string NAME_SPL_Whirlwind = "Dust Devil"; const string NAME_SPL_WaterFist = "Waterfist"; const string NAME_SPL_IceLance = "Ice Lance"; const string NAME_SPL_Inflate = "Inflate People"; const string NAME_SPL_Geyser = "Geyser"; const string NAME_SPL_Waterwall = "Water Wall"; const string NAME_SPL_Reserved_77 = "NAME_SPL_RESERVED_77"; const string NAME_SPL_Reserved_78 = "NAME_SPL_RESERVED_78"; const string NAME_SPL_Reserved_79 = "NAME_SPL_RESERVED_79"; const string NAME_SPL_Plague = "Insect Plague"; const string NAME_SPL_Swarm = "Insect Swarm"; const string NAME_SPL_GreenTentacle = "Root Snare"; const string NAME_SPL_Earthquake = "Earthquake"; const string NAME_SPL_SummonGuardian = "Create Guardian"; const string NAME_SPL_BeliarsRage = "Beliar's Wrath"; const string NAME_SPL_SuckEnergy = "Steal energy"; const string NAME_SPL_Skull = "Cry of the Dead"; const string NAME_SPL_SummonZombie = "Create Zombie"; const string NAME_SPL_SummonMud = "Summon Mud"; const string NAME_SPL_Reserved_90 = "NAME_SPL_RESERVED_90"; const string NAME_SPL_Reserved_91 = "NAME_SPL_RESERVED_91"; const string NAME_SPL_Reserved_92 = "NAME_SPL_RESERVED_92"; const string NAME_SPL_Reserved_93 = "NAME_SPL_RESERVED_93"; const string NAME_SPL_Reserved_94 = "NAME_SPL_RESERVED_94"; const string NAME_SPL_Reserved_95 = "NAME_SPL_RESERVED_95"; const string NAME_SPL_Reserved_96 = "NAME_SPL_RESERVED_96"; const string NAME_SPL_Reserved_97 = "NAME_SPL_RESERVED_97"; const string NAME_SPL_Reserved_98 = "NAME_SPL_RESERVED_98"; const string NAME_SPL_Reserved_99 = "NAME_SPL_RESERVED_99"; const string TXT_TALENTS[22] = { "", "One-Handed", "Two-Handed", "Bow", "Crossbow", "Pick Locks", "", "Magic", "Sneak", "", "", "Acrobatics", "Pickpocket", "Forge Weapons", "Create Runes", "Alchemy", "Take Trophies", "Read foreign language", "Will-o'-the-wisp abilities", "", "", "" }; const string TXT_TALENTS_SKILLS[22] = { "", "Rookie|Fighter|Master", "Rookie|Fighter|Master", "Rookie|Marksman|Master", "Rookie|Marksman|Master", "-|Learned|-", "0|1|2", "0|1|2|3|4|5|6", "-|Learned", "-|-", "-|-", "-|Learned", "-|Learned", "-|Learned", "-|Learned", "-|Learned", "-|Learned", "-|Learned", "-|Learned", "-|Learned", "-|Learned", "-|Learned" }; const string TXT_INV_CAT[9] = { "", "Weapons", "Armor", "Magic", "Artifacts", "Food", "Potions", "Writings", "Miscellaneous" }; const string NAME_Paladin = "Paladin"; const string NAME_Miliz = "City Guard"; const string NAME_Torwache = "Gate Guard"; const string NAME_Tuerwache = "Door Guard"; const string NAME_Stadtwache = "City Guard"; const string NAME_Arbeiter = "Worker"; const string NAME_Ritter = "Knight"; const string NAME_Wache = "Guard"; const string NAME_Buerger = "Citizen"; const string NAME_Buergerin = "Citizen"; const string NAME_Magd = "Maid"; const string NAME_Magier = "Magician"; const string NAME_Novize = "Novice"; const string NAME_Drachenjaeger = "Dragon Hunter"; const string NAME_ToterDrachenjaeger = "Dead Dragon Hunter"; const string NAME_Soeldner = "Mercenary"; const string NAME_Bauer = "Farmer"; const string NAME_Baeuerin = "Farmer"; const string NAME_Bandit = "Bandit"; const string NAME_Halsabschneider = "Cutthroat"; const string NAME_Straefling = "Convict"; const string NAME_Waffenknecht = "Man-at-Arms"; const string NAME_Dementor = "Seeker"; const string NAME_ToterNovize = "Dead Novice"; const string NAME_Antipaldin = "Orcish Warlord"; const string NAME_Schiffswache = "Ship Guard"; const string NAME_Fluechtling = "Fugitive"; const string NAME_Addon_Pirat = "Pirate"; const string NAME_Addon_Guard = "Guard"; const string NAME_Addon_Esteban_Guard = "Bodyguard"; const string NAME_Addon_Sklave = "Slave"; const string NAME_Addon_Buddler = "Digger"; const string NAME_ADDON_SCAVENGERGL = "Grassland Scavenger"; const string NAME_Addon_Summoned_Guardian = "Summoned Stone Sentinel"; const string NAME_Addon_Summoned_Zombie = "Summoned Zombie"; const string NAME_ADDON_BELIARSWEAPON = "The Claw of Beliar"; const string NAME_Addon_Undead_Mud = "Undead Mud"; const string NAME_Addon_Summoned_Mud = "Summoned Mud"; const string Dialog_Ende = "END"; const string Dialog_Back = "BACK"; const string DIALOG_TRADE = "(Trade)"; const string DIALOG_PICKPOCKET = "(Pickpocket)"; const string NAME_Ring = "Ring"; const string NAME_Amulett = "Amulet"; const string NAME_Trank = "Potion"; const string NAME_Rune = "Rune"; const string NAME_Spruchrolle = "Scroll"; const string NAME_Key = "Key"; const string NAME_Addon_Belt = "Belt"; const string NAME_Addon_BeltMage = "Sash"; const string NAME_Addon_BeArSLD = "Together with mercenary armor +"; const string NAME_Addon_BeArMIL = "Together with militia armor +"; const string NAME_Addon_BeArKDF = "Together with magician's robe +"; const string NAME_Addon_BeArNOV = "Together with novice's robe +"; const string NAME_Addon_BeArMC = "Together with crawler armor +"; const string NAME_Addon_BeArLeather = "Together with leather armor +"; const string PRINT_Addon_BDTArmor = "Whoever wears this armor belongs to the bandits."; const string PRINT_Addon_KUMU_01 = "We are three brothers from the same caste."; const string PRINT_Addon_KUMU_02 = "Together we are stronger."; const string PRINT_Addon_NadjaWait = "Wait. About the weed..."; const string NAME_Currency = "Gold:"; const string PRINT_Trade_Not_Enough_Gold = "You don't have enough gold to buy this item."; const string NAME_Value = "Value:"; const string NAME_Mag_Circle = "Circle:"; const string NAME_Manakosten = "Mana cost:"; const string NAME_MinManakosten = "Mana cost (min):"; const string NAME_ManakostenMax = "Mana cost (max):"; const string NAME_ManaPerSec = "Mana per sec."; const string NAME_Duration = "Duration (mins)"; const string NAME_Sec_Duration = "Duration (secs)"; const string NAME_Mana_needed = "Mana required:"; const string NAME_Str_needed = "Strength required:"; const string NAME_Dex_needed = "Dexterity required:"; const string NAME_Spell_Load = "Boostable spell"; const string NAME_Spell_Invest = "Sustainable spell"; const string NAME_Dam_Edge = "Weapon Damage"; const string NAME_Dam_Point = "Arrow Damage"; const string NAME_Dam_Fire = "Fire Damage"; const string NAME_Dam_Magic = "Magic Damage"; const string NAME_Dam_Fly = "Wind Damage"; const string NAME_Damage = "Damage"; const string NAME_Damage_Max = "Maximum damage"; const string NAME_PerMana = " (per mana)"; const string NAME_DamagePerSec = "Damage per sec."; const string NAME_Prot_Edge = "Weapon Protection:"; const string NAME_Prot_Point = "Arrow Protection:"; const string NAME_Prot_Fire = "Fire Protection:"; const string NAME_Prot_Magic = "Magic Protection:"; const string NAME_Bonus_HP = "Hitpoint bonus:"; const string NAME_Bonus_Mana = "Mana bonus:"; const string NAME_Bonus_HpMax = "Bonus for maximum Hitpoints:"; const string NAME_Bonus_ManaMax = "Bonus for maximum Mana:"; const string NAME_Bonus_Dex = "Dexterity bonus:"; const string NAME_Bonus_Str = "Strength bonus:"; const string NAME_OneHanded = "One-Handed Weapon"; const string NAME_TwoHanded = "Two-Handed Weapon"; const string NAME_HealingPerMana = "Healing per Mana"; const string NAME_HealingPerCast = "Healing:"; const string NAME_Addon_NostalgieBonus = "Nostalgia Bonus:"; const string NAME_Addon_NeedsAllMana = "Uses up entire mana store"; const string NAME_Addon_SpellDontKill = "Spell doesn't kill"; const string NAME_Addon_Damage_Min = "Damage (min)"; const string NAME_ADDON_WISPSKILL_FF = "Long-range Weapons and Ammunition"; const string NAME_ADDON_WISPSKILL_NONE = "Gold, Keys and Utensils"; const string NAME_ADDON_WISPSKILL_RUNE = "Runes and Spell Scrolls"; const string NAME_ADDON_WISPSKILL_MAGIC = "Rings and Amulets"; const string NAME_ADDON_WISPSKILL_FOOD = "Food and Plants"; const string NAME_ADDON_WISPSKILL_POTIONS = "Potions, Magic and Regular"; const string NAME_ADDON_LEARNLANGUAGE_1 = "Learn language of the peasants"; const string NAME_ADDON_LEARNLANGUAGE_2 = "Learn language of the warriors"; const string NAME_ADDON_LEARNLANGUAGE_3 = "Learn language of the priests"; const string NAME_ADDON_MALUS_2H = "Two-handed talent - Malus"; const string NAME_ADDON_MALUS_1H = "One-handed talent - Malus"; const string NAME_ADDON_BONUS_1H = "One-handed talent - Bonus"; const string NAME_ADDON_BONUS_2H = "Two-handed talent - Bonus"; const string NAME_ADDON_ONEHANDED_BELIAR = "Chance of extra damage"; const string NAME_ADDON_TWOHANDED_BELIAR = "Chance of extra damage"; const string NAME_ADDON_UPGRATEBELIARSWEAPON = "Improve 'Claw of Beliar'"; const string NAME_ADDON_BETEN = "Pray"; const string NAME_ADDON_PRAYIDOL_GIVENOTHING = "I will pray and offer nothing."; const string NAME_ADDON_PRAYIDOL_GIVEHITPOINT1 = "I will pray and offer 1 life energy."; const string NAME_ADDON_PRAYIDOL_GIVEHITPOINT2 = "I will pray and offer 2 life energy."; const string NAME_ADDON_PRAYIDOL_GIVEHITPOINT3 = "I will pray and offer 3 life energy."; const string NAME_ADDON_PRAYIDOL_GIVEMANA = "I will pray and offer 1 mana."; const string NAME_ItMw_1H_Common_01 = "Sword"; const string NAME_ItMw_1H_Special_01 = "Ore Longsword"; const string NAME_ItMw_2H_Special_01 = "Ore Two-Hander"; const string NAME_ItMw_1H_Special_02 = "Ore Bastard Sword"; const string NAME_ItMw_2H_Special_02 = "Heavy Ore Two-Hander"; const string NAME_ItMw_1H_Special_03 = "Ore Battle Blade"; const string NAME_ItMw_2H_Special_03 = "Heavy Ore Battle Blade"; const string NAME_ItMw_1H_Special_04 = "Ore Dragon Slayer"; const string NAME_ItMw_2H_Special_04 = "Large Ore Dragon Slayer"; const string NAME_Addon_Harad_01 = "Fine Sword"; const string NAME_Addon_Harad_02 = "Fine Longsword"; const string NAME_Addon_Harad_03 = "Ruby Blade"; const string NAME_Addon_Harad_04 = "El Bastardo"; const string PRINT_Addon_gegeben = "given"; const string PRINT_GoldGegeben = " gold given"; const string PRINT_ItemGegeben = " item given"; const string PRINT_ItemsGegeben = " items given"; const string PRINT_Addon_erhalten = "received"; const string PRINT_GoldErhalten = " gold received"; const string PRINT_ItemErhalten = " item received"; const string PRINT_ItemsErhalten = " items received"; const string PRINT_Addon_RuneGiven = "Beliar grants you another spell"; const string PRINT_Kosten = ". Cost:"; const string PRINT_LP = " LP"; const string PRINT_NotEnoughLP = "Not enough Learning Points!"; const string PRINT_NoLearnOverPersonalMAX = "This teacher's maximum is"; const string PRINT_LearnSTR = "Strength + "; const string PRINT_LearnDEX = "Dexterity + "; const string PRINT_LearnMANA_MAX = "Mana + "; const string PRINT_Learnhitpoints_MAX = "Hitpoints + "; const string PRINT_LearnLP = "Learning Points + "; const string PRINT_LearnCircle_1 = "Learn: 1st Circle of Magic"; const string PRINT_LearnCircle_2 = "Learn: 2nd Circle of Magic"; const string PRINT_LearnCircle_3 = "Learn: 3rd Circle of Magic"; const string PRINT_LearnCircle_4 = "Learn: 4th Circle of Magic"; const string PRINT_LearnCircle_5 = "Learn: 5th Circle of Magic"; const string PRINT_LearnCircle_6 = "Learn: 6th Circle of Magic"; const string PRINT_Learn1H = "Improve: Fight with one-handed weapons"; const string PRINT_Learn1H_and_2H = "Improve: Fight with one and two-handed weapons"; const string PRINT_Learn2H = "Improve: Fight with two-handed weapons"; const string PRINT_Learn2H_and_1H = "Improve: Fight with two and one-handed weapons"; const string PRINT_LearnBow = "Improve: Bow accuracy"; const string PRINT_LearnBow_and_Crossbow = "Improve: Bow and crossbow accuracy"; const string PRINT_LearnCrossbow = "Improve: Crossbow accuracy"; const string PRINT_LearnCrossbow_and_Bow = "Improve: Crossbow and bow accuracy"; const string PRINT_LearnPicklock = "Learn: Pick locks"; const string PRINT_LearnSneak = "Learn: Sneak"; const string PRINT_LearnAcrobat = "Learn: Acrobatics"; const string PRINT_Addon_AcrobatBonus = "Acrobatics bonus!"; const string PRINT_LearnPickpocket = "Learn: Pickpocket"; const string PRINT_Beliarshitpoints_MAX = "Life energy -"; const string PRINT_LearnSmith = "Learn: Forge weapon"; const string PRINT_LearnRunes = "Learn: Create rune"; const string PRINT_LearnAlchemy = "Learn: Brew potion"; const string PRINT_LearnAlchemyInnosEye = "Learn: Charge Eye of Innos"; const string PRINT_LearnTakeAnimalTrophy = "Learn: Take animaltrophy"; const string PRINT_LearnForeignLanguage = "Learn: Language of the builders"; const string PRINT_LearnWispDetector = "Your will-o'-the-wisp has learned"; const string PRINT_LearnPalTeleportSecret = "Learn: Create secret teleport rune"; const string PRINT_NotEnoughLearnPoints = "Not enough Learning points!"; const string PRINT_LearnSTR1 = "Strength + 1"; const string PRINT_LearnSTR5 = "Strength + 5"; const string PRINT_LearnDEX1 = "Dexterity + 1"; const string PRINT_LearnDEX5 = "Dexterity + 5"; const string PRINT_LearnMANA1 = "Mana + 1"; const string PRINT_LearnMANA5 = "Mana + 5"; const string PRINT_Learn1h1 = "One-handed weapons + 1"; const string PRINT_Learn1h5 = "One-handed weapons + 5"; const string PRINT_Learn2h1 = "Two-handed weapons + 1"; const string PRINT_Learn2h5 = "Two-handed weapons + 5"; const string PRINT_LearnBow1 = "Bow + 1"; const string PRINT_LearnBow5 = "Bow + 5"; const string PRINT_LearnCrossBow1 = "Crossbow + 1"; const string PRINT_LearnCrossBow5 = "Crossbow + 5"; const string PRINT_SleepOver = "You've slept well and feel rested!"; const string PRINT_SleepOverObsessed = "Nightmares prevent your resting!"; const string PRINT_SmithSuccess = "Weapon made!"; const string PRINT_RuneSuccess = "Rune created!"; const string PRINT_AlchemySuccess = "Potion brewed!"; const string PRINT_AlchemySuccessInnoseye = "Energy pulses through the Eye of Innos!"; const string PRINT_ProdItemsMissing = "Not enough resources!"; const string PRINT_TabakSuccess = "New tobacco made!"; const string PRINT_JointSuccess = "Swampweed reefer made!"; const string PRINT_Addon_Joint_01_Success = "Green novice rolled!"; const string PRINT_NoInnosTears = "You lack the 'Tears of Innos'."; const string PRINT_Addon_GuildNeeded = "You lack a guild."; const string PRINT_Addon_GuildNeeded_NOV = "You are still not a magician."; const string PRINT_KeyMissing = "I need the right key."; const string PRINT_PicklockMissing = "I need a lockpick."; const string PRINT_Picklock_or_KeyMissing = "I need either the key or a lockpick."; const string PRINT_NeverOpen = "It will never open."; const string PRINT_Toofar_Away = "It's too far away."; const string PRINT_WrongSide = "That's the wrong side."; const string PRINT_MissingItem = "I don't have the right item."; const string PRINT_AnotherUser = "It's in use."; const string PRINT_NoPicklockTalent = "I don't have that skill."; const string PRINT_NOTHINGTOGET = "Nothing to be had there ..."; const string PRINT_NOTHINGTOGET02 = "Nothing there ..."; const string PRINT_NOTHINGTOGET03 = "Nothing to plunder ..."; const string PRINT_BlessSTR = "Innos grants you: Strength + "; const string PRINT_BlessDEX = "Innos grants you: Dexterity + "; const string PRINT_BlessMANA_MAX = "Innos grants you: Mana + "; const string PRINT_BlessHitpoints_MAX = "Innos grants you: Hitpoints + "; const string PRINT_BlessMANA = "You are filled with mental clarity."; const string PRINT_BlessHitpoints = "Innos hears you and heals you."; const string Print_BlessMana_Hit = "You feel reborn."; const string Print_BlessNone = "Innos thanks you for your prayer."; const string Print_NotEnoughGold = "Not enough gold."; const string Bless_Sword = "Consecrate Sword (5000 gold)"; const string Bless_Sword2 = "Consecrate Sword (Tears of Innos)"; const string Pray_Paladin1 = "... Innos, extend your hand over your vassals ..."; const string Pray_Paladin2 = "... bless them with your fire and grant them strength ..."; const string Pray_Paladin3 = "... to fight bravely in your name ..."; const string Pray_Paladin4 = "... for victory or death, according to your will."; const string DIALOG_ADDON_ATTENTAT_DESCRIPTION = "What do you know about the attempt on Esteban's life?"; const string DIALOG_ADDON_ATTENTAT_PRO = "I want to kill those traitors."; const string DIALOG_ADDON_ATTENTAT_CONTRA = "I'm looking for those guys so I can move against Esteban."; const string DIALOG_ADDON_MINE_DESCRIPTION = "You're needed in the mine. (Give red stone)"; const string DIALOG_ADDON_GOLD_DESCRIPTION = "What do I need to know about mining gold?"; const string PRINT_ADDON_KNOWSBF = "Knowledge of stinger poison learned"; const string PRINT_ADDON_HACKCHANCE = "Knowledge of gold digging improved! (+"; const string PRINT_Addon_StuntBonus = "Stunt Bonus"; const string PRINT_Addon_ExploitBonus = "Exploit Malus"; const string PRINT_ADDON_ENOUGHTALK = "Enough talk. Let's fight."; const string PRINT_FullyHealed = "Completely healed."; const string PRINT_Eat1 = "You feel refreshed."; const string PRINT_Eat2 = "Tastes juicy and fresh."; const string PRINT_Eat3 = "You feel well and strong!"; const string Print_ReadAstronomy = "A feeling of divine enlightenment fulfills you."; const string PRINT_GornsTreasure = "100 gold received."; const string PRINT_KerolothsGeldBeutel = "300 gold received."; const string PRINT_MalethBanditsGold = "300 gold received."; const string Print_DiegosTreasure = "2000 gold received."; const string PRINT_IrdorathBookDoesntOpen = "The cover of the book can't be opened."; const string PRINT_IrdorathBookHiddenKey = "There's a key hidden in the cover of the book!"; const string PRINT_FishLetter = "There's a note hidden inside the fish."; const string Print_InnoseyeGiven = "Eye of Innos given"; const string Print_InnosEyeGet = "Eye of Innos received"; const string PRINT_GotFourItems = "4 items received"; const string PRINT_OrcEliteRingEquip = "You feel weakened."; const string PRINT_SCIsObsessed = "You feel stifled!"; const string PRINT_ClearSCObsession = "You feel released!"; const string PRINT_NumberLeft = " left"; const string PRINT_NovizenLeft = " novices left"; const string PRINT_Addon_CanyonRazorsLeft = " Razor(s) left"; const string PRINT_DragKillCount = "The enemy is beaten. This time I will not rot beneath the rocks. Time to get back on the ship."; const string PRINT_Smith_1H_Special_01 = " (1 ore)"; const string PRINT_Smith_2H_Special_01 = " (2 ore)"; const string PRINT_Smith_1H_Special_02 = " (2 ore)"; const string PRINT_Smith_2H_Special_02 = " (3 ore)"; const string PRINT_Smith_1H_Special_03 = " (3 ore)"; const string PRINT_Smith_2H_Special_03 = " (4 ore)"; const string PRINT_Smith_1H_Special_04 = " (4 ore, 5 dragon blood)"; const string PRINT_Smith_2H_Special_04 = " (5 ore, 5 dragon blood)"; const string NAME_MageScroll = "Scroll"; const string PRINT_FoundRing = "Ring found"; const string PRINT_FoundAmulett = "Amulet found"; const string PRINT_FoundScroll = "Spell scroll found"; const string PRINT_FoundPotion = "Potion found"; const string PRINT_FoundMap = "Map found"; const string PRINT_FoundGold10 = "10 gold found"; const string PRINT_FoundGold25 = "25 gold found"; const string PRINT_FoundGold50 = "50 gold found"; const string PRINT_FoundGold100 = "100 gold found"; const string PRINT_FoundRuneBlank = "Rune found"; const string PRINT_FoundOreNugget = "Lump of ore found"; const string PRINT_FoundLockpick = "Lockpick found"; const string PRINT_HannasBeutel = "A small key and some lockpicks ..."; const string PRINT_GotPlants = "Some herbs found"; const string PRINT_NoSweeping = "It'll take ages to sweep all the chambers!"; const string PRINT_Mandibles = "The secretion isn't having any effect."; const string PRINT_Bloodfly = "Tastes bitter and poisonous."; const string PRINT_PILZ = "Mushroom tobacco"; const string PRINT_DOPPEL = "Double Apple"; const string PRINT_HONIG = "Honey Tobacco"; const string PRINT_KRAUT = "Herb tobacco"; const string PRINT_XPGained = "Experience + "; const string PRINT_LevelUp = "Level Up!"; const string PRINT_NewLogEntry = "New Diary Entry"; const string PRINT_TeleportTooFarAway = "Too far away"; const string PRINT_BiffsAnteil = "Biff's share: "; const string PRINT_BiffGold = " gold"; const string PRINT_Addon_SCIsWearingRangerRing = "You now bear the sign of the 'Ring of Water'"; var string TEXT_Innoseye_Setting; const string TEXT_Innoseye_Setting_Broken = "The setting of the amulet has broken."; const string TEXT_Innoseye_Setting_Repaired = "The setting of the amulet is intact."; const string TEXT_Innoseye_Gem = "The gem is dull and powerless."; const string Pickpocket_20 = "(It would be child's play to steal his purse.)"; const string Pickpocket_40 = "(It would be simple to steal his purse.)"; const string Pickpocket_60 = "(It would be risky to steal his purse.)"; const string Pickpocket_80 = "(It would be difficult to steal his purse.)"; const string Pickpocket_100 = "(It would be damn difficult to steal his purse.)"; const string Pickpocket_120 = "(It would be nearly impossible to steal his purse.)"; const string Pickpocket_20_Female = "(It would be child's play to steal her purse.)"; const string Pickpocket_40_Female = "(It would be simple to steal her purse.)"; const string Pickpocket_60_Female = "(It would be risky to steal her purse.)"; const string Pickpocket_80_Female = "(It would be difficult to steal her purse.)"; const string Pickpocket_100_Female = "(It would be damn difficult to steal her purse.)"; const string Pickpocket_120_Female = "(It would be nearly impossible to steal her purse.)"; const int YPOS_GoldGiven = 34; const int YPOS_GoldTaken = 34; const int YPOS_ItemGiven = 37; const int YPOS_ItemTaken = 40; const int YPOS_LOGENTRY = 45; const int YPOS_LevelUp = 50; const int YPOS_XPGained = 55; const string PRINT_PICKLOCK_SUCCESS = "That sounded good."; const string PRINT_PICKLOCK_UNLOCK = "The lock's open."; const string PRINT_PICKLOCK_FAILURE = "Damn ... Try again."; const string PRINT_PICKLOCK_BROKEN = "The lockpick broke."; const string PRINT_HITPOINTS_MISSING = "Not enough Hitpoints."; const string PRINT_HITPOINTS_MAX_MISSING = "maximum Hitpoints too short."; const string PRINT_MANA_MISSING = "Not enough Mana points."; const string PRINT_MANA_MAX_MISSING = "Not enough maximum mana points."; const string PRINT_STRENGTH_MISSING = "Not enough Strength points."; const string PRINT_DEXTERITY_MISSING = "Not enough Dexterity points."; const string PRINT_MAGCIRCLES_MISSING = "Magic Circle too low to use rune."; const string PRINT_ADDON_BELIARSCOURSE_MISSING = "The weapon cannot be equipped."; const string _STR_MESSAGE_INTERACT_NO_KEY = "No lockpick or fitting key."; const string _STR_MESSAGE_TRADE_FAILURE = "Your trade goods aren't valuable enough."; const string STR_INFO_TRADE_ACCEPT = "Accept"; const string STR_INFO_TRADE_RESET = "Decline"; const string STR_INFO_TRADE_EXIT = "BACK"; const string MENU_TEXT_NEEDS_APPLY = "Press ENTER to activate!"; const string MENU_TEXT_NEEDS_RESTART = "Some settings will not become active until you restart."; const string KapWechsel_1 = "Chapter 1"; const string KapWechsel_1_Text = "The Menace"; const string KapWechsel_2 = "Chapter 2"; const string KapWechsel_2_Text = "Return to the Colony"; const string KapWechsel_3 = "Chapter 3"; const string KapWechsel_3_Text = "The Eye of Innos"; const string KapWechsel_4 = "Chapter 4"; const string KapWechsel_4_Text = "The Dragon Hunt"; const string KapWechsel_5 = "Chapter 5"; const string KapWechsel_5_Text = "Departure"; const string KapWechsel_6 = "Chapter 6"; const string KapWechsel_6_Text = "The Halls of Irdorath";
D
/// PTB language modeling dataset module grain.dataset.ptb; import std.array; import std.algorithm : splitter; import std.stdio : File; import mir.ndslice; import mir.random.variable : UniformVariable; import numir; /// auto prepareDataset() { import std.format; import std.file : exists, read, mkdir; import std.net.curl : download; if (!exists("data")) { mkdir("data"); } enum root = "https://github.com/tomsercu/lstm/raw/master/"; foreach (f; ["train", "valid", "test"]) { auto dst = format!"data/ptb.%s.txt"(f); if (!exists(dst))download(root ~ dst, dst); } Corpus corpus; foreach (name; ["train", "valid", "test"]) { corpus.register("data/ptb." ~ name ~ ".txt", name); } return corpus; } /// struct Dictionary { enum eos = "<eos>"; enum eosId = 0; string[] idx2word; int[string] word2idx; void register(string word) { assert(int.max > this.idx2word.length); if (this.idx2word.empty) { // init this.idx2word = [eos]; this.word2idx[eos] = 0; } if (word !in this.word2idx) { this.word2idx[word] = cast(int) this.idx2word.length; this.idx2word ~= word; } } } /// struct Corpus { Dictionary dict; int[][string] dataset; size_t batchSize = 20; void register(string path, string name) { import std.string : strip; int[] data; foreach (line; File(path).byLine) { foreach (word; line.strip.splitter(' ')) { this.dict.register(word.idup); data ~= this.dict.word2idx[word]; } data ~= Dictionary.eosId; } dataset[name] = data; } /// returns word-id 2d slice shaped (seqlen, batchsize) auto batchfy(string name) { import numir; auto data = this.dataset[name]; const len = data.length / this.batchSize; return data[0 .. len * this.batchSize].sliced.view(this.batchSize, len).transposed.slice; } auto vocabSize() { return cast(int) this.dict.idx2word.length; } }
D
/* TEST_OUTPUT: --- fail_compilation/fail9081.d(12): Error: package `core` has no type fail_compilation/fail9081.d(13): Error: package `stdc` has no type fail_compilation/fail9081.d(14): Error: module `stdio` has no type --- */ import core.stdc.stdio; typeof(core) a; typeof(core.stdc) b; typeof(core.stdc.stdio) c;
D
import mat4; import model; import shader; import vao; import derelict.opengl3.gl3; class AdvancedModel : Model { private: ShaderProgram * shader_prog; Vao * arrayobj; public: this(ShaderProgram * shad) { shader_prog = shad; } void setVao(Vao * vao) { arrayobj = vao; } override void draw(ref Mat4 cam, ref Mat4 proj, ref Mat4 trans) { shader_prog.bind(); arrayobj.bind(); // All data is drawn from the VAO glDrawElements(GL_TRIANGLES, arrayobj.length, GL_UNSIGNED_SHORT, null); ShaderProgram.unbind(); glBindVertexArray(0); } override void tick() { } @property const(Vao *) vao() { return arrayobj; } }
D
module accessors; import std.traits; struct Read { string visibility = "public"; } // Deprecated! See below. // RefRead can not check invariants on change, so there's no point. // ref property functions where the value being returned is a field of the class // are entirely equivalent to public fields. struct RefRead { string visibility = "public"; } struct ConstRead { string visibility = "public"; } struct Write { string visibility = "public"; } immutable string GenerateFieldAccessors = ` mixin GenerateFieldAccessorMethods; mixin(GenerateFieldAccessorMethodsImpl); `; mixin template GenerateFieldAccessorMethods() { import std.meta : Alias, Filter; private enum bool isNotThis(string T) = T != "this"; static enum GenerateFieldAccessorMethodsImpl() { import std.traits : hasUDA; string result = ""; foreach (name; Filter!(isNotThis, __traits(derivedMembers, typeof(this)))) { enum string fieldCode = `Alias!(__traits(getMember, typeof(this), "` ~ name ~ `"))`; mixin("alias field = " ~ fieldCode ~ ";"); static if (__traits(compiles, hasUDA!(field, Read))) { static if (hasUDA!(field, Read)) { enum string readerDecl = GenerateReader!(name, field); debug (accessors) pragma(msg, readerDecl); result ~= readerDecl; } static if (hasUDA!(field, RefRead)) { result ~= `pragma(msg, "Deprecation! RefRead on ` ~ typeof(this).stringof ~ `.` ~ name ~ ` makes a private field effectively public, defeating the point.");`; enum string refReaderDecl = GenerateRefReader!(name, field); debug (accessors) pragma(msg, refReaderDecl); result ~= refReaderDecl; } static if (hasUDA!(field, ConstRead)) { enum string constReaderDecl = GenerateConstReader!(name, field); debug (accessors) pragma(msg, constReaderDecl); result ~= constReaderDecl; } static if (hasUDA!(field, Write)) { enum string writerDecl = GenerateWriter!(name, field, fieldCode); debug (accessors) pragma(msg, writerDecl); result ~= writerDecl; } } } return result; } } template isStatic(alias field) { enum isStatic = helper; static enum helper() { return is(typeof({ auto f = field; })); } } template getModifiers(alias field) { enum getModifiers = helper; static enum helper() { static if (isStatic!field) { return " static"; } else { return ""; } } } template filterAttributes(alias field) { enum filterAttributes = helper; static enum helper() { uint attributes = uint.max; static if (needToDup!(typeof(field))) { attributes &= ~FunctionAttribute.nogc; } static if (isStatic!field) { attributes &= ~FunctionAttribute.pure_; } return attributes; } } template GenerateReader(string name, alias field) { enum GenerateReader = helper; static enum helper() { import std.string : format; enum visibility = getVisibility!(field, Read); enum accessorName = accessor(name); enum needToDup = needToDup!(typeof(field)); enum uint attributes = inferAttributes!(typeof(field), "__postblit") & filterAttributes!field; string attributesString = generateAttributeString!attributes; static if (needToDup) { return format("%s%s final @property auto %s() inout %s" ~ "{ return typeof(this.%s).init ~ this.%s; }", visibility, getModifiers!field, accessorName, attributesString, name, name); } else static if (isStatic!field) { return format("%s static final @property auto %s() %s{ return this.%s; }", visibility, accessorName, attributesString, name); } else { return format("%s final @property auto %s() inout %s{ return this.%s; }", visibility, accessorName, attributesString, name); } } } /// @nogc nothrow pure @safe unittest { int integerValue; string stringValue; int[] intArrayValue; static assert(GenerateReader!("foo", integerValue) == "public static final @property auto foo() " ~ "@nogc nothrow @safe { return this.foo; }"); static assert(GenerateReader!("foo", stringValue) == "public static final @property auto foo() " ~ "@nogc nothrow @safe { return this.foo; }"); static assert(GenerateReader!("foo", intArrayValue) == "public static final @property auto foo() inout nothrow @safe " ~ "{ return typeof(this.foo).init ~ this.foo; }"); } template GenerateRefReader(string name, alias field) { enum GenerateRefReader = helper; static enum helper() { import std.string : format; enum visibility = getVisibility!(field, RefRead); enum accessorName = accessor(name); static if (isStatic!field) { enum string attributesString = "@nogc nothrow @safe "; } else { enum string attributesString = "@nogc nothrow pure @safe "; } return format("%s%s final @property ref auto %s() " ~ "%s{ return this.%s; }", visibility, getModifiers!field, accessorName, attributesString, name); } } /// @nogc nothrow pure @safe unittest { int integerValue; string stringValue; int[] intArrayValue; static assert(GenerateRefReader!("foo", integerValue) == "public static final @property ref auto foo() " ~ "@nogc nothrow @safe { return this.foo; }"); static assert(GenerateRefReader!("foo", stringValue) == "public static final @property ref auto foo() " ~ "@nogc nothrow @safe { return this.foo; }"); static assert(GenerateRefReader!("foo", intArrayValue) == "public static final @property ref auto foo() " ~ "@nogc nothrow @safe { return this.foo; }"); } template GenerateConstReader(string name, alias field) { enum GenerateConstReader = helper; static enum helper() { import std.string : format; enum visibility = getVisibility!(field, RefRead); enum accessorName = accessor(name); alias attributes = inferAttributes!(typeof(field), "__postblit"); string attributesString = generateAttributeString!attributes; return format("%s final @property auto %s() const %s { return this.%s; }", visibility, accessorName, attributesString, name); } } template GenerateWriter(string name, alias field, string fieldCode) { enum GenerateWriter = helper; static enum helper() { import std.string : format; enum visibility = getVisibility!(field, Write); enum accessorName = accessor(name); enum inputName = accessorName; enum needToDup = needToDup!(typeof(field)); enum uint attributes = defaultFunctionAttributes & filterAttributes!field & inferAssignAttributes!(typeof(field)) & inferAttributes!(typeof(field), "__postblit") & inferAttributes!(typeof(field), "__dtor"); enum attributesString = generateAttributeString!attributes; return format("%s%s final @property void %s(typeof(%s) %s) %s{ this.%s = %s%s; }", visibility, getModifiers!field, accessorName, fieldCode, inputName, attributesString, name, inputName, needToDup ? ".dup" : ""); } } /// @nogc nothrow pure @safe unittest { int integerValue; string stringValue; int[] intArrayValue; static assert(GenerateWriter!("foo", integerValue, "integerValue") == "public static final @property void foo(typeof(integerValue) foo) " ~ "@nogc nothrow @safe { this.foo = foo; }"); static assert(GenerateWriter!("foo", stringValue, "stringValue") == "public static final @property void foo(typeof(stringValue) foo) " ~ "@nogc nothrow @safe { this.foo = foo; }"); static assert(GenerateWriter!("foo", intArrayValue, "intArrayValue") == "public static final @property void foo(typeof(intArrayValue) foo) " ~ "nothrow @safe { this.foo = foo.dup; }"); } private enum uint defaultFunctionAttributes = FunctionAttribute.nogc | FunctionAttribute.safe | FunctionAttribute.nothrow_ | FunctionAttribute.pure_; private template inferAttributes(T, string M) { enum uint inferAttributes() { uint attributes = defaultFunctionAttributes; static if (is(T == struct)) { static if (hasMember!(T, M)) { attributes &= functionAttributes!(__traits(getMember, T, M)); } else { foreach (field; Fields!T) { attributes &= inferAttributes!(field, M); } } } return attributes; } } private enum uint inferAssignAttributes(T)() { static if (hasElaborateAssign!T) { void testAttributes()() { auto testObject = T.init; testObject = T.init; } return functionAttributes!(testAttributes!()); } else { return defaultFunctionAttributes; } } // Issue 22: https://github.com/funkwerk/accessors/issues/22 @nogc nothrow pure @safe unittest { static struct SysTime { void opAssign(SysTime) @safe pure nothrow { new int; } } static struct Nullable { SysTime t; void opAssign()(SysTime) { } } static assert((inferAssignAttributes!Nullable & FunctionAttribute.nogc) == 0); } private template generateAttributeString(uint attributes) { enum string generateAttributeString() { string attributesString; static if (attributes & FunctionAttribute.nogc) { attributesString ~= "@nogc "; } static if (attributes & FunctionAttribute.nothrow_) { attributesString ~= "nothrow "; } static if (attributes & FunctionAttribute.pure_) { attributesString ~= "pure "; } static if (attributes & FunctionAttribute.safe) { attributesString ~= "@safe "; } return attributesString; } } private enum needToDup(T) = isArray!T && !DeepConst!T; private enum DeepConst(T) = __traits(compiles, (const T x) { T y = x; }); @nogc nothrow pure @safe unittest { int integerField; int[] integerArrayField; string stringField; const int[] constIntegerArrayField; static assert(!needToDup!(typeof(integerField))); static assert(needToDup!(typeof(integerArrayField))); static assert(!needToDup!(typeof(stringField))); static assert(!needToDup!(typeof(constIntegerArrayField))); } static string accessor(string name) @nogc nothrow pure @safe { import std.string : chomp, chompPrefix; return name.chomp("_").chompPrefix("_"); } /// @nogc nothrow pure @safe unittest { assert(accessor("foo_") == "foo"); assert(accessor("_foo") == "foo"); } /** * Returns a string with the value of the field "visibility" if the field * is annotated with an UDA of type A. The default visibility is "public". */ template getVisibility(alias field, A) { import std.string : format; enum getVisibility = helper; static enum helper() { alias attributes = getUDAs!(field, A); static if (attributes.length == 0) { return A.init.visibility; } else { static assert(attributes.length == 1, format("%s should not have more than one attribute @%s", field.stringof, A.stringof)); static if (is(typeof(attributes[0]))) return attributes[0].visibility; else return A.init.visibility; } } } /// @nogc nothrow pure @safe unittest { @Read("public") int publicInt; @Read("package") int packageInt; @Read("protected") int protectedInt; @Read("private") int privateInt; @Read int defaultVisibleInt; @Read @Write("protected") int publicReadableProtectedWritableInt; static assert(getVisibility!(publicInt, Read) == "public"); static assert(getVisibility!(packageInt, Read) == "package"); static assert(getVisibility!(protectedInt, Read) == "protected"); static assert(getVisibility!(privateInt, Read) == "private"); static assert(getVisibility!(defaultVisibleInt, Read) == "public"); static assert(getVisibility!(publicReadableProtectedWritableInt, Read) == "public"); static assert(getVisibility!(publicReadableProtectedWritableInt, Write) == "protected"); } /// Creates accessors for flags. nothrow pure @safe unittest { import std.typecons : Flag, No, Yes; class Test { @Read @Write public Flag!"someFlag" test_ = Yes.someFlag; mixin(GenerateFieldAccessors); } with (new Test) { assert(test == Yes.someFlag); test = No.someFlag; assert(test == No.someFlag); static assert(is(typeof(test) == Flag!"someFlag")); } } /// Creates accessors for Nullables. nothrow pure @safe unittest { import std.typecons : Nullable; class Test { @Read @Write public Nullable!string test_ = Nullable!string("X"); mixin(GenerateFieldAccessors); } with (new Test) { assert(!test.isNull); assert(test.get == "X"); static assert(is(typeof(test) == Nullable!string)); } } /// Creates non-const reader. nothrow pure @safe unittest { class Test { @Read int i_; mixin(GenerateFieldAccessors); } auto mutableObject = new Test; const constObject = mutableObject; mutableObject.i_ = 42; assert(mutableObject.i == 42); static assert(is(typeof(mutableObject.i) == int)); static assert(is(typeof(constObject.i) == const(int))); } /// Creates ref reader. nothrow pure @safe unittest { class Test { @RefRead int i_; mixin(GenerateFieldAccessors); } auto mutableTestObject = new Test; mutableTestObject.i = 42; assert(mutableTestObject.i == 42); static assert(is(typeof(mutableTestObject.i) == int)); } /// Creates writer. nothrow pure @safe unittest { class Test { @Read @Write private int i_; mixin(GenerateFieldAccessors); } auto mutableTestObject = new Test; mutableTestObject.i = 42; assert(mutableTestObject.i == 42); static assert(!__traits(compiles, mutableTestObject.i += 1)); static assert(is(typeof(mutableTestObject.i) == int)); } /// Checks whether hasUDA can be used for each member. nothrow pure @safe unittest { class Test { alias Z = int; @Read @Write private int i_; mixin(GenerateFieldAccessors); } auto mutableTestObject = new Test; mutableTestObject.i = 42; assert(mutableTestObject.i == 42); static assert(!__traits(compiles, mutableTestObject.i += 1)); } /// Returns non const for PODs and structs. nothrow pure @safe unittest { import std.algorithm : map, sort; import std.array : array; class C { @Read string s_; mixin(GenerateFieldAccessors); } C[] a = null; static assert(__traits(compiles, a.map!(c => c.s).array.sort())); } /// Regression. nothrow pure @safe unittest { class C { @Read @Write string s_; mixin(GenerateFieldAccessors); } with (new C) { s = "foo"; assert(s == "foo"); static assert(is(typeof(s) == string)); } } /// Supports user-defined accessors. nothrow pure @safe unittest { class C { this() { str_ = "foo"; } @RefRead private string str_; public @property const(string) str() const { return this.str_.dup; } mixin(GenerateFieldAccessors); } with (new C) { str = "bar"; } } /// Creates accessor for locally defined types. @system unittest { class X { } class Test { @Read public X x_; mixin(GenerateFieldAccessors); } with (new Test) { x_ = new X; assert(x == x_); static assert(is(typeof(x) == X)); } } /// Creates const reader for simple structs. nothrow pure @safe unittest { class Test { struct S { int i; } @Read S s_; mixin(GenerateFieldAccessors); } auto mutableObject = new Test; const constObject = mutableObject; mutableObject.s_.i = 42; assert(constObject.s.i == 42); static assert(is(typeof(mutableObject.s) == Test.S)); static assert(is(typeof(constObject.s) == const(Test.S))); } /// Reader for structs return copies. nothrow pure @safe unittest { class Test { struct S { int i; } @Read S s_; mixin(GenerateFieldAccessors); } auto mutableObject = new Test; mutableObject.s.i = 42; assert(mutableObject.s.i == int.init); } /// Creates reader for const arrays. nothrow pure @safe unittest { class X { } class C { @Read private const(X)[] foo_; mixin(GenerateFieldAccessors); } auto x = new X; with (new C) { foo_ = [x]; auto y = foo; static assert(is(typeof(y) == const(X)[])); static assert(is(typeof(foo) == const(X)[])); } } /// Property has correct type. nothrow pure @safe unittest { class C { @Read private int foo_; mixin(GenerateFieldAccessors); } with (new C) { static assert(is(typeof(foo) == int)); } } /// Inheritance (https://github.com/funkwerk/accessors/issues/5). @nogc nothrow pure @safe unittest { class A { @Read string foo_; mixin(GenerateFieldAccessors); } class B : A { @Read string bar_; mixin(GenerateFieldAccessors); } } /// Transfers struct attributes. @nogc nothrow pure @safe unittest { struct S { this(this) { } void opAssign(S s) { } } class A { @Read S[] foo_; @ConstRead S bar_; @Write S baz_; mixin(GenerateFieldAccessors); } } /// @Read property returns array with mutable elements. nothrow pure @safe unittest { struct Field { } struct S { @Read Field[] foo_; mixin(GenerateFieldAccessors); } with (S()) { Field[] arr = foo; } } /// Static properties are generated for static members. unittest { class MyStaticTest { @Read static int stuff_ = 8; mixin(GenerateFieldAccessors); } assert(MyStaticTest.stuff == 8); } unittest { struct S { @Read @Write static int foo_ = 8; @RefRead static int bar_ = 6; mixin(GenerateFieldAccessors); } assert(S.foo == 8); static assert(is(typeof({ S.foo = 8; }))); assert(S.bar == 6); } @nogc nothrow pure @safe unittest { struct Thing { @Read private int[] content_; mixin(GenerateFieldAccessors); } class User { void helper(const int[] content) { } void doer(const Thing thing) { helper(thing.content); } } } nothrow pure @safe unittest { class Class { } struct Thing { @Read private Class[] classes_; mixin(GenerateFieldAccessors); } Thing thing; assert(thing.classes.length == 0); }
D
/* GDC -- D front-end for GCC Copyright (C) 2013 Free Software Foundation, Inc. GCC 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 3, or (at your option) any later version. GCC is distributed in the hope that 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 GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ /* This module provides a backtrace implementation for gdc */ module gcc.backtrace; import gcc.libbacktrace; version( Posix ) { // NOTE: The first 5 frames with the current implementation are // inside core.runtime and the object code, so eliminate // these for readability. The alternative would be to // exclude the first N frames that are in a list of // mangled function names. static enum FIRSTFRAME = 5; } else { // NOTE: On Windows, the number of frames to exclude is based on // whether the exception is user or system-generated, so // it may be necessary to exclude a list of function names // instead. static enum FIRSTFRAME = 0; } static if(BACKTRACE_SUPPORTED && !BACKTRACE_USES_MALLOC) { import core.stdc.stdint, core.stdc.string, core.stdc.stdio; enum MAXFRAMES = 128; extern(C) int simpleCallback(void* data, uintptr_t pc) { auto context = cast(LibBacktrace)data; if(context.numPCs == MAXFRAMES) return 1; context.pcs[context.numPCs++] = pc; return 0; } /* * Used for backtrace_create_state and backtrace_simple */ extern(C) void simpleErrorCallback(void* data, const(char)* msg, int errnum) { if(data) //context is not available in backtrace_create_state { auto context = cast(LibBacktrace)data; strncpy(context.errorBuf.ptr, msg, context.errorBuf.length - 1); context.error = errnum; } } /* * Used for backtrace_pcinfo */ extern(C) int pcinfoCallback(void* data, uintptr_t pc, const(char)* filename, int lineno, const(char)* func) { auto context = cast(SymbolCallbackInfo*)data; //Try to get the function name via backtrace_syminfo if(func is null) { SymbolCallbackInfo2 info; info.base = context; info.filename = filename; info.lineno = lineno; if(backtrace_syminfo(context.state, pc, &syminfoCallback2, null, &info) != 0) { return context.retval; } } auto sym = SymbolOrError(0, SymbolInfo(func, filename, lineno, cast(void*)pc)); context.retval = context.applyCB(context.num, sym); context.num++; return context.retval; } /* * Used for backtrace_pcinfo and backtrace_syminfo */ extern(C) void pcinfoErrorCallback(void* data, const(char)* msg, int errnum) { auto context = cast(SymbolCallbackInfo*)data; if(errnum == -1) { context.noInfo = true; return; } SymbolOrError symError; symError.errnum = errnum; symError.msg = msg; size_t i = 0; context.retval = context.applyCB(i, symError); } /* * Used for backtrace_syminfo (in opApply) */ extern(C) void syminfoCallback(void* data, uintptr_t pc, const(char)* symname, uintptr_t symval) { auto context = cast(SymbolCallbackInfo*)data; auto sym = SymbolOrError(0, SymbolInfo(symname, null, 0, cast(void*)pc)); context.retval = context.applyCB(context.num, sym); context.num++; } /* * This callback is used if backtrace_syminfo is called from the pcinfoCallback * callback. It merges it's information with the information from pcinfoCallback. */ extern(C) void syminfoCallback2(void* data, uintptr_t pc, const(char)* symname, uintptr_t symval) { auto context = cast(SymbolCallbackInfo2*)data; auto sym = SymbolOrError(0, SymbolInfo(symname, context.filename, context.lineno, cast(void*)pc)); context.base.retval = context.base.applyCB(context.base.num, sym); context.base.num++; } /* * The callback type used with the opApply overload which returns a SymbolOrError */ private alias scope int delegate(ref size_t, ref SymbolOrError) ApplyCallback; /* * Passed to syminfoCallback, pcinfoCallback and pcinfoErrorCallback */ struct SymbolCallbackInfo { bool noInfo = false; //True if debug info / symbol table is not available size_t num = 0; //Counter for opApply int retval; //Value returned by applyCB backtrace_state* state; //info.fileName / funcName / errmsg may become invalid after this delegate returned ApplyCallback applyCB; void reset() { noInfo = false; num = 0; } } /* * Passed to the syminfoCallback2 callback. That function merges it's * funcName with this information and updates base as all other callbacks do. */ struct SymbolCallbackInfo2 { SymbolCallbackInfo* base; const(char)* filename; int lineno; } /* * Contains a valid symbol or an error message if errnum is != 0. */ struct SymbolOrError { int errnum; // == 0: No error union { SymbolInfo symbol; const(char)* msg; } } //FIXME: state is never freed as libbacktrace doesn't provide a free function... public class LibBacktrace : Throwable.TraceInfo { enum MaxAlignment = (void*).alignof; static void initLibBacktrace() { if(!initialized) { state = backtrace_create_state(null, false, &simpleErrorCallback, null); initialized = true; } } this(int firstFrame = FIRSTFRAME) { _firstFrame = firstFrame; initLibBacktrace(); if(state) { backtrace_simple(state, _firstFrame, &simpleCallback, &simpleErrorCallback, cast(void*)this); } } override int opApply( scope int delegate(ref const(char[])) dg ) const { return opApply( (ref size_t, ref const(char[]) buf) { return dg( buf ); } ); } override int opApply( scope int delegate(ref size_t, ref const(char[])) dg ) const { return opApply( (ref size_t i, ref SymbolOrError sym) { char[512] buffer = '\0'; char[] msg; if(sym.errnum != 0) { auto retval = snprintf(buffer.ptr, buffer.length, "libbacktrace error: '%s' errno: %d", sym.msg, sym.errnum); if(retval >= buffer.length) msg = buffer[0 .. $-1]; //Ignore zero terminator else if(retval > 0) msg = buffer[0 .. retval]; } else { msg = formatLine(sym.symbol, buffer); } return dg(i, msg); } ); } int opApply(ApplyCallback dg) const { //If backtrace_simple produced an error report it and exit if(!state || error != 0) { size_t pos = 0; SymbolOrError symError; symError.errnum = error; symError.msg = errorBuf.ptr; return dg(pos, symError); } SymbolCallbackInfo cinfo; cinfo.applyCB = dg; cinfo.state = cast(backtrace_state*)state; //Try using debug info first foreach(i, pc; pcs[0 .. numPCs]) { //FIXME: We may violate const guarantees here... if(backtrace_pcinfo(cast(backtrace_state*)state, pc, &pcinfoCallback, &pcinfoErrorCallback, &cinfo) != 0) { break; //User delegate requested abort or no debug info at all } } //If no error or other error which has already been reported via callback if(!cinfo.noInfo) return cinfo.retval; //Try using symbol table cinfo.reset(); foreach(pc; pcs[0 .. numPCs]) { if(backtrace_syminfo(cast(backtrace_state*)state, pc, &syminfoCallback, &pcinfoErrorCallback, &cinfo) == 0) { break; } } if(!cinfo.noInfo) return cinfo.retval; //No symbol table foreach(i, pc; pcs[0 .. numPCs]) { auto sym = SymbolOrError(0, SymbolInfo(null, null, 0, cast(void*)pc)); if(auto ret = dg(i, sym) != 0) return ret; } return 0; } override string toString() const { string buf; foreach(i, const(char[]) line; this ) buf ~= i ? "\n" ~ line : line; return buf; } private: static backtrace_state* state = null; static bool initialized = false; size_t numPCs = 0; uintptr_t[MAXFRAMES] pcs; int error = 0; int _firstFrame = 0; char[128] errorBuf; } } else { /* * Our fallback backtrace implementation using libgcc's unwind * and backtrace support. In theory libbacktrace should be available * everywhere where this code works. We keep it anyway till libbacktrace * is well-tested. */ public class GDCBacktrace : Throwable.TraceInfo { this(int firstFrame = FIRSTFRAME) { _firstFrame = firstFrame; _callstack = gdcBacktrace(); _framelist = gdcBacktraceSymbols(_callstack); } override int opApply( scope int delegate(ref const(char[])) dg ) const { return opApply( (ref size_t, ref const(char[]) buf) { return dg( buf ); } ); } override int opApply( scope int delegate(ref size_t, ref const(char[])) dg ) const { int ret = 0; char[512] fixbuf = '\0'; for( int i = _firstFrame; i < _framelist.entries; ++i ) { auto pos = cast(size_t)(i - _firstFrame); auto buf = formatLine(_framelist.symbols[i], fixbuf); ret = dg( pos, buf ); if( ret ) break; } return ret; } override string toString() const { string buf; foreach( i, line; this ) buf ~= i ? "\n" ~ line : line; return buf; } private: BTSymbolData _framelist; GDCBacktraceData _callstack; int _firstFrame = 0; } // Implementation details private: import gcc.unwind; static enum MAXFRAMES = 128; struct GDCBacktraceData { void*[MAXFRAMES] callstack; int numframes = 0; } struct BTSymbolData { size_t entries; SymbolInfo[MAXFRAMES] symbols; } static extern (C) _Unwind_Reason_Code unwindCB(_Unwind_Context *ctx, void *d) { GDCBacktraceData* bt = cast(GDCBacktraceData*)d; if(bt.numframes >= MAXFRAMES) return _URC_NO_REASON; bt.callstack[bt.numframes] = cast(void*)_Unwind_GetIP(ctx); bt.numframes++; return _URC_NO_REASON; } GDCBacktraceData gdcBacktrace() { GDCBacktraceData stackframe; _Unwind_Backtrace(&unwindCB, &stackframe); return stackframe; } BTSymbolData gdcBacktraceSymbols(GDCBacktraceData data) { BTSymbolData symData; for(auto i = 0; i < data.numframes; i++) { static if(HAVE_DLADDR) { Dl_info funcInfo; if(data.callstack[i] !is null && dladdr(data.callstack[i], &funcInfo) != 0) { symData.symbols[symData.entries].funcName = funcInfo.dli_sname; symData.symbols[symData.entries].address = data.callstack[i]; symData.entries++; } else { symData.symbols[symData.entries].address = data.callstack[i]; symData.entries++; } } else { symData.symbols[symData.entries].address = data.callstack[i]; symData.entries++; } } return symData; } } /* * Struct representing a symbol (function) in the backtrace */ struct SymbolInfo { const(char)* funcName, fileName; size_t line; const(void)* address; } /* * Format one output line for symbol sym. * Returns a slice of fixbuf. */ char[] formatLine(const SymbolInfo sym, ref char[512] fixbuf) { import core.demangle, core.stdc.config; import core.stdc.stdio : snprintf, printf; import core.stdc.string : strlen; int ret; ret = snprintf(fixbuf.ptr, fixbuf.sizeof, "0x%lx ", cast(c_ulong)sym.address); if(ret >= fixbuf.sizeof) return fixbuf[0 .. $-1]; //Ignore zero terminator if(sym.funcName is null) { if(!(fixbuf.sizeof - ret > 3)) return fixbuf[0 .. ret]; fixbuf[ret] = fixbuf[ret+1] = fixbuf[ret+2] = '?'; ret += 3; } else { auto demangled = demangle(sym.funcName[0 .. strlen(sym.funcName)], fixbuf[ret .. $-1]); ret += demangled.length; if(ret + 1 >= fixbuf.sizeof) return fixbuf[0 .. $-1]; //Ignore zero terminator } ret += snprintf(fixbuf.ptr + ret, fixbuf.sizeof - ret, "\n\t%s:%d", sym.fileName is null ? "???" : sym.fileName, sym.line); if(ret >= fixbuf.sizeof) return fixbuf[0 .. $-1]; //Ignore zero terminator else return fixbuf[0 .. ret]; } unittest { char[512] sbuf = '\0'; char[] result; string longString; for(size_t i = 0; i < 60; i++) longString ~= "abcdefghij"; longString ~= '\0'; auto symbol = SymbolInfo(null, null, 0, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo(longString.ptr, null, 0, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo("func", "test.d", 0, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo("func", longString.ptr, 0, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo(longString.ptr, "test.d", 0, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo(longString.ptr, longString.ptr, 0, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo("func", "test.d", 1000, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo(null, (longString[0..500] ~ '\0').ptr, 100000000, null); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo("func", "test.d", 0, cast(void*)0x100000); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo("func", null, 0, cast(void*)0x100000); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo(null, "test.d", 0, cast(void*)0x100000); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); symbol = SymbolInfo(longString.ptr, "test.d", 0, cast(void*)0x100000); result = formatLine(symbol, sbuf); assert(result.length < 512 && result.ptr[result.length] == '\0' && sbuf[$-1] == '\0'); }
D
prototype Mst_Default_Harpie(C_Npc) { name[0] = "Harpy"; guild = GIL_HARPY; aivar[AIV_MM_REAL_ID] = ID_HARPY; level = 20; attribute[ATR_STRENGTH] = 110; attribute[ATR_DEXTERITY] = 110; attribute[ATR_HITPOINTS_MAX] = 280; attribute[ATR_HITPOINTS] = 280; attribute[ATR_MANA_MAX] = 100; attribute[ATR_MANA] = 100; protection[PROT_BLUNT] = 110; protection[PROT_EDGE] = 90; protection[PROT_POINT] = 40; protection[PROT_FIRE] = 90; protection[PROT_FLY] = 0; protection[PROT_MAGIC] = 0; damagetype = DAM_EDGE; fight_tactic = FAI_HARPY; senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL; senses_range = PERC_DIST_MONSTER_ACTIVE_MAX; aivar[AIV_MM_ThreatenBeforeAttack] = TRUE; aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM; aivar[AIV_MM_FollowInWater] = TRUE; start_aistate = ZS_MM_AllScheduler; aivar[AIV_MM_RestStart] = OnlyRoutine; }; func void B_SetVisuals_Harpie() { Mdl_SetVisual(self,"Harpie.mds"); Mdl_SetVisualBody(self,"Har_Body",DEFAULT,DEFAULT,"",DEFAULT,DEFAULT,-1); }; instance Harpie(Mst_Default_Harpie) { B_SetVisuals_Harpie(); Npc_SetToFistMode(self); };
D
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Vapor.build/Sessions/Request+Session.swift.o : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Vapor.build/Sessions/Request+Session~partial.swiftmodule : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Vapor.build/Sessions/Request+Session~partial.swiftdoc : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/FileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/URLEncoded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/ServeCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/RoutesCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/BootCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Method.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionCache.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ResponseCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/RequestCodable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/Middleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/FileMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/DateMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Response.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/AnyResponse.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServerConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/SessionsConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/HTTPMethod+String.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Path.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Request+Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Session.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Application.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/RouteCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Function.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/VaporProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Responder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/BasicResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/ApplicationResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/PlaintextEncoder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/ParametersContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/QueryContainer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/EngineRouter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/Server.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/NIOServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Server/RunningServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Error.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Logging/Logger+LogError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/AbortError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/Sessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Sessions/MemorySessions.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/ContentCoders.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/HTTPStatus.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Response/Redirect.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/SingleValueGet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Config+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Services/Services+Default.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/Client.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Client/FoundationClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Routing/Router+Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Content/Content.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Error/Abort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/vapor/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOHTTP1.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOOpenSSL.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/HTTP.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOTLS.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Routing.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/URLEncodedForm.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Validation.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/WebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOWebSocket.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/TemplateKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Multipart.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOSHA1/include/CNIOSHA1.h /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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/include/c_nio_openssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/CNIOHTTPParser.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.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
/Users/hannh/Documents/MyGitHub/ChartsTest2/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ViewPortJob.o : /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/Legend.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/MarkerImage.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/Range.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/AxisBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/ComponentBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Fill.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Platform.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/Description.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/IMarker.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Transformer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Renderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Animation/Animator.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Filters/DataApproximator.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/XAxis.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/YAxis.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ChartUtils.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/Highlight.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/MarkerView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/PieChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/LineChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/RadarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/LegendEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Supporting\ Files/Charts.h /Users/hannh/Documents/MyGitHub/ChartsTest2/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Users/hannh/Documents/MyGitHub/ChartsTest2/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ViewPortJob~partial.swiftmodule : /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/Legend.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/MarkerImage.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/Range.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/AxisBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/ComponentBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Fill.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Platform.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/Description.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/IMarker.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Transformer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Renderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Animation/Animator.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Filters/DataApproximator.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/XAxis.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/YAxis.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ChartUtils.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/Highlight.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/MarkerView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/PieChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/LineChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/RadarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/LegendEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Supporting\ Files/Charts.h /Users/hannh/Documents/MyGitHub/ChartsTest2/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Users/hannh/Documents/MyGitHub/ChartsTest2/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ViewPortJob~partial.swiftdoc : /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/Legend.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/MarkerImage.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/Range.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/AxisBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/ComponentBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Fill.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Platform.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/Description.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/IMarker.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/Transformer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Renderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Animation/Animator.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Filters/DataApproximator.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/XAxis.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/YAxis.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/ChartUtils.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Highlight/Highlight.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/MarkerView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/PieChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/LineChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/BarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/RadarChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Charts/Components/LegendEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/hannh/Documents/MyGitHub/ChartsTest2/Charts/Source/Supporting\ Files/Charts.h /Users/hannh/Documents/MyGitHub/ChartsTest2/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap
D
/++ This is a submodule of $(MREF mir,ndslice). Field is a type with `opIndex(ptrdiff_t index)` primitive. An iterator can be created on top of a field using $(SUBREF iterator, FieldIterator). An ndslice can be created on top of a field using $(SUBREF slice, slicedField). $(BOOKTABLE $(H2 Fields), $(TR $(TH Field Name) $(TH Used By)) $(T2 BitpackField, $(SUBREF topology, bitpack)) $(T2 BitwiseField, $(SUBREF topology, bitwise)) $(T2 LinspaceField, $(SUBREF topology, linspace)) $(T2 MagicField, $(SUBREF topology, magic)) $(T2 MapField, $(SUBREF topology, map)) $(T2 ndIotaField, $(SUBREF topology, ndiota)) $(T2 RepeatField, $(SUBREF topology, repeat)) ) License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0). Copyright: Copyright © 2016-, Ilya Yaroshenko Authors: Ilya Yaroshenko Macros: SUBREF = $(REF_ALTTEXT $(TT $2), $2, mir, ndslice, $1)$(NBSP) T2=$(TR $(TDNW $(LREF $1)) $(TD $+)) +/ module mir.ndslice.field; import std.traits; import mir.internal.utility: Iota; import mir.math.common: optmath; import mir.ndslice.internal; @optmath: auto MapField__map(Field, alias fun, alias fun1)(ref MapField!(Field, fun) f) { import mir.functional: pipe; return MapField!(Field, pipe!(fun, fun1))(f._field); } /++ `MapField` is used by $(SUBREF topology, map). +/ struct MapField(Field, alias fun) { @optmath: /// Field _field; /++ User defined constructor used by $(LREF mapField). +/ static alias __map(alias fun1) = MapField__map!(Field, fun, fun1); auto ref opIndex(T...)(auto ref T index) { import mir.functional: RefTuple, unref; static if (is(typeof(_field[index]) : RefTuple!K, K...)) { import mir.ndslice.field: _iotaArgs; auto t = _field[index]; return mixin("fun(" ~ _iotaArgs!(K.length, "t.expand[", "].unref, ") ~ ")"); } else return fun(_field[index]); } auto length()() @property { return _field.length; } auto shape()() @property { return _field.shape; } auto elemenstCount()() @property { return _field.elemenstCount; } } /++ Creates a mapped field. Uses `__map` if possible. +/ auto mapField(alias fun, Field)(Field field) { static if (__traits(hasMember, Field, "__map")) return Field.__map!fun(field); else return MapField!(Field, fun)(field); } /++ `RepeatField` is used by $(SUBREF topology, repeat). +/ struct RepeatField(T) { @optmath: static if (is(T == class) || is(T == interface) || is(T : Unqual!T) && is(Unqual!T : T)) /// alias UT = Unqual!T; else /// alias UT = T; /// UT _value; auto ref T opIndex()(ptrdiff_t) { return cast(T) _value; } } /++ `BitwiseField` is used by $(SUBREF topology, bitwise). +/ struct BitwiseField(Field, I = typeof(Field.init[size_t.init])) if (isUnsigned!I) { @optmath: import core.bitop: bsr; package alias E = I; package enum shift = bsr(I.sizeof) + 3; package enum mask = (1 << shift) - 1; /// Field _field; bool opIndex()(size_t index) { return ((_field[index >>> shift] & (I(1) << (index & mask)))) != 0; } bool opIndexAssign()(bool value, size_t index) { auto m = I(1) << (index & mask); index >>= shift; Unqual!I e = _field[index]; if (value) e |= m; else e &= ~m; _field[index] = e; return value; } } /// version(mir_test) unittest { import mir.ndslice.iterator: FieldIterator; ushort[10] data; auto f = FieldIterator!(BitwiseField!(ushort*))(0, BitwiseField!(ushort*)(data.ptr)); f[123] = true; f++; assert(f[122]); } /++ `BitpackField` is used by $(SUBREF topology, bitpack). +/ struct BitpackField(Field, uint pack, I = typeof(Field.init[size_t.init])) if (isUnsigned!I) { //static assert(); @optmath: package alias E = I; package enum mask = (I(1) << pack) - 1; package enum bits = I.sizeof * 8; /// Field _field; I opIndex()(size_t index) { index *= pack; size_t start = index % bits; index /= bits; auto ret = (_field[index] >>> start) & mask; static if (bits % pack) { sizediff_t end = start - (bits - pack); if (end > 0) ret ^= cast(I)(_field[index + 1] << (bits - end)) >>> (bits - pack); } return cast(I) ret; } I opIndexAssign()(I value, size_t index) { assert(cast(Unsigned!I)value <= mask); index *= pack; size_t start = index % bits; index /= bits; _field[index] = cast(I)((_field[index] & ~(mask << start)) ^ (value << start)); static if (bits % pack) { sizediff_t end = start - (bits - pack); if (end > 0) _field[index + 1] = cast(I)((_field[index + 1] & ~((I(1) << end) - 1)) ^ (value >>> (pack - end))); } return value; } } /// unittest { import mir.ndslice.iterator: FieldIterator; ushort[10] data; auto f = FieldIterator!(BitpackField!(ushort*, 6))(0, BitpackField!(ushort*, 6)(data.ptr)); f[0] = cast(ushort) 31; f[1] = cast(ushort) 13; f[2] = cast(ushort) 8; f[3] = cast(ushort) 43; f[4] = cast(ushort) 28; f[5] = cast(ushort) 63; f[6] = cast(ushort) 39; f[7] = cast(ushort) 23; f[8] = cast(ushort) 44; assert(f[0] == 31); assert(f[1] == 13); assert(f[2] == 8); assert(f[3] == 43); assert(f[4] == 28); assert(f[5] == 63); assert(f[6] == 39); assert(f[7] == 23); assert(f[8] == 44); assert(f[9] == 0); assert(f[10] == 0); assert(f[11] == 0); } unittest { import mir.ndslice.slice; import mir.ndslice.topology; import mir.ndslice.sorting; uint[2] data; auto packed = data[].sliced.bitpack!18; assert(packed.length == 3); packed[0] = 5; packed[1] = 3; packed[2] = 2; packed.sort; assert(packed[0] == 2); assert(packed[1] == 3); assert(packed[2] == 5); } /++ `ndIotaField` is used by $(SUBREF topology, ndiota). +/ struct ndIotaField(size_t N) if (N) { @optmath: /// size_t[N - 1] _lengths; size_t[N] opIndex()(size_t index) const { size_t[N] indexes; foreach_reverse (i; Iota!(N - 1)) { indexes[i + 1] = index % _lengths[i]; index /= _lengths[i]; } indexes[0] = index; return indexes; } } /++ `LinspaceField` is used by $(SUBREF topology, linspace). +/ struct LinspaceField(T) { /// size_t _length; /// T _start = cast(T) 0, _stop = cast(T) 0; // no fastmath /// T opIndex()(sizediff_t index) { sizediff_t d = _length - 1; auto v = typeof(T.init.re)(d - index); auto w = typeof(T.init.re)(index); v /= d; w /= d; auto a = v * _start; auto b = w * _stop; return a + b; } @optmath: /// size_t length()() @property { return _length; } /// size_t[1] shape(size_t dimension = 0)() @property @nogc if (dimension == 0) { return [_length]; } } /++ Magic square field. +/ struct MagicField() { @optmath: /++ Magic Square size. Should be even. +/ size_t _n; /// size_t length(size_t dimension = 0)() @property if(dimension <= 2) { return _n * _n; } /// size_t[1] shape()() @property @nogc { return [_n * _n]; } /// size_t opIndex()(size_t index) { auto d = index / _n; auto m = index % _n; if (_n & 1) { //d = _n - 1 - d; // MATLAB synchronization //index = d * _n + m; // ditto auto r = (index + 1 - d + (_n - 3) / 2) % _n; auto c = (_n * _n - index + 2 * d) % _n; return r * _n + c + 1; } else if ((_n & 2) == 0) { auto a = (d + 1) & 2; auto b = (m + 1) & 2; return a != b ? index + 1: _n * _n - index; } else { auto n = _n / 2 ; size_t shift; ptrdiff_t q; ptrdiff_t p = m - n; if (p >= 0) { m = p; shift = n * n; auto mul = m <= n / 2 + 1; q = d - n; if (q >= 0) { d = q; mul = !mul; } if (mul) { shift *= 2; } } else { auto mul = m < n / 2; q = d - n; if (q >= 0) { d = q; mul = !mul; } if (d == n / 2 && (m == 0 || m == n / 2)) { mul = !mul; } if (mul) { shift = n * n * 3; } } index = d * n + m; auto r = (index + 1 - d + (n - 3) / 2) % n; auto c = (n * n - index + 2 * d) % n; return r * n + c + 1 + shift; } } }
D
/** * Generate Mach-O object files * * Compiler implementation of the * $(LINK2 https://www.dlang.org, D programming language). * * Copyright: Copyright (C) 2009-2023 by The D Language Foundation, All Rights Reserved * Authors: $(LINK2 https://www.digitalmars.com, Walter Bright) * License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/machobj.d, backend/machobj.d) */ module dmd.backend.machobj; import core.stdc.ctype; import core.stdc.stdint; import core.stdc.stdio; import core.stdc.stdlib; import core.stdc.string; import dmd.backend.barray; import dmd.backend.cc; import dmd.backend.cdef; import dmd.backend.code; import dmd.backend.code_x86; import dmd.backend.mem; import dmd.backend.aarray; import dmd.backend.dlist; import dmd.backend.el; import dmd.backend.global; import dmd.backend.obj; import dmd.backend.oper; import dmd.backend.ty; import dmd.backend.type; import dmd.common.outbuffer; extern (C++): nothrow: @safe: alias _compare_fp_t = extern(C) nothrow int function(const void*, const void*); extern(C) void qsort(void* base, size_t nmemb, size_t size, _compare_fp_t compar); import dmd.backend.dwarf; import dmd.backend.mach; alias nlist = dmd.backend.mach.nlist; // avoid conflict with dmd.backend.dlist.nlist /**************************************** * Sort the relocation entry buffer. * put before nothrow because qsort was not marked nothrow until version 2.086 */ extern (C) { @trusted private int mach_rel_fp(scope const(void*) e1, scope const(void*) e2) { Relocation *r1 = cast(Relocation *)e1; Relocation *r2 = cast(Relocation *)e2; return cast(int)(r1.offset - r2.offset); } } @trusted void mach_relsort(OutBuffer *buf) { qsort(buf.buf, buf.length() / Relocation.sizeof, Relocation.sizeof, &mach_rel_fp); } // for x86_64 enum { X86_64_RELOC_UNSIGNED = 0, X86_64_RELOC_SIGNED = 1, X86_64_RELOC_BRANCH = 2, X86_64_RELOC_GOT_LOAD = 3, X86_64_RELOC_GOT = 4, X86_64_RELOC_SUBTRACTOR = 5, X86_64_RELOC_SIGNED_1 = 6, X86_64_RELOC_SIGNED_2 = 7, X86_64_RELOC_SIGNED_4 = 8, X86_64_RELOC_TLV = 9, // for thread local variables } private extern (D) __gshared OutBuffer *fobjbuf; enum DEST_LEN = (IDMAX + IDOHD + 1); public import dmd.backend.dwarfdbginf : except_table_seg, eh_frame_seg; /****************************************** */ /// Returns: a reference to the global offset table @trusted Symbol* MachObj_getGOTsym() { __gshared Symbol *GOTsym; if (!GOTsym) { GOTsym = symbol_name("_GLOBAL_OFFSET_TABLE_",SC.global,tspvoid); } return GOTsym; } void MachObj_refGOTsym() { assert(0); } // The object file is built is several separate pieces // String Table - String table for all other names private extern (D) __gshared OutBuffer *symtab_strings; // Section Headers __gshared OutBuffer *SECbuf; // Buffer to build section table in @trusted section* SecHdrTab() { return cast(section *)SECbuf.buf; } @trusted section_64* SecHdrTab64() { return cast(section_64 *)SECbuf.buf; } __gshared { // The relocation for text and data seems to get lost. // Try matching the order gcc output them // This means defining the sections and then removing them if they are // not used. private int section_cnt; // Number of sections in table enum SEC_TAB_INIT = 16; // Initial number of sections in buffer enum SEC_TAB_INC = 4; // Number of sections to increment buffer by enum SYM_TAB_INIT = 100; // Initial number of symbol entries in buffer enum SYM_TAB_INC = 50; // Number of symbols to increment buffer by /* Three symbol tables, because the different types of symbols * are grouped into 3 different types (and a 4th for comdef's). */ private OutBuffer *local_symbuf; private OutBuffer *public_symbuf; private OutBuffer *extern_symbuf; } @trusted private void reset_symbols(OutBuffer *buf) { Symbol **p = cast(Symbol **)buf.buf; const size_t n = buf.length() / (Symbol *).sizeof; for (size_t i = 0; i < n; ++i) symbol_reset(p[i]); } __gshared { struct Comdef { Symbol *sym; targ_size_t size; int count; } private OutBuffer *comdef_symbuf; // Comdef's are stored here private OutBuffer *indirectsymbuf1; // indirect symbol table of Symbol*'s private int jumpTableSeg; // segment index for __jump_table private OutBuffer *indirectsymbuf2; // indirect symbol table of Symbol*'s private int pointersSeg; // segment index for __pointers /* If an MachObj_external_def() happens, set this to the string index, * to be added last to the symbol table. * Obviously, there can be only one. */ private IDXSTR extdef; } static if (0) { enum { STI_FILE = 1, // Where file symbol table entry is STI_TEXT = 2, STI_DATA = 3, STI_BSS = 4, STI_GCC = 5, // Where "gcc2_compiled" symbol is */ STI_RODAT = 6, // Symbol for readonly data STI_COM = 8, } } // Each compiler segment is a section // Predefined compiler segments CODE,DATA,CDATA,UDATA map to indexes // into SegData[] // New compiler segments are added to end. /****************************** * Returns !=0 if this segment is a code segment. */ @trusted int mach_seg_data_isCode(const ref seg_data sd) { // The codegen assumes that code.data references are indirect, // but when CDATA is treated as code reftoident will emit a direct // relocation. if (&sd == SegData[CDATA]) return false; if (I64) { //printf("SDshtidx = %d, x%x\n", SDshtidx, SecHdrTab64[sd.SDshtidx].flags); return strcmp(SecHdrTab64[sd.SDshtidx].segname.ptr, "__TEXT") == 0; } else { //printf("SDshtidx = %d, x%x\n", SDshtidx, SecHdrTab[sd.SDshtidx].flags); return strcmp(SecHdrTab[sd.SDshtidx].segname.ptr, "__TEXT") == 0; } } __gshared { extern Rarray!(seg_data*) SegData; /** * Section index for the __thread_vars/__tls_data section. * * This section is used for the variable symbol for TLS variables. */ private extern (D) int seg_tlsseg = UNKNOWN; /** * Section index for the __thread_bss section. * * This section is used for the data symbol ($tlv$init) for TLS variables * without an initializer. */ private extern (D) int seg_tlsseg_bss = UNKNOWN; /** * Section index for the __thread_data section. * * This section is used for the data symbol ($tlv$init) for TLS variables * with an initializer. */ int seg_tlsseg_data = UNKNOWN; int seg_cstring = UNKNOWN; // __cstring section int seg_mod_init_func = UNKNOWN; // __mod_init_func section int seg_mod_term_func = UNKNOWN; // __mod_term_func section int seg_deh_eh = UNKNOWN; // __deh_eh section int seg_textcoal_nt = UNKNOWN; int seg_tlscoal_nt = UNKNOWN; int seg_datacoal_nt = UNKNOWN; } /******************************************************* * Because the Mach-O relocations cannot be computed until after * all the segments are written out, and we need more information * than the Mach-O relocations provide, make our own relocation * type. Later, translate to Mach-O relocation structure. */ enum { RELaddr = 0, // straight address RELrel = 1, // relative to location to be fixed up } struct Relocation { // Relocations are attached to the struct seg_data they refer to targ_size_t offset; // location in segment to be fixed up Symbol *funcsym; // function in which offset lies, if any Symbol *targsym; // if !=null, then location is to be fixed up // to address of this symbol uint targseg; // if !=0, then location is to be fixed up // to address of start of this segment ubyte rtype; // RELaddr or RELrel ubyte flag; // 1: emit SUBTRACTOR/UNSIGNED pair short val; // 0, -1, -2, -4 } /******************************* * Output a string into a string table * Input: * strtab = string table for entry * str = string to add * * Returns index into the specified string table. */ @trusted IDXSTR MachObj_addstr(OutBuffer *strtab, const(char)* str) { //printf("MachObj_addstr(strtab = %p str = '%s')\n",strtab,str); IDXSTR idx = cast(IDXSTR)strtab.length(); // remember starting offset strtab.writeStringz(str); //printf("\tidx %d, new size %d\n",idx,strtab.length()); return idx; } /******************************* * Output a mangled string into the symbol string table * Input: * str = string to add * * Returns index into the table. */ @trusted private IDXSTR mach_addmangled(Symbol *s) { //printf("mach_addmangled(%s)\n", s.Sident); char[DEST_LEN] dest = void; char *destr; const(char)* name; IDXSTR namidx; namidx = cast(IDXSTR)symtab_strings.length(); destr = obj_mangle2(s, dest.ptr); name = destr; if (CPP && name[0] == '_' && name[1] == '_') { if (strncmp(name,"__ct__",6) == 0) name += 4; static if (0) { switch(name[2]) { case 'c': if (strncmp(name,"__ct__",6) == 0) name += 4; break; case 'd': if (strcmp(name,"__dl__FvP") == 0) name = "__builtin_delete"; break; case 'v': //if (strcmp(name,"__vec_delete__FvPiUIPi") == 0) //name = "__builtin_vec_del"; //else //if (strcmp(name,"__vn__FPUI") == 0) //name = "__builtin_vec_new"; break; case 'n': if (strcmp(name,"__nw__FPUI") == 0) name = "__builtin_new"; break; default: break; } } } else if (tyfunc(s.ty()) && s.Sfunc && s.Sfunc.Fredirect) name = s.Sfunc.Fredirect; symtab_strings.writeStringz(name); if (destr != dest.ptr) // if we resized result mem_free(destr); //dbg_printf("\telf_addmagled symtab_strings %s namidx %d len %d size %d\n",name, namidx,len,symtab_strings.length()); return namidx; } /************************** * Ouput read only data and generate a symbol for it. * */ Symbol * MachObj_sym_cdata(tym_t ty,char *p,int len) { Symbol *s; static if (0) { if (I64) { alignOffset(DATA, tysize(ty)); s = symboldata(Offset(DATA), ty); SegData[DATA].SDbuf.write(p,len); s.Sseg = DATA; s.Soffset = Offset(DATA); // Remember its offset into DATA section Offset(DATA) += len; s.Sfl = /*(config.flags3 & CFG3pic) ? FLgotoff :*/ FLextern; return s; } } //printf("MachObj_sym_cdata(ty = %x, p = %x, len = %d, Offset(CDATA) = %x)\n", ty, p, len, Offset(CDATA)); alignOffset(CDATA, tysize(ty)); s = symboldata(Offset(CDATA), ty); s.Sseg = CDATA; //MachObj_pubdef(CDATA, s, Offset(CDATA)); MachObj_bytes(CDATA, Offset(CDATA), len, p); s.Sfl = /*(config.flags3 & CFG3pic) ? FLgotoff :*/ FLextern; return s; } /************************** * Ouput read only data for data * */ @trusted int MachObj_data_readonly(char *p, int len, int *pseg) { int oldoff = cast(int)Offset(CDATA); SegData[CDATA].SDbuf.reserve(len); SegData[CDATA].SDbuf.writen(p,len); Offset(CDATA) += len; *pseg = CDATA; return oldoff; } @trusted int MachObj_data_readonly(char *p, int len) { int pseg; return MachObj_data_readonly(p, len, &pseg); } /***************************** * Get segment for readonly string literals. * The linker will pool strings in this section. * Params: * sz = number of bytes per character (1, 2, or 4) * Returns: * segment index */ @trusted int MachObj_string_literal_segment(uint sz) { if (sz == 1) return getsegment2(seg_cstring, "__cstring", "__TEXT", 0, S_CSTRING_LITERALS); return CDATA; // no special handling for other wstring, dstring; use __const } /****************************** * Perform initialization that applies to all .o output files. * Called before any other obj_xxx routines */ @trusted Obj MachObj_init(OutBuffer *objbuf, const(char)* filename, const(char)* csegname) { //printf("MachObj_init()\n"); Obj obj = cast(Obj)mem_calloc(__traits(classInstanceSize, Obj)); cseg = CODE; fobjbuf = objbuf; seg_tlsseg = UNKNOWN; seg_tlsseg_bss = UNKNOWN; seg_tlsseg_data = UNKNOWN; seg_cstring = UNKNOWN; seg_mod_init_func = UNKNOWN; seg_mod_term_func = UNKNOWN; seg_deh_eh = UNKNOWN; seg_textcoal_nt = UNKNOWN; seg_tlscoal_nt = UNKNOWN; seg_datacoal_nt = UNKNOWN; // Initialize buffers if (symtab_strings) symtab_strings.setsize(1); else { symtab_strings = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!symtab_strings) err_nomem(); symtab_strings.reserve(2048); symtab_strings.writeByte(0); } if (!local_symbuf) { local_symbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!local_symbuf) err_nomem(); local_symbuf.reserve((Symbol *).sizeof * SYM_TAB_INIT); } local_symbuf.reset(); if (public_symbuf) { reset_symbols(public_symbuf); public_symbuf.reset(); } else { public_symbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!public_symbuf) err_nomem(); public_symbuf.reserve((Symbol *).sizeof * SYM_TAB_INIT); } if (extern_symbuf) { reset_symbols(extern_symbuf); extern_symbuf.reset(); } else { extern_symbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!extern_symbuf) err_nomem(); extern_symbuf.reserve((Symbol *).sizeof * SYM_TAB_INIT); } if (!comdef_symbuf) { comdef_symbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!comdef_symbuf) err_nomem(); comdef_symbuf.reserve((Symbol *).sizeof * SYM_TAB_INIT); } comdef_symbuf.reset(); extdef = 0; if (indirectsymbuf1) indirectsymbuf1.reset(); jumpTableSeg = 0; if (indirectsymbuf2) indirectsymbuf2.reset(); pointersSeg = 0; // Initialize segments for CODE, DATA, UDATA and CDATA size_t struct_section_size = I64 ? section_64.sizeof : section.sizeof; if (SECbuf) { SECbuf.setsize(cast(uint)struct_section_size); } else { SECbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!SECbuf) err_nomem(); SECbuf.reserve(cast(uint)(SEC_TAB_INIT * struct_section_size)); // Ignore the first section - section numbers start at 1 SECbuf.writezeros(cast(uint)struct_section_size); } section_cnt = 1; SegData.reset(); // recycle memory SegData.push(); // element 0 is reserved int align_ = I64 ? 4 : 2; // align to 16 bytes for floating point MachObj_getsegment("__text", "__TEXT", 2, S_REGULAR | S_ATTR_PURE_INSTRUCTIONS | S_ATTR_SOME_INSTRUCTIONS); MachObj_getsegment("__data", "__DATA", align_, S_REGULAR); // DATA MachObj_getsegment("__const", "__TEXT", 2, S_REGULAR); // CDATA MachObj_getsegment("__bss", "__DATA", 4, S_ZEROFILL); // UDATA MachObj_getsegment("__const", "__DATA", align_, S_REGULAR); // CDATAREL dwarf_initfile(filename); return obj; } /************************** * Initialize the start of object output for this particular .o file. * * Input: * filename: Name of source file * csegname: User specified default code segment name */ @trusted void MachObj_initfile(const(char)* filename, const(char)* csegname, const(char)* modname) { //dbg_printf("MachObj_initfile(filename = %s, modname = %s)\n",filename,modname); if (config.fulltypes) dwarf_initmodule(filename, modname); } /************************************ * Patch pseg/offset by adding in the vmaddr difference from * pseg/offset to start of seg. */ @trusted int32_t *patchAddr(int seg, targ_size_t offset) { return cast(int32_t *)(fobjbuf.buf + SecHdrTab[SegData[seg].SDshtidx].offset + offset); } @trusted int32_t *patchAddr64(int seg, targ_size_t offset) { return cast(int32_t *)(fobjbuf.buf + SecHdrTab64[SegData[seg].SDshtidx].offset + offset); } @trusted void patch(seg_data *pseg, targ_size_t offset, int seg, targ_size_t value) { //printf("patch(offset = x%04x, seg = %d, value = x%llx)\n", cast(uint)offset, seg, value); if (I64) { int32_t *p = cast(int32_t *)(fobjbuf.buf + SecHdrTab64[pseg.SDshtidx].offset + offset); static if (0) { printf("\taddr1 = x%llx\n\taddr2 = x%llx\n\t*p = x%llx\n\tdelta = x%llx\n", SecHdrTab64[pseg.SDshtidx].addr, SecHdrTab64[SegData[seg].SDshtidx].addr, *p, SecHdrTab64[SegData[seg].SDshtidx].addr - (SecHdrTab64[pseg.SDshtidx].addr + offset)); } *p += SecHdrTab64[SegData[seg].SDshtidx].addr - (SecHdrTab64[pseg.SDshtidx].addr - value); } else { int32_t *p = cast(int32_t *)(fobjbuf.buf + SecHdrTab[pseg.SDshtidx].offset + offset); static if (0) { printf("\taddr1 = x%x\n\taddr2 = x%x\n\t*p = x%x\n\tdelta = x%x\n", SecHdrTab[pseg.SDshtidx].addr, SecHdrTab[SegData[seg].SDshtidx].addr, *p, SecHdrTab[SegData[seg].SDshtidx].addr - (SecHdrTab[pseg.SDshtidx].addr + offset)); } *p += SecHdrTab[SegData[seg].SDshtidx].addr - (SecHdrTab[pseg.SDshtidx].addr - value); } } /*************************** * Number symbols so they are * ordered as locals, public and then extern/comdef */ @trusted void mach_numbersyms() { //printf("mach_numbersyms()\n"); int n = 0; int dim; dim = cast(int)(local_symbuf.length() / (Symbol *).sizeof); for (int i = 0; i < dim; i++) { Symbol *s = (cast(Symbol **)local_symbuf.buf)[i]; s.Sxtrnnum = n; n++; } dim = cast(int)(public_symbuf.length() / (Symbol *).sizeof); for (int i = 0; i < dim; i++) { Symbol *s = (cast(Symbol **)public_symbuf.buf)[i]; s.Sxtrnnum = n; n++; } dim = cast(int)(extern_symbuf.length() / (Symbol *).sizeof); for (int i = 0; i < dim; i++) { Symbol *s = (cast(Symbol **)extern_symbuf.buf)[i]; s.Sxtrnnum = n; n++; } dim = cast(int)(comdef_symbuf.length() / Comdef.sizeof); for (int i = 0; i < dim; i++) { Comdef *c = (cast(Comdef *)comdef_symbuf.buf) + i; c.sym.Sxtrnnum = n; n++; } } /*************************** * Fixup and terminate object file. */ @trusted void MachObj_termfile() { //dbg_printf("MachObj_termfile\n"); if (configv.addlinenumbers) { dwarf_termmodule(); } } /********************************* * Terminate package. */ @trusted void MachObj_term(const(char)* objfilename) { //printf("MachObj_term()\n"); outfixlist(); // backpatches if (configv.addlinenumbers) { dwarf_termfile(); } /* Write out the object file in the following order: * header * commands * segment_command * { sections } * symtab_command * dysymtab_command * { segment contents } * { relocations } * symbol table * string table * indirect symbol table */ uint foffset; uint headersize; uint sizeofcmds; // Write out the bytes for the header if (I64) { mach_header_64 header = void; header.magic = MH_MAGIC_64; header.cputype = CPU_TYPE_X86_64; header.cpusubtype = CPU_SUBTYPE_I386_ALL; header.filetype = MH_OBJECT; header.ncmds = 3; header.sizeofcmds = cast(uint)(segment_command_64.sizeof + (section_cnt - 1) * section_64.sizeof + symtab_command.sizeof + dysymtab_command.sizeof); header.flags = MH_SUBSECTIONS_VIA_SYMBOLS; header.reserved = 0; fobjbuf.write(&header, header.sizeof); foffset = header.sizeof; // start after header headersize = header.sizeof; sizeofcmds = header.sizeofcmds; // Write the actual data later fobjbuf.writezeros(header.sizeofcmds); foffset += header.sizeofcmds; } else { mach_header header = void; header.magic = MH_MAGIC; header.cputype = CPU_TYPE_I386; header.cpusubtype = CPU_SUBTYPE_I386_ALL; header.filetype = MH_OBJECT; header.ncmds = 3; header.sizeofcmds = cast(uint)(segment_command.sizeof + (section_cnt - 1) * section.sizeof + symtab_command.sizeof + dysymtab_command.sizeof); header.flags = MH_SUBSECTIONS_VIA_SYMBOLS; fobjbuf.write(&header, header.sizeof); foffset = header.sizeof; // start after header headersize = header.sizeof; sizeofcmds = header.sizeofcmds; // Write the actual data later fobjbuf.writezeros(header.sizeofcmds); foffset += header.sizeofcmds; } segment_command segment_cmd = void; segment_command_64 segment_cmd64 = void; symtab_command symtab_cmd = void; dysymtab_command dysymtab_cmd = void; memset(&segment_cmd, 0, segment_cmd.sizeof); memset(&segment_cmd64, 0, segment_cmd64.sizeof); memset(&symtab_cmd, 0, symtab_cmd.sizeof); memset(&dysymtab_cmd, 0, dysymtab_cmd.sizeof); if (I64) { segment_cmd64.cmd = LC_SEGMENT_64; segment_cmd64.cmdsize = cast(uint)(segment_cmd64.sizeof + (section_cnt - 1) * section_64.sizeof); segment_cmd64.nsects = section_cnt - 1; segment_cmd64.maxprot = 7; segment_cmd64.initprot = 7; } else { segment_cmd.cmd = LC_SEGMENT; segment_cmd.cmdsize = cast(uint)(segment_cmd.sizeof + (section_cnt - 1) * section.sizeof); segment_cmd.nsects = section_cnt - 1; segment_cmd.maxprot = 7; segment_cmd.initprot = 7; } symtab_cmd.cmd = LC_SYMTAB; symtab_cmd.cmdsize = symtab_cmd.sizeof; dysymtab_cmd.cmd = LC_DYSYMTAB; dysymtab_cmd.cmdsize = dysymtab_cmd.sizeof; /* If a __pointers section was emitted, need to set the .reserved1 * field to the symbol index in the indirect symbol table of the * start of the __pointers symbols. */ if (pointersSeg) { seg_data *pseg = SegData[pointersSeg]; if (I64) { section_64 *psechdr = &SecHdrTab64[pseg.SDshtidx]; // corresponding section psechdr.reserved1 = cast(uint)(indirectsymbuf1 ? indirectsymbuf1.length() / (Symbol *).sizeof : 0); } else { section *psechdr = &SecHdrTab[pseg.SDshtidx]; // corresponding section psechdr.reserved1 = cast(uint)(indirectsymbuf1 ? indirectsymbuf1.length() / (Symbol *).sizeof : 0); } } // Walk through sections determining size and file offsets // // First output individual section data associate with program // code and data // foffset = elf_align(I64 ? 8 : 4, foffset); if (I64) segment_cmd64.fileoff = foffset; else segment_cmd.fileoff = foffset; uint vmaddr = 0; //printf("Setup offsets and sizes foffset %d\n\tsection_cnt %d, SegData.length %d\n",foffset,section_cnt,SegData.length); // Zero filled segments go at the end, so go through segments twice for (int i = 0; i < 2; i++) { for (int seg = 1; seg < SegData.length; seg++) { seg_data *pseg = SegData[seg]; if (I64) { section_64 *psechdr = &SecHdrTab64[pseg.SDshtidx]; // corresponding section // Do zero-fill the second time through this loop if (i ^ (psechdr.flags == S_ZEROFILL || psechdr.flags == S_THREAD_LOCAL_ZEROFILL)) continue; int align_ = 1 << psechdr._align; while (psechdr._align > 0 && align_ < pseg.SDalignment) { psechdr._align += 1; align_ <<= 1; } foffset = elf_align(align_, foffset); vmaddr = (vmaddr + align_ - 1) & ~(align_ - 1); if (psechdr.flags == S_ZEROFILL || psechdr.flags == S_THREAD_LOCAL_ZEROFILL) { psechdr.offset = 0; psechdr.size = pseg.SDoffset; // accumulated size } else { psechdr.offset = foffset; psechdr.size = 0; //printf("\tsection name %s,", psechdr.sectname); if (pseg.SDbuf && pseg.SDbuf.length()) { //printf("\tsize %d\n", pseg.SDbuf.length()); psechdr.size = pseg.SDbuf.length(); fobjbuf.write(pseg.SDbuf.buf, cast(uint)psechdr.size); foffset += psechdr.size; } } psechdr.addr = vmaddr; vmaddr += psechdr.size; //printf(" assigned offset %d, size %d\n", foffset, psechdr.sh_size); } else { section *psechdr = &SecHdrTab[pseg.SDshtidx]; // corresponding section // Do zero-fill the second time through this loop if (i ^ (psechdr.flags == S_ZEROFILL || psechdr.flags == S_THREAD_LOCAL_ZEROFILL)) continue; int align_ = 1 << psechdr._align; while (psechdr._align > 0 && align_ < pseg.SDalignment) { psechdr._align += 1; align_ <<= 1; } foffset = elf_align(align_, foffset); vmaddr = (vmaddr + align_ - 1) & ~(align_ - 1); if (psechdr.flags == S_ZEROFILL || psechdr.flags == S_THREAD_LOCAL_ZEROFILL) { psechdr.offset = 0; psechdr.size = cast(uint)pseg.SDoffset; // accumulated size } else { psechdr.offset = foffset; psechdr.size = 0; //printf("\tsection name %s,", psechdr.sectname); if (pseg.SDbuf && pseg.SDbuf.length()) { //printf("\tsize %d\n", pseg.SDbuf.length()); psechdr.size = cast(uint)pseg.SDbuf.length(); fobjbuf.write(pseg.SDbuf.buf, psechdr.size); foffset += psechdr.size; } } psechdr.addr = vmaddr; vmaddr += psechdr.size; //printf(" assigned offset %d, size %d\n", foffset, psechdr.sh_size); } } } if (I64) { segment_cmd64.vmsize = vmaddr; segment_cmd64.filesize = foffset - segment_cmd64.fileoff; /* Bugzilla 5331: Apparently having the filesize field greater than the vmsize field is an * error, and is happening sometimes. */ if (segment_cmd64.filesize > vmaddr) segment_cmd64.vmsize = segment_cmd64.filesize; } else { segment_cmd.vmsize = vmaddr; segment_cmd.filesize = foffset - segment_cmd.fileoff; /* Bugzilla 5331: Apparently having the filesize field greater than the vmsize field is an * error, and is happening sometimes. */ if (segment_cmd.filesize > vmaddr) segment_cmd.vmsize = segment_cmd.filesize; } // Put out relocation data mach_numbersyms(); for (int seg = 1; seg < SegData.length; seg++) { seg_data *pseg = SegData[seg]; section *psechdr = null; section_64 *psechdr64 = null; if (I64) { psechdr64 = &SecHdrTab64[pseg.SDshtidx]; // corresponding section //printf("psechdr.addr = x%llx\n", psechdr64.addr); } else { psechdr = &SecHdrTab[pseg.SDshtidx]; // corresponding section //printf("psechdr.addr = x%x\n", psechdr.addr); } foffset = elf_align(I64 ? 8 : 4, foffset); uint reloff = foffset; uint nreloc = 0; if (pseg.SDrel) { Relocation *r = cast(Relocation *)pseg.SDrel.buf; Relocation *rend = cast(Relocation *)(pseg.SDrel.buf + pseg.SDrel.length()); for (; r != rend; r++) { Symbol *s = r.targsym; const(char)* rs = r.rtype == RELaddr ? "addr" : "rel"; //printf("%d:x%04llx : tseg %d tsym %s REL%s\n", seg, r.offset, r.targseg, s ? s.Sident.ptr : "0", rs); relocation_info rel; scattered_relocation_info srel; if (s) { //printf("Relocation\n"); //symbol_print(s); if (r.flag == 1) // emit SUBTRACTOR/UNSIGNED pair { if (I64) { rel.r_type = X86_64_RELOC_SUBTRACTOR; rel.r_address = cast(int)r.offset; rel.r_symbolnum = r.funcsym.Sxtrnnum; rel.r_pcrel = 0; rel.r_length = 3; rel.r_extern = 1; fobjbuf.write(&rel, rel.sizeof); foffset += (rel).sizeof; ++nreloc; rel.r_type = X86_64_RELOC_UNSIGNED; rel.r_symbolnum = s.Sxtrnnum; fobjbuf.write(&rel, rel.sizeof); foffset += rel.sizeof; ++nreloc; // patch with fdesym.Soffset - offset long *p = cast(long *)patchAddr64(seg, r.offset); *p += r.funcsym.Soffset - r.offset; continue; } else { // address = segment + offset int targ_address = cast(int)(SecHdrTab[SegData[s.Sseg].SDshtidx].addr + s.Soffset); int fixup_address = cast(int)(psechdr.addr + r.offset); srel.r_scattered = 1; srel.r_type = GENERIC_RELOC_LOCAL_SECTDIFF; srel.r_address = cast(uint)r.offset; srel.r_pcrel = 0; srel.r_length = 2; srel.r_value = targ_address; fobjbuf.write((&srel)[0 .. 1]); foffset += srel.sizeof; ++nreloc; srel.r_type = GENERIC_RELOC_PAIR; srel.r_address = 0; srel.r_value = fixup_address; fobjbuf.write(&srel, srel.sizeof); foffset += srel.sizeof; ++nreloc; int32_t *p = patchAddr(seg, r.offset); *p += targ_address - fixup_address; continue; } } else if (pseg.isCode()) { if (I64) { rel.r_type = (r.rtype == RELrel) ? X86_64_RELOC_BRANCH : X86_64_RELOC_SIGNED; if (r.val == -1) rel.r_type = X86_64_RELOC_SIGNED_1; else if (r.val == -2) rel.r_type = X86_64_RELOC_SIGNED_2; if (r.val == -4) rel.r_type = X86_64_RELOC_SIGNED_4; if (s.Sclass == SC.extern_ || s.Sclass == SC.comdef || s.Sclass == SC.comdat || s.Sclass == SC.static_ || s.Sclass == SC.global) { if ((s.ty() & mTYLINK) == mTYthread && r.rtype == RELaddr) rel.r_type = X86_64_RELOC_TLV; else if (s.Sfl == FLfunc && s.Sclass == SC.static_ && r.rtype == RELaddr) rel.r_type = X86_64_RELOC_SIGNED; else if ((s.Sfl == FLfunc || s.Sfl == FLextern || s.Sclass == SC.global || s.Sclass == SC.comdat || s.Sclass == SC.comdef) && r.rtype == RELaddr) { rel.r_type = X86_64_RELOC_GOT_LOAD; if (seg == eh_frame_seg || seg == except_table_seg) rel.r_type = X86_64_RELOC_GOT; } rel.r_address = cast(int)r.offset; rel.r_symbolnum = s.Sxtrnnum; rel.r_pcrel = 1; rel.r_length = 2; rel.r_extern = 1; fobjbuf.write(&rel, rel.sizeof); foffset += rel.sizeof; nreloc++; continue; } else { rel.r_address = cast(int)r.offset; rel.r_symbolnum = s.Sseg; rel.r_pcrel = 1; rel.r_length = 2; rel.r_extern = 0; fobjbuf.write(&rel, rel.sizeof); foffset += rel.sizeof; nreloc++; int32_t *p = patchAddr64(seg, r.offset); // Absolute address; add in addr of start of targ seg //printf("*p = x%x, .addr = x%x, Soffset = x%x\n", *p, cast(int)SecHdrTab64[SegData[s.Sseg].SDshtidx].addr, cast(int)s.Soffset); //printf("pseg = x%x, r.offset = x%x\n", cast(int)SecHdrTab64[pseg.SDshtidx].addr, cast(int)r.offset); *p += SecHdrTab64[SegData[s.Sseg].SDshtidx].addr; *p += s.Soffset; *p -= SecHdrTab64[pseg.SDshtidx].addr + r.offset + 4; //patch(pseg, r.offset, s.Sseg, s.Soffset); continue; } } } else { if (s.Sclass == SC.extern_ || s.Sclass == SC.comdef || s.Sclass == SC.comdat) { rel.r_address = cast(int)r.offset; rel.r_symbolnum = s.Sxtrnnum; rel.r_pcrel = 0; rel.r_length = 2; rel.r_extern = 1; rel.r_type = GENERIC_RELOC_VANILLA; if (I64) { rel.r_type = X86_64_RELOC_UNSIGNED; rel.r_length = 3; } fobjbuf.write(&rel, rel.sizeof); foffset += rel.sizeof; nreloc++; continue; } else { rel.r_address = cast(int)r.offset; rel.r_symbolnum = s.Sseg; rel.r_pcrel = 0; rel.r_length = 2; rel.r_extern = 0; rel.r_type = GENERIC_RELOC_VANILLA; if (I64) { rel.r_type = X86_64_RELOC_UNSIGNED; rel.r_length = 3; if (0 && s.Sseg != seg) rel.r_type = X86_64_RELOC_BRANCH; } fobjbuf.write(&rel, rel.sizeof); foffset += rel.sizeof; nreloc++; if (I64) { rel.r_length = 3; int32_t *p = patchAddr64(seg, r.offset); // Absolute address; add in addr of start of targ seg *p += SecHdrTab64[SegData[s.Sseg].SDshtidx].addr + s.Soffset; //patch(pseg, r.offset, s.Sseg, s.Soffset); } else { int32_t *p = patchAddr(seg, r.offset); // Absolute address; add in addr of start of targ seg *p += SecHdrTab[SegData[s.Sseg].SDshtidx].addr + s.Soffset; //patch(pseg, r.offset, s.Sseg, s.Soffset); } continue; } } } else if (r.rtype == RELaddr && pseg.isCode()) { srel.r_scattered = 1; srel.r_address = cast(uint)r.offset; srel.r_length = 2; if (I64) { int32_t *p64 = patchAddr64(seg, r.offset); srel.r_type = X86_64_RELOC_GOT; srel.r_value = cast(int)(SecHdrTab64[SegData[r.targseg].SDshtidx].addr + *p64); //printf("SECTDIFF: x%llx + x%llx = x%x\n", SecHdrTab[SegData[r.targseg].SDshtidx].addr, *p, srel.r_value); } else { int32_t *p = patchAddr(seg, r.offset); srel.r_type = GENERIC_RELOC_LOCAL_SECTDIFF; srel.r_value = SecHdrTab[SegData[r.targseg].SDshtidx].addr + *p; //printf("SECTDIFF: x%x + x%x = x%x\n", SecHdrTab[SegData[r.targseg].SDshtidx].addr, *p, srel.r_value); } srel.r_pcrel = 0; fobjbuf.write(&srel, srel.sizeof); foffset += srel.sizeof; nreloc++; srel.r_address = 0; srel.r_length = 2; if (I64) { srel.r_type = X86_64_RELOC_SIGNED; srel.r_value = cast(int)(SecHdrTab64[pseg.SDshtidx].addr + r.funcsym.Slocalgotoffset + _tysize[TYnptr]); } else { srel.r_type = GENERIC_RELOC_PAIR; if (r.funcsym) srel.r_value = cast(int)(SecHdrTab[pseg.SDshtidx].addr + r.funcsym.Slocalgotoffset + _tysize[TYnptr]); else srel.r_value = cast(int)(psechdr.addr + r.offset); //printf("srel.r_value = x%x, psechdr.addr = x%x, r.offset = x%x\n", //cast(int)srel.r_value, cast(int)psechdr.addr, cast(int)r.offset); } srel.r_pcrel = 0; fobjbuf.write(&srel, srel.sizeof); foffset += srel.sizeof; nreloc++; // Recalc due to possible realloc of fobjbuf.buf if (I64) { int32_t *p64 = patchAddr64(seg, r.offset); //printf("address = x%x, p64 = %p *p64 = x%llx\n", r.offset, p64, *p64); *p64 += SecHdrTab64[SegData[r.targseg].SDshtidx].addr - (SecHdrTab64[pseg.SDshtidx].addr + r.funcsym.Slocalgotoffset + _tysize[TYnptr]); } else { int32_t *p = patchAddr(seg, r.offset); //printf("address = x%x, p = %p *p = x%x\n", r.offset, p, *p); if (r.funcsym) *p += SecHdrTab[SegData[r.targseg].SDshtidx].addr - (SecHdrTab[pseg.SDshtidx].addr + r.funcsym.Slocalgotoffset + _tysize[TYnptr]); else // targ_address - fixup_address *p += SecHdrTab[SegData[r.targseg].SDshtidx].addr - (psechdr.addr + r.offset); } continue; } else { rel.r_address = cast(int)r.offset; rel.r_symbolnum = r.targseg; rel.r_pcrel = (r.rtype == RELaddr) ? 0 : 1; rel.r_length = 2; rel.r_extern = 0; rel.r_type = GENERIC_RELOC_VANILLA; if (I64) { rel.r_type = X86_64_RELOC_UNSIGNED; rel.r_length = 3; if (0 && r.targseg != seg) rel.r_type = X86_64_RELOC_BRANCH; } fobjbuf.write(&rel, rel.sizeof); foffset += rel.sizeof; nreloc++; if (I64) { int32_t *p64 = patchAddr64(seg, r.offset); //long before = *p64; if (rel.r_pcrel) // Relative address patch(pseg, r.offset, r.targseg, 0); else { // Absolute address; add in addr of start of targ seg //printf("*p = x%x, targ.addr = x%x\n", *p64, cast(int)SecHdrTab64[SegData[r.targseg].SDshtidx].addr); //printf("pseg = x%x, r.offset = x%x\n", cast(int)SecHdrTab64[pseg.SDshtidx].addr, cast(int)r.offset); *p64 += SecHdrTab64[SegData[r.targseg].SDshtidx].addr; //*p64 -= SecHdrTab64[pseg.SDshtidx].addr; } //printf("%d:x%04x before = x%04llx, after = x%04llx pcrel = %d\n", seg, r.offset, before, *p64, rel.r_pcrel); } else { int32_t *p = patchAddr(seg, r.offset); //int32_t before = *p; if (rel.r_pcrel) // Relative address patch(pseg, r.offset, r.targseg, 0); else // Absolute address; add in addr of start of targ seg *p += SecHdrTab[SegData[r.targseg].SDshtidx].addr; //printf("%d:x%04x before = x%04x, after = x%04x pcrel = %d\n", seg, r.offset, before, *p, rel.r_pcrel); } continue; } } } if (nreloc) { if (I64) { psechdr64.reloff = reloff; psechdr64.nreloc = nreloc; } else { psechdr.reloff = reloff; psechdr.nreloc = nreloc; } } } // Put out symbol table foffset = elf_align(I64 ? 8 : 4, foffset); symtab_cmd.symoff = foffset; dysymtab_cmd.ilocalsym = 0; dysymtab_cmd.nlocalsym = cast(uint)(local_symbuf.length() / (Symbol *).sizeof); dysymtab_cmd.iextdefsym = dysymtab_cmd.nlocalsym; dysymtab_cmd.nextdefsym = cast(uint)(public_symbuf.length() / (Symbol *).sizeof); dysymtab_cmd.iundefsym = dysymtab_cmd.iextdefsym + dysymtab_cmd.nextdefsym; int nexterns = cast(int)(extern_symbuf.length() / (Symbol *).sizeof); int ncomdefs = cast(int)(comdef_symbuf.length() / Comdef.sizeof); dysymtab_cmd.nundefsym = nexterns + ncomdefs; symtab_cmd.nsyms = dysymtab_cmd.nlocalsym + dysymtab_cmd.nextdefsym + dysymtab_cmd.nundefsym; fobjbuf.reserve(cast(uint)(symtab_cmd.nsyms * (I64 ? nlist_64.sizeof : nlist.sizeof))); for (int i = 0; i < dysymtab_cmd.nlocalsym; i++) { Symbol *s = (cast(Symbol **)local_symbuf.buf)[i]; nlist_64 sym = void; sym.n_strx = mach_addmangled(s); sym.n_type = N_SECT; sym.n_desc = 0; if (s.Sclass == SC.comdat) sym.n_desc = N_WEAK_DEF; sym.n_sect = cast(ubyte)s.Sseg; if (I64) { sym.n_value = s.Soffset + SecHdrTab64[SegData[s.Sseg].SDshtidx].addr; fobjbuf.write(&sym, sym.sizeof); } else { nlist sym32 = void; sym32.n_strx = sym.n_strx; sym32.n_value = cast(uint)(s.Soffset + SecHdrTab[SegData[s.Sseg].SDshtidx].addr); sym32.n_type = sym.n_type; sym32.n_desc = sym.n_desc; sym32.n_sect = sym.n_sect; fobjbuf.write(&sym32, sym32.sizeof); } } for (int i = 0; i < dysymtab_cmd.nextdefsym; i++) { Symbol *s = (cast(Symbol **)public_symbuf.buf)[i]; //printf("Writing public symbol %d:x%x %s\n", s.Sseg, s.Soffset, s.Sident); nlist_64 sym = void; sym.n_strx = mach_addmangled(s); sym.n_type = N_EXT | N_SECT; if (s.Sflags & SFLhidden) sym.n_type |= N_PEXT; // private extern sym.n_desc = 0; if (s.Sclass == SC.comdat) sym.n_desc = N_WEAK_DEF; sym.n_sect = cast(ubyte)s.Sseg; if (I64) { sym.n_value = s.Soffset + SecHdrTab64[SegData[s.Sseg].SDshtidx].addr; fobjbuf.write(&sym, sym.sizeof); } else { nlist sym32 = void; sym32.n_strx = sym.n_strx; sym32.n_value = cast(uint)(s.Soffset + SecHdrTab[SegData[s.Sseg].SDshtidx].addr); sym32.n_type = sym.n_type; sym32.n_desc = sym.n_desc; sym32.n_sect = sym.n_sect; fobjbuf.write(&sym32, sym32.sizeof); } } for (int i = 0; i < nexterns; i++) { Symbol *s = (cast(Symbol **)extern_symbuf.buf)[i]; nlist_64 sym = void; sym.n_strx = mach_addmangled(s); sym.n_value = s.Soffset; sym.n_type = N_EXT | N_UNDF; sym.n_desc = tyfunc(s.ty()) ? REFERENCE_FLAG_UNDEFINED_LAZY : REFERENCE_FLAG_UNDEFINED_NON_LAZY; sym.n_sect = 0; if (I64) fobjbuf.write(&sym, sym.sizeof); else { nlist sym32 = void; sym32.n_strx = sym.n_strx; sym32.n_value = cast(uint)sym.n_value; sym32.n_type = sym.n_type; sym32.n_desc = sym.n_desc; sym32.n_sect = sym.n_sect; fobjbuf.write(&sym32, sym32.sizeof); } } for (int i = 0; i < ncomdefs; i++) { Comdef *c = (cast(Comdef *)comdef_symbuf.buf) + i; nlist_64 sym = void; sym.n_strx = mach_addmangled(c.sym); sym.n_value = c.size * c.count; sym.n_type = N_EXT | N_UNDF; int align_; if (c.size < 2) align_ = 0; // align_ is expressed as power of 2 else if (c.size < 4) align_ = 1; else if (c.size < 8) align_ = 2; else if (c.size < 16) align_ = 3; else align_ = 4; sym.n_desc = cast(ushort)(align_ << 8); sym.n_sect = 0; if (I64) fobjbuf.write(&sym, sym.sizeof); else { nlist sym32 = void; sym32.n_strx = sym.n_strx; sym32.n_value = cast(uint)sym.n_value; sym32.n_type = sym.n_type; sym32.n_desc = sym.n_desc; sym32.n_sect = sym.n_sect; fobjbuf.write(&sym32, sym32.sizeof); } } if (extdef) { nlist_64 sym = void; sym.n_strx = extdef; sym.n_value = 0; sym.n_type = N_EXT | N_UNDF; sym.n_desc = 0; sym.n_sect = 0; if (I64) fobjbuf.write(&sym, sym.sizeof); else { nlist sym32 = void; sym32.n_strx = sym.n_strx; sym32.n_value = cast(uint)sym.n_value; sym32.n_type = sym.n_type; sym32.n_desc = sym.n_desc; sym32.n_sect = sym.n_sect; fobjbuf.write(&sym32, sym32.sizeof); } symtab_cmd.nsyms++; } foffset += symtab_cmd.nsyms * (I64 ? nlist_64.sizeof : nlist.sizeof); // Put out string table foffset = elf_align(I64 ? 8 : 4, foffset); symtab_cmd.stroff = foffset; symtab_cmd.strsize = cast(uint)symtab_strings.length(); fobjbuf.write(symtab_strings.buf, symtab_cmd.strsize); foffset += symtab_cmd.strsize; // Put out indirectsym table, which is in two parts foffset = elf_align(I64 ? 8 : 4, foffset); dysymtab_cmd.indirectsymoff = foffset; if (indirectsymbuf1) { dysymtab_cmd.nindirectsyms += indirectsymbuf1.length() / (Symbol *).sizeof; for (int i = 0; i < dysymtab_cmd.nindirectsyms; i++) { Symbol *s = (cast(Symbol **)indirectsymbuf1.buf)[i]; fobjbuf.write32(s.Sxtrnnum); } } if (indirectsymbuf2) { int n = cast(int)(indirectsymbuf2.length() / (Symbol *).sizeof); dysymtab_cmd.nindirectsyms += n; for (int i = 0; i < n; i++) { Symbol *s = (cast(Symbol **)indirectsymbuf2.buf)[i]; fobjbuf.write32(s.Sxtrnnum); } } foffset += dysymtab_cmd.nindirectsyms * 4; /* The correct offsets are now determined, so * rewind and fix the header. */ fobjbuf.position(headersize, sizeofcmds); if (I64) { fobjbuf.write(&segment_cmd64, segment_cmd64.sizeof); fobjbuf.write(SECbuf.buf + section_64.sizeof, cast(uint)((section_cnt - 1) * section_64.sizeof)); } else { fobjbuf.write(&segment_cmd, segment_cmd.sizeof); fobjbuf.write(SECbuf.buf + section.sizeof, cast(uint)((section_cnt - 1) * section.sizeof)); } fobjbuf.write(&symtab_cmd, symtab_cmd.sizeof); fobjbuf.write(&dysymtab_cmd, dysymtab_cmd.sizeof); fobjbuf.position(foffset, 0); } /***************************** * Line number support. */ /*************************** * Record file and line number at segment and offset. * The actual .debug_line segment is put out by dwarf_termfile(). * Params: * srcpos = source file position * seg = segment it corresponds to * offset = offset within seg */ @trusted void MachObj_linnum(Srcpos srcpos, int seg, targ_size_t offset) { if (srcpos.Slinnum == 0) return; static if (0) { printf("MachObj_linnum(seg=%d, offset=x%lx) ", seg, offset); srcpos.print(""); } if (!srcpos.Sfilename) return; size_t i; seg_data *pseg = SegData[seg]; // Find entry i in SDlinnum_data[] that corresponds to srcpos filename for (i = 0; 1; i++) { if (i == pseg.SDlinnum_data.length) { // Create new entry pseg.SDlinnum_data.push(linnum_data(srcpos.Sfilename)); break; } if (pseg.SDlinnum_data[i].filename == srcpos.Sfilename) break; } linnum_data *ld = &pseg.SDlinnum_data[i]; // printf("i = %d, ld = x%x\n", i, ld); ld.linoff.push(LinOff(srcpos.Slinnum, cast(uint)offset)); } /******************************* * Set start address */ void MachObj_startaddress(Symbol *s) { //dbg_printf("MachObj_startaddress(Symbol *%s)\n",s.Sident); //obj.startaddress = s; } /******************************* * Output library name. */ bool MachObj_includelib(const(char)* name) { //dbg_printf("MachObj_includelib(name *%s)\n",name); return false; } /******************************* * Output linker directive. */ bool MachObj_linkerdirective(const(char)* name) { return false; } /********************************** * Do we allow zero sized objects? */ bool MachObj_allowZeroSize() { return true; } /************************** * Embed string in executable. */ void MachObj_exestr(const(char)* p) { //dbg_printf("MachObj_exestr(char *%s)\n",p); } /************************** * Embed string in obj. */ void MachObj_user(const(char)* p) { //dbg_printf("MachObj_user(char *%s)\n",p); } /******************************* * Output a weak extern record. */ void MachObj_wkext(Symbol *s1,Symbol *s2) { //dbg_printf("MachObj_wkext(Symbol *%s,Symbol *s2)\n",s1.Sident.ptr,s2.Sident.ptr); } /******************************* * Output file name record. * * Currently assumes that obj_filename will not be called * twice for the same file. */ void MachObj_filename(const(char)* modname) { //dbg_printf("MachObj_filename(char *%s)\n",modname); // Not supported by Mach-O } /******************************* * Embed compiler version in .obj file. */ void MachObj_compiler(const(char)* p) { //dbg_printf("MachObj_compiler\n"); MachObj_user(p); } /************************************** * Symbol is the function that calls the static constructors. * Put a pointer to it into a special segment that the startup code * looks at. * Input: * s static constructor function * dtor !=0 if leave space for static destructor * seg 1: user * 2: lib * 3: compiler */ void MachObj_staticctor(Symbol *s, int, int) { MachObj_setModuleCtorDtor(s, true); } /************************************** * Symbol is the function that calls the static destructors. * Put a pointer to it into a special segment that the exit code * looks at. * Input: * s static destructor function */ void MachObj_staticdtor(Symbol *s) { MachObj_setModuleCtorDtor(s, false); } /*************************************** * Stuff pointer to function in its own segment. * Used for static ctor and dtor lists. */ @trusted void MachObj_setModuleCtorDtor(Symbol *sfunc, bool isCtor) { const align_ = I64 ? 3 : 2; // align to _tysize[TYnptr] IDXSEC seg = isCtor ? getsegment2(seg_mod_init_func, "__mod_init_func", "__DATA", align_, S_MOD_INIT_FUNC_POINTERS) : getsegment2(seg_mod_term_func, "__mod_term_func", "__DATA", align_, S_MOD_TERM_FUNC_POINTERS); const int relflags = I64 ? CFoff | CFoffset64 : CFoff; const int sz = MachObj_reftoident(seg, SegData[seg].SDoffset, sfunc, 0, relflags); SegData[seg].SDoffset += sz; } /*************************************** * Stuff the following data (instance of struct FuncTable) in a separate segment: * pointer to function * pointer to ehsym * length of function */ @trusted void MachObj_ehtables(Symbol *sfunc,uint size,Symbol *ehsym) { //dbg_printf("MachObj_ehtables(%s) \n",sfunc.Sident.ptr); /* BUG: this should go into a COMDAT if sfunc is in a COMDAT * otherwise the duplicates aren't removed. */ int align_ = I64 ? 3 : 2; // align to _tysize[TYnptr] // The size is (FuncTable).sizeof in deh2.d int seg = getsegment2(seg_deh_eh, "__deh_eh", "__DATA", align_, S_REGULAR); OutBuffer *buf = SegData[seg].SDbuf; if (I64) { MachObj_reftoident(seg, buf.length(), sfunc, 0, CFoff | CFoffset64); MachObj_reftoident(seg, buf.length(), ehsym, 0, CFoff | CFoffset64); buf.write64(sfunc.Ssize); } else { MachObj_reftoident(seg, buf.length(), sfunc, 0, CFoff); MachObj_reftoident(seg, buf.length(), ehsym, 0, CFoff); buf.write32(cast(int)sfunc.Ssize); } } /********************************************* * Put out symbols that define the beginning/end of the .deh_eh section. * This gets called if this is the module with "main()" in it. */ void MachObj_ehsections() { //printf("MachObj_ehsections()\n"); } /********************************* * Setup for Symbol s to go into a COMDAT segment. * Output (if s is a function): * cseg segment index of new current code segment * Offset(cseg) starting offset in cseg * Returns: * "segment index" of COMDAT */ int MachObj_comdatsize(Symbol *s, targ_size_t symsize) { return MachObj_comdat(s); } @trusted int MachObj_comdat(Symbol *s) { const(char)* sectname; const(char)* segname; int align_; int flags; //printf("MachObj_comdat(Symbol* %s)\n",s.Sident.ptr); //symbol_print(s); symbol_debug(s); if (tyfunc(s.ty())) { sectname = "__textcoal_nt"; segname = "__TEXT"; align_ = 2; // 4 byte alignment flags = S_COALESCED | S_ATTR_PURE_INSTRUCTIONS | S_ATTR_SOME_INSTRUCTIONS; s.Sseg = getsegment2(seg_textcoal_nt, sectname, segname, align_, flags); } else if ((s.ty() & mTYLINK) == mTYweakLinkage) { s.Sfl = FLdata; align_ = 4; // 16 byte alignment MachObj_data_start(s, 1 << align_, s.Sseg); } else if ((s.ty() & mTYLINK) == mTYthread) { s.Sfl = FLtlsdata; align_ = 4; if (I64) s.Sseg = objmod.tlsseg().SDseg; else s.Sseg = getsegment2(seg_tlscoal_nt, "__tlscoal_nt", "__DATA", align_, S_COALESCED); MachObj_data_start(s, 1 << align_, s.Sseg); } else { s.Sfl = FLdata; sectname = "__datacoal_nt"; segname = "__DATA"; align_ = 4; // 16 byte alignment s.Sseg = getsegment2(seg_datacoal_nt, sectname, segname, align_, S_COALESCED); MachObj_data_start(s, 1 << align_, s.Sseg); } // find or create new segment if (s.Salignment > (1 << align_)) SegData[s.Sseg].SDalignment = s.Salignment; s.Soffset = SegData[s.Sseg].SDoffset; if (s.Sfl == FLdata || s.Sfl == FLtlsdata) { // Code symbols are 'published' by MachObj_func_start() MachObj_pubdef(s.Sseg,s,s.Soffset); searchfixlist(s); // backpatch any refs to this symbol } return s.Sseg; } int MachObj_readonly_comdat(Symbol *s) { assert(0); } /*********************************** * Returns: * jump table segment for function s */ @trusted int MachObj_jmpTableSegment(Symbol *s) { return (config.flags & CFGromable) ? cseg : CDATA; } /********************************** * Get segment. * Input: * align_ segment alignment as power of 2 * Returns: * segment index of found or newly created segment */ @trusted int MachObj_getsegment(const(char)* sectname, const(char)* segname, int align_, int flags) { assert(strlen(sectname) <= 16); assert(strlen(segname) <= 16); for (int seg = 1; seg < cast(int)SegData.length; seg++) { seg_data *pseg = SegData[seg]; if (I64) { if (strncmp(SecHdrTab64[pseg.SDshtidx].sectname.ptr, sectname, 16) == 0 && strncmp(SecHdrTab64[pseg.SDshtidx].segname.ptr, segname, 16) == 0) return seg; // return existing segment } else { if (strncmp(SecHdrTab[pseg.SDshtidx].sectname.ptr, sectname, 16) == 0 && strncmp(SecHdrTab[pseg.SDshtidx].segname.ptr, segname, 16) == 0) return seg; // return existing segment } } const int seg = cast(int)SegData.length; seg_data** ppseg = SegData.push(); seg_data* pseg = *ppseg; if (pseg) { OutBuffer *b1 = pseg.SDbuf; OutBuffer *b2 = pseg.SDrel; memset(pseg, 0, seg_data.sizeof); if (b1) b1.reset(); if (b2) b2.reset(); pseg.SDbuf = b1; pseg.SDrel = b2; } else { pseg = cast(seg_data *)mem_calloc(seg_data.sizeof); SegData[seg] = pseg; } if (!pseg.SDbuf) { if (flags != S_ZEROFILL && flags != S_THREAD_LOCAL_ZEROFILL) { pseg.SDbuf = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!pseg.SDbuf) err_nomem(); pseg.SDbuf.reserve(4096); } } //printf("\tNew segment - %d size %d\n", seg,SegData[seg].SDbuf); pseg.SDseg = seg; pseg.SDoffset = 0; if (I64) { section_64 *sec = cast(section_64 *) SECbuf.writezeros(section_64.sizeof); strncpy(sec.sectname.ptr, sectname, 16); strncpy(sec.segname.ptr, segname, 16); sec._align = align_; sec.flags = flags; } else { section *sec = cast(section *) SECbuf.writezeros(section.sizeof); strncpy(sec.sectname.ptr, sectname, 16); strncpy(sec.segname.ptr, segname, 16); sec._align = align_; sec.flags = flags; } pseg.SDshtidx = section_cnt++; pseg.SDaranges_offset = 0; pseg.SDlinnum_data.reset(); //printf("SegData.length = %d\n", SegData.length); return seg; } /******************************** * Memoize seg index. * Params: * seg = value to memoize if it is not already set * sectname = section name * segname = segment name * align_ = section alignment * flags = S_???? * Returns: * seg index */ int getsegment2(ref int seg, const(char)* sectname, const(char)* segname, int align_, int flags) { if (seg == UNKNOWN) seg = MachObj_getsegment(sectname, segname, align_, flags); return seg; } /********************************** * Reset code seg to existing seg. * Used after a COMDAT for a function is done. */ @trusted void MachObj_setcodeseg(int seg) { cseg = seg; } /******************************** * Define a new code segment. * Input: * name name of segment, if null then revert to default * suffix 0 use name as is * 1 append "_TEXT" to name * Output: * cseg segment index of new current code segment * Offset(cseg) starting offset in cseg * Returns: * segment index of newly created code segment */ int MachObj_codeseg(const char *name,int suffix) { //dbg_printf("MachObj_codeseg(%s,%x)\n",name,suffix); static if (0) { const(char)* sfx = (suffix) ? "_TEXT" : null; if (!name) // returning to default code segment { if (cseg != CODE) // not the current default { SegData[cseg].SDoffset = Offset(cseg); Offset(cseg) = SegData[CODE].SDoffset; cseg = CODE; } return cseg; } int seg = ElfObj_getsegment(name, sfx, SHT_PROGDEF, SHF_ALLOC|SHF_EXECINSTR, 4); // find or create code segment cseg = seg; // new code segment index Offset(cseg) = 0; return seg; } else { return 0; } } /********************************* * Define segments for Thread Local Storage for 32bit. * Output: * seg_tlsseg set to segment number for TLS segment. * Returns: * segment for TLS segment */ @trusted seg_data *MachObj_tlsseg() { //printf("MachObj_tlsseg(\n"); int seg = I32 ? getsegment2(seg_tlsseg, "__tls_data", "__DATA", 2, S_REGULAR) : getsegment2(seg_tlsseg, "__thread_vars", "__DATA", 0, S_THREAD_LOCAL_VARIABLES); return SegData[seg]; } /********************************* * Define segments for Thread Local Storage. * Output: * seg_tlsseg_bss set to segment number for TLS segment. * Returns: * segment for TLS segment */ @trusted seg_data *MachObj_tlsseg_bss() { if (I32) { /* Because DMD does not support native tls for Mach-O 32bit, * it's easier to support if we have all the tls in one segment. */ return MachObj_tlsseg(); } else { // The alignment should actually be alignment of the largest variable in // the section, but this seems to work anyway. int seg = getsegment2(seg_tlsseg_bss, "__thread_bss", "__DATA", 3, S_THREAD_LOCAL_ZEROFILL); return SegData[seg]; } } /********************************* * Define segments for Thread Local Storage data. * Output: * seg_tlsseg_data set to segment number for TLS data segment. * Returns: * segment for TLS data segment */ @trusted seg_data *MachObj_tlsseg_data() { //printf("MachObj_tlsseg_data(\n"); assert(I64); // The alignment should actually be alignment of the largest variable in // the section, but this seems to work anyway. int seg = getsegment2(seg_tlsseg_data, "__thread_data", "__DATA", 4, S_THREAD_LOCAL_REGULAR); return SegData[seg]; } /******************************* * Output an alias definition record. */ void MachObj_alias(const(char)* n1,const(char)* n2) { //printf("MachObj_alias(%s,%s)\n",n1,n2); assert(0); static if (0) { uint len; char *buffer; buffer = cast(char *) alloca(strlen(n1) + strlen(n2) + 2 * ONS_OHD); len = obj_namestring(buffer,n1); len += obj_namestring(buffer + len,n2); objrecord(ALIAS,buffer,len); } } @trusted private extern (D) char* unsstr (uint value) { __gshared char[64] buffer = void; snprintf (buffer.ptr, buffer.length, "%d", value); return buffer.ptr; } /******************************* * Mangle a name. * Returns: * mangled name */ @trusted private extern (D) char *obj_mangle2(Symbol *s,char *dest) { size_t len; const(char)* name; //printf("MachObj_mangle(s = %p, '%s'), mangle = x%x\n",s,s.Sident.ptr,type_mangle(s.Stype)); symbol_debug(s); assert(dest); // C++ name mangling is handled by front end name = &s.Sident[0]; len = strlen(name); // # of bytes in name //dbg_printf("len %d\n",len); switch (type_mangle(s.Stype)) { case mTYman_pas: // if upper case case mTYman_for: if (len >= DEST_LEN) dest = cast(char *)mem_malloc(len + 1); memcpy(dest,name,len + 1); // copy in name and ending 0 for (char *p = dest; *p; p++) *p = cast(char)toupper(*p); break; case mTYman_std: { bool cond = (tyfunc(s.ty()) && !variadic(s.Stype)); if (cond) { char *pstr = unsstr(type_paramsize(s.Stype)); size_t pstrlen = strlen(pstr); size_t destlen = len + 1 + pstrlen + 1; if (destlen > DEST_LEN) dest = cast(char *)mem_malloc(destlen); memcpy(dest,name,len); dest[len] = '@'; memcpy(dest + 1 + len, pstr, pstrlen + 1); break; } goto case; } case mTYman_sys: case 0: if (len >= DEST_LEN) dest = cast(char *)mem_malloc(len + 1); memcpy(dest,name,len+1);// copy in name and trailing 0 break; case mTYman_c: if (s.Sflags & SFLnounderscore) goto case 0; goto case; case mTYman_cpp: case mTYman_d: if (len >= DEST_LEN - 1) dest = cast(char *)mem_malloc(1 + len + 1); dest[0] = '_'; memcpy(dest + 1,name,len+1);// copy in name and trailing 0 break; default: debug { printf("mangling %x\n",type_mangle(s.Stype)); symbol_print(s); } printf("%d\n", type_mangle(s.Stype)); assert(0); } //dbg_printf("\t %s\n",dest); return dest; } /******************************* * Export a function name. */ void MachObj_export_symbol(Symbol *s,uint argsize) { //dbg_printf("MachObj_export_symbol(%s,%d)\n",s.Sident.ptr,argsize); } /******************************* * Update data information about symbol * align for output and assign segment * if not already specified. * * Input: * sdata data symbol * datasize output size * seg default seg if not known * Returns: * actual seg */ @trusted int MachObj_data_start(Symbol *sdata, targ_size_t datasize, int seg) { targ_size_t alignbytes; //printf("MachObj_data_start(%s,size %llu,seg %d)\n",sdata.Sident.ptr,datasize,seg); //symbol_print(sdata); assert(sdata.Sseg); if (sdata.Sseg == UNKNOWN) // if we don't know then there sdata.Sseg = seg; // wasn't any segment override else seg = sdata.Sseg; targ_size_t offset = Offset(seg); if (sdata.Salignment > 0) { if (SegData[seg].SDalignment < sdata.Salignment) SegData[seg].SDalignment = sdata.Salignment; alignbytes = ((offset + sdata.Salignment - 1) & ~(sdata.Salignment - 1)) - offset; } else alignbytes = _align(datasize, offset) - offset; if (alignbytes) MachObj_lidata(seg, offset, alignbytes); sdata.Soffset = offset + alignbytes; return seg; } /******************************* * Update function info before codgen * * If code for this function is in a different segment * than the current default in cseg, switch cseg to new segment. */ @trusted void MachObj_func_start(Symbol *sfunc) { //printf("MachObj_func_start(%s)\n",sfunc.Sident.ptr); symbol_debug(sfunc); assert(sfunc.Sseg); if (sfunc.Sseg == UNKNOWN) sfunc.Sseg = CODE; //printf("sfunc.Sseg %d CODE %d cseg %d Coffset x%x\n",sfunc.Sseg,CODE,cseg,Offset(cseg)); cseg = sfunc.Sseg; assert(cseg == CODE || cseg > UDATA); MachObj_pubdef(cseg, sfunc, Offset(cseg)); sfunc.Soffset = Offset(cseg); dwarf_func_start(sfunc); } /******************************* * Update function info after codgen */ @trusted void MachObj_func_term(Symbol *sfunc) { //dbg_printf("MachObj_func_term(%s) offset %x, Coffset %x symidx %d\n", // sfunc.Sident.ptr, sfunc.Soffset,Offset(cseg),sfunc.Sxtrnnum); static if (0) { // fill in the function size if (I64) SymbolTable64[sfunc.Sxtrnnum].st_size = Offset(cseg) - sfunc.Soffset; else SymbolTable[sfunc.Sxtrnnum].st_size = Offset(cseg) - sfunc.Soffset; } dwarf_func_term(sfunc); } /******************************** * Output a public definition. * Input: * seg = segment index that symbol is defined in * s . symbol * offset = offset of name within segment */ void MachObj_pubdefsize(int seg, Symbol *s, targ_size_t offset, targ_size_t symsize) { return MachObj_pubdef(seg, s, offset); } @trusted void MachObj_pubdef(int seg, Symbol *s, targ_size_t offset) { //printf("MachObj_pubdef(%d:x%x s=%p, %s)\n", seg, offset, s, s.Sident.ptr); //symbol_print(s); symbol_debug(s); s.Soffset = offset; s.Sseg = seg; switch (s.Sclass) { case SC.global: case SC.inline: public_symbuf.write((&s)[0 .. 1]); break; case SC.comdat: case SC.comdef: public_symbuf.write((&s)[0 .. 1]); break; case SC.static_: if (s.Sflags & SFLhidden) { public_symbuf.write((&s)[0 .. 1]); break; } goto default; default: local_symbuf.write((&s)[0 .. 1]); break; } //printf("%p\n", *cast(void**)public_symbuf.buf); s.Sxtrnnum = 1; } /******************************* * Output an external symbol for name. * Input: * name Name to do EXTDEF on * (Not to be mangled) * Returns: * Symbol table index of the definition * NOTE: Numbers will not be linear. */ @trusted int MachObj_external_def(const(char)* name) { //printf("MachObj_external_def('%s')\n",name); assert(name); assert(extdef == 0); extdef = MachObj_addstr(symtab_strings, name); return 0; } /******************************* * Output an external for existing symbol. * Input: * s Symbol to do EXTDEF on * (Name is to be mangled) * Returns: * Symbol table index of the definition * NOTE: Numbers will not be linear. */ @trusted int MachObj_external(Symbol *s) { //printf("MachObj_external('%s') %x\n",s.Sident.ptr,s.Svalue); symbol_debug(s); extern_symbuf.write((&s)[0 .. 1]); s.Sxtrnnum = 1; return 0; } /******************************* * Output a common block definition. * Input: * p . external identifier * size size in bytes of each elem * count number of elems * Returns: * Symbol table index for symbol */ @trusted int MachObj_common_block(Symbol *s,targ_size_t size,targ_size_t count) { //printf("MachObj_common_block('%s', size=%d, count=%d)\n",s.Sident.ptr,size,count); symbol_debug(s); // can't have code or thread local comdef's assert(!(s.ty() & (mTYcs | mTYthread))); // support for hidden comdefs not implemented assert(!(s.Sflags & SFLhidden)); Comdef comdef = void; comdef.sym = s; comdef.size = size; comdef.count = cast(int)count; comdef_symbuf.write(&comdef, (comdef).sizeof); s.Sxtrnnum = 1; if (!s.Sseg) s.Sseg = UDATA; return 0; // should return void } int MachObj_common_block(Symbol *s, int flag, targ_size_t size, targ_size_t count) { return MachObj_common_block(s, size, count); } /*************************************** * Append an iterated data block of 0s. * (uninitialized data only) */ void MachObj_write_zeros(seg_data *pseg, targ_size_t count) { MachObj_lidata(pseg.SDseg, pseg.SDoffset, count); } /*************************************** * Output an iterated data block of 0s. * * For boundary alignment and initialization */ @trusted void MachObj_lidata(int seg,targ_size_t offset,targ_size_t count) { //printf("MachObj_lidata(%d,%x,%d)\n",seg,offset,count); size_t idx = SegData[seg].SDshtidx; const flags = (I64 ? SecHdrTab64[idx].flags : SecHdrTab[idx].flags); if (flags == S_ZEROFILL || flags == S_THREAD_LOCAL_ZEROFILL) { // Use SDoffset to record size of bss section SegData[seg].SDoffset += count; } else { MachObj_bytes(seg, offset, cast(uint)count, null); } } /*********************************** * Append byte to segment. */ void MachObj_write_byte(seg_data *pseg, uint byte_) { MachObj_byte(pseg.SDseg, pseg.SDoffset, byte_); } /************************************ * Output byte to object file. */ @trusted void MachObj_byte(int seg,targ_size_t offset,uint byte_) { OutBuffer *buf = SegData[seg].SDbuf; int save = cast(int)buf.length(); //dbg_printf("MachObj_byte(seg=%d, offset=x%lx, byte_=x%x)\n",seg,offset,byte_); buf.setsize(cast(uint)offset); buf.writeByte(byte_); if (save > offset+1) buf.setsize(save); else SegData[seg].SDoffset = offset+1; //dbg_printf("\tsize now %d\n",buf.length()); } /*********************************** * Append bytes to segment. */ void MachObj_write_bytes(seg_data *pseg, uint nbytes, const(void)* p) { MachObj_bytes(pseg.SDseg, pseg.SDoffset, nbytes, p); } /************************************ * Output bytes to object file. * Returns: * nbytes */ @trusted uint MachObj_bytes(int seg, targ_size_t offset, uint nbytes, const(void)* p) { static if (0) { if (!(seg >= 0 && seg < SegData.length)) { printf("MachObj_bytes: seg = %d, SegData.length = %d\n", seg, SegData.length); *cast(char*)0=0; } } assert(seg >= 0 && seg < SegData.length); OutBuffer *buf = SegData[seg].SDbuf; if (buf == null) { //dbg_printf("MachObj_bytes(seg=%d, offset=x%llx, nbytes=%d, p=%p)\n", seg, offset, nbytes, p); //raise(SIGSEGV); assert(buf != null); } int save = cast(int)buf.length(); //dbg_printf("MachObj_bytes(seg=%d, offset=x%lx, nbytes=%d, p=x%x)\n", //seg,offset,nbytes,p); buf.position(cast(size_t)offset, nbytes); if (p) buf.write(p, nbytes); else // Zero out the bytes buf.writezeros(nbytes); if (save > offset+nbytes) buf.setsize(save); else SegData[seg].SDoffset = offset+nbytes; return nbytes; } /********************************************* * Add a relocation entry for seg/offset. */ @trusted void MachObj_addrel(int seg, targ_size_t offset, Symbol *targsym, uint targseg, int rtype, int val = 0) { Relocation rel = void; rel.offset = offset; rel.targsym = targsym; rel.targseg = targseg; rel.rtype = cast(ubyte)rtype; rel.flag = 0; rel.funcsym = funcsym_p; rel.val = cast(short)val; seg_data *pseg = SegData[seg]; if (!pseg.SDrel) { pseg.SDrel = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!pseg.SDrel) err_nomem(); } pseg.SDrel.write(&rel, rel.sizeof); } /******************************* * Refer to address that is in the data segment. * Input: * seg:offset = the address being fixed up * val = displacement from start of target segment * targetdatum = target segment number (DATA, CDATA or UDATA, etc.) * flags = CFoff, CFseg * Example: * int *abc = &def[3]; * to allocate storage: * MachObj_reftodatseg(DATA,offset,3 * (int *).sizeof,UDATA); */ @trusted void MachObj_reftodatseg(int seg,targ_size_t offset,targ_size_t val, uint targetdatum,int flags) { OutBuffer *buf = SegData[seg].SDbuf; int save = cast(int)buf.length(); buf.setsize(cast(uint)offset); static if (0) { printf("MachObj_reftodatseg(seg:offset=%d:x%llx, val=x%llx, targetdatum %x, flags %x )\n", seg,offset,val,targetdatum,flags); } assert(seg != 0); if (SegData[seg].isCode() && SegData[targetdatum].isCode()) { assert(0); } MachObj_addrel(seg, offset, null, targetdatum, RELaddr); if (I64) { if (flags & CFoffset64) { buf.write64(val); if (save > offset + 8) buf.setsize(save); return; } } buf.write32(cast(int)val); if (save > offset + 4) buf.setsize(save); } /******************************* * Refer to address that is in the current function code (funcsym_p). * Only offsets are output, regardless of the memory model. * Used to put values in switch address tables. * Input: * seg = where the address is going (CODE or DATA) * offset = offset within seg * val = displacement from start of this module */ @trusted void MachObj_reftocodeseg(int seg,targ_size_t offset,targ_size_t val) { //printf("MachObj_reftocodeseg(seg=%d, offset=x%x, val=x%x )\n",seg,cast(uint)offset,cast(uint)val); assert(seg > 0); OutBuffer *buf = SegData[seg].SDbuf; int save = cast(int)buf.length(); buf.setsize(cast(uint)offset); val -= funcsym_p.Soffset; MachObj_addrel(seg, offset, funcsym_p, 0, RELaddr); // if (I64) // buf.write64(val); // else buf.write32(cast(int)val); if (save > offset + 4) buf.setsize(save); } /******************************* * Refer to an identifier. * Input: * seg = where the address is going (CODE or DATA) * offset = offset within seg * s . Symbol table entry for identifier * val = displacement from identifier * flags = CFselfrel: self-relative * CFseg: get segment * CFoff: get offset * CFpc32: [RIP] addressing, val is 0, -1, -2 or -4 * CFoffset64: 8 byte offset for 64 bit builds * Returns: * number of bytes in reference (4 or 8) */ @trusted int MachObj_reftoident(int seg, targ_size_t offset, Symbol *s, targ_size_t val, int flags) { int retsize = (flags & CFoffset64) ? 8 : 4; static if (0) { printf("\nMachObj_reftoident('%s' seg %d, offset x%llx, val x%llx, flags x%x) ", s.Sident.ptr,seg,cast(ulong)offset,cast(ulong)val,flags); CF_print(flags); printf("retsize = %d\n", retsize); //dbg_printf("Sseg = %d, Sxtrnnum = %d\n",s.Sseg,s.Sxtrnnum); symbol_print(s); } assert(seg > 0); if (s.Sclass != SC.locstat && !s.Sxtrnnum) { // It may get defined later as public or local, so defer size_t numbyteswritten = addtofixlist(s, offset, seg, val, flags); assert(numbyteswritten == retsize); } else { if (I64) { //if (s.Sclass != SCcomdat) //val += s.Soffset; int v = 0; if (flags & CFpc32) v = cast(int)val; if (flags & CFselfrel) { MachObj_addrel(seg, offset, s, 0, RELrel, v); } else { MachObj_addrel(seg, offset, s, 0, RELaddr, v); } } else { if (SegData[seg].isCode() && flags & CFselfrel) { if (!jumpTableSeg) { jumpTableSeg = MachObj_getsegment("__jump_table", "__IMPORT", 0, S_SYMBOL_STUBS | S_ATTR_PURE_INSTRUCTIONS | S_ATTR_SOME_INSTRUCTIONS | S_ATTR_SELF_MODIFYING_CODE); } seg_data *pseg = SegData[jumpTableSeg]; if (I64) SecHdrTab64[pseg.SDshtidx].reserved2 = 5; else SecHdrTab[pseg.SDshtidx].reserved2 = 5; if (!indirectsymbuf1) { indirectsymbuf1 = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!indirectsymbuf1) err_nomem(); } else { // Look through indirectsym to see if it is already there int n = cast(int)(indirectsymbuf1.length() / (Symbol *).sizeof); Symbol **psym = cast(Symbol **)indirectsymbuf1.buf; for (int i = 0; i < n; i++) { // Linear search, pretty pathetic if (s == psym[i]) { val = i * 5; goto L1; } } } val = pseg.SDbuf.length(); static immutable char[5] halts = [ 0xF4,0xF4,0xF4,0xF4,0xF4 ]; pseg.SDbuf.write(halts.ptr, 5); // Add symbol s to indirectsymbuf1 indirectsymbuf1.write((&s)[0 .. 1]); L1: val -= offset + 4; MachObj_addrel(seg, offset, null, jumpTableSeg, RELrel); } else if (SegData[seg].isCode() && !(flags & CFindirect) && ((s.Sclass != SC.extern_ && SegData[s.Sseg].isCode()) || s.Sclass == SC.locstat || s.Sclass == SC.static_)) { val += s.Soffset; MachObj_addrel(seg, offset, null, s.Sseg, RELaddr); } else if ((flags & CFindirect) || SegData[seg].isCode() && !tyfunc(s.ty())) { if (!pointersSeg) { pointersSeg = MachObj_getsegment("__pointers", "__IMPORT", 0, S_NON_LAZY_SYMBOL_POINTERS); } seg_data *pseg = SegData[pointersSeg]; if (!indirectsymbuf2) { indirectsymbuf2 = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!indirectsymbuf2) err_nomem(); } else { // Look through indirectsym to see if it is already there int n = cast(int)(indirectsymbuf2.length() / (Symbol *).sizeof); Symbol **psym = cast(Symbol **)indirectsymbuf2.buf; for (int i = 0; i < n; i++) { // Linear search, pretty pathetic if (s == psym[i]) { val = i * 4; goto L2; } } } val = pseg.SDbuf.length(); pseg.SDbuf.writezeros(_tysize[TYnptr]); // Add symbol s to indirectsymbuf2 indirectsymbuf2.write((&s)[0 .. 1]); L2: //printf("MachObj_reftoident: seg = %d, offset = x%x, s = %s, val = x%x, pointersSeg = %d\n", seg, cast(int)offset, s.Sident.ptr, cast(int)val, pointersSeg); if (flags & CFindirect) { Relocation rel = void; rel.offset = offset; rel.targsym = null; rel.targseg = pointersSeg; rel.rtype = RELaddr; rel.flag = 0; rel.funcsym = null; rel.val = 0; seg_data *pseg2 = SegData[seg]; if (!pseg2.SDrel) { pseg2.SDrel = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!pseg2.SDrel) err_nomem(); } pseg2.SDrel.write(&rel, rel.sizeof); } else MachObj_addrel(seg, offset, null, pointersSeg, RELaddr); } else { //val -= s.Soffset; MachObj_addrel(seg, offset, s, 0, RELaddr); } } OutBuffer *buf = SegData[seg].SDbuf; int save = cast(int)buf.length(); buf.position(cast(uint)offset, retsize); //printf("offset = x%llx, val = x%llx\n", offset, val); if (retsize == 8) buf.write64(val); else buf.write32(cast(int)val); if (save > offset + retsize) buf.setsize(save); } return retsize; } /***************************************** * Generate far16 thunk. * Input: * s Symbol to generate a thunk for */ void MachObj_far16thunk(Symbol *s) { //dbg_printf("MachObj_far16thunk('%s')\n", s.Sident.ptr); assert(0); } /************************************** * Mark object file as using floating point. */ void MachObj_fltused() { //dbg_printf("MachObj_fltused()\n"); } /************************************ * Close and delete .OBJ file. */ void machobjfile_delete() { //remove(fobjname); // delete corrupt output file } /********************************** * Terminate. */ void machobjfile_term() { static if(TERMCODE) { mem_free(fobjname); fobjname = null; } } /********************************** * Write to the object file */ /+void objfile_write(FILE *fd, void *buffer, uint len) { fobjbuf.write(buffer, len); }+/ @trusted private extern (D) int elf_align(targ_size_t size, int foffset) { if (size <= 1) return foffset; int offset = cast(int)((foffset + size - 1) & ~(size - 1)); if (offset > foffset) fobjbuf.writezeros(offset - foffset); return offset; } /*************************************** * Stuff pointer to ModuleInfo in its own segment. */ @trusted void MachObj_moduleinfo(Symbol *scc) { int align_ = I64 ? 3 : 2; // align to _tysize[TYnptr] int seg = MachObj_getsegment("__minfodata", "__DATA", align_, S_REGULAR); //printf("MachObj_moduleinfo(%s) seg = %d:x%x\n", scc.Sident.ptr, seg, Offset(seg)); static if (0) { type *t = type_fake(TYint); t.Tmangle = mTYman_c; const len = strlen(scc.Sident.ptr); char *p = cast(char *)malloc(5 + len + 1); if (!p) err_nomem(); strcpy(p, "SUPER"); memcpy(p + 5, scc.Sident.ptr, len); Symbol *s_minfo_beg = symbol_name(p[0 .. len], SC.global, t); MachObj_pubdef(seg, s_minfo_beg, 0); } int flags = CFoff; if (I64) flags |= CFoffset64; SegData[seg].SDoffset += MachObj_reftoident(seg, Offset(seg), scc, 0, flags); } /************************************* */ @trusted void MachObj_gotref(Symbol *s) { //printf("MachObj_gotref(%x '%s', %d)\n",s,s.Sident.ptr, s.Sclass); switch(s.Sclass) { case SC.static_: case SC.locstat: s.Sfl = FLgotoff; break; case SC.extern_: case SC.global: case SC.comdat: case SC.comdef: s.Sfl = FLgot; break; default: break; } } /** * Returns the symbol for the __tlv_bootstrap function. * * This function is used in the implementation of native thread local storage. * It's used as a placeholder in the TLV descriptors. The dynamic linker will * replace the placeholder with a real function at load time. */ @trusted Symbol* MachObj_tlv_bootstrap() { __gshared Symbol* tlv_bootstrap_sym; if (!tlv_bootstrap_sym) tlv_bootstrap_sym = symbol_name("__tlv_bootstrap", SC.extern_, type_fake(TYnfunc)); return tlv_bootstrap_sym; } void MachObj_write_pointerRef(Symbol* s, uint off) { } /****************************************** * Generate fixup specific to .eh_frame and .gcc_except_table sections. * Params: * seg = segment of where to write fixup * offset = offset of where to write fixup * s = fixup is a reference to this Symbol * val = displacement from s * Returns: * number of bytes written at seg:offset */ int mach_dwarf_reftoident(int seg, targ_size_t offset, Symbol *s, targ_size_t val) { //printf("dwarf_reftoident(seg=%d offset=x%x s=%s val=x%x\n", seg, cast(int)offset, s.Sident.ptr, cast(int)val); MachObj_reftoident(seg, offset, s, val + 4, I64 ? CFoff : CFindirect); return 4; } /***************************************** * Generate LSDA and PC_Begin fixups in the __eh_frame segment encoded as DW_EH_PE_pcrel|ptr. * 64 bits * LSDA * [0] address x0071 symbolnum 6 pcrel 0 length 3 extern 1 type 5 RELOC_SUBTRACTOR __Z3foov.eh * [1] address x0071 symbolnum 1 pcrel 0 length 3 extern 1 type 0 RELOC_UNSIGNED GCC_except_table2 * PC_Begin: * [2] address x0060 symbolnum 6 pcrel 0 length 3 extern 1 type 5 RELOC_SUBTRACTOR __Z3foov.eh * [3] address x0060 symbolnum 5 pcrel 0 length 3 extern 1 type 0 RELOC_UNSIGNED __Z3foov * Want the result to be &s - pc * The fixup yields &s - &fdesym + value * Therefore value = &fdesym - pc * which is the same as fdesym.Soffset - offset * 32 bits * LSDA * [6] address x0028 pcrel 0 length 2 value x0 type 4 RELOC_LOCAL_SECTDIFF * [7] address x0000 pcrel 0 length 2 value x1dc type 1 RELOC_PAIR * PC_Begin * [8] address x0013 pcrel 0 length 2 value x228 type 4 RELOC_LOCAL_SECTDIFF * [9] address x0000 pcrel 0 length 2 value x1c7 type 1 RELOC_PAIR * Params: * dfseg = segment of where to write fixup (eh_frame segment) * offset = offset of where to write fixup (eh_frame offset) * s = fixup is a reference to this Symbol (GCC_except_table%d or function_name) * val = displacement from s * fdesym = function_name.eh * Returns: * number of bytes written at seg:offset */ @trusted int dwarf_eh_frame_fixup(int dfseg, targ_size_t offset, Symbol *s, targ_size_t val, Symbol *fdesym) { OutBuffer *buf = SegData[dfseg].SDbuf; assert(offset == buf.length()); assert(fdesym.Sseg == dfseg); if (I64) buf.write64(val); // add in 'value' later else buf.write32(cast(int)val); Relocation rel; rel.offset = offset; rel.targsym = s; rel.targseg = 0; rel.rtype = RELaddr; rel.flag = 1; rel.funcsym = fdesym; rel.val = 0; seg_data *pseg = SegData[dfseg]; if (!pseg.SDrel) { pseg.SDrel = cast(OutBuffer*) calloc(1, OutBuffer.sizeof); if (!pseg.SDrel) err_nomem(); } pseg.SDrel.write(&rel, rel.sizeof); return I64 ? 8 : 4; }
D
module huffman.d; import std.stdio; import std.conv; import std.algorithm; import std.string; import std.math; struct HuffmanTree { private { uint[string] compressTable_; string[uint] decompressTable_; Node top_; File fileToCompress_; File compressedFile_; File decompressedFile_; string fileName_; } public this(string fileName) { fileName_ = fileName; fileToCompress_.open(fileName ~ ".had", "r"); compressedFile_.open(fileName ~ "compressed" ~ ".had", "w+"); decompressedFile_.open(fileName ~ "decompressed.hda", "w"); } public ~this() { auto tables = File("tables.had", "w"); tables.writeln(compressTable_); tables.writeln(decompressTable_); fileToCompress_.close(); compressedFile_.close(); decompressedFile_.close(); } public void setTables(Node top) { compressTable_ = top_.returnTable; foreach(key, value; compressTable_){ decompressTable_[value] = key; } } public void compressFile() { string lines; while(!fileToCompress_.eof()){ lines ~= fileToCompress_.readln(); } auto nodes = searchLetters(lines); top_ = createTree(nodes); top_.setBinaryCodes(); setTables(top_); string compressedText; foreach(letter; lines){ compressedText ~= format("%b", compressTable_[to!string(letter)]); if(compressedText.length >= 8){ compressedFile_.rawWrite([toDecimal(compressedText[0 .. 8])]); compressedText = compressedText[8 .. $]; } } compressedFile_.rawWrite([toDecimal(compressedText[0 .. $])]); } public void decompressFile() { ubyte[1024] buffer; ubyte[] data; while(!compressedFile_.eof()){ data ~= compressedFile_.rawRead(buffer); } writeln(buffer); writeln(data); } } ubyte toDecimal(string number) in { assert(number.length != 0); } body { ubyte result; foreach (i; 0 .. number.length) { if (number[i] == '1') { result += 2 ^^ (number.length - 1 - i); } } return result; } struct Node { private { string value_; uint binaryCode_; uint frequency_; Node* right_; Node* left_; } public this(const uint frequence, string value) { value_ = value; frequency_ = frequence; } public int opCmp(Node another) const { return frequency_ == another.frequency_ ? cmp(value_, another.value_) : frequency_ - another.frequency_ ; } public string toString() const { string result; result ~= "Binary code: " ~ to!string(binaryCode_) ~ "\n"; result ~= "Letter: " ~ value_ ~ "\n"; return result; } public void setBinaryCodes() { if(right_ && left_) { right_.binaryCode_ = binaryCode_; left_.binaryCode_ = binaryCode_; right_.binaryCode_ <<= 1; left_.binaryCode_ <<= 1; right_.binaryCode_ |= 1; right_.setBinaryCodes(); left_.setBinaryCodes(); } } public uint[string] returnTable() const @property { uint[string] result; result[value_] = binaryCode_; if(right_ && left_) { foreach(index, value; left_.returnTable()){ if(index.length==1){ result[index] = value; } } foreach(index, value; right_.returnTable()){ if(index.length==1){ result[index] = value; } } } foreach(index, value; result){ if(index.length != 1){ result.remove(index); } } return result; } } Node[] searchLetters(string text) { uint[char] letters; Node[] result; foreach(character; text){ if(character in letters){ ++letters[character]; } else { letters[character] = 1; } } foreach(index, value; letters){ result ~= Node(value, to!string(index)); } return result; } Node createTree(Node[] nodes) { while(nodes.length > 1) { nodes.sort(); auto newNode = Node((nodes[0].frequency_ + nodes[1].frequency_), (nodes[0].value_ ~ nodes[1].value_)); newNode.left_ = &nodes[0]; newNode.right_ = &nodes[1]; nodes ~= newNode; nodes = nodes[2 .. $]; } return nodes[0]; }
D
/Users/arjunpola/Documents/Swift/Homework9/build/Homework9.build/Debug-iphonesimulator/Homework9Tests.build/Objects-normal/i386/Homework9Tests.o : /Users/arjunpola/Documents/Swift/Homework9/Homework9Tests/Homework9Tests.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/XCTest.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuiteRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuite.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestProbe.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObserver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestLog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCaseRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTextCase+AsynchronousTesting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertionsImpl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCAbstractTest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/module.map /Users/arjunpola/Documents/Swift/Homework9/build/Homework9.build/Debug-iphonesimulator/Homework9Tests.build/Objects-normal/i386/Homework9Tests~partial.swiftmodule : /Users/arjunpola/Documents/Swift/Homework9/Homework9Tests/Homework9Tests.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/XCTest.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuiteRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuite.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestProbe.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObserver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestLog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCaseRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTextCase+AsynchronousTesting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertionsImpl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCAbstractTest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/module.map /Users/arjunpola/Documents/Swift/Homework9/build/Homework9.build/Debug-iphonesimulator/Homework9Tests.build/Objects-normal/i386/Homework9Tests~partial.swiftdoc : /Users/arjunpola/Documents/Swift/Homework9/Homework9Tests/Homework9Tests.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/32/XCTest.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuiteRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuite.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestProbe.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObserver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestLog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCaseRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTextCase+AsynchronousTesting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertionsImpl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCAbstractTest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/module.map
D
func void b_story_cordspost() { var C_NPC gorn; gorn = Hlp_GetNpc(pc_fighter); Npc_ExchangeRoutine(gorn,"GuardNC"); b_exchangeroutine(sld_709_cord,"FMTaken"); b_exchangeroutine(sld_735_soeldner,"FMTaken"); b_exchangeroutine(sld_736_soeldner,"FMTaken"); };
D
/** License: 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. Authors: Alexandru Ermicioi **/ module aermicioi.aedi.storage.locator; import aermicioi.aedi.storage.storage; import aermicioi.aedi.util.typecons : Pair, pair; /** Interface for objects that can serevr Type elements. **/ @safe interface Locator(Type = Object, KeyType = string) { public { /** Get a Type that is associated with key. Params: identity = the element id. Throws: NotFoundException in case if the element wasn't found. Returns: Type element if it is available. **/ Type get(KeyType identity); /** Check if an element is present in Locator by key id. Note: This check should be done for elements that locator actually contains, and not in chained locator. Params: identity = identity of element. Returns: bool true if an element by key is present in Locator. **/ bool has(in KeyType identity) inout; } } /** Exposes the list of locators contained in it. **/ @safe interface AggregateLocator(Type = Object, KeyType = string, LocatorKeyType = KeyType) : Locator!(Type, KeyType) { import std.range.interfaces : InputRange; public { /** Get a specific locator. Params: key = the locator identity. **/ Locator!(Type, KeyType) getLocator(LocatorKeyType key); /** Get all locators in aggregate locator Returns: InputRange!(Tuple!(Locator!(Type, KeyType), LocatorKeyType)) a range of locator => identity **/ InputRange!(Pair!(Locator!(Type, KeyType), LocatorKeyType)) getLocators(); /** Check if aggregate locator contains a specific locator. Params: key = the identity of locator in aggregate locator **/ bool hasLocator(LocatorKeyType key) inout; } } /** Exposes, and allows to set a list of containers into it. **/ @safe interface MutableAggregateLocator(Type = Object, KeyType = string, LocatorKeyType = KeyType) : AggregateLocator!(Type, KeyType, LocatorKeyType), Storage!(Locator!(Type, KeyType), LocatorKeyType) { } /** Given a locator, locates an object and attempts to downcast to T type. See: aermicioi.aedi.storage.wrapper : unwrap for downcasting semantics. Params: locator = the locator that contains the component with id as identity id = identity of object contained in locator Throws: InvalidCastException when actual type of object is not of type that is requested. Returns: Object casted to desired type. **/ @trusted auto ref locate(T)(Locator!(Object, string) locator, string id) { import aermicioi.aedi.storage.wrapper : unwrap; return locator.get(id).unwrap!T; } /** ditto **/ @trusted auto ref locate(T)(Locator!(Object, string) locator) { import std.traits : fullyQualifiedName; string id = typeid(T).toString; if (!locator.has(id)) { id = fullyQualifiedName!T; } return locator.locate!T(id); } /** Mix in locator interface implementation that delegates the logic to decorated container. **/ @safe mixin template LocatorMixin(T : Locator!(W, X), W, X) { mixin LocatorMixin!(W, X); } /** ditto **/ @safe mixin template LocatorMixin(W, X) { /** Get object created by a factory identified by key Params: key = identity of factory Returns: Object **/ W get(X key) in(decorated !is null, "Cannot get component out of decorated component container, when no container to decorate is provided.") { return this.decorated.get(key); } /** Check if an object factory for it exists in container. Params: key = identity of factory Returns: bool **/ bool has(in X key) inout in(decorated !is null, "Cannot check if component is in decorated component container, when no container to decorate is provided.") { return this.decorated_.has(key); } }
D
// Written in the D programming language. /* NYSL Version 0.9982 A. This software is "Everyone'sWare". It means: Anybody who has this software can use it as if he/she is the author. A-1. Freeware. No fee is required. A-2. You can freely redistribute this software. A-3. You can freely modify this software. And the source may be used in any software with no limitation. A-4. When you release a modified version to public, you must publish it with your name. B. The author is not responsible for any kind of damages or loss while using or misusing this software, which is distributed "AS IS". No warranty of any kind is expressed or implied. You use AT YOUR OWN RISK. C. Copyrighted to Kazuki KOMATSU D. Above three clauses are applied both to source and binary form of this software. */ import graphite.twitter; immutable consumerToken = ConsumerToken(".....................", "..........................................."); immutable accessToken = AccessToken(consumerToken, "..................................................", ".............................................");
D
// Issue 2920 - recursive templates blow compiler stack // template_29_B. template foo(uint i) { static if (i > 0) { const uint bar = foo!(i - 1).bar; } else { const uint bar = 1; } } int main() { return foo!(uint.max).bar; }
D
module durge.system.streams; public: import durge.system.streams.crc; import durge.system.streams.deflate; import durge.system.streams.file; import durge.system.streams.inflate; import durge.system.streams.memory; import durge.system.streams.stream;
D
module android.java.java.nio.channels.InterruptedByTimeoutException_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import1 = android.java.java.io.PrintStream_d_interface; import import4 = android.java.java.lang.Class_d_interface; import import3 = android.java.java.lang.StackTraceElement_d_interface; import import2 = android.java.java.io.PrintWriter_d_interface; import import0 = android.java.java.lang.JavaThrowable_d_interface; final class InterruptedByTimeoutException : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import this(arsd.jni.Default); @Import string getMessage(); @Import string getLocalizedMessage(); @Import import0.JavaThrowable getCause(); @Import import0.JavaThrowable initCause(import0.JavaThrowable); @Import @JavaName("toString") string toString_(); override string toString() { return arsd.jni.javaObjectToString(this); } @Import void printStackTrace(); @Import void printStackTrace(import1.PrintStream); @Import void printStackTrace(import2.PrintWriter); @Import import0.JavaThrowable fillInStackTrace(); @Import import3.StackTraceElement[] getStackTrace(); @Import void setStackTrace(import3.StackTraceElement[]); @Import void addSuppressed(import0.JavaThrowable); @Import import0.JavaThrowable[] getSuppressed(); @Import import4.Class getClass(); @Import int hashCode(); @Import bool equals(IJavaObject); @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/nio/channels/InterruptedByTimeoutException;"; }
D
module webtank.ivy.service.backend; import webtank.net.service.json_rpc: JSON_RPCService; class IvyBackendService: JSON_RPCService { import webtank.security.auth.iface.controller: IAuthController; import webtank.security.auth.client.controller: AuthClientController; import webtank.security.right.controller: AccessRightController; import webtank.security.right.remote_source: RightRemoteSource; import webtank.ivy.access_rule_factory: IvyAccessRuleFactory; import webtank.net.service.consts: ServiceRole; import ivy.engine: IvyEngine; import webtank.ivy.engine: WebtankIvyEngine; import std.exception: enforce; IvyEngine _ivyEngine; // Конструктор сервиса с системой прав по-умлочанию this(string serviceName) { // Создаем сервис с удаленной аутентификацией this(serviceName, new AuthClientController(this.config)); // Устанавливаем получение прав с сервиса аутентификации _rights = new AccessRightController( new IvyAccessRuleFactory(this._ivyEngine), new RightRemoteSource(this.config, ServiceRole.auth, "accessRight.list")); } // Конструктор сервиса заданным аутентификатором. Конструктор для использования в наследниках protected this(string serviceName, IAuthController accessController) { enforce(accessController, `Access controller expected`); super(serviceName); // Устанавливаем контроллер аутентификации _accessController = accessController; // Стартуем шаблонизатор для нужд проверки прав _ivyEngine = new WebtankIvyEngine([this.config.fileSystemPaths["siteIvyTemplates"]], this.log); } }
D
/** File handling. Copyright: © 2012 rejectedsoftware e.K. License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file. Authors: Sönke Ludwig */ module dub.internal.vibecompat.core.file; public import dub.internal.vibecompat.inet.url; import dub.internal.vibecompat.core.log; import std.conv; import std.c.stdio; import std.datetime; import std.exception; import std.file; import std.path; static import std.stream; import std.string; import std.utf; /* Add output range support to File */ struct RangeFile { std.stream.File file; void put(in ubyte[] bytes) { file.writeExact(bytes.ptr, bytes.length); } void put(in char[] str) { put(cast(ubyte[])str); } void put(char ch) { put((&ch)[0 .. 1]); } void put(dchar ch) { char[4] chars; put(chars[0 .. encode(chars, ch)]); } ubyte[] readAll() { file.seek(0, std.stream.SeekPos.End); auto sz = file.position; enforce(sz <= size_t.max, "File is too big to read to memory."); file.seek(0, std.stream.SeekPos.Set); auto ret = new ubyte[cast(size_t)sz]; file.readExact(ret.ptr, ret.length); return ret; } void rawRead(ubyte[] dst) { file.readExact(dst.ptr, dst.length); } void write(string str) { put(str); } void close() { file.close(); } void flush() { file.flush(); } @property ulong size() { return file.size; } } /** Opens a file stream with the specified mode. */ RangeFile openFile(Path path, FileMode mode = FileMode.Read) { std.stream.FileMode fmode; final switch(mode){ case FileMode.Read: fmode = std.stream.FileMode.In; break; case FileMode.ReadWrite: fmode = std.stream.FileMode.Out; break; case FileMode.CreateTrunc: fmode = std.stream.FileMode.OutNew; break; case FileMode.Append: fmode = std.stream.FileMode.Append; break; } auto ret = new std.stream.File(path.toNativeString(), fmode); assert(ret.isOpen()); return RangeFile(ret); } /// ditto RangeFile openFile(string path, FileMode mode = FileMode.Read) { return openFile(Path(path), mode); } /** Moves or renames a file. */ void moveFile(Path from, Path to) { moveFile(from.toNativeString(), to.toNativeString()); } /// ditto void moveFile(string from, string to) { std.file.rename(from, to); } /** Copies a file. Note that attributes and time stamps are currently not retained. Params: from = Path of the source file to = Path for the destination file overwrite = If true, any file existing at the destination path will be overwritten. If this is false, an excpetion will be thrown should a file already exist at the destination path. Throws: An Exception if the copy operation fails for some reason. */ void copyFile(Path from, Path to, bool overwrite = false) { if (existsFile(to)) { enforce(overwrite, "Destination file already exists."); // remove file before copy to allow "overwriting" files that are in // use on Linux removeFile(to); } .copy(from.toNativeString(), to.toNativeString()); // try to preserve ownership/permissions in Posix version (Posix) { import core.sys.posix.sys.stat; import core.sys.posix.unistd; import std.utf; auto cspath = toUTFz!(const(char)*)(from.toNativeString()); auto cdpath = toUTFz!(const(char)*)(to.toNativeString()); stat_t st; enforce(stat(cspath, &st) == 0, "Failed to get attributes of source file."); if (chown(cdpath, st.st_uid, st.st_gid) != 0) st.st_mode &= ~(S_ISUID | S_ISGID); chmod(cdpath, st.st_mode); } } /// ditto void copyFile(string from, string to) { copyFile(Path(from), Path(to)); } /** Removes a file */ void removeFile(Path path) { removeFile(path.toNativeString()); } /// ditto void removeFile(string path) { std.file.remove(path); } /** Checks if a file exists */ bool existsFile(Path path) { return existsFile(path.toNativeString()); } /// ditto bool existsFile(string path) { return std.file.exists(path); } /** Stores information about the specified file/directory into 'info' Returns false if the file does not exist. */ FileInfo getFileInfo(Path path) { static if (__VERSION__ >= 2064) auto ent = std.file.DirEntry(path.toNativeString()); else auto ent = std.file.dirEntry(path.toNativeString()); return makeFileInfo(ent); } /// ditto FileInfo getFileInfo(string path) { return getFileInfo(Path(path)); } /** Creates a new directory. */ void createDirectory(Path path) { mkdir(path.toNativeString()); } /// ditto void createDirectory(string path) { createDirectory(Path(path)); } /** Enumerates all files in the specified directory. */ void listDirectory(Path path, scope bool delegate(FileInfo info) del) { foreach( DirEntry ent; dirEntries(path.toNativeString(), SpanMode.shallow) ) if( !del(makeFileInfo(ent)) ) break; } /// ditto void listDirectory(string path, scope bool delegate(FileInfo info) del) { listDirectory(Path(path), del); } /// ditto int delegate(scope int delegate(ref FileInfo)) iterateDirectory(Path path) { int iterator(scope int delegate(ref FileInfo) del){ int ret = 0; listDirectory(path, (fi){ ret = del(fi); return ret == 0; }); return ret; } return &iterator; } /// ditto int delegate(scope int delegate(ref FileInfo)) iterateDirectory(string path) { return iterateDirectory(Path(path)); } /** Returns the current working directory. */ Path getWorkingDirectory() { return Path(std.file.getcwd()); } /** Contains general information about a file. */ struct FileInfo { /// Name of the file (not including the path) string name; /// Size of the file (zero for directories) ulong size; /// Time of the last modification SysTime timeModified; /// Time of creation (not available on all operating systems/file systems) SysTime timeCreated; /// True if this is a symlink to an actual file bool isSymlink; /// True if this is a directory or a symlink pointing to a directory bool isDirectory; } /** Specifies how a file is manipulated on disk. */ enum FileMode { /// The file is opened read-only. Read, /// The file is opened for read-write random access. ReadWrite, /// The file is truncated if it exists and created otherwise and the opened for read-write access. CreateTrunc, /// The file is opened for appending data to it and created if it does not exist. Append } /** Accesses the contents of a file as a stream. */ private FileInfo makeFileInfo(DirEntry ent) { FileInfo ret; ret.name = baseName(ent.name); if( ret.name.length == 0 ) ret.name = ent.name; assert(ret.name.length > 0); ret.isSymlink = ent.isSymlink; try { ret.isDirectory = ent.isDir; ret.size = ent.size; ret.timeModified = ent.timeLastModified; version(Windows) ret.timeCreated = ent.timeCreated; else ret.timeCreated = ent.timeLastModified; } catch (Exception e) { logDiagnostic("Failed to get extended file information for %s: %s", ret.name, e.msg); } return ret; }
D
/***************************************************************************** * * Higgs JavaScript Virtual Machine * * This file is part of the Higgs project. The project is distributed at: * https://github.com/maximecb/Higgs * * Copyright (c) 2012, Maxime Chevalier-Boisvert. All rights reserved. * * This software is licensed under the following license (Modified BSD * License): * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *****************************************************************************/ module runtime.string; import std.stdio; import std.string; import std.conv; import runtime.vm; import runtime.layout; import runtime.gc; immutable uint32 STR_TBL_INIT_SIZE = 16384; immutable uint32 STR_TBL_MAX_LOAD_NUM = 3; immutable uint32 STR_TBL_MAX_LOAD_DEN = 5; /** Extract a D wchar string from a string object */ wstring extractWStr(refptr ptr) { assert ( obj_get_header(ptr) == LAYOUT_STR, "invalid string object" ); auto len = str_get_len(ptr); wchar[] wchars = new wchar[len]; for (uint32 i = 0; i < len; ++i) wchars[i] = str_get_data(ptr, i); return to!wstring(wchars); } /** Extract a D string from a string object */ string extractStr(refptr ptr) { return to!string(extractWStr(ptr)); } /** Compute the hash value for a given string object */ uint32 compStrHash(refptr str) { // TODO: operate on multiple characters at a time, look at Murmur hash auto len = str_get_len(str); uint32 hashCode = 0; for (uint32 i = 0; i < len; ++i) { auto ch = str_get_data(str, i); hashCode = (((hashCode << 8) + ch) & 536870911) % 426870919; } // Store the hash code on the string object str_set_hash(str, hashCode); return hashCode; } /** Compare two string objects for equality by comparing their contents */ bool streq(refptr strA, refptr strB) { auto lenA = str_get_len(strA); auto lenB = str_get_len(strB); if (lenA != lenB) return false; for (uint32 i = 0; i < lenA; ++i) if (str_get_data(strA, i) != str_get_data(strB, i)) return false; return true; } /** Find a string in the string table if duplicate, or add it to the string table */ refptr getTableStr(VM vm, refptr str) { auto strTbl = vm.strTbl; // Get the size of the string table auto tblSize = strtbl_get_cap(strTbl); // Get the hash code from the string object auto hashCode = str_get_hash(str); // Get the hash table index for this hash value auto hashIndex = hashCode & (tblSize - 1); // Until the key is found, or a free slot is encountered while (true) { // Get the string value at this hash slot auto strVal = strtbl_get_str(strTbl, hashIndex); // If we have reached an empty slot if (strVal == null) { // Break out of the loop break; } // Otherwise, if this is the string we want else if (streq(strVal, str) == true) { // Return a reference to the string we found in the table return strVal; } // Move to the next hash table slot hashIndex = (hashIndex + 1) & (tblSize - 1); } // // Hash table updating // // Set the corresponding key and value in the slot strtbl_set_str(strTbl, hashIndex, str); // Get the number of strings and increment it auto numStrings = strtbl_get_num_strs(strTbl); numStrings++; strtbl_set_num_strs(strTbl, numStrings); // Test if resizing of the string table is needed // numStrings > ratio * tblSize // numStrings > num/den * tblSize // numStrings * den > tblSize * num if (numStrings * STR_TBL_MAX_LOAD_DEN > tblSize * STR_TBL_MAX_LOAD_NUM) { // Store the string pointer in a GC root object auto strRoot = GCRoot(vm, str, Type.STRING); // Extend the string table extStrTable(vm, strTbl, tblSize, numStrings); // Restore the string pointer str = strRoot.ptr; } // Return a reference to the string object passed as argument return str; } /** Extend the string table's capacity */ void extStrTable(VM vm, refptr curTbl, uint32 curSize, uint32 numStrings) { // Compute the new table size auto newSize = 2 * curSize; //writefln("extending string table, old size: %s, new size: %s", curSize, newSize); //printInt(curSize); //printInt(newSize); // Allocate a new, larger hash table auto newTbl = strtbl_alloc(vm, newSize); // Set the number of strings stored strtbl_set_num_strs(newTbl, numStrings); // Initialize the string array for (uint32 i = 0; i < newSize; ++i) strtbl_set_str(newTbl, i, null); // For each entry in the current table for (uint32 curIdx = 0; curIdx < curSize; curIdx++) { // Get the value at this hash slot auto slotVal = strtbl_get_str(curTbl, curIdx); // If this slot is empty, skip it if (slotVal == null) continue; // Get the hash code for the value auto valHash = str_get_hash(slotVal); // Get the hash table index for this hash value in the new table auto startHashIndex = valHash & (newSize - 1); auto hashIndex = startHashIndex; // Until a free slot is encountered while (true) { // Get the value at this hash slot auto slotVal2 = strtbl_get_str(newTbl, hashIndex); // If we have reached an empty slot if (slotVal2 == null) { // Set the corresponding key and value in the slot strtbl_set_str(newTbl, hashIndex, slotVal); // Break out of the loop break; } // Move to the next hash table slot hashIndex = (hashIndex + 1) & (newSize - 1); // Ensure that a free slot was found for this key assert ( hashIndex != startHashIndex, "no free slots found in extended hash table" ); } } // Update the string table reference vm.strTbl = newTbl; } /** Get the string object for a given string */ refptr getString(VM vm, wstring str) { auto objPtr = str_alloc(vm, cast(uint32)str.length); for (uint32 i = 0; i < str.length; ++i) str_set_data(objPtr, i, str[i]); // Compute the hash code for the string compStrHash(objPtr); // Find/add the string in the string table objPtr = getTableStr(vm, objPtr); return objPtr; }
D
ctomn (2) --- translate ASCII control character to mnemonic 03/28/80 _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n integer function ctomn (c, rep) character c, rep (4) Library: vswtlb (standard Subsystem library) _F_u_n_c_t_i_o_n 'Ctomn' is used to convert an unprintable ASCII character to its official ASCII mnemonic. The first argument is the character to be converted; the second is a string to receive the mnemonic. The function return is the length of the string placed in the second argument. If the character passed is printable, it is copied through unchanged to the receiving string. If not, its two- or three-character ASCII mnemonic (e.g. NUL, SOH, etc.) is copied into the receiving string. _I_m_p_l_e_m_e_n_t_a_t_i_o_n If the character is printable, it is placed in the receiving string, which is then terminated with EOS. If the character is between 128 and 160, inclusive, or equals 255, its value is used to compute an index into a string table containing the mnemonics. The mnemonic thus selected is copied into the receiving string. _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d rep _C_a_l_l_s scopy _S_e_e _A_l_s_o mntoc (2) ctomn (2) - 1 - ctomn (2)
D
/home/pavel/create-near-NFTapp/NFT-app/contract/target/debug/build/serde_json-89982fe8b1c3b1e1/build_script_build-89982fe8b1c3b1e1: /home/pavel/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.62/build.rs /home/pavel/create-near-NFTapp/NFT-app/contract/target/debug/build/serde_json-89982fe8b1c3b1e1/build_script_build-89982fe8b1c3b1e1.d: /home/pavel/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.62/build.rs /home/pavel/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.62/build.rs:
D
/** d2d.base holds the base interfaces needed by most of the classes. */ module d2d.core.base; import d2d.core.event; /// exception thrown when something unlogical is done with the base class or its child objects, services, ... class ObjectLogicException : Exception { /// ctor this(string err) { super(err); } } /** Base is the base interaface for all engine classes. It has the methods that are basically needed by every part of the system. */ class Base { /// Base ctor this() { // first set the object id _id = maxId; maxId++; } /// Base destructor ~this() { } /* preUpdate is called before update is called Should be used to process events, inputs etc. Also put everything that might fire events that should be processed immediatly */ void preUpdate() { } /// postUpdate is called after update is called /// Avoid fireing events here. Here you should do things that dont affect other objects but need the full interaction with the rest of the world in before. void postUpdate() { } /// Update is called every tick (1/30 of a second). void update() { } // preRender is called before all children and the object is renderd. void preRender() { } /// Render is called every frame void render() { } /// postRender is called after all children and the object were renderd. void postRender() { } /// Propagates an update thru the object hirarchy final void propagateUpdate() { propagate( (b) { b.preUpdate(); }, (b) => !b._paused ); propagate( (b) { b.update(); }, (b) => !b._paused ); propagate( (b) { b.postUpdate(); }, (b) => !b._paused ); } /// Propagates the rendering through the object hirarchy // cant use the propagate because render has additional pre- and post functions. final void propagateRender() { this.preRender(); this.render(); foreach(ref c; _children) { c.propagateRender(); } this.postRender(); } /// add a child to this object. Resets the parent of the object to add. T addChild(this T)(Base child) { if (child.parent && child.parent != this) { child.parent.removeChild(child); } _children[child.id] = child; child.parent = this; this.onChildAdded(child); child.onParentSet(); return cast(T) this; } /// Fires an event, moves it up in the object hirarchy and propagetes it through void fireEvent(Event e) { e.source = this; this.root.propagateEvent(e); } /// propagate an event throgh the object hirarchy final void propagateEvent(Event e) { propagate( (b) { if(b.canReciveEvents && e.source != b) b.pendingEvents ~= e; }, (b) => !b._paused ); } /// removes a child from this object final void removeChild(Base child) { child.parent = null; if(_children.remove(child.id)) { this.onChildRemoved(child); child.onParentRemoved(); } } /** marks an object for deletion. It immediatly removes the service (if existant) and also marks all children for deletion! Deletion means removal from object hirarchy and services. However if the object is stored somewhere else it also has to be removed manually there (should never ever happen). */ final void setDeleted() { _deleted = true; if (_isService) { removeService(); } foreach(ref c; _children) { c.setDeleted(); } } /** PreTickDelte removes all objects that are makred for deletion from the hirachy. If an objects had children, these are deleted, too. */ final void preTickDelete() { propagate( (b) { foreach(ref c; b.children) { if (c.deleted) { b.removeChild(c); } } }); } /// Gets a service by its name. Syntax is getService!ServiceClass(name) final static T getService (T) (string name) { auto exsisting = name in _services; if(exsisting) { return cast(T)(*exsisting); } throw new ObjectLogicException("Cannot get an unknown service (" ~ name ~ ")!"); } /// fixed obj id of this object final @property size_t id() const { return _id; } /// gets the parent object of this object final @property Base parent() { return _parent; } /// sets the parent object of this object final @property Base parent(Base newParent) { return _parent = newParent; } /// gets the child objects of this object final @property Base[long] children() { return _children; } /// if this object accepts events final @property bool acceptsEvents() const { return canReciveEvents; } /// pauses/unpauses the object final @property bool paused() const { return _paused; } final @property bool paused(bool paused) { return _paused = paused; } /// returns if the object will be deleted before the next tick final @property bool deleted() const { return _deleted; } /// the "root" is the root of the element tree wich this object is a member final @property Base root() { // i am root! if (_parent is null) { return this; } //go up return this.parent.root; } protected: /// Enables event reciving for this object. Should be called in the constructor of classes that want it. final void enableEventHandling() { canReciveEvents = true; } /// returns the pending events and does NOT clean them final Event[] peekEvents() { Event[] scpy = pendingEvents.dup; return scpy; } /// returns the pending events and cleans final Event[] pollEvents() { Event[] scpy = pendingEvents.dup; // empty the pending events - happy GC pendingEvents.length = 0; return scpy; } /// Propagates event actions final void propagate(void delegate(Base) action) { propagate(action, (b) => true); } final void propagate(void delegate(Base) action, bool delegate(Base) test) { if(!test(this)) return; action(this); foreach(ref c; _children) { c.propagate(action, test); } } /// Registers a class as a service that can be accessed by its name. Should be called by classes that want to be deleted final void registerAsService(string name) { if (!_isService) { auto exsisting = name in _services; if (!exsisting) { _services[name] = this; _serviceName = name; _isService = true; } } else { throw new ObjectLogicException("Cannot create 2 services of the same name (" ~ name ~ ")!"); } } /// Removes a service final void removeService() { if (_isService) { _services.remove(_serviceName); } else { throw new ObjectLogicException("Cannot un-service an object that never was a service!"); } } /// Called if a child is added to this object. overload to add usefullness void onChildAdded(Base c) { } /// Called if a child is removed from this object void onChildRemoved(Base c) { } /// Called if a parent is added to this object. overload to add usefullness void onParentSet() { } /// Called if this object has lost its parent void onParentRemoved() { } private: /// every engine object has an object id, this is the current maximum static size_t maxId = 0; /// the known services static Base[string] _services; /// the object id of the engine object immutable size_t _id; /// the child objects, key is the object id Base[long] _children; /// the parent object Base _parent; /// if true the object can recive events bool canReciveEvents = false; /// if true the object is paused; no child objects or the object is updated or renderd, can recive any events or anything. bool _paused = false; /// if the object is a service bool _isService = false; /// name of the service string _serviceName; /// true if an object is marked for deletion bool _deleted = false; /// the current pending events Event[] pendingEvents; }
D
module ipcfg.parser; import ipcfg.node; import ipcfg.edge; import ipcfg.graph; import ipcfg.iface; import std.stdio; import std.file; import std.utf; import pegged.grammar; enum eni_grammar = ` ENI: Grammar <- Statement+ :EOI Statement <- ( AutoStatement / HotplugStatement / IfaceStatement / :EmptyLine / :(S* Comment) ) EmptyLine <: S* EOL AutoStatement <- "auto" S+ ^IfaceName :EOL HotplugStatement <- "allow-hotplug" S+ ^IfaceName :EOL IfaceStatement <- ConfigLine ConfigStatements? ConfigLine <- "iface" S+ ^IfaceName S+ "inet" S+ ConfigType :EOL ConfigType <- ( "dhcp" / "static" / "loopback" / "manual" ) ConfigStatements <- ( BuiltinStatement / ExtensionStatement / (S+ Comment) )+ BuiltinStatement <- S+ OptIdentifier Arguments :EOL ExtensionStatement <- S+ OptIdentifier '-' OptIdentifier Arguments :EOL Arguments <- ( S+ (ArgIdentifier / QuotedString) )+ QuotedString <- Quote ~(!Quote .)* Quote Quote <: '\"' Comment <: "#" (!EOL .)* EOL S <: " " / "\t" IfaceName <~ [a-zA-Z] [a-zA-Z0-9.:]* ArgIdentifier <~ [-a-zA-Z0-9/=_] [-a-zA-Z0-9.:/=_]* OptIdentifier <~ [a-zA-Z_]+ `d; mixin(grammar(eni_grammar)); /+ enum graph_grammar = ` GRAPH: Grammar <- "graph" '{' (Statement ';')+ '}' EOI Statement <- NodeStatement / EdgeStatement NodeStatement <- Identifier ('[' Attribute+ ']')? EdgeStatement <- Identifier '->' Identifier ('[' Attribute+ ']')? Attribute <- Identifier '=' (Identifier / QuotedString') `; mixin(grammar(graph_grammar)); +/ void parseIfaceData(O)(O o, Graph g, Iface i) { } class ParseError : Error { this(string msg = "", string file = __FILE__, int line=__LINE__) { super(msg, file, line); } } void buildGraph(O)(O o, Graph g) { ipcfg.node.Node n1, n2; ipcfg.edge.Edge e; void parseToGraph(ParseTree p, Graph g) { writeln(p.ruleName); switch(p.ruleName) { case "Grammar": goto case; case "Statement": foreach(ParseTree c; p.children) { parseToGraph(c, g); } break; case "EmptyLine": /* *should* have been ignored according to our grammar, but isn't */ break; case "HotplugStatement": g.iface(toUTF8(p.capture[1])).markHotplug(); break; case "AutoStatement": g.iface(toUTF8(p.capture[1])).markAuto(); break; case "IfaceStatement": break; default: break; } } parseToGraph(o.parseTree, g); } void parseconfigs(Graph g) { buildGraph(ENI.parse(readText("/etc/network/interfaces")), g); }
D
/* Copyright (c) 2019 Timur Gafarov 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 dagon.core.time; import dlib.core.ownership; struct Time { double delta; double elapsed; } class Cadencer: Owner { double elapsedTime = 0.0; double timeStep = 0.0; uint maxTicksPerFrame = 5; void delegate(Time) callback; this(void delegate(Time) callback, uint freq, Owner owner) { super(owner); this.callback = callback; timeStep = 1.0 / cast(double)freq; } void update(Time t) { int tickCount = 0; elapsedTime += t.delta; while (elapsedTime >= timeStep) { if (tickCount < maxTicksPerFrame) callback(Time(timeStep, t.elapsed)); elapsedTime -= timeStep; tickCount++; } } }
D
/* * Copyright 2002-2017 the original author or authors. * * 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 hunt.stomp.simp.SimpMessageSendingOperations; import hunt.collection.Map; import hunt.stomp.MessagingException; import hunt.stomp.core.MessagePostProcessor; import hunt.stomp.core.MessageSendingOperations; /** * A specialization of {@link MessageSendingOperations} with methods for use with * the Spring Framework support for Simple Messaging Protocols (like STOMP). * * <p>For more on user destinations see * {@link hunt.stomp.simp.user.UserDestinationResolver * UserDestinationResolver}. * * <p>Generally it is expected the user is the one authenticated with the * WebSocket session (or by extension the user authenticated with the * handshake request that started the session). However if the session is * not authenticated, it is also possible to pass the session id (if known) * in place of the user name. Keep in mind though that in that scenario, * you must use one of the overloaded methods that accept headers making sure the * {@link hunt.stomp.simp.SimpMessageHeaderAccessor#setSessionId * sessionId} header has been set accordingly. * * @author Rossen Stoyanchev * @since 4.0 */ interface SimpMessageSendingOperations : MessageSendingOperations!(string) { /** * Send a message to the given user. * @param user the user that should receive the message. * @param destination the destination to send the message to. * @param payload the payload to send */ void convertAndSendToUser(string user, string destination, Object payload); /** * Send a message to the given user. * <p>By default headers are interpreted as native headers (e.g. STOMP) and * are saved under a special key in the resulting Spring * {@link hunt.stomp.Message Message}. In effect when the * message leaves the application, the provided headers are included with it * and delivered to the destination (e.g. the STOMP client or broker). * <p>If the map already contains the key * {@link hunt.stomp.support.NativeMessageHeaderAccessor#NATIVE_HEADERS "nativeHeaders"} * or was prepared with * {@link hunt.stomp.simp.SimpMessageHeaderAccessor SimpMessageHeaderAccessor} * then the headers are used directly. A common expected case is providing a * content type (to influence the message conversion) and native headers. * This may be done as follows: * <pre class="code"> * SimpMessageHeaderAccessor accessor = SimpMessageHeaderAccessor.create(); * accessor.setContentType(MimeTypeUtils.TEXT_PLAIN); * accessor.setNativeHeader("foo", "bar"); * accessor.setLeaveMutable(true); * MessageHeaders headers = accessor.getMessageHeaders(); * messagingTemplate.convertAndSendToUser(user, destination, payload, headers); * </pre> * <p><strong>Note:</strong> if the {@code MessageHeaders} are mutable as in * the above example, implementations of this interface should take notice and * update the headers in the same instance (rather than copy or re-create it) * and then set it immutable before sending the final message. * @param user the user that should receive the message (must not be {@code null}) * @param destination the destination to send the message to (must not be {@code null}) * @param payload the payload to send (may be {@code null}) * @param headers the message headers (may be {@code null}) */ void convertAndSendToUser(string user, string destination, Object payload, Map!(string, Object) headers); /** * Send a message to the given user. * @param user the user that should receive the message (must not be {@code null}) * @param destination the destination to send the message to (must not be {@code null}) * @param payload the payload to send (may be {@code null}) * @param postProcessor a postProcessor to post-process or modify the created message */ void convertAndSendToUser(string user, string destination, Object payload, MessagePostProcessor postProcessor); /** * Send a message to the given user. * <p>See {@link #convertAndSend(Object, Object, java.util.Map)} for important * notes regarding the input headers. * @param user the user that should receive the message * @param destination the destination to send the message to * @param payload the payload to send * @param headers the message headers * @param postProcessor a postProcessor to post-process or modify the created message */ void convertAndSendToUser(string user, string destination, Object payload, Map!(string, Object) headers, MessagePostProcessor postProcessor); }
D
/Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/build/Pods.build/Debug-iphonesimulator/SwipeCellKit.build/Objects-normal/x86_64/SwipeTableOptions.o : /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/Swipeable.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeExpansionStyle.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCellDelegate.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeExpanding.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionTransitioning.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeFeedback.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeAction.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionButton.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeAnimator.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/Extensions.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableOptions.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTransitionLayout.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionsView.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell+Display.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell+Accessibility.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/Target\ Support\ Files/SwipeCellKit/SwipeCellKit-umbrella.h /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/build/Pods.build/Debug-iphonesimulator/SwipeCellKit.build/unextended-module.modulemap /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/build/Pods.build/Debug-iphonesimulator/SwipeCellKit.build/Objects-normal/x86_64/SwipeTableOptions~partial.swiftmodule : /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/Swipeable.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeExpansionStyle.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCellDelegate.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeExpanding.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionTransitioning.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeFeedback.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeAction.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionButton.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeAnimator.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/Extensions.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableOptions.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTransitionLayout.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionsView.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell+Display.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell+Accessibility.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/Target\ Support\ Files/SwipeCellKit/SwipeCellKit-umbrella.h /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/build/Pods.build/Debug-iphonesimulator/SwipeCellKit.build/unextended-module.modulemap /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/build/Pods.build/Debug-iphonesimulator/SwipeCellKit.build/Objects-normal/x86_64/SwipeTableOptions~partial.swiftdoc : /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/Swipeable.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeExpansionStyle.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCellDelegate.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeExpanding.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionTransitioning.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeFeedback.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeAction.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionButton.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeAnimator.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/Extensions.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableOptions.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTransitionLayout.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeActionsView.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell+Display.swift /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/SwipeCellKit/Source/SwipeTableViewCell+Accessibility.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /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/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.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/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/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/artemon/Desktop/projects/Swift/HARMAN/FitHelper/Pods/Target\ Support\ Files/SwipeCellKit/SwipeCellKit-umbrella.h /Users/artemon/Desktop/projects/Swift/HARMAN/FitHelper/build/Pods.build/Debug-iphonesimulator/SwipeCellKit.build/unextended-module.modulemap
D
module des.isys.neiro.neiron; import std.algorithm; import des.isys.neiro.traits; interface Neiron(T) { @property T output() const; void process(); } abstract class FakeNeiron(T) : Neiron!T { void process(){} } class ValueNeiron(T) : FakeNeiron!T { T value; this( T value ) { this.value = value; } @property T output() const { return value; } } class ReferenceNeiron(T) : FakeNeiron!T { Neiron!T neiron; this( Neiron!T neiron ) in{ assert( neiron !is null ); } body { this.neiron = neiron; } @property T output() const { return neiron.output; } } unittest { auto vn = new ValueNeiron!float(3.1415); auto rn = new ReferenceNeiron!float( vn ); import std.math; assert( abs(rn.output - 3.1415) < float.epsilon*2 ); } class FunctionNeiron(T) : FakeNeiron!T { T delegate() func; this( T delegate() func ) in{ assert( func !is null ); } body { this.func = func; } @property T output() const { return func(); } } interface Link(T) { @property T value(); } abstract class BaseNeiron(T) : Neiron!T if( canSummate!T ) { protected: T value; abstract T activate( T ); abstract @property Link!T[] links(); public: this( T initial = T.init ) { value = initial; } final @property T output() const { return value; } void process() { value = activate( reduce!((s,v)=>s+v)( map!"a.value"(links) ) ); } } version(unittest) { private { import std.conv; class TestNeiron : BaseNeiron!float { protected: override float activate( float x ) { return x * coef; } override @property Link!float[] links() { return _links; } Link!float[] _links; float coef; public: this( float ac, Link!float[] lnks ) { coef = ac; _links = lnks; } } } } unittest { static class TestLink : Link!float { @property float value() { return 1; } } TestLink[] buf; foreach( i; 0 .. 10 ) buf ~= new TestLink; auto tn = new TestNeiron( .25, to!(Link!float[])(buf) ); tn.process(); assert( tn.output == 2.5 ); } abstract class WeightLink(T,N) : Link!T if( canMultiplicate!(T,N) ) { @property { abstract protected T source() const; abstract N weight() const; abstract void weight( N ); final T value() { return source * weight; } } } unittest { static class TestLink : WeightLink!(float,float) { float w; override @property { protected float source() const { return 1; } float weight() const { return w; } void weight( float nw ) { w = nw; } } this( float W ) { w = W; } } TestLink[] buf; foreach( i; 0 .. 10 ) buf ~= new TestLink( 0.25 ); auto tn = new TestNeiron( 1, to!(Link!float[])(buf) ); tn.process(); assert( tn.output == 2.5 ); }
D
/+ + Copyright (c) Charles Petzold, 1998. + Ported to the D Programming Language by Andrej Mitrovic, 2011. +/ module PopPad3; import core.memory; import core.runtime; import core.thread; import std.conv; import std.math; import std.range; import std.string; import std.utf; auto toUTF16z(S)(S s) { return toUTFz!(const(wchar)*)(s); } pragma(lib, "gdi32.lib"); pragma(lib, "comdlg32.lib"); pragma(lib, "winmm.lib"); import win32.windef; import win32.winuser; import win32.wingdi; import win32.winbase; import win32.commdlg; import win32.mmsystem; import PopFile; import PopFind; import PopFont; import resource; string appName = "PopPad"; string description = "name"; HINSTANCE hinst; extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { int result; void exceptionHandler(Throwable e) { throw e; } try { Runtime.initialize(&exceptionHandler); result = myWinMain(hInstance, hPrevInstance, lpCmdLine, iCmdShow); Runtime.terminate(&exceptionHandler); } catch (Throwable o) { MessageBox(null, o.toString().toUTF16z, "Error", MB_OK | MB_ICONEXCLAMATION); result = 0; } return result; } int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { hinst = hInstance; HACCEL hAccel; HWND hwnd; MSG msg; WNDCLASS wndclass; wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = &WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon(hInstance, appName.toUTF16z); wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = cast(HBRUSH) GetStockObject(WHITE_BRUSH); wndclass.lpszMenuName = appName.toUTF16z; wndclass.lpszClassName = appName.toUTF16z; if (!RegisterClass(&wndclass)) { MessageBox(NULL, "This program requires Windows NT!", appName.toUTF16z, MB_ICONERROR); return 0; } hwnd = CreateWindow(appName.toUTF16z, // window class name description.toUTF16z, // window caption WS_OVERLAPPEDWINDOW, // window style CW_USEDEFAULT, // initial x position CW_USEDEFAULT, // initial y position CW_USEDEFAULT, // initial x size CW_USEDEFAULT, // initial y size NULL, // parent window handle NULL, // window menu handle hInstance, // program instance handle NULL); // creation parameters ShowWindow(hwnd, iCmdShow); UpdateWindow(hwnd); hAccel = LoadAccelerators(hInstance, appName.toUTF16z); while (GetMessage(&msg, NULL, 0, 0)) { if (hDlgModeless == NULL || !IsDialogMessage(hDlgModeless, &msg)) { if (!TranslateAccelerator(hwnd, hAccel, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } } return msg.wParam; } enum EDITID = 1; enum UNTITLED = "(untitled)"; HWND hDlgModeless; void DoCaption(HWND hwnd, string szTitleName) { string szCaption; szCaption = format("%s - %s", appName, szTitleName.length ? szTitleName : UNTITLED); SetWindowText(hwnd, szCaption.toUTF16z); } void OkMessage(HWND hwnd, string szMessage, string szTitleName) { string szBuffer; szBuffer = format(szMessage, szTitleName.length ? szTitleName : UNTITLED); MessageBox(hwnd, szBuffer.toUTF16z, appName.toUTF16z, MB_OK | MB_ICONEXCLAMATION); } int AskAboutSave(HWND hwnd, string szTitleName) { string szBuffer; int iReturn; szBuffer = format("Save current changes in %s?", szTitleName.length ? szTitleName : UNTITLED); iReturn = MessageBox(hwnd, szBuffer.toUTF16z, appName.toUTF16z, MB_YESNOCANCEL | MB_ICONQUESTION); if (iReturn == IDYES) if (!SendMessage(hwnd, WM_COMMAND, IDM_FILE_SAVE, 0)) iReturn = IDCANCEL; return iReturn; } wchar[MAX_PATH] szFileName = 0; wchar[MAX_PATH] szTitleName = 0; extern (Windows) LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static BOOL bNeedSave = FALSE; static HINSTANCE hInst; static HWND hwndEdit; static int iOffset; static UINT messageFindReplace; int iSelBeg, iSelEnd, iEnable; LPFINDREPLACE pfr; switch (message) { case WM_CREATE: hInst = (cast(LPCREATESTRUCT)lParam).hInstance; // Create the edit control child window hwndEdit = CreateWindow("edit", NULL, WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | WS_BORDER | ES_LEFT | ES_MULTILINE | ES_NOHIDESEL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0, 0, 0, 0, hwnd, cast(HMENU)EDITID, hInst, NULL); SendMessage(hwndEdit, EM_LIMITTEXT, 32000, 0L); // Initialize common dialog box stuff PopFileInitialize(hwnd); PopFontInitialize(hwndEdit); messageFindReplace = RegisterWindowMessage(FINDMSGSTRING.ptr); DoCaption(hwnd, to!string(fromWStringz(szTitleName.ptr))); return 0; case WM_SETFOCUS: SetFocus(hwndEdit); return 0; case WM_SIZE: MoveWindow(hwndEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE); return 0; case WM_INITMENUPOPUP: switch (lParam) { case 1: // Edit menu // Enable Undo if edit control can do it EnableMenuItem(cast(HMENU)wParam, IDM_EDIT_UNDO, SendMessage(hwndEdit, EM_CANUNDO, 0, 0L) ? MF_ENABLED : MF_GRAYED); // Enable Paste if text is in the clipboard EnableMenuItem(cast(HMENU)wParam, IDM_EDIT_PASTE, IsClipboardFormatAvailable(CF_TEXT) ? MF_ENABLED : MF_GRAYED); // Enable Cut, Copy, and Del if text is selected SendMessage(hwndEdit, EM_GETSEL, cast(WPARAM)&iSelBeg, cast(LPARAM)&iSelEnd); iEnable = (iSelBeg != iSelEnd) ? MF_ENABLED : MF_GRAYED; EnableMenuItem(cast(HMENU)wParam, IDM_EDIT_CUT, iEnable); EnableMenuItem(cast(HMENU)wParam, IDM_EDIT_COPY, iEnable); EnableMenuItem(cast(HMENU)wParam, IDM_EDIT_CLEAR, iEnable); break; case 2: // Search menu // Enable Find, Next, and Replace if modeless // dialogs are not already active iEnable = hDlgModeless == NULL ? MF_ENABLED : MF_GRAYED; EnableMenuItem(cast(HMENU)wParam, IDM_SEARCH_FIND, iEnable); EnableMenuItem(cast(HMENU)wParam, IDM_SEARCH_NEXT, iEnable); EnableMenuItem(cast(HMENU)wParam, IDM_SEARCH_REPLACE, iEnable); break; default: } return 0; case WM_COMMAND: // Messages from edit control if (lParam && LOWORD(wParam) == EDITID) { switch (HIWORD(wParam)) { case EN_UPDATE: bNeedSave = TRUE; return 0; case EN_ERRSPACE: case EN_MAXTEXT: MessageBox(hwnd, "Edit control out of space.", appName.toUTF16z, MB_OK | MB_ICONSTOP); return 0; default: } break; } switch (LOWORD(wParam)) { // Messages from File menu case IDM_FILE_NEW: if (bNeedSave && IDCANCEL == AskAboutSave(hwnd, to!string(fromWStringz(szTitleName.ptr)))) return 0; SetWindowText(hwndEdit, "\0"); szFileName[0] = 0; szTitleName[0] = 0; DoCaption(hwnd, to!string(fromWStringz(szTitleName.ptr))); bNeedSave = FALSE; return 0; case IDM_FILE_OPEN: if (bNeedSave && IDCANCEL == AskAboutSave(hwnd, to!string(fromWStringz(szTitleName.ptr)))) return 0; if (PopFileOpenDlg(hwnd, szFileName.ptr, szTitleName.ptr)) { if (!PopFileRead(hwndEdit, szFileName.ptr)) { OkMessage(hwnd, "Could not read file %s!", to!string(fromWStringz(szTitleName.ptr))); szFileName[0] = 0; szTitleName[0] = 0; } } DoCaption(hwnd, to!string(fromWStringz(szTitleName.ptr))); bNeedSave = FALSE; return 0; case IDM_FILE_SAVE: if (szFileName[0] != 0) { if (PopFileWrite(hwndEdit, szFileName.ptr)) { bNeedSave = FALSE; return 1; } else { OkMessage(hwnd, "Could not write file %s", to!string(fromWStringz(szTitleName.ptr))); return 0; } } goto case; case IDM_FILE_SAVE_AS: if (PopFileSaveDlg(hwnd, szFileName.ptr, szTitleName.ptr)) { DoCaption(hwnd, to!string(fromWStringz(szTitleName.ptr))); if (PopFileWrite(hwndEdit, szFileName.ptr)) { bNeedSave = FALSE; return 1; } else { OkMessage(hwnd, "Could not write file %s", to!string(fromWStringz(szTitleName.ptr))); return 0; } } return 0; case IDM_FILE_PRINT: if (!PopPrntPrintFile(hInst, hwnd, hwndEdit, szTitleName.ptr)) OkMessage(hwnd, "Could not print file %s", to!string(fromWStringz(szTitleName.ptr))); return 0; case IDM_APP_EXIT: SendMessage(hwnd, WM_CLOSE, 0, 0); return 0; // Messages from Edit menu case IDM_EDIT_UNDO: SendMessage(hwndEdit, WM_UNDO, 0, 0); return 0; case IDM_EDIT_CUT: SendMessage(hwndEdit, WM_CUT, 0, 0); return 0; case IDM_EDIT_COPY: SendMessage(hwndEdit, WM_COPY, 0, 0); return 0; case IDM_EDIT_PASTE: SendMessage(hwndEdit, WM_PASTE, 0, 0); return 0; case IDM_EDIT_CLEAR: SendMessage(hwndEdit, WM_CLEAR, 0, 0); return 0; case IDM_EDIT_SELECT_ALL: SendMessage(hwndEdit, EM_SETSEL, 0, -1); return 0; // Messages from Search menu case IDM_SEARCH_FIND: SendMessage(hwndEdit, EM_GETSEL, 0, cast(LPARAM)&iOffset); hDlgModeless = PopFindFindDlg(hwnd); return 0; case IDM_SEARCH_NEXT: SendMessage(hwndEdit, EM_GETSEL, 0, cast(LPARAM)&iOffset); if (PopFindValidFind()) PopFindNextText(hwndEdit, &iOffset); else hDlgModeless = PopFindFindDlg(hwnd); return 0; case IDM_SEARCH_REPLACE: SendMessage(hwndEdit, EM_GETSEL, 0, cast(LPARAM)&iOffset); hDlgModeless = PopFindReplaceDlg(hwnd); return 0; case IDM_FORMAT_FONT: if (PopFontChooseFont(hwnd)) PopFontSetFont(hwndEdit); return 0; // Messages from Help menu case IDM_HELP: OkMessage(hwnd, "Help not yet implemented!", "\0"); return 0; case IDM_APP_ABOUT: DialogBox(hInst, "AboutBox", hwnd, &AboutDlgProc); return 0; default: } break; case WM_CLOSE: if (!bNeedSave || IDCANCEL != AskAboutSave(hwnd, to!string(fromWStringz(szTitleName.ptr)))) DestroyWindow(hwnd); return 0; case WM_QUERYENDSESSION: if (!bNeedSave || IDCANCEL != AskAboutSave(hwnd, to!string(fromWStringz(szTitleName.ptr)))) return 1; return 0; case WM_DESTROY: PopFontDeinitialize(); PostQuitMessage(0); return 0; default: // Process "Find-Replace" messages if (message == messageFindReplace) { pfr = cast(LPFINDREPLACE)lParam; if (pfr.Flags & FR_DIALOGTERM) hDlgModeless = NULL; if (pfr.Flags & FR_FINDNEXT) if (!PopFindFindText(hwndEdit, &iOffset, pfr)) OkMessage(hwnd, "Text not found!", "\0"); if (pfr.Flags & FR_REPLACE || pfr.Flags & FR_REPLACEALL) if (!PopFindReplaceText(hwndEdit, &iOffset, pfr)) OkMessage(hwnd, "Text not found!", "\0"); if (pfr.Flags & FR_REPLACEALL) { while (PopFindReplaceText(hwndEdit, &iOffset, pfr)) { } } return 0; } break; } return DefWindowProc(hwnd, message, wParam, lParam); } extern (Windows) BOOL AboutDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: EndDialog(hDlg, 0); return TRUE; default: } break; default: } return FALSE; } BOOL PopPrntPrintFile(HINSTANCE hInst, HWND hwnd, HWND hwndEdit, PTSTR pstrTitleName) { return FALSE; }
D
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE 322.100006 68 3.70000005 44.7999992 80 100 -36.4000015 149.899994 5723 6.0999999 6.0999999 0.585017938 sediments, redbeds 340 40 5 0 80 100 -33.7999992 150.699997 1768 10 10 0.572979734 intrusives 325 55 5 0 80 100 -33.9000015 151.300003 1766 10 10 0.572979734 intrusives, basalt 329.5 49.5 11.6000004 23.6000004 100 120 -23 150.5 8586 19.7000008 21.3999996 0.420771458 extrusives 330.100006 45.9000015 3.9000001 600 80 100 -33.7999992 150.800003 83 7.5999999 7.5999999 0.583382418 intrusives, breccia 307.200012 48.0999985 3.4000001 228.600006 80 100 -33.7000008 150.800003 82 6.19999981 6.19999981 0.587319131 intrusives, basalts, breccias 342.100006 57.7000008 19.5 40.7999992 80 100 -33.7999992 151.100006 87 35.5999985 35.5999985 0.314778679 intrusives, breccia 322.399994 60.7000008 8.19999981 35.2999992 90 110 -33.7999992 150.899994 85 13.3999996 13.3999996 0.580602712 intrusives, dolerite 317 54 8 63 80 100 -34.5 150.300003 8442 12.3999996 12.8999996 0.533714237 intrusives, dolerite 338.200012 55.2000008 5.9000001 238.800003 80 100 -35.2999992 150.399994 240 10.6000004 10.6000004 0.562780352 intrusives, porphyry 319.399994 59.0999985 2.29999995 300.799988 80 100 -33.7000008 151.100006 238 4.19999981 4.19999981 0.594156636 extrusives 328 45 10 30.8999996 100 120 -22.5 149.300003 8407 18 19 0.450368701 extrusives,intrusives 338 55.9000015 6.5 42 90 110 -35.2999992 150.5 766 11.6999998 12.3000002 0.605191955 intrusives, porphyry 335.600006 61 4 0 80 120 -31.1000004 152.5 7562 6.9000001 6.9000001 0.557534559 sediments, sandstones, siltstones 328.799988 50.7000008 8.19999981 0 80 120 -31.5 152.5 7560 15.3999996 15.3999996 0.505602712 extrusives, basalts 342.299988 68.5999985 5.9000001 131.600006 99 146 -30.9652004 142.628098 9341 8.19999981 9.89999962 0.494695246 sediments, sandstones 306.700012 57.4000015 7.69999981 76.0999985 80 100 -33.5999985 149 1106 12.8000002 14.1000004 0.538277622 sediments, extrusives 323.399994 57.2999992 1.89999998 642.900024 80 100 -33.5 151.5 1097 3.5999999 3.5999999 0.596004935 sediments, redbeds 140.800003 47.5999985 11.1000004 33.9000015 100 146 -9.30000019 125.599998 1210 10.1999998 15 0.401981201 sediments 346 61 9 41.2000008 35 100 -31.3999996 138.600006 1170 13 15 0.448404336 sediments 333 45 9 16.5 35 100 -30.3999996 139.399994 1161 17 18 0.448404336 sediments, tillite 317 57 5 200 35 100 -30.5 139.300003 1165 9 10 0.503748965 sediments, redbeds 329 58 25 4.0999999 35 100 -30.2000008 139 1166 41.5999985 45.5999985 0.155445335 sediments, sandstone, tillite 223 26 13 14.8000002 35 100 -30.2999992 139.5 1157 26 26 0.374223009 extrusives 318 56 5 47 90 100 -36.2999992 150 1848 9 9 0.672979734 intrusives 269 40 30.996521 0 50 300 -32.5999985 151.5 1868 0 0 0.0711177871 extrusives, andesites 102 19.8999996 21.7000008 18.7999992 65 245 -32 116 1944 28.1000004 28.1000004 0.192262649 intrusives 341 49 6.4000001 142 90 105 -33.4000015 115.599998 1932 10 10 0.65649871 extrusives, basalts 331 23 4.80000019 81 100 160 -34 151 1594 9.30000019 9.39999962 0.491710982 intrusives 324 51 3.29999995 960 65 100 -34 151 1591 6.0999999 6.4000001 0.545188094 intrusives 272 66 4.80000019 191 60 100 -33.7000008 151.100006 1592 5.80000019 7.4000001 0.525044315 intrusives
D
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.build/atomics.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOConcurrencyHelpers/lock.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.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/Darwin.apinotes /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.build/atomics~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOConcurrencyHelpers/lock.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.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/Darwin.apinotes /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.build/atomics~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOConcurrencyHelpers/lock.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOConcurrencyHelpers/atomics.swift /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/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/cpp_magic.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOAtomics/include/c-atomics.h /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio-zlib-support.git--4783613459776704231/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/lb/Documents/Project/LearnVapor/.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/Darwin.apinotes
D
module moverfactory; import all; class ParticleFactory{ Particle createGoSkyEffect(Vector pos){ return null; } }
D
// Copyright Brian Schott (Hackerpilot) 2012. // 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 dscanner.astprinter; import dparse.lexer; import dparse.ast; import dparse.formatter; import std.stdio; import std.string; import std.array; /** * AST visitor that outputs an XML representation of the AST to its file. */ class XMLPrinter : ASTVisitor { override void visit(const AddExpression addExpression) { output.writeln("<addExpression operator=\"", str(addExpression.operator), "\">"); output.writeln("<left>"); dynamicDispatch(addExpression.left); output.writeln("</left>"); if (addExpression.right !is null) { output.writeln("<right>"); dynamicDispatch(addExpression.right); output.writeln("</right>"); } output.writeln("</addExpression>"); } override void visit(const AliasDeclaration aliasDeclaration) { output.writeln("<aliasDeclaration>"); writeDdoc(aliasDeclaration.comment); aliasDeclaration.accept(this); output.writeln("</aliasDeclaration>"); } override void visit(const AlignAttribute alignAttribute) { if (alignAttribute.assignExpression is null) output.writeln("<alignAttribute/>"); else { output.write("<alignAttribute align=\""); format(output.lockingTextWriter, alignAttribute.assignExpression); output.writeln("\"/>"); } } override void visit(const AndAndExpression andAndExpression) { output.writeln("<andAndExpression>"); output.writeln("<left>"); dynamicDispatch(andAndExpression.left); output.writeln("</left>"); if (andAndExpression.right !is null) { output.writeln("<right>"); dynamicDispatch(andAndExpression.right); output.writeln("</right>"); } output.writeln("</andAndExpression>"); } override void visit(const AndExpression andExpression) { output.writeln("<andExpression>"); output.writeln("<left>"); dynamicDispatch(andExpression.left); output.writeln("</left>"); if (andExpression.right !is null) { output.writeln("<right>"); dynamicDispatch(andExpression.right); output.writeln("</right>"); } output.writeln("</andExpression>"); } override void visit(const AsmInstruction asmInstruction) { output.writeln("<asmInstruction>"); if (asmInstruction.hasAlign) { output.writeln("<align>"); visit(asmInstruction.identifierOrIntegerOrOpcode); output.writeln("</align>"); } if (asmInstruction.asmInstruction !is null) { output.writeln("<label label=\"", asmInstruction.identifierOrIntegerOrOpcode.text, "\"/>"); asmInstruction.asmInstruction.accept(this); } else if (asmInstruction.identifierOrIntegerOrOpcode != tok!"") visit(asmInstruction.identifierOrIntegerOrOpcode); if (asmInstruction.operands !is null) { visit(asmInstruction.operands); } output.writeln("</asmInstruction>"); } override void visit(const AssignExpression assignExpression) { if (assignExpression.expression is null) output.writeln("<expression>"); else output.writeln("<expression operator=\"", xmlAttributeEscape(str(assignExpression.operator)), "\">"); assignExpression.accept(this); output.writeln("</expression>"); } override void visit(const AtAttribute atAttribute) { output.writeln("<atAttribute>"); if (atAttribute.identifier.type != tok!"") output.writeln("<identifier>", atAttribute.identifier.text, "</identifier>"); atAttribute.accept(this); output.writeln("</atAttribute>"); } override void visit(const Attribute attribute) { if (attribute.attribute == tok!"") { output.writeln("<attribute>"); attribute.accept(this); output.writeln("</attribute>"); } else if (attribute.identifierChain is null) output.writeln("<attribute attribute=\"", str(attribute.attribute.type), "\"/>"); else { output.writeln("<attribute attribute=\"", str(attribute.attribute.type), "\">"); visit(attribute.identifierChain); output.writeln("</attribute>"); } } override void visit(const AutoDeclaration autoDec) { output.writeln("<autoDeclaration>"); output.writeln("<storageClasses>"); foreach (sc; autoDec.storageClasses) visit(sc); output.writeln("</storageClasses>"); foreach (part; autoDec.parts) visit(part); output.writeln("</autoDeclaration>"); } override void visit(const AutoDeclarationPart part) { output.writeln("<autoDeclarationPart>"); output.writeln("<item>"); output.writeln("<name line=\"", part.identifier.line, "\">", part.identifier.text, "</name>"); visit(part.initializer); output.writeln("</item>"); output.writeln("</autoDeclarationPart>"); } override void visit(const BreakStatement breakStatement) { if (breakStatement.label.type == tok!"") output.writeln("<breakStatement/>"); else output.writeln("<breakStatement label=\"", breakStatement.label.text, "\"/>"); } override void visit(const CaseRangeStatement caseRangeStatement) { output.writeln("<caseRangeStatement>"); if (caseRangeStatement.low !is null) { output.writeln("<low>"); dynamicDispatch(caseRangeStatement.low); output.writeln("</low>"); } if (caseRangeStatement.high !is null) { output.writeln("<high>"); dynamicDispatch(caseRangeStatement.high); output.writeln("</high>"); } if (caseRangeStatement.declarationsAndStatements !is null) visit(caseRangeStatement.declarationsAndStatements); output.writeln("</caseRangeStatement>"); } override void visit(const Catch catch_) { output.writeln("<catch>"); catch_.accept(this); output.writeln("</catch>"); } override void visit(const ClassDeclaration classDec) { output.writeln("<classDeclaration line=\"", classDec.name.line, "\">"); writeName(classDec.name.text); writeDdoc(classDec.comment); classDec.accept(this); output.writeln("</classDeclaration>"); } override void visit(const ConditionalDeclaration conditionalDeclaration) { output.writeln("<conditionalDeclaration>"); visit(conditionalDeclaration.compileCondition); output.writeln("<trueDeclarations>"); foreach (dec; conditionalDeclaration.trueDeclarations) visit(dec); output.writeln("</trueDeclarations>"); if (conditionalDeclaration.falseDeclarations.length > 0) { output.writeln("<falseDeclarations>"); foreach (dec; conditionalDeclaration.falseDeclarations) visit(dec); output.writeln("</falseDeclarations>"); } output.writeln("</conditionalDeclaration>"); } override void visit(const ConditionalStatement conditionalStatement) { output.writeln("<conditionalStatement>"); visit(conditionalStatement.compileCondition); output.writeln("<trueStatement>"); visit(conditionalStatement.trueStatement); output.writeln("</trueStatement>"); if (conditionalStatement.falseStatement !is null) { output.writeln("<falseStatement>"); visit(conditionalStatement.falseStatement); output.writeln("</falseStatement>"); } output.writeln("</conditionalStatement>"); } override void visit(const ContinueStatement continueStatement) { if (continueStatement.label.type == tok!"") output.writeln("<continueStatement/>"); else output.writeln("<continueStatement label=\"", continueStatement.label.text, "\"/>"); } override void visit(const DebugCondition debugCondition) { if (debugCondition.identifierOrInteger.type == tok!"") output.writeln("<debugCondition/>"); else output.writeln("<debugCondition condition=\"", debugCondition.identifierOrInteger.text, "\"/>"); } override void visit(const DebugSpecification debugSpecification) { if (debugSpecification.identifierOrInteger.type == tok!"") output.writeln("<debugSpecification/>"); else output.writeln("<debugSpecification condition=\"", debugSpecification.identifierOrInteger.text, "\"/>"); } override void visit(const Declarator declarator) { output.writeln("<declarator line=\"", declarator.name.line, "\">"); writeName(declarator.name.text); writeDdoc(declarator.comment); declarator.accept(this); output.writeln("</declarator>"); } override void visit(const Deprecated deprecated_) { if (deprecated_.assignExpression !is null) { output.writeln("<deprecated>"); dynamicDispatch(deprecated_.assignExpression); output.writeln("</deprecated>"); } else output.writeln("<deprecated/>"); } override void visit(const EnumDeclaration enumDec) { output.writeln("<enumDeclaration line=\"", enumDec.name.line, "\">"); writeDdoc(enumDec.comment); if (enumDec.name.type == tok!"identifier") writeName(enumDec.name.text); enumDec.accept(this); output.writeln("</enumDeclaration>"); } override void visit(const AnonymousEnumMember enumMember) { output.writeln("<anonymousEnumMember line=\"", enumMember.name.line, "\">"); writeDdoc(enumMember.comment); if (enumMember.type !is null) visit(enumMember.type); output.write("<name>", enumMember.name.text, "</name>"); if (enumMember.assignExpression !is null) dynamicDispatch(enumMember.assignExpression); output.writeln("</anonymousEnumMember>"); } override void visit(const EnumMember enumMem) { output.writeln("<enumMember line=\"", enumMem.name.line, "\">"); writeDdoc(enumMem.comment); enumMem.accept(this); output.writeln("</enumMember>"); } override void visit(const EqualExpression equalExpression) { output.writeln("<equalExpression operator=\"", str(equalExpression.operator), "\">"); output.writeln("<left>"); dynamicDispatch(equalExpression.left); output.writeln("</left>"); output.writeln("<right>"); dynamicDispatch(equalExpression.right); output.writeln("</right>"); output.writeln("</equalExpression>"); } override void visit(const Finally finally_) { output.writeln("<finally>"); finally_.accept(this); output.writeln("</finally>"); } override void visit(const ForStatement forStatement) { output.writeln("<forStatement>"); if (forStatement.initialization !is null) { output.writeln("<initialization>"); visit(forStatement.initialization); output.writeln("</initialization>"); } if (forStatement.test !is null) { output.writeln("<test>"); visit(forStatement.test); output.writeln("</test>"); } if (forStatement.increment !is null) { output.writeln("<increment>"); visit(forStatement.increment); output.writeln("</increment>"); } if (forStatement.declarationOrStatement !is null) visit(forStatement.declarationOrStatement); output.writeln("</forStatement>"); } override void visit(const ForeachStatement foreachStatement) { output.writeln("<foreachStatement type=\"", str(foreachStatement.type), "\">"); if (foreachStatement.foreachType !is null) visit(foreachStatement.foreachType); if (foreachStatement.foreachTypeList !is null) visit(foreachStatement.foreachTypeList); output.writeln("<low>"); visit(foreachStatement.low); output.writeln("</low>"); if (foreachStatement.high !is null) { output.writeln("<high>"); visit(foreachStatement.high); output.writeln("</high>"); } visit(foreachStatement.declarationOrStatement); output.writeln("</foreachStatement>"); } override void visit(const ForeachType foreachType) { output.writeln("<foreachType>"); foreach (constructor; foreachType.typeConstructors) { output.writeln("<typeConstructor>", str(constructor), "</typeConstructor>"); } if (foreachType.type !is null) visit(foreachType.type); visit(foreachType.identifier); output.writeln("</foreachType>"); } override void visit(const FunctionDeclaration functionDec) { output.writeln("<functionDeclaration line=\"", functionDec.name.line, "\">"); writeName(functionDec.name.text); writeDdoc(functionDec.comment); if (functionDec.hasAuto) output.writeln("<auto/>"); if (functionDec.hasRef) output.writeln("<ref/>"); functionDec.accept(this); output.writeln("</functionDeclaration>"); } override void visit(const FunctionLiteralExpression functionLiteralExpression) { output.writeln("<functionLiteralExpression type=\"", functionLiteralExpression.functionOrDelegate != tok!"" ? str(functionLiteralExpression.functionOrDelegate) : "auto", "\">"); functionLiteralExpression.accept(this); output.writeln("</functionLiteralExpression>"); } override void visit(const GotoStatement gotoStatement) { if (gotoStatement.label.type == tok!"default") output.writeln("<gotoStatement default=\"true\"/>"); else if (gotoStatement.label.type == tok!"identifier") output.writeln("<gotoStatement label=\"", gotoStatement.label.text, "\"/>"); else { output.writeln("<gotoStatement>"); output.writeln("<case>"); if (gotoStatement.expression) visit(gotoStatement.expression); output.writeln("</case>"); output.writeln("</gotoStatement>"); } } override void visit(const IdentityExpression identityExpression) { if (identityExpression.negated) output.writeln("<identityExpression operator=\"!is\">"); else output.writeln("<identityExpression operator=\"is\">"); output.writeln("<left>"); dynamicDispatch(identityExpression.left); output.writeln("</left>"); output.writeln("<right>"); dynamicDispatch(identityExpression.right); output.writeln("</right>"); output.writeln("</identityExpression>"); } override void visit(const IfStatement ifStatement) { output.writeln("<ifStatement>"); output.writeln("<condition>"); if (ifStatement.condition.identifier.type != tok!"") { if (ifStatement.condition.type is null) output.writeln("<auto/>"); else visit(ifStatement.condition.type); visit(ifStatement.condition.identifier); } ifStatement.condition.expression.accept(this); output.writeln("</condition>"); output.writeln("<then>"); ifStatement.thenStatement.accept(this); output.writeln("</then>"); if (ifStatement.elseStatement !is null) { output.writeln("<else>"); ifStatement.elseStatement.accept(this); output.writeln("</else>"); } output.writeln("</ifStatement>"); } override void visit(const ImportBind importBind) { if (importBind.right.type == tok!"") output.writeln("<importBind symbol=\"", importBind.left.text, "\"/>"); else output.writeln("<importBind symbol=\"", importBind.right.text, "\" rename=\"", importBind.left.text, "\"/>"); } override void visit(const InExpression inExpression) { if (inExpression.negated) output.writeln("<inExpression operator=\"!in\">"); else output.writeln("<inExpression operator=\"in\">"); output.writeln("<left>"); dynamicDispatch(inExpression.left); output.writeln("</left>"); output.writeln("<right>"); dynamicDispatch(inExpression.right); output.writeln("</right>"); output.writeln("</inExpression>"); } override void visit(const Initialize initialize) { if (initialize.statementNoCaseNoDefault is null) output.writeln("<initialize/>"); else { output.writeln("<initialize>"); visit(initialize.statementNoCaseNoDefault); output.writeln("</initialize>"); } } override void visit(const Initializer initializer) { if (initializer.nonVoidInitializer is null) output.writeln("<initializer void=\"true\"/>"); else { output.writeln("<initializer>"); visit(initializer.nonVoidInitializer); output.writeln("</initializer>"); } } override void visit(const InterfaceDeclaration interfaceDec) { output.writeln("<interfaceDeclaration line=\"", interfaceDec.name.line, "\">"); writeName(interfaceDec.name.text); writeDdoc(interfaceDec.comment); interfaceDec.accept(this); output.writeln("</interfaceDeclaration>"); } override void visit(const Invariant invariant_) { output.writeln("<invariant>"); writeDdoc(invariant_.comment); invariant_.accept(this); output.writeln("</invariant>"); } override void visit(const IsExpression isExpression) { output.writeln("<isExpression>"); visit(isExpression.type); if (isExpression.identifier.type != tok!"") visit(isExpression.identifier); if (isExpression.typeSpecialization !is null) { if (isExpression.equalsOrColon == tok!":") output.writeln("<colon/>"); else output.writeln("<equals/>"); visit(isExpression.typeSpecialization); if (isExpression.templateParameterList !is null) visit(isExpression.templateParameterList); } output.writeln("</isExpression>"); } override void visit(const KeyValuePair keyValuePair) { output.writeln("<keyValuePair>"); output.writeln("<key>"); dynamicDispatch(keyValuePair.key); output.writeln("</key>"); output.writeln("<value>"); dynamicDispatch(keyValuePair.value); output.writeln("</value>"); output.writeln("</keyValuePair>"); } override void visit(const LabeledStatement labeledStatement) { output.writeln("<labeledStatement label=\"", labeledStatement.identifier.text, "\">"); if (labeledStatement.declarationOrStatement !is null) visit(labeledStatement.declarationOrStatement); output.writeln("</labeledStatement>"); } override void visit(const LinkageAttribute linkageAttribute) { if (linkageAttribute.hasPlusPlus) { output.write("<linkageAttribute linkage=\"C++\""); if (linkageAttribute.typeIdentifierPart !is null && linkageAttribute.typeIdentifierPart.typeIdentifierPart !is null) { output.write(" namespace=\""); format(output.lockingTextWriter, linkageAttribute.typeIdentifierPart); output.writeln("\"/>"); } else if (linkageAttribute.classOrStruct == tok!"class") output.writeln(" mangleAs=\"class\"/>"); else if (linkageAttribute.classOrStruct == tok!"struct") output.writeln(" mangleAs=\"struct\"/>"); else output.writeln("/>"); } else if (linkageAttribute.identifier.text == "Objective") output.writeln("<linkageAttribute linkage=\"Objective-C\"/>"); else output.writeln("<linkageAttribute linkage=\"", linkageAttribute.identifier.text, "\"/>"); } override void visit(const MemberFunctionAttribute memberFunctionAttribute) { output.writeln("<memberFunctionAttribute>"); if (memberFunctionAttribute.atAttribute is null) output.writeln(str(memberFunctionAttribute.tokenType)); else memberFunctionAttribute.accept(this); output.writeln("</memberFunctionAttribute>"); } override void visit(const Module module_) { output.writeln("<?xml version=\"1.0\"?>"); output.writeln("<module>"); module_.accept(this); output.writeln("</module>"); } override void visit(const MulExpression mulExpression) { output.writeln("<mulExpression operator=\"", str(mulExpression.operator), "\">"); output.writeln("<left>"); dynamicDispatch(mulExpression.left); output.writeln("</left>"); if (mulExpression.right !is null) { output.writeln("<right>"); dynamicDispatch(mulExpression.right); output.writeln("</right>"); } output.writeln("</mulExpression>"); } override void visit(const OrOrExpression orOrExpression) { output.writeln("<orOrExpression>"); output.writeln("<left>"); dynamicDispatch(orOrExpression.left); output.writeln("</left>"); if (orOrExpression.right !is null) { output.writeln("<right>"); dynamicDispatch(orOrExpression.right); output.writeln("</right>"); } output.writeln("</orOrExpression>"); } override void visit(const ParameterAttribute pa) { output.writeln("<parameterAttribute>"); if (pa.atAttribute) visit(pa.atAttribute); else writeln(str(pa.idType)); output.writeln("</parameterAttribute>"); } override void visit(const Parameter param) { output.writeln("<parameter>"); if (param.name.type == tok!"identifier") writeName(param.name.text); param.accept(this); if (param.vararg) output.writeln("<vararg/>"); output.writeln("</parameter>"); } override void visit(const PowExpression powExpression) { output.writeln("<powExpression>"); output.writeln("<left>"); dynamicDispatch(powExpression.left); output.writeln("</left>"); if (powExpression.right !is null) { output.writeln("<right>"); dynamicDispatch(powExpression.right); output.writeln("</right>"); } output.writeln("</powExpression>"); } override void visit(const RelExpression relExpression) { output.writeln("<relExpression operator=\"", xmlAttributeEscape(str(relExpression.operator)), "\">"); output.writeln("<left>"); dynamicDispatch(relExpression.left); output.writeln("</left>"); output.writeln("<right>"); dynamicDispatch(relExpression.right); output.writeln("</right>"); output.writeln("</relExpression>"); } override void visit(const ReturnStatement returnStatement) { if (returnStatement.expression is null) output.writeln("<returnStatement/>"); else { output.writeln("<returnStatement>"); returnStatement.accept(this); output.writeln("</returnStatement>"); } } override void visit(const ShiftExpression shiftExpression) { output.writeln("<shiftExpression operator=\"", xmlAttributeEscape(str(shiftExpression.operator)), "\">"); output.writeln("<left>"); dynamicDispatch(shiftExpression.left); output.writeln("</left>"); output.writeln("<right>"); dynamicDispatch(shiftExpression.right); output.writeln("</right>"); output.writeln("</shiftExpression>"); } override void visit(const SingleImport singleImport) { if (singleImport.rename.type == tok!"") output.writeln("<singleImport>"); else output.writeln("<singleImport rename=\"", singleImport.rename.text, "\">"); visit(singleImport.identifierChain); output.writeln("</singleImport>"); } override void visit(const StructDeclaration structDec) { output.writeln("<structDeclaration line=\"", structDec.name.line, "\">"); writeName(structDec.name.text); writeDdoc(structDec.comment); structDec.accept(this); output.writeln("</structDeclaration>"); } override void visit(const TemplateAliasParameter templateAliasParameter) { output.writeln("<templateAliasParameter>"); if (templateAliasParameter.type !is null) visit(templateAliasParameter.type); visit(templateAliasParameter.identifier); if (templateAliasParameter.colonExpression !is null) { output.writeln("<specialization>"); dynamicDispatch(templateAliasParameter.colonExpression); output.writeln("</specialization>"); } else if (templateAliasParameter.colonType !is null) { output.writeln("<specialization>"); visit(templateAliasParameter.colonType); output.writeln("</specialization>"); } if (templateAliasParameter.assignExpression !is null) { output.writeln("<default>"); dynamicDispatch(templateAliasParameter.assignExpression); output.writeln("</default>"); } else if (templateAliasParameter.assignType !is null) { output.writeln("<default>"); visit(templateAliasParameter.assignType); output.writeln("</default>"); } output.writeln("</templateAliasParameter>"); } override void visit(const TemplateDeclaration templateDeclaration) { writeDdoc(templateDeclaration.comment); output.writeln("<templateDeclaration line=\"", templateDeclaration.name.line, "\">"); writeName(templateDeclaration.name.text); visit(templateDeclaration.templateParameters); if (templateDeclaration.constraint !is null) visit(templateDeclaration.constraint); foreach (dec; templateDeclaration.declarations) { if (dec !is null) visit(dec); } output.writeln("</templateDeclaration>"); } override void visit(const Token token) { string tagName; switch (token.type) { case tok!"": return; case tok!"identifier": tagName = "identifier"; break; case tok!"doubleLiteral": tagName = "doubleLiteral"; break; case tok!"idoubleLiteral": tagName = "idoubleLiteral"; break; case tok!"floatLiteral": tagName = "floatLiteral"; break; case tok!"ifloatLiteral": tagName = "ifloatLiteral"; break; case tok!"intLiteral": tagName = "intLiteral"; break; case tok!"uintLiteral": tagName = "uintLiteral"; break; case tok!"longLiteral": tagName = "longLiteral"; break; case tok!"ulongLiteral": tagName = "ulongLiteral"; break; case tok!"realLiteral": tagName = "realLiteral"; break; case tok!"irealLiteral": tagName = "irealLiteral"; break; case tok!"characterLiteral": tagName = "characterLiteral"; break; case tok!"stringLiteral": tagName = "stringLiteral"; break; case tok!"dstringLiteral": tagName = "dstringLiteral"; break; case tok!"wstringLiteral": tagName = "wstringLiteral"; break; case tok!"scriptLine": tagName = "scriptLine"; break; case tok!"$": output.writeln("<dollar/>"); return; case tok!".": output.writeln("<dot/>"); return; default: output.writeln("<", str(token.type), "/>"); return; } output.writeln("<", tagName, ">", xmlEscape(token.text), "</", tagName, ">"); } override void visit(const Type type) { auto app = appender!string(); auto formatter = new Formatter!(typeof(app))(app); formatter.format(type); output.writeln("<type pretty=\"", xmlAttributeEscape(app.data), "\">"); type.accept(this); output.writeln("</type>"); } override void visit(const Type2 type2) { if (type2.builtinType != tok!"") { output.writeln("<type2>", str(type2.builtinType), "</type2>"); if (type2.typeIdentifierPart !is null) visit(type2.typeIdentifierPart); } else { output.writeln("<type2>"); type2.accept(this); output.writeln("</type2>"); } } override void visit(const TypeSuffix typeSuffix) { if (typeSuffix.star != tok!"") output.writeln("<typeSuffix type=\"*\"/>"); else if (typeSuffix.array) { if (typeSuffix.low is null && typeSuffix.type is null) output.writeln("<typeSuffix type=\"[]\"/>"); else { if (typeSuffix.low is null) { output.writeln("<typeSuffix type=\"[]\">"); visit(typeSuffix.type); output.writeln("</typeSuffix>"); } else { output.writeln("<typeSuffix type=\"[]\">"); if (typeSuffix.high !is null) { output.writeln("<low>"); dynamicDispatch(typeSuffix.low); output.writeln("</low>"); output.writeln("<high>"); dynamicDispatch(typeSuffix.high); output.writeln("</high>"); } else dynamicDispatch(typeSuffix.low); output.writeln("</typeSuffix>"); } } } else { visit(typeSuffix.delegateOrFunction); visit(typeSuffix.parameters); foreach (attr; typeSuffix.memberFunctionAttributes) { if (attr !is null) visit(attr); } } } override void visit(const UnaryExpression unaryExpression) { output.writeln("<unaryExpression>"); if (unaryExpression.prefix != tok!"") { output.writeln("<prefix>", xmlEscape(str(unaryExpression.prefix.type)), "</prefix>"); unaryExpression.unaryExpression.accept(this); } else { if (unaryExpression.suffix != tok!"") { assert(unaryExpression.suffix.text == ""); unaryExpression.unaryExpression.accept(this); output.writeln("<suffix>", str(unaryExpression.suffix.type), "</suffix>"); } else unaryExpression.accept(this); } output.writeln("</unaryExpression>"); } override void visit(const UnionDeclaration unionDeclaration) { output.writeln("<unionDeclaration line=\"", unionDeclaration.name.line, "\">"); if (unionDeclaration.name != tok!"") writeName(unionDeclaration.name.text); if (unionDeclaration.templateParameters !is null) visit(unionDeclaration.templateParameters); if (unionDeclaration.constraint !is null) visit(unionDeclaration.constraint); if (unionDeclaration.structBody !is null) visit(unionDeclaration.structBody); output.writeln("</unionDeclaration>"); } override void visit(const Unittest unittest_) { output.writeln("<unittest>"); unittest_.accept(this); output.writeln("</unittest>"); } override void visit(const VariableDeclaration variableDeclaration) { output.writeln("<variableDeclaration>"); writeDdoc(variableDeclaration.comment); variableDeclaration.accept(this); output.writeln("</variableDeclaration>"); } override void visit(const XorExpression xorExpression) { output.writeln("<xorExpression>"); output.writeln("<left>"); dynamicDispatch(xorExpression.left); output.writeln("</left>"); if (xorExpression.right !is null) { output.writeln("<right>"); dynamicDispatch(xorExpression.right); output.writeln("</right>"); } output.writeln("</xorExpression>"); } override void visit(const Index index) { output.writeln("<index>"); if (index.high) { output.writeln("<low>"); dynamicDispatch(index.low); output.writeln("</low>"); output.writeln("<high>"); dynamicDispatch(index.high); output.writeln("</high>"); } else dynamicDispatch(index.low); output.writeln("</index>"); } override void visit(const NamedArgument arg) { if (arg.name.text.length) output.writeln("<argument named=\"", arg.name.text, "\">"); else output.writeln("<argument>"); dynamicDispatch(arg.assignExpression); output.writeln("</argument>"); } // dfmt off override void visit(const AliasInitializer aliasInitializer) { mixin (tagAndAccept!"aliasInitializer"); } override void visit(const AliasThisDeclaration aliasThisDeclaration) { mixin (tagAndAccept!"aliasThisDeclaration"); } override void visit(const AnonymousEnumDeclaration anonymousEnumDeclaration) { mixin (tagAndAccept!"anonymousEnumDeclaration"); } override void visit(const ArgumentList argumentList) { mixin (tagAndAccept!"argumentList"); } override void visit(const NamedArgumentList argumentList) { mixin (tagAndAccept!"argumentList"); } override void visit(const Arguments arguments) { mixin (tagAndAccept!"arguments"); } override void visit(const ArrayInitializer arrayInitializer) { mixin (tagAndAccept!"arrayInitializer"); } override void visit(const ArrayLiteral arrayLiteral) { mixin (tagAndAccept!"arrayLiteral"); } override void visit(const ArrayMemberInitialization arrayMemberInitialization) { mixin (tagAndAccept!"arrayMemberInitialization"); } override void visit(const AsmAddExp asmAddExp) { mixin (tagAndAccept!"asmAddExp"); } override void visit(const AsmAndExp asmAndExp) { mixin (tagAndAccept!"asmAndExp"); } override void visit(const AsmBrExp asmBrExp) { mixin (tagAndAccept!"asmBrExp"); } override void visit(const AsmEqualExp asmEqualExp) { mixin (tagAndAccept!"asmEqualExp"); } override void visit(const AsmExp asmExp) { mixin (tagAndAccept!"asmExp"); } override void visit(const AsmLogAndExp asmLogAndExp) { mixin (tagAndAccept!"asmLogAndExp"); } override void visit(const AsmLogOrExp asmLogOrExp) { mixin (tagAndAccept!"asmLogOrExp"); } override void visit(const AsmMulExp asmMulExp) { mixin (tagAndAccept!"asmMulExp"); } override void visit(const AsmOrExp asmOrExp) { mixin (tagAndAccept!"asmOrExp"); } override void visit(const AsmPrimaryExp asmPrimaryExp) { mixin (tagAndAccept!"asmPrimaryExp"); } override void visit(const AsmRelExp asmRelExp) { mixin (tagAndAccept!"asmRelExp"); } override void visit(const AsmShiftExp asmShiftExp) { mixin (tagAndAccept!"asmShiftExp"); } override void visit(const AsmStatement asmStatement) { mixin (tagAndAccept!"asmStatement"); } override void visit(const AsmTypePrefix asmTypePrefix) { mixin (tagAndAccept!"asmTypePrefix"); } override void visit(const AsmUnaExp asmUnaExp) { mixin (tagAndAccept!"asmUnaExp"); } override void visit(const AsmXorExp asmXorExp) { mixin (tagAndAccept!"asmXorExp"); } override void visit(const AssocArrayLiteral assocArrayLiteral) { mixin (tagAndAccept!"assocArrayLiteral"); } override void visit(const AssertExpression assertExpression) { mixin (tagAndAccept!"assertExpression"); } override void visit(const AssertArguments assertArguments) { mixin (tagAndAccept!"assertArguments"); } override void visit(const AttributeDeclaration attributeDeclaration) { mixin (tagAndAccept!"attributeDeclaration"); } override void visit(const BaseClass baseClass) { mixin (tagAndAccept!"baseClass"); } override void visit(const BaseClassList baseClassList) { mixin (tagAndAccept!"baseClassList"); } override void visit(const BlockStatement blockStatement) { mixin (tagAndAccept!"blockStatement"); } override void visit(const CaseStatement caseStatement) { mixin (tagAndAccept!"caseStatement"); } override void visit(const CastExpression castExpression) { mixin (tagAndAccept!"castExpression"); } override void visit(const CastQualifier castQualifier) { mixin (tagAndAccept!"castQualifier"); } override void visit(const Catches catches) { mixin (tagAndAccept!"catches"); } override void visit(const CmpExpression cmpExpression) { mixin (tagAndAccept!"cmpExpression"); } override void visit(const CompileCondition compileCondition) { mixin (tagAndAccept!"compileCondition"); } override void visit(const Constraint constraint) { mixin (tagAndAccept!"constraint"); } override void visit(const Constructor constructor) { mixin (tagAndAccept!"constructor"); } override void visit(const Declaration declaration) { mixin (tagAndAccept!"declaration"); } override void visit(const DeclarationOrStatement declarationOrStatement) { mixin (tagAndAccept!"declarationOrStatement"); } override void visit(const DeclarationsAndStatements declarationsAndStatements) { mixin (tagAndAccept!"declarationsAndStatements"); } override void visit(const DeclaratorIdentifierList declaratorIdentifierList) { mixin (tagAndAccept!"declaratorIdentifierList"); } override void visit(const DefaultStatement defaultStatement) { mixin (tagAndAccept!"defaultStatement"); } override void visit(const DeleteExpression deleteExpression) { mixin (tagAndAccept!"deleteExpression"); } override void visit(const DeleteStatement deleteStatement) { mixin (tagAndAccept!"deleteStatement"); } override void visit(const Destructor destructor) { mixin (tagAndAccept!"destructor"); } override void visit(const DoStatement doStatement) { mixin (tagAndAccept!"doStatement"); } override void visit(const EnumBody enumBody) { mixin (tagAndAccept!"enumBody"); } override void visit(const EponymousTemplateDeclaration eponymousTemplateDeclaration) { mixin (tagAndAccept!"eponymousTemplateDeclaration"); } override void visit(const Expression expression) { mixin (tagAndAccept!"expression"); } override void visit(const ExpressionStatement expressionStatement) { mixin (tagAndAccept!"expressionStatement"); } override void visit(const FinalSwitchStatement finalSwitchStatement) { mixin (tagAndAccept!"finalSwitchStatement"); } override void visit(const ForeachTypeList foreachTypeList) { mixin (tagAndAccept!"foreachTypeList"); } override void visit(const FunctionAttribute functionAttribute) { mixin (tagAndAccept!"functionAttribute"); } override void visit(const FunctionBody functionBody) { mixin (tagAndAccept!"functionBody"); } override void visit(const FunctionCallExpression functionCallExpression) { mixin (tagAndAccept!"functionCallExpression"); } override void visit(const IdentifierChain identifierChain) { mixin (tagAndAccept!"identifierChain"); } override void visit(const IdentifierOrTemplateChain identifierOrTemplateChain) { mixin (tagAndAccept!"identifierOrTemplateChain"); } override void visit(const IdentifierOrTemplateInstance identifierOrTemplateInstance) { mixin (tagAndAccept!"identifierOrTemplateInstance"); } override void visit(const ImportBindings importBindings) { mixin (tagAndAccept!"importBindings"); } override void visit(const ImportDeclaration importDeclaration) { mixin (tagAndAccept!"importDeclaration"); } override void visit(const ImportExpression importExpression) { mixin (tagAndAccept!"importExpression"); } override void visit(const IndexExpression indexExpression) { mixin (tagAndAccept!"indexExpression"); } override void visit(const InStatement inStatement) { mixin (tagAndAccept!"inStatement"); } override void visit(const InContractExpression inContractExpression) { mixin (tagAndAccept!"inContractExpression"); } override void visit(const InOutContractExpression inOutContractExpression) { mixin (tagAndAccept!"inOutContractExpression"); } override void visit(const KeyValuePairs keyValuePairs) { mixin (tagAndAccept!"keyValuePairs"); } override void visit(const MixinExpression mixinExpression) { mixin (tagAndAccept!"mixinExpression"); } override void visit(const MixinTemplateDeclaration mixinTemplateDeclaration) { mixin (tagAndAccept!"mixinTemplateDeclaration"); } override void visit(const MixinTemplateName mixinTemplateName) { mixin (tagAndAccept!"mixinTemplateName"); } override void visit(const ModuleDeclaration moduleDeclaration) { mixin (tagAndAccept!"moduleDeclaration"); } override void visit(const LastCatch lastCatch) { mixin (tagAndAccept!"lastCatch"); } override void visit(const NewExpression newExpression) { mixin (tagAndAccept!"newExpression"); } override void visit(const NonVoidInitializer nonVoidInitializer) { mixin (tagAndAccept!"nonVoidInitializer"); } override void visit(const Operands operands) { mixin (tagAndAccept!"operands"); } override void visit(const OrExpression orExpression) { mixin (tagAndAccept!"orExpression"); } override void visit(const OutStatement outStatement) { mixin (tagAndAccept!"outStatement"); } override void visit(const MixinDeclaration mixinDeclaration) { mixin (tagAndAccept!"mixinDeclaration"); } override void visit(const Parameters parameters) { mixin (tagAndAccept!"parameters"); } override void visit(const Postblit postblit) { mixin (tagAndAccept!"postblit"); } override void visit(const NewAnonClassExpression newAnonClassExpression) { mixin (tagAndAccept!"newAnonClassExpression"); } override void visit(const PragmaDeclaration pragmaDeclaration) { mixin (tagAndAccept!"pragmaDeclaration"); } override void visit(const PragmaExpression pragmaExpression) { mixin (tagAndAccept!"pragmaExpression"); } override void visit(const PrimaryExpression primaryExpression) { mixin (tagAndAccept!"primaryExpression"); } override void visit(const Register register) { mixin (tagAndAccept!"register"); } override void visit(const ScopeGuardStatement scopeGuardStatement) { mixin (tagAndAccept!"scopeGuardStatement"); } override void visit(const SharedStaticConstructor sharedStaticConstructor) { mixin (tagAndAccept!"sharedStaticConstructor"); } override void visit(const SharedStaticDestructor sharedStaticDestructor) { mixin (tagAndAccept!"sharedStaticDestructor"); } override void visit(const StatementNoCaseNoDefault statementNoCaseNoDefault) { mixin (tagAndAccept!"statementNoCaseNoDefault"); } override void visit(const StaticAssertDeclaration staticAssertDeclaration) { mixin (tagAndAccept!"staticAssertDeclaration"); } override void visit(const StaticAssertStatement staticAssertStatement) { mixin (tagAndAccept!"staticAssertStatement"); } override void visit(const StaticConstructor staticConstructor) { mixin (tagAndAccept!"staticConstructor"); } override void visit(const StaticDestructor staticDestructor) { mixin (tagAndAccept!"staticDestructor"); } override void visit(const StaticIfCondition staticIfCondition) { mixin (tagAndAccept!"staticIfCondition"); } override void visit(const StorageClass storageClass) { mixin (tagAndAccept!"storageClass"); } override void visit(const StructBody structBody) { mixin (tagAndAccept!"structBody"); } override void visit(const StructInitializer structInitializer) { mixin (tagAndAccept!"structInitializer"); } override void visit(const StructMemberInitializers structMemberInitializers) { mixin (tagAndAccept!"structMemberInitializers"); } override void visit(const StructMemberInitializer structMemberInitializer) { mixin (tagAndAccept!"structMemberInitializer"); } override void visit(const SwitchStatement switchStatement) { mixin (tagAndAccept!"switchStatement"); } override void visit(const Symbol symbol) { mixin (tagAndAccept!"symbol"); } override void visit(const SynchronizedStatement synchronizedStatement) { mixin (tagAndAccept!"synchronizedStatement"); } override void visit(const Statement statement) { mixin (tagAndAccept!"statement"); } override void visit(const TemplateArgumentList templateArgumentList) { mixin (tagAndAccept!"templateArgumentList"); } override void visit(const TemplateArguments templateArguments) { mixin (tagAndAccept!"templateArguments"); } override void visit(const TemplateArgument templateArgument) { mixin (tagAndAccept!"templateArgument"); } override void visit(const TemplateMixinExpression templateMixinExpression) { mixin (tagAndAccept!"templateMixinExpression"); } override void visit(const TemplateParameterList templateParameterList) { mixin (tagAndAccept!"templateParameterList"); } override void visit(const TemplateParameters templateParameters) { mixin (tagAndAccept!"templateParameters"); } override void visit(const TemplateParameter templateParameter) { mixin (tagAndAccept!"templateParameter"); } override void visit(const TemplateSingleArgument templateSingleArgument) { mixin (tagAndAccept!"templateSingleArgument"); } override void visit(const TemplateThisParameter templateThisParameter) { mixin (tagAndAccept!"templateThisParameter"); } override void visit(const TemplateTupleParameter templateTupleParameter) { mixin (tagAndAccept!"templateTupleParameter"); } override void visit(const TemplateTypeParameter templateTypeParameter) { mixin (tagAndAccept!"templateTypeParameter"); } override void visit(const TemplateValueParameterDefault templateValueParameterDefault) { mixin (tagAndAccept!"templateValueParameterDefault"); } override void visit(const TemplateValueParameter templateValueParameter) { mixin (tagAndAccept!"templateValueParameter"); } override void visit(const TernaryExpression ternaryExpression) { mixin (tagAndAccept!"ternaryExpression"); } override void visit(const TypeIdentifierPart typeIdentifierPart) { mixin (tagAndAccept!"typeIdentifierPart"); } override void visit(const ThrowExpression throwExpression) { mixin (tagAndAccept!"throwExpression"); } override void visit(const TryStatement tryStatement) { mixin (tagAndAccept!"tryStatement"); } override void visit(const TemplateInstance templateInstance) { mixin (tagAndAccept!"templateInstance"); } override void visit(const TypeofExpression typeofExpression) { mixin (tagAndAccept!"typeofExpression"); } override void visit(const TypeSpecialization typeSpecialization) { mixin (tagAndAccept!"typeSpecialization"); } override void visit(const TraitsExpression traitsExpression) { mixin (tagAndAccept!"traitsExpression"); } override void visit(const Vector vector) { mixin (tagAndAccept!"vector"); } override void visit(const VersionCondition versionCondition) { mixin (tagAndAccept!"versionCondition"); } override void visit(const VersionSpecification versionSpecification) { mixin (tagAndAccept!"versionSpecification"); } override void visit(const WhileStatement whileStatement) { mixin (tagAndAccept!"whileStatement"); } override void visit(const WithStatement withStatement) { mixin (tagAndAccept!"withStatement"); } override void visit(const TypeidExpression typeidExpression) { mixin (tagAndAccept!"typeidExpression"); } // dfmt on alias visit = ASTVisitor.visit; private static string xmlEscape(string s) { return s.translate(['<' : "&lt;", '>' : "&gt;", '&' : "&amp;"]); } private static string xmlAttributeEscape(string s) { return s.translate(['<' : "&lt;", '>' : "&gt;", '&' : "&amp;", '\"' : "&quot;", '\'' : "&apos;"]); } private void writeName(string name) { output.write("<name>", name, "</name>"); } private void writeDdoc(string comment) { if (comment.ptr is null) return; output.writeln("<ddoc>", xmlEscape(comment), "</ddoc>"); } /** * File that output is written to. */ File output; } private: template tagAndAccept(string tagName) { immutable tagAndAccept = `output.writeln("<` ~ tagName ~ `>");` ~ tagName ~ `.accept(this);` ~ `output.writeln("</` ~ tagName ~ `>");`; }
D
instance DIA_Udar_EXIT(C_Info) { npc = PAL_268_Udar; nr = 999; condition = DIA_Udar_EXIT_Condition; information = DIA_Udar_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_Udar_EXIT_Condition() { if(Kapitel < 4) { return TRUE; }; }; func void DIA_Udar_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_Udar_Hello(C_Info) { npc = PAL_268_Udar; nr = 2; condition = DIA_Udar_Hello_Condition; information = DIA_Udar_Hello_Info; important = TRUE; }; func int DIA_Udar_Hello_Condition() { if(Npc_IsInState(self,ZS_Talk) && (self.aivar[AIV_TalkedToPlayer] == FALSE) && (Kapitel < 4)) { return TRUE; }; }; func void DIA_Udar_Hello_Info() { AI_Output(self,other,"DIA_Udar_Hello_09_00"); //Тебе крупно повезло, когда ты пробирался сюда. Я чуть не застрелил тебя. AI_Output(other,self,"DIA_Udar_Hello_15_01"); //Тогда, наверное, я должен радоваться, что у тебя такой острый глаз. AI_Output(self,other,"DIA_Udar_Hello_09_02"); //Не стоит трепаться попусту. Поговори с Сенгратом, если тебе что-нибудь нужно. AI_StopProcessInfos(self); }; instance DIA_Udar_YouAreBest(C_Info) { npc = PAL_268_Udar; nr = 3; condition = DIA_Udar_YouAreBest_Condition; information = DIA_Udar_YouAreBest_Info; permanent = FALSE; description = "Я слышал, что ты ЛУЧШИЙ арбалетчик!"; }; func int DIA_Udar_YouAreBest_Condition() { if(Npc_KnowsInfo(other,DIA_Keroloth_Udar) && (KAPITELORCATC == FALSE)) { return 1; }; }; func void DIA_Udar_YouAreBest_Info() { AI_Output(other,self,"DIA_Udar_YouAreBest_15_00"); //Я слышал, что ты ЛУЧШИЙ арбалетчик во всей округе! AI_Output(self,other,"DIA_Udar_YouAreBest_09_01"); //Ну, если так говорят, возможно, это правда. Что тебе нужно? }; instance DIA_Udar_TeachMe(C_Info) { npc = PAL_268_Udar; nr = 3; condition = DIA_Udar_TeachMe_Condition; information = DIA_Udar_TeachME_Info; permanent = FALSE; description = "Научи меня стрелять из арбалета."; }; func int DIA_Udar_TeachMe_Condition() { if(Npc_KnowsInfo(other,DIA_Udar_YouAreBest) && (Udar_TeachPlayer != TRUE) && (KAPITELORCATC == FALSE)) { return 1; }; }; func void DIA_Udar_TeachME_Info() { AI_Output(other,self,"DIA_Udar_Teacher_15_00"); //Научи меня стрелять из арбалета. AI_Output(self,other,"DIA_Udar_Teacher_09_01"); //Убирайся! Вокруг замка бегает достаточно мишеней, на которых можно потренироваться. }; instance DIA_Udar_ImGood(C_Info) { npc = PAL_268_Udar; nr = 3; condition = DIA_Udar_ImGood_Condition; information = DIA_Udar_ImGood_Info; permanent = FALSE; description = "Самый великий арбалетчик - я."; }; func int DIA_Udar_ImGood_Condition() { if(Npc_KnowsInfo(other,DIA_Udar_YouAreBest) && (KAPITELORCATC == FALSE)) { return 1; }; }; func void DIA_Udar_ImGood_Info() { AI_Output(other,self,"DIA_Udar_ImGood_15_00"); //Самый великий арбалетчик - я. AI_Output(self,other,"DIA_Udar_ImGood_09_01"); //(смеется) Да, ты прав! AI_Output(self,other,"DIA_Udar_ImGood_09_02"); //Что ж, если ты хочешь поучиться, я могу помочь. Udar_TeachPlayer = TRUE; B_LogEntry(TOPIC_Teacher_OC,"Удар может обучить меня искусству стрельбы из арбалета."); }; instance DIA_Udar_Teach(C_Info) { npc = PAL_268_Udar; nr = 3; condition = DIA_Udar_Teach_Condition; information = DIA_Udar_Teach_Info; permanent = TRUE; description = "Я хочу поучиться у тебя."; }; func int DIA_Udar_Teach_Condition() { if((Udar_TeachPlayer == TRUE) && (KAPITELORCATC == FALSE)) { return TRUE; }; }; func void DIA_Udar_Teach_Info() { AI_Output(other,self,"DIA_Udar_Teach_15_00"); //Я хочу учиться у тебя. AI_Output(self,other,"DIA_Udar_Teach_09_01"); //Ладно, учись! Info_ClearChoices(DIA_Udar_Teach); Info_AddChoice(DIA_Udar_Teach,Dialog_Back,DIA_Udar_Teach_Back); Info_AddChoice(DIA_Udar_Teach,b_buildlearnstringforfight(PRINT_LearnCrossBow1,B_GetLearnCostTalent(other,NPC_TALENT_CROSSBOW,1)),DIA_Udar_Teach_CROSSBOW_1); Info_AddChoice(DIA_Udar_Teach,b_buildlearnstringforfight(PRINT_LearnCrossBow5,B_GetLearnCostTalent(other,NPC_TALENT_CROSSBOW,5)),DIA_Udar_Teach_CROSSBOW_5); }; func void DIA_Udar_Teach_Back() { Info_ClearChoices(DIA_Udar_Teach); }; func void B_Udar_TeachNoMore1() { AI_Output(self,other,"B_Udar_TeachNoMore1_09_00"); //Ты уже знаешь основы - на большее у нас нет времени. }; func void B_Udar_TeachNoMore2() { AI_Output(self,other,"B_Udar_TeachNoMore2_09_00"); //Чтобы улучшить владение этим оружием, тебе лучше поискать более подходящего учителя. }; func void DIA_Udar_Teach_CROSSBOW_1() { B_TeachFightTalentPercent(self,other,NPC_TALENT_CROSSBOW,1,60); if(other.HitChance[NPC_TALENT_CROSSBOW] >= 60) { B_Udar_TeachNoMore1(); if(Npc_GetTalentSkill(other,NPC_TALENT_CROSSBOW) == 1) { B_Udar_TeachNoMore2(); }; }; Info_AddChoice(DIA_Udar_Teach,b_buildlearnstringforfight(PRINT_LearnCrossBow1,B_GetLearnCostTalent(other,NPC_TALENT_CROSSBOW,1)),DIA_Udar_Teach_CROSSBOW_1); }; func void DIA_Udar_Teach_CROSSBOW_5() { B_TeachFightTalentPercent(self,other,NPC_TALENT_CROSSBOW,5,60); if(other.HitChance[NPC_TALENT_CROSSBOW] >= 60) { B_Udar_TeachNoMore1(); if(Npc_GetTalentSkill(other,NPC_TALENT_CROSSBOW) == 1) { B_Udar_TeachNoMore2(); }; }; Info_AddChoice(DIA_Udar_Teach,b_buildlearnstringforfight(PRINT_LearnCrossBow5,B_GetLearnCostTalent(other,NPC_TALENT_CROSSBOW,5)),DIA_Udar_Teach_CROSSBOW_5); }; instance DIA_Udar_Perm(C_Info) { npc = PAL_268_Udar; nr = 11; condition = DIA_Udar_Perm_Condition; information = DIA_Udar_Perm_Info; permanent = FALSE; description = "Как дела в замке?"; }; func int DIA_Udar_Perm_Condition() { if(Kapitel <= 3) { return TRUE; }; }; func void DIA_Udar_Perm_Info() { AI_Output(other,self,"DIA_Udar_Perm_15_00"); //Как дела в замке? AI_Output(self,other,"DIA_Udar_Perm_09_01"); //Некоторые из наших парней посвящают себя тренировкам, но, в принципе, все мы просто ждем, когда что-нибудь произойдет. AI_Output(self,other,"DIA_Udar_Perm_09_02"); //Эта неопределенность изматывает. Такова стратегия этих чертовых орков. Они будут выжидать, пока наше терпение не лопнет. }; instance DIA_Udar_Ring(C_Info) { npc = PAL_268_Udar; nr = 11; condition = DIA_Udar_Ring_Condition; information = DIA_Udar_Ring_Info; permanent = FALSE; description = "Вот, я принес тебе кольцо Тенгрона."; }; func int DIA_Udar_Ring_Condition() { if((Npc_HasItems(other,ItRi_Tengron) >= 1) && (KAPITELORCATC == FALSE)) { return TRUE; }; }; func void DIA_Udar_Ring_Info() { AI_Output(other,self,"DIA_Udar_Ring_15_00"); //Вот, я принес тебе кольцо Тенгрона. Оно будет защищать тебя. Тенгрон говорит, что он когда-нибудь вернется и заберет это кольцо назад. AI_Output(self,other,"DIA_Udar_Ring_09_01"); //Что? Да ты знаешь, что это за кольцо? Он получил эту награду за мужество, проявленное в бою. AI_Output(self,other,"DIA_Udar_Ring_09_02"); //Говоришь, что он хочет забрать его назад? Если такова воля Инноса, так и будет. Если такова воля Инноса... B_GiveInvItems(other,self,ItRi_Tengron,1); TengronRing = TRUE; B_GivePlayerXP(XP_TengronRing); }; instance DIA_Udar_KAP4_EXIT(C_Info) { npc = PAL_268_Udar; nr = 999; condition = DIA_Udar_KAP4_EXIT_Condition; information = DIA_Udar_KAP4_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_Udar_KAP4_EXIT_Condition() { if(Kapitel == 4) { return TRUE; }; }; func void DIA_Udar_KAP4_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_Udar_Kap4WiederDa(C_Info) { npc = PAL_268_Udar; nr = 40; condition = DIA_Udar_Kap4WiederDa_Condition; information = DIA_Udar_Kap4WiederDa_Info; important = TRUE; }; func int DIA_Udar_Kap4WiederDa_Condition() { if((Kapitel >= 4) && (KAPITELORCATC == FALSE)) { return TRUE; }; }; func void DIA_Udar_Kap4WiederDa_Info() { AI_Output(self,other,"DIA_Udar_Kap4WiederDa_09_00"); //Хорошо, что ты пришел. Здесь творится сущий ад. if(hero.guild != GIL_DJG) { AI_Output(other,self,"DIA_Udar_Kap4WiederDa_15_01"); //Что случилось? AI_Output(self,other,"DIA_Udar_Kap4WiederDa_09_02"); //Охотники на драконов ошиваются по всему замку и бахвалятся, что могут решить проблему с драконами. AI_Output(self,other,"DIA_Udar_Kap4WiederDa_09_03"); //Но я скажу тебе - судя по тому, как они выглядят, они не в состоянии убить даже старого больного снеппера. }; AI_Output(self,other,"DIA_Udar_Kap4WiederDa_09_04"); //Многие из нас уже отчаялись и уже не верят, что нам удастся выбраться отсюда живыми. }; instance DIA_Udar_Sengrath(C_Info) { npc = PAL_268_Udar; nr = 41; condition = DIA_Udar_Sengrath_Condition; information = DIA_Udar_Sengrath_Info; description = "По-моему, вы вдвоем стояли здесь на часах?"; }; func int DIA_Udar_Sengrath_Condition() { if((Kapitel >= 4) && Npc_KnowsInfo(other,DIA_Udar_Kap4WiederDa) && (Sengrath_Missing == TRUE) && (KAPITELORCATC == FALSE)) { return TRUE; }; }; func void DIA_Udar_Sengrath_Info() { AI_Output(other,self,"DIA_Udar_Sengrath_15_00"); //По-моему, вы вдвоем стояли здесь на часах? AI_Output(self,other,"DIA_Udar_Sengrath_09_01"); //Теперь нет. Сенграт стоял у края стены и заснул. AI_Output(self,other,"DIA_Udar_Sengrath_09_02"); //Он выронил свой арбалет, и тот упал вниз. AI_Output(self,other,"DIA_Udar_Sengrath_09_03"); //Мы видели, как один из орков схватил его и растворился в темноте. AI_Output(self,other,"DIA_Udar_Sengrath_09_04"); //Сенграт проснулся и побежал в ночь по направлению к частоколу орков. С тех пор его никто не видел. AI_Output(self,other,"DIA_Udar_Sengrath_09_05"); //Да пребудет с нами Иннос! Log_CreateTopic(TOPIC_Sengrath_Missing,LOG_MISSION); Log_SetTopicStatus(TOPIC_Sengrath_Missing,LOG_Running); B_LogEntry(TOPIC_Sengrath_Missing,"Удар, гвардеец замка, скучает по своему приятелю Сенграту. Последний раз он видел его как-то поздно ночью, тот направлялся к забору орков, чтобы вернуть свой арбалет."); }; instance DIA_Udar_SENGRATHGEFUNDEN(C_Info) { npc = PAL_268_Udar; nr = 42; condition = DIA_Udar_SENGRATHGEFUNDEN_Condition; information = DIA_Udar_SENGRATHGEFUNDEN_Info; description = "Я нашел Сенграта."; }; func int DIA_Udar_SENGRATHGEFUNDEN_Condition() { if((Kapitel >= 4) && Npc_KnowsInfo(other,DIA_Udar_Sengrath) && Npc_HasItems(other,ItRw_SengrathsArmbrust_MIS) && (KAPITELORCATC == FALSE)) { return TRUE; }; }; func void DIA_Udar_SENGRATHGEFUNDEN_Info() { AI_Output(other,self,"DIA_Udar_SENGRATHGEFUNDEN_15_00"); //Я нашел Сенграта. AI_Output(self,other,"DIA_Udar_SENGRATHGEFUNDEN_09_01"); //Да? И где же он? AI_Output(other,self,"DIA_Udar_SENGRATHGEFUNDEN_15_02"); //Он мертв. Вот его арбалет. Он был при нем. AI_Output(self,other,"DIA_Udar_SENGRATHGEFUNDEN_09_03"); //Должно быть, он смог вернуть свой арбалет, но орки все же прикончили его. AI_Output(self,other,"DIA_Udar_SENGRATHGEFUNDEN_09_04"); //Чертов дурак. Я знал, что так будет. Мы все тут погибнем. TOPIC_END_Sengrath_Missing = TRUE; B_GivePlayerXP(XP_SengrathFound); }; instance DIA_Udar_BADFEELING(C_Info) { npc = PAL_268_Udar; nr = 50; condition = DIA_Udar_BADFEELING_Condition; information = DIA_Udar_BADFEELING_Info; important = TRUE; permanent = TRUE; }; func int DIA_Udar_BADFEELING_Condition() { if((Npc_RefuseTalk(self) == FALSE) && Npc_IsInState(self,ZS_Talk) && Npc_KnowsInfo(other,DIA_Udar_SENGRATHGEFUNDEN) && (Kapitel >= 4) && (KAPITELORCATC == FALSE)) { return TRUE; }; }; func void DIA_Udar_BADFEELING_Info() { if(MIS_OCGateOpen == TRUE) { AI_Output(self,other,"DIA_Udar_BADFEELING_09_00"); //Еще одна такая неподготовленная атака и нам конец. } else if(MIS_AllDragonsDead == TRUE) { AI_Output(self,other,"DIA_Udar_BADFEELING_09_01"); //Орки очень нервничают. Что-то очень напугало их. Я чувствую это. } else { AI_Output(self,other,"DIA_Udar_BADFEELING_09_02"); //Мне очень не нравится все это. }; Npc_SetRefuseTalk(self,30); }; instance DIA_Udar_KAP5_EXIT(C_Info) { npc = PAL_268_Udar; nr = 999; condition = DIA_Udar_KAP5_EXIT_Condition; information = DIA_Udar_KAP5_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_Udar_KAP5_EXIT_Condition() { if(Kapitel == 5) { return TRUE; }; }; func void DIA_Udar_KAP5_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_Udar_KAP6_EXIT(C_Info) { npc = PAL_268_Udar; nr = 999; condition = DIA_Udar_KAP6_EXIT_Condition; information = DIA_Udar_KAP6_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_Udar_KAP6_EXIT_Condition() { if(Kapitel == 6) { return TRUE; }; }; func void DIA_Udar_KAP6_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_Udar_PICKPOCKET(C_Info) { npc = PAL_268_Udar; nr = 900; condition = DIA_Udar_PICKPOCKET_Condition; information = DIA_Udar_PICKPOCKET_Info; permanent = TRUE; description = PICKPOCKET_COMM; }; func int DIA_Udar_PICKPOCKET_Condition() { return C_Beklauen(20,15); }; func void DIA_Udar_PICKPOCKET_Info() { Info_ClearChoices(DIA_Udar_PICKPOCKET); Info_AddChoice(DIA_Udar_PICKPOCKET,Dialog_Back,DIA_Udar_PICKPOCKET_BACK); Info_AddChoice(DIA_Udar_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Udar_PICKPOCKET_DoIt); }; func void DIA_Udar_PICKPOCKET_DoIt() { B_Beklauen(); INNOSCRIMECOUNT = INNOSCRIMECOUNT + 1; Info_ClearChoices(DIA_Udar_PICKPOCKET); }; func void DIA_Udar_PICKPOCKET_BACK() { Info_ClearChoices(DIA_Udar_PICKPOCKET); }; instance DIA_UDAR_CAPTURED(C_Info) { npc = PAL_268_Udar; nr = 2; condition = dia_udar_captured_condition; information = dia_udar_captured_info; permanent = TRUE; important = TRUE; }; func int dia_udar_captured_condition() { if(Npc_IsInState(self,ZS_Talk) && (KAPITELORCATC == TRUE) && (PALADINCASTELFREE == FALSE)) { return TRUE; }; }; func void dia_udar_captured_info() { if((MIS_NATANDOLG == LOG_Running) && (UDARKNOWSNATAN == FALSE)) { B_GivePlayerXP(100); AI_Output(self,other,"DIA_Udar_Captured_01_01"); //Как? (удивленно) И ты здесь? Вот уж не думал, что орки пустят тебя сюда. AI_Output(other,self,"DIA_Udar_Captured_01_04"); //Вы еще не думали о том, чтобы смыться отсюда? AI_Output(self,other,"DIA_Udar_Captured_01_05"); //Эх...(обреченно) Если у нас был хотя бы один шанс это сделать - мы бы уже давно это сделали. AI_Output(other,self,"DIA_Udar_Captured_01_06"); //Полагаю, скоро у вас будет эта возможность. AI_Output(other,self,"DIA_Udar_Captured_01_08"); //А пока скажи - ты знаешь паладина Натана? AI_Output(self,other,"DIA_Udar_Captured_01_09"); //Натана? Да, знаю, конечно. AI_Output(other,self,"DIA_Udar_Captured_01_10"); //Он сказал, что ты когда-то спас ему жизнь. Это так? AI_Output(self,other,"DIA_Udar_Captured_01_11"); //Да! И после всего случившегося, бедный парень почему-то вдолбил себе в голову, что должен непременно отплатить мне тем же самым. AI_Output(self,other,"DIA_Udar_Captured_01_12"); //Хотя я ему не раз говорил, что на моем месте он бы поступил точно так же. AI_Output(self,other,"DIA_Udar_Captured_01_13"); //Но он и слушать меня не хотел! Даже отправился вместе со мной в эту экспедицию, чтобы иметь здесь шанс вернуть мне свой долг чести. AI_Output(self,other,"DIA_Udar_Captured_01_15"); //Ты его тоже знаешь? AI_Output(other,self,"DIA_Udar_Captured_01_16"); //Да, паладин Натан сейчас также находится в Долине Рудников. AI_Output(self,other,"DIA_Udar_Captured_01_17"); //Правда? (грустно) Надеюсь, он не натворит глупостей. B_LogEntry(TOPIC_NATANDOLG,"Я спросил Удара о паладине Натане, и он подтвердил, что действительно когда-то спас жизнь этому парню. Однако Удар был крайне опечален тем, что Натан сейчас находится в Долине Рудников. По его словам, Натан слишком импульсивен, и Удар боится, что желание парня отдать свой долг чести во чтобы то ни стало может плохо для него закончиться."); UDARKNOWSNATAN = TRUE; AI_StopProcessInfos(self); } else { B_Say(self,other,"$NOTNOW"); AI_StopProcessInfos(self); }; };
D
/** * Быстрый поиск в именах файлов Win 32/64, Linux 32/64 * * MGW 26.04.2014 18:56:44 * * Программа состоит из двух частей: * * ffc.exe - Консольная. Создаёт индексый файл. * ff.exe - GUI. Поиск по индексному файлу и визуализация. * * Компиляция Linux 32/64 где -mXX соответственно -m32 или -m64: * * dmd ff.d asc1251.d qte.d -mXX -release -O -L-ldl -offf.exe * dmd ffc.d asc1251.d -mXX -release -O -L-ldl -offfc.exe * * Компиляция Windows 32/64 где -mXX соответственно -m32 или -m64: * * dmd ff.d asc1251.d qte.d -mXX -release -O -offf.exe * dmd ffc.d asc1251.d -mXX -release -O -offfc.exe * * */ import std.datetime; import core.runtime; // Обработка входных параметров import asc1251; import std.path; import std.file; import std.conv; import std.stdio; import std.string; import std.file: isDir; import std.c.string; import std.datetime; import std.process; import core.sys.windows.windows; import qte; // Работа с Qt import std.ascii; // import std.parallelism; QString tmpQs; // Временная строка для всего на свете QTextCodec UTF_8; // Кодек Linux QTextCodec WIN_1251; // Кодек Windows const int wr = 1000; int mNamelength; // Расскраска для виджетов string strElow = "background: #FCFDC6"; //#F8FFA1"; string strBlue = "background: #ACFFF2"; QApplication app; // Основной цикл Qt ClassMain wd_Main; char[] mPath[]; // массив Путей. Номер соответствует полнуму пути size_t iPath[]; // Массив списка длинн struct StNameFile { size_t FullPath; // Полный путь из массива mPath char[] NameFile; // Имя файла } string nameFileIndex; // Имя файла индекса StNameFile mName[]; // массив имен файлов char razd = '|'; // size_t vec[1000]; // вектор кеша на строки до 1000 символов bool runFind; // Искать или нет // Записать строку в QString tmpQs QString tmpQsSet(string s) { char strBuf[1000]; // Буфер под строку size_t dl = s.length; sprintf(cast(char*)strBuf.ptr, cast(char*)s.ptr); strBuf[dl] = '\0'; tmpQs.toUnicode(cast(char*)strBuf.ptr, UTF_8); return tmpQs; } // Обработка кнопки Поиска extern (C) void onKnFind() { wd_Main.ViewStrs(); } // Обработка кнопки Стоп extern (C) void onKnStop() { wd_Main.knpStop(); } // Обработка кнопки Word extern (C) void onKnOpen() { wd_Main.knpWord(); } // Обработка кнопки ОткрытьКаталог extern (C) void onOpenDir() { wd_Main.knpOpenDir(); } // Обрботка события, выделение текста в QTextEdit extern (C) void onChText() { msgbox("Есть событие с QTextEdit"); } // Обрботка события, F1 - Инструкция extern (C) void onF1() { // wd_Main.loadIndex(); } /* bool fShowMain; extern (C) void onLoadFile() { try { if(!fShowMain) { fShowMain = true; wd_Main.loadIndex(); } // writeln("--1--"); // wd_Main.loadIndex(); } catch { } } */ // Обрботка события, Enter - Поиск extern (C) void onEnter() { msgbox("Событие Enter - Поиск"); } // AboutQt extern (C) void onAboutQt() { app.aboutQt(); } // About Program extern (C) void onAboutProgram() { // writeln("extern (C) void onAboutProgram()"); msgbox("<h2><p align=center><i><u><font color=red>FF - быстрый поиск файла.</font></i></u></p></h2> <p><b>MGW © 2014г. (mgw@yandex.ru)</b></p> <p>Ver 1.0 Windows 32/64 and Linux 32/64</p> <hr> Source: <ol> <li>DMD 32/64 v2.065 <A HREF='http://dlang.org/'>http://dlang.org</A></li> <li>QtE 32/64 for D v1.3 <A HREF='http://qte.ucoz.ru/'>http://qte.ucoz.ru</A></li> <li>Qt 32/64 v8.x</li> </ol> <hr> <p> Программа состоит из двух частей: <ol> <li>ffc.exe - Консольная. Создаёт индексый файл.</li> <li>ff.exe - GUI. Поиск по индексному файлу и визуализация.</li> </ol> </p> <hr> <p>Компиляция Linux 32/64 где -mXX соответственно -m32 или -m64:</p> <ol> <li>dmd ff.d asc1251.d qte.d -mXX -release -O -L-ldl -offf.exe</li> <li>dmd ffc.d asc1251.d -mXX -release -O -L-ldl -offfc.exe</li> </ol> <p>Компиляция Windows 32/64 где -mXX соответственно -m32 или -m64:</p> <ol> <li>dmd ff.d asc1251.d qte.d -mXX -release -O -offf.exe</li> <li>dmd ffc.d asc1251.d -mXX -release -O -offfc.exe</li> </ol> ", "О программе FF"); } // Основная форма class ClassMain: QMainWindow { gWidget wd_main; // Главное окно QLabel lb_capt1, lb_capt2; // Подсказка QLineEdit le_s1,le_s2,le_s3,le_s4; // 2 x 2 поля ввода строк поиска gPushButton kn_Find; // Кнопка старта поиска QTextEdit te_list; // Вывод результата QStatusBar sb_pbar; // Статус бар QHBoxLayout lh_param; // Строка параметров QHBoxLayout lh_button; // Строка кнопок QVBoxLayout lv_main; // Вертикальный выравниватель QCheckBox cb_12, cb_23; QProgressBar prb_prog; gPushButton kn_Edit, kn_Word, kn_Excel, kn_PDF, kn_Help, kn_Exit; QFont f1; // Центральная строка меню QMenuBar menuBar; // Выполнители QAction act11; QAction act12; QAction act13; QAction act14; QAction act15; QAction act21; QAction act22; QAction act23; // Вертикальное меню QMenu menu11; QMenu menu12; // ---------------------------------------------------------- this() { super(); wd_main = new gWidget(this, 0); lh_param = new QHBoxLayout(); lh_button = new QHBoxLayout(); lv_main = new QVBoxLayout(); sb_pbar = new QStatusBar(this); te_list = new QTextEdit(null); le_s1 = new QLineEdit(null); cb_12 = new QCheckBox(null); le_s2 = new QLineEdit(null); le_s2.setStyleSheet(tmpQsSet(strElow)); cb_23 = new QCheckBox(null); le_s3 = new QLineEdit(null); le_s3.setStyleSheet(tmpQsSet(strElow)); le_s4 = new QLineEdit(null); le_s4.setStyleSheet(tmpQsSet(strElow)); tmpQsSet("Если выключен = ищется любая комбинайия левой И правой строки\n Если включен, то только левая ИЛИ только правая.\n Регистр не важен."); cb_23.setToolTip(tmpQs); tmpQsSet("Подстрока в ПУТИ файла. Регистр не важен."); le_s2.setToolTip(tmpQs); tmpQsSet("Подстрока в ИМЕНИ файла. Регистр не важен."); le_s3.setToolTip(tmpQs); le_s4.setToolTip(tmpQs); lb_capt1 = new QLabel(null); lb_capt2 = new QLabel(null); prb_prog = new QProgressBar(null); prb_prog.setStyleSheet(tmpQsSet(strBlue)); f1 = new QFont(); f1.setPointSize(10); setFont(f1); // Кнопки kn_Find = new gPushButton(wd_main, new QString("Поиск F5")); tmpQsSet("Начать поиск ..."); kn_Find.setToolTip(tmpQs); kn_Edit = new gPushButton(wd_main, new QString("Стоп")); tmpQsSet("Остановить поиск ..."); kn_Edit.setToolTip(tmpQs); kn_Word = new gPushButton(wd_main, new QString("Открыть файл")); tmpQsSet("Windows: Открыть файл использую АССОЦИРОВАННУЮ программу\n Linux: Открыть файл используя текстовый редактор kwrite"); kn_Word.setToolTip(tmpQs); kn_Excel = new gPushButton(wd_main, new QString("Открыть папку с файлом")); tmpQsSet("Открыть папку содержащию указаный файл."); kn_Excel.setToolTip(tmpQs); le_s1.setEnabled(false); cb_12.setEnabled(false); lb_capt1.setText(new QString("Полный путь файла:")); lb_capt2.setText(new QString("Имя файла:")); // Соберем строку с полями вводи и кнопкой. Гориз выравниватель lh_param.addWidget(lb_capt1); /* lh_param.addWidget(le_s1); lh_param.addWidget(cb_12); */ lh_param.addWidget(le_s2); lh_param.addWidget(lb_capt2); lh_param.addWidget(le_s3); lh_param.addWidget(cb_23); lh_param.addWidget(le_s4); cb_12.setText(new QString("или")); cb_23.setText(new QString("или")); // Соберем кнопки lh_button.addWidget(kn_Find); lh_button.addWidget(kn_Edit); lh_button.addWidget(kn_Word); lh_button.addWidget(kn_Excel); // Соберем вертикальный выравниватель lv_main.addLayout(lh_param); lv_main.addWidget(te_list); lv_main.addWidget(prb_prog); lv_main.addLayout(lh_button); wd_main.setLayout(lv_main); setCentralWidget(wd_main); setStatusBar(sb_pbar); // Привяжем кнопку gSlot slotknFind = new gSlot(); slotknFind.setSlot(0, &onKnFind); // Установить обработчик на Кнопку connect(kn_Find.QtObj, MSS("clicked()", QSIGNAL), slotknFind.QtObj, MSS("Slot0()", QSLOT), 1); gSlot slotknEdit = new gSlot(); slotknEdit.setSlot(0, &onKnStop); // Установить обработчик на Кнопку connect(kn_Edit.QtObj, MSS("clicked()", QSIGNAL), slotknEdit.QtObj, MSS("Slot0()", QSLOT), 1); gSlot slotknWord = new gSlot(); slotknWord.setSlot(0, &onKnOpen); // Установить обработчик на Кнопку connect(kn_Word.QtObj, MSS("clicked()", QSIGNAL), slotknWord.QtObj, MSS("Slot0()", QSLOT), 1); gSlot slotknDir = new gSlot(); slotknDir.setSlot(0, &onOpenDir); // Установить обработчик на Кнопку connect(kn_Excel.QtObj, MSS("clicked()", QSIGNAL), slotknDir.QtObj, MSS("Slot0()", QSLOT), 1); // Напишем заголовок окна. QString tmpQs = new QString("Использую файл индекса: "); QString tmpQs1 = new QString("\0"); tmpQs1.toUnicode(cast(char*)nameFileIndex.ptr, UTF_8); tmpQs.append(tmpQs1); setWindowTitle(tmpQs); resize(800, 600); // Центральная строка меню menuBar = new QMenuBar(null); // Выполнители act11 = new QAction(null); act21 = new QAction(null); act12 = new QAction(null); act22 = new QAction(null); act13 = new QAction(null); act23 = new QAction(null); act14 = new QAction(null); act15 = new QAction(null); // Вертикальное меню menu11 = new QMenu(null); menu12 = new QMenu(null); tmpQs.toUnicode("Действия", UTF_8); menu11.setTitle(tmpQs); tmpQs.toUnicode("Помощь", UTF_8); menu12.setTitle(tmpQs); menu11.addAction(act11); tmpQs.toUnicode("Поиск", UTF_8); act11.setText(tmpQs); // act11.onClick(&onKnFind); act11.setHotKey(QtE.Key.Key_F5 /*QtE.Key.Key_ControlModifier + QtE.Key.Key_Enter*/); act11.onClick(&onKnFind); menu11.addAction(act12); tmpQs.toUnicode("Стоп", UTF_8); act12.setText(tmpQs); // act11.onClick(&onKnFind); act12.setHotKey(QtE.Key.Key_Escape); act12.onClick(&onKnStop); menu11.addAction(act13); tmpQs.toUnicode("Открыть файл", UTF_8); act13.setText(tmpQs); // act11.onClick(&onKnFind); act13.setHotKey(QtE.Key.Key_F6); act13.onClick(&onKnOpen); menu11.addAction(act14); tmpQs.toUnicode("Открыть папку", UTF_8); act14.setText(tmpQs); // act11.onClick(&onKnFind); act14.setHotKey(QtE.Key.Key_F7); act14.onClick(&onOpenDir); menu11.addSeparator(); menu11.addAction(act15); tmpQs.toUnicode("Выход", UTF_8); act15.setText(tmpQs); // act11.onClick(&onKnFind); act21.setHotKey(QtE.Key.Key_F1); menu12.addAction(act21); tmpQs.toUnicode("Инструкция", UTF_8); act21.setText(tmpQs); // act11.onClick(&onKnFind); act21.setHotKey(QtE.Key.Key_F1); act21.onClick(&onF1); menu12.addSeparator(); menu12.addAction(act22); tmpQs.toUnicode("О Программе", UTF_8); act22.setText(tmpQs); // act11.onClick(&onKnFind); act22.onClick(&onAboutProgram); menu12.addAction(act23); tmpQs.toUnicode("О Qt", UTF_8); act23.setText(tmpQs); // act11.onClick(&onKnFind); act23.onClick(&onAboutQt); menuBar.addMenu(menu11); menuBar.addMenu(menu12); // Отобразим меню setMenuBar(menuBar); // Событие на открытие окна // setResizeEvent(&onLoadFile); } // ---------------------------------------------------------- void knpOpenDir() { // Открыть каталог с файлом try { QString tmpQstr = new QString(); te_list.getQStringCursor(tmpQstr); string nameProc; nameProc = tmpQstr.fromUnicode(nameProc, UTF_8); // Это реакция на кнопку открыть папку version(Windows) { auto pid = spawnProcess(["explorer", dirName(nameProc)]); } version(linux) { auto pid = spawnProcess(["dolphin", "--select", nameProc]); } } catch { msgbox("Осуществите поиск и укажите файл."); } } // ---------------------------------------------------------- void knpWord() { // Открыть файл в редакторе try { QString tmpQstr = new QString(); te_list.getQStringCursor(tmpQstr); string nameProc; nameProc = tmpQstr.fromUnicode(nameProc, UTF_8); version(Windows) { auto pid = spawnShell('"' ~ nameProc ~ '"'); } version(linux) { auto pid = spawnProcess(["kwrite", nameProc]); } } catch { msgbox("Осуществите поиск и укажите файл."); } } // ---------------------------------------------------------- void loadIndex() { // Прочитать файл в память bool f = true; bool fLoad; // Проверка на правильность структуры индексного файла StNameFile el; void ErrMessage() { msgbox("Файл индекса поврежден или не найден!","Внимание!",QMessageBox.Icon.Critical); QString qstr = new QString("Файл индекса поврежден или не найден!"); sb_pbar.showMessage(qstr); } // Прочитаем исходный файл if(!exists(nameFileIndex)) { ErrMessage(); } File fIndex = File(nameFileIndex, "r"); int i; foreach(line; fIndex.byLine()) { if(i==i++/wr*wr) app.processEvents(); if(line == "#####") { f = false; fLoad = true; } else { if(f) { mPath ~= line.dup; } else { el.FullPath = to!int(Split1251(line, razd, 0)); el.NameFile = Split1251(line, razd, 1) ~ 0; mName ~= el; } } } // -------------------------- if(fLoad) { string frase = format("Загружено: каталогов %s, файлов %s", mPath.length, mName.length); QString qstr = new QString(); qstr.toUnicode(cast(char*)(frase ~ 0 ~ 0).ptr, UTF_8); sb_pbar.showMessage(qstr); prb_prog.setValue(0); } else { ErrMessage(); } } // ---------------------------------------------------------- void knpStop() { runFind = false; } // ---------------------------------------------------------- void ViewStrs() { // Искать вхождения строк size_t n; char[] strNames; QString qstr = new QString(); bool pb1, pb2, pb3, pb4; bool b1, b2, b3, b4; char[] str_cmp1, str_cmp2, str_cmp3, str_cmp4; char[] str_empty = cast(char[])""; string str_compare; mNamelength = cast(int)mName.length-1; // Для ProgressBar // Подготовим аргументы сравнения QString qstr_compare = new QString(); le_s1.text(qstr_compare); if(qstr_compare.size == 0) { str_cmp1 = str_empty; pb1 = false; } else { str_cmp1 = toUpper1251(cast(char[])qstr_compare.fromUnicode(str_compare, WIN_1251)) ~ 0; pb1 = true; } le_s2.text(qstr_compare); if(qstr_compare.size == 0) { str_cmp2 = str_empty; pb2 = false; } else { str_cmp2 = toUpper1251(cast(char[])qstr_compare.fromUnicode(str_compare, WIN_1251)) ~ 0; pb2 = true; } le_s3.text(qstr_compare); if(qstr_compare.size == 0) { str_cmp3 = str_empty; pb3 = false; } else { str_cmp3 = toUpper1251(cast(char[])qstr_compare.fromUnicode(str_compare, WIN_1251)) ~ 0; pb3 = true; } le_s4.text(qstr_compare); if(qstr_compare.size == 0) { str_cmp4 = str_empty; pb4 = false; } else { str_cmp4 = toUpper1251(cast(char[])qstr_compare.fromUnicode(str_compare, WIN_1251)) ~ 0; pb4 = true; } prb_prog.setMinimum(0); prb_prog.setMaximum(mNamelength); int j; te_list.clear(); void PrintEk(StNameFile el) { char[] fullName = mPath[el.FullPath] ~ dirSeparator ~ el.NameFile; qstr.toUnicode(cast(char*)(fullName ~ 0 ~ 0).ptr, WIN_1251); te_list.append(qstr); } runFind = true; // Подпрограмма поиска одиночного вхождения void find1(char[] str_cmp) { bool b; char *uksh = cast(char*)(str_cmp).ptr; int i; foreach(el; mName) { if(!runFind) break; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; b = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh); if(b) PrintEk(el); } prb_prog.setValue(mNamelength); } // Подпрограмма поиска двойного вхождения void find2(char[] str_cmp1, char[] str_cmp2, bool bif) { bool b1, b2; char *uksh1 = cast(char*)(str_cmp1).ptr; char *uksh2 = cast(char*)(str_cmp2).ptr; int i; foreach(el; mName) { if(!runFind) break; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; b1 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh1); b2 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh2); if(bif) { if(b1 | b2) PrintEk(el); } else { if(b1 & b2) PrintEk(el); } } prb_prog.setValue(mNamelength); } // Начнем поиск и сравнение if(!pb4 & !pb3 & !pb2 & !pb1) { goto M1; } if(pb4 & !pb3 & !pb2 & !pb1) { find1(str_cmp4); goto M1; } if(!pb4 & pb3 & !pb2 & !pb1) { find1(str_cmp3); goto M1; } if(pb4 & pb3 & !pb2 & !pb1) { if(cb_23.isChecked()) { // Или find2(str_cmp3, str_cmp4, true); } else { // И find2(str_cmp3, str_cmp4, false); } goto M1; } //----------------------- if(!pb4 & !pb3 & pb2) { int i; char *uksh = cast(char*)(str_cmp2).ptr; foreach(el; mName) { if(!runFind) break; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; // char[] pf = mPath[el.FullPath].dup; b2 = null != strstr(cast(char*)(toUpper1251(mPath[el.FullPath]) ~ 0), uksh); if(b2) { PrintEk(el); } } goto M1; } if(pb4 & !pb3 & pb2) { int i; char *uksh2 = cast(char*)(str_cmp2).ptr; char *uksh4 = cast(char*)(str_cmp4).ptr; foreach(el; mName) { if(!runFind) break; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; b2 = null != strstr(cast(char*)(toUpper1251(mPath[el.FullPath]) ~ 0), uksh2); b4 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh4); if(b2 & b4) { PrintEk(el); } } goto M1; } if(!pb4 & pb3 & pb2) { int i; char *uksh2 = cast(char*)(str_cmp2).ptr; char *uksh3 = cast(char*)(str_cmp3).ptr; foreach(el; mName) { if(!runFind) break; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; b2 = null != strstr(cast(char*)(toUpper1251(mPath[el.FullPath]) ~ 0), uksh2); b3 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh3); if(b2 & b3) { PrintEk(el); } } goto M1; } if(pb4 & pb3 & pb2) { if(cb_23.isChecked()) { // Или int i; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; char *uksh4 = cast(char*)(str_cmp4).ptr; char *uksh2 = cast(char*)(str_cmp2).ptr; char *uksh3 = cast(char*)(str_cmp3).ptr; foreach(el; mName) { if(!runFind) break; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; b2 = null != strstr(cast(char*)(toUpper1251(mPath[el.FullPath]) ~ 0), uksh2); b3 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh3); b4 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh4); if((b3 | b4) & b2) { PrintEk(el); } } } else { // И int i; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; char *uksh4 = cast(char*)(str_cmp4).ptr; char *uksh2 = cast(char*)(str_cmp2).ptr; char *uksh3 = cast(char*)(str_cmp3).ptr; foreach(el; mName) { if(!runFind) break; if(i==i++/wr*wr) { prb_prog.setValue(j); app.processEvents(); } j++; b2 = null != strstr(cast(char*)(toUpper1251(mPath[el.FullPath]) ~ 0), uksh2); b3 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh3); b4 = null != strstr(cast(char*)(toUpper1251(el.NameFile)), uksh4); if((b3 & b4) & b2) { PrintEk(el); } } } goto M1; } M1: // if(!runFind) prb_prog.setValue(0); prb_prog.setValue(mNamelength); } } int main(string[] args) { // Проверим режим загрузки. Если есть '--debug' старт в отладочном режиме bool fDebug; fDebug = false; foreach(i, arg; args) { if(arg=="--debug") { fDebug = true; continue; } if(i>0) nameFileIndex = arg; } if(nameFileIndex=="") nameFileIndex = "index.txt"; // Загрузка графической библиотеки int rez = LoadQt( dll.Core | dll.Gui | dll.QtE, fDebug); if (rez==1) return 1; // Ошибка загрузки библиотеки app = new QApplication(&Runtime.cArgs.argc, Runtime.cArgs.argv, 1); // ---------------------------------- // Инициализация внутренних перекодировок, для QtE UTF_8 = new QTextCodec("UTF-8"); WIN_1251 = new QTextCodec("Windows-1251"); tmpQs = new QString(); // ---------------------------------- wd_Main = new ClassMain(); wd_Main.show(); try { wd_Main.loadIndex(); } catch { } // ---------------------------------- return app.exec(); }
D
<?xml version="1.0" encoding="ASCII" standalone="no"?> <di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0"> <pageList> <availablePage> <emfPageIdentifier href="VAR_0_agm-7341926935.notation#_copSALmGEeKQQp7P9cQvNQ"/> </availablePage> </pageList> <sashModel currentSelection="//@sashModel/@windows.0/@children.0"> <windows> <children xsi:type="di:TabFolder"> <children> <emfPageIdentifier href="VAR_0_agm-7341926935.notation#_copSALmGEeKQQp7P9cQvNQ"/> </children> </children> </windows> </sashModel> </di:SashWindowsMngr>
D
import std.stdio; import std.file; import std.algorithm.searching; import std.algorithm.iteration; import std.typecons : Flag, Yes, No; void main() { auto input = slurp!(int, int, char, string)("input", "%d-%d %c: %s"); writeln("Part 1"); { int valid = 0; foreach(line; input) { int min = line[0]; int max = line[1]; char search = line[2]; string pw = line[3]; auto count = pw.count!((a) => a == search); if (min <= count && count <= max) valid++; } writeln(valid); } writeln("Part 2"); { int valid = 0; foreach(line; input) { import std.conv, std.array; int min = line[0]; int max = line[1]; dchar search = to!dchar(line[2]); string pw = line[3]; bool satisfiedMin = false; bool satisfiedMax = false; import std.array; pw.array.each!((i, a) { if ((i + 1) == min) { if (a == search) satisfiedMin = true; } else if ((i + 1) == max) { if (a == search) satisfiedMax = true; } return Yes.each; }); if (satisfiedMin && !satisfiedMax) { valid++; } else if (!satisfiedMin && satisfiedMax) { valid++; } } writeln(valid); } }
D
/************************************************************************* ** OrcBiter Prototype ** *************************************************************************/ PROTOTYPE Mst_Default_OrcBiter(C_Npc) { name = "Kousavec"; guild = GIL_SCAVENGER; aivar[AIV_MM_REAL_ID] = ID_ORCBITER; level = 12; //---------------------------------------------------- attribute [ATR_STRENGTH] = 60; attribute [ATR_DEXTERITY] = 60; attribute [ATR_HITPOINTS_MAX] = 120; attribute [ATR_HITPOINTS] = 120; attribute [ATR_MANA_MAX] = 0; attribute [ATR_MANA] = 0; //---------------------------------------------------- protection [PROT_BLUNT] = 60; protection [PROT_EDGE] = 60; protection [PROT_POINT] = 60; protection [PROT_FIRE] = 60; protection [PROT_FLY] = 60; protection [PROT_MAGIC] = 0; //---------------------------------------------------- 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; //---------------------------------------------------- fight_tactic = FAI_SCAVENGER; //---------------------------------------------------- senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL; senses_range = 3000; // aivar[AIV_MM_Behaviour] = HUNTER; // aivar[AIV_MM_PercRange] = 1200; // aivar[AIV_MM_DrohRange] = 1000; // aivar[AIV_MM_AttackRange] = 700; // aivar[AIV_MM_DrohTime] = 5; aivar[AIV_MM_FollowTime] = 10; aivar[AIV_MM_FollowInWater] = TRUE; //------------------------------------------------------------- start_aistate = ZS_MM_AllScheduler; aivar[AIV_MM_RestStart] = OnlyRoutine; }; //------------------------------------------------------------- func void Set_OrcBiter_Visuals() { Mdl_SetVisual (self, "Scavenger.mds"); Mdl_ApplyOverlayMds (self, "Orcbiter.mds"); // eigener Run-Loop // Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR Mdl_SetVisualBody (self, "Sc2_Body", DEFAULT, DEFAULT, "", DEFAULT, DEFAULT, -1); }; /************************************************************************* ** OrcBiter ** *************************************************************************/ INSTANCE OrcBiter (Mst_Default_OrcBiter) { Set_OrcBiter_Visuals(); Npc_SetToFistMode(self); CreateInvItems (self, ItFoMuttonRaw, 2); };
D
/home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Vapor.build/Engine/Server/ServerFactoryProtocol.swift.o : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Message+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Response+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Body+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+FormData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/FormData+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/StructuredData+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/Request+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Log+Convenience.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Resource.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/HTTP+Node.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/AcceptLanguage.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cache/Config+Cache.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Configurable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSONRepresentable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/StringInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/RequestInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Vapor+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/MediaType.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Config+Middleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Date/DateMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/File+Response.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Resolve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Serve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/DumpConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Config+ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoEncoding.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Chaining.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Droplet+Routing.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Config+Log.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RoutesLog.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Config+Hash.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogLevel.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Config+Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/ProviderInstall.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/HashProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CipherProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Int+Random.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Version.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSConfiguration.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RouteCollection.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Subscription.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mailgun.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Config+Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Responder.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileManager.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/ConsoleLogger.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/Config+Cipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoCipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/CryptoHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/BCryptHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/StaticViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/EngineServer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/SecurityLayer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/AbortError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider+Resources.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Directories.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Bytes.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/InitProtocols.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Sessions/Config+Sessions.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Responder+Helpers.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/WebSockets/WebSockets.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Exports.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/EngineClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/FoundationClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Response+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Request+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Event.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/Accept.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+Multipart.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/Abort.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer+Request.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/Config+View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorView.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/Config+ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Config+ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/URI.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/JSON.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/SMTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/HTTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/TLS.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/FormData.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Node.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cache.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/PathIndexable.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Routing.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Random.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Crypto.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Branches.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cookies.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Configs.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sessions.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/WebSockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/BCrypt.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Multipart.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Transport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/checkouts/engine.git--7533756970564908605/Sources/CHTTP/include/http_parser.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/checkouts/ctls.git--2818177660473049491/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Vapor.build/ServerFactoryProtocol~partial.swiftmodule : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Message+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Response+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Body+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+FormData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/FormData+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/StructuredData+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/Request+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Log+Convenience.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Resource.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/HTTP+Node.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/AcceptLanguage.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cache/Config+Cache.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Configurable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSONRepresentable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/StringInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/RequestInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Vapor+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/MediaType.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Config+Middleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Date/DateMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/File+Response.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Resolve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Serve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/DumpConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Config+ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoEncoding.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Chaining.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Droplet+Routing.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Config+Log.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RoutesLog.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Config+Hash.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogLevel.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Config+Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/ProviderInstall.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/HashProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CipherProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Int+Random.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Version.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSConfiguration.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RouteCollection.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Subscription.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mailgun.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Config+Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Responder.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileManager.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/ConsoleLogger.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/Config+Cipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoCipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/CryptoHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/BCryptHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/StaticViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/EngineServer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/SecurityLayer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/AbortError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider+Resources.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Directories.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Bytes.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/InitProtocols.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Sessions/Config+Sessions.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Responder+Helpers.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/WebSockets/WebSockets.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Exports.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/EngineClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/FoundationClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Response+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Request+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Event.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/Accept.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+Multipart.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/Abort.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer+Request.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/Config+View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorView.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/Config+ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Config+ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/URI.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/JSON.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/SMTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/HTTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/TLS.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/FormData.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Node.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cache.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/PathIndexable.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Routing.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Random.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Crypto.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Branches.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cookies.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Configs.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sessions.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/WebSockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/BCrypt.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Multipart.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Transport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/checkouts/engine.git--7533756970564908605/Sources/CHTTP/include/http_parser.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/checkouts/ctls.git--2818177660473049491/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Vapor.build/ServerFactoryProtocol~partial.swiftdoc : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Message+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Response+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Body+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+FormData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/FormData+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/StructuredData+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/Request+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Log+Convenience.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Resource.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/HTTP+Node.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/AcceptLanguage.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cache/Config+Cache.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Configurable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSONRepresentable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/StringInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/RequestInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Vapor+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/MediaType.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Config+Middleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Date/DateMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/File+Response.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Resolve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Serve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/DumpConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Config+ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoEncoding.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Chaining.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Droplet+Routing.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Config+Log.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RoutesLog.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Config+Hash.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogLevel.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Config+Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/ProviderInstall.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/HashProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CipherProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Int+Random.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Version.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSConfiguration.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RouteCollection.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Subscription.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mailgun.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Config+Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Responder.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileManager.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/ConsoleLogger.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/Config+Cipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoCipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/CryptoHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/BCryptHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/StaticViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/EngineServer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/SecurityLayer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/AbortError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider+Resources.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Directories.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Bytes.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/InitProtocols.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Sessions/Config+Sessions.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Responder+Helpers.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/WebSockets/WebSockets.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Exports.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/EngineClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/FoundationClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Response+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Request+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Event.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/Accept.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+Multipart.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/Abort.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer+Request.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/Config+View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorView.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/Config+ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Config+ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/URI.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/JSON.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/SMTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/HTTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/TLS.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/FormData.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Node.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cache.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/PathIndexable.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Routing.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Random.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Crypto.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Branches.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cookies.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Configs.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sessions.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/WebSockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/BCrypt.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Multipart.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Transport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/checkouts/engine.git--7533756970564908605/Sources/CHTTP/include/http_parser.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/checkouts/ctls.git--2818177660473049491/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap
D
/* DIrrlicht - D Bindings for Irrlicht Engine Copyright (C) 2014- Danyal Zia (catofdanyal@yahoo.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ module dirrlicht.video.vertex; /// Enumeration for all vertex types there are. enum VertexType { /// Standard vertex type used by the Irrlicht engine, video::S3DVertex. Standard = 0, /// Vertex with two texture coordinates, video::S3DVertex2TCoords. /// Usually used for geometry with lightmaps or other special materials. TTCoords, /// Vertex with a tangent and binormal vector, video::S3DVertexTangents. /// Usually used for tangent space normal mapping. Tangents } class S3DVertex { }
D
D [0, 42]["void", "main", "string", "s", "=", ""] +-D.Module [0, 42]["void", "main", "string", "s", "=", ""] +-D.DeclDefs [0, 42]["void", "main", "string", "s", "=", ""] +-D.DeclDef [11, 42]["void", "main", "string", "s", "=", ""] +-D.Declaration [11, 42]["void", "main", "string", "s", "=", ""] +-D.Decl [11, 42]["void", "main", "string", "s", "=", ""] +-D.basicFunction [11, 42]["void", "main", "string", "s", "=", ""] +-D.BasicType [11, 16]["void"] | +-D.BasicTypeX [11, 15]["void"] +-D.Declarator [16, 23]["main"] | +-D.Identifier [16, 20]["main"] +-D.FunctionBody [23, 42]["string", "s", "=", ""] +-D.BlockStatement [23, 42]["string", "s", "=", ""] +-D.StatementList [26, 41]["string", "s", "=", ""] +-D.Statement [26, 41]["string", "s", "=", ""] +-D.NonEmptyStatement [26, 41]["string", "s", "=", ""] +-D.NonEmptyStatementNoCaseNoDefault [26, 41]["string", "s", "=", ""] +-D.DeclarationStatement [26, 41]["string", "s", "=", ""] +-D.Declaration [26, 41]["string", "s", "=", ""] +-D.Decl [26, 41]["string", "s", "=", ""] +-D.BasicType [26, 33]["string"] | +-D.IdentifierList [26, 32]["string"] | +-D.Identifier [26, 32]["string"] +-D.Declarators [33, 39]["s", "=", ""] +-D.DeclaratorInitializer [33, 39]["s", "=", ""] +-D.Declarator [33, 35]["s"] | +-D.Identifier [33, 35]["s"] +-D.Initializer [37, 39][""] +-D.NonVoidInitializer [37, 39][""] +-D.AssignExpression [37, 39][""] +-D.ConditionalExpression [37, 39][""] +-D.OrOrExpression [37, 39][""] +-D.AndAndExpression [37, 39][""] +-D.OrExpression [37, 39][""] +-D.XorExpression [37, 39][""] +-D.AndExpression [37, 39][""] +-D.ShiftExpression [37, 39][""] +-D.AddExpression [37, 39][""] +-D.MulExpression [37, 39][""] +-D.UnaryExpression [37, 39][""] +-D.PowExpression [37, 39][""] +-D.PostfixExpression [37, 39][""] +-D.PrimaryExpression [37, 39][""] +-D.StringLiteral [37, 39][""] +-D.DoubleQuotedString [37, 39][""]
D
module context; import std.stdio, std.path, std.file, std.random, std.conv, std.array, x11.X, x11.Xlib, x11.Xatom; enum PATH = "~/.flatman/"; void main(string[] args){ version(unittest){ import core.stdc.stdlib: exit; exit(0); } if(args.length < 2) getContext.writeln; else if(args[1] == "-p") getContextPath.writeln; else if(args[1] == "-c") args[2].clean.createContext; else args[1].clean.setContext; } string clean(string path){ return path.expandTilde.absolutePath.buildNormalizedPath; } string getContext(){ auto cur = (PATH ~ "current").clean; if(!cur.exists || !cur.readText.exists){ setContext("~".clean); cur = (PATH ~ "current").clean; } return cur.readText.readText; } string getContextPath(){ return (PATH ~ "current").expandTilde.readText; } void setContext(string context){ context.createContext; auto path = context.replace("/", "-") ~ ".context"; std.file.write(PATH.expandTilde ~ "current", PATH.expandTilde ~ path); } void createContext(string context){ if(!PATH.expandTilde.exists) mkdir(PATH.expandTilde); auto path = context.replace("/", "-") ~ ".context"; std.file.write(PATH.expandTilde ~ path, context); }
D
/home/jingel/Documents/Programmering/rust/rustbook/tests_cargo/adder/target/debug/adder-9a6c0b024fb23df4: /home/jingel/Documents/Programmering/rust/rustbook/tests_cargo/adder/src/lib.rs
D
module collie.codec.http.header; import std.conv; import std.uri; import std.string; public import collie.codec.http.parsertype; import collie.codec.http.config; enum HTTPHeaderType { HTTP_REQUEST = HTTPParserType.HTTP_REQUEST, HTTP_RESPONSE = HTTPParserType.HTTP_RESPONSE, } enum HTTPVersion { HTTP1_0, HTTP1_1, HTTP2 //暂时不支持 } class HTTPHeader { this(HTTPHeaderType type) { _type = type; } ~this() { // destroy(_header); _header = null; } @property HTTPHeaderType type() const { return _type; } @property void type(HTTPHeaderType type) { _type = type; } // REQUEST @property HTTPMethod method() const { return _method; } @property void method(HTTPMethod met) { _method = met; } @property string methodString() const { return method_strings[_method]; } @property bool upgrade() const { return _upgrade; } @property int statusCode() const { return _statuCode; } // RESPONSE only @property void statusCode(int code) { _statuCode = code; } @property httpVersion() const { return _hversion; } @property httpVersion(HTTPVersion ver) { _hversion = ver; } @property requestString() const { return _queryString; } @property requestString(string str) { _queryString = str; auto idx = _queryString.indexOf('?'); if (idx != -1) { _fileStart = cast(uint) idx; } else { _fileStart = cast(uint) _queryString.length; } } @property queryString() const { if (_fileStart + 1 < _queryString.length) return _queryString[(_fileStart + 1) .. $]; else return ""; } @property path() const { return decode(_queryString[0 .. _fileStart]); } @property string[string] queryMap() const { if (_fileStart == cast(uint) _queryString.length) return string[string].init; return parseKeyValues(queryString); } @property const(string[string]) headerMap() const { return _header; } @property host() const { return _header["Host"]; } void setHeaderValue(T)(string key, T value) { key = toLower(key.strip); //capitalizeHeader(strip(key));// _header[key] = to!string(value); } string getHeaderValue(string key) const { key = toLower(key.strip); //capitalizeHeader(strip(key));// return _header.get(key, ""); } void removeHeaderKey(string key) { key = toLower(key.strip); //capitalizeHeader(key);// _header.remove(key); } string contentType(bool toLow = false)() const { string type = getHeaderValue("Content-Type"); if (type.length > 0) { string[] pairs = raw.split(';'); type = pairs[0].strip(); static if (tolow) { type = toLower(type); } } return type; } bool isInVaild() const { return (_method == HTTPMethod.HTTP_INVAILD && _statuCode == -1); } // 无效的 package: void clear() { _statuCode = -1; _method = HTTPMethod.HTTP_INVAILD; _queryString = ""; _fileStart = 0; _header.clear(); //foreach(key; _header.keys) //_header.remove(key); } @property void upgrade(bool up) { _upgrade = up; } private: HTTPMethod _method = HTTPMethod.HTTP_INVAILD; int _statuCode = -1; HTTPHeaderType _type; HTTPVersion _hversion; string[string] _header; string _queryString; bool _upgrade = false; uint _fileStart; } string[string] parseKeyValues(string raw, string split1 = "&", string spilt2 = "=") { string[string] map; if (raw.length == 0) return map; string[] pairs = raw.strip.split(split1); foreach (string pair; pairs) { string[] parts = pair.split(spilt2); // Accept formats a=b/a=b=c=d/a if (parts.length == 1) { string key = decode(parts[0]); map[key] = ""; } else if (parts.length > 1) { string key = decode(parts[0]); string value = decode(pair[parts[0].length + 1 .. $]); map[key] = value; } } return map; } string capitalizeHeader(string name) { string[] parts = name.split("-"); for (int i = 0; i < parts.length; i++) { parts[i] = parts[i].capitalize; } return join(parts, "-"); }
D
/** $(SCRIPT inhibitQuickIndex = 1;) This is a submodule of $(LINK2 std_experimental_ndslice.html, std.experimental.ndslice). Selectors create new views and iteration patterns over the same data, without copying. $(H2 Subspace selectors) Subspace selectors serve to generalize and combine other selectors easily. For a slice of `Slice!(N, Range)` type `slice.pack!K` creates a slice of slices of `Slice!(N-K, Slice!(K+1, Range))` type by packing the last `K` dimensions of the top dimension pack, and the type of element of `slice.byElement` is `Slice!(K, Range)`. Another way to use $(LREF pack) is transposition of dimension packs using $(LREF evertPack). Examples of use of subspace selectors are available for selectors, $(SUBREF slice, Slice.shape), and $(SUBREF slice, Slice.elementsCount). $(BOOKTABLE , $(TR $(TH Function Name) $(TH Description)) $(T2 pack , returns slice of slices) $(T2 unpack , merges all dimension packs) $(T2 evertPack, reverses dimension packs) ) $(BOOKTABLE $(H2 Selectors), $(TR $(TH Function Name) $(TH Description)) $(T2 byElement, flat, random access range of all elements with `index` property) $(T2 byElementInStandardSimplex, an input range of all elements in standard simplex of hypercube with `index` property. If the slice has two dimensions, it is a range of all elements of upper left triangular matrix.) $(T2 indexSlice, lazy slice with initial multidimensional index) $(T2 iotaSlice, lazy slice with initial flattened (continuous) index) $(T2 reshape, new slice with changed dimensions for the same data) $(T2 diagonal, 1-dimensional slice composed of diagonal elements) $(T2 blocks, n-dimensional slice composed of n-dimensional non-overlapping blocks. If the slice has two dimensions, it is a block matrix.) $(T2 windows, n-dimensional slice of n-dimensional overlapping windows. If the slice has two dimensions, it is a sliding window.) ) License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: Ilya Yaroshenko Source: $(PHOBOSSRC std/_experimental/_ndslice/_selection.d) Macros: SUBMODULE = $(LINK2 std_experimental_ndslice_$1.html, std.experimental.ndslice.$1) SUBREF = $(LINK2 std_experimental_ndslice_$1.html#.$2, $(TT $2))$(NBSP) T2=$(TR $(TDNW $(LREF $1)) $(TD $+)) T4=$(TR $(TDNW $(LREF $1)) $(TD $2) $(TD $3) $(TD $4)) */ module std.experimental.ndslice.selection; import std.traits; import std.meta; //: allSatisfy; import std.experimental.ndslice.internal; import std.experimental.ndslice.slice; //: Slice; /++ Creates a packed slice, i.e. slice of slices. The function does not carry out any calculations, it simply returns the same binary data presented differently. Params: K = sizes of dimension packs Returns: `pack!K` returns `Slice!(N-K, Slice!(K+1, Range))`; `slice.pack!(K1, K2, ..., Kn)` is the same as `slice.pack!K1.pack!K2. ... pack!Kn`. +/ template pack(K...) { auto pack(size_t N, Range)(auto ref Slice!(N, Range) slice) { template Template(size_t NInner, Range, R...) { static if (R.length > 0) { static if (NInner > R[0]) alias Template = Template!(NInner - R[0], Slice!(R[0] + 1, Range), R[1 .. $]); else static assert(0, "Sum of all lengths of packs " ~ K.stringof ~ " should be less than N = "~ N.stringof ~ tailErrorMessage!()); } else { alias Template = Slice!(NInner, Range); } } with (slice) return Template!(N, Range, K)(_lengths, _strides, _ptr); } } /// @safe @nogc pure nothrow unittest { import std.experimental.ndslice.slice; import std.range.primitives: ElementType; import std.range: iota; auto r = (3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11).iota; auto a = r.sliced(3, 4, 5, 6, 7, 8, 9, 10, 11); auto b = a.pack!(2, 3); // same as `a.pack!2.pack!3` auto c = b[1, 2, 3, 4]; auto d = c[5, 6, 7]; auto e = d[8, 9]; auto g = a[1, 2, 3, 4, 5, 6, 7, 8, 9]; assert(e == g); assert(a == b); assert(c == a[1, 2, 3, 4]); alias R = typeof(r); static assert(is(typeof(b) == typeof(a.pack!2.pack!3))); static assert(is(typeof(b) == Slice!(4, Slice!(4, Slice!(3, R))))); static assert(is(typeof(c) == Slice!(3, Slice!(3, R)))); static assert(is(typeof(d) == Slice!(2, R))); static assert(is(typeof(e) == ElementType!R)); } @safe @nogc pure nothrow unittest { auto a = iotaSlice(3, 4, 5, 6, 7, 8, 9, 10, 11); auto b = a.pack!(2, 3); static assert(b.shape.length == 4); static assert(b.structure.lengths.length == 4); static assert(b.structure.strides.length == 4); static assert(b .byElement.front .shape.length == 3); static assert(b .byElement.front .byElement.front .shape.length == 2); // test save b.byElement.save.popFront; static assert(b .byElement.front .shape.length == 3); } /++ Unpacks a packed slice. The function does not carry out any calculations, it simply returns the same binary data presented differently. Params: slice = packed slice Returns: unpacked slice See_also: $(LREF pack), $(LREF evertPack) +/ Slice!(N, Range).PureThis unpack(size_t N, Range)(auto ref Slice!(N, Range) slice) { with (slice) return PureThis(_lengths, _strides, _ptr); } /// pure nothrow unittest { auto a = iotaSlice(3, 4, 5, 6, 7, 8, 9, 10, 11); auto b = a.pack!(2, 3).unpack(); static assert(is(typeof(a) == typeof(b))); assert(a == b); } /++ Reverses the order of dimension packs. This function is used in a functional pipeline with other selectors. Params: slice = packed slice Returns: packed slice See_also: $(LREF pack), $(LREF unpack) +/ SliceFromSeq!(Slice!(N, Range).PureRange, NSeqEvert!(Slice!(N, Range).NSeq)) evertPack(size_t N, Range)(auto ref Slice!(N, Range) slice) { mixin _DefineRet; static assert(Ret.NSeq.length > 0); with (slice) { alias C = Snowball!(Parts!NSeq); alias D = Reverse!(Snowball!(Reverse!(Parts!NSeq))); foreach (i, _; NSeq) { foreach (j; Iota!(0, C[i + 1] - C[i])) { ret._lengths[j + D[i + 1]] = _lengths[j + C[i]]; ret._strides[j + D[i + 1]] = _strides[j + C[i]]; } } ret._ptr = _ptr; return ret; } } /// @safe @nogc pure nothrow unittest { import std.experimental.ndslice.iteration: transposed; auto slice = iotaSlice(3, 4, 5, 6, 7, 8, 9, 10, 11); assert(slice .pack!2 .evertPack .unpack == slice.transposed!( slice.shape.length-2, slice.shape.length-1)); } /// pure nothrow unittest { import std.experimental.ndslice.slice; import std.experimental.ndslice.iteration: transposed; import std.range.primitives: ElementType; import std.range: iota; import std.algorithm.comparison: equal; auto r = (3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11).iota; auto a = r.sliced(3, 4, 5, 6, 7, 8, 9, 10, 11); auto b = a .pack!(2, 3) .evertPack; auto c = b[8, 9]; auto d = c[5, 6, 7]; auto e = d[1, 2, 3, 4]; auto g = a[1, 2, 3, 4, 5, 6, 7, 8, 9]; assert(e == g); assert(a == b.evertPack); assert(c == a.transposed!(7, 8, 4, 5, 6)[8, 9]); alias R = typeof(r); static assert(is(typeof(b) == Slice!(2, Slice!(4, Slice!(5, R))))); static assert(is(typeof(c) == Slice!(3, Slice!(5, R)))); static assert(is(typeof(d) == Slice!(4, R))); static assert(is(typeof(e) == ElementType!R)); } @safe @nogc pure nothrow unittest { import std.experimental.ndslice.slice; static assert(is(typeof(slice!int(20) .evertPack) == Slice!(1LU, int*))); static assert(is(typeof(slice!int(20) .sliced(3) .evertPack) == Slice!(2LU, int*))); static assert(is(typeof(slice!int(20) .sliced(1,2,3) .sliced(3) .evertPack) == Slice!(3LU, Slice!(2LU, int*)))); static assert(is(typeof(slice!int(20) .sliced(1,2,3) .evertPack) == Slice!(4LU, int*))); } /++ Returns a 1-dimensional slice over the main diagonal of an n-dimensional slice. `diagonal` can be generalized with other selectors such as $(LREF blocks) (diagonal blocks) and $(LREF windows) (multi-diagonal slice). Params: N = dimension count slice = input slice Returns: 1-dimensional slice composed of diagonal elements +/ Slice!(1, Range) diagonal(size_t N, Range)(auto ref Slice!(N, Range) slice) { auto NewN = slice.PureN - N + 1; mixin _DefineRet; ret._lengths[0] = slice._lengths[0]; ret._strides[0] = slice._strides[0]; foreach (i; Iota!(1, N)) { if (ret._lengths[0] > slice._lengths[i]) ret._lengths[0] = slice._lengths[i]; ret._strides[0] += slice._strides[i]; } foreach (i; Iota!(1, ret.PureN)) { ret._lengths[i] = slice._lengths[i + N - 1]; ret._strides[i] = slice._strides[i + N - 1]; } ret._ptr = slice._ptr; return ret; } /// Matrix, main diagonal @safe @nogc pure nothrow unittest { // ------- // | 0 1 2 | // | 3 4 5 | // ------- //-> // | 0 4 | static immutable d = [0, 4]; assert(iotaSlice(2, 3).diagonal == d); } /// Non-square matrix @safe @nogc pure nothrow unittest { import std.algorithm.comparison: equal; import std.range: only; // ------- // | 0 1 | // | 2 3 | // | 4 5 | // ------- //-> // | 0 3 | assert(iotaSlice(3, 2) .diagonal .equal(only(0, 3))); } /// Loop through diagonal pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(3, 3); int i; foreach (ref e; slice.diagonal) e = ++i; assert(slice == [ [1, 0, 0], [0, 2, 0], [0, 0, 3]]); } /// Matrix, subdiagonal @safe @nogc pure nothrow unittest { import std.experimental.ndslice.iteration: dropOne; // ------- // | 0 1 2 | // | 3 4 5 | // ------- //-> // | 1 5 | static immutable d = [1, 5]; assert(iotaSlice(2, 3).dropOne!1.diagonal == d); } /// Matrix, antidiagonal @safe @nogc pure nothrow unittest { import std.experimental.ndslice.iteration: dropToHypercube, reversed; // ------- // | 0 1 2 | // | 3 4 5 | // ------- //-> // | 1 3 | static immutable d = [1, 3]; assert(iotaSlice(2, 3).dropToHypercube.reversed!1.diagonal == d); } /// 3D, main diagonal @safe @nogc pure nothrow unittest { // ----------- // | 0 1 2 | // | 3 4 5 | // - - - - - - // | 6 7 8 | // | 9 10 11 | // ----------- //-> // | 0 10 | static immutable d = [0, 10]; assert(iotaSlice(2, 2, 3).diagonal == d); } /// 3D, subdiagonal @safe @nogc pure nothrow unittest { import std.experimental.ndslice.iteration: dropOne; // ----------- // | 0 1 2 | // | 3 4 5 | // - - - - - - // | 6 7 8 | // | 9 10 11 | // ----------- //-> // | 1 11 | static immutable d = [1, 11]; assert(iotaSlice(2, 2, 3).dropOne!2.diagonal == d); } /// 3D, diagonal plain @nogc @safe pure nothrow unittest { import std.experimental.ndslice.iteration: dropOne; // ----------- // | 0 1 2 | // | 3 4 5 | // | 6 7 8 | // - - - - - - // | 9 10 11 | // | 12 13 14 | // | 15 16 17 | // - - - - - - // | 18 20 21 | // | 22 23 24 | // | 24 25 26 | // ----------- //-> // ----------- // | 0 4 8 | // | 9 13 17 | // | 18 23 26 | // ----------- static immutable d = [[ 0, 4, 8], [ 9, 13, 17], [18, 22, 26]]; auto slice = iotaSlice(3, 3, 3) .pack!2 .evertPack .diagonal .evertPack; assert(slice == d); } /++ Returns an n-dimensional slice of n-dimensional non-overlapping blocks. `blocks` can be generalized with other selectors. For example, `blocks` in combination with $(LREF diagonal) can be used to get a slice of diagonal blocks. Params: N = dimension count slice = slice to be split into blocks lengths = dimensions of block, residual blocks are ignored Returns: packed `N`-dimensional slice composed of `N`-dimensional slices +/ Slice!(N, Slice!(N+1, Range)) blocks(size_t N, Range, Lengths...)(auto ref Slice!(N, Range) slice, Lengths lengths) if (allSatisfy!(isIndex, Lengths) && Lengths.length == N) in { foreach (i, length; lengths) assert(length > 0, "length of dimension = " ~ i.stringof ~ " must be positive" ~ tailErrorMessage!()); } body { mixin _DefineRet; foreach (dimension; Iota!(0, N)) { ret._lengths[dimension] = slice._lengths[dimension] / lengths[dimension]; ret._strides[dimension] = slice._strides[dimension]; if (ret._lengths[dimension]) //do not remove `if (...)` ret._strides[dimension] *= lengths[dimension]; ret._lengths[dimension + N] = lengths[dimension]; ret._strides[dimension + N] = slice._strides[dimension]; } foreach (dimension; Iota!(N, slice.PureN)) { ret._lengths[dimension + N] = slice._lengths[dimension]; ret._strides[dimension + N] = slice._strides[dimension]; } ret._ptr = slice._ptr; return ret; } /// pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(5, 8); auto blocks = slice.blocks(2, 3); int i; foreach (block; blocks.byElement) block[] = ++i; assert(blocks == [[[[1, 1, 1], [1, 1, 1]], [[2, 2, 2], [2, 2, 2]]], [[[3, 3, 3], [3, 3, 3]], [[4, 4, 4], [4, 4, 4]]]]); assert( slice == [[1, 1, 1, 2, 2, 2, 0, 0], [1, 1, 1, 2, 2, 2, 0, 0], [3, 3, 3, 4, 4, 4, 0, 0], [3, 3, 3, 4, 4, 4, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]); } /// Diagonal blocks pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(5, 8); auto blocks = slice.blocks(2, 3); auto diagonalBlocks = blocks.diagonal.unpack; diagonalBlocks[0][] = 1; diagonalBlocks[1][] = 2; assert(diagonalBlocks == [[[1, 1, 1], [1, 1, 1]], [[2, 2, 2], [2, 2, 2]]]); assert(blocks == [[[[1, 1, 1], [1, 1, 1]], [[0, 0, 0], [0, 0, 0]]], [[[0, 0, 0], [0, 0, 0]], [[2, 2, 2], [2, 2, 2]]]]); assert(slice == [[1, 1, 1, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 2, 2, 2, 0, 0], [0, 0, 0, 2, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]); } /// Matrix divided into vertical blocks pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(5, 13); auto blocks = slice .pack!1 .evertPack .blocks(3) .unpack .pack!2; int i; foreach (block; blocks.byElement) block[] = ++i; assert(slice == [[1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0], [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0], [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0], [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0], [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0]]); } /++ Returns an n-dimensional slice of n-dimensional overlapping windows. `windows` can be generalized with other selectors. For example, `windows` in combination with $(LREF diagonal) can be used to get a multi-diagonal slice. Params: N = dimension count slice = slice to be iterated lengths = dimensions of windows Returns: packed `N`-dimensional slice composed of `N`-dimensional slices +/ Slice!(N, Slice!(N+1, Range)) windows(size_t N, Range, Lengths...)(auto ref Slice!(N, Range) slice, Lengths lengths) if (allSatisfy!(isIndex, Lengths) && Lengths.length == N) in { foreach (i, length; lengths) assert(length > 0, "length of dimension = " ~ i.stringof ~ " must be positive" ~ tailErrorMessage!()); } body { mixin _DefineRet; foreach (dimension; Iota!(0, N)) { ret._lengths[dimension] = slice._lengths[dimension] >= lengths[dimension] ? slice._lengths[dimension] - lengths[dimension] + 1: 0; ret._strides[dimension] = slice._strides[dimension]; ret._lengths[dimension + N] = lengths[dimension]; ret._strides[dimension + N] = slice._strides[dimension]; } foreach (dimension; Iota!(N, slice.PureN)) { ret._lengths[dimension + N] = slice._lengths[dimension]; ret._strides[dimension + N] = slice._strides[dimension]; } ret._ptr = slice._ptr; return ret; } /// pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(5, 8); auto windows = slice.windows(2, 3); foreach (window; windows.byElement) window[] += 1; assert(slice == [[1, 2, 3, 3, 3, 3, 2, 1], [2, 4, 6, 6, 6, 6, 4, 2], [2, 4, 6, 6, 6, 6, 4, 2], [2, 4, 6, 6, 6, 6, 4, 2], [1, 2, 3, 3, 3, 3, 2, 1]]); } /// pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(5, 8); auto windows = slice.windows(2, 3); windows[1, 2][] = 1; windows[1, 2][0, 1] += 1; windows.unpack[1, 2, 0, 1] += 1; assert(slice == [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 3, 1, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]); } /// Multi-diagonal matrix pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(8, 8); auto windows = slice.windows(3, 3); auto multidiagonal = windows .diagonal .unpack; foreach (window; multidiagonal) window[] += 1; assert(slice == [[ 1, 1, 1, 0, 0, 0, 0, 0], [ 1, 2, 2, 1, 0, 0, 0, 0], [ 1, 2, 3, 2, 1, 0, 0, 0], [0, 1, 2, 3, 2, 1, 0, 0], [0, 0, 1, 2, 3, 2, 1, 0], [0, 0, 0, 1, 2, 3, 2, 1], [0, 0, 0, 0, 1, 2, 2, 1], [0, 0, 0, 0, 0, 1, 1, 1]]); } /// Sliding window over matrix columns pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(5, 8); auto windows = slice .pack!1 .evertPack .windows(3) .unpack .pack!2; foreach (window; windows.byElement) window[] += 1; assert(slice == [[1, 2, 3, 3, 3, 3, 2, 1], [1, 2, 3, 3, 3, 3, 2, 1], [1, 2, 3, 3, 3, 3, 2, 1], [1, 2, 3, 3, 3, 3, 2, 1], [1, 2, 3, 3, 3, 3, 2, 1]]); } /++ Returns a new slice for the same data with different dimensions. Params: slice = slice to be reshaped lengths = list of new dimensions. One of the lengths can be set to `-1`. In this case, the corresponding dimension is inferable. Returns: reshaped slice Throws: $(LREF ReshapeException) if the slice cannot be reshaped with the input lengths. +/ Slice!(Lengths.length, Range) reshape ( size_t N, Range , Lengths... ) (auto ref Slice!(N, Range) slice, Lengths lengths) if ( allSatisfy!(isIndex, Lengths) && Lengths.length) { mixin _DefineRet; foreach (i; Iota!(0, ret.N)) ret._lengths[i] = lengths[i]; immutable size_t eco = slice.elementsCount; size_t ecn = ret .elementsCount; if (eco == 0) throw new ReshapeException( slice._lengths.dup, slice._strides.dup, ret. _lengths.dup, "slice should be not empty"); foreach (i; Iota!(0, ret.N)) if (ret._lengths[i] == -1) { ecn = -ecn; ret._lengths[i] = eco / ecn; ecn *= ret._lengths[i]; break; } if (eco != ecn) throw new ReshapeException( slice._lengths.dup, slice._strides.dup, ret. _lengths.dup, "total element count should be the same"); for (size_t oi, ni, oj, nj; oi < slice.N && ni < ret.N; oi = oj, ni = nj) { size_t op = slice._lengths[oj++]; size_t np = ret ._lengths[nj++]; for (;;) { if (op < np) op *= slice._lengths[oj++]; if (op > np) np *= ret ._lengths[nj++]; if (op == np) break; } while (oj < slice.N && slice._lengths[oj] == 1) oj++; while (nj < ret .N && ret ._lengths[nj] == 1) nj++; for (size_t l = oi, r = oi + 1; r < oj; r++) if (slice._lengths[r] != 1) { if (slice._strides[l] != slice._lengths[r] * slice._strides[r]) throw new ReshapeException( slice._lengths.dup, slice._strides.dup, ret. _lengths.dup, "structure is incompatible with new shape"); l = r; } ret._strides[nj - 1] = slice._strides[oj - 1]; foreach_reverse (i; ni .. nj - 1) ret._strides[i] = ret._lengths[i + 1] * ret._strides[i + 1]; assert((oi == slice.N) == (ni == ret.N)); } foreach (i; Iota!(ret.N, ret.PureN)) { ret._lengths[i] = slice._lengths[i + slice.N - ret.N]; ret._strides[i] = slice._strides[i + slice.N - ret.N]; } ret._ptr = slice._ptr; return ret; } /// @safe pure unittest { import std.experimental.ndslice.iteration: allReversed; auto slice = iotaSlice(3, 4) .allReversed .reshape(-1, 3); assert(slice == [[11, 10, 9], [ 8, 7, 6], [ 5, 4, 3], [ 2, 1, 0]]); } /// Reshaping with memory allocation pure unittest { import std.experimental.ndslice.slice; import std.experimental.ndslice.iteration: reversed; import std.array: array; auto reshape2(S, L...)(S slice, L lengths) { // Tries to reshape without allocation try return slice.reshape(lengths); catch(ReshapeException e) //allocates the elements and creates a slice //Note: -1 length is not supported by reshape2 return slice.byElement.array.sliced(lengths); } auto slice = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] .sliced(3, 4) .reversed!0; assert(reshape2(slice, 4, 3) == [[ 8, 9, 10], [11, 4, 5], [ 6, 7, 0], [ 1, 2, 3]]); } @safe pure unittest { import std.experimental.ndslice.iteration: allReversed; auto slice = iotaSlice(1, 1, 3, 2, 1, 2, 1).allReversed; assert(slice.reshape(1, -1, 1, 1, 3, 1) == [[[[[[11], [10], [9]]]], [[[[ 8], [ 7], [6]]]], [[[[ 5], [ 4], [3]]]], [[[[ 2], [ 1], [0]]]]]]); } // Issue 15919 unittest { assert(iotaSlice(3, 4, 5, 6, 7).pack!2.reshape(4, 3, 5)[0, 0, 0].shape == cast(size_t[2])[6, 7]); } @safe pure unittest { import std.experimental.ndslice.slice; import std.range: iota; import std.exception: assertThrown; auto e = 1.iotaSlice(1); // resize to the wrong dimension assertThrown!ReshapeException(e.reshape(2)); e.popFront; // test with an empty slice assertThrown!ReshapeException(e.reshape(1)); } unittest { auto pElements = iotaSlice(3, 4, 5, 6, 7) .pack!2 .byElement(); assert(pElements[0][0] == iotaSlice(7)); assert(pElements[$-1][$-1] == iotaSlice([7], 2513)); } /// See_also: $(LREF reshape) class ReshapeException: SliceException { /// Old lengths size_t[] lengths; /// Old strides sizediff_t[] strides; /// New lengths size_t[] newLengths; /// this( size_t[] lengths, sizediff_t[] strides, size_t[] newLengths, string msg, string file = __FILE__, uint line = cast(uint)__LINE__, Throwable next = null ) pure nothrow @nogc @safe { super(msg, file, line, next); this.lengths = lengths; this.strides = strides; this.newLengths = newLengths; } } /++ Returns a random access range of all elements of a slice. The order of elements is preserved. `byElement` can be generalized with other selectors. Params: N = dimension count slice = slice to be iterated Returns: random access range composed of elements of the `slice` +/ auto byElement(size_t N, Range)(auto ref Slice!(N, Range) slice) { with (Slice!(N, Range)) { /++ ByElement shifts the range's `_ptr` without modifying its strides and lengths. +/ static struct ByElement { This _slice; size_t _length; size_t[N] _indexes; static if (canSave!PureRange) auto save() @property { return typeof(this)(_slice.save, _length, _indexes); } bool empty() const @property { pragma(inline, true); return _length == 0; } size_t length() const @property { pragma(inline, true); return _length; } auto ref front() @property { assert(!this.empty); static if (N == PureN) { return _slice._ptr[0]; } else with (_slice) { alias M = DeepElemType.PureN; return DeepElemType(_lengths[$ - M .. $], _strides[$ - M .. $], _ptr); } } static if (PureN == 1 && isMutable!DeepElemType && !hasAccessByRef) auto front(E)(E elem) @property { assert(!this.empty); return _slice._ptr[0] = elem; } void popFront() { assert(_length != 0); _length--; popFrontImpl; } private void popFrontImpl() { foreach_reverse (i; Iota!(0, N)) with (_slice) { _ptr += _strides[i]; _indexes[i]++; if (_indexes[i] < _lengths[i]) return; debug (ndslice) assert(_indexes[i] == _lengths[i]); _ptr -= _lengths[i] * _strides[i]; _indexes[i] = 0; } } auto ref back() @property { assert(!this.empty); return opIndex(_length - 1); } static if (PureN == 1 && isMutable!DeepElemType && !hasAccessByRef) auto back(E)(E elem) @property { assert(!this.empty); return opIndexAssign(_length - 1, elem); } void popBack() { pragma(inline, true); assert(_length != 0); _length--; } void popFrontExactly(size_t n) in { assert(n <= _length); } body { _length -= n; //calculates shift and new indexes sizediff_t _shift; n += _indexes[N-1]; foreach_reverse (i; Iota!(1, N)) with (_slice) { immutable v = n / _lengths[i]; n %= _lengths[i]; _shift += (n - _indexes[i]) * _strides[i]; _indexes[i] = n; n = _indexes[i - 1] + v; } assert(n < _slice._lengths[0]); with (_slice) { _shift += (n - _indexes[0]) * _strides[0]; _indexes[0] = n; } _slice._ptr += _shift; } void popBackExactly(size_t n) in { assert(n <= _length); } body { pragma(inline, true); _length -= n; } //calculates shift for index n private sizediff_t getShift(size_t n) in { assert(n < _length); } body { sizediff_t _shift; n += _indexes[N-1]; foreach_reverse (i; Iota!(1, N)) with (_slice) { immutable v = n / _lengths[i]; n %= _lengths[i]; _shift += (n - _indexes[i]) * _strides[i]; n = _indexes[i - 1] + v; } debug (ndslice) assert(n < _slice._lengths[0]); with (_slice) _shift += (n - _indexes[0]) * _strides[0]; return _shift; } auto ref opIndex(size_t index) { static if (N == PureN) { return _slice._ptr[getShift(index)]; } else with (_slice) { alias M = DeepElemType.PureN; return DeepElemType(_lengths[$ - M .. $], _strides[$ - M .. $], _ptr + getShift(index)); } } static if (PureN == 1 && isMutable!DeepElemType && !hasAccessByRef) auto opIndexAssign(E)(E elem, size_t index) { static if (N == PureN) { return _slice._ptr[getShift(index)] = elem; } else { static assert(0, "ByElement.opIndexAssign is not implemented for packed slices." ~ "Use additional empty slicing `elemsOfSlice[index][] = value`" ~ tailErrorMessage()); } } static if (isMutable!DeepElemType && N == PureN) { auto opIndexAssign(V)(V val, _Slice slice) { return this[slice][] = val; } auto opIndexAssign(V)(V val) { foreach (ref e; this) e = val; return this; } auto opIndexAssign(V : T[], T)(V val) if (__traits(compiles, front = val[0])) { assert(_length == val.length, "lengths should be equal" ~ tailErrorMessage!()); foreach (ref e; this) { e = val[0]; val = val[1 .. $]; } return this; } auto opIndexAssign(V : Slice!(1, _Range), _Range)(V val) if (__traits(compiles, front = val.front)) { assert(_length == val.length, "lengths should be equal" ~ tailErrorMessage!()); foreach (ref e; this) { e = val.front; val.popFront; } return this; } } auto opIndex(_Slice sl) { auto ret = this; ret.popFrontExactly(sl.i); ret.popBackExactly(_length - sl.j); return ret; } alias opDollar = length; _Slice opSlice(size_t pos : 0)(size_t i, size_t j) in { assert(i <= j, "the left bound must be less than or equal to the right bound" ~ tailErrorMessage!()); assert(j - i <= _length, "the difference between the right and the left bound must be less than or equal to range length" ~ tailErrorMessage!()); } body { pragma(inline, true); return typeof(return)(i, j); } size_t[N] index() @property { pragma(inline, true); return _indexes; } } return ByElement(slice, slice.elementsCount); } } /// Regular slice @safe @nogc pure nothrow unittest { import std.algorithm.comparison: equal; import std.range: iota; assert(iotaSlice(4, 5) .byElement .equal(20.iota)); } /// Packed slice @safe @nogc pure nothrow unittest { import std.experimental.ndslice.slice; import std.experimental.ndslice.iteration; import std.range: drop; assert(iotaSlice(3, 4, 5, 6, 7) .pack!2 .byElement() .drop(1) .front == iotaSlice([6, 7], 6 * 7)); } /// Properties pure nothrow unittest { auto elems = iotaSlice(3, 4).byElement; elems.popFrontExactly(2); assert(elems.front == 2); assert(elems.index == [0, 2]); elems.popBackExactly(2); assert(elems.back == 9); assert(elems.length == 8); } /// Index property pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = new long[20].sliced(5, 4); for (auto elems = slice.byElement; !elems.empty; elems.popFront) { size_t[2] index = elems.index; elems.front = index[0] * 10 + index[1] * 3; } assert(slice == [[ 0, 3, 6, 9], [10, 13, 16, 19], [20, 23, 26, 29], [30, 33, 36, 39], [40, 43, 46, 49]]); } pure nothrow unittest { // test save import std.range: dropOne; import std.range: iota; auto elems = 12.iota.sliced(3, 4).byElement; assert(elems.front == 0); assert(elems.save.dropOne.front == 1); assert(elems.front == 0); } /++ Random access and slicing +/ @nogc nothrow unittest { import std.experimental.ndslice.slice; import std.algorithm.comparison: equal; import std.array: array; import std.range: iota, repeat; static data = 20.iota.array; auto elems = data.sliced(4, 5).byElement; elems = elems[11 .. $ - 2]; assert(elems.length == 7); assert(elems.front == 11); assert(elems.back == 17); foreach (i; 0 .. 7) assert(elems[i] == i + 11); // assign an element elems[2 .. 6] = -1; assert(elems[2 .. 6].equal(repeat(-1, 4))); // assign an array static ar = [-1, -2, -3, -4]; elems[2 .. 6] = ar; assert(elems[2 .. 6].equal(ar)); // assign a slice ar[] *= 2; auto sl = ar.sliced(ar.length); elems[2 .. 6] = sl; assert(elems[2 .. 6].equal(sl)); } /++ Forward access works faster than random access or backward access. Use $(SUBREF iteration, allReversed) in pipeline before `byElement` to achieve fast backward access. +/ @safe @nogc pure nothrow unittest { import std.range: retro; import std.experimental.ndslice.iteration: allReversed; auto slice = iotaSlice(3, 4, 5); /// Slow backward iteration #1 foreach (ref e; slice.byElement.retro) { //... } /// Slow backward iteration #2 foreach_reverse (ref e; slice.byElement) { //... } /// Fast backward iteration foreach (ref e; slice.allReversed.byElement) { //... } } @safe @nogc pure nothrow unittest { import std.range.primitives: isRandomAccessRange, hasSlicing; auto elems = iotaSlice(4, 5).byElement; static assert(isRandomAccessRange!(typeof(elems))); static assert(hasSlicing!(typeof(elems))); } // Checks strides @safe @nogc pure nothrow unittest { import std.experimental.ndslice.iteration; import std.range: isRandomAccessRange; auto elems = iotaSlice(4, 5).everted.byElement; static assert(isRandomAccessRange!(typeof(elems))); elems = elems[11 .. $ - 2]; auto elems2 = elems; foreach (i; 0 .. 7) { assert(elems[i] == elems2.front); elems2.popFront; } } @safe @nogc pure nothrow unittest { import std.experimental.ndslice.slice; import std.experimental.ndslice.iteration; import std.range: iota, isForwardRange, hasLength; import std.algorithm.comparison: equal; auto range = (3 * 4 * 5 * 6 * 7).iota; auto slice0 = range.sliced(3, 4, 5, 6, 7); auto slice1 = slice0.transposed!(2, 1).pack!2; auto elems0 = slice0.byElement; auto elems1 = slice1.byElement; import std.meta; foreach (S; AliasSeq!(typeof(elems0), typeof(elems1))) { static assert(isForwardRange!S); static assert(hasLength!S); } assert(elems0.length == slice0.elementsCount); assert(elems1.length == 5 * 4 * 3); auto elems2 = elems1; foreach (q; slice1) foreach (w; q) foreach (e; w) { assert(!elems2.empty); assert(e == elems2.front); elems2.popFront; } assert(elems2.empty); elems0.popFront(); elems0.popFrontExactly(slice0.elementsCount - 14); assert(elems0.length == 13); assert(elems0.equal(range[slice0.elementsCount - 13 .. slice0.elementsCount])); foreach (elem; elems0) {} } // Issue 15549 unittest { import std.range.primitives; alias A = typeof(iotaSlice(2, 5).sliced(1, 1, 1, 1)); static assert(isRandomAccessRange!A); static assert(hasLength!A); static assert(hasSlicing!A); alias B = typeof(slice!double(2, 5).sliced(1, 1, 1, 1)); static assert(isRandomAccessRange!B); static assert(hasLength!B); static assert(hasSlicing!B); } /++ Returns an forward range of all elements of standard simplex of a slice. In case the slice has two dimensions, it is composed of elements of upper left triangular matrix. The order of elements is preserved. `byElementInStandardSimplex` can be generalized with other selectors. Params: N = dimension count slice = slice to be iterated Returns: forward range composed of all elements of standard simplex of the `slice` +/ auto byElementInStandardSimplex(size_t N, Range)(auto ref Slice!(N, Range) slice, size_t maxCobeLength = size_t.max) { with (Slice!(N, Range)) { /++ ByElementInTopSimplex shifts the range's `_ptr` without modifying its strides and lengths. +/ static struct ByElementInTopSimplex { This _slice; size_t _length; size_t maxCobeLength; size_t sum; size_t[N] _indexes; static if (canSave!PureRange) auto save() @property { return typeof(this)(_slice.save, _length, maxCobeLength, sum, _indexes); } bool empty() const @property { pragma(inline, true); return _length == 0; } size_t length() const @property { pragma(inline, true); return _length; } auto ref front() @property { assert(!this.empty); static if (N == PureN) return _slice._ptr[0]; else with (_slice) { alias M = DeepElemType.PureN; return DeepElemType(_lengths[$ - M .. $], _strides[$ - M .. $], _ptr); } } static if (PureN == 1 && isMutable!DeepElemType && !hasAccessByRef) auto front(E)(E elem) @property { pragma(inline, true); assert(!this.empty); return _slice._ptr[0] = elem; } void popFront() { pragma(inline, true); assert(_length != 0); _length--; popFrontImpl; } private void popFrontImpl() { foreach_reverse (i; Iota!(0, N)) with (_slice) { _ptr += _strides[i]; _indexes[i]++; debug (ndslice) assert(_indexes[i] <= _lengths[i]); sum++; if (sum < maxCobeLength) return; debug (ndslice) assert(sum == maxCobeLength); _ptr -= _indexes[i] * _strides[i]; sum -= _indexes[i]; _indexes[i] = 0; } } size_t[N] index() @property { pragma(inline, true); return _indexes; } } foreach (i; Iota!(0, N)) if (maxCobeLength > slice._lengths[i]) maxCobeLength = slice._lengths[i]; immutable size_t elementsCount = ((maxCobeLength + 1) * maxCobeLength ^^ (N - 1)) / 2; return ByElementInTopSimplex(slice, elementsCount, maxCobeLength); } } /// pure nothrow unittest { import std.experimental.ndslice.slice; auto slice = slice!int(4, 5); auto elems = slice .byElementInStandardSimplex; int i; foreach (ref e; elems) e = ++i; assert(slice == [[ 1, 2, 3, 4, 0], [ 5, 6, 7, 0, 0], [ 8, 9, 0, 0, 0], [10, 0, 0, 0, 0]]); } /// pure nothrow unittest { import std.experimental.ndslice.slice; import std.experimental.ndslice.iteration; auto slice = slice!int(4, 5); auto elems = slice .transposed .allReversed .byElementInStandardSimplex; int i; foreach (ref e; elems) e = ++i; assert(slice == [[0, 0, 0, 0, 4], [0, 0, 0, 7, 3], [0, 0, 9, 6, 2], [0, 10, 8, 5, 1]]); } /// Properties @safe @nogc pure nothrow unittest { import std.range.primitives: popFrontN; auto elems = iotaSlice(3, 4).byElementInStandardSimplex; elems.popFront; assert(elems.front == 1); assert(elems.index == cast(size_t[2])[0, 1]); elems.popFrontN(3); assert(elems.front == 5); } /// Save @safe @nogc pure nothrow unittest { auto elems = iotaSlice(3, 4).byElementInStandardSimplex; import std.range: dropOne, popFrontN; elems.popFrontN(4); assert(elems.save.dropOne.front == 8); assert(elems.front == 5); assert(elems.index == cast(size_t[2])[1, 1]); assert(elems.length == 2); } /++ Returns a slice, the elements of which are equal to the initial multidimensional index value. This is multidimensional analog of $(LINK2 std_range.html#iota, std.range.iota). For a flattened (continuous) index, see $(LREF iotaSlice). Params: N = dimension count lengths = list of dimension lengths Returns: `N`-dimensional slice composed of indexes See_also: $(LREF IndexSlice), $(LREF iotaSlice) +/ IndexSlice!(Lengths.length) indexSlice(Lengths...)(Lengths lengths) if (allSatisfy!(isIndex, Lengths)) { return .indexSlice!(Lengths.length)([lengths]); } ///ditto IndexSlice!N indexSlice(size_t N)(auto ref size_t[N] lengths) { import std.experimental.ndslice.slice: sliced; with (typeof(return)) return Range(lengths[1 .. $]).sliced(lengths); } /// @safe pure nothrow @nogc unittest { auto slice = indexSlice(2, 3); static immutable array = [[[0, 0], [0, 1], [0, 2]], [[1, 0], [1, 1], [1, 2]]]; assert(slice == array); static assert(is(IndexSlice!2 : Slice!(2, Range), Range)); static assert(is(DeepElementType!(IndexSlice!2) == size_t[2])); } /// @safe pure nothrow unittest { auto im = indexSlice(7, 9); assert(im[2, 1] == [2, 1]); //slicing works correctly auto cm = im[1 .. $, 4 .. $]; assert(cm[2, 1] == [3, 5]); } @safe pure nothrow unittest { // test save import std.range: dropOne; auto im = indexSlice(7, 9); auto imByElement = im.byElement; assert(imByElement.front == [0, 0]); assert(imByElement.save.dropOne.front == [0, 1]); assert(imByElement.front == [0, 0]); } /++ Slice composed of indexes. See_also: $(LREF indexSlice) +/ template IndexSlice(size_t N) if (N) { struct IndexMap { private size_t[N-1] _lengths; IndexMap save() @property const { pragma(inline, true); return this; } size_t[N] opIndex(size_t index) const { pragma(inline, true); size_t[N] indexes = void; foreach_reverse (i; Iota!(0, N - 1)) { indexes[i + 1] = index % _lengths[i]; index /= _lengths[i]; } indexes[0] = index; return indexes; } } alias IndexSlice = Slice!(N, IndexMap); } unittest { auto r = indexSlice(1); import std.range.primitives: isRandomAccessRange; static assert(isRandomAccessRange!(typeof(r))); } /++ Returns a slice, the elements of which are equal to the initial flattened index value. For a multidimensional index, see $(LREF indexSlice). Params: N = dimension count lengths = list of dimension lengths shift = value of the first element in a slice Returns: `N`-dimensional slice composed of indexes See_also: $(LREF IotaSlice), $(LREF indexSlice) +/ IotaSlice!(Lengths.length) iotaSlice(Lengths...)(Lengths lengths) if (allSatisfy!(isIndex, Lengths)) { return .iotaSlice!(Lengths.length)([lengths]); } ///ditto IotaSlice!N iotaSlice(size_t N)(auto ref size_t[N] lengths, size_t shift = 0) { import std.experimental.ndslice.slice: sliced; with (typeof(return)) return Range.init.sliced(lengths, shift); } /// @safe pure nothrow @nogc unittest { auto slice = iotaSlice(2, 3); static immutable array = [[0, 1, 2], [3, 4, 5]]; assert(slice == array); import std.range.primitives: isRandomAccessRange; static assert(isRandomAccessRange!(IotaSlice!2)); static assert(is(IotaSlice!2 : Slice!(2, Range), Range)); static assert(is(DeepElementType!(IotaSlice!2) == size_t)); } /// @safe pure nothrow unittest { auto im = iotaSlice([10, 5], 100); assert(im[2, 1] == 111); // 100 + 2 * 5 + 1 //slicing works correctly auto cm = im[1 .. $, 3 .. $]; assert(cm[2, 1] == 119); // 119 = 100 + (1 + 2) * 5 + (3 + 1) } /++ Slice composed of flattened indexes. See_also: $(LREF iotaSlice) +/ template IotaSlice(size_t N) if (N) { alias IotaSlice = Slice!(N, IotaMap!()); } // undocumented // zero cost variant of `std.range.iota` struct IotaMap() { enum bool empty = false; enum IotaMap save = IotaMap.init; static size_t opIndex()(size_t index) @safe pure nothrow @nogc @property { pragma(inline, true); return index; } }
D
module hunt.wechat.bean.message.CopyrightCheckResult; import hunt.collection.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "CopyrightCheckResult") @XmlAccessorType(XmlAccessType.FIELD) class CopyrightCheckResult { private Integer Count; @XmlElementWrapper(name = "ResultList") //@XmlElement(name = "item") private List!(CopyrightCheckResultItem) ResultList; private Integer CheckState; //整体校验结果 1-未被判为转载,可以群发,2-被判为转载,可以群发,3-被判为转载,不能群发 public Integer getCount() { return Count; } public void setCount(Integer count) { Count = count; } public List!(CopyrightCheckResultItem) getResultList() { return ResultList; } public void setResultList(List!(CopyrightCheckResultItem) resultList) { ResultList = resultList; } public Integer getCheckState() { return CheckState; } public void setCheckState(Integer checkState) { CheckState = checkState; } }
D
part get a divorce of someone whose marriage has been legally dissolved
D
C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/libraries/soft_serial/examples/.phr_out/lib/corelib_dac.d C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/libraries/soft_serial/examples/.phr_out/lib/corelib_dac.p1: hardware/cores/lib/corelib_dac.c C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_adc.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_user_interrupt.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/PhilRoboKit_CoreLib_GlobalDefs.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_basetimer.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/PhilRoboKit_CoreLib_DataTypes.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_16bit_timer.h hardware/cores/lib/corelib_dac.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_pwm.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_dac.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_timer.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_uart.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/compilers/htc/htc_16f87xa.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_gpio.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_pwm.h hardware/cores/lib/corelib_pwm.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/PhilRoboKit_HW_Config.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_16bit_timer.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_uart.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/PhilRoboKit_CoreLib_Header.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_8bit_timer.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_gpio.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_user_interrupt.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/hal_adc.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_masterlib.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/lib/corelib_8bit_timer.h C:/Users/glutnix/Documents/Dropbox/__RapidProto/philrobokit_xc8/hardware/cores/PhilRoboKit_CoreLib_Macro.h
D
of or relating to or characteristic of an autobiographer relating to or in the style of an autobiography
D
instance NOV_1332_BAALKAGAN(NPC_DEFAULT) { name[0] = "Идол Каган"; npctype = NPCTYPE_MAIN; guild = GIL_NOV; level = 9; voice = 13; id = 1332; attribute[ATR_STRENGTH] = 15; attribute[ATR_DEXTERITY] = 15; attribute[ATR_MANA_MAX] = 0; attribute[ATR_MANA] = 0; attribute[ATR_HITPOINTS_MAX] = 148; attribute[ATR_HITPOINTS] = 148; Mdl_SetVisual(self,"HUMANS.MDS"); Mdl_ApplyOverlayMds(self,"Humans_Mage.mds"); Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Psionic",29,1,nov_armor_h); b_scale(self); Mdl_SetModelFatness(self,-1); fight_tactic = FAI_HUMAN_STRONG; Npc_SetTalentSkill(self,NPC_TALENT_1H,1); EquipItem(self,itmw_1h_axe_old_01); CreateInvItems(self,itmijoint_1,10); CreateInvItems(self,itmijoint_2,20); CreateInvItems(self,itmijoint_3,20); daily_routine = rtn_start_1332; }; func void rtn_start_1332() { ta_standaround(0,0,7,30,"NC_PATH_PEASANT_OUTSIDE11"); ta_smalltalk(7,30,0,0,"NC_PLACE06"); }; func void rtn_ch5_1332() { ta_standaround(0,0,7,30,"NC_PATH_PEASANT_OUTSIDE11"); ta_smalltalk(7,30,16,0,"NC_PLACE06"); ta_smalltalk(16,0,17,0,"NC_TAVERN_SIDE02"); ta_smalltalk(17,0,0,0,"NC_PLACE06"); };
D
func void ZS_TestHangAround() { Npc_PercEnable(self,PERC_ASSESSENTERROOM,B_AssessEnterRoom); AI_GotoWP(self,self.wp); }; func void ZS_TestHangAround_Loop() { AI_PlayAni(self,"T_PERCEPTION"); }; func void ZS_TestHangAround_End() { }; func void ZS_TestPerception() { Npc_PercEnable(self,PERC_ASSESSTALK,TestPrint); }; func void ZS_TestPerception_Loop() { if(Hlp_IsValidNpc(other)) { PrintDebugS("other valid im TestHang"); }; if(Npc_GetStateTime(self) > 20) { return; }; }; func void ZS_TestPerception_End() { }; func void TestPrint() { Print("Perception AN !!!"); Npc_PercDisable(self,PERC_ASSESSTALK); }; func void ZS_TestPerception1() { Npc_PercDisable(self,PERC_ASSESSTALK); }; func void ZS_TestPerception1_Loop() { if(Npc_GetDistToNpc(self,other) < 500) { AI_ContinueRoutine(self); }; }; func void ZS_TestPerception1_End() { };
D