code
stringlengths
3
10M
language
stringclasses
31 values
/** * Compiler implementation of the D programming language * http://dlang.org * * Copyright: Copyright (c) 1999-2016 by D Language Foundation, All Rights Reserved * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Source: $(DMDSRC root/_longdouble.d) */ module ddmd.root.longdouble; real ldouble(T)(T x) { return cast(real)x; }
D
INSTANCE Info_Mod_Vigonza_Hi (C_INFO) { npc = Mod_7572_OUT_Vigonza_EIS; nr = 1; condition = Info_Mod_Vigonza_Hi_Condition; information = Info_Mod_Vigonza_Hi_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Vigonza_Hi_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Luis_Hi)) { return 1; }; }; FUNC VOID Info_Mod_Vigonza_Hi_Info() { AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_00"); //Was zum Teufel?! Wie kommst du hier rauf und was hast du mit meinen Männern gemacht? AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_01"); //Um deine Männer würde ich mir keine Sorgen mehr machen, mit denen hatte der Sensenmann schon seinen Spaß. Bei dir steht das noch aus. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_02"); //Hast du überhaupt den blassesten Schimmer, was wir hier machen und wer wir sind? AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_03"); //Ihr seid selbst Schuld. Warum greifen deine Leute auch jeden an? AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_04"); //Auf einmal sind meine Leute Schuld? Wir wurden doch als Erste angegriffen. AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_05"); //Wer soll euch denn angriffen haben? AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_06"); //Ein Jäger. Er hat einen meiner besten Männer mit seinem Bogen beschossen. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_07"); //Natürlich konnte ich ihm das nicht durchgehen lassen und hab zwei meiner Männer losgeschickt, die ihn zu mir bringen sollten. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_08"); //Sie sind aber bis heute nicht zurückgekehrt. Deshalb habe ich befohlen, jeden, der sich uns nähert, anzugreifen, bis ich weiß, ob man uns hier feindlich gesonnen ist. AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_09"); //Ich hab den Jäger gefunden, der von deinen Leuten verfolgt wurde. Sie haben ihn getötet und das gleiche auch bei mir versucht, allerdings ohne Erfolg. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_10"); //Wenn sie ihn getötet haben, dann nur, weil er sie angegriffen hat. Und kannst du es ihnen dann übel nehmen, wenn sie auch dich für eine Feind halten. AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_11"); //Gut, aber dann erklär mir, warum ein Jäger euch angreifen sollte? AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_12"); //Ich schätze mal er wollte das, weshalb auch wir in diese Lande gekommen sind. Mit der Ausnahme, dass er hinter dem schnellen Gold her war und wir um unsere Existenz kämpfen. AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_13"); //Das musst du mir genauer erklären. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_14"); //Ich bin Hauptmann unseres Königs George Goddard, dem Zweiten. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_15"); //Unser König hat uns entsandt, um das Blut der Dalma, einer Riesenspinne, die normalerweise tief unter der Erde lebt, zu holen, um ihn von seiner Familienkrankheit zu heilen. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_16"); //Allerdings ist sie uns im Kampf in den Tiefen der Berge entwischt und in dieses Land geflüchtet. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_17"); //Als mein bester Krieger sie für mich besiegen sollte, wurde er von dem Jäger angegriffen. Warscheinlich, weil er den Wert der Trophäen vor Augen hatte. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_18"); //Und seitdem habe ich versucht, meine Leute auf einen Angriff vorzubereiten. Aber ohne meinen besten Krieger hätten sie es warscheinlich nicht geschafft. AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_19"); //Ich glaube euch. Hätte man das vorher klären können, wären eure Leute noch am Leben. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_20"); //Vielleicht war es Schicksal. Du siehst aus, als könntest du gut kämpfen, und vielleicht hast du mehr Chancen gegen das Monster, als alle meine Leute zusammen. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_21"); //Ich bitte dich darum, mir im Kampf gegen die Dalma zur Seite zu stehen. Ich kann mich in meiner Heimat nicht ohne das Blut sehen lassen. AI_Output(hero, self, "Info_Mod_Vigonza_Hi_15_22"); //In Ordnung. Führe mich zu der Spinne und ich werde dir helfen. AI_Output(self, hero, "Info_Mod_Vigonza_Hi_16_23"); //Folge mir! B_LogEntry (TOPIC_MOD_EIS_ALTERTURM, "Alles nur ein Misverständnis. Es scheint so als hätte Randi diesen Angriff provoziert. Wenigstens hat er seine gerechte Strafe bekommen. Vigonza, der Anführer der Bande, hat mich gebeten ihm beim Kampf gegen die Dalma, eine gefährliche Riesenspinne beizustehen. Er wird mich dorthin führen."); AI_StopProcessInfos (self); B_StartOtherRoutine (self, "DALMA"); Wld_InsertNpc (Dalma, "EIS_400"); }; INSTANCE Info_Mod_Vigonza_Dalma (C_INFO) { npc = Mod_7572_OUT_Vigonza_EIS; nr = 1; condition = Info_Mod_Vigonza_Dalma_Condition; information = Info_Mod_Vigonza_Dalma_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Vigonza_Dalma_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Vigonza_Hi)) && (Npc_GetDistToWP(self, "EIS_400") < 500) && (Npc_IsDead(Dalma)) { return 1; }; }; FUNC VOID Info_Mod_Vigonza_Dalma_Info() { AI_Output(self, hero, "Info_Mod_Vigonza_Dalma_16_00"); //Endlich ist das Mistvieh erlegt. Ich danke dir. Hier, nimm dies als Belohnung. B_GiveInvItems (self, hero, ItAt_DalmaZange, 2); AI_Output(self, hero, "Info_Mod_Vigonza_Dalma_16_01"); //Es sind die Zangen der Dalma. Mögen sie dir einen Goldregen schenken. AI_Output(self, hero, "Info_Mod_Vigonza_Dalma_16_02"); //Ich werde mich jetzt zum Pass begeben. Hoffentlich komme ich nicht zu spät. Alles Gute, Fremder. B_LogEntry (TOPIC_MOD_EIS_ALTERTURM, "Die Dalma ist erledigt. Vigonza wird nun zurückkehren und ich sollte zu Keith gehen."); AI_StopProcessInfos (self); B_StartOtherRoutine (self, "TOT"); }; INSTANCE Info_Mod_Vigonza_EXIT (C_INFO) { npc = Mod_7572_OUT_Vigonza_EIS; nr = 1; condition = Info_Mod_Vigonza_EXIT_Condition; information = Info_Mod_Vigonza_EXIT_Info; permanent = 1; important = 0; description = DIALOG_ENDE; }; FUNC INT Info_Mod_Vigonza_EXIT_Condition() { return 1; }; FUNC VOID Info_Mod_Vigonza_EXIT_Info() { AI_StopProcessInfos (self); };
D
very great resembling an abyss in depth
D
int main(){ bool a; bool b; bool c; a = false; b = true; c = a && b; Print(c); c = a || b; Print(c); c = !a; Print(c); }
D
/home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Core.build/Thread+Async.swift.o : /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/NestedData.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Thread+Async.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Deprecated.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/NotFound.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Reflectable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/File.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/MediaType.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/OptionalType.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Process+Execute.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/HeaderValue.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/FutureEncoder.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CoreError.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/String+Utilities.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/DataCoders.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Exports.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Data+Hex.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/BasicKey.swift /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIO.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Async.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/COperatingSystem.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIOConcurrencyHelpers.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIOFoundationCompat.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/share/swift/usr/lib/swift/linux/x86_64/glibc.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOSHA1.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOOpenSSL.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CCryptoOpenSSL.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOZlib.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIODarwin.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOHTTPParser.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOAtomics.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOLinux.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio-zlib-support/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Core.build/Thread+Async~partial.swiftmodule : /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/NestedData.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Thread+Async.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Deprecated.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/NotFound.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Reflectable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/File.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/MediaType.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/OptionalType.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Process+Execute.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/HeaderValue.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/FutureEncoder.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CoreError.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/String+Utilities.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/DataCoders.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Exports.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Data+Hex.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/BasicKey.swift /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIO.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Async.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/COperatingSystem.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIOConcurrencyHelpers.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIOFoundationCompat.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/share/swift/usr/lib/swift/linux/x86_64/glibc.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOSHA1.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOOpenSSL.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CCryptoOpenSSL.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOZlib.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIODarwin.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOHTTPParser.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOAtomics.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOLinux.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio-zlib-support/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Core.build/Thread+Async~partial.swiftdoc : /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Data+Base64URL.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/NestedData.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Thread+Async.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Deprecated.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/NotFound.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecodable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/Decodable+Reflectable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Reflectable.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/LosslessDataConvertible.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/File.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/MediaType.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/OptionalType.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Process+Execute.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/HeaderValue.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/DirectoryConfig.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CaseInsensitiveString.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Future+Unwrap.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/FutureEncoder.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CoreError.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/String+Utilities.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/DataCoders.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/CodableReflection/ReflectionDecoders.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Exports.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/Data+Hex.swift /home/juliobrz/Git/PixelCanvas/.build/checkouts/core/Sources/Core/BasicKey.swift /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIO.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Async.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/COperatingSystem.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIOConcurrencyHelpers.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/NIOFoundationCompat.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/share/swift/usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/share/swift/usr/lib/swift/linux/x86_64/glibc.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOSHA1.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOOpenSSL.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CCryptoOpenSSL.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOZlib.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIODarwin.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOHTTPParser.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOAtomics.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/x86_64-unknown-linux/debug/CNIOLinux.build/module.modulemap /home/juliobrz/Git/PixelCanvas/.build/checkouts/swift-nio-zlib-support/module.modulemap
D
/* * Hunt - A data validation for DLang based on hunt library. * * Copyright (C) 2015-2019, HuntLabs * * Website: https://www.huntlabs.net * * Licensed under the Apache-2.0 License. * */ module hunt.validation.constraints.AssertFalse; struct AssertFalse { string message="must be false"; }
D
/Users/hashgard-01/rust/src/github.com/adao/target/release/build/crunchy-35a6264a7a76182e/build_script_build-35a6264a7a76182e: /Users/hashgard-01/.cargo/registry/src/github.com-1ecc6299db9ec823/crunchy-0.1.6/build.rs /Users/hashgard-01/rust/src/github.com/adao/target/release/build/crunchy-35a6264a7a76182e/build_script_build-35a6264a7a76182e.d: /Users/hashgard-01/.cargo/registry/src/github.com-1ecc6299db9ec823/crunchy-0.1.6/build.rs /Users/hashgard-01/.cargo/registry/src/github.com-1ecc6299db9ec823/crunchy-0.1.6/build.rs:
D
/** * Implementation of associative arrays. * * Copyright: Copyright Digital Mars 2000 - 2010. * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. * Authors: Walter Bright, Sean Kelly */ /* Copyright Digital Mars 2000 - 2010. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) */ module rt.aaA; private { import core.stdc.stdarg; import core.stdc.string; import core.stdc.stdio; import core.memory; enum BlkAttr : uint { FINALIZE = 0b0000_0001, NO_SCAN = 0b0000_0010, NO_MOVE = 0b0000_0100, APPENDABLE = 0b0000_1000, NO_INTERIOR = 0b0001_0000, ALL_BITS = 0b1111_1111 } extern (C) void* gc_malloc( size_t sz, uint ba = 0 ); extern (C) void gc_free( void* p ); // Convenience function to make sure the NO_INTERIOR gets set on the // aaA arrays. aaA*[] newaaA(size_t len) { auto ptr = cast(aaA**) gc_malloc( len * (aaA*).sizeof, BlkAttr.NO_INTERIOR); auto ret = ptr[0..len]; ret[] = null; return ret; } } // Auto-rehash and pre-allocate - Dave Fladebo static immutable size_t[] prime_list = [ 31UL, 97UL, 389UL, 1_543UL, 6_151UL, 24_593UL, 98_317UL, 393_241UL, 1_572_869UL, 6_291_469UL, 25_165_843UL, 100_663_319UL, 402_653_189UL, 1_610_612_741UL, 4_294_967_291UL, // 8_589_934_513UL, 17_179_869_143UL ]; /* This is the type of the return value for dynamic arrays. * It should be a type that is returned in registers. * Although DMD will return types of Array in registers, * gcc will not, so we instead use a 'long'. */ alias void[] ArrayRet_t; struct Array { size_t length; void* ptr; } struct aaA { aaA *next; size_t hash; /* key */ /* value */ } struct BB { aaA*[] b; size_t nodes; // total number of aaA nodes TypeInfo keyti; // TODO: replace this with TypeInfo_AssociativeArray when available in _aaGet() aaA*[4] binit; // initial value of b[] } /* This is the type actually seen by the programmer, although * it is completely opaque. */ struct AA { BB* a; } /********************************** * Align to next pointer boundary, so that * GC won't be faced with misaligned pointers * in value. */ size_t aligntsize(size_t tsize) nothrow { version (D_LP64) // Size of key needed to align value on 16 bytes return (tsize + 15) & ~(15); else return (tsize + size_t.sizeof - 1) & ~(size_t.sizeof - 1); } extern (C): /************************************************* * Invariant for aa. */ /+ void _aaInvAh(aaA*[] aa) { for (size_t i = 0; i < aa.length; i++) { if (aa[i]) _aaInvAh_x(aa[i]); } } private int _aaCmpAh_x(aaA *e1, aaA *e2) { int c; c = e1.hash - e2.hash; if (c == 0) { c = e1.key.length - e2.key.length; if (c == 0) c = memcmp((char *)e1.key, (char *)e2.key, e1.key.length); } return c; } private void _aaInvAh_x(aaA *e) { size_t key_hash; aaA *e1; aaA *e2; key_hash = getHash(e.key); assert(key_hash == e.hash); while (1) { int c; e1 = e.left; if (e1) { _aaInvAh_x(e1); // ordinary recursion do { c = _aaCmpAh_x(e1, e); assert(c < 0); e1 = e1.right; } while (e1 != null); } e2 = e.right; if (e2) { do { c = _aaCmpAh_x(e, e2); assert(c < 0); e2 = e2.left; } while (e2 != null); e = e.right; // tail recursion } else break; } } +/ /**************************************************** * Determine number of entries in associative array. */ size_t _aaLen(AA aa) in { //printf("_aaLen()+\n"); //_aaInv(aa); } out (result) { size_t len = 0; if (aa.a) { foreach (e; aa.a.b) { while (e) { len++; e = e.next; } } } assert(len == result); //printf("_aaLen()-\n"); } body { return aa.a ? aa.a.nodes : 0; } /************************************************* * Get pointer to value in associative array indexed by key. * Add entry for key if it is not already there. */ // retained for backwards compatibility void* _aaGet(AA* aa, TypeInfo keyti, size_t valuesize, ...) { return _aaGetX(aa, keyti, valuesize, cast(void*)(&valuesize + 1)); } void* _aaGetX(AA* aa, TypeInfo keyti, size_t valuesize, void* pkey) in { assert(aa); } out (result) { assert(result); assert(aa.a); assert(aa.a.b.length); //assert(_aaInAh(*aa.a, key)); } body { size_t i; aaA *e; //printf("keyti = %p\n", keyti); //printf("aa = %p\n", aa); immutable keytitsize = keyti.tsize(); if (!aa.a) { aa.a = new BB(); aa.a.b = aa.a.binit[]; } //printf("aa = %p\n", aa); //printf("aa.a = %p\n", aa.a); aa.a.keyti = keyti; auto key_hash = keyti.getHash(pkey); //printf("hash = %d\n", key_hash); i = key_hash % aa.a.b.length; auto pe = &aa.a.b[i]; while ((e = *pe) !is null) { if (key_hash == e.hash) { auto c = keyti.compare(pkey, e + 1); if (c == 0) goto Lret; } pe = &e.next; } // Not found, create new elem //printf("create new one\n"); size_t size = aaA.sizeof + aligntsize(keytitsize) + valuesize; e = cast(aaA *) gc_malloc(size); e.next = null; e.hash = key_hash; ubyte* ptail = cast(ubyte*)(e + 1); memcpy(ptail, pkey, keytitsize); memset(ptail + aligntsize(keytitsize), 0, valuesize); // zero value *pe = e; auto nodes = ++aa.a.nodes; //printf("length = %d, nodes = %d\n", aa.a.b.length, nodes); if (nodes > aa.a.b.length * 4) { //printf("rehash\n"); _aaRehash(aa,keyti); } Lret: return cast(void *)(e + 1) + aligntsize(keytitsize); } /************************************************* * Get pointer to value in associative array indexed by key. * Returns null if it is not already there. */ void* _aaGetRvalue(AA aa, TypeInfo keyti, size_t valuesize, ...) { return _aaGetRvalueX(aa, keyti, valuesize, cast(void*)(&valuesize + 1)); } void* _aaGetRvalueX(AA aa, TypeInfo keyti, size_t valuesize, void* pkey) { //printf("_aaGetRvalue(valuesize = %u)\n", valuesize); if (!aa.a) return null; auto keysize = aligntsize(keyti.tsize()); auto len = aa.a.b.length; if (len) { auto key_hash = keyti.getHash(pkey); //printf("hash = %d\n", key_hash); size_t i = key_hash % len; auto e = aa.a.b[i]; while (e !is null) { if (key_hash == e.hash) { auto c = keyti.compare(pkey, e + 1); if (c == 0) return cast(void *)(e + 1) + keysize; } e = e.next; } } return null; // not found, caller will throw exception } /************************************************* * Determine if key is in aa. * Returns: * null not in aa * !=null in aa, return pointer to value */ void* _aaIn(AA aa, TypeInfo keyti, ...) { return _aaInX(aa, keyti, cast(void*)(&keyti + 1)); } void* _aaInX(AA aa, TypeInfo keyti, void* pkey) in { } out (result) { //assert(result == 0 || result == 1); } body { if (aa.a) { //printf("_aaIn(), .length = %d, .ptr = %x\n", aa.a.length, cast(uint)aa.a.ptr); auto len = aa.a.b.length; if (len) { auto key_hash = keyti.getHash(pkey); //printf("hash = %d\n", key_hash); const i = key_hash % len; auto e = aa.a.b[i]; while (e !is null) { if (key_hash == e.hash) { auto c = keyti.compare(pkey, e + 1); if (c == 0) return cast(void *)(e + 1) + aligntsize(keyti.tsize()); } e = e.next; } } } // Not found return null; } /************************************************* * Delete key entry in aa[]. * If key is not in aa[], do nothing. */ bool _aaDel(AA aa, TypeInfo keyti, ...) { return _aaDelX(aa, keyti, cast(void*)(&keyti + 1)); } bool _aaDelX(AA aa, TypeInfo keyti, void* pkey) { aaA *e; if (aa.a && aa.a.b.length) { auto key_hash = keyti.getHash(pkey); //printf("hash = %d\n", key_hash); size_t i = key_hash % aa.a.b.length; auto pe = &aa.a.b[i]; while ((e = *pe) !is null) // null means not found { if (key_hash == e.hash) { auto c = keyti.compare(pkey, e + 1); if (c == 0) { *pe = e.next; aa.a.nodes--; gc_free(e); return true; } } pe = &e.next; } } return false; } /******************************************** * Produce array of values from aa. */ ArrayRet_t _aaValues(AA aa, size_t keysize, size_t valuesize) { size_t resi; Array a; auto alignsize = aligntsize(keysize); if (aa.a) { a.length = _aaLen(aa); a.ptr = cast(byte*) gc_malloc(a.length * valuesize, valuesize < (void*).sizeof ? BlkAttr.NO_SCAN : 0); resi = 0; foreach (e; aa.a.b) { while (e) { memcpy(a.ptr + resi * valuesize, cast(byte*)e + aaA.sizeof + alignsize, valuesize); resi++; e = e.next; } } assert(resi == a.length); } return *cast(ArrayRet_t*)(&a); } /******************************************** * Rehash an array. */ void* _aaRehash(AA* paa, TypeInfo keyti) in { //_aaInvAh(paa); } out (result) { //_aaInvAh(result); } body { //printf("Rehash\n"); if (paa.a) { BB newb; auto aa = paa.a; auto len = _aaLen(*paa); if (len) { size_t i; for (i = 0; i < prime_list.length - 1; i++) { if (len <= prime_list[i]) break; } len = prime_list[i]; newb.b = newaaA(len); foreach (e; aa.b) { while (e) { auto enext = e.next; const j = e.hash % len; e.next = newb.b[j]; newb.b[j] = e; e = enext; } } if (aa.b.ptr == aa.binit.ptr) aa.binit[] = null; else GC.free(aa.b.ptr); newb.nodes = aa.nodes; newb.keyti = aa.keyti; } *paa.a = newb; } return (*paa).a; } /******************************************** * Produce array of N byte keys from aa. */ ArrayRet_t _aaKeys(AA aa, size_t keysize) { auto len = _aaLen(aa); if (!len) return null; auto res = (cast(byte*) gc_malloc(len * keysize, !(aa.a.keyti.flags() & 1) ? BlkAttr.NO_SCAN : 0))[0 .. len * keysize]; size_t resi = 0; foreach (e; aa.a.b) { while (e) { memcpy(&res[resi * keysize], cast(byte*)(e + 1), keysize); resi++; e = e.next; } } assert(resi == len); Array a; a.length = len; a.ptr = res.ptr; return *cast(ArrayRet_t*)(&a); } unittest { int[string] aa; aa["hello"] = 3; assert(aa["hello"] == 3); aa["hello"]++; assert(aa["hello"] == 4); assert(aa.length == 1); string[] keys = aa.keys; assert(keys.length == 1); assert(memcmp(keys[0].ptr, cast(char*)"hello", 5) == 0); int[] values = aa.values; assert(values.length == 1); assert(values[0] == 4); aa.rehash; assert(aa.length == 1); assert(aa["hello"] == 4); aa["foo"] = 1; aa["bar"] = 2; aa["batz"] = 3; assert(aa.keys.length == 4); assert(aa.values.length == 4); foreach(a; aa.keys) { assert(a.length != 0); assert(a.ptr != null); //printf("key: %.*s -> value: %d\n", a.length, a.ptr, aa[a]); } foreach(v; aa.values) { assert(v != 0); //printf("value: %d\n", v); } } /********************************************** * 'apply' for associative arrays - to support foreach */ // dg is D, but _aaApply() is C extern (D) alias int delegate(void *) dg_t; int _aaApply(AA aa, size_t keysize, dg_t dg) { if (!aa.a) { return 0; } immutable alignsize = aligntsize(keysize); //printf("_aaApply(aa = x%llx, keysize = %d, dg = x%llx)\n", aa.a, keysize, dg); foreach (e; aa.a.b) { while (e) { auto result = dg(cast(void *)(e + 1) + alignsize); if (result) return result; e = e.next; } } return 0; } // dg is D, but _aaApply2() is C extern (D) alias int delegate(void *, void *) dg2_t; int _aaApply2(AA aa, size_t keysize, dg2_t dg) { if (!aa.a) { return 0; } //printf("_aaApply(aa = x%llx, keysize = %d, dg = x%llx)\n", aa.a, keysize, dg); immutable alignsize = aligntsize(keysize); foreach (e; aa.a.b) { while (e) { auto result = dg(e + 1, cast(void *)(e + 1) + alignsize); if (result) return result; e = e.next; } } return 0; } /*********************************** * Construct an associative array of type ti from * length pairs of key/value pairs. */ extern (C) BB* _d_assocarrayliteralT(TypeInfo_AssociativeArray ti, size_t length, ...) { auto valuesize = ti.next.tsize(); // value size auto keyti = ti.key; auto keysize = keyti.tsize(); // key size BB* result; //printf("_d_assocarrayliteralT(keysize = %d, valuesize = %d, length = %d)\n", keysize, valuesize, length); //printf("tivalue = %.*s\n", ti.next.classinfo.name); if (length == 0 || valuesize == 0 || keysize == 0) { } else { va_list q; version (Win64) va_start(q, length); else version(X86_64) va_start(q, __va_argsave); else va_start(q, length); result = new BB(); result.keyti = keyti; size_t i; for (i = 0; i < prime_list.length - 1; i++) { if (length <= prime_list[i]) break; } auto len = prime_list[i]; result.b = newaaA(len); size_t keystacksize = (keysize + int.sizeof - 1) & ~(int.sizeof - 1); size_t valuestacksize = (valuesize + int.sizeof - 1) & ~(int.sizeof - 1); size_t keytsize = aligntsize(keysize); for (size_t j = 0; j < length; j++) { void* pkey = q; q += keystacksize; void* pvalue = q; q += valuestacksize; aaA* e; auto key_hash = keyti.getHash(pkey); //printf("hash = %d\n", key_hash); i = key_hash % len; auto pe = &result.b[i]; while (1) { e = *pe; if (!e) { // Not found, create new elem //printf("create new one\n"); e = cast(aaA *) cast(void*) new void[aaA.sizeof + keytsize + valuesize]; memcpy(e + 1, pkey, keysize); e.hash = key_hash; *pe = e; result.nodes++; break; } if (key_hash == e.hash) { auto c = keyti.compare(pkey, e + 1); if (c == 0) break; } pe = &e.next; } memcpy(cast(void *)(e + 1) + keytsize, pvalue, valuesize); } va_end(q); } return result; } extern (C) BB* _d_assocarrayliteralTX(TypeInfo_AssociativeArray ti, void[] keys, void[] values) { auto valuesize = ti.next.tsize(); // value size auto keyti = ti.key; auto keysize = keyti.tsize(); // key size auto length = keys.length; BB* result; //printf("_d_assocarrayliteralT(keysize = %d, valuesize = %d, length = %d)\n", keysize, valuesize, length); //printf("tivalue = %.*s\n", ti.next.classinfo.name); assert(length == values.length); if (length == 0 || valuesize == 0 || keysize == 0) { } else { result = new BB(); result.keyti = keyti; size_t i; for (i = 0; i < prime_list.length - 1; i++) { if (length <= prime_list[i]) break; } auto len = prime_list[i]; result.b = newaaA(len); size_t keytsize = aligntsize(keysize); for (size_t j = 0; j < length; j++) { auto pkey = keys.ptr + j * keysize; auto pvalue = values.ptr + j * valuesize; aaA* e; auto key_hash = keyti.getHash(pkey); //printf("hash = %d\n", key_hash); i = key_hash % len; auto pe = &result.b[i]; while (1) { e = *pe; if (!e) { // Not found, create new elem //printf("create new one\n"); e = cast(aaA *) cast(void*) new void[aaA.sizeof + keytsize + valuesize]; memcpy(e + 1, pkey, keysize); e.hash = key_hash; *pe = e; result.nodes++; break; } if (key_hash == e.hash) { auto c = keyti.compare(pkey, e + 1); if (c == 0) break; } pe = &e.next; } memcpy(cast(void *)(e + 1) + keytsize, pvalue, valuesize); } } return result; } static TypeInfo_AssociativeArray _aaUnwrapTypeInfo(const(TypeInfo) tiRaw) nothrow { const(TypeInfo)* p = &tiRaw; TypeInfo_AssociativeArray ti; while (true) { if ((ti = cast(TypeInfo_AssociativeArray)*p) !is null) break; if (auto tiConst = cast(TypeInfo_Const)*p) { // The member in object_.d and object.di differ. This is to ensure // the file can be compiled both independently in unittest and // collectively in generating the library. Fixing object.di // requires changes to std.format in Phobos, fixing object_.d // makes Phobos's unittest fail, so this hack is employed here to // avoid irrelevant changes. static if (is(typeof(&tiConst.base) == TypeInfo*)) p = &tiConst.base; else p = &tiConst.next; } else assert(0); // ??? } return ti; } /*********************************** * Compare AA contents for equality. * Returns: * 1 equal * 0 not equal */ int _aaEqual(TypeInfo tiRaw, AA e1, AA e2) { //printf("_aaEqual()\n"); //printf("keyti = %.*s\n", ti.key.classinfo.name); //printf("valueti = %.*s\n", ti.next.classinfo.name); if (e1.a is e2.a) return 1; size_t len = _aaLen(e1); if (len != _aaLen(e2)) return 0; // Check for Bug 5925. ti_raw could be a TypeInfo_Const, we need to unwrap // it until reaching a real TypeInfo_AssociativeArray. TypeInfo_AssociativeArray ti = _aaUnwrapTypeInfo(tiRaw); /* Algorithm: Visit each key/value pair in e1. If that key doesn't exist * in e2, or if the value in e1 doesn't match the one in e2, the arrays * are not equal, and exit early. * After all pairs are checked, the arrays must be equal. */ auto keyti = ti.key; auto valueti = ti.next; const keysize = aligntsize(keyti.tsize()); const len2 = e2.a.b.length; int _aaKeys_x(aaA* e) { do { auto pkey = cast(void*)(e + 1); auto pvalue = pkey + keysize; //printf("key = %d, value = %g\n", *cast(int*)pkey, *cast(double*)pvalue); // We have key/value for e1. See if they exist in e2 auto key_hash = keyti.getHash(pkey); //printf("hash = %d\n", key_hash); const i = key_hash % len2; auto f = e2.a.b[i]; while (1) { //printf("f is %p\n", f); if (f is null) return 0; // key not found, so AA's are not equal if (key_hash == f.hash) { //printf("hash equals\n"); auto c = keyti.compare(pkey, f + 1); if (c == 0) { // Found key in e2. Compare values //printf("key equals\n"); auto pvalue2 = cast(void *)(f + 1) + keysize; if (valueti.equals(pvalue, pvalue2)) { //printf("value equals\n"); break; } else return 0; // values don't match, so AA's are not equal } } f = f.next; } // Look at next entry in e1 e = e.next; } while (e !is null); return 1; // this subtree matches } foreach (e; e1.a.b) { if (e) { if (_aaKeys_x(e) == 0) return 0; } } return 1; // equal } /***************************************** * Computes a hash value for the entire AA * Returns: * Hash value */ extern (C) hash_t _aaGetHash(AA* aa, const(TypeInfo) tiRaw) nothrow { import rt.util.hash; if (!aa.a) return 0; hash_t h = 0; TypeInfo_AssociativeArray ti = _aaUnwrapTypeInfo(tiRaw); auto keyti = ti.key; auto valueti = ti.next; const keysize = aligntsize(keyti.tsize()); foreach (e; aa.a.b) { while (e) { auto pkey = cast(void*)(e + 1); auto pvalue = pkey + keysize; // Compute a hash for the key/value pair by hashing their // respective hash values. hash_t[2] hpair; hpair[0] = e.hash; hpair[1] = valueti.getHash(pvalue); // Combine the hash of the key/value pair with the running hash // value using an associative operator (+) so that the resulting // hash value is independent of the actual order the pairs are // stored in (important to ensure equality of hash value for two // AA's containing identical pairs but with different hashtable // sizes). h += hashOf(hpair.ptr, hpair.length * hash_t.sizeof); e = e.next; } } return h; } unittest { string[int] key1 = [1: "true", 2: "false"]; string[int] key2 = [1: "false", 2: "true"]; // AA lits create a larger hashtable int[string[int]] aa1 = [key1: 100, key2: 200]; // Ensure consistent hash values are computed for key1 assert((key1 in aa1) !is null); // Manually assigning to an empty AA creates a smaller hashtable int[string[int]] aa2; aa2[key1] = 100; aa2[key2] = 200; assert(aa1 == aa2); // Ensure binary-independence of equal hash keys string[int] key2a; key2a[1] = "false"; key2a[2] = "true"; assert(aa1[key2a] == 200); }
D
#!/sbin/runscript # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header$ CONFIG=/etc/sensors3.conf depend() { need localmount use logger lm_sensors } pidfile=/run/sensord.pid command=/usr/sbin/sensord command_args="--config-file ${CONFIG} ${SENSORD_OPTIONS} --pid-file ${pidfile}" start_pre() { if [ ! -f ${CONFIG} ]; then eerror "Configuration file ${CONFIG} not found" return 1 fi }
D
module UnrealScript.Engine.AnimNodeBlend; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.Engine.AnimNodeBlendBase; extern(C++) interface AnimNodeBlend : AnimNodeBlendBase { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.AnimNodeBlend")); } private static __gshared AnimNodeBlend mDefaultProperties; @property final static AnimNodeBlend DefaultProperties() { mixin(MGDPC("AnimNodeBlend", "AnimNodeBlend Engine.Default__AnimNodeBlend")); } static struct Functions { private static __gshared ScriptFunction mSetBlendTarget; public @property static final ScriptFunction SetBlendTarget() { mixin(MGF("mSetBlendTarget", "Function Engine.AnimNodeBlend.SetBlendTarget")); } } @property final { auto ref { float BlendTimeToGo() { mixin(MGPC("float", 252)); } float Child2WeightTarget() { mixin(MGPC("float", 248)); } float Child2Weight() { mixin(MGPC("float", 244)); } } bool bSkipBlendWhenNotRendered() { mixin(MGBPC(256, 0x1)); } bool bSkipBlendWhenNotRendered(bool val) { mixin(MSBPC(256, 0x1)); } } final void SetBlendTarget(float BlendTarget, float BlendTime) { ubyte params[8]; params[] = 0; *cast(float*)params.ptr = BlendTarget; *cast(float*)&params[4] = BlendTime; (cast(ScriptObject)this).ProcessEvent(Functions.SetBlendTarget, params.ptr, cast(void*)0); } }
D
module vcg_ast_arraylength; // REQUIRED_ARGS: -vcg-ast -o- // PERMUTE_ARGS: // POST_SCRIPT: compilable/extra-files/vcg-ast-arraylength-postscript.sh void main() { int[] arr = [1, 2, 3]; // may use runtime call arr.length = 100; // should convert to arr = arr[0 .. 0]; arr.length = 0; // https://issues.dlang.org/show_bug.cgi?id=21678 int[] f; int[] a; a.length = f.length = 0; const x = 0; a.length = f.length = x; static assert(is(typeof(a.length = 0) == size_t)); static assert(is(typeof(a.length = f.length = 0) == size_t)); }
D
// This file is part of Visual D // // Visual D integrates the D programming language into Visual Studio // Copyright (c) 2017 by Rainer Schuetze, All Rights Reserved // // 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 visuald.taskprovider; import visuald.logutil; import visuald.comutil; import visuald.hierutil; import visuald.dpackage; import sdk.vsi.vsshell; import sdk.vsi.vsshell80; import sdk.win32.winerror; import std.string; import std.conv; import std.utf; import std.ascii; import std.uni; class TaskProvider : DisposingComObject, IVsTaskProvider, IVsTaskListEvents { VSTASKPRIORITY[string] mTokens; CommentTaskItem[] mTasks; this() { RefreshTokens(); } override void Dispose() { } override HRESULT QueryInterface(in IID* riid, void** pvObject) { if(queryInterface!(IVsTaskProvider) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsTaskListEvents) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } override HRESULT EnumTaskItems(/+[out]+/ IVsEnumTaskItems *ppEnum) { mixin(LogCallMix); *ppEnum = newCom!TaskItemsEnum(mTasks); addref(*ppEnum); return S_OK; } override HRESULT get_ImageList(/+[out,retval]+/ HANDLE *phImageList) { mixin(LogCallMix); *phImageList = null; return E_NOTIMPL; } override HRESULT get_SubcategoryList(in ULONG cbstr, BSTR *rgbstr, ULONG *pcActual) { mixin(LogCallMix); return E_NOTIMPL; } override HRESULT get_ReRegistrationKey (BSTR *pbstrKey) { mixin(LogCallMix); return E_NOTIMPL; } override HRESULT OnTaskListFinalRelease(IVsTaskList pTaskList) { mixin(LogCallMix); return E_NOTIMPL; } // IVsTaskListEvents override HRESULT OnCommentTaskInfoChanged() { RefreshTokens(); return S_OK; } VSTASKPRIORITY getPriority(string txt) { size_t pos; while(pos < txt.length) { auto nextpos = pos; dchar ch = decode(txt, nextpos); if (!std.uni.isAlpha(ch) && !std.ascii.isDigit(ch) && ch != '_' && ch != '@') break; pos = nextpos; } string tok = txt[0..pos]; if (auto pprio = tok in mTokens) return *pprio; return TP_NORMAL; } void updateTaskItems(string filename, string tasks) { size_t pos = 0; string[] tsks = splitLines(tasks); bool modified = false; foreach(t; tsks) { auto idx = indexOf(t, ':'); if(idx > 0) { string[] num = split(t[0..idx], ","); if(num.length == 2) { try { int line = parse!int(num[0]); int col = parse!int(num[1]); string txt = t[idx+1 .. $]; VSTASKPRIORITY prio = getPriority(txt); while (pos < mTasks.length && mTasks[pos].mFile != filename) pos++; if (pos == mTasks.length) { mTasks ~= newCom!CommentTaskItem(txt, prio, filename, line, col); modified = true; } else if (mTasks[pos].mLine != line || mTasks[pos].mColumn != col || mTasks[pos].mText != txt || mTasks[pos].mPriority != prio) { mTasks[pos].mLine = line; mTasks[pos].mColumn = col; mTasks[pos].mText = txt; mTasks[pos].mPriority = prio; modified = true; } pos++; } catch(ConvException) { } } } } while (pos < mTasks.length && mTasks[pos].mFile != filename) pos++; if (pos < mTasks.length) { for (size_t q = pos; q < mTasks.length; q++) if (mTasks[q].mFile != filename) mTasks[pos++] = mTasks[q]; mTasks.length = pos; modified = true; } if (modified) Package.RefreshTaskList(); } // Retrieves token settings as defined by user in Tools -> Options -> Environment -> Task List. void RefreshTokens() { auto taskInfo = queryService!(IVsTaskList, IVsCommentTaskInfo); if (taskInfo is null) return; scope(exit) release(taskInfo); IVsEnumCommentTaskTokens enumTokens; if (FAILED(taskInfo.get_EnumTokens(&enumTokens))) return; scope(exit) release(enumTokens); VSTASKPRIORITY[string] tokens; IVsCommentTaskToken token; uint fetched; // DevDiv bug 1135485: EnumCommentTaskTokens.Next returns E_FAIL instead of S_FALSE while(enumTokens.Next(1, &token, &fetched) == S_OK && fetched > 0) { scope(exit) release(token); BSTR text; VSTASKPRIORITY priority; if(token.get_Text(&text) == S_OK) { string txt = detachBSTR(text); if (token.get_Priority(&priority) == S_OK) { tokens[txt] = priority; } } } if (mTokens != tokens) { mTokens = tokens; auto langsvc = Package.GetLanguageService(); langsvc.vdServerClient.ConfigureCommentTasks(tokens.keys()); } } } class CommentTaskItem : DComObject, IVsTaskItem, IVsErrorItem { string mFile; int mLine, mColumn; string mText; VSTASKPRIORITY mPriority; bool mChecked; this(string txt, VSTASKPRIORITY prio, string file, int line, int col) { mText = txt; mPriority = prio; mFile = file; mLine = line; mColumn = col; } override HRESULT QueryInterface(in IID* riid, void** pvObject) { if(queryInterface!(IVsTaskItem) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsErrorItem) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } override HRESULT get_Priority(VSTASKPRIORITY *ptpPriority) { *ptpPriority = mPriority; return S_OK; } override HRESULT put_Priority(in VSTASKPRIORITY tpPriority) { mPriority = tpPriority; return S_OK; } override HRESULT get_Category(/+[out, retval]+/ VSTASKCATEGORY *pCat) { *pCat = CAT_COMMENTS; return S_OK; } override HRESULT get_SubcategoryIndex(/+[out, retval]+/int *pIndex) { *pIndex = 0; return E_NOTIMPL; } override HRESULT get_ImageListIndex(/+[out,retval]+/ int *pIndex) { *pIndex = BMP_COMMENT; return S_OK; } override HRESULT get_Checked(/+[out,retval]+/BOOL *pfChecked) { *pfChecked = mChecked; return S_OK; } override HRESULT put_Checked(in BOOL fChecked) { mChecked = fChecked != 0; return S_OK; } override HRESULT get_Text(/+[out,retval]+/ BSTR *pbstrName) { *pbstrName = allocBSTR(mText); return S_OK; } override HRESULT put_Text (in BSTR bstrName) { return E_NOTIMPL; } override HRESULT get_Document(/+[out,retval]+/ BSTR *pbstrMkDocument) { *pbstrMkDocument = allocBSTR(mFile); return S_OK; } override HRESULT get_Line(/+[out,retval]+/ int *piLine) { *piLine = mLine - 1; // 0 based return S_OK; } override HRESULT get_Column(/+[out, retval]+/ int *piCol) { *piCol = mColumn - 1; return S_OK; } override HRESULT get_CanDelete(/+[out, retval]+/BOOL *pfCanDelete) { *pfCanDelete = FALSE; return S_OK; } override HRESULT get_IsReadOnly(in VSTASKFIELD field, BOOL *pfReadOnly) { switch(field) { case FLD_PRIORITY: case FLD_CHECKED: *pfReadOnly = false; break; default: *pfReadOnly = true; break; } return S_OK; } override HRESULT get_HasHelp(BOOL *pfHasHelp) { *pfHasHelp = FALSE; return S_OK; } // Actions override HRESULT NavigateTo() { return OpenFileInSolution(mFile, mLine - 1, mColumn - 1); } override HRESULT NavigateToHelp() { return E_NOTIMPL; } // Notifications override HRESULT OnFilterTask(in BOOL fVisible) { return E_NOTIMPL; } override HRESULT OnDeleteTask() { return E_NOTIMPL; } // IVsErrorItem HRESULT GetHierarchy(/+[out]+/ IVsHierarchy * ppProject) { *ppProject = getProjectForSourceFile(mFile); return S_OK; } // Returns the category of this item: error, warning, or informational message. HRESULT GetCategory(/+[out]+/ VSERRORCATEGORY* pCategory) { *pCategory = EC_MESSAGE; return S_OK; } } class TaskItemsEnum : DComObject, IVsEnumTaskItems { CommentTaskItem[] mItems; int mPos; this(CommentTaskItem[] items) { mItems = items; mPos = 0; } override HRESULT QueryInterface(in IID* riid, void** pvObject) { if(queryInterface!(IVsEnumTaskItems) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } override int Next(in ULONG celt, IVsTaskItem *rgelt, ULONG *pceltFetched) { if(mPos + celt > mItems.length) return E_FAIL; for(int i = 0; i < celt; i++) rgelt[i] = addref(mItems[mPos + i]); mPos += celt; if(pceltFetched) *pceltFetched = celt; return S_OK; } override int Skip(in ULONG celt) { mPos += celt; return S_OK; } override int Reset() { mPos = 0; return S_OK; } override int Clone(IVsEnumTaskItems *ppenum) { auto clone = newCom!TaskItemsEnum(mItems); mPos = clone.mPos; *ppenum = addref(clone); return S_OK; } }
D
/++ Base module for working with colors and in-memory image pixmaps. Also has various basic data type definitions that are generally useful with images like [Point], [Size], and [Rectangle]. +/ module arsd.color; @safe: // importing phobos explodes the size of this code 10x, so not doing it. private { double toInternal(T)(scope const(char)[] s) { double accumulator = 0.0; size_t i = s.length; foreach(idx, c; s) { if(c >= '0' && c <= '9') { accumulator *= 10; accumulator += c - '0'; } else if(c == '.') { i = idx + 1; break; } else { string wtfIsWrongWithThisStupidLanguageWithItsBrokenSafeAttribute = "bad char to make double from "; wtfIsWrongWithThisStupidLanguageWithItsBrokenSafeAttribute ~= s; throw new Exception(wtfIsWrongWithThisStupidLanguageWithItsBrokenSafeAttribute); } } double accumulator2 = 0.0; double count = 1; foreach(c; s[i .. $]) { if(c >= '0' && c <= '9') { accumulator2 *= 10; accumulator2 += c - '0'; count *= 10; } else { string wtfIsWrongWithThisStupidLanguageWithItsBrokenSafeAttribute = "bad char to make double from "; wtfIsWrongWithThisStupidLanguageWithItsBrokenSafeAttribute ~= s; throw new Exception(wtfIsWrongWithThisStupidLanguageWithItsBrokenSafeAttribute); } } return accumulator + accumulator2 / count; } package(arsd) @trusted string toInternal(T)(int a) { if(a == 0) return "0"; char[] ret; bool neg; if(a < 0) { neg = true; a = -a; } while(a) { ret ~= (a % 10) + '0'; a /= 10; } for(int i = 0; i < ret.length / 2; i++) { char c = ret[i]; ret[i] = ret[$ - i - 1]; ret[$ - i - 1] = c; } if(neg) ret = "-" ~ ret; return cast(string) ret; } string toInternal(T)(double a) { // a simplifying assumption here is the fact that we only use this in one place: toInternal!string(cast(double) a / 255) // thus we know this will always be between 0.0 and 1.0, inclusive. if(a <= 0.0) return "0.0"; if(a >= 1.0) return "1.0"; string ret = "0."; // I wonder if I can handle round off error any better. Phobos does, but that isn't worth 100 KB of code. int amt = cast(int)(a * 1000); return ret ~ toInternal!string(amt); } nothrow @safe @nogc pure double absInternal(double a) { return a < 0 ? -a : a; } nothrow @safe @nogc pure double minInternal(double a, double b, double c) { auto m = a; if(b < m) m = b; if(c < m) m = c; return m; } nothrow @safe @nogc pure double maxInternal(double a, double b, double c) { auto m = a; if(b > m) m = b; if(c > m) m = c; return m; } nothrow @safe @nogc pure bool startsWithInternal(in char[] a, in char[] b) { return (a.length >= b.length && a[0 .. b.length] == b); } inout(char)[][] splitInternal(inout(char)[] a, char c) { inout(char)[][] ret; size_t previous = 0; foreach(i, char ch; a) { if(ch == c) { ret ~= a[previous .. i]; previous = i + 1; } } if(previous != a.length) ret ~= a[previous .. $]; return ret; } nothrow @safe @nogc pure inout(char)[] stripInternal(inout(char)[] s) { foreach(i, char c; s) if(c != ' ' && c != '\t' && c != '\n') { s = s[i .. $]; break; } for(int a = cast(int)(s.length - 1); a > 0; a--) { char c = s[a]; if(c != ' ' && c != '\t' && c != '\n') { s = s[0 .. a + 1]; break; } } return s; } } // done with mini-phobos /// Represents an RGBA color struct Color { @system static Color fromJsVar(T)(T v) { // it is a template so i don't have to actually import arsd.jsvar... return Color.fromString(v.get!string); } @safe: /++ The color components are available as a static array, individual bytes, and a uint inside this union. Since it is anonymous, you can use the inner members' names directly. +/ union { ubyte[4] components; /// [r, g, b, a] /// Holder for rgba individual components. struct { ubyte r; /// red ubyte g; /// green ubyte b; /// blue ubyte a; /// alpha. 255 == opaque } uint asUint; /// The components as a single 32 bit value (beware of endian issues!) } /++ Like the constructor, but this makes sure they are in range before casting. If they are out of range, it saturates: anything less than zero becomes zero and anything greater than 255 becomes 255. +/ nothrow pure @nogc static Color fromIntegers(int red, int green, int blue, int alpha = 255) { return Color(clampToByte(red), clampToByte(green), clampToByte(blue), clampToByte(alpha)); } /// Construct a color with the given values. They should be in range 0 <= x <= 255, where 255 is maximum intensity and 0 is minimum intensity. nothrow pure @nogc this(int red, int green, int blue, int alpha = 255) { this.r = cast(ubyte) red; this.g = cast(ubyte) green; this.b = cast(ubyte) blue; this.a = cast(ubyte) alpha; } /// Static convenience functions for common color names nothrow pure @nogc static Color transparent() { return Color(0, 0, 0, 0); } /// Ditto nothrow pure @nogc static Color white() { return Color(255, 255, 255); } /// Ditto nothrow pure @nogc static Color gray() { return Color(128, 128, 128); } /// Ditto nothrow pure @nogc static Color black() { return Color(0, 0, 0); } /// Ditto nothrow pure @nogc static Color red() { return Color(255, 0, 0); } /// Ditto nothrow pure @nogc static Color green() { return Color(0, 255, 0); } /// Ditto nothrow pure @nogc static Color blue() { return Color(0, 0, 255); } /// Ditto nothrow pure @nogc static Color yellow() { return Color(255, 255, 0); } /// Ditto nothrow pure @nogc static Color teal() { return Color(0, 255, 255); } /// Ditto nothrow pure @nogc static Color purple() { return Color(255, 0, 255); } /// Ditto nothrow pure @nogc static Color brown() { return Color(128, 64, 0); } /* ubyte[4] toRgbaArray() { return [r,g,b,a]; } */ /// Return black-and-white color Color toBW() () nothrow pure @safe @nogc { // FIXME: gamma? int intens = clampToByte(cast(int)(0.2126*r+0.7152*g+0.0722*b)); return Color(intens, intens, intens, a); } /// Makes a string that matches CSS syntax for websites string toCssString() const { if(a == 255) return "#" ~ toHexInternal(r) ~ toHexInternal(g) ~ toHexInternal(b); else { return "rgba("~toInternal!string(r)~", "~toInternal!string(g)~", "~toInternal!string(b)~", "~toInternal!string(cast(double)a / 255.0)~")"; } } /// Makes a hex string RRGGBBAA (aa only present if it is not 255) string toString() const { if(a == 255) return toCssString()[1 .. $]; else return toRgbaHexString(); } /// returns RRGGBBAA, even if a== 255 string toRgbaHexString() const { return toHexInternal(r) ~ toHexInternal(g) ~ toHexInternal(b) ~ toHexInternal(a); } /// Gets a color by name, iff the name is one of the static members listed above static Color fromNameString(string s) { Color c; foreach(member; __traits(allMembers, Color)) { static if(__traits(compiles, c = __traits(getMember, Color, member))) { if(s == member) return __traits(getMember, Color, member); } } throw new Exception("Unknown color " ~ s); } /++ Reads a CSS style string to get the color. Understands #rrggbb, rgba(), hsl(), and rrggbbaa History: The short-form hex string parsing (`#fff`) was added on April 10, 2020. (v7.2.0) +/ static Color fromString(scope const(char)[] s) { s = s.stripInternal(); Color c; c.a = 255; // trying named colors via the static no-arg methods here foreach(member; __traits(allMembers, Color)) { static if(__traits(compiles, c = __traits(getMember, Color, member))) { if(s == member) return __traits(getMember, Color, member); } } // try various notations borrowed from CSS (though a little extended) // hsl(h,s,l,a) where h is degrees and s,l,a are 0 >= x <= 1.0 if(s.startsWithInternal("hsl(") || s.startsWithInternal("hsla(")) { assert(s[$-1] == ')'); s = s[s.startsWithInternal("hsl(") ? 4 : 5 .. $ - 1]; // the closing paren double[3] hsl; ubyte a = 255; auto parts = s.splitInternal(','); foreach(i, part; parts) { if(i < 3) hsl[i] = toInternal!double(part.stripInternal); else a = clampToByte(cast(int) (toInternal!double(part.stripInternal) * 255)); } c = .fromHsl(hsl); c.a = a; return c; } // rgb(r,g,b,a) where r,g,b are 0-255 and a is 0-1.0 if(s.startsWithInternal("rgb(") || s.startsWithInternal("rgba(")) { assert(s[$-1] == ')'); s = s[s.startsWithInternal("rgb(") ? 4 : 5 .. $ - 1]; // the closing paren auto parts = s.splitInternal(','); foreach(i, part; parts) { // lol the loop-switch pattern auto v = toInternal!double(part.stripInternal); switch(i) { case 0: // red c.r = clampToByte(cast(int) v); break; case 1: c.g = clampToByte(cast(int) v); break; case 2: c.b = clampToByte(cast(int) v); break; case 3: c.a = clampToByte(cast(int) (v * 255)); break; default: // ignore } } return c; } // otherwise let's try it as a hex string, really loosely if(s.length && s[0] == '#') s = s[1 .. $]; // support short form #fff for example if(s.length == 3 || s.length == 4) { string n; n.reserve(8); foreach(ch; s) { n ~= ch; n ~= ch; } s = n; } // not a built in... do it as a hex string if(s.length >= 2) { c.r = fromHexInternal(s[0 .. 2]); s = s[2 .. $]; } if(s.length >= 2) { c.g = fromHexInternal(s[0 .. 2]); s = s[2 .. $]; } if(s.length >= 2) { c.b = fromHexInternal(s[0 .. 2]); s = s[2 .. $]; } if(s.length >= 2) { c.a = fromHexInternal(s[0 .. 2]); s = s[2 .. $]; } return c; } /// from hsl static Color fromHsl(double h, double s, double l) { return .fromHsl(h, s, l); } // this is actually branch-less for ints on x86, and even for longs on x86_64 static ubyte clampToByte(T) (T n) pure nothrow @safe @nogc if (__traits(isIntegral, T)) { static if (__VERSION__ > 2067) pragma(inline, true); static if (T.sizeof == 2 || T.sizeof == 4) { static if (__traits(isUnsigned, T)) { return cast(ubyte)(n&0xff|(255-((-cast(int)(n < 256))>>24))); } else { n &= -cast(int)(n >= 0); return cast(ubyte)(n|((255-cast(int)n)>>31)); } } else static if (T.sizeof == 1) { static assert(__traits(isUnsigned, T), "clampToByte: signed byte? no, really?"); return cast(ubyte)n; } else static if (T.sizeof == 8) { static if (__traits(isUnsigned, T)) { return cast(ubyte)(n&0xff|(255-((-cast(long)(n < 256))>>56))); } else { n &= -cast(long)(n >= 0); return cast(ubyte)(n|((255-cast(long)n)>>63)); } } else { static assert(false, "clampToByte: integer too big"); } } /** this mixin can be used to alphablend two `uint` colors; * `colu32name` is variable that holds color to blend, * `destu32name` is variable that holds "current" color (from surface, for example). * alpha value of `destu32name` doesn't matter. * alpha value of `colu32name` means: 255 for replace color, 0 for keep `destu32name`. * * WARNING! This function does blending in RGB space, and RGB space is not linear! */ public enum ColorBlendMixinStr(string colu32name, string destu32name) = "{ immutable uint a_tmp_ = (256-(255-(("~colu32name~")>>24)))&(-(1-(((255-(("~colu32name~")>>24))+1)>>8))); // to not loose bits, but 255 should become 0 immutable uint dc_tmp_ = ("~destu32name~")&0xffffff; immutable uint srb_tmp_ = (("~colu32name~")&0xff00ff); immutable uint sg_tmp_ = (("~colu32name~")&0x00ff00); immutable uint drb_tmp_ = (dc_tmp_&0xff00ff); immutable uint dg_tmp_ = (dc_tmp_&0x00ff00); immutable uint orb_tmp_ = (drb_tmp_+(((srb_tmp_-drb_tmp_)*a_tmp_+0x800080)>>8))&0xff00ff; immutable uint og_tmp_ = (dg_tmp_+(((sg_tmp_-dg_tmp_)*a_tmp_+0x008000)>>8))&0x00ff00; ("~destu32name~") = (orb_tmp_|og_tmp_)|0xff000000; /*&0xffffff;*/ }"; /// Perform alpha-blending of `fore` to this color, return new color. /// WARNING! This function does blending in RGB space, and RGB space is not linear! Color alphaBlend (Color fore) const pure nothrow @trusted @nogc { static if (__VERSION__ > 2067) pragma(inline, true); Color res; res.asUint = asUint; mixin(ColorBlendMixinStr!("fore.asUint", "res.asUint")); return res; } } unittest { Color c = Color.fromString("#fff"); assert(c == Color.white); assert(c == Color.fromString("#ffffff")); c = Color.fromString("#f0f"); assert(c == Color.fromString("rgb(255, 0, 255)")); } nothrow @safe private string toHexInternal(ubyte b) { string s; if(b < 16) s ~= '0'; else { ubyte t = (b & 0xf0) >> 4; if(t >= 10) s ~= 'A' + t - 10; else s ~= '0' + t; b &= 0x0f; } if(b >= 10) s ~= 'A' + b - 10; else s ~= '0' + b; return s; } nothrow @safe @nogc pure private ubyte fromHexInternal(in char[] s) { int result = 0; int exp = 1; //foreach(c; retro(s)) { // FIXME: retro doesn't work right in dtojs foreach_reverse(c; s) { if(c >= 'A' && c <= 'F') result += exp * (c - 'A' + 10); else if(c >= 'a' && c <= 'f') result += exp * (c - 'a' + 10); else if(c >= '0' && c <= '9') result += exp * (c - '0'); else // throw new Exception("invalid hex character: " ~ cast(char) c); return 0; exp *= 16; } return cast(ubyte) result; } /// Converts hsl to rgb Color fromHsl(real[3] hsl) nothrow pure @safe @nogc { return fromHsl(cast(double) hsl[0], cast(double) hsl[1], cast(double) hsl[2]); } Color fromHsl(double[3] hsl) nothrow pure @safe @nogc { return fromHsl(hsl[0], hsl[1], hsl[2]); } /// Converts hsl to rgb Color fromHsl(double h, double s, double l, double a = 255) nothrow pure @safe @nogc { h = h % 360; double C = (1 - absInternal(2 * l - 1)) * s; double hPrime = h / 60; double X = C * (1 - absInternal(hPrime % 2 - 1)); double r, g, b; if(h is double.nan) r = g = b = 0; else if (hPrime >= 0 && hPrime < 1) { r = C; g = X; b = 0; } else if (hPrime >= 1 && hPrime < 2) { r = X; g = C; b = 0; } else if (hPrime >= 2 && hPrime < 3) { r = 0; g = C; b = X; } else if (hPrime >= 3 && hPrime < 4) { r = 0; g = X; b = C; } else if (hPrime >= 4 && hPrime < 5) { r = X; g = 0; b = C; } else if (hPrime >= 5 && hPrime < 6) { r = C; g = 0; b = X; } double m = l - C / 2; r += m; g += m; b += m; return Color( cast(int)(r * 255), cast(int)(g * 255), cast(int)(b * 255), cast(int)(a)); } /// Assumes the input `u` is already between 0 and 1 fyi. nothrow pure @safe @nogc double srgbToLinearRgb(double u) { if(u < 0.4045) return u / 12.92; else return ((u + 0.055) / 1.055) ^^ 2.4; } /// Converts an RGB color into an HSL triplet. useWeightedLightness will try to get a better value for luminosity for the human eye, which is more sensitive to green than red and more to red than blue. If it is false, it just does average of the rgb. double[3] toHsl(Color c, bool useWeightedLightness = false) nothrow pure @trusted @nogc { double r1 = cast(double) c.r / 255; double g1 = cast(double) c.g / 255; double b1 = cast(double) c.b / 255; double maxColor = maxInternal(r1, g1, b1); double minColor = minInternal(r1, g1, b1); double L = (maxColor + minColor) / 2 ; if(useWeightedLightness) { // the colors don't affect the eye equally // this is a little more accurate than plain HSL numbers L = 0.2126*srgbToLinearRgb(r1) + 0.7152*srgbToLinearRgb(g1) + 0.0722*srgbToLinearRgb(b1); // maybe a better number is 299, 587, 114 } double S = 0; double H = 0; if(maxColor != minColor) { if(L < 0.5) { S = (maxColor - minColor) / (maxColor + minColor); } else { S = (maxColor - minColor) / (2.0 - maxColor - minColor); } if(r1 == maxColor) { H = (g1-b1) / (maxColor - minColor); } else if(g1 == maxColor) { H = 2.0 + (b1 - r1) / (maxColor - minColor); } else { H = 4.0 + (r1 - g1) / (maxColor - minColor); } } H = H * 60; if(H < 0){ H += 360; } return [H, S, L]; } /// . Color lighten(Color c, double percentage) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[2] *= (1 + percentage); if(hsl[2] > 1) hsl[2] = 1; return fromHsl(hsl); } /// . Color darken(Color c, double percentage) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[2] *= (1 - percentage); return fromHsl(hsl); } /// for light colors, call darken. for dark colors, call lighten. /// The goal: get toward center grey. Color moderate(Color c, double percentage) nothrow pure @safe @nogc { auto hsl = toHsl(c); if(hsl[2] > 0.5) hsl[2] *= (1 - percentage); else { if(hsl[2] <= 0.01) // if we are given black, moderating it means getting *something* out hsl[2] = percentage; else hsl[2] *= (1 + percentage); } if(hsl[2] > 1) hsl[2] = 1; return fromHsl(hsl); } /// the opposite of moderate. Make darks darker and lights lighter Color extremify(Color c, double percentage) nothrow pure @safe @nogc { auto hsl = toHsl(c, true); if(hsl[2] < 0.5) hsl[2] *= (1 - percentage); else hsl[2] *= (1 + percentage); if(hsl[2] > 1) hsl[2] = 1; return fromHsl(hsl); } /// Move around the lightness wheel, trying not to break on moderate things Color oppositeLightness(Color c) nothrow pure @safe @nogc { auto hsl = toHsl(c); auto original = hsl[2]; if(original > 0.4 && original < 0.6) hsl[2] = 0.8 - original; // so it isn't quite the same else hsl[2] = 1 - original; return fromHsl(hsl); } /// Try to determine a text color - either white or black - based on the input Color makeTextColor(Color c) nothrow pure @safe @nogc { auto hsl = toHsl(c, true); // give green a bonus for contrast if(hsl[2] > 0.71) return Color(0, 0, 0); else return Color(255, 255, 255); } // These provide functional access to hsl manipulation; useful if you need a delegate Color setLightness(Color c, double lightness) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[2] = lightness; return fromHsl(hsl); } /// Color rotateHue(Color c, double degrees) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[0] += degrees; return fromHsl(hsl); } /// Color setHue(Color c, double hue) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[0] = hue; return fromHsl(hsl); } /// Color desaturate(Color c, double percentage) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[1] *= (1 - percentage); return fromHsl(hsl); } /// Color saturate(Color c, double percentage) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[1] *= (1 + percentage); if(hsl[1] > 1) hsl[1] = 1; return fromHsl(hsl); } /// Color setSaturation(Color c, double saturation) nothrow pure @safe @nogc { auto hsl = toHsl(c); hsl[1] = saturation; return fromHsl(hsl); } /* void main(string[] args) { auto color1 = toHsl(Color(255, 0, 0)); auto color = fromHsl(color1[0] + 60, color1[1], color1[2]); writefln("#%02x%02x%02x", color.r, color.g, color.b); } */ /* Color algebra functions */ /* Alpha putpixel looks like this: void putPixel(Image i, Color c) { Color b; b.r = i.data[(y * i.width + x) * bpp + 0]; b.g = i.data[(y * i.width + x) * bpp + 1]; b.b = i.data[(y * i.width + x) * bpp + 2]; b.a = i.data[(y * i.width + x) * bpp + 3]; float ca = cast(float) c.a / 255; i.data[(y * i.width + x) * bpp + 0] = alpha(c.r, ca, b.r); i.data[(y * i.width + x) * bpp + 1] = alpha(c.g, ca, b.g); i.data[(y * i.width + x) * bpp + 2] = alpha(c.b, ca, b.b); i.data[(y * i.width + x) * bpp + 3] = alpha(c.a, ca, b.a); } ubyte alpha(ubyte c1, float alpha, ubyte onto) { auto got = (1 - alpha) * onto + alpha * c1; if(got > 255) return 255; return cast(ubyte) got; } So, given the background color and the resultant color, what was composited on to it? */ /// ubyte unalpha(ubyte colorYouHave, float alpha, ubyte backgroundColor) nothrow pure @safe @nogc { // resultingColor = (1-alpha) * backgroundColor + alpha * answer auto resultingColorf = cast(float) colorYouHave; auto backgroundColorf = cast(float) backgroundColor; auto answer = (resultingColorf - backgroundColorf + alpha * backgroundColorf) / alpha; return Color.clampToByte(cast(int) answer); } /// ubyte makeAlpha(ubyte colorYouHave, ubyte backgroundColor/*, ubyte foreground = 0x00*/) nothrow pure @safe @nogc { //auto foregroundf = cast(float) foreground; auto foregroundf = 0.00f; auto colorYouHavef = cast(float) colorYouHave; auto backgroundColorf = cast(float) backgroundColor; // colorYouHave = backgroundColorf - alpha * backgroundColorf + alpha * foregroundf auto alphaf = 1 - colorYouHave / backgroundColorf; alphaf *= 255; return Color.clampToByte(cast(int) alphaf); } int fromHex(string s) { int result = 0; int exp = 1; // foreach(c; retro(s)) { foreach_reverse(c; s) { if(c >= 'A' && c <= 'F') result += exp * (c - 'A' + 10); else if(c >= 'a' && c <= 'f') result += exp * (c - 'a' + 10); else if(c >= '0' && c <= '9') result += exp * (c - '0'); else throw new Exception("invalid hex character: " ~ cast(char) c); exp *= 16; } return result; } /// Color colorFromString(string s) { if(s.length == 0) return Color(0,0,0,255); if(s[0] == '#') s = s[1..$]; assert(s.length == 6 || s.length == 8); Color c; c.r = cast(ubyte) fromHex(s[0..2]); c.g = cast(ubyte) fromHex(s[2..4]); c.b = cast(ubyte) fromHex(s[4..6]); if(s.length == 8) c.a = cast(ubyte) fromHex(s[6..8]); else c.a = 255; return c; } /* import browser.window; import std.conv; void main() { import browser.document; foreach(ele; document.querySelectorAll("input")) { ele.addEventListener("change", { auto h = toInternal!double(document.querySelector("input[name=h]").value); auto s = toInternal!double(document.querySelector("input[name=s]").value); auto l = toInternal!double(document.querySelector("input[name=l]").value); Color c = Color.fromHsl(h, s, l); auto e = document.getElementById("example"); e.style.backgroundColor = c.toCssString(); // JSElement __js_this; // __js_this.style.backgroundColor = c.toCssString(); }, false); } } */ /** This provides two image classes and a bunch of functions that work on them. Why are they separate classes? I think the operations on the two of them are necessarily different. There's a whole bunch of operations that only really work on truecolor (blurs, gradients), and a few that only work on indexed images (palette swaps). Even putpixel is pretty different. On indexed, it is a palette entry's index number. On truecolor, it is the actual color. A greyscale image is the weird thing in the middle. It is truecolor, but fits in the same size as indexed. Still, I'd say it is a specialization of truecolor. There is a subset that works on both */ /// An image in memory interface MemoryImage { //IndexedImage convertToIndexedImage() const; //TrueColorImage convertToTrueColor() const; /// gets it as a TrueColorImage. May return this or may do a conversion and return a new image TrueColorImage getAsTrueColorImage() pure nothrow @safe; /// Image width, in pixels int width() const pure nothrow @safe @nogc; /// Image height, in pixels int height() const pure nothrow @safe @nogc; /// Get image pixel. Slow, but returns valid RGBA color (completely transparent for off-image pixels). Color getPixel(int x, int y) const pure nothrow @safe @nogc; /// Set image pixel. void setPixel(int x, int y, in Color clr) nothrow @safe; /// Returns a copy of the image MemoryImage clone() const pure nothrow @safe; /// Load image from file. This will import arsd.image to do the actual work, and cost nothing if you don't use it. static MemoryImage fromImage(T : const(char)[]) (T filename) @trusted { static if (__traits(compiles, (){import arsd.image;})) { // yay, we have image loader here, try it! import arsd.image; return loadImageFromFile(filename); } else { static assert(0, "please provide 'arsd.image' to load images!"); } } // ***This method is deliberately not publicly documented.*** // What it does is unconditionally frees internal image storage, without any sanity checks. // If you will do this, make sure that you have no references to image data left (like // slices of [data] array, for example). Those references will become invalid, and WILL // lead to Undefined Behavior. // tl;dr: IF YOU HAVE *ANY* QUESTIONS REGARDING THIS COMMENT, DON'T USE THIS! // Note to implementors: it is safe to simply do nothing in this method. // Also, it should be safe to call this method twice or more. void clearInternal () nothrow @system;// @nogc; // nogc is commented right now just because GC.free is only @nogc in newest dmd and i want to stay compatible a few versions back too. it can be added later /// Convenient alias for `fromImage` alias fromImageFile = fromImage; } /// An image that consists of indexes into a color palette. Use [getAsTrueColorImage]() if you don't care about palettes class IndexedImage : MemoryImage { bool hasAlpha; /// . Color[] palette; /// the data as indexes into the palette. Stored left to right, top to bottom, no padding. ubyte[] data; override void clearInternal () nothrow @system {// @nogc { import core.memory : GC; // it is safe to call [GC.free] with `null` pointer. GC.free(palette.ptr); palette = null; GC.free(data.ptr); data = null; _width = _height = 0; } /// . override int width() const pure nothrow @safe @nogc { return _width; } /// . override int height() const pure nothrow @safe @nogc { return _height; } /// . override IndexedImage clone() const pure nothrow @trusted { auto n = new IndexedImage(width, height); n.data[] = this.data[]; // the data member is already there, so array copy n.palette = this.palette.dup; // and here we need to allocate too, so dup n.hasAlpha = this.hasAlpha; return n; } override Color getPixel(int x, int y) const pure nothrow @trusted @nogc { if (x >= 0 && y >= 0 && x < _width && y < _height) { size_t pos = cast(size_t)y*_width+x; if (pos >= data.length) return Color(0, 0, 0, 0); ubyte b = data.ptr[pos]; if (b >= palette.length) return Color(0, 0, 0, 0); return palette.ptr[b]; } else { return Color(0, 0, 0, 0); } } override void setPixel(int x, int y, in Color clr) nothrow @trusted { if (x >= 0 && y >= 0 && x < _width && y < _height) { size_t pos = cast(size_t)y*_width+x; if (pos >= data.length) return; ubyte pidx = findNearestColor(palette, clr); if (palette.length < 255 && (palette.ptr[pidx].r != clr.r || palette.ptr[pidx].g != clr.g || palette.ptr[pidx].b != clr.b || palette.ptr[pidx].a != clr.a)) { // add new color pidx = addColor(clr); } data.ptr[pos] = pidx; } } private int _width; private int _height; /// . this(int w, int h) pure nothrow @safe { _width = w; _height = h; // ensure that the computed size does not exceed basic address space limits assert(cast(ulong)w * h <= size_t.max); // upcast to avoid overflow for images larger than 536 Mpix data = new ubyte[cast(size_t)w*h]; } /* void resize(int w, int h, bool scale) { } */ /// returns a new image override TrueColorImage getAsTrueColorImage() pure nothrow @safe { return convertToTrueColor(); } /// Creates a new TrueColorImage based on this data TrueColorImage convertToTrueColor() const pure nothrow @trusted { auto tci = new TrueColorImage(width, height); foreach(i, b; data) { /* if(b >= palette.length) { string fuckyou; fuckyou ~= b + '0'; fuckyou ~= " "; fuckyou ~= palette.length + '0'; assert(0, fuckyou); } */ tci.imageData.colors[i] = palette[b]; } return tci; } /// Gets an exact match, if possible, adds if not. See also: the findNearestColor free function. ubyte getOrAddColor(Color c) nothrow @trusted { foreach(i, co; palette) { if(c == co) return cast(ubyte) i; } return addColor(c); } /// Number of colors currently in the palette (note: palette entries are not necessarily used in the image data) int numColors() const pure nothrow @trusted @nogc { return cast(int) palette.length; } /// Adds an entry to the palette, returning its index ubyte addColor(Color c) nothrow @trusted { assert(palette.length < 256); if(c.a != 255) hasAlpha = true; palette ~= c; return cast(ubyte) (palette.length - 1); } } /// An RGBA array of image data. Use the free function quantize() to convert to an IndexedImage class TrueColorImage : MemoryImage { // bool hasAlpha; // bool isGreyscale; //ubyte[] data; // stored as rgba quads, upper left to right to bottom /// . struct Data { ubyte[] bytes; /// the data as rgba bytes. Stored left to right, top to bottom, no padding. // the union is no good because the length of the struct is wrong! /// the same data as Color structs @trusted // the cast here is typically unsafe, but it is ok // here because I guarantee the layout, note the static assert below @property inout(Color)[] colors() inout pure nothrow @nogc { return cast(inout(Color)[]) bytes; } static assert(Color.sizeof == 4); } /// . Data imageData; alias imageData.bytes data; int _width; int _height; override void clearInternal () nothrow @system {// @nogc { import core.memory : GC; // it is safe to call [GC.free] with `null` pointer. GC.free(imageData.bytes.ptr); imageData.bytes = null; _width = _height = 0; } /// . override TrueColorImage clone() const pure nothrow @trusted { auto n = new TrueColorImage(width, height); n.imageData.bytes[] = this.imageData.bytes[]; // copy into existing array ctor allocated return n; } /// . override int width() const pure nothrow @trusted @nogc { return _width; } ///. override int height() const pure nothrow @trusted @nogc { return _height; } override Color getPixel(int x, int y) const pure nothrow @trusted @nogc { if (x >= 0 && y >= 0 && x < _width && y < _height) { size_t pos = cast(size_t)y*_width+x; return imageData.colors.ptr[pos]; } else { return Color(0, 0, 0, 0); } } override void setPixel(int x, int y, in Color clr) nothrow @trusted { if (x >= 0 && y >= 0 && x < _width && y < _height) { size_t pos = cast(size_t)y*_width+x; if (pos < imageData.bytes.length/4) imageData.colors.ptr[pos] = clr; } } /// . this(int w, int h) pure nothrow @safe { _width = w; _height = h; // ensure that the computed size does not exceed basic address space limits assert(cast(ulong)w * h * 4 <= size_t.max); // upcast to avoid overflow for images larger than 536 Mpix imageData.bytes = new ubyte[cast(size_t)w * h * 4]; } /// Creates with existing data. The data pointer is stored here. this(int w, int h, ubyte[] data) pure nothrow @safe { _width = w; _height = h; assert(cast(ulong)w * h * 4 <= size_t.max); assert(data.length == cast(size_t)w * h * 4); imageData.bytes = data; } /// Returns this override TrueColorImage getAsTrueColorImage() pure nothrow @safe { return this; } } /+ /// An RGB array of image data. class TrueColorImageWithoutAlpha : MemoryImage { struct Data { ubyte[] bytes; // the data as rgba bytes. Stored left to right, top to bottom, no padding. } /// . Data imageData; int _width; int _height; override void clearInternal () nothrow @system {// @nogc { import core.memory : GC; // it is safe to call [GC.free] with `null` pointer. GC.free(imageData.bytes.ptr); imageData.bytes = null; _width = _height = 0; } /// . override TrueColorImageWithoutAlpha clone() const pure nothrow @trusted { auto n = new TrueColorImageWithoutAlpha(width, height); n.imageData.bytes[] = this.imageData.bytes[]; // copy into existing array ctor allocated return n; } /// . override int width() const pure nothrow @trusted @nogc { return _width; } ///. override int height() const pure nothrow @trusted @nogc { return _height; } override Color getPixel(int x, int y) const pure nothrow @trusted @nogc { if (x >= 0 && y >= 0 && x < _width && y < _height) { uint pos = (y*_width+x) * 3; return Color(imageData.bytes[0], imageData.bytes[1], imageData.bytes[2], 255); } else { return Color(0, 0, 0, 0); } } override void setPixel(int x, int y, in Color clr) nothrow @trusted { if (x >= 0 && y >= 0 && x < _width && y < _height) { uint pos = y*_width+x; //if (pos < imageData.bytes.length/4) imageData.colors.ptr[pos] = clr; // FIXME } } /// . this(int w, int h) pure nothrow @safe { _width = w; _height = h; imageData.bytes = new ubyte[w*h*3]; } /// Creates with existing data. The data pointer is stored here. this(int w, int h, ubyte[] data) pure nothrow @safe { _width = w; _height = h; assert(data.length == w * h * 3); imageData.bytes = data; } /// override TrueColorImage getAsTrueColorImage() pure nothrow @safe { // FIXME //return this; } } +/ alias extern(C) int function(const void*, const void*) @system Comparator; @trusted void nonPhobosSort(T)(T[] obj, Comparator comparator) { import core.stdc.stdlib; qsort(obj.ptr, obj.length, typeof(obj[0]).sizeof, comparator); } /// Converts true color to an indexed image. It uses palette as the starting point, adding entries /// until maxColors as needed. If palette is null, it creates a whole new palette. /// /// After quantizing the image, it applies a dithering algorithm. /// /// This is not written for speed. IndexedImage quantize(in TrueColorImage img, Color[] palette = null, in int maxColors = 256) // this is just because IndexedImage assumes ubyte palette values in { assert(maxColors <= 256); } body { int[Color] uses; foreach(pixel; img.imageData.colors) { if(auto i = pixel in uses) { (*i)++; } else { uses[pixel] = 1; } } struct ColorUse { Color c; int uses; //string toString() { import std.conv; return c.toCssString() ~ " x " ~ to!string(uses); } int opCmp(ref const ColorUse co) const { return co.uses - uses; } extern(C) static int comparator(const void* lhs, const void* rhs) { return (cast(ColorUse*)rhs).uses - (cast(ColorUse*)lhs).uses; } } ColorUse[] sorted; foreach(color, count; uses) sorted ~= ColorUse(color, count); uses = null; nonPhobosSort(sorted, &ColorUse.comparator); // or, with phobos, but that adds 70ms to compile time //import std.algorithm.sorting : sort; //sort(sorted); ubyte[Color] paletteAssignments; foreach(idx, entry; palette) paletteAssignments[entry] = cast(ubyte) idx; // For the color assignments from the image, I do multiple passes, decreasing the acceptable // distance each time until we're full. // This is probably really slow.... but meh it gives pretty good results. auto ddiff = 32; outer: for(int d1 = 128; d1 >= 0; d1 -= ddiff) { auto minDist = d1*d1; if(d1 <= 64) ddiff = 16; if(d1 <= 32) ddiff = 8; foreach(possibility; sorted) { if(palette.length == maxColors) break; if(palette.length) { auto co = palette[findNearestColor(palette, possibility.c)]; auto pixel = possibility.c; auto dr = cast(int) co.r - pixel.r; auto dg = cast(int) co.g - pixel.g; auto db = cast(int) co.b - pixel.b; auto dist = dr*dr + dg*dg + db*db; // not good enough variety to justify an allocation yet if(dist < minDist) continue; } paletteAssignments[possibility.c] = cast(ubyte) palette.length; palette ~= possibility.c; } } // Final pass: just fill in any remaining space with the leftover common colors while(palette.length < maxColors && sorted.length) { if(sorted[0].c !in paletteAssignments) { paletteAssignments[sorted[0].c] = cast(ubyte) palette.length; palette ~= sorted[0].c; } sorted = sorted[1 .. $]; } bool wasPerfect = true; auto newImage = new IndexedImage(img.width, img.height); newImage.palette = palette; foreach(idx, pixel; img.imageData.colors) { if(auto p = pixel in paletteAssignments) newImage.data[idx] = *p; else { // gotta find the closest one... newImage.data[idx] = findNearestColor(palette, pixel); wasPerfect = false; } } if(!wasPerfect) floydSteinbergDither(newImage, img); return newImage; } /// Finds the best match for pixel in palette (currently by checking for minimum euclidean distance in rgb colorspace) ubyte findNearestColor(in Color[] palette, in Color pixel) nothrow pure @trusted @nogc { int best = 0; int bestDistance = int.max; foreach(pe, co; palette) { auto dr = cast(int) co.r - pixel.r; auto dg = cast(int) co.g - pixel.g; auto db = cast(int) co.b - pixel.b; int dist = dr*dr + dg*dg + db*db; if(dist < bestDistance) { best = cast(int) pe; bestDistance = dist; } } return cast(ubyte) best; } /+ // Quantizing and dithering test program void main( ){ /* auto img = new TrueColorImage(256, 32); foreach(y; 0 .. img.height) { foreach(x; 0 .. img.width) { img.imageData.colors[x + y * img.width] = Color(x, y * (255 / img.height), 0); } } */ TrueColorImage img; { import arsd.png; struct P { ubyte[] range; void put(ubyte[] a) { range ~= a; } } P range; import std.algorithm; import std.stdio; writePngLazy(range, pngFromBytes(File("/home/me/nyesha.png").byChunk(4096)).byRgbaScanline.map!((line) { foreach(ref pixel; line.pixels) { continue; auto sum = cast(int) pixel.r + pixel.g + pixel.b; ubyte a = cast(ubyte)(sum / 3); pixel.r = a; pixel.g = a; pixel.b = a; } return line; })); img = imageFromPng(readPng(range.range)).getAsTrueColorImage; } auto qimg = quantize(img, null, 2); import arsd.simpledisplay; auto win = new SimpleWindow(img.width, img.height * 3); auto painter = win.draw(); painter.drawImage(Point(0, 0), Image.fromMemoryImage(img)); painter.drawImage(Point(0, img.height), Image.fromMemoryImage(qimg)); floydSteinbergDither(qimg, img); painter.drawImage(Point(0, img.height * 2), Image.fromMemoryImage(qimg)); win.eventLoop(0); } +/ /+ /// If the background is transparent, it simply erases the alpha channel. void removeTransparency(IndexedImage img, Color background) +/ /// Perform alpha-blending of `fore` to this color, return new color. /// WARNING! This function does blending in RGB space, and RGB space is not linear! Color alphaBlend(Color foreground, Color background) pure nothrow @safe @nogc { static if (__VERSION__ > 2067) pragma(inline, true); return background.alphaBlend(foreground); } /* /// Reduces the number of colors in a palette. void reducePaletteSize(IndexedImage img, int maxColors = 16) { } */ // I think I did this wrong... but the results aren't too bad so the bug can't be awful. /// Dithers img in place to look more like original. void floydSteinbergDither(IndexedImage img, in TrueColorImage original) nothrow @trusted { assert(img.width == original.width); assert(img.height == original.height); auto buffer = new Color[](original.imageData.colors.length); int x, y; foreach(idx, c; original.imageData.colors) { auto n = img.palette[img.data[idx]]; int errorR = cast(int) c.r - n.r; int errorG = cast(int) c.g - n.g; int errorB = cast(int) c.b - n.b; void doit(int idxOffset, int multiplier) { // if(idx + idxOffset < buffer.length) buffer[idx + idxOffset] = Color.fromIntegers( c.r + multiplier * errorR / 16, c.g + multiplier * errorG / 16, c.b + multiplier * errorB / 16, c.a ); } if((x+1) != original.width) doit(1, 7); if((y+1) != original.height) { if(x != 0) doit(-1 + img.width, 3); doit(img.width, 5); if(x+1 != original.width) doit(1 + img.width, 1); } img.data[idx] = findNearestColor(img.palette, buffer[idx]); x++; if(x == original.width) { x = 0; y++; } } } // these are just really useful in a lot of places where the color/image functions are used, // so I want them available with Color /// struct Point { int x; /// int y; /// pure const nothrow @safe: Point opBinary(string op)(in Point rhs) @nogc { return Point(mixin("x" ~ op ~ "rhs.x"), mixin("y" ~ op ~ "rhs.y")); } Point opBinary(string op)(int rhs) @nogc { return Point(mixin("x" ~ op ~ "rhs"), mixin("y" ~ op ~ "rhs")); } } /// struct Size { int width; /// int height; /// int area() pure nothrow @safe const @nogc { return width * height; } } /// struct Rectangle { int left; /// int top; /// int right; /// int bottom; /// pure const nothrow @safe @nogc: /// this(int left, int top, int right, int bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } /// this(in Point upperLeft, in Point lowerRight) { this(upperLeft.x, upperLeft.y, lowerRight.x, lowerRight.y); } /// this(in Point upperLeft, in Size size) { this(upperLeft.x, upperLeft.y, upperLeft.x + size.width, upperLeft.y + size.height); } /// @property Point upperLeft() { return Point(left, top); } /// @property Point upperRight() { return Point(right, top); } /// @property Point lowerLeft() { return Point(left, bottom); } /// @property Point lowerRight() { return Point(right, bottom); } /// @property Point center() { return Point((right + left) / 2, (bottom + top) / 2); } /// @property Size size() { return Size(width, height); } /// @property int width() { return right - left; } /// @property int height() { return bottom - top; } /// Returns true if this rectangle entirely contains the other bool contains(in Rectangle r) { return contains(r.upperLeft) && contains(r.lowerRight); } /// ditto bool contains(in Point p) { return (p.x >= left && p.x < right && p.y >= top && p.y < bottom); } /// Returns true of the two rectangles at any point overlap bool overlaps(in Rectangle r) { // the -1 in here are because right and top are exclusive return !((right-1) < r.left || (r.right-1) < left || (bottom-1) < r.top || (r.bottom-1) < top); } } /++ Implements a flood fill algorithm, like the bucket tool in MS Paint. Note it assumes `what.length == width*height`. Params: what = the canvas to work with, arranged as top to bottom, left to right elements width = the width of the canvas height = the height of the canvas target = the type to replace. You may pass the existing value if you want to do what Paint does replacement = the replacement value x = the x-coordinate to start the fill (think of where the user clicked in Paint) y = the y-coordinate to start the fill additionalCheck = A custom additional check to perform on each square before continuing. Returning true means keep flooding, returning false means stop. If null, it is not used. +/ void floodFill(T)( T[] what, int width, int height, // the canvas to inspect T target, T replacement, // fill params int x, int y, bool delegate(int x, int y) @safe additionalCheck) // the node // in(what.length == width * height) // gdc doesn't support this syntax yet so not gonna use it until that comes out. { assert(what.length == width * height); // will use the contract above when gdc supports it T node = what[y * width + x]; if(target == replacement) return; if(node != target) return; if(additionalCheck is null) additionalCheck = (int, int) => true; if(!additionalCheck(x, y)) return; Point[] queue; queue ~= Point(x, y); while(queue.length) { auto n = queue[0]; queue = queue[1 .. $]; //queue.assumeSafeAppend(); // lol @safe breakage auto w = n; int offset = cast(int) (n.y * width + n.x); auto e = n; auto eoffset = offset; w.x--; offset--; while(w.x >= 0 && what[offset] == target && additionalCheck(w.x, w.y)) { w.x--; offset--; } while(e.x < width && what[eoffset] == target && additionalCheck(e.x, e.y)) { e.x++; eoffset++; } // to make it inclusive again w.x++; offset++; foreach(o ; offset .. eoffset) { what[o] = replacement; if(w.y && what[o - width] == target && additionalCheck(w.x, w.y)) queue ~= Point(w.x, w.y - 1); if(w.y + 1 < height && what[o + width] == target && additionalCheck(w.x, w.y)) queue ~= Point(w.x, w.y + 1); w.x++; } } /+ what[y * width + x] = replacement; if(x) floodFill(what, width, height, target, replacement, x - 1, y, additionalCheck); if(x != width - 1) floodFill(what, width, height, target, replacement, x + 1, y, additionalCheck); if(y) floodFill(what, width, height, target, replacement, x, y - 1, additionalCheck); if(y != height - 1) floodFill(what, width, height, target, replacement, x, y + 1, additionalCheck); +/ } // for scripting, so you can tag it without strictly needing to import arsd.jsvar enum arsd_jsvar_compatible = "arsd_jsvar_compatible";
D
/Users/benjaminrees/Desktop/Rust/Section 2/guessing_game/target/debug/deps/rand_chacha-0aa8b166e63413bd.rmeta: /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/lib.rs /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/chacha.rs /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/guts.rs /Users/benjaminrees/Desktop/Rust/Section 2/guessing_game/target/debug/deps/librand_chacha-0aa8b166e63413bd.rlib: /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/lib.rs /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/chacha.rs /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/guts.rs /Users/benjaminrees/Desktop/Rust/Section 2/guessing_game/target/debug/deps/rand_chacha-0aa8b166e63413bd.d: /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/lib.rs /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/chacha.rs /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/guts.rs /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/lib.rs: /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/chacha.rs: /Users/benjaminrees/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_chacha-0.3.1/src/guts.rs:
D
/** * Contains compiler-recognized user-defined attribute types. * * Copyright: Authors 2015-2018 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Authors: LDC team */ module ldc.attributes; import microd.types; /// Helper template private template AliasSeq(TList...) { alias AliasSeq = TList; } /** * Specifies that the function returns `null` or a pointer to at least a * certain number of allocated bytes. `sizeArgIdx` and `numArgIdx` specify * the 0-based index of the function arguments that should be used to calculate * the number of bytes returned: * * bytes = arg[sizeArgIdx] * (numArgIdx < 0) ? arg[numArgIdx] : 1 * * The optimizer may assume that an @allocSize function has no other side * effects and that it is valid to eliminate calls to the function if the * allocated memory is not used. The optimizer will eliminate all code from * `foo` in this example: * @allocSize(0) void* myAlloc(usize size); * void foo() { * auto p = myAlloc(100); * p[0] = 1; * } * * See LLVM LangRef for more details: * http://llvm.org/docs/LangRef.html#function-attributes * * This attribute has no effect for LLVM < 3.9. * * Example: * --- * import ldc.attributes; * * @allocSize(0) extern(C) void* malloc(usize size); * @allocSize(2,1) extern(C) void* reallocarray(void *ptr, usize nmemb, * usize size); * @allocSize(0,1) void* my_calloc(usize element_size, usize count, * bool irrelevant); * --- */ struct allocSize { i32 sizeArgIdx; /// If numArgIdx < 0, there is no argument specifying the element count i32 numArgIdx = i32.min; } /++ + When applied to a global symbol, the compiler, assembler, and linker are + required to treat the symbol as if there is a reference to the symbol that + it cannot see (which is why they have to be named). For example, it + prevents the deletion by the linker of an unreferenced symbol. + + This attribute corresponds to “attribute((used))” in GNU C. + + Examples: + --- + import ldc.attributes; + + @assumeUsed i32 dont_remove; + --- +/ immutable assumeUsed = _assumeUsed(); private struct _assumeUsed { } /++ + When applied to a function, marks this function for dynamic compilation. + Calls to the function will be to the dynamically compiled function, + instead of to the statically compiled function (the statically compiled + function is still emitted into the object file). + All functions marked with this attribute must be explicitly compiled in + runtime via ldc.dynamic_compile api before usage. + + This attribute has no effect if dynamic compilation wasn't enabled with + -enable-dynamic-compile + + Examples: + --- + import ldc.attributes; + + @dynamicCompile i32 foo() { return 42; } + --- +/ immutable dynamicCompile = _dynamicCompile(); private struct _dynamicCompile { } /++ + When applied to global variable, this variable will be treated as constant + by any dynamically compiled functions and is subject to optimizations. + All dynamically compiled functions must be recompiled after any update to + such variable. + + This attribute has no effect if dynamic compilation wasn't enabled with + -enable-dynamic-compile + + Examples: + --- + import ldc.attributes; + + @dynamicCompileConst __gshared i32 value = 1; + + @dynamicCompile i32 foo() { return value * 42; } + --- +/ immutable dynamicCompileConst = _dynamicCompileConst(); private struct _dynamicCompileConst { } /++ + When applied to a function, makes this function available for dynamic + compilation. + In contrast to `@dynamicCompile`, calls to the function will be to the + statically compiled function (like normal functions). The function body + is made available for dynamic compilation with the jit facilities (e.g. + jit bind). + If both @dynamicCompile and @dynamicCompileEmit attributes are + applied to function, @dynamicCompile will get precedence. + + This attribute has no effect if dynamic compilation wasn't enabled with + -enable-dynamic-compile + + Examples: + --- + import ldc.attributes; + + @dynamicCompileEmit i32 foo() { return 42; } + --- +/ immutable dynamicCompileEmit = _dynamicCompileEmit(); private struct _dynamicCompileEmit { } /** * Explicitly sets "fast math" for a function, enabling aggressive math * optimizations. These optimizations may dramatically change the outcome of * floating point calculations (e.g. because of reassociation). * * Example: * --- * import ldc.attributes; * * @fastmath * double dot(double[] a, double[] b) { * double s = 0; * foreach(usize i; 0..a.length) * { * // will result in vectorized fused-multiply-add instructions * s += a * b; * } * return s; * } * --- */ alias fastmath = AliasSeq!(llvmAttr("unsafe-fp-math", "true"), llvmFastMathFlag("fast")); /** * Adds an LLVM attribute to a function, without checking the validity or * applicability of the attribute. * The attribute is specified as key-value pair: * @llvmAttr("key", "value") * If the value string is empty, just the key is added as attribute. * * Example: * --- * import ldc.attributes; * * @llvmAttr("unsafe-fp-math", "true") * double dot(double[] a, double[] b) { * double s = 0; * foreach(usize i; 0..a.length) * { * import ldc.llvmasm: __ir; * s = __ir!(`%p = fmul fast double %0, %1 * %r = fadd fast double %p, %2 * ret double %r`, double)(a[i], b[i], s); * } * return s; * } * --- */ struct llvmAttr { string key; string value; } /** * Sets LLVM's fast-math flags for floating point operations in the function * this attribute is applied to. * See LLVM LangRef for possible values: * http://llvm.org/docs/LangRef.html#fast-math-flags * @llvmFastMathFlag("clear") clears all flags. */ struct llvmFastMathFlag { string flag; } /** * Adds LLVM's "naked" attribute to a function, disabling function prologue / * epilogue emission, incl. LDC's. * Intended to be used in combination with a function body defined via * ldc.llvmasm.__asm() and/or ldc.simd.inlineIR(). */ enum naked = llvmAttr("naked"); /** * Adds LLVM's "noalias" attribute to a function parameter, with semantics * very similar to C99 "restrict". * The parameter needs to boil down to a pointer, e.g., be a D pointer, class * reference or a `ref` parameter. */ enum restrict = llvmAttr("noalias"); /** * Sets the optimization strategy for a function. * Valid strategies are "none", "optsize", "minsize". The strategies are mutually exclusive. * * @optStrategy("none") in particular is useful to selectively debug functions when a * fully unoptimized program cannot be used (e.g. due to too low performance). * * Strategy "none": * Disables most optimizations for a function. * It implies `pragma(inline, false)`: the function is never inlined * in a calling function, and the attribute cannot be combined with * `pragma(inline, true)`. * Functions with `pragma(inline, true)` are still candidates for inlining into * the function. * * Strategy "optsize": * Tries to keep the code size of the function low and does optimizations to * reduce code size as long as they do not significantly impact runtime performance. * * Strategy "minsize": * Tries to keep the code size of the function low and does optimizations to * reduce code size that may reduce runtime performance. */ struct optStrategy { string strategy; } /++ + When applied to a function, specifies that the function should be optimzed by + Polly, LLVM's polyhedral optimizer. Useful for optimizing loops for data locatily, + vectorization and parallelism. + + Experimental! + + Only effective when LDC was built with Polly included. +/ immutable polly = _polly(); private struct _polly { } /** * When applied to a global variable or function, causes it to be emitted to a * non-standard object file/executable section. * * The target platform might impose certain restrictions on the format for * section names. * * Examples: * --- * import ldc.attributes; * * @section(".mySection") i32 myGlobal; * --- */ struct section { string name; } /** * When applied to a function, specifies that the function should be compiled * with different target options than on the command line. * * The passed string should be a comma-separated list of options. The options * are passed to LLVM by adding them to the "target-features" function * attribute, after minor processing: negative options (e.g. "no-sse") have the * "no" stripped (--> "-sse"), whereas positive options (e.g. sse") gain a * leading "+" (--> "+sse"). Negative options override positive options * regardless of their order. * The "arch=" option is a special case and is passed to LLVM via the * "target-cpu" function attribute. * * Examples: * --- * import ldc.attributes; * * @target("no-sse") * void foo_nosse(float *A, float* B, float K, u32 n) { * for (i32 i = 0; i < n; ++i) * A[i] *= B[i] + K; * } * @target("arch=haswell") * void foo_haswell(float *A, float* B, float K, u32 n) { * for (i32 i = 0; i < n; ++i) * A[i] *= B[i] + K; * } * --- */ struct target { string specifier; } /++ + When applied to a global symbol, specifies that the symbol should be emitted + with weak linkage. An example use case is a library function that should be + overridable by user code. + + Quote from the LLVM manual: "Note that weak linkage does not actually allow + the optimizer to inline the body of this function into callers because it + doesn’t know if this definition of the function is the definitive definition + within the program or whether it will be overridden by a stronger + definition." + + Examples: + --- + import ldc.attributes; + + @weak i32 user_hook() { return 1; } + --- +/ immutable weak = _weak(); private struct _weak { }
D
instance DIA_Garvell_EXIT(C_Info) { npc = VLK_441_Garvell; nr = 999; condition = DIA_Garvell_EXIT_Condition; information = DIA_Garvell_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_Garvell_EXIT_Condition() { return TRUE; }; func void DIA_Garvell_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_Garvell_PICKPOCKET(C_Info) { npc = VLK_441_Garvell; nr = 900; condition = DIA_Garvell_PICKPOCKET_Condition; information = DIA_Garvell_PICKPOCKET_Info; permanent = TRUE; description = "(Украсть его кошелек легче легкого)"; }; func int DIA_Garvell_PICKPOCKET_Condition() { if((Npc_GetTalentSkill(other,NPC_TALENT_PICKPOCKET) == 1) && (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE) && (Npc_HasItems(self,ItSe_GoldPocket25) >= 1) && (other.attribute[ATR_DEXTERITY] >= (10 - Theftdiff))) { return TRUE; }; }; func void DIA_Garvell_PICKPOCKET_Info() { Info_ClearChoices(DIA_Garvell_PICKPOCKET); Info_AddChoice(DIA_Garvell_PICKPOCKET,Dialog_Back,DIA_Garvell_PICKPOCKET_BACK); Info_AddChoice(DIA_Garvell_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Garvell_PICKPOCKET_DoIt); }; func void DIA_Garvell_PICKPOCKET_DoIt() { if(other.attribute[ATR_DEXTERITY] >= 10) { B_GiveInvItems(self,other,ItSe_GoldPocket25,1); self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE; B_GiveThiefXP(); Info_ClearChoices(DIA_Garvell_PICKPOCKET); } else { B_ResetThiefLevel(); AI_StopProcessInfos(self); B_Attack(self,other,AR_Theft,1); }; }; func void DIA_Garvell_PICKPOCKET_BACK() { Info_ClearChoices(DIA_Garvell_PICKPOCKET); }; instance DIA_Garvell_GREET(C_Info) { npc = VLK_441_Garvell; nr = 2; condition = DIA_Garvell_GREET_Condition; information = DIA_Garvell_GREET_Info; description = "Что ты делаешь здесь?"; }; func int DIA_Garvell_GREET_Condition() { if(Wld_IsTime(5,0,19,0)) { return TRUE; }; }; func void DIA_Garvell_GREET_Info() { AI_Output(other,self,"DIA_Garvell_GREET_15_00"); //Что ты делаешь здесь? AI_Output(self,other,"DIA_Garvell_GREET_04_01"); //Я строю корабль, потому что я хочу убраться отсюда - и чем быстрее, тем лучше. AI_Output(self,other,"DIA_Garvell_GREET_04_02"); //Но судя по тому, как идет работа, этот корабль никогда не будет закончен. }; instance DIA_Garvell_eilig(C_Info) { npc = VLK_441_Garvell; nr = 2; condition = DIA_Garvell_eilig_Condition; information = DIA_Garvell_eilig_Info; description = "Почему ты так торопишься?"; }; func int DIA_Garvell_eilig_Condition() { if(Npc_KnowsInfo(other,DIA_Garvell_GREET)) { return TRUE; }; }; func void DIA_Garvell_eilig_Info() { AI_Output(other,self,"DIA_Garvell_eilig_15_00"); //Почему ты так торопишься? AI_Output(self,other,"DIA_Garvell_eilig_04_01"); //Скоро придут орки и сожгут город дотла. AI_Output(other,self,"DIA_Garvell_eilig_15_02"); //Почему ты так думаешь? AI_Output(self,other,"DIA_Garvell_eilig_04_03"); //Парень, ты видишь, что паладины теперь повсюду? Почему, как ты думаешь, они здесь? AI_Output(self,other,"DIA_Garvell_eilig_04_04"); //Я сажу тебе. Они здесь, потому что скоро на нас нападут орки. А это не доставит нам радости. }; instance DIA_Garvell_Schiff(C_Info) { npc = VLK_441_Garvell; nr = 99; condition = DIA_Garvell_Schiff_Condition; information = DIA_Garvell_Schiff_Info; description = "Почему ты не можешь закончить корабль?"; }; func int DIA_Garvell_Schiff_Condition() { if(Npc_KnowsInfo(other,DIA_Garvell_GREET)) { return TRUE; }; }; func void DIA_Garvell_Schiff_Info() { AI_Output(other,self,"DIA_Garvell_Schiff_15_00"); //Почему ты не можешь закончить корабль? AI_Output(self,other,"DIA_Garvell_Schiff_04_01"); //Ох, у нас тысячи проблем. Остов пока еще не очень стабилен и не хватает досок на обшивку. AI_Output(self,other,"DIA_Garvell_Schiff_04_02"); //У меня почти не осталось средств на покупку материалов, а последняя партия вся была поедена жучком. AI_Output(self,other,"DIA_Garvell_Schiff_04_03"); //Мои парни работают не очень эффективно. Один хочет построить быстрый корабль, а другого волнует только резная фигура, которая будет установлена на носу судна AI_Output(self,other,"DIA_Garvell_Schiff_04_04"); //Как будто нам больше нечем заняться! AI_Output(self,other,"DIA_Addon_Garvell_Schiff_04_00"); //К тому же один из моих парней просто перестал приходить на работу. Я начинаю опасаться, что это еще сильнее задержит постройку. }; instance DIA_Addon_Garvell_MissingPeople(C_Info) { npc = VLK_441_Garvell; nr = 5; condition = DIA_Addon_Garvell_MissingPeople_Condition; information = DIA_Addon_Garvell_MissingPeople_Info; description = "У тебя пропал рабочий?"; }; func int DIA_Addon_Garvell_MissingPeople_Condition() { if(Npc_KnowsInfo(other,DIA_Garvell_Schiff) && (SC_HearedAboutMissingPeople == TRUE) && (MissingPeopleReturnedHome == FALSE)) { return TRUE; }; }; func void DIA_Addon_Garvell_MissingPeople_Info() { AI_Output(other,self,"DIA_Addon_Garvell_MissingPeople_15_00"); //У тебя пропал рабочий? AI_Output(self,other,"DIA_Addon_Garvell_MissingPeople_04_01"); //Да. Его звали Монти. Он как будто растворился в воздухе. AI_Output(self,other,"DIA_Addon_Garvell_MissingPeople_04_02"); //Эта ленивая свинья, наверное, прохлаждается сейчас на какой-нибудь ферме. Не надо было платить ему аванс. Log_CreateTopic(TOPIC_Addon_MissingPeople,LOG_MISSION); Log_SetTopicStatus(TOPIC_Addon_MissingPeople,LOG_Running); B_LogEntry(TOPIC_Addon_MissingPeople,"Гарвелл жалуется на своего работника Монти, который не вышел на работу несколько дней назад. Гарвелл думает, что Монти сбежал к фермерам."); Info_ClearChoices(DIA_Addon_Garvell_MissingPeople); Info_AddChoice(DIA_Addon_Garvell_MissingPeople,"Я слышал, что пропадали и другие люди.",DIA_Addon_Garvell_MissingPeople_more); if(SCKnowsFarimAsWilliamsFriend == FALSE) { Info_AddChoice(DIA_Addon_Garvell_MissingPeople,"Когда в последний раз ты видел Монти?",DIA_Addon_Garvell_MissingPeople_wo); }; }; func void DIA_Addon_Garvell_MissingPeople_more() { AI_Output(other,self,"DIA_Addon_Garvell_MissingPeople_more_15_00"); //Я слышал, что пропадали и другие люди. AI_Output(self,other,"DIA_Addon_Garvell_MissingPeople_more_04_01"); //О чем я и говорю! Плохие времена настали... AI_Output(self,other,"DIA_Addon_Garvell_MissingPeople_more_04_02"); //Рыбак Фарим рассказывал мне похожую историю. Пропал его приятель Вильям. AI_Output(self,other,"DIA_Addon_Garvell_MissingPeople_more_04_03"); //Я уверен, что за всем этим стоят орки. SCKnowsFarimAsWilliamsFriend = TRUE; Log_CreateTopic(TOPIC_Addon_WhoStolePeople,LOG_MISSION); Log_SetTopicStatus(TOPIC_Addon_WhoStolePeople,LOG_Running); B_LogEntry(TOPIC_Addon_WhoStolePeople,"Рыбак Фарим похоже что-то знает об исчезновении своего друга Вильяма."); Log_CreateTopic(TOPIC_Addon_MissingPeople,LOG_MISSION); Log_SetTopicStatus(TOPIC_Addon_MissingPeople,LOG_Running); Log_AddEntry(TOPIC_Addon_MissingPeople,LogText_Addon_WilliamMissing); Info_AddChoice(DIA_Addon_Garvell_MissingPeople,Dialog_Back,DIA_Addon_Garvell_MissingPeople_BACK); if(Farim.aivar[AIV_TalkedToPlayer] == FALSE) { Info_AddChoice(DIA_Addon_Garvell_MissingPeople,"Где мне найти этого Фарима?",DIA_Addon_Garvell_MissingPeople_Farim); }; }; func void DIA_Addon_Garvell_MissingPeople_BACK() { Info_ClearChoices(DIA_Addon_Garvell_MissingPeople); }; func void DIA_Addon_Garvell_MissingPeople_Farim() { AI_Output(other,self,"DIA_Addon_Garvell_MissingPeople_Farim_15_00"); //Где мне найти этого Фарима? AI_Output(self,other,"DIA_Addon_Garvell_MissingPeople_Farim_04_01"); //Он рыбак. Думаю, ты найдешь его рядом со складом запасов паладинов. Но я не уверен. B_LogEntry(TOPIC_Addon_WhoStolePeople,"Хижина Фарима находится неподалеку от склада провизии паладинов."); }; func void DIA_Addon_Garvell_MissingPeople_wo() { AI_Output(other,self,"DIA_Addon_Garvell_MissingPeople_wo_15_00"); //Когда в последний раз ты видел Монти? AI_Output(self,other,"DIA_Addon_Garvell_MissingPeople_wo_04_01"); //Первый раз он не потрудился придти на работу два дня назад. }; instance DIA_Garvell_ReturnMonty(C_Info) { npc = VLK_441_Garvell; nr = 99; condition = DIA_Garvell_ReturnMonty_Condition; information = DIA_Garvell_ReturnMonty_Info; description = "Как продвигаются дела?"; }; func int DIA_Garvell_ReturnMonty_Condition() { if((Npc_GetDistToWP(Monty_NW,"NW_CITY_HABOUR_WERFT_IN_01") <= 1000) && (MissingPeopleReturnedHome == TRUE)) { return TRUE; }; }; func void DIA_Garvell_ReturnMonty_Info() { AI_Output(other,self,"DIA_Addon_Garvell_ReturnMonty_15_00"); //Как продвигаются дела? AI_Output(self,other,"DIA_Addon_Garvell_ReturnMonty_04_01"); //Монти вернулся! Сейчас он изучает чертежи. AI_Output(self,other,"DIA_Addon_Garvell_ReturnMonty_04_02"); //Может быть, теперь нам и удастся построить корабль... B_GivePlayerXP(XP_Ambient); }; instance DIA_Garvell_MISSION(C_Info) { npc = VLK_441_Garvell; nr = 2; condition = DIA_Garvell_MISSION_Condition; information = DIA_Garvell_MISSION_Info; permanent = FALSE; description = "Могу я чем-нибудь помочь?"; }; func int DIA_Garvell_MISSION_Condition() { if(Npc_KnowsInfo(other,DIA_Garvell_eilig) && (Kapitel < 3)) { return TRUE; }; }; func void DIA_Garvell_MISSION_Info() { AI_Output(other,self,"DIA_Garvell_MISSION_15_00"); //Могу я чем-нибудь помочь? AI_Output(self,other,"DIA_Garvell_MISSION_04_01"); //Да, можешь. Выясни, что планируют паладины. Я хочу знать, зачем они здесь. AI_Output(self,other,"DIA_Garvell_MISSION_04_02"); //И я должен знать, действительно ли орки собираются напасть на нас и как далеко от города они находятся. AI_Output(self,other,"DIA_Garvell_MISSION_04_03"); //Одного из этих отродий видели совсем неподалеку от города. AI_Output(self,other,"DIA_Garvell_MISSION_04_04"); //Просто сообщай мне всю информацию, что раздобудешь. AI_Output(self,other,"DIA_Garvell_Add_04_00"); //Я должен знать, сколько у меня осталось времени на постройку судна. MIS_Garvell_Infos = LOG_Running; Knows_Ork = TRUE; Log_CreateTopic(TOPIC_Garvell,LOG_MISSION); Log_SetTopicStatus(TOPIC_Garvell,LOG_Running); B_LogEntry(TOPIC_Garvell,"Гарвелл хочет получить информацию об орках, и хочет знать, зачем паладины в городе."); }; func void B_GarvellWeiter() { AI_Output(self,other,"DIA_Garvell_Weiter_04_00"); //Хорошо. Если еще что-нибудь выяснишь, дай мне знать. }; func void B_GarvellSuccess() { AI_Output(self,other,"DIA_Garvell_Success_04_00"); //Спасибо за информацию. Судя по всему, у нас сколько угодно времени на постройку судна. MIS_Garvell_Infos = LOG_SUCCESS; B_GivePlayerXP(XP_Ambient); }; instance DIA_Garvell_Orks(C_Info) { npc = VLK_441_Garvell; nr = 3; condition = DIA_Garvell_Orks_Condition; information = DIA_Garvell_Orks_Info; permanent = FALSE; description = "У меня есть информация об орках."; }; func int DIA_Garvell_Orks_Condition() { if((MIS_Garvell_Infos == LOG_Running) && (Knows_Paladins >= 1)) { return TRUE; }; }; func void DIA_Garvell_Orks_Info() { AI_Output(other,self,"DIA_Garvell_Orks_15_00"); //У меня есть информация об орках. AI_Output(self,other,"DIA_Garvell_Orks_04_01"); //Выкладывай. AI_Output(other,self,"DIA_Garvell_Orks_15_02"); //Они застряли в Долине Рудников, и, похоже, они собираются остаться там. AI_Output(other,self,"DIA_Garvell_Orks_15_03"); //Чтобы здесь было безопасно, паладины охраняют Проход. Tell_Garvell = Tell_Garvell + 1; B_GivePlayerXP(XP_Ambient); if(Tell_Garvell >= 3) { B_GarvellSuccess(); } else { B_GarvellWeiter(); }; }; instance DIA_Garvell_Paladine(C_Info) { npc = VLK_441_Garvell; nr = 2; condition = DIA_Garvell_Paladine_Condition; information = DIA_Garvell_Paladine_Info; permanent = FALSE; description = "Я знаю, зачем паладины здесь."; }; func int DIA_Garvell_Paladine_Condition() { if((MIS_Garvell_Infos == LOG_Running) && (KnowsPaladins_Ore == TRUE)) { return TRUE; }; }; func void DIA_Garvell_Paladine_Info() { AI_Output(other,self,"DIA_Garvell_Paladine_15_00"); //Я знаю, зачем паладины здесь. AI_Output(self,other,"DIA_Garvell_Paladine_04_01"); //Правда? Скажи мне! AI_Output(other,self,"DIA_Garvell_Paladine_15_02"); //Паладины здесь, чтобы добывать магическую руду в Долине Рудников, а не потому, что они ожидают нападения орков на город. AI_Output(other,self,"DIA_Garvell_Paladine_15_03"); //Как только они добудут руду, они вернутся на материк. Tell_Garvell = Tell_Garvell + 1; B_GivePlayerXP(XP_Ambient); if(Tell_Garvell >= 3) { B_GarvellSuccess(); } else { B_GarvellWeiter(); }; }; instance DIA_Garvell_City(C_Info) { npc = VLK_441_Garvell; nr = 4; condition = DIA_Garvell_City_Condition; information = DIA_Garvell_City_Info; permanent = FALSE; description = "Что касается орка около города..."; }; func int DIA_Garvell_City_Condition() { if((MIS_Garvell_Infos == LOG_Running) && (Knows_Paladins >= 2)) { return TRUE; }; }; func void DIA_Garvell_City_Info() { AI_Output(other,self,"DIA_Garvell_City_15_00"); //Что касается орка около города... AI_Output(self,other,"DIA_Garvell_City_04_01"); //Дааа?.. AI_Output(other,self,"DIA_Garvell_City_15_02"); //Не волнуйся насчет него. Городская стража позаботится о нем. Tell_Garvell = Tell_Garvell + 1; B_GivePlayerXP(XP_Ambient); if(Tell_Garvell >= 3) { B_GarvellSuccess(); } else { B_GarvellWeiter(); }; }; instance DIA_Garvell_Perm(C_Info) { npc = VLK_441_Garvell; nr = 13; condition = DIA_Garvell_Perm_Condition; information = DIA_Garvell_Perm_Info; permanent = TRUE; description = "Что происходит в гавани?"; }; func int DIA_Garvell_Perm_Condition() { if(Npc_KnowsInfo(other,DIA_Garvell_MISSION)) { return TRUE; }; }; func void DIA_Garvell_Perm_Info() { AI_Output(other,self,"DIA_Garvell_Perm_15_00"); //Что происходит в гавани? if(MIS_Garvell_Infos != LOG_SUCCESS) { AI_Output(self,other,"DIA_Garvell_Perm_04_01"); //Орки дышат нам в спину, а ты спрашиваешь о гавани? AI_Output(other,self,"DIA_Garvell_Perm_15_02"); //Я только хотел... AI_Output(self,other,"DIA_Garvell_Perm_04_03"); //Самая большая проблема в том, что в гавани недостаточно кораблей, чтобы вывезти нас отсюда. AI_Output(self,other,"DIA_Garvell_Perm_04_04"); //Если честно, здесь всего один корабль, и он принадлежит паладинам. А они уж точно не позволят нам воспользоваться им. } else { AI_Output(self,other,"DIA_Garvell_Perm_04_05"); //Оглянись вокруг, здесь давно уже ничего не происходит. }; };
D
/Users/j/Desktop/Code/clock/target/rls/debug/build/backtrace-b578421c3be5c1a5/build_script_build-b578421c3be5c1a5: /Users/j/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.31/build.rs /Users/j/Desktop/Code/clock/target/rls/debug/build/backtrace-b578421c3be5c1a5/build_script_build-b578421c3be5c1a5.d: /Users/j/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.31/build.rs /Users/j/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.31/build.rs:
D
// Written in the D programming language. /** DLANGUI library. This module implements array based collection. Synopsis: ---- import dlangui.core.collections; // add Collection!Widget widgets; widgets ~= new Widget("id1"); widgets ~= new Widget("id2"); Widget w3 = new Widget("id3"); widgets ~= w3; // remove by index widgets.remove(1); // foreach foreach(w; widgets) writeln("widget: ", w.id); // remove by value widgets -= w3; writeln(widgets[0].id); ---- Copyright: Vadim Lopatin, 2014 License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(WEB coolreader.org, Vadim Lopatin) */ module dlangui.core.collections; import std.algorithm; /// array based collection of items /// retains item order when during add/remove operations struct Collection(T, bool ownItems = false) { private T[] _items; private size_t _len; /// returns true if there are no items in collection @property bool empty() { return _len == 0; } /// returns number of items in collection @property size_t length() { return _len; } /// returns currently allocated capacity (may be more than length) @property size_t size() { return _items.length; } /// change capacity (e.g. to reserve big space to avoid multiple reallocations) @property void size(size_t newSize) { if (_len > newSize) length = newSize; // shrink _items.length = newSize; } /// returns number of items in collection @property void length(size_t newSize) { if (newSize < _len) { // shrink static if (is(T == class) || is(T == struct)) { // clear items for (size_t i = newSize; i < _len; i++) { static if (ownItems) destroy(_items[i]); _items[i] = T.init; } } } else if (newSize > _len) { // expand if (_items.length < newSize) _items.length = newSize; } _len = newSize; } /// access item by index ref T opIndex(size_t index) { assert(index < _len); return _items[index]; } /// insert new item in specified position void add(T item, size_t index = size_t.max) { if (index > _len) index = _len; if (_items.length >= _len) { if (_items.length < 4) _items.length = 4; else _items.length = _items.length * 2; } if (index < _len) { for (size_t i = _len; i > index; i--) _items[i] = _items[i - 1]; } _items[index] = item; _len++; } /// add all items from other collection void addAll(ref Collection!(T, ownItems) v) { for (int i = 0; i < v.length; i++) add(v[i]); } /// support for appending (~=, +=) and removing by value (-=) ref Collection opOpAssign(string op)(T item) { static if (op.equal("~") || op.equal("+")) { // append item to end of collection add(item); return this; } else if (op.equal("-")) { // remove item from collection, if present removeValue(item); return this; } else { assert(false, "not supported opOpAssign " ~ op); } } /// returns index of first occurence of item, size_t.max if not found size_t indexOf(T item) { for (size_t i = 0; i < _len; i++) if (_items[i] == item) return i; return size_t.max; } /// remove single item, returning removed item T remove(size_t index) { assert(index < _len); T result = _items[index]; for (size_t i = index; i + 1 < _len; i++) _items[i] = _items[i + 1]; _items[_len] = T.init; _len--; return result; } /// remove single item by value - if present in collection, returning true if item was found and removed bool removeValue(T value) { size_t index = indexOf(value); if (index == size_t.max) return false; T res = remove(index); static if (ownItems) destroy(res); return true; } /// support of foreach with reference int opApply(int delegate(ref T param) op) { int result = 0; for (size_t i = 0; i < _len; i++) { result = op(_items[i]); if (result) break; } return result; } /// remove all items void clear() { static if (is(T == class) || is(T == struct)) { /// clear references for(size_t i = 0; i < _len; i++) { static if (ownItems) destroy(_items[i]); _items[i] = T.init; } } _len = 0; _items = null; } //=================================== // stack/queue-like ops /// remove first item @property T popFront() { if (empty) return T.init; // no items return remove(0); } /// insert item at beginning of collection void pushFront(T item) { add(item, 0); } /// remove last item @property T popBack() { if (empty) return T.init; // no items return remove(length - 1); } /// insert item at end of collection void pushBack(T item) { add(item); } /// peek first item @property T front() { if (empty) return T.init; // no items return _items[0]; } /// peek last item @property T back() { if (empty) return T.init; // no items return _items[_len - 1]; } ~this() { clear(); } }
D
/+ Copyright (c) 2006 Eric Anderton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/ /** Provides Tango binary Reader support, with a few enhancements Authors: Eric Anderton License: BSD Derivative (see source for details) Copyright: 2006 Eric Anderton */ module ddl.DDLReader; private import ddl.Utils; private import ddl.FileBuffer; enum Anchor{ None, Begin, End, Current } /** Tango IO Reader subclass. DDLReader provides a few key pieces of functionality that are used heavily within DDL's input operations. In short, it provides a way to seek, peek and get an entire buffer from a buffer or condiut. This makes it possible to implement a wider array of parser types (e.g. unlimited read-ahead, and recursive descent) than is possible with the standard Mango Reader. The reader class itself is useful as-is, but implementors are strongly encouraged to subclass the reader, as to create a richer and more task-oriented feature set. */ public class DDLReader { ubyte[] data; size_t position; /** Simple constructor. Params: data = data to use for this reader. */ public this(void[] data) { this.data = cast(ubyte[])data; } public this(FileBuffer buffer) { this.data = buffer.data; } /** Look ahead one byte into the input buffer, without advancing the current read position. Params: x = (inout) will contain the value of the byte just after the current read position. */ public DDLReader peek(inout ubyte x) { assert(this.hasMore()); x = data[position]; return this; } /** Look ahead <i>n</i> bytes into the input buffer, without advancing the current read position. Params: x = (inout) will contain the value(s) of the byte(s) just after the current read position. elements = (default: uint.max) the number of bytes to peek. */ public DDLReader peek(inout ubyte[] x,size_t elements = size_t.max) { if(elements == size_t.max) { x = data[position..$]; } else{ x = data[position..position+elements]; } return this; } /** Reads everything the underlying conduit has. The current position will be at EOF after this operation. Params: x = (inout) will contain everything from the current read position to the end of the file. */ public DDLReader getAll(inout void[] x) { x = data[position..$]; position = data.length; return this; } public DDLReader _get(T)(inout T x) { //debug debugLog("reading element size: {0}",T.sizeof); x = *(cast(T*)(data[position..position + T.sizeof].ptr)); position += T.sizeof; return this; } public DDLReader get(inout char x) { return _get(x); } public DDLReader get(inout wchar x) { return _get(x); } public DDLReader get(inout dchar x) { return _get(x); } public DDLReader get(inout byte x) { return _get(x); } public DDLReader get(inout ubyte x) { return _get(x); } public DDLReader get(inout short x) { return _get(x); } public DDLReader get(inout ushort x) { return _get(x); } public DDLReader get(inout int x) { return _get(x); } public DDLReader get(inout uint x) { return _get(x); } public DDLReader get(inout long x) { return _get(x); } public DDLReader get(inout ulong x) { return _get(x); } public DDLReader _getArray(T)(inout T[] x,size_t elements = size_t.max) { size_t end; if(elements == size_t.max) { //debug debugLog("reading max"); end = data.length - (data.length % T.sizeof); x = cast(T[])(data[position..end]); } else{ //debug debugLog("size: {3} elements: {0} len: {1} pos: {2}",elements,data.length,position,T.sizeof); end = position + (elements * T.sizeof); x = cast(T[])(data[position..end]); } position = end; return this; } public DDLReader get(inout char[] x,size_t elements = size_t.max) { return _getArray!(char)(x,elements); } public DDLReader get(inout wchar[] x,size_t elements = size_t.max) { return _getArray!(wchar)(x,elements); } public DDLReader get(inout dchar[] x,size_t elements = size_t.max) { return _getArray!(dchar)(x,elements); } public DDLReader get(inout byte[] x,size_t elements = size_t.max) { return _getArray!(byte)(x,elements); } public DDLReader get(inout ubyte[] x,size_t elements = size_t.max) { return _getArray!(ubyte)(x,elements); } public DDLReader get(inout short[] x,size_t elements = size_t.max) { return _getArray!(short)(x,elements); } public DDLReader get(inout ushort[] x,size_t elements = size_t.max) { return _getArray!(ushort)(x,elements); } public DDLReader get(inout int[] x,size_t elements = size_t.max) { return _getArray!(int)(x,elements); } public DDLReader get(inout uint[] x,size_t elements = size_t.max) { return _getArray!(uint)(x,elements); } public DDLReader get(inout long[] x,size_t elements = size_t.max) { return _getArray!(long)(x,elements); } public DDLReader get(inout ulong[] x,size_t elements = size_t.max) { return _getArray!(ulong)(x,elements); } /** Returns: (true/false) If the conduit has any more data to be read. */ bool hasMore() { return position < data.length; } /** Perform a seek relative to the current buffer position and status using the conduit. Some Tango conduits are seekable directly. For all others, this method seeks by manipulating the buffer and the current read position instead. <b>NOTE:</b> this will clear out the current buffer, which may have some performance implications. Params: offset = the number of bytes to seek from the specified anchor anchor = (default: Begin) specifies the point in the conduit from where seeks are calculated (see: ISeekable.SeekAnchor for more info). */ DDLReader seek(ulong offset, Anchor anchor = Anchor.Begin) { switch(anchor) { case Anchor.Begin: assert(offset < data.length); position = offset; break; case Anchor.End: assert(position + offset < data.length); position = data.length + offset; break; default: case Anchor.None: case Anchor.Current: assert(position + offset < data.length); position += offset; break; } return this; } /** Returns: The position relative to the current buffer position. */ size_t getPosition() { return position; } ubyte[] getData() { return data; } }
D
module UnrealScript.TribesGame.TrAccolade_KillStreak_Ten; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.TribesGame.TrAccolade; extern(C++) interface TrAccolade_KillStreak_Ten : TrAccolade { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrAccolade_KillStreak_Ten")); } private static __gshared TrAccolade_KillStreak_Ten mDefaultProperties; @property final static TrAccolade_KillStreak_Ten DefaultProperties() { mixin(MGDPC("TrAccolade_KillStreak_Ten", "TrAccolade_KillStreak_Ten TribesGame.Default__TrAccolade_KillStreak_Ten")); } }
D
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSESSIONMANAGER_H #define QSESSIONMANAGER_H public import qt.QtCore.qobject; public import qt.QtGui.qwindowdefs; public import qt.QtCore.qstring; public import qt.QtCore.qstringlist; #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QGuiApplication; class QSessionManagerPrivate; class Q_GUI_EXPORT QSessionManager : public QObject { mixin Q_OBJECT; mixin Q_DECLARE_PRIVATE; QSessionManager(QGuiApplication *app, QString &id, QString &key); ~QSessionManager(); public: QString sessionId() const; QString sessionKey() const; bool allowsInteraction(); bool allowsErrorInteraction(); void release(); void cancel(); enum RestartHint { RestartIfRunning, RestartAnyway, RestartImmediately, RestartNever }; void setRestartHint(RestartHint); RestartHint restartHint() const; void setRestartCommand(ref const(QStringList)); QStringList restartCommand() const; void setDiscardCommand(ref const(QStringList)); QStringList discardCommand() const; void setManagerProperty(ref const(QString) name, ref const(QString) value); void setManagerProperty(ref const(QString) name, ref const(QStringList) value); bool isPhase2() const; void requestPhase2(); private: friend class QGuiApplication; friend class QGuiApplicationPrivate; }; QT_END_NAMESPACE #endif // QT_NO_SESSIONMANAGER #endif // QSESSIONMANAGER_H
D
module hurt.util.pair; struct Pair(T,S) { T first; S second; this(T first, S second) { this.first = first; this.second = second; } }
D
/Users/hishizuka/Work/git/rust/fizzbuzz/target/rls/debug/deps/fizzbuzz-9fc25dc6ade72b04.rmeta: src/main.rs /Users/hishizuka/Work/git/rust/fizzbuzz/target/rls/debug/deps/fizzbuzz-9fc25dc6ade72b04.d: src/main.rs src/main.rs:
D
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE 238 77 6 77 15 60 64.5999985 -127.900002 1745 11.6000004 11.8000002 0.333333333 sediments, redbeds 151.699997 80.8000031 5.19999981 18.2000008 21 26 36.7999992 -105.400002 355 5.0999999 7.30000019 1 intrusives 219.300003 68.9000015 2.79999995 90.9000015 15 60 64.5 -128.5 343 5.5999999 5.5999999 0.333333333 sediments, redbeds 142.300003 67.9000015 10.3000002 17 20 47 35.5 -106.099998 1004 11.1000004 11.1000004 0.555555556 intrusives, extrusives 6.69999981 87.3000031 6.69999981 46.9000015 22 24 36.5999985 -105.5 550 6.69999981 9.5 1 intrusives 256.399994 77.0999985 13 0 2 56 46 -112 3368 21.7000008 21.7000008 0.277777778 extrusives, intrusives 164 83 5.80000019 32.2000008 15 65 58.5 -119.300003 7737 10 10 0.3 sediments, dolomite 240 82 34 55 2 65 45 -110 2808 49 58 0.238095238 intrusives, porphyry
D
module ui.base; public import content; public import collections; public import rendering.combined; public import window.mouse, window.keyboard, window.clipboard; public import util.variant; public import util.hash; public import rendering; public import ui.window; public import math.rect : Rect; enum HorizontalAlignment : ubyte { left, right, center } enum VerticalAlignment : ubyte { bottom, top, center } Rect intersection(ref Rect first, ref Rect second) { import std.algorithm; float4 f = first.toFloat4, g = second.toFloat4; float4 r; r.x = max(f.x, g.x); r.y = max(f.y, g.y); r.z = min(f.z, g.z); r.w = min(f.w, g.w); auto res = Rect(r.x, r.y, r.z - r.x, r.w - r.y); if(res.w < 0 || res.h < 0) return Rect(0,0,0,0); else return res; } Rect padded(ref Rect r, float2 p) { return Rect(r.x + p.x, r.y + p.y, r.w - p.x * 2, r.h - p.y * 2); } struct GuiFrame { HashID frame; Color color; this(string s, Color c) { frame = bytesHash(s); color = c; } this(HashID f, Color c) { frame = f; color = c; } } struct GuiFont { HashID font; Color color; ubyte4 packed; void thresholds(float2 value) { packed.z = cast(ubyte)(value.x * 255.0); packed.w = cast(ubyte)(value.y * 255.0); } float2 thresholds() { return float2(packed.z / 255.0f, packed.w / 255.0f); } float2 size() { return float2(packed.x, packed.y); } float lineHeight() { return size.y * 1.5f; } void size(float2 value) { packed.x = cast(ubyte)(value.x); packed.y = cast(ubyte)(value.y); } this(string s, Color c, float2 sz, float2 thresh) { font = bytesHash(s); color = c; thresholds = thresh; size = sz; } } struct GuiTooltipStyle { GuiFont font; } struct ButtonObj { string text; string tooltip; } alias EditText = List!char; struct GuiState { float4 fullArea; private float2 offset; private Rect area; private Rect focusRect; private int focus; int controlCount; } alias StateVariant = VariantN!(64); struct Gui { import std.algorithm; Renderer2D* renderer; private VariantTable!(64) skin; private Table!(HashID, StateVariant) oldControlStates; private Table!(HashID, StateVariant) controlStates; WindowManager windows; //Diffrent items use diffrent overlapping rectangles. List!Rect overlaping; AtlasHandle atlas; FontHandle fonts; Keyboard* keyboard; Mouse* mouse; Clipboard* clipboard; GuiState guiState; @property ref Rect area() { return guiState.area; } @property area(Rect value) { guiState.area = value; } @property int focus() { return guiState.focus; } //We need to store some sort of delta state so //that frame transitions work ok. this(A)(ref A allocator, AtlasHandle atlas, FontHandle fonts, VariantTable!(64) skin, Renderer2D* renderer, Keyboard* keyboard, Mouse* mouse, Clipboard* clipboard, Rect area) { this.renderer = renderer; this.atlas = atlas; this.fonts = fonts; this.skin = skin; this.keyboard = keyboard; this.mouse = mouse; this.clipboard = clipboard; oldControlStates = Table!(HashID, StateVariant)(allocator, 100); controlStates = Table!(HashID, StateVariant)(allocator, 100); overlaping = List!Rect(allocator, 50); windows = WindowManager(allocator); this.guiState.fullArea = area; this.guiState.area = area; this.guiState.offset = float2.zero; this.guiState.controlCount = 0; this.guiState.focus = -1; } void unfocus() { this.guiState.focus = -1; } GuiState beginSubArea(Rect area, float2 offset, int focused) { GuiState old = this.guiState; Rect newArea = intersection(area, this.guiState.area); offset = offset - (newArea.xy - area.xy); this.guiState.area = newArea; this.guiState.fullArea = Rect(area); this.guiState.offset = offset; this.guiState.focus = focused; this.guiState.controlCount = 0; return old; } void endSubArea(GuiState oldState) { guiState = oldState; } bool wasClicked(Rect rect) { Rect r = intersection(rect, guiState.area); return mouse.wasReleased(MouseButton.left) && r.contains(mouse.location) && r.contains(mouse.state(MouseButton.left).lastDown) && !isCovered(mouse.state(MouseButton.left).lastDown); } bool isCovered(float2 point) { foreach(ref rect; overlaping) { if(rect.contains(point)) return true; } return false; } bool isDown(Rect rect) { Rect r = intersection(rect, guiState.area); return mouse.isDown(MouseButton.left) && r.contains(mouse.location) && !isCovered(mouse.location); } bool wasDown(Rect rect) { Rect r = intersection(rect, guiState.area); return mouse.isDown(MouseButton.left) && r.contains(mouse.state(MouseButton.left).lastDown) && !isCovered(mouse.state(MouseButton.left).lastDown); } bool isHovering(Rect rect) { Rect r = intersection(rect, guiState.area); return r.contains(mouse.location) && !isCovered(mouse.location); } bool hasFocus() { return guiState.focus == guiState.controlCount - 1; } bool nextHasFocus() { return guiState.focus == guiState.controlCount; } T fetchState(T)(HashID id, T default_) { auto ptr = id in oldControlStates; auto state = ptr ? ptr.get!(T) : default_; return state; } T fetchCurrentState(T)(HashID id, T default_) { auto ptr = id in controlStates; auto state = ptr ? ptr.get!(T) : default_; return state; } T fetchStyle(T)(HashID id) { return skin[id].get!(T); } void state(T)(HashID id, T state) { controlStates[id] = StateVariant.create(state); } void fixRect(ref Rect rect) { import std.algorithm; rect.x += guiState.area.x; rect.y += guiState.area.y; guiState.fullArea.x = min(rect.x, guiState.fullArea.x); guiState.fullArea.y = min(rect.y, guiState.fullArea.y); guiState.fullArea.z = max(rect.x + rect.w, guiState.fullArea.z); guiState.fullArea.w = max(rect.y + rect.h, guiState.fullArea.w); rect.x += guiState.offset.x; rect.y += guiState.offset.y; } bool handleControl(ref Rect rect) { fixRect(rect); if(wasDown(rect)) guiState.focus = guiState.controlCount; guiState.controlCount++; if(hasFocus()) { guiState.focusRect = rect; return true; } return false; } void drawTooltip(Rect rect, const(char)[] tooltip) { GuiTooltipStyle style = skin.tooltip.get!(GuiTooltipStyle); renderer.drawText(tooltip, float2.zero, style.font.size, fonts.asset[style.font.font], style.font.color, style.font.thresholds); } void drawLine(Frame)(float2 start, float2 end, float width, auto ref Frame frame) { Rect area = guiState.area; start.x = min(area.x + area.w, max(area.x, start.x)); end.x = min(area.x + area.w, max(area.x, end.x)); start.y = min(area.y + area.h, max(area.y, start.y)); end.y = min(area.y + area.h, max(area.y, end.y)); renderer.drawLine(start, end, width, atlas.asset[frame.frame], frame.color); } void drawQuad(Frame)(Rect rect, auto ref Frame frame) { renderer.drawQuad(rect, atlas.asset[frame.frame], frame.color, guiState.area); } void drawQuad(Frame)(Rect rect, auto ref Frame frame, Rect bounds) { renderer.drawQuad(rect, atlas.asset[frame.frame], frame.color, bounds); } void drawQuadOutline(Frame)(Rect rect, float width, auto ref Frame frame) { renderer.drawQuadOutline(rect, width, atlas.asset[frame.frame], frame.color); } void drawQuad(Frame)(Rect rect, auto ref Frame frame, Color color) { renderer.drawQuad(rect, frame, color, guiState.area); } void drawText(const(char[]) text, float2 pos, Rect rect, ref GuiFont font) { drawText(text, pos, rect, font, guiState.area); } void drawText(const(char[]) text, float2 pos, Rect rect, ref GuiFont font, Rect bounds) { Rect b = intersection(rect, bounds); if(b == Rect.empty) return; renderer.drawText(text, pos, font.size, fonts.asset[font.font], font.color, font.thresholds, b); } void drawText(const(char[]) text, Rect rect, ref GuiFont font, Rect bounds, HorizontalAlignment horizontal = HorizontalAlignment.left, VerticalAlignment vertical = VerticalAlignment.center) { auto f = &fonts.asset[font.font]; auto textSize = f.measure(text) * font.size; auto fontPos = rect.xy; if(vertical == VerticalAlignment.center) fontPos.y += rect.h / 2 - textSize.y / 2; else if(vertical == VerticalAlignment.top) fontPos.y += rect.h - textSize.y; if(horizontal == HorizontalAlignment.center) fontPos.x += rect.w / 2 - textSize.x / 2; else if(horizontal == HorizontalAlignment.right) fontPos.x += rect.w - textSize.x; drawText(text, fontPos, rect, font, bounds); } void drawText(const(char[]) text, Rect rect, ref GuiFont font, HorizontalAlignment horizontal = HorizontalAlignment.left, VerticalAlignment vertical = VerticalAlignment.center) { drawText(text, rect, font, guiState.area, horizontal, vertical); } void begin() { updateFocus(); import std.algorithm; swap(controlStates, oldControlStates); controlStates.clear(); renderer.begin(); } void updateFocus() { guiState.fullArea = guiState.area.toFloat4; if(keyboard.wasInput(Key.tab)) guiState.focus++; guiState.controlCount = 0; } void drawFocused() { if(guiState.focus >= 0 && guiState.focus < guiState.controlCount) { //renderer.drawQuadOutline(intersection(guiState.area, guiState.focusRect), 1.0f, atlas.asset.pixel, Color.black); } } void end() { drawFocused(); if(guiState.focus >= guiState.controlCount) guiState.focus = 0; windows.render(this); renderer.end(); } }
D
/Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/Jobs.build/Duration+Extensions.swift.o : /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/JSON.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Shell.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Jobs.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Duration+Extensions.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Helpers.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Day.swift /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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/Jobs.build/Duration+Extensions~partial.swiftmodule : /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/JSON.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Shell.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Jobs.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Duration+Extensions.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Helpers.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Day.swift /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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/Jobs.build/Duration+Extensions~partial.swiftdoc : /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/JSON.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Shell.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Jobs.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Duration+Extensions.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Helpers.swift /Users/christian/GitHub/Tweescord/.build/checkouts/Jobs/Sources/Day.swift /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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/Tweescord/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap
D
instance DIA_Harad_EXIT(C_Info) { npc = VLK_412_Harad; nr = 999; condition = DIA_Harad_EXIT_Condition; information = DIA_Harad_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_Harad_EXIT_Condition() { return TRUE; }; func void DIA_Harad_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_Harad_Hallo(C_Info) { npc = VLK_412_Harad; nr = 2; condition = DIA_Harad_Hallo_Condition; information = DIA_Harad_Hallo_Info; permanent = FALSE; important = TRUE; }; func int DIA_Harad_Hallo_Condition() { if(Npc_IsInState(self,ZS_Talk) && (self.aivar[AIV_TalkedToPlayer] == TRUE)) { return TRUE; }; }; func void DIA_Harad_Hallo_Info() { AI_Output(self,other,"DIA_Harad_Hallo_12_00"); //(раздраженно) Что ты хочешь? }; instance DIA_Harad_Arbeit(C_Info) { npc = VLK_412_Harad; nr = 1; condition = DIA_Harad_Arbeit_Condition; information = DIA_Harad_Arbeit_Info; permanent = FALSE; description = "Я ищу работу!"; }; func int DIA_Harad_Arbeit_Condition() { return TRUE; }; func void DIA_Harad_Arbeit_Info() { AI_Output(other,self,"DIA_Harad_Arbeit_15_00"); //Я ищу работу! AI_Output(self,other,"DIA_Harad_Arbeit_12_01"); //Хм - мне не помешал бы новый ученик. AI_Output(self,other,"DIA_Harad_Arbeit_12_02"); //Брайан скоро закончит свое обучение, а затем покинет город. AI_Output(self,other,"DIA_Harad_Arbeit_12_03"); //А ты на что-нибудь годишься? AI_Output(other,self,"DIA_Harad_Arbeit_15_04"); //Если ты имеешь в виду, знаю ли я работу кузнеца ... AI_Output(self,other,"DIA_Harad_Arbeit_12_05"); //Нет. Я о другом. AI_Output(self,other,"DIA_Harad_Arbeit_12_06"); //Рано или поздно, придут орки и возьмут город в кольцо. И тогда в расчет будут приниматься только мужчины, способные защищать город. if(other.guild == GIL_NONE) { AI_Output(self,other,"DIA_Harad_Arbeit_12_07"); //А я не хочу, чтобы мой ученик опозорил мое имя, сбежав из города вместе с женщинами и никчемными бездельниками, вместо того, чтобы держать оборону вместе с другими мужчинами. }; Log_CreateTopic(TOPIC_Lehrling,LOG_MISSION); Log_SetTopicStatus(TOPIC_Lehrling,LOG_Running); B_LogEntry(TOPIC_Lehrling,"Если я смогу убедить Гарада, что я хоть на что-нибудь гожусь, он примет меня в ученики."); }; instance DIA_Harad_Taugenichts(C_Info) { npc = VLK_412_Harad; nr = 1; condition = DIA_Harad_Taugenichts_Condition; information = DIA_Harad_Taugenichts_Info; permanent = FALSE; description = "Я не никчемный!"; }; func int DIA_Harad_Taugenichts_Condition() { if(Npc_KnowsInfo(other,DIA_Harad_Arbeit)) { return TRUE; }; }; func void DIA_Harad_Taugenichts_Info() { AI_Output(other,self,"DIA_Harad_Taugenichts_15_00"); //Я не никчемный! AI_Output(self,other,"DIA_Harad_Taugenichts_12_01"); //Это громкие слова! А ты можешь подтвердить их такими же громкими делами? AI_Output(other,self,"DIA_Harad_Taugenichts_15_02"); //На что ты намекаешь? AI_Output(self,other,"DIA_Harad_Taugenichts_12_03"); //Принеси мне оружие орков. AI_Output(self,other,"DIA_Harad_Taugenichts_12_04"); //Орков недавно видели около города. Я думаю, тебе не придется искать их слишком долго. AI_Output(self,other,"DIA_Harad_Taugenichts_12_05"); //Если тебе удастся завалить одного из них, я возьму тебя в ученики. AI_Output(self,other,"DIA_Harad_Taugenichts_12_06"); //Если, конечно, другие мастера будут согласны. MIS_Harad_Orc = LOG_Running; Log_CreateTopic(TOPIC_HaradOrk,LOG_MISSION); Log_SetTopicStatus(TOPIC_HaradOrk,LOG_Running); B_LogEntry(TOPIC_HaradOrk,"Неподалеку от города видели орка. Кузнец Гарад хочет, чтобы я убил его. Оружие орка послужит достаточным доказательством."); }; instance DIA_Harad_OrcRunning(C_Info) { npc = VLK_412_Harad; nr = 1; condition = DIA_Harad_OrcRunning_Condition; information = DIA_Harad_OrcRunning_Info; permanent = FALSE; description = "Давай еще поговорим об этих орках ..."; }; func int DIA_Harad_OrcRunning_Condition() { if((MIS_Harad_Orc == LOG_Running) && (Harad_HakonMission == FALSE)) { return TRUE; }; }; func void DIA_Harad_OrcRunning_Info() { AI_Output(other,self,"DIA_Harad_OrcRunning_15_00"); //Давай еще поговорим об этих орках ... AI_Output(self,other,"DIA_Harad_OrcRunning_12_01"); //(отрывисто) Что? Info_ClearChoices(DIA_Harad_OrcRunning); Info_AddChoice(DIA_Harad_OrcRunning,"Можешь считать своего орка мертвым!",DIA_Harad_OrcRunning_Done); Info_AddChoice(DIA_Harad_OrcRunning,"Орк это очень серьезный противник ... ...",DIA_Harad_OrcRunning_TooHard); }; func void DIA_Harad_OrcRunning_TooHard() { AI_Output(other,self,"DIA_Harad_OrcRunning_TooHard_15_00"); //Но орк это очень серьезный противник ... AI_Output(self,other,"DIA_Harad_OrcRunning_TooHard_12_01"); //Хм - судя по тому, как ты выглядишь, возможно ты прав. У тебя слишком мало мяса на костях. Но это можно поправить. AI_Output(self,other,"DIA_Harad_OrcRunning_TooHard_12_02"); //Том не менее, ты должен доказать мне, что у тебя хватит мужества сражаться, если это будет необходимо. AI_Output(other,self,"DIA_Harad_OrcRunning_TooHard_15_03"); //А нет ли для меня противника немного поменьше? AI_Output(self,other,"DIA_Harad_OrcRunning_TooHard_12_04"); //Хм - (задумчиво) Хакон, торговец оружием на рыночной площади, сказал мне, что на него напали бандиты несколько дней назад. AI_Output(self,other,"DIA_Harad_OrcRunning_TooHard_12_05"); //Эти ублюдки, по слухам, устроили себе логово где-то за восточными воротами. AI_Output(self,other,"DIA_Harad_OrcRunning_TooHard_12_06"); //Эти трусливые шакалы не должны быть так уж сильны. AI_Output(self,other,"DIA_Harad_OrcRunning_TooHard_12_07"); //Убей этих ублюдков! Всех! Тогда я пойму, что ты не опозоришь наш город. Harad_HakonMission = TRUE; Log_CreateTopic(TOPIC_Lehrling,LOG_MISSION); Log_SetTopicStatus(TOPIC_Lehrling,LOG_Running); if(MIS_HakonBandits != LOG_Running) { B_LogEntry(TOPIC_Lehrling,"Гарад сказал мне, что бандиты ограбили торговца Хакона недалеко от города. Если я смогу убить их, это убедит его, что я хоть на что-то гожусь. Я должен поговорить с Хаконом. Возможно, он знает, где скрываются эти бандиты."); } else { B_LogEntry(TOPIC_Lehrling,"Гарад сказал мне, что бандиты ограбили торговца Хакона недалеко от города. Если я смогу убить их, это убедит его, что я хоть на что-то гожусь."); }; Info_ClearChoices(DIA_Harad_OrcRunning); }; func void DIA_Harad_OrcRunning_Done() { AI_Output(other,self,"DIA_Harad_OrcRunning_Done_15_00"); //Можешь считать своего орка мертвым! AI_Output(self,other,"DIA_Harad_OrcRunning_Done_12_01"); //Хорошо! Тогда не трать слова попусту. Пусть твои дела сами говорят за себя. Info_ClearChoices(DIA_Harad_OrcRunning); }; instance DIA_Harad_OrcSuccess(C_Info) { npc = VLK_412_Harad; nr = 1; condition = DIA_Harad_OrcSuccess_Condition; information = DIA_Harad_OrcSuccess_Info; permanent = FALSE; description = "Я принес тебе оружие орков, как ты хотел."; }; func int DIA_Harad_OrcSuccess_Condition() { if(MIS_Harad_Orc == LOG_Running) { if((Npc_HasItems(other,ItMw_2H_OrcAxe_01) > 0) || (Npc_HasItems(other,ItMw_2H_OrcAxe_02) > 0) || (Npc_HasItems(other,ItMw_2H_OrcAxe_03) > 0) || (Npc_HasItems(other,ItMw_2H_OrcAxe_04) > 0) || (Npc_HasItems(other,ItMw_2H_OrcSword_01) > 0)) { return TRUE; }; }; }; func void DIA_Harad_OrcSuccess_Info() { AI_Output(other,self,"DIA_Harad_OrcSuccess_15_00"); //Я принес тебе оружие орков, как ты хотел. AI_Output(self,other,"DIA_Harad_OrcSuccess_12_01"); //Покажи ... if(Npc_HasItems(other,ItMw_2H_OrcAxe_01) > 0) { B_GiveInvItems(other,self,ItMw_2H_OrcAxe_01,1); } else if(Npc_HasItems(other,ItMw_2H_OrcAxe_02) > 0) { B_GiveInvItems(other,self,ItMw_2H_OrcAxe_02,1); } else if(Npc_HasItems(other,ItMw_2H_OrcAxe_03) > 0) { B_GiveInvItems(other,self,ItMw_2H_OrcAxe_03,1); } else if(Npc_HasItems(other,ItMw_2H_OrcAxe_04) > 0) { B_GiveInvItems(other,self,ItMw_2H_OrcAxe_04,1); } else { B_GiveInvItems(other,self,ItMw_2H_OrcSword_01,1); }; if(Harad_HakonMission == TRUE) { AI_Output(self,other,"DIA_Harad_OrcSuccess_12_02"); //Ты ВСЕ ЖЕ сделал это?! Ты настоящий мужчина! }; AI_Output(self,other,"DIA_Harad_OrcSuccess_12_03"); //Давно уже не держал я подобного оружия в своих руках - с тех пор как был солдатом во время Войны с Орками. AI_Output(self,other,"DIA_Harad_OrcSuccess_12_04"); //Да уж, суровые то были времена, скажу я тебе. if(Player_IsApprentice == APP_Harad) { AI_Output(self,other,"DIA_Harad_OrcSuccess_12_05"); //Я знал, что из тебя получится хороший ученик. Отличная работа! } else if(Player_IsApprentice == APP_NONE) { AI_Output(self,other,"DIA_Harad_OrcSuccess_12_06"); //Я не думал, что тебе удастся это. Я поражен. } else { AI_Output(self,other,"DIA_Harad_OrcSuccess_12_07"); //Жаль, только, что ты выбрал другое ремесло. AI_Output(self,other,"DIA_Harad_OrcSuccess_12_08"); //Ты бы очень пригодился мне. }; MIS_Harad_Orc = LOG_SUCCESS; B_GivePlayerXP(XP_Harad_Orc); B_LogEntry(TOPIC_Lehrling,"Гарад примет меня в ученики, если я смогу получить одобрение других мастеров."); }; var int Harad_StartGuild; instance DIA_Harad_LEHRLING(C_Info) { npc = VLK_412_Harad; nr = 1; condition = DIA_Harad_LEHRLING_Condition; information = DIA_Harad_LEHRLING_Info; permanent = TRUE; description = "Когда я могу стать твоим учеником?"; }; func int DIA_Harad_LEHRLING_Condition() { if(Npc_KnowsInfo(other,DIA_Harad_Arbeit) && (Player_IsApprentice == APP_NONE)) { return TRUE; }; }; func void DIA_Harad_LEHRLING_Info() { var int stimmen; stimmen = 0; AI_Output(other,self,"DIA_Harad_LEHRLING_15_00"); //Когда я могу стать твоим учеником? if((MIS_Harad_Orc == LOG_SUCCESS) || ((MIS_HakonBandits == LOG_SUCCESS) && (Harad_HakonMission == TRUE))) { if(MIS_Harad_Orc == LOG_SUCCESS) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_01"); //Нам здесь совсем не помешал бы человек, способный прикончить орка. if(MIS_HakonBandits == LOG_SUCCESS) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_02"); //Кроме того, Хакон рассказал мне, как ты решил проблему с бандитами. Ты настоящий мужчина! }; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_03"); //Ты не убил орка, но Хакон рассказал мне, как ты решил проблему с бандитами. Это хорошо! }; AI_Output(self,other,"DIA_Harad_LEHRLING_12_04"); //Что касается моего мнения, то ты можешь приступать к работе хоть сейчас. stimmen = stimmen + 1; AI_Output(self,other,"DIA_Harad_LEHRLING_12_05"); //А другие мастера ... if(Thorben.aivar[AIV_TalkedToPlayer] == TRUE) { if(MIS_Thorben_GetBlessings == LOG_SUCCESS) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_06"); //Торбен дал тебе свое благословение. stimmen = stimmen + 1; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_07"); //Старый добрый Торбен хочет, чтобы ты получил благословение богов. Я думаю, это хорошая идея. }; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_08"); //Торбен говорит, что никогда не видел тебя. }; if(Bosper.aivar[AIV_TalkedToPlayer] == TRUE) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_09"); //Боспер пытался оговорить меня от идеи взять тебя в ученики. Он хочет, чтобы ты стал ЕГО учеником. if((MIS_Bosper_Bogen == LOG_SUCCESS) || (MIS_Bosper_WolfFurs == LOG_SUCCESS)) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_10"); //Я имел краткий, но напряженный разговор с ним по этому вопросу. AI_Output(self,other,"DIA_Harad_LEHRLING_12_11"); //В конце концов, он согласился. stimmen = stimmen + 1; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_12"); //Он попросил меня, чтобы я дал тебе возможность хотя бы попробовать себя в его ремесле. AI_Output(self,other,"DIA_Harad_LEHRLING_12_13"); //Попробуй - ты можешь принять решение чуть позже. Если, конечно, тебе нужен его голос. }; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_14"); //Боспер пока не знает, кто ты такой }; if(Constantino.aivar[AIV_TalkedToPlayer] == TRUE) { if(B_GetGreatestPetzCrime(self) == CRIME_NONE) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_15"); //Как всегда, Константино ничего не волнует. Он сказал, что с его точки зрения, ты можешь стать моим учеником в любой момент. stimmen = stimmen + 1; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_16"); //Константино говорит, что ты обвиняешься в преступлении в городе - это правда? AI_Output(self,other,"DIA_Harad_LEHRLING_12_17"); //Если это так, то тебе нужно уладить эту проблему как можно быстрее! }; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_18"); //Константино никогда не слышал о тебе. }; if(Matteo.aivar[AIV_TalkedToPlayer] == TRUE) { if(MIS_Matteo_Gold == LOG_SUCCESS) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_19"); //Маттео говорит, что ты вернул ему его золото. Мне кажется, ты благородный молодой человек. stimmen = stimmen + 1; } else if(MIS_Matteo_Gold == LOG_Running) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_20"); //Маттео говорит, что ты ему что-то должен. Я не знаю, что у вас там за дела, но ты должен урегулировать эту проблему. } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_21"); //Маттео говорит, что никогда не говорил об этом с тобой. }; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_22"); //Маттео говорит, что никогда не видел тебя в своей лавке. }; if(stimmen >= 4) { if(stimmen == 5) { AI_Output(self,other,"DIA_Harad_LEHRLING_12_23"); //Это означает, что ты получил одобрение всех мастеров! } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_24"); //Это означает, что ты получил одобрение четырех мастеров. Этого достаточно, чтобы быть принятым в ученики. }; AI_Output(self,other,"DIA_Harad_LEHRLING_12_25"); //Ты готов стать моим учеником? Info_ClearChoices(DIA_Harad_LEHRLING); Info_AddChoice(DIA_Harad_LEHRLING,"Хорошо - я подумаю над этим.",DIA_Harad_LEHRLING_Later); Info_AddChoice(DIA_Harad_LEHRLING,"Я готов стать твоим учеником!",DIA_Harad_LEHRLING_OK); } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_26"); //Тебе нужно получить одобрение, по крайней мере, четырех мастеров. Иначе ты не сможешь стать учеником в нижней части города. AI_Output(self,other,"DIA_Harad_LEHRLING_12_27"); //Поэтому ты должен поговорить со всеми мастерами, которые еще не уверены в тебе. }; } else { AI_Output(self,other,"DIA_Harad_LEHRLING_12_28"); //Не раньше, чем докажешь мне, что хоть на что-то годен. }; }; func void DIA_Harad_LEHRLING_OK() { AI_Output(other,self,"DIA_Harad_LEHRLING_OK_15_00"); //Я готов! AI_Output(self,other,"DIA_Harad_LEHRLING_OK_12_01"); //Отлично! Я научу тебя ковать хорошие мечи. if(PLAYER_TALENT_SMITH[WEAPON_Common] == TRUE) { AI_Output(other,self,"DIA_Harad_LEHRLING_OK_15_02"); //Я уже умею это! AI_Output(self,other,"DIA_Harad_LEHRLING_OK_12_03"); //Что ж. Тем лучше! }; if(other.attribute[ATR_STRENGTH] < (T_MED - 30)) { AI_Output(self,other,"DIA_Harad_LEHRLING_OK_12_04"); //Кроме того, пришло время стать немного сильнее. Ты чахнешь прямо у меня на глазах! }; Player_IsApprentice = APP_Harad; Npc_ExchangeRoutine(Lothar,"START"); Harad_StartGuild = other.guild; Harad_Lehrling_Day = Wld_GetDay(); Wld_AssignRoomToGuild("schmied",GIL_NONE); MIS_Apprentice = LOG_SUCCESS; B_LogEntry(Topic_Bonus,"Гарад принял меня в ученики. Теперь я смогу попасть в верхний квартал."); B_LogEntry(Topic_Bonus,"Гарад будет покупать оружие, выкованное мной, по хорошей цене."); Log_CreateTopic(TOPIC_CityTeacher,LOG_NOTE); B_GivePlayerXP(XP_Lehrling); B_LogEntry(TOPIC_CityTeacher,"Гарад может обучить меня кузнечному делу. Также он может помочь мне стать сильнее."); Info_ClearChoices(DIA_Harad_LEHRLING); }; func void DIA_Harad_LEHRLING_Later() { AI_Output(other,self,"DIA_Harad_LEHRLING_Later_15_00"); //Хорошо - я подумаю над этим. if(!Npc_IsDead(Brian)) { AI_Output(self,other,"DIA_Harad_LEHRLING_Later_12_01"); //Как знаешь. Брайан все равно еще поработает здесь некоторое время. }; Info_ClearChoices(DIA_Harad_LEHRLING); }; instance DIA_Harad_Zustimmung(C_Info) { npc = VLK_412_Harad; nr = 2; condition = DIA_Harad_Zustimmung_Condition; information = DIA_Harad_Zustimmung_Info; permanent = TRUE; description = "Могу я стать учеником другого мастера?"; }; func int DIA_Harad_Zustimmung_Condition() { if((Player_IsApprentice == APP_NONE) && Npc_KnowsInfo(other,DIA_Harad_Arbeit)) { return TRUE; }; }; var int DIA_Harad_Zustimmung_Permanent; func void DIA_Harad_Zustimmung_Info() { AI_Output(other,self,"DIA_Harad_Zustimmung_15_00"); //Могу я стать учеником другого мастера? if((MIS_Harad_Orc == LOG_SUCCESS) || ((MIS_HakonBandits == LOG_SUCCESS) && (Harad_HakonMission == TRUE))) { AI_Output(self,other,"DIA_Harad_Zustimmung_12_01"); //Ты хороший человек. if(MIS_HakonBandits == LOG_SUCCESS) { AI_Output(self,other,"DIA_Harad_Zustimmung_12_02"); //Хакон рассказал мне, как ты разделался с бандитами. }; AI_Output(self,other,"DIA_Harad_Zustimmung_12_03"); //Я дам тебе свое одобрение. if(DIA_Harad_Zustimmung_Permanent == FALSE) { B_GivePlayerXP(XP_Zustimmung); DIA_Harad_Zustimmung_Permanent = TRUE; }; B_LogEntry(TOPIC_Lehrling,"Гарад даст мне свое одобрение, если я захочу стать учеником другого мастера."); if(!Npc_IsDead(Brian)) { AI_Output(self,other,"DIA_Harad_Zustimmung_12_04"); //Брайан еще поработает здесь некоторое время. И я уверен, что рано или поздно найдется крепкий парень, способный заменить его. }; } else { AI_Output(self,other,"DIA_Harad_Zustimmung_12_05"); //Другие мастера могут дать свое согласие на это. Но я дам сое одобрение только после того, как ты докажешь, что хоть на что-то годен! }; }; var int Harad_MILKommentar; var int Harad_PALKommentar; var int Harad_INNOSKommentar; instance DIA_Harad_AlsLehrling(C_Info) { npc = VLK_412_Harad; nr = 1; condition = DIA_Harad_AlsLehrling_Condition; information = DIA_Harad_AlsLehrling_Info; permanent = TRUE; important = TRUE; }; func int DIA_Harad_AlsLehrling_Condition() { if((Player_IsApprentice == APP_Harad) && Npc_IsInState(self,ZS_Talk)) { return TRUE; }; }; func void DIA_Harad_AlsLehrling_Info() { if((other.guild == GIL_MIL) && (Harad_StartGuild != GIL_MIL) && (Harad_MILKommentar == FALSE)) { AI_Output(self,other,"DIA_Harad_AlsLehrling_12_00"); //Ты теперь служишь в ополчении? Я горжусь тобой! AI_Output(self,other,"DIA_Harad_AlsLehrling_12_01"); //Пока ты служишь в армии, естественно я не могу рассчитывать, что ты будешь выполнять еще и свои обязанности ученика. AI_Output(self,other,"DIA_Harad_AlsLehrling_12_02"); //Но если тебе что-нибудь понадобится, можешь заходить ко мне, когда захочешь. Harad_MILKommentar = TRUE; } else if((other.guild == GIL_PAL) && (Harad_StartGuild != GIL_PAL) && (Harad_PALKommentar == FALSE)) { AI_Output(self,other,"DIA_Harad_AlsLehrling_12_03"); //Тебе удалось стать паладином! AI_Output(self,other,"DIA_Harad_AlsLehrling_12_04"); //Я рад, что когда-то взял тебя в ученики. Даже хотя ты и не проводил много времени за наковальней. Harad_PALKommentar = TRUE; } else if(((other.guild == GIL_NOV) || (other.guild == GIL_KDF)) && (Harad_StartGuild != GIL_NOV) && (Harad_StartGuild != GIL_KDF) && (Harad_INNOSKommentar == FALSE)) { AI_Output(self,other,"DIA_Harad_AlsLehrling_12_05"); //Так ты постригся в монастырь. Я бы предпочел, чтобы ты оставался в городе. Нам нужны сильные люди. AI_Output(self,other,"DIA_Harad_AlsLehrling_12_06"); //Но если ты решил следовать пути Инноса, то так тому и быть. AI_Output(self,other,"DIA_Harad_AlsLehrling_12_07"); //Если тебе будет что-нибудь нужно от меня, я всегда буду рад помочь. Harad_INNOSKommentar = TRUE; } else if((Harad_Lehrling_Day <= (Wld_GetDay() - 4)) && (Harad_MILKommentar == FALSE) && (Harad_PALKommentar == FALSE) && (Harad_INNOSKommentar == FALSE)) { AI_Output(self,other,"DIA_Harad_AlsLehrling_12_08"); //Давненько тебя не было видно здесь. Где ты был все это время, хм? Harad_Lehrling_Day = Wld_GetDay(); } else { AI_Output(self,other,"DIA_Harad_AlsLehrling_12_09"); //Опять ты ... Harad_Lehrling_Day = Wld_GetDay(); }; }; instance DIA_Harad_Waffen(C_Info) { npc = VLK_412_Harad; nr = 3; condition = DIA_Harad_Waffen_Condition; information = DIA_Harad_Waffen_Info; permanent = FALSE; description = "Ты продаешь оружие?"; }; func int DIA_Harad_Waffen_Condition() { if(Kapitel == 1) { return TRUE; }; }; func void DIA_Harad_Waffen_Info() { AI_Output(other,self,"DIA_Harad_Waffen_15_00"); //Ты продаешь оружие? AI_Output(self,other,"DIA_Harad_Waffen_12_01"); //Забудь об этом. Все, что я делаю, уходит паладинам или ополчению. AI_Output(self,other,"DIA_Harad_Add_12_00"); //У меня заказ на 100 мечей от лорда Хагена. Он хочет вооружить городскую стражу. }; instance DIA_Harad_Aufgaben(C_Info) { npc = VLK_412_Harad; nr = 1; condition = DIA_Harad_Aufgaben_Condition; information = DIA_Harad_Aufgaben_Info; permanent = FALSE; description = "Что должен делать ученик?"; }; func int DIA_Harad_Aufgaben_Condition() { if(Player_IsApprentice == APP_Harad) { return TRUE; }; }; func void DIA_Harad_Aufgaben_Info() { AI_Output(other,self,"DIA_Harad_Aufgaben_15_00"); //Что должен делать ученик? AI_Output(self,other,"DIA_Harad_Aufgaben_12_01"); //Три вещи. Попробуй угадать. AI_Output(other,self,"DIA_Harad_Aufgaben_15_02"); //Ковать, ковать и ковать? AI_Output(self,other,"DIA_Harad_Aufgaben_12_03"); //Ты не так уж бестолков, как кажешься. Я плачу за каждый меч. Если ты не работаешь, то и денег не получаешь. Это просто. AI_Output(self,other,"DIA_Harad_Aufgaben_12_05"); //Кроме того, я научу тебя всему, что нужно знать для изготовления обычных мечей. AI_Output(self,other,"DIA_Harad_Aufgaben_12_06"); //Изготовление магических мечей - работа для опытного кузнеца. Тебе до этого еще далеко ... AI_Output(self,other,"DIA_Harad_Aufgaben_12_07"); //Если тебе нужно место для сна, ты можешь прилечь где-нибудь в моем доме. Все понятно? }; instance DIA_Harad_SellBlades(C_Info) { npc = VLK_412_Harad; nr = 200; condition = DIA_Harad_SellBlades_Condition; information = DIA_Harad_SellBlades_Info; permanent = TRUE; description = "Я хочу продать оружие, выкованное мной."; }; func int DIA_Harad_SellBlades_Condition() { if(Player_IsApprentice == APP_Harad) { return TRUE; }; }; func void DIA_Harad_SellBlades_Info() { var C_Item EquipWeap; var int anzahl_common; var int anzahl_schwert1; var int anzahl_schwert4; var int anzahl_rubinklinge; var int anzahl_elbastardo; var int gesamt; var string concatText; var int lohn; AI_Output(other,self,"DIA_Harad_SellBlades_15_00"); //Я хочу продать оружие, выкованное мной. EquipWeap = Npc_GetEquippedMeleeWeapon(other); anzahl_common = Npc_HasItems(other,ItMw_1H_Common_01); if(Hlp_IsItem(EquipWeap,ItMw_1H_Common_01) == TRUE) { anzahl_common = anzahl_common - 1; }; anzahl_schwert1 = Npc_HasItems(other,ItMw_Schwert1); if(Hlp_IsItem(EquipWeap,ItMw_Schwert1) == TRUE) { anzahl_schwert1 = anzahl_schwert1 - 1; }; anzahl_schwert4 = Npc_HasItems(other,ItMw_Schwert4); if(Hlp_IsItem(EquipWeap,ItMw_Schwert4) == TRUE) { anzahl_schwert4 = anzahl_schwert4 - 1; }; anzahl_rubinklinge = Npc_HasItems(other,ItMw_Rubinklinge); if(Hlp_IsItem(EquipWeap,ItMw_Rubinklinge) == TRUE) { anzahl_rubinklinge = anzahl_rubinklinge - 1; }; anzahl_elbastardo = Npc_HasItems(other,ItMw_ElBastardo); if(Hlp_IsItem(EquipWeap,ItMw_ElBastardo) == TRUE) { anzahl_elbastardo = anzahl_elbastardo - 1; }; gesamt = anzahl_common + anzahl_schwert1 + anzahl_schwert4 + anzahl_rubinklinge + anzahl_elbastardo; if(gesamt == 0) { if((Hlp_IsItem(EquipWeap,ItMw_1H_Common_01) == TRUE) || (Hlp_IsItem(EquipWeap,ItMw_Schwert1) == TRUE) || (Hlp_IsItem(EquipWeap,ItMw_Schwert4) == TRUE) || (Hlp_IsItem(EquipWeap,ItMw_Rubinklinge) == TRUE) || (Hlp_IsItem(EquipWeap,ItMw_ElBastardo) == TRUE)) { AI_Output(self,other,"DIA_Harad_SellBlades_12_01"); //Все, что у тебя есть - это меч, висящий на поясе. Ты лучше оставь его себе. } else { AI_Output(self,other,"DIA_Harad_SellBlades_12_04"); //Тогда сделай его! Я принимаю только обычные мечи. }; } else { AI_Output(self,other,"DIA_Harad_SellBlades_12_02"); //Хорошо - давай сюда. Npc_RemoveInvItems(other,ItMw_1H_Common_01,anzahl_common); Npc_RemoveInvItems(other,ItMw_Schwert1,anzahl_schwert1); Npc_RemoveInvItems(other,ItMw_Schwert4,anzahl_schwert4); Npc_RemoveInvItems(other,ItMw_Rubinklinge,anzahl_rubinklinge); Npc_RemoveInvItems(other,ItMw_ElBastardo,anzahl_elbastardo); concatText = ConcatStrings(IntToString(gesamt),PRINT_ItemsGegeben); AI_PrintScreen(concatText,-1,YPOS_ItemGiven,FONT_ScreenSmall,2); AI_Output(self,other,"DIA_Harad_SellBlades_12_03"); //Отлично. Держи, что заработал. lohn = (anzahl_common * Value_Common1) + (anzahl_schwert1 * Value_Schwert1) + (anzahl_schwert4 * Value_Schwert4) + (anzahl_rubinklinge * Value_Rubinklinge) + (anzahl_elbastardo * Value_ElBastardo); lohn = lohn / 3; B_GiveInvItems(self,other,ItMi_Gold,lohn); }; }; func void B_Harad_TeachSmith() { AI_Output(self,other,"DIA_Harad_TeachCommon_12_01"); //Это довольно просто, парень. Берешь кусок сырой стали, и держишь его над огнем, пока он не раскалится. AI_Output(self,other,"DIA_Harad_TeachCommon_12_02"); //Потом придаешь клинку форму на наковальне. }; func void B_HaradSmithChoices() { Info_ClearChoices(DIA_Harad_TeachSmith); Info_AddChoice(DIA_Harad_TeachSmith,Dialog_Back,DIA_Harad_TeachSmith_BACK); if((PLAYER_TALENT_SMITH[WEAPON_1H_Harad_04] == FALSE) && (PLAYER_TALENT_SMITH[WEAPON_1H_Harad_03] == TRUE)) { Info_AddChoice(DIA_Harad_TeachSmith,B_BuildLearnString(NAME_Addon_Harad_04,B_GetLearnCostTalent(other,NPC_TALENT_SMITH,WEAPON_1H_Harad_04)),DIA_Harad_TeachSmith_Harad04); }; if((PLAYER_TALENT_SMITH[WEAPON_1H_Harad_03] == FALSE) && (PLAYER_TALENT_SMITH[WEAPON_1H_Harad_02] == TRUE)) { Info_AddChoice(DIA_Harad_TeachSmith,B_BuildLearnString(NAME_Addon_Harad_03,B_GetLearnCostTalent(other,NPC_TALENT_SMITH,WEAPON_1H_Harad_03)),DIA_Harad_TeachSmith_Harad03); }; if((PLAYER_TALENT_SMITH[WEAPON_1H_Harad_02] == FALSE) && (PLAYER_TALENT_SMITH[WEAPON_1H_Harad_01] == TRUE)) { Info_AddChoice(DIA_Harad_TeachSmith,B_BuildLearnString(NAME_Addon_Harad_02,B_GetLearnCostTalent(other,NPC_TALENT_SMITH,WEAPON_1H_Harad_02)),DIA_Harad_TeachSmith_Harad02); }; if((PLAYER_TALENT_SMITH[WEAPON_1H_Harad_01] == FALSE) && (PLAYER_TALENT_SMITH[WEAPON_Common] == TRUE)) { Info_AddChoice(DIA_Harad_TeachSmith,B_BuildLearnString(NAME_Addon_Harad_01,B_GetLearnCostTalent(other,NPC_TALENT_SMITH,WEAPON_1H_Harad_01)),DIA_Harad_TeachSmith_Harad01); }; if(PLAYER_TALENT_SMITH[WEAPON_Common] == FALSE) { Info_AddChoice(DIA_Harad_TeachSmith,B_BuildLearnString("Научиться ковать.",B_GetLearnCostTalent(other,NPC_TALENT_SMITH,WEAPON_Common)),DIA_Harad_TeachSmith_Common); }; }; instance DIA_Harad_TeachSmith(C_Info) { npc = VLK_412_Harad; nr = 50; condition = DIA_Harad_TeachSmith_Condition; information = DIA_Harad_TeachSmith_Info; permanent = TRUE; description = "Научи меня ковать хорошие мечи!"; }; func int DIA_Harad_TeachSmith_Condition() { if(Player_IsApprentice == APP_Harad) { if((PLAYER_TALENT_SMITH[WEAPON_Common] == FALSE) || (PLAYER_TALENT_SMITH[WEAPON_1H_Harad_01] == FALSE) || (PLAYER_TALENT_SMITH[WEAPON_1H_Harad_02] == FALSE) || (PLAYER_TALENT_SMITH[WEAPON_1H_Harad_03] == FALSE) || (PLAYER_TALENT_SMITH[WEAPON_1H_Harad_04] == FALSE)) { return TRUE; }; }; }; func void DIA_Harad_TeachSmith_Info() { AI_Output(other,self,"DIA_Harad_TeachCommon_15_00"); //Научи меня ковать хорошие мечи! B_HaradSmithChoices(); }; func void DIA_Harad_TeachSmith_BACK() { Info_ClearChoices(DIA_Harad_TeachSmith); }; func void DIA_Harad_TeachSmith_Common() { if(B_TeachPlayerTalentSmith(self,other,WEAPON_Common)) { B_Harad_TeachSmith(); AI_Output(self,other,"DIA_Harad_TeachCommon_12_03"); //Твой первый меч конечно не станет произведением искусства, но всему остальному ты научишься чуть позже. }; B_HaradSmithChoices(); }; func void DIA_Harad_TeachSmith_Harad01() { if(B_TeachPlayerTalentSmith(self,other,WEAPON_1H_Harad_01)) { B_Harad_TeachSmith(); }; B_HaradSmithChoices(); }; func void DIA_Harad_TeachSmith_Harad02() { if(B_TeachPlayerTalentSmith(self,other,WEAPON_1H_Harad_02)) { B_Harad_TeachSmith(); }; B_HaradSmithChoices(); }; func void DIA_Harad_TeachSmith_Harad03() { if(B_TeachPlayerTalentSmith(self,other,WEAPON_1H_Harad_03)) { B_Harad_TeachSmith(); }; B_HaradSmithChoices(); }; func void DIA_Harad_TeachSmith_Harad04() { if(B_TeachPlayerTalentSmith(self,other,WEAPON_1H_Harad_04)) { B_Harad_TeachSmith(); }; B_HaradSmithChoices(); }; var int Harad_Merke_STR; instance DIA_Harad_TeachSTR(C_Info) { npc = VLK_412_Harad; nr = 100; condition = DIA_Harad_TeachSTR_Condition; information = DIA_Harad_TeachSTR_Info; permanent = 1; description = "Я хочу стать сильнее!"; }; func int DIA_Harad_TeachSTR_Condition() { if(Player_IsApprentice == APP_Harad) { return TRUE; }; }; func void DIA_Harad_TeachSTR_Info() { AI_Output(other,self,"DIA_Harad_TeachSTR_15_00"); //Я хочу стать сильнее! Harad_Merke_STR = other.attribute[ATR_STRENGTH]; Info_ClearChoices(DIA_Harad_TeachSTR); Info_AddChoice(DIA_Harad_TeachSTR,Dialog_Back,DIA_Harad_TeachSTR_BACK); Info_AddChoice(DIA_Harad_TeachSTR,B_BuildLearnString(PRINT_LearnSTR1,B_GetLearnCostAttribute(other,ATR_STRENGTH)),DIA_Harad_TeachSTR_1); Info_AddChoice(DIA_Harad_TeachSTR,B_BuildLearnString(PRINT_LearnSTR5,B_GetLearnCostAttribute(other,ATR_STRENGTH) * 5),DIA_Harad_TeachSTR_5); }; func void DIA_Harad_TeachSTR_BACK() { if(Harad_Merke_STR < other.attribute[ATR_STRENGTH]) { AI_Output(self,other,"DIA_Harad_TeachSTR_BACK_12_01"); //Ты уже нарастил немного мускулов. }; if(other.attribute[ATR_STRENGTH] < T_MED) { AI_Output(self,other,"DIA_Harad_TeachSTR_BACK_12_02"); //Возвращайся, если хочешь поучиться еще. }; Info_ClearChoices(DIA_Harad_TeachSTR); }; func void DIA_Harad_TeachSTR_1() { B_TeachAttributePoints(self,other,ATR_STRENGTH,1,T_MED); Info_ClearChoices(DIA_Harad_TeachSTR); Info_AddChoice(DIA_Harad_TeachSTR,Dialog_Back,DIA_Harad_TeachSTR_BACK); Info_AddChoice(DIA_Harad_TeachSTR,B_BuildLearnString(PRINT_LearnSTR1,B_GetLearnCostAttribute(other,ATR_STRENGTH)),DIA_Harad_TeachSTR_1); Info_AddChoice(DIA_Harad_TeachSTR,B_BuildLearnString(PRINT_LearnSTR5,B_GetLearnCostAttribute(other,ATR_STRENGTH) * 5),DIA_Harad_TeachSTR_5); }; func void DIA_Harad_TeachSTR_5() { B_TeachAttributePoints(self,other,ATR_STRENGTH,5,T_MED); Info_ClearChoices(DIA_Harad_TeachSTR); Info_AddChoice(DIA_Harad_TeachSTR,Dialog_Back,DIA_Harad_TeachSTR_BACK); Info_AddChoice(DIA_Harad_TeachSTR,B_BuildLearnString(PRINT_LearnSTR1,B_GetLearnCostAttribute(other,ATR_STRENGTH)),DIA_Harad_TeachSTR_1); Info_AddChoice(DIA_Harad_TeachSTR,B_BuildLearnString(PRINT_LearnSTR5,B_GetLearnCostAttribute(other,ATR_STRENGTH) * 5),DIA_Harad_TeachSTR_5); }; instance DIA_Harad_ImmerNoch(C_Info) { npc = VLK_412_Harad; nr = 3; condition = DIA_Harad_ImmerNoch_Condition; information = DIA_Harad_ImmerNoch_Info; permanent = FALSE; description = "Ты все еще работаешь на паладинов?"; }; func int DIA_Harad_ImmerNoch_Condition() { if(Kapitel >= 2) { return TRUE; }; }; func void DIA_Harad_ImmerNoch_Info() { AI_Output(other,self,"DIA_Harad_Add_15_01"); //Ты все еще работаешь на паладинов? AI_Output(self,other,"DIA_Harad_Add_12_02"); //Я закончил заказ лорда Хагена. AI_Output(self,other,"DIA_Harad_Add_12_03"); //Теперь я делаю доля него мечи из магической руды - но на этот раз за плату. AI_Output(self,other,"DIA_Harad_Add_12_04"); //Но теперь у меня также есть время, чтобы делать оружие для торговцев на рыночной площади. AI_Output(self,other,"DIA_Harad_Add_12_05"); //Так что если ты ищешь хороший меч, обратись к ним. }; instance DIA_Harad_AboutErzklingen(C_Info) { npc = VLK_412_Harad; nr = 3; condition = DIA_Harad_AboutErzklingen_Condition; information = DIA_Harad_AboutErzklingen_Info; permanent = FALSE; description = "Расскажи мне о мечах из магической руды!"; }; func int DIA_Harad_AboutErzklingen_Condition() { if(Npc_KnowsInfo(other,DIA_Harad_ImmerNoch)) { return TRUE; }; }; func void DIA_Harad_AboutErzklingen_Info() { AI_Output(other,self,"DIA_Harad_Add_15_06"); //Расскажи мне о мечах из магической руды! AI_Output(self,other,"DIA_Harad_Waffen_12_02"); //Создание магического меча - очень сложный и дорогой процесс, но в результате получается очень удобный и практически не тупящийся меч. AI_Output(self,other,"DIA_Harad_Waffen_12_03"); //Это очень хороший меч, но все его достоинства раскрываются только в руках паладина. AI_Output(self,other,"DIA_Harad_Waffen_12_04"); //Меч паладина освящается самим Инносом. В результате, он становится зачарованным оружием, наносящим огромный урон врагу! }; instance DIA_Harad_Erzklingen(C_Info) { npc = VLK_412_Harad; nr = 3; condition = DIA_Harad_Erzklingen_Condition; information = DIA_Harad_Erzklingen_Info; permanent = TRUE; description = "Я хочу купить меч из магической руды."; }; func int DIA_Harad_Erzklingen_Condition() { if((OreBladeBought == FALSE) && Npc_KnowsInfo(other,DIA_Harad_AboutErzklingen)) { return TRUE; }; }; var int OreBladeBought; func void DIA_Harad_Erzklingen_Info() { AI_Output(other,self,"DIA_Harad_Erzklingen_15_00"); //Я хочу купить меч из магической руды. if(hero.guild != GIL_PAL) { AI_Output(self,other,"DIA_Harad_Erzklingen_12_01"); //Я подаю магические мечи только паладинам. И только по одному в одни руки. } else { AI_Output(self,other,"DIA_Harad_Erzklingen_12_02"); //Вы, паладины, можете считать себя счастливчиками, что вам дозволено владеть такими превосходными мечами. AI_Output(self,other,"DIA_Harad_Erzklingen_12_03"); //Согласно декрету лорда Хагена, я могу продать тебе только одно магическое оружие. AI_Output(self,other,"DIA_Harad_Erzklingen_12_04"); //Так, что я могу предложить тебе? Info_ClearChoices(DIA_Harad_Erzklingen); Info_AddChoice(DIA_Harad_Erzklingen,Dialog_Back,DIA_Harad_Erzklingen_Back); Info_AddChoice(DIA_Harad_Erzklingen,"Двуручный меч (2000 золота)",DIA_Harad_Erzklingen_2h); Info_AddChoice(DIA_Harad_Erzklingen,"Одноручный меч (2000 золота)",DIA_Harad_Erzklingen_1h); }; }; func void DIA_Harad_Erzklingen_Back() { Info_ClearChoices(DIA_Harad_Erzklingen); }; func void B_Harad_NotEnoughGold() { AI_Output(self,other,"B_Harad_NotEnoughGold_12_00"); //У тебя недостаточно золота. }; func void B_Harad_HaveFunWithYourSword() { AI_Output(self,other,"B_Harad_HaveGunWithYourSword_12_00"); //Береги свое новое оружие. Оно стоит целое состояние. OreBladeBought = TRUE; Info_ClearChoices(DIA_Harad_Erzklingen); }; func void DIA_Harad_Erzklingen_2h() { AI_Output(other,self,"DIA_Harad_Erzklingen_2h_15_00"); //Я возьму двуручный меч! if(Npc_HasItems(other,ItMi_Gold) >= Value_Blessed_2H_1) { B_GiveInvItems(other,self,ItMi_Gold,Value_Blessed_2H_1); CreateInvItems(self,ItMw_2H_Blessed_01,1); B_GiveInvItems(self,other,ItMw_2H_Blessed_01,1); B_Harad_HaveFunWithYourSword(); } else { B_Harad_NotEnoughGold(); Info_ClearChoices(DIA_Harad_Erzklingen); Info_AddChoice(DIA_Harad_Erzklingen,Dialog_Back,DIA_Harad_Erzklingen_Back); Info_AddChoice(DIA_Harad_Erzklingen,"Двуручный меч (2000 золота)",DIA_Harad_Erzklingen_2h); Info_AddChoice(DIA_Harad_Erzklingen,"Одноручный меч (2000 золота)",DIA_Harad_Erzklingen_1h); }; }; func void DIA_Harad_Erzklingen_1h() { AI_Output(other,self,"DIA_Harad_Erzklingen_1h_15_00"); //Я возьму одноручный меч! if(Npc_HasItems(other,ItMi_Gold) >= Value_Blessed_1H_1) { B_GiveInvItems(other,self,ItMi_Gold,Value_Blessed_1H_1); CreateInvItems(self,ItMw_1H_Blessed_01,1); B_GiveInvItems(self,other,ItMw_1H_Blessed_01,1); B_Harad_HaveFunWithYourSword(); } else { B_Harad_NotEnoughGold(); Info_ClearChoices(DIA_Harad_Erzklingen); Info_AddChoice(DIA_Harad_Erzklingen,Dialog_Back,DIA_Harad_Erzklingen_Back); Info_AddChoice(DIA_Harad_Erzklingen,"Двуручный меч (2000 золота)",DIA_Harad_Erzklingen_2h); Info_AddChoice(DIA_Harad_Erzklingen,"Одноручный меч (2000 золота)",DIA_Harad_Erzklingen_1h); }; }; instance DIA_Harad_RepairNecklace(C_Info) { npc = VLK_412_Harad; nr = 8; condition = DIA_Harad_RepairNecklace_Condition; information = DIA_Harad_RepairNecklace_Info; permanent = FALSE; description = "Ты можешь ремонтировать ювелирные изделия?"; }; func int DIA_Harad_RepairNecklace_Condition() { if((MIS_Bennet_InnosEyeRepairedSetting != LOG_SUCCESS) && (Npc_HasItems(other,ItMi_InnosEye_Broken_Mis) || (MIS_SCKnowsInnosEyeIsBroken == TRUE))) { return TRUE; }; }; func void DIA_Harad_RepairNecklace_Info() { AI_Output(other,self,"DIA_Harad_RepairNecklace_15_00"); //Ты можешь синить драгоценности? AI_Output(self,other,"DIA_Harad_RepairNecklace_12_01"); //Я оружейник, а не ювелир. Пожалуй, здесь в городе ты не найдешь никого, кто мог бы помочь тебе. AI_Output(self,other,"DIA_Harad_RepairNecklace_12_02"); //Сейчас мало у кого водятся деньги, и давно уже никому не удавалось разбогатеть здесь. AI_Output(self,other,"DIA_Harad_RepairNecklace_12_03"); //Большинство радо хотя бы тому, что им хватает на хлеб. MIS_SCKnowsInnosEyeIsBroken = TRUE; }; instance DIA_Harad_Goldsmith(C_Info) { npc = VLK_412_Harad; nr = 8; condition = DIA_Harad_Goldsmith_Condition; information = DIA_Harad_Goldsmith_Info; permanent = FALSE; description = "Где мне найти ювелира?"; }; func int DIA_Harad_Goldsmith_Condition() { if(Npc_KnowsInfo(other,DIA_Harad_RepairNecklace)) { return TRUE; }; }; func void DIA_Harad_Goldsmith_Info() { AI_Output(other,self,"DIA_Harad_Goldsmith_15_00"); //Где мне найти ювелира? AI_Output(self,other,"DIA_Harad_Goldsmith_12_01"); //Я слышал, что у наемников на ферме Онара есть хороший кузнец. AI_Output(self,other,"DIA_Harad_Goldsmith_12_02"); //Может, тебе стоит поспрашивать там. }; instance DIA_Harad_PICKPOCKET(C_Info) { npc = VLK_412_Harad; nr = 900; condition = DIA_Harad_PICKPOCKET_Condition; information = DIA_Harad_PICKPOCKET_Info; permanent = TRUE; description = Pickpocket_20; }; func int DIA_Harad_PICKPOCKET_Condition() { return C_Beklauen(14,35); }; func void DIA_Harad_PICKPOCKET_Info() { Info_ClearChoices(DIA_Harad_PICKPOCKET); Info_AddChoice(DIA_Harad_PICKPOCKET,Dialog_Back,DIA_Harad_PICKPOCKET_BACK); Info_AddChoice(DIA_Harad_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Harad_PICKPOCKET_DoIt); }; func void DIA_Harad_PICKPOCKET_DoIt() { B_Beklauen(); Info_ClearChoices(DIA_Harad_PICKPOCKET); }; func void DIA_Harad_PICKPOCKET_BACK() { Info_ClearChoices(DIA_Harad_PICKPOCKET); };
D
INSTANCE Info_Mod_Darrion_Hi (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_Hi_Condition; information = Info_Mod_Darrion_Hi_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Darrion_Hi_Condition() { return 1; }; FUNC VOID Info_Mod_Darrion_Hi_Info() { AI_Output(self, hero, "Info_Mod_Darrion_Hi_11_00"); //Willkommen in meiner Schmiede. AI_Output(self, hero, "Info_Mod_Darrion_Hi_11_01"); //Wenn du ein Schwert brauchst, kannst du es bei mir bekommen. Log_CreateTopic (TOPIC_MOD_HAENDLER_PSICAMP, LOG_NOTE); B_LogEntry (TOPIC_MOD_HAENDLER_PSICAMP, "Darrion verkauft Waffen."); }; INSTANCE Info_Mod_Darrion_Urs (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_Urs_Condition; information = Info_Mod_Darrion_Urs_Info; permanent = 0; important = 0; description = "Schmied, hier dein gesegneter Stahl."; }; FUNC INT Info_Mod_Darrion_Urs_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Darrion_Hi)) && (Npc_KnowsInfo(hero, Info_Mod_Urs_Hi)) && (Npc_HasItems(hero, ItMi_ErzpaketDarrion) == 1) { return 1; }; }; FUNC VOID Info_Mod_Darrion_Urs_Info() { AI_Output(hero, self, "Info_Mod_Darrion_Urs_15_00"); //Schmied, hier dein gesegneter Stahl. B_GiveInvItems (hero, self, ItMi_ErzpaketDarrion, 1); Npc_RemoveInvItems (self, ItMi_ErzpaketDarrion, 1); AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_01"); //(skeptisch) Wirklich? Na, das will ich erst mal die Probe stellen. AI_UseMob (self, "FIRE", 1); AI_Wait (self, 2); AI_UseMob (self, "FIRE", -1); AI_UseMob (self, "ANVIL", 1); AI_Wait (self, 2); AI_UseMob (self, "ANVIL", -1); AI_UseMob (self, "COOL", 1); AI_Wait (self, 2); AI_UseMob (self, "COOL", -1); AI_UseMob (self, "SHARP", 1); AI_Wait (self, 2); AI_UseMob (self, "SHARP", -1); AI_GotoNpc (self, hero); AI_TurnToNpc (self, hero); AI_TurnToNpc (hero, self); AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_02"); //So die Klinge wäre dann schon mal geschafft. Ich bringe sie jetzt Gor Na Ran. AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_03"); //Er soll sie an den besessenen Pflanzen ausprobieren, die Zurzeit wie Unkraut aus dem Boden schießen. AI_Output(hero, self, "Info_Mod_Darrion_Urs_15_04"); //Besessene Pflanzen? AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_05"); //Nunja, ein kleines Experiment, das außer Kontrolle geriet. AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_06"); //Die Baals hatten versucht die Sumpfkrauternte zu steigern, indem sie das Kraut magisch beeinflussten ... mit Zaubern, die Beschwörungen nicht unähnlich sind. AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_07"); //Leider nahm das ganze unkontrollierte, dämonische Auswüchse an. AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_08"); //Das besessene Kraut ist äußerst aggressiv und hartnäckig. Kaum hat man mit Mühe eine Pflanze erledigt, schießt schon wo anders eine neue empor. AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_09"); //Sollte der Stahl tatsächlich die Fähigkeit in sich bergen, Dämonisches zu bannen, wird er den Templern ihre Aufgabe um einiges erleichtern. AI_Output(self, hero, "Info_Mod_Darrion_Urs_11_10"); //Und nun folge mir. AI_StopProcessInfos (self); B_StartOtherRoutine (self, "TOGORNARAN"); }; INSTANCE Info_Mod_Darrion_Urs2 (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_Urs2_Condition; information = Info_Mod_Darrion_Urs2_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Darrion_Urs2_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_GorNaRan_Urs2)) { return 1; }; }; FUNC VOID Info_Mod_Darrion_Urs2_Info() { AI_Output(self, hero, "Info_Mod_Darrion_Urs2_11_00"); //Gut, diese beeindruckende Demonstration des Stahles soll mir genügen. Er ist jeden Krautstängel in diesem Paket hier Wert. B_GiveInvItems (self, hero, ItMi_HerbPaket, 1); AI_Output(self, hero, "Info_Mod_Darrion_Urs2_11_01"); //Ach, nimm diese Stängel hier noch als Bonus ... was zu rauchen für unterwegs. CreateInvItems (hero, ItMi_Addon_Joint_02, 3); CreateInvItems (hero, ItMi_Traumruf, 3); B_ShowGivenThings ("3 Schwarzer Weiser und 3 Traumruf erhalten"); AI_Output(hero, self, "Info_Mod_Darrion_Urs2_15_02"); //Danke. Ich hoffe, ihr habt etwas aus der Sache gelernt. AI_Output(self, hero, "Info_Mod_Darrion_Urs2_11_03"); //Selbstverständlich. So was machen wir nie wieder. Es muss bessere Wege geben, die Krauternte zu steigern. AI_Output(self, hero, "Info_Mod_Darrion_Urs2_11_04"); //Einige unserer Jungs sind gerade auf ganz Khorinis unterwegs und erproben das Wachstum der Pflanzen auf magisch beeinflussten Böden. AI_TurnAway (hero, self); AI_Output(hero, self, "Info_Mod_Darrion_Urs2_15_05"); //(zu sich selbst) Na ja, so meinte ich das eigentlich nicht. Aber was soll’s. AI_Output(self, hero, "DEFAULT"); // B_GivePlayerXP (400); B_LogEntry (TOPIC_MOD_URS_HUND, "So, das Krautpaket aus dem Sumpflager hätte ich."); AI_StopProcessInfos (self); B_StartOtherRoutine (self, "START"); }; INSTANCE Info_Mod_Darrion_Hueterklinge (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_Hueterklinge_Condition; information = Info_Mod_Darrion_Hueterklinge_Info; permanent = 1; important = 0; description = "Schmiede mir einer Hüterklinge!"; }; FUNC INT Info_Mod_Darrion_Hueterklinge_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Angar_Hueterklinge)) && (Mod_TPL_Hueterklinge == 0) { return 1; }; }; FUNC VOID Info_Mod_Darrion_Hueterklinge_Info() { AI_Output(hero, self, "Info_Mod_Darrion_Hueterklinge_15_00"); //Schmiede mir einer Hüterklinge! AI_Output(self, hero, "Info_Mod_Darrion_Hueterklinge_13_01"); //Hast du alle Zutaten? Info_ClearChoices (Info_Mod_Darrion_Hueterklinge); Info_AddChoice (Info_Mod_Darrion_Hueterklinge, DIALOG_BACK, Info_Mod_Darrion_Hueterklinge_BACK); if (Mod_TPL_Hueterklinge_Art == 2) { if (Npc_HasItems(hero, ItMi_Nugget) >= 8) && (Npc_HasItems(hero, ItPl_Health_Herb_01) >= 6) && (Npc_HasItems(hero, ItMw_1H_VLK_Dagger) >= 1) && (Npc_HasItems(hero, ItFo_MuttonRaw) >= 1) { Info_AddChoice (Info_Mod_Darrion_Hueterklinge, "(falsche Zutaten geben)", Info_Mod_Darrion_Hueterklinge_B2); }; if (Npc_HasItems(hero, ItMi_Nugget) >= 8) && (Npc_HasItems(hero, ItPl_Health_Herb_01_Reisfresser) >= 6) && (Npc_HasItems(hero, ItMw_1H_VLK_Dagger_Blut) >= 1) && (Npc_HasItems(hero, ItFo_MuttonRaw_Scav) >= 1) { Info_AddChoice (Info_Mod_Darrion_Hueterklinge, "(richtige Zutaten geben)", Info_Mod_Darrion_Hueterklinge_A2); }; } else { if (Npc_HasItems(hero, ItMi_Nugget) >= 4) && (Npc_HasItems(hero, ItMi_Orkstatuette) >= 1) && (Npc_HasItems(hero, ItAt_SkeletonBone) >= 1) && (Npc_HasItems(hero, ItAt_Teeth) >= 1) { Info_AddChoice (Info_Mod_Darrion_Hueterklinge, "(falsche Zutaten geben)", Info_Mod_Darrion_Hueterklinge_B1); }; if (Npc_HasItems(hero, ItMi_Nugget) >= 4) && (Npc_HasItems(hero, ItMi_Orkstatuette_Stonehenge) >= 1) && (Npc_HasItems(hero, ItAt_SkeletonBone_Herrscher) >= 1) && (Npc_HasItems(hero, ItAt_Teeth_Wolf) >= 1) { Info_AddChoice (Info_Mod_Darrion_Hueterklinge, "(richtige Zutaten geben)", Info_Mod_Darrion_Hueterklinge_A1); }; }; }; FUNC VOID Info_Mod_Darrion_Hueterklinge_BACK() { Info_ClearChoices (Info_Mod_Darrion_Hueterklinge); }; FUNC VOID Info_Mod_Darrion_Hueterklinge_B2() { Npc_RemoveInvItems (hero, ItMi_Nugget, 8); Npc_RemoveInvItems (hero, ItPl_Health_Herb_01, 6); Npc_RemoveInvItems (hero, ItMw_1H_Vlk_Dagger, 1); Npc_RemoveInvItems (hero, ItFo_MuttonRaw, 1); AI_UseMob (self, "FIRE", 1); AI_Wait (self, 2); AI_UseMob (self, "FIRE", -1); AI_UseMob (self, "ANVIL", 1); AI_Wait (self, 2); AI_UseMob (self, "ANVIL", -1); AI_UseMob (self, "COOL", 1); AI_Wait (self, 2); AI_UseMob (self, "COOL", -1); AI_UseMob (self, "SHARP", 1); AI_Wait (self, 2); AI_UseMob (self, "SHARP", -1); AI_GotoNpc (self, hero); AI_TurnToNpc (self, hero); AI_TurnToNpc (hero, self); B_GiveInvItems (self, hero, ItMw_FalscheHueterklinge_2H, 1); B_LogEntry (TOPIC_MOD_SL_SCHMIEDEFEUERN, "Ich habe mir von Darrion eine falsche Hüterklinge schmieden lassen. Ich sollte jetzt mal bei Cor Angar vorstellig werden."); Mod_TPL_Hueterklinge = 2; Info_ClearChoices (Info_Mod_Darrion_Hueterklinge); }; FUNC VOID Info_Mod_Darrion_Hueterklinge_A2() { Npc_RemoveInvItems (hero, ItMi_Nugget, 8); Npc_RemoveInvItems (hero, ItPl_Health_Herb_01_Reisfresser, 6); Npc_RemoveInvItems (hero, ItMw_1H_Vlk_Dagger_Blut, 1); Npc_RemoveInvItems (hero, ItFo_MuttonRaw_Scav, 1); AI_UseMob (self, "FIRE", 1); AI_Wait (self, 2); AI_UseMob (self, "FIRE", -1); AI_UseMob (self, "ANVIL", 1); AI_Wait (self, 2); AI_UseMob (self, "ANVIL", -1); AI_UseMob (self, "COOL", 1); AI_Wait (self, 2); AI_UseMob (self, "COOL", -1); AI_UseMob (self, "SHARP", 1); AI_Wait (self, 2); AI_UseMob (self, "SHARP", -1); AI_GotoNpc (self, hero); AI_TurnToNpc (self, hero); AI_TurnToNpc (hero, self); B_GiveInvItems (self, hero, ItMw_Hueterklinge_2H, 1); B_LogEntry (TOPIC_MOD_SL_SCHMIEDEFEUERN, "Ich habe mir von Darrion eine Hüterklinge schmieden lassen. Ich sollte jetzt mal bei Cor Angar vorstellig werden."); Mod_TPL_Hueterklinge = 3; Info_ClearChoices (Info_Mod_Darrion_Hueterklinge); }; FUNC VOID Info_Mod_Darrion_Hueterklinge_B1() { Npc_RemoveInvItems (hero, ItMi_Nugget, 4); Npc_RemoveInvItems (hero, ItMi_Orkstatuette, 1); Npc_RemoveInvItems (hero, ItAt_SkeletonBone, 1); Npc_RemoveInvItems (hero, ItAt_Teeth, 1); AI_UseMob (self, "FIRE", 1); AI_Wait (self, 2); AI_UseMob (self, "FIRE", -1); AI_UseMob (self, "ANVIL", 1); AI_Wait (self, 2); AI_UseMob (self, "ANVIL", -1); AI_UseMob (self, "COOL", 1); AI_Wait (self, 2); AI_UseMob (self, "COOL", -1); AI_UseMob (self, "SHARP", 1); AI_Wait (self, 2); AI_UseMob (self, "SHARP", -1); AI_GotoNpc (self, hero); AI_TurnToNpc (self, hero); AI_TurnToNpc (hero, self); B_GiveInvItems (self, hero, ItMw_FalscheHueterklinge_1H, 1); B_LogEntry (TOPIC_MOD_SL_SCHMIEDEFEUERN, "Ich habe mir von Darrion eine falsche Hüterklinge schmieden lassen. Ich sollte jetzt mal bei Cor Angar vorstellig werden."); Mod_TPL_Hueterklinge = 2; Info_ClearChoices (Info_Mod_Darrion_Hueterklinge); }; FUNC VOID Info_Mod_Darrion_Hueterklinge_A1() { Npc_RemoveInvItems (hero, ItMi_Nugget, 4); Npc_RemoveInvItems (hero, ItMi_Orkstatuette_Stonehenge, 1); Npc_RemoveInvItems (hero, ItAt_SkeletonBone_Herrscher, 1); Npc_RemoveInvItems (hero, ItAt_Teeth_Wolf, 1); AI_UseMob (self, "FIRE", 1); AI_Wait (self, 2); AI_UseMob (self, "FIRE", -1); AI_UseMob (self, "ANVIL", 1); AI_Wait (self, 2); AI_UseMob (self, "ANVIL", -1); AI_UseMob (self, "COOL", 1); AI_Wait (self, 2); AI_UseMob (self, "COOL", -1); AI_UseMob (self, "SHARP", 1); AI_Wait (self, 2); AI_UseMob (self, "SHARP", -1); AI_GotoNpc (self, hero); AI_TurnToNpc (self, hero); AI_TurnToNpc (hero, self); B_GiveInvItems (self, hero, ItMw_Hueterklinge_1H, 1); B_LogEntry (TOPIC_MOD_SL_SCHMIEDEFEUERN, "Ich habe mir von Darrion eine Hüterklinge schmieden lassen. Ich sollte jetzt mal bei Cor Angar vorstellig werden."); Mod_TPL_Hueterklinge = 3; Info_ClearChoices (Info_Mod_Darrion_Hueterklinge); }; INSTANCE Info_Mod_Darrion_Sumpfmensch (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_Sumpfmensch_Condition; information = Info_Mod_Darrion_Sumpfmensch_Info; permanent = 0; important = 0; description = "Fortuno hat mir erzählt, du hast den heulenden Sumpfmenschen gesehen."; }; FUNC INT Info_Mod_Darrion_Sumpfmensch_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Fortuno_Sumpfmensch)) { return 1; }; }; FUNC VOID Info_Mod_Darrion_Sumpfmensch_Info() { AI_Output(hero, self, "Info_Mod_Darrion_Sumpfmensch_15_00"); //Fortuno hat mir erzählt, du hast den heulenden Sumpfmenschen gesehen. AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_11_01"); //Ja, das habe ich, und es hätte mich beinahe das Leben gekostet! Ich weiß nicht, welchem Gott ich danken soll, aber dass ich noch lebe grenzt an ein Wunder. AI_Output(hero, self, "Info_Mod_Darrion_Sumpfmensch_15_02"); //Wo hast du ihn getroffen? AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_11_03"); //Tief im Sumpf. Ich habe dort früher spezielles Sumpfkraut gepflanzt, das an den Randgebieten einfach nicht gedeiht. AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_11_04"); //Als ich vor einigen Wochen dort nach dem Rechten sehen wollte, stand plötzlich diese Kreatur vor mir. Ich hab mir fast in die Hosen geschissen! AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_11_05"); //Da hab sogar ich alter Seebär mich gefühlt, wie ein kleines Mädchen! AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_11_06"); //Ich hab's den andren gesagt und ich sag's dir: Wenn du diesem Monster jemals begegnen solltest, nimm die Beine in die Hand und renn! B_StartOtherRoutine (Mod_951_PSINOV_Fortuno_MT, "START"); B_StartOtherRoutine (Mod_1339_PSINOV_Novize_MT, "START"); B_StartOtherRoutine (Mod_2008_PSINOV_Ghorim_MT, "START"); B_StartOtherRoutine (Mod_1337_PSINOV_Novize_MT, "START"); B_StartOtherRoutine (Mod_1336_PSINOV_Novize_MT, "START"); B_StartOtherRoutine (Mod_1338_PSINOV_Novize_MT, "START"); Info_ClearChoices (Info_Mod_Darrion_Sumpfmensch); Info_AddChoice (Info_Mod_Darrion_Sumpfmensch, "Wo im Sumpf hast du dein Sumpfkraut gefplanzt?", Info_Mod_Darrion_Sumpfmensch_C); Info_AddChoice (Info_Mod_Darrion_Sumpfmensch, "Du bist früher zur See gefahren?", Info_Mod_Darrion_Sumpfmensch_B); Info_AddChoice (Info_Mod_Darrion_Sumpfmensch, "Was für spezielles Sumpfkraut hast du da gepflanzt?", Info_Mod_Darrion_Sumpfmensch_A); }; FUNC VOID Info_Mod_Darrion_Sumpfmensch_C() { AI_Output(hero, self, "Info_Mod_Darrion_Sumpfmensch_C_15_00"); //Wo im Sumpf hast du dein Sumpfkraut gefplanzt? AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_C_11_01"); //Irgendwo weit drinnen, aber komm ja nicht auf die Idee da zu suchen, Junge, ich sag's nochmals: das Wesen ist gefährlich, das reißt dir den Arsch auf! }; FUNC VOID Info_Mod_Darrion_Sumpfmensch_B() { AI_Output(hero, self, "Info_Mod_Darrion_Sumpfmensch_B_15_00"); //Du bist früher zur See gefahren? AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_B_11_01"); //Ich war früher Pirat, Junge! Und was für einer! AI_Output(hero, self, "Info_Mod_Darrion_Sumpfmensch_B_15_02"); //Warum hast du die Piraten verlassen? AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_B_11_03"); //Ach, ich hatte das Piratendasein satt, Junge. AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_B_11_04"); //Und hier? Hier stampf ich tagsüber etwas Kraut, damit die Muskeln nicht rosten, rauch ein bisschen Sumpfkraut und lass mir den restlichen Tag die Sonne auf den Bauch scheinen. AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_B_11_05"); //Und jetzt lass mich in Ruhe. Info_ClearChoices (Info_Mod_Darrion_Sumpfmensch); AI_StopProcessInfos (self); }; FUNC VOID Info_Mod_Darrion_Sumpfmensch_A() { AI_Output(hero, self, "Info_Mod_Darrion_Sumpfmensch_A_15_00"); //Was für spezielles Sumpfkraut hast du da gepflanzt? AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_A_11_01"); //Das war ganz was Feines, das hab ich aus dem großen Sumpf der ein bisschen von der Piratenbucht entfernt liegt ausgegraben und mitgebracht. AI_Output(self, hero, "Info_Mod_Darrion_Sumpfmensch_A_11_02"); //Musste ein paar ziemlich hässliche Viecher umhaun' um da dran zu kommen. }; INSTANCE Info_Mod_Darrion_Trade (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_Trade_Condition; information = Info_Mod_Darrion_Trade_Info; permanent = 1; important = 0; trade = 1; description = DIALOG_TRADE; }; FUNC INT Info_Mod_Darrion_Trade_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Darrion_Hi)) { return 1; }; }; FUNC VOID Info_Mod_Darrion_Trade_Info() { Backup_Questitems(); B_GiveTradeInv (self); B_Say (hero, self, "$TRADE_1"); }; INSTANCE Info_Mod_Darrion_Pickpocket (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_Pickpocket_Condition; information = Info_Mod_Darrion_Pickpocket_Info; permanent = 1; important = 0; description = Pickpocket_90; }; FUNC INT Info_Mod_Darrion_Pickpocket_Condition() { C_Beklauen (64, ItMiSwordRaw, 5); }; FUNC VOID Info_Mod_Darrion_Pickpocket_Info() { Info_ClearChoices (Info_Mod_Darrion_Pickpocket); Info_AddChoice (Info_Mod_Darrion_Pickpocket, DIALOG_BACK, Info_Mod_Darrion_Pickpocket_BACK); Info_AddChoice (Info_Mod_Darrion_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_Darrion_Pickpocket_DoIt); }; FUNC VOID Info_Mod_Darrion_Pickpocket_BACK() { Info_ClearChoices (Info_Mod_Darrion_Pickpocket); }; FUNC VOID Info_Mod_Darrion_Pickpocket_DoIt() { if (B_Beklauen() == TRUE) { Info_ClearChoices (Info_Mod_Darrion_Pickpocket); } else { Info_ClearChoices (Info_Mod_Darrion_Pickpocket); Info_AddChoice (Info_Mod_Darrion_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_Darrion_Pickpocket_Beschimpfen); Info_AddChoice (Info_Mod_Darrion_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_Darrion_Pickpocket_Bestechung); Info_AddChoice (Info_Mod_Darrion_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_Darrion_Pickpocket_Herausreden); }; }; FUNC VOID Info_Mod_Darrion_Pickpocket_Beschimpfen() { B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN"); B_Say (self, hero, "$DIRTYTHIEF"); Info_ClearChoices (Info_Mod_Darrion_Pickpocket); AI_StopProcessInfos (self); B_Attack (self, hero, AR_Theft, 1); }; FUNC VOID Info_Mod_Darrion_Pickpocket_Bestechung() { B_Say (hero, self, "$PICKPOCKET_BESTECHUNG"); var int rnd; rnd = r_max(99); if (rnd < 25) || ((rnd >= 25) && (rnd < 50) && (Npc_HasItems(hero, ItMi_Gold) < 50)) || ((rnd >= 50) && (rnd < 75) && (Npc_HasItems(hero, ItMi_Gold) < 100)) || ((rnd >= 75) && (rnd < 100) && (Npc_HasItems(hero, ItMi_Gold) < 200)) { B_Say (self, hero, "$DIRTYTHIEF"); Info_ClearChoices (Info_Mod_Darrion_Pickpocket); AI_StopProcessInfos (self); B_Attack (self, hero, AR_Theft, 1); } else { if (rnd >= 75) { B_GiveInvItems (hero, self, ItMi_Gold, 200); } else if (rnd >= 50) { B_GiveInvItems (hero, self, ItMi_Gold, 100); } else if (rnd >= 25) { B_GiveInvItems (hero, self, ItMi_Gold, 50); }; B_Say (self, hero, "$PICKPOCKET_BESTECHUNG_01"); Info_ClearChoices (Info_Mod_Darrion_Pickpocket); AI_StopProcessInfos (self); }; }; FUNC VOID Info_Mod_Darrion_Pickpocket_Herausreden() { B_Say (hero, self, "$PICKPOCKET_HERAUSREDEN"); if (r_max(99) < Mod_Verhandlungsgeschick) { B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_01"); Info_ClearChoices (Info_Mod_Darrion_Pickpocket); } else { B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02"); }; }; INSTANCE Info_Mod_Darrion_EXIT (C_INFO) { npc = Mod_2014_PSINOV_Darrion_MT; nr = 1; condition = Info_Mod_Darrion_EXIT_Condition; information = Info_Mod_Darrion_EXIT_Info; permanent = 1; important = 0; description = DIALOG_ENDE; }; FUNC INT Info_Mod_Darrion_EXIT_Condition() { return 1; }; FUNC VOID Info_Mod_Darrion_EXIT_Info() { AI_StopProcessInfos (self); };
D
module weapon.FlameThrower; import nuclear.Game; import weapon.Weapon; import weapon.AbstractWeapon; import entity.CollidingEntity; import entity.Mattis; import entity.projectile.Projectile; import entity.projectile.Flame; import coreinit.debugout; public class FlameThrower : AbstractWeapon { public this(Mattis[] mattis, int power) { super(mattis, power, "box_flamethrower.png"); } public int getFireDelay() { return 20; } public bool hasAmmo() { return power > 0; } public Projectile[] shoot(int player) { __gshared Projectile[1] result; //Game.playSound(Game.SOUND_FLAMETHROWER, 1.0f, 0.03f); power--; Flame flame = new Flame(mattis[player].getGunX(), mattis[player].getGunY(), mattis[player].getRotation(), mattis[player]); result[0] = flame; return result; } public WeaponSlot getSlot() { return WeaponSlot.SECONDARY; } public Weapon copy() { return new FlameThrower(mattis, power); } public string toString() { return getName();// + " [" + power + "]"; } public string getName() { return "Flamer"; } public double getWeight() { return 1f; } }
D
// Written in the D programming language. /** This module implements the formatting functionality for strings and I/O. It's comparable to C99's $(D vsprintf()) and uses a similar format encoding scheme. Macros: WIKI = Phobos/StdFormat Copyright: Copyright Digital Mars 2000-. License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(WEB digitalmars.com, Walter Bright), $(WEB erdani.com, Andrei Alexandrescu), and Kenji Hara Source: $(PHOBOSSRC std/_format.d) */ module std.format; //debug=format; // uncomment to turn on debugging printf's import core.stdc.stdio, core.stdc.stdlib, core.stdc.string, core.vararg; import std.algorithm, std.array, std.ascii, std.bitmanip, std.conv, std.exception, std.functional, std.math, std.range, std.string, std.system, std.traits, std.typecons, std.typetuple, std.utf; version(unittest) { import std.stdio; import core.exception; } version (Win32) version (DigitalMars) { version = DigitalMarsC; } version (DigitalMarsC) { // This is DMC's internal floating point formatting function extern (C) { extern shared char* function(int c, int flags, int precision, in real* pdval, char* buf, size_t* psl, int width) __pfloatfmt; } } /********************************************************************** * Signals a mismatch between a format and its corresponding argument. */ class FormatException : Exception { this() { super("format error"); } this(string msg, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null) { super(msg, fn, ln, next); } } /++ $(RED Deprecated. It will be removed In January 2013. Please use $(D FormatException) instead.) +/ deprecated alias FormatException FormatError; /********************************************************************** Interprets variadic argument list $(D args), formats them according to $(D fmt), and sends the resulting characters to $(D w). The encoding of the output is the same as $(D Char). type $(D Writer) must satisfy $(XREF range,isOutputRange!(Writer, Char)). The variadic arguments are normally consumed in order. POSIX-style $(WEB opengroup.org/onlinepubs/009695399/functions/printf.html, positional parameter syntax) is also supported. Each argument is formatted into a sequence of chars according to the format specification, and the characters are passed to $(D w). As many arguments as specified in the format string are consumed and formatted. If there are fewer arguments than format specifiers, a $(D FormatException) is thrown. If there are more remaining arguments than needed by the format specification, they are ignored but only if at least one argument was formatted. The format string supports the formatting of array and nested array elements via the grouping format specifiers $(B %&#40;) and $(B %&#41;). Each matching pair of $(B %&#40;) and $(B %&#41;) corresponds with a single array argument. The enclosed sub-format string is applied to individual array elements. The trailing portion of the sub-format string following the conversion specifier for the array element is interpreted as the array delimiter, and is therefore omitted following the last array element. The $(B %|) specifier may be used to explicitly indicate the start of the delimiter, so that the preceding portion of the string will be included following the last array element. (See below for explicit examples.) Params: w = Output is sent to this writer. Typical output writers include $(XREF array,Appender!string) and $(XREF stdio,LockingTextWriter). fmt = Format string. args = Variadic argument list. Returns: Formatted number of arguments. Throws: Mismatched arguments and formats result in a $(D FormatException) being thrown. Format_String: <a name="format-string">$(I Format strings)</a> consist of characters interspersed with $(I format specifications). Characters are simply copied to the output (such as putc) after any necessary conversion to the corresponding UTF-8 sequence. The format string has the following grammar: $(PRE $(I FormatString): $(I FormatStringItem)* $(I FormatStringItem): $(B '%%') $(B '%') $(I Position) $(I Flags) $(I Width) $(I Precision) $(I FormatChar) $(B '%$(LPAREN)') $(I FormatString) $(B '%$(RPAREN)') $(I OtherCharacterExceptPercent) $(I Position): $(I empty) $(I Integer) $(B '$') $(I Flags): $(I empty) $(B '-') $(I Flags) $(B '+') $(I Flags) $(B '#') $(I Flags) $(B '0') $(I Flags) $(B ' ') $(I Flags) $(I Width): $(I empty) $(I Integer) $(B '*') $(I Precision): $(I empty) $(B '.') $(B '.') $(I Integer) $(B '.*') $(I Integer): $(I Digit) $(I Digit) $(I Integer) $(I Digit): $(B '0')|$(B '1')|$(B '2')|$(B '3')|$(B '4')|$(B '5')|$(B '6')|$(B '7')|$(B '8')|$(B '9') $(I FormatChar): $(B 's')|$(B 'b')|$(B 'd')|$(B 'o')|$(B 'x')|$(B 'X')|$(B 'e')|$(B 'E')|$(B 'f')|$(B 'F')|$(B 'g')|$(B 'G')|$(B 'a')|$(B 'A') ) $(BOOKTABLE Flags affect formatting depending on the specifier as follows., $(TR $(TH Flag) $(TH Types&nbsp;affected) $(TH Semantics)) $(TR $(TD $(B '-')) $(TD numeric) $(TD Left justify the result in the field. It overrides any $(B 0) flag.)) $(TR $(TD $(B '+')) $(TD numeric) $(TD Prefix positive numbers in a signed conversion with a $(B +). It overrides any $(I space) flag.)) $(TR $(TD $(B '#')) $(TD integral ($(B 'o'))) $(TD Add to precision as necessary so that the first digit of the octal formatting is a '0', even if both the argument and the $(I Precision) are zero.)) $(TR $(TD $(B '#')) $(TD integral ($(B 'x'), $(B 'X'))) $(TD If non-zero, prefix result with $(B 0x) ($(B 0X)).)) $(TR $(TD $(B '#')) $(TD floating) $(TD Always insert the decimal point and print trailing zeros.)) $(TR $(TD $(B '#')) $(TD numeric ($(B '0'))) $(TD Use leading zeros to pad rather than spaces (except for the floating point values $(D nan) and $(D infinity)). Ignore if there's a $(I Precision).)) $(TR $(TD $(B ' ')) $(TD numeric)) $(TD Prefix positive numbers in a signed conversion with a space.))) <dt>$(I Width) <dd> Specifies the minimum field width. If the width is a $(B *), the next argument, which must be of type $(B int), is taken as the width. If the width is negative, it is as if the $(B -) was given as a $(I Flags) character. <dt>$(I Precision) <dd> Gives the precision for numeric conversions. If the precision is a $(B *), the next argument, which must be of type $(B int), is taken as the precision. If it is negative, it is as if there was no $(I Precision). <dt>$(I FormatChar) <dd> <dl> <dt>$(B 's') <dd>The corresponding argument is formatted in a manner consistent with its type: <dl> <dt>$(B bool) <dd>The result is <tt>'true'</tt> or <tt>'false'</tt>. <dt>integral types <dd>The $(B %d) format is used. <dt>floating point types <dd>The $(B %g) format is used. <dt>string types <dd>The result is the string converted to UTF-8. A $(I Precision) specifies the maximum number of characters to use in the result. <dt>classes derived from $(B Object) <dd>The result is the string returned from the class instance's $(B .toString()) method. A $(I Precision) specifies the maximum number of characters to use in the result. <dt>non-string static and dynamic arrays <dd>The result is [s<sub>0</sub>, s<sub>1</sub>, ...] where s<sub>k</sub> is the kth element formatted with the default format. </dl> <dt>$(B 'c') <dd>The corresponding argument must be a character type. <dt>$(B 'b','d','o','x','X') <dd> The corresponding argument must be an integral type and is formatted as an integer. If the argument is a signed type and the $(I FormatChar) is $(B d) it is converted to a signed string of characters, otherwise it is treated as unsigned. An argument of type $(B bool) is formatted as '1' or '0'. The base used is binary for $(B b), octal for $(B o), decimal for $(B d), and hexadecimal for $(B x) or $(B X). $(B x) formats using lower case letters, $(B X) uppercase. If there are fewer resulting digits than the $(I Precision), leading zeros are used as necessary. If the $(I Precision) is 0 and the number is 0, no digits result. <dt>$(B 'e','E') <dd> A floating point number is formatted as one digit before the decimal point, $(I Precision) digits after, the $(I FormatChar), &plusmn;, followed by at least a two digit exponent: $(I d.dddddd)e$(I &plusmn;dd). If there is no $(I Precision), six digits are generated after the decimal point. If the $(I Precision) is 0, no decimal point is generated. <dt>$(B 'f','F') <dd> A floating point number is formatted in decimal notation. The $(I Precision) specifies the number of digits generated after the decimal point. It defaults to six. At least one digit is generated before the decimal point. If the $(I Precision) is zero, no decimal point is generated. <dt>$(B 'g','G') <dd> A floating point number is formatted in either $(B e) or $(B f) format for $(B g); $(B E) or $(B F) format for $(B G). The $(B f) format is used if the exponent for an $(B e) format is greater than -5 and less than the $(I Precision). The $(I Precision) specifies the number of significant digits, and defaults to six. Trailing zeros are elided after the decimal point, if the fractional part is zero then no decimal point is generated. <dt>$(B 'a','A') <dd> A floating point number is formatted in hexadecimal exponential notation 0x$(I h.hhhhhh)p$(I &plusmn;d). There is one hexadecimal digit before the decimal point, and as many after as specified by the $(I Precision). If the $(I Precision) is zero, no decimal point is generated. If there is no $(I Precision), as many hexadecimal digits as necessary to exactly represent the mantissa are generated. The exponent is written in as few digits as possible, but at least one, is in decimal, and represents a power of 2 as in $(I h.hhhhhh)*2<sup>$(I &plusmn;d)</sup>. The exponent for zero is zero. The hexadecimal digits, x and p are in upper case if the $(I FormatChar) is upper case. </dl> Floating point NaN's are formatted as $(B nan) if the $(I FormatChar) is lower case, or $(B NAN) if upper. Floating point infinities are formatted as $(B inf) or $(B infinity) if the $(I FormatChar) is lower case, or $(B INF) or $(B INFINITY) if upper. </dl> Examples: ------------------------- import std.c.stdio; import std.format; void main() { auto writer = appender!string(); formattedWrite(writer, "%s is the ultimate %s.", 42, "answer"); assert(writer.data == "42 is the ultimate answer."); // Clear the writer writer = appender!string(); formattedWrite(writer, "Date: %2$s %1$s", "October", 5); assert(writer.data == "Date: 5 October"); } ------------------------ The positional and non-positional styles can be mixed in the same format string. (POSIX leaves this behavior undefined.) The internal counter for non-positional parameters tracks the next parameter after the largest positional parameter already used. Example using array and nested array formatting: ------------------------- import std.stdio; void main() { writefln("My items are %(%s %).", [1,2,3]); writefln("My items are %(%s, %).", [1,2,3]); } ------------------------- The output is: <pre class=console> My items are 1 2 3. My items are 1, 2, 3. </pre> The trailing end of the sub-format string following the specifier for each item is interpreted as the array delimiter, and is therefore omitted following the last array item. The $(B %|) delimiter specifier may be used to indicate where the delimiter begins, so that the portion of the format string prior to it will be retained in the last array element: ------------------------- import std.stdio; void main() { writefln("My items are %(-%s-%|, %).", [1,2,3]); } ------------------------- which gives the output: <pre class=console> My items are -1-, -2-, -3-. </pre> These compound format specifiers may be nested in the case of a nested array argument: ------------------------- import std.stdio; void main() { auto mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; writefln("%(%(%d %)\n%)", mat); writeln(); writefln("[%(%(%d %)\n %)]", mat); writeln(); writefln("[%([%(%d %)]%|\n %)]", mat); writeln(); } ------------------------- The output is: <pre class=console> 1 2 3 4 5 6 7 8 9 [1 2 3 4 5 6 7 8 9] [[1 2 3] [4 5 6] [7 8 9]] </pre> Inside a compound format specifier, strings and characters are escaped automatically. To avoid this behavior, add $(B '-') flag to $(D "%$(LPAREN)"). ------------------------- import std.stdio; void main() { writefln("My friends are %s.", ["John", "Nancy"]); writefln("My friends are %(%s, %).", ["John", "Nancy"]); writefln("My friends are %-(%s, %).", ["John", "Nancy"]); } ------------------------- which gives the output: <pre class=console> My friends are ["John", "Nancy"]. My friends are "John", "Nancy". My friends are John, Nancy. </pre> */ uint formattedWrite(Writer, Char, A...)(Writer w, in Char[] fmt, A args) { enum len = args.length; void function(Writer, const(void)*, ref FormatSpec!Char) funs[len] = void; const(void)* argsAddresses[len] = void; if (!__ctfe) { foreach (i, arg; args) { funs[i] = &formatGeneric!(Writer, typeof(arg), Char); // We can safely cast away shared because all data is either // immutable or completely owned by this function. argsAddresses[i] = cast(const(void*)) &args[ i ]; } } // Are we already done with formats? Then just dump each parameter in turn uint currentArg = 0; auto spec = FormatSpec!Char(fmt); while (spec.writeUpToNextSpec(w)) { if (currentArg == funs.length && !spec.indexStart) { // leftover spec? enforceEx!FormatException( fmt.length == 0, text("Orphan format specifier: %", fmt)); break; } if (spec.width == spec.DYNAMIC) { auto width = to!(typeof(spec.width))(getNthInt(currentArg, args)); if (width < 0) { spec.flDash = true; width = -width; } spec.width = width; ++currentArg; } else if (spec.width < 0) { // means: get width as a positional parameter auto index = cast(uint) -spec.width; assert(index > 0); auto width = to!(typeof(spec.width))(getNthInt(index - 1, args)); if (currentArg < index) currentArg = index; if (width < 0) { spec.flDash = true; width = -width; } spec.width = width; } if (spec.precision == spec.DYNAMIC) { auto precision = to!(typeof(spec.precision))( getNthInt(currentArg, args)); if (precision >= 0) spec.precision = precision; // else negative precision is same as no precision else spec.precision = spec.UNSPECIFIED; ++currentArg; } else if (spec.precision < 0) { // means: get precision as a positional parameter auto index = cast(uint) -spec.precision; assert(index > 0); auto precision = to!(typeof(spec.precision))( getNthInt(index- 1, args)); if (currentArg < index) currentArg = index; if (precision >= 0) spec.precision = precision; // else negative precision is same as no precision else spec.precision = spec.UNSPECIFIED; } // Format! if (spec.indexStart > 0) { // using positional parameters! foreach (i; spec.indexStart - 1 .. spec.indexEnd) { if (funs.length <= i) break; if (__ctfe) formatNth(w, spec, i, args); else funs[i](w, argsAddresses[i], spec); } if (currentArg < spec.indexEnd) currentArg = spec.indexEnd; } else { if (__ctfe) formatNth(w, spec, currentArg, args); else funs[currentArg](w, argsAddresses[currentArg], spec); ++currentArg; } } return currentArg; } /** Reads characters from input range $(D r), converts them according to $(D fmt), and writes them to $(D args). Returns: On success, the function returns the number of variables filled. This count can match the expected number of readings or fewer, even zero, if a matching failure happens. Example: ---- string s = "hello!124:34.5"; string a; int b; double c; formattedRead(s, "%s!%s:%s", &a, &b, &c); assert(a == "hello" && b == 124 && c == 34.5); ---- */ uint formattedRead(R, Char, S...)(ref R r, const(Char)[] fmt, S args) { auto spec = FormatSpec!Char(fmt); static if (!S.length) { spec.readUpToNextSpec(r); enforce(spec.trailing.empty); return 0; } else { // The function below accounts for '*' == fields meant to be // read and skipped void skipUnstoredFields() { for (;;) { spec.readUpToNextSpec(r); if (spec.width != spec.DYNAMIC) break; // must skip this field skipData(r, spec); } } skipUnstoredFields(); if (r.empty) { // Input is empty, nothing to read return 0; } alias typeof(*args[0]) A; static if (isTuple!A) { foreach (i, T; A.Types) { (*args[0])[i] = unformatValue!(T)(r, spec); skipUnstoredFields(); } } else { *args[0] = unformatValue!(A)(r, spec); } return 1 + formattedRead(r, spec.trailing, args[1 .. $]); } } unittest { string s = " 1.2 3.4 "; double x, y, z; assert(formattedRead(s, " %s %s %s ", &x, &y, &z) == 2); assert(s.empty); assert(x == 1.2); assert(y == 3.4); assert(isnan(z)); } template FormatSpec(Char) if (!is(Unqual!Char == Char)) { alias FormatSpec!(Unqual!Char) FormatSpec; } /** A General handler for $(D printf) style format specifiers. Used for building more specific formatting functions. Example: ---- auto a = appender!(string)(); auto fmt = "Number: %2.4e\nString: %s"; auto f = FormatSpec!char(fmt); f.writeUpToNextSpec(a); assert(a.data == "Number: "); assert(f.trailing == "\nString: %s"); assert(f.spec == 'e'); assert(f.width == 2); assert(f.precision == 4); f.writeUpToNextSpec(a); assert(a.data == "Number: \nString: "); assert(f.trailing == ""); assert(f.spec == 's'); ---- */ struct FormatSpec(Char) if (is(Unqual!Char == Char)) { /** Minimum _width, default $(D 0). */ int width = 0; /** Precision. Its semantics depends on the argument type. For floating point numbers, _precision dictates the number of decimals printed. */ int precision = UNSPECIFIED; /** Special value for width and precision. $(D DYNAMIC) width or precision means that they were specified with $(D '*') in the format string and are passed at runtime through the varargs. */ enum int DYNAMIC = int.max; /** Special value for precision, meaning the format specifier contained no explicit precision. */ enum int UNSPECIFIED = DYNAMIC - 1; /** The actual format specifier, $(D 's') by default. */ char spec = 's'; /** Index of the argument for positional parameters, from $(D 1) to $(D ubyte.max). ($(D 0) means not used). */ ubyte indexStart; /** Index of the last argument for positional parameter range, from $(D 1) to $(D ubyte.max). ($(D 0) means not used). */ ubyte indexEnd; version(StdDdoc) { /** The format specifier contained a $(D '-') ($(D printf) compatibility). */ bool flDash; /** The format specifier contained a $(D '0') ($(D printf) compatibility). */ bool flZero; /** The format specifier contained a $(D ' ') ($(D printf) compatibility). */ bool flSpace; /** The format specifier contained a $(D '+') ($(D printf) compatibility). */ bool flPlus; /** The format specifier contained a $(D '#') ($(D printf) compatibility). */ bool flHash; // Fake field to allow compilation ubyte allFlags; } else { union { ubyte allFlags; mixin(bitfields!( bool, "flDash", 1, bool, "flZero", 1, bool, "flSpace", 1, bool, "flPlus", 1, bool, "flHash", 1, ubyte, "", 3)); } } /** In case of a compound format specifier starting with $(D "%$(LPAREN)") and ending with $(D "%$(RPAREN)"), $(D _nested) contains the string contained within the two separators. */ const(Char)[] nested; /** In case of a compound format specifier, $(D _sep) contains the string positioning after $(D "%|"). */ const(Char)[] sep; /** $(D _trailing) contains the rest of the format string. */ const(Char)[] trailing; /* This string is inserted before each sequence (e.g. array) formatted (by default $(D "[")). */ enum immutable(Char)[] seqBefore = "["; /* This string is inserted after each sequence formatted (by default $(D "]")). */ enum immutable(Char)[] seqAfter = "]"; /* This string is inserted after each element keys of a sequence (by default $(D ":")). */ enum immutable(Char)[] keySeparator = ":"; /* This string is inserted in between elements of a sequence (by default $(D ", ")). */ enum immutable(Char)[] seqSeparator = ", "; /** Construct a new $(D FormatSpec) using the format string $(D fmt), no processing is done until needed. */ this(in Char[] fmt) { trailing = fmt; } bool writeUpToNextSpec(OutputRange)(OutputRange writer) { if (trailing.empty) return false; for (size_t i = 0; i < trailing.length; ++i) { if (trailing[i] != '%') continue; if (trailing[++i] != '%') { // Spec found. Print, fill up the spec, and bailout put(writer, trailing[0 .. i - 1]); trailing = trailing[i .. $]; fillUp(); return true; } // Doubled! Now print whatever we had, then update the // string and move on put(writer, trailing[0 .. i - 1]); trailing = trailing[i .. $]; i = 0; } // no format spec found put(writer, trailing); trailing = null; return false; } unittest { auto w = appender!(char[])(); auto f = FormatSpec("abc%sdef%sghi"); f.writeUpToNextSpec(w); assert(w.data == "abc", w.data); assert(f.trailing == "def%sghi", text(f.trailing)); f.writeUpToNextSpec(w); assert(w.data == "abcdef", w.data); assert(f.trailing == "ghi"); // test with embedded %%s f = FormatSpec("ab%%cd%%ef%sg%%h%sij"); w.clear(); f.writeUpToNextSpec(w); assert(w.data == "ab%cd%ef" && f.trailing == "g%%h%sij", w.data); f.writeUpToNextSpec(w); assert(w.data == "ab%cd%efg%h" && f.trailing == "ij"); // bug4775 f = FormatSpec("%%%s"); w.clear(); f.writeUpToNextSpec(w); assert(w.data == "%" && f.trailing == ""); f = FormatSpec("%%%%%s%%"); w.clear(); while (f.writeUpToNextSpec(w)) continue; assert(w.data == "%%%"); } private void fillUp() { // Reset content if (__ctfe) { flDash = false; flZero = false; flSpace = false; flPlus = false; flHash = false; } else { allFlags = 0; } width = 0; precision = UNSPECIFIED; nested = null; // Parse the spec (we assume we're past '%' already) for (size_t i = 0; i < trailing.length; ) { switch (trailing[i]) { case '(': // Embedded format specifier. auto j = i + 1; void check(bool condition) { enforce( condition, text("Incorrect format specifier: %", trailing[i .. $])); } // Get the matching balanced paren for (uint innerParens;;) { check(j < trailing.length); if (trailing[j++] != '%') { // skip, we're waiting for %( and %) continue; } if (trailing[j] == '-') // for %-( ++j; // skip if (trailing[j] == ')') { if (innerParens-- == 0) break; } else if (trailing[j] == '|') { if (innerParens == 0) break; } else if (trailing[j] == '(') { ++innerParens; } } if (trailing[j] == '|') { auto k = j; for (++j;;) { if (trailing[j++] != '%') continue; if (trailing[j] == '%') ++j; else if (trailing[j] == ')') break; else throw new Exception( text("Incorrect format specifier: %", trailing[j .. $])); } nested = to!(typeof(nested))(trailing[i + 1 .. k - 1]); sep = to!(typeof(nested))(trailing[k + 1 .. j - 1]); } else { nested = to!(typeof(nested))(trailing[i + 1 .. j - 1]); sep = null; } //this = FormatSpec(innerTrailingSpec); spec = '('; // We practically found the format specifier trailing = trailing[j + 1 .. $]; return; case '-': flDash = true; ++i; break; case '+': flPlus = true; ++i; break; case '#': flHash = true; ++i; break; case '0': flZero = true; ++i; break; case ' ': flSpace = true; ++i; break; case '*': if (isDigit(trailing[++i])) { // a '*' followed by digits and '$' is a // positional format trailing = trailing[1 .. $]; width = -.parse!(typeof(width))(trailing); i = 0; enforceEx!FormatException( trailing[i++] == '$', "$ expected"); } else { // read result width = DYNAMIC; } break; case '1': .. case '9': auto tmp = trailing[i .. $]; const widthOrArgIndex = .parse!(uint)(tmp); enforceEx!FormatException( tmp.length, text("Incorrect format specifier %", trailing[i .. $])); i = tmp.ptr - trailing.ptr; if (tmp.startsWith('$')) { // index of the form %n$ indexEnd = indexStart = to!ubyte(widthOrArgIndex); ++i; } else if (tmp.length && tmp[0] == ':') { // two indexes of the form %m:n$, or one index of the form %m:$ indexStart = to!ubyte(widthOrArgIndex); tmp = tmp[1 .. $]; if (tmp.startsWith('$')) { indexEnd = indexEnd.max; } else { indexEnd = .parse!(typeof(indexEnd))(tmp); } i = tmp.ptr - trailing.ptr; enforceEx!FormatException( trailing[i++] == '$', "$ expected"); } else { // width width = to!int(widthOrArgIndex); } break; case '.': // Precision if (trailing[++i] == '*') { if (isDigit(trailing[++i])) { // a '.*' followed by digits and '$' is a // positional precision trailing = trailing[i .. $]; i = 0; precision = -.parse!int(trailing); enforceEx!FormatException( trailing[i++] == '$', "$ expected"); } else { // read result precision = DYNAMIC; } } else if (trailing[i] == '-') { // negative precision, as good as 0 precision = 0; auto tmp = trailing[i .. $]; .parse!(int)(tmp); // skip digits i = tmp.ptr - trailing.ptr; } else if (isDigit(trailing[i])) { auto tmp = trailing[i .. $]; precision = .parse!int(tmp); i = tmp.ptr - trailing.ptr; } else { // "." was specified, but nothing after it precision = 0; } break; default: // this is the format char spec = cast(char) trailing[i++]; trailing = trailing[i .. $]; return; } // end switch } // end for throw new Exception(text("Incorrect format specifier: ", trailing)); } //-------------------------------------------------------------------------- private bool readUpToNextSpec(R)(ref R r) { // Reset content if (__ctfe) { flDash = false; flZero = false; flSpace = false; flPlus = false; flHash = false; } else { allFlags = 0; } width = 0; precision = UNSPECIFIED; nested = null; // Parse the spec while (trailing.length) { if (*trailing.ptr == '%') { if (trailing.length > 1 && trailing.ptr[1] == '%') { assert(!r.empty); // Require a '%' if (r.front != '%') break; trailing = trailing[2 .. $]; r.popFront(); } else { enforce(isLower(trailing[1]) || trailing[1] == '*' || trailing[1] == '(', text("'%", trailing[1], "' not supported with formatted read")); trailing = trailing[1 .. $]; fillUp(); return true; } } else { if (trailing.ptr[0] == ' ') { while (!r.empty && std.ascii.isWhite(r.front)) r.popFront(); //r = std.algorithm.find!(not!(std.ascii.isWhite))(r); } else { enforce(!r.empty, text("parseToFormatSpec: Cannot find character `", trailing.ptr[0], "' in the input string.")); if (r.front != trailing.front) break; r.popFront(); } trailing = trailing[std.utf.stride(trailing, 0) .. $]; } } return false; } private const string getCurFmtStr() { auto w = appender!string(); auto f = FormatSpec!Char("%s"); // for stringnize put(w, '%'); if (indexStart != 0) formatValue(w, indexStart, f), put(w, '$'); if (flDash) put(w, '-'); if (flZero) put(w, '0'); if (flSpace) put(w, ' '); if (flPlus) put(w, '+'); if (flHash) put(w, '#'); if (width != 0) formatValue(w, width, f); if (precision != FormatSpec!Char.UNSPECIFIED) put(w, '.'), formatValue(w, precision, f); put(w, spec); return w.data; } unittest { // issue 5237 auto w = appender!string(); auto f = FormatSpec!char("%.16f"); f.writeUpToNextSpec(w); // dummy eating assert(f.spec == 'f'); auto fmt = f.getCurFmtStr(); assert(fmt == "%.16f"); } private const(Char)[] headUpToNextSpec() { auto w = appender!(typeof(return))(); auto tr = trailing; while (tr.length) { if (*tr.ptr == '%') { if (tr.length > 1 && tr.ptr[1] == '%') { tr = tr[2 .. $]; w.put('%'); } else break; } else { w.put(tr.front); tr.popFront(); } } return w.data; } string toString() { return text("address = ", cast(void*) &this, "\nwidth = ", width, "\nprecision = ", precision, "\nspec = ", spec, "\nindexStart = ", indexStart, "\nindexEnd = ", indexEnd, "\nflDash = ", flDash, "\nflZero = ", flZero, "\nflSpace = ", flSpace, "\nflPlus = ", flPlus, "\nflHash = ", flHash, "\nnested = ", nested, "\ntrailing = ", trailing, "\n"); } } unittest { //Test the example auto a = appender!(string)(); auto fmt = "Number: %2.4e\nString: %s"; auto f = FormatSpec!char(fmt); f.writeUpToNextSpec(a); assert(a.data == "Number: "); assert(f.trailing == "\nString: %s"); assert(f.spec == 'e'); assert(f.width == 2); assert(f.precision == 4); f.writeUpToNextSpec(a); assert(a.data == "Number: \nString: "); assert(f.trailing == ""); assert(f.spec == 's'); } /** Helper function that returns a $(D FormatSpec) for a single specifier given in $(D fmt) Returns a $(D FormatSpec) with the specifier parsed. Enforces giving only one specifier to the function. */ FormatSpec!Char singleSpec(Char)(Char[] fmt) { enforce(fmt.length >= 2, new Exception("fmt must be at least 2 characters long")); enforce(fmt.front == '%', new Exception("fmt must start with a '%' character")); static struct DummyOutputRange { void put(C)(C[] buf) {} // eat elements } auto a = DummyOutputRange(); auto spec = FormatSpec!Char(fmt); //dummy write spec.writeUpToNextSpec(a); enforce(spec.trailing.empty, new Exception(text("Trailing characters in fmt string: '", spec.trailing))); return spec; } unittest { auto spec = singleSpec("%2.3e"); assert(spec.trailing == ""); assert(spec.spec == 'e'); assert(spec.width == 2); assert(spec.precision == 3); assertThrown(singleSpec("")); assertThrown(singleSpec("2.3e")); assertThrown(singleSpec("%2.3eTest")); } /** $(D bool)s are formatted as "true" or "false" with %s and as "1" or "0" with integral-specific format specs. */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (isBoolean!T && !is(T == enum) && !hasToString!(T, Char)) { BooleanTypeOf!T val = obj; if (f.spec == 's') put(w, val ? "true" : "false"); else formatValue(w, cast(int) val, f); } unittest { formatTest( false, "false" ); formatTest( true, "true" ); class C1 { bool val; alias val this; this(bool v){ val = v; } } class C2 { bool val; alias val this; this(bool v){ val = v; } override string toString() const { return "C"; } } formatTest( new C1(false), "false" ); formatTest( new C1(true), "true" ); formatTest( new C2(false), "C" ); formatTest( new C2(true), "C" ); struct S1 { bool val; alias val this; } struct S2 { bool val; alias val this; string toString() const { return "S"; } } formatTest( S1(false), "false" ); formatTest( S1(true), "true" ); formatTest( S2(false), "S" ); formatTest( S2(true), "S" ); } /** $(D null) literal is formatted as $(D "null"). */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (is(T == typeof(null)) && !is(T == enum) && !hasToString!(T, Char)) { enforceEx!FormatException(f.spec == 's', "null"); put(w, "null"); } unittest { formatTest( null, "null" ); } /** Integrals are formatted like $(D printf) does. */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (isIntegral!T && !is(T == enum) && !hasToString!(T, Char)) { IntegralTypeOf!T val = obj; if (f.spec == 'r') { // raw write, skip all else and write the thing auto begin = cast(const char*) &val; if (std.system.endian == Endian.littleEndian && f.flPlus || std.system.endian == Endian.bigEndian && f.flDash) { // must swap bytes foreach_reverse (i; 0 .. val.sizeof) put(w, begin[i]); } else { foreach (i; 0 .. val.sizeof) put(w, begin[i]); } return; } // Forward on to formatIntegral to handle both T and const(T) // Saves duplication of code for both versions. static if (isSigned!T) formatIntegral(w, cast(long) val, f, Unsigned!(T).max); else formatIntegral(w, cast(ulong) val, f, T.max); } private void formatIntegral(Writer, T, Char)(Writer w, const(T) val, ref FormatSpec!Char f, ulong mask) { FormatSpec!Char fs = f; // fs is copy for change its values. T arg = val; uint base = fs.spec == 'x' || fs.spec == 'X' ? 16 : fs.spec == 'o' ? 8 : fs.spec == 'b' ? 2 : fs.spec == 's' || fs.spec == 'd' || fs.spec == 'u' ? 10 : 0; enforceEx!FormatException( base > 0, "integral"); bool negative = (base == 10 && arg < 0); if (negative) { arg = -arg; } // All unsigned integral types should fit in ulong. formatUnsigned(w, (cast(ulong) arg) & mask, fs, base, negative); } private void formatUnsigned(Writer, Char)(Writer w, ulong arg, ref FormatSpec!Char fs, uint base, bool negative) { if (fs.precision == fs.UNSPECIFIED) { // default precision for integrals is 1 fs.precision = 1; } else { // if a precision is specified, the '0' flag is ignored. fs.flZero = false; } char leftPad = void; if (!fs.flDash && !fs.flZero) leftPad = ' '; else if (!fs.flDash && fs.flZero) leftPad = '0'; else leftPad = 0; // figure out sign and continue in unsigned mode char forcedPrefix = void; if (fs.flPlus) forcedPrefix = '+'; else if (fs.flSpace) forcedPrefix = ' '; else forcedPrefix = 0; if (base != 10) { // non-10 bases are always unsigned forcedPrefix = 0; } else if (negative) { // argument is signed forcedPrefix = '-'; } // fill the digits char[] digits = void; { char buffer[64]; // 64 bits in base 2 at most uint i = buffer.length; auto n = arg; do { --i; buffer[i] = cast(char) (n % base); n /= base; if (buffer[i] < 10) buffer[i] += '0'; else buffer[i] += (fs.spec == 'x' ? 'a' : 'A') - 10; } while (n); digits = buffer[i .. $]; // got the digits without the sign } // adjust precision to print a '0' for octal if alternate format is on if (base == 8 && fs.flHash && (fs.precision <= digits.length)) // too low precision { //fs.precision = digits.length + (arg != 0); forcedPrefix = '0'; } // write left pad; write sign; write 0x or 0X; write digits; // write right pad // Writing left pad sizediff_t spacesToPrint = fs.width // start with the minimum width - digits.length // take away digits to print - (forcedPrefix != 0) // take away the sign if any - (base == 16 && fs.flHash && arg ? 2 : 0); // 0x or 0X const sizediff_t delta = fs.precision - digits.length; if (delta > 0) spacesToPrint -= delta; if (spacesToPrint > 0) // need to do some padding { if (leftPad == '0') { // pad with zeros fs.precision = cast(typeof(fs.precision)) (spacesToPrint + digits.length); //to!(typeof(fs.precision))(spacesToPrint + digits.length); } else if (leftPad) foreach (i ; 0 .. spacesToPrint) put(w, ' '); } // write sign if (forcedPrefix) put(w, forcedPrefix); // write 0x or 0X if (base == 16 && fs.flHash && arg) { // @@@ overcome bug in dmd; //w.write(fs.spec == 'x' ? "0x" : "0X"); //crashes the compiler put(w, '0'); put(w, fs.spec == 'x' ? 'x' : 'X'); // x or X } // write the digits if (arg || fs.precision) { sizediff_t zerosToPrint = fs.precision - digits.length; foreach (i ; 0 .. zerosToPrint) put(w, '0'); put(w, digits); } // write the spaces to the right if left-align if (!leftPad) foreach (i ; 0 .. spacesToPrint) put(w, ' '); } unittest { formatTest( 10, "10" ); class C1 { long val; alias val this; this(long v){ val = v; } } class C2 { long val; alias val this; this(long v){ val = v; } override string toString() const { return "C"; } } formatTest( new C1(10), "10" ); formatTest( new C2(10), "C" ); struct S1 { long val; alias val this; } struct S2 { long val; alias val this; string toString() const { return "S"; } } formatTest( S1(10), "10" ); formatTest( S2(10), "S" ); } /** * Floating-point values are formatted like $(D printf) does. */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (isFloatingPoint!T && !is(T == enum) && !hasToString!(T, Char)) { FormatSpec!Char fs = f; // fs is copy for change its values. FloatingPointTypeOf!T val = obj; if (fs.spec == 'r') { // raw write, skip all else and write the thing auto begin = cast(const char*) &val; if (std.system.endian == Endian.littleEndian && f.flPlus || std.system.endian == Endian.bigEndian && f.flDash) { // must swap bytes foreach_reverse (i; 0 .. val.sizeof) put(w, begin[i]); } else { foreach (i; 0 .. val.sizeof) put(w, begin[i]); } return; } enforceEx!FormatException( std.algorithm.find("fgFGaAeEs", fs.spec).length, "floating"); if (fs.spec == 's') fs.spec = 'g'; char sprintfSpec[1 /*%*/ + 5 /*flags*/ + 3 /*width.prec*/ + 2 /*format*/ + 1 /*\0*/] = void; sprintfSpec[0] = '%'; uint i = 1; if (fs.flDash) sprintfSpec[i++] = '-'; if (fs.flPlus) sprintfSpec[i++] = '+'; if (fs.flZero) sprintfSpec[i++] = '0'; if (fs.flSpace) sprintfSpec[i++] = ' '; if (fs.flHash) sprintfSpec[i++] = '#'; sprintfSpec[i .. i + 3] = "*.*"; i += 3; if (is(Unqual!(typeof(val)) == real)) sprintfSpec[i++] = 'L'; sprintfSpec[i++] = fs.spec; sprintfSpec[i] = 0; //printf("format: '%s'; geeba: %g\n", sprintfSpec.ptr, val); char[512] buf; immutable n = snprintf(buf.ptr, buf.length, sprintfSpec.ptr, fs.width, // negative precision is same as no precision specified fs.precision == fs.UNSPECIFIED ? -1 : fs.precision, val); enforceEx!FormatException( n >= 0, "floating point formatting failure"); put(w, buf[0 .. strlen(buf.ptr)]); } unittest { foreach (T; TypeTuple!(float, double, real)) { formatTest( to!( T)(5.5), "5.5" ); formatTest( to!( const T)(5.5), "5.5" ); formatTest( to!(immutable T)(5.5), "5.5" ); } } unittest { formatTest( 2.25, "2.25" ); class C1 { double val; alias val this; this(double v){ val = v; } } class C2 { double val; alias val this; this(double v){ val = v; } override string toString() const { return "C"; } } formatTest( new C1(2.25), "2.25" ); formatTest( new C2(2.25), "C" ); struct S1 { double val; alias val this; } struct S2 { double val; alias val this; string toString() const { return "S"; } } formatTest( S1(2.25), "2.25" ); formatTest( S2(2.25), "S" ); } /* Formatting a $(D creal) is deprecated but still kept around for a while. */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (is(Unqual!T : creal) && !is(T == enum) && !hasToString!(T, Char)) { creal val = obj; formatValue(w, val.re, f); put(w, '+'); formatValue(w, val.im, f); put(w, 'i'); } unittest { foreach (T; TypeTuple!(cfloat, cdouble, creal)) { formatTest( to!( T)(1 + 1i), "1+1i" ); formatTest( to!( const T)(1 + 1i), "1+1i" ); formatTest( to!(immutable T)(1 + 1i), "1+1i" ); } } unittest { formatTest( 3+2.25i, "3+2.25i" ); class C1 { cdouble val; alias val this; this(cdouble v){ val = v; } } class C2 { cdouble val; alias val this; this(cdouble v){ val = v; } override string toString() const { return "C"; } } formatTest( new C1(3+2.25i), "3+2.25i" ); formatTest( new C2(3+2.25i), "C" ); struct S1 { cdouble val; alias val this; } struct S2 { cdouble val; alias val this; string toString() const { return "S"; } } formatTest( S1(3+2.25i), "3+2.25i" ); formatTest( S2(3+2.25i), "S" ); } /* Formatting an $(D ireal) is deprecated but still kept around for a while. */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (is(Unqual!T : ireal) && !is(T == enum) && !hasToString!(T, Char)) { ireal val = obj; formatValue(w, val.im, f); put(w, 'i'); } unittest { foreach (T; TypeTuple!(ifloat, idouble, ireal)) { formatTest( to!( T)(1i), "1i" ); formatTest( to!( const T)(1i), "1i" ); formatTest( to!(immutable T)(1i), "1i" ); } } unittest { formatTest( 2.25i, "2.25i" ); class C1 { idouble val; alias val this; this(idouble v){ val = v; } } class C2 { idouble val; alias val this; this(idouble v){ val = v; } override string toString() const { return "C"; } } formatTest( new C1(2.25i), "2.25i" ); formatTest( new C2(2.25i), "C" ); struct S1 { idouble val; alias val this; } struct S2 { idouble val; alias val this; string toString() const { return "S"; } } formatTest( S1(2.25i), "2.25i" ); formatTest( S2(2.25i), "S" ); } /** Individual characters ($(D char), $(D wchar), or $(D dchar)) are formatted as Unicode characters with %s and as integers with integral-specific format specs. */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (isSomeChar!T && !is(T == enum) && !hasToString!(T, Char)) { CharTypeOf!T val = obj; if (f.spec == 's' || f.spec == 'c') { put(w, val); } else { formatValue(w, cast(uint) val, f); } } unittest { formatTest( 'c', "c" ); class C1 { char val; alias val this; this(char v){ val = v; } } class C2 { char val; alias val this; this(char v){ val = v; } override string toString() const { return "C"; } } formatTest( new C1('c'), "c" ); formatTest( new C2('c'), "C" ); struct S1 { char val; alias val this; } struct S2 { char val; alias val this; string toString() const { return "S"; } } formatTest( S1('c'), "c" ); formatTest( S2('c'), "S" ); } /** Strings are formatted like $(D printf) does. */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (isSomeString!T && !isStaticArray!T && !is(T == enum) && !hasToString!(T, Char)) { Unqual!(StringTypeOf!T) val = obj; // for `alias this`, see bug5371 formatRange(w, val, f); } unittest { formatTest( "abc", "abc" ); } unittest { // Test for bug 5371 for classes class C1 { const string var; alias var this; this(string s){ var = s; } } class C2 { string var; alias var this; this(string s){ var = s; } } formatTest( new C1("c1"), "c1" ); formatTest( new C2("c2"), "c2" ); // Test for bug 5371 for structs struct S1 { const string var; alias var this; } struct S2 { string var; alias var this; } formatTest( S1("s1"), "s1" ); formatTest( S2("s2"), "s2" ); } unittest { class C3 { string val; alias val this; this(string s){ val = s; } override string toString() const { return "C"; } } formatTest( new C3("c3"), "C" ); struct S3 { string val; alias val this; string toString() const { return "S"; } } formatTest( S3("s3"), "S" ); } /** Static-size arrays are formatted as dynamic arrays. */ void formatValue(Writer, T, Char)(Writer w, auto ref T obj, ref FormatSpec!Char f) if (isStaticArray!T && !is(T == enum) && !hasToString!(T, Char)) { formatValue(w, obj[], f); } unittest // Test for issue 8310 { FormatSpec!char f; auto w = appender!string(); char[2] two = ['a', 'b']; formatValue(w, two, f); char[2] getTwo(){ return two; } formatValue(w, getTwo(), f); } /** Dynamic arrays are formatted as input ranges. Specializations: $(UL $(LI $(D void[]) is formatted like $(D ubyte[]).) $(LI Const array is converted to input range by removing its qualifier.)) */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (isDynamicArray!T && !isSomeString!T && !is(T == enum) && !hasToString!(T, Char)) { static if (is(const(ArrayTypeOf!T) == const(void[]))) { formatValue(w, cast(const ubyte[])obj, f); } else static if (!isInputRange!T) { alias Unqual!(ArrayTypeOf!T) U; static assert(isInputRange!U); U val = obj; formatValue(w, val, f); } else { formatRange(w, obj, f); } } // alias this, input range I/F, and toString() unittest { struct S(uint flags) { int[] arr; static if (flags & 1) alias arr this; static if (flags & 2) { @property bool empty() const { return arr.length == 0; } @property int front() const { return arr[0] * 2; } void popFront() { arr = arr[1..$]; } } static if (flags & 4) string toString() const { return "S"; } } formatTest(S!0b000([0, 1, 2]), "S!(0)([0, 1, 2])"); formatTest(S!0b001([0, 1, 2]), "[0, 1, 2]"); // Test for bug 7628 formatTest(S!0b010([0, 1, 2]), "[0, 2, 4]"); formatTest(S!0b011([0, 1, 2]), "[0, 2, 4]"); formatTest(S!0b100([0, 1, 2]), "S"); formatTest(S!0b101([0, 1, 2]), "S"); // Test for bug 7628 formatTest(S!0b110([0, 1, 2]), "S"); formatTest(S!0b111([0, 1, 2]), "S"); class C(uint flags) { int[] arr; static if (flags & 1) alias arr this; this(int[] a) { arr = a; } static if (flags & 2) { @property bool empty() const { return arr.length == 0; } @property int front() const { return arr[0] * 2; } void popFront() { arr = arr[1..$]; } } static if (flags & 4) override string toString() const { return "C"; } } formatTest(new C!0b000([0, 1, 2]), (new C!0b000([])).toString()); formatTest(new C!0b001([0, 1, 2]), "[0, 1, 2]"); // Test for bug 7628 formatTest(new C!0b010([0, 1, 2]), "[0, 2, 4]"); formatTest(new C!0b011([0, 1, 2]), "[0, 2, 4]"); formatTest(new C!0b100([0, 1, 2]), "C"); formatTest(new C!0b101([0, 1, 2]), "C"); // Test for bug 7628 formatTest(new C!0b110([0, 1, 2]), "C"); formatTest(new C!0b111([0, 1, 2]), "C"); } unittest { // void[] void[] val0; formatTest( val0, "[]" ); void[] val = cast(void[])cast(ubyte[])[1, 2, 3]; formatTest( val, "[1, 2, 3]" ); void[0] sval0 = []; formatTest( sval0, "[]"); void[3] sval = cast(void[3])cast(ubyte[3])[1, 2, 3]; formatTest( sval, "[1, 2, 3]" ); } unittest { // const(T[]) -> const(T)[] const short[] a = [1, 2, 3]; formatTest( a, "[1, 2, 3]" ); struct S { const(int[]) arr; alias arr this; } auto s = S([1,2,3]); formatTest( s, "[1, 2, 3]" ); } unittest { // 6640 struct Range { string value; const @property bool empty(){ return !value.length; } const @property dchar front(){ return value.front(); } void popFront(){ value.popFront(); } const @property size_t length(){ return value.length; } } immutable table = [ ["[%s]", "[string]"], ["[%10s]", "[ string]"], ["[%-10s]", "[string ]"], ["[%(%02x %)]", "[73 74 72 69 6e 67]"], ["[%(%c %)]", "[s t r i n g]"], ]; foreach (e; table) { formatTest(e[0], "string", e[1]); formatTest(e[0], Range("string"), e[1]); } } unittest { // string literal from valid UTF sequence is encoding free. foreach (StrType; TypeTuple!(string, wstring, dstring)) { // Valid and printable (ASCII) formatTest( [cast(StrType)"hello"], `["hello"]` ); // 1 character escape sequences (' is not escaped in strings) formatTest( [cast(StrType)"\"'\\\a\b\f\n\r\t\v"], `["\"'\\\a\b\f\n\r\t\v"]` ); // Valid and non-printable code point (<= U+FF) formatTest( [cast(StrType)"\x00\x10\x1F\x20test"], `["\x00\x10\x1F test"]` ); // Valid and non-printable code point (<= U+FFFF) formatTest( [cast(StrType)"\u200B..\u200F"], `["\u200B..\u200F"]` ); // Valid and non-printable code point (<= U+10FFFF) formatTest( [cast(StrType)"\U000E0020..\U000E007F"], `["\U000E0020..\U000E007F"]` ); } // invalid UTF sequence needs hex-string literal postfix (c/w/d) { // U+FFFF with UTF-8 (Invalid code point for interchange) formatTest( [cast(string)[0xEF, 0xBF, 0xBF]], `[x"EF BF BF"c]` ); // U+FFFF with UTF-16 (Invalid code point for interchange) formatTest( [cast(wstring)[0xFFFF]], `[x"FFFF"w]` ); // U+FFFF with UTF-32 (Invalid code point for interchange) formatTest( [cast(dstring)[0xFFFF]], `[x"FFFF"d]` ); } } unittest { // nested range formatting with array of string formatTest( "%({%(%02x %)}%| %)", ["test", "msg"], `{74 65 73 74} {6d 73 67}` ); } unittest { // stop auto escaping inside range formatting auto arr = ["hello", "world"]; formatTest( "%(%s, %)", arr, `"hello", "world"` ); formatTest( "%-(%s, %)", arr, `hello, world` ); auto aa1 = [1:"hello", 2:"world"]; formatTest( "%(%s:%s, %)", aa1, `1:"hello", 2:"world"` ); formatTest( "%-(%s:%s, %)", aa1, `1:hello, 2:world` ); auto aa2 = [1:["ab", "cd"], 2:["ef", "gh"]]; formatTest( "%-(%s:%s, %)", aa2, `1:["ab", "cd"], 2:["ef", "gh"]` ); formatTest( "%-(%s:%(%s%), %)", aa2, `1:"ab""cd", 2:"ef""gh"` ); formatTest( "%-(%s:%-(%s%)%|, %)", aa2, `1:abcd, 2:efgh` ); } // input range formatting private void formatRange(Writer, T, Char)(ref Writer w, ref T val, ref FormatSpec!Char f) if (isInputRange!T) { // Formatting character ranges like string static if (isSomeChar!(ElementType!T)) if (f.spec == 's') { static if (isSomeString!T) { auto s = val[0 .. f.precision < $ ? f.precision : $]; if (!f.flDash) { // right align if (f.width > s.length) foreach (i ; 0 .. f.width - s.length) put(w, ' '); put(w, s); } else { // left align put(w, s); if (f.width > s.length) foreach (i ; 0 .. f.width - s.length) put(w, ' '); } } else { if (!f.flDash) { static if (hasLength!T) { // right align auto len = val.length; } else static if (isForwardRange!T) { auto len = walkLength(val.save); } else { enforce(f.width == 0, "Cannot right-align a range without length"); size_t len = 0; } if (f.precision != f.UNSPECIFIED && len > f.precision) len = f.precision; if (f.width > len) foreach (i ; 0 .. f.width - len) put(w, ' '); if (f.precision == f.UNSPECIFIED) put(w, val); else { size_t printed = 0; for (; !val.empty && printed < f.precision; val.popFront(), ++printed) put(w, val.front); } } else { size_t printed = void; // left align if (f.precision == f.UNSPECIFIED) { static if (hasLength!T) { printed = val.length; put(w, val); } else { printed = 0; for (; !val.empty; val.popFront(), ++printed) put(w, val.front); } } else { printed = 0; for (; !val.empty && printed < f.precision; val.popFront(), ++printed) put(w, val.front); } if (f.width > printed) foreach (i ; 0 .. f.width - printed) put(w, ' '); } } return; } if (f.spec == 'r') { // raw writes for (size_t i; !val.empty; val.popFront(), ++i) { formatValue(w, val.front, f); } } else if (f.spec == 's') { put(w, f.seqBefore); if (!val.empty) { formatElement(w, val.front, f); val.popFront(); for (size_t i; !val.empty; val.popFront(), ++i) { put(w, f.seqSeparator); formatElement(w, val.front, f); } } static if (!isInfinite!T) put(w, f.seqAfter); } else if (f.spec == '(') { if (val.empty) return; // Nested specifier is to be used for (;;) { auto fmt = FormatSpec!Char(f.nested); fmt.writeUpToNextSpec(w); if (f.flDash) formatValue(w, val.front, fmt); else formatElement(w, val.front, fmt); if (f.sep) { put(w, fmt.trailing); val.popFront(); if (val.empty) break; put(w, f.sep); } else { val.popFront(); if (val.empty) break; put(w, fmt.trailing); } } } else throw new Exception(text("Incorrect format specifier for range: %", f.spec)); } // character formatting with ecaping private void formatChar(Writer)(Writer w, in dchar c, in char quote) { if (std.uni.isGraphical(c)) { if (c == quote || c == '\\') put(w, '\\'), put(w, c); else put(w, c); } else if (c <= 0xFF) { put(w, '\\'); switch (c) { case '\a': put(w, 'a'); break; case '\b': put(w, 'b'); break; case '\f': put(w, 'f'); break; case '\n': put(w, 'n'); break; case '\r': put(w, 'r'); break; case '\t': put(w, 't'); break; case '\v': put(w, 'v'); break; default: formattedWrite(w, "x%02X", cast(uint)c); } } else if (c <= 0xFFFF) formattedWrite(w, "\\u%04X", cast(uint)c); else formattedWrite(w, "\\U%08X", cast(uint)c); } // undocumented // string elements are formatted like UTF-8 string literals. void formatElement(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isSomeString!T && !is(T == enum)) { StringTypeOf!T str = val; // bug 8015 if (f.spec == 's') { try { // ignore other specifications and quote auto app = appender!(typeof(T[0])[])(); put(app, '\"'); for (size_t i = 0; i < str.length; ) { auto c = std.utf.decode(str, i); // \uFFFE and \uFFFF are considered valid by isValidDchar, // so need checking for interchange. if (c == 0xFFFE || c == 0xFFFF) goto LinvalidSeq; formatChar(app, c, '"'); } put(app, '\"'); put(w, app.data()); return; } catch (UTFException) { } // If val contains invalid UTF sequence, formatted like HexString literal LinvalidSeq: static if (is(typeof(str[0]) : const(char))) { enum postfix = 'c'; alias const(ubyte)[] IntArr; } else static if (is(typeof(str[0]) : const(wchar))) { enum postfix = 'w'; alias const(ushort)[] IntArr; } else static if (is(typeof(str[0]) : const(dchar))) { enum postfix = 'd'; alias const(uint)[] IntArr; } formattedWrite(w, "x\"%(%02X %)\"%s", cast(IntArr)str, postfix); } else formatValue(w, str, f); } unittest { // Test for bug 8015 import std.typecons; struct MyStruct { string str; @property string toStr() { return str; } alias toStr this; } Tuple!(MyStruct) t; } // undocumented // character elements are formatted like UTF-8 character literals. void formatElement(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isSomeChar!T && !is(T == enum)) { if (f.spec == 's') { put(w, '\''); formatChar(w, val, '\''); put(w, '\''); } else formatValue(w, val, f); } // undocumented // Maybe T is noncopyable struct, so receive it by 'auto ref'. void formatElement(Writer, T, Char)(Writer w, auto ref T val, ref FormatSpec!Char f) if (!isSomeString!T && !isSomeChar!T || is(T == enum)) { formatValue(w, val, f); } /** Associative arrays are formatted by using $(D ':') and $(D ', ') as separators, and enclosed by $(D '[') and $(D ']'). */ void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f) if (isAssociativeArray!T && !is(T == enum) && !hasToString!(T, Char)) { AssocArrayTypeOf!T val = obj; enforceEx!FormatException( f.spec == 's' || f.spec == '(', "associative"); enum const(Char)[] defSpec = "%s" ~ f.keySeparator ~ "%s" ~ f.seqSeparator; auto fmtSpec = f.spec == '(' ? f.nested : defSpec; size_t i = 0, end = val.length; if (f.spec == 's') put(w, f.seqBefore); foreach (k, ref v; val) { auto fmt = FormatSpec!Char(fmtSpec); fmt.writeUpToNextSpec(w); if (f.flDash) { formatValue(w, k, fmt); fmt.writeUpToNextSpec(w); formatValue(w, v, fmt); } else { formatElement(w, k, fmt); fmt.writeUpToNextSpec(w); formatElement(w, v, fmt); } if (f.sep) { fmt.writeUpToNextSpec(w); if (++i != end) put(w, f.sep); } else { if (++i != end) fmt.writeUpToNextSpec(w); } } if (f.spec == 's') put(w, f.seqAfter); } unittest { int[string] aa0; formatTest( aa0, `[]` ); // elements escaping formatTest( ["aaa":1, "bbb":2, "ccc":3], `["aaa":1, "bbb":2, "ccc":3]` ); formatTest( ['c':"str"], `['c':"str"]` ); formatTest( ['"':"\"", '\'':"'"], `['"':"\"", '\'':"'"]` ); // range formatting for AA auto aa3 = [1:"hello", 2:"world"]; // escape formatTest( "{%(%s:%s $ %)}", aa3, `{1:"hello" $ 2:"world"}`); // use range formatting for key and value, and use %| formatTest( "{%([%04d->%(%c.%)]%| $ %)}", aa3, `{[0001->h.e.l.l.o] $ [0002->w.o.r.l.d]}` ); } unittest { class C1 { int[char] val; alias val this; this(int[char] v){ val = v; } } class C2 { int[char] val; alias val this; this(int[char] v){ val = v; } override string toString() const { return "C"; } } formatTest( new C1(['c':1, 'd':2]), `['c':1, 'd':2]` ); formatTest( new C2(['c':1, 'd':2]), "C" ); struct S1 { int[char] val; alias val this; } struct S2 { int[char] val; alias val this; string toString() const { return "S"; } } formatTest( S1(['c':1, 'd':2]), `['c':1, 'd':2]` ); formatTest( S2(['c':1, 'd':2]), "S" ); } template hasToString(T, Char) { static if(isPointer!T && !isAggregateType!T) { // X* does not have toString, even if X is aggregate type has toString. enum hasToString = 0; } else static if (is(typeof({ T val = void; FormatSpec!Char f; val.toString((const(char)[] s){}, f); }))) { enum hasToString = 4; } else static if (is(typeof({ T val = void; val.toString((const(char)[] s){}, "%s"); }))) { enum hasToString = 3; } else static if (is(typeof({ T val = void; val.toString((const(char)[] s){}); }))) { enum hasToString = 2; } else static if (is(typeof({ T val = void; return val.toString(); }()) S) && isSomeString!S) { enum hasToString = 1; } else { enum hasToString = 0; } } // object formatting with toString private void formatObject(Writer, T, Char)(ref Writer w, ref T val, ref FormatSpec!Char f) if (hasToString!(T, Char)) { static if (is(typeof(val.toString((const(char)[] s){}, f)))) { val.toString((const(char)[] s) { put(w, s); }, f); } else static if (is(typeof(val.toString((const(char)[] s){}, "%s")))) { val.toString((const(char)[] s) { put(w, s); }, f.getCurFmtStr()); } else static if (is(typeof(val.toString((const(char)[] s){})))) { val.toString((const(char)[] s) { put(w, s); }); } else static if (is(typeof(val.toString()) S) && isSomeString!S) { put(w, val.toString()); } else static assert(0); } /** Aggregates ($(D struct), $(D union), $(D class), and $(D interface)) are basically formatted by calling $(D toString). $(D toString) should have one of the following signatures: --- const void toString(scope void delegate(const(char)[]) sink, FormatSpec fmt); const void toString(scope void delegate(const(char)[]) sink, string fmt); const void toString(scope void delegate(const(char)[]) sink); const string toString(); --- For the class objects which have input range interface, $(UL $(LI If the instance $(D toString) has overridden $(D Object.toString), it is used.) $(LI Otherwise, the objects are formatted as input range.)) For the struct and union objects which does not have $(D toString), $(UL $(LI If they have range interface, formatted as input range.) $(LI Otherwise, they are formatted like $(D Type(field1, filed2, ...)).)) Otherwise, are formatted just as their type name. */ void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == class) && !is(T == enum)) { // TODO: Change this once toString() works for shared objects. static assert(!is(T == shared), "unable to format shared objects"); if (val is null) put(w, "null"); else { static if (hasToString!(T, Char) > 1 || (!isInputRange!T && !isBuiltinType!T)) { formatObject!(Writer, T, Char)(w, val, f); } else { //string delegate() dg = &val.toString; Object o = val; // workaround string delegate() dg = &o.toString; if (dg.funcptr != &Object.toString) // toString is overridden { formatObject(w, val, f); } else static if (isInputRange!T) { formatRange(w, val, f); } else static if (is(BuiltinTypeOf!T X)) { X x = val; formatValue(w, x, f); } else { formatObject(w, val, f); } } } } unittest { // class range (issue 5154) auto c = inputRangeObject([1,2,3,4]); formatTest( c, "[1, 2, 3, 4]" ); assert(c.empty); c = null; formatTest( c, "null" ); } unittest { // 5354 // If the class has both range I/F and custom toString, the use of custom // toString routine is prioritized. // Enable the use of custom toString that gets a sink delegate // for class formatting. enum inputRangeCode = q{ int[] arr; this(int[] a){ arr = a; } @property int front() const { return arr[0]; } @property bool empty() const { return arr.length == 0; } void popFront(){ arr = arr[1..$]; } }; class C1 { mixin(inputRangeCode); void toString(scope void delegate(const(char)[]) dg, ref FormatSpec!char f) const { dg("[012]"); } } class C2 { mixin(inputRangeCode); void toString(scope void delegate(const(char)[]) dg, string f) const { dg("[012]"); } } class C3 { mixin(inputRangeCode); void toString(scope void delegate(const(char)[]) dg) const { dg("[012]"); } } class C4 { mixin(inputRangeCode); override string toString() const { return "[012]"; } } class C5 { mixin(inputRangeCode); } formatTest( new C1([0, 1, 2]), "[012]" ); formatTest( new C2([0, 1, 2]), "[012]" ); formatTest( new C3([0, 1, 2]), "[012]" ); formatTest( new C4([0, 1, 2]), "[012]" ); formatTest( new C5([0, 1, 2]), "[0, 1, 2]" ); } /// ditto void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == interface) && (hasToString!(T, Char) || !isBuiltinType!T) && !is(T == enum)) { if (val is null) put(w, "null"); else { static if (hasToString!(T, Char)) { formatObject(w, val, f); } else static if (isInputRange!T) { formatRange(w, val, f); } else { formatValue(w, cast(Object)val, f); } } } unittest { // interface InputRange!int i = inputRangeObject([1,2,3,4]); formatTest( i, "[1, 2, 3, 4]" ); assert(i.empty); i = null; formatTest( i, "null" ); // interface (downcast to Object) interface Whatever {} class C : Whatever { override @property string toString() const { return "ab"; } } Whatever val = new C; formatTest( val, "ab" ); } /// ditto // Maybe T is noncopyable struct, so receive it by 'auto ref'. void formatValue(Writer, T, Char)(Writer w, auto ref T val, ref FormatSpec!Char f) if ((is(T == struct) || is(T == union)) && (hasToString!(T, Char) || !isBuiltinType!T) && !is(T == enum)) { static if (hasToString!(T, Char)) { formatObject(w, val, f); } else static if (isInputRange!T) { formatRange(w, val, f); } else static if (is(T == struct)) { enum left = T.stringof~"("; enum separator = ", "; enum right = ")"; put(w, left); foreach (i, e; val.tupleof) { static if (0 < i && val.tupleof[i-1].offsetof == val.tupleof[i].offsetof) { static if (i == val.tupleof.length - 1 || val.tupleof[i].offsetof != val.tupleof[i+1].offsetof) put(w, separator~val.tupleof[i].stringof[4..$]~"}"); else put(w, separator~val.tupleof[i].stringof[4..$]); } else { static if (i+1 < val.tupleof.length && val.tupleof[i].offsetof == val.tupleof[i+1].offsetof) put(w, (i > 0 ? separator : "")~"#{overlap "~val.tupleof[i].stringof[4..$]); else { static if (i > 0) put(w, separator); formatElement(w, e, f); } } } put(w, right); } else { put(w, T.stringof); } } unittest { // bug 4638 struct U8 { string toString() const { return "blah"; } } struct U16 { wstring toString() const { return "blah"; } } struct U32 { dstring toString() const { return "blah"; } } formatTest( U8(), "blah" ); formatTest( U16(), "blah" ); formatTest( U32(), "blah" ); } unittest { // 3890 struct Int{ int n; } struct Pair{ string s; Int i; } formatTest( Pair("hello", Int(5)), `Pair("hello", Int(5))` ); } unittest { // union formatting without toString union U1 { int n; string s; } U1 u1; formatTest( u1, "U1" ); // union formatting with toString union U2 { int n; string s; string toString() const { return s; } } U2 u2; u2.s = "hello"; formatTest( u2, "hello" ); } unittest { // 7230 static struct Bug7230 { string s = "hello"; union { string a; int b; double c; } long x = 10; } Bug7230 bug; bug.b = 123; FormatSpec!char f; auto w = appender!(char[])(); formatValue(w, bug, f); assert(w.data == `Bug7230("hello", #{overlap a, b, c}, 10)`); } unittest { static struct S{ @disable this(this); } S s; FormatSpec!char f; auto w = appender!string(); formatValue(w, s, f); assert(w.data == "S()"); } /** $(D enum) is formatted like its base value. */ void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == enum)) { if (f.spec == 's') { foreach (i, e; EnumMembers!T) { if (val == e) { formatValue(w, __traits(allMembers, T)[i], f); return; } } // val is not a member of T, output cast(T)rawValue instead. put(w, "cast(" ~ T.stringof ~ ")"); static assert(!is(OriginalType!T == T)); } formatValue(w, cast(OriginalType!T)val, f); } unittest { enum A { first, second, third } formatTest( A.second, "second" ); formatTest( cast(A)72, "cast(A)72" ); } unittest { enum A : string { one = "uno", two = "dos", three = "tres" } formatTest( A.three, "three" ); formatTest( cast(A)"mill\&oacute;n", "cast(A)mill\&oacute;n" ); } unittest { enum A : bool { no, yes } formatTest( A.yes, "yes" ); formatTest( A.no, "no" ); } unittest { // Test for bug 6892 enum Foo { A = 10 } formatTest("%s", Foo.A, "A"); formatTest(">%4s<", Foo.A, "> A<"); formatTest("%04d", Foo.A, "0010"); formatTest("%+2u", Foo.A, "+10"); formatTest("%02x", Foo.A, "0a"); formatTest("%3o", Foo.A, " 12"); formatTest("%b", Foo.A, "1010"); } /** Pointers are formatted as hex integers. */ void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (isPointer!T && !is(T == enum) && !hasToString!(T, Char)) { if (val is null) put(w, "null"); else { static if (isInputRange!T) { formatRange(w, *val, f); } else { const void * p = val; if (f.spec == 's') { FormatSpec!Char fs = f; // fs is copy for change its values. fs.spec = 'X'; formatValue(w, cast(ulong) p, fs); } else { enforceEx!FormatException(f.spec == 'X' || f.spec == 'x', "Expected one of %s, %x or %X for pointer type."); formatValue(w, cast(ulong) p, f); } } } } unittest { // pointer auto r = retro([1,2,3,4]); auto p = &r; formatTest( p, "[4, 3, 2, 1]" ); assert(p.empty); p = null; formatTest( p, "null" ); auto q = cast(void*)0xFFEECCAA; formatTest( q, "FFEECCAA" ); } unittest { // Test for issue 7869 struct S { string toString() const { return ""; } } S* p = null; formatTest( p, "null" ); S* q = cast(S*)0xFFEECCAA; formatTest( q, "FFEECCAA" ); } unittest { // Test for issue 8186 class B { int*a; this(){ a = new int; } alias a this; } formatTest( B.init, "null" ); } /** Delegates are formatted by 'Attributes ReturnType delegate(Parameters)' */ void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == delegate) && !is(T == enum) && !hasToString!(T, Char)) { alias FunctionAttribute FA; if (functionAttributes!T & FA.pure_) formatValue(w, "pure ", f); if (functionAttributes!T & FA.nothrow_) formatValue(w, "nothrow ", f); if (functionAttributes!T & FA.ref_) formatValue(w, "ref ", f); if (functionAttributes!T & FA.property) formatValue(w, "@property ", f); if (functionAttributes!T & FA.trusted) formatValue(w, "@trusted ", f); if (functionAttributes!T & FA.safe) formatValue(w, "@safe ", f); formatValue(w, ReturnType!(T).stringof,f); formatValue(w, " delegate",f); formatValue(w, ParameterTypeTuple!(T).stringof,f); } unittest { void func() {} formatTest( &func, "void delegate()" ); } /* Formatting a $(D typedef) is deprecated but still kept around for a while. */ void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f) if (is(T == typedef)) { static if (is(T U == typedef)) { formatValue(w, cast(U) val, f); } } /* Formats an object of type 'D' according to 'f' and writes it to 'w'. The pointer 'arg' is assumed to point to an object of type 'D'. The untyped signature is for the sake of taking this function's address. */ private void formatGeneric(Writer, D, Char)(Writer w, const(void)* arg, ref FormatSpec!Char f) { formatValue(w, *cast(D*) arg, f); } private void formatNth(Writer, Char, A...)(Writer w, ref FormatSpec!Char f, size_t index, A args) { static string gencode(size_t count)() { string result; foreach (n; 0 .. count) { auto num = to!string(n); result ~= "case "~num~":"~ " formatValue(w, args["~num~"], f);"~ " break;"; } return result; } switch (index) { mixin(gencode!(A.length)()); default: assert(0, "n = "~cast(char)(index + '0')); } } unittest { int[] a = [ 1, 3, 2 ]; formatTest( "testing %(%s & %) embedded", a, "testing 1 & 3 & 2 embedded"); formatTest( "testing %((%s) %)) wyda3", a, "testing (1) (3) (2) wyda3" ); int[0] empt = []; formatTest( "(%s)", empt, "([])" ); } //------------------------------------------------------------------------------ // Fix for issue 1591 private int getNthInt(A...)(uint index, A args) { static if (A.length) { if (index) { return getNthInt(index - 1, args[1 .. $]); } static if (is(typeof(args[0]) : long) || is(typeof(arg) : ulong)) { return to!(int)(args[0]); } else { throw new FormatException("int expected"); } } else { throw new FormatException("int expected"); } } /* ======================== Unit Tests ====================================== */ version(unittest) void formatTest(T)(T val, string expected, size_t ln = __LINE__, string fn = __FILE__) { FormatSpec!char f; auto w = appender!string(); formatValue(w, val, f); enforceEx!AssertError( w.data == expected, text("expected = `", expected, "`, result = `", w.data, "`"), fn, ln); } version(unittest) void formatTest(T)(string fmt, T val, string expected, size_t ln = __LINE__, string fn = __FILE__) { auto w = appender!string(); formattedWrite(w, fmt, val); enforceEx!AssertError( w.data == expected, text("expected = `", expected, "`, result = `", w.data, "`"), fn, ln); } unittest { auto stream = appender!string(); formattedWrite(stream, "%s", 1.1); assert(stream.data == "1.1", stream.data); stream = appender!string(); formattedWrite(stream, "%s", map!"a*a"([2, 3, 5])); assert(stream.data == "[4, 9, 25]", stream.data); // Test shared data. stream = appender!string(); shared int s = 6; formattedWrite(stream, "%s", s); assert(stream.data == "6"); } unittest { auto stream = appender!string(); formattedWrite(stream, "%u", 42); assert(stream.data == "42", stream.data); } unittest { // testing raw writes auto w = appender!(char[])(); uint a = 0x02030405; formattedWrite(w, "%+r", a); assert(w.data.length == 4 && w.data[0] == 2 && w.data[1] == 3 && w.data[2] == 4 && w.data[3] == 5); w.clear(); formattedWrite(w, "%-r", a); assert(w.data.length == 4 && w.data[0] == 5 && w.data[1] == 4 && w.data[2] == 3 && w.data[3] == 2); } unittest { // testing positional parameters auto w = appender!(char[])(); formattedWrite(w, "Numbers %2$s and %1$s are reversed and %1$s%2$s repeated", 42, 0); assert(w.data == "Numbers 0 and 42 are reversed and 420 repeated", w.data); w.clear(); formattedWrite(w, "asd%s", 23); assert(w.data == "asd23", w.data); w.clear(); formattedWrite(w, "%s%s", 23, 45); assert(w.data == "2345", w.data); } unittest { debug(format) printf("std.format.format.unittest\n"); auto stream = appender!(char[])(); //goto here; formattedWrite(stream, "hello world! %s %s ", true, 57, 1_000_000_000, 'x', " foo"); assert(stream.data == "hello world! true 57 ", stream.data); stream.clear(); formattedWrite(stream, "%g %A %s", 1.67, -1.28, float.nan); // std.c.stdio.fwrite(stream.data.ptr, stream.data.length, 1, stderr); /* The host C library is used to format floats. C99 doesn't * specify what the hex digit before the decimal point is for * %A. */ version (linux) { assert(stream.data == "1.67 -0X1.47AE147AE147BP+0 nan", stream.data); } else version (OSX) { assert(stream.data == "1.67 -0X1.47AE147AE147BP+0 nan", stream.data); } else { assert(stream.data == "1.67 -0X1.47AE147AE147BP+0 nan", stream.data); } stream.clear(); formattedWrite(stream, "%x %X", 0x1234AF, 0xAFAFAFAF); assert(stream.data == "1234af AFAFAFAF"); stream.clear(); formattedWrite(stream, "%b %o", 0x1234AF, 0xAFAFAFAF); assert(stream.data == "100100011010010101111 25753727657"); stream.clear(); formattedWrite(stream, "%d %s", 0x1234AF, 0xAFAFAFAF); assert(stream.data == "1193135 2947526575"); stream.clear(); // formattedWrite(stream, "%s", 1.2 + 3.4i); // assert(stream.data == "1.2+3.4i"); // stream.clear(); formattedWrite(stream, "%a %A", 1.32, 6.78f); //formattedWrite(stream, "%x %X", 1.32); assert(stream.data == "0x1.51eb851eb851fp+0 0X1.B1EB86P+2"); stream.clear(); formattedWrite(stream, "%#06.*f",2,12.345); assert(stream.data == "012.35"); stream.clear(); formattedWrite(stream, "%#0*.*f",6,2,12.345); assert(stream.data == "012.35"); stream.clear(); const real constreal = 1; formattedWrite(stream, "%g",constreal); assert(stream.data == "1"); stream.clear(); formattedWrite(stream, "%7.4g:", 12.678); assert(stream.data == " 12.68:"); stream.clear(); formattedWrite(stream, "%7.4g:", 12.678L); assert(stream.data == " 12.68:"); stream.clear(); formattedWrite(stream, "%04f|%05d|%#05x|%#5x",-4.0,-10,1,1); assert(stream.data == "-4.000000|-0010|0x001| 0x1", stream.data); stream.clear(); int i; string s; i = -10; formattedWrite(stream, "%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(stream.data == "-10|-10|-10|-10|-10.0000"); stream.clear(); i = -5; formattedWrite(stream, "%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(stream.data == "-5| -5|-05|-5|-5.0000"); stream.clear(); i = 0; formattedWrite(stream, "%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(stream.data == "0| 0|000|0|0.0000"); stream.clear(); i = 5; formattedWrite(stream, "%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(stream.data == "5| 5|005|5|5.0000"); stream.clear(); i = 10; formattedWrite(stream, "%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(stream.data == "10| 10|010|10|10.0000"); stream.clear(); formattedWrite(stream, "%.0d", 0); assert(stream.data == ""); stream.clear(); formattedWrite(stream, "%.g", .34); assert(stream.data == "0.3"); stream.clear(); stream.clear(); formattedWrite(stream, "%.0g", .34); assert(stream.data == "0.3"); stream.clear(); formattedWrite(stream, "%.2g", .34); assert(stream.data == "0.34"); stream.clear(); formattedWrite(stream, "%0.0008f", 1e-08); assert(stream.data == "0.00000001"); stream.clear(); formattedWrite(stream, "%0.0008f", 1e-05); assert(stream.data == "0.00001000"); //return; //std.c.stdio.fwrite(stream.data.ptr, stream.data.length, 1, stderr); s = "helloworld"; string r; stream.clear(); formattedWrite(stream, "%.2s", s[0..5]); assert(stream.data == "he"); stream.clear(); formattedWrite(stream, "%.20s", s[0..5]); assert(stream.data == "hello"); stream.clear(); formattedWrite(stream, "%8s", s[0..5]); assert(stream.data == " hello"); byte[] arrbyte = new byte[4]; arrbyte[0] = 100; arrbyte[1] = -99; arrbyte[3] = 0; stream.clear(); formattedWrite(stream, "%s", arrbyte); assert(stream.data == "[100, -99, 0, 0]", stream.data); ubyte[] arrubyte = new ubyte[4]; arrubyte[0] = 100; arrubyte[1] = 200; arrubyte[3] = 0; stream.clear(); formattedWrite(stream, "%s", arrubyte); assert(stream.data == "[100, 200, 0, 0]", stream.data); short[] arrshort = new short[4]; arrshort[0] = 100; arrshort[1] = -999; arrshort[3] = 0; stream.clear(); formattedWrite(stream, "%s", arrshort); assert(stream.data == "[100, -999, 0, 0]"); stream.clear(); formattedWrite(stream, "%s",arrshort); assert(stream.data == "[100, -999, 0, 0]"); ushort[] arrushort = new ushort[4]; arrushort[0] = 100; arrushort[1] = 20_000; arrushort[3] = 0; stream.clear(); formattedWrite(stream, "%s", arrushort); assert(stream.data == "[100, 20000, 0, 0]"); int[] arrint = new int[4]; arrint[0] = 100; arrint[1] = -999; arrint[3] = 0; stream.clear(); formattedWrite(stream, "%s", arrint); assert(stream.data == "[100, -999, 0, 0]"); stream.clear(); formattedWrite(stream, "%s",arrint); assert(stream.data == "[100, -999, 0, 0]"); long[] arrlong = new long[4]; arrlong[0] = 100; arrlong[1] = -999; arrlong[3] = 0; stream.clear(); formattedWrite(stream, "%s", arrlong); assert(stream.data == "[100, -999, 0, 0]"); stream.clear(); formattedWrite(stream, "%s",arrlong); assert(stream.data == "[100, -999, 0, 0]"); ulong[] arrulong = new ulong[4]; arrulong[0] = 100; arrulong[1] = 999; arrulong[3] = 0; stream.clear(); formattedWrite(stream, "%s", arrulong); assert(stream.data == "[100, 999, 0, 0]"); string[] arr2 = new string[4]; arr2[0] = "hello"; arr2[1] = "world"; arr2[3] = "foo"; stream.clear(); formattedWrite(stream, "%s", arr2); assert(stream.data == `["hello", "world", "", "foo"]`, stream.data); stream.clear(); formattedWrite(stream, "%.8d", 7); assert(stream.data == "00000007"); stream.clear(); formattedWrite(stream, "%.8x", 10); assert(stream.data == "0000000a"); stream.clear(); formattedWrite(stream, "%-3d", 7); assert(stream.data == "7 "); stream.clear(); formattedWrite(stream, "%*d", -3, 7); assert(stream.data == "7 "); stream.clear(); formattedWrite(stream, "%.*d", -3, 7); //writeln(stream.data); assert(stream.data == "7"); // assert(false); // typedef int myint; // myint m = -7; // stream.clear(); formattedWrite(stream, "", m); // assert(stream.data == "-7"); stream.clear(); formattedWrite(stream, "%s", "abc"c); assert(stream.data == "abc"); stream.clear(); formattedWrite(stream, "%s", "def"w); assert(stream.data == "def", text(stream.data.length)); stream.clear(); formattedWrite(stream, "%s", "ghi"d); assert(stream.data == "ghi"); here: void* p = cast(void*)0xDEADBEEF; stream.clear(); formattedWrite(stream, "%s", p); assert(stream.data == "DEADBEEF", stream.data); stream.clear(); formattedWrite(stream, "%#x", 0xabcd); assert(stream.data == "0xabcd"); stream.clear(); formattedWrite(stream, "%#X", 0xABCD); assert(stream.data == "0XABCD"); stream.clear(); formattedWrite(stream, "%#o", octal!12345); assert(stream.data == "012345"); stream.clear(); formattedWrite(stream, "%o", 9); assert(stream.data == "11"); stream.clear(); formattedWrite(stream, "%+d", 123); assert(stream.data == "+123"); stream.clear(); formattedWrite(stream, "%+d", -123); assert(stream.data == "-123"); stream.clear(); formattedWrite(stream, "% d", 123); assert(stream.data == " 123"); stream.clear(); formattedWrite(stream, "% d", -123); assert(stream.data == "-123"); stream.clear(); formattedWrite(stream, "%%"); assert(stream.data == "%"); stream.clear(); formattedWrite(stream, "%d", true); assert(stream.data == "1"); stream.clear(); formattedWrite(stream, "%d", false); assert(stream.data == "0"); stream.clear(); formattedWrite(stream, "%d", 'a'); assert(stream.data == "97", stream.data); wchar wc = 'a'; stream.clear(); formattedWrite(stream, "%d", wc); assert(stream.data == "97"); dchar dc = 'a'; stream.clear(); formattedWrite(stream, "%d", dc); assert(stream.data == "97"); byte b = byte.max; stream.clear(); formattedWrite(stream, "%x", b); assert(stream.data == "7f"); stream.clear(); formattedWrite(stream, "%x", ++b); assert(stream.data == "80"); stream.clear(); formattedWrite(stream, "%x", ++b); assert(stream.data == "81"); short sh = short.max; stream.clear(); formattedWrite(stream, "%x", sh); assert(stream.data == "7fff"); stream.clear(); formattedWrite(stream, "%x", ++sh); assert(stream.data == "8000"); stream.clear(); formattedWrite(stream, "%x", ++sh); assert(stream.data == "8001"); i = int.max; stream.clear(); formattedWrite(stream, "%x", i); assert(stream.data == "7fffffff"); stream.clear(); formattedWrite(stream, "%x", ++i); assert(stream.data == "80000000"); stream.clear(); formattedWrite(stream, "%x", ++i); assert(stream.data == "80000001"); stream.clear(); formattedWrite(stream, "%x", 10); assert(stream.data == "a"); stream.clear(); formattedWrite(stream, "%X", 10); assert(stream.data == "A"); stream.clear(); formattedWrite(stream, "%x", 15); assert(stream.data == "f"); stream.clear(); formattedWrite(stream, "%X", 15); assert(stream.data == "F"); Object c = null; stream.clear(); formattedWrite(stream, "%s", c); assert(stream.data == "null"); enum TestEnum { Value1, Value2 } stream.clear(); formattedWrite(stream, "%s", TestEnum.Value2); assert(stream.data == "Value2", stream.data); stream.clear(); formattedWrite(stream, "%s", cast(TestEnum)5); assert(stream.data == "cast(TestEnum)5", stream.data); //immutable(char[5])[int] aa = ([3:"hello", 4:"betty"]); //stream.clear(); formattedWrite(stream, "%s", aa.values); //std.c.stdio.fwrite(stream.data.ptr, stream.data.length, 1, stderr); //assert(stream.data == "[[h,e,l,l,o],[b,e,t,t,y]]"); //stream.clear(); formattedWrite(stream, "%s", aa); //assert(stream.data == "[3:[h,e,l,l,o],4:[b,e,t,t,y]]"); static const dchar[] ds = ['a','b']; for (int j = 0; j < ds.length; ++j) { stream.clear(); formattedWrite(stream, " %d", ds[j]); if (j == 0) assert(stream.data == " 97"); else assert(stream.data == " 98"); } stream.clear(); formattedWrite(stream, "%.-3d", 7); assert(stream.data == "7", ">" ~ stream.data ~ "<"); // systematic test const string[] flags = [ "-", "+", "#", "0", " ", "" ]; const string[] widths = [ "", "0", "4", "20" ]; const string[] precs = [ "", ".", ".0", ".4", ".20" ]; const string formats = "sdoxXeEfFgGaA"; /+ foreach (flag1; flags) foreach (flag2; flags) foreach (flag3; flags) foreach (flag4; flags) foreach (flag5; flags) foreach (width; widths) foreach (prec; precs) foreach (format; formats) { stream.clear(); auto fmt = "%" ~ flag1 ~ flag2 ~ flag3 ~ flag4 ~ flag5 ~ width ~ prec ~ format ~ '\0'; fmt = fmt[0 .. $ - 1]; // keep it zero-term char buf[256]; buf[0] = 0; switch (format) { case 's': formattedWrite(stream, fmt, "wyda"); snprintf(buf.ptr, buf.length, fmt.ptr, "wyda\0".ptr); break; case 'd': formattedWrite(stream, fmt, 456); snprintf(buf.ptr, buf.length, fmt.ptr, 456); break; case 'o': formattedWrite(stream, fmt, 345); snprintf(buf.ptr, buf.length, fmt.ptr, 345); break; case 'x': formattedWrite(stream, fmt, 63546); snprintf(buf.ptr, buf.length, fmt.ptr, 63546); break; case 'X': formattedWrite(stream, fmt, 12566); snprintf(buf.ptr, buf.length, fmt.ptr, 12566); break; case 'e': formattedWrite(stream, fmt, 3245.345234); snprintf(buf.ptr, buf.length, fmt.ptr, 3245.345234); break; case 'E': formattedWrite(stream, fmt, 3245.2345234); snprintf(buf.ptr, buf.length, fmt.ptr, 3245.2345234); break; case 'f': formattedWrite(stream, fmt, 3245234.645675); snprintf(buf.ptr, buf.length, fmt.ptr, 3245234.645675); break; case 'F': formattedWrite(stream, fmt, 213412.43); snprintf(buf.ptr, buf.length, fmt.ptr, 213412.43); break; case 'g': formattedWrite(stream, fmt, 234134.34); snprintf(buf.ptr, buf.length, fmt.ptr, 234134.34); break; case 'G': formattedWrite(stream, fmt, 23141234.4321); snprintf(buf.ptr, buf.length, fmt.ptr, 23141234.4321); break; case 'a': formattedWrite(stream, fmt, 21341234.2134123); snprintf(buf.ptr, buf.length, fmt.ptr, 21341234.2134123); break; case 'A': formattedWrite(stream, fmt, 1092384098.45234); snprintf(buf.ptr, buf.length, fmt.ptr, 1092384098.45234); break; default: break; } auto exp = buf[0 .. strlen(buf.ptr)]; if (stream.data != exp) { writeln("Format: \"", fmt, '"'); writeln("Expected: >", exp, "<"); writeln("Actual: >", stream.data, "<"); assert(false); } }+/ } unittest { immutable(char[5])[int] aa = ([3:"hello", 4:"betty"]); if (false) writeln(aa.keys); assert(aa[3] == "hello"); assert(aa[4] == "betty"); // if (false) // { // writeln(aa.values[0]); // writeln(aa.values[1]); // writefln("%s", typeid(typeof(aa.values))); // writefln("%s", aa[3]); // writefln("%s", aa[4]); // writefln("%s", aa.values); // //writefln("%s", aa); // wstring a = "abcd"; // writefln(a); // dstring b = "abcd"; // writefln(b); // } auto stream = appender!(char[])(); alias TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong, float, double, real) AllNumerics; foreach (T; AllNumerics) { T value = 1; stream.clear(); formattedWrite(stream, "%s", value); assert(stream.data == "1"); } //auto r = std.string.format("%s", aa.values); stream.clear(); formattedWrite(stream, "%s", aa); //assert(stream.data == "[3:[h,e,l,l,o],4:[b,e,t,t,y]]", stream.data); // r = std.string.format("%s", aa); // assert(r == "[3:[h,e,l,l,o],4:[b,e,t,t,y]]"); } unittest { string s = "hello!124:34.5"; string a; int b; double c; formattedRead(s, "%s!%s:%s", &a, &b, &c); assert(a == "hello" && b == 124 && c == 34.5); } version(unittest) void formatReflectTest(T)(ref T val, string fmt, string formatted, string fn = __FILE__, size_t ln = __LINE__) { auto w = appender!string(); formattedWrite(w, fmt, val); auto input = w.data; enforceEx!AssertError( input == formatted, input, fn, ln); T val2; formattedRead(input, fmt, &val2); static if (isAssociativeArray!T) if (__ctfe) { alias val aa1; alias val2 aa2; //assert(aa1 == aa2); assert(aa1.length == aa2.length); assert(aa1.keys == aa2.keys); //assert(aa1.values == aa2.values); assert(aa1.values.length == aa2.values.length); foreach (i; 0 .. aa1.values.length) assert(aa1.values[i] == aa2.values[i]); //foreach (i, key; aa1.keys) // assert(aa1.values[i] == aa1[key]); //foreach (i, key; aa2.keys) // assert(aa2.values[i] == aa2[key]); return; } enforceEx!AssertError( val == val2, input, fn, ln); } version(unittest) @property void checkCTFEable(alias dg)() { static assert({ dg(); return true; }()); dg(); } unittest { void booleanTest() { auto b = true; formatReflectTest(b, "%s", `true`); formatReflectTest(b, "%b", `1`); formatReflectTest(b, "%o", `1`); formatReflectTest(b, "%d", `1`); formatReflectTest(b, "%u", `1`); formatReflectTest(b, "%x", `1`); } void integerTest() { auto n = 127; formatReflectTest(n, "%s", `127`); formatReflectTest(n, "%b", `1111111`); formatReflectTest(n, "%o", `177`); formatReflectTest(n, "%d", `127`); formatReflectTest(n, "%u", `127`); formatReflectTest(n, "%x", `7f`); } void floatingTest() { auto f = 3.14; formatReflectTest(f, "%s", `3.14`); formatReflectTest(f, "%e", `3.140000e+00`); formatReflectTest(f, "%f", `3.140000`); formatReflectTest(f, "%g", `3.14`); } void charTest() { auto c = 'a'; formatReflectTest(c, "%s", `a`); formatReflectTest(c, "%c", `a`); formatReflectTest(c, "%b", `1100001`); formatReflectTest(c, "%o", `141`); formatReflectTest(c, "%d", `97`); formatReflectTest(c, "%u", `97`); formatReflectTest(c, "%x", `61`); } void strTest() { auto s = "hello"; formatReflectTest(s, "%s", `hello`); formatReflectTest(s, "%(%c,%)", `h,e,l,l,o`); formatReflectTest(s, "%(%s,%)", `'h','e','l','l','o'`); formatReflectTest(s, "[%(<%c>%| $ %)]", `[<h> $ <e> $ <l> $ <l> $ <o>]`); } void daTest() { auto a = [1,2,3,4]; formatReflectTest(a, "%s", `[1, 2, 3, 4]`); formatReflectTest(a, "[%(%s; %)]", `[1; 2; 3; 4]`); formatReflectTest(a, "[%(<%s>%| $ %)]", `[<1> $ <2> $ <3> $ <4>]`); } void saTest() { int[4] sa = [1,2,3,4]; formatReflectTest(sa, "%s", `[1, 2, 3, 4]`); formatReflectTest(sa, "[%(%s; %)]", `[1; 2; 3; 4]`); formatReflectTest(sa, "[%(<%s>%| $ %)]", `[<1> $ <2> $ <3> $ <4>]`); } void aaTest() { auto aa = [1:"hello", 2:"world"]; formatReflectTest(aa, "%s", `[1:"hello", 2:"world"]`); formatReflectTest(aa, "[%(%s->%s, %)]", `[1->"hello", 2->"world"]`); formatReflectTest(aa, "{%([%s=%(%c%)]%|; %)}", `{[1=hello]; [2=world]}`); } checkCTFEable!({ booleanTest(); integerTest(); if (!__ctfe) floatingTest(); // snprintf charTest(); strTest(); daTest(); saTest(); aaTest(); return true; }); } //------------------------------------------------------------------------------ private void skipData(Range, Char)(ref Range input, ref FormatSpec!Char spec) { switch (spec.spec) { case 'c': input.popFront(); break; case 'd': if (input.front == '+' || input.front == '-') input.popFront(); goto case 'u'; case 'u': while (!input.empty && isDigit(input.front)) input.popFront(); break; default: assert(false, text("Format specifier not understood: %", spec.spec)); } } private template acceptedSpecs(T) { static if (isIntegral!T) enum acceptedSpecs = "bdosuxX"; else static if (isFloatingPoint!T) enum acceptedSpecs = "seEfgG"; else static if (isSomeChar!T) enum acceptedSpecs = "bcdosuxX"; // integral + 'c' else enum acceptedSpecs = ""; } /** * Reads a boolean value and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && is(Unqual!T == bool)) { if (spec.spec == 's') { return parse!T(input); } enforce(std.algorithm.find(acceptedSpecs!long, spec.spec).length, text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); return unformatValue!long(input, spec) != 0; } unittest { string line; bool f1; line = "true"; formattedRead(line, "%s", &f1); assert(f1); line = "TrUE"; formattedRead(line, "%s", &f1); assert(f1); line = "false"; formattedRead(line, "%s", &f1); assert(!f1); line = "fALsE"; formattedRead(line, "%s", &f1); assert(!f1); line = "1"; formattedRead(line, "%d", &f1); assert(f1); line = "-1"; formattedRead(line, "%d", &f1); assert(f1); line = "0"; formattedRead(line, "%d", &f1); assert(!f1); line = "-0"; formattedRead(line, "%d", &f1); assert(!f1); } /** * Reads null literal and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && is(T == typeof(null))) { enforce(spec.spec == 's', text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); return parse!T(input); } /** Reads an integral value and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && isIntegral!T && !is(T == enum)) { enforce(std.algorithm.find(acceptedSpecs!T, spec.spec).length, text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); enforce(spec.width == 0); // TODO uint base = spec.spec == 'x' || spec.spec == 'X' ? 16 : spec.spec == 'o' ? 8 : spec.spec == 'b' ? 2 : spec.spec == 's' || spec.spec == 'd' || spec.spec == 'u' ? 10 : 0; assert(base != 0); return parse!T(input, base); } /** Reads a floating-point value and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isFloatingPoint!T && !is(T == enum)) { if (spec.spec == 'r') { // raw read //enforce(input.length >= T.sizeof); enforce(isSomeString!Range || ElementType!(Range).sizeof == 1); union X { ubyte[T.sizeof] raw; T typed; } X x; foreach (i; 0 .. T.sizeof) { static if (isSomeString!Range) { x.raw[i] = input[0]; input = input[1 .. $]; } else { // TODO: recheck this x.raw[i] = cast(ubyte) input.front; input.popFront(); } } return x.typed; } enforce(std.algorithm.find(acceptedSpecs!T, spec.spec).length, text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); return parse!T(input); } version(none)unittest { union A { char[float.sizeof] untyped; float typed; } A a; a.typed = 5.5; char[] input = a.untyped[]; float witness; formattedRead(input, "%r", &witness); assert(witness == a.typed); } unittest { char[] line = "1 2".dup; int a, b; formattedRead(line, "%s %s", &a, &b); assert(a == 1 && b == 2); line = "10 2 3".dup; formattedRead(line, "%d ", &a); assert(a == 10); assert(line == "2 3"); Tuple!(int, float) t; line = "1 2.125".dup; formattedRead(line, "%d %g", &t); assert(t[0] == 1 && t[1] == 2.125); line = "1 7643 2.125".dup; formattedRead(line, "%s %*u %s", &t); assert(t[0] == 1 && t[1] == 2.125); } /** * Reads one character and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && isSomeChar!T && !is(T == enum)) { if (spec.spec == 's' || spec.spec == 'c') { auto result = to!T(input.front); input.popFront(); return result; } enforce(std.algorithm.find(acceptedSpecs!T, spec.spec).length, text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); static if (T.sizeof == 1) return unformatValue!ubyte(input, spec); else static if (T.sizeof == 2) return unformatValue!ushort(input, spec); else static if (T.sizeof == 4) return unformatValue!uint(input, spec); else static assert(0); } unittest { string line; char c1, c2; line = "abc"; formattedRead(line, "%s%c", &c1, &c2); assert(c1 == 'a' && c2 == 'b'); assert(line == "c"); } /** Reads a string and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && isSomeString!T && !is(T == enum)) { if (spec.spec == '(') { return unformatRange!T(input, spec); } enforce(spec.spec == 's', text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); static if (isStaticArray!T) { T result; auto app = result[]; } else auto app = appender!T(); if (spec.trailing.empty) { for (; !input.empty; input.popFront()) { static if (isStaticArray!T) if (app.empty) break; app.put(input.front); } } else { auto end = spec.trailing.front; for (; !input.empty && input.front != end; input.popFront()) { static if (isStaticArray!T) if (app.empty) break; app.put(input.front); } } static if (isStaticArray!T) { enforce(app.empty, "need more input"); return result; } else return app.data; } unittest { string line; string s1, s2; line = "hello, world"; formattedRead(line, "%s", &s1); assert(s1 == "hello, world", s1); line = "hello, world;yah"; formattedRead(line, "%s;%s", &s1, &s2); assert(s1 == "hello, world", s1); assert(s2 == "yah", s2); line = `['h','e','l','l','o']`; string s3; formattedRead(line, "[%(%s,%)]", &s3); assert(s3 == "hello"); line = `"hello"`; string s4; formattedRead(line, "\"%(%c%)\"", &s4); assert(s4 == "hello"); } /** Reads an array (except for string types) and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && isArray!T && !isSomeString!T && !is(T == enum)) { if (spec.spec == '(') { return unformatRange!T(input, spec); } enforce(spec.spec == 's', text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); return parse!T(input); } unittest { string line; line = "[1,2,3]"; int[] s1; formattedRead(line, "%s", &s1); assert(s1 == [1,2,3]); } unittest { string line; line = "[1,2,3]"; int[] s1; formattedRead(line, "[%(%s,%)]", &s1); assert(s1 == [1,2,3]); line = `["hello", "world"]`; string[] s2; formattedRead(line, "[%(%s, %)]", &s2); assert(s2 == ["hello", "world"]); line = "123 456"; int[] s3; formattedRead(line, "%(%s %)", &s3); assert(s3 == [123, 456]); line = "h,e,l,l,o; w,o,r,l,d"; string[] s4; formattedRead(line, "%(%(%c,%); %)", &s4); assert(s4 == ["hello", "world"]); } unittest { string line; int[4] sa1; line = `[1,2,3,4]`; formattedRead(line, "%s", &sa1); assert(sa1 == [1,2,3,4]); int[4] sa2; line = `[1,2,3]`; assertThrown(formattedRead(line, "%s", &sa2)); int[4] sa3; line = `[1,2,3,4,5]`; assertThrown(formattedRead(line, "%s", &sa3)); } unittest { string input; int[4] sa1; input = `[1,2,3,4]`; formattedRead(input, "[%(%s,%)]", &sa1); assert(sa1 == [1,2,3,4]); int[4] sa2; input = `[1,2,3]`; assertThrown(formattedRead(input, "[%(%s,%)]", &sa2)); } unittest { // 7241 string input = "a"; auto spec = FormatSpec!char("%s"); spec.readUpToNextSpec(input); auto result = unformatValue!(dchar[1])(input, spec); assert(result[0] == 'a'); } /** * Reads an associative array and returns it. */ T unformatValue(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range && isAssociativeArray!T && !is(T == enum)) { if (spec.spec == '(') { return unformatRange!T(input, spec); } enforce(spec.spec == 's', text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof)); return parse!T(input); } unittest { string line; string[int] aa1; line = `[1:"hello", 2:"world"]`; formattedRead(line, "%s", &aa1); assert(aa1 == [1:"hello", 2:"world"]); int[string] aa2; line = `{"hello"=1; "world"=2}`; formattedRead(line, "{%(%s=%s; %)}", &aa2); assert(aa2 == ["hello":1, "world":2]); int[string] aa3; line = `{[hello=1]; [world=2]}`; formattedRead(line, "{%([%(%c%)=%s]%|; %)}", &aa3); assert(aa3 == ["hello":1, "world":2]); } //debug = unformatRange; private T unformatRange(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) in { assert(spec.spec == '('); } body { debug (unformatRange) printf("unformatRange:\n"); T result; static if (isStaticArray!T) { size_t i; } const(Char)[] cont = spec.trailing; for (size_t j = 0; j < spec.trailing.length; ++j) { if (spec.trailing[j] == '%') { cont = spec.trailing[0 .. j]; break; } } debug (unformatRange) printf("\t"); debug (unformatRange) if (!input.empty) printf("input.front = %c, ", input.front); debug (unformatRange) printf("cont = %.*s\n", cont); bool checkEnd() { return input.empty || !cont.empty && input.front == cont.front; } if (!checkEnd()) { for (;;) { auto fmt = FormatSpec!Char(spec.nested); fmt.readUpToNextSpec(input); enforce(!input.empty); debug (unformatRange) printf("\t) spec = %c, front = %c ", fmt.spec, input.front); static if (isStaticArray!T) { result[i++] = unformatElement!(typeof(T.init[0]))(input, fmt); } else static if (isDynamicArray!T) { result ~= unformatElement!(ElementType!T)(input, fmt); } else static if (isAssociativeArray!T) { auto key = unformatElement!(typeof(T.keys[0]))(input, fmt); fmt.readUpToNextSpec(input); // eat key separator result[key] = unformatElement!(typeof(T.values[0]))(input, fmt); } debug (unformatRange) { if (input.empty) printf("-> front = [empty] "); else printf("-> front = %c ", input.front); } static if (isStaticArray!T) { debug (unformatRange) printf("i = %u < %u\n", i, T.length); enforce(i <= T.length); } auto sep = spec.sep ? fmt.readUpToNextSpec(input), spec.sep : fmt.trailing; debug (unformatRange) { if (!sep.empty && !input.empty) printf("-> %c, sep = %.*s\n", input.front, sep); else printf("\n"); } if (checkEnd()) break; if (!sep.empty && input.front == sep.front) { while (!sep.empty) { enforce(!input.empty); enforce(input.front == sep.front); input.popFront(); sep.popFront(); } debug (unformatRange) printf("input.front = %c\n", input.front); } } } static if (isStaticArray!T) { enforce(i == T.length); } return result; } // Undocumented T unformatElement(T, Range, Char)(ref Range input, ref FormatSpec!Char spec) if (isInputRange!Range) { static if (isSomeString!T) { if (spec.spec == 's') { return parseElement!T(input); } } else static if (isSomeChar!T) { if (spec.spec == 's') { return parseElement!T(input); } } return unformatValue!T(input, spec); } // Legacy implementation enum Mangle : char { Tvoid = 'v', Tbool = 'b', Tbyte = 'g', Tubyte = 'h', Tshort = 's', Tushort = 't', Tint = 'i', Tuint = 'k', Tlong = 'l', Tulong = 'm', Tfloat = 'f', Tdouble = 'd', Treal = 'e', Tifloat = 'o', Tidouble = 'p', Tireal = 'j', Tcfloat = 'q', Tcdouble = 'r', Tcreal = 'c', Tchar = 'a', Twchar = 'u', Tdchar = 'w', Tarray = 'A', Tsarray = 'G', Taarray = 'H', Tpointer = 'P', Tfunction = 'F', Tident = 'I', Tclass = 'C', Tstruct = 'S', Tenum = 'E', Ttypedef = 'T', Tdelegate = 'D', Tconst = 'x', Timmutable = 'y', } // return the TypeInfo for a primitive type and null otherwise. This // is required since for arrays of ints we only have the mangled char // to work from. If arrays always subclassed TypeInfo_Array this // routine could go away. private TypeInfo primitiveTypeInfo(Mangle m) { // BUG: should fix this in static this() to avoid double checked locking bug __gshared TypeInfo[Mangle] dic; if (!dic.length) { dic = [ Mangle.Tvoid : typeid(void), Mangle.Tbool : typeid(bool), Mangle.Tbyte : typeid(byte), Mangle.Tubyte : typeid(ubyte), Mangle.Tshort : typeid(short), Mangle.Tushort : typeid(ushort), Mangle.Tint : typeid(int), Mangle.Tuint : typeid(uint), Mangle.Tlong : typeid(long), Mangle.Tulong : typeid(ulong), Mangle.Tfloat : typeid(float), Mangle.Tdouble : typeid(double), Mangle.Treal : typeid(real), Mangle.Tifloat : typeid(ifloat), Mangle.Tidouble : typeid(idouble), Mangle.Tireal : typeid(ireal), Mangle.Tcfloat : typeid(cfloat), Mangle.Tcdouble : typeid(cdouble), Mangle.Tcreal : typeid(creal), Mangle.Tchar : typeid(char), Mangle.Twchar : typeid(wchar), Mangle.Tdchar : typeid(dchar) ]; } auto p = m in dic; return p ? *p : null; } // This stuff has been removed from the docs and is planned for deprecation. /* * Interprets variadic argument list pointed to by argptr whose types * are given by arguments[], formats them according to embedded format * strings in the variadic argument list, and sends the resulting * characters to putc. * * The variadic arguments are consumed in order. Each is formatted * into a sequence of chars, using the default format specification * for its type, and the characters are sequentially passed to putc. * If a $(D char[]), $(D wchar[]), or $(D dchar[]) argument is * encountered, it is interpreted as a format string. As many * arguments as specified in the format string are consumed and * formatted according to the format specifications in that string and * passed to putc. If there are too few remaining arguments, a * $(D FormatException) is thrown. If there are more remaining arguments than * needed by the format specification, the default processing of * arguments resumes until they are all consumed. * * Params: * putc = Output is sent do this delegate, character by character. * arguments = Array of $(D TypeInfo)s, one for each argument to be formatted. * argptr = Points to variadic argument list. * * Throws: * Mismatched arguments and formats result in a $(D FormatException) being thrown. * * Format_String: * <a name="format-string">$(I Format strings)</a> * consist of characters interspersed with * $(I format specifications). Characters are simply copied * to the output (such as putc) after any necessary conversion * to the corresponding UTF-8 sequence. * * A $(I format specification) starts with a '%' character, * and has the following grammar: <pre> $(I FormatSpecification): $(B '%%') $(B '%') $(I Flags) $(I Width) $(I Precision) $(I FormatChar) $(I Flags): $(I empty) $(B '-') $(I Flags) $(B '+') $(I Flags) $(B '#') $(I Flags) $(B '0') $(I Flags) $(B ' ') $(I Flags) $(I Width): $(I empty) $(I Integer) $(B '*') $(I Precision): $(I empty) $(B '.') $(B '.') $(I Integer) $(B '.*') $(I Integer): $(I Digit) $(I Digit) $(I Integer) $(I Digit): $(B '0') $(B '1') $(B '2') $(B '3') $(B '4') $(B '5') $(B '6') $(B '7') $(B '8') $(B '9') $(I FormatChar): $(B 's') $(B 'b') $(B 'd') $(B 'o') $(B 'x') $(B 'X') $(B 'e') $(B 'E') $(B 'f') $(B 'F') $(B 'g') $(B 'G') $(B 'a') $(B 'A') </pre> <dl> <dt>$(I Flags) <dl> <dt>$(B '-') <dd> Left justify the result in the field. It overrides any $(B 0) flag. <dt>$(B '+') <dd>Prefix positive numbers in a signed conversion with a $(B +). It overrides any $(I space) flag. <dt>$(B '#') <dd>Use alternative formatting: <dl> <dt>For $(B 'o'): <dd> Add to precision as necessary so that the first digit of the octal formatting is a '0', even if both the argument and the $(I Precision) are zero. <dt> For $(B 'x') ($(B 'X')): <dd> If non-zero, prefix result with $(B 0x) ($(B 0X)). <dt> For floating point formatting: <dd> Always insert the decimal point. <dt> For $(B 'g') ($(B 'G')): <dd> Do not elide trailing zeros. </dl> <dt>$(B '0') <dd> For integer and floating point formatting when not nan or infinity, use leading zeros to pad rather than spaces. Ignore if there's a $(I Precision). <dt>$(B ' ') <dd>Prefix positive numbers in a signed conversion with a space. </dl> <dt>$(I Width) <dd> Specifies the minimum field width. If the width is a $(B *), the next argument, which must be of type $(B int), is taken as the width. If the width is negative, it is as if the $(B -) was given as a $(I Flags) character. <dt>$(I Precision) <dd> Gives the precision for numeric conversions. If the precision is a $(B *), the next argument, which must be of type $(B int), is taken as the precision. If it is negative, it is as if there was no $(I Precision). <dt>$(I FormatChar) <dd> <dl> <dt>$(B 's') <dd>The corresponding argument is formatted in a manner consistent with its type: <dl> <dt>$(B bool) <dd>The result is <tt>'true'</tt> or <tt>'false'</tt>. <dt>integral types <dd>The $(B %d) format is used. <dt>floating point types <dd>The $(B %g) format is used. <dt>string types <dd>The result is the string converted to UTF-8. A $(I Precision) specifies the maximum number of characters to use in the result. <dt>classes derived from $(B Object) <dd>The result is the string returned from the class instance's $(B .toString()) method. A $(I Precision) specifies the maximum number of characters to use in the result. <dt>non-string static and dynamic arrays <dd>The result is [s<sub>0</sub>, s<sub>1</sub>, ...] where s<sub>k</sub> is the kth element formatted with the default format. </dl> <dt>$(B 'b','d','o','x','X') <dd> The corresponding argument must be an integral type and is formatted as an integer. If the argument is a signed type and the $(I FormatChar) is $(B d) it is converted to a signed string of characters, otherwise it is treated as unsigned. An argument of type $(B bool) is formatted as '1' or '0'. The base used is binary for $(B b), octal for $(B o), decimal for $(B d), and hexadecimal for $(B x) or $(B X). $(B x) formats using lower case letters, $(B X) uppercase. If there are fewer resulting digits than the $(I Precision), leading zeros are used as necessary. If the $(I Precision) is 0 and the number is 0, no digits result. <dt>$(B 'e','E') <dd> A floating point number is formatted as one digit before the decimal point, $(I Precision) digits after, the $(I FormatChar), &plusmn;, followed by at least a two digit exponent: $(I d.dddddd)e$(I &plusmn;dd). If there is no $(I Precision), six digits are generated after the decimal point. If the $(I Precision) is 0, no decimal point is generated. <dt>$(B 'f','F') <dd> A floating point number is formatted in decimal notation. The $(I Precision) specifies the number of digits generated after the decimal point. It defaults to six. At least one digit is generated before the decimal point. If the $(I Precision) is zero, no decimal point is generated. <dt>$(B 'g','G') <dd> A floating point number is formatted in either $(B e) or $(B f) format for $(B g); $(B E) or $(B F) format for $(B G). The $(B f) format is used if the exponent for an $(B e) format is greater than -5 and less than the $(I Precision). The $(I Precision) specifies the number of significant digits, and defaults to six. Trailing zeros are elided after the decimal point, if the fractional part is zero then no decimal point is generated. <dt>$(B 'a','A') <dd> A floating point number is formatted in hexadecimal exponential notation 0x$(I h.hhhhhh)p$(I &plusmn;d). There is one hexadecimal digit before the decimal point, and as many after as specified by the $(I Precision). If the $(I Precision) is zero, no decimal point is generated. If there is no $(I Precision), as many hexadecimal digits as necessary to exactly represent the mantissa are generated. The exponent is written in as few digits as possible, but at least one, is in decimal, and represents a power of 2 as in $(I h.hhhhhh)*2<sup>$(I &plusmn;d)</sup>. The exponent for zero is zero. The hexadecimal digits, x and p are in upper case if the $(I FormatChar) is upper case. </dl> Floating point NaN's are formatted as $(B nan) if the $(I FormatChar) is lower case, or $(B NAN) if upper. Floating point infinities are formatted as $(B inf) or $(B infinity) if the $(I FormatChar) is lower case, or $(B INF) or $(B INFINITY) if upper. </dl> Example: ------------------------- import std.c.stdio; import std.format; void myPrint(...) { void putc(char c) { fputc(c, stdout); } std.format.doFormat(&putc, _arguments, _argptr); } ... int x = 27; // prints 'The answer is 27:6' myPrint("The answer is %s:", x, 6); ------------------------ */ void doFormat(void delegate(dchar) putc, TypeInfo[] arguments, va_list argptr) { TypeInfo ti; Mangle m; uint flags; int field_width; int precision; enum : uint { FLdash = 1, FLplus = 2, FLspace = 4, FLhash = 8, FLlngdbl = 0x20, FL0pad = 0x40, FLprecision = 0x80, } static TypeInfo skipCI(TypeInfo valti) { for (;;) { if (valti.classinfo.name.length == 18 && valti.classinfo.name[9..18] == "Invariant") valti = (cast(TypeInfo_Invariant)valti).next; else if (valti.classinfo.name.length == 14 && valti.classinfo.name[9..14] == "Const") valti = (cast(TypeInfo_Const)valti).next; else break; } return valti; } void formatArg(char fc) { bool vbit; ulong vnumber; char vchar; dchar vdchar; Object vobject; real vreal; creal vcreal; Mangle m2; int signed = 0; uint base = 10; int uc; char[ulong.sizeof * 8] tmpbuf; // long enough to print long in binary const(char)* prefix = ""; string s; void putstr(const char[] s) { //printf("putstr: s = %.*s, flags = x%x\n", s.length, s.ptr, flags); sizediff_t padding = field_width - (strlen(prefix) + toUCSindex(s, s.length)); sizediff_t prepad = 0; sizediff_t postpad = 0; if (padding > 0) { if (flags & FLdash) postpad = padding; else prepad = padding; } if (flags & FL0pad) { while (*prefix) putc(*prefix++); while (prepad--) putc('0'); } else { while (prepad--) putc(' '); while (*prefix) putc(*prefix++); } foreach (dchar c; s) putc(c); while (postpad--) putc(' '); } void putreal(real v) { //printf("putreal %Lg\n", vreal); switch (fc) { case 's': fc = 'g'; break; case 'f', 'F', 'e', 'E', 'g', 'G', 'a', 'A': break; default: //printf("fc = '%c'\n", fc); Lerror: throw new FormatException("floating"); } version (DigitalMarsC) { uint sl; char[] fbuf = tmpbuf; if (!(flags & FLprecision)) precision = 6; while (1) { sl = fbuf.length; prefix = (*__pfloatfmt)(fc, flags | FLlngdbl, precision, &v, cast(char*)fbuf, &sl, field_width); if (sl != -1) break; sl = fbuf.length * 2; fbuf = (cast(char*)alloca(sl * char.sizeof))[0 .. sl]; } putstr(fbuf[0 .. sl]); } else { sizediff_t sl; char[] fbuf = tmpbuf; char[12] format; format[0] = '%'; int i = 1; if (flags & FLdash) format[i++] = '-'; if (flags & FLplus) format[i++] = '+'; if (flags & FLspace) format[i++] = ' '; if (flags & FLhash) format[i++] = '#'; if (flags & FL0pad) format[i++] = '0'; format[i + 0] = '*'; format[i + 1] = '.'; format[i + 2] = '*'; format[i + 3] = 'L'; format[i + 4] = fc; format[i + 5] = 0; if (!(flags & FLprecision)) precision = -1; while (1) { sl = fbuf.length; version (Win64) auto n = snprintf(fbuf.ptr, sl, format.ptr, field_width, precision, cast(double)v); else auto n = snprintf(fbuf.ptr, sl, format.ptr, field_width, precision, v); //printf("format = '%s', n = %d\n", cast(char*)format, n); if (n >= 0 && n < sl) { sl = n; break; } if (n < 0) sl = sl * 2; else sl = n + 1; fbuf = (cast(char*)alloca(sl * char.sizeof))[0 .. sl]; } putstr(fbuf[0 .. sl]); } return; } static Mangle getMan(TypeInfo ti) { auto m = cast(Mangle)ti.classinfo.name[9]; if (ti.classinfo.name.length == 20 && ti.classinfo.name[9..20] == "StaticArray") m = cast(Mangle)'G'; return m; } /* p = pointer to the first element in the array * len = number of elements in the array * valti = type of the elements */ void putArray(void* p, size_t len, TypeInfo valti) { //printf("\nputArray(len = %u), tsize = %u\n", len, valti.tsize()); putc('['); valti = skipCI(valti); size_t tsize = valti.tsize(); auto argptrSave = argptr; auto tiSave = ti; auto mSave = m; ti = valti; //printf("\n%.*s\n", valti.classinfo.name.length, valti.classinfo.name.ptr); m = getMan(valti); while (len--) { //doFormat(putc, (&valti)[0 .. 1], p); version (Win64) { void* q = void; if (tsize > 8 && m != Mangle.Tsarray) { q = p; argptr = &q; } else argptr = p; formatArg('s'); p += tsize; } else { version (X86) argptr = p; else version(X86_64) { __va_list va; va.stack_args = p; argptr = &va; } else static assert(false, "unsupported platform"); formatArg('s'); p += tsize; } if (len > 0) putc(','); } m = mSave; ti = tiSave; argptr = argptrSave; putc(']'); } void putAArray(ubyte[long] vaa, TypeInfo valti, TypeInfo keyti) { putc('['); bool comma=false; auto argptrSave = argptr; auto tiSave = ti; auto mSave = m; valti = skipCI(valti); keyti = skipCI(keyti); foreach(ref fakevalue; vaa) { if (comma) putc(','); comma = true; void *pkey = &fakevalue; version (D_LP64) pkey -= (long.sizeof + 15) & ~(15); else pkey -= (long.sizeof + size_t.sizeof - 1) & ~(size_t.sizeof - 1); // the key comes before the value auto keysize = keyti.tsize; version (D_LP64) auto keysizet = (keysize + 15) & ~(15); else auto keysizet = (keysize + size_t.sizeof - 1) & ~(size_t.sizeof - 1); void* pvalue = pkey + keysizet; //doFormat(putc, (&keyti)[0..1], pkey); m = getMan(keyti); version (X86) argptr = pkey; else version (Win64) { void* q = void; if (keysize > 8 && m != Mangle.Tsarray) { q = pkey; argptr = &q; } else argptr = pkey; } else version (X86_64) { __va_list va; va.stack_args = pkey; argptr = &va; } else static assert(false, "unsupported platform"); ti = keyti; formatArg('s'); putc(':'); //doFormat(putc, (&valti)[0..1], pvalue); m = getMan(valti); version (X86) argptr = pvalue; else version (Win64) { void* q2 = void; auto valuesize = valti.tsize(); if (valuesize > 8 && m != Mangle.Tsarray) { q2 = pvalue; argptr = &q2; } else argptr = pvalue; } else version (X86_64) { __va_list va2; va2.stack_args = pvalue; argptr = &va2; } else static assert(false, "unsupported platform"); ti = valti; formatArg('s'); } m = mSave; ti = tiSave; argptr = argptrSave; putc(']'); } //printf("formatArg(fc = '%c', m = '%c')\n", fc, m); switch (m) { case Mangle.Tbool: vbit = va_arg!(bool)(argptr); if (fc != 's') { vnumber = vbit; goto Lnumber; } putstr(vbit ? "true" : "false"); return; case Mangle.Tchar: vchar = va_arg!(char)(argptr); if (fc != 's') { vnumber = vchar; goto Lnumber; } L2: putstr((&vchar)[0 .. 1]); return; case Mangle.Twchar: vdchar = va_arg!(wchar)(argptr); goto L1; case Mangle.Tdchar: vdchar = va_arg!(dchar)(argptr); L1: if (fc != 's') { vnumber = vdchar; goto Lnumber; } if (vdchar <= 0x7F) { vchar = cast(char)vdchar; goto L2; } else { if (!isValidDchar(vdchar)) throw new UTFException("invalid dchar in format"); char[4] vbuf; putstr(toUTF8(vbuf, vdchar)); } return; case Mangle.Tbyte: signed = 1; vnumber = va_arg!(byte)(argptr); goto Lnumber; case Mangle.Tubyte: vnumber = va_arg!(ubyte)(argptr); goto Lnumber; case Mangle.Tshort: signed = 1; vnumber = va_arg!(short)(argptr); goto Lnumber; case Mangle.Tushort: vnumber = va_arg!(ushort)(argptr); goto Lnumber; case Mangle.Tint: signed = 1; vnumber = va_arg!(int)(argptr); goto Lnumber; case Mangle.Tuint: Luint: vnumber = va_arg!(uint)(argptr); goto Lnumber; case Mangle.Tlong: signed = 1; vnumber = cast(ulong)va_arg!(long)(argptr); goto Lnumber; case Mangle.Tulong: Lulong: vnumber = va_arg!(ulong)(argptr); goto Lnumber; case Mangle.Tclass: vobject = va_arg!(Object)(argptr); if (vobject is null) s = "null"; else s = vobject.toString(); goto Lputstr; case Mangle.Tpointer: vnumber = cast(ulong)va_arg!(void*)(argptr); if (fc != 'x') uc = 1; flags |= FL0pad; if (!(flags & FLprecision)) { flags |= FLprecision; precision = (void*).sizeof; } base = 16; goto Lnumber; case Mangle.Tfloat: case Mangle.Tifloat: if (fc == 'x' || fc == 'X') goto Luint; vreal = va_arg!(float)(argptr); goto Lreal; case Mangle.Tdouble: case Mangle.Tidouble: if (fc == 'x' || fc == 'X') goto Lulong; vreal = va_arg!(double)(argptr); goto Lreal; case Mangle.Treal: case Mangle.Tireal: vreal = va_arg!(real)(argptr); goto Lreal; case Mangle.Tcfloat: vcreal = va_arg!(cfloat)(argptr); goto Lcomplex; case Mangle.Tcdouble: vcreal = va_arg!(cdouble)(argptr); goto Lcomplex; case Mangle.Tcreal: vcreal = va_arg!(creal)(argptr); goto Lcomplex; case Mangle.Tsarray: version (X86) putArray(argptr, (cast(TypeInfo_StaticArray)ti).len, cast()(cast(TypeInfo_StaticArray)ti).next); else version (Win64) putArray(argptr, (cast(TypeInfo_StaticArray)ti).len, cast()(cast(TypeInfo_StaticArray)ti).next); else putArray((cast(__va_list*)argptr).stack_args, (cast(TypeInfo_StaticArray)ti).len, cast()(cast(TypeInfo_StaticArray)ti).next); return; case Mangle.Tarray: int mi = 10; if (ti.classinfo.name.length == 14 && ti.classinfo.name[9..14] == "Array") { // array of non-primitive types TypeInfo tn = cast()(cast(TypeInfo_Array)ti).next; tn = skipCI(tn); switch (cast(Mangle)tn.classinfo.name[9]) { case Mangle.Tchar: goto LarrayChar; case Mangle.Twchar: goto LarrayWchar; case Mangle.Tdchar: goto LarrayDchar; default: break; } void[] va = va_arg!(void[])(argptr); putArray(va.ptr, va.length, tn); return; } if (ti.classinfo.name.length == 25 && ti.classinfo.name[9..25] == "AssociativeArray") { // associative array ubyte[long] vaa = va_arg!(ubyte[long])(argptr); putAArray(vaa, cast()(cast(TypeInfo_AssociativeArray)ti).next, (cast(TypeInfo_AssociativeArray)ti).key); return; } while (1) { m2 = cast(Mangle)ti.classinfo.name[mi]; switch (m2) { case Mangle.Tchar: LarrayChar: s = va_arg!(string)(argptr); goto Lputstr; case Mangle.Twchar: LarrayWchar: wchar[] sw = va_arg!(wchar[])(argptr); s = toUTF8(sw); goto Lputstr; case Mangle.Tdchar: LarrayDchar: auto sd = va_arg!(dstring)(argptr); s = toUTF8(sd); Lputstr: if (fc != 's') throw new FormatException("string"); if (flags & FLprecision && precision < s.length) s = s[0 .. precision]; putstr(s); break; case Mangle.Tconst: case Mangle.Timmutable: mi++; continue; default: TypeInfo ti2 = primitiveTypeInfo(m2); if (!ti2) goto Lerror; void[] va = va_arg!(void[])(argptr); putArray(va.ptr, va.length, ti2); } return; } assert(0); case Mangle.Ttypedef: ti = (cast(TypeInfo_Typedef)ti).base; m = cast(Mangle)ti.classinfo.name[9]; formatArg(fc); return; case Mangle.Tenum: ti = (cast(TypeInfo_Enum)ti).base; m = cast(Mangle)ti.classinfo.name[9]; formatArg(fc); return; case Mangle.Tstruct: { TypeInfo_Struct tis = cast(TypeInfo_Struct)ti; if (tis.xtoString is null) throw new FormatException("Can't convert " ~ tis.toString() ~ " to string: \"string toString()\" not defined"); version(X86) { s = tis.xtoString(argptr); argptr += (tis.tsize() + 3) & ~3; } else version(Win64) { void* p = argptr; if (tis.tsize() > 8) p = *cast(void**)p; s = tis.xtoString(p); argptr += size_t.sizeof; } else version (X86_64) { void[32] parmn = void; // place to copy struct if passed in regs void* p; auto tsize = tis.tsize(); TypeInfo arg1, arg2; if (!tis.argTypes(arg1, arg2)) // if could be passed in regs { assert(tsize <= parmn.length); p = parmn.ptr; va_arg(argptr, tis, p); } else { /* Avoid making a copy of the struct; take advantage of * it always being passed in memory */ // The arg may have more strict alignment than the stack auto talign = tis.talign(); __va_list* ap = cast(__va_list*)argptr; p = cast(void*)((cast(size_t)ap.stack_args + talign - 1) & ~(talign - 1)); ap.stack_args = cast(void*)(cast(size_t)p + ((tsize + size_t.sizeof - 1) & ~(size_t.sizeof - 1))); } s = tis.xtoString(p); } else static assert(0); goto Lputstr; } default: goto Lerror; } Lnumber: switch (fc) { case 's': case 'd': if (signed) { if (cast(long)vnumber < 0) { prefix = "-"; vnumber = -vnumber; } else if (flags & FLplus) prefix = "+"; else if (flags & FLspace) prefix = " "; } break; case 'b': signed = 0; base = 2; break; case 'o': signed = 0; base = 8; break; case 'X': uc = 1; if (flags & FLhash && vnumber) prefix = "0X"; signed = 0; base = 16; break; case 'x': if (flags & FLhash && vnumber) prefix = "0x"; signed = 0; base = 16; break; default: goto Lerror; } if (!signed) { switch (m) { case Mangle.Tbyte: vnumber &= 0xFF; break; case Mangle.Tshort: vnumber &= 0xFFFF; break; case Mangle.Tint: vnumber &= 0xFFFFFFFF; break; default: break; } } if (flags & FLprecision && fc != 'p') flags &= ~FL0pad; if (vnumber < base) { if (vnumber == 0 && precision == 0 && flags & FLprecision && !(fc == 'o' && flags & FLhash)) { putstr(null); return; } if (precision == 0 || !(flags & FLprecision)) { vchar = cast(char)('0' + vnumber); if (vnumber < 10) vchar = cast(char)('0' + vnumber); else vchar = cast(char)((uc ? 'A' - 10 : 'a' - 10) + vnumber); goto L2; } } sizediff_t n = tmpbuf.length; char c; int hexoffset = uc ? ('A' - ('9' + 1)) : ('a' - ('9' + 1)); while (vnumber) { c = cast(char)((vnumber % base) + '0'); if (c > '9') c += hexoffset; vnumber /= base; tmpbuf[--n] = c; } if (tmpbuf.length - n < precision && precision < tmpbuf.length) { sizediff_t m = tmpbuf.length - precision; tmpbuf[m .. n] = '0'; n = m; } else if (flags & FLhash && fc == 'o') prefix = "0"; putstr(tmpbuf[n .. tmpbuf.length]); return; Lreal: putreal(vreal); return; Lcomplex: putreal(vcreal.re); putc('+'); putreal(vcreal.im); putc('i'); return; Lerror: throw new FormatException("formatArg"); } for (int j = 0; j < arguments.length; ) { ti = arguments[j++]; //printf("arg[%d]: '%.*s' %d\n", j, ti.classinfo.name.length, ti.classinfo.name.ptr, ti.classinfo.name.length); //ti.print(); flags = 0; precision = 0; field_width = 0; ti = skipCI(ti); int mi = 9; do { if (ti.classinfo.name.length <= mi) goto Lerror; m = cast(Mangle)ti.classinfo.name[mi++]; } while (m == Mangle.Tconst || m == Mangle.Timmutable); if (m == Mangle.Tarray) { if (ti.classinfo.name.length == 14 && ti.classinfo.name[9..14] == "Array") { TypeInfo tn = cast()(cast(TypeInfo_Array)ti).next; tn = skipCI(tn); switch (cast(Mangle)tn.classinfo.name[9]) { case Mangle.Tchar: case Mangle.Twchar: case Mangle.Tdchar: ti = tn; mi = 9; break; default: break; } } L1: Mangle m2 = cast(Mangle)ti.classinfo.name[mi]; string fmt; // format string wstring wfmt; dstring dfmt; /* For performance reasons, this code takes advantage of the * fact that most format strings will be ASCII, and that the * format specifiers are always ASCII. This means we only need * to deal with UTF in a couple of isolated spots. */ switch (m2) { case Mangle.Tchar: fmt = va_arg!(string)(argptr); break; case Mangle.Twchar: wfmt = va_arg!(wstring)(argptr); fmt = toUTF8(wfmt); break; case Mangle.Tdchar: dfmt = va_arg!(dstring)(argptr); fmt = toUTF8(dfmt); break; case Mangle.Tconst: case Mangle.Timmutable: mi++; goto L1; default: formatArg('s'); continue; } for (size_t i = 0; i < fmt.length; ) { dchar c = fmt[i++]; dchar getFmtChar() { // Valid format specifier characters will never be UTF if (i == fmt.length) throw new FormatException("invalid specifier"); return fmt[i++]; } int getFmtInt() { int n; while (1) { n = n * 10 + (c - '0'); if (n < 0) // overflow throw new FormatException("int overflow"); c = getFmtChar(); if (c < '0' || c > '9') break; } return n; } int getFmtStar() { Mangle m; TypeInfo ti; if (j == arguments.length) throw new FormatException("too few arguments"); ti = arguments[j++]; m = cast(Mangle)ti.classinfo.name[9]; if (m != Mangle.Tint) throw new FormatException("int argument expected"); return va_arg!(int)(argptr); } if (c != '%') { if (c > 0x7F) // if UTF sequence { i--; // back up and decode UTF sequence c = std.utf.decode(fmt, i); } Lputc: putc(c); continue; } // Get flags {-+ #} flags = 0; while (1) { c = getFmtChar(); switch (c) { case '-': flags |= FLdash; continue; case '+': flags |= FLplus; continue; case ' ': flags |= FLspace; continue; case '#': flags |= FLhash; continue; case '0': flags |= FL0pad; continue; case '%': if (flags == 0) goto Lputc; break; default: break; } break; } // Get field width field_width = 0; if (c == '*') { field_width = getFmtStar(); if (field_width < 0) { flags |= FLdash; field_width = -field_width; } c = getFmtChar(); } else if (c >= '0' && c <= '9') field_width = getFmtInt(); if (flags & FLplus) flags &= ~FLspace; if (flags & FLdash) flags &= ~FL0pad; // Get precision precision = 0; if (c == '.') { flags |= FLprecision; //flags &= ~FL0pad; c = getFmtChar(); if (c == '*') { precision = getFmtStar(); if (precision < 0) { precision = 0; flags &= ~FLprecision; } c = getFmtChar(); } else if (c >= '0' && c <= '9') precision = getFmtInt(); } if (j == arguments.length) goto Lerror; ti = arguments[j++]; ti = skipCI(ti); mi = 9; do { m = cast(Mangle)ti.classinfo.name[mi++]; } while (m == Mangle.Tconst || m == Mangle.Timmutable); if (c > 0x7F) // if UTF sequence goto Lerror; // format specifiers can't be UTF formatArg(cast(char)c); } } else { formatArg('s'); } } return; Lerror: throw new FormatException(); } /* ======================== Unit Tests ====================================== */ unittest { int i; string s; debug(format) printf("std.format.format.unittest\n"); s = std.string.format("hello world! %s %s ", true, 57, 1_000_000_000, 'x', " foo"); assert(s == "hello world! true 57 1000000000x foo"); s = std.string.format(1.67, " %A ", -1.28, float.nan); /* The host C library is used to format floats. * C99 doesn't specify what the hex digit before the decimal point * is for %A. */ version (linux) assert(s == "1.67 -0XA.3D70A3D70A3D8P-3 nan"); else version (OSX) assert(s == "1.67 -0XA.3D70A3D70A3D8P-3 nan", s); else assert(s == "1.67 -0X1.47AE147AE147BP+0 nan"); s = std.string.format("%x %X", 0x1234AF, 0xAFAFAFAF); assert(s == "1234af AFAFAFAF"); s = std.string.format("%b %o", 0x1234AF, 0xAFAFAFAF); assert(s == "100100011010010101111 25753727657"); s = std.string.format("%d %s", 0x1234AF, 0xAFAFAFAF); assert(s == "1193135 2947526575"); version(X86_64) { pragma(msg, "several format tests disabled on x86_64 due to bug 5625"); } else { s = std.string.format("%s", 1.2 + 3.4i); assert(s == "1.2+3.4i"); s = std.string.format("%x %X", 1.32, 6.78f); assert(s == "3ff51eb851eb851f 40D8F5C3"); } s = std.string.format("%#06.*f",2,12.345); assert(s == "012.35"); s = std.string.format("%#0*.*f",6,2,12.345); assert(s == "012.35"); s = std.string.format("%7.4g:", 12.678); assert(s == " 12.68:"); s = std.string.format("%7.4g:", 12.678L); assert(s == " 12.68:"); s = std.string.format("%04f|%05d|%#05x|%#5x",-4.0,-10,1,1); assert(s == "-4.000000|-0010|0x001| 0x1"); i = -10; s = std.string.format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(s == "-10|-10|-10|-10|-10.0000"); i = -5; s = std.string.format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(s == "-5| -5|-05|-5|-5.0000"); i = 0; s = std.string.format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(s == "0| 0|000|0|0.0000"); i = 5; s = std.string.format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(s == "5| 5|005|5|5.0000"); i = 10; s = std.string.format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i); assert(s == "10| 10|010|10|10.0000"); s = std.string.format("%.0d", 0); assert(s == ""); s = std.string.format("%.g", .34); assert(s == "0.3"); s = std.string.format("%.0g", .34); assert(s == "0.3"); s = std.string.format("%.2g", .34); assert(s == "0.34"); s = std.string.format("%0.0008f", 1e-08); assert(s == "0.00000001"); s = std.string.format("%0.0008f", 1e-05); assert(s == "0.00001000"); s = "helloworld"; string r; r = std.string.format("%.2s", s[0..5]); assert(r == "he"); r = std.string.format("%.20s", s[0..5]); assert(r == "hello"); r = std.string.format("%8s", s[0..5]); assert(r == " hello"); byte[] arrbyte = new byte[4]; arrbyte[0] = 100; arrbyte[1] = -99; arrbyte[3] = 0; r = std.string.format(arrbyte); assert(r == "[100,-99,0,0]"); ubyte[] arrubyte = new ubyte[4]; arrubyte[0] = 100; arrubyte[1] = 200; arrubyte[3] = 0; r = std.string.format(arrubyte); assert(r == "[100,200,0,0]"); short[] arrshort = new short[4]; arrshort[0] = 100; arrshort[1] = -999; arrshort[3] = 0; r = std.string.format(arrshort); assert(r == "[100,-999,0,0]"); r = std.string.format("%s",arrshort); assert(r == "[100,-999,0,0]"); ushort[] arrushort = new ushort[4]; arrushort[0] = 100; arrushort[1] = 20_000; arrushort[3] = 0; r = std.string.format(arrushort); assert(r == "[100,20000,0,0]"); int[] arrint = new int[4]; arrint[0] = 100; arrint[1] = -999; arrint[3] = 0; r = std.string.format(arrint); assert(r == "[100,-999,0,0]"); r = std.string.format("%s",arrint); assert(r == "[100,-999,0,0]"); long[] arrlong = new long[4]; arrlong[0] = 100; arrlong[1] = -999; arrlong[3] = 0; r = std.string.format(arrlong); assert(r == "[100,-999,0,0]"); r = std.string.format("%s",arrlong); assert(r == "[100,-999,0,0]"); ulong[] arrulong = new ulong[4]; arrulong[0] = 100; arrulong[1] = 999; arrulong[3] = 0; r = std.string.format(arrulong); assert(r == "[100,999,0,0]"); string[] arr2 = new string[4]; arr2[0] = "hello"; arr2[1] = "world"; arr2[3] = "foo"; r = std.string.format(arr2); assert(r == "[hello,world,,foo]"); r = std.string.format("%.8d", 7); assert(r == "00000007"); r = std.string.format("%.8x", 10); assert(r == "0000000a"); r = std.string.format("%-3d", 7); assert(r == "7 "); r = std.string.format("%*d", -3, 7); assert(r == "7 "); r = std.string.format("%.*d", -3, 7); assert(r == "7"); //typedef int myint; //myint m = -7; //r = std.string.format(m); //assert(r == "-7"); r = std.string.format("abc"c); assert(r == "abc"); r = std.string.format("def"w); assert(r == "def"); r = std.string.format("ghi"d); assert(r == "ghi"); void* p = cast(void*)0xDEADBEEF; r = std.string.format(p); assert(r == "DEADBEEF"); r = std.string.format("%#x", 0xabcd); assert(r == "0xabcd"); r = std.string.format("%#X", 0xABCD); assert(r == "0XABCD"); r = std.string.format("%#o", octal!12345); assert(r == "012345"); r = std.string.format("%o", 9); assert(r == "11"); r = std.string.format("%+d", 123); assert(r == "+123"); r = std.string.format("%+d", -123); assert(r == "-123"); r = std.string.format("% d", 123); assert(r == " 123"); r = std.string.format("% d", -123); assert(r == "-123"); r = std.string.format("%%"); assert(r == "%"); r = std.string.format("%d", true); assert(r == "1"); r = std.string.format("%d", false); assert(r == "0"); r = std.string.format("%d", 'a'); assert(r == "97"); wchar wc = 'a'; r = std.string.format("%d", wc); assert(r == "97"); dchar dc = 'a'; r = std.string.format("%d", dc); assert(r == "97"); byte b = byte.max; r = std.string.format("%x", b); assert(r == "7f"); r = std.string.format("%x", ++b); assert(r == "80"); r = std.string.format("%x", ++b); assert(r == "81"); short sh = short.max; r = std.string.format("%x", sh); assert(r == "7fff"); r = std.string.format("%x", ++sh); assert(r == "8000"); r = std.string.format("%x", ++sh); assert(r == "8001"); i = int.max; r = std.string.format("%x", i); assert(r == "7fffffff"); r = std.string.format("%x", ++i); assert(r == "80000000"); r = std.string.format("%x", ++i); assert(r == "80000001"); r = std.string.format("%x", 10); assert(r == "a"); r = std.string.format("%X", 10); assert(r == "A"); r = std.string.format("%x", 15); assert(r == "f"); r = std.string.format("%X", 15); assert(r == "F"); Object c = null; r = std.string.format(c); assert(r == "null"); enum TestEnum { Value1, Value2 } r = std.string.format("%s", TestEnum.Value2); assert(r == "1"); immutable(char[5])[int] aa = ([3:"hello", 4:"betty"]); r = std.string.format("%s", aa.values); assert(r == "[[h,e,l,l,o],[b,e,t,t,y]]"); r = std.string.format("%s", aa); assert(r == "[3:[h,e,l,l,o],4:[b,e,t,t,y]]"); static const dchar[] ds = ['a','b']; for (int j = 0; j < ds.length; ++j) { r = std.string.format(" %d", ds[j]); if (j == 0) assert(r == " 97"); else assert(r == " 98"); } r = std.string.format(">%14d<, ", 15, [1,2,3]); assert(r == "> 15<, [1,2,3]"); assert(std.string.format("%8s", "bar") == " bar"); assert(std.string.format("%8s", "b\u00e9ll\u00f4") == " b\u00e9ll\u00f4"); } unittest { // bugzilla 3479 auto stream = appender!(char[])(); formattedWrite(stream, "%2$.*1$d", 12, 10); assert(stream.data == "000000000010", stream.data); }
D
/Users/ozgun/Desktop/IOSCase/build/IOSCase.build/Debug-iphonesimulator/IOSCase.build/Objects-normal/x86_64/TermsListView.o : /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewModelType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewControllerType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/AppDelegate.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ClientApi.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/TermsModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/Cell/TermsTableViewCell.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Common/Extension/UIImageView+Extension.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseViewController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseRouter.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ErrorGenerator.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Helpers/GlobalHelpers.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/Base/Result.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/HTTPClient.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailView.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/Accelerate.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/AVFoundation.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/CoreAudio.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/RxCocoa.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/RxRelay.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RX.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXObjCRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoaRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXKVOObserver.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXDelegateProxy.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.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.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.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.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/ozgun/Desktop/IOSCase/build/IOSCase.build/Debug-iphonesimulator/IOSCase.build/Objects-normal/x86_64/TermsListView~partial.swiftmodule : /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewModelType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewControllerType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/AppDelegate.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ClientApi.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/TermsModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/Cell/TermsTableViewCell.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Common/Extension/UIImageView+Extension.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseViewController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseRouter.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ErrorGenerator.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Helpers/GlobalHelpers.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/Base/Result.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/HTTPClient.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailView.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/Accelerate.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/AVFoundation.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/CoreAudio.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/RxCocoa.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/RxRelay.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RX.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXObjCRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoaRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXKVOObserver.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXDelegateProxy.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.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.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.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.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/ozgun/Desktop/IOSCase/build/IOSCase.build/Debug-iphonesimulator/IOSCase.build/Objects-normal/x86_64/TermsListView~partial.swiftdoc : /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewModelType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewControllerType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/AppDelegate.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ClientApi.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/TermsModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/Cell/TermsTableViewCell.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Common/Extension/UIImageView+Extension.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseViewController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseRouter.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ErrorGenerator.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Helpers/GlobalHelpers.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/Base/Result.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/HTTPClient.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailView.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/Accelerate.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/AVFoundation.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/CoreAudio.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/RxCocoa.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/RxRelay.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RX.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXObjCRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoaRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXKVOObserver.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXDelegateProxy.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.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.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.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.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/ozgun/Desktop/IOSCase/build/IOSCase.build/Debug-iphonesimulator/IOSCase.build/Objects-normal/x86_64/TermsListView~partial.swiftsourceinfo : /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewModelType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewControllerType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Utils/ViewType.swift /Users/ozgun/Desktop/IOSCase/IOSCase/AppDelegate.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ClientApi.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/TermsModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListViewModel.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/Cell/TermsTableViewCell.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Common/Extension/UIImageView+Extension.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseViewController.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/BaseViewController/BaseRouter.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/ErrorGenerator.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Helpers/GlobalHelpers.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Models/Base/Result.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Networking/HTTPClient.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermDetailController/TermDetailView.swift /Users/ozgun/Desktop/IOSCase/IOSCase/Controller/TermsListController/TermsListView.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/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.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/Accelerate.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/AVFoundation.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/CoreAudio.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/RxCocoa.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 /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/RxRelay.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RX.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-umbrella.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXObjCRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoaRuntime.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXKVOObserver.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-Swift.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXDelegateProxy.h /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/module.modulemap /Users/ozgun/Desktop/IOSCase/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.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.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.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.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AVKit.framework/Headers/AVKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
prototype Mst_Default_Keiler(C_Npc) { name[0] = CZ_NAME_Monster_Keiler; guild = GIL_MOLERAT; aivar[AIV_MM_REAL_ID] = ID_Keiler; level = 8; attribute[ATR_STRENGTH] = 80; attribute[ATR_DEXTERITY] = 60; attribute[ATR_HITPOINTS_MAX] = 200; attribute[ATR_HITPOINTS] = 200; attribute[ATR_MANA_MAX] = 0; attribute[ATR_MANA] = 0; protection[PROT_BLUNT] = 100; protection[PROT_EDGE] = 100; protection[PROT_POINT] = 60; protection[PROT_FIRE] = 30; protection[PROT_FLY] = 30; protection[PROT_MAGIC] = 10; damagetype = DAM_BLUNT; fight_tactic = FAI_WOLF; senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL; senses_range = PERC_DIST_MONSTER_ACTIVE_MAX; aivar[AIV_MM_ThreatenBeforeAttack] = TRUE; aivar[AIV_MM_FollowTime] = FOLLOWTIME_LONG; aivar[AIV_MM_FollowInWater] = TRUE; aivar[AIV_MM_Packhunter] = TRUE; start_aistate = ZS_MM_AllScheduler; aivar[AIV_MM_SleepStart] = 22; aivar[AIV_MM_SleepEnd] = 6; aivar[AIV_MM_RoamStart] = 6; aivar[AIV_MM_RoamEnd] = 22; }; func void B_SetVisuals_Keiler() { Mdl_SetVisual(self,"Keiler.mds"); Mdl_SetVisualBody(self,"Keiler_Body",DEFAULT,DEFAULT,"",DEFAULT,DEFAULT,-1); }; func void b_setvisuals_keiles() { Mdl_SetVisual(self,"Keiler_VB.mds"); Mdl_SetVisualBody(self,"Keilerv_Body",DEFAULT,DEFAULT,"",DEFAULT,DEFAULT,-1); //Mdl_SetVisual(self,"Keiler.mds"); //Mdl_SetVisualBody(self,"Keiles_Body",DEFAULT,DEFAULT,"",DEFAULT,DEFAULT,-1); }; instance Keiler(Mst_Default_Keiler) { name[0] = CZ_NAME_Monster_Keiler; aivar[AIV_Gender] = TRUE; level = 8; attribute[ATR_STRENGTH] = 80; attribute[ATR_DEXTERITY] = 60; attribute[ATR_HITPOINTS_MAX] = 300; attribute[ATR_HITPOINTS] = 300; attribute[ATR_MANA_MAX] = 0; attribute[ATR_MANA] = 0; protection[PROT_BLUNT] = 100; protection[PROT_EDGE] = 100; protection[PROT_POINT] = 60; protection[PROT_FIRE] = 30; protection[PROT_FLY] = 30; protection[PROT_MAGIC] = 10; B_SetVisuals_Keiler(); Npc_SetToFistMode(self); }; instance KEILER_VEPR(Mst_Default_Keiler) { name[0] = CZ_NAME_Monster_Keiler_Vepr; level = 35; aivar[90] = TRUE; attribute[ATR_STRENGTH] = 170; attribute[ATR_DEXTERITY] = 140; attribute[ATR_HITPOINTS_MAX] = 1000; attribute[ATR_HITPOINTS] = 1000; attribute[ATR_MANA_MAX] = 0; attribute[ATR_MANA] = 0; protection[PROT_BLUNT] = 175; protection[PROT_EDGE] = 175; protection[PROT_POINT] = 140; protection[PROT_FIRE] = 50; protection[PROT_FLY] = 50; protection[PROT_MAGIC] = 30; b_setvisuals_keiles(); Npc_SetToFistMode(self); CreateInvItems(self,itat_veprfur,1); Mdl_SetModelScale(self,1.2,1.2,1.2); }; instance KEILER_YOUNG(Mst_Default_Keiler) { name[0] = CZ_NAME_Monster_Keiler; aivar[AIV_Gender] = TRUE; level = 6; attribute[ATR_STRENGTH] = 40; attribute[ATR_DEXTERITY] = 40; attribute[ATR_HITPOINTS_MAX] = 60; attribute[ATR_HITPOINTS] = 60; attribute[ATR_MANA_MAX] = 0; attribute[ATR_MANA] = 0; protection[PROT_BLUNT] = 15; protection[PROT_EDGE] = 20; protection[PROT_POINT] = 20; protection[PROT_FIRE] = 20; protection[PROT_FLY] = 20; protection[PROT_MAGIC] = 0; B_SetVisuals_Keiler(); Npc_SetToFistMode(self); };
D
module smtp.reply; import std.conv; /++ SMTP server reply codes, RFC 2921, April 2001 +/ enum SmtpReplyCode : uint { HELP_STATUS = 211, // Information reply HELP = 214, // Information reply READY = 220, // After connection is established QUIT = 221, // After connected aborted AUTH_SUCCESS = 235, // Authentication succeeded OK = 250, // Transaction success FORWARD = 251, // Non-local user, message is forwarded VRFY_FAIL = 252, // Verification failed (still attempt to deliver) AUTH_CONTINUE = 334, // Answer to AUTH <method> prompting to send auth data DATA_START = 354, // Server starts to accept mail data NA = 421, // Not Available. Shutdown must follow after this reply NEED_PASSWORD = 435, // Password transition is needed BUSY = 450, // Mail action failed ABORTED = 451, // Action aborted (internal server error) STORAGE = 452, // Not enough system storage on server TLS = 454, // TLS unavailable | Temporary Auth fail SYNTAX = 500, // Command syntax error | Too long auth command line SYNTAX_PARAM = 501, // Command parameter syntax error NI = 502, // Command not implemented BAD_SEQUENCE = 503, // This command breaks specified allowed sequences NI_PARAM = 504, // Command parameter not implemented AUTH_REQUIRED = 530, // Authentication required AUTH_TOO_WEAK = 534, // Need stronger authentication type AUTH_CRED = 535, // Wrong authentication credentials AUTH_ENCRYPTION = 538, // Encryption reqiured for current authentication type MAILBOX = 550, // Mailbox is not found (for different reasons) TRY_FORWARD = 551, // Non-local user, forwarding is needed MAILBOX_STORAGE = 552, // Storage for mailbox exceeded MAILBOX_NAME = 553, // Unallowed name for the mailbox FAIL = 554 // Transaction fail }; /++ SMTP Reply +/ struct SmtpReply { bool success; uint code; string message; string toString() { return to!string(code) ~ message; } }; unittest { // Testing SmtpReply toString converesion auto reply = SmtpReply(true, 220, " Hello, ready to work\r\n"); assert(reply.toString == "220 Hello, ready to work\r\n"); }
D
a monastery of friars
D
void main() { runSolver(); } void problem() { auto N = scan!long; auto solve() { char[] ans; while(N > 0) { if (N % 2 == 0) { N /= 2; ans ~= "B"; } else { N--; ans ~= "A"; } } return ans.reverse.array.to!string; } outputForAtCoder(&solve); } // ---------------------------------------------- import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric, std.traits, std.functional, std.bigint, std.datetime.stopwatch, core.time, core.bitop; T[][] combinations(T)(T[] s, in long m) { if (!m) return [[]]; if (s.empty) return []; return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); } string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; } T scan(T)(){ return scan.to!T; } T[] scan(T)(long n){ return n.iota.map!(i => scan!T()).array; } void deb(T ...)(T t){ debug writeln(t); } alias Point = Tuple!(long, "x", long, "y"); Point invert(Point p) { return Point(p.y, p.x); } long[] divisors(long n) { long[] ret; for (long i = 1; i * i <= n; i++) { if (n % i == 0) { ret ~= i; if (i * i != n) ret ~= n / i; } } return ret.sort.array; } bool chmin(T)(ref T a, T b) { if (b < a) { a = b; return true; } else return false; } bool chmax(T)(ref T a, T b) { if (b > a) { a = b; return true; } else return false; } string charSort(alias S = "a < b")(string s) { return (cast(char[])((cast(byte[])s).sort!S.array)).to!string; } ulong comb(ulong a, ulong b) { if (b == 0) {return 1;}else{return comb(a - 1, b - 1) * a / b;}} string toAnswerString(R)(R r) { return r.map!"a.to!string".joiner(" ").array.to!string; } struct ModInt(uint MD) if (MD < int.max) {ulong v;this(string v) {this(v.to!long);}this(int v) {this(long(v));}this(long v) {this.v = (v%MD+MD)%MD;}void opAssign(long t) {v = (t%MD+MD)%MD;}static auto normS(ulong x) {return (x<MD)?x:x-MD;}static auto make(ulong x) {ModInt m; m.v = x; return m;}auto opBinary(string op:"+")(ModInt r) const {return make(normS(v+r.v));}auto opBinary(string op:"-")(ModInt r) const {return make(normS(v+MD-r.v));}auto opBinary(string op:"*")(ModInt r) const {return make((ulong(v)*r.v%MD).to!ulong);}auto opBinary(string op:"^^", T)(T r) const {long x=v;long y=1;while(r){if(r%2==1)y=(y*x)%MD;x=x^^2%MD;r/=2;} return make(y);}auto opBinary(string op:"/")(ModInt r) const {return this*memoize!inv(r);}static ModInt inv(ModInt x) {return x^^(MD-2);}string toString() const {return v.to!string;}auto opOpAssign(string op)(ModInt r) {return mixin ("this=this"~op~"r");}} alias MInt1 = ModInt!(10^^9 + 7); alias MInt9 = ModInt!(998_244_353); void outputForAtCoder(T)(T delegate() fn) { static if (is(T == float) || is(T == double) || is(T == real)) "%.16f".writefln(fn()); else static if (is(T == void)) fn(); else static if (is(T == string)) fn().writeln; else static if (isInputRange!T) { static if (!is(string == ElementType!T) && isInputRange!(ElementType!T)) foreach(r; fn()) r.toAnswerString.writeln; else foreach(r; fn()) r.writeln; } else fn().writeln; } void runSolver() { enum BORDER = "=================================="; debug { BORDER.writeln; while(!stdin.eof) { "<<< Process time: %s >>>".writefln(benchmark!problem(1)); BORDER.writeln; } } else problem(); } enum YESNO = [true: "Yes", false: "No"]; // -----------------------------------------------
D
module dinu.command.desktop; import dinu; __gshared: shared immutable class CommandDesktop: Command { string exec; this(string args){ auto split = args.bangSplit; super(Type.desktop, split[0], options.colorDesktop); exec = split[1]; } override string serialize(){ return [name, exec].bangJoin; } override int draw(DrawEmpty draw, int[2] pos, bool selected, immutable(int)[] positions){ int origX = pos.x; pos.x += super.draw(draw, pos, selected, positions); return pos.x-origX; } override string hint(){ return exec; } override size_t score(){ return 12; } override string filterText(){ return name ~ exec; } override void run(string parameter){ this.spawnCommand(exec, parameter); } override void spawnCommand(string command, string arguments=""){ options.configPath.execute(type.to!string, serialize.replace("!", "\\!"), command, arguments.replace("!", "\\!")); } }
D
/Users/nikhilsridhar/Desktop/Shopp/Shopp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager.o : /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/MultipartFormData.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Timeline.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Alamofire.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Response.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/TaskDelegate.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/SessionDelegate.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ParameterEncoding.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Validation.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ResponseSerialization.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/SessionManager.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/AFError.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Notifications.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Result.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Request.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/nikhilsridhar/Desktop/Shopp/Shopp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/nikhilsridhar/Desktop/Shopp/Shopp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftmodule : /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/MultipartFormData.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Timeline.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Alamofire.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Response.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/TaskDelegate.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/SessionDelegate.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ParameterEncoding.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Validation.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ResponseSerialization.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/SessionManager.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/AFError.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Notifications.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Result.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Request.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/nikhilsridhar/Desktop/Shopp/Shopp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/nikhilsridhar/Desktop/Shopp/Shopp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftdoc : /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/MultipartFormData.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Timeline.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Alamofire.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Response.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/TaskDelegate.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/SessionDelegate.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ParameterEncoding.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Validation.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ResponseSerialization.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/SessionManager.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/AFError.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Notifications.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Result.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/Request.swift /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nikhilsridhar/Desktop/Shopp/Shopp/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/nikhilsridhar/Desktop/Shopp/Shopp/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
/// Authors: Chance Snow /// Copyright: Copyright © 2021 Chance Snow. All rights reserved. /// License: MIT License module descartes.path.arc;
D
void main() @safe /*@nogc*/ { import std.stdio, std.algorithm, std.typecons, std.conv; static struct Bounty { int value; double weight, volume; } immutable Bounty panacea = {3000, 0.3, 0.025}; immutable Bounty ichor = {1800, 0.2, 0.015}; immutable Bounty gold = {2500, 2.0, 0.002}; immutable Bounty sack = { 0, 25.0, 0.25 }; immutable maxPanacea = min(sack.weight / panacea.weight, sack.volume / panacea.volume).to!int; immutable maxIchor = min(sack.weight / ichor.weight, sack.volume / ichor.volume).to!int; immutable maxGold = min(sack.weight / gold.weight, sack.volume / gold.volume).to!int; Bounty best = {0, 0, 0}; Tuple!(int, int, int) bestAmounts; foreach (immutable nPanacea; 0 .. maxPanacea) foreach (immutable nIchor; 0 .. maxIchor) foreach (immutable nGold; 0 .. maxGold) { immutable Bounty current = { value: nPanacea * panacea.value + nIchor * ichor.value + nGold * gold.value, weight: nPanacea * panacea.weight + nIchor * ichor.weight + nGold * gold.weight, volume: nPanacea * panacea.volume + nIchor * ichor.volume + nGold * gold.volume}; if (current.value > best.value && current.weight <= sack.weight && current.volume <= sack.volume) { best = Bounty(current.value, current.weight, current.volume); bestAmounts = tuple(nPanacea, nIchor, nGold); } } writeln("Maximum value achievable is ", best.value); writefln("This is achieved by carrying (one solution) %d" ~ " panacea, %d ichor and %d gold", bestAmounts[]); writefln("The weight to carry is %4.1f and the volume used is %5.3f", best.weight, best.volume); }
D
// Written in the D programming language /** This module offers some conversions functions from a Graph to a range. License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. Authors: Philippe Sigaud 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 dranges.graphrange; import std.array, std.exception, std.range; import dranges.algorithm, dranges.graph, dranges.queue, dranges.range, dranges.stack; /// enum TraversalMode {DepthFirst, BreadthFirst}; /** A lazy range struct that traverses a graph in a depth-first or breadth-first manner, as specified at creation with the TraversalMode enum. It produces labels, not the nodes or their values. See_Also: traversal, valueTraversal. */ struct GraphTraversal(N,E,TraversalMode travmode) if (isNode!N && isEdge!E) { alias typeof(N.label) Label; bool[Label] visited; Graph!(N,E) graph; static if (travmode == TraversalMode.DepthFirst) Stack!Label toBeVisited; else Queue!Label toBeVisited; this(Graph!(N,E) g) { this(g, g.labels.front); // No first node given: we begin on g's "first" node. } this(Graph!(N,E) g, Label l) { enforce(l in g); graph = g; toBeVisited = typeof(toBeVisited)(g.size); toBeVisited.push(l); // The node n is the beginning of the traversal. } Label front() { return toBeVisited.top(); } void pushNodes(Label first) { static if (travmode == TraversalMode.DepthFirst) { // depth -> stack -> foreach_reverse foreach_reverse(Label l; graph.neighbors(first)) { // node if (!(l in visited)) toBeVisited.push(l); } } else { // breadth -> queue -> foreach foreach(Label l; graph.neighbors(first)) { if (!(l in visited)) toBeVisited.push(l); } } } @property GraphTraversal save() { return this;} void popFront() { auto first = toBeVisited.pop(); visited[first] = true; pushNodes(first); } bool empty() { // We purge old nodes that have already been visited due to cycles in the graph while (!toBeVisited.empty() && (toBeVisited.top() in visited)) toBeVisited.pop(); return toBeVisited.empty; } } /** Generic function to create a Traversal struct. Prefer the use of depthFirst or breadthFirst. */ GraphTraversal!(N,E,trav) traversal(TraversalMode trav, N,E,L)(Graph!(N,E) graph, L label) if(is(typeof(N.label) == L)) { return GraphTraversal!(N,E,trav)(graph, label); } /** Returns a range that traverses the graph in a depth-first or breadth-first way, from the node labeled label. The graph returns labels, not nodes. */ GraphTraversal!(N,E,TraversalMode.DepthFirst) depthFirst(N,E,L)(Graph!(N,E) graph, L label) if(is(typeof(N.label) == L)) { return GraphTraversal!(N,E,TraversalMode.DepthFirst)(graph, label); } /// ditto GraphTraversal!(N,E,TraversalMode.BreadthFirst) breadthFirst(N,E,L)(Graph!(N,E) graph, L label) if(is(typeof(N.label) == L)) { return GraphTraversal!(N,E,TraversalMode.BreadthFirst)(graph, label); } /** Returns a range that traverses the graph in a depth-first or breadth-first way, from node label, and returns the nodes value. Note: first try, probably horribly inefficient. */ TMapType!("a[b].value", Repeat!(Graph!(N,E)), GraphTraversal!(N,E,TraversalMode.DepthFirst)) depthFirstValues(N,E,L)(Graph!(N,E) graph, L label) if(is(typeof(N.label) == L)) { return tmap!"a[b].value"(repeat(graph), depthFirst(graph,label)); } /// ditto TMapType!("a[b].value", Repeat!(Graph!(N,E)), GraphTraversal!(N,E,TraversalMode.BreadthFirst)) breadthFirstValues(N,E,L)(Graph!(N,E) graph, L label) if(is(typeof(N.label) == L)) { return tmap!"a[b].value"(repeat(graph), breadthFirst(graph,label)); }
D
/Users/linkov/Documents/sdwr/texture-maker/texturelib/target/rls/debug/build/stdweb-8da71b55ae429bd4/build_script_build-8da71b55ae429bd4: /Users/linkov/.cargo/registry/src/github.com-1ecc6299db9ec823/stdweb-0.4.20/build.rs /Users/linkov/Documents/sdwr/texture-maker/texturelib/target/rls/debug/build/stdweb-8da71b55ae429bd4/build_script_build-8da71b55ae429bd4.d: /Users/linkov/.cargo/registry/src/github.com-1ecc6299db9ec823/stdweb-0.4.20/build.rs /Users/linkov/.cargo/registry/src/github.com-1ecc6299db9ec823/stdweb-0.4.20/build.rs:
D
/Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/Kitura.build/staticFileServer/ResponseHeadersSetter.swift.o : /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Kitura.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHTTPVerbs_generated.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMethod.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/contentType/ContentType.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddleware.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterResponse.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/SSLConfig.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Stack.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/BodyParserProtocol.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/HTTPVersion.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/RangeHeader.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddlewareWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterParameterWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterElementWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/ResourcePathHandler.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHandler.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/BodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/JSONBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/URLEncodedBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/MultiPartBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/TextBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/RawBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/LinkParameter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/CacheRelatedHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/ResponseHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/CompositeHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Router.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/CodableRouter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/FileResourceServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/FileServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/StaticFileServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHTTPVerbs+Error.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Error.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/JSONPError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/TemplatingError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/InternalError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddlewareGenerator.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/MimeTypeAcceptor.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/contentType/types.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/String+Extensions.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Headers.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterElement.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/Part.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterRequest.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouteRegex.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/ParsedBody.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/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/LoggerAPI.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/SSLService.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraTemplateEngine.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraContracts.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraNet.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/Socket.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/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/CHTTPParser.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/http_parser.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/utils.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/CCurl.git-8026296523752779197/module.modulemap /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/CHTTPParser.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/Kitura.build/ResponseHeadersSetter~partial.swiftmodule : /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Kitura.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHTTPVerbs_generated.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMethod.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/contentType/ContentType.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddleware.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterResponse.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/SSLConfig.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Stack.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/BodyParserProtocol.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/HTTPVersion.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/RangeHeader.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddlewareWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterParameterWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterElementWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/ResourcePathHandler.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHandler.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/BodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/JSONBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/URLEncodedBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/MultiPartBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/TextBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/RawBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/LinkParameter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/CacheRelatedHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/ResponseHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/CompositeHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Router.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/CodableRouter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/FileResourceServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/FileServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/StaticFileServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHTTPVerbs+Error.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Error.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/JSONPError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/TemplatingError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/InternalError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddlewareGenerator.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/MimeTypeAcceptor.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/contentType/types.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/String+Extensions.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Headers.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterElement.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/Part.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterRequest.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouteRegex.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/ParsedBody.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/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/LoggerAPI.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/SSLService.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraTemplateEngine.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraContracts.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraNet.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/Socket.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/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/CHTTPParser.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/http_parser.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/utils.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/CCurl.git-8026296523752779197/module.modulemap /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/CHTTPParser.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/Kitura.build/ResponseHeadersSetter~partial.swiftdoc : /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Kitura.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHTTPVerbs_generated.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMethod.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/contentType/ContentType.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddleware.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterResponse.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/SSLConfig.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Stack.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/BodyParserProtocol.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/HTTPVersion.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/RangeHeader.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddlewareWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterParameterWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterElementWalker.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/ResourcePathHandler.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHandler.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/BodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/JSONBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/URLEncodedBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/MultiPartBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/TextBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/RawBodyParser.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/LinkParameter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/CacheRelatedHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/ResponseHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/CompositeHeadersSetter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Router.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/CodableRouter.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/FileResourceServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/FileServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/staticFileServer/StaticFileServer.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterHTTPVerbs+Error.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Error.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/JSONPError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/TemplatingError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/InternalError.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterMiddlewareGenerator.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/MimeTypeAcceptor.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/contentType/types.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/String+Extensions.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/Headers.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterElement.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/Part.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouterRequest.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/RouteRegex.swift /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura.git-6522211175291160341/Sources/Kitura/bodyParser/ParsedBody.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/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/LoggerAPI.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/SSLService.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraTemplateEngine.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraContracts.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/KituraNet.swiftmodule /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/Socket.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/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/CHTTPParser.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/http_parser.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/Kitura-net.git--7410958935072501107/Sources/CHTTPParser/include/utils.h /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/checkouts/CCurl.git-8026296523752779197/module.modulemap /Users/GLB-312/Desktop/KituraWebInterface_Starter/.build/x86_64-apple-macosx10.10/debug/CHTTPParser.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
/** * TypeInfo support code. * * Copyright: Copyright Digital Mars 2004 - 2009. * License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). * Authors: Walter Bright */ /* Copyright Digital Mars 2004 - 2009. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) */ module rt.typeinfo.ti_Afloat; private import rt.typeinfo.ti_float; private import rt.util.hash; // float[] class TypeInfo_Af : TypeInfo_Array { override bool opEquals(Object o) { return TypeInfo.opEquals(o); } override string toString() const { return "float[]"; } override size_t getHash(in void* p) @trusted const { float[] s = *cast(float[]*)p; return rt.util.hash.hashOf(s.ptr, s.length * float.sizeof); } override bool equals(in void* p1, in void* p2) const { float[] s1 = *cast(float[]*)p1; float[] s2 = *cast(float[]*)p2; size_t len = s1.length; if (len != s2.length) return 0; for (size_t u = 0; u < len; u++) { if (!TypeInfo_f._equals(s1[u], s2[u])) return false; } return true; } override int compare(in void* p1, in void* p2) const { float[] s1 = *cast(float[]*)p1; float[] s2 = *cast(float[]*)p2; size_t len = s1.length; if (s2.length < len) len = s2.length; for (size_t u = 0; u < len; u++) { int c = TypeInfo_f._compare(s1[u], s2[u]); if (c) return c; } if (s1.length < s2.length) return -1; else if (s1.length > s2.length) return 1; return 0; } override @property inout(TypeInfo) next() inout { return cast(inout)typeid(float); } } // ifloat[] class TypeInfo_Ao : TypeInfo_Af { override string toString() const { return "ifloat[]"; } override @property inout(TypeInfo) next() inout { return cast(inout)typeid(ifloat); } }
D
module dfmt.editorconfig; import std.regex : ctRegex; static if (__VERSION__ >= 2067) public import std.traits : FieldNameTuple; else { private enum NameOf(alias T) = T.stringof; template FieldNameTuple(T) { import std.typetuple : staticMap; import std.traits : isNested; static if (is(T == struct) || is(T == union)) alias FieldNameTuple = staticMap!(NameOf, T.tupleof[0 .. $ - isNested!T]); else static if (is(T == class)) alias FieldNameTuple = staticMap!(NameOf, T.tupleof); else alias FieldNameTuple = TypeTuple!""; } } private auto headerRe = ctRegex!(`^\s*\[([^\n]+)\]\s*(:?#.*)?$`); private auto propertyRe = ctRegex!(`^\s*([\w_]+)\s*=\s*([\w_]+)\s*[#;]?.*$`); private auto commentRe = ctRegex!(`^\s*[#;].*$`); enum OptionalBoolean : ubyte { unspecified = 3, t = 1, f = 0 } enum IndentStyle : ubyte { unspecified, tab, space } enum EOL : ubyte { unspecified, lf, cr, crlf } mixin template StandardEditorConfigFields() { string pattern; OptionalBoolean root; EOL end_of_line; OptionalBoolean insert_final_newline; string charset; IndentStyle indent_style; int indent_size = -1; int tab_width = -1; OptionalBoolean trim_trailing_whitespace; int max_line_length = -1; void merge(ref const typeof(this) other, const string fileName) { import dfmt.globmatch_editorconfig : globMatchEditorConfig; import std.array : front, popFront, empty, save; if (other.pattern is null || !ecMatch(fileName, other.pattern)) return; foreach (N; FieldNameTuple!(typeof(this))) { alias T = typeof(mixin(N)); const otherN = mixin("other." ~ N); auto thisN = &mixin("this." ~ N); static if (N == "pattern") continue; else static if (is(T == enum)) *thisN = otherN != T.unspecified ? otherN : *thisN; else static if (is(T == int)) *thisN = otherN != -1 ? otherN : *thisN; else static if (is(T == string)) *thisN = otherN !is null ? otherN : *thisN; else static assert(false); } } private bool ecMatch(string fileName, string patt) { import std.algorithm : canFind; import std.path : baseName; import dfmt.globmatch_editorconfig : globMatchEditorConfig; if (!pattern.canFind("/")) fileName = fileName.baseName; return fileName.globMatchEditorConfig(patt); } } unittest { struct Config { mixin StandardEditorConfigFields; } Config config1; Config config2; config2.pattern = "test.d"; config2.end_of_line = EOL.crlf; assert(config1.end_of_line != config2.end_of_line); config1.merge(config2, "a/b/test.d"); assert(config1.end_of_line == config2.end_of_line); } /** * Params: * path = the path to the file * Returns: * The configuration for the file at the given path */ EC getConfigFor(EC)(string path) { import std.stdio : File; import std.regex : regex, match; import std.path : globMatch, dirName, baseName, pathSplitter, buildPath, absolutePath; import std.algorithm : reverse, map, filter; import std.array : array; import std.file : isDir; EC result; EC[][] configs; immutable expanded = absolutePath(path); immutable bool id = isDir(expanded); immutable string fileName = id ? "dummy.d" : baseName(expanded); string[] pathParts = cast(string[]) pathSplitter(expanded).array(); for (size_t i = pathParts.length; i > 1; i--) { EC[] sections = parseConfig!EC(buildPath(pathParts[0 .. i])); if (sections.length) configs ~= sections; if (!sections.map!(a => a.root).filter!(a => a == OptionalBoolean.t).empty) break; } reverse(configs); static if (__VERSION__ >= 2067) { import std.algorithm : each; configs.each!(a => a.each!(b => result.merge(b, fileName)))(); } else { foreach (c; configs) foreach (d; c) result.merge(d, fileName); } return result; } private EC[] parseConfig(EC)(string dir) { import std.stdio : File; import std.file : exists; import std.path : buildPath; import std.regex : matchAll; import std.conv : to; import std.uni : toLower; EC section; EC[] sections; immutable string path = buildPath(dir, ".editorconfig"); if (!exists(path)) return sections; File f = File(path); foreach (line; f.byLine()) { auto l = line.idup; auto headerMatch = l.matchAll(headerRe); if (headerMatch) { sections ~= section; section = EC.init; auto c = headerMatch.captures; c.popFront(); section.pattern = c.front(); } else { auto propertyMatch = l.matchAll(propertyRe); if (propertyMatch) { auto c = propertyMatch.captures; c.popFront(); immutable string propertyName = c.front(); c.popFront(); immutable string propertyValue = toLower(c.front()); foreach (F; FieldNameTuple!EC) { enum configDot = "section." ~ F; alias FieldType = typeof(mixin(configDot)); if (F == propertyName) { static if (is(FieldType == OptionalBoolean)) mixin(configDot) = propertyValue == "true" ? OptionalBoolean.t : OptionalBoolean.f; else mixin(configDot) = to!(FieldType)(propertyValue); } } } } } sections ~= section; return sections; }
D
module isystem; public: import platform; import ivalidator; import igame; import ixmldom; import ixml; import cry_camera; import frame_profiler; import cry_version; import iinput; import iconsole; import ilog; import iscriptsystem; import ientitysystem; import irenderer; import inetwork : INetwork; extern (C++) { interface ICryPak { } interface IKeyboard { } interface IMouse { } interface IProcess { } interface I3DEngine { } interface ITimer { } interface IAISystem { } interface IFlash { } interface ICryFont { } interface IMovieSystem { } interface IPhysicalWorld { } interface IMemoryManager { } interface ISoundSystem { } interface IMusicSystem { } //interface XDOM::IXMLDOMDocument{} interface IFrameProfileSystem { } interface FrameProfiler { } interface IStreamEngine { } interface ICryCharManager { } interface IDataProbe { } interface ICrySizer { } interface CXFont { } ////////////////////////////////////////////////////////////////////////// enum ESystemUpdateFlags { ESYSUPDATE_IGNORE_AI = 0x0001, ESYSUPDATE_IGNORE_PHYSICS = 0x0002, // Special update mode for editor. ESYSUPDATE_EDITOR = 0x0004, ESYSUPDATE_MULTIPLAYER = 0x0008 }; ////////////////////////////////////////////////////////////////////////// enum ESystemConfigSpec { CONFIG_LOW_SPEC = 0, CONFIG_MEDIUM_SPEC = 1, CONFIG_HIGH_SPEC = 2, CONFIG_VERYHIGH_SPEC = 3, }; ////////////////////////////////////////////////////////////////////////// // User defined callback, which can be passed to ISystem. interface ISystemUserCallback { /** Signals to User that engine error occured. @return true to Halt execution or false to ignore this error. */ bool OnError(const char * szErrorString); /** If working in Editor environment notify user that engine want to Save current document. This happens if critical error have occured and engine gives a user way to save data and not lose it due to crash. */ void OnSaveDocument(); /** Notify user that system wants to switch out of current process. (For ex. Called when pressing ESC in game mode to go to Menu). */ void OnProcessSwitch(); }; ////////////////////////////////////////////////////////////////////////// // Structure passed to Init method of ISystem interface. struct SSystemInitParams { void * hInstance; // void * hWnd; // char[512] szSystemCmdLine; // command line, used to execute the early commands e.g. -DEVMODE "g_gametype ASSAULT" ISystemUserCallback * pUserCallback; // ILog * pLog; // You can specify your own ILog to be used by System. IValidator * pValidator; // You can specify different validator object to use by System. const char * sLogFileName; // File name to use for log. bool bEditor; // When runing in Editor mode. bool bPreview; // When runing in Preview mode (Minimal initialization). bool bTestMode; // When runing in Automated testing mode. bool bDedicatedServer; // When runing a dedicated server. ISystem * pSystem; // Pointer to existing ISystem interface, it will be reused if not NULL. version (Linux) { //void (*pCheckFunc)(void*); // authentication function (must be set). } else { void * pCheckFunc; // authentication function (must be set). } }; ////////////////////////////////////////////////////////////////////////// // Structure passed to CreateGame method of ISystem interface. struct SGameInitParams { const char * sGameDLL; // Name of Game DLL. (Win32 Only) IGame pGame; // Pointer to already created game interface. bool bDedicatedServer; // When runing a dedicated server. char[256] szGameCmdLine; // command line, used to execute the console commands after game creation e.g. -DEVMODE "g_gametype ASSAULT" } //////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////// // Main Engine Interface // initialize and dispatch all engine's subsystems interface ISystem { // Loads GameDLL and creates game instance. bool CreateGame(ref SGameInitParams params); // Release ISystem. void Release(); // Update all subsystems (including the ScriptSink() ) // @param flags one or more flags from ESystemUpdateFlags sructure. // @param boolean to set when in pause or cutscene mode in order to avoid // certain subsystem updates 0=menu/pause, 1=cutscene mode bool Update(int updateFlags, int nPauseMode); // update _time, _frametime (useful after loading level to apply the time value) void UpdateScriptSink(); // Begin rendering frame. void RenderBegin(); // Render subsystems. void Render(); // End rendering frame and swap back buffer. void RenderEnd(); // Renders the statistics; this is called from RenderEnd, but if the // Host application (Editor) doesn't employ the Render cycle in ISystem, // it may call this method to render the essencial statistics void RenderStatistics(); // Retrieve the name of the user currently logged in to the computer const char * GetUserName(); // Gets current supported CPU features flags. (CPUF_SSE, CPUF_SSE2, CPUF_3DNOW, CPUF_MMX) int GetCPUFlags(); // Get seconds per processor tick double GetSecondsPerCycle(); // dumps the memory usage statistics to the log void DumpMemoryUsageStatistics(); // Quit the appliacation void Quit(); // Tells the system if it is relaunching or not void Relaunch(bool bRelaunch); // return true if the application is in the shutdown phase bool IsQuitting(); // Display error message. // Logs it to console and file and error message box. // Then terminates execution. void Error(const char * sFormat, ...); //DOC-IGNORE-BEGIN //[Timur] DEPRECATED! Use Validator Warning instead. // Display warning message. // Logs it to console and file and display a warning message box. // Not terminates execution. //__declspec(deprecated) void Warning( const char *sFormat,... ); //DOC-IGNORE-END // Report warning to current Validator object. // Not terminates execution. void Warning(EValidatorModule _module, EValidatorSeverity severity, int flags, const char * file, const char * format, ...); // Compare specified verbosity level to the one currently set. bool CheckLogVerbosity(int verbosity); // returns true if this is dedicated server application bool IsDedicated(); // return the related subsystem interface IGame GetIGame(); INetwork GetINetwork(); IRenderer GetIRenderer(); IInput GetIInput(); ITimer GetITimer(); IConsole GetIConsole(); IScriptSystem GetIScriptSystem(); I3DEngine GetI3DEngine(); ISoundSystem GetISoundSystem(); IMusicSystem GetIMusicSystem(); IPhysicalWorld GetIPhysicalWorld(); IMovieSystem GetIMovieSystem(); IAISystem GetAISystem(); IMemoryManager GetIMemoryManager(); IEntitySystem GetIEntitySystem(); ICryFont GetICryFont(); ICryPak GetIPak(); ILog GetILog(); IStreamEngine GetStreamEngine(); ICryCharManager GetIAnimationSystem(); IValidator GetIValidator(); IFrameProfileSystem GetIProfileSystem(); void DebugStats(bool checkpoint, bool leaks); void DumpWinHeaps(); int DumpMMStats(bool log); ////////////////////////////////////////////////////////////////////////// // @param bValue set to true when running on a cheat protected server or a client that is connected to it (not used in singlplayer) void SetForceNonDevMode(const bool bValue); // @return is true when running on a cheat protected server or a client that is connected to it (not used in singlplayer) bool GetForceNonDevMode() const; bool WasInDevMode() const; bool IsDevMode() const; XDOM.IXMLDOMDocument CreateXMLDocument(); ////////////////////////////////////////////////////////////////////////// // IXmlNode interface. ////////////////////////////////////////////////////////////////////////// // Creates new xml node. XmlNodeRef CreateXmlNode(const char * sNodeName); // Load xml file, return 0 if load failed. XmlNodeRef LoadXmlFile(const char * sFilename); // Load xml from string, return 0 if load failed. XmlNodeRef LoadXmlFromString(const char * sXmlString); void SetViewCamera(ref CCamera Camera); ref CCamera GetViewCamera(); void CreateEntityScriptBinding(IEntity pEntity); // When ignore update sets to true, system will ignore and updates and render calls. void IgnoreUpdates(bool bIgnore); // Set rate of Garbage Collection for script system. // @param fRate in seconds void SetGCFrequency(const float fRate); /* Set the active process @param process a pointer to a class that implement the IProcess interface */ void SetIProcess(IProcess process); /* Get the active process @return a pointer to the current active process */ IProcess GetIProcess(); version (Win32) { IRenderer CreateRenderer(bool fullscreen, void * hinst, void * hWndAttach); } // Returns true if system running in Test mode. bool IsTestMode() const; void ShowDebugger(const char * pszSourceFile, int iLine, const char * pszReason); ////////////////////////////////////////////////////////////////////////// // Frame profiler functions void SetFrameProfiler(bool on, bool display, char * prefix); // Starts section profiling. void StartProfilerSection(CFrameProfilerSection * pProfileSection); // Stops section profiling. void EndProfilerSection(CFrameProfilerSection * pProfileSection); ////////////////////////////////////////////////////////////////////////// // VTune Profiling interface. // Resume vtune data collection. void VTuneResume(); // Pauses vtune data collection. void VTunePause(); ////////////////////////////////////////////////////////////////////////// void Deltree(const char * szFolder, bool bRecurse); ////////////////////////////////////////////////////////////////////////// // File version. ////////////////////////////////////////////////////////////////////////// const ref SFileVersion GetFileVersion(); const ref SFileVersion GetProductVersion(); // Compressed file read & write bool WriteCompressedFile(char * filename, void * data, uint bitlen); uint ReadCompressedFile(char * filename, void * data, uint maxbitlen); uint GetCompressedFileSize(char * filename); // Sample: char str[256]; bool bRet=GetSSFileInfo("C:\\mastercd\\materials\\compound_indoor.xml",str,256); // get info about the last SourceSafe action for a specifed file (Name,Comment,Date) // @param inszFileName inszFileName!, e.g. "c:\\mastercd\\AssetMan\\AssetManShellExt\\AssManMenu.cpp" // @param outszInfo outszInfo!, [0..indwBufferSize-1] // @param indwBufferSize >0 // @return true=success, false otherwise (output parameter is set to empty strings) bool GetSSFileInfo(const char * inszFileName, char * outszInfo, const DWORD indwBufferSize); // Retrieve IDataProbe interface. IDataProbe * GetIDataProbe(); ////////////////////////////////////////////////////////////////////////// // Configuration. ////////////////////////////////////////////////////////////////////////// // Saves system configuration. void SaveConfiguration(); // Loads system configuration void LoadConfiguration(const string sFilename); // Get current configuration specification. ESystemConfigSpec GetConfigSpec(); } ////////////////////////////////////////////////////////////////////////// // CrySystem DLL Exports. ////////////////////////////////////////////////////////////////////////// // Get the system interface (must be defined locally in each module) ISystem GetISystem(); // interface of the DLL extern (C) { export ISystem CreateSystemInterface(ref SSystemInitParams initParams); } ////////////////////////////////////////////////////////////////////////// // Logs important data that must be printed regardless verbosity. void CryLogAlways(const char * format, ...) { if (GetISystem()) { va_list args; va_start(args, format); GetISystem().GetILog().LogV(ILog.ELogType.eAlways, format, args); va_end(args); } } }
D
/* Copyright (c) 2007-2010 iMatix Corporation This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 0MQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ module deimos.zmq.zmq; extern (C) { /******************************************************************************/ /* 0MQ versioning support. */ /******************************************************************************/ /* Version macros for compile-time API version detection */ enum { ZMQ_VERSION_MAJOR =2, ZMQ_VERSION_MINOR =1, ZMQ_VERSION_PATCH =10 } /* Run-time API version detection */ void zmq_version(int* major, int* minor, int* patch); /******************************************************************************/ /* 0MQ errors. */ /******************************************************************************/ /* A number random anough not to collide with different errno ranges on */ /* different OSes. The assumption is that error_t is at least 32-bit type. */ immutable enum { ZMQ_HAUSNUMERO = 156384712, /* On Windows platform some of the standard POSIX errnos are not defined. */ ENOTSUP = (ZMQ_HAUSNUMERO + 1), EPROTONOSUPPORT = (ZMQ_HAUSNUMERO + 2), ENOBUFS = (ZMQ_HAUSNUMERO + 3), ENETDOWN = (ZMQ_HAUSNUMERO + 4), EADDRINUSE = (ZMQ_HAUSNUMERO + 5), EADDRNOTAVAIL = (ZMQ_HAUSNUMERO + 6), ECONNREFUSED = (ZMQ_HAUSNUMERO + 7), EINPROGRESS = (ZMQ_HAUSNUMERO + 8), ENOTSOCK = (ZMQ_HAUSNUMERO + 9), /* Native 0MQ error codes. */ EFSM = (ZMQ_HAUSNUMERO + 51), ENOCOMPATPROTO = (ZMQ_HAUSNUMERO + 52), ETERM = (ZMQ_HAUSNUMERO + 53), EMTHREAD = (ZMQ_HAUSNUMERO + 54) }//enum error_code /* This function retrieves the errno as it is known to 0MQ library. The goal */ /* of this function is to make the code 100% portable, including where 0MQ */ /* compiled with certain CRT library (on Windows) is linked to an */ /* application that uses different CRT library. */ int zmq_errno(); /* Resolves system errors and 0MQ errors to human-readable string. */ char* zmq_strerror(int errnum); /******************************************************************************/ /* 0MQ message definition. */ /******************************************************************************/ immutable enum { /* Maximal size of "Very Small Message". VSMs are passed by value */ /* to avoid excessive memory allocation/deallocation. */ /* If VMSs larger than 255 bytes are required, type of 'vsm_size' */ /* field in zmq_msg_t structure should be modified accordingly. */ ZMQ_MAX_VSM_SIZE = 30, /* Message types. These integers may be stored in 'content' member of the */ /* message instead of regular pointer to the data. */ ZMQ_DELIMITER = 31, ZMQ_VSM = 32, /* Message flags. ZMQ_MSG_SHARED is strictly speaking not a message flag */ /* (it has no equivalent in the wire format), however, making it a flag */ /* allows us to pack the stucture tigher and thus improve performance. */ ZMQ_MSG_MORE = 1, ZMQ_MSG_SHARED = 128, ZMQ_MSG_MASK = 129 } /* A message. Note that 'content' is not a pointer to the raw data. */ /* Rather it is pointer to zmq::msg_content_t structure */ /* (see src/msg_content.hpp for its definition). */ struct zmq_msg_t { void* content; ubyte flags; ubyte vsm_size; ubyte vsm_data[ZMQ_MAX_VSM_SIZE]; } int zmq_msg_init(zmq_msg_t* msg); int zmq_msg_init_size(zmq_msg_t* msg, size_t size); int zmq_msg_init_data(zmq_msg_t* msg, void* data, size_t size, void function(void* data, void* hint), void* hint); int zmq_msg_close(zmq_msg_t* msg); int zmq_msg_move(zmq_msg_t* dest, zmq_msg_t* src); int zmq_msg_copy(zmq_msg_t* dest, zmq_msg_t* src); void* zmq_msg_data(zmq_msg_t* msg); size_t zmq_msg_size(zmq_msg_t* msg); /******************************************************************************/ /* 0MQ infrastructure (a.k.a. context) initialisation & termination. */ /******************************************************************************/ void* zmq_init(int io_threads); int zmq_term(void* context); /******************************************************************************/ /* 0MQ socket definition. */ /******************************************************************************/ /* Socket types. */ immutable enum { ZMQ_PAIR = 0, ZMQ_PUB = 1, ZMQ_SUB = 2, ZMQ_REQ = 3, ZMQ_REP = 4, ZMQ_DEALER = 5, ZMQ_ROUTER = 6, ZMQ_PULL = 7, ZMQ_PUSH = 8, ZMQ_XPUB = 9, ZMQ_XSUB = 10, ZMQ_XREQ = ZMQ_DEALER, /* Old alias, remove in 3.x */ ZMQ_XREP = ZMQ_ROUTER, /* Old alias, remove in 3.x */ ZMQ_UPSTREAM = ZMQ_PULL, /* Old alias, remove in 3.x */ ZMQ_DOWNSTREAM = ZMQ_PUSH /* Old alias, remove in 3.x */ } /* Socket options. */ immutable enum { ZMQ_HWM = 1, ZMQ_SWAP = 3, ZMQ_AFFINITY = 4, ZMQ_IDENTITY = 5, ZMQ_SUBSCRIBE = 6, ZMQ_UNSUBSCRIBE = 7, ZMQ_RATE = 8, ZMQ_RECOVERY_IVL = 9, ZMQ_MCAST_LOOP = 10, ZMQ_SNDBUF = 11, ZMQ_RCVBUF = 12, ZMQ_RCVMORE = 13, ZMQ_FD = 14, ZMQ_EVENTS = 15, ZMQ_TYPE = 16, ZMQ_LINGER = 17, ZMQ_RECONNECT_IVL = 18, ZMQ_BACKLOG = 19, ZMQ_RECOVERY_IVL_MSEC = 20, /*opt. recovery time, reconcile in 3.x */ ZMQ_RECONNECT_IVL_MAX = 21 } /* Send/recv options. */ immutable enum { ZMQ_NOBLOCK = 1, ZMQ_SNDMORE = 2 } void* zmq_socket(void* context, int type); int zmq_close(void* s); int zmq_setsockopt(void* s, int option, void* optval, size_t optvallen); int zmq_getsockopt(void* s, int option, void* optval, size_t *optvallen); int zmq_bind(void* s, const char* addr); int zmq_connect(void* s, immutable char* addr); int zmq_send(void* s, zmq_msg_t* msg, int flags); int zmq_recv(void* s, zmq_msg_t* msg, int flags); /******************************************************************************/ /* I/O multiplexing. */ /******************************************************************************/ immutable enum { ZMQ_POLLIN = 1, ZMQ_POLLOUT = 2, ZMQ_POLLERR = 4 } __gshared struct zmq_pollitem_t { void* socket; version (win32) { SOCKET fd; } else { int fd; } short events; short revents; } int zmq_poll(zmq_pollitem_t* items, int nitems, long timeout); /******************************************************************************/ /* Built-in devices */ /******************************************************************************/ immutable enum { ZMQ_STREAMER = 1, ZMQ_FORWARDER = 2, ZMQ_QUEUE = 3 } int zmq_device(int device, void* insocket, void* outsocket); }// extern (C)
D
/Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/PhoneNumberKit.build/Objects-normal/x86_64/TextField.o : /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/UI/TextField.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumber.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/MetadataManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/ParseManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/RegexManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumberParser.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/Formatter.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PartialFormatter.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/MetadataTypes.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/Constants.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/NSRegularExpression+Swift.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumberKit.swift /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/zaidtayyab/Desktop/Template/Pods/Target\ Support\ Files/PhoneNumberKit/PhoneNumberKit-umbrella.h /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/PhoneNumberKit.build/unextended-module.modulemap /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/PhoneNumberKit.build/Objects-normal/x86_64/TextField~partial.swiftmodule : /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/UI/TextField.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumber.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/MetadataManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/ParseManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/RegexManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumberParser.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/Formatter.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PartialFormatter.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/MetadataTypes.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/Constants.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/NSRegularExpression+Swift.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumberKit.swift /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/zaidtayyab/Desktop/Template/Pods/Target\ Support\ Files/PhoneNumberKit/PhoneNumberKit-umbrella.h /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/PhoneNumberKit.build/unextended-module.modulemap /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/PhoneNumberKit.build/Objects-normal/x86_64/TextField~partial.swiftdoc : /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/UI/TextField.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumber.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/MetadataManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/ParseManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/RegexManager.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumberParser.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/Formatter.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PartialFormatter.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/MetadataTypes.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/Constants.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/NSRegularExpression+Swift.swift /Users/zaidtayyab/Desktop/Template/Pods/PhoneNumberKit/PhoneNumberKit/PhoneNumberKit.swift /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/zaidtayyab/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/zaidtayyab/Desktop/Template/Pods/Target\ Support\ Files/PhoneNumberKit/PhoneNumberKit-umbrella.h /Users/zaidtayyab/Desktop/Template/Build/Template/Build/Intermediates/Pods.build/Debug-iphonesimulator/PhoneNumberKit.build/unextended-module.modulemap
D
/** * D header file for C99. * * Copyright: Copyright Sean Kelly 2005 - 2009. * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. * Authors: Sean Kelly, Alex Rønne Petersen * Standards: ISO/IEC 9899:1999 (E) */ /* Copyright Sean Kelly 2005 - 2009. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) */ module core.stdc.stdio; private { import core.stdc.config; import core.stdc.stddef; // for size_t import core.stdc.stdarg; // for va_list import core.stdc.stdint : intptr_t; version (FreeBSD) { import core.sys.posix.sys.types; } else version (Android) { import core.sys.posix.sys.types: off_t; } } extern (C): @system: nothrow: version( Win32 ) { enum { BUFSIZ = 0x4000, EOF = -1, FOPEN_MAX = 20, FILENAME_MAX = 256, // 255 plus NULL TMP_MAX = 32767, SYS_OPEN = 20, // non-standard } enum int _NFILE = 60; // non-standard enum string _P_tmpdir = "\\"; // non-standard enum wstring _wP_tmpdir = "\\"; // non-standard enum int L_tmpnam = _P_tmpdir.length + 12; } else version( Win64 ) { enum { BUFSIZ = 512, EOF = -1, FOPEN_MAX = 20, FILENAME_MAX = 260, TMP_MAX = 32767, _SYS_OPEN = 20, // non-standard } enum int _NFILE = 512; // non-standard enum string _P_tmpdir = "\\"; // non-standard enum wstring _wP_tmpdir = "\\"; // non-standard enum int L_tmpnam = _P_tmpdir.length + 12; } else version( linux ) { enum { BUFSIZ = 8192, EOF = -1, FOPEN_MAX = 16, FILENAME_MAX = 4095, TMP_MAX = 238328, L_tmpnam = 20 } } else version( OSX ) { enum { BUFSIZ = 1024, EOF = -1, FOPEN_MAX = 20, FILENAME_MAX = 1024, TMP_MAX = 308915776, L_tmpnam = 1024, } private { struct __sbuf { ubyte* _base; int _size; } struct __sFILEX { } } } else version ( FreeBSD ) { enum { BUFSIZ = 1024, EOF = -1, FOPEN_MAX = 20, FILENAME_MAX = 1024, TMP_MAX = 308915776, L_tmpnam = 1024 } struct __sbuf { ubyte *_base; int _size; } union __mbstate_t // <sys/_types.h> { char[128] _mbstate8; long _mbstateL; } } else version (Solaris) { enum { BUFSIZ = 1024, EOF = -1, FOPEN_MAX = _NFILE, FILENAME_MAX = 1024, TMP_MAX = 17576, L_tmpnam = 25, } version (X86) enum int _NFILE = 60; else enum int _NFILE = 20; } else version( Android ) { enum { BUFSIZ = 1024, EOF = -1, FOPEN_MAX = 20, FILENAME_MAX = 1024, TMP_MAX = 308915776, L_tmpnam = 1024 } struct __sbuf { ubyte* _base; int _size; } } else { static assert( false, "Unsupported platform" ); } enum { SEEK_SET, SEEK_CUR, SEEK_END } version( Win32 ) { alias int fpos_t; //check this struct _iobuf { char* _ptr; int _cnt; char* _base; int _flag; int _file; int _charbuf; int _bufsiz; char* __tmpnum; } alias shared(_iobuf) FILE; } else version( Win64 ) { alias int fpos_t; //check this struct _iobuf { char* _ptr; int _cnt; char* _base; int _flag; int _file; int _charbuf; int _bufsiz; char* _tmpfname; } alias shared(_iobuf) FILE; } else version( linux ) { alias int fpos_t; //this is probably wrong, fix this struct _IO_FILE { int _flags; char* _read_ptr; char* _read_end; char* _read_base; char* _write_base; char* _write_ptr; char* _write_end; char* _buf_base; char* _buf_end; char* _save_base; char* _backup_base; char* _save_end; void* _markers; _IO_FILE* _chain; int _fileno; int _blksize; int _old_offset; ushort _cur_column; byte _vtable_offset; char[1] _shortbuf; void* _lock; } alias _IO_FILE _iobuf; //remove later alias shared(_IO_FILE) FILE; } else version( OSX ) { alias int fpos_t; //check this struct __sFILE { ubyte* _p; int _r; int _w; short _flags; short _file; __sbuf _bf; int _lbfsize; void* _cookie; int function(void*) _close; int function(void*, char*, int) _read; fpos_t function(void*, fpos_t, int) _seek; int function(void*, char *, int) _write; __sbuf _ub; __sFILEX* _extra; int _ur; ubyte[3] _ubuf; ubyte[1] _nbuf; __sbuf _lb; int _blksize; fpos_t _offset; } alias __sFILE _iobuf; //remove later alias shared(__sFILE) FILE; } else version( FreeBSD ) { alias int fpos_t; //check this struct __sFILE { ubyte* _p; int _r; int _w; short _flags; short _file; __sbuf _bf; int _lbfsize; void* _cookie; int function(void*) _close; int function(void*, char*, int) _read; fpos_t function(void*, fpos_t, int) _seek; int function(void*, in char*, int) _write; __sbuf _ub; ubyte* _up; int _ur; ubyte[3] _ubuf; ubyte[1] _nbuf; __sbuf _lb; int _blksize; fpos_t _offset; pthread_mutex_t _fl_mutex; pthread_t _fl_owner; int _fl_count; int _orientation; __mbstate_t _mbstate; } alias __sFILE _iobuf; //remove later alias shared(__sFILE) FILE; } else version (Solaris) { alias int fpos_t; //check this struct _iobuf { char* _ptr; int _cnt; char* _base; char _flag; char _magic; ushort __flags; // __orientation:2 // __ionolock:1 // __seekable:1 // __extendedfd:1 // __xf_nocheck:1 // __filler:10 } alias shared(_iobuf) FILE; } else version( Android ) { alias off_t fpos_t; struct __sFILE { ubyte* _p; int _r; int _w; short _flags; short _file; __sbuf _bf; int _lbfsize; void* _cookie; int function(void*) _close; int function(void*, char*, int) _read; fpos_t function(void*, fpos_t, int) _seek; int function(void*, in char*, int) _write; __sbuf _ext; ubyte* _up; int _ur; ubyte[3] _ubuf; ubyte[1] _nbuf; __sbuf _lb; int _blksize; fpos_t _offset; } alias __sFILE _iobuf; //remove later alias shared(__sFILE) FILE; } else { static assert( false, "Unsupported platform" ); } enum { _F_RDWR = 0x0003, // non-standard _F_READ = 0x0001, // non-standard _F_WRIT = 0x0002, // non-standard _F_BUF = 0x0004, // non-standard _F_LBUF = 0x0008, // non-standard _F_ERR = 0x0010, // non-standard _F_EOF = 0x0020, // non-standard _F_BIN = 0x0040, // non-standard _F_IN = 0x0080, // non-standard _F_OUT = 0x0100, // non-standard _F_TERM = 0x0200, // non-standard } version( Win32 ) { enum { _IOFBF = 0, _IOLBF = 0x40, _IONBF = 4, _IOREAD = 1, // non-standard _IOWRT = 2, // non-standard _IOMYBUF = 8, // non-standard _IOEOF = 0x10, // non-standard _IOERR = 0x20, // non-standard _IOSTRG = 0x40, // non-standard _IORW = 0x80, // non-standard _IOTRAN = 0x100, // non-standard _IOAPP = 0x200, // non-standard } extern shared void function() _fcloseallp; private extern shared FILE[_NFILE] _iob; shared stdin = &_iob[0]; shared stdout = &_iob[1]; shared stderr = &_iob[2]; shared stdaux = &_iob[3]; shared stdprn = &_iob[4]; } else version( Win64 ) { enum { _IOFBF = 0, _IOLBF = 0x40, _IONBF = 4, _IOREAD = 1, // non-standard _IOWRT = 2, // non-standard _IOMYBUF = 8, // non-standard _IOEOF = 0x10, // non-standard _IOERR = 0x20, // non-standard _IOSTRG = 0x40, // non-standard _IORW = 0x80, // non-standard _IOAPP = 0x200, // non-standard _IOAPPEND = 0x200, // non-standard } extern shared void function() _fcloseallp; private extern shared FILE[_NFILE] _iob; shared(FILE)* __iob_func(); shared FILE* stdin; // = &__iob_func()[0]; shared FILE* stdout; // = &__iob_func()[1]; shared FILE* stderr; // = &__iob_func()[2]; } else version( linux ) { enum { _IOFBF = 0, _IOLBF = 1, _IONBF = 2, } extern shared FILE* stdin; extern shared FILE* stdout; extern shared FILE* stderr; } else version( OSX ) { enum { _IOFBF = 0, _IOLBF = 1, _IONBF = 2, } private extern shared FILE* __stdinp; private extern shared FILE* __stdoutp; private extern shared FILE* __stderrp; alias __stdinp stdin; alias __stdoutp stdout; alias __stderrp stderr; } else version( FreeBSD ) { enum { _IOFBF = 0, _IOLBF = 1, _IONBF = 2, } private extern shared FILE* __stdinp; private extern shared FILE* __stdoutp; private extern shared FILE* __stderrp; alias __stdinp stdin; alias __stdoutp stdout; alias __stderrp stderr; } else version (Solaris) { enum { _IOFBF = 0x00, _IOLBF = 0x40, _IONBF = 0x04, _IOEOF = 0x20, _IOERR = 0x40, _IOREAD = 0x01, _IOWRT = 0x02, _IORW = 0x80, _IOMYBUF = 0x08, } private extern shared FILE[_NFILE] __iob; shared stdin = &__iob[0]; shared stdout = &__iob[1]; shared stderr = &__iob[2]; } else version( Android ) { enum { _IOFBF = 0, _IOLBF = 1, _IONBF = 2, } private extern shared FILE[3] __sF; shared stdin = &__sF[0]; shared stdout = &__sF[1]; shared stderr = &__sF[2]; } else { static assert( false, "Unsupported platform" ); } int remove(in char* filename); int rename(in char* from, in char* to); @trusted FILE* tmpfile(); // No unsafe pointer manipulation. char* tmpnam(char* s); int fclose(FILE* stream); // No unsafe pointer manipulation. @trusted { int fflush(FILE* stream); } FILE* fopen(in char* filename, in char* mode); FILE* freopen(in char* filename, in char* mode, FILE* stream); void setbuf(FILE* stream, char* buf); int setvbuf(FILE* stream, char* buf, int mode, size_t size); version (MinGW) { // Prefer the MinGW versions over the MSVC ones, as the latter don't handle // reals at all. int __mingw_fprintf(FILE* stream, in char* format, ...); alias __mingw_fprintf fprintf; int __mingw_fscanf(FILE* stream, in char* format, ...); alias __mingw_fscanf fscanf; int __mingw_sprintf(char* s, in char* format, ...); alias __mingw_sprintf sprintf; int __mingw_sscanf(in char* s, in char* format, ...); alias __mingw_sscanf sscanf; int __mingw_vfprintf(FILE* stream, in char* format, va_list arg); alias __mingw_vfprintf vfprintf; int __mingw_vfscanf(FILE* stream, in char* format, va_list arg); alias __mingw_vfscanf vfscanf; int __mingw_vsprintf(char* s, in char* format, va_list arg); alias __mingw_vsprintf vsprintf; int __mingw_vsscanf(in char* s, in char* format, va_list arg); alias __mingw_vsscanf vsscanf; int __mingw_vprintf(in char* format, va_list arg); alias __mingw_vprintf vprintf; int __mingw_vscanf(in char* format, va_list arg); alias __mingw_vscanf vscanf; int __mingw_printf(in char* format, ...); alias __mingw_printf printf; int __mingw_scanf(in char* format, ...); alias __mingw_scanf scanf; } else { int fprintf(FILE* stream, in char* format, ...); int fscanf(FILE* stream, in char* format, ...); int sprintf(char* s, in char* format, ...); int sscanf(in char* s, in char* format, ...); int vfprintf(FILE* stream, in char* format, va_list arg); int vfscanf(FILE* stream, in char* format, va_list arg); int vsprintf(char* s, in char* format, va_list arg); int vsscanf(in char* s, in char* format, va_list arg); int vprintf(in char* format, va_list arg); int vscanf(in char* format, va_list arg); int printf(in char* format, ...); int scanf(in char* format, ...); } // No usafe pointer manipulation. @trusted { int fgetc(FILE* stream); int fputc(int c, FILE* stream); } char* fgets(char* s, int n, FILE* stream); int fputs(in char* s, FILE* stream); char* gets(char* s); int puts(in char* s); // No unsafe pointer manipulation. extern (D) @trusted { int getchar() { return getc(stdin); } int putchar(int c) { return putc(c,stdout); } int getc(FILE* stream) { return fgetc(stream); } int putc(int c, FILE* stream) { return fputc(c,stream); } } @trusted int ungetc(int c, FILE* stream); // No unsafe pointer manipulation. size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream); size_t fwrite(in void* ptr, size_t size, size_t nmemb, FILE* stream); // No unsafe pointer manipulation. @trusted { int fgetpos(FILE* stream, fpos_t * pos); int fsetpos(FILE* stream, in fpos_t* pos); int fseek(FILE* stream, c_long offset, int whence); c_long ftell(FILE* stream); } version( MinGW ) { // No unsafe pointer manipulation. extern (D) @trusted { void rewind(FILE* stream) { fseek(stream,0L,SEEK_SET); stream._flag&=~_IOERR; } pure void clearerr(FILE* stream) { stream._flag &= ~(_IOERR|_IOEOF); } pure int feof(FILE* stream) { return stream._flag&_IOEOF; } pure int ferror(FILE* stream) { return stream._flag&_IOERR; } } int __mingw_snprintf(char* s, size_t n, in char* fmt, ...); alias __mingw_snprintf _snprintf; alias __mingw_snprintf snprintf; int __mingw_vsnprintf(char* s, size_t n, in char* format, va_list arg); alias __mingw_vsnprintf _vsnprintf; alias __mingw_vsnprintf vsnprintf; } else version( Win32 ) { // No unsafe pointer manipulation. extern (D) @trusted { void rewind(FILE* stream) { fseek(stream,0L,SEEK_SET); stream._flag&=~_IOERR; } pure void clearerr(FILE* stream) { stream._flag &= ~(_IOERR|_IOEOF); } pure int feof(FILE* stream) { return stream._flag&_IOEOF; } pure int ferror(FILE* stream) { return stream._flag&_IOERR; } } int _snprintf(char* s, size_t n, in char* fmt, ...); alias _snprintf snprintf; int _vsnprintf(char* s, size_t n, in char* format, va_list arg); alias _vsnprintf vsnprintf; } else version( Win64 ) { // No unsafe pointer manipulation. extern (D) @trusted { void rewind(FILE* stream) { fseek(stream,0L,SEEK_SET); stream._flag&=~_IOERR; } pure void clearerr(FILE* stream) { stream._flag &= ~(_IOERR|_IOEOF); } pure int feof(FILE* stream) { return stream._flag&_IOEOF; } pure int ferror(FILE* stream) { return stream._flag&_IOERR; } pure int fileno(FILE* stream) { return stream._file; } } int _snprintf(char* s, size_t n, in char* fmt, ...); alias _snprintf snprintf; int _vsnprintf(char* s, size_t n, in char* format, va_list arg); alias _vsnprintf vsnprintf; uint _set_output_format(uint format); enum _TWO_DIGIT_EXPONENT = 1; int _filbuf(FILE *fp); int _flsbuf(int c, FILE *fp); int _fputc_nolock(int c, FILE *fp) { if (--fp._cnt >= 0) return *fp._ptr++ = cast(char)c; else return _flsbuf(c, fp); } int _fgetc_nolock(FILE *fp) { if (--fp._cnt >= 0) return *fp._ptr++; else return _filbuf(fp); } int _lock_file(FILE *fp); int _unlock_file(FILE *fp); intptr_t _get_osfhandle(int fd); int _open_osfhandle(intptr_t osfhandle, int flags); } else version( linux ) { // No unsafe pointer manipulation. @trusted { void rewind(FILE* stream); pure void clearerr(FILE* stream); pure int feof(FILE* stream); pure int ferror(FILE* stream); int fileno(FILE *); } int snprintf(char* s, size_t n, in char* format, ...); int vsnprintf(char* s, size_t n, in char* format, va_list arg); } else version( OSX ) { // No unsafe pointer manipulation. @trusted { void rewind(FILE*); pure void clearerr(FILE*); pure int feof(FILE*); pure int ferror(FILE*); int fileno(FILE*); } int snprintf(char* s, size_t n, in char* format, ...); int vsnprintf(char* s, size_t n, in char* format, va_list arg); } else version( FreeBSD ) { // No unsafe pointer manipulation. @trusted { void rewind(FILE*); pure void clearerr(FILE*); pure int feof(FILE*); pure int ferror(FILE*); int fileno(FILE*); } int snprintf(char* s, size_t n, in char* format, ...); int vsnprintf(char* s, size_t n, in char* format, va_list arg); } else version (Solaris) { // No unsafe pointer manipulation. @trusted { void rewind(FILE*); pure void clearerr(FILE*); pure int feof(FILE*); pure int ferror(FILE*); int fileno(FILE*); } int snprintf(char* s, size_t n, in char* format, ...); int vsnprintf(char* s, size_t n, in char* format, va_list arg); } else version( Android ) { // No unsafe pointer manipulation. @trusted { void rewind(FILE*); pure void clearerr(FILE*); pure int feof(FILE*); pure int ferror(FILE*); int fileno(FILE*); } int snprintf(char* s, size_t n, in char* format, ...); int vsnprintf(char* s, size_t n, in char* format, va_list arg); } else { static assert( false, "Unsupported platform" ); } void perror(in char* s); version (DigitalMars) version (Win32) { import core.sys.windows.windows; enum { FHND_APPEND = 0x04, FHND_DEVICE = 0x08, FHND_TEXT = 0x10, FHND_BYTE = 0x20, FHND_WCHAR = 0x40, } private enum _MAX_SEMAPHORES = 10 + _NFILE; private enum _semIO = 3; private extern __gshared short _iSemLockCtrs[_MAX_SEMAPHORES]; private extern __gshared int _iSemThreadIds[_MAX_SEMAPHORES]; private extern __gshared int _iSemNestCount[_MAX_SEMAPHORES]; private extern __gshared HANDLE[_NFILE] _osfhnd; private extern __gshared ubyte[_NFILE] __fhnd_info; private void _WaitSemaphore(int iSemaphore); private void _ReleaseSemaphore(int iSemaphore); // this is copied from semlock.h in DMC's runtime. private void LockSemaphore(uint num) { asm { mov EDX, num; lock; inc _iSemLockCtrs[EDX * 2]; jz lsDone; push EDX; call _WaitSemaphore; add ESP, 4; } lsDone: {} } // this is copied from semlock.h in DMC's runtime. private void UnlockSemaphore(uint num) { asm { mov EDX, num; lock; dec _iSemLockCtrs[EDX * 2]; js usDone; push EDX; call _ReleaseSemaphore; add ESP, 4; } usDone: {} } // This converts a HANDLE to a file descriptor in DMC's runtime int _handleToFD(HANDLE h, int flags) { LockSemaphore(_semIO); scope(exit) UnlockSemaphore(_semIO); foreach (fd; 0 .. _NFILE) { if (!_osfhnd[fd]) { _osfhnd[fd] = h; __fhnd_info[fd] = cast(ubyte)flags; return fd; } } return -1; } HANDLE _fdToHandle(int fd) { // no semaphore is required, once inserted, a file descriptor // doesn't change. if (fd < 0 || fd >= _NFILE) return null; return _osfhnd[fd]; } enum { O_RDONLY = 0x000, O_WRONLY = 0x001, O_RDWR = 0x002, O_APPEND = 0x008, O_CREAT = 0x100, O_TRUNC = 0x200, O_EXCL = 0x400, } enum { S_IREAD = 0x0100, S_IWRITE = 0x0080, } enum { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2, } int open(const(char)* filename, int flags, ...); int close(int fd); FILE *fdopen(int fd, const(char)* flags); }
D
module game.topology.lightref; import gamelib.containers.intrusivelist; import game.units; import game.topology.room; import game.renderer.light; struct LightRef { Light light; Room room; LightRef* prev; //for allocator IntrusiveListLink roomLink; IntrusiveListLink entityLink; }
D
/Users/apple/Developer/SuperDemo/build/SuperDemo.build/Debug-iphonesimulator/SuperDemo.build/Objects-normal/x86_64/EditTableViewController.o : /Users/apple/Developer/SuperDemo/SuperDemo/TableViewCell.swift /Users/apple/Developer/SuperDemo/SuperDemo/Item.swift /Users/apple/Developer/SuperDemo/SuperDemo/Detail.swift /Users/apple/Developer/SuperDemo/SuperDemo/EditTableViewController.swift /Users/apple/Developer/SuperDemo/SuperDemo/ViewController.swift /Users/apple/Developer/SuperDemo/SuperDemo/AppDelegate.swift /Users/apple/Developer/SuperDemo/SuperDemo/ViewControllerExtension.swift /Users/apple/Developer/SuperDemo/SuperDemo/EditCell.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64.swiftmodule /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Users/apple/Developer/SuperDemo/build/SuperDemo.build/Debug-iphonesimulator/SuperDemo.build/Objects-normal/x86_64/EditTableViewController~partial.swiftmodule : /Users/apple/Developer/SuperDemo/SuperDemo/TableViewCell.swift /Users/apple/Developer/SuperDemo/SuperDemo/Item.swift /Users/apple/Developer/SuperDemo/SuperDemo/Detail.swift /Users/apple/Developer/SuperDemo/SuperDemo/EditTableViewController.swift /Users/apple/Developer/SuperDemo/SuperDemo/ViewController.swift /Users/apple/Developer/SuperDemo/SuperDemo/AppDelegate.swift /Users/apple/Developer/SuperDemo/SuperDemo/ViewControllerExtension.swift /Users/apple/Developer/SuperDemo/SuperDemo/EditCell.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64.swiftmodule /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap /Users/apple/Developer/SuperDemo/build/SuperDemo.build/Debug-iphonesimulator/SuperDemo.build/Objects-normal/x86_64/EditTableViewController~partial.swiftdoc : /Users/apple/Developer/SuperDemo/SuperDemo/TableViewCell.swift /Users/apple/Developer/SuperDemo/SuperDemo/Item.swift /Users/apple/Developer/SuperDemo/SuperDemo/Detail.swift /Users/apple/Developer/SuperDemo/SuperDemo/EditTableViewController.swift /Users/apple/Developer/SuperDemo/SuperDemo/ViewController.swift /Users/apple/Developer/SuperDemo/SuperDemo/AppDelegate.swift /Users/apple/Developer/SuperDemo/SuperDemo/ViewControllerExtension.swift /Users/apple/Developer/SuperDemo/SuperDemo/EditCell.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/SnapKit.swiftmodule/x86_64.swiftmodule /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-Swift.h /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Headers/SnapKit-umbrella.h /Users/apple/Developer/SuperDemo/build/Debug-iphonesimulator/SnapKit/SnapKit.framework/Modules/module.modulemap
D
module utils; import std.array : Appender; import std.format : formattedWrite; import etc.c.curl; static const char* USERAGENT = "Auto-Tester. https://auto-tester.puremagic.com/ contact: braddr@puremagic.com"; static string LOGNAME = "/tmp/serverd.log"; static ulong page_num = 0; void setLogPageNum(ulong num) { page_num = num; } void writelog(S...)(S s) { import core.sys.posix.stdio : printf; import core.thread : getpid; import core.time : msecs; import std.datetime : Clock; import std.stdio : File; static int mypid = -1; if (mypid == -1) mypid = getpid(); try { auto fp = File(LOGNAME, "a"); auto t = Clock.currTime(); t.fracSecs = msecs(0); fp.writef("%05d(%03d) - %s - ", mypid, page_num, t.toISOExtString()); fp.writefln(s); } catch (Exception e) { printf("uh: %.*s", e.toString.length, e.toString.ptr); // maybe get fcgi_err visible here and write to it? } } string lookup(const ref string[string] hash, string key) { const(string*) ptr = key in hash; return ptr ? *ptr : ""; } string getURLProtocol(const ref string[string] hash) { return lookup(hash, "HTTPS") == "on" ? "https" : "http"; } bool auth_check(string raddr, Appender!string outstr) { import std.array : empty; if (raddr.empty) { formattedWrite(outstr, "no remote addr: %s\n", raddr); return false; } if (!check_addr(raddr)) { formattedWrite(outstr, "unauthorized: %s\n", raddr); return false; } return true; } bool check_addr(string addr) { import mysql; import std.conv : text; static bool check_set(sqlrow[] rows, string addr) { foreach(row; rows) { size_t l = row[0].length; if (addr.length < l) l = addr.length; if (addr[0 .. l] == row[0]) return true; } return false; } sql_exec("select ipaddr from authorized_addresses where enabled = 1"); sqlrow[] rows = sql_rows(); if (check_set(rows, addr)) return true; sql_exec(text("select ipaddr from build_hosts where enabled = 1 and ipaddr = \"", addr, "\"")); rows = sql_rows(); if (check_set(rows, addr)) return true; return false; } bool getAccessTokenFromCookie(string cookie, string csrf, ref string access_token, ref string userid, ref string username) { import mysql; import std.conv : text; sql_exec(text("select id, username, access_token, csrf from github_users where cookie=\"", cookie, "\" and csrf=\"", csrf, "\"")); sqlrow[] rows = sql_rows(); if (rows.length != 1) { writelog(" found %s rows, expected 1, for cookie '%s', csrf '%s'", rows.length, cookie, csrf); return false; } userid = rows[0][0]; username = rows[0][1]; access_token = rows[0][2]; return true; } void updateHostLastCheckin(string hostid, string clientver) { import mysql; import std.conv : text; sql_exec(text("update build_hosts set last_heard_from = now(), clientver = ", clientver, " where id = ", hostid)); } extern(C) size_t handleBodyData(char *ptr, size_t size, size_t nmemb, void *userdata) { auto payload = cast(string*)userdata; *payload ~= cast(string)(ptr[0 .. size*nmemb].idup); return size*nmemb; } extern(C) size_t handleHeaderData(char *ptr, size_t size, size_t nmemb, void *userdata) { import std.string : chomp; auto payload = cast(string[]*)userdata; *payload ~= chomp(cast(string)(ptr[0 .. size*nmemb].idup)); return size*nmemb; } extern(C) size_t handleRequestBodyData(void *ptr, size_t size, size_t nmemb, void *userdata) { import std.algorithm : min; auto payload = cast(string*)userdata; size_t bytesAllowed = size * nmemb; size_t bytesToSend = min(payload.length, bytesAllowed); if (bytesToSend > 0) { (cast(char*)ptr)[0 .. bytesToSend] = (*payload)[0 .. bytesToSend]; *payload = (*payload)[bytesToSend .. $]; return bytesToSend; } return 0; } bool runCurlGET(CURL* curl, ref string responsepayload, ref string[] responseheaders, string url, string user, string passwd) { return runCurlMethodRetry(curl, CurlOption.httpget, responsepayload, responseheaders, url, null, null, user, passwd); } bool runCurlPUT(CURL* curl, ref string responsepayload, ref string[] responseheaders, string url, string requestpayload, string[] requestheaders, string user, string passwd) { return runCurlMethodRetry(curl, CurlOption.put, responsepayload, responseheaders, url, requestpayload, requestheaders, user, passwd); } bool runCurlPOST(CURL* curl, ref string responsepayload, ref string[] responseheaders, string url, string requestpayload, string[] requestheaders, string user, string passwd) { return runCurlMethodRetry(curl, CurlOption.post, responsepayload, responseheaders, url, requestpayload, requestheaders, user, passwd); } bool runCurlMethodRetry(CURL* curl, CurlOption co, ref string responsepayload, ref string[] responseheaders, string url, string requestpayload, string[] requestheaders, string user, string passwd) { import core.thread; int tries; while (tries < 3) { writelog(" url: %s, try: #%s", url, tries); CURLcode res = runCurlMethod(curl, co, responsepayload, responseheaders, url, requestpayload, requestheaders, user, passwd); long statusCode; curl_easy_getinfo(curl, CurlInfo.response_code, &statusCode); if ((statusCode >= 200 && statusCode <= 299) || (statusCode == 422)) return true; ++tries; writelog(" http status code %s, retrying in %s seconds, body: %s", statusCode, tries, responsepayload); Thread.sleep(dur!("seconds")( tries )); } return false; } CURLcode runCurlMethod(CURL* curl, CurlOption co, ref string responsepayload, ref string[] responseheaders, string url, string requestpayload, string[] requestheaders, string user, string passwd) { import std.stdio : File; import std.string : toStringz; auto fp = File(LOGNAME, "a"); responsepayload = ""; responseheaders = []; curl_easy_reset(curl); curl_easy_setopt(curl, co, 1L); // method curl_easy_setopt(curl, CurlOption.forbid_reuse, 1L); curl_easy_setopt(curl, CurlOption.useragent, USERAGENT); if (user && passwd) { curl_easy_setopt(curl, CurlOption.httpauth, CurlAuth.basic); curl_easy_setopt(curl, CurlOption.username, toStringz(user)); curl_easy_setopt(curl, CurlOption.password, toStringz(passwd)); } else curl_easy_setopt(curl, CurlOption.httpauth, CurlAuth.none); curl_slist* curl_request_headers; foreach (h; requestheaders) curl_request_headers = curl_slist_append(curl_request_headers, cast(char*) toStringz(h)); curl_easy_setopt(curl, CurlOption.httpheader, curl_request_headers); if (co != CurlOption.httpget) { string rpay = requestpayload; // copy original string since rpay is altered during the send curl_easy_setopt(curl, CurlOption.infile, cast(void*)&rpay); curl_easy_setopt(curl, CurlOption.readfunction, &handleRequestBodyData); curl_easy_setopt(curl, CurlOption.postfieldsize, requestpayload.length); } curl_easy_setopt(curl, CurlOption.writefunction, &handleBodyData); curl_easy_setopt(curl, CurlOption.file, &responsepayload); curl_easy_setopt(curl, CurlOption.headerfunction, &handleHeaderData); curl_easy_setopt(curl, CurlOption.writeheader, &responseheaders); curl_easy_setopt(curl, CurlOption.stderr, fp.getFP()); curl_easy_setopt(curl, CurlOption.verbose, 0); curl_easy_setopt(curl, CurlOption.url, toStringz(url)); CURLcode res = curl_easy_perform(curl); if (res != 0) writelog(" result: %s", res); //foreach(h; responseheaders) // writelog("header: '%s'", h); //writelog("body: '%s'", responsepayload); curl_slist_free_all(curl_request_headers); curl_request_headers = null; curl_easy_setopt(curl, CurlOption.httpheader, curl_request_headers); curl_easy_setopt(curl, CurlOption.stderr, 0); return res; }
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric; alias S = Tuple!(int, "x", int, "y", int, "c"); void main() { auto rc = readln.split.to!(int[]); auto R = rc[0]; auto C = rc[1]; int[][] RC; RC.length = R; foreach (ref c; RC) { c.length = C; foreach (ref n; c) n = int.max; } wchar[][] O; O.length = R; int s_x, s_y, t_x, t_y; foreach (int y, ref l; O) { l = readln.chomp.to!(wchar[]); foreach (int x, c; l) { if (c == 's') { s_x = x; s_y = y; } if (c == 't') { t_x = x; t_y = y; } } } auto DRS = [ [[1, 0], [-1, 0], [-1, 1], [0, 1], [-1, -1], [0, -1]], // even [[1, 0], [-1, 0], [0, 1], [1, 1], [0, -1], [1, -1]] // odd ]; auto ss = [S(s_x, s_y, 0)]; RC[s_y][s_x] = true; int[] res; while (!ss.empty) { auto s = ss[0]; ss = ss[1..$]; foreach (dr; DRS[s.y % 2]) { auto x = s.x + dr[0]; auto y = s.y + dr[1]; if (x < 0 || x >= C || y < 0 || y >= R) continue; if (x == t_x && y == t_y) { res ~= s.c; continue; } auto c = s.c + O[y][x] - 48; if (RC[y][x] <= c) continue; RC[y][x] = c; ss ~= S(x, y, c); } } sort(res); writeln(res[0]); }
D
/Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Command.build/Utilities/CommandError.swift.o : /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Command/Command.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Base/CommandRunnable.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Output+Autocomplete.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Config/CommandConfig.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Base/CommandOption.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Console+Run.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Output+Help.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Group/CommandGroup.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Group/BasicCommandGroup.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/CommandError.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Config/Commands.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/Utilities.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/Exports.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Command/CommandArgument.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/CommandInput.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/CommandContext.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/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/ifaddrs-android.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/CNIODarwin.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/CNIOLinux.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Command.build/CommandError~partial.swiftmodule : /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Command/Command.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Base/CommandRunnable.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Output+Autocomplete.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Config/CommandConfig.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Base/CommandOption.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Console+Run.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Output+Help.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Group/CommandGroup.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Group/BasicCommandGroup.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/CommandError.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Config/Commands.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/Utilities.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/Exports.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Command/CommandArgument.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/CommandInput.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/CommandContext.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/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/ifaddrs-android.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/CNIODarwin.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/CNIOLinux.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Command.build/CommandError~partial.swiftdoc : /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Command/Command.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Base/CommandRunnable.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Output+Autocomplete.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Config/CommandConfig.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Base/CommandOption.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Console+Run.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/Output+Help.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Group/CommandGroup.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Group/BasicCommandGroup.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/CommandError.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Config/Commands.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/Utilities.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Utilities/Exports.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Command/CommandArgument.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/CommandInput.swift /Users/godemodegame/Desktop/ATMApp/.build/checkouts/console.git--2431895819212044213/Sources/Command/Run/CommandContext.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/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/godemodegame/Desktop/ATMApp/.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/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/ifaddrs-android.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/CNIODarwin.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/CNIOLinux.h /Users/godemodegame/Desktop/ATMApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CCryptoOpenSSL.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/godemodegame/Desktop/ATMApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
playful like a lively kitten
D
const int LOADINGTEXNAME_OFFSET = 9118980; //0x8B2504; func void SetLoadTexNameTo_XXXXing (var string XXXX) { var int XXXXptr; XXXXptr = STRINT_ToChar (XXXX); MEM_WriteInt (LOADINGTEXNAME_OFFSET, MEM_ReadInt (XXXXptr)); };
D
//Written in the D programming language /++ D header file for FreeBSD's extensions to POSIX's time.h. Copyright: Copyright 2014 License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(HTTP jmdavisprog.com, Jonathan M Davis) +/ module core.sys.freebsd.time; public import core.sys.posix.time; version(FreeBSD): enum CLOCK_VIRTUAL = 1; enum CLOCK_PROF = 2; enum CLOCK_UPTIME = 5; enum CLOCK_UPTIME_PRECISE = 7; enum CLOCK_UPTIME_FAST = 8; enum CLOCK_REALTIME_PRECISE = 9; enum CLOCK_REALTIME_FAST = 10; enum CLOCK_MONOTONIC_PRECISE = 11; enum CLOCK_MONOTONIC_FAST = 12; enum CLOCK_SECOND = 13;
D
module dweb.common; /** 获取所有子类 */ ClassInfo[] getChildClasses(ClassInfo c) { ClassInfo[] info; foreach(mod; ModuleInfo) { foreach(cla; mod.localClasses) { if(cla.base is c) { info ~= cla; } } } return info; }
D
instance DIA_Lehmar_EXIT(DIA_Proto_End) { npc = VLK_484_Lehmar; }; /////////////////////////////////////// РУПЕРТ ////////////////////////////////////////////// // ============================================== instance DIA_Lehmar_Rupert_Hello(C_INFO) { nr = 1; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Rupert_MR_Hello_cond; information = DIA_Lehmar_Rupert_MR_Hello_info; important = TRUE; }; func int DIA_Lehmar_Rupert_MR_Hello_cond() { if (C_HeroIs_Rupert() && !MIS_Rupert_Debts_Paid[Creditor_Lehmar]) { return TRUE; }; }; func void DIA_Lehmar_Rupert_MR_Hello_info() { AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_09_00"); //Явился-таки? AI_Output(other,self,"DIA_Lehmar_Rupert_MR_Hello_03_01"); //Я... AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_09_02"); //(перебивает) Ты должен мне 500 золотых. B_LogEntry(TOPIC_Rupert_Debts,TOPIC_Rupert_Debts_Lehmar_Sum); AI_Output(other,self,"DIA_Lehmar_Rupert_MR_Hello_03_03"); //Пятьсот?! Но я же брал в долг сотню! AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_09_04"); //Больше двух недель назад! AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_09_05"); //Я тут не занимаюсь благотворительностью. Проценты нарастают с каждым днем. А мое терпение иссякает. AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_09_06"); //Так ты собираешься платить? Info_ClearChoices(DIA_Lehmar_Rupert_Hello); if (MIS_Rupert_Debts_Lehmar_Sword == MIS_Rupert_Debts_Lehmar_SwordKnown) { Info_AddChoice(DIA_Lehmar_Rupert_Hello,"Я слышал, тебе нужен меч из магической руды.",DIA_Lehmar_Rupert_AskSword_info); } else { Info_AddChoice(DIA_Lehmar_Rupert_Hello,"Может, я могу как-нибудь отработать долг?",DIA_Lehmar_Rupert_MR_Hello_AskRelief); }; Info_AddChoice(DIA_Lehmar_Rupert_Hello,"Пожалуйста, дай мне еще несколько дней!",DIA_Lehmar_Rupert_MR_Hello_NoPay); if (C_NpcHasGold(other,500)) { Info_AddChoice(DIA_Lehmar_Rupert_Hello,"Вот деньги. (500 зол.)",DIA_Lehmar_Rupert_MR_Hello_Pay); }; MIS_Rupert_Debts_Lehmar_Day = Wld_GetDay() + 3; }; func void DIA_Lehmar_Rupert_MR_Hello_Pay() { AI_Output(other,self,"DIA_Lehmar_Rupert_MR_Hello_Pay_03_00"); //Вот деньги. B_GiveInvItems(other,self,ItMi_Gold,500); B_RupertPayDebt(Creditor_Lehmar); Info_ClearChoices(DIA_Lehmar_Rupert_Hello); }; func void DIA_Lehmar_Rupert_MR_Hello_NoPay() { AI_Output(other,self,"DIA_Lehmar_Rupert_MR_Hello_NoPay_03_00"); //Пожалуйста, дай мне еще несколько дней! Я принесу деньги, клянусь! AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_NoPay_09_01"); //Мне нужны деньги, а не твои клятвы! AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_NoPay_09_02"); //(размышляет) AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_NoPay_09_03"); //Ну, хорошо. Я даю тебе еще три дня. Под 20 процентов в день. Это 100 золотых за каждый день, если ты не умеешь считать. AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_NoPay_09_04"); //И помни - это последняя отсрочка! Если через три дня я не получу денег, придется принять меры. B_LogEntry(TOPIC_Rupert_Debts,TOPIC_Rupert_Debts_Lehmar_Percent); Info_ClearChoices(DIA_Lehmar_Rupert_Hello); }; func void DIA_Lehmar_Rupert_MR_Hello_AskRelief() { AI_Output(other,self,"DIA_Lehmar_Rupert_MR_Hello_AskRelief_03_00"); //Может, я могу как-нибудь отработать долг? AI_Output(self,other,"DIA_Lehmar_Rupert_MR_Hello_AskRelief_09_01"); //Нет. У меня нет ничего, с чем бы справился такой бездарь, как ты. }; // ---------------------------------------------- instance DIA_Lehmar_Rupert_AskSword(C_INFO) { nr = 2; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Rupert_AskSword_cond; information = DIA_Lehmar_Rupert_AskSword_info; description = "Я слышал, тебе нужен меч из магической руды."; }; func int DIA_Lehmar_Rupert_AskSword_cond() { if (C_HeroIs_Rupert() && (MIS_Rupert_Debts_Lehmar_Sword == MIS_Rupert_Debts_Lehmar_SwordKnown) && !MIS_Rupert_Debts_Paid[Creditor_Lehmar]) { return TRUE; }; }; func void DIA_Lehmar_Rupert_AskSword_info() { AI_Output(other,self,"DIA_Lehmar_Rupert_AskSword_03_00"); //Я слышал, тебе нужен меч из магической руды. Что, если я достану тебе такой? AI_Output(self,other,"DIA_Lehmar_Rupert_AskSword_09_01"); //Ты?! Меч из руды? Хотя... почему бы и нет. AI_Output(self,other,"DIA_Lehmar_Rupert_AskSword_09_02"); //Договоримся так - если ты добудешь такой меч, то я прощу тебе все проценты. Ты снова будешь должен мне только сотню. B_LogEntry(TOPIC_Rupert_Debts,TOPIC_Rupert_Debts_Lehmar_Told); MIS_Rupert_Debts_Lehmar_Sword = MIS_Rupert_Debts_Lehmar_SwordTold; Info_ClearChoices(DIA_Lehmar_Rupert_Hello); }; // ---------------------------------------------- instance DIA_Lehmar_Rupert_GiveMoney(C_INFO) { nr = 3; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Rupert_GiveMoney_cond; information = DIA_Lehmar_Rupert_GiveMoney_info; description = "Я пришел вернуть долг."; permanent = TRUE; }; func int DIA_Lehmar_Rupert_GiveMoney_cond() { //сколько? if (MIS_Rupert_Debts_Lehmar_Sword == MIS_Rupert_Debts_Lehmar_SwordGiven) { MIS_Rupert_Debts_Lehmar_Sum = 100; } else { MIS_Rupert_Debts_Lehmar_Sum = 500 + 100 * (3 + Wld_GetDay() - MIS_Rupert_Debts_Lehmar_Day); }; DIA_Lehmar_Rupert_GiveMoney.description = C_BuildPriceString("Я пришел вернуть долг ",MIS_Rupert_Debts_Lehmar_Sum); if (C_HeroIs_Rupert() && !MIS_Rupert_Debts_Paid[Creditor_Lehmar]) { return TRUE; }; }; func void DIA_Lehmar_Rupert_GiveMoney_info() { AI_Output(other,self,"DIA_Lehmar_Rupert_GiveMoney_03_00"); //Я пришел вернуть долг. if (C_NpcHasGold(other,MIS_Rupert_Debts_Lehmar_Sum)) { AI_Output(self,other,"DIA_Lehmar_Rupert_GiveMoney_09_01"); //Давай деньги и катись отсюда! B_GiveInvItems(other,self,ItMi_Gold,MIS_Rupert_Debts_Lehmar_Sum); B_RupertPayDebt(Creditor_Lehmar); AI_Output(self,other,"DIA_Lehmar_Rupert_GiveMoney_09_02"); //(себе под нос) Чтобы я еще раз связался с дологосрочным кредитом... } else { AI_Output(self,other,"DIA_Lehmar_Rupert_GiveMoney_09_03"); //Тогда принеси деньги! Да поживее! }; AI_StopProcessInfos(self); }; // ---------------------------------------------- instance DIA_Lehmar_Rupert_GiveSword(C_INFO) { nr = 4; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Rupert_GiveSword_cond; information = DIA_Lehmar_Rupert_GiveSword_info; description = "Я принес тебе рудный меч."; }; func int DIA_Lehmar_Rupert_GiveSword_cond() { if (C_HeroIs_Rupert() && ((MIS_Rupert_Debts_Lehmar_Sword == MIS_Rupert_Debts_Lehmar_SwordKnown) || (MIS_Rupert_Debts_Lehmar_Sword == MIS_Rupert_Debts_Lehmar_SwordTold)) && !MIS_Rupert_Debts_Paid[Creditor_Lehmar] && (Npc_HasItems(other,ItMw_1H_Sword_Lehmar) > 0)) { return TRUE; }; }; func void DIA_Lehmar_Rupert_GiveSword_info() { AI_Output(other,self,"DIA_Lehmar_Rupert_GiveSword_03_00"); //Я принес тебе рудный меч. if (MIS_Rupert_Debts_Lehmar_Sword == MIS_Rupert_Debts_Lehmar_SwordTold) { B_GiveInvItems(other,self,ItMw_1H_Sword_Lehmar,1); AI_Output(self,other,"DIA_Lehmar_Rupert_GiveSword_09_01"); //Хм, похоже иногда ты не просто бросаешь слова на ветер. AI_Output(self,other,"DIA_Lehmar_Rupert_GiveSword_09_02"); //Как мы и договаривались, я спишу твои проценты. Ты снова должен мне только 100 золотых. AI_Output(self,other,"DIA_Lehmar_Rupert_GiveSword_09_03"); //И лучше, если ты вернешь их вовремя. Бизнес есть бизнес. B_LogEntry(TOPIC_Rupert_Debts,TOPIC_Rupert_Debts_Lehmar_Sword); B_GivePlayerXP(XP_Rupert_Debts_Lehmar_Sword); } else { AI_Output(other,self,"DIA_Lehmar_Rupert_GiveSword_03_04"); //Слышал, тебе такой нужен. AI_Output(self,other,"DIA_Lehmar_Rupert_GiveSword_09_05"); //Что? Откуда ты?.. А, не важно. AI_Output(self,other,"DIA_Lehmar_Rupert_GiveSword_09_06"); //Я действительно давно ищу такой меч. AI_Output(other,self,"DIA_Lehmar_Rupert_GiveSword_03_07"); //Сгодится в качестве уплаты долга? AI_Output(self,other,"DIA_Lehmar_Rupert_GiveSword_09_08"); //Да, задери меня орк! Давай его сюда, и катись, пока я не передумал! B_GiveInvItems(other,self,ItMw_1H_Sword_Lehmar,1); B_RupertPayDebt(Creditor_Lehmar); AI_StopProcessInfos(self); }; MIS_Rupert_Debts_Lehmar_Sword = MIS_Rupert_Debts_Lehmar_SwordGiven; }; // ---------------------------------------------- instance DIA_Lehmar_Rupert_Punishment(C_INFO) { nr = 5; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Rupert_Punishment_cond; information = DIA_Lehmar_Rupert_Punishment_info; important = TRUE; }; func int DIA_Lehmar_Rupert_Punishment_cond() { if (C_HeroIs_Rupert() && ((MIS_Rupert_Debts_Lehmar_Day < Wld_GetDay()) && !MIS_Rupert_Debts_Paid[Creditor_Lehmar])) { return TRUE; }; }; func void DIA_Lehmar_Rupert_Punishment_info() { AI_GotoNpc(VLK_415_Meldor,other); AI_GotoNpc(VLK_4941_Thug,other); AI_Output(self,other,"DIA_Lehmar_Rupert_Punishment_09_00"); //Ты! Посмел заявиться сам! AI_Output(other,self,"DIA_Lehmar_Rupert_Punishment_03_01"); //Я хотел... AI_Output(self,other,"DIA_Lehmar_Rupert_Punishment_09_02"); //Мне плевать, что ты там хотел! Я ждал более, чем достаточно. AI_StopProcessInfos(self); B_Attack(self,other,AR_Theft,0); B_Attack(VLK_415_Meldor,other,AR_NONE,0); B_Attack(VLK_4941_Thug,other,AR_NONE,0); MIS_Rupert_Debts_Paid[Creditor_Lehmar] = TRUE; }; // ---------------------------------------------- instance DIA_Lehmar_Rupert_GetOut(C_INFO) { nr = 6; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Rupert_GetOut_cond; information = DIA_Lehmar_Rupert_GetOut_info; important = TRUE; permanent = TRUE; }; func int DIA_Lehmar_Rupert_GetOut_cond() { if (C_HeroIs_Rupert() && DIA_WhenAsked_cond() && MIS_Rupert_Debts_Paid[Creditor_Lehmar]) { return TRUE; }; }; func void DIA_Lehmar_Rupert_GetOut_info() { AI_Output(self,other,"DIA_Lehmar_Rupert_GetOut_09_00"); //Пошел вон! AI_StopProcessInfos(self); }; /////////////////////////////////////// ЕЛЕНА ////////////////////////////////////////////// // ============================================== instance DIA_Lehmar_Elena_AboutCup(C_INFO) { nr = 10; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Elena_AboutCup_cond; information = DIA_Lehmar_Elena_AboutCup_info; description = "Я слыхала, у тебя есть кубок Верности."; }; func int DIA_Lehmar_Elena_AboutCup_cond() { if (C_HeroIs_Elena() && MIS_Elena_Present_KnowsLehmar && (MIS_Elena_Present == LOG_Running)) { return TRUE; }; }; func void DIA_Lehmar_Elena_AboutCup_info() { AI_Output(other,self,"DIA_Lehmar_Elena_AboutCup_16_00"); //Здравствуй. Я слыхала, у тебя есть кубок Верности. AI_Output(self,other,"DIA_Lehmar_Elena_AboutCup_09_01"); //И что? AI_Output(other,self,"DIA_Lehmar_Elena_AboutCup_16_02"); //Я бы хотела его выкупить. AI_Output(self,other,"DIA_Lehmar_Elena_AboutCup_09_03"); //Нет. AI_Output(other,self,"DIA_Lehmar_Elena_AboutCup_16_04"); //Но почему? AI_Output(self,other,"DIA_Lehmar_Elena_AboutCup_09_05"); //Я не обязан перед тобой объясняться! AI_Output(self,other,"DIA_Lehmar_Elena_AboutCup_09_06"); //Это мой кубок - хочу продаю, хочу не продаю! B_LogEntry(TOPIC_Elena_Present,TOPIC_Elena_Present_LehmarNo); AI_StopProcessInfos(self); }; // ============================================== instance DIA_Lehmar_Elena_AboutCupPerm(C_INFO) { nr = 11; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Elena_AboutCupPerm_cond; information = DIA_Lehmar_Elena_AboutCupPerm_info; description = "Я заплачу, сколько захочешь."; permanent = TRUE; }; func int DIA_Lehmar_Elena_AboutCupPerm_cond() { if (C_HeroIs_Elena() && Npc_KnowsInfo(other,DIA_Lehmar_Elena_AboutCup) && !MIS_Elena_Present_CupLehmarGot && (MIS_Elena_Present == LOG_Running)) { return TRUE; }; }; func void DIA_Lehmar_Elena_AboutCupPerm_info() { AI_Output(other,self,"DIA_Lehmar_Elena_AboutCupPerm_16_00"); //Я заплачу, сколько захочешь. AI_Output(self,other,"DIA_Lehmar_Elena_AboutCupPerm_09_01"); //Нет. Он не продается. AI_StopProcessInfos(self); }; // ============================================== instance DIA_Lehmar_Elena_CupLost(C_INFO) { npc = VLK_484_Lehmar; nr = 12; condition = DIA_Lehmar_Elena_CupLost_cond; information = DIA_Lehmar_Elena_CupLost_info; important = TRUE; }; func int DIA_Lehmar_Elena_CupLost_cond() { if (C_HeroIs_Elena() && MIS_Elena_Present_CupLehmarGot) { return TRUE; }; }; func void DIA_Lehmar_Elena_CupLost_info() { MIS_Elena_Present_LehamarAskedCupBack = MIS_Elena_Present_Lehamar_Mad; AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_09_00"); //Эй ты, девка! Да, я тебе! AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_09_01"); //У меня пропал кубок Верности, после того, как ты о нем распрашивала. AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_09_02"); //Думаешь, я тупой? Верни мне кубок, воровка! Info_ClearChoices(DIA_Lehmar_Elena_CupLost); Info_AddChoice(DIA_Lehmar_Elena_CupLost,"(с искренним удивлением) Так его у тебя украли? Я просто выкупила его...",DIA_Lehmar_Elena_CupLost_Bought); Info_AddChoice(DIA_Lehmar_Elena_CupLost,"(сухо) У меня его нет.",DIA_Lehmar_Elena_CupLost_No); B_StartOtherRoutine(self,"START"); B_StartOtherRoutine(VLK_415_Meldor,"START"); }; func void DIA_Lehmar_Elena_CupLost_No() { AI_Output(other,self,"DIA_Lehmar_Elena_CupLost_No_17_00"); //(сухо) У меня его нет. AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_No_09_01"); //(с угрозой) А если я тебя обыщу? AI_Output(other,self,"DIA_Lehmar_Elena_CupLost_No_17_02"); //Ну, попробуй. //атакует как вора. Если кубок в инвентаре, забирает AI_StopProcessInfos(self); B_Attack(self,other,AR_NONE,0); B_LogEntry(TOPIC_Elena_Present,ConcatStrings(TOPIC_Elena_Present_LehmarCupTheft,TOPIC_Elena_Present_LehmarCupMine)); }; func void DIA_Lehmar_Elena_CupLost_Bought() { AI_Output(other,self,"DIA_Lehmar_Elena_CupLost_Bought_17_00"); //(искренне) Так его у тебя украли? Я просто выкупила его... AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_Bought_09_01"); //(задыхаясь) И у тебя хватает наглости... AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_Bought_09_02"); //Верни кубок сейчас же! Info_ClearChoices(DIA_Lehmar_Elena_CupLost); Info_AddChoice(DIA_Lehmar_Elena_CupLost,"Я за него честно заплатила! Ничего не знаю.",DIA_Lehmar_Elena_CupLost_MyCup); if (Npc_HasItems(other,ItMi_FaithfulnessCup_02)) { Info_AddChoice(DIA_Lehmar_Elena_CupLost,"Вот, возьми. Я правда не знала, прости.",DIA_Lehmar_Elena_CupLost_Return); } else { Info_AddChoice(DIA_Lehmar_Elena_CupLost,"У меня нет его с собой. Подожди, я принесу.",DIA_Lehmar_Elena_CupLost_NoCup); }; }; func void DIA_Lehmar_Elena_CupLost_Return() { AI_Output(other,self,"DIA_Lehmar_Elena_CupLost_Return_17_00"); //Вот, возьми. Я правда не знала, прости. B_GiveInvItems(other,self,ItMi_FaithfulnessCup_02,1); AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_Return_09_01"); //Ладно, я тебе верю. B_GivePlayerXP(XP_Elena_CupReterned); MIS_Elena_Present_LehamarAskedCupBack = MIS_Elena_Present_Lehamar_Returned; MIS_Elena_Present_ReadyCnt -= 1; if (MIS_Elena_Present_ReadyCnt == 0) { MIS_Elena_Present = LOG_Running; B_LogEntry_Status(TOPIC_Elena_Present,LOG_Running,ConcatStrings(TOPIC_Elena_Present_LehmarCupTheft,TOPIC_Elena_Present_LehmarReturned)); } else { B_LogEntry(TOPIC_Elena_Present,ConcatStrings(TOPIC_Elena_Present_LehmarCupTheft,TOPIC_Elena_Present_LehmarReturned)); }; Info_ClearChoices(DIA_Lehmar_Elena_CupLost); Info_AddChoice(DIA_Lehmar_Elena_CupLost,"Чем тебе так дорог этот кубок?",DIA_Lehmar_Elena_WhyTreasure_info); }; func void DIA_Lehmar_Elena_WhyTreasure_info() { AI_Output(other,self,"DIA_Lehmar_Elena_WhyTreasure_17_00"); //Чем тебе так дорог этот кубок? AI_Output(self,other,"DIA_Lehmar_Elena_WhyTreasure_09_01"); //До чего же ты любопытная... Прямо как моя дочурка. AI_Output(self,other,"DIA_Lehmar_Elena_WhyTreasure_09_02"); //Ей на свадьбу я эти кубки готовил, такого жениха подобрал, а она сбежала с каким-то проходимцем на материк! AI_Output(self,other,"DIA_Lehmar_Elena_WhyTreasure_09_03"); //Семь лет о ней ни слуху, ни духу. Может, и сгинула уже. Info_ClearChoices(DIA_Lehmar_Elena_CupLost); }; func void DIA_Lehmar_Elena_CupLost_NoCup() { AI_Output(other,self,"DIA_Lehmar_Elena_CupLost_NoCup_17_00"); //У меня нет его с собой. Подожди, я принесу. AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_NoCup_09_01"); //С какой стати я должен тебе верить? AI_Output(other,self,"DIA_Lehmar_Elena_CupLost_NoCup_17_02"); //Можешь обыскать меня, но это тебе ничего не даст. AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_NoCup_09_03"); //Ну и катись отсюда, стерва! И чтобы я тебя больше не видел. MIS_Elena_Present_LehamarAskedCupBack = MIS_Elena_Present_Lehamar_Waits; B_LogEntry(TOPIC_Elena_Present,ConcatStrings(TOPIC_Elena_Present_LehmarCupTheft,TOPIC_Elena_Present_LehmarWaits)); AI_StopProcessInfos(self); }; func void DIA_Lehmar_Elena_CupLost_MyCup() { AI_Output(other,self,"DIA_Lehmar_Elena_CupLost_MyCup_17_00"); //Я за него честно заплатила! Ничего не знаю. AI_Output(self,other,"DIA_Lehmar_Elena_CupLost_MyCup_09_01"); //Ах ты, сучка! Только попробуй еще показаться тут! B_LogEntry(TOPIC_Elena_Present,ConcatStrings(TOPIC_Elena_Present_LehmarCupTheft,TOPIC_Elena_Present_LehmarCupMine)); AI_StopProcessInfos(self); }; // ============================================== instance DIA_Lehmar_Elena_ReturnCup(C_INFO) { npc = VLK_484_Lehmar; nr = 13; condition = DIA_Lehmar_Elena_ReturnCup_cond; information = DIA_Lehmar_Elena_ReturnCup_info; important = TRUE; permanent = TRUE; }; func int DIA_Lehmar_Elena_ReturnCup_cond() { if (C_HeroIs_Elena() && DIA_WhenAsked_cond() && (MIS_Elena_Present_LehamarAskedCupBack == MIS_Elena_Present_Lehamar_Waits)) { return TRUE; }; }; func void DIA_Lehmar_Elena_ReturnCup_info() { AI_Output(self,other,"DIA_Lehmar_Elena_ReturnCup_09_00"); //Ты принесла кубок? if (Npc_HasItems(other,ItMi_FaithfulnessCup_02)) { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnCup_17_01"); //Да, вот он. DIA_Lehmar_Elena_CupLost_Return(); } else { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnCup_17_02"); //Еще нет... AI_Output(self,other,"DIA_Lehmar_Elena_ReturnCup_09_03"); //Тогда вали отсюда! AI_StopProcessInfos(self); }; }; // ============================================== var int DIA_Lehmar_Elena_AfterReturnPerm_Once; instance DIA_Lehmar_Elena_AfterReturnPerm(C_INFO) { npc = VLK_484_Lehmar; nr = 14; condition = DIA_Lehmar_Elena_AfterReturnPerm_cond; information = DIA_Lehmar_Elena_AfterReturnPerm_info; description = "Еще раз прости за кубок."; permanent = TRUE; }; func int DIA_Lehmar_Elena_AfterReturnPerm_cond() { if (C_HeroIs_Elena() && (MIS_Elena_Present_LehamarAskedCupBack == MIS_Elena_Present_Lehamar_Returned)) { return TRUE; }; }; func void DIA_Lehmar_Elena_AfterReturnPerm_info() { AI_Output(other,self,"DIA_Lehmar_Elena_AfterReturnPerm_17_00"); //Еще раз прости за кубок. if (!DIA_Lehmar_Elena_AfterReturnPerm_Once) { AI_Output(self,other,"DIA_Lehmar_Elena_AfterReturnPerm_09_01"); //Извинения приняты. Но я его тебе все равно не продам. DIA_Lehmar_Elena_AfterReturnPerm_Once = TRUE; } else { AI_Output(self,other,"DIA_Lehmar_Elena_AfterReturnPerm_09_02"); //Просто оставь меня в покое. }; }; // ============================================== instance DIA_Lehmar_Elena_ReturnOtherCup(C_INFO) { npc = VLK_484_Lehmar; nr = 15; condition = DIA_Lehmar_Elena_ReturnOtherCup_cond; information = DIA_Lehmar_Elena_ReturnOtherCup_info; description = "Тебе нужен второй Кубок верности?"; }; func int DIA_Lehmar_Elena_ReturnOtherCup_cond() { if (C_HeroIs_Elena() && (MIS_Elena_Present_LehamarAskedCupBack == MIS_Elena_Present_Lehamar_Returned) && Npc_HasItems(other,ItMi_FaithfulnessCup_01)) { return TRUE; }; }; func void DIA_Lehmar_Elena_ReturnOtherCup_info() { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup_17_00"); //Тебе нужен второй кубок Верности? AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup_09_01"); //Да, черт побери! Где он? AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup_17_02"); //Он у меня. AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup_09_03"); //Сколько ты за него хочешь? Info_ClearChoices(DIA_Lehmar_Elena_ReturnOtherCup); Info_AddChoice(DIA_Lehmar_Elena_ReturnOtherCup,"Забирай так.",DIA_Lehmar_Elena_ReturnOtherCup0); Info_AddChoice(DIA_Lehmar_Elena_ReturnOtherCup,"1000 золотых.",DIA_Lehmar_Elena_ReturnOtherCup1000); Info_AddChoice(DIA_Lehmar_Elena_ReturnOtherCup,"850 золотых.",DIA_Lehmar_Elena_ReturnOtherCup850); Info_AddChoice(DIA_Lehmar_Elena_ReturnOtherCup,"500 золотых.",DIA_Lehmar_Elena_ReturnOtherCup500); Info_AddChoice(DIA_Lehmar_Elena_ReturnOtherCup,"350 золотых.",DIA_Lehmar_Elena_ReturnOtherCup350); }; func void DIA_Lehmar_Elena_ReturnOtherCup350() { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup350_17_00"); //350 золотых. AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup350_09_01"); //Хорошо. Вот твое золото. А теперь уходи, я хочу побыть один. B_GiveInvItems(other,self,ItMi_FaithfulnessCup_01,1); B_GiveInvItems(self,other,ItMi_Gold,350); B_GivePlayerXP(XP_Elena_Cup2ReternedPayed); AI_StopProcessInfos(self); }; func void DIA_Lehmar_Elena_ReturnOtherCup500() { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup500_17_00"); //500 золотых. AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup500_09_01"); //Ладно. Держи деньги и убирайся с глаз моих! B_GiveInvItems(other,self,ItMi_FaithfulnessCup_01,1); B_GiveInvItems(self,other,ItMi_Gold,500); AI_StopProcessInfos(self); }; func void DIA_Lehmar_Elena_ReturnOtherCup850() { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup850_17_00"); //850 золотых. AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup850_09_01"); //Сколько?! AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup850_17_02"); //Ровно во столько мне обошлись оба кубка. Я просто хочу вернуть мои деньги. AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup850_09_03"); //(скрипя зубами) Хорошо. Держи деньги и катись отсюда. B_GiveInvItems(other,self,ItMi_FaithfulnessCup_01,1); B_GiveInvItems(self,other,ItMi_Gold,850); AI_StopProcessInfos(self); }; func void DIA_Lehmar_Elena_ReturnOtherCup1000() { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup1000_17_00"); //1000 золотых. AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup1000_09_01"); //Что?! Да ты совсем сдурела? AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup1000_09_02"); //Думаешь, если я ростовщик, то у меня любые деньги есть? AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup1000_09_03"); //Да мне тебя убить дешевле. Уйди от греха! AI_StopProcessInfos(self); }; func void DIA_Lehmar_Elena_ReturnOtherCup0() { AI_Output(other,self,"DIA_Lehmar_Elena_ReturnOtherCup0_17_00"); //Забирай так. B_GiveInvItems(other,self,ItMi_FaithfulnessCup_01,1); AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup0_09_01"); //Не пойму, ты совсем дура или святая? AI_Output(self,other,"DIA_Lehmar_Elena_ReturnOtherCup0_09_02"); //Вот, возьми 500 золотых. Бери, и больше не появляйся! B_GiveInvItems(self,other,ItMi_Gold,500); B_GivePlayerXP(XP_Elena_Cup2ReternedFree); AI_StopProcessInfos(self); //Аданос B_Adanos_Bless4Good(); }; // ============================================== instance DIA_Lehmar_Elena_GetOut(C_INFO) { npc = VLK_484_Lehmar; nr = 16; condition = DIA_Lehmar_Elena_GetOut_cond; information = DIA_Lehmar_Elena_GetOut_info; important = TRUE; permanent = TRUE; }; func int DIA_Lehmar_Elena_GetOut_cond() { if (C_HeroIs_Elena() && DIA_WhenAsked_cond() && ((MIS_Elena_Present_LehamarAskedCupBack == MIS_Elena_Present_Lehamar_GotByForce) || (MIS_Elena_Present_LehamarAskedCupBack == MIS_Elena_Present_Lehamar_Mad) || Npc_KnowsInfo(other,DIA_Lehmar_Elena_ReturnOtherCup))) { return TRUE; }; }; func void DIA_Lehmar_Elena_GetOut_info() { AI_Output(self,other,"DIA_Lehmar_Elena_GetOut_09_00"); //Оставь меня в покое! AI_StopProcessInfos(self); }; /////////////////////////////////////// ОСТАЛЬНЫЕ ///////////////////////////////////////////// // ============================================== instance DIA_Lehmar_Others_Hello(C_INFO) { nr = 50; npc = VLK_484_Lehmar; condition = DIA_Lehmar_Others_MR_Hello_cond; information = DIA_Lehmar_Others_MR_Hello_info; important = TRUE; permanent = TRUE; }; func int DIA_Lehmar_Others_MR_Hello_cond() { var C_NPC owner; owner = Wld_GetPlayerPortalOwner(); if (!C_HeroIs_Rupert() && !(C_HeroIs_Elena() && MIS_Elena_Present_KnowsLehmar) && (C_NpcIs(owner,self)) && DIA_WhenAsked_cond()) { return TRUE; }; }; func void DIA_Lehmar_Others_MR_Hello_info() { AI_Output(self,other,"DIA_Lehmar_Others_MR_Hello_09_00"); //Хочешь занять денег? if (hero.voice == 3) { //Одо/Руперт AI_Output(other,self,"DIA_Lehmar_Others_MR_Hello_03_01"); //Нет. } else if (hero.voice == 7) { //Талбин AI_Output(other,self,"DIA_Lehmar_Others_MR_Hello_07_01"); //Нет. } else if (hero.voice == 10) { //Эрол AI_Output(other,self,"DIA_Lehmar_Others_MR_Hello_10_01"); //Нет. } else if (hero.voice == 14) { //Тилл AI_Output(other,self,"DIA_Lehmar_Others_MR_Hello_14_01"); //Нет. } else { //Елена/Сара AI_Output(other,self,"DIA_Lehmar_Others_MR_Hello_16_01"); //Нет. }; AI_Output(self,other,"DIA_Lehmar_Others_MR_Hello_09_02"); //Тогда не мельтеши перед глазами. AI_StopProcessInfos(self); };
D
void foo(T)(){} static assert(__traits(isTemplate,foo)); static assert(!__traits(isTemplate,foo!int())); static assert(!__traits(isTemplate,"string"));
D
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/Console.build/Clear/Console+Ephemeral.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Terminal/ANSI.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Console.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleStyle.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Choose.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicatorState.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Ask.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Terminal/Terminal.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/Console+Ephemeral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Confirm.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/LoadingBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ProgressBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/Console+Clear.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/ConsoleClear.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/ConsoleLogger.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Center.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleColor.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/ConsoleError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Wait.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleTextFragment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Input.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Output.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleText.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/Logging.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/Console.build/Console+Ephemeral~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Terminal/ANSI.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Console.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleStyle.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Choose.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicatorState.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Ask.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Terminal/Terminal.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/Console+Ephemeral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Confirm.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/LoadingBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ProgressBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/Console+Clear.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/ConsoleClear.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/ConsoleLogger.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Center.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleColor.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/ConsoleError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Wait.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleTextFragment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Input.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Output.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleText.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/Logging.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/Console.build/Console+Ephemeral~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Terminal/ANSI.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Deprecated.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Console.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleStyle.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Choose.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicatorState.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Ask.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Terminal/Terminal.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/Console+Ephemeral.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Confirm.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/LoadingBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ProgressBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityBar.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/Console+Clear.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Clear/ConsoleClear.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/ConsoleLogger.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Center.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleColor.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/ConsoleError.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Activity/ActivityIndicator.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Utilities/Exports.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Wait.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleTextFragment.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Input/Console+Input.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/Console+Output.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/console.git--1231705849320085599/Sources/Console/Output/ConsoleText.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/Logging.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
/mnt/c/Users/zeliwang/hello_world/digital_signature/target/debug/deps/odds-ec2b75a9dde4a98c.rmeta: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/lib.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/range.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/fix.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/char.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/string.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/vec.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/unalign.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/iter.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/stride.rs /mnt/c/Users/zeliwang/hello_world/digital_signature/target/debug/deps/odds-ec2b75a9dde4a98c.d: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/lib.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/range.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/fix.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/char.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/string.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/vec.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/mod.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/unalign.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/iter.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/stride.rs /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/lib.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/range.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/fix.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/char.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/string.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/vec.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/mod.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/unalign.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/slice/iter.rs: /home/zeliwang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/odds-0.2.26/src/stride.rs:
D
/* Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ module derelict.sdl2.mixer; private { import derelict.util.loader; import derelict.util.system; import derelict.sdl2.types; import derelict.sdl2.functions; static if( Derelict_OS_Windows ) enum libNames = "SDL2_mixer.dll"; else static if( Derelict_OS_Mac ) enum libNames = "/usr/local/lib/libSDL2_mixer.dylib, ../Frameworks/SDL2_mixer.framework/SDL2_mixer, /Library/Frameworks/SDL2_mixer.framework/SDL2_mixer, /System/Library/Frameworks/SDL2_mixer.framework/SDL2_mixer"; else static if( Derelict_OS_Posix ) enum libNames = "libSDL2_mixer.so, libSDL2_mixer-2.0.so, libSDL2_mixer-2.0.so.0, /usr/local/lib/libSDL2_mixer-2.0.so, /usr/local/lib/libSDL2_mixer-2.0.so.0"; else static assert( 0, "Need to implement SDL2_mixer libNames for this operating system." ); } enum : Uint8 { SDL_MIXER_MAJOR_VERSION = 2, SDL_MIXER_MINOR_VERSION = 0, SDL_MIXER_PATCHLEVEL = 0, } alias MIX_MAJOR_VERSION = SDL_MIXER_MAJOR_VERSION; alias MIX_MINOR_VERSION = SDL_MIXER_MINOR_VERSION; alias MIX_PATCH_LEVEL = SDL_MIXER_PATCHLEVEL; @nogc nothrow void SDL_MIXER_VERSION( SDL_version* X ) { X.major = SDL_MIXER_MAJOR_VERSION; X.minor = SDL_MIXER_MINOR_VERSION; X.patch = SDL_MIXER_PATCHLEVEL; } alias SDL_MIX_VERSION = SDL_MIXER_VERSION; alias Mix_SetError = SDL_SetError; alias Mix_GetError = SDL_GetError; alias MIX_InitFlags = int; enum : int { MIX_INIT_FLAC = 0x00000001, MIX_INIT_MOD = 0x00000002, MIX_INIT_MODPLUG = 0x00000004, MIX_INIT_MP3 = 0x00000008, MIX_INIT_OGG = 0x00000010, MIX_INIT_FLUIDSYNTH = 0x00000020, } enum { MIX_CHANNELS = 8, MIX_DEFAULT_FREQUENCY = 22050, MIX_DEFAULT_CHANNELS = 2, MIX_MAX_VOLUME = 128, MIX_CHANNEL_POST = -2, } version ( LittleEndian ) { enum MIX_DEFAULT_FORMAT = AUDIO_S16LSB; } else { enum MIX_DEFAULT_FORMAT = AUDIO_S16MSB; } struct Mix_Chunk { int allocated; Uint8* abuf; Uint32 alen; Uint8 volume; }; alias Mix_Fading = int; enum : int { MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN }; alias Mix_MusicType = int; enum : int { MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG, MUS_MP3, MUS_MP3_MAD, MUS_FLAC, MUS_MODPLUG, }; struct Mix_Music; string MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED"; extern( C ) nothrow { alias Mix_EffectFunc_t = void function( int chan, void* stream, int len, void* udata ); alias Mix_EffectDone_t = void function( int chan, void* udata ); } @nogc nothrow { Mix_Chunk* Mix_LoadWAV( const( char )* file ) { return Mix_LoadWAV_RW( SDL_RWFromFile( file, "rb" ), 1 ); } int Mix_PlayChannel( int channel, Mix_Chunk* chunk, int loops ) { return Mix_PlayChannelTimed( channel, chunk, loops, -1 ); } int Mix_FadeInChannel( int channel, Mix_Chunk* chunk, int loops, int ms ) { return Mix_FadeInChannelTimed( channel, chunk, loops, ms, -1 ); } } extern ( C ) @nogc nothrow { alias da_Mix_Linked_Version = const( SDL_version )* function(); alias da_Mix_Init = int function( int ); alias da_Mix_Quit = void function(); alias da_Mix_OpenAudio = int function ( int, Uint16, int, int ); alias da_Mix_AllocateChannels = int function( int ); alias da_Mix_QuerySpec = int function( int*, Uint16*, int* ); alias da_Mix_LoadWAV_RW = Mix_Chunk* function( SDL_RWops*, int ); alias da_Mix_LoadMUS = Mix_Music* function( const( char )* ); alias da_Mix_LoadMUS_RW = Mix_Music* function( SDL_RWops*, int ); alias da_Mix_LoadMUSType_RW = Mix_Music* function( SDL_RWops*, Mix_MusicType, int ); alias da_Mix_QuickLoad_WAV = Mix_Chunk* function( Uint8* ); alias da_Mix_QuickLoad_RAW = Mix_Chunk* function( Uint8*, Uint32 ); alias da_Mix_FreeChunk = void function( Mix_Chunk* ); alias da_Mix_FreeMusic = void function( Mix_Music* ); alias da_Mix_GetNumChunkDecoders = int function(); alias da_Mix_GetChunkDecoder = const( char )* function( int ); alias da_Mix_GetNumMusicDecoders = int function(); alias da_Mix_GetMusicDecoder = const( char )* function( int ); alias da_Mix_GetMusicType = Mix_MusicType function( const( Mix_Music )* ); alias da_Mix_SetPostMix = void function( void function(void*, Uint8*, int), void* ); alias da_Mix_HookMusic = void function( void function(void*, Uint8*, int), void* ); alias da_Mix_HookMusicFinished = void function( void function() ); alias da_Mix_GetMusicHookData = void* function(); alias da_Mix_ChannelFinished = void function( void function( int channel ) ); alias da_Mix_RegisterEffect = int function( int, Mix_EffectFunc_t, Mix_EffectDone_t, void* ); alias da_Mix_UnregisterEffect = int function( int, Mix_EffectFunc_t ); alias da_Mix_UnregisterAllEffects = int function( int ); alias da_Mix_SetPanning = int function( int, Uint8, Uint8 ); alias da_Mix_SetPosition = int function( int, Sint16, Uint8 ); alias da_Mix_SetDistance = int function( int, Uint8 ); // alias int function( int, Uint8 ) da_Mix_SetReverb; alias da_Mix_SetReverseStereo = int function( int, int ); alias da_Mix_ReserveChannels = int function( int ); alias da_Mix_GroupChannel = int function( int, int ); alias da_Mix_GroupChannels = int function( int, int, int ); alias da_Mix_GroupAvailable = int function( int ); alias da_Mix_GroupCount = int function( int ); alias da_Mix_GroupOldest = int function( int ); alias da_Mix_GroupNewer = int function( int ); alias da_Mix_PlayChannelTimed = int function( int, Mix_Chunk*, int, int ); alias da_Mix_PlayMusic = int function( Mix_Music*, int ); alias da_Mix_FadeInMusic = int function( Mix_Music*, int, int ); alias da_Mix_FadeInMusicPos = int function( Mix_Music*, int, int, double ); alias da_Mix_FadeInChannelTimed = int function( int, Mix_Chunk*, int, int, int ); alias da_Mix_Volume = int function( int, int ); alias da_Mix_VolumeChunk = int function( Mix_Chunk*, int ); alias da_Mix_VolumeMusic = int function( int ); alias da_Mix_HaltChannel = int function( int ); alias da_Mix_HaltGroup = int function( int ); alias da_Mix_HaltMusic = int function(); alias da_Mix_ExpireChannel = int function( int, int ); alias da_Mix_FadeOutChannel = int function( int, int ); alias da_Mix_FadeOutGroup = int function( int, int ); alias da_Mix_FadeOutMusic = int function( int ); alias da_Mix_FadingMusic = Mix_Fading function(); alias da_Mix_FadingChannel = Mix_Fading function( int ); alias da_Mix_Pause = void function( int ); alias da_Mix_Resume = void function( int ); alias da_Mix_Paused = int function( int ); alias da_Mix_PauseMusic = void function(); alias da_Mix_ResumeMusic = void function(); alias da_Mix_RewindMusic = void function(); alias da_Mix_PausedMusic = int function(); alias da_Mix_SetMusicPosition = int function( double ); alias da_Mix_Playing = int function( int ); alias da_Mix_PlayingMusic = int function(); alias da_Mix_SetMusicCMD = int function( in char* ); alias da_Mix_SetSynchroValue = int function( int ); alias da_Mix_GetSynchroValue = int function(); alias da_Mix_GetChunk = Mix_Chunk* function( int ); alias da_Mix_CloseAudio = void function(); } __gshared { da_Mix_Linked_Version Mix_Linked_Version; da_Mix_Init Mix_Init; da_Mix_Quit Mix_Quit; da_Mix_OpenAudio Mix_OpenAudio; da_Mix_AllocateChannels Mix_AllocateChannels; da_Mix_QuerySpec Mix_QuerySpec; da_Mix_LoadWAV_RW Mix_LoadWAV_RW; da_Mix_LoadMUS Mix_LoadMUS; da_Mix_LoadMUS_RW Mix_LoadMUS_RW; da_Mix_LoadMUSType_RW Mix_LoadMUSType_RW; da_Mix_QuickLoad_WAV Mix_QuickLoad_WAV; da_Mix_QuickLoad_RAW Mix_QuickLoad_RAW; da_Mix_FreeChunk Mix_FreeChunk; da_Mix_FreeMusic Mix_FreeMusic; da_Mix_GetNumChunkDecoders Mix_GetNumChunkDecoders; da_Mix_GetChunkDecoder Mix_GetChunkDecoder; da_Mix_GetNumMusicDecoders Mix_GetNumMusicDecoders; da_Mix_GetMusicDecoder Mix_GetMusicDecoder; da_Mix_GetMusicType Mix_GetMusicType; da_Mix_SetPostMix Mix_SetPostMix; da_Mix_HookMusic Mix_HookMusic; da_Mix_HookMusicFinished Mix_HookMusicFinished; da_Mix_GetMusicHookData Mix_GetMusicHookData; da_Mix_ChannelFinished Mix_ChannelFinished; da_Mix_RegisterEffect Mix_RegisterEffect; da_Mix_UnregisterEffect Mix_UnregisterEffect; da_Mix_UnregisterAllEffects Mix_UnregisterAllEffects; da_Mix_SetPanning Mix_SetPanning; da_Mix_SetPosition Mix_SetPosition; da_Mix_SetDistance Mix_SetDistance; // da_ Mix_SetReverb; da_Mix_SetReverseStereo Mix_SetReverseStereo; da_Mix_ReserveChannels Mix_ReserveChannels; da_Mix_GroupChannel Mix_GroupChannel; da_Mix_GroupChannels Mix_GroupChannels; da_Mix_GroupAvailable Mix_GroupAvailable; da_Mix_GroupCount Mix_GroupCount; da_Mix_GroupOldest Mix_GroupOldest; da_Mix_GroupNewer Mix_GroupNewer; da_Mix_PlayChannelTimed Mix_PlayChannelTimed; da_Mix_PlayMusic Mix_PlayMusic; da_Mix_FadeInMusic Mix_FadeInMusic; da_Mix_FadeInMusicPos Mix_FadeInMusicPos; da_Mix_FadeInChannelTimed Mix_FadeInChannelTimed; da_Mix_Volume Mix_Volume; da_Mix_VolumeChunk Mix_VolumeChunk; da_Mix_VolumeMusic Mix_VolumeMusic; da_Mix_HaltChannel Mix_HaltChannel; da_Mix_HaltGroup Mix_HaltGroup; da_Mix_HaltMusic Mix_HaltMusic; da_Mix_ExpireChannel Mix_ExpireChannel; da_Mix_FadeOutChannel Mix_FadeOutChannel; da_Mix_FadeOutGroup Mix_FadeOutGroup; da_Mix_FadeOutMusic Mix_FadeOutMusic; da_Mix_FadingMusic Mix_FadingMusic; da_Mix_FadingChannel Mix_FadingChannel; da_Mix_Pause Mix_Pause; da_Mix_Resume Mix_Resume; da_Mix_Paused Mix_Paused; da_Mix_PauseMusic Mix_PauseMusic; da_Mix_ResumeMusic Mix_ResumeMusic; da_Mix_RewindMusic Mix_RewindMusic; da_Mix_PausedMusic Mix_PausedMusic; da_Mix_SetMusicPosition Mix_SetMusicPosition; da_Mix_Playing Mix_Playing; da_Mix_PlayingMusic Mix_PlayingMusic; da_Mix_SetMusicCMD Mix_SetMusicCMD; da_Mix_SetSynchroValue Mix_SetSynchroValue; da_Mix_GetSynchroValue Mix_GetSynchroValue; da_Mix_GetChunk Mix_GetChunk; da_Mix_CloseAudio Mix_CloseAudio; } class DerelictSDL2MixerLoader : SharedLibLoader { public this() { super( libNames ); } protected override void loadSymbols() { bindFunc( cast( void** )&Mix_Linked_Version, "Mix_Linked_Version" ); bindFunc( cast( void** )&Mix_Init, "Mix_Init" ); bindFunc( cast( void** )&Mix_Quit, "Mix_Quit" ); bindFunc( cast( void** )&Mix_OpenAudio, "Mix_OpenAudio" ); bindFunc( cast( void** )&Mix_AllocateChannels, "Mix_AllocateChannels" ); bindFunc( cast( void** )&Mix_QuerySpec, "Mix_QuerySpec" ); bindFunc( cast( void** )&Mix_LoadWAV_RW, "Mix_LoadWAV_RW" ); bindFunc( cast( void** )&Mix_LoadMUS, "Mix_LoadMUS" ); bindFunc( cast( void** )&Mix_LoadMUS_RW, "Mix_LoadMUS_RW" ); bindFunc( cast( void** )&Mix_LoadMUSType_RW, "Mix_LoadMUSType_RW" ); bindFunc( cast( void** )&Mix_QuickLoad_WAV, "Mix_QuickLoad_WAV" ); bindFunc( cast( void** )&Mix_QuickLoad_RAW, "Mix_QuickLoad_RAW" ); bindFunc( cast( void** )&Mix_FreeChunk, "Mix_FreeChunk" ); bindFunc( cast( void** )&Mix_FreeMusic, "Mix_FreeMusic" ); bindFunc( cast( void** )&Mix_GetNumChunkDecoders, "Mix_GetNumChunkDecoders" ); bindFunc( cast( void** )&Mix_GetChunkDecoder, "Mix_GetChunkDecoder" ); bindFunc( cast( void** )&Mix_GetNumMusicDecoders, "Mix_GetNumMusicDecoders" ); bindFunc( cast( void** )&Mix_GetMusicDecoder, "Mix_GetMusicDecoder" ); bindFunc( cast( void** )&Mix_GetMusicType, "Mix_GetMusicType" ); bindFunc( cast( void** )&Mix_SetPostMix, "Mix_SetPostMix" ); bindFunc( cast( void** )&Mix_HookMusic, "Mix_HookMusic" ); bindFunc( cast( void** )&Mix_HookMusicFinished, "Mix_HookMusicFinished" ); bindFunc( cast( void** )&Mix_GetMusicHookData, "Mix_GetMusicHookData" ); bindFunc( cast( void** )&Mix_ChannelFinished, "Mix_ChannelFinished" ); bindFunc( cast( void** )&Mix_RegisterEffect, "Mix_RegisterEffect" ); bindFunc( cast( void** )&Mix_UnregisterEffect, "Mix_UnregisterEffect" ); bindFunc( cast( void** )&Mix_UnregisterAllEffects, "Mix_UnregisterAllEffects" ); bindFunc( cast( void** )&Mix_SetPanning, "Mix_SetPanning" ); bindFunc( cast( void** )&Mix_SetPosition, "Mix_SetPosition" ); bindFunc( cast( void** )&Mix_SetDistance, "Mix_SetDistance" ); // bindFunc( cast( void** )&Mix_SetReverb, "Mix_SetReverb" ); bindFunc( cast( void** )&Mix_SetReverseStereo, "Mix_SetReverseStereo" ); bindFunc( cast( void** )&Mix_ReserveChannels, "Mix_ReserveChannels" ); bindFunc( cast( void** )&Mix_GroupChannel, "Mix_GroupChannel" ); bindFunc( cast( void** )&Mix_GroupChannels, "Mix_GroupChannels" ); bindFunc( cast( void** )&Mix_GroupAvailable, "Mix_GroupAvailable" ); bindFunc( cast( void** )&Mix_GroupCount, "Mix_GroupCount" ); bindFunc( cast( void** )&Mix_GroupOldest, "Mix_GroupOldest" ); bindFunc( cast( void** )&Mix_GroupNewer, "Mix_GroupNewer" ); bindFunc( cast( void** )&Mix_PlayChannelTimed, "Mix_PlayChannelTimed" ); bindFunc( cast( void** )&Mix_PlayMusic, "Mix_PlayMusic" ); bindFunc( cast( void** )&Mix_FadeInMusic, "Mix_FadeInMusic" ); bindFunc( cast( void** )&Mix_FadeInMusicPos, "Mix_FadeInMusicPos" ); bindFunc( cast( void** )&Mix_FadeInChannelTimed, "Mix_FadeInChannelTimed" ); bindFunc( cast( void** )&Mix_Volume, "Mix_Volume" ); bindFunc( cast( void** )&Mix_VolumeChunk, "Mix_VolumeChunk" ); bindFunc( cast( void** )&Mix_VolumeMusic, "Mix_VolumeMusic" ); bindFunc( cast( void** )&Mix_HaltChannel, "Mix_HaltChannel" ); bindFunc( cast( void** )&Mix_HaltGroup, "Mix_HaltGroup" ); bindFunc( cast( void** )&Mix_HaltMusic, "Mix_HaltMusic" ); bindFunc( cast( void** )&Mix_ExpireChannel, "Mix_ExpireChannel" ); bindFunc( cast( void** )&Mix_FadeOutChannel, "Mix_FadeOutChannel" ); bindFunc( cast( void** )&Mix_FadeOutGroup, "Mix_FadeOutGroup" ); bindFunc( cast( void** )&Mix_FadeOutMusic, "Mix_FadeOutMusic" ); bindFunc( cast( void** )&Mix_FadingMusic, "Mix_FadingMusic" ); bindFunc( cast( void** )&Mix_FadingChannel, "Mix_FadingChannel" ); bindFunc( cast( void** )&Mix_Pause, "Mix_Pause" ); bindFunc( cast( void** )&Mix_Resume, "Mix_Resume" ); bindFunc( cast( void** )&Mix_Paused, "Mix_Paused" ); bindFunc( cast( void** )&Mix_PauseMusic, "Mix_PauseMusic" ); bindFunc( cast( void** )&Mix_ResumeMusic, "Mix_ResumeMusic" ); bindFunc( cast( void** )&Mix_RewindMusic, "Mix_RewindMusic" ); bindFunc( cast( void** )&Mix_PausedMusic, "Mix_PausedMusic" ); bindFunc( cast( void** )&Mix_SetMusicPosition, "Mix_SetMusicPosition" ); bindFunc( cast( void** )&Mix_Playing, "Mix_Playing" ); bindFunc( cast( void** )&Mix_PlayingMusic, "Mix_PlayingMusic" ); bindFunc( cast( void** )&Mix_SetMusicCMD, "Mix_SetMusicCMD" ); bindFunc( cast( void** )&Mix_SetSynchroValue, "Mix_SetSynchroValue" ); bindFunc( cast( void** )&Mix_GetSynchroValue, "Mix_GetSynchroValue" ); bindFunc( cast( void** )&Mix_GetChunk, "Mix_GetChunk" ); bindFunc( cast( void** )&Mix_CloseAudio, "Mix_CloseAudio" ); } } __gshared DerelictSDL2MixerLoader DerelictSDL2Mixer; shared static this() { DerelictSDL2Mixer = new DerelictSDL2MixerLoader(); }
D
having a rough edge
D
changing to a lighter color turn white
D
module it.c.compile.struct_; import it; @("onefield.int") @C( q{ struct Foo { int i; }; } ) @safe unittest { mixin( shouldCompile( D( q{ auto f = Foo(5); static assert(f.sizeof == 4, "Wrong sizeof for foo"); } ) ) ); } @("onefield.double") @safe unittest { shouldCompile( C( q{ struct Bar { double d; }; } ), D( q{ auto b = Bar(33.3); static assert(b.sizeof == 8, "Wrong sizeof for Bar"); } ) ); } @("threefields") @safe unittest { shouldCompile( C( q{ struct Baz { int i; int j; double d; }; } ), D( q{ import std.conv: text; auto b = Baz(42, 7, 33.3); static assert(is(typeof(b.i) == int)); static assert(is(typeof(b.j) == int)); static assert(is(typeof(b.d) == double)); static assert(b.sizeof == 16, text("Wrong sizeof for Baz: ", b.sizeof)); } ) ); } @("nested") @C( q{ struct Outer { int integer; struct Inner { int x; } inner; }; } ) @safe unittest { mixin( shouldCompile( D( q{ auto o = Outer(77, Outer.Inner(42)); static assert(o.sizeof == 8, "Wrong sizeof for Outer"); } ) ) ); } @("typedef.name") @C( q{ typedef struct TypeDefd_ { int i; double d; } TypeDefd; } ) @safe unittest { mixin( shouldCompile( D( q{ { auto t = TypeDefd_(42, 33.3); static assert(t.sizeof == 16, "Wrong sizeof for TypeDefd_"); } { auto t = TypeDefd(42, 33.3); static assert(t.sizeof == 16, "Wrong sizeof for TypeDefd"); } } ) ) ); } @C( q{ typedef struct { int x, y, z; } Nameless1; typedef struct { double d; } Nameless2; } ) @("typedef.anon") @safe unittest { mixin( shouldCompile( D( q{ auto n1 = Nameless1(2, 3, 4); static assert(n1.sizeof == 12, "Wrong sizeof for Nameless1"); static assert(is(typeof(Nameless1.x) == int)); static assert(is(typeof(Nameless1.y) == int)); static assert(is(typeof(Nameless1.z) == int)); auto n2 = Nameless2(33.3); static assert(n2.sizeof == 8, "Wrong sizeof for Nameless2"); static assert(is(typeof(Nameless2.d) == double)); } ) ) ); } @C( q{ typedef struct A B; struct A { int a; }; } ) @("typedef.before") @safe unittest { mixin( shouldCompile( D( q{ auto a = A(42); auto b = B(77); static assert(is(A == B)); } ) ) ); } @WIP2 @("fsid_t") @safe unittest { shouldCompile( C( ` #define __FSID_T_TYPE struct { int __val[2]; } typedef __FSID_T_TYPE __fsid_t; typedef __fsid_t fsid_t; ` ), D( q{ fsid_t foo; foo.__val[0] = 2; foo.__val[1] = 3; } ) ); } @WIP2 @("fd_set") @safe unittest { with(immutable IncludeSandbox()) { writeFile("system.h", ` #define __FD_SETSIZE 1024 typedef long int __fd_mask; #define __NFDBITS (8 * (int) sizeof (__fd_mask)) typedef struct { #ifdef __USE_XOPEN __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->fds_bits) #else __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; # define __FDS_BITS(set) ((set)->__fds_bits) #endif } fd_set; `); writeFile("header.h", ` #include "system.h" `); const dppFileName = "foo.dpp"; writeFile("foo.dpp", ` #include "header.h" void func() { fd_set foo; foo.__fds_bits[0] = 5; } `); runPreprocessOnly("foo.dpp"); shouldCompile("foo.d"); } } @("multiple declarations") @safe unittest { shouldCompile( C( q{ struct Struct; struct Struct; struct OtherStruct; struct Struct { int x, y, z; }; } ), D( q{ Struct s; s.x = 42; s.y = 33; s.z = 77; static assert(!__traits(compiles, OtherStruct())); } ) ); } @WIP2 @("var.anonymous") @safe unittest { shouldCompile( C(`struct { int i; } var;`), D( q{ var.i = 42; } ) ); } @WIP2 @("var.anonymous.typedef") @safe unittest { shouldCompile( C(` typedef struct { int i; } mystruct; mystruct var; `), D( q{ var.i = 42; } ) ); } @("const anonymous struct as field") @safe unittest { shouldCompile( C( q{ struct A { const struct { int version; int other; } version; }; } ), D( q{ A a = { version_ : { version_ : 13, other : 7 } }; } ) ); } @("Pointer to pointer to undeclared struct should result in a struct declaration") @safe unittest { shouldCompile( C( q{ struct A { const struct B** p; }; void f(struct C***); } ), D( q{ B *ptrB; C *ptrC; } ) ); } @("rpcndr") @safe unittest { shouldCompile( C( q{ typedef struct { int i; } *StructPtr; } ), D( q{ StructPtr ptr = null; } ) ); }
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range; void get(Args...)(ref Args args) { import std.traits, std.meta, std.typecons; static if (Args.length == 1) { alias Arg = Args[0]; static if (isArray!Arg) { static if (isSomeChar!(ElementType!Arg)) { args[0] = readln.chomp.to!Arg; } else { args[0] = readln.split.to!Arg; } } else static if (isTuple!Arg) { auto input = readln.split; static foreach (i; 0..Fields!Arg.length) { args[0][i] = input[i].to!(Fields!Arg[i]); } } else { args[0] = readln.chomp.to!Arg; } } else { auto input = readln.split; assert(input.length == Args.length); static foreach (i; 0..Args.length) { args[i] = input[i].to!(Args[i]); } } } void get_lines(Args...)(size_t N, ref Args args) { import std.traits, std.range; static foreach (i; 0..Args.length) { static assert(isArray!(Args[i])); args[i].length = N; } foreach (i; 0..N) { static if (Args.length == 1) { get(args[0][i]); } else { auto input = readln.split; static foreach (j; 0..Args.length) { args[j][i] = input[j].to!(ElementType!(Args[j])); } } } } void main() { int N; get(N); long[] AA; get(AA); auto ff = AA[0..N].dup.redBlackTree!true(); auto f = AA[0..N].sum(); auto bb = AA[N..$].dup.redBlackTree!true(); long b; foreach (_; 0..N) { b += bb.front; bb.removeFront(); } auto r = f - b; foreach (i; N..2 * N) { f += AA[i]; ff.insert(AA[i]); f -= ff.front(); ff.removeFront(); if (bb.equalRange(AA[i]).empty) { b += bb.front - AA[i]; bb.removeFront(); } else { bb.removeKey(AA[i]); } r = max(r, f - b); } writeln(r); }
D
# FIXED Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/driverlib/interrupt.c Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/inc/hw_types.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/driverlib/interrupt.h Comun/driverlib/interrupt.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/driverlib/interrupt.c: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/inc/hw_types.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/driverlib/interrupt.h: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h:
D
/Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/YPImagePicker.build/Objects-normal/x86_64/YPCameraView.o : /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPCameraVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Video/YPVideoCaptureVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Crop/YPCropVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/YPPickerVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Video/YPVideoFiltersVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPPhotoFiltersVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibrary+LibraryChange.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPPermissionCheckable.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/PreiOS10PhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/PostiOS10PhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPPhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC+PanGesture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryViewDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPImageSize.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFilterCollectionViewCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryViewCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPMediaItem.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPMenuItem.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbum.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPPickerScreen.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPImagePickerConfiguration.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPLibrarySelection.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPDragDirection.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPPermissionDeniedPopup.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPBottomPager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/LibraryMediaManager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumsManager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/YPImagePicker.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAssetViewContainer.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Video/YPVideoCaptureHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPDeviceOrientationHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFilter.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPPhotoSaver.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPTrimError.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPVideoProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPWordings.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPIcons.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/URL+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVCaptureDevice+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CIImage+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIImage+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVFileType+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/String+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVCaptureSession+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVFoundation+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVMutableComposition+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIButton+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/PHCachingImageManager+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/NSFileManager+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVPlayer+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIColor+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CGFloat+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CGRect+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/IndexSet+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVAsset+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/PHFetchResult+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UICollectionView+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPLoaders.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPColors.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPPhotoCaptureDefaults.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPAlerts.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPPagerMenu.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPCameraView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPGridView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAssetZoomableView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPLoadingView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC+CollectionView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Video/YPVideoView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Crop/YPCropView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPBottomPagerView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFiltersView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryView.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/simd.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreLocation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Photos.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.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/CoreAudio.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/Photos.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 /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/SteviaLayout/Stevia.framework/Modules/Stevia.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 /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/PryntTrimmerView/PryntTrimmerView.framework/Modules/PryntTrimmerView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/YPImagePicker/YPImagePicker-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/SteviaLayout/SteviaLayout-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/PryntTrimmerView/PryntTrimmerView-umbrella.h /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/SteviaLayout/Stevia.framework/Headers/Stevia-Swift.h /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/PryntTrimmerView/PryntTrimmerView.framework/Headers/PryntTrimmerView-Swift.h /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/YPImagePicker.build/unextended-module.modulemap /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/SteviaLayout.build/module.modulemap /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/PryntTrimmerView.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/YPImagePicker.build/Objects-normal/x86_64/YPCameraView~partial.swiftmodule : /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPCameraVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Video/YPVideoCaptureVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Crop/YPCropVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/YPPickerVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Video/YPVideoFiltersVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPPhotoFiltersVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibrary+LibraryChange.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPPermissionCheckable.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/PreiOS10PhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/PostiOS10PhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPPhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC+PanGesture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryViewDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPImageSize.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFilterCollectionViewCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryViewCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPMediaItem.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPMenuItem.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbum.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPPickerScreen.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPImagePickerConfiguration.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPLibrarySelection.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPDragDirection.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPPermissionDeniedPopup.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPBottomPager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/LibraryMediaManager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumsManager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/YPImagePicker.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAssetViewContainer.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Video/YPVideoCaptureHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPDeviceOrientationHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFilter.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPPhotoSaver.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPTrimError.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPVideoProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPWordings.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPIcons.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/URL+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVCaptureDevice+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CIImage+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIImage+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVFileType+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/String+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVCaptureSession+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVFoundation+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVMutableComposition+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIButton+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/PHCachingImageManager+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/NSFileManager+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVPlayer+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIColor+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CGFloat+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CGRect+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/IndexSet+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVAsset+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/PHFetchResult+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UICollectionView+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPLoaders.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPColors.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPPhotoCaptureDefaults.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPAlerts.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPPagerMenu.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPCameraView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPGridView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAssetZoomableView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPLoadingView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC+CollectionView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Video/YPVideoView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Crop/YPCropView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPBottomPagerView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFiltersView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryView.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/simd.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreLocation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Photos.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.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/CoreAudio.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/Photos.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 /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/SteviaLayout/Stevia.framework/Modules/Stevia.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 /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/PryntTrimmerView/PryntTrimmerView.framework/Modules/PryntTrimmerView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/YPImagePicker/YPImagePicker-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/SteviaLayout/SteviaLayout-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/PryntTrimmerView/PryntTrimmerView-umbrella.h /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/SteviaLayout/Stevia.framework/Headers/Stevia-Swift.h /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/PryntTrimmerView/PryntTrimmerView.framework/Headers/PryntTrimmerView-Swift.h /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/YPImagePicker.build/unextended-module.modulemap /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/SteviaLayout.build/module.modulemap /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/PryntTrimmerView.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/YPImagePicker.build/Objects-normal/x86_64/YPCameraView~partial.swiftdoc : /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPCameraVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Video/YPVideoCaptureVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Crop/YPCropVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/YPPickerVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Video/YPVideoFiltersVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPPhotoFiltersVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryVC.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibrary+LibraryChange.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPPermissionCheckable.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/PreiOS10PhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/PostiOS10PhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPPhotoCapture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC+PanGesture.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryViewDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPImageSize.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFilterCollectionViewCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryViewCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryCell.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPMediaItem.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPMenuItem.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbum.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPPickerScreen.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPImagePickerConfiguration.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPLibrarySelection.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPDragDirection.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPPermissionDeniedPopup.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPBottomPager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/LibraryMediaManager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumsManager.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/YPImagePicker.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAssetViewContainer.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Video/YPVideoCaptureHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPDeviceOrientationHelper.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFilter.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPPhotoSaver.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Models/YPTrimError.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPVideoProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPWordings.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPIcons.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/URL+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVCaptureDevice+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CIImage+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIImage+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVFileType+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/String+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVCaptureSession+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVFoundation+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVMutableComposition+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIButton+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/PHCachingImageManager+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/NSFileManager+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVPlayer+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UIColor+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CGFloat+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/CGRect+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/IndexSet+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/AVAsset+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/PHFetchResult+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/Extensions/UICollectionView+Extensions.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPLoaders.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Configuration/YPColors.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPPhotoCaptureDefaults.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPAlerts.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPPagerMenu.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Photo/YPCameraView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPGridView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAssetZoomableView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Helpers/YPLoadingView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPAlbumView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryVC+CollectionView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Video/YPVideoView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/Crop/YPCropView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/BottomPager/YPBottomPagerView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Filters/YPFiltersView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/Pages/Gallery/YPLibraryView.swift /Users/macbook/Desktop/BookFarm/Pods/YPImagePicker/Source/SelectionsGallery/YPSelectionsGalleryView.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/simd.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreLocation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Photos.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.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/CoreAudio.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/Photos.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 /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/SteviaLayout/Stevia.framework/Modules/Stevia.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 /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/PryntTrimmerView/PryntTrimmerView.framework/Modules/PryntTrimmerView.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/YPImagePicker/YPImagePicker-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/SteviaLayout/SteviaLayout-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/PryntTrimmerView/PryntTrimmerView-umbrella.h /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/SteviaLayout/Stevia.framework/Headers/Stevia-Swift.h /Users/macbook/Desktop/BookFarm/build/Debug-iphonesimulator/PryntTrimmerView/PryntTrimmerView.framework/Headers/PryntTrimmerView-Swift.h /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/YPImagePicker.build/unextended-module.modulemap /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/SteviaLayout.build/module.modulemap /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/PryntTrimmerView.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
// Copyright Ahmet Sait Koçak 2020. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) module bindbc.hb.bind.ot.math; import bindbc.hb.bind.common; import bindbc.hb.bind.face; import bindbc.hb.bind.font; extern(C) @nogc nothrow: /* * MATH */ enum HB_OT_TAG_MATH = HB_TAG('M', 'A', 'T', 'H'); /* Use with hb_buffer_set_script() for math shaping. */ enum HB_OT_MATH_SCRIPT = HB_TAG('m', 'a', 't', 'h'); /* Types */ /** * hb_ot_math_constant_t: * * The 'MATH' table constants specified at * https://docs.microsoft.com/en-us/typography/opentype/spec/math * * Since: 1.3.3 */ enum : int { HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN = 0, HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN = 1, HB_OT_MATH_CONSTANT_DELIMITED_SUB_FORMULA_MIN_HEIGHT = 2, HB_OT_MATH_CONSTANT_DISPLAY_OPERATOR_MIN_HEIGHT = 3, HB_OT_MATH_CONSTANT_MATH_LEADING = 4, HB_OT_MATH_CONSTANT_AXIS_HEIGHT = 5, HB_OT_MATH_CONSTANT_ACCENT_BASE_HEIGHT = 6, HB_OT_MATH_CONSTANT_FLATTENED_ACCENT_BASE_HEIGHT = 7, HB_OT_MATH_CONSTANT_SUBSCRIPT_SHIFT_DOWN = 8, HB_OT_MATH_CONSTANT_SUBSCRIPT_TOP_MAX = 9, HB_OT_MATH_CONSTANT_SUBSCRIPT_BASELINE_DROP_MIN = 10, HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP = 11, HB_OT_MATH_CONSTANT_SUPERSCRIPT_SHIFT_UP_CRAMPED = 12, HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MIN = 13, HB_OT_MATH_CONSTANT_SUPERSCRIPT_BASELINE_DROP_MAX = 14, HB_OT_MATH_CONSTANT_SUB_SUPERSCRIPT_GAP_MIN = 15, HB_OT_MATH_CONSTANT_SUPERSCRIPT_BOTTOM_MAX_WITH_SUBSCRIPT = 16, HB_OT_MATH_CONSTANT_SPACE_AFTER_SCRIPT = 17, HB_OT_MATH_CONSTANT_UPPER_LIMIT_GAP_MIN = 18, HB_OT_MATH_CONSTANT_UPPER_LIMIT_BASELINE_RISE_MIN = 19, HB_OT_MATH_CONSTANT_LOWER_LIMIT_GAP_MIN = 20, HB_OT_MATH_CONSTANT_LOWER_LIMIT_BASELINE_DROP_MIN = 21, HB_OT_MATH_CONSTANT_STACK_TOP_SHIFT_UP = 22, HB_OT_MATH_CONSTANT_STACK_TOP_DISPLAY_STYLE_SHIFT_UP = 23, HB_OT_MATH_CONSTANT_STACK_BOTTOM_SHIFT_DOWN = 24, HB_OT_MATH_CONSTANT_STACK_BOTTOM_DISPLAY_STYLE_SHIFT_DOWN = 25, HB_OT_MATH_CONSTANT_STACK_GAP_MIN = 26, HB_OT_MATH_CONSTANT_STACK_DISPLAY_STYLE_GAP_MIN = 27, HB_OT_MATH_CONSTANT_STRETCH_STACK_TOP_SHIFT_UP = 28, HB_OT_MATH_CONSTANT_STRETCH_STACK_BOTTOM_SHIFT_DOWN = 29, HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_ABOVE_MIN = 30, HB_OT_MATH_CONSTANT_STRETCH_STACK_GAP_BELOW_MIN = 31, HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_SHIFT_UP = 32, HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_DISPLAY_STYLE_SHIFT_UP = 33, HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_SHIFT_DOWN = 34, HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_DISPLAY_STYLE_SHIFT_DOWN = 35, HB_OT_MATH_CONSTANT_FRACTION_NUMERATOR_GAP_MIN = 36, HB_OT_MATH_CONSTANT_FRACTION_NUM_DISPLAY_STYLE_GAP_MIN = 37, HB_OT_MATH_CONSTANT_FRACTION_RULE_THICKNESS = 38, HB_OT_MATH_CONSTANT_FRACTION_DENOMINATOR_GAP_MIN = 39, HB_OT_MATH_CONSTANT_FRACTION_DENOM_DISPLAY_STYLE_GAP_MIN = 40, HB_OT_MATH_CONSTANT_SKEWED_FRACTION_HORIZONTAL_GAP = 41, HB_OT_MATH_CONSTANT_SKEWED_FRACTION_VERTICAL_GAP = 42, HB_OT_MATH_CONSTANT_OVERBAR_VERTICAL_GAP = 43, HB_OT_MATH_CONSTANT_OVERBAR_RULE_THICKNESS = 44, HB_OT_MATH_CONSTANT_OVERBAR_EXTRA_ASCENDER = 45, HB_OT_MATH_CONSTANT_UNDERBAR_VERTICAL_GAP = 46, HB_OT_MATH_CONSTANT_UNDERBAR_RULE_THICKNESS = 47, HB_OT_MATH_CONSTANT_UNDERBAR_EXTRA_DESCENDER = 48, HB_OT_MATH_CONSTANT_RADICAL_VERTICAL_GAP = 49, HB_OT_MATH_CONSTANT_RADICAL_DISPLAY_STYLE_VERTICAL_GAP = 50, HB_OT_MATH_CONSTANT_RADICAL_RULE_THICKNESS = 51, HB_OT_MATH_CONSTANT_RADICAL_EXTRA_ASCENDER = 52, HB_OT_MATH_CONSTANT_RADICAL_KERN_BEFORE_DEGREE = 53, HB_OT_MATH_CONSTANT_RADICAL_KERN_AFTER_DEGREE = 54, HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT = 55 } alias hb_ot_math_constant_t = int; /** * hb_ot_math_kern_t: * * The math kerning-table types defined for the four corners * of a glyph. * * Since: 1.3.3 */ enum : int { HB_OT_MATH_KERN_TOP_RIGHT = 0, HB_OT_MATH_KERN_TOP_LEFT = 1, HB_OT_MATH_KERN_BOTTOM_RIGHT = 2, HB_OT_MATH_KERN_BOTTOM_LEFT = 3 } alias hb_ot_math_kern_t = int; /** * hb_ot_math_glyph_variant_t: * @glyph: The glyph index of the variant * @advance: The advance width of the variant * * Data type to hold math-variant information for a glyph. * * Since: 1.3.3 */ struct hb_ot_math_glyph_variant_t { hb_codepoint_t glyph; hb_position_t advance; } /** * hb_ot_math_glyph_part_flags_t: * * Flags for math glyph parts. * * Since: 1.3.3 */ enum : uint { /*< flags >*/ HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER = 0x00000001u /* Extender glyph */ } alias hb_ot_math_glyph_part_flags_t = uint; /** * hb_ot_math_glyph_part_t: * @glyph: The glyph index of the variant part * @start_connector_length: The length of the connector on the starting side of the variant part * @end_connector_length: The length of the connector on the ending side of the variant part * @full_advance: The total advance of the part * @flags: #hb_ot_math_glyph_part_flags_t flags for the part * * Data type to hold information for a "part" component of a math-variant glyph. * Large variants for stretchable math glyphs (such as parentheses) can be constructed * on the fly from parts. * * Since: 1.3.3 */ struct hb_ot_math_glyph_part_t { hb_codepoint_t glyph; hb_position_t start_connector_length; hb_position_t end_connector_length; hb_position_t full_advance; hb_ot_math_glyph_part_flags_t flags; } /* Methods */ version(BindHB_Static) hb_bool_t hb_ot_math_has_data (hb_face_t* face); else { private alias fp_hb_ot_math_has_data = hb_bool_t function (hb_face_t* face); __gshared fp_hb_ot_math_has_data hb_ot_math_has_data; } version(BindHB_Static) hb_position_t hb_ot_math_get_constant ( hb_font_t* font, hb_ot_math_constant_t constant); else { private alias fp_hb_ot_math_get_constant = hb_position_t function ( hb_font_t* font, hb_ot_math_constant_t constant); __gshared fp_hb_ot_math_get_constant hb_ot_math_get_constant; } version(BindHB_Static) hb_position_t hb_ot_math_get_glyph_italics_correction ( hb_font_t* font, hb_codepoint_t glyph); else { private alias fp_hb_ot_math_get_glyph_italics_correction = hb_position_t function ( hb_font_t* font, hb_codepoint_t glyph); __gshared fp_hb_ot_math_get_glyph_italics_correction hb_ot_math_get_glyph_italics_correction; } version(BindHB_Static) hb_position_t hb_ot_math_get_glyph_top_accent_attachment ( hb_font_t* font, hb_codepoint_t glyph); else { private alias fp_hb_ot_math_get_glyph_top_accent_attachment = hb_position_t function ( hb_font_t* font, hb_codepoint_t glyph); __gshared fp_hb_ot_math_get_glyph_top_accent_attachment hb_ot_math_get_glyph_top_accent_attachment; } version(BindHB_Static) hb_bool_t hb_ot_math_is_glyph_extended_shape ( hb_face_t* face, hb_codepoint_t glyph); else { private alias fp_hb_ot_math_is_glyph_extended_shape = hb_bool_t function ( hb_face_t* face, hb_codepoint_t glyph); __gshared fp_hb_ot_math_is_glyph_extended_shape hb_ot_math_is_glyph_extended_shape; } version(BindHB_Static) hb_position_t hb_ot_math_get_glyph_kerning ( hb_font_t* font, hb_codepoint_t glyph, hb_ot_math_kern_t kern, hb_position_t correction_height); else { private alias fp_hb_ot_math_get_glyph_kerning = hb_position_t function ( hb_font_t* font, hb_codepoint_t glyph, hb_ot_math_kern_t kern, hb_position_t correction_height); __gshared fp_hb_ot_math_get_glyph_kerning hb_ot_math_get_glyph_kerning; } /* IN/OUT */ /* OUT */ version(BindHB_Static) uint hb_ot_math_get_glyph_variants ( hb_font_t* font, hb_codepoint_t glyph, hb_direction_t direction, uint start_offset, uint* variants_count, hb_ot_math_glyph_variant_t* variants); else { private alias fp_hb_ot_math_get_glyph_variants = uint function ( hb_font_t* font, hb_codepoint_t glyph, hb_direction_t direction, uint start_offset, uint* variants_count, hb_ot_math_glyph_variant_t* variants); __gshared fp_hb_ot_math_get_glyph_variants hb_ot_math_get_glyph_variants; } version(BindHB_Static) hb_position_t hb_ot_math_get_min_connector_overlap ( hb_font_t* font, hb_direction_t direction); else { private alias fp_hb_ot_math_get_min_connector_overlap = hb_position_t function ( hb_font_t* font, hb_direction_t direction); __gshared fp_hb_ot_math_get_min_connector_overlap hb_ot_math_get_min_connector_overlap; } /* IN/OUT */ /* OUT */ /* OUT */ version(BindHB_Static) uint hb_ot_math_get_glyph_assembly ( hb_font_t* font, hb_codepoint_t glyph, hb_direction_t direction, uint start_offset, uint* parts_count, hb_ot_math_glyph_part_t* parts, hb_position_t* italics_correction); else { private alias fp_hb_ot_math_get_glyph_assembly = uint function ( hb_font_t* font, hb_codepoint_t glyph, hb_direction_t direction, uint start_offset, uint* parts_count, hb_ot_math_glyph_part_t* parts, hb_position_t* italics_correction); __gshared fp_hb_ot_math_get_glyph_assembly hb_ot_math_get_glyph_assembly; }
D
/Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/Build/Intermediates/mihon.build/Debug-iphoneos/mihon.build/Objects-normal/armv7/SecondViewControllre.o : /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/FirstViewController.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/AppDelegate.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/SecondViewControllre.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild3.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild1.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild2.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/CustomNavigationController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/CoreImage.swiftmodule /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/Build/Intermediates/mihon.build/Debug-iphoneos/mihon.build/Objects-normal/armv7/SecondViewControllre~partial.swiftmodule : /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/FirstViewController.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/AppDelegate.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/SecondViewControllre.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild3.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild1.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild2.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/CustomNavigationController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/CoreImage.swiftmodule /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/Build/Intermediates/mihon.build/Debug-iphoneos/mihon.build/Objects-normal/armv7/SecondViewControllre~partial.swiftdoc : /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/FirstViewController.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/AppDelegate.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/SecondViewControllre.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild3.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild1.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/ViewControllerTabChild2.swift /Users/yamasakitomohiro/Desktop/warkingFolder/seminar/seminar1/mihon/mihon/CustomNavigationController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/32/CoreImage.swiftmodule
D
module gui.inventorywindow; import std.algorithm; import std.conv; import std.exception; import std.stdio; import main; import gui.mainmenu; import gui.all; import graphics.image; import gui.unitcontrol; import cgy.util.sizes; import worldstate.block; import worldstate.sector; import random.random; import cgy.util.pos; import settings; import cgy.util.statistics; import cgy.util.util; import cgy.util.rect; import entities.entity; import inventory; class InventoryWindow : GuiElementWindow { GuiSystem guiSystem; HyperUnitControlInterfaceInputManager ofDOOM; GuiElementListBox listBox; GuiElementComboBox comboBox; this(GuiSystem g, HyperUnitControlInterfaceInputManager DOOM, Inventory* inventory) { guiSystem = g; ofDOOM = DOOM; super(guiSystem, Rectd(vec2d(0.25, 0.25), vec2d(0.5, 0.5)), "Inventory window~~~!", true, true); new PushButton(this, Rectd(vec2d(0.75, 0.9), vec2d(0.2, 0.10)), "Back", &onBack); listBox = new GuiElementListBox(this, Rectd(vec2d(0.5, 0.0), vec2d(0.5, 0.80)), 30); inventory.listBox = &listBox; comboBox = new GuiElementComboBox(this, Rectd(vec2d(0.1, 0.1), vec2d(0.3, 0.09))); comboBox.addItem("Item 1"); comboBox.addItem("Ett till"); comboBox.addItem("Wololooo"); comboBox.addItem("Sista"); comboBox.addItem("First!", 0); setVisible(false); } void onOpenInventory() { if (isVisible){ setVisible(false); guiSystem.setEventDump(ofDOOM); } else{ setVisible(true); guiSystem.setEventDump(null); } } override void onWindowClose() { onBack(); } void onBack() { setVisible(false); guiSystem.setEventDump(ofDOOM); } }
D
module android.java.java.nio.charset.CoderResult; public import android.java.java.nio.charset.CoderResult_d_interface; import arsd.jni : ImportExportImpl; mixin ImportExportImpl!CoderResult; import import1 = android.java.java.lang.Class; import import0 = android.java.java.nio.charset.CoderResult;
D
/Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/ImageView+Kingfisher.o : /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Image.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/WKInterfaceImage+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/NSButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Filter.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Result.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.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/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Kingfisher.h /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/ImageView+Kingfisher~partial.swiftmodule : /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Image.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/WKInterfaceImage+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/NSButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Filter.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Result.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.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/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Kingfisher.h /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/ImageView+Kingfisher~partial.swiftdoc : /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Image.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/WKInterfaceImage+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/NSButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Filter.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Result.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.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/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Kingfisher.h /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range; void get(Args...)(ref Args args) { import std.traits, std.meta, std.typecons; static if (Args.length == 1) { alias Arg = Args[0]; static if (isArray!Arg) { static if (isSomeChar!(ElementType!Arg)) { args[0] = readln.chomp.to!Arg; } else { args[0] = readln.split.to!Arg; } } else static if (isTuple!Arg) { auto input = readln.split; static foreach (i; 0..Fields!Arg.length) { args[0][i] = input[i].to!(Fields!Arg[i]); } } else { args[0] = readln.chomp.to!Arg; } } else { auto input = readln.split; assert(input.length == Args.length); static foreach (i; 0..Args.length) { args[i] = input[i].to!(Args[i]); } } } void get_lines(Args...)(size_t N, ref Args args) { import std.traits, std.range; static foreach (i; 0..Args.length) { static assert(isArray!(Args[i])); args[i].length = N; } foreach (i; 0..N) { static if (Args.length == 1) { get(args[0][i]); } else { auto input = readln.split; static foreach (j; 0..Args.length) { args[j][i] = input[j].to!(ElementType!(Args[j])); } } } } alias P = Tuple!(int, "a", int, "b"); void main() { int N; get(N); P[] ps; get_lines(N, ps); sort!"a.b < b.b"(ps); auto DP = new int[][](N + 1, N + 1); foreach (ref dp; DP) dp[] = int.max / 3; DP[0][0] = 0; foreach (i; 0..N) with (ps[i]) foreach (j; 0..N) { DP[i + 1][j] = min(DP[i + 1][j], DP[i][j]); if (DP[i][j] + a <= b) DP[i + 1][j + 1] = min(DP[i + 1][j + 1], DP[i][j] + a); } foreach_reverse (i, n; DP[N]) if (n < int.max / 3) return writeln(i); }
D
.hd twrit$ "write raw words to terminal" 03/25/82 integer function twrit$ (buf, nw, f) integer buf (ARB), nw file_des f .sp Library: vswtlb (standard Subsystem library) .fs 'Twrit$' is the device-dependent driver for terminal line-image i/o. The first argument is a string of words to be written; the second argument is the number of words to be written; and, the third argument is the file descriptor of the file to which data will be written. 'Twrit$' returns the number of words written (which should always equal 'nw'). 'Twrit$' is not intended for general use; it is not protected from user error, and may cause termination of the user's program if used incorrectly. It should always be referenced through 'writef'. .im 'Twrit$' calls the Primos subroutine T1OU 'nw' times, once per word in 'buf'. T1OU outputs one character to the user terminal. .ca Primos t1ou .sa writef (2), tread$ (6), readf (2)
D
/** * Copyright © DiamondMVC 2018 * License: MIT (https://github.com/DiamondMVC/Diamond/blob/master/LICENSE) * Author: Jacob Jensen (bausshf) */ module diamond.data.mapping.engines; public { import diamond.data.mapping.engines.mysql; }
D
instance Mod_943_GRD_Bloodwyn_MT (Npc_Default) { // ------ NSC ------ name = "Bloodwyn"; guild = GIL_OUT; id = 943; voice = 4;//Stimme Lee flags = 2; npctype = NPCTYPE_main; //aivars aivar[AIV_StoryBandit] = TRUE; // ------ Attribute ------ B_SetAttributesToChapter (self, 3); // ------ Kampf-Taktik ------ fight_tactic = FAI_HUMAN_STRONG; // ------ Equippte Waffen ------ EquipItem (self, ItMw_Sturmbringer); // ------ Inventory ------ // ------ visuals ------ B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_N_Bloodwyn, BodyTex_N, GRD_ARMOR_M); Mdl_SetModelFatness (self, 0); Mdl_ApplyOverlayMds (self, "Humans_Militia.mds"); // ------ NSC-relevante Talente vergeben ------ B_GiveNpcTalents (self); // ------ Kampf-Talente ------ B_SetFightSkills (self, 65); // ------ TA anmelden ------ daily_routine = Rtn_Start_943; }; FUNC VOID Rtn_Start_943 () { TA_Stand_Guarding (06,00,07,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (07,00,08,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (08,00,09,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (09,00,10,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (10,00,11,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (11,00,12,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (12,00,13,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (13,00,14,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (14,00,15,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (15,00,16,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (16,00,17,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (17,00,18,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (18,00,19,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (19,00,20,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (20,00,21,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (21,00,22,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (22,00,23,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (23,00,00,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (00,00,01,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (01,00,02,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (02,00,03,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (03,00,04,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (04,00,05,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (05,00,06,00,"OCR_OUTSIDE_HUT_63"); }; FUNC VOID Rtn_Dieb_943() { TA_Stand_Guarding (06,00,07,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (07,00,08,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (08,00,09,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (09,00,10,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (10,00,11,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (11,00,12,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (12,00,13,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (13,00,14,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (14,00,15,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (15,00,16,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (16,00,17,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (17,00,18,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (18,00,19,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (19,00,20,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (20,00,21,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (21,00,22,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (22,00,23,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (23,00,00,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (00,00,01,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (01,00,02,00,"OCC_BARONS_HALLWAY_FRONT"); TA_Pick_FP (02,00,03,00,"OCC_BARONS_UPSTAIRS_RIGHT_ROOM_FRONT"); TA_Stand_Guarding (03,00,04,00,"OCR_OUTSIDE_HUT_63"); TA_Stand_Guarding (04,00,05,00,"OCR_OUTSIDE_HUT_77_INSERT"); TA_Stand_Guarding (05,00,06,00,"OCR_OUTSIDE_HUT_63"); }; FUNC VOID Rtn_Flucht_943 () { TA_FleeToWP (23,35,08,35,"TOT"); TA_FleeToWP (08,35,23,35,"TOT"); }; FUNC VOID Rtn_knast_943 () { TA_Sit_Campfire (23,35,08,35,"OCC_CELLAR_BACK_RIGHT_CELL"); TA_Sit_Campfire (08,35,23,35,"OCC_CELLAR_BACK_RIGHT_CELL"); }; FUNC VOID Rtn_Tot_943 () { TA_Sit_Campfire (23,35,08,35,"TOT"); TA_Sit_Campfire (08,35,23,35,"TOT"); };
D
struct Foo { Foo opDispatch(string name)(int a, int[] b...) if(name == "bar") { return Foo(); } Foo opDispatch(string name)() if(name != "bar") { return Foo(); } } void main() { Foo().bar(0).bar(0).bar(0); }
D
// Written in the D programming language. /** Defines generic containers. Source: $(PHOBOSSRC std/_container.d) Macros: WIKI = Phobos/StdContainer TEXTWITHCOMMAS = $0 Copyright: Red-black tree code copyright (C) 2008- by Steven Schveighoffer. Other code copyright 2010- Andrei Alexandrescu. All rights reserved by the respective holders. License: Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at $(WEB boost.org/LICENSE_1_0.txt)). Authors: Steven Schveighoffer, $(WEB erdani.com, Andrei Alexandrescu) $(BOOKTABLE $(TEXTWITHCOMMAS Container primitives. A _container need not implement all primitives, but if a primitive is implemented, it must support the syntax described in the $(B syntax) column with the semantics described in the $(B description) column, and it must not have worse worst-case complexity than denoted in big-O notation in the $(BIGOH &middot;) column. Below, $(D C) means a _container type, $(D c) is a value of _container type, $(D n$(SUBx)) represents the effective length of value $(D x), which could be a single element (in which case $(D n$(SUB x)) is $(D 1)), a _container, or a range.), $(TR $(TH Syntax) $(TH $(BIGOH &middot;)) $(TH Description)) $(TR $(TDNW $(D C(x))) $(TDNW $(D n$(SUB x))) $(TD Creates a _container of type $(D C) from either another _container or a range.)) $(TR $(TDNW $(D c.dup)) $(TDNW $(D n$(SUB c))) $(TD Returns a duplicate of the _container.)) $(TR $(TDNW $(D c ~ x)) $(TDNW $(D n$(SUB c) + n$(SUB x))) $(TD Returns the concatenation of $(D c) and $(D r). $(D x) may be a single element or an input range.)) $(TR $(TDNW $(D x ~ c)) $(TDNW $(D n$(SUB c) + n$(SUB x))) $(TD Returns the concatenation of $(D x) and $(D c). $(D x) may be a single element or an input range type.)) $(LEADINGROW Iteration) $(TR $(TD $(D c.Range)) $(TD) $(TD The primary range type associated with the _container.)) $(TR $(TD $(D c[])) $(TDNW $(D log n$(SUB c))) $(TD Returns a range iterating over the entire _container, in a _container-defined order.)) $(TR $(TDNW $(D c[a .. b])) $(TDNW $(D log n$(SUB c))) $(TD Fetches a portion of the _container from key $(D a) to key $(D b).)) $(LEADINGROW Capacity) $(TR $(TD $(D c.empty)) $(TD $(D 1)) $(TD Returns $(D true) if the _container has no elements, $(D false) otherwise.)) $(TR $(TD $(D c.length)) $(TDNW $(D log n$(SUB c))) $(TD Returns the number of elements in the _container.)) $(TR $(TDNW $(D c.length = n)) $(TDNW $(D n$(SUB c) + n)) $(TD Forces the number of elements in the _container to $(D n). If the _container ends up growing, the added elements are initialized in a _container-dependent manner (usually with $(D T.init)).)) $(TR $(TD $(D c.capacity)) $(TDNW $(D log n$(SUB c))) $(TD Returns the maximum number of elements that can be stored in the _container without triggering a reallocation.)) $(TR $(TD $(D c.reserve(x))) $(TD $(D n$(SUB c))) $(TD Forces $(D capacity) to at least $(D x) without reducing it.)) $(LEADINGROW Access) $(TR $(TDNW $(D c.front)) $(TDNW $(D log n$(SUB c))) $(TD Returns the first element of the _container, in a _container-defined order.)) $(TR $(TDNW $(D c.moveFront)) $(TDNW $(D log n$(SUB c))) $(TD Destructively reads and returns the first element of the _container. The slot is not removed from the _container; it is left initialized with $(D T.init). This routine need not be defined if $(D front) returns a $(D ref).)) $(TR $(TDNW $(D c.front = v)) $(TDNW $(D log n$(SUB c))) $(TD Assigns $(D v) to the first element of the _container.)) $(TR $(TDNW $(D c.back)) $(TDNW $(D log n$(SUB c))) $(TD Returns the last element of the _container, in a _container-defined order.)) $(TR $(TDNW $(D c.moveBack)) $(TDNW $(D log n$(SUB c))) $(TD Destructively reads and returns the last element of the container. The slot is not removed from the _container; it is left initialized with $(D T.init). This routine need not be defined if $(D front) returns a $(D ref).)) $(TR $(TDNW $(D c.back = v)) $(TDNW $(D log n$(SUB c))) $(TD Assigns $(D v) to the last element of the _container.)) $(TR $(TDNW $(D c[x])) $(TDNW $(D log n$(SUB c))) $(TD Provides indexed access into the _container. The index type is _container-defined. A container may define several index types (and consequently overloaded indexing).)) $(TR $(TDNW $(D c.moveAt(x))) $(TDNW $(D log n$(SUB c))) $(TD Destructively reads and returns the value at position $(D x). The slot is not removed from the _container; it is left initialized with $(D T.init).)) $(TR $(TDNW $(D c[x] = v)) $(TDNW $(D log n$(SUB c))) $(TD Sets element at specified index into the _container.)) $(TR $(TDNW $(D c[x] $(I op)= v)) $(TDNW $(D log n$(SUB c))) $(TD Performs read-modify-write operation at specified index into the _container.)) $(LEADINGROW Operations) $(TR $(TDNW $(D e in c)) $(TDNW $(D log n$(SUB c))) $(TD Returns nonzero if e is found in $(D c).)) $(TR $(TDNW $(D c.lowerBound(v))) $(TDNW $(D log n$(SUB c))) $(TD Returns a range of all elements strictly less than $(D v).)) $(TR $(TDNW $(D c.upperBound(v))) $(TDNW $(D log n$(SUB c))) $(TD Returns a range of all elements strictly greater than $(D v).)) $(TR $(TDNW $(D c.equalRange(v))) $(TDNW $(D log n$(SUB c))) $(TD Returns a range of all elements in $(D c) that are equal to $(D v).)) $(LEADINGROW Modifiers) $(TR $(TDNW $(D c ~= x)) $(TDNW $(D n$(SUB c) + n$(SUB x))) $(TD Appends $(D x) to $(D c). $(D x) may be a single element or an input range type.)) $(TR $(TDNW $(D c.clear())) $(TDNW $(D n$(SUB c))) $(TD Removes all elements in $(D c).)) $(TR $(TDNW $(D c.insert(x))) $(TDNW $(D n$(SUB x) * log n$(SUB c))) $(TD Inserts $(D x) in $(D c) at a position (or positions) chosen by $(D c).)) $(TR $(TDNW $(D c.stableInsert(x))) $(TDNW $(D n$(SUB x) * log n$(SUB c))) $(TD Same as $(D c.insert(x)), but is guaranteed to not invalidate any ranges.)) $(TR $(TDNW $(D c.linearInsert(v))) $(TDNW $(D n$(SUB c))) $(TD Same as $(D c.insert(v)) but relaxes complexity to linear.)) $(TR $(TDNW $(D c.stableLinearInsert(v))) $(TDNW $(D n$(SUB c))) $(TD Same as $(D c.stableInsert(v)) but relaxes complexity to linear.)) $(TR $(TDNW $(D c.removeAny())) $(TDNW $(D log n$(SUB c))) $(TD Removes some element from $(D c) and returns it.)) $(TR $(TDNW $(D c.stableRemoveAny())) $(TDNW $(D log n$(SUB c))) $(TD Same as $(D c.removeAny()), but is guaranteed to not invalidate any iterators.)) $(TR $(TDNW $(D c.insertFront(v))) $(TDNW $(D log n$(SUB c))) $(TD Inserts $(D v) at the front of $(D c).)) $(TR $(TDNW $(D c.stableInsertFront(v))) $(TDNW $(D log n$(SUB c))) $(TD Same as $(D c.insertFront(v)), but guarantees no ranges will be invalidated.)) $(TR $(TDNW $(D c.insertBack(v))) $(TDNW $(D log n$(SUB c))) $(TD Inserts $(D v) at the back of $(D c).)) $(TR $(TDNW $(D c.stableInsertBack(v))) $(TDNW $(D log n$(SUB c))) $(TD Same as $(D c.insertBack(v)), but guarantees no ranges will be invalidated.)) $(TR $(TDNW $(D c.removeFront())) $(TDNW $(D log n$(SUB c))) $(TD Removes the element at the front of $(D c).)) $(TR $(TDNW $(D c.stableRemoveFront())) $(TDNW $(D log n$(SUB c))) $(TD Same as $(D c.removeFront()), but guarantees no ranges will be invalidated.)) $(TR $(TDNW $(D c.removeBack())) $(TDNW $(D log n$(SUB c))) $(TD Removes the value at the back of $(D c).)) $(TR $(TDNW $(D c.stableRemoveBack())) $(TDNW $(D log n$(SUB c))) $(TD Same as $(D c.removeBack()), but guarantees no ranges will be invalidated.)) $(TR $(TDNW $(D c.remove(r))) $(TDNW $(D n$(SUB r) * log n$(SUB c))) $(TD Removes range $(D r) from $(D c).)) $(TR $(TDNW $(D c.stableRemove(r))) $(TDNW $(D n$(SUB r) * log n$(SUB c))) $(TD Same as $(D c.remove(r)), but guarantees iterators are not invalidated.)) $(TR $(TDNW $(D c.linearRemove(r))) $(TDNW $(D n$(SUB c))) $(TD Removes range $(D r) from $(D c).)) $(TR $(TDNW $(D c.stableLinearRemove(r))) $(TDNW $(D n$(SUB c))) $(TD Same as $(D c.linearRemove(r)), but guarantees iterators are not invalidated.)) $(TR $(TDNW $(D c.removeKey(k))) $(TDNW $(D log n$(SUB c))) $(TD Removes an element from $(D c) by using its key $(D k). The key's type is defined by the _container.)) $(TR $(TDNW $(D )) $(TDNW $(D )) $(TD )) ) */ module std.container; import core.exception, core.memory, core.stdc.stdlib, core.stdc.string, std.algorithm, std.conv, std.exception, std.functional, std.range, std.traits, std.typecons, std.typetuple; version(unittest) import std.stdio; version(unittest) version = RBDoChecks; //version = RBDoChecks; version(RBDoChecks) { import std.stdio; } /* The following documentation and type $(D TotalContainer) are intended for developers only. $(D TotalContainer) is an unimplemented container that illustrates a host of primitives that a container may define. It is to some extent the bottom of the conceptual container hierarchy. A given container most often will choose to only implement a subset of these primitives, and define its own additional ones. Adhering to the standard primitive names below allows generic code to work independently of containers. Things to remember: any container must be a reference type, whether implemented as a $(D class) or $(D struct). No primitive below requires the container to escape addresses of elements, which means that compliant containers can be defined to use reference counting or other deterministic memory management techniques. A container may choose to define additional specific operations. The only requirement is that those operations bear different names than the ones below, lest user code gets confused. Complexity of operations should be interpreted as "at least as good as". If an operation is required to have $(BIGOH n) complexity, it could have anything lower than that, e.g. $(BIGOH log(n)). Unless specified otherwise, $(D n) inside a $(BIGOH) expression stands for the number of elements in the container. */ struct TotalContainer(T) { /** If the container has a notion of key-value mapping, $(D KeyType) defines the type of the key of the container. */ alias KeyType = T; /** If the container has a notion of multikey-value mapping, $(D KeyTypes[k]), where $(D k) is a zero-based unsigned number, defines the type of the $(D k)th key of the container. A container may define both $(D KeyType) and $(D KeyTypes), e.g. in the case it has the notion of primary/preferred key. */ alias KeyTypes = TypeTuple!T; /** If the container has a notion of key-value mapping, $(D ValueType) defines the type of the value of the container. Typically, a map-style container mapping values of type $(D K) to values of type $(D V) defines $(D KeyType) to be $(D K) and $(D ValueType) to be $(D V). */ alias ValueType = T; /** Defines the container's primary range, which embodies one of the ranges defined in $(XREFMODULE range). Generally a container may define several types of ranges. */ struct Range { /++ Range primitives. +/ @property bool empty() { assert(0); } /// Ditto @property ref T front() //ref return optional { assert(0); } /// Ditto @property void front(T value) //Only when front does not return by ref { assert(0); } /// Ditto T moveFront() { assert(0); } /// Ditto void popFront() { assert(0); } /// Ditto @property ref T back() //ref return optional { assert(0); } /// Ditto @property void back(T value) //Only when front does not return by ref { assert(0); } /// Ditto T moveBack() { assert(0); } /// Ditto void popBack() { assert(0); } /// Ditto T opIndex(size_t i) //ref return optional { assert(0); } /// Ditto void opIndexAssign(size_t i, T value) //Only when front does not return by ref { assert(0); } /// Ditto T opIndexUnary(string op)(size_t i) //Only when front does not return by ref { assert(0); } /// Ditto void opIndexOpAssign(string op)(size_t i, T value) //Only when front does not return by ref { assert(0); } /// Ditto T moveAt(size_t i) { assert(0); } /// Ditto @property size_t length() { assert(0); } } /** Property returning $(D true) if and only if the container has no elements. Complexity: $(BIGOH 1) */ @property bool empty() { assert(0); } /** Returns a duplicate of the container. The elements themselves are not transitively duplicated. Complexity: $(BIGOH n). */ @property TotalContainer dup() { assert(0); } /** Returns the number of elements in the container. Complexity: $(BIGOH log(n)). */ @property size_t length() { assert(0); } /** Returns the maximum number of elements the container can store without (a) allocating memory, (b) invalidating iterators upon insertion. Complexity: $(BIGOH log(n)). */ @property size_t capacity() { assert(0); } /** Ensures sufficient capacity to accommodate $(D n) elements. Postcondition: $(D capacity >= n) Complexity: $(BIGOH log(e - capacity)) if $(D e > capacity), otherwise $(BIGOH 1). */ void reserve(size_t e) { assert(0); } /** Returns a range that iterates over all elements of the container, in a container-defined order. The container should choose the most convenient and fast method of iteration for $(D opSlice()). Complexity: $(BIGOH log(n)) */ Range opSlice() { assert(0); } /** Returns a range that iterates the container between two specified positions. Complexity: $(BIGOH log(n)) */ Range opSlice(size_t a, size_t b) { assert(0); } /** Forward to $(D opSlice().front) and $(D opSlice().back), respectively. Complexity: $(BIGOH log(n)) */ @property ref T front() //ref return optional { assert(0); } /// Ditto @property void front(T value) //Only when front does not return by ref { assert(0); } /// Ditto T moveFront() { assert(0); } /// Ditto @property ref T back() //ref return optional { assert(0); } /// Ditto @property void back(T value) //Only when front does not return by ref { assert(0); } /// Ditto T moveBack() { assert(0); } /** Indexing operators yield or modify the value at a specified index. */ ref T opIndex(KeyType) //ref return optional { assert(0); } /// ditto void opIndexAssign(KeyType i, T value) //Only when front does not return by ref { assert(0); } /// ditto T opIndexUnary(string op)(KeyType i) //Only when front does not return by ref { assert(0); } /// ditto void opIndexOpAssign(string op)(KeyType i, T value) //Only when front does not return by ref { assert(0); } /// ditto T moveAt(KeyType i) { assert(0); } /** $(D k in container) returns true if the given key is in the container. */ bool opBinaryRight(string op)(KeyType k) if (op == "in") { assert(0); } /** Returns a range of all elements containing $(D k) (could be empty or a singleton range). */ Range equalRange(KeyType k) { assert(0); } /** Returns a range of all elements with keys less than $(D k) (could be empty or a singleton range). Only defined by containers that store data sorted at all times. */ Range lowerBound(KeyType k) { assert(0); } /** Returns a range of all elements with keys larger than $(D k) (could be empty or a singleton range). Only defined by containers that store data sorted at all times. */ Range upperBound(KeyType k) { assert(0); } /** Returns a new container that's the concatenation of $(D this) and its argument. $(D opBinaryRight) is only defined if $(D Stuff) does not define $(D opBinary). Complexity: $(BIGOH n + m), where m is the number of elements in $(D stuff) */ TotalContainer opBinary(string op)(Stuff rhs) if (op == "~") { assert(0); } /// ditto TotalContainer opBinaryRight(string op)(Stuff lhs) if (op == "~") { assert(0); } /** Forwards to $(D insertAfter(this[], stuff)). */ void opOpAssign(string op)(Stuff stuff) if (op == "~") { assert(0); } /** Removes all contents from the container. The container decides how $(D capacity) is affected. Postcondition: $(D empty) Complexity: $(BIGOH n) */ void clear() { assert(0); } /** Sets the number of elements in the container to $(D newSize). If $(D newSize) is greater than $(D length), the added elements are added to unspecified positions in the container and initialized with $(D .init). Complexity: $(BIGOH abs(n - newLength)) Postcondition: $(D _length == newLength) */ @property void length(size_t newLength) { assert(0); } /** Inserts $(D stuff) in an unspecified position in the container. Implementations should choose whichever insertion means is the most advantageous for the container, but document the exact behavior. $(D stuff) can be a value convertible to the element type of the container, or a range of values convertible to it. The $(D stable) version guarantees that ranges iterating over the container are never invalidated. Client code that counts on non-invalidating insertion should use $(D stableInsert). Such code would not compile against containers that don't support it. Returns: The number of elements added. Complexity: $(BIGOH m * log(n)), where $(D m) is the number of elements in $(D stuff) */ size_t insert(Stuff)(Stuff stuff) { assert(0); } ///ditto size_t stableInsert(Stuff)(Stuff stuff) { assert(0); } /** Same as $(D insert(stuff)) and $(D stableInsert(stuff)) respectively, but relax the complexity constraint to linear. */ size_t linearInsert(Stuff)(Stuff stuff) { assert(0); } ///ditto size_t stableLinearInsert(Stuff)(Stuff stuff) { assert(0); } /** Picks one value in an unspecified position in the container, removes it from the container, and returns it. Implementations should pick the value that's the most advantageous for the container, but document the exact behavior. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Precondition: $(D !empty) Returns: The element removed. Complexity: $(BIGOH log(n)). */ T removeAny() { assert(0); } /// ditto T stableRemoveAny() { assert(0); } /** Inserts $(D value) to the front or back of the container. $(D stuff) can be a value convertible to the container's element type or a range of values convertible to it. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements inserted Complexity: $(BIGOH log(n)). */ size_t insertFront(Stuff)(Stuff stuff) { assert(0); } /// ditto size_t stableInsertFront(Stuff)(Stuff stuff) { assert(0); } /// ditto size_t insertBack(Stuff)(Stuff stuff) { assert(0); } /// ditto size_t stableInsertBack(T value) { assert(0); } /** Removes the value at the front or back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. The optional parameter $(D howMany) instructs removal of that many elements. If $(D howMany > n), all elements are removed and no exception is thrown. Precondition: $(D !empty) Complexity: $(BIGOH log(n)). */ void removeFront() { assert(0); } /// ditto void stableRemoveFront() { assert(0); } /// ditto void removeBack() { assert(0); } /// ditto void stableRemoveBack() { assert(0); } /** Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, if $(D howMany > n), all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements removed Complexity: $(BIGOH howMany * log(n)). */ size_t removeFront(size_t howMany) { assert(0); } /// ditto size_t stableRemoveFront(size_t howMany) { assert(0); } /// ditto size_t removeBack(size_t howMany) { assert(0); } /// ditto size_t stableRemoveBack(size_t howMany) { assert(0); } /** Removes all values corresponding to key $(D k). Complexity: $(BIGOH m * log(n)), where $(D m) is the number of elements with the same key. Returns: The number of elements removed. */ size_t removeKey(KeyType k) { assert(0); } /** Inserts $(D stuff) before, after, or instead range $(D r), which must be a valid range previously extracted from this container. $(D stuff) can be a value convertible to the container's element type or a range of objects convertible to it. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of values inserted. Complexity: $(BIGOH n + m), where $(D m) is the length of $(D stuff) */ size_t insertBefore(Stuff)(Range r, Stuff stuff) { assert(0); } /// ditto size_t stableInsertBefore(Stuff)(Range r, Stuff stuff) { assert(0); } /// ditto size_t insertAfter(Stuff)(Range r, Stuff stuff) { assert(0); } /// ditto size_t stableInsertAfter(Stuff)(Range r, Stuff stuff) { assert(0); } /// ditto size_t replace(Stuff)(Range r, Stuff stuff) { assert(0); } /// ditto size_t stableReplace(Stuff)(Range r, Stuff stuff) { assert(0); } /** Removes all elements belonging to $(D r), which must be a range obtained originally from this container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: A range spanning the remaining elements in the container that initially were right after $(D r). Complexity: $(BIGOH m * log(n)), where $(D m) is the number of elements in $(D r) */ Range remove(Range r) { assert(0); } /// ditto Range stableRemove(Range r) { assert(0); } /** Same as $(D remove) above, but has complexity relaxed to linear. Returns: A range spanning the remaining elements in the container that initially were right after $(D r). Complexity: $(BIGOH n) */ Range linearRemove(Range r) { assert(0); } /// ditto Range stableLinearRemove(Range r) { assert(0); } } unittest { TotalContainer!int test; } /** Returns an initialized object. This function is mainly for eliminating construction differences between structs and classes. It allows code to not worry about whether the type it's constructing is a struct or a class. Examples: -------------------- auto arr = make!(Array!int)([4, 2, 3, 1]); assert(equal(arr[], [4, 2, 3, 1])); auto rbt = make!(RedBlackTree!(int, "a > b"))([4, 2, 3, 1]); assert(equal(rbt[], [4, 3, 2, 1])); alias makeList = make!(DList!int); auto list = makeList([1, 7, 42]); assert(equal(list[], [1, 7, 42])); -------------------- */ template make(T) if (is(T == struct) || is(T == class)) { T make(Args...)(Args arguments) if (is(T == struct) && __traits(compiles, T(arguments))) { return T(arguments); } T make(Args...)(Args arguments) if (is(T == class) && __traits(compiles, new T(arguments))) { return new T(arguments); } } //Verify Examples. unittest { auto arr = make!(Array!int)([4, 2, 3, 1]); assert(equal(arr[], [4, 2, 3, 1])); auto rbt = make!(RedBlackTree!(int, "a > b"))([4, 2, 3, 1]); assert(equal(rbt[], [4, 3, 2, 1])); alias makeList = make!(DList!int); auto list = makeList([1, 7, 42]); assert(equal(list[], [1, 7, 42])); } unittest { auto arr1 = make!(Array!dchar)(); assert(arr1.empty); auto arr2 = make!(Array!dchar)("hello"d); assert(equal(arr2[], "hello"d)); auto rtb1 = make!(RedBlackTree!dchar)(); assert(rtb1.empty); auto rtb2 = make!(RedBlackTree!dchar)('h', 'e', 'l', 'l', 'o'); assert(equal(rtb2[], "ehlo"d)); } /** Implements a simple and fast singly-linked list. */ struct SList(T) { private struct Node { T _payload; Node * _next; this(T a, Node* b) { _payload = a; _next = b; } } private Node * _root; private static Node * findLastNode(Node * n) { assert(n); auto ahead = n._next; while (ahead) { n = ahead; ahead = n._next; } return n; } private static Node * findLastNode(Node * n, size_t limit) { assert(n && limit); auto ahead = n._next; while (ahead) { if (!--limit) break; n = ahead; ahead = n._next; } return n; } private static Node * findNode(Node * n, Node * findMe) { assert(n); auto ahead = n._next; while (ahead != findMe) { n = ahead; enforce(n); ahead = n._next; } return n; } /** Constructor taking a number of nodes */ this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)) { insertFront(values); } /** Constructor taking an input range */ this(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T) && !is(Stuff == T[])) { insertFront(stuff); } /** Comparison for equality. Complexity: $(BIGOH min(n, n1)) where $(D n1) is the number of elements in $(D rhs). */ bool opEquals(const SList rhs) const { return opEquals(rhs); } /// ditto bool opEquals(ref const SList rhs) const { const(Node) * n1 = _root, n2 = rhs._root; for (;; n1 = n1._next, n2 = n2._next) { if (!n1) return !n2; if (!n2 || n1._payload != n2._payload) return false; } } /** Defines the container's primary range, which embodies a forward range. */ struct Range { private Node * _head; private this(Node * p) { _head = p; } /// Input range primitives. @property bool empty() const { return !_head; } /// ditto @property ref T front() { assert(!empty, "SList.Range.front: Range is empty"); return _head._payload; } /// ditto void popFront() { assert(!empty, "SList.Range.popFront: Range is empty"); _head = _head._next; } /// Forward range primitive. @property Range save() { return this; } T moveFront() { assert(!empty, "SList.Range.moveFront: Range is empty"); return move(_head._payload); } bool sameHead(Range rhs) { return _head && _head == rhs._head; } } unittest { static assert(isForwardRange!Range); } /** Property returning $(D true) if and only if the container has no elements. Complexity: $(BIGOH 1) */ @property bool empty() const { return _root is null; } /** Duplicates the container. The elements themselves are not transitively duplicated. Complexity: $(BIGOH n). */ @property SList dup() { return SList(this[]); } /** Returns a range that iterates over all elements of the container, in forward order. Complexity: $(BIGOH 1) */ Range opSlice() { return Range(_root); } /** Forward to $(D opSlice().front). Complexity: $(BIGOH 1) */ @property ref T front() { assert(!empty, "SList.front: List is empty"); return _root._payload; } unittest { auto s = SList!int(1, 2, 3); s.front = 42; assert(s == SList!int(42, 2, 3)); } /** Returns a new $(D SList) that's the concatenation of $(D this) and its argument. $(D opBinaryRight) is only defined if $(D Stuff) does not define $(D opBinary). */ SList opBinary(string op, Stuff)(Stuff rhs) if (op == "~" && is(typeof(SList(rhs)))) { auto toAdd = SList(rhs); static if (is(Stuff == SList)) { toAdd = toAdd.dup; } if (empty) return toAdd; // TODO: optimize auto result = dup; auto n = findLastNode(result._root); n._next = toAdd._root; return result; } /** Removes all contents from the $(D SList). Postcondition: $(D empty) Complexity: $(BIGOH 1) */ void clear() { _root = null; } /** Inserts $(D stuff) to the front of the container. $(D stuff) can be a value convertible to $(D T) or a range of objects convertible to $(D T). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements inserted Complexity: $(BIGOH m), where $(D m) is the length of $(D stuff) */ size_t insertFront(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T)) { size_t result; Node * n, newRoot; foreach (item; stuff) { auto newNode = new Node(item, null); (newRoot ? n._next : newRoot) = newNode; n = newNode; ++result; } if (!n) return 0; // Last node points to the old root n._next = _root; _root = newRoot; return result; } /// ditto size_t insertFront(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)) { auto newRoot = new Node(stuff, _root); _root = newRoot; return 1; } /// ditto alias insert = insertFront; /// ditto alias stableInsert = insert; /// ditto alias stableInsertFront = insertFront; /** Picks one value from the front of the container, removes it from the container, and returns it. Precondition: $(D !empty) Returns: The element removed. Complexity: $(BIGOH 1). */ T removeAny() { assert(!empty, "SList.removeAny: List is empty"); auto result = move(_root._payload); _root = _root._next; return result; } /// ditto alias stableRemoveAny = removeAny; /** Removes the value at the front of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Precondition: $(D !empty) Complexity: $(BIGOH 1). */ void removeFront() { assert(!empty, "SList.removeFront: List is empty"); _root = _root._next; } /// ditto alias stableRemoveFront = removeFront; /** Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, if $(D howMany > n), all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements removed Complexity: $(BIGOH howMany * log(n)). */ size_t removeFront(size_t howMany) { size_t result; while (_root && result < howMany) { _root = _root._next; ++result; } return result; } /// ditto alias stableRemoveFront = removeFront; /** Inserts $(D stuff) after range $(D r), which must be a range previously extracted from this container. Given that all ranges for a list end at the end of the list, this function essentially appends to the list and uses $(D r) as a potentially fast way to reach the last node in the list. Ideally $(D r) is positioned near or at the last element of the list. $(D stuff) can be a value convertible to $(D T) or a range of objects convertible to $(D T). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of values inserted. Complexity: $(BIGOH k + m), where $(D k) is the number of elements in $(D r) and $(D m) is the length of $(D stuff). Examples: -------------------- auto sl = SList!string(["a", "b", "d"]); sl.insertAfter(sl[], "e"); // insert at the end (slowest) assert(std.algorithm.equal(sl[], ["a", "b", "d", "e"])); sl.insertAfter(std.range.take(sl[], 2), "c"); // insert after "b" assert(std.algorithm.equal(sl[], ["a", "b", "c", "d", "e"])); -------------------- */ size_t insertAfter(Stuff)(Range r, Stuff stuff) { if (!_root) { enforce(!r._head); return insertFront(stuff); } enforce(r._head); auto n = findLastNode(r._head); SList tmp; auto result = tmp.insertFront(stuff); n._next = tmp._root; return result; } /** Similar to $(D insertAfter) above, but accepts a range bounded in count. This is important for ensuring fast insertions in the middle of the list. For fast insertions after a specified position $(D r), use $(D insertAfter(take(r, 1), stuff)). The complexity of that operation only depends on the number of elements in $(D stuff). Precondition: $(D r.original.empty || r.maxLength > 0) Returns: The number of values inserted. Complexity: $(BIGOH k + m), where $(D k) is the number of elements in $(D r) and $(D m) is the length of $(D stuff). */ size_t insertAfter(Stuff)(Take!Range r, Stuff stuff) { auto orig = r.source; if (!orig._head) { // Inserting after a null range counts as insertion to the // front return insertFront(stuff); } enforce(!r.empty); // Find the last valid element in the range foreach (i; 1 .. r.maxLength) { if (!orig._head._next) break; orig.popFront(); } // insert here SList tmp; tmp._root = orig._head._next; auto result = tmp.insertFront(stuff); orig._head._next = tmp._root; return result; } /// ditto alias stableInsertAfter = insertAfter; /** Removes a range from the list in linear time. Returns: An empty range. Complexity: $(BIGOH n) */ Range linearRemove(Range r) { if (!_root) { enforce(!r._head); return this[]; } auto n = findNode(_root, r._head); n._next = null; return Range(null); } /** Removes a $(D Take!Range) from the list in linear time. Returns: A range comprehending the elements after the removed range. Complexity: $(BIGOH n) */ Range linearRemove(Take!Range r) { auto orig = r.source; // We have something to remove here if (orig._head == _root) { // remove straight from the head of the list for (; !r.empty; r.popFront()) { removeFront(); } return this[]; } if (!r.maxLength) { // Nothing to remove, return the range itself return orig; } // Remove from somewhere in the middle of the list enforce(_root); auto n1 = findNode(_root, orig._head); auto n2 = findLastNode(orig._head, r.maxLength); n1._next = n2._next; return Range(n1._next); } /// ditto alias stableLinearRemove = linearRemove; } unittest { auto s = make!(SList!int)(1, 2, 3); auto n = s.findLastNode(s._root); assert(n && n._payload == 3); } unittest { auto s = SList!int(1, 2, 5, 10); assert(walkLength(s[]) == 4); } unittest { auto src = take([0, 1, 2, 3], 3); auto s = SList!int(src); assert(s == SList!int(0, 1, 2)); } unittest { auto a = SList!int(1, 2, 3); auto b = SList!int(4, 5, 6); // @@@BUG@@@ in compiler //auto c = a ~ b; auto d = [ 4, 5, 6 ]; auto e = a ~ d; assert(e == SList!int(1, 2, 3, 4, 5, 6)); } unittest { auto a = SList!int(1, 2, 3); auto c = a ~ 4; assert(c == SList!int(1, 2, 3, 4)); } unittest { auto s = SList!int(1, 2, 3, 4); s.insertFront([ 42, 43 ]); assert(s == SList!int(42, 43, 1, 2, 3, 4)); } unittest { auto s = SList!int(1, 2, 3); assert(s.removeAny() == 1); assert(s == SList!int(2, 3)); assert(s.stableRemoveAny() == 2); assert(s == SList!int(3)); } unittest { auto s = SList!int(1, 2, 3); s.removeFront(); assert(equal(s[], [2, 3])); s.stableRemoveFront(); assert(equal(s[], [3])); } unittest { auto s = SList!int(1, 2, 3, 4, 5, 6, 7); assert(s.removeFront(3) == 3); assert(s == SList!int(4, 5, 6, 7)); } unittest { auto a = SList!int(1, 2, 3); auto b = SList!int(1, 2, 3); assert(a.insertAfter(a[], b[]) == 3); } unittest { auto s = SList!int(1, 2, 3, 4); auto r = take(s[], 2); assert(s.insertAfter(r, 5) == 1); assert(s == SList!int(1, 2, 5, 3, 4)); } unittest { // insertAfter documentation example auto sl = SList!string(["a", "b", "d"]); sl.insertAfter(sl[], "e"); // insert at the end (slowest) assert(std.algorithm.equal(sl[], ["a", "b", "d", "e"])); sl.insertAfter(std.range.take(sl[], 2), "c"); // insert after "b" assert(std.algorithm.equal(sl[], ["a", "b", "c", "d", "e"])); } unittest { auto s = SList!int(1, 2, 3, 4, 5); auto r = s[]; popFrontN(r, 3); auto r1 = s.linearRemove(r); assert(s == SList!int(1, 2, 3)); assert(r1.empty); } unittest { auto s = SList!int(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); auto r = s[]; popFrontN(r, 3); auto r1 = take(r, 4); assert(equal(r1, [4, 5, 6, 7])); auto r2 = s.linearRemove(r1); assert(s == SList!int(1, 2, 3, 8, 9, 10)); assert(equal(r2, [8, 9, 10])); } unittest { auto lst = SList!int(1, 5, 42, 9); assert(!lst.empty); assert(lst.front == 1); assert(walkLength(lst[]) == 4); auto lst2 = lst ~ [ 1, 2, 3 ]; assert(walkLength(lst2[]) == 7); auto lst3 = lst ~ [ 7 ]; assert(walkLength(lst3[]) == 5); } unittest { auto s = make!(SList!int)(1, 2, 3); } unittest { // 5193 static struct Data { const int val; } SList!Data list; } unittest { auto s = SList!int([1, 2, 3]); s.front = 5; //test frontAssign assert(s.front == 5); auto r = s[]; r.front = 1; //test frontAssign assert(r.front == 1); } /** Implements a doubly-linked list. $(D DList) uses neither reference nor value semantics. They can be seen as several different handles into an external chain of nodes. Several different $(D DList)s can all reference different points in a same chain. $(D DList.Range) is, for all intents and purposes, a DList with range semantics. The $(D DList.Range) has a view directly into the chain itself. It is not tied to its parent $(D DList), and may be used to operate on other lists (that point to the same chain). The ONLY operation that can invalidate a $(D DList) or $(D DList.Range), but which will invalidate BOTH, is the $(D remove) operation, if the cut Range overlaps with the boundaries of another DList or DList.Range. Example: ---- auto a = DList!int([3, 4]); //Create a new chain auto b = a; //Point to the same chain // (3 - 4) assert(a[].equal([3, 4])); assert(b[].equal([3, 4])); b.stableInsertFront(1); //insert before of b b.stableInsertBack(5); //insert after of b // (2 - (3 - 4) - 5) assert(a[].equal([3, 4])); //a is not changed assert(b[].equal([1, 3, 4, 5])); // but b is changed a.stableInsertFront(2); //insert in front of a, this will insert "inside" the chain // (1 - (2 - 3 - 4) - 5) assert(a[].equal([2, 3, 4])); //a is modified assert(b[].equal([1, 2, 3, 4, 5])); //and so is b; a.remove(a[]); //remove all the elements of a: This will cut them from the chain; // (1 - 5) assert(a[].empty); //a is empty assert(b[].equal([1, 5])); //b has lost some of its elements; a.insert(2); //insert in a. This will create a new chain // (2) // (1 - 5) assert(a[].equal([2])); //a is a new chain assert(b[].equal([1, 5])); //b is unchanged; ---- */ struct DList(T) { private struct Node { T _payload; Node * _prev; Node * _next; this(T a, Node* p, Node* n) { _payload = a; _prev = p; _next = n; if (p) p._next = &this; if (n) n._prev = &this; } } private Node * _first; private Node * _last; /** Constructor taking a number of nodes */ this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)) { insertBack(values); } /** Constructor taking an input range */ this(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T)) { insertBack(stuff); } /** Comparison for equality. Complexity: $(BIGOH min(n, n1)) where $(D n1) is the number of elements in $(D rhs). */ bool opEquals()(ref const DList rhs) const if (is(typeof(front == front))) { if(_first == rhs._first) return _last == rhs._last; if(_last == rhs._last) return false; const(Node)* nthis = _first, nrhs = rhs._first; while(true) { if (!nthis) return !nrhs; if (!nrhs || nthis._payload != nrhs._payload) return false; nthis = nthis._next; nrhs = nrhs._next; } } /** Defines the container's primary range, which embodies a bidirectional range. */ struct Range { private Node * _first; private Node * _last; private this(Node* first, Node* last) { assert(!!_first == !!_last, "Dlist.Rangethis: Invalid arguments"); _first = first; _last = last; } private this(Node* n) { _first = _last = n; } /// Input range primitives. @property const nothrow bool empty() { assert(!!_first == !!_last, "DList.Range: Invalidated state"); return !_first; } /// ditto @property ref T front() { assert(!empty, "DList.Range.front: Range is empty"); return _first._payload; } /// ditto void popFront() { assert(!empty, "DList.Range.popFront: Range is empty"); if (_first is _last) { _first = _last = null; } else { assert(_first is _first._next._prev, "DList.Range: Invalidated state"); _first = _first._next; } } /// Forward range primitive. @property Range save() { return this; } /// Bidirectional range primitives. @property ref T back() { assert(!empty, "DList.Range.back: Range is empty"); return _last._payload; } /// ditto void popBack() { assert(!empty, "DList.Range.popBack: Range is empty"); if (_first is _last) { _first = _last = null; } else { assert(_last is _last._prev._next, "DList.Range: Invalidated state"); _last = _last._prev; } } } unittest { static assert(isBidirectionalRange!Range); } /** Property returning $(D true) if and only if the container has no elements. Complexity: $(BIGOH 1) */ @property const nothrow bool empty() { assert(!!_first == !!_last, "DList: Internal error, inconsistant list"); return _first is null; } /** Removes all contents from the $(D DList). Postcondition: $(D empty) Complexity: $(BIGOH 1) */ void clear() { //remove actual elements. remove(this[]); } /** Duplicates the container. The elements themselves are not transitively duplicated. Complexity: $(BIGOH n). */ @property DList dup() { return DList(this[]); } /** Returns a range that iterates over all elements of the container, in forward order. Complexity: $(BIGOH 1) */ Range opSlice() { return Range(_first, _last); } /** Forward to $(D opSlice().front). Complexity: $(BIGOH 1) */ @property ref inout(T) front() inout { assert(!empty, "DList.front: List is empty"); return _first._payload; } /** Forward to $(D opSlice().back). Complexity: $(BIGOH 1) */ @property ref inout(T) back() inout { assert(!empty, "DList.back: List is empty"); return _last._payload; } /+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/ /+ BEGIN CONCAT FUNCTIONS HERE +/ /+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/ /** Returns a new $(D DList) that's the concatenation of $(D this) and its argument $(D rhs). */ DList opBinary(string op, Stuff)(Stuff rhs) if (op == "~" && is(typeof(insertBack(rhs)))) { auto ret = this.dup; ret.insertBack(rhs); return ret; } /// ditto DList opBinary(string op)(DList rhs) if (op == "~") { return ret ~ rhs[]; } /** Returns a new $(D DList) that's the concatenation of the argument $(D lhs) and $(D this). */ DList opBinaryRight(string op, Stuff)(Stuff lhs) if (op == "~" && is(typeof(insertFront(lhs)))) { auto ret = this.dup; ret.insertFront(lhs); return ret; } /** Appends the contents of the argument $(D rhs) into $(D this). */ DList opOpAssign(string op, Stuff)(Stuff rhs) if (op == "~" && is(typeof(insertBack(rhs)))) { insertBack(rhs); return this; } /// ditto DList opOpAssign(string op)(DList rhs) if (op == "~") { return this ~= rhs[]; } /+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/ /+ BEGIN INSERT FUNCTIONS HERE +/ /+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/ /** Inserts $(D stuff) to the front/back of the container. $(D stuff) can be a value convertible to $(D T) or a range of objects convertible to $(D T). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements inserted Complexity: $(BIGOH log(n)) */ size_t insertFront(Stuff)(Stuff stuff) { return insertBeforeNode(_first, stuff); } /// ditto size_t insertBack(Stuff)(Stuff stuff) { return insertBeforeNode(null, stuff); } /// ditto alias insert = insertBack; /// ditto alias stableInsert = insert; /// ditto alias stableInsertFront = insertFront; /// ditto alias stableInsertBack = insertBack; /** Inserts $(D stuff) after range $(D r), which must be a non-empty range previously extracted from this container. $(D stuff) can be a value convertible to $(D T) or a range of objects convertible to $(D T). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Elements are not actually removed from the chain, but the $(D DList)'s, first/last pointer is advanced. Returns: The number of values inserted. Complexity: $(BIGOH k + m), where $(D k) is the number of elements in $(D r) and $(D m) is the length of $(D stuff). */ size_t insertBefore(Stuff)(Range r, Stuff stuff) { Node* n = (r._first) ? r._first : _first; return insertBeforeNode(n, stuff); } /// ditto alias stableInsertBefore = insertBefore; /// ditto size_t insertAfter(Stuff)(Range r, Stuff stuff) { Node* n = (r._last) ? r._last._next : null; return insertBeforeNode(n, stuff); } /// ditto alias stableInsertAfter = insertAfter; /+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/ /+ BEGIN REMOVE FUNCTIONS HERE +/ /+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/ /** Picks one value from the front of the container, removes it from the container, and returns it. Elements are not actually removed from the chain, but the $(D DList)'s, first/last pointer is advanced. Precondition: $(D !empty) Returns: The element removed. Complexity: $(BIGOH 1). */ T removeAny() { assert(!empty, "DList.removeAny: List is empty"); auto result = move(back); _last = _last._prev; if (_last is null) { _first = null; } return result; } /// ditto alias stableRemoveAny = removeAny; /** Removes the value at the front/back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Elements are not actually removed from the chain, but the $(D DList)'s, first/last pointer is advanced. Precondition: $(D !empty) Complexity: $(BIGOH 1). */ void removeFront() { assert(!empty, "DList.removeFront: List is empty"); _first = _first._next; if (_first is null) { _last = null; } } /// ditto alias stableRemoveFront = removeFront; /// ditto void removeBack() { assert(!empty, "DList.removeBack: List is empty"); _last = _last._prev; if (_last is null) { _first = null; } } /// ditto alias stableRemoveBack = removeBack; /** Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, if $(D howMany > n), all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Elements are not actually removed from the chain, but the $(D DList)'s, first/last pointer is advanced. Returns: The number of elements removed Complexity: $(BIGOH howMany * log(n)). */ size_t removeFront(size_t howMany) { size_t result; while (_first && result < howMany) { _first = _first._next; ++result; } if (_first is null) { _last = null; } return result; } /// ditto alias stableRemoveFront = removeFront; /// ditto size_t removeBack(size_t howMany) { size_t result; while (_last && result < howMany) { _last = _last._prev; ++result; } if (_last is null) { _first = null; } return result; } /// ditto alias stableRemoveBack = removeBack; /** Removes all elements belonging to $(D r), which must be a range obtained originally from this container. This function actually removes the elements from the chain. This is the only function that may invalidate a range, as it cuts the chain of elements: *Ranges (and other DList) that contain $(D r) or that are inside $(D r), as well a $(D r) itself, are never invalidated. *Ranges (and other DList) which partially overlap with $(D r) will be cut, and invalidated. Returns: A range spanning the remaining elements in the container that initially were right after $(D r). Complexity: $(BIGOH 1) */ Range remove(Range r) { if (r.empty) { return r; } assert(!empty, "DList.remove: Range is empty"); //Note about the unusual complexity here: //The first and last nodes are not necessarilly the actual last nodes //of the "chain". //If we merelly excise the range from the chain, we can run into odd behavior, //in particlar, when the range's front and/or back coincide with the List's... Node* before = r._first._prev; Node* after = r._last._next; Node* oldFirst = _first; Node* oldLast = _last; if (before) { if (after) { before._next = after; after._prev = before; } if (_first == r._first) _first = (oldLast != r._last) ? after : null ; } else { assert(oldFirst == r._first, "Dlist.remove: Range is not part of the list"); _first = (oldLast != r._last) ? after : null ; } if (after) { if (before) { after._prev = before; before._next = after; } if (_last == r._last) _last = (oldFirst != r._first) ? before : null ; } else { assert(oldLast == r._last, "Dlist.remove: Range is not part of the list"); _last = (oldFirst != r._first) ? before : null ; } return Range(after, _last); } /// ditto Range linearRemove(Range r) { return remove(r); } /** $(D linearRemove) functions as $(D remove), but also accepts ranges that are result the of a $(D take) operation. This is a convenient way to remove a fixed amount of elements from the range. Complexity: $(BIGOH r.walkLength) */ Range linearRemove(Take!Range r) { if (r.empty) return Range(null,null); assert(r.source._first); Node* first = r.source._first; Node* last = void; do { last = r.source._first; r.popFront(); } while ( !r.empty ); return remove(Range(first, last)); } /// ditto alias stableRemove = remove; /// ditto alias stableLinearRemove = linearRemove; private: // Helper: insert $(D stuff) before Node $(D n). If $(D n) is $(D null) then insert at end. size_t insertBeforeNode(Stuff)(Node* n, Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T)) { size_t result; if(stuff.empty) return result; Node* first; Node* last; //scope block { auto item = stuff.front; stuff.popFront(); last = first = new Node(item, null, null); ++result; } foreach (item; stuff) { last = new Node(item, last, null); ++result; } //We have created a first-last chain. Now we insert it. if(!_first) { _first = first; _last = last; } else { assert(_last); if(n) { if(n._prev) { n._prev._next = first; first._prev = n._prev; } n._prev = last; last._next = n; if(n is _first) _first = first; } else { if(_last._next) { _last._next._prev = last; last._next = _last._next; } _last._next = first; first._prev = _last; _last = last; } } assert(_first); assert(_last); return result; } // Helper: insert $(D stuff) before Node $(D n). If $(D n) is $(D null) then insert at end. size_t insertBeforeNode(Stuff)(Node* n, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)) { Stuff[] stuffs = (&stuff)[0 .. 1]; return insertBeforeNode(n, stuffs); } } unittest { auto a = DList!int([3, 4]); //Create a new chain auto b = a; //Point to the same chain // (3 - 4) assert(a[].equal([3, 4])); assert(b[].equal([3, 4])); b.stableInsertFront(1); //insert before of b b.stableInsertBack(5); //insert after of b // (2 - (3 - 4) - 5) assert(a[].equal([3, 4])); //a is not changed assert(b[].equal([1, 3, 4, 5])); // but b is changed a.stableInsertFront(2); //insert in front of a, this will insert "inside" the chain // (1 - (2 - 3 - 4) - 5) assert(a[].equal([2, 3, 4])); //a is modified assert(b[].equal([1, 2, 3, 4, 5])); //and so is b; a.remove(a[]); //remove all the elements of a: This will cut them from the chain; // (1 - 5) assert(a[].empty); //a is empty assert(b[].equal([1, 5])); //b has lost some of its elements; a.insert(2); //insert in a. This will create a new chain // (2) // (1 - 5) assert(a[].equal([2])); //a is a new chain assert(b[].equal([1, 5])); //b is unchanged; } unittest { //Tests construction signatures alias IntList = DList!int; auto a0 = IntList(); auto a1 = IntList(0); auto a2 = IntList(0, 1); auto a3 = IntList([0]); auto a4 = IntList([0, 1]); assert(a0[].empty); assert(equal(a1[], [0])); assert(equal(a2[], [0, 1])); assert(equal(a3[], [0])); assert(equal(a4[], [0, 1])); } unittest { alias IntList = DList!int; IntList list = IntList([0,1,2,3]); assert(equal(list[],[0,1,2,3])); list.insertBack([4,5,6,7]); assert(equal(list[],[0,1,2,3,4,5,6,7])); list = IntList(); list.insertFront([0,1,2,3]); assert(equal(list[],[0,1,2,3])); list.insertFront([4,5,6,7]); assert(equal(list[],[4,5,6,7,0,1,2,3])); } unittest { alias IntList = DList!int; IntList list = IntList([0,1,2,3]); auto range = list[]; for( ; !range.empty; range.popFront()) { int item = range.front; if (item == 2) { list.stableLinearRemove(take(range,1)); break; } } assert(equal(list[],[0,1,3])); list = IntList([0,1,2,3]); range = list[]; for( ; !range.empty; range.popFront()) { int item = range.front; if (item == 2) { list.stableLinearRemove(take(range,2)); break; } } assert(equal(list[],[0,1])); list = IntList([0,1,2,3]); range = list[]; for( ; !range.empty; range.popFront()) { int item = range.front; if (item == 0) { list.stableLinearRemove(take(range,2)); break; } } assert(equal(list[],[2,3])); list = IntList([0,1,2,3]); range = list[]; for( ; !range.empty; range.popFront()) { int item = range.front; if (item == 1) { list.stableLinearRemove(take(range,2)); break; } } assert(equal(list[],[0,3])); } unittest { auto dl = DList!string(["a", "b", "d"]); dl.insertAfter(dl[], "e"); // insert at the end assert(equal(dl[], ["a", "b", "d", "e"])); auto dlr = dl[]; dlr.popBack(); dlr.popBack(); dl.insertAfter(dlr, "c"); // insert after "b" assert(equal(dl[], ["a", "b", "c", "d", "e"])); } unittest { auto dl = DList!string(["a", "b", "d"]); dl.insertBefore(dl[], "e"); // insert at the front assert(equal(dl[], ["e", "a", "b", "d"])); auto dlr = dl[]; dlr.popFront(); dlr.popFront(); dl.insertBefore(dlr, "c"); // insert before "b" assert(equal(dl[], ["e", "a", "c", "b", "d"])); } unittest { auto d = DList!int([1, 2, 3]); d.front = 5; //test frontAssign assert(d.front == 5); auto r = d[]; r.back = 1; assert(r.back == 1); } // Issue 8895 unittest { auto a = make!(DList!int)(1,2,3,4); auto b = make!(DList!int)(1,2,3,4); auto c = make!(DList!int)(1,2,3,5); auto d = make!(DList!int)(1,2,3,4,5); assert(a == b); // this better terminate! assert(!(a == c)); assert(!(a == d)); } unittest { auto d = DList!int([1, 2, 3]); d.front = 5; //test frontAssign assert(d.front == 5); auto r = d[]; r.back = 1; assert(r.back == 1); } unittest { auto a = DList!int(); assert(a.removeFront(10) == 0); a.insert([1, 2, 3]); assert(a.removeFront(10) == 3); assert(a[].empty); } unittest { //Verify all flavors of ~ auto a = DList!int(); auto b = DList!int(); auto c = DList!int([1, 2, 3]); auto d = DList!int([4, 5, 6]); assert((a ~ b[])[].empty); assert((c ~ d[])[].equal([1, 2, 3, 4, 5, 6])); assert(c[].equal([1, 2, 3])); assert(d[].equal([4, 5, 6])); assert((c[] ~ d)[].equal([1, 2, 3, 4, 5, 6])); assert(c[].equal([1, 2, 3])); assert(d[].equal([4, 5, 6])); a~=c[]; assert(a[].equal([1, 2, 3])); assert(c[].equal([1, 2, 3])); a~=d[]; assert(a[].equal([1, 2, 3, 4, 5, 6])); assert(d[].equal([4, 5, 6])); a~=[7, 8, 9]; assert(a[].equal([1, 2, 3, 4, 5, 6, 7, 8, 9])); //trick test: auto r = c[]; c.removeFront(); c.removeBack(); c~=d[]; assert(c[].equal([2, 4, 5, 6])); assert(r.equal([1, 2, 4, 5, 6, 3])); } unittest { //8905 auto a = DList!int([1, 2, 3, 4]); auto r = a[]; a.stableRemoveBack(); a.stableInsertBack(7); assert(a[].equal([1, 2, 3, 7])); assert(r.equal([1, 2, 3, 7, 4])); } /** Array type with deterministic control of memory. The memory allocated for the array is reclaimed as soon as possible; there is no reliance on the garbage collector. $(D Array) uses $(D malloc) and $(D free) for managing its own memory. */ struct Array(T) if (!is(Unqual!T == bool)) { // This structure is not copyable. private struct Payload { size_t _capacity; T[] _payload; // Convenience constructor this(T[] p) { _capacity = p.length; _payload = p; } // Destructor releases array memory ~this() { foreach (ref e; _payload) .destroy(e); static if (hasIndirections!T) GC.removeRange(_payload.ptr); free(_payload.ptr); } this(this) { assert(0); } void opAssign(Payload rhs) { assert(false); } // Duplicate data // @property Payload dup() // { // Payload result; // result._payload = _payload.dup; // // Conservatively assume initial capacity == length // result._capacity = result._payload.length; // return result; // } // length @property size_t length() const { return _payload.length; } // length @property void length(size_t newLength) { if (length >= newLength) { // shorten static if (is(T == struct) && hasElaborateDestructor!T) { foreach (ref e; _payload.ptr[newLength .. _payload.length]) { .destroy(e); } } _payload = _payload.ptr[0 .. newLength]; return; } // enlarge auto startEmplace = length; _payload = (cast(T*) realloc(_payload.ptr, T.sizeof * newLength))[0 .. newLength]; initializeAll(_payload.ptr[startEmplace .. length]); } // capacity @property size_t capacity() const { return _capacity; } // reserve void reserve(size_t elements) { if (elements <= capacity) return; immutable sz = elements * T.sizeof; static if (hasIndirections!T) // should use hasPointers instead { /* Because of the transactional nature of this * relative to the garbage collector, ensure no * threading bugs by using malloc/copy/free rather * than realloc. */ immutable oldLength = length; auto newPayload = enforce(cast(T*) malloc(sz))[0 .. oldLength]; // copy old data over to new array memcpy(newPayload.ptr, _payload.ptr, T.sizeof * oldLength); // Zero out unused capacity to prevent gc from seeing // false pointers memset(newPayload.ptr + oldLength, 0, (elements - oldLength) * T.sizeof); GC.addRange(newPayload.ptr, sz); GC.removeRange(_payload.ptr); free(_payload.ptr); _payload = newPayload; } else { /* These can't have pointers, so no need to zero * unused region */ auto newPayload = enforce(cast(T*) realloc(_payload.ptr, sz))[0 .. length]; _payload = newPayload; } _capacity = elements; } // Insert one item size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)) { if (_capacity == length) { reserve(1 + capacity * 3 / 2); } assert(capacity > length && _payload.ptr); emplace(_payload.ptr + _payload.length, stuff); _payload = _payload.ptr[0 .. _payload.length + 1]; return 1; } /// Insert a range of items size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T)) { static if (hasLength!Stuff) { immutable oldLength = length; reserve(oldLength + stuff.length); } size_t result; foreach (item; stuff) { insertBack(item); ++result; } static if (hasLength!Stuff) { assert(length == oldLength + stuff.length); } return result; } } private alias Data = RefCounted!(Payload, RefCountedAutoInitialize.no); private Data _data; /** Constructor taking a number of items */ this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)) { auto p = cast(T*) malloc(T.sizeof * values.length); if (hasIndirections!T && p) { GC.addRange(p, T.sizeof * values.length); } foreach (i, e; values) { emplace(p + i, e); assert(p[i] == e); } _data = Data(p[0 .. values.length]); } /** Constructor taking an input range */ this(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T) && !is(Stuff == T[])) { insertBack(stuff); } /** Comparison for equality. */ bool opEquals(const Array rhs) const { return opEquals(rhs); } /// ditto bool opEquals(ref const Array rhs) const { if (empty) return rhs.empty; if (rhs.empty) return false; return _data._payload == rhs._data._payload; } /** Defines the container's primary range, which is a random-access range. */ static struct Range { private Array _outer; private size_t _a, _b; private this(ref Array data, size_t a, size_t b) { _outer = data; _a = a; _b = b; } @property Range save() { return this; } @property bool empty() @safe pure nothrow const { return _a >= _b; } @property size_t length() @safe pure nothrow const { return _b - _a; } alias opDollar = length; @property ref T front() { version (assert) if (empty) throw new RangeError(); return _outer[_a]; } @property ref T back() { version (assert) if (empty) throw new RangeError(); return _outer[_b - 1]; } void popFront() @safe pure nothrow { version (assert) if (empty) throw new RangeError(); ++_a; } void popBack() @safe pure nothrow { version (assert) if (empty) throw new RangeError(); --_b; } T moveFront() { version (assert) if (empty || _a >= _outer.length) throw new RangeError(); return move(_outer._data._payload[_a]); } T moveBack() { version (assert) if (empty || _b > _outer.length) throw new RangeError(); return move(_outer._data._payload[_b - 1]); } T moveAt(size_t i) { version (assert) if (_a + i >= _b || _a + i >= _outer.length) throw new RangeError(); return move(_outer._data._payload[_a + i]); } ref T opIndex(size_t i) { version (assert) if (_a + i >= _b) throw new RangeError(); return _outer[_a + i]; } typeof(this) opSlice() { return typeof(this)(_outer, _a, _b); } typeof(this) opSlice(size_t i, size_t j) { version (assert) if (i > j || _a + j > _b) throw new RangeError(); return typeof(this)(_outer, _a + i, _a + j); } void opSliceAssign(T value) { version (assert) if (_b > _outer.length) throw new RangeError(); _outer[_a .. _b] = value; } void opSliceAssign(T value, size_t i, size_t j) { version (assert) if (_a + j > _b) throw new RangeError(); _outer[_a + i .. _a + j] = value; } void opSliceUnary(string op)() if(op == "++" || op == "--") { version (assert) if (_b > _outer.length) throw new RangeError(); mixin(op~"_outer[_a .. _b];"); } void opSliceUnary(string op)(size_t i, size_t j) if(op == "++" || op == "--") { version (assert) if (_a + j > _b) throw new RangeError(); mixin(op~"_outer[_a + i .. _a + j];"); } void opSliceOpAssign(string op)(T value) { version (assert) if (_b > _outer.length) throw new RangeError(); mixin("_outer[_a .. _b] "~op~"= value;"); } void opSliceOpAssign(string op)(T value, size_t i, size_t j) { version (assert) if (_a + j > _b) throw new RangeError(); mixin("_outer[_a + i .. _a + j] "~op~"= value;"); } } /** Duplicates the container. The elements themselves are not transitively duplicated. Complexity: $(BIGOH n). */ @property Array dup() { if (!_data.refCountedStore.isInitialized) return this; return Array(_data._payload); } /** Property returning $(D true) if and only if the container has no elements. Complexity: $(BIGOH 1) */ @property bool empty() const { return !_data.refCountedStore.isInitialized || _data._payload.empty; } /** Returns the number of elements in the container. Complexity: $(BIGOH 1). */ @property size_t length() const { return _data.refCountedStore.isInitialized ? _data._payload.length : 0; } /// ditto size_t opDollar() const { return length; } /** Returns the maximum number of elements the container can store without (a) allocating memory, (b) invalidating iterators upon insertion. Complexity: $(BIGOH 1) */ @property size_t capacity() { return _data.refCountedStore.isInitialized ? _data._capacity : 0; } /** Ensures sufficient capacity to accommodate $(D e) elements. Postcondition: $(D capacity >= e) Complexity: $(BIGOH 1) */ void reserve(size_t elements) { if (!_data.refCountedStore.isInitialized) { if (!elements) return; immutable sz = elements * T.sizeof; auto p = enforce(malloc(sz)); static if (hasIndirections!T) { GC.addRange(p, sz); } _data = Data(cast(T[]) p[0 .. 0]); _data._capacity = elements; } else { _data.reserve(elements); } } /** Returns a range that iterates over elements of the container, in forward order. Complexity: $(BIGOH 1) */ Range opSlice() { return Range(this, 0, length); } /** Returns a range that iterates over elements of the container from index $(D a) up to (excluding) index $(D b). Precondition: $(D a <= b && b <= length) Complexity: $(BIGOH 1) */ Range opSlice(size_t i, size_t j) { version (assert) if (i > j || j > length) throw new RangeError(); return Range(this, i, j); } /** Forward to $(D opSlice().front) and $(D opSlice().back), respectively. Precondition: $(D !empty) Complexity: $(BIGOH 1) */ @property ref T front() { version (assert) if (!_data.refCountedStore.isInitialized) throw new RangeError(); return _data._payload[0]; } /// ditto @property ref T back() { version (assert) if (!_data.refCountedStore.isInitialized) throw new RangeError(); return _data._payload[$ - 1]; } /** Indexing operators yield or modify the value at a specified index. Precondition: $(D i < length) Complexity: $(BIGOH 1) */ ref T opIndex(size_t i) { version (assert) if (!_data.refCountedStore.isInitialized) throw new RangeError(); return _data._payload[i]; } /** Slicing operations execute an operation on an entire slice. Precondition: $(D i < j && j < length) Complexity: $(BIGOH slice.length) */ void opSliceAssign(T value) { if (!_data.refCountedStore.isInitialized) return; _data._payload[] = value; } /// ditto void opSliceAssign(T value, size_t i, size_t j) { auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init; slice[i .. j] = value; } /// ditto void opSliceUnary(string op)() if(op == "++" || op == "--") { if(!_data.refCountedStore.isInitialized) return; mixin(op~"_data._payload[];"); } /// ditto void opSliceUnary(string op)(size_t i, size_t j) if(op == "++" || op == "--") { auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init; mixin(op~"slice[i .. j];"); } /// ditto void opSliceOpAssign(string op)(T value) { if(!_data.refCountedStore.isInitialized) return; mixin("_data._payload[] "~op~"= value;"); } /// ditto void opSliceOpAssign(string op)(T value, size_t i, size_t j) { auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init; mixin("slice[i .. j] "~op~"= value;"); } /** Returns a new container that's the concatenation of $(D this) and its argument. $(D opBinaryRight) is only defined if $(D Stuff) does not define $(D opBinary). Complexity: $(BIGOH n + m), where m is the number of elements in $(D stuff) */ Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~") { // TODO: optimize Array result; // @@@BUG@@ result ~= this[] doesn't work auto r = this[]; result ~= r; assert(result.length == length); result ~= stuff[]; return result; } /** Forwards to $(D insertBack(stuff)). */ void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~") { static if (is(typeof(stuff[]))) { insertBack(stuff[]); } else { insertBack(stuff); } } /** Removes all contents from the container. The container decides how $(D capacity) is affected. Postcondition: $(D empty) Complexity: $(BIGOH n) */ void clear() { .destroy(_data); } /** Sets the number of elements in the container to $(D newSize). If $(D newSize) is greater than $(D length), the added elements are added to unspecified positions in the container and initialized with $(D T.init). Complexity: $(BIGOH abs(n - newLength)) Postcondition: $(D length == newLength) */ @property void length(size_t newLength) { _data.refCountedStore.ensureInitialized(); _data.length = newLength; } /** Picks one value in an unspecified position in the container, removes it from the container, and returns it. Implementations should pick the value that's the most advantageous for the container, but document the exact behavior. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Precondition: $(D !empty) Returns: The element removed. Complexity: $(BIGOH log(n)). */ T removeAny() { auto result = back; removeBack(); return result; } /// ditto alias stableRemoveAny = removeAny; /** Inserts $(D value) to the front or back of the container. $(D stuff) can be a value convertible to $(D T) or a range of objects convertible to $(D T). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements inserted Complexity: $(BIGOH m * log(n)), where $(D m) is the number of elements in $(D stuff) */ size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T) || isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T)) { _data.refCountedStore.ensureInitialized(); return _data.insertBack(stuff); } /// ditto alias insert = insertBack; /** Removes the value at the back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Precondition: $(D !empty) Complexity: $(BIGOH log(n)). */ void removeBack() { enforce(!empty); static if (is(T == struct)) { // Destroy this guy .destroy(_data._payload[$ - 1]); } _data._payload = _data._payload[0 .. $ - 1]; } /// ditto alias stableRemoveBack = removeBack; /** Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, if $(D howMany > n), all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements removed Complexity: $(BIGOH howMany). */ size_t removeBack(size_t howMany) { if (howMany > length) howMany = length; static if (is(T == struct)) { // Destroy this guy foreach (ref e; _data._payload[$ - howMany .. $]) { .destroy(e); } } _data._payload = _data._payload[0 .. $ - howMany]; return howMany; } /// ditto alias stableRemoveBack = removeBack; /** Inserts $(D stuff) before, after, or instead range $(D r), which must be a valid range previously extracted from this container. $(D stuff) can be a value convertible to $(D T) or a range of objects convertible to $(D T). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of values inserted. Complexity: $(BIGOH n + m), where $(D m) is the length of $(D stuff) */ size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)) { enforce(r._outer._data is _data && r._a <= length); reserve(length + 1); assert(_data.refCountedStore.isInitialized); // Move elements over by one slot memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a)); emplace(_data._payload.ptr + r._a, stuff); _data._payload = _data._payload.ptr[0 .. _data._payload.length + 1]; return 1; } /// ditto size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T)) { enforce(r._outer._data is _data && r._a <= length); static if (isForwardRange!Stuff) { // Can find the length in advance auto extra = walkLength(stuff); if (!extra) return 0; reserve(length + extra); assert(_data.refCountedStore.isInitialized); // Move elements over by extra slots memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a)); foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra) { emplace(p, stuff.front); stuff.popFront(); } _data._payload = _data._payload.ptr[0 .. _data._payload.length + extra]; return extra; } else { enforce(_data); immutable offset = r._a; enforce(offset <= length); auto result = insertBack(stuff); bringToFront(this[offset .. length - result], this[length - result .. length]); return result; } } /// ditto size_t insertAfter(Stuff)(Range r, Stuff stuff) { enforce(r._outer._data is _data); // TODO: optimize immutable offset = r._b; enforce(offset <= length); auto result = insertBack(stuff); bringToFront(this[offset .. length - result], this[length - result .. length]); return result; } /// ditto size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T)) { enforce(r._outer._data is _data); size_t result; for (; !stuff.empty; stuff.popFront()) { if (r.empty) { // insert the rest return result + insertBefore(r, stuff); } r.front = stuff.front; r.popFront(); ++result; } // Remove remaining stuff in r linearRemove(r); return result; } /// ditto size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)) { enforce(r._outer._data is _data); if (r.empty) { insertBefore(r, stuff); } else { r.front = stuff; r.popFront(); linearRemove(r); } return 1; } /** Removes all elements belonging to $(D r), which must be a range obtained originally from this container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: A range spanning the remaining elements in the container that initially were right after $(D r). Complexity: $(BIGOH n - m), where $(D m) is the number of elements in $(D r) */ Range linearRemove(Range r) { enforce(r._outer._data is _data); enforce(_data.refCountedStore.isInitialized); enforce(r._a <= r._b && r._b <= length); immutable offset1 = r._a; immutable offset2 = r._b; immutable tailLength = length - offset2; // Use copy here, not a[] = b[] because the ranges may overlap copy(this[offset2 .. length], this[offset1 .. offset1 + tailLength]); length = offset1 + tailLength; return this[length - tailLength .. length]; } /// ditto alias stableLinearRemove = remove; } unittest { Array!int a; assert(a.empty); } unittest { Array!int a = Array!int(1, 2, 3); //a._data._refCountedDebug = true; auto b = a.dup; assert(b == Array!int(1, 2, 3)); b.front = 42; assert(b == Array!int(42, 2, 3)); assert(a == Array!int(1, 2, 3)); } unittest { auto a = Array!int(1, 2, 3); assert(a.length == 3); } unittest { Array!int a; a.reserve(1000); assert(a.length == 0); assert(a.empty); assert(a.capacity >= 1000); auto p = a._data._payload.ptr; foreach (i; 0 .. 1000) { a.insertBack(i); } assert(p == a._data._payload.ptr); } unittest { auto a = Array!int(1, 2, 3); a[1] *= 42; assert(a[1] == 84); } unittest { auto a = Array!int(1, 2, 3); auto b = Array!int(11, 12, 13); auto c = a ~ b; //foreach (e; c) writeln(e); assert(c == Array!int(1, 2, 3, 11, 12, 13)); //assert(a ~ b[] == Array!int(1, 2, 3, 11, 12, 13)); } unittest { auto a = Array!int(1, 2, 3); auto b = Array!int(11, 12, 13); a ~= b; assert(a == Array!int(1, 2, 3, 11, 12, 13)); } unittest { auto a = Array!int(1, 2, 3, 4); assert(a.removeAny() == 4); assert(a == Array!int(1, 2, 3)); } unittest { auto a = Array!int(1, 2, 3, 4, 5); auto r = a[2 .. a.length]; assert(a.insertBefore(r, 42) == 1); assert(a == Array!int(1, 2, 42, 3, 4, 5)); r = a[2 .. 2]; assert(a.insertBefore(r, [8, 9]) == 2); assert(a == Array!int(1, 2, 8, 9, 42, 3, 4, 5)); } unittest { auto a = Array!int(0, 1, 2, 3, 4, 5, 6, 7, 8); a.linearRemove(a[4 .. 6]); auto b = Array!int(0, 1, 2, 3, 6, 7, 8); //writeln(a.length); //foreach (e; a) writeln(e); assert(a == Array!int(0, 1, 2, 3, 6, 7, 8)); } // Give the Range object some testing. unittest { auto a = Array!int(0, 1, 2, 3, 4, 5, 6)[]; auto b = Array!int(6, 5, 4, 3, 2, 1, 0)[]; alias A = typeof(a); static assert(isRandomAccessRange!A); static assert(hasSlicing!A); static assert(hasAssignableElements!A); static assert(hasMobileElements!A); assert(equal(retro(b), a)); assert(a.length == 7); assert(equal(a[1..4], [1, 2, 3])); } // Test issue 5920 version(unittest) { //@@@BUG4274@@@: This cannot be declared as an inner struct. private struct structBug5920 { int order; uint* pDestructionMask; ~this() { if (pDestructionMask) *pDestructionMask += 1 << order; } } } unittest { alias S = structBug5920; uint dMask; auto arr = Array!S(cast(S[])[]); foreach (i; 0..8) arr.insertBack(S(i, &dMask)); // don't check dMask now as S may be copied multiple times (it's ok?) { assert(arr.length == 8); dMask = 0; arr.length = 6; assert(arr.length == 6); // make sure shrinking calls the d'tor assert(dMask == 0b1100_0000); arr.removeBack(); assert(arr.length == 5); // make sure removeBack() calls the d'tor assert(dMask == 0b1110_0000); arr.removeBack(3); assert(arr.length == 2); // ditto assert(dMask == 0b1111_1100); arr.clear(); assert(arr.length == 0); // make sure clear() calls the d'tor assert(dMask == 0b1111_1111); } assert(dMask == 0b1111_1111); // make sure the d'tor is called once only. } // Test issue 5792 (mainly just to check if this piece of code is compilable) unittest { auto a = Array!(int[])([[1,2],[3,4]]); a.reserve(4); assert(a.capacity >= 4); assert(a.length == 2); assert(a[0] == [1,2]); assert(a[1] == [3,4]); a.reserve(16); assert(a.capacity >= 16); assert(a.length == 2); assert(a[0] == [1,2]); assert(a[1] == [3,4]); } // test replace!Stuff with range Stuff unittest { auto a = Array!int([1, 42, 5]); a.replace(a[1 .. 2], [2, 3, 4]); assert(equal(a[], [1, 2, 3, 4, 5])); } // test insertBefore and replace with empty Arrays unittest { auto a = Array!int(); a.insertBefore(a[], 1); assert(equal(a[], [1])); } unittest { auto a = Array!int(); a.insertBefore(a[], [1, 2]); assert(equal(a[], [1, 2])); } unittest { auto a = Array!int(); a.replace(a[], [1, 2]); assert(equal(a[], [1, 2])); } unittest { auto a = Array!int(); a.replace(a[], 1); assert(equal(a[], [1])); } // make sure that Array instances refuse ranges that don't belong to them unittest { Array!int a = [1, 2, 3]; auto r = a.dup[]; assertThrown(a.insertBefore(r, 42)); assertThrown(a.insertBefore(r, [42])); assertThrown(a.insertAfter(r, 42)); assertThrown(a.replace(r, 42)); assertThrown(a.replace(r, [42])); assertThrown(a.linearRemove(r)); } unittest { auto a = Array!int([1, 1]); a[1] = 0; //Check Array.opIndexAssign assert(a[1] == 0); a[1] += 1; //Check Array.opIndexOpAssign assert(a[1] == 1); //Check Array.opIndexUnary ++a[0]; //a[0]++ //op++ doesn't return, so this shouldn't work, even with 5044 fixed assert(a[0] == 2); assert(+a[0] == +2); assert(-a[0] == -2); assert(~a[0] == ~2); auto r = a[]; r[1] = 0; //Check Array.Range.opIndexAssign assert(r[1] == 0); r[1] += 1; //Check Array.Range.opIndexOpAssign assert(r[1] == 1); //Check Array.Range.opIndexUnary ++r[0]; //r[0]++ //op++ doesn't return, so this shouldn't work, even with 5044 fixed assert(r[0] == 3); assert(+r[0] == +3); assert(-r[0] == -3); assert(~r[0] == ~3); } unittest { //Test "array-wide" operations auto a = Array!int([0, 1, 2]); //Array a[] += 5; assert(a[].equal([5, 6, 7])); ++a[]; assert(a[].equal([6, 7, 8])); a[1 .. 3] *= 5; assert(a[].equal([6, 35, 40])); a[0 .. 2] = 0; assert(a[].equal([0, 0, 40])); //Test empty array auto a2 = Array!int.init; ++a2[]; ++a2[0 .. 0]; a2[] = 0; a2[0 .. 0] = 0; a2[] += 0; a2[0 .. 0] += 0; //Test "range-wide" operations auto r = Array!int([0, 1, 2])[]; //Array.Range r[] += 5; assert(r.equal([5, 6, 7])); ++r[]; assert(r.equal([6, 7, 8])); r[1 .. 3] *= 5; assert(r.equal([6, 35, 40])); r[0 .. 2] = 0; assert(r.equal([0, 0, 40])); //Test empty Range auto r2 = Array!int.init[]; ++r2[]; ++r2[0 .. 0]; r2[] = 0; r2[0 .. 0] = 0; r2[] += 0; r2[0 .. 0] += 0; } // Test issue 11194 unittest { static struct S { int i = 1337; void* p; this(this) { assert(i == 1337); } ~this() { assert(i == 1337); } } Array!S arr; S s; arr ~= s; arr ~= s; } unittest //11459 { static struct S { bool b; alias b this; } alias A = Array!S; alias B = Array!(shared bool); } unittest //11884 { auto a = Array!int([1, 2, 2].filter!"true"()); } unittest //8282 { auto arr = new Array!int; } // BinaryHeap /** Implements a $(WEB en.wikipedia.org/wiki/Binary_heap, binary heap) container on top of a given random-access range type (usually $(D T[])) or a random-access container type (usually $(D Array!T)). The documentation of $(D BinaryHeap) will refer to the underlying range or container as the $(I store) of the heap. The binary heap induces structure over the underlying store such that accessing the largest element (by using the $(D front) property) is a $(BIGOH 1) operation and extracting it (by using the $(D removeFront()) method) is done fast in $(BIGOH log n) time. If $(D less) is the less-than operator, which is the default option, then $(D BinaryHeap) defines a so-called max-heap that optimizes extraction of the $(I largest) elements. To define a min-heap, instantiate BinaryHeap with $(D "a > b") as its predicate. Simply extracting elements from a $(D BinaryHeap) container is tantamount to lazily fetching elements of $(D Store) in descending order. Extracting elements from the $(D BinaryHeap) to completion leaves the underlying store sorted in ascending order but, again, yields elements in descending order. If $(D Store) is a range, the $(D BinaryHeap) cannot grow beyond the size of that range. If $(D Store) is a container that supports $(D insertBack), the $(D BinaryHeap) may grow by adding elements to the container. */ struct BinaryHeap(Store, alias less = "a < b") if (isRandomAccessRange!(Store) || isRandomAccessRange!(typeof(Store.init[]))) { // Really weird @@BUG@@: if you comment out the "private:" label below, // std.algorithm can't unittest anymore //private: // The payload includes the support store and the effective length private static struct Data { Store _store; size_t _length; } private RefCounted!(Data, RefCountedAutoInitialize.no) _payload; // Comparison predicate private alias comp = binaryFun!(less); // Convenience accessors private @property ref Store _store() { assert(_payload.refCountedStore.isInitialized); return _payload._store; } private @property ref size_t _length() { assert(_payload.refCountedStore.isInitialized); return _payload._length; } // Asserts that the heap property is respected. private void assertValid() { debug { if (!_payload.refCountedStore.isInitialized) return; if (_length < 2) return; for (size_t n = _length - 1; n >= 1; --n) { auto parentIdx = (n - 1) / 2; assert(!comp(_store[parentIdx], _store[n]), text(n)); } } } // Assuming the element at index i perturbs the heap property in // store r, percolates it down the heap such that the heap // property is restored. private void percolateDown(Store r, size_t i, size_t length) { for (;;) { auto left = i * 2 + 1, right = left + 1; if (right == length) { if (comp(r[i], r[left])) swap(r, i, left); return; } if (right > length) return; assert(left < length && right < length); auto largest = comp(r[i], r[left]) ? (comp(r[left], r[right]) ? right : left) : (comp(r[i], r[right]) ? right : i); if (largest == i) return; swap(r, i, largest); i = largest; } } // @@@BUG@@@: add private here, std.algorithm doesn't unittest anymore /*private*/ void pop(Store store) { assert(!store.empty, "Cannot pop an empty store."); if (store.length == 1) return; auto t1 = moveFront(store[]); auto t2 = moveBack(store[]); store.front = move(t2); store.back = move(t1); percolateDown(store, 0, store.length - 1); } /*private*/ static void swap(Store _store, size_t i, size_t j) { static if (is(typeof(swap(_store[i], _store[j])))) { swap(_store[i], _store[j]); } else static if (is(typeof(_store.moveAt(i)))) { auto t1 = _store.moveAt(i); auto t2 = _store.moveAt(j); _store[i] = move(t2); _store[j] = move(t1); } else // assume it's a container and access its range with [] { auto t1 = _store[].moveAt(i); auto t2 = _store[].moveAt(j); _store[i] = move(t2); _store[j] = move(t1); } } public: /** Converts the store $(D s) into a heap. If $(D initialSize) is specified, only the first $(D initialSize) elements in $(D s) are transformed into a heap, after which the heap can grow up to $(D r.length) (if $(D Store) is a range) or indefinitely (if $(D Store) is a container with $(D insertBack)). Performs $(BIGOH min(r.length, initialSize)) evaluations of $(D less). */ this(Store s, size_t initialSize = size_t.max) { acquire(s, initialSize); } /** Takes ownership of a store. After this, manipulating $(D s) may make the heap work incorrectly. */ void acquire(Store s, size_t initialSize = size_t.max) { _payload.refCountedStore.ensureInitialized(); _store = move(s); _length = min(_store.length, initialSize); if (_length < 2) return; for (auto i = (_length - 2) / 2; ; ) { this.percolateDown(_store, i, _length); if (i-- == 0) break; } assertValid(); } /** Takes ownership of a store assuming it already was organized as a heap. */ void assume(Store s, size_t initialSize = size_t.max) { _payload.refCountedStore.ensureInitialized(); _store = s; _length = min(_store.length, initialSize); assertValid(); } /** Clears the heap. Returns the portion of the store from $(D 0) up to $(D length), which satisfies the $(LUCKY heap property). */ auto release() { if (!_payload.refCountedStore.isInitialized) { return typeof(_store[0 .. _length]).init; } assertValid(); auto result = _store[0 .. _length]; _payload = _payload.init; return result; } /** Returns $(D true) if the heap is _empty, $(D false) otherwise. */ @property bool empty() { return !length; } /** Returns a duplicate of the heap. The underlying store must also support a $(D dup) method. */ @property BinaryHeap dup() { BinaryHeap result; if (!_payload.refCountedStore.isInitialized) return result; result.assume(_store.dup, length); return result; } /** Returns the _length of the heap. */ @property size_t length() { return _payload.refCountedStore.isInitialized ? _length : 0; } /** Returns the _capacity of the heap, which is the length of the underlying store (if the store is a range) or the _capacity of the underlying store (if the store is a container). */ @property size_t capacity() { if (!_payload.refCountedStore.isInitialized) return 0; static if (is(typeof(_store.capacity) : size_t)) { return _store.capacity; } else { return _store.length; } } /** Returns a copy of the _front of the heap, which is the largest element according to $(D less). */ @property ElementType!Store front() { enforce(!empty, "Cannot call front on an empty heap."); return _store.front; } /** Clears the heap by detaching it from the underlying store. */ void clear() { _payload = _payload.init; } /** Inserts $(D value) into the store. If the underlying store is a range and $(D length == capacity), throws an exception. */ size_t insert(ElementType!Store value) { static if (is(typeof(_store.insertBack(value)))) { _payload.refCountedStore.ensureInitialized(); if (length == _store.length) { // reallocate _store.insertBack(value); } else { // no reallocation _store[_length] = value; } } else { // can't grow enforce(length < _store.length, "Cannot grow a heap created over a range"); _store[_length] = value; } // sink down the element for (size_t n = _length; n; ) { auto parentIdx = (n - 1) / 2; if (!comp(_store[parentIdx], _store[n])) break; // done! // must swap and continue swap(_store, parentIdx, n); n = parentIdx; } ++_length; assertValid(); return 1; } /** Removes the largest element from the heap. */ void removeFront() { enforce(!empty, "Cannot call removeFront on an empty heap."); if (_length > 1) { auto t1 = moveFront(_store[]); auto t2 = moveAt(_store[], _length - 1); _store.front = move(t2); _store[_length - 1] = move(t1); } --_length; percolateDown(_store, 0, _length); } /** Removes the largest element from the heap and returns a copy of it. The element still resides in the heap's store. For performance reasons you may want to use $(D removeFront) with heaps of objects that are expensive to copy. */ ElementType!Store removeAny() { removeFront(); return _store[_length]; } /** Replaces the largest element in the store with $(D value). */ void replaceFront(ElementType!Store value) { // must replace the top assert(!empty, "Cannot call replaceFront on an empty heap."); _store.front = value; percolateDown(_store, 0, _length); assertValid(); } /** If the heap has room to grow, inserts $(D value) into the store and returns $(D true). Otherwise, if $(D less(value, front)), calls $(D replaceFront(value)) and returns again $(D true). Otherwise, leaves the heap unaffected and returns $(D false). This method is useful in scenarios where the smallest $(D k) elements of a set of candidates must be collected. */ bool conditionalInsert(ElementType!Store value) { _payload.refCountedStore.ensureInitialized(); if (_length < _store.length) { insert(value); return true; } // must replace the top assert(!_store.empty, "Cannot replace front of an empty heap."); if (!comp(value, _store.front)) return false; // value >= largest _store.front = value; percolateDown(_store, 0, _length); assertValid(); return true; } } /// unittest { // Example from "Introduction to Algorithms" Cormen et al, p 146 int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ]; auto h = heapify(a); // largest element assert(h.front == 16); // a has the heap property assert(equal(a, [ 16, 14, 10, 8, 7, 9, 3, 2, 4, 1 ])); } /** Convenience function that returns a $(D BinaryHeap!Store) object initialized with $(D s) and $(D initialSize). */ BinaryHeap!(Store, less) heapify(alias less = "a < b", Store)(Store s, size_t initialSize = size_t.max) { return BinaryHeap!(Store, less)(s, initialSize); } unittest { { // example from "Introduction to Algorithms" Cormen et al., p 146 int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ]; auto h = heapify(a); h = heapify!"a < b"(a); assert(h.front == 16); assert(a == [ 16, 14, 10, 8, 7, 9, 3, 2, 4, 1 ]); auto witness = [ 16, 14, 10, 9, 8, 7, 4, 3, 2, 1 ]; for (; !h.empty; h.removeFront(), witness.popFront()) { assert(!witness.empty); assert(witness.front == h.front); } assert(witness.empty); } { int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ]; int[] b = new int[a.length]; BinaryHeap!(int[]) h = BinaryHeap!(int[])(b, 0); foreach (e; a) { h.insert(e); } assert(b == [ 16, 14, 10, 8, 7, 3, 9, 1, 4, 2 ], text(b)); } } //////////////////////////////////////////////////////////////////////////////// // Array!bool //////////////////////////////////////////////////////////////////////////////// /** _Array specialized for $(D bool). Packs together values efficiently by allocating one bit per element. */ struct Array(T) if (is(Unqual!T == bool)) { static immutable uint bitsPerWord = size_t.sizeof * 8; private static struct Data { Array!size_t.Payload _backend; size_t _length; } private RefCounted!(Data, RefCountedAutoInitialize.no) _store; private @property ref size_t[] data() { assert(_store.refCountedStore.isInitialized); return _store._backend._payload; } /** Defines the container's primary range. */ struct Range { private Array _outer; private size_t _a, _b; /// Range primitives @property Range save() { version (bug4437) { return this; } else { auto copy = this; return copy; } } /// Ditto @property bool empty() { return _a >= _b || _outer.length < _b; } /// Ditto @property T front() { enforce(!empty); return _outer[_a]; } /// Ditto @property void front(bool value) { enforce(!empty); _outer[_a] = value; } /// Ditto T moveFront() { enforce(!empty); return _outer.moveAt(_a); } /// Ditto void popFront() { enforce(!empty); ++_a; } /// Ditto @property T back() { enforce(!empty); return _outer[_b - 1]; } /// Ditto @property void back(bool value) { enforce(!empty); _outer[_b - 1] = value; } /// Ditto T moveBack() { enforce(!empty); return _outer.moveAt(_b - 1); } /// Ditto void popBack() { enforce(!empty); --_b; } /// Ditto T opIndex(size_t i) { return _outer[_a + i]; } /// Ditto void opIndexAssign(T value, size_t i) { _outer[_a + i] = value; } /// Ditto T moveAt(size_t i) { return _outer.moveAt(_a + i); } /// Ditto @property size_t length() const { assert(_a <= _b); return _b - _a; } alias opDollar = length; /// ditto Range opSlice(size_t low, size_t high) { assert(_a <= low && low <= high && high <= _b); return Range(_outer, _a + low, _a + high); } } /** Property returning $(D true) if and only if the container has no elements. Complexity: $(BIGOH 1) */ @property bool empty() { return !length; } unittest { Array!bool a; //a._store._refCountedDebug = true; assert(a.empty); a.insertBack(false); assert(!a.empty); } /** Returns a duplicate of the container. The elements themselves are not transitively duplicated. Complexity: $(BIGOH n). */ @property Array dup() { Array result; result.insertBack(this[]); return result; } unittest { Array!bool a; assert(a.empty); auto b = a.dup; assert(b.empty); a.insertBack(true); assert(b.empty); } /** Returns the number of elements in the container. Complexity: $(BIGOH log(n)). */ @property size_t length() const { return _store.refCountedStore.isInitialized ? _store._length : 0; } size_t opDollar() const { return length; } unittest { Array!bool a; assert(a.length == 0); a.insert(true); assert(a.length == 1, text(a.length)); } /** Returns the maximum number of elements the container can store without (a) allocating memory, (b) invalidating iterators upon insertion. Complexity: $(BIGOH log(n)). */ @property size_t capacity() { return _store.refCountedStore.isInitialized ? cast(size_t) bitsPerWord * _store._backend.capacity : 0; } unittest { Array!bool a; assert(a.capacity == 0); foreach (i; 0 .. 100) { a.insert(true); assert(a.capacity >= a.length, text(a.capacity)); } } /** Ensures sufficient capacity to accommodate $(D n) elements. Postcondition: $(D capacity >= n) Complexity: $(BIGOH log(e - capacity)) if $(D e > capacity), otherwise $(BIGOH 1). */ void reserve(size_t e) { _store.refCountedStore.ensureInitialized(); _store._backend.reserve(to!size_t((e + bitsPerWord - 1) / bitsPerWord)); } unittest { Array!bool a; assert(a.capacity == 0); a.reserve(15657); assert(a.capacity >= 15657); } /** Returns a range that iterates over all elements of the container, in a container-defined order. The container should choose the most convenient and fast method of iteration for $(D opSlice()). Complexity: $(BIGOH log(n)) */ Range opSlice() { return Range(this, 0, length); } unittest { Array!bool a; a.insertBack([true, false, true, true]); assert(a[].length == 4); } /** Returns a range that iterates the container between two specified positions. Complexity: $(BIGOH log(n)) */ Range opSlice(size_t a, size_t b) { enforce(a <= b && b <= length); return Range(this, a, b); } unittest { Array!bool a; a.insertBack([true, false, true, true]); assert(a[0 .. 2].length == 2); } /** Equivalent to $(D opSlice().front) and $(D opSlice().back), respectively. Complexity: $(BIGOH log(n)) */ @property bool front() { enforce(!empty); return data.ptr[0] & 1; } /// Ditto @property void front(bool value) { enforce(!empty); if (value) data.ptr[0] |= 1; else data.ptr[0] &= ~cast(size_t) 1; } unittest { Array!bool a; a.insertBack([true, false, true, true]); assert(a.front); a.front = false; assert(!a.front); } /// Ditto @property bool back() { enforce(!empty); return cast(bool)(data.back & (cast(size_t)1 << ((_store._length - 1) % bitsPerWord))); } /// Ditto @property void back(bool value) { enforce(!empty); if (value) { data.back |= (cast(size_t)1 << ((_store._length - 1) % bitsPerWord)); } else { data.back &= ~(cast(size_t)1 << ((_store._length - 1) % bitsPerWord)); } } unittest { Array!bool a; a.insertBack([true, false, true, true]); assert(a.back); a.back = false; assert(!a.back); } /** Indexing operators yield or modify the value at a specified index. */ bool opIndex(size_t i) { auto div = cast(size_t) (i / bitsPerWord); auto rem = i % bitsPerWord; enforce(div < data.length); return cast(bool)(data.ptr[div] & (cast(size_t)1 << rem)); } /// ditto void opIndexAssign(bool value, size_t i) { auto div = cast(size_t) (i / bitsPerWord); auto rem = i % bitsPerWord; enforce(div < data.length); if (value) data.ptr[div] |= (cast(size_t)1 << rem); else data.ptr[div] &= ~(cast(size_t)1 << rem); } /// ditto void opIndexOpAssign(string op)(bool value, size_t i) { auto div = cast(size_t) (i / bitsPerWord); auto rem = i % bitsPerWord; enforce(div < data.length); auto oldValue = cast(bool) (data.ptr[div] & (cast(size_t)1 << rem)); // Do the deed auto newValue = mixin("oldValue "~op~" value"); // Write back the value if (newValue != oldValue) { if (newValue) data.ptr[div] |= (cast(size_t)1 << rem); else data.ptr[div] &= ~(cast(size_t)1 << rem); } } /// Ditto T moveAt(size_t i) { return this[i]; } unittest { Array!bool a; a.insertBack([true, false, true, true]); assert(a[0] && !a[1]); a[0] &= a[1]; assert(!a[0]); } /** Returns a new container that's the concatenation of $(D this) and its argument. Complexity: $(BIGOH n + m), where m is the number of elements in $(D stuff) */ Array!bool opBinary(string op, Stuff)(Stuff rhs) if (op == "~") { auto result = this; return result ~= rhs; } unittest { Array!bool a; a.insertBack([true, false, true, true]); Array!bool b; b.insertBack([true, true, false, true]); assert(equal((a ~ b)[], [true, false, true, true, true, true, false, true])); } // /// ditto // TotalContainer opBinaryRight(Stuff, string op)(Stuff lhs) if (op == "~") // { // assert(0); // } /** Forwards to $(D insertAfter(this[], stuff)). */ // @@@BUG@@@ //ref Array!bool opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~") Array!bool opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~") { static if (is(typeof(stuff[]))) insertBack(stuff[]); else insertBack(stuff); return this; } unittest { Array!bool a; a.insertBack([true, false, true, true]); Array!bool b; a.insertBack([false, true, false, true, true]); a ~= b; assert(equal( a[], [true, false, true, true, false, true, false, true, true])); } /** Removes all contents from the container. The container decides how $(D capacity) is affected. Postcondition: $(D empty) Complexity: $(BIGOH n) */ void clear() { this = Array(); } unittest { Array!bool a; a.insertBack([true, false, true, true]); a.clear(); assert(a.capacity == 0); } /** Sets the number of elements in the container to $(D newSize). If $(D newSize) is greater than $(D length), the added elements are added to the container and initialized with $(D ElementType.init). Complexity: $(BIGOH abs(n - newLength)) Postcondition: $(D _length == newLength) */ @property void length(size_t newLength) { _store.refCountedStore.ensureInitialized(); auto newDataLength = to!size_t((newLength + bitsPerWord - 1) / bitsPerWord); _store._backend.length = newDataLength; _store._length = newLength; } unittest { Array!bool a; a.length = 1057; assert(a.length == 1057); foreach (e; a) { assert(!e); } } /** Inserts $(D stuff) in the container. $(D stuff) can be a value convertible to $(D ElementType) or a range of objects convertible to $(D ElementType). The $(D stable) version guarantees that ranges iterating over the container are never invalidated. Client code that counts on non-invalidating insertion should use $(D stableInsert). Returns: The number of elements added. Complexity: $(BIGOH m * log(n)), where $(D m) is the number of elements in $(D stuff) */ alias insert = insertBack; ///ditto alias stableInsert = insertBack; /** Same as $(D insert(stuff)) and $(D stableInsert(stuff)) respectively, but relax the complexity constraint to linear. */ alias linearInsert = insertBack; ///ditto alias stableLinearInsert = insertBack; /** Picks one value in the container, removes it from the container, and returns it. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Precondition: $(D !empty) Returns: The element removed. Complexity: $(BIGOH log(n)) */ T removeAny() { auto result = back; removeBack(); return result; } /// ditto alias stableRemoveAny = removeAny; unittest { Array!bool a; a.length = 1057; assert(!a.removeAny()); assert(a.length == 1056); foreach (e; a) { assert(!e); } } /** Inserts $(D value) to the back of the container. $(D stuff) can be a value convertible to $(D ElementType) or a range of objects convertible to $(D ElementType). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements inserted Complexity: $(BIGOH log(n)) */ size_t insertBack(Stuff)(Stuff stuff) if (is(Stuff : bool)) { _store.refCountedStore.ensureInitialized(); auto rem = _store._length % bitsPerWord; if (rem) { // Fits within the current array if (stuff) { data[$ - 1] |= (1u << rem); } else { data[$ - 1] &= ~(1u << rem); } } else { // Need to add more data _store._backend.insertBack(stuff); } ++_store._length; return 1; } /// Ditto size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff && is(ElementType!Stuff : bool)) { static if (!hasLength!Stuff) size_t result; for (; !stuff.empty; stuff.popFront()) { insertBack(stuff.front); static if (!hasLength!Stuff) ++result; } static if (!hasLength!Stuff) return result; else return stuff.length; } /// ditto alias stableInsertBack = insertBack; /** Removes the value at the front or back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. The optional parameter $(D howMany) instructs removal of that many elements. If $(D howMany > n), all elements are removed and no exception is thrown. Precondition: $(D !empty) Complexity: $(BIGOH log(n)). */ void removeBack() { enforce(_store._length); if (_store._length % bitsPerWord) { // Cool, just decrease the length --_store._length; } else { // Reduce the allocated space --_store._length; _store._backend.length = _store._backend.length - 1; } } /// ditto alias stableRemoveBack = removeBack; /** Removes $(D howMany) values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove $(D howMany) elements. Instead, if $(D howMany > n), all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of elements removed Complexity: $(BIGOH howMany * log(n)). */ /// ditto size_t removeBack(size_t howMany) { if (howMany >= length) { howMany = length; clear(); } else { length = length - howMany; } return howMany; } unittest { Array!bool a; a.length = 1057; assert(a.removeBack(1000) == 1000); assert(a.length == 57); foreach (e; a) { assert(!e); } } /** Inserts $(D stuff) before, after, or instead range $(D r), which must be a valid range previously extracted from this container. $(D stuff) can be a value convertible to $(D ElementType) or a range of objects convertible to $(D ElementType). The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: The number of values inserted. Complexity: $(BIGOH n + m), where $(D m) is the length of $(D stuff) */ size_t insertBefore(Stuff)(Range r, Stuff stuff) { // TODO: make this faster, it moves one bit at a time immutable inserted = stableInsertBack(stuff); immutable tailLength = length - inserted; bringToFront( this[r._a .. tailLength], this[tailLength .. length]); return inserted; } /// ditto alias stableInsertBefore = insertBefore; unittest { Array!bool a; version (bugxxxx) { a._store.refCountedDebug = true; } a.insertBefore(a[], true); assert(a.length == 1, text(a.length)); a.insertBefore(a[], false); assert(a.length == 2, text(a.length)); } /// ditto size_t insertAfter(Stuff)(Range r, Stuff stuff) { // TODO: make this faster, it moves one bit at a time immutable inserted = stableInsertBack(stuff); immutable tailLength = length - inserted; bringToFront( this[r._b .. tailLength], this[tailLength .. length]); return inserted; } /// ditto alias stableInsertAfter = insertAfter; unittest { Array!bool a; a.length = 10; a.insertAfter(a[0 .. 5], true); assert(a.length == 11, text(a.length)); assert(a[5]); } /// ditto size_t replace(Stuff)(Range r, Stuff stuff) if (is(Stuff : bool)) { if (!r.empty) { // There is room r.front = stuff; r.popFront(); linearRemove(r); } else { // No room, must insert insertBefore(r, stuff); } return 1; } /// ditto alias stableReplace = replace; unittest { Array!bool a; a.length = 10; a.replace(a[3 .. 5], true); assert(a.length == 9, text(a.length)); assert(a[3]); } /** Removes all elements belonging to $(D r), which must be a range obtained originally from this container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. Returns: A range spanning the remaining elements in the container that initially were right after $(D r). Complexity: $(BIGOH n) */ Range linearRemove(Range r) { copy(this[r._b .. length], this[r._a .. length]); length = length - r.length; return this[r._a .. length]; } /// ditto alias stableLinearRemove = linearRemove; } unittest { Array!bool a; assert(a.empty); } unittest { Array!bool arr; arr.insert([false, false, false, false]); assert(arr.front == false); assert(arr.back == false); assert(arr[1] == false); auto slice = arr[]; slice = arr[0 .. $]; slice = slice[1 .. $]; slice.front = true; slice.back = true; slice[1] = true; assert(slice.front == true); assert(slice.back == true); assert(slice[1] == true); assert(slice.moveFront == true); assert(slice.moveBack == true); assert(slice.moveAt(1) == true); } /* * Implementation for a Red Black node for use in a Red Black Tree (see below) * * this implementation assumes we have a marker Node that is the parent of the * root Node. This marker Node is not a valid Node, but marks the end of the * collection. The root is the left child of the marker Node, so it is always * last in the collection. The marker Node is passed in to the setColor * function, and the Node which has this Node as its parent is assumed to be * the root Node. * * A Red Black tree should have O(lg(n)) insertion, removal, and search time. */ struct RBNode(V) { /* * Convenience alias */ alias Node = RBNode*; private Node _left; private Node _right; private Node _parent; /** * The value held by this node */ V value; /** * Enumeration determining what color the node is. Null nodes are assumed * to be black. */ enum Color : byte { Red, Black } /** * The color of the node. */ Color color; /** * Get the left child */ @property Node left() { return _left; } /** * Get the right child */ @property Node right() { return _right; } /** * Get the parent */ @property Node parent() { return _parent; } /** * Set the left child. Also updates the new child's parent node. This * does not update the previous child. * * Returns newNode */ @property Node left(Node newNode) { _left = newNode; if(newNode !is null) newNode._parent = &this; return newNode; } /** * Set the right child. Also updates the new child's parent node. This * does not update the previous child. * * Returns newNode */ @property Node right(Node newNode) { _right = newNode; if(newNode !is null) newNode._parent = &this; return newNode; } // assume _left is not null // // performs rotate-right operation, where this is T, _right is R, _left is // L, _parent is P: // // P P // | -> | // T L // / \ / \ // L R a T // / \ / \ // a b b R // /** * Rotate right. This performs the following operations: * - The left child becomes the parent of this node. * - This node becomes the new parent's right child. * - The old right child of the new parent becomes the left child of this * node. */ Node rotateR() in { assert(_left !is null); } body { // sets _left._parent also if(isLeftNode) parent.left = _left; else parent.right = _left; Node tmp = _left._right; // sets _parent also _left.right = &this; // sets tmp._parent also left = tmp; return &this; } // assumes _right is non null // // performs rotate-left operation, where this is T, _right is R, _left is // L, _parent is P: // // P P // | -> | // T R // / \ / \ // L R T b // / \ / \ // a b L a // /** * Rotate left. This performs the following operations: * - The right child becomes the parent of this node. * - This node becomes the new parent's left child. * - The old left child of the new parent becomes the right child of this * node. */ Node rotateL() in { assert(_right !is null); } body { // sets _right._parent also if(isLeftNode) parent.left = _right; else parent.right = _right; Node tmp = _right._left; // sets _parent also _right.left = &this; // sets tmp._parent also right = tmp; return &this; } /** * Returns true if this node is a left child. * * Note that this should always return a value because the root has a * parent which is the marker node. */ @property bool isLeftNode() const in { assert(_parent !is null); } body { return _parent._left is &this; } /** * Set the color of the node after it is inserted. This performs an * update to the whole tree, possibly rotating nodes to keep the Red-Black * properties correct. This is an O(lg(n)) operation, where n is the * number of nodes in the tree. * * end is the marker node, which is the parent of the topmost valid node. */ void setColor(Node end) { // test against the marker node if(_parent !is end) { if(_parent.color == Color.Red) { Node cur = &this; while(true) { // because root is always black, _parent._parent always exists if(cur._parent.isLeftNode) { // parent is left node, y is 'uncle', could be null Node y = cur._parent._parent._right; if(y !is null && y.color == Color.Red) { cur._parent.color = Color.Black; y.color = Color.Black; cur = cur._parent._parent; if(cur._parent is end) { // root node cur.color = Color.Black; break; } else { // not root node cur.color = Color.Red; if(cur._parent.color == Color.Black) // satisfied, exit the loop break; } } else { if(!cur.isLeftNode) cur = cur._parent.rotateL(); cur._parent.color = Color.Black; cur = cur._parent._parent.rotateR(); cur.color = Color.Red; // tree should be satisfied now break; } } else { // parent is right node, y is 'uncle' Node y = cur._parent._parent._left; if(y !is null && y.color == Color.Red) { cur._parent.color = Color.Black; y.color = Color.Black; cur = cur._parent._parent; if(cur._parent is end) { // root node cur.color = Color.Black; break; } else { // not root node cur.color = Color.Red; if(cur._parent.color == Color.Black) // satisfied, exit the loop break; } } else { if(cur.isLeftNode) cur = cur._parent.rotateR(); cur._parent.color = Color.Black; cur = cur._parent._parent.rotateL(); cur.color = Color.Red; // tree should be satisfied now break; } } } } } else { // // this is the root node, color it black // color = Color.Black; } } /** * Remove this node from the tree. The 'end' node is used as the marker * which is root's parent. Note that this cannot be null! * * Returns the next highest valued node in the tree after this one, or end * if this was the highest-valued node. */ Node remove(Node end) { // // remove this node from the tree, fixing the color if necessary. // Node x; Node ret; if(_left is null || _right is null) { ret = next; } else { // // normally, we can just swap this node's and y's value, but // because an iterator could be pointing to y and we don't want to // disturb it, we swap this node and y's structure instead. This // can also be a benefit if the value of the tree is a large // struct, which takes a long time to copy. // Node yp, yl, yr; Node y = next; yp = y._parent; yl = y._left; yr = y._right; auto yc = y.color; auto isyleft = y.isLeftNode; // // replace y's structure with structure of this node. // if(isLeftNode) _parent.left = y; else _parent.right = y; // // need special case so y doesn't point back to itself // y.left = _left; if(_right is y) y.right = &this; else y.right = _right; y.color = color; // // replace this node's structure with structure of y. // left = yl; right = yr; if(_parent !is y) { if(isyleft) yp.left = &this; else yp.right = &this; } color = yc; // // set return value // ret = y; } // if this has less than 2 children, remove it if(_left !is null) x = _left; else x = _right; // remove this from the tree at the end of the procedure bool removeThis = false; if(x is null) { // pretend this is a null node, remove this on finishing x = &this; removeThis = true; } else if(isLeftNode) _parent.left = x; else _parent.right = x; // if the color of this is black, then it needs to be fixed if(color == color.Black) { // need to recolor the tree. while(x._parent !is end && x.color == Node.Color.Black) { if(x.isLeftNode) { // left node Node w = x._parent._right; if(w.color == Node.Color.Red) { w.color = Node.Color.Black; x._parent.color = Node.Color.Red; x._parent.rotateL(); w = x._parent._right; } Node wl = w.left; Node wr = w.right; if((wl is null || wl.color == Node.Color.Black) && (wr is null || wr.color == Node.Color.Black)) { w.color = Node.Color.Red; x = x._parent; } else { if(wr is null || wr.color == Node.Color.Black) { // wl cannot be null here wl.color = Node.Color.Black; w.color = Node.Color.Red; w.rotateR(); w = x._parent._right; } w.color = x._parent.color; x._parent.color = Node.Color.Black; w._right.color = Node.Color.Black; x._parent.rotateL(); x = end.left; // x = root } } else { // right node Node w = x._parent._left; if(w.color == Node.Color.Red) { w.color = Node.Color.Black; x._parent.color = Node.Color.Red; x._parent.rotateR(); w = x._parent._left; } Node wl = w.left; Node wr = w.right; if((wl is null || wl.color == Node.Color.Black) && (wr is null || wr.color == Node.Color.Black)) { w.color = Node.Color.Red; x = x._parent; } else { if(wl is null || wl.color == Node.Color.Black) { // wr cannot be null here wr.color = Node.Color.Black; w.color = Node.Color.Red; w.rotateL(); w = x._parent._left; } w.color = x._parent.color; x._parent.color = Node.Color.Black; w._left.color = Node.Color.Black; x._parent.rotateR(); x = end.left; // x = root } } } x.color = Node.Color.Black; } if(removeThis) { // // clear this node out of the tree // if(isLeftNode) _parent.left = null; else _parent.right = null; } return ret; } /** * Return the leftmost descendant of this node. */ @property Node leftmost() { Node result = &this; while(result._left !is null) result = result._left; return result; } /** * Return the rightmost descendant of this node */ @property Node rightmost() { Node result = &this; while(result._right !is null) result = result._right; return result; } /** * Returns the next valued node in the tree. * * You should never call this on the marker node, as it is assumed that * there is a valid next node. */ @property Node next() { Node n = &this; if(n.right is null) { while(!n.isLeftNode) n = n._parent; return n._parent; } else return n.right.leftmost; } /** * Returns the previous valued node in the tree. * * You should never call this on the leftmost node of the tree as it is * assumed that there is a valid previous node. */ @property Node prev() { Node n = &this; if(n.left is null) { while(n.isLeftNode) n = n._parent; return n._parent; } else return n.left.rightmost; } Node dup(scope Node delegate(V v) alloc) { // // duplicate this and all child nodes // // The recursion should be lg(n), so we shouldn't have to worry about // stack size. // Node copy = alloc(value); copy.color = color; if(_left !is null) copy.left = _left.dup(alloc); if(_right !is null) copy.right = _right.dup(alloc); return copy; } Node dup() { Node copy = new RBNode!V; copy.value = value; copy.color = color; if(_left !is null) copy.left = _left.dup(); if(_right !is null) copy.right = _right.dup(); return copy; } } /** * Implementation of a $(LUCKY red-black tree) container. * * All inserts, removes, searches, and any function in general has complexity * of $(BIGOH lg(n)). * * To use a different comparison than $(D "a < b"), pass a different operator string * that can be used by $(XREF functional, binaryFun), or pass in a * function, delegate, functor, or any type where $(D less(a, b)) results in a $(D bool) * value. * * Note that less should produce a strict ordering. That is, for two unequal * elements $(D a) and $(D b), $(D less(a, b) == !less(b, a)). $(D less(a, a)) should * always equal $(D false). * * If $(D allowDuplicates) is set to $(D true), then inserting the same element more than * once continues to add more elements. If it is $(D false), duplicate elements are * ignored on insertion. If duplicates are allowed, then new elements are * inserted after all existing duplicate elements. */ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false) if(is(typeof(binaryFun!less(T.init, T.init)))) { alias _less = binaryFun!less; // BUG: this must come first in the struct due to issue 2810 // add an element to the tree, returns the node added, or the existing node // if it has already been added and allowDuplicates is false private auto _add(Elem n) { Node result; static if(!allowDuplicates) bool added = true; if(!_end.left) { _end.left = _begin = result = allocate(n); } else { Node newParent = _end.left; Node nxt = void; while(true) { if(_less(n, newParent.value)) { nxt = newParent.left; if(nxt is null) { // // add to right of new parent // newParent.left = result = allocate(n); break; } } else { static if(!allowDuplicates) { if(!_less(newParent.value, n)) { result = newParent; added = false; break; } } nxt = newParent.right; if(nxt is null) { // // add to right of new parent // newParent.right = result = allocate(n); break; } } newParent = nxt; } if(_begin.left) _begin = _begin.left; } static if(allowDuplicates) { result.setColor(_end); version(RBDoChecks) check(); ++_length; return result; } else { if(added) { ++_length; result.setColor(_end); } version(RBDoChecks) check(); return Tuple!(bool, "added", Node, "n")(added, result); } } version(unittest) { private enum doUnittest = isIntegral!T; // note, this must be final so it does not affect the vtable layout final bool arrayEqual(T[] arr) { if(walkLength(this[]) == arr.length) { foreach(v; arr) { if(!(v in this)) return false; } return true; } return false; } } else { private enum doUnittest = false; } /** * Element type for the tree */ alias Elem = T; // used for convenience private alias Node = RBNode!Elem.Node; private Node _end; private Node _begin; private size_t _length; private void _setup() { assert(!_end); //Make sure that _setup isn't run more than once. _begin = _end = allocate(); } static private Node allocate() { return new RBNode!Elem; } static private Node allocate(Elem v) { auto result = allocate(); result.value = v; return result; } /** * The range type for $(D RedBlackTree) */ struct Range { private Node _begin; private Node _end; private this(Node b, Node e) { _begin = b; _end = e; } /** * Returns $(D true) if the range is _empty */ @property bool empty() const { return _begin is _end; } /** * Returns the first element in the range */ @property Elem front() { return _begin.value; } /** * Returns the last element in the range */ @property Elem back() { return _end.prev.value; } /** * pop the front element from the range * * complexity: amortized $(BIGOH 1) */ void popFront() { _begin = _begin.next; } /** * pop the back element from the range * * complexity: amortized $(BIGOH 1) */ void popBack() { _end = _end.prev; } /** * Trivial _save implementation, needed for $(D isForwardRange). */ @property Range save() { return this; } } static if(doUnittest) unittest { auto ts = new RedBlackTree(1, 2, 3, 4, 5); assert(ts.length == 5); auto r = ts[]; static if(less == "a < b") auto vals = [1, 2, 3, 4, 5]; else auto vals = [5, 4, 3, 2, 1]; assert(std.algorithm.equal(r, vals)); assert(r.front == vals.front); assert(r.back != r.front); auto oldfront = r.front; auto oldback = r.back; r.popFront(); r.popBack(); assert(r.front != r.back); assert(r.front != oldfront); assert(r.back != oldback); assert(ts.length == 5); } // find a node based on an element value private Node _find(Elem e) { static if(allowDuplicates) { Node cur = _end.left; Node result = null; while(cur) { if(_less(cur.value, e)) cur = cur.right; else if(_less(e, cur.value)) cur = cur.left; else { // want to find the left-most element result = cur; cur = cur.left; } } return result; } else { Node cur = _end.left; while(cur) { if(_less(cur.value, e)) cur = cur.right; else if(_less(e, cur.value)) cur = cur.left; else return cur; } return null; } } /** * Check if any elements exist in the container. Returns $(D false) if at least * one element exists. */ @property bool empty() { return _end.left is null; } /++ Returns the number of elements in the container. Complexity: $(BIGOH 1). +/ @property size_t length() { return _length; } /** * Duplicate this container. The resulting container contains a shallow * copy of the elements. * * Complexity: $(BIGOH n) */ @property RedBlackTree dup() { return new RedBlackTree(_end.dup(), _length); } static if(doUnittest) unittest { auto ts = new RedBlackTree(1, 2, 3, 4, 5); assert(ts.length == 5); auto ts2 = ts.dup; assert(ts2.length == 5); assert(std.algorithm.equal(ts[], ts2[])); ts2.insert(cast(Elem)6); assert(!std.algorithm.equal(ts[], ts2[])); assert(ts.length == 5 && ts2.length == 6); } /** * Fetch a range that spans all the elements in the container. * * Complexity: $(BIGOH log(n)) */ Range opSlice() { return Range(_begin, _end); } /** * The front element in the container * * Complexity: $(BIGOH log(n)) */ Elem front() { return _begin.value; } /** * The last element in the container * * Complexity: $(BIGOH log(n)) */ Elem back() { return _end.prev.value; } /++ $(D in) operator. Check to see if the given element exists in the container. Complexity: $(BIGOH log(n)) +/ bool opBinaryRight(string op)(Elem e) if (op == "in") { return _find(e) !is null; } static if(doUnittest) unittest { auto ts = new RedBlackTree(1, 2, 3, 4, 5); assert(cast(Elem)3 in ts); assert(cast(Elem)6 !in ts); } /** * Compares two trees for equality. * * Complexity: $(BIGOH n*log(n)) */ override bool opEquals(Object rhs) { RedBlackTree that = cast(RedBlackTree)rhs; if (that is null) return false; // If there aren't the same number of nodes, we can't be equal. if (this._length != that._length) return false; // FIXME: use a more efficient algo (if one exists?) auto thisRange = this[]; auto thatRange = that[]; return equal!(function(Elem a, Elem b) => !_less(a,b) && !_less(b,a)) (thisRange, thatRange); } static if(doUnittest) unittest { auto t1 = new RedBlackTree(1,2,3,4); auto t2 = new RedBlackTree(1,2,3,4); auto t3 = new RedBlackTree(1,2,3,5); auto t4 = new RedBlackTree(1,2,3,4,5); auto o = new Object(); assert(t1==t2); assert(t1!=t3); assert(t1!=t4); assert(t1!=o); // pathological case, must not crash } /** * Removes all elements from the container. * * Complexity: $(BIGOH 1) */ void clear() { _end.left = null; _begin = _end; _length = 0; } static if(doUnittest) unittest { auto ts = new RedBlackTree(1,2,3,4,5); assert(ts.length == 5); ts.clear(); assert(ts.empty && ts.length == 0); } /** * Insert a single element in the container. Note that this does not * invalidate any ranges currently iterating the container. * * Complexity: $(BIGOH log(n)) */ size_t stableInsert(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, Elem)) { static if(allowDuplicates) { _add(stuff); return 1; } else { return(_add(stuff).added ? 1 : 0); } } /** * Insert a range of elements in the container. Note that this does not * invalidate any ranges currently iterating the container. * * Complexity: $(BIGOH m * log(n)) */ size_t stableInsert(Stuff)(Stuff stuff) if(isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, Elem)) { size_t result = 0; static if(allowDuplicates) { foreach(e; stuff) { ++result; _add(e); } } else { foreach(e; stuff) { if(_add(e).added) ++result; } } return result; } /// ditto alias insert = stableInsert; static if(doUnittest) unittest { auto ts = new RedBlackTree(2,1,3,4,5,2,5); static if(allowDuplicates) { assert(ts.length == 7); assert(ts.stableInsert(cast(Elem[])[7, 8, 6, 9, 10, 8]) == 6); assert(ts.length == 13); assert(ts.stableInsert(cast(Elem)11) == 1 && ts.length == 14); assert(ts.stableInsert(cast(Elem)7) == 1 && ts.length == 15); static if(less == "a < b") assert(ts.arrayEqual([1,2,2,3,4,5,5,6,7,7,8,8,9,10,11])); else assert(ts.arrayEqual([11,10,9,8,8,7,7,6,5,5,4,3,2,2,1])); } else { assert(ts.length == 5); assert(ts.stableInsert(cast(Elem[])[7, 8, 6, 9, 10, 8]) == 5); assert(ts.length == 10); assert(ts.stableInsert(cast(Elem)11) == 1 && ts.length == 11); assert(ts.stableInsert(cast(Elem)7) == 0 && ts.length == 11); static if(less == "a < b") assert(ts.arrayEqual([1,2,3,4,5,6,7,8,9,10,11])); else assert(ts.arrayEqual([11,10,9,8,7,6,5,4,3,2,1])); } } /** * Remove an element from the container and return its value. * * Complexity: $(BIGOH log(n)) */ Elem removeAny() { scope(success) --_length; auto n = _begin; auto result = n.value; _begin = n.remove(_end); version(RBDoChecks) check(); return result; } static if(doUnittest) unittest { auto ts = new RedBlackTree(1,2,3,4,5); assert(ts.length == 5); auto x = ts.removeAny(); assert(ts.length == 4); Elem[] arr; foreach(Elem i; 1..6) if(i != x) arr ~= i; assert(ts.arrayEqual(arr)); } /** * Remove the front element from the container. * * Complexity: $(BIGOH log(n)) */ void removeFront() { scope(success) --_length; _begin = _begin.remove(_end); version(RBDoChecks) check(); } /** * Remove the back element from the container. * * Complexity: $(BIGOH log(n)) */ void removeBack() { scope(success) --_length; auto lastnode = _end.prev; if(lastnode is _begin) _begin = _begin.remove(_end); else lastnode.remove(_end); version(RBDoChecks) check(); } static if(doUnittest) unittest { auto ts = new RedBlackTree(1,2,3,4,5); assert(ts.length == 5); ts.removeBack(); assert(ts.length == 4); static if(less == "a < b") assert(ts.arrayEqual([1,2,3,4])); else assert(ts.arrayEqual([2,3,4,5])); ts.removeFront(); assert(ts.arrayEqual([2,3,4]) && ts.length == 3); } /++ Removes the given range from the container. Returns: A range containing all of the elements that were after the given range. Complexity: $(BIGOH m * log(n)) (where m is the number of elements in the range) +/ Range remove(Range r) { auto b = r._begin; auto e = r._end; if(_begin is b) _begin = e; while(b !is e) { b = b.remove(_end); --_length; } version(RBDoChecks) check(); return Range(e, _end); } static if(doUnittest) unittest { auto ts = new RedBlackTree(1,2,3,4,5); assert(ts.length == 5); auto r = ts[]; r.popFront(); r.popBack(); assert(ts.length == 5); auto r2 = ts.remove(r); assert(ts.length == 2); assert(ts.arrayEqual([1,5])); static if(less == "a < b") assert(std.algorithm.equal(r2, [5])); else assert(std.algorithm.equal(r2, [1])); } /++ Removes the given $(D Take!Range) from the container Returns: A range containing all of the elements that were after the given range. Complexity: $(BIGOH m * log(n)) (where m is the number of elements in the range) +/ Range remove(Take!Range r) { immutable isBegin = (r.source._begin is _begin); auto b = r.source._begin; while(!r.empty) { r.popFront(); b = b.remove(_end); --_length; } if(isBegin) _begin = b; return Range(b, _end); } static if(doUnittest) unittest { auto ts = new RedBlackTree(1,2,3,4,5); auto r = ts[]; r.popFront(); assert(ts.length == 5); auto r2 = ts.remove(take(r, 0)); static if(less == "a < b") { assert(std.algorithm.equal(r2, [2,3,4,5])); auto r3 = ts.remove(take(r, 2)); assert(ts.arrayEqual([1,4,5]) && ts.length == 3); assert(std.algorithm.equal(r3, [4,5])); } else { assert(std.algorithm.equal(r2, [4,3,2,1])); auto r3 = ts.remove(take(r, 2)); assert(ts.arrayEqual([5,2,1]) && ts.length == 3); assert(std.algorithm.equal(r3, [2,1])); } } /++ Removes elements from the container that are equal to the given values according to the less comparator. One element is removed for each value given which is in the container. If $(D allowDuplicates) is true, duplicates are removed only if duplicate values are given. Returns: The number of elements removed. Complexity: $(BIGOH m log(n)) (where m is the number of elements to remove) Examples: -------------------- auto rbt = redBlackTree!true(0, 1, 1, 1, 4, 5, 7); rbt.removeKey(1, 4, 7); assert(std.algorithm.equal(rbt[], [0, 1, 1, 5])); rbt.removeKey(1, 1, 0); assert(std.algorithm.equal(rbt[], [5])); -------------------- +/ size_t removeKey(U...)(U elems) if(allSatisfy!(isImplicitlyConvertibleToElem, U)) { Elem[U.length] toRemove; foreach(i, e; elems) toRemove[i] = e; return removeKey(toRemove[]); } /++ Ditto +/ size_t removeKey(U)(U[] elems) if(isImplicitlyConvertible!(U, Elem)) { immutable lenBefore = length; foreach(e; elems) { auto beg = _firstGreaterEqual(e); if(beg is _end || _less(e, beg.value)) // no values are equal continue; immutable isBegin = (beg is _begin); beg = beg.remove(_end); if(isBegin) _begin = beg; --_length; } return lenBefore - length; } /++ Ditto +/ size_t removeKey(Stuff)(Stuff stuff) if(isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, Elem) && !isDynamicArray!Stuff) { //We use array in case stuff is a Range from this RedBlackTree - either //directly or indirectly. return removeKey(array(stuff)); } //Helper for removeKey. private template isImplicitlyConvertibleToElem(U) { enum isImplicitlyConvertibleToElem = isImplicitlyConvertible!(U, Elem); } static if(doUnittest) unittest { auto rbt = new RedBlackTree(5, 4, 3, 7, 2, 1, 7, 6, 2, 19, 45); //The cast(Elem) is because these tests are instantiated with a variety //of numeric types, and the literals are all int, which is not always //implicitly convertible to Elem (e.g. short). static if(allowDuplicates) { assert(rbt.length == 11); assert(rbt.removeKey(cast(Elem)4) == 1 && rbt.length == 10); assert(rbt.arrayEqual([1,2,2,3,5,6,7,7,19,45]) && rbt.length == 10); assert(rbt.removeKey(cast(Elem)6, cast(Elem)2, cast(Elem)1) == 3); assert(rbt.arrayEqual([2,3,5,7,7,19,45]) && rbt.length == 7); assert(rbt.removeKey(cast(Elem)(42)) == 0 && rbt.length == 7); assert(rbt.removeKey(take(rbt[], 3)) == 3 && rbt.length == 4); static if(less == "a < b") assert(std.algorithm.equal(rbt[], [7,7,19,45])); else assert(std.algorithm.equal(rbt[], [7,5,3,2])); } else { assert(rbt.length == 9); assert(rbt.removeKey(cast(Elem)4) == 1 && rbt.length == 8); assert(rbt.arrayEqual([1,2,3,5,6,7,19,45])); assert(rbt.removeKey(cast(Elem)6, cast(Elem)2, cast(Elem)1) == 3); assert(rbt.arrayEqual([3,5,7,19,45]) && rbt.length == 5); assert(rbt.removeKey(cast(Elem)(42)) == 0 && rbt.length == 5); assert(rbt.removeKey(take(rbt[], 3)) == 3 && rbt.length == 2); static if(less == "a < b") assert(std.algorithm.equal(rbt[], [19,45])); else assert(std.algorithm.equal(rbt[], [5,3])); } } // find the first node where the value is > e private Node _firstGreater(Elem e) { // can't use _find, because we cannot return null auto cur = _end.left; auto result = _end; while(cur) { if(_less(e, cur.value)) { result = cur; cur = cur.left; } else cur = cur.right; } return result; } // find the first node where the value is >= e private Node _firstGreaterEqual(Elem e) { // can't use _find, because we cannot return null. auto cur = _end.left; auto result = _end; while(cur) { if(_less(cur.value, e)) cur = cur.right; else { result = cur; cur = cur.left; } } return result; } /** * Get a range from the container with all elements that are > e according * to the less comparator * * Complexity: $(BIGOH log(n)) */ Range upperBound(Elem e) { return Range(_firstGreater(e), _end); } /** * Get a range from the container with all elements that are < e according * to the less comparator * * Complexity: $(BIGOH log(n)) */ Range lowerBound(Elem e) { return Range(_begin, _firstGreaterEqual(e)); } /** * Get a range from the container with all elements that are == e according * to the less comparator * * Complexity: $(BIGOH log(n)) */ Range equalRange(Elem e) { auto beg = _firstGreaterEqual(e); if(beg is _end || _less(e, beg.value)) // no values are equal return Range(beg, beg); static if(allowDuplicates) { return Range(beg, _firstGreater(e)); } else { // no sense in doing a full search, no duplicates are allowed, // so we just get the next node. return Range(beg, beg.next); } } static if(doUnittest) unittest { auto ts = new RedBlackTree(1, 2, 3, 4, 5); auto rl = ts.lowerBound(3); auto ru = ts.upperBound(3); auto re = ts.equalRange(3); static if(less == "a < b") { assert(std.algorithm.equal(rl, [1,2])); assert(std.algorithm.equal(ru, [4,5])); } else { assert(std.algorithm.equal(rl, [5,4])); assert(std.algorithm.equal(ru, [2,1])); } assert(std.algorithm.equal(re, [3])); } version(RBDoChecks) { /* * Print the tree. This prints a sideways view of the tree in ASCII form, * with the number of indentations representing the level of the nodes. * It does not print values, only the tree structure and color of nodes. */ void printTree(Node n, int indent = 0) { if(n !is null) { printTree(n.right, indent + 2); for(int i = 0; i < indent; i++) write("."); writeln(n.color == n.color.Black ? "B" : "R"); printTree(n.left, indent + 2); } else { for(int i = 0; i < indent; i++) write("."); writeln("N"); } if(indent is 0) writeln(); } /* * Check the tree for validity. This is called after every add or remove. * This should only be enabled to debug the implementation of the RB Tree. */ void check() { // // check implementation of the tree // int recurse(Node n, string path) { if(n is null) return 1; if(n.parent.left !is n && n.parent.right !is n) throw new Exception("Node at path " ~ path ~ " has inconsistent pointers"); Node next = n.next; static if(allowDuplicates) { if(next !is _end && _less(next.value, n.value)) throw new Exception("ordering invalid at path " ~ path); } else { if(next !is _end && !_less(n.value, next.value)) throw new Exception("ordering invalid at path " ~ path); } if(n.color == n.color.Red) { if((n.left !is null && n.left.color == n.color.Red) || (n.right !is null && n.right.color == n.color.Red)) throw new Exception("Node at path " ~ path ~ " is red with a red child"); } int l = recurse(n.left, path ~ "L"); int r = recurse(n.right, path ~ "R"); if(l != r) { writeln("bad tree at:"); printTree(n); throw new Exception("Node at path " ~ path ~ " has different number of black nodes on left and right paths"); } return l + (n.color == n.color.Black ? 1 : 0); } try { recurse(_end.left, ""); } catch(Exception e) { printTree(_end.left, 0); throw e; } } } /+ For the moment, using templatized contstructors doesn't seem to work very well (likely due to bug# 436 and/or bug# 1528). The redBlackTree helper function seems to do the job well enough though. /** * Constructor. Pass in an array of elements, or individual elements to * initialize the tree with. */ this(U)(U[] elems...) if (isImplicitlyConvertible!(U, Elem)) { _setup(); stableInsert(elems); } /** * Constructor. Pass in a range of elements to initialize the tree with. */ this(Stuff)(Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, Elem) && !is(Stuff == Elem[])) { _setup(); stableInsert(stuff); } +/ /++ +/ this() { _setup(); } /++ Constructor. Pass in an array of elements, or individual elements to initialize the tree with. +/ this(Elem[] elems...) { _setup(); stableInsert(elems); } private this(Node end, size_t length) { _end = end; _begin = end.leftmost; _length = length; } } //Verify Example for removeKey. unittest { auto rbt = redBlackTree!true(0, 1, 1, 1, 4, 5, 7); rbt.removeKey(1, 4, 7); assert(std.algorithm.equal(rbt[], [0, 1, 1, 5])); rbt.removeKey(1, 1, 0); assert(std.algorithm.equal(rbt[], [5])); } //Tests for removeKey unittest { { auto rbt = redBlackTree(["hello", "world", "foo", "bar"]); assert(equal(rbt[], ["bar", "foo", "hello", "world"])); assert(rbt.removeKey("hello") == 1); assert(equal(rbt[], ["bar", "foo", "world"])); assert(rbt.removeKey("hello") == 0); assert(equal(rbt[], ["bar", "foo", "world"])); assert(rbt.removeKey("hello", "foo", "bar") == 2); assert(equal(rbt[], ["world"])); assert(rbt.removeKey(["", "world", "hello"]) == 1); assert(rbt.empty); } { auto rbt = redBlackTree([1, 2, 12, 27, 4, 500]); assert(equal(rbt[], [1, 2, 4, 12, 27, 500])); assert(rbt.removeKey(1u) == 1); assert(equal(rbt[], [2, 4, 12, 27, 500])); assert(rbt.removeKey(cast(byte)1) == 0); assert(equal(rbt[], [2, 4, 12, 27, 500])); assert(rbt.removeKey(1, 12u, cast(byte)27) == 2); assert(equal(rbt[], [2, 4, 500])); assert(rbt.removeKey([cast(short)0, cast(short)500, cast(short)1]) == 1); assert(equal(rbt[], [2, 4])); } } unittest { void test(T)() { auto rt1 = new RedBlackTree!(T, "a < b", false)(); auto rt2 = new RedBlackTree!(T, "a < b", true)(); auto rt3 = new RedBlackTree!(T, "a > b", false)(); auto rt4 = new RedBlackTree!(T, "a > b", true)(); } test!long(); test!ulong(); test!int(); test!uint(); test!short(); test!ushort(); test!byte(); test!byte(); } /++ Convenience function for creating a $(D RedBlackTree!E) from a list of values. Examples: -------------------- auto rbt1 = redBlackTree(0, 1, 5, 7); auto rbt2 = redBlackTree!string("hello", "world"); auto rbt3 = redBlackTree!true(0, 1, 5, 7, 5); auto rbt4 = redBlackTree!"a > b"(0, 1, 5, 7); auto rbt5 = redBlackTree!("a > b", true)(0.1, 1.3, 5.9, 7.2, 5.9); -------------------- +/ auto redBlackTree(E)(E[] elems...) { return new RedBlackTree!E(elems); } /++ Ditto +/ auto redBlackTree(bool allowDuplicates, E)(E[] elems...) { return new RedBlackTree!(E, "a < b", allowDuplicates)(elems); } /++ Ditto +/ auto redBlackTree(alias less, E)(E[] elems...) { return new RedBlackTree!(E, less)(elems); } /++ Ditto +/ auto redBlackTree(alias less, bool allowDuplicates, E)(E[] elems...) if(is(typeof(binaryFun!less(E.init, E.init)))) { //We shouldn't need to instantiate less here, but for some reason, //dmd can't handle it if we don't (even though the template which //takes less but not allowDuplicates works just fine). return new RedBlackTree!(E, binaryFun!less, allowDuplicates)(elems); } //Verify Examples. unittest { auto rbt1 = redBlackTree(0, 1, 5, 7); auto rbt2 = redBlackTree!string("hello", "world"); auto rbt3 = redBlackTree!true(0, 1, 5, 7, 5); auto rbt4 = redBlackTree!"a > b"(0, 1, 5, 7); auto rbt5 = redBlackTree!("a > b", true)(0.1, 1.3, 5.9, 7.2, 5.9); } //Combinations not in examples. unittest { auto rbt1 = redBlackTree!(true, string)("hello", "hello"); auto rbt2 = redBlackTree!((a, b){return a < b;}, double)(5.1, 2.3); auto rbt3 = redBlackTree!("a > b", true, string)("hello", "world"); } unittest { auto rt1 = redBlackTree(5, 4, 3, 2, 1); assert(rt1.length == 5); assert(array(rt1[]) == [1, 2, 3, 4, 5]); auto rt2 = redBlackTree!"a > b"(1.1, 2.1); assert(rt2.length == 2); assert(array(rt2[]) == [2.1, 1.1]); auto rt3 = redBlackTree!true(5, 5, 4); assert(rt3.length == 3); assert(array(rt3[]) == [4, 5, 5]); auto rt4 = redBlackTree!string("hello", "hello"); assert(rt4.length == 1); assert(array(rt4[]) == ["hello"]); } version(unittest) struct UnittestMe { int a; } unittest { auto c = Array!UnittestMe(); }
D
/Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/Build/Intermediates/TableViewSwiftSample.build/Debug-iphonesimulator/TableViewSwiftSample.build/Objects-normal/x86_64/AppDelegate.o : /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/TableViewSwiftSample/ViewController.swift /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/TableViewSwiftSample/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/Build/Intermediates/TableViewSwiftSample.build/Debug-iphonesimulator/TableViewSwiftSample.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/TableViewSwiftSample/ViewController.swift /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/TableViewSwiftSample/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/Build/Intermediates/TableViewSwiftSample.build/Debug-iphonesimulator/TableViewSwiftSample.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/TableViewSwiftSample/ViewController.swift /Users/y_satou/Desktop/espla/esplaBlog/TableViewSwiftSample/TableViewSwiftSample/TableViewSwiftSample/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
D
/** * A convenient way to store and access 1-8 flags in a single byte */ module util.meta.FlagByte; import std.traits; /** * FlagByte template * * Template params: * Byte = The byte to use as storage * names = The name aliases of the bit flags * bitmasks = The bitmasks to access the aliases */ template FlagByte ( alias Byte, string[] names, ubyte[] bitmasks ) { import std.format; static assert(is(typeof(Byte) == ubyte), "A flag byte must be stored in an actual byte"); static assert(names.length >= 1 && bitmasks.length >= 1, "A byte flag filed must have at least one flag"); static assert(names.length <= 8 && bitmasks.length <= 8, "A byte can only have 8 flags"); static assert(names.length == bitmasks.length, "A flagbyte must have the same amount of names as bitmasks"); template flags ( ubyte bitmask ) { @property { ubyte flags ( ) { return Byte & bitmask; } ubyte flags ( bool val ) { if ( val ) { Byte |= bitmask; } else { Byte &= ~bitmask; } return Byte & bitmask; } } } mixin(format("alias %s = flags!0x%02x;", names[0], bitmasks[0])); static if ( names.length > 1 && bitmasks.length > 1 ) { mixin FlagByte!(Byte, names[1 .. $], bitmasks[1 .. $]); } }
D
module wx.Colour; public import wx.common; version(Dinrus) private import stdrus; //! \cond EXTERN extern (C) ЦелУкз wxColour_ctor(); extern (C) ЦелУкз wxColour_ctorByName(ткст имя); extern (C) ЦелУкз wxColour_ctorByParts(ббайт красный, ббайт зелёный, ббайт синий); extern (C) проц wxColour_dtor(ЦелУкз сам); //extern (C) проц wxColour_RegisterDisposable(ЦелУкз сам, Virtual_Dispose onDispose); extern (C) ббайт wxColour_Red(ЦелУкз сам); extern (C) ббайт wxColour_Blue(ЦелУкз сам); extern (C) ббайт wxColour_Green(ЦелУкз сам); extern (C) бул wxColour_Ok(ЦелУкз сам); extern (C) проц wxColour_Set(ЦелУкз сам, ббайт красный, ббайт зелёный, ббайт синий); extern (C) ЦелУкз wxColour_CreateByName(ткст имя); //! \endcond //--------------------------------------------------------------------- export class Цвет : ВизОбъект { public static Цвет ЧЁРНЫЙ; public static Цвет БЕЛЫЙ; public static Цвет КРАСНЫЙ; public static Цвет СИНИЙ; public static Цвет ЗЕЛЁНЫЙ; public static Цвет ЦЫАН; public static Цвет СВЕТЛО_СЕРЫЙ; public static Цвет НуллЦвет; //--------------------------------------------------------------------- export this(ЦелУкз вхобъ) { super(вхобъ); } export this(ЦелУкз вхобъ, бул памСобств) { super(вхобъ); this.памСобств = памСобств; } export this() { this(wxColour_ctor(), да); //wxColour_RegisterDisposable(вхобъ, &VirtualDispose); } export this(ткст имя) { this(wxColour_ctorByName(имя), да); // toupper //wxColour_RegisterDisposable(вхобъ, &VirtualDispose); } export this(ббайт красный, ббайт зелёный, ббайт синий) { this(wxColour_ctorByParts(красный, зелёный, синий), да); //wxColour_RegisterDisposable(вхобъ, &VirtualDispose); } //--------------------------------------------------------------------- export override проц вымести() { if ((this != Цвет.ЧЁРНЫЙ) && (this != Цвет.БЕЛЫЙ) && (this != Цвет.КРАСНЫЙ) && (this != Цвет.СИНИЙ) && (this != Цвет.ЗЕЛЁНЫЙ) && (this != Цвет.ЦЫАН) && (this != Цвет.СВЕТЛО_СЕРЫЙ)) { super.вымести(/*да*/); } } //--------------------------------------------------------------------- export ббайт красный() { return wxColour_Red(вхобъ); } export ббайт зелёный() { return wxColour_Green(вхобъ); } export ббайт синий() { return wxColour_Blue(вхобъ); } //--------------------------------------------------------------------- export бул Ок() { return wxColour_Ok(вхобъ); } export проц установи(ббайт красный, ббайт зелёный, ббайт синий) { wxColour_Set(вхобъ, красный, зелёный, синий); } //--------------------------------------------------------------------- version(__WXGTK__) { export static Цвет создайПоИмени(ткст имя) { return new Цвет(wxColour_CreateByName(имя), да); } } // version(__WXGTK__) export static ВизОбъект Нов(ЦелУкз ptr) { return new Цвет(ptr); } }
D
/** * Uri parser * * Parse URI (Uniform Resource Identifiers) into parts described in RFC, based on tango.net.uri and GIO * * Authors: $(WEB github.com/robik, Robert 'Robik' Pasiński), $(WEB driv.pl/, Damian 'nazriel' Ziemba) * Copyright: Robert 'Robik' Pasiński, Damian 'nazriel' Ziemba 2011 * License: $(WEB http://www.boost.org/users/license.html, Boost license) * * Source: $(REPO std/net/uri.d) */ module dragonov.net.Uri; import std.string : indexOf; import std.conv : to; import std.array : split; //** TEMPORARY static import std.uri; /** * Represents query parameter */ struct QueryParam { /** * Creates new QueryParam object * * Params: * n = Query param name * v = Query param value */ this(string name, string value) { Name = name; Value = value; } /// Query param name string Name; /// Query param value string Value; } /** * Represents URI query */ struct UriQuery { /** * Array of params */ private QueryParam[55] _params; private size_t _count = 0; /** * Returns query param value with specified name * * Params: * name = Query param name * * Throws: * Exception if not exists * * Return: * String with contents */ string opIndex(string name) { foreach(param; _params) { if(param.Name == name) return param.Value; } throw new Exception("Param with name '"~name~"' does not exists"); } size_t Length() const { return _count; } /** * Returns QueryParam with specified index * * Params: * i = Query param index * * Returns: * QueryParam * * Throws: * Exception if index is out of bounds */ QueryParam opIndex(int i) { if(i >= _count) throw new Exception("Trying to get index that does not exits"); return _params[i]; } /** * Adds new QueryParam * * Params: * param = Param to add */ void Add(QueryParam param) { _params[_count++] = param; } } /** * Represents URI * * Examples: * --------- * auto uri = new Uri("http://domain.com/path"); * assert(uri.domain == "domain.com"); * assert(uri.path == "/path"); * --------- */ class Uri { /** * URI schemes */ enum Scheme : string { Http = "HTTP", Https = "HTTPS", Ftp = "FTP", Ftps = "FTPS", Irc = "IRC", Smtp = "SMTP", Unknown = "", } protected { Scheme _scheme; string _domain; ushort _port; string _path; UriQuery _query; string _user; string _password; string _fragment; string _rawUri; string _rawquery; } /** * Creates new Uri object * * Params: * uri = Uri to parse */ this(string uri) { Parse(uri); } /** * Creates new Uri object * * Params: * uri = Uri to parse * port = Port */ this(string uri, ushort port) { Parse(uri, port); } /** * Parses Uri * * Params: * uri = Uri to parse * port = Port */ void Parse(string uri, ushort port = 0) { Reset(); size_t i, j; _port = port; _rawUri = uri; /* * Scheme */ i = indexOf(uri, "://"); if(i != -1) { switch(uri[0 .. i]) { case "http": _scheme = Scheme.Http; break; case "https": _scheme = Scheme.Https; break; case "ftp": _scheme = Scheme.Ftp; break; case "ftps": _scheme = Scheme.Ftps; break; case "irc": _scheme = Scheme.Irc; break; case "smtp": _scheme = Scheme.Smtp; break; default: _scheme = Scheme.Unknown; break; } uri = uri[i + 3 .. $]; } else { _scheme = Scheme.Unknown; i = indexOf(uri, ":"); } /* * Username and Password */ i = indexOf(uri, "@"); if(i != -1) { j = indexOf(uri[0..i+1], ":"); if(j != -1) { _user = uri[0 .. j]; _password = uri[j+1 .. i]; } else { _user = uri[0 .. i]; } uri = uri[i+1 .. $]; } /* * Host and port */ i = indexOf(uri, "/"); if(i == -1) i = uri.length; j = indexOf(uri[0..i], ":"); if(j != -1) { _domain = uri[0..j]; _port = to!(ushort)(uri[j+1..i]); } else { _domain = uri[0..i]; } if ( _port != 0 && _scheme == Scheme.Unknown ) { GetDefaultScheme(); } else if ( _port == 0 && _scheme != Scheme.Unknown ) { GetDefaultPort(); } uri = uri[i .. $]; /* * Fragment */ i = indexOf(uri, "#"); if(i != -1) { _fragment = uri[i+1..$]; uri = uri[0..i]; } /* * Path and Query */ i = indexOf(uri, "?"); if(i != -1) { _rawquery = uri[i+1 .. $]; _path = uri[0 .. i]; ParseQuery(); } else _path = uri[0..$]; if ( _path == "" ) { _path = "/"; } } // TODO: Parse to Query void ParseQuery() { auto parts = split(_rawquery, "&"); foreach(part; parts) { auto i = indexOf(part, "="); _query.Add(QueryParam(part[0 .. i], part[i+1..$])); } } /** * Gets default scheme depending on port */ protected void GetDefaultScheme() { switch(_port) { case 80: case 8080: _scheme = Scheme.Http; break; case 443: _scheme = Scheme.Https; break; case 21: _scheme = Scheme.Ftp; break; case 990: _scheme = Scheme.Ftps; break; case 6667: _scheme = Scheme.Irc; break; case 25: _scheme = Scheme.Smtp; break; default: _scheme = Scheme.Unknown; break; } } /** * Gets default port depending on scheme */ protected void GetDefaultPort() { final switch (cast(string) _scheme) { case Scheme.Http: _port = 80; break; case Scheme.Https: _port = 443; break; case Scheme.Ftp: _port = 21; break; case Scheme.Ftps: _port = 990; break; case Scheme.Irc: _port = 6667; break; case Scheme.Smtp: _port = 25; break; } } /** * Resets Uri Data * * Example: * -------- * uri.parse("http://domain.com"); * assert(uri.domain == "domain.com"); * uri.reset; * assert(uri.domain == null); * -------- */ void Reset() { _scheme = Scheme.Unknown; _port = 0; _domain = null; _path = null; _rawquery = null; _query = UriQuery(); _user = null; _password = null; _fragment = null; } /** * Builds Uri string * * Returns: * Uri */ alias Build toString; /// ditto string Build() { string uri; uri ~= cast(string)_scheme ~ "://"; if(_user) { uri ~= _user; if(_password) uri ~= ":"~ _password; uri ~= "@"; } uri ~= _domain; if(_port != 0) uri ~= ":" ~ to!(string)(_port); uri ~= _path; if(_rawquery) uri ~= "?" ~ RawQuery(); if(_fragment) uri ~= "#" ~ Fragment(); return uri; } /** * Returns: Uri scheme */ @property Scheme Protocol() const { return _scheme; } /** * Returns: Uri domain */ @property string Domain() const { return _domain; } /// ditto alias Domain Host; /** * Returns: Uri port */ @property ushort Port() const { return _port; } @property Uri Port(ushort port_) { _port = port_; return this; } @property string RawUri() const { return _rawUri; } /** * Returns: Uri path */ @property string Path() const { return _path; } @property Uri Path(string path_) { _path = path_; return this; } /** * Returns: Uri query (raw) */ @property string RawQuery() const { return _rawquery; } @property UriQuery Query() const { return _query; } /** * Returns: Uri username */ @property string User() const { return _user; } @property Uri User(string username) { _user = username; return this; } /** * Returns: Uri password */ @property string Password() const { return _password; } @property Uri Password(string pass) { _password = pass; return this; } /** * Returns: Uri fragment */ @property string Fragment() const { return _fragment; } /** * Parses Uri and returns new Uri object * * Params: * uri = Uri to parse * port = Port * * Returns: * Uri * * Example: * -------- * auto uri = Uri.parseUri("http://domain.com", 80); * -------- */ static Uri ParseUri(string uri, ushort port) { return new Uri(uri, port); } /** * Parses Uri and returns new Uri object * * Params: * uri = Uri to parse * * Returns: * Uri * * Example: * -------- * auto uri = Uri.parseUri("http://domain.com"); * -------- */ static Uri ParseUri(string uri) { return new Uri(uri); } static string Encode(string uri) { return std.uri.encode(uri); } static string Decode(string uri) { return std.uri.decode(uri); } } unittest { auto uri = new Uri("http://user:pass@domain.com:80/path/a?q=query#fragment"); assert(uri.scheme() == uri.Http); assert(uri.scheme() == uri.Scheme.Http); assert(uri.scheme() == Uri.Scheme.Http); assert(uri.scheme() == Uri.Http); assert(uri.host == "domain.com"); assert(uri.port == 80); assert(uri.user == "user"); assert(uri.password == "pass"); assert(uri.path == "/path/a"); assert(uri.rawquery == "q=query"); assert(uri.query["q"] == "query"); assert(uri.fragment == "fragment"); uri.parse("http://google.com"); assert(uri.port() == 80); assert(uri.scheme() == uri.Http); uri.parse("google.com", 80); assert(uri.scheme() == uri.Http); uri.parse("google.com", 8080); assert(uri.scheme() == uri.Http); uri.parse("publicftp.com", 21); assert(uri.scheme() == uri.Ftp); uri.parse("ftp://google.com"); assert(uri.scheme() == uri.Ftp, uri.scheme); uri.parse("smtp://gmail.com"); assert(uri.scheme() == uri.Smtp); assert(uri.host() == "gmail.com"); uri.parse("http://google.com:666"); assert(uri.scheme() == uri.Http); assert(uri.port() == 666); assert(Uri.parseUri("http://google.com").scheme() == Uri.Http); UriQuery query = UriQuery(); query.add(QueryParam("key", "value")); query.add(QueryParam("key1" ,"value1")); assert(query.length() == 2); }
D
/Users/tpmccallum/SecondState/wasm-joey/apps/server_side_solarisation/target/release/build/log-caab69f8b23c55c7/build_script_build-caab69f8b23c55c7: /Users/tpmccallum/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.11/build.rs /Users/tpmccallum/SecondState/wasm-joey/apps/server_side_solarisation/target/release/build/log-caab69f8b23c55c7/build_script_build-caab69f8b23c55c7.d: /Users/tpmccallum/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.11/build.rs /Users/tpmccallum/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.11/build.rs:
D
// Copyright © 2011, Jakob Bornecrantz. All rights reserved. // See copyright notice in src/charge/charge.d (GPLv2 only). module miners.importer.info; import std.file : exists, DirEntry, listdir; import std.string : format, toString; import charge.util.vector; import charge.math.point3d; import miners.importer.folders; import lib.nbt.nbt; /** * Holds information about a single minecraft level. */ struct MinecraftLevelInfo { string name; /**< Level name */ string dir; /**< Directory holding this level */ bool beta; /**< Is this level a beta level */ bool nether; /**< Does this level have a nether directory */ Point3d spawn; /**< Spawn point */ } /** * Checks a Minecraft level. * * Returns null if no level.dat was found inside the directory. */ MinecraftLevelInfo* checkMinecraftLevel(string level) { auto region = format(level, "/region"); auto nether = format(level, "/DIM-1"); string name; Point3d spawn; if (!getInfoFromLevelDat(level, name, spawn)) return null; auto li = new MinecraftLevelInfo(); li.name = name; li.dir = level; li.spawn = spawn; if (exists(region)) li.beta = true; if (exists(nether)) li.nether = true; return li; } /** * Scan a directory for Minecraft worlds. * * If null or no argument given scans the guesstimated Minecraft save folder. * * Returns a array of MinecraftLevelInfo's. */ MinecraftLevelInfo[] scanForLevels(string dir = null) { VectorData!(MinecraftLevelInfo) levels; // If no directory given guesstimate the Minecraft save folder. if (dir is null) dir = getMinecraftSaveFolder(); // Called for each file/directory found in directory bool cb(DirEntry *de) { // Early out any files that are in the save directory if (!de.isdir) return true; // Check if the level is okay auto li = checkMinecraftLevel(de.name); if (li is null) return true; levels ~= *li; return true; } try { listdir(dir, &cb); } catch (Exception e) { return null; } return levels.adup; } /** * Gets information from a level.dat. */ private bool getInfoFromLevelDat(string level, out string name, out Point3d spawn) { auto dat = format(level, "/level.dat\0"); nbt_node *data; nbt_node *levelName; nbt_node *spwn; auto file = nbt_parse_path(dat.ptr); if (!file) return false; scope(exit) nbt_free(file); data = nbt_find_by_name(file, "Data"); if (!data) return false; levelName = nbt_find_by_name(data, "LevelName"); if (levelName && levelName.type == TAG_STRING) name = toString(levelName.tag_string).dup; // Need to dup spawn = Point3d(0, 64, 0); foreach(int i, n; ["SpawnX", "SpawnY", "SpawnZ"]) { spwn = nbt_find_by_name(data, n.ptr); if (!spwn || spwn.type != TAG_INT) continue; (&spawn.x)[i] = spwn.tag_int; } return true; }
D
module ast.template_; import token; import ast.astnode; import ast.attribute; import ast.symbol; import ast.expression; import ast.type; import visitor.visitor; final class TemplateInstance : Symbol { Token[][] params; TemplateDeclaration decl; /// template declaration /// parsed parameters Symbol[] syms; Expression[] exps; Type[] tps; this(Identifier id, Token[][] params) { super(SYMKind.instance, [], PRLV.undefined, STC.undefined, id); this.params = params; } override void accept(Visitor v) { v.visit(this); } } final class TemplateDeclaration : Symbol { this(Attribution[] attrbs, PRLV prlv, StorageClass stc, Identifier id) { super(SYMKind.template_, attrbs, prlv, stc, id); } override void accept(Visitor v) { v.visit(this); } }
D
import core.stdc.stdio, core.stdc.stdlib; struct MemoryPool(T, int MAX_BLOCK_BYTES = 1 << 17) { static assert(!is(T == class), "MemoryPool is designed for native data."); static assert(MAX_BLOCK_BYTES >= 1, "MemoryPool: MAX_BLOCK_BYTES must be >= 1 bytes."); static assert(MAX_BLOCK_BYTES >= T.sizeof, "MemoryPool: MAX_BLOCK_BYTES must be" ~ " bigger than a T."); static if (T.sizeof * 5 > MAX_BLOCK_BYTES) pragma(msg, "MemoryPool: Block is very small."); alias Block = T[MAX_BLOCK_BYTES / T.sizeof]; static __gshared Block*[] blocks; static __gshared T* nextFree, lastFree; static T* newItem() nothrow { if (nextFree >= lastFree) { blocks ~= cast(Block*)calloc(1, Block.sizeof); if (blocks[$ - 1] == null) exit(1); nextFree = blocks[$ - 1].ptr; lastFree = nextFree + Block.length; } return nextFree++; } // static void freeAll() nothrow { // foreach (blockPtr; blocks) // free(blockPtr); // blocks.length = 0; // nextFree = null; // lastFree = null; // } } struct Rec { // Tree node int length; Rec*[10] p; } __gshared int nNodes; __gshared Rec* rec_root; __gshared MemoryPool!Rec recPool; Rec* findRec(char* s, Rec* root) nothrow { int c; Rec* next; while (true) { c = *s; s++; if (!c) break; c -= '0'; next = root.p[c]; if (!next) { nNodes++; next = recPool.newItem; root.p[c] = next; } root = next; } return root; } void nextNum(char* s) nothrow @nogc { int[10] cnt; for (int i = 0; s[i]; i++) cnt[s[i] - '0']++; foreach_reverse (i; 0 .. 10) { if (!cnt[i]) continue; s += sprintf(s, "%d%c", cnt[i], i + '0'); } } int getLen(char* s, int depth) nothrow { auto r = findRec(s, rec_root); if (r.length > 0) return r.length; depth++; if (!r.length) r.length = -depth; else r.length += depth; nextNum(s); depth = 1 + getLen(s, depth); if (r.length <= 0) r.length = depth; return r.length; } void main() nothrow { enum MAXN = 1_000_000; int[100] longest; int nLongest, ml; char[32] buf; rec_root = recPool.newItem(); foreach (immutable i; 0 .. MAXN) { sprintf(buf.ptr, "%d", i); int l = getLen(buf.ptr, 0); if (l < ml) continue; if (l > ml) { nLongest = 0; ml = l; } longest[nLongest] = i; nLongest++; } printf("seq leng: %d\n\n", ml); foreach (immutable i; 0 .. nLongest) { sprintf(buf.ptr, "%d", longest[i]); // print len+1 so we know repeating starts from when foreach (immutable l; 0 .. ml + 1) { printf("%2d: %s\n", getLen(buf.ptr, 0), buf.ptr); nextNum(buf.ptr); } printf("\n"); } printf("Allocated %d Rec tree nodes.\n", nNodes); //recPool.freeAll; }
D
; Copyright (C) 2008 The Android Open Source Project ; ; 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. .source T_rsub_int_9.java .class public dot.junit.opcodes.rsub_int.d.T_rsub_int_9 .super java/lang/Object .method public <init>()V .limit regs 1 invoke-direct {v0}, java/lang/Object/<init>()V return-void .end method .method public run(D)I .limit regs 4 rsub-int v0, v2, 10 return v0 .end method
D
instance DIA_MiltenNW_EXIT(C_Info) { npc = PC_Mage_NW; nr = 999; condition = DIA_MiltenNW_EXIT_Condition; information = DIA_MiltenNW_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_MiltenNW_EXIT_Condition() { if(Kapitel < 3) { return TRUE; }; }; func void DIA_MiltenNW_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_MiltenNW_KAP3_EXIT(C_Info) { npc = PC_Mage_NW; nr = 999; condition = DIA_MiltenNW_KAP3_EXIT_Condition; information = DIA_MiltenNW_KAP3_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_MiltenNW_KAP3_EXIT_Condition() { if(Kapitel == 3) { return TRUE; }; }; func void DIA_MiltenNW_KAP3_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_MiltenNW_KAP3_Hello(C_Info) { npc = PC_Mage_NW; nr = 31; condition = DIA_MiltenNW_KAP3_Hello_Condition; information = DIA_MiltenNW_KAP3_Hello_Info; permanent = FALSE; important = TRUE; }; func int DIA_MiltenNW_KAP3_Hello_Condition() { if((hero.guild == GIL_PAL) || (hero.guild == GIL_DJG) || (hero.guild == GIL_KDW) || (hero.guild == GIL_KDM) || (hero.guild == GIL_TPL) || (hero.guild == GIL_GUR)) { return TRUE; }; }; func void DIA_MiltenNW_KAP3_Hello_Info() { if(hero.guild == GIL_PAL) { AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_00"); //Я не могу поверить в это. Ты действительно стал паладином? AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_01"); //Похоже на то. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_02"); //Если такие как ты становятся паладинами, то прихвостням Белиара нужно держать ухо востро. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_03"); //Какая-то горстка орков для тебя не проблема. AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_04"); //Проблема не только в орках. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_05"); //Я знаю, но все равно хорошо, что ты на нашей стороне. AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_06"); //Ну да. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_07"); //Что ты делаешь здесь, в монастыре? Дай я угадаю. Ты хочешь быть посвященным в искусство магии. AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_08"); //Возможно. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_09"); //Я знал это - лучше всего тебе поговорить с Мардуком, он отвечает за вас, паладинов. Ты найдешь его перед часовней. }; if(hero.guild == GIL_DJG) { AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_10"); //Я вижу, что слухи оказались правдой. AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_11"); //Какие слухи? AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_12"); //Что ты присоединился к охотникам за драконами. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_13"); //Ну, ты никогда не был человеком церкви. Тем не менее, ты сражаешься за наше общее дело, и только это имеет значение. AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_14"); //Это все? AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_15"); //Я рад, конечно, и судя по тому, как ты выглядишь, все орки должны бояться тебя. AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_16"); //Дело не только в орках. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_17"); //Я знаю, но, тем не менее, они доставляют проблемы. А ты важная птица. AI_Output(self,other,"DIA_MiltenNW_KAP3_Hello_03_18"); //Ты победил Спящего. Нам всем может понадобиться твоя помощь однажды. AI_Output(other,self,"DIA_MiltenNW_KAP3_Hello_15_19"); //Ох, ладно. }; }; instance DIA_MiltenNW_Pashal(C_Info) { npc = PC_Mage_NW; nr = 3; condition = DIA_MiltenNW_Pashal_Condition; information = DIA_MiltenNW_Pashal_Info; permanent = FALSE; description = "У меня к тебе один вопрос."; }; func int DIA_MiltenNW_Pashal_Condition() { if((MIS_PashalQuest == LOG_Running) && (PashalQuestMageStep == TRUE) && (PashalQuestCaveStep == FALSE)) { return TRUE; }; }; func void DIA_MiltenNW_Pashal_Info() { AI_Output(other,self,"DIA_MiltenOW_Pashal_01_00"); //У меня к тебе один вопрос. AI_Output(self,other,"DIA_MiltenOW_Pashal_01_01"); //Какой именно? AI_Output(other,self,"DIA_MiltenOW_Pashal_01_02"); //Ты что-нибудь слышал о неком магическом артефакте, который вобрал в себя всю силу этого мира? AI_Output(self,other,"DIA_MiltenOW_Pashal_01_03"); //Хммм...(задумчиво) Да! Я что-то припоминаю...помойму мастер Корристо однажды упоминал о таком. AI_Output(self,other,"DIA_MiltenOW_Pashal_01_04"); //В его планах было даже использование этого артефакта для того, чтобы разрушить магический барьер! AI_Output(self,other,"DIA_MiltenOW_Pashal_01_05"); //Но поскольку артефакт так и не был найден, то все это осталось лишь на словах. AI_Output(other,self,"DIA_MiltenOW_Pashal_01_06"); //А что вы конкретно предприняли? AI_Output(self,other,"DIA_MiltenOW_Pashal_01_07"); //Насколько я знаю, Корристо послал одного из магов на его поиски. AI_Output(self,other,"DIA_MiltenOW_Pashal_01_08"); //Но тот так и не вернулся! Больше попыток его отыскать не предпринималось. AI_Output(other,self,"DIA_MiltenOW_Pashal_01_09"); //Ясно. PashalQuestCaveStep = TRUE; PashalQuestCaveStepIns = TRUE; B_LogEntry(TOPIC_PashalQuest,"Милтен рассказал мне о том, что Маги Огня пытались найти этот артефакт и даже отправили на поиски одного из Магов. Но у них ничего не вышло, а тот маг вообще пропал."); }; instance DIA_MiltenNW_Monastery(C_Info) { npc = PC_Mage_NW; nr = 35; condition = DIA_MiltenNW_Monastery_Condition; information = DIA_MiltenNW_Monastery_Info; permanent = FALSE; description = "Как ты смог добраться до монастыря так быстро?"; }; func int DIA_MiltenNW_Monastery_Condition() { if(Kapitel == 3) { return TRUE; }; }; func void DIA_MiltenNW_Monastery_Info() { AI_Output(other,self,"DIA_MiltenNW_Monastery_15_00"); //Как ты смог добраться до монастыря так быстро? AI_Output(self,other,"DIA_MiltenNW_Monastery_03_01"); //Откуда такой вопрос? Я проскользнул через Проход и направился прямо в монастырь. AI_Output(self,other,"DIA_MiltenNW_Monastery_03_02"); //Должен признать, что это было непросто - уйти от всех монстров, что поселились по эту сторону от долины, но проблем оказалось все же меньше, чем я ожидал. }; instance DIA_MiltenNW_FourFriends(C_Info) { npc = PC_Mage_NW; nr = 35; condition = DIA_MiltenNW_FourFriends_Condition; information = DIA_MiltenNW_FourFriends_Info; permanent = FALSE; description = "Ты знаешь, где остальные?"; }; func int DIA_MiltenNW_FourFriends_Condition() { if(Kapitel == 3) { return TRUE; }; }; func void DIA_MiltenNW_FourFriends_Info() { AI_Output(other,self,"DIA_MiltenNW_FourFriends_15_00"); //Ты знаешь, где остальные? if(Npc_IsDead(PC_Fighter_NW_vor_DJG) == FALSE) { AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_01"); //Горн, похоже, ничуть не изменился после заключения в тюрьме Гаронда. if(MIS_RescueGorn != LOG_SUCCESS) { AI_Output(other,self,"DIA_MiltenNW_FourFriends_15_02"); //Как ему удалось выбраться? AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_03"); //Мне пришлось солгать Гаронду, так что он снял все обвинения. AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_04"); //Но это только между нами, понятно? }; AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_05"); //В любом случае он хотел отправиться к Ли и посмотреть, что происходит на ферме. AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_06"); //После голодания в темнице, он, вероятно, сейчас пытается восполнить потерю в весе и испытывает на прочность кладовку наемников. } else { AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_07"); //Горн не виноват. }; if(Npc_IsDead(PC_Thief_NW) == FALSE) { AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_08"); //Диего бормотал что-то о расплате. Но я понятия не имею, что он хотел сказать этим. AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_09"); //Но я подозреваю, что он сейчас в городе. Ты знаешь его - он всегда там, где можно поживиться. } else { AI_Output(self,other,"DIA_MiltenNW_FourFriends_03_10"); //Диего выкупил Горна - похоже, что Барьер изменил и его. }; }; instance DIA_MiltenNW_KAP3_Entry(C_Info) { npc = PC_Mage_NW; nr = 32; condition = DIA_MiltenNW_KAP3_Entry_Condition; information = DIA_MiltenNW_KAP3_Entry_Info; permanent = TRUE; description = "Мне нужно попасть в монастырь. Это срочно!"; }; func int DIA_MiltenNW_KAP3_Entry_Condition() { if((Kapitel == 3) && (hero.guild != GIL_KDF) && (MiltenNW_GivesMonasteryKey == FALSE) && !Npc_HasItems(other,ItKe_Innos_MIS)) { return TRUE; }; }; func void DIA_MiltenNW_KAP3_Entry_Info() { AI_Output(other,self,"DIA_MiltenNW_KAP3_Entry_15_00"); //Мне нужно попасть в монастырь. Это срочно! if(hero.guild == GIL_PAL) { AI_Output(self,other,"DIA_MiltenNW_KAP3_Entry_03_01"); //Да, конечно! Вот ключ. CreateInvItems(self,ItKe_Innos_MIS,1); B_GiveInvItems(self,other,ItKe_Innos_MIS,1); MiltenNW_GivesMonasteryKey = TRUE; CanEnterKloster = TRUE; } else { AI_Output(self,other,"DIA_MiltenNW_KAP3_Entry_03_02"); //Я не могу пустить тебя в монастырь. У меня будут проблемы с Высшим Советом. AI_Output(self,other,"DIA_MiltenNW_KAP3_Entry_03_03"); //Без разрешения верховных магов, я никого не могу пустить в монастырь. Info_ClearChoices(DIA_MiltenNW_KAP3_Entry); Info_AddChoice(DIA_MiltenNW_KAP3_Entry,Dialog_Back,DIA_MiltenNW_KAP3_Entry_BACK); Info_AddChoice(DIA_MiltenNW_KAP3_Entry,"Это очень важно!",DIA_MiltenNW_KAP3_Entry_Important); if(Npc_HasItems(other,ItWr_PermissionToWearInnosEye_MIS) >= 1) { Info_AddChoice(DIA_MiltenNW_KAP3_Entry,"У меня есть письмо от лорда Хагена.",DIA_MiltenNW_KAP3_Entry_Permit); }; }; }; func void DIA_MiltenNW_KAP3_Entry_BACK() { Info_ClearChoices(DIA_MiltenNW_KAP3_Entry); }; func void DIA_MiltenNW_KAP3_Entry_Important() { AI_Output(other,self,"DIA_MiltenNW_KAP3_Entry_Important_15_00"); //Но это важно! AI_Output(self,other,"DIA_MiltenNW_KAP3_Entry_Important_03_01"); //Это не поможет. Пирокар оторвет мне голову за это. Info_ClearChoices(DIA_MiltenNW_KAP3_Entry); }; func void DIA_MiltenNW_KAP3_Entry_Permit() { AI_Output(other,self,"DIA_MiltenNW_KAP3_Entry_Permit_15_00"); //У меня есть письмо от лорда Хагена. AI_Output(self,other,"DIA_MiltenNW_KAP3_Entry_Permit_03_01"); //Покажи. B_GiveInvItems(other,self,ItWr_PermissionToWearInnosEye_MIS,1); B_UseFakeScroll(); AI_Output(self,other,"DIA_MiltenNW_KAP3_Entry_Permit_03_02"); //(колеблясь) Хорошо. Вот ключ от монастыря. Ты найдешь Пирокара в церкви. CreateInvItems(self,ItKe_Innos_MIS,1); B_GiveInvItems(self,other,ItKe_Innos_MIS,1); B_GiveInvItems(self,other,ItWr_PermissionToWearInnosEye_MIS,1); MiltenNW_GivesMonasteryKey = TRUE; CanEnterKloster = TRUE; Info_ClearChoices(DIA_MiltenNW_KAP3_Entry); }; instance DIA_MiltenNW_KAP3_NovizenChase(C_Info) { npc = PC_Mage_NW; nr = 31; condition = DIA_MiltenNW_KAP3_NovizenChase_Condition; information = DIA_MiltenNW_KAP3_NovizenChase_Info; permanent = FALSE; description = "Ты знаешь, где Педро?"; }; func int DIA_MiltenNW_KAP3_NovizenChase_Condition() { if((Kapitel == 3) && (MIS_NovizenChase == LOG_Running) && (MIS_SCKnowsInnosEyeIsBroken == FALSE)) { return TRUE; }; }; func void DIA_MiltenNW_KAP3_NovizenChase_Info() { AI_Output(other,self,"DIA_MiltenNW_KAP3_NovizenChase_15_00"); //Ты знаешь, где Педро? AI_Output(self,other,"DIA_MiltenNW_KAP3_NovizenChase_03_01"); //Ты думаешь, я стоял бы здесь, если бы я знал, где скрывается этот предатель? AI_Output(self,other,"DIA_MiltenNW_KAP3_NovizenChase_03_02"); //Он должен заплатить за то, что сделал. Я надеюсь, нам удастся вернуть Глаз. AI_Output(self,other,"DIA_MiltenNW_KAP3_NovizenChase_03_03"); //Ты должен помочь нам. Найди его и принеси назад Глаз Инноса. }; instance DIA_MiltenNW_KAP3_Perm(C_Info) { npc = PC_Mage_NW; nr = 39; condition = DIA_MiltenNW_KAP3_Perm_Condition; information = DIA_MiltenNW_KAP3_Perm_Info; permanent = FALSE; description = "Ты знаешь, что-нибудь о людях в черных рясах?"; }; func int DIA_MiltenNW_KAP3_Perm_Condition() { if(Kapitel == 3) { return TRUE; }; }; func void DIA_MiltenNW_KAP3_Perm_Info() { AI_Output(other,self,"DIA_MiltenNW_KAP3_Perm_15_00"); //Ты знаешь, что-нибудь о людях в черных рясах? AI_Output(self,other,"DIA_MiltenNW_KAP3_Perm_03_01"); //Нет, но у меня плохое предчувствие насчет них. AI_Output(self,other,"DIA_MiltenNW_KAP3_Perm_03_02"); //Будь осторожен, если наткнешься на них. }; instance DIA_MiltenNW_KAP4_EXIT(C_Info) { npc = PC_Mage_NW; nr = 999; condition = DIA_MiltenNW_KAP4_EXIT_Condition; information = DIA_MiltenNW_KAP4_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_MiltenNW_KAP4_EXIT_Condition() { if(Kapitel == 4) { return TRUE; }; }; func void DIA_MiltenNW_KAP4_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_MILTENNW_BEFOREDRAGONS(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_beforedragons_condition; information = dia_miltennw_beforedragons_info; permanent = FALSE; important = TRUE; }; func int dia_miltennw_beforedragons_condition() { if((Kapitel == 4) && (MIS_RitualInnosEyeRepair == LOG_SUCCESS) && (MIS_AllDragonsDead == FALSE) && (Npc_HasItems(self,itke_miltenkey_nw) > 0)) { return TRUE; }; }; func void dia_miltennw_beforedragons_info() { AI_Output(self,other,"DIA_MiltenNW_BeforeDragons_03_00"); //Идешь на драконов? AI_Output(other,self,"DIA_MiltenNW_BeforeDragons_15_01"); //Что-то вроде того. AI_Output(self,other,"DIA_MiltenNW_BeforeDragons_03_02"); //Возьми это ключ от сундука в часовне замка. AI_Output(self,other,"DIA_MiltenNW_BeforeDragons_03_03"); //Думаю, он мне больше не пригодится. Полезного там немного, но больше мне помочь нечем. B_GiveInvItems(self,other,itke_miltenkey_nw,1); AI_StopProcessInfos(self); }; instance DIA_MiltenNW_KAP4_PERM(C_Info) { npc = PC_Mage_NW; nr = 49; condition = DIA_MiltenNW_KAP4_PERM_Condition; information = DIA_MiltenNW_KAP4_PERM_Info; permanent = TRUE; description = "Есть новости?"; }; func int DIA_MiltenNW_KAP4_PERM_Condition() { if(Kapitel == 4) { return TRUE; }; }; func void DIA_MiltenNW_KAP4_PERM_Info() { AI_Output(other,self,"DIA_MiltenNW_KAP4_PERM_15_00"); //Есть новости? AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_01"); //Это я должен тебя спрашивать. Мы все здесь очень обеспокоены. AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_02"); //Высший Совет пытается предугадать следующий ход врага. AI_Output(other,self,"DIA_MiltenNW_KAP4_PERM_15_03"); //Что-нибудь еще? if(hero.guild == GIL_PAL) { AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_04"); //Последнее время все больше сообщений о нападении орков, даже за пределами Долины Рудников. AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_05"); //Мне это все не нравится - я не думаю, что у нас осталось много времени. } else if(hero.guild == GIL_DJG) { AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_06"); //Фермер сообщил о появлении чешуйчатых существ у его фермы. AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_07"); //Я не знаю, что все это значит, но я думаю, что враг что-то задумал. } else if(MIS_FindTheObesessed == LOG_Running) { AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_08"); //Мы получаем все больше сообщений об одержимых людях. Враг стал силен, значительно сильнее, чем я ожидал. } else { AI_Output(self,other,"DIA_MiltenNW_KAP4_PERM_03_09"); //Нет, ситуация все еще очень серьезная. Все, что нам остается, - это верить в Инноса. }; }; instance DIA_MiltenNW_KAP5_EXIT(C_Info) { npc = PC_Mage_NW; nr = 999; condition = DIA_MiltenNW_KAP5_EXIT_Condition; information = DIA_MiltenNW_KAP5_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_MiltenNW_KAP5_EXIT_Condition() { if(Kapitel == 5) { return TRUE; }; }; func void DIA_MiltenNW_KAP5_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_MiltenNW_AllDragonsDead(C_Info) { npc = PC_Mage_NW; nr = 900; condition = DIA_MiltenNW_AllDragonsDead_Condition; information = DIA_MiltenNW_AllDragonsDead_Info; permanent = FALSE; description = "Я убил всех драконов."; }; func int DIA_MiltenNW_AllDragonsDead_Condition() { if(Kapitel == 5) { return TRUE; }; }; func void DIA_MiltenNW_AllDragonsDead_Info() { AI_Output(other,self,"DIA_MiltenNW_AllDragonsDead_15_00"); //Я убил всех драконов. AI_Output(self,other,"DIA_MiltenNW_AllDragonsDead_03_01"); //Правда? Значит, есть еще проблеск надежды на горизонте. Теперь все, что нам остается, - это отрубить голову Злу. AI_Output(self,other,"DIA_MiltenNW_AllDragonsDead_03_02"); //Если ты действительно сделал это, мы обязательно победим в этой войне. AI_Output(other,self,"DIA_MiltenNW_AllDragonsDead_15_03"); //Кому, мне? AI_Output(self,other,"DIA_MiltenNW_AllDragonsDead_03_04"); //Тебе, конечно же. Кому же еще? if(MiltenNW_IsOnBoard == LOG_SUCCESS) { AI_Output(self,other,"DIA_MiltenNW_AllDragonsDead_03_05"); //Мы должны выступать как можно скорее, иначе может стать слишком поздно. }; }; instance DIA_MiltenNW_KnowWhereEnemy(C_Info) { npc = PC_Mage_NW; nr = 55; condition = DIA_MiltenNW_KnowWhereEnemy_Condition; information = DIA_MiltenNW_KnowWhereEnemy_Info; permanent = TRUE; description = "Я знаю, где скрывается враг."; }; func int DIA_MiltenNW_KnowWhereEnemy_Condition() { if((MIS_SCKnowsWayToIrdorath == TRUE) && (MiltenNW_IsOnBoard == FALSE) && (CAPITANORDERDIAWAY == FALSE) && (SCGotCaptain == TRUE)) { return TRUE; }; }; var int SCToldMiltenHeKnowWhereEnemy; func void DIA_MiltenNW_KnowWhereEnemy_Info() { AI_Output(other,self,"DIA_MiltenNW_KnowWhereEnemy_15_00"); //Я знаю, где скрывается враг. На небольшом острове, недалеко отсюда. AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_03_01"); //Это наш шанс. Мы должны отправляться туда немедленно и уничтожить зло раз и навсегда. SCToldMiltenHeKnowWhereEnemy = TRUE; Log_CreateTopic(Topic_Crew,LOG_MISSION); Log_SetTopicStatus(Topic_Crew,LOG_Running); if(Npc_IsDead(DiegoNW) == FALSE) { AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_03_02"); //Ты говорил с Диего? Я думаю, он согласится присоединиться к тебе. B_LogEntry(Topic_Crew,"Диего может оказаться полезным. Он никогда подолгу не задерживается на одном месте."); }; if(Npc_IsDead(GornNW_nach_DJG) == FALSE) { AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_03_03"); //А что насчет Горна? Поговори с ним. Я слышал, он вернулся из Долины Рудников. B_LogEntry(Topic_Crew,"Горн, определенно, может оказаться полезным. Никогда не помешает иметь на своей стороне такого закаленного бойца. Возможно, он сможет тренировать меня."); }; if(Npc_IsDead(Lester) == FALSE) { AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_03_04"); //И не забудь Лестера. Если ты не вытащишь его из долины, он сгниет там. B_LogEntry(Topic_Crew,"Если я не возьму Лестера с собой, ему никогда не выбраться из этой долины."); }; AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_03_05"); //Я также вижу свою роль во всем этом. Я могу повысить твою ману и помочь в создании рун. Когда мы приступим? B_LogEntry(Topic_Crew,"Если Милтен отправится в путь со мной, он может научить меня создавать руны и повысить мою ману."); if(Crewmember_Count >= Max_Crew) { AI_Output(other,self,"DIA_MiltenNW_KnowWhereEnemy_15_06"); //Не так быстро, у меня уже достаточно людей. AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_03_07"); //Ты знаешь, я всегда готов пойти с тобой. Если передумаешь, только скажи. AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_03_08"); //Удачи, да не оставит тебя Иннос без своей защиты. } else { Info_ClearChoices(DIA_MiltenNW_KnowWhereEnemy); Info_AddChoice(DIA_MiltenNW_KnowWhereEnemy,"Сейчас я не могу найти тебе место.",DIA_MiltenNW_KnowWhereEnemy_No); Info_AddChoice(DIA_MiltenNW_KnowWhereEnemy,"Добро пожаловать на борт!",DIA_MiltenNW_KnowWhereEnemy_Yes); }; }; func void DIA_MiltenNW_KnowWhereEnemy_Yes() { AI_Output(other,self,"DIA_MiltenNW_KnowWhereEnemy_Yes_15_00"); //Добро пожаловать на борт! AI_Output(other,self,"DIA_MiltenNW_KnowWhereEnemy_Yes_15_01"); //Лучше всего нам встретиться в порту. Жди меня там. AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_Yes_03_02"); //Хорошо, если у тебя все уже готово, я буду там MiltenNW_IsOnBoard = LOG_SUCCESS; B_GivePlayerXP(XP_Crewmember_Success); Crewmember_Count = Crewmember_Count + 1; if(MIS_ReadyforChapter6 == TRUE) { Npc_ExchangeRoutine(self,"SHIP"); } else { Npc_ExchangeRoutine(self,"WAITFORSHIP"); }; Info_ClearChoices(DIA_MiltenNW_KnowWhereEnemy); }; func void DIA_MiltenNW_KnowWhereEnemy_No() { AI_Output(other,self,"DIA_MiltenNW_KnowWhereEnemy_No_15_00"); //Сейчас я не могу найти тебе место. AI_Output(self,other,"DIA_MiltenNW_KnowWhereEnemy_No_03_01"); //Ты знаешь, что я готов идти с тобой до конца. Если передумаешь, только скажи. MiltenNW_IsOnBoard = LOG_OBSOLETE; Info_ClearChoices(DIA_MiltenNW_KnowWhereEnemy); }; instance DIA_MiltenNW_WhereCaptain(C_Info) { npc = PC_Mage_NW; nr = 3; condition = DIA_MiltenNW_WhereCaptain_Condition; information = DIA_MiltenNW_WhereCaptain_Info; description = "Где мне найти капитана?"; }; func int DIA_MiltenNW_WhereCaptain_Condition() { if((MIS_SCKnowsWayToIrdorath == TRUE) && (SCToldMiltenHeKnowWhereEnemy == TRUE) && (SCGotCaptain == FALSE)) { return TRUE; }; }; func void DIA_MiltenNW_WhereCaptain_Info() { AI_Output(other,self,"DIA_MiltenNW_WhereCaptain_15_00"); //Где мне найти капитана? AI_Output(self,other,"DIA_MiltenNW_WhereCaptain_03_01"); //Спроси Йоргена. Он ведь моряк. Он, должно быть, все еще в монастыре. AI_Output(self,other,"DIA_MiltenNW_WhereCaptain_03_02"); //Но если он не сможет помочь, попробуй поспрашивать на фермах или в городе, может быть, найдется человек, способный управлять твоим кораблем. AI_Output(self,other,"DIA_MiltenNW_WhereCaptain_03_03"); //Лучше всего поговорить с Ли или поспрашивать в гавани Хориниса. Больше ничего сейчас мне в голову не приходит. Log_CreateTopic(Topic_Captain,LOG_MISSION); Log_SetTopicStatus(Topic_Captain,LOG_Running); B_LogEntry(Topic_Captain,"Возможно, стоит взять с собой Йоргена в качестве капитана. Он все еще должен быть в монастыре. Хотя, кроме него есть и другие кандидаты на фермах и в городе. Возможно, мне стоит поговорить с Ли или поспрашивать в гавани."); }; instance DIA_MiltenNW_LeaveMyShip(C_Info) { npc = PC_Mage_NW; nr = 55; condition = DIA_MiltenNW_LeaveMyShip_Condition; information = DIA_MiltenNW_LeaveMyShip_Info; permanent = TRUE; description = "Я не могу взять тебя с собой."; }; func int DIA_MiltenNW_LeaveMyShip_Condition() { if((MiltenNW_IsOnBoard == LOG_SUCCESS) && (MIS_ReadyforChapter6 == FALSE)) { return TRUE; }; }; func void DIA_MiltenNW_LeaveMyShip_Info() { AI_Output(other,self,"DIA_MiltenNW_LeaveMyShip_15_00"); //Я не могу взять тебя с собой. AI_Output(self,other,"DIA_MiltenNW_LeaveMyShip_03_01"); //Ты лучше знаешь, кто тебе нужен. Если передумаешь, я буду ждать тебя в монастыре. MiltenNW_IsOnBoard = LOG_OBSOLETE; Crewmember_Count = Crewmember_Count - 1; Npc_ExchangeRoutine(self,"ShipOff"); }; instance DIA_MiltenNW_StillNeedYou(C_Info) { npc = PC_Mage_NW; nr = 55; condition = DIA_MiltenNW_StillNeedYou_Condition; information = DIA_MiltenNW_StillNeedYou_Info; permanent = TRUE; description = "Ты нужен мне."; }; func int DIA_MiltenNW_StillNeedYou_Condition() { if((MiltenNW_IsOnBoard == LOG_OBSOLETE) && (Crewmember_Count < Max_Crew) && (CAPITANORDERDIAWAY == FALSE)) { return TRUE; }; }; func void DIA_MiltenNW_StillNeedYou_Info() { AI_Output(other,self,"DIA_MiltenNW_StillNeedYou_15_00"); //Ты мне нужен. AI_Output(self,other,"DIA_MiltenNW_StillNeedYou_03_01"); //Я раду твоему решению. Вперед, нам нельзя терять время. AI_Output(self,other,"DIA_MiltenNW_StillNeedYou_03_02"); //Я уже иду уже в порт. Встречаемся там. MiltenNW_IsOnBoard = LOG_SUCCESS; Crewmember_Count = Crewmember_Count + 1; if(MIS_ReadyforChapter6 == TRUE) { Npc_ExchangeRoutine(self,"SHIP"); } else { Npc_ExchangeRoutine(self,"WAITFORSHIP"); }; AI_StopProcessInfos(self); }; instance DIA_MiltenNW_Teach(C_Info) { npc = PC_Mage_NW; nr = 90; condition = DIA_MiltenNW_Teach_Condition; information = DIA_MiltenNW_Teach_Info; permanent = TRUE; description = "Я хочу изучить новые заклинания."; }; func int DIA_MiltenNW_Teach_Condition() { if(other.guild == GIL_KDF) { return TRUE; }; }; func void DIA_MiltenNW_Teach_Info() { AI_Output(other,self,"DIA_MiltenNW_Teach_15_00"); //Я хочу изучить кое-какие заклинания. if(Npc_GetTalentSkill(other,NPC_TALENT_MAGE) >= 2) { Info_ClearChoices(DIA_MiltenNW_Teach); Info_AddChoice(DIA_MiltenNW_Teach,Dialog_Back,DIA_MiltenNW_Teach_BACK); if(PLAYER_TALENT_RUNES[SPL_InstantFireball] == FALSE) { Info_AddChoice(DIA_MiltenNW_Teach,b_buildlearnstringforrunes(NAME_SPL_InstantFireball,B_GetLearnCostTalent(other,NPC_TALENT_RUNES,SPL_InstantFireball)),DIA_MiltenNW_Teach_Feuerball); }; if((PLAYER_TALENT_RUNES[SPL_RapidFirebolt] == FALSE) && (LegoSpells == TRUE)) { Info_AddChoice(DIA_MiltenNW_Teach,b_buildlearnstringforrunes(NAME_SPL_RapidFirebolt,B_GetLearnCostTalent(other,NPC_TALENT_RUNES,SPL_RapidFirebolt)),DIA_MiltenNW_Teach_RapidFirebolt); }; } else { AI_Output(self,other,"DIA_MiltenNW_Teach_03_01"); //Ты все еще не достиг второго круга магии. Я ничему не могу научить тебя. }; }; func void DIA_MiltenNW_Teach_BACK() { Info_ClearChoices(DIA_MiltenNW_Teach); }; func void DIA_MiltenNW_Teach_Feuerball() { B_TeachPlayerTalentRunes(self,other,SPL_InstantFireball); }; func void DIA_MiltenNW_Teach_RapidFirebolt() { B_TeachPlayerTalentRunes(self,other,SPL_RapidFirebolt); }; instance DIA_MiltenNW_Mana(C_Info) { npc = PC_Mage_NW; nr = 100; condition = DIA_MiltenNW_Mana_Condition; information = DIA_MiltenNW_Mana_Info; permanent = TRUE; description = "Я хочу повысить мои магические способности."; }; func int DIA_MiltenNW_Mana_Condition() { if(other.guild == GIL_KDF) { return TRUE; }; }; func void DIA_MiltenNW_Mana_Info() { AI_Output(other,self,"DIA_MiltenNW_Mana_15_00"); //Я хочу повысить свои магические способности. Info_ClearChoices(DIA_MiltenNW_Mana); Info_AddChoice(DIA_MiltenNW_Mana,Dialog_Back,DIA_MiltenNW_Mana_BACK); Info_AddChoice(DIA_MiltenNW_Mana,b_buildlearnstringforskills(PRINT_LearnMANA1,B_GetLearnCostAttribute(other,ATR_MANA_MAX)),DIA_MiltenNW_Mana_1); Info_AddChoice(DIA_MiltenNW_Mana,b_buildlearnstringforskills(PRINT_LearnMANA5,B_GetLearnCostAttribute(other,ATR_MANA_MAX) * 5),DIA_MiltenNW_Mana_5); }; func void DIA_MiltenNW_Mana_BACK() { if(other.attribute[ATR_MANA_MAX] >= T_MAX) { AI_Output(self,other,"DIA_MiltenNW_Mana_03_00"); //Твоя магическая энергия велика. Слишком велика, чтобы я мог увеличить ее. }; Info_ClearChoices(DIA_MiltenNW_Mana); }; func void DIA_MiltenNW_Mana_1() { B_TeachAttributePoints(self,other,ATR_MANA_MAX,1,T_MAX); Info_ClearChoices(DIA_MiltenNW_Mana); Info_AddChoice(DIA_MiltenNW_Mana,Dialog_Back,DIA_MiltenNW_Mana_BACK); Info_AddChoice(DIA_MiltenNW_Mana,b_buildlearnstringforskills(PRINT_LearnMANA1,B_GetLearnCostAttribute(other,ATR_MANA_MAX)),DIA_MiltenNW_Mana_1); Info_AddChoice(DIA_MiltenNW_Mana,b_buildlearnstringforskills(PRINT_LearnMANA5,B_GetLearnCostAttribute(other,ATR_MANA_MAX) * 5),DIA_MiltenNW_Mana_5); }; func void DIA_MiltenNW_Mana_5() { B_TeachAttributePoints(self,other,ATR_MANA_MAX,5,T_MAX); Info_ClearChoices(DIA_MiltenNW_Mana); Info_AddChoice(DIA_MiltenNW_Mana,Dialog_Back,DIA_MiltenNW_Mana_BACK); Info_AddChoice(DIA_MiltenNW_Mana,b_buildlearnstringforskills(PRINT_LearnMANA1,B_GetLearnCostAttribute(other,ATR_MANA_MAX)),DIA_MiltenNW_Mana_1); Info_AddChoice(DIA_MiltenNW_Mana,b_buildlearnstringforskills(PRINT_LearnMANA5,B_GetLearnCostAttribute(other,ATR_MANA_MAX) * 5),DIA_MiltenNW_Mana_5); }; instance DIA_MILTENNW_CASSIA(C_Info) { npc = PC_Mage_NW; nr = 40; condition = dia_miltennw_cassia_condition; information = dia_miltennw_cassia_info; permanent = FALSE; description = "А ты не знаешь случайно..."; }; func int dia_miltennw_cassia_condition() { if((MIS_CASSIAGOLDCUP == LOG_Running) && (MILTENSAYABOUTOCKEY == FALSE) && (Npc_HasItems(other,ItKe_OC_Store) == 0) && (CAPITANORDERDIAWAY == FALSE)) { return TRUE; }; }; func void dia_miltennw_cassia_info() { AI_Output(other,self,"DIA_MiltenNW_Cassia_15_00"); //А ты не знаешь случайно, у кого ключ от склада паладинов в замке? AI_Output(self,other,"DIA_MiltenNW_Cassia_03_01"); //Что ты задумал, разбойник? Впрочем, тебе не повезло. AI_Output(self,other,"DIA_MiltenNW_Cassia_03_02"); //В один прекрасный день Энгор вылез из своей конуры подышать свежим воздухом и где-то его посеял. AI_Output(self,other,"DIA_MiltenNW_Cassia_03_03"); //Думаю, что Гаронд рано или поздно прикажет сломать дверь и заставит Энгора ее чинить. B_LogEntry(TOPIC_CASSIAGOLDCUP,"Энгор потерял ключ склада паладинов, выбравшись подышать свежим воздухом."); MILTENSAYABOUTOCKEY = TRUE; }; instance DIA_Mage_NW_PICKPOCKET(C_Info) { npc = PC_Mage_NW; nr = 900; condition = DIA_Mage_NW_PICKPOCKET_Condition; information = DIA_Mage_NW_PICKPOCKET_Info; permanent = TRUE; description = PICKPOCKET_COMM; }; func int DIA_Mage_NW_PICKPOCKET_Condition() { return C_Beklauen(56,75); }; func void DIA_Mage_NW_PICKPOCKET_Info() { Info_ClearChoices(DIA_Mage_NW_PICKPOCKET); Info_AddChoice(DIA_Mage_NW_PICKPOCKET,Dialog_Back,DIA_Mage_NW_PICKPOCKET_BACK); Info_AddChoice(DIA_Mage_NW_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Mage_NW_PICKPOCKET_DoIt); }; func void DIA_Mage_NW_PICKPOCKET_DoIt() { B_Beklauen(); Info_ClearChoices(DIA_Mage_NW_PICKPOCKET); }; func void DIA_Mage_NW_PICKPOCKET_BACK() { Info_ClearChoices(DIA_Mage_NW_PICKPOCKET); }; instance DIA_MILTENNW_KAP6_EXIT(C_Info) { npc = PC_Mage_NW; nr = 999; condition = dia_miltennw_kap6_exit_condition; information = dia_miltennw_kap6_exit_info; permanent = TRUE; description = Dialog_Ende; }; func int dia_miltennw_kap6_exit_condition() { if(Kapitel >= 6) { return TRUE; }; }; func void dia_miltennw_kap6_exit_info() { AI_StopProcessInfos(self); }; instance DIA_MILTENNW_SOONBATTLE(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_soonbattle_condition; information = dia_miltennw_soonbattle_info; permanent = FALSE; description = "Ты в курсе того, что случилось?"; }; func int dia_miltennw_soonbattle_condition() { if((KAPITELORCATC == TRUE) && (STOPBIGBATTLE == FALSE)) { return TRUE; }; }; func void dia_miltennw_soonbattle_info() { AI_Output(other,self,"DIA_MiltenNW_SoonBattle_01_00"); //Ты в курсе того, что случилось? AI_Output(self,other,"DIA_MiltenNW_SoonBattle_01_01"); //Да. Пирокар обо всем мне уже рассказал. И, по правде говоря, я этому нисколько не удивлен. AI_Output(self,other,"DIA_MiltenNW_SoonBattle_01_02"); //Я знал, что рано или поздно орки пожалуют сюда, и всегда был готов к этому. AI_Output(self,other,"DIA_MiltenNW_SoonBattle_01_03"); //Но сейчас я пребываю в полной растерянности. AI_Output(other,self,"DIA_MiltenNW_SoonBattle_01_04"); //Не волнуйся! Мы что-нибудь придумаем. }; instance DIA_MILTENNW_SOONBATTLENOW(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_soonbattlenow_condition; information = dia_miltennw_soonbattlenow_info; permanent = FALSE; description = "Паладинам понадобится ваша помощь."; }; func int dia_miltennw_soonbattlenow_condition() { if((KAPITELORCATC == TRUE) && (KDF_JOINHAGEN == TRUE) && (STOPBIGBATTLE == FALSE)) { return TRUE; }; }; func void dia_miltennw_soonbattlenow_info() { AI_Output(other,self,"DIA_MiltenNW_SoonBattleNow_01_00"); //Паладинам понадобится ваша помощь. AI_Output(self,other,"DIA_MiltenNW_SoonBattleNow_01_01"); //Не волнуйся. Я знаю об этом. AI_Output(self,other,"DIA_MiltenNW_SoonBattleNow_01_02"); //И сделаю все, что только в моих силах на благо их победы. }; instance DIA_MILTENNW_BATTLEWIN(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_battlewin_condition; information = dia_miltennw_battlewin_info; permanent = FALSE; description = "Наш враг побежден!"; }; func int dia_miltennw_battlewin_condition() { if((STOPBIGBATTLE == TRUE) && (HUMANSWINSBB == TRUE) && (ALLGREATVICTORY == FALSE)) { return TRUE; }; }; func void dia_miltennw_battlewin_info() { B_GivePlayerXP(200); AI_Output(other,self,"DIA_MiltenNW_BattleWin_01_00"); //Наш враг побежден! AI_Output(self,other,"DIA_MiltenNW_BattleWin_01_01"); //И я крайне рад этому! Теперь нам всем будет куда проще. if(MONASTERYISFREE == FALSE) { AI_Output(self,other,"DIA_MiltenNW_BattleWin_01_02"); //Но об окончательной победе в этой войне говорить пока слишком рано. AI_Output(self,other,"DIA_MiltenNW_BattleWin_01_03"); //Монастырь все еще осаждают орки! А значит, мои братья до сих пор находятся в опасности. AI_Output(other,self,"DIA_MiltenNW_BattleWin_01_04"); //Не волнуйся! Уверен, что в скором времени мы разберемся и с этой проблемой. AI_Output(self,other,"DIA_MiltenNW_BattleWin_01_05"); //Будем надеяться. }; }; instance DIA_MILTENNW_RUNEMAGICNOTWORK(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_runemagicnotwork_condition; information = dia_miltennw_runemagicnotwork_info; permanent = FALSE; description = "Твои магические руны - они все еще работают?"; }; func int dia_miltennw_runemagicnotwork_condition() { if((STOPBIGBATTLE == TRUE) && (MIS_RUNEMAGICNOTWORK == LOG_Running) && (FIREMAGERUNESNOT == FALSE)) { return TRUE; }; }; func void dia_miltennw_runemagicnotwork_info() { B_GivePlayerXP(200); AI_Output(other,self,"DIA_MiltenNW_RuneMagicNotWork_01_00"); //Твои магические руны - они все еще работают? AI_Output(self,other,"DIA_MiltenNW_RuneMagicNotWork_01_01"); //Мне очень хочется ответить положительно, но я не могу. Мои руны полностью лишились магии. AI_Output(other,self,"DIA_MiltenNW_RuneMagicNotWork_01_02"); //А что насчет остальных? AI_Output(self,other,"DIA_MiltenNW_RuneMagicNotWork_01_03"); //(с горькой ухмылкой) Мои братья сейчас солидарны со мной, как никогда. AI_Output(other,self,"DIA_MiltenNW_RuneMagicNotWork_01_04"); //Понятно. B_LogEntry(TOPIC_RUNEMAGICNOTWORK,"Рунические камни остальных магов Огня тоже потеряли свою силу."); FIREMAGERUNESNOT = TRUE; }; instance DIA_MILTENNW_GOONORKSHUNT(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_goonorkshunt_condition; information = dia_miltennw_goonorkshunt_info; permanent = FALSE; description = "Я собираюсь поохотиться на орков. Ты пойдешь вместе со мной?"; }; func int dia_miltennw_goonorkshunt_condition() { if((HAGENGIVEHELP == TRUE) && (ALLGREATVICTORY == FALSE) && (MILTENTOBIGLAND == FALSE) && (RUNEMAGICNOTWORK == TRUE) && (ALLDISMISSFROMHUNT == FALSE) && Npc_KnowsInfo(hero,dia_miltennw_battlewin)) { return TRUE; }; }; func void dia_miltennw_goonorkshunt_info() { B_GivePlayerXP(100); AI_Output(other,self,"DIA_MiltenNW_GoOnOrksHunt_01_00"); //Я собираюсь поохотиться на орков. Ты пойдешь вместе со мной? AI_Output(self,other,"DIA_MiltenNW_GoOnOrksHunt_01_01"); //Наша рунная магия больше не работает. А без нее от меня будет мало толку. AI_Output(self,other,"DIA_MiltenNW_GoOnOrksHunt_01_02"); //Правда... я неплохо владею посохом! Так и быть, помогу тебе. MILTENJOINMEHUNT = TRUE; }; instance DIA_MILTENNW_FOLLOWME(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_followme_condition; information = dia_miltennw_followme_info; permanent = TRUE; description = "Иди за мной!"; }; func int dia_miltennw_followme_condition() { if((MILTENJOINMEHUNT == TRUE) && (self.aivar[AIV_PARTYMEMBER] == FALSE) && (ALLDISMISSFROMHUNT == FALSE) && (MILTENTOBIGLAND == FALSE)) { return TRUE; }; }; func void dia_miltennw_followme_info() { AI_Output(other,self,"DIA_MiltenNW_FollowMe_01_00"); //Иди за мной! AI_Output(self,other,"DIA_MiltenNW_FollowMe_01_01"); //Конечно. if(Npc_HasItems(self,ItMw_1h_Nov_Mace) < 1) { CreateInvItems(self,ItMw_1h_Nov_Mace,1); }; EquipItem(self,ItMw_1h_Nov_Mace); Npc_ExchangeRoutine(self,"Follow"); self.aivar[AIV_PARTYMEMBER] = TRUE; AI_StopProcessInfos(self); }; instance DIA_MILTENNW_STOPHERE(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_stophere_condition; information = dia_miltennw_stophere_info; permanent = TRUE; description = "Жди тут!"; }; func int dia_miltennw_stophere_condition() { if((MILTENJOINMEHUNT == TRUE) && (self.aivar[AIV_PARTYMEMBER] == TRUE) && (ALLDISMISSFROMHUNT == FALSE) && (MILTENTOBIGLAND == FALSE)) { return TRUE; }; }; func void dia_miltennw_stophere_info() { AI_Output(other,self,"DIA_MiltenNW_StopHere_01_00"); //Жди тут! if(MONASTERYISFREE == FALSE) { AI_Output(self,other,"DIA_MiltenNW_StopHere_01_01"); //Хорошо! Тогда я пока вернусь обратно на ферму. AI_Output(self,other,"DIA_MiltenNW_StopHere_01_02"); //Если понадоблюсь - ищи меня там. Npc_ExchangeRoutine(self,"CampOn"); } else { AI_Output(self,other,"DIA_MiltenNW_StopHere_01_03"); //Хорошо! Тогда я пока вернусь обратно в монастырь. AI_Output(self,other,"DIA_MiltenNW_StopHere_01_04"); //Если понадоблюсь - ищи меня там. Npc_ExchangeRoutine(self,"OrcAtcNW"); }; self.aivar[AIV_PARTYMEMBER] = FALSE; AI_StopProcessInfos(self); }; instance DIA_MILTENNW_ALLGREATVICTORY(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_allgreatvictory_condition; information = dia_miltennw_allgreatvictory_info; permanent = FALSE; description = "Не устал?"; }; func int dia_miltennw_allgreatvictory_condition() { if(ALLGREATVICTORY == TRUE) { return TRUE; }; }; func void dia_miltennw_allgreatvictory_info() { B_GivePlayerXP(100); AI_Output(other,self,"DIA_MiltenNW_AllGreatVictory_01_00"); //Не устал? AI_Output(self,other,"DIA_MiltenNW_AllGreatVictory_01_01"); //(вздыхая) Последние дни меня действительно сильно измотали. AI_Output(self,other,"DIA_MiltenNW_AllGreatVictory_01_02"); //Однако это лучше, чем постоянно находиться в страхе. Нам ведь теперь ничего не угрожает! }; instance DIA_MILTENNW_WHATDONOW(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_whatdonow_condition; information = dia_miltennw_whatdonow_info; permanent = FALSE; description = "Останешься в монастыре?"; }; func int dia_miltennw_whatdonow_condition() { if((ALLGREATVICTORY == TRUE) && (MILTENTOBIGLAND == FALSE)) { return TRUE; }; }; func void dia_miltennw_whatdonow_info() { AI_Output(other,self,"DIA_MiltenNW_WhatDoNow_01_00"); //Останешься в монастыре? AI_Output(self,other,"DIA_MiltenNW_WhatDoNow_01_01"); //Скорее всего. Хватит с меня уже приключений! AI_Output(self,other,"DIA_MiltenNW_WhatDoNow_01_02"); //Теперь я лучше займусь каким-то более спокойным делом. AI_Output(other,self,"DIA_MiltenNW_WhatDoNow_01_03"); //И чем же именно? AI_Output(self,other,"DIA_MiltenNW_WhatDoNow_01_04"); //(задумчиво) Я давно хотел изучить некоторые древние рукописи, что хранятся в нашей тайной библиотеке. }; instance DIA_MILTENNW_TRAVELONBIGLAND(C_Info) { npc = PC_Mage_NW; nr = 1; condition = dia_miltennw_travelonbigland_condition; information = dia_miltennw_travelonbigland_info; permanent = FALSE; description = "Ты поплывешь со мной на материк?"; }; func int dia_miltennw_travelonbigland_condition() { if(WHOTRAVELONBIGLAND == TRUE) { return TRUE; }; }; func void dia_miltennw_travelonbigland_info() { B_GivePlayerXP(200); AI_Output(other,self,"DIA_MiltenNW_TravelOnBigLand_01_00"); //Ты поплывешь со мной на материк? AI_Output(self,other,"DIA_MiltenNW_TravelOnBigLand_01_01"); //Хммм...(растерянно) Твое предложение довольно неожиданно. AI_Output(self,other,"DIA_MiltenNW_TravelOnBigLand_01_02"); //Хотя по правде говоря, мне этот остров уже чертовски надоел! Думаю, мне стоит немного сменить обстановку. AI_Output(self,other,"DIA_MiltenNW_TravelOnBigLand_01_04"); //Я поплыву вместе с тобой! AI_Output(other,self,"DIA_MiltenNW_TravelOnBigLand_01_05"); //Тогда встретимся на корабле. COUNTTRAVELONBIGLAND = COUNTTRAVELONBIGLAND + 1; MILTENTOBIGLAND = TRUE; B_LogEntry(TOPIC_SALETOBIGLAND,"Милтену захотелось сменить окружающую его обстановку. Он отправится со мной на материк."); Npc_ExchangeRoutine(self,"SHIP"); AI_StopProcessInfos(self); };
D
a military unit consisting of armored fighting vehicles protective covering made of metal and used in combat tough more-or-less rigid protective covering of an animal or plant equip with armor
D
// This file is part of Visual D // // Visual D integrates the D programming language into Visual Studio // Copyright (c) 2010 by Rainer Schuetze, All Rights Reserved // // 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 visuald.config; import std.string; import std.conv; import std.file; import std.path; import std.utf; import std.array; import std.exception; import stdext.path; import stdext.array; import stdext.file; import stdext.string; import stdext.util; import xml = visuald.xmlwrap; import visuald.windows; import sdk.port.vsi; import sdk.win32.objbase; import sdk.vsi.vsshell; import visuald.comutil; import visuald.logutil; import visuald.hierutil; import visuald.hierarchy; import visuald.chiernode; import visuald.dproject; import visuald.dpackage; import visuald.build; import visuald.propertypage; import visuald.stringutil; import visuald.fileutil; import visuald.lexutil; import visuald.pkgutil; import visuald.vdextensions; // version = hasOutputGroup; /////////////////////////////////////////////////////////////// const string[] kPlatforms = [ "Win32", "x64" ]; enum string kToolResourceCompiler = "Resource Compiler"; enum string kToolCpp = "C/C++"; const string kCmdLogFileExtension = "build"; /////////////////////////////////////////////////////////////// T clone(T)(T object) { auto size = object.classinfo.init.length; object = cast(T) ((cast(void*)object) [0..size].dup.ptr ); // object.__monitor = null; return object; } /////////////////////////////////////////////////////////////// ubyte toUbyte(string s) { return to!(ubyte)(s); } float toFloat(string s) { return to!(float)(s); } string uintToString(uint x) { return to!(string)(x); } string toElem(bool b) { return b ? "1" : "0"; } string toElem(float f) { return to!(string)(f); } string toElem(string s) { return s; } string toElem(uint x) { return uintToString(x); } void _fromElem(xml.Element e, ref string x) { x = e.text(); } void _fromElem(xml.Element e, ref bool x) { x = e.text() == "1"; } void _fromElem(xml.Element e, ref ubyte x) { x = toUbyte(e.text()); } void _fromElem(xml.Element e, ref uint x) { x = toUbyte(e.text()); } void _fromElem(xml.Element e, ref float x) { x = toFloat(e.text()); } void fromElem(T)(xml.Element e, string s, ref T x) { if(xml.Element el = xml.getElement(e, s)) _fromElem(el, x); } enum Compiler { DMD, GDC, LDC } enum OutputType { Executable, StaticLib, DLL }; enum Subsystem { NotSet, Console, Windows, Native, Posix }; enum CRuntime { None, StaticRelease, StaticDebug, DynamicRelease, DynamicDebug, } class ProjectOptions { bool obj; // write object file bool link; // perform link ubyte lib; // write library file instead of object file(s) (1: static, 2:dynamic) ubyte subsystem; bool multiobj; // break one object file into multiple ones bool oneobj; // write one object file instead of multiple ones bool mscoff; // use mscoff object files for Win32 bool trace; // insert profiling hooks bool quiet; // suppress non-error messages bool verbose; // verbose compile bool vtls; // identify thread local variables bool vgc; // List all gc allocations including hidden ones (DMD 2.066+) ubyte symdebug; // insert debug symbolic information bool optimize; // run optimizer ubyte cpu; // target CPU bool isX86_64; // generate X86_64 bit code bool isLinux; // generate code for linux bool isOSX; // generate code for Mac OSX bool isWindows; // generate code for Windows bool isFreeBSD; // generate code for FreeBSD bool isSolaris; // generate code for Solaris bool scheduler; // which scheduler to use bool useDeprecated; // allow use of deprecated features bool errDeprecated; // error when using deprecated features (2.061+) bool useAssert; // generate runtime code for assert()'s bool useInvariants; // generate class invariant checks bool useIn; // generate precondition checks bool useOut; // generate postcondition checks ubyte useArrayBounds; // 0: no array bounds checks // 1: array bounds checks for safe functions only // 2: array bounds checks for all functions bool noboundscheck; // no array bounds checking at all bool useSwitchError; // check for switches without a default bool useUnitTests; // generate unittest code bool useInline; // inline expand functions bool release; // build release version bool preservePaths; // !=0 means don't strip path from source file bool warnings; // enable warnings bool infowarnings; // enable informational warnings bool checkProperty; // enforce property syntax bool genStackFrame; // always generate stack frame bool pic; // generate position-independent-code for shared libs bool cov; // generate code coverage data bool nofloat; // code should not pull in floating point support bool ignoreUnsupportedPragmas; // rather than error on them bool allinst; // generate code for all template instantiations bool stackStomp; // add stack stomp code float Dversion; // D version number ubyte compiler; // 0: DMD, 1: GDC, 2:LDC bool otherDMD; // use explicit program path bool ccTransOpt; // translate D options to C where applicable string cccmd; // C/C++ compiler command prefix string program; // program name string imppath; // array of char*'s of where to look for import modules string fileImppath; // array of char*'s of where to look for file import modules string outdir; // target output directory string objdir; // .obj/.lib file output directory string objname; // .obj file output name string libname; // .lib file output name bool doDocComments; // process embedded documentation comments string docdir; // write documentation file to docdir directory string docname; // write documentation file to docname string ddocfiles; // macro include files for Ddoc string modules_ddoc; // generate modules.ddoc for candydoc bool doHdrGeneration; // process embedded documentation comments string hdrdir; // write 'header' file to docdir directory string hdrname; // write 'header' file to docname bool doXGeneration; // write JSON file string xfilename; // write JSON file to xfilename uint debuglevel; // debug level string debugids; // debug identifiers uint versionlevel; // version level string versionids; // version identifiers bool dump_source; uint mapverbosity; bool createImplib; string defaultlibname; // default library for non-debug builds string debuglibname; // default library for debug builds string moduleDepsFile; // filename for deps output bool run; // run resulting executable string runargs; // arguments for executable bool runCv2pdb; // run cv2pdb on executable bool cv2pdbPre2043; // pass version before 2.043 for older aa implementation bool cv2pdbNoDemangle; // do not demangle symbols bool cv2pdbEnumType; // use enumerator type string pathCv2pdb; // exe path for cv2pdb string cv2pdbOptions; // more options for cv2pdb enum { kCombinedCompileAndLink, kSingleFileCompilation, kSeparateCompileAndLink, kSeparateCompileOnly, } uint compilationModel = kCombinedCompileAndLink; // Linker stuff string objfiles; string linkswitches; string libfiles; string libpaths; string deffile; string resfile; string exefile; bool useStdLibPath; uint cRuntime; bool privatePhobos; string additionalOptions; string preBuildCommand; string postBuildCommand; // debug options string debugtarget; string debugarguments; string debugworkingdir; bool debugattach; string debugremote; ubyte debugEngine; // 0: mixed, 1: mago bool debugStdOutToOutputWindow; bool pauseAfterRunning; string filesToClean; this(bool dbg, bool x64) { Dversion = 2.043; exefile = "$(OutDir)\\$(ProjectName).exe"; outdir = "$(ConfigurationName)"; objdir = "$(OutDir)"; debugtarget = "$(TARGETPATH)"; pathCv2pdb = "$(VisualDInstallDir)cv2pdb\\cv2pdb.exe"; program = "$(DMDInstallDir)windows\\bin\\dmd.exe"; xfilename = "$(IntDir)\\$(TargetName).json"; cccmd = "$(CC) -c"; ccTransOpt = true; doXGeneration = true; useStdLibPath = true; cRuntime = CRuntime.StaticRelease; filesToClean = "*.obj;*.cmd;*.build;*.json;*.dep"; setDebug(dbg); setX64(x64); } void setDebug(bool dbg) { runCv2pdb = dbg; symdebug = dbg ? 1 : 0; release = dbg ? 0 : 1; } void setX64(bool x64) { isX86_64 = x64; if(!release && cRuntime == CRuntime.StaticRelease) cRuntime = CRuntime.StaticDebug; } string objectFileExtension() { return compiler != Compiler.GDC ? "obj" : "o"; } string otherCompilerPath() { return otherDMD ? program : null; } @property ref CompilerDirectories compilerDirectories() { switch(compiler) { default: case Compiler.DMD: return Package.GetGlobalOptions().DMD; case Compiler.GDC: return Package.GetGlobalOptions().GDC; case Compiler.LDC: return Package.GetGlobalOptions().LDC; } } // common options with building phobos.lib string dmdCommonCompileOptions() { string cmd; if(isX86_64) cmd ~= " -m64"; else if(mscoff) cmd ~= " -m32mscoff"; if(verbose) cmd ~= " -v"; if(Dversion >= 2 && vtls) cmd ~= " -vtls"; if(Dversion >= 2 && vgc) cmd ~= " -vgc"; if(symdebug == 1) cmd ~= " -g"; if(symdebug == 2) cmd ~= " -gc"; if(optimize) cmd ~= " -O"; if(useDeprecated) cmd ~= " -d"; if(useInline) cmd ~= " -inline"; if(release) cmd ~= " -release"; else cmd ~= " -debug"; if(warnings) cmd ~= " -w"; if(infowarnings) cmd ~= " -wi"; if(checkProperty) cmd ~= " -property"; if(genStackFrame) cmd ~= " -gs"; if(stackStomp) cmd ~= " -gx"; return cmd; } string buildDMDCommandLine(bool compile = true, bool performLink = true, bool deps = true, bool syntaxOnly = false) { string cmd; if(otherDMD && program.length) cmd = quoteNormalizeFilename(program); else cmd = "dmd"; if(performLink && Package.GetGlobalOptions().demangleError) cmd = "\"$(VisualDInstallDir)pipedmd.exe\" " ~ cmd; cmd ~= dmdCommonCompileOptions(); if(lib == OutputType.StaticLib && performLink) cmd ~= " -lib"; if(multiobj) cmd ~= " -multiobj"; if(trace) cmd ~= " -profile"; if(quiet) cmd ~= " -quiet"; else if(errDeprecated) cmd ~= " -de"; if(Dversion >= 2 && noboundscheck) cmd ~= " -noboundscheck"; if(useUnitTests) cmd ~= " -unittest"; if(preservePaths) cmd ~= " -op"; if(cov) cmd ~= " -cov"; if(nofloat) cmd ~= " -nofloat"; if(ignoreUnsupportedPragmas) cmd ~= " -ignore"; if(allinst) cmd ~= " -allinst"; if(privatePhobos) cmd ~= " -defaultlib=" ~ quoteFilename(normalizeDir(outdir) ~ "privatephobos.lib"); if(doDocComments && compile && !syntaxOnly) { cmd ~= " -D"; if(docdir.length) cmd ~= " -Dd" ~ quoteNormalizeFilename(docdir); if(docname.length) cmd ~= " -Df" ~ quoteNormalizeFilename(docname); } if(doHdrGeneration && compile && !syntaxOnly) { cmd ~= " -H"; if(hdrdir.length) cmd ~= " -Hd" ~ quoteNormalizeFilename(hdrdir); if(hdrname.length) cmd ~= " -Hf" ~ quoteNormalizeFilename(hdrname); } if(doXGeneration && compile && !syntaxOnly) { cmd ~= " -X"; if(xfilename.length) cmd ~= " -Xf" ~ quoteNormalizeFilename(xfilename); } string[] imports = tokenizeArgs(imppath); foreach(imp; imports) if(strip(imp).length) cmd ~= " -I" ~ quoteNormalizeFilename(strip(imp)); string[] globalimports = tokenizeArgs(compilerDirectories.ImpSearchPath); foreach(gimp; globalimports) if(strip(gimp).length) cmd ~= " -I" ~ quoteNormalizeFilename(strip(gimp)); string[] fileImports = tokenizeArgs(fileImppath); foreach(imp; fileImports) if(strip(imp).length) cmd ~= " -J" ~ quoteNormalizeFilename(strip(imp)); string[] versions = tokenizeArgs(versionids); foreach(ver; versions) if(strip(ver).length) cmd ~= " -version=" ~ strip(ver); string[] ids = tokenizeArgs(debugids); foreach(id; ids) if(strip(id).length) cmd ~= " -debug=" ~ strip(id); if(deps && !syntaxOnly) cmd ~= " -deps=" ~ quoteNormalizeFilename(getDependenciesPath()); if(performLink) cmd ~= linkCommandLine(); return cmd; } string buildGDCCommandLine(bool compile = true, bool performLink = true, bool deps = true, bool syntaxOnly = false) { string cmd; if(otherDMD && program.length) cmd = quoteNormalizeFilename(program); else cmd = "gdc"; if(performLink && Package.GetGlobalOptions().demangleError) cmd = "\"$(VisualDInstallDir)pipedmd.exe\" -gdcmode " ~ cmd; // if(lib && performLink) // cmd ~= " -lib"; // if(multiobj) // cmd ~= " -multiobj"; if(lib == OutputType.DLL) cmd ~= " -mdll"; if(subsystem == Subsystem.Windows) cmd ~= " -mwindows"; else if(subsystem == Subsystem.Console) cmd ~= " -mconsole"; if(isX86_64) cmd ~= " -m64"; else cmd ~= " -m32"; if(trace) cmd ~= " -pg"; // if(quiet) // cmd ~= " -quiet"; if(verbose) cmd ~= " -fd-verbose"; if(Dversion < 2) cmd ~= " -fd-version=1"; if(Dversion >= 2 && vtls) cmd ~= " -fd-vtls"; if(Dversion >= 2 && vgc) cmd ~= " -fd-vgc"; if(symdebug == 1) cmd ~= " -g"; if(symdebug == 2) cmd ~= " -fdebug-c"; if(optimize) cmd ~= " -O3"; if(useDeprecated) cmd ~= " -fdeprecated"; if(Dversion >= 2 && noboundscheck) cmd ~= " -fno-bounds-check"; if(useUnitTests) cmd ~= " -funittest"; if(!useInline) cmd ~= " -fno-inline-functions"; if(release) cmd ~= " -frelease"; else cmd ~= " -fdebug"; // if(preservePaths) // cmd ~= " -op"; if(warnings) cmd ~= " -Werror"; if(infowarnings) cmd ~= " -Wall"; if(checkProperty) cmd ~= " -fproperty"; if(genStackFrame) cmd ~= " -fno-omit-frame-pointer"; if(cov) cmd ~= " -fprofile-arcs -ftest-coverage"; // if(nofloat) // cmd ~= " -nofloat"; if(ignoreUnsupportedPragmas) cmd ~= " -fignore-unknown-pragmas"; if(doDocComments && compile && !syntaxOnly) { cmd ~= " -fdoc"; if(docdir.length) cmd ~= " -fdoc-dir=" ~ quoteNormalizeFilename(docdir); if(docname.length) cmd ~= " -fdoc-file=" ~ quoteNormalizeFilename(docname); } if(doHdrGeneration && compile && !syntaxOnly) { cmd ~= " -fintfc"; if(hdrdir.length) cmd ~= " -fintfc-dir=" ~ quoteNormalizeFilename(hdrdir); if(hdrname.length) cmd ~= " -fintfc-file=" ~ quoteNormalizeFilename(hdrname); } if(doXGeneration && compile && !syntaxOnly) { string xfile = xfilename.length ? xfilename : "$(OUTDIR)\\$(SAFEPROJECTNAME).json"; cmd ~= " -fXf=" ~ quoteNormalizeFilename(xfile); } string[] imports = tokenizeArgs(imppath); foreach(imp; imports) if(strip(imp).length) cmd ~= " -I" ~ quoteNormalizeFilename(strip(imp)); string[] globalimports = tokenizeArgs(compilerDirectories.ImpSearchPath); foreach(gimp; globalimports) if(strip(gimp).length) cmd ~= " -I" ~ quoteNormalizeFilename(strip(gimp)); string[] fileImports = tokenizeArgs(fileImppath); foreach(imp; fileImports) if(strip(imp).length) cmd ~= " -J" ~ quoteNormalizeFilename(strip(imp)); string[] versions = tokenizeArgs(versionids); foreach(ver; versions) if(strip(ver).length) cmd ~= " -fversion=" ~ strip(ver); string[] ids = tokenizeArgs(debugids); foreach(id; ids) if(strip(id).length) cmd ~= " -fdebug=" ~ strip(id); if(deps && !syntaxOnly) cmd ~= " -fdeps=" ~ quoteNormalizeFilename(getDependenciesPath()); if(performLink) cmd ~= linkCommandLine(); return cmd; } string buildLDCCommandLine(bool compile = true, bool performLink = true, bool deps = true, bool syntaxOnly = false) { string cmd; if(otherDMD && program.length) cmd = quoteNormalizeFilename(program); else cmd = "ldc2"; if(performLink && Package.GetGlobalOptions().demangleError) cmd = "\"$(VisualDInstallDir)pipedmd.exe\" " ~ cmd; if(lib == OutputType.StaticLib && performLink) cmd ~= " -lib"; if(isX86_64) cmd ~= " -m64"; else cmd ~= " -m32"; if(verbose) cmd ~= " -v"; if(symdebug == 1) cmd ~= " -g"; if(symdebug == 2) cmd ~= " -gc"; if(optimize) cmd ~= " -O"; if(useDeprecated) cmd ~= " -d"; else if(errDeprecated) cmd ~= " -de"; if(useUnitTests) cmd ~= " -unittest"; if(release) cmd ~= " -release"; if(preservePaths) cmd ~= " -op"; if(warnings) cmd ~= " -w"; if(infowarnings) cmd ~= " -wi"; if(checkProperty) cmd ~= " -property"; if(ignoreUnsupportedPragmas) cmd ~= " -ignore"; if(doDocComments && compile && !syntaxOnly) { cmd ~= " -D"; if(docdir.length) cmd ~= " -Dd=" ~ quoteNormalizeFilename(docdir); if(docname.length) cmd ~= " -Df=" ~ quoteNormalizeFilename(docname); } if(doHdrGeneration && compile && !syntaxOnly) { cmd ~= " -H"; if(hdrdir.length) cmd ~= " -Hd=" ~ quoteNormalizeFilename(hdrdir); if(hdrname.length) cmd ~= " -Hf=" ~ quoteNormalizeFilename(hdrname); } if(doXGeneration && compile && !syntaxOnly) { cmd ~= " -X"; if(xfilename.length) cmd ~= " -Xf=" ~ quoteNormalizeFilename(xfilename); } string[] imports = tokenizeArgs(imppath); foreach(imp; imports) if(strip(imp).length) cmd ~= " -I=" ~ quoteNormalizeFilename(strip(imp)); string[] globalimports = tokenizeArgs(compilerDirectories.ImpSearchPath); foreach(gimp; globalimports) if(strip(gimp).length) cmd ~= " -I=" ~ quoteNormalizeFilename(strip(gimp)); string[] fileImports = tokenizeArgs(fileImppath); foreach(imp; fileImports) if(strip(imp).length) cmd ~= " -J=" ~ quoteNormalizeFilename(strip(imp)); string[] versions = tokenizeArgs(versionids); foreach(ver; versions) if(strip(ver).length) cmd ~= " -d-version=" ~ strip(ver); string[] ids = tokenizeArgs(debugids); foreach(id; ids) if(strip(id).length) cmd ~= " -d-debug=" ~ strip(id); if(deps && !syntaxOnly) cmd ~= " -deps=" ~ quoteNormalizeFilename(getDependenciesPath()); if(performLink) cmd ~= linkCommandLine(); return cmd; } string buildCommandLine(bool compile = true, bool performLink = true, bool deps = true, bool syntaxOnly = false) { if(compiler == Compiler.DMD) return buildDMDCommandLine(compile, performLink, deps, syntaxOnly); if(!compile && performLink && lib == OutputType.StaticLib) return buildARCommandLine(); if(compiler == Compiler.LDC) return buildLDCCommandLine(compile, performLink, deps, syntaxOnly); return buildGDCCommandLine(compile, performLink, deps, syntaxOnly); } string buildARCommandLine() { string cmd = "ar cru " ~ quoteNormalizeFilename(getTargetPath()); return cmd; } string linkDMDCommandLine(bool mslink) { string cmd; string dmdoutfile = getTargetPath(); if(usesCv2pdb()) dmdoutfile ~= "_cv"; cmd ~= getOutputFileOption(dmdoutfile); if(mslink && compiler != Compiler.DMD) cmd ~= " -L/MAP:\"$(INTDIR)\\$(SAFEPROJECTNAME).map\""; else cmd ~= " -map \"$(INTDIR)\\$(SAFEPROJECTNAME).map\""; switch(mapverbosity) { case 0: cmd ~= mslink ? "" : " -L/NOMAP"; break; // actually still creates map file case 1: cmd ~= mslink ? "-L/MAPINFO:EXPORTS" : " -L/MAP:ADDRESS"; break; case 2: break; case 3: cmd ~= mslink ? "-L/MAPINFO:EXPORTS,LINES" : " -L/MAP:FULL"; break; case 4: cmd ~= mslink ? "-L/MAPINFO:EXPORTS,LINES,FIXUPS" : " -L/MAP:FULL -L/XREF"; break; default: break; } if(lib != OutputType.StaticLib) { if(createImplib) cmd ~= " -L/IMPLIB:$(OUTDIR)\\$(PROJECTNAME).lib"; if(objfiles.length) cmd ~= " " ~ objfiles; if(deffile.length) cmd ~= " " ~ deffile; if(libfiles.length) cmd ~= " " ~ libfiles; if(resfile.length) cmd ~= " " ~ resfile; switch(subsystem) { default: case Subsystem.NotSet: break; case Subsystem.Console: cmd ~= " -L/SUBSYSTEM:CONSOLE"; break; case Subsystem.Windows: cmd ~= " -L/SUBSYSTEM:WINDOWS"; break; case Subsystem.Native: cmd ~= " -L/SUBSYSTEM:NATIVE"; break; case Subsystem.Posix: cmd ~= " -L/SUBSYSTEM:POSIX"; break; } } return cmd; } string linkGDCCommandLine() { string cmd; string dmdoutfile = getTargetPath(); if(usesCv2pdb()) dmdoutfile ~= "_cv"; cmd ~= " -o " ~ quoteNormalizeFilename(dmdoutfile); switch(mapverbosity) { case 0: // no map break; default: cmd ~= " -Wl,-Map=\"$(INTDIR)\\$(SAFEPROJECTNAME).map\""; break; } string[] lpaths = tokenizeArgs(libpaths); if(useStdLibPath) lpaths ~= tokenizeArgs(isX86_64 ? compilerDirectories.LibSearchPath64 : compilerDirectories.LibSearchPath); else cmd ~= " -Wl,-nostdlib"; foreach(lp; lpaths) cmd ~= " -Wl,-L," ~ quoteFilename(lp); if(lib != OutputType.StaticLib) { // if(createImplib) // cmd ~= " -L/IMPLIB:$(OUTDIR)\\$(PROJECTNAME).lib"; if(objfiles.length) cmd ~= " " ~ objfiles; if(deffile.length) cmd ~= " " ~ deffile; // added later in getCommandFileList // if(libfiles.length) // cmd ~= " " ~ libfiles; if(resfile.length) cmd ~= " " ~ resfile; } return cmd; } string optlinkCommandLine(string[] lnkfiles, string inioptions, string workdir, bool mslink) { string cmd; string dmdoutfile = getTargetPath(); if(usesCv2pdb()) dmdoutfile ~= "_cv"; string mapfile = "\"$(INTDIR)\\$(SAFEPROJECTNAME).map\""; string plus = mslink ? " " : "+"; static string plusList(string[] lnkfiles, string ext, string sep) { if(ext.length == 0 || ext[0] != '.') ext = "." ~ ext; string s; foreach(i, file; lnkfiles) { if(toLower(extension(file)) != ext) continue; if(s.length > 0) s ~= sep; s ~= quoteNormalizeFilename(file); } return s; } inioptions ~= " " ~ additionalOptions; string[] opts = tokenizeArgs(inioptions, false); opts = expandResponseFiles(opts, workdir); string addopts; foreach(ref opt; opts) { opt = unquoteArgument(opt); if(opt.startsWith("-L")) addopts ~= " " ~ quoteFilename(opt[2..$]); if(opt[0] != '-') lnkfiles ~= opt; } cmd ~= plusList(lnkfiles, objectFileExtension(), plus); cmd ~= mslink ? " /OUT:" : ","; cmd ~= quoteNormalizeFilename(dmdoutfile); cmd ~= mslink ? " /MAP:" : ","; cmd ~= mapfile; cmd ~= mslink ? " " : ","; string[] libs = tokenizeArgs(libfiles); libs ~= "user32.lib"; libs ~= "kernel32.lib"; cmd ~= plusList(lnkfiles ~ libs, ".lib", plus); string[] lpaths = tokenizeArgs(libpaths); if(useStdLibPath) lpaths ~= tokenizeArgs(isX86_64 ? compilerDirectories.LibSearchPath64 : mscoff ? compilerDirectories.LibSearchPath32coff : compilerDirectories.LibSearchPath); foreach(lp; lpaths) if(mslink) cmd ~= " /LIBPATH:" ~ quoteFilename(normalizeDir(unquoteArgument(lp))[0..$-1]); // avoid trailing \ for quoted files else cmd ~= "+" ~ quoteFilename(normalizeDir(unquoteArgument(lp))); // optlink needs trailing \ string def = deffile.length ? quoteNormalizeFilename(deffile) : plusList(lnkfiles, ".def", mslink ? " /DEF:" : plus); string res = resfile.length ? quoteNormalizeFilename(resfile) : plusList(lnkfiles, ".res", plus); if(mslink) { if(def.length) cmd ~= " /DEF:" ~ def; if(res.length) cmd ~= " " ~ res; } else { if(def.length || res.length) cmd ~= "," ~ def; if(res.length) cmd ~= "," ~ res; } // options // "/m" to geneate map? if(!mslink) switch(mapverbosity) { case 0: cmd ~= "/NOMAP"; break; // actually still creates map file case 1: cmd ~= "/MAP:ADDRESS"; break; case 2: break; case 3: cmd ~= "/MAP:FULL"; break; case 4: cmd ~= "/MAP:FULL/XREF"; break; default: break; } if(symdebug) cmd ~= mslink ? " /DEBUG" : "/CO"; cmd ~= mslink ? " /INCREMENTAL:NO /NOLOGO" : "/NOI/DELEXE"; if(mslink) { switch(cRuntime) { case CRuntime.None: cmd ~= " /NODEFAULTLIB:libcmt"; break; case CRuntime.StaticRelease: break; case CRuntime.StaticDebug: cmd ~= " /NODEFAULTLIB:libcmt libcmtd.lib"; break; case CRuntime.DynamicRelease: cmd ~= " /NODEFAULTLIB:libcmt msvcrt.lib"; break; case CRuntime.DynamicDebug: cmd ~= " /NODEFAULTLIB:libcmt msvcrtd.lib"; break; default: break; } } if(lib != OutputType.StaticLib) { if(createImplib) cmd ~= " /IMPLIB:$(OUTDIR)\\$(PROJECTNAME).lib"; switch(subsystem) { default: case Subsystem.NotSet: break; case Subsystem.Console: cmd ~= " /SUBSYSTEM:CONSOLE"; break; case Subsystem.Windows: cmd ~= " /SUBSYSTEM:WINDOWS"; break; case Subsystem.Native: cmd ~= " /SUBSYSTEM:NATIVE"; break; case Subsystem.Posix: cmd ~= " /SUBSYSTEM:POSIX"; break; } } cmd ~= addopts; return cmd; } string linkCommandLine() { if(compiler == Compiler.GDC) return linkGDCCommandLine(); else if(compiler == Compiler.LDC) return linkDMDCommandLine(true); else return linkDMDCommandLine(isX86_64); } string getOutputDirOption() { switch(compiler) { default: case Compiler.DMD: return " -od" ~ quoteFilename(objdir); case Compiler.LDC: return " -od=" ~ quoteFilename(objdir); case Compiler.GDC: return ""; // does not work with GDC } } string getOutputFileOption(string file) { switch(compiler) { default: case Compiler.DMD: return " -of" ~ quoteFilename(file); case Compiler.LDC: return " -of=" ~ quoteFilename(file); case Compiler.GDC: return " -o " ~ quoteFilename(file); } } string getCppCommandLine(string file, bool setenv) { int cc; // 0-3 for dmc,cl,clang,gdc switch(compiler) { default: case Compiler.DMD: cc = (isX86_64 || mscoff ? 1 : 0); break; case Compiler.LDC: cc = 2; break; case Compiler.GDC: cc = 3; break; } string cmd = cccmd; if(cc == 1 && setenv) cmd = `call "%VCINSTALLDIR%\vcvarsall.bat" ` ~ (isX86_64 ? "x86_amd64" : "x86") ~ "\n" ~ cmd; static string[4] outObj = [ " -o", " -Fo", " -o", " -o " ]; if (file.length) cmd ~= outObj[cc] ~ quoteFilename(file); if (!ccTransOpt) return cmd; static string[4] dbg = [ " -g", " -Z7", " -g", " -g" ]; if(symdebug) cmd ~= dbg[cc]; if (release) cmd ~= " -DNDEBUG"; static string[4] opt = [ " -O", " -Ox", " -O3", " -O3" ]; if(optimize) cmd ~= opt[cc]; if (quiet && cc == 1) cmd ~= " /NOLOGO"; return cmd; } string getDependenciesFileOption(string file) { if(compiler == Compiler.GDC) return " -fdeps=" ~ quoteFilename(file); else return " -deps=" ~ quoteFilename(file); } string getAdditionalLinkOptions() { if(compiler != Compiler.DMD && lib == OutputType.StaticLib) return ""; // no options to ar return additionalOptions; // always filtered through compiler } string getTargetPath() { if(exefile.length) return normalizePath(exefile); if(lib == OutputType.StaticLib) return "$(OutDir)\\$(ProjectName).lib"; return "$(OutDir)\\$(ProjectName).exe"; } string getDependenciesPath() { return normalizeDir(objdir) ~ "$(ProjectName).dep"; } string getCommandLinePath() { return normalizeDir(objdir) ~ "$(ProjectName)." ~ kCmdLogFileExtension; } // "linking" includes building library (through ar with GDC, internal with DMD) bool doSeparateLink() { if(compilationModel == ProjectOptions.kSeparateCompileOnly) return false; bool separateLink = compilationModel == ProjectOptions.kSeparateCompileAndLink; if (compiler == Compiler.GDC && lib == OutputType.StaticLib) separateLink = true; if (compiler == Compiler.DMD && lib != OutputType.StaticLib) { if(Package.GetGlobalOptions().optlinkDeps) separateLink = true; else if(isX86_64 && Package.GetGlobalOptions().DMD.overrideIni64) separateLink = true; else if(!isX86_64 && mscoff && Package.GetGlobalOptions().DMD.overrideIni32coff) separateLink = true; } return separateLink; } bool callLinkerDirectly() { bool dmdlink = compiler == Compiler.DMD && doSeparateLink() && lib != OutputType.StaticLib; return dmdlink; // && !isX86_64; } bool usesCv2pdb() { if(compiler == Compiler.DMD && (isX86_64 || mscoff)) return false; // should generate correct debug info directly return (/*compiler == Compiler.DMD && */symdebug && runCv2pdb && lib != OutputType.StaticLib && debugEngine != 1); } string appendCv2pdb() { if(usesCv2pdb()) { string target = getTargetPath(); string cmd = quoteFilename(pathCv2pdb); if(Dversion < 2) cmd ~= " -D" ~ to!(string)(Dversion) ~ " "; else if(cv2pdbPre2043) cmd ~= " -D2.001"; if(cv2pdbEnumType) cmd ~= " -e"; if(cv2pdbNoDemangle) cmd ~= " -n"; if(cv2pdbOptions.length) cmd ~= " " ~ cv2pdbOptions; cmd ~= " " ~ quoteFilename(target ~ "_cv") ~ " " ~ quoteFilename(target); return cmd; } return ""; } string replaceEnvironment(string cmd, Config config, string inputfile = "", string outputfile = "") { if(indexOf(cmd, '$') < 0) return cmd; string configname = config.mName; string projectpath = config.GetProjectPath(); string safeprojectpath = projectpath.replace(" ", "_"); string[string] replacements; string solutionpath = GetSolutionFilename(); if(solutionpath.length) addFileMacros(solutionpath, "SOLUTION", replacements); replacements["PLATFORMNAME"] = config.mPlatform; addFileMacros(projectpath, "PROJECT", replacements); replacements["PROJECTNAME"] = config.GetProjectName(); addFileMacros(safeprojectpath, "SAFEPROJECT", replacements); replacements["SAFEPROJECTNAME"] = config.GetProjectName().replace(" ", "_"); addFileMacros(inputfile.length ? inputfile : projectpath, "INPUT", replacements); replacements["CONFIGURATIONNAME"] = configname; replacements["CONFIGURATION"] = configname; replacements["OUTDIR"] = normalizePath(outdir); replacements["INTDIR"] = normalizePath(objdir); Package.GetGlobalOptions().addReplacements(replacements); replacements["CC"] = config.GetCppCompiler(); string targetpath = outputfile.length ? outputfile : getTargetPath(); string target = replaceMacros(targetpath, replacements); addFileMacros(target, "TARGET", replacements); return replaceMacros(cmd, replacements); } void writeXML(xml.Element elem) { elem ~= new xml.Element("obj", toElem(obj)); elem ~= new xml.Element("link", toElem(link)); elem ~= new xml.Element("lib", toElem(lib)); elem ~= new xml.Element("subsystem", toElem(subsystem)); elem ~= new xml.Element("multiobj", toElem(multiobj)); elem ~= new xml.Element("singleFileCompilation", toElem(compilationModel)); elem ~= new xml.Element("oneobj", toElem(oneobj)); elem ~= new xml.Element("mscoff", toElem(mscoff)); elem ~= new xml.Element("trace", toElem(trace)); elem ~= new xml.Element("quiet", toElem(quiet)); elem ~= new xml.Element("verbose", toElem(verbose)); elem ~= new xml.Element("vtls", toElem(vtls)); elem ~= new xml.Element("vgc", toElem(vgc)); elem ~= new xml.Element("symdebug", toElem(symdebug)); elem ~= new xml.Element("optimize", toElem(optimize)); elem ~= new xml.Element("cpu", toElem(cpu)); elem ~= new xml.Element("isX86_64", toElem(isX86_64)); elem ~= new xml.Element("isLinux", toElem(isLinux)); elem ~= new xml.Element("isOSX", toElem(isOSX)); elem ~= new xml.Element("isWindows", toElem(isWindows)); elem ~= new xml.Element("isFreeBSD", toElem(isFreeBSD)); elem ~= new xml.Element("isSolaris", toElem(isSolaris)); elem ~= new xml.Element("scheduler", toElem(scheduler)); elem ~= new xml.Element("useDeprecated", toElem(useDeprecated)); elem ~= new xml.Element("errDeprecated", toElem(errDeprecated)); elem ~= new xml.Element("useAssert", toElem(useAssert)); elem ~= new xml.Element("useInvariants", toElem(useInvariants)); elem ~= new xml.Element("useIn", toElem(useIn)); elem ~= new xml.Element("useOut", toElem(useOut)); elem ~= new xml.Element("useArrayBounds", toElem(useArrayBounds)); elem ~= new xml.Element("noboundscheck", toElem(noboundscheck)); elem ~= new xml.Element("useSwitchError", toElem(useSwitchError)); elem ~= new xml.Element("useUnitTests", toElem(useUnitTests)); elem ~= new xml.Element("useInline", toElem(useInline)); elem ~= new xml.Element("release", toElem(release)); elem ~= new xml.Element("preservePaths", toElem(preservePaths)); elem ~= new xml.Element("warnings", toElem(warnings)); elem ~= new xml.Element("infowarnings", toElem(infowarnings)); elem ~= new xml.Element("checkProperty", toElem(checkProperty)); elem ~= new xml.Element("genStackFrame", toElem(genStackFrame)); elem ~= new xml.Element("pic", toElem(pic)); elem ~= new xml.Element("cov", toElem(cov)); elem ~= new xml.Element("nofloat", toElem(nofloat)); elem ~= new xml.Element("Dversion", toElem(Dversion)); elem ~= new xml.Element("ignoreUnsupportedPragmas", toElem(ignoreUnsupportedPragmas)); elem ~= new xml.Element("allinst", toElem(allinst)); elem ~= new xml.Element("stackStomp", toElem(stackStomp)); elem ~= new xml.Element("compiler", toElem(compiler)); elem ~= new xml.Element("otherDMD", toElem(otherDMD)); elem ~= new xml.Element("cccmd", toElem(cccmd)); elem ~= new xml.Element("ccTransOpt", toElem(ccTransOpt)); elem ~= new xml.Element("program", toElem(program)); elem ~= new xml.Element("imppath", toElem(imppath)); elem ~= new xml.Element("fileImppath", toElem(fileImppath)); elem ~= new xml.Element("outdir", toElem(outdir)); elem ~= new xml.Element("objdir", toElem(objdir)); elem ~= new xml.Element("objname", toElem(objname)); elem ~= new xml.Element("libname", toElem(libname)); elem ~= new xml.Element("doDocComments", toElem(doDocComments)); elem ~= new xml.Element("docdir", toElem(docdir)); elem ~= new xml.Element("docname", toElem(docname)); elem ~= new xml.Element("modules_ddoc", toElem(modules_ddoc)); elem ~= new xml.Element("ddocfiles", toElem(ddocfiles)); elem ~= new xml.Element("doHdrGeneration", toElem(doHdrGeneration)); elem ~= new xml.Element("hdrdir", toElem(hdrdir)); elem ~= new xml.Element("hdrname", toElem(hdrname)); elem ~= new xml.Element("doXGeneration", toElem(doXGeneration)); elem ~= new xml.Element("xfilename", toElem(xfilename)); elem ~= new xml.Element("debuglevel", toElem(debuglevel)); elem ~= new xml.Element("debugids", toElem(debugids)); elem ~= new xml.Element("versionlevel", toElem(versionlevel)); elem ~= new xml.Element("versionids", toElem(versionids)); elem ~= new xml.Element("dump_source", toElem(dump_source)); elem ~= new xml.Element("mapverbosity", toElem(mapverbosity)); elem ~= new xml.Element("createImplib", toElem(createImplib)); elem ~= new xml.Element("defaultlibname", toElem(defaultlibname)); elem ~= new xml.Element("debuglibname", toElem(debuglibname)); elem ~= new xml.Element("moduleDepsFile", toElem(moduleDepsFile)); elem ~= new xml.Element("run", toElem(run)); elem ~= new xml.Element("runargs", toElem(runargs)); elem ~= new xml.Element("runCv2pdb", toElem(runCv2pdb)); elem ~= new xml.Element("pathCv2pdb", toElem(pathCv2pdb)); elem ~= new xml.Element("cv2pdbPre2043", toElem(cv2pdbPre2043)); elem ~= new xml.Element("cv2pdbNoDemangle", toElem(cv2pdbNoDemangle)); elem ~= new xml.Element("cv2pdbEnumType", toElem(cv2pdbEnumType)); elem ~= new xml.Element("cv2pdbOptions", toElem(cv2pdbOptions)); // Linker stuff elem ~= new xml.Element("objfiles", toElem(objfiles)); elem ~= new xml.Element("linkswitches", toElem(linkswitches)); elem ~= new xml.Element("libfiles", toElem(libfiles)); elem ~= new xml.Element("libpaths", toElem(libpaths)); elem ~= new xml.Element("deffile", toElem(deffile)); elem ~= new xml.Element("resfile", toElem(resfile)); elem ~= new xml.Element("exefile", toElem(exefile)); elem ~= new xml.Element("useStdLibPath", toElem(useStdLibPath)); elem ~= new xml.Element("cRuntime", toElem(cRuntime)); elem ~= new xml.Element("privatePhobos", toElem(privatePhobos)); elem ~= new xml.Element("additionalOptions", toElem(additionalOptions)); elem ~= new xml.Element("preBuildCommand", toElem(preBuildCommand)); elem ~= new xml.Element("postBuildCommand", toElem(postBuildCommand)); elem ~= new xml.Element("filesToClean", toElem(filesToClean)); } void writeDebuggerXML(xml.Element elem) { elem ~= new xml.Element("debugtarget", toElem(debugtarget)); elem ~= new xml.Element("debugarguments", toElem(debugarguments)); elem ~= new xml.Element("debugworkingdir", toElem(debugworkingdir)); elem ~= new xml.Element("debugattach", toElem(debugattach)); elem ~= new xml.Element("debugremote", toElem(debugremote)); elem ~= new xml.Element("debugEngine", toElem(debugEngine)); elem ~= new xml.Element("debugStdOutToOutputWindow", toElem(debugStdOutToOutputWindow)); elem ~= new xml.Element("pauseAfterRunning", toElem(pauseAfterRunning)); } void readXML(xml.Element elem) { fromElem(elem, "obj", obj); fromElem(elem, "link", link); fromElem(elem, "lib", lib); fromElem(elem, "subsystem", subsystem); fromElem(elem, "multiobj", multiobj); fromElem(elem, "singleFileCompilation", compilationModel); fromElem(elem, "oneobj", oneobj); fromElem(elem, "mscoff", mscoff); fromElem(elem, "trace", trace); fromElem(elem, "quiet", quiet); fromElem(elem, "verbose", verbose); fromElem(elem, "vtls", vtls); fromElem(elem, "vgc", vgc); fromElem(elem, "symdebug", symdebug); fromElem(elem, "optimize", optimize); fromElem(elem, "cpu", cpu); fromElem(elem, "isX86_64", isX86_64); fromElem(elem, "isLinux", isLinux); fromElem(elem, "isOSX", isOSX); fromElem(elem, "isWindows", isWindows); fromElem(elem, "isFreeBSD", isFreeBSD); fromElem(elem, "isSolaris", isSolaris); fromElem(elem, "scheduler", scheduler); fromElem(elem, "useDeprecated", useDeprecated); fromElem(elem, "errDeprecated", errDeprecated); fromElem(elem, "useAssert", useAssert); fromElem(elem, "useInvariants", useInvariants); fromElem(elem, "useIn", useIn); fromElem(elem, "useOut", useOut); fromElem(elem, "useArrayBounds", useArrayBounds); fromElem(elem, "noboundscheck", noboundscheck); fromElem(elem, "useSwitchError", useSwitchError); fromElem(elem, "useUnitTests", useUnitTests); fromElem(elem, "useInline", useInline); fromElem(elem, "release", release); fromElem(elem, "preservePaths", preservePaths); fromElem(elem, "warnings", warnings); fromElem(elem, "infowarnings", infowarnings); fromElem(elem, "checkProperty", checkProperty); fromElem(elem, "genStackFrame", genStackFrame); fromElem(elem, "pic", pic); fromElem(elem, "cov", cov); fromElem(elem, "nofloat", nofloat); fromElem(elem, "Dversion", Dversion); fromElem(elem, "ignoreUnsupportedPragmas", ignoreUnsupportedPragmas); fromElem(elem, "allinst", allinst); fromElem(elem, "stackStomp", stackStomp); fromElem(elem, "compiler", compiler); fromElem(elem, "otherDMD", otherDMD); fromElem(elem, "cccmd", cccmd); fromElem(elem, "ccTransOpt", ccTransOpt); fromElem(elem, "program", program); fromElem(elem, "imppath", imppath); fromElem(elem, "fileImppath", fileImppath); fromElem(elem, "outdir", outdir); fromElem(elem, "objdir", objdir); fromElem(elem, "objname", objname); fromElem(elem, "libname", libname); fromElem(elem, "doDocComments", doDocComments); fromElem(elem, "docdir", docdir); fromElem(elem, "docname", docname); fromElem(elem, "modules_ddoc", modules_ddoc); fromElem(elem, "ddocfiles", ddocfiles); fromElem(elem, "doHdrGeneration", doHdrGeneration); fromElem(elem, "hdrdir", hdrdir); fromElem(elem, "hdrname", hdrname); fromElem(elem, "doXGeneration", doXGeneration); fromElem(elem, "xfilename", xfilename); fromElem(elem, "debuglevel", debuglevel); fromElem(elem, "debugids", debugids); fromElem(elem, "versionlevel", versionlevel); fromElem(elem, "versionids", versionids); fromElem(elem, "dump_source", dump_source); fromElem(elem, "mapverbosity", mapverbosity); fromElem(elem, "createImplib", createImplib); fromElem(elem, "defaultlibname", defaultlibname); fromElem(elem, "debuglibname", debuglibname); fromElem(elem, "moduleDepsFile", moduleDepsFile); fromElem(elem, "run", run); fromElem(elem, "runargs", runargs); fromElem(elem, "runCv2pdb", runCv2pdb); fromElem(elem, "pathCv2pdb", pathCv2pdb); fromElem(elem, "cv2pdbPre2043", cv2pdbPre2043); fromElem(elem, "cv2pdbNoDemangle", cv2pdbNoDemangle); fromElem(elem, "cv2pdbEnumType", cv2pdbEnumType); fromElem(elem, "cv2pdbOptions", cv2pdbOptions); // Linker stuff fromElem(elem, "objfiles", objfiles); fromElem(elem, "linkswitches", linkswitches); fromElem(elem, "libfiles", libfiles); fromElem(elem, "libpaths", libpaths); fromElem(elem, "deffile", deffile); fromElem(elem, "resfile", resfile); fromElem(elem, "exefile", exefile); fromElem(elem, "useStdLibPath", useStdLibPath); fromElem(elem, "cRuntime", cRuntime); fromElem(elem, "privatePhobos", privatePhobos); fromElem(elem, "additionalOptions", additionalOptions); fromElem(elem, "preBuildCommand", preBuildCommand); fromElem(elem, "postBuildCommand", postBuildCommand); fromElem(elem, "debugtarget", debugtarget); fromElem(elem, "debugarguments", debugarguments); fromElem(elem, "debugworkingdir", debugworkingdir); fromElem(elem, "debugattach", debugattach); fromElem(elem, "debugremote", debugremote); fromElem(elem, "debugEngine", debugEngine); fromElem(elem, "debugStdOutToOutputWindow", debugStdOutToOutputWindow); fromElem(elem, "pauseAfterRunning", pauseAfterRunning); fromElem(elem, "filesToClean", filesToClean); } }; class ConfigProvider : DisposingComObject, // IVsExtensibleObject, IVsCfgProvider2, IVsProjectCfgProvider { this(Project prj) { mProject = prj; // mConfigs ~= addref(new Config(this, "Debug")); // mConfigs ~= addref(new Config(this, "Release")); } Config addConfig(string name, string platform) { Config cfg = newCom!Config(this, name, platform); mConfigs ~= addref(cfg); return cfg; } void addConfigsToXml(xml.Document doc) { foreach(Config cfg; mConfigs) { auto config = new xml.Element("Config"); xml.setAttribute(config, "name", cfg.mName); xml.setAttribute(config, "platform", cfg.mPlatform); ProjectOptions opt = cfg.GetProjectOptions(); opt.writeXML(config); doc ~= config; } } override void Dispose() { foreach(Config cfg; mConfigs) release(cfg); mConfigs = mConfigs.init; } override HRESULT QueryInterface(in IID* riid, void** pvObject) { //mixin(LogCallMix); if(queryInterface!(IVsCfgProvider) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsCfgProvider2) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsProjectCfgProvider) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } // IVsCfgProvider override int GetCfgs( /* [in] */ in ULONG celt, /* [size_is][out][in] */ IVsCfg *rgpcfg, /* [optional][out] */ ULONG *pcActual, /* [optional][out] */ VSCFGFLAGS *prgfFlags) { debug(FULL_DBG) mixin(LogCallMix); for(int i = 0; i < celt && i < mConfigs.length; i++) rgpcfg[i] = addref(mConfigs[i]); if(pcActual) *pcActual = mConfigs.length; if(prgfFlags) *prgfFlags = cast(VSCFGFLAGS) 0; return S_OK; } // IVsProjectCfgProvider override int OpenProjectCfg( /* [in] */ in wchar* szProjectCfgCanonicalName, /* [out] */ IVsProjectCfg *ppIVsProjectCfg) { mixin(LogCallMix); return returnError(E_NOTIMPL); } override int get_UsesIndependentConfigurations( /* [out] */ BOOL *pfUsesIndependentConfigurations) { logCall("%s.get_UsesIndependentConfigurations(pfUsesIndependentConfigurations=%s)", this, _toLog(pfUsesIndependentConfigurations)); return returnError(E_NOTIMPL); } // IVsCfgProvider2 override int GetCfgNames( /* [in] */ in ULONG celt, /* [size_is][out][in] */ BSTR *rgbstr, /* [optional][out] */ ULONG *pcActual) { mixin(LogCallMix); int j, cnt = 0; for(int i = 0; i < mConfigs.length; i++) { for(j = 0; j < i; j++) if(mConfigs[i].mName == mConfigs[j].mName) break; if(j >= i) { if(cnt < celt && rgbstr) rgbstr[cnt] = allocBSTR(mConfigs[i].mName); cnt++; } } if(pcActual) *pcActual = cnt; return S_OK; } override int GetPlatformNames( /* [in] */ in ULONG celt, /* [size_is][out][in] */ BSTR *rgbstr, /* [optional][out] */ ULONG *pcActual) { mixin(LogCallMix); int j, cnt = 0; for(int i = 0; i < mConfigs.length; i++) { for(j = 0; j < i; j++) if(mConfigs[i].mPlatform == mConfigs[j].mPlatform) break; if(j >= i) { if(cnt < celt) rgbstr[cnt] = allocBSTR(mConfigs[i].mPlatform); cnt++; } } if(pcActual) *pcActual = cnt; return S_OK; } override int GetCfgOfName( /* [in] */ in wchar* pszCfgName, /* [in] */ in wchar* pszPlatformName, /* [out] */ IVsCfg *ppCfg) { mixin(LogCallMix); string cfg = to_string(pszCfgName); string plat = to_string(pszPlatformName); for(int i = 0; i < mConfigs.length; i++) if((plat == "" || plat == mConfigs[i].mPlatform) && (cfg == "" || mConfigs[i].mName == cfg)) { *ppCfg = addref(mConfigs[i]); return S_OK; } return returnError(E_INVALIDARG); } extern(D) void NotifyConfigEvent(void delegate(IVsCfgProviderEvents) dg) { // make a copy of the callback list, because it might change during execution of the callback IVsCfgProviderEvents[] cbs; foreach(cb; mCfgProviderEvents) cbs ~= cb; foreach(cb; cbs) dg(cb); } override int AddCfgsOfCfgName( /* [in] */ in wchar* pszCfgName, /* [in] */ in wchar* pszCloneCfgName, /* [in] */ in BOOL fPrivate) { mixin(LogCallMix); string strCfgName = to_string(pszCfgName); string strCloneCfgName = to_string(pszCloneCfgName); // Check if the CfgName already exists and that CloneCfgName exists Config clonecfg; foreach(c; mConfigs) if(c.mName == strCfgName) return returnError(E_FAIL); else if(c.mName == strCloneCfgName) clonecfg = c; if(strCloneCfgName.length && !clonecfg) return returnError(E_FAIL); //if(!mProject.QueryEditProjectFile()) // return returnError(E_ABORT); // copy configs for all platforms int cnt = mConfigs.length; for(int i = 0; i < cnt; i++) if(mConfigs[i].mName == strCloneCfgName) { Config config = newCom!Config(this, strCfgName, mConfigs[i].mPlatform, mConfigs[i].mProjectOptions); mConfigs ~= addref(config); } NotifyConfigEvent(delegate (IVsCfgProviderEvents cb) { cb.OnCfgNameAdded(pszCfgName); }); mProject.GetProjectNode().SetProjectFileDirty(true); // dirty the project file return S_OK; } override int DeleteCfgsOfCfgName( /* [in] */ in wchar* pszCfgName) { logCall("%s.DeleteCfgsOfCfgName(pszCfgName=%s)", this, _toLog(pszCfgName)); string strCfgName = to_string(pszCfgName); int cnt = mConfigs.length; for(int i = 0; i < mConfigs.length; ) if(mConfigs[i].mName == strCfgName) mConfigs = mConfigs[0..i] ~ mConfigs[i+1..$]; else i++; if(cnt == mConfigs.length) return returnError(E_FAIL); NotifyConfigEvent(delegate (IVsCfgProviderEvents cb) { cb.OnCfgNameDeleted(pszCfgName); }); mProject.GetProjectNode().SetProjectFileDirty(true); // dirty the project file return S_OK; } override int RenameCfgsOfCfgName( /* [in] */ in wchar* pszOldName, /* [in] */ in wchar* pszNewName) { mixin(LogCallMix2); string strOldName = to_string(pszOldName); string strNewName = to_string(pszNewName); Config config; foreach(c; mConfigs) if(c.mName == strNewName) return returnError(E_FAIL); else if(c.mName == strOldName) config = c; if(!config) return returnError(E_FAIL); //if(!mProject.QueryEditProjectFile()) // return returnError(E_ABORT); foreach(c; mConfigs) if(c.mName == strOldName) c.mName = strNewName; NotifyConfigEvent(delegate (IVsCfgProviderEvents cb) { cb.OnCfgNameRenamed(pszOldName, pszNewName); }); mProject.GetProjectNode().SetProjectFileDirty(true); // dirty the project file return S_OK; } override int AddCfgsOfPlatformName( /* [in] */ in wchar* pszPlatformName, /* [in] */ in wchar* pszClonePlatformName) { logCall("%s.AddCfgsOfPlatformName(pszPlatformName=%s,pszClonePlatformName=%s)", this, _toLog(pszPlatformName), _toLog(pszClonePlatformName)); string strPlatformName = to_string(pszPlatformName); string strClonePlatformName = to_string(pszClonePlatformName); // Check if the CfgName already exists and that CloneCfgName exists Config clonecfg; foreach(c; mConfigs) if(c.mPlatform == strPlatformName) return returnError(E_FAIL); else if(c.mPlatform == strClonePlatformName) clonecfg = c; if(strClonePlatformName.length && !clonecfg) return returnError(E_FAIL); //if(!mProject.QueryEditProjectFile()) // return returnError(E_ABORT); int cnt = mConfigs.length; for(int i = 0; i < cnt; i++) if(mConfigs[i].mPlatform == strClonePlatformName) { Config config = newCom!Config(this, mConfigs[i].mName, strPlatformName, mConfigs[i].mProjectOptions); mConfigs ~= addref(config); } NotifyConfigEvent(delegate (IVsCfgProviderEvents cb) { cb.OnPlatformNameAdded(pszPlatformName); }); mProject.GetProjectNode().SetProjectFileDirty(true); // dirty the project file return S_OK; } override int DeleteCfgsOfPlatformName( /* [in] */ in wchar* pszPlatformName) { logCall("%s.DeleteCfgsOfPlatformName(pszPlatformName=%s)", this, _toLog(pszPlatformName)); string strPlatformName = to_string(pszPlatformName); int cnt = mConfigs.length; for(int i = 0; i < mConfigs.length; ) if(mConfigs[i].mPlatform == strPlatformName) mConfigs = mConfigs[0..i] ~ mConfigs[i+1..$]; else i++; if(cnt == mConfigs.length) return returnError(E_FAIL); NotifyConfigEvent(delegate (IVsCfgProviderEvents cb) { cb.OnPlatformNameDeleted(pszPlatformName); }); mProject.GetProjectNode().SetProjectFileDirty(true); // dirty the project file return S_OK; } override int GetSupportedPlatformNames( /* [in] */ in ULONG celt, /* [size_is][out][in] */ BSTR *rgbstr, /* [optional][out] */ ULONG *pcActual) { mixin(LogCallMix); for(int cnt = 0; cnt < kPlatforms.length && cnt < celt && rgbstr; cnt++) rgbstr[cnt] = allocBSTR(kPlatforms[cnt]); if(pcActual) *pcActual = kPlatforms.length; return S_OK; } override int GetCfgProviderProperty( /* [in] */ in VSCFGPROPID propid, /* [out] */ VARIANT *var) { mixin(LogCallMix); switch(propid) { case VSCFGPROPID_SupportsCfgAdd: case VSCFGPROPID_SupportsCfgDelete: case VSCFGPROPID_SupportsCfgRename: case VSCFGPROPID_SupportsPlatformAdd: case VSCFGPROPID_SupportsPlatformDelete: var.vt = VT_BOOL; var.boolVal = true; return S_OK; default: break; } return returnError(E_NOTIMPL); } override int AdviseCfgProviderEvents( /* [in] */ IVsCfgProviderEvents pCPE, /* [out] */ VSCOOKIE *pdwCookie) { mixin(LogCallMix); *pdwCookie = ++mLastCfgProviderEventsCookie; mCfgProviderEvents[mLastCfgProviderEventsCookie] = addref(pCPE); return S_OK; } override int UnadviseCfgProviderEvents( /* [in] */ in VSCOOKIE dwCookie) { logCall("%s.UnadviseCfgProviderEvents(dwCookie=%s)", this, _toLog(dwCookie)); if(dwCookie in mCfgProviderEvents) { release(mCfgProviderEvents[dwCookie]); mCfgProviderEvents.remove(dwCookie); return S_OK; } return returnError(E_FAIL); } private: Project mProject; Config[] mConfigs; IVsCfgProviderEvents[VSCOOKIE] mCfgProviderEvents; VSCOOKIE mLastCfgProviderEventsCookie; } interface ConfigModifiedListener : IUnknown { void OnConfigModified(); } class Config : DisposingComObject, IVsProjectCfg2, IVsDebuggableProjectCfg, IVsBuildableProjectCfg, ISpecifyPropertyPages { static const GUID iid = { 0x402744c1, 0xe382, 0x4877, [ 0x9e, 0x38, 0x26, 0x9c, 0xb7, 0xa3, 0xb8, 0x9d ] }; this(ConfigProvider provider, string name, string platform, ProjectOptions opts = null) { mProvider = provider; if (opts) { mProjectOptions = clone(opts); //mProjectOptions.setDebug(name == "Debug"); mProjectOptions.setX64(platform == "x64"); } else mProjectOptions = new ProjectOptions(name == "Debug", platform == "x64"); mBuilder = new CBuilderThread(this); version(hasOutputGroup) mOutputGroup = newCom!VsOutputGroup(this); mName = name; mPlatform = platform; } override void Dispose() { mBuilder.Dispose(); } override ULONG AddRef() { return super.AddRef(); } override ULONG Release() { return super.Release(); } override HRESULT QueryInterface(in IID* riid, void** pvObject) { //mixin(LogCallMix); if(queryInterface!(Config) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsCfg) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsProjectCfg) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsProjectCfg2) (this, riid, pvObject)) return S_OK; if(queryInterface!(ISpecifyPropertyPages) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsDebuggableProjectCfg) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsBuildableProjectCfg) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } // ISpecifyPropertyPages override int GetPages( /* [out] */ CAUUID *pPages) { mixin(LogCallMix); CHierNode[] nodes; CFileNode file; CProjectNode proj; if(GetProject().GetSelectedNodes(nodes) == S_OK) { foreach(n; nodes) { if(!file) file = cast(CFileNode) n; if(!proj) proj = cast(CProjectNode) n; } } if (!proj) return PropertyPageFactory.GetFilePages(pPages); return PropertyPageFactory.GetProjectPages(pPages, false); } // IVsCfg override int get_DisplayName(BSTR *pbstrDisplayName) { logCall("%s.get_DisplayName(pbstrDisplayName=%s)", this, _toLog(pbstrDisplayName)); *pbstrDisplayName = allocBSTR(getCfgName()); return S_OK; } override int get_IsDebugOnly(BOOL *pfIsDebugOnly) { logCall("%s.get_IsDebugOnly(pfIsDebugOnly=%s)", this, _toLog(pfIsDebugOnly)); *pfIsDebugOnly = (mName == "Debug"); return S_OK; } override int get_IsReleaseOnly(BOOL *pfIsReleaseOnly) { logCall("%s.get_IsReleaseOnly(pfIsReleaseOnly=%s)", this, _toLog(pfIsReleaseOnly)); *pfIsReleaseOnly = (mName == "Release"); return S_OK; } // IVsProjectCfg override int EnumOutputs(IVsEnumOutputs *ppIVsEnumOutputs) { mixin(LogCallMix); *ppIVsEnumOutputs = addref(newCom!DEnumOutputs(this, 0)); return S_OK; } override int OpenOutput(in wchar* szOutputCanonicalName, IVsOutput *ppIVsOutput) { mixin(LogCallMix); return returnError(E_NOTIMPL); } override int get_ProjectCfgProvider(/* [out] */ IVsProjectCfgProvider *ppIVsProjectCfgProvider) { mixin(LogCallMix); *ppIVsProjectCfgProvider = addref(mProvider); return S_OK; } override int get_BuildableProjectCfg( /* [out] */ IVsBuildableProjectCfg *ppIVsBuildableProjectCfg) { mixin(LogCallMix); *ppIVsBuildableProjectCfg = addref(this); return S_OK; } override int get_CanonicalName( /* [out] */ BSTR *pbstrCanonicalName) { logCall("get_CanonicalName(pbstrCanonicalName=%s)", _toLog(pbstrCanonicalName)); return returnError(E_NOTIMPL); } override int get_Platform( /* [out] */ GUID *pguidPlatform) { // The documentation says this is obsolete, so don't do anything. // mixin(LogCallMix); *pguidPlatform = GUID(); //GUID_VS_PLATFORM_WIN32_X86; return returnError(E_NOTIMPL); } override int get_IsPackaged( /* [out] */ BOOL *pfIsPackaged) { logCall("get_IsPackaged(pfIsPackaged=%s)", _toLog(pfIsPackaged)); return returnError(E_NOTIMPL); } override int get_IsSpecifyingOutputSupported( /* [out] */ BOOL *pfIsSpecifyingOutputSupported) { logCall("get_IsSpecifyingOutputSupported(pfIsSpecifyingOutputSupported=%s)", _toLog(pfIsSpecifyingOutputSupported)); return returnError(E_NOTIMPL); } override int get_TargetCodePage( /* [out] */ UINT *puiTargetCodePage) { logCall("get_TargetCodePage(puiTargetCodePage=%s)", _toLog(puiTargetCodePage)); return returnError(E_NOTIMPL); } override int get_UpdateSequenceNumber( /* [out] */ ULARGE_INTEGER *puliUSN) { mixin(LogCallMix); return returnError(E_NOTIMPL); } override int get_RootURL( /* [out] */ BSTR *pbstrRootURL) { logCall("get_RootURL(pbstrRootURL=%s)", _toLog(pbstrRootURL)); return returnError(E_NOTIMPL); } // IVsProjectCfg2 override int get_CfgType( /* [in] */ in IID* iidCfg, /* [iid_is][out] */ void **ppCfg) { debug(FULL_DBG) mixin(LogCallMix); return QueryInterface(iidCfg, ppCfg); } override int get_OutputGroups( /* [in] */ in ULONG celt, /* [size_is][out][in] */ IVsOutputGroup *rgpcfg, /* [optional][out] */ ULONG *pcActual) { mixin(LogCallMix); version(hasOutputGroup) { if(celt >= 1) *rgpcfg = addref(mOutputGroup); if(pcActual) *pcActual = 1; return S_OK; } else { return returnError(E_NOTIMPL); } } override int OpenOutputGroup( /* [in] */ in wchar* szCanonicalName, /* [out] */ IVsOutputGroup *ppIVsOutputGroup) { mixin(LogCallMix); version(hasOutputGroup) { if(to_wstring(szCanonicalName) != to_wstring(VS_OUTPUTGROUP_CNAME_Built)) return returnError(E_INVALIDARG); *ppIVsOutputGroup = addref(mOutputGroup); return S_OK; } else { return returnError(E_NOTIMPL); } } override int OutputsRequireAppRoot( /* [out] */ BOOL *pfRequiresAppRoot) { logCall("%s.OutputsRequireAppRoot(pfRequiresAppRoot=%s)", this, _toLog(pfRequiresAppRoot)); return returnError(E_NOTIMPL); } override int get_VirtualRoot( /* [out] */ BSTR *pbstrVRoot) { logCall("%s.get_VirtualRoot(pbstrVRoot=%s)", this, _toLog(pbstrVRoot)); return returnError(E_NOTIMPL); } override int get_IsPrivate( /* [out] */ BOOL *pfPrivate) { logCall("%s.get_IsPrivate(pfPrivate=%s)", this, _toLog(pfPrivate)); return returnError(E_NOTIMPL); } // IVsDebuggableProjectCfg override int DebugLaunch( /* [in] */ in VSDBGLAUNCHFLAGS grfLaunch) { logCall("%s.DebugLaunch(grfLaunch=%s)", this, _toLog(grfLaunch)); string prg = mProjectOptions.replaceEnvironment(mProjectOptions.debugtarget, this); if (prg.length == 0) return S_OK; if(!isAbsolute(prg)) prg = GetProjectDir() ~ "\\" ~ prg; //prg = quoteFilename(prg); string workdir = mProjectOptions.replaceEnvironment(mProjectOptions.debugworkingdir, this); if(!isAbsolute(workdir)) workdir = GetProjectDir() ~ "\\" ~ workdir; Package.GetGlobalOptions().addExecutionPath(workdir); string args = mProjectOptions.replaceEnvironment(mProjectOptions.debugarguments, this); if(DBGLAUNCH_NoDebug & grfLaunch) { if(mProjectOptions.pauseAfterRunning) { args = "/c " ~ quoteFilename(prg) ~ " " ~ args ~ " & pause"; prg = getCmdPath(); } ShellExecuteW(null, null, toUTF16z(quoteFilename(prg)), toUTF16z(args), toUTF16z(workdir), SW_SHOWNORMAL); return(S_OK); } return _DebugLaunch(prg, workdir, args, mProjectOptions.debugEngine); } HRESULT _DebugLaunch(string prg, string workdir, string args, int engine) { HRESULT hr = E_NOTIMPL; // When the debug target is the project build output, the project have to use // IVsSolutionDebuggingAssistant2 to determine if the target was deployed. // The interface allows the project to find out where the outputs were deployed to // and direct the debugger to the deployed locations as appropriate. // Projects start out their debugging sessions by calling MapOutputToDeployedURLs(). // Here we do not use IVsSolutionDebuggingAssistant2 because our debug target is // explicitly set in the project options and it is not built by the project. // For demo of how to use IVsSolutionDebuggingAssistant2 refer to MycPrj sample in the // Environment SDK. if(IVsDebugger srpVsDebugger = queryService!(IVsDebugger)) { scope(exit) release(srpVsDebugger); // if bstr-parameters not passed as BSTR parameters, VS2010 crashes on some systems // not sure if they can be free'd afterwards... VsDebugTargetInfo dbgi; dbgi.cbSize = VsDebugTargetInfo.sizeof; dbgi.bstrRemoteMachine = null; string remote = mProjectOptions.replaceEnvironment(mProjectOptions.debugremote, this); if(remote.length == 0) { if(!std.file.exists(prg)) { UtilMessageBox("The program to launch does not exist:\n" ~ prg, MB_OK, "Launch Debugger"); return S_FALSE; } if(workdir.length && !isExistingDir(workdir)) { UtilMessageBox("The working directory does not exist:\n" ~ workdir, MB_OK, "Launch Debugger"); return S_FALSE; } } else dbgi.bstrRemoteMachine = allocBSTR(remote); // _toUTF16z(remote); dbgi.dlo = DLO_CreateProcess; // DLO_Custom; // specifies how this process should be launched // clsidCustom is the clsid of the debug engine to use to launch the debugger switch(engine) { case 1: GUID GUID_MaGoDebugger = uuid("{97348AC0-2B6B-4B99-A245-4C7E2C09D403}"); dbgi.clsidCustom = GUID_MaGoDebugger; break; case 2: dbgi.clsidCustom = GUID_COMPlusNativeEng; // the mixed-mode debugger (works only on x86) break; default: dbgi.clsidCustom = GUID_NativeOnlyEng; // works for x64 break; } dbgi.bstrMdmRegisteredName = null; // used with DLO_AlreadyRunning. The name of the // app as it is registered with the MDM. dbgi.bstrExe = allocBSTR(prg); // _toUTF16z(prg); dbgi.bstrCurDir = allocBSTR(workdir); // _toUTF16z(workdir); dbgi.bstrArg = allocBSTR(args); // _toUTF16z(args); dbgi.fSendStdoutToOutputWindow = mProjectOptions.debugStdOutToOutputWindow; hr = srpVsDebugger.LaunchDebugTargets(1, &dbgi); if (FAILED(hr)) { string msg = format("cannot launch debugger on %s\nhr = %x", prg, hr); mProvider.mProject.SetErrorInfo(E_FAIL, msg); hr = E_FAIL; } } return(hr); } override int QueryDebugLaunch( /* [in] */ in VSDBGLAUNCHFLAGS grfLaunch, /* [out] */ BOOL *pfCanLaunch) { // mixin(LogCallMix); *pfCanLaunch = true; return S_OK; // returnError(E_NOTIMPL); } // IVsBuildableProjectCfg override int get_ProjectCfg( /* [out] */ IVsProjectCfg *ppIVsProjectCfg) { mixin(LogCallMix); return returnError(E_NOTIMPL); } override int AdviseBuildStatusCallback( /* [in] */ IVsBuildStatusCallback pIVsBuildStatusCallback, /* [out] */ VSCOOKIE *pdwCookie) { mixin(LogCallMix); *pdwCookie = ++mLastBuildStatusCookie; mBuildStatusCallbacks[mLastBuildStatusCookie] = addref(pIVsBuildStatusCallback); mTicking[mLastBuildStatusCookie] = false; mStarted[mLastBuildStatusCookie] = false; return S_OK; } override int UnadviseBuildStatusCallback( /* [in] */ in VSCOOKIE dwCookie) { // mixin(LogCallMix); if(dwCookie in mBuildStatusCallbacks) { release(mBuildStatusCallbacks[dwCookie]); mBuildStatusCallbacks.remove(dwCookie); mTicking.remove(dwCookie); mStarted.remove(dwCookie); return S_OK; } return returnError(E_FAIL); } override int StartBuild( /* [in] */ IVsOutputWindowPane pIVsOutputWindowPane, /* [in] */ in DWORD dwOptions) { mixin(LogCallMix); if(dwOptions & VS_BUILDABLEPROJECTCFGOPTS_REBUILD) return mBuilder.Start(CBuilderThread.Operation.eRebuild, pIVsOutputWindowPane); return mBuilder.Start(CBuilderThread.Operation.eBuild, pIVsOutputWindowPane); } override int StartClean( /* [in] */ IVsOutputWindowPane pIVsOutputWindowPane, /* [in] */ in DWORD dwOptions) { mixin(LogCallMix); return mBuilder.Start(CBuilderThread.Operation.eClean, pIVsOutputWindowPane); } override int StartUpToDateCheck( /* [in] */ IVsOutputWindowPane pIVsOutputWindowPane, /* [in] */ in DWORD dwOptions) { mixin(LogCallMix); HRESULT rc = mBuilder.Start(CBuilderThread.Operation.eCheckUpToDate, pIVsOutputWindowPane); return rc == S_OK ? S_OK : E_FAIL; // E_FAIL used to indicate "not uptodate" //return returnError(E_NOTIMPL); //S_OK; } override int QueryStatus( /* [out] */ BOOL *pfBuildDone) { logCall("%s.QueryStatus(pfBuildDone=%s)", this, _toLog(pfBuildDone)); mBuilder.QueryStatus(pfBuildDone); return S_OK; } override int Stop( /* [in] */ in BOOL fSync) { logCall("%s.Stop(fSync=%s)", this, _toLog(fSync)); mBuilder.Stop(fSync); return S_OK; } override int Wait( /* [in] */ in DWORD dwMilliseconds, /* [in] */ in BOOL fTickWhenMessageQNotEmpty) { mixin(LogCallMix); return returnError(E_NOTIMPL); } override int QueryStartBuild( /* [in] */ in DWORD dwOptions, /* [optional][out] */ BOOL *pfSupported, /* [optional][out] */ BOOL *pfReady) { debug(FULL_DBG) mixin(LogCallMix); if(pfSupported) *pfSupported = true; if(pfReady) { mBuilder.QueryStatus(pfReady); } return S_OK; // returnError(E_NOTIMPL); } override int QueryStartClean( /* [in] */ in DWORD dwOptions, /* [optional][out] */ BOOL *pfSupported, /* [optional][out] */ BOOL *pfReady) { mixin(LogCallMix); if(pfSupported) *pfSupported = true; if(pfReady) { mBuilder.QueryStatus(pfReady); } return S_OK; // returnError(E_NOTIMPL); } override int QueryStartUpToDateCheck( /* [in] */ in DWORD dwOptions, /* [optional][out] */ BOOL *pfSupported, /* [optional][out] */ BOOL *pfReady) { mixin(LogCallMix); if(pfSupported) *pfSupported = true; if(pfReady) { mBuilder.QueryStatus(pfReady); } return S_OK; // returnError(E_NOTIMPL); } ////////////////////////////////////////////////////////////////////////////// void AddModifiedListener(ConfigModifiedListener listener) { mModifiedListener.addunique(listener); } void RemoveModifiedListener(ConfigModifiedListener listener) { mModifiedListener.remove(listener); } ////////////////////////////////////////////////////////////////////////////// void SetDirty() { mProvider.mProject.GetProjectNode().SetProjectFileDirty(true); foreach(listener; mModifiedListener) listener.OnConfigModified(); } CProjectNode GetProjectNode() { return mProvider.mProject.GetProjectNode(); } string GetProjectPath() { return mProvider.mProject.GetFilename(); } string GetProjectDir() { return dirName(mProvider.mProject.GetFilename()); } string GetProjectName() { return mProvider.mProject.GetProjectNode().GetName(); } Project GetProject() { return mProvider.mProject; } ProjectOptions GetProjectOptions() { return mProjectOptions; } string GetTargetPath() { string exe = mProjectOptions.getTargetPath(); return mProjectOptions.replaceEnvironment(exe, this); } string GetDependenciesPath() { string exe = mProjectOptions.getDependenciesPath(); return mProjectOptions.replaceEnvironment(exe, this); } string GetLinkDependenciesPath() { string dep = GetDependenciesPath(); assert(dep[$-4..$] == ".dep"); return dep[0..$-4] ~ ".lnkdep"; } string GetCppCompiler() { switch(mProjectOptions.compiler) { default: case Compiler.DMD: return mProjectOptions.mscoff || mProjectOptions.isX86_64 ? "cl" : "dmc"; case Compiler.GDC: return "gcc"; case Compiler.LDC: return "clang"; } } bool hasLinkDependencies() { return mProjectOptions.callLinkerDirectly() && Package.GetGlobalOptions().optlinkDeps; } string GetCommandLinePath() { string exe = mProjectOptions.getCommandLinePath(); return mProjectOptions.replaceEnvironment(exe, this); } string GetOutDir() { return mProjectOptions.replaceEnvironment(mProjectOptions.outdir, this); } string GetIntermediateDir() { return mProjectOptions.replaceEnvironment(mProjectOptions.objdir, this); } string[] GetDependencies(CFileNode file) { string tool = GetCompileTool(file); if(tool == "Custom" || tool == kToolResourceCompiler || tool == kToolCpp) { string outfile = GetOutputFile(file); string dep = file.GetDependencies(getCfgName()); dep = mProjectOptions.replaceEnvironment(dep, this, file.GetFilename(), outfile); string[] deps = tokenizeArgs(dep); deps ~= file.GetFilename(); string workdir = GetProjectDir(); foreach(ref string s; deps) s = makeFilenameAbsolute(s, workdir); return deps; } if(tool == "DMDsingle") { string outfile = GetOutputFile(file); string depfile = outfile ~ ".dep"; depfile = mProjectOptions.replaceEnvironment(depfile, this, file.GetFilename(), outfile); string workdir = GetProjectDir(); string deppath = makeFilenameAbsolute(depfile, workdir); string[] files; bool depok = false; if(std.file.exists(deppath)) depok = getFilenamesFromDepFile(deppath, files); if(!depok) files ~= deppath; // force update without if dependency file does not exist or is invalid files ~= file.GetFilename(); files ~= getDDocFileList(); makeFilenamesAbsolute(files, workdir); return files; } return null; } bool isUptodate(CFileNode file, string* preason) { string fcmd = GetCompileCommand(file); if(fcmd.length == 0) return true; string outfile = GetOutputFile(file); outfile = mProjectOptions.replaceEnvironment(outfile, this, file.GetFilename(), outfile); string workdir = GetProjectDir(); string cmdfile = makeFilenameAbsolute(outfile ~ "." ~ kCmdLogFileExtension, workdir); if(!compareCommandFile(cmdfile, fcmd)) { if(preason) *preason = "command line has changed"; return false; } string[] deps = GetDependencies(file); outfile = makeFilenameAbsolute(outfile, workdir); string oldestFile, newestFile; long targettm = getOldestFileTime( [ outfile ], oldestFile ); long sourcetm = getNewestFileTime(deps, newestFile); if(targettm > sourcetm) return true; if(file.GetUptodateWithSameTime(getCfgName()) && targettm == sourcetm) return true; if(preason) *preason = newestFile ~ " is newer"; return false; } static bool IsResource(CFileNode file) { string tool = file.GetTool(null); if(tool == "") if(toLower(extension(file.GetFilename())) == ".rc") return true; return tool == kToolResourceCompiler; } static string GetStaticCompileTool(CFileNode file, string cfgname) { string tool = file.GetTool(cfgname); if(tool == "") { string fname = file.GetFilename(); string ext = toLower(extension(fname)); if(isIn(ext, ".d", ".ddoc", ".def", ".lib", ".obj", ".o", ".res")) tool = "DMD"; else if(ext == "rc") tool = kToolResourceCompiler; else if(isIn(ext, ".c", ".cpp", ".cxx", ".cc")) tool = kToolCpp; } return tool; } string GetCompileTool(CFileNode file) { string tool = file.GetTool(getCfgName()); if(tool == "") { string fname = file.GetFilename(); string ext = toLower(extension(fname)); if(ext == ".d" && mProjectOptions.compilationModel == ProjectOptions.kSingleFileCompilation) tool = "DMDsingle"; else if(isIn(ext, ".d", ".ddoc", ".def", ".lib", ".obj", ".o", ".res")) tool = "DMD"; else if(ext == "rc") tool = kToolResourceCompiler; else if(isIn(ext, ".c", ".cpp", ".cxx", ".cc")) tool = kToolCpp; } return tool; } string GetOutputFile(CFileNode file, string tool = null) { if(tool.empty) tool = GetCompileTool(file); string fname; if(tool == "DMD") return file.GetFilename(); if(tool == "DMDsingle") fname = mProjectOptions.objdir ~ "\\" ~ safeFilename(stripExtension(file.GetFilename())) ~ "." ~ mProjectOptions.objectFileExtension(); if(tool == "RDMD") fname = mProjectOptions.outdir ~ "\\" ~ safeFilename(stripExtension(file.GetFilename())) ~ ".exe"; if(tool == kToolResourceCompiler) fname = mProjectOptions.objdir ~ "\\" ~ safeFilename(stripExtension(file.GetFilename()), "_") ~ ".res"; if(tool == kToolCpp) fname = mProjectOptions.objdir ~ "\\" ~ safeFilename(stripExtension(file.GetFilename()), "_") ~ ".obj"; if(tool == "Custom") fname = file.GetOutFile(getCfgName()); if(fname.length) fname = mProjectOptions.replaceEnvironment(fname, this, file.GetFilename()); return fname; } string expandedAbsoluteFilename(string name) { string workdir = GetProjectDir(); string expname = mProjectOptions.replaceEnvironment(name, this); string absname = makeFilenameAbsolute(expname, workdir); return absname; } string GetBuildLogFile() { return expandedAbsoluteFilename("$(INTDIR)\\$(SAFEPROJECTNAME).buildlog.html"); } string[] GetBuildFiles() { string workdir = normalizeDir(GetProjectDir()); string outdir = normalizeDir(makeFilenameAbsolute(GetOutDir(), workdir)); string intermediatedir = normalizeDir(makeFilenameAbsolute(GetIntermediateDir(), workdir)); string target = makeFilenameAbsolute(GetTargetPath(), workdir); string cmdfile = makeFilenameAbsolute(GetCommandLinePath(), workdir); string[] files; files ~= target; files ~= cmdfile; files ~= cmdfile ~ ".rsp"; files ~= makeFilenameAbsolute(GetDependenciesPath(), workdir); files ~= makeFilenameAbsolute(GetLinkDependenciesPath(), workdir); if(mProjectOptions.usesCv2pdb()) { files ~= target ~ "_cv"; files ~= setExtension(target, "pdb"); } string mapfile = expandedAbsoluteFilename("$(INTDIR)\\$(SAFEPROJECTNAME).map"); files ~= mapfile; string buildlog = GetBuildLogFile(); files ~= buildlog; if(mProjectOptions.createImplib) files ~= setExtension(target, "lib"); if(mProjectOptions.doDocComments) { if(mProjectOptions.docdir.length) files ~= expandedAbsoluteFilename(normalizeDir(mProjectOptions.docdir)) ~ "*.html"; if(mProjectOptions.docname.length) files ~= expandedAbsoluteFilename(mProjectOptions.docname); if(mProjectOptions.modules_ddoc) files ~= expandedAbsoluteFilename(mProjectOptions.modules_ddoc); } if(mProjectOptions.doHdrGeneration) { if(mProjectOptions.hdrdir.length) files ~= expandedAbsoluteFilename(normalizeDir(mProjectOptions.hdrdir)) ~ "*.di"; if(mProjectOptions.hdrname.length) files ~= expandedAbsoluteFilename(mProjectOptions.hdrname); } if(mProjectOptions.doXGeneration) { if(mProjectOptions.xfilename.length) files ~= expandedAbsoluteFilename(mProjectOptions.xfilename); } string[] toclean = tokenizeArgs(mProjectOptions.filesToClean); foreach(s; toclean) { string uqs = unquoteArgument(s); files ~= outdir ~ uqs; if(outdir != intermediatedir) files ~= intermediatedir ~ uqs; } searchNode(mProvider.mProject.GetRootNode(), delegate (CHierNode n) { if(CFileNode file = cast(CFileNode) n) { string outname = GetOutputFile(file); if (outname.length && outname != file.GetFilename()) { files ~= makeFilenameAbsolute(outname, workdir); files ~= makeFilenameAbsolute(outname ~ "." ~ kCmdLogFileExtension, workdir); } } return false; }); return files; } string GetCompileCommand(CFileNode file, bool syntaxOnly = false, string tool = null, string addopt = null) { if(tool.empty) tool = GetCompileTool(file); string cmd; string outfile = GetOutputFile(file, tool); if(tool == kToolResourceCompiler) { cmd = "rc /fo" ~ quoteFilename(outfile); string include = Package.GetGlobalOptions().IncSearchPath; if(include.length) { string[] incs = tokenizeArgs(include); foreach(string inc; incs) cmd ~= " /I" ~ quoteFilename(inc); cmd = mProjectOptions.replaceEnvironment(cmd, this, outfile); } string addOpts = file.GetAdditionalOptions(getCfgName()); if(addOpts.length) cmd ~= " " ~ addOpts; cmd ~= " " ~ quoteFilename(file.GetFilename()); } if(tool == kToolCpp) { cmd = mProjectOptions.getCppCommandLine(outfile, true); string addOpts = file.GetAdditionalOptions(getCfgName()); if(addOpts.length) cmd ~= " " ~ addOpts; cmd ~= " " ~ quoteFilename(file.GetFilename()); } if(tool == "Custom") { cmd = file.GetCustomCmd(getCfgName()); } if(tool == "DMDsingle") { string depfile = GetOutputFile(file, tool) ~ ".dep"; cmd = "echo Compiling " ~ file.GetFilename() ~ "...\n"; cmd ~= mProjectOptions.buildCommandLine(true, false, false, syntaxOnly); if(syntaxOnly && mProjectOptions.compiler == Compiler.DMD) cmd ~= " -c -o-"; else if(syntaxOnly) cmd ~= " -c -fsyntax-only"; else cmd ~= " -c " ~ mProjectOptions.getOutputFileOption(outfile) ~ mProjectOptions.getDependenciesFileOption(depfile); cmd ~= " " ~ file.GetFilename(); foreach(ddoc; getDDocFileList()) cmd ~= " " ~ ddoc; } if(tool == "RDMD") { // temporarily switch to "rdmd" ProjectOptions opts = clone(mProjectOptions); opts.compiler = Compiler.DMD; opts.program = "rdmd"; opts.otherDMD = true; opts.mapverbosity = 2; // no map option opts.otherDMD = true; opts.doXGeneration = false; opts.doHdrGeneration = false; opts.doDocComments = false; opts.lib = OutputType.Executable; //opts.runCv2pdb = false; opts.exefile = "$(OutDir)\\" ~ baseName(stripExtension(outfile)) ~ ".exe"; cmd = "echo Compiling " ~ file.GetFilename() ~ "...\n"; cmd ~= opts.buildCommandLine(true, !syntaxOnly, false, syntaxOnly); if(syntaxOnly) cmd ~= " --build-only"; cmd ~= addopt ~ " " ~ file.GetFilename(); addopt = ""; // must be before filename for rdmd if (!syntaxOnly) { string cv2pdb = opts.appendCv2pdb(); if (cv2pdb.length) cmd ~= "\nif errorlevel 1 goto reportError\n" ~ opts.appendCv2pdb(); } } if(cmd.length) { cmd = getEnvironmentChanges() ~ cmd ~ addopt ~ "\n:reportError\n"; if(syntaxOnly) cmd ~= "if errorlevel 1 echo Compiling " ~ file.GetFilename() ~ " failed!\n"; else cmd ~= "if errorlevel 1 echo Building " ~ outfile ~ " failed!\n"; cmd = mProjectOptions.replaceEnvironment(cmd, this, file.GetFilename(), outfile); } return cmd; } string getEnvironmentChanges() { string cmd; bool x64 = mProjectOptions.isX86_64; bool mscoff = mProjectOptions.compiler == Compiler.DMD && mProjectOptions.mscoff; GlobalOptions globOpt = Package.GetGlobalOptions(); string exeSearchPath = x64 ? mProjectOptions.compilerDirectories.ExeSearchPath64 : mscoff ? mProjectOptions.compilerDirectories.ExeSearchPath32coff : mProjectOptions.compilerDirectories.ExeSearchPath; if(exeSearchPath.length) cmd ~= "set PATH=" ~ replaceCrLfSemi(exeSearchPath) ~ ";%PATH%\n"; string libSearchPath = x64 ? mProjectOptions.compilerDirectories.LibSearchPath64 : mscoff ? mProjectOptions.compilerDirectories.LibSearchPath32coff : mProjectOptions.compilerDirectories.LibSearchPath; bool hasGlobalPath = mProjectOptions.useStdLibPath && libSearchPath.length; if(hasGlobalPath || mProjectOptions.libpaths.length) { // obsolete? string lpath; if(hasGlobalPath) lpath = replaceCrLfSemi(libSearchPath); if(mProjectOptions.libpaths.length && !_endsWith(lpath, ";")) lpath ~= ";"; lpath ~= mProjectOptions.libpaths; if(mProjectOptions.compiler == Compiler.DMD) cmd ~= "set DMD_LIB=" ~ lpath ~ "\n"; else if(mProjectOptions.compiler == Compiler.LDC) cmd ~= "set LIB=" ~ lpath ~ "\n"; } if(x64 || mscoff) { if(globOpt.WindowsSdkDir.length) cmd ~= "set WindowsSdkDir=" ~ globOpt.WindowsSdkDir ~ "\n"; if(globOpt.VCInstallDir.length) cmd ~= "set VCINSTALLDIR=" ~ globOpt.VCInstallDir ~ "\n"; } return cmd; } string getModuleName(string fname) { string ext = toLower(extension(fname)); if(ext != ".d" && ext != ".di") return ""; string modname = getModuleDeclarationName(fname); if(modname.length > 0) return modname; return stripExtension(baseName(fname)); } string getModulesDDocCommandLine(string[] files, ref string modules_ddoc) { if(!mProjectOptions.doDocComments) return ""; string mod_cmd; modules_ddoc = strip(mProjectOptions.modules_ddoc); if(modules_ddoc.length > 0) { modules_ddoc = quoteFilename(modules_ddoc); mod_cmd = "echo MODULES = >" ~ modules_ddoc ~ "\n"; string workdir = GetProjectDir(); for(int i = 0; i < files.length; i++) { string fname = makeFilenameAbsolute(files[i], workdir); string mod = getModuleName(fname); if(mod.length > 0) { if(indexOf(mod, '.') < 0) mod = "." ~ mod; mod_cmd ~= "echo $$(MODULE " ~ mod ~ ") >>" ~ modules_ddoc ~ "\n"; } } } return mod_cmd; } string getCommandFileList(string[] files, string responsefile, ref string precmd) { if(mProjectOptions.compiler == Compiler.GDC) foreach(ref f; files) f = replace(f, "\\", "/"); files = files.dup; quoteFilenames(files); string fcmd = std.string.join(files, " "); if(fcmd.length > 100) { precmd ~= "\n"; precmd ~= "echo " ~ files[0] ~ " >" ~ quoteFilename(responsefile) ~ "\n"; for(int i = 1; i < files.length; i++) precmd ~= "echo " ~ files[i] ~ " >>" ~ quoteFilename(responsefile) ~ "\n"; precmd ~= "\n"; fcmd = " @" ~ quoteFilename(responsefile); } else if (fcmd.length) fcmd = " " ~ fcmd; if(mProjectOptions.compiler == Compiler.GDC && mProjectOptions.libfiles.length) fcmd ~= " " ~ replace(mProjectOptions.libfiles, "\\", "/"); return fcmd; } string[] getObjectFileList(string[] dfiles) { string[] files = dfiles.dup; string[] remove; bool singleObj = (mProjectOptions.compilationModel == ProjectOptions.kCombinedCompileAndLink); string targetObj; foreach(ref f; files) if(f.endsWith(".d") || f.endsWith(".D")) { if(singleObj) { if(targetObj.length) remove ~= f; else { targetObj = "$(OutDir)\\$(ProjectName)." ~ mProjectOptions.objectFileExtension(); f = targetObj; } } else { string fname = stripExtension(f); if(!mProjectOptions.preservePaths) fname = baseName(fname); fname ~= "." ~ mProjectOptions.objectFileExtension(); if(mProjectOptions.compiler == Compiler.DMD && !isAbsolute(fname)) f = mProjectOptions.objdir ~ "\\" ~ fname; else f = fname; } } foreach(r; remove) files.remove(r); return files; } string getLinkFileList(string[] dfiles, ref string precmd) { string[] files = getObjectFileList(dfiles); string responsefile = GetCommandLinePath() ~ ".lnkarg"; return getCommandFileList(files, responsefile, precmd); } string[] getSourceFileList() { string[] files; searchNode(mProvider.mProject.GetRootNode(), delegate (CHierNode n) { if(CFileNode file = cast(CFileNode) n) files ~= file.GetFilename(); return false; }); return files; } string[] getDDocFileList() { string[] files; searchNode(mProvider.mProject.GetRootNode(), delegate (CHierNode n) { if(CFileNode file = cast(CFileNode) n) { string fname = file.GetFilename(); if(extension(fname) == ".ddoc") files ~= fname; } return false; }); return files; } string[] getInputFileList() { string[] files; searchNode(mProvider.mProject.GetRootNode(), delegate (CHierNode n) { if(CFileNode file = cast(CFileNode) n) { string fname = GetOutputFile(file); if(fname.length) if(file.GetTool(getCfgName()) != "Custom" || file.GetLinkOutput(getCfgName())) files ~= fname; } return false; }); string[] libs = getLibsFromDependentProjects(); foreach(lib; libs) { // dmd also understands ".json", ".map" and ".exe", but these are shortcuts for output files string ext = toLower(extension(lib)); if(ext.isIn(".d", ".di", ".o", ".obj", ".lib", ".a", ".ddoc", ".res", ".def", ".dd", ".htm", ".html", ".xhtml")) files ~= lib; } return files; } string GetPhobosPath() { string libpath = normalizeDir(GetIntermediateDir()); string libfile = "privatephobos.lib"; return libpath ~ libfile; } string GetPhobosCommandLine() { string libpath = normalizeDir(GetIntermediateDir()); bool x64 = mProjectOptions.isX86_64; bool mscoff = mProjectOptions.compiler == Compiler.DMD && mProjectOptions.mscoff; string model = "32"; if(x64) model = "64"; else if (mscoff) model = "32mscoff"; string libfile = "privatephobos.lib"; string lib = libpath ~ libfile; string cmdfile = libpath ~ "buildphobos.bat"; string dmddir = Package.GetGlobalOptions().findDmdBinDir(); string dmdpath = dmddir ~ "dmd.exe"; string installDir = normalizeDir(Package.GetGlobalOptions().DMD.InstallDir); if(!std.file.exists(dmdpath)) return "echo dmd.exe not found in DMDInstallDir=" ~ installDir ~ " or through PATH\nexit /B 1"; string druntimePath = "src\\druntime\\src\\"; if(!std.file.exists(installDir ~ druntimePath ~ "object_.d")) druntimePath = "druntime\\src\\"; if(!std.file.exists(installDir ~ druntimePath ~ "object_.d")) return "echo druntime source not found in DMDInstallDir=" ~ installDir ~ "\nexit /B 1"; string phobosPath = "src\\phobos\\"; if(!std.file.exists(installDir ~ phobosPath ~ "std")) phobosPath = "phobos\\"; if(!std.file.exists(installDir ~ phobosPath ~ "std")) return "echo phobos source not found in DMDInstallDir=" ~ installDir ~ "\nexit /B 1"; string cmdline = "@echo off\n"; cmdline ~= "echo Building " ~ lib ~ "\n"; cmdline ~= getEnvironmentChanges(); string opts = " -lib -d " ~ mProjectOptions.dmdCommonCompileOptions(); // collect C files string[] cfiles; cfiles ~= findDRuntimeFiles(installDir, druntimePath ~ "core", true, true, true); cfiles ~= findDRuntimeFiles(installDir, phobosPath ~ "etc\\c", true, true, true); if (cfiles.length) { foreach(i, ref file; cfiles) { file = installDir ~ file; string outfile = libpath ~ "phobos-" ~ baseName(file) ~ ".obj"; string cccmd = mProjectOptions.getCppCommandLine(outfile, i == 0); cmdline ~= cccmd ~ " -DNO_snprintf " ~ file ~ "\n"; cmdline ~= "if errorlevel 1 exit /B %ERRORLEVEL%\n\n"; file = outfile; } } // collect druntime D files string[] files; files ~= druntimePath ~ "object_.d"; files ~= findDRuntimeFiles(installDir, druntimePath ~ "rt", true, false, true); files ~= findDRuntimeFiles(installDir, druntimePath ~ "core", true, false, true); files ~= findDRuntimeFiles(installDir, druntimePath ~ "gc", true, false, true); foreach(ref file; files) file = installDir ~ file; files ~= cfiles; if(model == "32") files ~= installDir ~ druntimePath ~ "rt\\minit.obj"; string dmd; if(mProjectOptions.otherDMD && mProjectOptions.program.length) dmd = quoteNormalizeFilename(mProjectOptions.program); else dmd = "dmd"; static string buildFiles(string dmd, string outlib, string[] files) { string rspfile = outlib ~ ".rsp"; string qrspfile = quoteFilename(rspfile); string cmdline = "echo. >" ~ qrspfile ~ "\n"; foreach(file; files) cmdline ~= "echo " ~ quoteFilename(file) ~ " >>" ~ qrspfile ~ "\n"; cmdline ~= dmd ~ " -of" ~ quoteFilename(outlib) ~ " @" ~ qrspfile ~ "\n\n"; return cmdline; } // because of inconsistent object.di and object_.d in dmd <2.067 we have to build // druntime and phobos seperately string druntimelib = libpath ~ "privatedruntime.lib"; cmdline ~= buildFiles(dmd ~ opts, druntimelib, files); cmdline ~= "if errorlevel 1 exit /B %ERRORLEVEL%\n\n"; // collect phobos D files files = null; files ~= findDRuntimeFiles(installDir, phobosPath ~ "std", true, false, true); files ~= findDRuntimeFiles(installDir, phobosPath ~ "etc\\c", true, false, true); foreach(ref file; files) file = installDir ~ file; cmdline ~= buildFiles(dmd ~ opts ~ " " ~ quoteFilename(druntimelib), lib, files); cmdline = mProjectOptions.replaceEnvironment(cmdline, this, null, lib); return cmdline; } bool isPhobosUptodate(string* preason) { string workdir = GetProjectDir(); string outfile = GetPhobosPath(); string lib = makeFilenameAbsolute(outfile, workdir); if (!std.file.exists(lib)) { if(preason) *preason = "does not exist"; return false; } string cmd = GetPhobosCommandLine(); if(cmd.length == 0) return true; string cmdfile = makeFilenameAbsolute(outfile ~ "." ~ kCmdLogFileExtension, workdir); if(!compareCommandFile(cmdfile, cmd)) { if(preason) *preason = "command line has changed"; return false; } // no further dependency checks return true; } string getCommandLine() { bool doLink = mProjectOptions.compilationModel != ProjectOptions.kSeparateCompileOnly; bool separateLink = mProjectOptions.doSeparateLink(); string opt = mProjectOptions.buildCommandLine(true, !separateLink && doLink, true); string workdir = normalizeDir(GetProjectDir()); bool x64 = mProjectOptions.isX86_64; bool mscoff = mProjectOptions.compiler == Compiler.DMD && mProjectOptions.mscoff; string precmd = getEnvironmentChanges(); string[] files = getInputFileList(); //quoteFilenames(files); string responsefile = GetCommandLinePath() ~ ".rsp"; string fcmd = getCommandFileList(files, responsefile, precmd); string[] srcfiles = getSourceFileList(); string modules_ddoc; string mod_cmd = getModulesDDocCommandLine(srcfiles, modules_ddoc); if(mod_cmd.length > 0) { precmd ~= mod_cmd ~ "\nif errorlevel 1 goto reportError\n"; fcmd ~= " " ~ modules_ddoc; } auto globOpts = Package.GetGlobalOptions(); if(separateLink || !doLink) { bool singleObj = (mProjectOptions.compilationModel == ProjectOptions.kCombinedCompileAndLink); if(fcmd.length == 0) opt = ""; // don't try to build zero files else if(singleObj) opt ~= " -c" ~ mProjectOptions.getOutputFileOption("$(OutDir)\\$(ProjectName)." ~ mProjectOptions.objectFileExtension()); else opt ~= " -c" ~ mProjectOptions.getOutputDirOption(); } string addopt; if(mProjectOptions.additionalOptions.length && fcmd.length) addopt = " " ~ mProjectOptions.additionalOptions; string cmd = precmd ~ opt ~ fcmd ~ addopt ~ "\n"; cmd = cmd ~ "if errorlevel 1 goto reportError\n"; if(separateLink && doLink) { string prelnk, lnkcmd; if(mProjectOptions.callLinkerDirectly()) { string libpaths, options; string otherCompiler = mProjectOptions.replaceEnvironment(mProjectOptions.otherCompilerPath(), this); string linkpath = globOpts.getLinkerPath(x64, mscoff, workdir, otherCompiler, &libpaths, &options); lnkcmd = quoteFilename(linkpath) ~ " "; if(globOpts.demangleError || globOpts.optlinkDeps) lnkcmd = "\"$(VisualDInstallDir)pipedmd.exe\" " ~ (globOpts.demangleError ? null : "-nodemangle ") ~ (globOpts.optlinkDeps ? "-deps " ~ quoteFilename(GetLinkDependenciesPath()) ~ " " : null) ~ lnkcmd; string[] lnkfiles = getObjectFileList(files); // convert D files to object files, but leaves anything else untouched string cmdfiles = mProjectOptions.optlinkCommandLine(lnkfiles, options, workdir, x64 || mscoff); if(cmdfiles.length > 100) { string lnkresponsefile = GetCommandLinePath() ~ ".lnkarg"; lnkresponsefile = makeFilenameAbsolute(lnkresponsefile, workdir); if(lnkresponsefile != quoteFilename(lnkresponsefile)) { // optlink does not support quoted response files if(!std.file.exists(lnkresponsefile)) collectException(std.file.write(lnkresponsefile, "")); string shortresponsefile = shortFilename(lnkresponsefile); if (shortresponsefile.empty || shortresponsefile != quoteFilename(shortresponsefile)) lnkresponsefile = baseName(lnkresponsefile); // if short name generation fails, move it into the project folder else lnkresponsefile = shortresponsefile; } prelnk ~= "echo. > " ~ lnkresponsefile ~ "\n"; prelnk ~= "echo " ~ cmdfiles.replace("+", "+ >> " ~ lnkresponsefile ~ "\necho "); prelnk ~= " >> " ~ lnkresponsefile ~ "\n\n"; lnkcmd ~= "@" ~ lnkresponsefile; } else lnkcmd ~= cmdfiles; if(!mProjectOptions.useStdLibPath) prelnk = "set OPTLINKS=%OPTLINKS% /NOSCANLIB\n" ~ prelnk; prelnk = "set LIB=" ~ libpaths ~ "\n" ~ prelnk; } else { lnkcmd = mProjectOptions.buildCommandLine(false, true, false); lnkcmd ~= getLinkFileList(files, prelnk); string addlnkopt = mProjectOptions.getAdditionalLinkOptions(); if(addlnkopt.length) lnkcmd ~= " " ~ addlnkopt; } cmd = cmd ~ "\n" ~ prelnk ~ lnkcmd ~ "\n"; cmd = cmd ~ "if errorlevel 1 goto reportError\n"; } string cv2pdb = mProjectOptions.appendCv2pdb(); if(cv2pdb.length && doLink) { string cvtarget = quoteFilename(mProjectOptions.getTargetPath() ~ "_cv"); cmd ~= "if not exist " ~ cvtarget ~ " (echo " ~ cvtarget ~ " not created! && goto reportError)\n"; cmd ~= "echo Converting debug information...\n"; cmd ~= cv2pdb; cmd ~= "\nif errorlevel 1 goto reportError\n"; } string pre = strip(mProjectOptions.preBuildCommand); if(pre.length) cmd = pre ~ "\nif errorlevel 1 goto reportError\n" ~ cmd; string post = strip(mProjectOptions.postBuildCommand); if(post.length) cmd = cmd ~ "\nif errorlevel 1 goto reportError\n" ~ post ~ "\n\n"; string target = quoteFilename(mProjectOptions.getTargetPath()); cmd ~= "if not exist " ~ target ~ " (echo " ~ target ~ " not created! && goto reportError)\n"; cmd ~= "\ngoto noError\n"; cmd ~= "\n:reportError\n"; cmd ~= "echo Building " ~ GetTargetPath() ~ " failed!\n"; cmd ~= "\n:noError\n"; return mProjectOptions.replaceEnvironment(cmd, this); } bool writeLinkDependencyFile() { string workdir = normalizeDir(GetProjectDir()); string depfile = makeFilenameAbsolute(GetDependenciesPath(), workdir); string[] files = getInputFileList(); files = getObjectFileList(files); string prefix = "target ("; string postfix = ") : public : object \n"; string deps; foreach(f; files) { deps ~= prefix ~ replace(f, "\\", "\\\\") ~ postfix; } bool fromMap = mProjectOptions.mapverbosity >= 3; try { std.file.write(depfile, deps); return true; } catch(Exception e) { } return false; } string[] getLibsFromDependentProjects() { string[] libs; auto solutionBuildManager = queryService!(IVsSolutionBuildManager)(); if(!solutionBuildManager) return libs; scope(exit) release(solutionBuildManager); ULONG cActual; if(HRESULT hr = solutionBuildManager.GetProjectDependencies(mProvider.mProject, 0, null, &cActual)) return libs; IVsHierarchy[] pHier = new IVsHierarchy [cActual]; if(HRESULT hr = solutionBuildManager.GetProjectDependencies(mProvider.mProject, cActual, pHier.ptr, &cActual)) return libs; for(int i = 0; i < cActual; i++) { IVsProjectCfg prjcfg; if(pHier[i].QueryInterface(&IVsProjectCfg.iid, cast(void**)&prjcfg) != S_OK) { IVsCfg cfg; IVsGetCfgProvider gcp; IVsCfgProvider cp; IVsCfgProvider2 cp2; if(pHier[i].QueryInterface(&IVsGetCfgProvider.iid, cast(void**)&gcp) == S_OK) gcp.GetCfgProvider(&cp); else pHier[i].QueryInterface(&IVsCfgProvider.iid, cast(void**)&cp); if(cp) { cp.QueryInterface(&IVsCfgProvider2.iid, cast(void**)&cp2); if(cp2) { cp2.GetCfgOfName(_toUTF16z(mName), _toUTF16z(mPlatform), &cfg); if(!cfg) cp2.GetCfgs(1, &cfg, null, null); // TODO: find a "similar" config? if(cfg) cfg.QueryInterface(&IVsProjectCfg.iid, cast(void**)&prjcfg); } } release(cfg); release(gcp); release(cp); release(cp2); } if(prjcfg) { scope(exit) release(prjcfg); debug logOutputGroups(prjcfg); version(none) if(auto prjcfg2 = qi_cast!IVsProjectCfg2(prjcfg)) { scope(exit) release(prjcfg2); IVsOutputGroup outputGroup; if(prjcfg2.OpenOutputGroup(VS_OUTPUTGROUP_CNAME_Built, &outputGroup) == S_OK) { scope(exit) release(outputGroup); ULONG cnt; if(outputGroup.get_Outputs(0, null, &cnt) == S_OK) { auto outs = new IVsOutput2[cnt]; if(outputGroup.get_Outputs(cnt, outs.ptr, null) == S_OK) { foreach(o; outs) { ScopedBSTR target; if(o.get_CanonicalName(&target.bstr) == S_OK) { string targ = target.detach(); libs ~= targ; } release(o); } } } } } IVsEnumOutputs eo; if(prjcfg.EnumOutputs(&eo) == S_OK) { scope(exit) release(eo); ULONG fetched; string lastTarg; IVsOutput pIVsOutput; while(eo.Next(1, &pIVsOutput, &fetched) == S_OK && fetched == 1) { ScopedBSTR target; if(pIVsOutput.get_CanonicalName(&target.bstr) == S_OK) //if(pIVsOutput.get_DeploySourceURL(&target.bstr) == S_OK) //if(pIVsOutput.get_DisplayName(&target.bstr) == S_OK) { string targ = target.detach(); if (lastTarg.length && targ.indexOf('$') >= 0) { // VC projects report the import library without expanding macros // (even if building static libraries), so assume it lies along side the DLL if (targ.extension().toLower() == ".lib" && lastTarg.extension().toLower() != ".lib") targ = lastTarg.stripExtension() ~ ".lib"; else targ = null; } if (targ.length) { libs ~= targ; lastTarg = targ; } } release(pIVsOutput); } } } release(pHier[i]); } return libs; } void logOutputGroups(IVsProjectCfg prjcfg) { if(auto prjcfg2 = qi_cast!IVsProjectCfg2(prjcfg)) { scope(exit) release(prjcfg2); ULONG cntGroups; if(SUCCEEDED(prjcfg2.get_OutputGroups(0, null, &cntGroups))) { auto groups = new IVsOutputGroup[cntGroups]; if(prjcfg2.get_OutputGroups(cntGroups, groups.ptr, &cntGroups) == S_OK) { foreach(outputGroup; groups) { scope(exit) release(outputGroup); BSTR bstrCanName, bstrDispName, bstrKeyOut, bstrDesc; outputGroup.get_CanonicalName(&bstrCanName); outputGroup.get_DisplayName(&bstrDispName); outputGroup.get_KeyOutput(&bstrKeyOut); outputGroup.get_Description(&bstrDesc); logCall("Group: %s Disp: %s KeyOut: %s Desc: %s", detachBSTR(bstrCanName), detachBSTR(bstrDispName), detachBSTR(bstrKeyOut), detachBSTR(bstrDesc)); ULONG cnt; if(outputGroup.get_Outputs(0, null, &cnt) == S_OK) { auto outs = new IVsOutput2[cnt]; if(outputGroup.get_Outputs(cnt, outs.ptr, &cnt) == S_OK) { foreach(o; outs) { BSTR target, display, url; o.get_CanonicalName(&target); o.get_DisplayName(&display); o.get_DeploySourceURL(&url); logCall(" Out: %s Disp: %s URL: %s", detachBSTR(target), detachBSTR(display), detachBSTR(url)); release(o); } } } } } } } } int addJSONFiles(ref string[] files) { int cnt = 0; alias mProjectOptions opt; if(opt.doXGeneration) { void addJSONFile(string xfile) { xfile = makeFilenameAbsolute(xfile, GetProjectDir()); if(xfile.length && std.file.exists(xfile)) { addunique(files, xfile); cnt++; } } if(opt.compilationModel == ProjectOptions.kSingleFileCompilation) { searchNode(mProvider.mProject.GetRootNode(), delegate (CHierNode n) { if(CFileNode file = cast(CFileNode) n) { string tool = GetCompileTool(file); if(tool == "DMDsingle") { string outfile = GetOutputFile(file); string xfile = opt.replaceEnvironment(opt.xfilename, this, file.GetFilename(), outfile); addJSONFile(xfile); } } return false; }); } else { string xfile = opt.replaceEnvironment(opt.xfilename, this); addJSONFile(xfile); } } return cnt; } // tick the sink and check if build can continue or not. BOOL FFireTick() { foreach(cb; mBuildStatusCallbacks) { //if (m_rgfTicking[i]) { BOOL fContinue = TRUE; HRESULT hr = cb.Tick(&fContinue); assert(SUCCEEDED(hr)); if (!fContinue) return FALSE; } } return TRUE; } void FFireBuildBegin(ref BOOL fContinue) { fContinue = TRUE; foreach(key, cb; mBuildStatusCallbacks) { HRESULT hr = cb.BuildBegin(&fContinue); if(FAILED(hr) || !fContinue) break; mStarted[key] = true; } } void FFireBuildEnd(BOOL fSuccess) { // make a copy in case BuildEnd calls Unadvise IVsBuildStatusCallback[] cbs; foreach(key, cb; mBuildStatusCallbacks) if(mStarted[key]) { cbs ~= cb; mStarted[key] = false; } foreach(cb; cbs) { HRESULT hr = cb.BuildEnd(fSuccess); assert(SUCCEEDED(hr)); } Package.scheduleUpdateLibrary(); } CBuilderThread getBuilder() { return mBuilder; } string getName() { return mName; } string getPlatform() { return mPlatform; } string getCfgName() { return mName ~ "|" ~ mPlatform; } private: string mName; string mPlatform; ConfigProvider mProvider; ProjectOptions mProjectOptions; CBuilderThread mBuilder; version(hasOutputGroup) VsOutputGroup mOutputGroup; ConfigModifiedListener[] mModifiedListener; IVsBuildStatusCallback[VSCOOKIE] mBuildStatusCallbacks; bool[VSCOOKIE] mTicking; bool[VSCOOKIE] mStarted; VSCOOKIE mLastBuildStatusCookie; }; class DEnumOutFactory : DComObject, IClassFactory { override HRESULT QueryInterface(in IID* riid, void** pvObject) { if(queryInterface2!(IClassFactory) (this, IID_IClassFactory, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } override HRESULT CreateInstance(IUnknown UnkOuter, in IID* riid, void** pvObject) { logCall("%s.CreateInstance(riid=%s)", this, _toLog(riid)); assert(!UnkOuter); DEnumOutputs eo = newCom!DEnumOutputs(null, 0); return eo.QueryInterface(riid, pvObject); } override HRESULT LockServer(in BOOL fLock) { return returnError(E_NOTIMPL); } } class DEnumOutputs : DComObject, IVsEnumOutputs, ICallFactory, IExternalConnection, IMarshal { // {785486EE-2FB9-47f5-85A9-5790A60B5CEB} static const GUID iid = { 0x785486ee, 0x2fb9, 0x47f5, [ 0x85, 0xa9, 0x57, 0x90, 0xa6, 0xb, 0x5c, 0xeb ] }; string[] mTargets; int mPos; this(Config cfg, int pos) { if(cfg) mTargets ~= makeFilenameAbsolute(cfg.GetTargetPath(), cfg.GetProjectDir()); mPos = pos; } this(DEnumOutputs eo) { mTargets = eo.mTargets; mPos = eo.mPos; } override HRESULT QueryInterface(in IID* riid, void** pvObject) { if(queryInterface!(IVsEnumOutputs) (this, riid, pvObject)) return S_OK; if(queryInterface!(ICallFactory) (this, riid, pvObject)) return S_OK; if(queryInterface!(IExternalConnection) (this, riid, pvObject)) return S_OK; if(queryInterface!(IMarshal) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } override HRESULT Reset() { mixin(LogCallMix); mPos = 0; return S_OK; } override HRESULT Next(in ULONG cElements, IVsOutput *rgpIVsOutput, ULONG *pcElementsFetched) { mixin(LogCallMix); if(mPos >= mTargets.length || cElements < 1) { if(pcElementsFetched) *pcElementsFetched = 0; return returnError(S_FALSE); } if(pcElementsFetched) *pcElementsFetched = 1; *rgpIVsOutput = addref(newCom!VsOutput(mTargets[mPos])); mPos++; return S_OK; } override HRESULT Skip(in ULONG cElements) { logCall("%s.Skip(cElements=%s)", this, _toLog(cElements)); mPos += cElements; if(mPos > mTargets.length) { mPos = mTargets.length; return S_FALSE; } return S_OK; } override HRESULT Clone(IVsEnumOutputs *ppIVsEnumOutputs) { mixin(LogCallMix); *ppIVsEnumOutputs = addref(newCom!DEnumOutputs(this)); return S_OK; } // ICallFactory override HRESULT CreateCall( /+[in]+/ in IID* riid, /+[in]+/ IUnknown pCtrlUnk, /+[in]+/ in IID* riid2, /+[out, iid_is(riid2)]+/ IUnknown *ppv ) { mixin(LogCallMix); return returnError(E_NOTIMPL); } // IExternalConnection override DWORD AddConnection ( /+[in]+/ in DWORD extconn, /+[in]+/ in DWORD reserved ) { mixin(LogCallMix); return ++mExternalReferences; } override DWORD ReleaseConnection( /+[in]+/ in DWORD extconn, /+[in]+/ in DWORD reserved, /+[in]+/ in BOOL fLastReleaseCloses ) { mixin(LogCallMix); --mExternalReferences; if(mExternalReferences == 0) CoDisconnectObject(this, 0); return mExternalReferences; } int mExternalReferences; // IMarshall override HRESULT GetUnmarshalClass ( /+[in]+/ in IID* riid, /+[in, unique]+/ in void *pv, /+[in]+/ in DWORD dwDestContext, /+[in, unique]+/ in void *pvDestContext, /+[in]+/ in DWORD mshlflags, /+[out]+/ CLSID *pCid ) { mixin(LogCallMixNoRet); *cast(GUID*)pCid = g_unmarshalCLSID; return S_OK; //return returnError(E_NOTIMPL); } override HRESULT GetMarshalSizeMax ( /+[in]+/ in IID* riid, /+[in, unique]+/ in void *pv, /+[in]+/ in DWORD dwDestContext, /+[in, unique]+/ in void *pvDestContext, /+[in]+/ in DWORD mshlflags, /+[out]+/ DWORD *pSize ) { mixin(LogCallMixNoRet); DWORD size = iid.sizeof + int.sizeof; foreach(s; mTargets) size += int.sizeof + s.length; size += mPos.sizeof; *pSize = size; return S_OK; //return returnError(E_NOTIMPL); } override HRESULT MarshalInterface ( /+[in, unique]+/ IStream pStm, /+[in]+/ in IID* riid, /+[in, unique]+/ in void *pv, /+[in]+/ in DWORD dwDestContext, /+[in, unique]+/ in void *pvDestContext, /+[in]+/ in DWORD mshlflags ) { mixin(LogCallMixNoRet); if(HRESULT hr = pStm.Write(cast(void*)&iid, iid.sizeof, null)) return hr; int length = mTargets.length; if(HRESULT hr = pStm.Write(&length, length.sizeof, null)) return hr; foreach(s; mTargets) { length = s.length; if(HRESULT hr = pStm.Write(&length, length.sizeof, null)) return hr; if(HRESULT hr = pStm.Write(cast(void*)s.ptr, length, null)) return hr; } if(HRESULT hr = pStm.Write(&mPos, mPos.sizeof, null)) return hr; return S_OK; } override HRESULT UnmarshalInterface ( /+[in, unique]+/ IStream pStm, /+[in]+/ in IID* riid, /+[out]+/ void **ppv ) { mixin(LogCallMix); GUID miid; if(HRESULT hr = pStm.Read(&miid, iid.sizeof, null)) return returnError(hr); assert(miid == iid); int cnt; if(HRESULT hr = pStm.Read(&cnt, cnt.sizeof, null)) return hr; DEnumOutputs eo = newCom!DEnumOutputs(null, 0); for(int i = 0; i < cnt; i++) { int length; if(HRESULT hr = pStm.Read(&length, length.sizeof, null)) return hr; char[] s = new char[length]; if(HRESULT hr = pStm.Read(s.ptr, length, null)) return hr; eo.mTargets ~= cast(string) s; } if(HRESULT hr = pStm.Read(&eo.mPos, eo.mPos.sizeof, null)) return hr; return eo.QueryInterface(riid, ppv); } override HRESULT ReleaseMarshalData(/+[in, unique]+/ IStream pStm) { mixin(LogCallMix2); return returnError(E_NOTIMPL); } override HRESULT DisconnectObject(/+[in]+/ in DWORD dwReserved) { logCall("%s.DisconnectObject(dwReserved=%s)", this, _toLog(dwReserved)); return returnError(E_NOTIMPL); } } class VsOutput : DComObject, IVsOutput2 { string mTarget; this(string target) { mTarget = target; } override HRESULT QueryInterface(in IID* riid, void** pvObject) { version(hasOutputGroup) if(queryInterface!(IVsOutput2) (this, riid, pvObject)) return S_OK; if(queryInterface!(IVsOutput) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } override HRESULT get_DisplayName(BSTR *pbstrDisplayName) { logCall("%s.get_DisplayName(pbstrDisplayName=%s)", this, _toLog(pbstrDisplayName)); *pbstrDisplayName = allocBSTR(mTarget); return S_OK; } override HRESULT get_CanonicalName(BSTR *pbstrCanonicalName) { logCall("%s.get_CanonicalName(pbstrCanonicalName=%s)", this, _toLog(pbstrCanonicalName)); *pbstrCanonicalName = allocBSTR(mTarget); return S_OK; } override HRESULT get_DeploySourceURL(BSTR *pbstrDeploySourceURL) { logCall("%s.get_DeploySourceURL(pbstrDeploySourceURL=%s)", this, _toLog(pbstrDeploySourceURL)); *pbstrDeploySourceURL = allocBSTR("file:///" ~ mTarget); return S_OK; } // obsolete method override HRESULT get_Type(/+[out]+/ GUID *pguidType) { logCall("%s.get_Type(pguidType=%s)", this, _toLog(pguidType)); *pguidType = GUID_NULL; return S_OK; } // IVsOutput2 HRESULT get_RootRelativeURL(/+[out]+/ BSTR *pbstrRelativePath) { mixin(LogCallMix); return returnError(E_NOTIMPL); } HRESULT get_Property(in LPCOLESTR szProperty, /+[out]+/ VARIANT *pvar) { mixin(LogCallMix); return returnError(E_NOTIMPL); } } class VsOutputGroup : DComObject, IVsOutputGroup { this(Config cfg) { mConfig = cfg; } override HRESULT QueryInterface(in IID* riid, void** pvObject) { if(queryInterface!(IVsOutputGroup) (this, riid, pvObject)) return S_OK; return super.QueryInterface(riid, pvObject); } // These return identical information regardless of cfg setting: HRESULT get_CanonicalName(/+[out]+/ BSTR *pbstrCanonicalName) { mixin(LogCallMix); *pbstrCanonicalName = allocBSTR(to_string(VS_OUTPUTGROUP_CNAME_Built)); return S_OK; } HRESULT get_DisplayName(/+[out]+/ BSTR *pbstrDisplayName) { mixin(LogCallMix); *pbstrDisplayName = allocBSTR("Project build target"); return S_OK; } // The results of these will vary based on the configuration: HRESULT get_KeyOutput(/+[out]+/ BSTR *pbstrCanonicalName) { mixin(LogCallMix); *pbstrCanonicalName = allocBSTR(""); return S_OK; } // Back pointer to project cfg: HRESULT get_ProjectCfg(/+[out]+/ IVsProjectCfg2 *ppIVsProjectCfg2) { mixin(LogCallMix); return returnError(E_NOTIMPL); } // The list of outputs. There might be none! Not all files go out // on every configuration, and a groups files might all be configuration // dependent! HRESULT get_Outputs(in ULONG celt, /+[in, out, size_is(celt)]+/ IVsOutput2 *rgpcfg, /+[out, optional]+/ ULONG *pcActual) { mixin(LogCallMix); if(celt >= 1) { string target = makeFilenameAbsolute(mConfig.GetTargetPath(), mConfig.GetProjectDir()); *rgpcfg = addref(newCom!VsOutput(target)); } if(pcActual) *pcActual = 1; return S_OK; } HRESULT get_DeployDependencies(in ULONG celt, /+[in, out, size_is(celt)]+/ IVsDeployDependency *rgpdpd, /+[out, optional]+/ ULONG *pcActual) { mixin(LogCallMix); return returnError(E_NOTIMPL); } HRESULT get_Description(/+[out]+/ BSTR *pbstrDescription) { mixin(LogCallMix); return returnError(E_NOTIMPL); } private: Config mConfig; }; Config GetActiveConfig(IVsHierarchy pHierarchy) { if(!pHierarchy) return null; auto solutionBuildManager = queryService!(IVsSolutionBuildManager)(); scope(exit) release(solutionBuildManager); IVsProjectCfg activeCfg; if(solutionBuildManager.FindActiveProjectCfg(null, null, pHierarchy, &activeCfg) == S_OK) { scope(exit) release(activeCfg); if(Config cfg = qi_cast!Config(activeCfg)) return cfg; } return null; }
D
module allegro5.keyboard; import allegro5.keycodes; import allegro5.display; import allegro5.events; import allegro5.internal.da5; extern (C) { struct ALLEGRO_KEYBOARD {}; struct ALLEGRO_KEYBOARD_STATE { /* public */ ALLEGRO_DISPLAY* display; /* internal */ uint __key_down__internal__[(ALLEGRO_KEY_MAX + 31) / 32]; } bool al_is_keyboard_installed(); bool al_install_keyboard(); void al_uninstall_keyboard(); bool al_set_keyboard_leds(int leds); const_char* al_keycode_to_name(int keycode); void al_get_keyboard_state(ALLEGRO_KEYBOARD_STATE* ret_state); bool al_key_down (in ALLEGRO_KEYBOARD_STATE* state, int keycode); ALLEGRO_EVENT_SOURCE* al_get_keyboard_event_source(); }
D
// Copyright Ferdinand Majerech 2011. // Copyright Cameron Ross 2016. // 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 wyaml.tests.compare; unittest { import std.meta : AliasSeq; import std.range : lockstep, StoppingPolicy; import wyaml.loader : Loader; import wyaml.tests.common : run2, writeComparison; /// Test parser by comparing output from parsing equivalent YAML data. /// /// Params: data = YAML data to load. /// canonical = Canonical YAML data. void testParser(string data, string canonical, string testName) { auto dataEvents = Loader(data).parse(); auto canonicalEvents = Loader(canonical).parse(); foreach (test, canon; lockstep(dataEvents, canonicalEvents, StoppingPolicy.requireSameLength)) { scope (failure) { writeComparison(testName, canon, test); } assert(test.id == canon.id, "testParser(" ~ testName ~ ") failed"); } } /// Test loader by comparing output from loading equivalent YAML data. /// /// Params: data = YAML data to load. /// canonical = Canonical YAML data. void testLoader(string data, string canonical, string testName) { auto dataLoaded = Loader(data).loadAll(); auto canonicalLoaded = Loader(canonical).loadAll(); foreach (test, canon; lockstep(dataLoaded, canonicalLoaded, StoppingPolicy.requireSameLength)) { scope (failure) { writeComparison(testName, canon, test); } assert(test == canon, "testLoader(" ~ testName ~ ") failed"); } } alias testSet = AliasSeq!("emit-block-scalar-in-simple-key-context-bug", "empty-document-bug", "scan-document-end-bug", "scan-line-break-bug", "sloppy-indentation", "spec-05-03", "spec-05-04", "spec-05-06", "spec-05-07", "spec-05-08", "spec-05-09", "spec-05-11", "spec-05-13", "spec-05-14", "spec-06-01", "spec-06-03", "spec-06-04", "spec-06-05", "spec-06-06", "spec-06-07", "spec-06-08", "spec-07-01", "spec-07-02", "spec-07-04", "spec-07-06", "spec-07-07a", "spec-07-07b", "spec-07-08", "spec-07-09", "spec-07-10", "spec-07-12a", "spec-07-12b", "spec-07-13", "spec-08-01", "spec-08-02", "spec-08-03", "spec-08-05", "spec-08-07", "spec-08-08", "spec-08-09", "spec-08-10", "spec-08-11", "spec-08-12", "spec-08-13", "spec-08-14", "spec-08-15", "spec-09-01", "spec-09-02", "spec-09-03", "spec-09-04", "spec-09-05", "spec-09-06", "spec-09-07", "spec-09-08", "spec-09-09", "spec-09-10", "spec-09-11", "spec-09-12", "spec-09-13", "spec-09-15", "spec-09-16", "spec-09-17", "spec-09-18", "spec-09-19", "spec-09-20", "spec-09-22", "spec-09-23", "spec-09-24", "spec-09-25", "spec-09-26", "spec-09-27", "spec-09-28", "spec-09-29", "spec-09-30", "spec-09-31", "spec-09-32", "spec-09-33", "spec-10-01", "spec-10-02", "spec-10-03", "spec-10-04", "spec-10-05", "spec-10-06", "spec-10-07", "spec-10-09", "spec-10-10", "spec-10-11", "spec-10-12", "spec-10-13", "spec-10-14", "spec-10-15"); alias testSet2 = AliasSeq!("emit-block-scalar-in-simple-key-context-bug", "empty-document-bug", "scan-document-end-bug", "scan-line-break-bug", "sloppy-indentation", "spec-05-03", "spec-05-04", "spec-05-07", "spec-05-08", "spec-05-09", "spec-05-11", "spec-05-13", "spec-05-14", "spec-06-01", "spec-06-03", "spec-06-04", "spec-06-05", "spec-06-06", "spec-06-07", "spec-06-08", "spec-07-01", "spec-07-02", "spec-07-04", "spec-07-09", "spec-07-10", "spec-07-12a", "spec-07-12b", "spec-08-01", "spec-08-02", "spec-08-07", "spec-08-08", "spec-08-09", "spec-08-10", "spec-08-11", "spec-08-12", "spec-08-13", "spec-08-14", "spec-08-15", "spec-09-01", "spec-09-02", "spec-09-03", "spec-09-04", "spec-09-05", "spec-09-06", "spec-09-07", "spec-09-08", "spec-09-09", "spec-09-10", "spec-09-11", "spec-09-12", "spec-09-13", "spec-09-15", "spec-09-16", "spec-09-17", "spec-09-18", "spec-09-19", "spec-09-20", "spec-09-22", "spec-09-23", "spec-09-24", "spec-09-25", "spec-09-26", "spec-09-27", "spec-09-28", "spec-09-29", "spec-09-30", "spec-09-31", "spec-09-32", "spec-09-33", "spec-10-01", "spec-10-02", "spec-10-03", "spec-10-04", "spec-10-05", "spec-10-06", "spec-10-07", "spec-10-09", "spec-10-10", "spec-10-11", "spec-10-12", "spec-10-13", "spec-10-14", "spec-10-15"); run2!(testParser, ["data", "canonical"], testSet)("Parser Comparison"); run2!(testLoader, ["data", "canonical"], testSet2)("Loader Comparison"); }
D
module android.java.android.widget.ImageView; public import android.java.android.widget.ImageView_d_interface; import arsd.jni : ImportExportImpl; mixin ImportExportImpl!ImageView; import import40 = android.java.android.view.accessibility.AccessibilityNodeProvider; import import80 = android.java.java.lang.Class; import import47 = android.java.android.view.ViewParent; import import76 = android.java.android.view.PointerIcon; import import63 = android.java.android.view.WindowId; import import56 = android.java.android.animation.StateListAnimator; import import69 = android.java.android.view.ViewTreeObserver; import import60 = android.java.android.os.Handler; import import41 = android.java.android.view.View; import import11 = android.java.android.graphics.ColorFilter; import import39 = android.java.android.view.View_AccessibilityDelegate; import import36 = android.java.android.view.autofill.AutofillId; import import78 = android.java.android.view.ViewPropertyAnimator; import import13 = android.java.java.util.Map; import import67 = android.java.android.view.ViewOverlay; import import62 = android.java.android.os.IBinder; import import10 = android.java.android.graphics.Matrix; import import48 = android.java.android.view.KeyEvent_DispatcherState; import import23 = android.java.android.view.ActionMode; import import42 = android.java.android.view.WindowInsets; import import70 = android.java.android.view.animation.Animation; import import59 = android.java.android.view.ViewGroup_LayoutParams; import import12 = android.java.java.lang.CharSequence; import import32 = android.java.android.view.accessibility.AccessibilityNodeInfo; import import68 = android.java.android.content.res.Resources; import import52 = android.java.android.view.inputmethod.InputConnection; import import64 = android.java.android.view.Display; import import45 = android.java.java.util.ArrayList;
D
module dmd.astbase; /** * Documentation: https://dlang.org/phobos/dmd_astbase.html * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/astbase.d */ import dmd.parsetimevisitor; /** The ASTBase family defines a family of AST nodes appropriate for parsing with * no semantic information. It defines all the AST nodes that the parser needs * and also all the conveniance methods and variables. The resulting AST can be * visited with the strict, permissive and transitive visitors. * The ASTBase family is used to instantiate the parser in the parser library. */ struct ASTBase { import dmd.root.file; import dmd.root.filename; import dmd.root.array; import dmd.root.rootobject; import dmd.root.outbuffer; import dmd.root.ctfloat; import dmd.root.rmem; import dmd.root.string : toDString; import dmd.root.stringtable; import dmd.tokens; import dmd.identifier; import dmd.globals; import dmd.id; import dmd.errors; import dmd.lexer; import core.stdc.string; import core.stdc.stdarg; alias Dsymbols = Array!(Dsymbol); alias Objects = Array!(RootObject); alias Expressions = Array!(Expression); alias TemplateParameters = Array!(TemplateParameter); alias BaseClasses = Array!(BaseClass*); alias Parameters = Array!(Parameter); alias Statements = Array!(Statement); alias Catches = Array!(Catch); alias Identifiers = Array!(Identifier); alias Initializers = Array!(Initializer); alias Ensures = Array!(Ensure); enum Sizeok : int { none, // size of aggregate is not yet able to compute fwd, // size of aggregate is ready to compute done, // size of aggregate is set correctly } enum Baseok : int { none, // base classes not computed yet start, // in process of resolving base classes done, // all base classes are resolved semanticdone, // all base classes semantic done } enum MODFlags : int { const_ = 1, // type is const immutable_ = 4, // type is immutable shared_ = 2, // type is shared wild = 8, // type is wild wildconst = (MODFlags.wild | MODFlags.const_), // type is wild const mutable = 0x10, // type is mutable (only used in wildcard matching) } alias MOD = ubyte; enum STC : long { undefined_ = 0L, static_ = (1L << 0), extern_ = (1L << 1), const_ = (1L << 2), final_ = (1L << 3), abstract_ = (1L << 4), parameter = (1L << 5), field = (1L << 6), override_ = (1L << 7), auto_ = (1L << 8), synchronized_ = (1L << 9), deprecated_ = (1L << 10), in_ = (1L << 11), // in parameter out_ = (1L << 12), // out parameter lazy_ = (1L << 13), // lazy parameter foreach_ = (1L << 14), // variable for foreach loop //(1L << 15) variadic = (1L << 16), // the 'variadic' parameter in: T foo(T a, U b, V variadic...) ctorinit = (1L << 17), // can only be set inside constructor templateparameter = (1L << 18), // template parameter scope_ = (1L << 19), immutable_ = (1L << 20), ref_ = (1L << 21), init = (1L << 22), // has explicit initializer manifest = (1L << 23), // manifest constant nodtor = (1L << 24), // don't run destructor nothrow_ = (1L << 25), // never throws exceptions pure_ = (1L << 26), // pure function tls = (1L << 27), // thread local alias_ = (1L << 28), // alias parameter shared_ = (1L << 29), // accessible from multiple threads gshared = (1L << 30), // accessible from multiple threads, but not typed as "shared" wild = (1L << 31), // for "wild" type constructor property = (1L << 32), safe = (1L << 33), trusted = (1L << 34), system = (1L << 35), ctfe = (1L << 36), // can be used in CTFE, even if it is static disable = (1L << 37), // for functions that are not callable result = (1L << 38), // for result variables passed to out contracts nodefaultctor = (1L << 39), // must be set inside constructor temp = (1L << 40), // temporary variable rvalue = (1L << 41), // force rvalue for variables nogc = (1L << 42), // @nogc volatile_ = (1L << 43), // destined for volatile in the back end return_ = (1L << 44), // 'return ref' or 'return scope' for function parameters autoref = (1L << 45), // Mark for the already deduced 'auto ref' parameter inference = (1L << 46), // do attribute inference exptemp = (1L << 47), // temporary variable that has lifetime restricted to an expression maybescope = (1L << 48), // parameter might be 'scope' scopeinferred = (1L << 49), // 'scope' has been inferred and should not be part of mangling future = (1L << 50), // introducing new base class function local = (1L << 51), // do not forward (see dmd.dsymbol.ForwardingScopeDsymbol). returninferred = (1L << 52), // 'return' has been inferred and should not be part of mangling live = (1L << 53), // function @live attribute safeGroup = STC.safe | STC.trusted | STC.system, TYPECTOR = (STC.const_ | STC.immutable_ | STC.shared_ | STC.wild), FUNCATTR = (STC.ref_ | STC.nothrow_ | STC.nogc | STC.pure_ | STC.property | STC.live | safeGroup), } extern (C++) __gshared const(StorageClass) STCStorageClass = (STC.auto_ | STC.scope_ | STC.static_ | STC.extern_ | STC.const_ | STC.final_ | STC.abstract_ | STC.synchronized_ | STC.deprecated_ | STC.override_ | STC.lazy_ | STC.alias_ | STC.out_ | STC.in_ | STC.manifest | STC.immutable_ | STC.shared_ | STC.wild | STC.nothrow_ | STC.nogc | STC.pure_ | STC.ref_ | STC.return_ | STC.tls | STC.gshared | STC.property | STC.live | STC.safeGroup | STC.disable); enum ENUMTY : int { Tarray, // slice array, aka T[] Tsarray, // static array, aka T[dimension] Taarray, // associative array, aka T[type] Tpointer, Treference, Tfunction, Tident, Tclass, Tstruct, Tenum, Tdelegate, Tnone, Tvoid, Tint8, Tuns8, Tint16, Tuns16, Tint32, Tuns32, Tint64, Tuns64, Tfloat32, Tfloat64, Tfloat80, Timaginary32, Timaginary64, Timaginary80, Tcomplex32, Tcomplex64, Tcomplex80, Tbool, Tchar, Twchar, Tdchar, Terror, Tinstance, Ttypeof, Ttuple, Tslice, Treturn, Tnull, Tvector, Tint128, Tuns128, Tmixin, TMAX } alias Tarray = ENUMTY.Tarray; alias Tsarray = ENUMTY.Tsarray; alias Taarray = ENUMTY.Taarray; alias Tpointer = ENUMTY.Tpointer; alias Treference = ENUMTY.Treference; alias Tfunction = ENUMTY.Tfunction; alias Tident = ENUMTY.Tident; alias Tclass = ENUMTY.Tclass; alias Tstruct = ENUMTY.Tstruct; alias Tenum = ENUMTY.Tenum; alias Tdelegate = ENUMTY.Tdelegate; alias Tnone = ENUMTY.Tnone; alias Tvoid = ENUMTY.Tvoid; alias Tint8 = ENUMTY.Tint8; alias Tuns8 = ENUMTY.Tuns8; alias Tint16 = ENUMTY.Tint16; alias Tuns16 = ENUMTY.Tuns16; alias Tint32 = ENUMTY.Tint32; alias Tuns32 = ENUMTY.Tuns32; alias Tint64 = ENUMTY.Tint64; alias Tuns64 = ENUMTY.Tuns64; alias Tfloat32 = ENUMTY.Tfloat32; alias Tfloat64 = ENUMTY.Tfloat64; alias Tfloat80 = ENUMTY.Tfloat80; alias Timaginary32 = ENUMTY.Timaginary32; alias Timaginary64 = ENUMTY.Timaginary64; alias Timaginary80 = ENUMTY.Timaginary80; alias Tcomplex32 = ENUMTY.Tcomplex32; alias Tcomplex64 = ENUMTY.Tcomplex64; alias Tcomplex80 = ENUMTY.Tcomplex80; alias Tbool = ENUMTY.Tbool; alias Tchar = ENUMTY.Tchar; alias Twchar = ENUMTY.Twchar; alias Tdchar = ENUMTY.Tdchar; alias Terror = ENUMTY.Terror; alias Tinstance = ENUMTY.Tinstance; alias Ttypeof = ENUMTY.Ttypeof; alias Ttuple = ENUMTY.Ttuple; alias Tslice = ENUMTY.Tslice; alias Treturn = ENUMTY.Treturn; alias Tnull = ENUMTY.Tnull; alias Tvector = ENUMTY.Tvector; alias Tint128 = ENUMTY.Tint128; alias Tuns128 = ENUMTY.Tuns128; alias Tmixin = ENUMTY.Tmixin; alias TMAX = ENUMTY.TMAX; alias TY = ubyte; enum TFlags { integral = 1, floating = 2, unsigned = 4, real_ = 8, imaginary = 0x10, complex = 0x20, char_ = 0x40, } enum PKG : int { unknown, // not yet determined whether it's a package.d or not module_, // already determined that's an actual package.d package_, // already determined that's an actual package } enum StructPOD : int { no, // struct is not POD yes, // struct is POD fwd, // POD not yet computed } enum TRUST : int { default_ = 0, system = 1, // @system (same as TRUST.default) trusted = 2, // @trusted safe = 3, // @safe live = 4, // @live } enum PURE : int { impure = 0, // not pure at all fwdref = 1, // it's pure, but not known which level yet weak = 2, // no mutable globals are read or written const_ = 3, // parameters are values or const strong = 4, // parameters are values or immutable } enum AliasThisRec : int { no = 0, // no alias this recursion yes = 1, // alias this has recursive dependency fwdref = 2, // not yet known typeMask = 3, // mask to read no/yes/fwdref tracing = 0x4, // mark in progress of implicitConvTo/deduceWild tracingDT = 0x8, // mark in progress of deduceType } enum VarArg { none = 0, /// fixed number of arguments variadic = 1, /// T t, ...) can be C-style (core.stdc.stdarg) or D-style (core.vararg) typesafe = 2, /// T t ...) typesafe https://dlang.org/spec/function.html#typesafe_variadic_functions /// or https://dlang.org/spec/function.html#typesafe_variadic_functions } alias Visitor = ParseTimeVisitor!ASTBase; extern (C++) abstract class ASTNode : RootObject { abstract void accept(Visitor v); } extern (C++) class Dsymbol : ASTNode { Loc loc; Identifier ident; UnitTestDeclaration ddocUnittest; UserAttributeDeclaration userAttribDecl; Dsymbol parent; const(char)* comment; final extern (D) this() {} final extern (D) this(Identifier ident) { this.ident = ident; } void addComment(const(char)* comment) { if (!this.comment) this.comment = comment; else if (comment && strcmp(cast(char*)comment, cast(char*)this.comment) != 0) this.comment = Lexer.combineComments(this.comment.toDString(), comment.toDString(), true); } override const(char)* toChars() const { return ident ? ident.toChars() : "__anonymous"; } bool oneMember(Dsymbol *ps, Identifier ident) { *ps = this; return true; } extern (D) static bool oneMembers(ref Dsymbols members, Dsymbol* ps, Identifier ident) { Dsymbol s = null; for (size_t i = 0; i < members.dim; i++) { Dsymbol sx = members[i]; bool x = sx.oneMember(ps, ident); if (!x) { assert(*ps is null); return false; } if (*ps) { assert(ident); if (!(*ps).ident || !(*ps).ident.equals(ident)) continue; if (!s) s = *ps; else if (s.isOverloadable() && (*ps).isOverloadable()) { // keep head of overload set FuncDeclaration f1 = s.isFuncDeclaration(); FuncDeclaration f2 = (*ps).isFuncDeclaration(); if (f1 && f2) { for (; f1 != f2; f1 = f1.overnext0) { if (f1.overnext0 is null) { f1.overnext0 = f2; break; } } } } else // more than one symbol { *ps = null; //printf("\tfalse 2\n"); return false; } } } *ps = s; return true; } bool isOverloadable() const { return false; } const(char)* kind() const { return "symbol"; } final void error(const(char)* format, ...) { va_list ap; va_start(ap, format); // last parameter : toPrettyChars verror(loc, format, ap, kind(), ""); va_end(ap); } inout(AttribDeclaration) isAttribDeclaration() inout { return null; } inout(TemplateDeclaration) isTemplateDeclaration() inout { return null; } inout(FuncLiteralDeclaration) isFuncLiteralDeclaration() inout { return null; } inout(FuncDeclaration) isFuncDeclaration() inout { return null; } inout(VarDeclaration) isVarDeclaration() inout { return null; } inout(TemplateInstance) isTemplateInstance() inout { return null; } inout(Declaration) isDeclaration() inout { return null; } inout(ClassDeclaration) isClassDeclaration() inout { return null; } inout(AggregateDeclaration) isAggregateDeclaration() inout { return null; } Dsymbol syntaxCopy(Dsymbol s) { return null; } override final DYNCAST dyncast() const { return DYNCAST.dsymbol; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class AliasThis : Dsymbol { Identifier ident; extern (D) this(const ref Loc loc, Identifier ident) { super(null); this.loc = loc; this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class Declaration : Dsymbol { StorageClass storage_class; Prot protection; LINK linkage; Type type; final extern (D) this(Identifier id) { super(id); storage_class = STC.undefined_; protection = Prot(Prot.Kind.undefined); linkage = LINK.default_; } override final inout(Declaration) isDeclaration() inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class ScopeDsymbol : Dsymbol { Dsymbols* members; final extern (D) this() {} final extern (D) this(Identifier id) { super(id); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class Import : Dsymbol { Identifiers* packages; Identifier id; Identifier aliasId; int isstatic; Prot protection; Identifiers names; Identifiers aliases; extern (D) this(const ref Loc loc, Identifiers* packages, Identifier id, Identifier aliasId, int isstatic) { super(null); this.loc = loc; this.packages = packages; this.id = id; this.aliasId = aliasId; this.isstatic = isstatic; this.protection = Prot(Prot.Kind.private_); if (aliasId) { // import [cstdio] = std.stdio; this.ident = aliasId; } else if (packages && packages.dim) { // import [std].stdio; this.ident = (*packages)[0]; } else { // import [foo]; this.ident = id; } } void addAlias(Identifier name, Identifier _alias) { if (isstatic) error("cannot have an import bind list"); if (!aliasId) this.ident = null; names.push(name); aliases.push(_alias); } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class AttribDeclaration : Dsymbol { Dsymbols* decl; final extern (D) this(Dsymbols *decl) { this.decl = decl; } override final inout(AttribDeclaration) isAttribDeclaration() inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StaticAssert : Dsymbol { Expression exp; Expression msg; extern (D) this(const ref Loc loc, Expression exp, Expression msg) { super(Id.empty); this.loc = loc; this.exp = exp; this.msg = msg; } } extern (C++) final class DebugSymbol : Dsymbol { uint level; extern (D) this(const ref Loc loc, Identifier ident) { super(ident); this.loc = loc; } extern (D) this(const ref Loc loc, uint level) { this.level = level; this.loc = loc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class VersionSymbol : Dsymbol { uint level; extern (D) this(const ref Loc loc, Identifier ident) { super(ident); this.loc = loc; } extern (D) this(const ref Loc loc, uint level) { this.level = level; this.loc = loc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class VarDeclaration : Declaration { Type type; Initializer _init; StorageClass storage_class; enum AdrOnStackNone = ~0u; uint ctfeAdrOnStack; uint sequenceNumber; __gshared uint nextSequenceNumber; final extern (D) this(const ref Loc loc, Type type, Identifier id, Initializer _init, StorageClass st = STC.undefined_) { super(id); this.type = type; this._init = _init; this.loc = loc; this.storage_class = st; sequenceNumber = ++nextSequenceNumber; ctfeAdrOnStack = AdrOnStackNone; } override final inout(VarDeclaration) isVarDeclaration() inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) struct Ensure { Identifier id; Statement ensure; } extern (C++) class FuncDeclaration : Declaration { Statement fbody; Statements* frequires; Ensures* fensures; Loc endloc; StorageClass storage_class; Type type; bool inferRetType; ForeachStatement fes; FuncDeclaration overnext0; final extern (D) this(const ref Loc loc, Loc endloc, Identifier id, StorageClass storage_class, Type type) { super(id); this.storage_class = storage_class; this.type = type; if (type) { // Normalize storage_class, because function-type related attributes // are already set in the 'type' in parsing phase. this.storage_class &= ~(STC.TYPECTOR | STC.FUNCATTR); } this.loc = loc; this.endloc = endloc; inferRetType = (type && type.nextOf() is null); } FuncLiteralDeclaration isFuncLiteralDeclaration() { return null; } override bool isOverloadable() const { return true; } override final inout(FuncDeclaration) isFuncDeclaration() inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AliasDeclaration : Declaration { Dsymbol aliassym; extern (D) this(const ref Loc loc, Identifier id, Dsymbol s) { super(id); this.loc = loc; this.aliassym = s; } extern (D) this(const ref Loc loc, Identifier id, Type type) { super(id); this.loc = loc; this.type = type; } override bool isOverloadable() const { //assume overloadable until alias is resolved; // should be modified when semantic analysis is added return true; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TupleDeclaration : Declaration { Objects* objects; extern (D) this(const ref Loc loc, Identifier id, Objects* objects) { super(id); this.loc = loc; this.objects = objects; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class FuncLiteralDeclaration : FuncDeclaration { TOK tok; extern (D) this(const ref Loc loc, Loc endloc, Type type, TOK tok, ForeachStatement fes, Identifier id = null) { super(loc, endloc, null, STC.undefined_, type); this.ident = id ? id : Id.empty; this.tok = tok; this.fes = fes; } override inout(FuncLiteralDeclaration) isFuncLiteralDeclaration() inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PostBlitDeclaration : FuncDeclaration { extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Identifier id) { super(loc, endloc, id, stc, null); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CtorDeclaration : FuncDeclaration { extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Type type, bool isCopyCtor = false) { super(loc, endloc, Id.ctor, stc, type); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DtorDeclaration : FuncDeclaration { extern (D) this(const ref Loc loc, Loc endloc) { super(loc, endloc, Id.dtor, STC.undefined_, null); } extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Identifier id) { super(loc, endloc, id, stc, null); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class InvariantDeclaration : FuncDeclaration { extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Identifier id, Statement fbody) { super(loc, endloc, id ? id : Identifier.generateId("__invariant"), stc, null); this.fbody = fbody; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class UnitTestDeclaration : FuncDeclaration { char* codedoc; extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, char* codedoc) { super(loc, endloc, Identifier.generateIdWithLoc("__unittest", loc), stc, null); this.codedoc = codedoc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class NewDeclaration : FuncDeclaration { Parameters* parameters; VarArg varargs; extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc, Parameters* fparams, VarArg varargs) { super(loc, endloc, Id.classNew, STC.static_ | stc, null); this.parameters = fparams; this.varargs = varargs; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class StaticCtorDeclaration : FuncDeclaration { final extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc) { super(loc, endloc, Identifier.generateIdWithLoc("_staticCtor", loc), STC.static_ | stc, null); } final extern (D) this(const ref Loc loc, Loc endloc, string name, StorageClass stc) { super(loc, endloc, Identifier.generateIdWithLoc(name, loc), STC.static_ | stc, null); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class StaticDtorDeclaration : FuncDeclaration { final extern (D) this()(Loc loc, Loc endloc, StorageClass stc) { super(loc, endloc, Identifier.generateIdWithLoc("__staticDtor", loc), STC.static_ | stc, null); } final extern (D) this(const ref Loc loc, Loc endloc, string name, StorageClass stc) { super(loc, endloc, Identifier.generateIdWithLoc(name, loc), STC.static_ | stc, null); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class SharedStaticCtorDeclaration : StaticCtorDeclaration { extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc) { super(loc, endloc, "_sharedStaticCtor", stc); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class SharedStaticDtorDeclaration : StaticDtorDeclaration { extern (D) this(const ref Loc loc, Loc endloc, StorageClass stc) { super(loc, endloc, "_sharedStaticDtor", stc); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class Package : ScopeDsymbol { PKG isPkgMod; uint tag; final extern (D) this(Identifier ident) { super(ident); this.isPkgMod = PKG.unknown; __gshared uint packageTag; this.tag = packageTag++; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class EnumDeclaration : ScopeDsymbol { Type type; Type memtype; Prot protection; extern (D) this(const ref Loc loc, Identifier id, Type memtype) { super(id); this.loc = loc; type = new TypeEnum(this); this.memtype = memtype; protection = Prot(Prot.Kind.undefined); } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class AggregateDeclaration : ScopeDsymbol { Prot protection; Sizeok sizeok; Type type; final extern (D) this(const ref Loc loc, Identifier id) { super(id); this.loc = loc; protection = Prot(Prot.Kind.public_); sizeok = Sizeok.none; } override final inout(AggregateDeclaration) isAggregateDeclaration() inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TemplateDeclaration : ScopeDsymbol { TemplateParameters* parameters; TemplateParameters* origParameters; Expression constraint; bool literal; bool ismixin; bool isstatic; Prot protection; Dsymbol onemember; extern (D) this(const ref Loc loc, Identifier id, TemplateParameters* parameters, Expression constraint, Dsymbols* decldefs, bool ismixin = false, bool literal = false) { super(id); this.loc = loc; this.parameters = parameters; this.origParameters = parameters; this.members = decldefs; this.literal = literal; this.ismixin = ismixin; this.isstatic = true; this.protection = Prot(Prot.Kind.undefined); if (members && ident) { Dsymbol s; if (Dsymbol.oneMembers(*members, &s, ident) && s) { onemember = s; s.parent = this; } } } override bool isOverloadable() const { return true; } override inout(TemplateDeclaration) isTemplateDeclaration () inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TemplateInstance : ScopeDsymbol { Identifier name; Objects* tiargs; Dsymbol tempdecl; bool semantictiargsdone; bool havetempdecl; TemplateInstance inst; final extern (D) this(const ref Loc loc, Identifier ident, Objects* tiargs) { super(null); this.loc = loc; this.name = ident; this.tiargs = tiargs; } final extern (D) this(const ref Loc loc, TemplateDeclaration td, Objects* tiargs) { super(null); this.loc = loc; this.name = td.ident; this.tempdecl = td; this.semantictiargsdone = true; this.havetempdecl = true; } override final inout(TemplateInstance) isTemplateInstance() inout { return this; } Objects* arraySyntaxCopy(Objects* objs) { Objects* a = null; if (objs) { a = new Objects(); a.setDim(objs.dim); for (size_t i = 0; i < objs.dim; i++) (*a)[i] = objectSyntaxCopy((*objs)[i]); } return a; } RootObject objectSyntaxCopy(RootObject o) { if (!o) return null; if (Type t = isType(o)) return t.syntaxCopy(); if (Expression e = isExpression(o)) return e.syntaxCopy(); return o; } override Dsymbol syntaxCopy(Dsymbol s) { TemplateInstance ti = s ? cast(TemplateInstance)s : new TemplateInstance(loc, name, null); ti.tiargs = arraySyntaxCopy(tiargs); TemplateDeclaration td; if (inst && tempdecl && (td = tempdecl.isTemplateDeclaration()) !is null) td.ScopeDsymbol.syntaxCopy(ti); else ScopeDsymbol.syntaxCopy(ti); return ti; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class Nspace : ScopeDsymbol { /** * Namespace identifier resolved during semantic. */ Expression identExp; extern (D) this(const ref Loc loc, Identifier ident, Expression identExp, Dsymbols* members) { super(ident); this.loc = loc; this.members = members; this.identExp = identExp; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CompileDeclaration : AttribDeclaration { Expressions* exps; extern (D) this(const ref Loc loc, Expressions* exps) { super(null); this.loc = loc; this.exps = exps; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class UserAttributeDeclaration : AttribDeclaration { Expressions* atts; extern (D) this(Expressions* atts, Dsymbols* decl) { super(decl); this.atts = atts; } extern (D) static Expressions* concat(Expressions* udas1, Expressions* udas2) { Expressions* udas; if (!udas1 || udas1.dim == 0) udas = udas2; else if (!udas2 || udas2.dim == 0) udas = udas1; else { udas = new Expressions(2); (*udas)[0] = new TupleExp(Loc.initial, udas1); (*udas)[1] = new TupleExp(Loc.initial, udas2); } return udas; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class LinkDeclaration : AttribDeclaration { LINK linkage; extern (D) this(LINK p, Dsymbols* decl) { super(decl); linkage = p; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AnonDeclaration : AttribDeclaration { bool isunion; extern (D) this(const ref Loc loc, bool isunion, Dsymbols* decl) { super(decl); this.loc = loc; this.isunion = isunion; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AlignDeclaration : AttribDeclaration { Expression ealign; extern (D) this(const ref Loc loc, Expression ealign, Dsymbols* decl) { super(decl); this.loc = loc; this.ealign = ealign; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CPPMangleDeclaration : AttribDeclaration { CPPMANGLE cppmangle; extern (D) this(CPPMANGLE p, Dsymbols* decl) { super(decl); cppmangle = p; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CPPNamespaceDeclaration : AttribDeclaration { Expression exp; extern (D) this(Identifier ident, Dsymbols* decl) { super(decl); this.ident = ident; } extern (D) this(Expression exp, Dsymbols* decl) { super(decl); this.exp = exp; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ProtDeclaration : AttribDeclaration { Prot protection; Identifiers* pkg_identifiers; extern (D) this(const ref Loc loc, Prot p, Dsymbols* decl) { super(decl); this.loc = loc; this.protection = p; } extern (D) this(const ref Loc loc, Identifiers* pkg_identifiers, Dsymbols* decl) { super(decl); this.loc = loc; this.protection.kind = Prot.Kind.package_; this.protection.pkg = null; this.pkg_identifiers = pkg_identifiers; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PragmaDeclaration : AttribDeclaration { Expressions* args; extern (D) this(const ref Loc loc, Identifier ident, Expressions* args, Dsymbols* decl) { super(decl); this.loc = loc; this.ident = ident; this.args = args; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class StorageClassDeclaration : AttribDeclaration { StorageClass stc; final extern (D) this(StorageClass stc, Dsymbols* decl) { super(decl); this.stc = stc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class ConditionalDeclaration : AttribDeclaration { Condition condition; Dsymbols* elsedecl; final extern (D) this(Condition condition, Dsymbols* decl, Dsymbols* elsedecl) { super(decl); this.condition = condition; this.elsedecl = elsedecl; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DeprecatedDeclaration : StorageClassDeclaration { Expression msg; extern (D) this(Expression msg, Dsymbols* decl) { super(STC.deprecated_, decl); this.msg = msg; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StaticIfDeclaration : ConditionalDeclaration { extern (D) this(Condition condition, Dsymbols* decl, Dsymbols* elsedecl) { super(condition, decl, elsedecl); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StaticForeachDeclaration : AttribDeclaration { StaticForeach sfe; extern (D) this(StaticForeach sfe, Dsymbols* decl) { super(decl); this.sfe = sfe; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class EnumMember : VarDeclaration { Expression origValue; Type origType; @property ref value() { return (cast(ExpInitializer)_init).exp; } extern (D) this(const ref Loc loc, Identifier id, Expression value, Type origType) { super(loc, null, id ? id : Id.empty, new ExpInitializer(loc, value)); this.origValue = value; this.origType = origType; } extern(D) this(const ref Loc loc, Identifier id, Expression value, Type memtype, StorageClass stc, UserAttributeDeclaration uad, DeprecatedDeclaration dd) { this(loc, id, value, memtype); storage_class = stc; userAttribDecl = uad; // just ignore `dd` } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class Module : Package { extern (C++) __gshared AggregateDeclaration moduleinfo; const FileName srcfile; const(char)* arg; extern (D) this(const(char)* filename, Identifier ident, int doDocComment, int doHdrGen) { super(ident); this.arg = filename; srcfile = FileName(FileName.defaultExt(filename.toDString, global.mars_ext)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class StructDeclaration : AggregateDeclaration { int zeroInit; StructPOD ispod; final extern (D) this(const ref Loc loc, Identifier id, bool inObject) { super(loc, id); zeroInit = 0; ispod = StructPOD.fwd; type = new TypeStruct(this); if (inObject) { if (id == Id.ModuleInfo && !Module.moduleinfo) Module.moduleinfo = this; } } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class UnionDeclaration : StructDeclaration { extern (D) this(const ref Loc loc, Identifier id) { super(loc, id, false); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class ClassDeclaration : AggregateDeclaration { extern (C++) __gshared { // Names found by reading object.d in druntime ClassDeclaration object; ClassDeclaration throwable; ClassDeclaration exception; ClassDeclaration errorException; ClassDeclaration cpp_type_info_ptr; // Object.__cpp_type_info_ptr } BaseClasses* baseclasses; Baseok baseok; final extern (D) this(const ref Loc loc, Identifier id, BaseClasses* baseclasses, Dsymbols* members, bool inObject) { if(!id) id = Identifier.generateId("__anonclass"); assert(id); super(loc, id); __gshared const(char)* msg = "only object.d can define this reserved class name"; if (baseclasses) { // Actually, this is a transfer this.baseclasses = baseclasses; } else this.baseclasses = new BaseClasses(); this.members = members; //printf("ClassDeclaration(%s), dim = %d\n", id.toChars(), this.baseclasses.dim); // For forward references type = new TypeClass(this); if (id) { // Look for special class names if (id == Id.__sizeof || id == Id.__xalignof || id == Id._mangleof) error("illegal class name"); // BUG: What if this is the wrong TypeInfo, i.e. it is nested? if (id.toChars()[0] == 'T') { if (id == Id.TypeInfo) { if (!inObject) error("%s", msg); Type.dtypeinfo = this; } if (id == Id.TypeInfo_Class) { if (!inObject) error("%s", msg); Type.typeinfoclass = this; } if (id == Id.TypeInfo_Interface) { if (!inObject) error("%s", msg); Type.typeinfointerface = this; } if (id == Id.TypeInfo_Struct) { if (!inObject) error("%s", msg); Type.typeinfostruct = this; } if (id == Id.TypeInfo_Pointer) { if (!inObject) error("%s", msg); Type.typeinfopointer = this; } if (id == Id.TypeInfo_Array) { if (!inObject) error("%s", msg); Type.typeinfoarray = this; } if (id == Id.TypeInfo_StaticArray) { //if (!inObject) // Type.typeinfostaticarray.error("%s", msg); Type.typeinfostaticarray = this; } if (id == Id.TypeInfo_AssociativeArray) { if (!inObject) error("%s", msg); Type.typeinfoassociativearray = this; } if (id == Id.TypeInfo_Enum) { if (!inObject) error("%s", msg); Type.typeinfoenum = this; } if (id == Id.TypeInfo_Function) { if (!inObject) error("%s", msg); Type.typeinfofunction = this; } if (id == Id.TypeInfo_Delegate) { if (!inObject) error("%s", msg); Type.typeinfodelegate = this; } if (id == Id.TypeInfo_Tuple) { if (!inObject) error("%s", msg); Type.typeinfotypelist = this; } if (id == Id.TypeInfo_Const) { if (!inObject) error("%s", msg); Type.typeinfoconst = this; } if (id == Id.TypeInfo_Invariant) { if (!inObject) error("%s", msg); Type.typeinfoinvariant = this; } if (id == Id.TypeInfo_Shared) { if (!inObject) error("%s", msg); Type.typeinfoshared = this; } if (id == Id.TypeInfo_Wild) { if (!inObject) error("%s", msg); Type.typeinfowild = this; } if (id == Id.TypeInfo_Vector) { if (!inObject) error("%s", msg); Type.typeinfovector = this; } } if (id == Id.Object) { if (!inObject) error("%s", msg); object = this; } if (id == Id.Throwable) { if (!inObject) error("%s", msg); throwable = this; } if (id == Id.Exception) { if (!inObject) error("%s", msg); exception = this; } if (id == Id.Error) { if (!inObject) error("%s", msg); errorException = this; } if (id == Id.cpp_type_info_ptr) { if (!inObject) error("%s", msg); cpp_type_info_ptr = this; } } baseok = Baseok.none; } override final inout(ClassDeclaration) isClassDeclaration() inout { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class InterfaceDeclaration : ClassDeclaration { final extern (D) this(const ref Loc loc, Identifier id, BaseClasses* baseclasses) { super(loc, id, baseclasses, null, false); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TemplateMixin : TemplateInstance { TypeQualified tqual; extern (D) this(const ref Loc loc, Identifier ident, TypeQualified tqual, Objects *tiargs) { super(loc, tqual.idents.dim ? cast(Identifier)tqual.idents[tqual.idents.dim - 1] : (cast(TypeIdentifier)tqual).ident, tiargs ? tiargs : new Objects()); this.ident = ident; this.tqual = tqual; } override void accept(Visitor v) { v.visit(this); } } extern (C++) struct ParameterList { Parameters* parameters; VarArg varargs = VarArg.none; } extern (C++) final class Parameter : ASTNode { StorageClass storageClass; Type type; Identifier ident; Expression defaultArg; UserAttributeDeclaration userAttribDecl; // user defined attributes extern (D) alias ForeachDg = int delegate(size_t idx, Parameter param); final extern (D) this(StorageClass storageClass, Type type, Identifier ident, Expression defaultArg, UserAttributeDeclaration userAttribDecl) { this.storageClass = storageClass; this.type = type; this.ident = ident; this.defaultArg = defaultArg; this.userAttribDecl = userAttribDecl; } static size_t dim(Parameters* parameters) { size_t nargs = 0; int dimDg(size_t n, Parameter p) { ++nargs; return 0; } _foreach(parameters, &dimDg); return nargs; } static Parameter getNth(Parameters* parameters, size_t nth, size_t* pn = null) { Parameter param; int getNthParamDg(size_t n, Parameter p) { if (n == nth) { param = p; return 1; } return 0; } int res = _foreach(parameters, &getNthParamDg); return res ? param : null; } extern (D) static int _foreach(Parameters* parameters, scope ForeachDg dg, size_t* pn = null) { assert(dg); if (!parameters) return 0; size_t n = pn ? *pn : 0; // take over index int result = 0; foreach (i; 0 .. parameters.dim) { Parameter p = (*parameters)[i]; Type t = p.type.toBasetype(); if (t.ty == Ttuple) { TypeTuple tu = cast(TypeTuple)t; result = _foreach(tu.arguments, dg, &n); } else result = dg(n++, p); if (result) break; } if (pn) *pn = n; // update index return result; } Parameter syntaxCopy() { return new Parameter(storageClass, type ? type.syntaxCopy() : null, ident, defaultArg ? defaultArg.syntaxCopy() : null, userAttribDecl ? cast(UserAttributeDeclaration) userAttribDecl.syntaxCopy(null) : null); } override void accept(Visitor v) { v.visit(this); } static Parameters* arraySyntaxCopy(Parameters* parameters) { Parameters* params = null; if (parameters) { params = new Parameters(); params.setDim(parameters.dim); for (size_t i = 0; i < params.dim; i++) (*params)[i] = (*parameters)[i].syntaxCopy(); } return params; } } enum STMT : ubyte { Error, Peel, Exp, DtorExp, Compile, Compound, CompoundDeclaration, CompoundAsm, UnrolledLoop, Scope, Forwarding, While, Do, For, Foreach, ForeachRange, If, Conditional, StaticForeach, Pragma, StaticAssert, Switch, Case, CaseRange, Default, GotoDefault, GotoCase, SwitchError, Return, Break, Continue, Synchronized, With, TryCatch, TryFinally, ScopeGuard, Throw, Debug, Goto, Label, Asm, InlineAsm, GccAsm, Import, } extern (C++) abstract class Statement : ASTNode { Loc loc; STMT stmt; final extern (D) this(const ref Loc loc, STMT stmt) { this.loc = loc; this.stmt = stmt; } nothrow pure @nogc inout(ExpStatement) isExpStatement() inout { return stmt == STMT.Exp ? cast(typeof(return))this : null; } nothrow pure @nogc inout(CompoundStatement) isCompoundStatement() inout { return stmt == STMT.Compound ? cast(typeof(return))this : null; } nothrow pure @nogc inout(ReturnStatement) isReturnStatement() inout { return stmt == STMT.Return ? cast(typeof(return))this : null; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ImportStatement : Statement { Dsymbols* imports; extern (D) this(const ref Loc loc, Dsymbols* imports) { super(loc, STMT.Import); this.imports = imports; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ScopeStatement : Statement { Statement statement; Loc endloc; extern (D) this(const ref Loc loc, Statement s, Loc endloc) { super(loc, STMT.Scope); this.statement = s; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ReturnStatement : Statement { Expression exp; extern (D) this(const ref Loc loc, Expression exp) { super(loc, STMT.Return); this.exp = exp; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class LabelStatement : Statement { Identifier ident; Statement statement; final extern (D) this(const ref Loc loc, Identifier ident, Statement statement) { super(loc, STMT.Label); this.ident = ident; this.statement = statement; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StaticAssertStatement : Statement { StaticAssert sa; final extern (D) this(StaticAssert sa) { super(sa.loc, STMT.StaticAssert); this.sa = sa; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CompileStatement : Statement { Expressions* exps; final extern (D) this(const ref Loc loc, Expressions* exps) { super(loc, STMT.Compile); this.exps = exps; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class WhileStatement : Statement { Expression condition; Statement _body; Loc endloc; extern (D) this(const ref Loc loc, Expression c, Statement b, Loc endloc) { super(loc, STMT.While); condition = c; _body = b; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ForStatement : Statement { Statement _init; Expression condition; Expression increment; Statement _body; Loc endloc; extern (D) this(const ref Loc loc, Statement _init, Expression condition, Expression increment, Statement _body, Loc endloc) { super(loc, STMT.For); this._init = _init; this.condition = condition; this.increment = increment; this._body = _body; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DoStatement : Statement { Statement _body; Expression condition; Loc endloc; extern (D) this(const ref Loc loc, Statement b, Expression c, Loc endloc) { super(loc, STMT.Do); _body = b; condition = c; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ForeachRangeStatement : Statement { TOK op; // TOK.foreach_ or TOK.foreach_reverse_ Parameter prm; // loop index variable Expression lwr; Expression upr; Statement _body; Loc endloc; // location of closing curly bracket extern (D) this(const ref Loc loc, TOK op, Parameter prm, Expression lwr, Expression upr, Statement _body, Loc endloc) { super(loc, STMT.ForeachRange); this.op = op; this.prm = prm; this.lwr = lwr; this.upr = upr; this._body = _body; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ForeachStatement : Statement { TOK op; // TOK.foreach_ or TOK.foreach_reverse_ Parameters* parameters; // array of Parameter*'s Expression aggr; Statement _body; Loc endloc; // location of closing curly bracket extern (D) this(const ref Loc loc, TOK op, Parameters* parameters, Expression aggr, Statement _body, Loc endloc) { super(loc, STMT.Foreach); this.op = op; this.parameters = parameters; this.aggr = aggr; this._body = _body; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class IfStatement : Statement { Parameter prm; Expression condition; Statement ifbody; Statement elsebody; VarDeclaration match; // for MatchExpression results Loc endloc; // location of closing curly bracket extern (D) this(const ref Loc loc, Parameter prm, Expression condition, Statement ifbody, Statement elsebody, Loc endloc) { super(loc, STMT.If); this.prm = prm; this.condition = condition; this.ifbody = ifbody; this.elsebody = elsebody; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ScopeGuardStatement : Statement { TOK tok; Statement statement; extern (D) this(const ref Loc loc, TOK tok, Statement statement) { super(loc, STMT.ScopeGuard); this.tok = tok; this.statement = statement; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ConditionalStatement : Statement { Condition condition; Statement ifbody; Statement elsebody; extern (D) this(const ref Loc loc, Condition condition, Statement ifbody, Statement elsebody) { super(loc, STMT.Conditional); this.condition = condition; this.ifbody = ifbody; this.elsebody = elsebody; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StaticForeachStatement : Statement { StaticForeach sfe; extern (D) this(const ref Loc loc, StaticForeach sfe) { super(loc, STMT.StaticForeach); this.sfe = sfe; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PragmaStatement : Statement { Identifier ident; Expressions* args; // array of Expression's Statement _body; extern (D) this(const ref Loc loc, Identifier ident, Expressions* args, Statement _body) { super(loc, STMT.Pragma); this.ident = ident; this.args = args; this._body = _body; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class SwitchStatement : Statement { Expression condition; Statement _body; bool isFinal; extern (D) this(const ref Loc loc, Expression c, Statement b, bool isFinal) { super(loc, STMT.Switch); this.condition = c; this._body = b; this.isFinal = isFinal; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CaseRangeStatement : Statement { Expression first; Expression last; Statement statement; extern (D) this(const ref Loc loc, Expression first, Expression last, Statement s) { super(loc, STMT.CaseRange); this.first = first; this.last = last; this.statement = s; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CaseStatement : Statement { Expression exp; Statement statement; extern (D) this(const ref Loc loc, Expression exp, Statement s) { super(loc, STMT.Case); this.exp = exp; this.statement = s; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DefaultStatement : Statement { Statement statement; extern (D) this(const ref Loc loc, Statement s) { super(loc, STMT.Default); this.statement = s; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class BreakStatement : Statement { Identifier ident; extern (D) this(const ref Loc loc, Identifier ident) { super(loc, STMT.Break); this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ContinueStatement : Statement { Identifier ident; extern (D) this(const ref Loc loc, Identifier ident) { super(loc, STMT.Continue); this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class GotoDefaultStatement : Statement { extern (D) this(const ref Loc loc) { super(loc, STMT.GotoDefault); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class GotoCaseStatement : Statement { Expression exp; extern (D) this(const ref Loc loc, Expression exp) { super(loc, STMT.GotoCase); this.exp = exp; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class GotoStatement : Statement { Identifier ident; extern (D) this(const ref Loc loc, Identifier ident) { super(loc, STMT.Goto); this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class SynchronizedStatement : Statement { Expression exp; Statement _body; extern (D) this(const ref Loc loc, Expression exp, Statement _body) { super(loc, STMT.Synchronized); this.exp = exp; this._body = _body; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class WithStatement : Statement { Expression exp; Statement _body; Loc endloc; extern (D) this(const ref Loc loc, Expression exp, Statement _body, Loc endloc) { super(loc, STMT.With); this.exp = exp; this._body = _body; this.endloc = endloc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TryCatchStatement : Statement { Statement _body; Catches* catches; extern (D) this(const ref Loc loc, Statement _body, Catches* catches) { super(loc, STMT.TryCatch); this._body = _body; this.catches = catches; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TryFinallyStatement : Statement { Statement _body; Statement finalbody; extern (D) this(const ref Loc loc, Statement _body, Statement finalbody) { super(loc, STMT.TryFinally); this._body = _body; this.finalbody = finalbody; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ThrowStatement : Statement { Expression exp; extern (D) this(const ref Loc loc, Expression exp) { super(loc, STMT.Throw); this.exp = exp; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class AsmStatement : Statement { Token* tokens; extern (D) this(const ref Loc loc, Token* tokens) { super(loc, STMT.Asm); this.tokens = tokens; } extern (D) this(const ref Loc loc, Token* tokens, STMT stmt) { super(loc, stmt); this.tokens = tokens; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class InlineAsmStatement : AsmStatement { extern (D) this(const ref Loc loc, Token* tokens) { super(loc, tokens, STMT.InlineAsm); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class GccAsmStatement : AsmStatement { extern (D) this(const ref Loc loc, Token* tokens) { super(loc, tokens, STMT.GccAsm); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class ExpStatement : Statement { Expression exp; final extern (D) this(const ref Loc loc, Expression exp) { super(loc, STMT.Exp); this.exp = exp; } final extern (D) this(const ref Loc loc, Dsymbol declaration) { super(loc, STMT.Exp); this.exp = new DeclarationExp(loc, declaration); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class CompoundStatement : Statement { Statements* statements; final extern (D) this(const ref Loc loc, Statements* statements) { super(loc, STMT.Compound); this.statements = statements; } final extern (D) this(const ref Loc loc, Statements* statements, STMT stmt) { super(loc, stmt); this.statements = statements; } final extern (D) this(const ref Loc loc, Statement[] sts...) { super(loc, STMT.Compound); statements = new Statements(); statements.reserve(sts.length); foreach (s; sts) statements.push(s); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CompoundDeclarationStatement : CompoundStatement { final extern (D) this(const ref Loc loc, Statements* statements) { super(loc, statements, STMT.CompoundDeclaration); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CompoundAsmStatement : CompoundStatement { StorageClass stc; final extern (D) this(const ref Loc loc, Statements* s, StorageClass stc) { super(loc, s, STMT.CompoundAsm); this.stc = stc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class Catch : RootObject { Loc loc; Type type; Identifier ident; Statement handler; extern (D) this(const ref Loc loc, Type t, Identifier id, Statement handler) { this.loc = loc; this.type = t; this.ident = id; this.handler = handler; } } extern (C++) abstract class Type : ASTNode { TY ty; MOD mod; char* deco; extern (C++) __gshared Type tvoid; extern (C++) __gshared Type tint8; extern (C++) __gshared Type tuns8; extern (C++) __gshared Type tint16; extern (C++) __gshared Type tuns16; extern (C++) __gshared Type tint32; extern (C++) __gshared Type tuns32; extern (C++) __gshared Type tint64; extern (C++) __gshared Type tuns64; extern (C++) __gshared Type tint128; extern (C++) __gshared Type tuns128; extern (C++) __gshared Type tfloat32; extern (C++) __gshared Type tfloat64; extern (C++) __gshared Type tfloat80; extern (C++) __gshared Type timaginary32; extern (C++) __gshared Type timaginary64; extern (C++) __gshared Type timaginary80; extern (C++) __gshared Type tcomplex32; extern (C++) __gshared Type tcomplex64; extern (C++) __gshared Type tcomplex80; extern (C++) __gshared Type tbool; extern (C++) __gshared Type tchar; extern (C++) __gshared Type twchar; extern (C++) __gshared Type tdchar; extern (C++) __gshared Type[TMAX] basic; extern (C++) __gshared Type tshiftcnt; extern (C++) __gshared Type tvoidptr; // void* extern (C++) __gshared Type tstring; // immutable(char)[] extern (C++) __gshared Type twstring; // immutable(wchar)[] extern (C++) __gshared Type tdstring; // immutable(dchar)[] extern (C++) __gshared Type tvalist; // va_list alias extern (C++) __gshared Type terror; // for error recovery extern (C++) __gshared Type tnull; // for null type extern (C++) __gshared Type tsize_t; // matches size_t alias extern (C++) __gshared Type tptrdiff_t; // matches ptrdiff_t alias extern (C++) __gshared Type thash_t; // matches hash_t alias extern (C++) __gshared ClassDeclaration dtypeinfo; extern (C++) __gshared ClassDeclaration typeinfoclass; extern (C++) __gshared ClassDeclaration typeinfointerface; extern (C++) __gshared ClassDeclaration typeinfostruct; extern (C++) __gshared ClassDeclaration typeinfopointer; extern (C++) __gshared ClassDeclaration typeinfoarray; extern (C++) __gshared ClassDeclaration typeinfostaticarray; extern (C++) __gshared ClassDeclaration typeinfoassociativearray; extern (C++) __gshared ClassDeclaration typeinfovector; extern (C++) __gshared ClassDeclaration typeinfoenum; extern (C++) __gshared ClassDeclaration typeinfofunction; extern (C++) __gshared ClassDeclaration typeinfodelegate; extern (C++) __gshared ClassDeclaration typeinfotypelist; extern (C++) __gshared ClassDeclaration typeinfoconst; extern (C++) __gshared ClassDeclaration typeinfoinvariant; extern (C++) __gshared ClassDeclaration typeinfoshared; extern (C++) __gshared ClassDeclaration typeinfowild; extern (C++) __gshared StringTable!Type stringtable; extern (C++) __gshared ubyte[TMAX] sizeTy = () { ubyte[TMAX] sizeTy = __traits(classInstanceSize, TypeBasic); sizeTy[Tsarray] = __traits(classInstanceSize, TypeSArray); sizeTy[Tarray] = __traits(classInstanceSize, TypeDArray); sizeTy[Taarray] = __traits(classInstanceSize, TypeAArray); sizeTy[Tpointer] = __traits(classInstanceSize, TypePointer); sizeTy[Treference] = __traits(classInstanceSize, TypeReference); sizeTy[Tfunction] = __traits(classInstanceSize, TypeFunction); sizeTy[Tdelegate] = __traits(classInstanceSize, TypeDelegate); sizeTy[Tident] = __traits(classInstanceSize, TypeIdentifier); sizeTy[Tinstance] = __traits(classInstanceSize, TypeInstance); sizeTy[Ttypeof] = __traits(classInstanceSize, TypeTypeof); sizeTy[Tenum] = __traits(classInstanceSize, TypeEnum); sizeTy[Tstruct] = __traits(classInstanceSize, TypeStruct); sizeTy[Tclass] = __traits(classInstanceSize, TypeClass); sizeTy[Ttuple] = __traits(classInstanceSize, TypeTuple); sizeTy[Tslice] = __traits(classInstanceSize, TypeSlice); sizeTy[Treturn] = __traits(classInstanceSize, TypeReturn); sizeTy[Terror] = __traits(classInstanceSize, TypeError); sizeTy[Tnull] = __traits(classInstanceSize, TypeNull); sizeTy[Tvector] = __traits(classInstanceSize, TypeVector); sizeTy[Tmixin] = __traits(classInstanceSize, TypeMixin); return sizeTy; }(); Type cto; Type ito; Type sto; Type scto; Type wto; Type wcto; Type swto; Type swcto; Type pto; Type rto; Type arrayof; // These members are probably used in semnatic analysis //TypeInfoDeclaration vtinfo; //type* ctype; final extern (D) this(TY ty) { this.ty = ty; } override const(char)* toChars() const { return "type"; } static void _init() { stringtable._init(14000); // Set basic types __gshared TY* basetab = [ Tvoid, Tint8, Tuns8, Tint16, Tuns16, Tint32, Tuns32, Tint64, Tuns64, Tint128, Tuns128, Tfloat32, Tfloat64, Tfloat80, Timaginary32, Timaginary64, Timaginary80, Tcomplex32, Tcomplex64, Tcomplex80, Tbool, Tchar, Twchar, Tdchar, Terror ]; for (size_t i = 0; basetab[i] != Terror; i++) { Type t = new TypeBasic(basetab[i]); t = t.merge(); basic[basetab[i]] = t; } basic[Terror] = new TypeError(); tvoid = basic[Tvoid]; tint8 = basic[Tint8]; tuns8 = basic[Tuns8]; tint16 = basic[Tint16]; tuns16 = basic[Tuns16]; tint32 = basic[Tint32]; tuns32 = basic[Tuns32]; tint64 = basic[Tint64]; tuns64 = basic[Tuns64]; tint128 = basic[Tint128]; tuns128 = basic[Tuns128]; tfloat32 = basic[Tfloat32]; tfloat64 = basic[Tfloat64]; tfloat80 = basic[Tfloat80]; timaginary32 = basic[Timaginary32]; timaginary64 = basic[Timaginary64]; timaginary80 = basic[Timaginary80]; tcomplex32 = basic[Tcomplex32]; tcomplex64 = basic[Tcomplex64]; tcomplex80 = basic[Tcomplex80]; tbool = basic[Tbool]; tchar = basic[Tchar]; twchar = basic[Twchar]; tdchar = basic[Tdchar]; tshiftcnt = tint32; terror = basic[Terror]; tnull = basic[Tnull]; tnull = new TypeNull(); tnull.deco = tnull.merge().deco; tvoidptr = tvoid.pointerTo(); tstring = tchar.immutableOf().arrayOf(); twstring = twchar.immutableOf().arrayOf(); tdstring = tdchar.immutableOf().arrayOf(); tvalist = Target.va_listType(); const isLP64 = global.params.isLP64; tsize_t = basic[isLP64 ? Tuns64 : Tuns32]; tptrdiff_t = basic[isLP64 ? Tint64 : Tint32]; thash_t = tsize_t; } final Type pointerTo() { if (ty == Terror) return this; if (!pto) { Type t = new TypePointer(this); if (ty == Tfunction) { t.deco = t.merge().deco; pto = t; } else pto = t.merge(); } return pto; } final Type arrayOf() { if (ty == Terror) return this; if (!arrayof) { Type t = new TypeDArray(this); arrayof = t.merge(); } return arrayof; } final bool isImmutable() const { return (mod & MODFlags.immutable_) != 0; } final Type nullAttributes() { uint sz = sizeTy[ty]; Type t = cast(Type)mem.xmalloc(sz); memcpy(cast(void*)t, cast(void*)this, sz); // t.mod = NULL; // leave mod unchanged t.deco = null; t.arrayof = null; t.pto = null; t.rto = null; t.cto = null; t.ito = null; t.sto = null; t.scto = null; t.wto = null; t.wcto = null; t.swto = null; t.swcto = null; //t.vtinfo = null; these aren't used in parsing //t.ctype = null; if (t.ty == Tstruct) (cast(TypeStruct)t).att = AliasThisRec.fwdref; if (t.ty == Tclass) (cast(TypeClass)t).att = AliasThisRec.fwdref; return t; } Type makeConst() { if (cto) return cto; Type t = this.nullAttributes(); t.mod = MODFlags.const_; return t; } Type makeWildConst() { if (wcto) return wcto; Type t = this.nullAttributes(); t.mod = MODFlags.wildconst; return t; } Type makeShared() { if (sto) return sto; Type t = this.nullAttributes(); t.mod = MODFlags.shared_; return t; } Type makeSharedConst() { if (scto) return scto; Type t = this.nullAttributes(); t.mod = MODFlags.shared_ | MODFlags.const_; return t; } Type makeImmutable() { if (ito) return ito; Type t = this.nullAttributes(); t.mod = MODFlags.immutable_; return t; } Type makeWild() { if (wto) return wto; Type t = this.nullAttributes(); t.mod = MODFlags.wild; return t; } Type makeSharedWildConst() { if (swcto) return swcto; Type t = this.nullAttributes(); t.mod = MODFlags.shared_ | MODFlags.wildconst; return t; } Type makeSharedWild() { if (swto) return swto; Type t = this.nullAttributes(); t.mod = MODFlags.shared_ | MODFlags.wild; return t; } // Truncated final Type merge() { if (ty == Terror) return this; if (ty == Ttypeof) return this; if (ty == Tident) return this; if (ty == Tinstance) return this; if (ty == Taarray && !(cast(TypeAArray)this).index.merge().deco) return this; if (ty != Tenum && nextOf() && !nextOf().deco) return this; // if (!deco) - code missing Type t = this; assert(t); return t; } final Type addSTC(StorageClass stc) { Type t = this; if (t.isImmutable()) { } else if (stc & STC.immutable_) { t = t.makeImmutable(); } else { if ((stc & STC.shared_) && !t.isShared()) { if (t.isWild()) { if (t.isConst()) t = t.makeSharedWildConst(); else t = t.makeSharedWild(); } else { if (t.isConst()) t = t.makeSharedConst(); else t = t.makeShared(); } } if ((stc & STC.const_) && !t.isConst()) { if (t.isShared()) { if (t.isWild()) t = t.makeSharedWildConst(); else t = t.makeSharedConst(); } else { if (t.isWild()) t = t.makeWildConst(); else t = t.makeConst(); } } if ((stc & STC.wild) && !t.isWild()) { if (t.isShared()) { if (t.isConst()) t = t.makeSharedWildConst(); else t = t.makeSharedWild(); } else { if (t.isConst()) t = t.makeWildConst(); else t = t.makeWild(); } } } return t; } Expression toExpression() { return null; } Type syntaxCopy() { return null; } final Type sharedWildConstOf() { if (mod == (MODFlags.shared_ | MODFlags.wildconst)) return this; if (swcto) { assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst)); return swcto; } Type t = makeSharedWildConst(); t = t.merge(); t.fixTo(this); return t; } final Type sharedConstOf() { if (mod == (MODFlags.shared_ | MODFlags.const_)) return this; if (scto) { assert(scto.mod == (MODFlags.shared_ | MODFlags.const_)); return scto; } Type t = makeSharedConst(); t = t.merge(); t.fixTo(this); return t; } final Type wildConstOf() { if (mod == MODFlags.wildconst) return this; if (wcto) { assert(wcto.mod == MODFlags.wildconst); return wcto; } Type t = makeWildConst(); t = t.merge(); t.fixTo(this); return t; } final Type constOf() { if (mod == MODFlags.const_) return this; if (cto) { assert(cto.mod == MODFlags.const_); return cto; } Type t = makeConst(); t = t.merge(); t.fixTo(this); return t; } final Type sharedWildOf() { if (mod == (MODFlags.shared_ | MODFlags.wild)) return this; if (swto) { assert(swto.mod == (MODFlags.shared_ | MODFlags.wild)); return swto; } Type t = makeSharedWild(); t = t.merge(); t.fixTo(this); return t; } final Type wildOf() { if (mod == MODFlags.wild) return this; if (wto) { assert(wto.mod == MODFlags.wild); return wto; } Type t = makeWild(); t = t.merge(); t.fixTo(this); return t; } final Type sharedOf() { if (mod == MODFlags.shared_) return this; if (sto) { assert(sto.mod == MODFlags.shared_); return sto; } Type t = makeShared(); t = t.merge(); t.fixTo(this); return t; } final Type immutableOf() { if (isImmutable()) return this; if (ito) { assert(ito.isImmutable()); return ito; } Type t = makeImmutable(); t = t.merge(); t.fixTo(this); return t; } final void fixTo(Type t) { Type mto = null; Type tn = nextOf(); if (!tn || ty != Tsarray && tn.mod == t.nextOf().mod) { switch (t.mod) { case 0: mto = t; break; case MODFlags.const_: cto = t; break; case MODFlags.wild: wto = t; break; case MODFlags.wildconst: wcto = t; break; case MODFlags.shared_: sto = t; break; case MODFlags.shared_ | MODFlags.const_: scto = t; break; case MODFlags.shared_ | MODFlags.wild: swto = t; break; case MODFlags.shared_ | MODFlags.wildconst: swcto = t; break; case MODFlags.immutable_: ito = t; break; default: break; } } assert(mod != t.mod); auto X(T, U)(T m, U n) { return ((m << 4) | n); } switch (mod) { case 0: break; case MODFlags.const_: cto = mto; t.cto = this; break; case MODFlags.wild: wto = mto; t.wto = this; break; case MODFlags.wildconst: wcto = mto; t.wcto = this; break; case MODFlags.shared_: sto = mto; t.sto = this; break; case MODFlags.shared_ | MODFlags.const_: scto = mto; t.scto = this; break; case MODFlags.shared_ | MODFlags.wild: swto = mto; t.swto = this; break; case MODFlags.shared_ | MODFlags.wildconst: swcto = mto; t.swcto = this; break; case MODFlags.immutable_: t.ito = this; if (t.cto) t.cto.ito = this; if (t.sto) t.sto.ito = this; if (t.scto) t.scto.ito = this; if (t.wto) t.wto.ito = this; if (t.wcto) t.wcto.ito = this; if (t.swto) t.swto.ito = this; if (t.swcto) t.swcto.ito = this; break; default: assert(0); } } final Type addMod(MOD mod) { Type t = this; if (!t.isImmutable()) { switch (mod) { case 0: break; case MODFlags.const_: if (isShared()) { if (isWild()) t = sharedWildConstOf(); else t = sharedConstOf(); } else { if (isWild()) t = wildConstOf(); else t = constOf(); } break; case MODFlags.wild: if (isShared()) { if (isConst()) t = sharedWildConstOf(); else t = sharedWildOf(); } else { if (isConst()) t = wildConstOf(); else t = wildOf(); } break; case MODFlags.wildconst: if (isShared()) t = sharedWildConstOf(); else t = wildConstOf(); break; case MODFlags.shared_: if (isWild()) { if (isConst()) t = sharedWildConstOf(); else t = sharedWildOf(); } else { if (isConst()) t = sharedConstOf(); else t = sharedOf(); } break; case MODFlags.shared_ | MODFlags.const_: if (isWild()) t = sharedWildConstOf(); else t = sharedConstOf(); break; case MODFlags.shared_ | MODFlags.wild: if (isConst()) t = sharedWildConstOf(); else t = sharedWildOf(); break; case MODFlags.shared_ | MODFlags.wildconst: t = sharedWildConstOf(); break; case MODFlags.immutable_: t = immutableOf(); break; default: assert(0); } } return t; } // TypeEnum overrides this method Type nextOf() { return null; } // TypeBasic, TypeVector, TypePointer, TypeEnum override this method bool isscalar() { return false; } final bool isConst() const { return (mod & MODFlags.const_) != 0; } final bool isWild() const { return (mod & MODFlags.wild) != 0; } final bool isShared() const { return (mod & MODFlags.shared_) != 0; } Type toBasetype() { return this; } // TypeIdentifier, TypeInstance, TypeTypeOf, TypeReturn, TypeStruct, TypeEnum, TypeClass override this method Dsymbol toDsymbol(Scope* sc) { return null; } override void accept(Visitor v) { v.visit(this); } } // missing functionality in constructor, but that's ok // since the class is needed only for its size; need to add all method definitions extern (C++) final class TypeBasic : Type { const(char)* dstring; uint flags; extern (D) this(TY ty) { super(ty); const(char)* d; uint flags = 0; switch (ty) { case Tvoid: d = Token.toChars(TOK.void_); break; case Tint8: d = Token.toChars(TOK.int8); flags |= TFlags.integral; break; case Tuns8: d = Token.toChars(TOK.uns8); flags |= TFlags.integral | TFlags.unsigned; break; case Tint16: d = Token.toChars(TOK.int16); flags |= TFlags.integral; break; case Tuns16: d = Token.toChars(TOK.uns16); flags |= TFlags.integral | TFlags.unsigned; break; case Tint32: d = Token.toChars(TOK.int32); flags |= TFlags.integral; break; case Tuns32: d = Token.toChars(TOK.uns32); flags |= TFlags.integral | TFlags.unsigned; break; case Tfloat32: d = Token.toChars(TOK.float32); flags |= TFlags.floating | TFlags.real_; break; case Tint64: d = Token.toChars(TOK.int64); flags |= TFlags.integral; break; case Tuns64: d = Token.toChars(TOK.uns64); flags |= TFlags.integral | TFlags.unsigned; break; case Tint128: d = Token.toChars(TOK.int128); flags |= TFlags.integral; break; case Tuns128: d = Token.toChars(TOK.uns128); flags |= TFlags.integral | TFlags.unsigned; break; case Tfloat64: d = Token.toChars(TOK.float64); flags |= TFlags.floating | TFlags.real_; break; case Tfloat80: d = Token.toChars(TOK.float80); flags |= TFlags.floating | TFlags.real_; break; case Timaginary32: d = Token.toChars(TOK.imaginary32); flags |= TFlags.floating | TFlags.imaginary; break; case Timaginary64: d = Token.toChars(TOK.imaginary64); flags |= TFlags.floating | TFlags.imaginary; break; case Timaginary80: d = Token.toChars(TOK.imaginary80); flags |= TFlags.floating | TFlags.imaginary; break; case Tcomplex32: d = Token.toChars(TOK.complex32); flags |= TFlags.floating | TFlags.complex; break; case Tcomplex64: d = Token.toChars(TOK.complex64); flags |= TFlags.floating | TFlags.complex; break; case Tcomplex80: d = Token.toChars(TOK.complex80); flags |= TFlags.floating | TFlags.complex; break; case Tbool: d = "bool"; flags |= TFlags.integral | TFlags.unsigned; break; case Tchar: d = Token.toChars(TOK.char_); flags |= TFlags.integral | TFlags.unsigned | TFlags.char_; break; case Twchar: d = Token.toChars(TOK.wchar_); flags |= TFlags.integral | TFlags.unsigned | TFlags.char_; break; case Tdchar: d = Token.toChars(TOK.dchar_); flags |= TFlags.integral | TFlags.unsigned | TFlags.char_; break; default: assert(0); } this.dstring = d; this.flags = flags; merge(); } override bool isscalar() const { return (flags & (TFlags.integral | TFlags.floating)) != 0; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeError : Type { extern (D) this() { super(Terror); } override Type syntaxCopy() { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeNull : Type { extern (D) this() { super(Tnull); } override Type syntaxCopy() { // No semantic analysis done, no need to copy return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TypeVector : Type { Type basetype; extern (D) this(Type baseType) { super(Tvector); this.basetype = basetype; } override Type syntaxCopy() { return new TypeVector(basetype.syntaxCopy()); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeEnum : Type { EnumDeclaration sym; extern (D) this(EnumDeclaration sym) { super(Tenum); this.sym = sym; } override Type syntaxCopy() { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeTuple : Type { Parameters* arguments; extern (D) this(Parameters* arguments) { super(Ttuple); this.arguments = arguments; } extern (D) this(Expressions* exps) { super(Ttuple); auto arguments = new Parameters(); if (exps) { arguments.setDim(exps.dim); for (size_t i = 0; i < exps.dim; i++) { Expression e = (*exps)[i]; if (e.type.ty == Ttuple) e.error("cannot form tuple of tuples"); auto arg = new Parameter(STC.undefined_, e.type, null, null, null); (*arguments)[i] = arg; } } this.arguments = arguments; } override Type syntaxCopy() { Parameters* args = Parameter.arraySyntaxCopy(arguments); Type t = new TypeTuple(args); t.mod = mod; return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeClass : Type { ClassDeclaration sym; AliasThisRec att = AliasThisRec.fwdref; extern (D) this (ClassDeclaration sym) { super(Tclass); this.sym = sym; } override Type syntaxCopy() { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeStruct : Type { StructDeclaration sym; AliasThisRec att = AliasThisRec.fwdref; extern (D) this(StructDeclaration sym) { super(Tstruct); this.sym = sym; } override Type syntaxCopy() { return this; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeReference : TypeNext { extern (D) this(Type t) { super(Treference, t); // BUG: what about references to static arrays? } override Type syntaxCopy() { Type t = next.syntaxCopy(); if (t == next) t = this; else { t = new TypeReference(t); t.mod = mod; } return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class TypeNext : Type { Type next; final extern (D) this(TY ty, Type next) { super(ty); this.next = next; } override final Type nextOf() { return next; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeSlice : TypeNext { Expression lwr; Expression upr; extern (D) this(Type next, Expression lwr, Expression upr) { super(Tslice, next); this.lwr = lwr; this.upr = upr; } override Type syntaxCopy() { Type t = new TypeSlice(next.syntaxCopy(), lwr.syntaxCopy(), upr.syntaxCopy()); t.mod = mod; return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TypeDelegate : TypeNext { extern (D) this(Type t) { super(Tfunction, t); ty = Tdelegate; } override Type syntaxCopy() { Type t = next.syntaxCopy(); if (t == next) t = this; else { t = new TypeDelegate(t); t.mod = mod; } return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypePointer : TypeNext { extern (D) this(Type t) { super(Tpointer, t); } override Type syntaxCopy() { Type t = next.syntaxCopy(); if (t == next) t = this; else { t = new TypePointer(t); t.mod = mod; } return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TypeFunction : TypeNext { ParameterList parameterList; // function parameters bool isnothrow; // true: nothrow bool isnogc; // true: is @nogc bool isproperty; // can be called without parentheses bool isref; // true: returns a reference bool isreturn; // true: 'this' is returned by ref bool isscope; // true: 'this' is scope bool islive; // true: function is @live LINK linkage; // calling convention TRUST trust; // level of trust PURE purity = PURE.impure; ubyte iswild; Expressions* fargs; extern (D) this(ParameterList pl, Type treturn, LINK linkage, StorageClass stc = 0) { super(Tfunction, treturn); assert(VarArg.none <= pl.varargs && pl.varargs <= VarArg.typesafe); this.parameterList = pl; this.linkage = linkage; if (stc & STC.pure_) this.purity = PURE.fwdref; if (stc & STC.nothrow_) this.isnothrow = true; if (stc & STC.nogc) this.isnogc = true; if (stc & STC.property) this.isproperty = true; if (stc & STC.live) this.islive = true; if (stc & STC.ref_) this.isref = true; if (stc & STC.return_) this.isreturn = true; if (stc & STC.scope_) this.isscope = true; this.trust = TRUST.default_; if (stc & STC.safe) this.trust = TRUST.safe; if (stc & STC.system) this.trust = TRUST.system; if (stc & STC.trusted) this.trust = TRUST.trusted; } override Type syntaxCopy() { Type treturn = next ? next.syntaxCopy() : null; Parameters* params = Parameter.arraySyntaxCopy(parameterList.parameters); auto t = new TypeFunction(ParameterList(params, parameterList.varargs), treturn, linkage); t.mod = mod; t.isnothrow = isnothrow; t.isnogc = isnogc; t.purity = purity; t.isproperty = isproperty; t.isref = isref; t.isreturn = isreturn; t.isscope = isscope; t.iswild = iswild; t.trust = trust; t.fargs = fargs; return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TypeArray : TypeNext { final extern (D) this(TY ty, Type next) { super(ty, next); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeDArray : TypeArray { extern (D) this(Type t) { super(Tarray, t); } override Type syntaxCopy() { Type t = next.syntaxCopy(); if (t == next) t = this; else { t = new TypeDArray(t); t.mod = mod; } return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeAArray : TypeArray { Type index; Loc loc; extern (D) this(Type t, Type index) { super(Taarray, t); this.index = index; } override Type syntaxCopy() { Type t = next.syntaxCopy(); Type ti = index.syntaxCopy(); if (t == next && ti == index) t = this; else { t = new TypeAArray(t, ti); t.mod = mod; } return t; } override Expression toExpression() { Expression e = next.toExpression(); if (e) { Expression ei = index.toExpression(); if (ei) return new ArrayExp(loc, e, ei); } return null; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeSArray : TypeArray { Expression dim; final extern (D) this(Type t, Expression dim) { super(Tsarray, t); this.dim = dim; } override Type syntaxCopy() { Type t = next.syntaxCopy(); Expression e = dim.syntaxCopy(); t = new TypeSArray(t, e); t.mod = mod; return t; } override Expression toExpression() { Expression e = next.toExpression(); if (e) e = new ArrayExp(dim.loc, e, dim); return e; } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class TypeQualified : Type { Objects idents; Loc loc; final extern (D) this(TY ty, Loc loc) { super(ty); this.loc = loc; } final void addIdent(Identifier id) { idents.push(id); } final void addInst(TemplateInstance ti) { idents.push(ti); } final void addIndex(RootObject e) { idents.push(e); } final void syntaxCopyHelper(TypeQualified t) { idents.setDim(t.idents.dim); for (size_t i = 0; i < idents.dim; i++) { RootObject id = t.idents[i]; if (id.dyncast() == DYNCAST.dsymbol) { TemplateInstance ti = cast(TemplateInstance)id; ti = cast(TemplateInstance)ti.syntaxCopy(null); id = ti; } else if (id.dyncast() == DYNCAST.expression) { Expression e = cast(Expression)id; e = e.syntaxCopy(); id = e; } else if (id.dyncast() == DYNCAST.type) { Type tx = cast(Type)id; tx = tx.syntaxCopy(); id = tx; } idents[i] = id; } } final Expression toExpressionHelper(Expression e, size_t i = 0) { for (; i < idents.dim; i++) { RootObject id = idents[i]; switch (id.dyncast()) { case DYNCAST.identifier: e = new DotIdExp(e.loc, e, cast(Identifier)id); break; case DYNCAST.dsymbol: auto ti = (cast(Dsymbol)id).isTemplateInstance(); assert(ti); e = new DotTemplateInstanceExp(e.loc, e, ti.name, ti.tiargs); break; case DYNCAST.type: // Bugzilla 1215 e = new ArrayExp(loc, e, new TypeExp(loc, cast(Type)id)); break; case DYNCAST.expression: // Bugzilla 1215 e = new ArrayExp(loc, e, cast(Expression)id); break; default: assert(0); } } return e; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TypeTraits : Type { TraitsExp exp; Loc loc; extern (D) this(const ref Loc loc, TraitsExp exp) { super(Tident); this.loc = loc; this.exp = exp; } override void accept(Visitor v) { v.visit(this); } override Type syntaxCopy() { TraitsExp te = cast(TraitsExp) exp.syntaxCopy(); TypeTraits tt = new TypeTraits(loc, te); tt.mod = mod; return tt; } } extern (C++) final class TypeMixin : Type { Loc loc; Expressions* exps; extern (D) this(const ref Loc loc, Expressions* exps) { super(Tmixin); this.loc = loc; this.exps = exps; } override Type syntaxCopy() { static Expressions* arraySyntaxCopy(Expressions* exps) { Expressions* a = null; if (exps) { a = new Expressions(exps.dim); foreach (i, e; *exps) { (*a)[i] = e ? e.syntaxCopy() : null; } } return a; } return new TypeMixin(loc, arraySyntaxCopy(exps)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeIdentifier : TypeQualified { Identifier ident; extern (D) this(const ref Loc loc, Identifier ident) { super(Tident, loc); this.ident = ident; } override Type syntaxCopy() { auto t = new TypeIdentifier(loc, ident); t.syntaxCopyHelper(this); t.mod = mod; return t; } override Expression toExpression() { return toExpressionHelper(new IdentifierExp(loc, ident)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeReturn : TypeQualified { extern (D) this(const ref Loc loc) { super(Treturn, loc); } override Type syntaxCopy() { auto t = new TypeReturn(loc); t.syntaxCopyHelper(this); t.mod = mod; return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeTypeof : TypeQualified { Expression exp; extern (D) this(const ref Loc loc, Expression exp) { super(Ttypeof, loc); this.exp = exp; } override Type syntaxCopy() { auto t = new TypeTypeof(loc, exp.syntaxCopy()); t.syntaxCopyHelper(this); t.mod = mod; return t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeInstance : TypeQualified { TemplateInstance tempinst; final extern (D) this(const ref Loc loc, TemplateInstance tempinst) { super(Tinstance, loc); this.tempinst = tempinst; } override Type syntaxCopy() { auto t = new TypeInstance(loc, cast(TemplateInstance)tempinst.syntaxCopy(null)); t.syntaxCopyHelper(this); t.mod = mod; return t; } override Expression toExpression() { return toExpressionHelper(new ScopeExp(loc, tempinst)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class Expression : ASTNode { TOK op; ubyte size; ubyte parens; Type type; Loc loc; final extern (D) this(const ref Loc loc, TOK op, int size) { this.loc = loc; this.op = op; this.size = cast(ubyte)size; } Expression syntaxCopy() { return copy(); } final void error(const(char)* format, ...) const { if (type != Type.terror) { va_list ap; va_start(ap, format); verror(loc, format, ap); va_end(ap); } } final Expression copy() { Expression e; if (!size) { assert(0); } e = cast(Expression)mem.xmalloc(size); return cast(Expression)memcpy(cast(void*)e, cast(void*)this, size); } override final DYNCAST dyncast() const { return DYNCAST.expression; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DeclarationExp : Expression { Dsymbol declaration; extern (D) this(const ref Loc loc, Dsymbol declaration) { super(loc, TOK.declaration, __traits(classInstanceSize, DeclarationExp)); this.declaration = declaration; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class IntegerExp : Expression { dinteger_t value; extern (D) this(const ref Loc loc, dinteger_t value, Type type) { super(loc, TOK.int64, __traits(classInstanceSize, IntegerExp)); assert(type); if (!type.isscalar()) { if (type.ty != Terror) error("integral constant must be scalar type, not %s", type.toChars()); type = Type.terror; } this.type = type; setInteger(value); } void setInteger(dinteger_t value) { this.value = value; normalize(); } void normalize() { /* 'Normalize' the value of the integer to be in range of the type */ switch (type.toBasetype().ty) { case Tbool: value = (value != 0); break; case Tint8: value = cast(d_int8)value; break; case Tchar: case Tuns8: value = cast(d_uns8)value; break; case Tint16: value = cast(d_int16)value; break; case Twchar: case Tuns16: value = cast(d_uns16)value; break; case Tint32: value = cast(d_int32)value; break; case Tdchar: case Tuns32: value = cast(d_uns32)value; break; case Tint64: value = cast(d_int64)value; break; case Tuns64: value = cast(d_uns64)value; break; case Tpointer: if (Target.ptrsize == 8) goto case Tuns64; if (Target.ptrsize == 4) goto case Tuns32; if (Target.ptrsize == 2) goto case Tuns16; assert(0); default: break; } } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class NewAnonClassExp : Expression { Expression thisexp; // if !=null, 'this' for class being allocated Expressions* newargs; // Array of Expression's to call new operator ClassDeclaration cd; // class being instantiated Expressions* arguments; // Array of Expression's to call class constructor extern (D) this(const ref Loc loc, Expression thisexp, Expressions* newargs, ClassDeclaration cd, Expressions* arguments) { super(loc, TOK.newAnonymousClass, __traits(classInstanceSize, NewAnonClassExp)); this.thisexp = thisexp; this.newargs = newargs; this.cd = cd; this.arguments = arguments; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class IsExp : Expression { Type targ; Identifier id; // can be null Type tspec; // can be null TemplateParameters* parameters; TOK tok; // ':' or '==' TOK tok2; // 'struct', 'union', etc. extern (D) this(const ref Loc loc, Type targ, Identifier id, TOK tok, Type tspec, TOK tok2, TemplateParameters* parameters) { super(loc, TOK.is_, __traits(classInstanceSize, IsExp)); this.targ = targ; this.id = id; this.tok = tok; this.tspec = tspec; this.tok2 = tok2; this.parameters = parameters; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class RealExp : Expression { real_t value; extern (D) this(const ref Loc loc, real_t value, Type type) { super(loc, TOK.float64, __traits(classInstanceSize, RealExp)); this.value = value; this.type = type; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class NullExp : Expression { extern (D) this(const ref Loc loc, Type type = null) { super(loc, TOK.null_, __traits(classInstanceSize, NullExp)); this.type = type; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeidExp : Expression { RootObject obj; extern (D) this(const ref Loc loc, RootObject o) { super(loc, TOK.typeid_, __traits(classInstanceSize, TypeidExp)); this.obj = o; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TraitsExp : Expression { Identifier ident; Objects* args; extern (D) this(const ref Loc loc, Identifier ident, Objects* args) { super(loc, TOK.traits, __traits(classInstanceSize, TraitsExp)); this.ident = ident; this.args = args; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StringExp : Expression { union { char* string; // if sz == 1 wchar* wstring; // if sz == 2 dchar* dstring; // if sz == 4 } // (const if ownedByCtfe == OwnedBy.code) size_t len; // number of code units ubyte sz = 1; // 1: char, 2: wchar, 4: dchar char postfix = 0; // 'c', 'w', 'd' extern (D) this(const ref Loc loc, const(void)[] string) { super(loc, TOK.string_, __traits(classInstanceSize, StringExp)); this.string = cast(char*)string.ptr; this.len = string.length; this.sz = 1; // work around LDC bug #1286 } extern (D) this(const ref Loc loc, const(void)[] string, size_t len, ubyte sz, char postfix = 0) { super(loc, TOK.string_, __traits(classInstanceSize, StringExp)); this.string = cast(char*)string; this.len = len; this.postfix = postfix; this.sz = 1; // work around LDC bug #1286 } /********************************************** * Write the contents of the string to dest. * Use numberOfCodeUnits() to determine size of result. * Params: * dest = destination * tyto = encoding type of the result * zero = add terminating 0 */ void writeTo(void* dest, bool zero, int tyto = 0) const { int encSize; switch (tyto) { case 0: encSize = sz; break; case Tchar: encSize = 1; break; case Twchar: encSize = 2; break; case Tdchar: encSize = 4; break; default: assert(0); } if (sz == encSize) { memcpy(dest, string, len * sz); if (zero) memset(dest + len * sz, 0, sz); } else assert(0); } extern (D) const(char)[] toStringz() const { auto nbytes = len * sz; char* s = cast(char*)mem.xmalloc_noscan(nbytes + sz); writeTo(s, true); return s[0 .. nbytes]; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class NewExp : Expression { Expression thisexp; // if !=null, 'this' for class being allocated Expressions* newargs; // Array of Expression's to call new operator Type newtype; Expressions* arguments; // Array of Expression's extern (D) this(const ref Loc loc, Expression thisexp, Expressions* newargs, Type newtype, Expressions* arguments) { super(loc, TOK.new_, __traits(classInstanceSize, NewExp)); this.thisexp = thisexp; this.newargs = newargs; this.newtype = newtype; this.arguments = arguments; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AssocArrayLiteralExp : Expression { Expressions* keys; Expressions* values; extern (D) this(const ref Loc loc, Expressions* keys, Expressions* values) { super(loc, TOK.assocArrayLiteral, __traits(classInstanceSize, AssocArrayLiteralExp)); assert(keys.dim == values.dim); this.keys = keys; this.values = values; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ArrayLiteralExp : Expression { Expression basis; Expressions* elements; extern (D) this(const ref Loc loc, Expressions* elements) { super(loc, TOK.arrayLiteral, __traits(classInstanceSize, ArrayLiteralExp)); this.elements = elements; } extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.arrayLiteral, __traits(classInstanceSize, ArrayLiteralExp)); elements = new Expressions(); elements.push(e); } extern (D) this(const ref Loc loc, Expression basis, Expressions* elements) { super(loc, TOK.arrayLiteral, __traits(classInstanceSize, ArrayLiteralExp)); this.basis = basis; this.elements = elements; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class FuncExp : Expression { FuncLiteralDeclaration fd; TemplateDeclaration td; TOK tok; extern (D) this(const ref Loc loc, Dsymbol s) { super(loc, TOK.function_, __traits(classInstanceSize, FuncExp)); this.td = s.isTemplateDeclaration(); this.fd = s.isFuncLiteralDeclaration(); if (td) { assert(td.literal); assert(td.members && td.members.dim == 1); fd = (*td.members)[0].isFuncLiteralDeclaration(); } tok = fd.tok; // save original kind of function/delegate/(infer) assert(fd.fbody); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class IntervalExp : Expression { Expression lwr; Expression upr; extern (D) this(const ref Loc loc, Expression lwr, Expression upr) { super(loc, TOK.interval, __traits(classInstanceSize, IntervalExp)); this.lwr = lwr; this.upr = upr; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TypeExp : Expression { extern (D) this(const ref Loc loc, Type type) { super(loc, TOK.type, __traits(classInstanceSize, TypeExp)); this.type = type; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ScopeExp : Expression { ScopeDsymbol sds; extern (D) this(const ref Loc loc, ScopeDsymbol sds) { super(loc, TOK.scope_, __traits(classInstanceSize, ScopeExp)); this.sds = sds; assert(!sds.isTemplateDeclaration()); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class IdentifierExp : Expression { Identifier ident; final extern (D) this(const ref Loc loc, Identifier ident) { super(loc, TOK.identifier, __traits(classInstanceSize, IdentifierExp)); this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class UnaExp : Expression { Expression e1; final extern (D) this(const ref Loc loc, TOK op, int size, Expression e1) { super(loc, op, size); this.e1 = e1; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class DefaultInitExp : Expression { TOK subop; // which of the derived classes this is final extern (D) this(const ref Loc loc, TOK subop, int size) { super(loc, TOK.default_, size); this.subop = subop; } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class BinExp : Expression { Expression e1; Expression e2; final extern (D) this(const ref Loc loc, TOK op, int size, Expression e1, Expression e2) { super(loc, op, size); this.e1 = e1; this.e2 = e2; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DsymbolExp : Expression { Dsymbol s; bool hasOverloads; extern (D) this(const ref Loc loc, Dsymbol s, bool hasOverloads = true) { super(loc, TOK.dSymbol, __traits(classInstanceSize, DsymbolExp)); this.s = s; this.hasOverloads = hasOverloads; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TemplateExp : Expression { TemplateDeclaration td; FuncDeclaration fd; extern (D) this(const ref Loc loc, TemplateDeclaration td, FuncDeclaration fd = null) { super(loc, TOK.template_, __traits(classInstanceSize, TemplateExp)); //printf("TemplateExp(): %s\n", td.toChars()); this.td = td; this.fd = fd; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class SymbolExp : Expression { Declaration var; bool hasOverloads; final extern (D) this(const ref Loc loc, TOK op, int size, Declaration var, bool hasOverloads) { super(loc, op, size); assert(var); this.var = var; this.hasOverloads = hasOverloads; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class VarExp : SymbolExp { extern (D) this(const ref Loc loc, Declaration var, bool hasOverloads = true) { if (var.isVarDeclaration()) hasOverloads = false; super(loc, TOK.variable, __traits(classInstanceSize, VarExp), var, hasOverloads); this.type = var.type; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TupleExp : Expression { Expression e0; Expressions* exps; extern (D) this(const ref Loc loc, Expression e0, Expressions* exps) { super(loc, TOK.tuple, __traits(classInstanceSize, TupleExp)); //printf("TupleExp(this = %p)\n", this); this.e0 = e0; this.exps = exps; } extern (D) this(const ref Loc loc, Expressions* exps) { super(loc, TOK.tuple, __traits(classInstanceSize, TupleExp)); //printf("TupleExp(this = %p)\n", this); this.exps = exps; } extern (D) this(const ref Loc loc, TupleDeclaration tup) { super(loc, TOK.tuple, __traits(classInstanceSize, TupleExp)); this.exps = new Expressions(); this.exps.reserve(tup.objects.dim); for (size_t i = 0; i < tup.objects.dim; i++) { RootObject o = (*tup.objects)[i]; if (Dsymbol s = getDsymbol(o)) { Expression e = new DsymbolExp(loc, s); this.exps.push(e); } else if (o.dyncast() == DYNCAST.expression) { auto e = (cast(Expression)o).copy(); e.loc = loc; // Bugzilla 15669 this.exps.push(e); } else if (o.dyncast() == DYNCAST.type) { Type t = cast(Type)o; Expression e = new TypeExp(loc, t); this.exps.push(e); } else { error("%s is not an expression", o.toChars()); } } } extern (C++) Dsymbol isDsymbol(RootObject o) { if (!o || o.dyncast || DYNCAST.dsymbol) return null; return cast(Dsymbol)o; } extern (C++) Dsymbol getDsymbol(RootObject oarg) { Dsymbol sa; Expression ea = isExpression(oarg); if (ea) { // Try to convert Expression to symbol if (ea.op == TOK.variable) sa = (cast(VarExp)ea).var; else if (ea.op == TOK.function_) { if ((cast(FuncExp)ea).td) sa = (cast(FuncExp)ea).td; else sa = (cast(FuncExp)ea).fd; } else if (ea.op == TOK.template_) sa = (cast(TemplateExp)ea).td; else sa = null; } else { // Try to convert Type to symbol Type ta = isType(oarg); if (ta) sa = ta.toDsymbol(null); else sa = isDsymbol(oarg); // if already a symbol } return sa; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DollarExp : IdentifierExp { extern (D) this(const ref Loc loc) { super(loc, Id.dollar); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class ThisExp : Expression { final extern (D) this(const ref Loc loc) { super(loc, TOK.this_, __traits(classInstanceSize, ThisExp)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class SuperExp : ThisExp { extern (D) this(const ref Loc loc) { super(loc); op = TOK.super_; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AddrExp : UnaExp { extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.address, __traits(classInstanceSize, AddrExp), e); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PreExp : UnaExp { extern (D) this(TOK op, Loc loc, Expression e) { super(loc, op, __traits(classInstanceSize, PreExp), e); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PtrExp : UnaExp { extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.star, __traits(classInstanceSize, PtrExp), e); } extern (D) this(const ref Loc loc, Expression e, Type t) { super(loc, TOK.star, __traits(classInstanceSize, PtrExp), e); type = t; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class NegExp : UnaExp { extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.negate, __traits(classInstanceSize, NegExp), e); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class UAddExp : UnaExp { extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.uadd, __traits(classInstanceSize, UAddExp), e); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class NotExp : UnaExp { extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.not, __traits(classInstanceSize, NotExp), e); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ComExp : UnaExp { extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.tilde, __traits(classInstanceSize, ComExp), e); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DeleteExp : UnaExp { bool isRAII; extern (D) this(const ref Loc loc, Expression e, bool isRAII) { super(loc, TOK.delete_, __traits(classInstanceSize, DeleteExp), e); this.isRAII = isRAII; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CastExp : UnaExp { Type to; ubyte mod = cast(ubyte)~0; extern (D) this(const ref Loc loc, Expression e, Type t) { super(loc, TOK.cast_, __traits(classInstanceSize, CastExp), e); this.to = t; } extern (D) this(const ref Loc loc, Expression e, ubyte mod) { super(loc, TOK.cast_, __traits(classInstanceSize, CastExp), e); this.mod = mod; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CallExp : UnaExp { Expressions* arguments; extern (D) this(const ref Loc loc, Expression e, Expressions* exps) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); this.arguments = exps; } extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); } extern (D) this(const ref Loc loc, Expression e, Expression earg1) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); auto arguments = new Expressions(); if (earg1) { arguments.setDim(1); (*arguments)[0] = earg1; } this.arguments = arguments; } extern (D) this(const ref Loc loc, Expression e, Expression earg1, Expression earg2) { super(loc, TOK.call, __traits(classInstanceSize, CallExp), e); auto arguments = new Expressions(); arguments.setDim(2); (*arguments)[0] = earg1; (*arguments)[1] = earg2; this.arguments = arguments; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DotIdExp : UnaExp { Identifier ident; extern (D) this(const ref Loc loc, Expression e, Identifier ident) { super(loc, TOK.dotIdentifier, __traits(classInstanceSize, DotIdExp), e); this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AssertExp : UnaExp { Expression msg; extern (D) this(const ref Loc loc, Expression e, Expression msg = null) { super(loc, TOK.assert_, __traits(classInstanceSize, AssertExp), e); this.msg = msg; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CompileExp : Expression { Expressions* exps; extern (D) this(const ref Loc loc, Expressions* exps) { super(loc, TOK.mixin_, __traits(classInstanceSize, CompileExp)); this.exps = exps; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ImportExp : UnaExp { extern (D) this(const ref Loc loc, Expression e) { super(loc, TOK.import_, __traits(classInstanceSize, ImportExp), e); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DotTemplateInstanceExp : UnaExp { TemplateInstance ti; extern (D) this(const ref Loc loc, Expression e, Identifier name, Objects* tiargs) { super(loc, TOK.dotTemplateInstance, __traits(classInstanceSize, DotTemplateInstanceExp), e); this.ti = new TemplateInstance(loc, name, tiargs); } extern (D) this(const ref Loc loc, Expression e, TemplateInstance ti) { super(loc, TOK.dotTemplateInstance, __traits(classInstanceSize, DotTemplateInstanceExp), e); this.ti = ti; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ArrayExp : UnaExp { Expressions* arguments; extern (D) this(const ref Loc loc, Expression e1, Expression index = null) { super(loc, TOK.array, __traits(classInstanceSize, ArrayExp), e1); arguments = new Expressions(); if (index) arguments.push(index); } extern (D) this(const ref Loc loc, Expression e1, Expressions* args) { super(loc, TOK.array, __traits(classInstanceSize, ArrayExp), e1); arguments = args; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class FuncInitExp : DefaultInitExp { extern (D) this(const ref Loc loc) { super(loc, TOK.functionString, __traits(classInstanceSize, FuncInitExp)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PrettyFuncInitExp : DefaultInitExp { extern (D) this(const ref Loc loc) { super(loc, TOK.prettyFunction, __traits(classInstanceSize, PrettyFuncInitExp)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class FileInitExp : DefaultInitExp { extern (D) this(const ref Loc loc, TOK tok) { super(loc, tok, __traits(classInstanceSize, FileInitExp)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class LineInitExp : DefaultInitExp { extern (D) this(const ref Loc loc) { super(loc, TOK.line, __traits(classInstanceSize, LineInitExp)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ModuleInitExp : DefaultInitExp { extern (D) this(const ref Loc loc) { super(loc, TOK.moduleString, __traits(classInstanceSize, ModuleInitExp)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CommaExp : BinExp { const bool isGenerated; bool allowCommaExp; extern (D) this(const ref Loc loc, Expression e1, Expression e2, bool generated = true) { super(loc, TOK.comma, __traits(classInstanceSize, CommaExp), e1, e2); allowCommaExp = isGenerated = generated; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PostExp : BinExp { extern (D) this(TOK op, Loc loc, Expression e) { super(loc, op, __traits(classInstanceSize, PostExp), e, new IntegerExp(loc, 1, Type.tint32)); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PowExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.pow, __traits(classInstanceSize, PowExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class MulExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.mul, __traits(classInstanceSize, MulExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DivExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.div, __traits(classInstanceSize, DivExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ModExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.mod, __traits(classInstanceSize, ModExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AddExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.add, __traits(classInstanceSize, AddExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class MinExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.min, __traits(classInstanceSize, MinExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CatExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.concatenate, __traits(classInstanceSize, CatExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ShlExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.leftShift, __traits(classInstanceSize, ShlExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ShrExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.rightShift, __traits(classInstanceSize, ShrExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class UshrExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.unsignedRightShift, __traits(classInstanceSize, UshrExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class EqualExp : BinExp { extern (D) this(TOK op, Loc loc, Expression e1, Expression e2) { super(loc, op, __traits(classInstanceSize, EqualExp), e1, e2); assert(op == TOK.equal || op == TOK.notEqual); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class InExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.in_, __traits(classInstanceSize, InExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class IdentityExp : BinExp { extern (D) this(TOK op, Loc loc, Expression e1, Expression e2) { super(loc, op, __traits(classInstanceSize, IdentityExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CmpExp : BinExp { extern (D) this(TOK op, Loc loc, Expression e1, Expression e2) { super(loc, op, __traits(classInstanceSize, CmpExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AndExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.and, __traits(classInstanceSize, AndExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class XorExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.xor, __traits(classInstanceSize, XorExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class OrExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.or, __traits(classInstanceSize, OrExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class LogicalExp : BinExp { extern (D) this(const ref Loc loc, TOK op, Expression e1, Expression e2) { super(loc, op, __traits(classInstanceSize, LogicalExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CondExp : BinExp { Expression econd; extern (D) this(const ref Loc loc, Expression econd, Expression e1, Expression e2) { super(loc, TOK.question, __traits(classInstanceSize, CondExp), e1, e2); this.econd = econd; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AssignExp : BinExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.assign, __traits(classInstanceSize, AssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class BinAssignExp : BinExp { final extern (D) this(const ref Loc loc, TOK op, int size, Expression e1, Expression e2) { super(loc, op, size, e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AddAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.addAssign, __traits(classInstanceSize, AddAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class MinAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.minAssign, __traits(classInstanceSize, MinAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class MulAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.mulAssign, __traits(classInstanceSize, MulAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DivAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.divAssign, __traits(classInstanceSize, DivAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ModAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.modAssign, __traits(classInstanceSize, ModAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class PowAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.powAssign, __traits(classInstanceSize, PowAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class AndAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.andAssign, __traits(classInstanceSize, AndAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class OrAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.orAssign, __traits(classInstanceSize, OrAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class XorAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.xorAssign, __traits(classInstanceSize, XorAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ShlAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.leftShiftAssign, __traits(classInstanceSize, ShlAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ShrAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.rightShiftAssign, __traits(classInstanceSize, ShrAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class UshrAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.unsignedRightShiftAssign, __traits(classInstanceSize, UshrAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class CatAssignExp : BinAssignExp { extern (D) this(const ref Loc loc, Expression e1, Expression e2) { super(loc, TOK.concatenateAssign, __traits(classInstanceSize, CatAssignExp), e1, e2); } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TemplateParameter : ASTNode { Loc loc; Identifier ident; final extern (D) this(const ref Loc loc, Identifier ident) { this.loc = loc; this.ident = ident; } TemplateParameter syntaxCopy(){ return null;} override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TemplateAliasParameter : TemplateParameter { Type specType; RootObject specAlias; RootObject defaultAlias; extern (D) this(const ref Loc loc, Identifier ident, Type specType, RootObject specAlias, RootObject defaultAlias) { super(loc, ident); this.ident = ident; this.specType = specType; this.specAlias = specAlias; this.defaultAlias = defaultAlias; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class TemplateTypeParameter : TemplateParameter { Type specType; Type defaultType; final extern (D) this(const ref Loc loc, Identifier ident, Type specType, Type defaultType) { super(loc, ident); this.ident = ident; this.specType = specType; this.defaultType = defaultType; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TemplateTupleParameter : TemplateParameter { extern (D) this(const ref Loc loc, Identifier ident) { super(loc, ident); this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TemplateValueParameter : TemplateParameter { Type valType; Expression specValue; Expression defaultValue; extern (D) this(const ref Loc loc, Identifier ident, Type valType, Expression specValue, Expression defaultValue) { super(loc, ident); this.ident = ident; this.valType = valType; this.specValue = specValue; this.defaultValue = defaultValue; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class TemplateThisParameter : TemplateTypeParameter { extern (D) this(const ref Loc loc, Identifier ident, Type specType, Type defaultType) { super(loc, ident, specType, defaultType); } override void accept(Visitor v) { v.visit(this); } } extern (C++) abstract class Condition : ASTNode { Loc loc; final extern (D) this(const ref Loc loc) { this.loc = loc; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StaticForeach : RootObject { Loc loc; ForeachStatement aggrfe; ForeachRangeStatement rangefe; final extern (D) this(const ref Loc loc, ForeachStatement aggrfe, ForeachRangeStatement rangefe) in { assert(!!aggrfe ^ !!rangefe); } do { this.loc = loc; this.aggrfe = aggrfe; this.rangefe = rangefe; } } extern (C++) final class StaticIfCondition : Condition { Expression exp; final extern (D) this(const ref Loc loc, Expression exp) { super(loc); this.exp = exp; } override void accept(Visitor v) { v.visit(this); } } extern (C++) class DVCondition : Condition { uint level; Identifier ident; Module mod; final extern (D) this(Module mod, uint level, Identifier ident) { super(Loc.initial); this.mod = mod; this.ident = ident; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class DebugCondition : DVCondition { extern (D) this(Module mod, uint level, Identifier ident) { super(mod, level, ident); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class VersionCondition : DVCondition { extern (D) this(Module mod, uint level, Identifier ident) { super(mod, level, ident); } override void accept(Visitor v) { v.visit(this); } } enum InitKind : ubyte { void_, error, struct_, array, exp, } extern (C++) class Initializer : ASTNode { Loc loc; InitKind kind; final extern (D) this(const ref Loc loc, InitKind kind) { this.loc = loc; this.kind = kind; } // this should be abstract and implemented in child classes Expression toExpression(Type t = null) { return null; } final ExpInitializer isExpInitializer() { return kind == InitKind.exp ? cast(ExpInitializer)cast(void*)this : null; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ExpInitializer : Initializer { Expression exp; extern (D) this(const ref Loc loc, Expression exp) { super(loc, InitKind.exp); this.exp = exp; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class StructInitializer : Initializer { Identifiers field; Initializers value; extern (D) this(const ref Loc loc) { super(loc, InitKind.struct_); } void addInit(Identifier field, Initializer value) { this.field.push(field); this.value.push(value); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class ArrayInitializer : Initializer { Expressions index; Initializers value; uint dim; Type type; extern (D) this(const ref Loc loc) { super(loc, InitKind.array); } void addInit(Expression index, Initializer value) { this.index.push(index); this.value.push(value); dim = 0; type = null; } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class VoidInitializer : Initializer { extern (D) this(const ref Loc loc) { super(loc, InitKind.void_); } override void accept(Visitor v) { v.visit(this); } } extern (C++) final class Tuple : RootObject { Objects objects; // kludge for template.isType() override DYNCAST dyncast() const { return DYNCAST.tuple; } override const(char)* toChars() const { return objects.toChars(); } } struct BaseClass { Type type; } struct ModuleDeclaration { Loc loc; Identifier id; Identifiers *packages; bool isdeprecated; Expression msg; extern (D) this(const ref Loc loc, Identifiers* packages, Identifier id, Expression msg, bool isdeprecated) { this.loc = loc; this.packages = packages; this.id = id; this.msg = msg; this.isdeprecated = isdeprecated; } extern (C++) const(char)* toChars() const { OutBuffer buf; if (packages && packages.dim) { for (size_t i = 0; i < packages.dim; i++) { const Identifier pid = (*packages)[i]; buf.writestring(pid.toString()); buf.writeByte('.'); } } buf.writestring(id.toString()); return buf.extractChars(); } } struct Prot { enum Kind : int { undefined, none, private_, package_, protected_, public_, export_, } Kind kind; Package pkg; } struct Scope { } static extern (C++) Tuple isTuple(RootObject o) { //return dynamic_cast<Tuple *>(o); if (!o || o.dyncast() != DYNCAST.tuple) return null; return cast(Tuple)o; } static extern (C++) Type isType(RootObject o) { if (!o || o.dyncast() != DYNCAST.type) return null; return cast(Type)o; } static extern (C++) Expression isExpression(RootObject o) { if (!o || o.dyncast() != DYNCAST.expression) return null; return cast(Expression)o; } static extern (C++) TemplateParameter isTemplateParameter(RootObject o) { if (!o || o.dyncast() != DYNCAST.templateparameter) return null; return cast(TemplateParameter)o; } static const(char)* protectionToChars(Prot.Kind kind) { final switch (kind) { case Prot.Kind.undefined: return null; case Prot.Kind.none: return "none"; case Prot.Kind.private_: return "private"; case Prot.Kind.package_: return "package"; case Prot.Kind.protected_: return "protected"; case Prot.Kind.public_: return "public"; case Prot.Kind.export_: return "export"; } } static bool stcToBuffer(OutBuffer* buf, StorageClass stc) { bool result = false; if ((stc & (STC.return_ | STC.scope_)) == (STC.return_ | STC.scope_)) stc &= ~STC.scope_; while (stc) { const(char)* p = stcToChars(stc); if (!p) // there's no visible storage classes break; if (!result) result = true; else buf.writeByte(' '); buf.writestring(p); } return result; } static extern (C++) Expression typeToExpression(Type t) { return t.toExpression; } static const(char)* stcToChars(ref StorageClass stc) { struct SCstring { StorageClass stc; TOK tok; const(char)* id; } __gshared SCstring* table = [ SCstring(STC.auto_, TOK.auto_), SCstring(STC.scope_, TOK.scope_), SCstring(STC.static_, TOK.static_), SCstring(STC.extern_, TOK.extern_), SCstring(STC.const_, TOK.const_), SCstring(STC.final_, TOK.final_), SCstring(STC.abstract_, TOK.abstract_), SCstring(STC.synchronized_, TOK.synchronized_), SCstring(STC.deprecated_, TOK.deprecated_), SCstring(STC.override_, TOK.override_), SCstring(STC.lazy_, TOK.lazy_), SCstring(STC.alias_, TOK.alias_), SCstring(STC.out_, TOK.out_), SCstring(STC.in_, TOK.in_), SCstring(STC.manifest, TOK.enum_), SCstring(STC.immutable_, TOK.immutable_), SCstring(STC.shared_, TOK.shared_), SCstring(STC.nothrow_, TOK.nothrow_), SCstring(STC.wild, TOK.inout_), SCstring(STC.pure_, TOK.pure_), SCstring(STC.ref_, TOK.ref_), SCstring(STC.tls), SCstring(STC.gshared, TOK.gshared), SCstring(STC.nogc, TOK.at, "@nogc"), SCstring(STC.property, TOK.at, "@property"), SCstring(STC.safe, TOK.at, "@safe"), SCstring(STC.trusted, TOK.at, "@trusted"), SCstring(STC.system, TOK.at, "@system"), SCstring(STC.live, TOK.at, "@live"), SCstring(STC.disable, TOK.at, "@disable"), SCstring(STC.future, TOK.at, "@__future"), SCstring(0, TOK.reserved) ]; for (int i = 0; table[i].stc; i++) { StorageClass tbl = table[i].stc; assert(tbl & STCStorageClass); if (stc & tbl) { stc &= ~tbl; if (tbl == STC.tls) // TOKtls was removed return "__thread"; TOK tok = table[i].tok; if (tok == TOK.at) return table[i].id; else return Token.toChars(tok); } } //printf("stc = %llx\n", stc); return null; } static const(char)* linkageToChars(LINK linkage) { final switch (linkage) { case LINK.default_: case LINK.system: return null; case LINK.d: return "D"; case LINK.c: return "C"; case LINK.cpp: return "C++"; case LINK.windows: return "Windows"; case LINK.pascal: return "Pascal"; case LINK.objc: return "Objective-C"; } } struct Target { extern (C++) __gshared int ptrsize; extern (C++) static Type va_listType() { if (global.params.isWindows) { return Type.tchar.pointerTo(); } else if (global.params.isLinux || global.params.isFreeBSD || global.params.isOpenBSD || global.params.isDragonFlyBSD || global.params.isSolaris || global.params.isOSX) { if (global.params.is64bit) { return (new TypeIdentifier(Loc.initial, Identifier.idPool("__va_list_tag"))).pointerTo(); } else { return Type.tchar.pointerTo(); } } else { assert(0); } } } }
D
/home/syx/SYXrepo/vacation_homework/percolation/target/rls/debug/deps/bitflags-a02a2a9e3f10de8f.rmeta: /home/syx/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bitflags-1.0.4/src/lib.rs /home/syx/SYXrepo/vacation_homework/percolation/target/rls/debug/deps/bitflags-a02a2a9e3f10de8f.d: /home/syx/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bitflags-1.0.4/src/lib.rs /home/syx/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/bitflags-1.0.4/src/lib.rs:
D
/** * The MIT License (MIT) * * Copyright (c) 2015 DNetDev (Richard Andrew Cattermole) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ module dnetdev.webserver.modulebase.core; public import dnetdev.webserver.modulebase.core.configdirectives; public import dnetdev.webserver.modulebase.core.pipeline; shared static this() { import dnetdev.webserver.modules.dside; registerInternalModule("core"); }
D
// https://issues.dlang.org/show_bug.cgi?id=15373 // Using `typeid` on an `extern(C++) class` type is fine as it is evaluated at compile-time // Using `typeid` on an `extern(C++) class` instance is not ok because `extern(C++) class` // instances are not rooted in `Object`. See test/fail_compilation/test15373.d extern(C++) class C { } void main() { auto Cti = typeid(C); assert(Cti.name == "test15373.C"); }
D
// Written in the D programming language. /** Haystack trio encoder. Copyright: Copyright (c) 2019, Radu Racariu <radu.racariu@gmail.com> License: $(LINK2 www.boost.org/LICENSE_1_0.txt, Boost License 1.0) Authors: Radu Racariu **/ module haystack.trio.encode; import std.range.primitives : isOutputRange; import haystack.tag; import haystack.zinc.encode : toZinc = encode; import haystack.util.tzdata : timeZone; public import haystack.zinc.encode : SortedKeys; /** Encodes `Dict`as a Trio. Expects an OutputRange as writer. Returns: the writter OutputRange */ ref R encode(R) (auto ref R writer, const(Dict) dict, SortedKeys sorted = SortedKeys.no) if (isOutputRange!(R, char)) { import std.algorithm : each, sort; void encodeKeyValue(string key) { writer.put(key); if (dict[key].hasValue!Marker) { writer.put("\n"); return; } writer.put(':'); if (dict[key].hasValue!XStr) { const xstr = dict.get!XStr(key); writer.put(xstr.type); writer.put(":\n "); auto padder = PaddingOutput!R(writer); padder.put(xstr.val); if (padder.lastChar == '\n') return; } else if (dict[key].hasValue!Grid) { writer.put("Zinc"); writer.put(":\n "); auto padder = PaddingOutput!R(writer); const grid = dict.get!Grid(key); toZinc(grid, padder, sorted); } else if (dict[key].hasValue!Dict) { toZinc(dict[key], writer, sorted); } else { toZinc(dict[key], writer); } writer.put("\n"); } if (sorted == SortedKeys.no) dict.byKey.each!(k => encodeKeyValue(k)); else dict.keys.sort.each!(k => encodeKeyValue(k)); return writer; } /** Encodes Dict to a Trio string */ string trio(const(Dict) dict, SortedKeys sorted = SortedKeys.no) { import std.array : appender; auto buf = appender!string(); buf.encode(dict, sorted); return buf.data(); } unittest { assert(trio(["marker":marker()]) == "marker\n"); } unittest { string expected =q"{bool:F coord:C(37.545826,-77.449188) date:2019-06-14 dateTime:2019-06-14T15:24:00+09:00 Tokyo marker na:NA number:42$ ref:@someId str:"a string" time:16:23:03 uri:`/a/b/c` xstr:XStr: xstr content foo }"; Dict dict = [ "bool": false.tag, "coord": Coord(37.545826,-77.449188).tag, "date": Date(2019, 6, 14).tag, "dateTime": SysTime(DateTime(Date(2019, 6, 14), TimeOfDay(15, 24, 0)), timeZone("Asia/Tokyo")).tag, "marker": marker, "na": na, "number": Num(42, "$").tag, "ref": Ref("someId").tag, "str": "a string".tag, "time": Time(16, 23, 3).tag, "uri": Uri(`/a/b/c`).tag, "xstr": XStr("XStr", "xstr content\nfoo").tag, ]; assert(trio(dict, SortedKeys.yes) == expected); } unittest { string expected =q"{dict:{a:"a" b:1} list:[1,2,"3"] zinc:Zinc: ver:"3.0" empty }"; Dict dict = [ "dict": ["a": "a".tag, "b": 1.tag].tag, "list": [1.tag, 2.tag, "3".tag].tag, "zinc": Grid().tag, ]; assert(trio(dict, SortedKeys.yes) == expected); } // Adds space padding after each line private struct PaddingOutput(R) if (isOutputRange!(R, char)) { this (scope ref R r) scope { this.r = &r; } void put(string str) { foreach (c; str) put(c); } void put(dchar c) { if (c != '\n') r.put(c); else r.put("\n "); lastChar = c; } R* r; dchar lastChar; }
D
[cc]mc | .hd guide "Software Tools Subsystem User's Guides" 08/27/84 [cc]mc guide { <option> | <item> } <option> ::= -p <item> ::= <guide_name> .ds Several of the more complicated or more frequently used [cc]mc | Subsystem commands and libraries have additional documentation beyond that which is available from the reference manual. [cc]mc This documentation is in the form of a separate paper [cc]mc | on each command or library, but these papers may be combined to form [cc]mc the .ul Software Tools Subsystem User's Guide. .sp The command .sp guide <guide name> .sp prints the named guide in a format suitable for reading on a fast CRT terminal. .sp The command .sp guide -p <guide name> .sp prints the named guide in a format suitable for the line printer. .sp Copies of individual documents may be printed on one of the on-site line printers by giving the following command: .sp guide -p <guide name> | os >/dev/lps/f .sp where "<guide name>" is one of the following guide names: .sp 2 .in +5 [cc]mc | .ne 9 .ti -5 cc .sp A copy of the [ul User's Guide for the Georgia Tech C Compiler]. This guide describes the necessary requirements for compiling programs written in C from the Subsystem. Refer to [ul The C Programming Language] by Brian Kernighan and Dennis Ritchie for specific details about the C programming language. .bf 100 This guide is only available to customers who have also licensed the C language compiler package. .bf 0 .sp 2 .ti -5 ed .sp A copy of .ul Introduction to the Software Tools Text Editor is printed. This paper includes a tutorial on the Subsystem's text editor that is highly recommended for beginning users, as well as a command summary and a special section on the Subsystem screen editor. .sp 2 .ti -5 fmt .sp A copy of the .ul Software Tools Subsystem Text Formatter User's Guide is printed. This includes tutorial, reference, and applications information. One very useful appendix contains all text formatting commands, arranged alphabetically. .sp 2 .ti -5 fs .sp A copy of .ul User's Guide to the Primos File System is printed. This paper gives a brief introduction to the Primos file system as it applies to the use of the Subsystem. It explains the structure of the file system, provisions for security, and how users access files by name. .sp 2 .ne 5 .ti -5 math .sp A copy of the [ul SWT Math Library User's Guide] is printed. This includes descriptions of the Prime floating point hardware, the SWT math library, and the tests used to validate the SWT library. Appendices contain useful programs to help determine where the exponent is located on your particular machine, determine the amount of loss of bits in a multiply operation, and calculate hexadecimal constants for use in mathematical routines. The addendum documents the routines which used to be in the old, locally supported, math library "vswtml." .sp 2 .ne 5 .ti -5 mgr .sp A copy of the .ul Software Tools Subsystem Manager's Guide is printed. This guide is useful for all Subsystem managers and anyone else interested in the installation, maintenance, and daily operation of the Subsystem. .sp 2 .ne 5 .ti -5 ring .sp A copy of .ul Ring -- The Software Tools Subsystem Network Utility is printed. This paper documents the structure and use of 'ring', a utility which makes it easier for the end user to deal with Primenet. .sp 2 .ne 5 .ti -5 rp .sp Prints the .ul Ratfor Programmer's Guide. This document includes a detailed description of the Ratfor programming language as well as instructions for its use under the Subsystem. It is essential for anyone hoping to do any significant amount of programming using the capabilities supplied by the Subsystem. .sp 2 .ne 5 .ti -5 sh .sp A copy of .ul User's Guide for the Software Tools Subsystem Command Interpreter is printed. This paper discusses the features of the Subsystem command interpreter, called the 'shell', on three levels: a tutorial introduction, a syntax and semantics reference, and a set of applications notes. .sp 2 .ne 5 .ti -5 tutorial .sp A copy of .ul The Software Tools Subsystem Tutorial is printed. This tutorial is intended as a user's first introduction to the Subsystem and covers such essentials as logging in and out, features of the command language, editing, online documentation and so forth. NEW USERS SHOULD READ THIS DOCUMENT FIRST. .sp 2 .ne 5 .ti -5 v8.1 .sp A copy of the .ul Software Tools Subsystem Version 8 to Version 8.1 Conversion Guide is printed. This guide summarizes all user-visible changes that have been made between the Version 8 and Version 8.1 Subsystems. .sp 2 .ne 5 .ti -5 v9 .sp A copy of the .ul Software Tools Subsystem Version 8.1 to Version 9 Conversion Guide is printed. This guide summarizes all user-visible changes that have been made between the Version 8.1 and Version 9 Subsystems. [cc]mc .sp 2 .ti -5 vcg .sp A copy of [ul A Re-Usable Code Generator for Prime 50-Series Computers User's Guide]. 'Vcg' is a reusable general-purpose code generator that accepts [cc]mc | an "intermediate form" and produces 64V-mode relocatable object code, or optionally, PMA. [cc]mc The V-mode code generator is the back-end for the Georgia Tech C Compiler. .bf 100 [cc]mc | This guide is only available to customers who have also licensed the [cc]mc C language compiler package. .bf 0 .in -5 .es guide tutorial guide -p rp | os >/dev/lps/f .fl Most of those contained in =doc=/fguide. .sa .ul Software Tools Subsystem Reference Manual
D