code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
import std.stdio;
import std.range;
import std.algorithm;
import multi_index;
import std.traits;
template Testsies(Allocator) {
int[typeof(cast() ElementType!(Range).init)] set(Range)(Range r) {
typeof(return) arr;
foreach(e; r) arr[e]=1;
return arr;
}
ElementType!Range[] array(Range)(Range r) {
typeof(return) arr;
foreach(e; r) arr ~= e;
return arr;
}
unittest{
alias MultiIndexContainer!(int, IndexedBy!(HashedUnique!()), Allocator) C1;
C1 c = C1.create;
c.insert(1);
assert(c.front() == 1);
c.insert(2);
c.insert(3);
assert(1 in c);
assert(2 in c);
assert(3 in c);
assert(set(c[]) == set([1,2,3]));
assert(c[1] == 1);
c.insert([4,5,6]);
assert(4 in c);
assert(5 in c);
assert(6 in c);
assert(set(c[]) == set([1,2,3,4,5,6]));
auto t = take(PSR(c[]), 2);
auto a = array(t);
c.remove(t);
foreach(x; a) assert(x.v !in c);
c.insert(iota(10));
auto r = c.equalRange(8);
c.remove(r);
assert(8 !in c);
c.removeKey(5);
assert(5 !in c);
c.clear();
c.insert(iota(10));
assert(set(c[]) == set([0,1,2,3,4,5,6,7,8,9]));
r = c.equalRange(5);
auto replace_count = c.replace(PSR(r).front, 6);
assert(replace_count == 0);
assert(set(c[]) == set([0,1,2,3,4,5,6,7,8,9]));
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
}
// again, but with immutable(int)
unittest{
alias MultiIndexContainer!(immutable(int), IndexedBy!(HashedUnique!()), Allocator) C1;
C1 c = C1.create;
c.insert(1);
assert(c.front() == 1);
c.insert(2);
c.insert(3);
assert(1 in c);
assert(2 in c);
assert(3 in c);
assert(set(c[]) == set([1,2,3]));
assert(c[1] == 1);
c.insert([4,5,6]);
assert(4 in c);
assert(5 in c);
assert(6 in c);
auto t = take(PSR(c[]), 2);
auto a = array(t);
c.remove(t);
foreach(x; a) assert(x.v !in c);
c.insert(iota(10));
auto r = c.equalRange(8);
c.remove(r);
assert(8 !in c);
c.removeKey(5);
assert(5 !in c);
c.clear();
c.insert(iota(10));
assert(set(c[]) == set([0,1,2,3,4,5,6,7,8,9]));
r = c.equalRange(5);
auto replace_count = c.replace(PSR(r).front, 6);
assert(replace_count == 0);
assert(set(c[]) == set([0,1,2,3,4,5,6,7,8,9]));
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
}
unittest{
// hashed index only
alias MultiIndexContainer!(int, IndexedBy!(HashedNonUnique!()), Allocator) C1;
C1 c = C1.create;
c.insert(1);
assert(c.front() == 1);
c.insert(2);
c.insert(3);
c.insert(3);
assert(set(c[]) == set([1,2,3])); // two 3
assert(c.length == 4); // two 3
c.insert([4,5,6]);
assert(set(c[]) == set([1,2,3,4,5,6])); // two 3
assert(c.length == 7); // two 3
auto t = take(PSR(c[]), 2);
auto a = array(t);
c.remove(t);
assert(c.length == 5);
foreach(x; a) assert(x.v !in c);
c.insert(iota(10));
c.insert(iota(10));
assert(c.length == 25);
auto r = c.equalRange(8);
assert(array(r.save()) == [8,8]);
c.remove(r);
assert(8 !in c);
assert(c.length == 23);
auto sz = c.removeKey(5,5,5);
assert(5 !in c);
assert(c.length == 23-sz);
c.clear();
c.insert(iota(10));
assert(set(c[]) == set([0,1,2,3,4,5,6,7,8,9]));
r = c.equalRange(5);
auto replace_count = c.replace(PSR(r).front, 6);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,6,7,8,9]));
assert(c.length == 10);
r = c.equalRange(6);
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
// r is pretty dang invalid now
r = c.equalRange(25);
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
}
// again, but with immutable(int)
unittest{
// hashed index only
alias MultiIndexContainer!(immutable(int), IndexedBy!(HashedNonUnique!()), Allocator) C1;
C1 c = C1.create;
c.insert(1);
assert(c.front() == 1);
c.insert(2);
c.insert(3);
c.insert(3);
assert(set(c[]) == set([1,2,3])); // two 3
assert(c.length == 4); // two 3
c.insert([4,5,6]);
assert(set(c[]) == set([1,2,3,4,5,6])); // two 3
assert(c.length == 7); // two 3
auto t = take(PSR(c[]), 2);
auto a = array(t);
c.remove(t);
assert(c.length == 5);
foreach(x; a) assert(x.v !in c);
c.insert(iota(10));
c.insert(iota(10));
assert(c.length == 25);
auto r = c.equalRange(8);
assert(array(r.save()) == [8,8]);
c.remove(r);
assert(8 !in c);
assert(c.length == 23);
auto sz = c.removeKey(5,5,5);
assert(5 !in c);
assert(c.length == 23-sz);
c.clear();
c.insert(iota(10));
assert(set(c[]) == set([0,1,2,3,4,5,6,7,8,9]));
r = c.equalRange(5);
auto replace_count = c.replace(PSR(r).front, 6);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,6,7,8,9]));
assert(c.length == 10);
r = c.equalRange(6);
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
// r is pretty dang invalid now
r = c.equalRange(25);
replace_count = c.replace(PSR(r).front, 25);
assert(replace_count == 1);
assert(set(c[]) == set([0,1,2,3,4,25,6,7,8,9]));
}
// tests for removeKey
unittest{
alias MultiIndexContainer!(int, IndexedBy!(HashedUnique!()), Allocator) C1;
{
C1 c = C1.create;
c.insert(iota(20));
assert(c.length == 20);
auto i = c.removeKey(0);
assert(i == 1);
assert(c.length == 19);
i = c.removeKey(0);
assert(i == 0);
assert(c.length == 19);
i = c.removeKey(1,0,1,0,2,0,4);
assert(set(c[]) == set([3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));
assert(i == 3);
}
alias MultiIndexContainer!(string, IndexedBy!(HashedUnique!()), Allocator) C2;
{
C2 c = C2.create;
c.insert(["a","g","b","c","z"]);
assert(set(c[]) == set(["a","b","c","g","z"]));
auto i = c.removeKey(["a","z"]);
assert(i == 2);
assert(set(c[]) == set(["b","c","g"]));
i = c.removeKey(map!("a.toLower()")(["C","G"]));
assert(i == 2);
assert(equal(c[], ["b"]));
}
// tests from std.container
{
auto rbt = C2.create;
rbt.insert(["hello", "world", "foo", "bar"]);
assert(set(rbt[]) == set(["bar", "foo", "hello", "world"]));
assert(rbt.removeKey("hello") == 1);
assert(rbt.length == 3);
assert(rbt.length == 3);
assert(set(rbt[]) == set(["bar", "foo", "world"]));
assert(rbt.removeKey("hello") == 0);
assert(set(rbt[]) == set(["bar", "foo", "world"]));
assert(rbt.removeKey("hello", "foo", "bar") == 2);
assert(set(rbt[]) == set(["world"]));
assert(rbt.removeKey(["", "world", "hello"]) == 1);
assert(rbt.empty);
}
{
auto rbt = C1.create;
rbt.insert([1, 2, 12, 27, 4, 500]);
assert(set(rbt[]) == set([1, 2, 4, 12, 27, 500]));
assert(rbt.removeKey(1u) == 1);
assert(set(rbt[]) == set([2, 4, 12, 27, 500]));
assert(rbt.removeKey(cast(byte)1) == 0);
assert(set(rbt[]) == set([2, 4, 12, 27, 500]));
assert(rbt.removeKey(1, 12u, cast(byte)27) == 2);
assert(set(rbt[]) == set([2, 4, 500]));
assert(rbt.removeKey([cast(short)0, cast(short)500, cast(short)1]) == 1);
assert(set(rbt[]) == set([2, 4]));
}
// end tests from std.container
{
alias MultiIndexContainer!(int, IndexedBy!(HashedNonUnique!()), Allocator) C3;
alias MultiIndexContainer!(int, IndexedBy!(Sequenced!()), Allocator) Ci;
auto rbt = C3.create;
rbt.insert([1,2,3,4,4,4,4,5,6,7]);
assert(rbt.length == 10);
assert(rbt.length == count(rbt[]));
assert(set(rbt[]) == set([1,2,3,4,4,4,4,5,6,7]));
assert(rbt.length == 10);
auto keys2 = C1.create;
auto keys = Ci.create;
keys.insert([5,6]);
keys2.insert([2,3]);
auto r = rbt.equalRange(4);
assert(equal(r, [4,4,4,4]));
auto i = rbt.removeKey(take(r,3));
import std.format : format;
assert(i == 3, format("i: %s", i));
assert(rbt.length == 7);
i = rbt.removeKey(r);
assert(i == 1);
assert(set(rbt[]) == set([1,2,3,5,6,7]));
i = rbt.removeKey(keys[]);
assert(i == 2);
assert(set(rbt[]) == set([1,2,3,7]));
i = rbt.removeKey(keys2[]);
assert(i == 2);
assert(equal(rbt[], [1,7]));
}
}
unittest{
alias MultiIndexContainer!(int, IndexedBy!(HashedUnique!(),
HashedNonUnique!("a*a")), Allocator) C1;
C1 y = C1.create;
auto c = y.get_index!0;
auto d = y.get_index!1;
c.insert(1);
assert(c.front() == 1);
c.insert(2);
c.insert(3);
c.insert(3);
d.insert(3);
assert(1 in c);
assert(2 in c);
assert(3 in c);
assert(c.length == 3);
assert(1 in d);
assert(2 in d);
assert(3 in d);
assert(d.length == 3);
auto a = array(c[]);
assert(c[1] == 1);
c.insert([4,5,6]);
assert(4 in c);
assert(5 in c);
assert(6 in c);
auto t = take(PSR(c[]), 2);
auto a2 = array(t);
c.remove(t);
foreach(x; a2) assert(x.v !in c);
c.insert(iota(10));
auto r = c.equalRange(8);
c.remove(r);
assert(8 !in c);
c.removeKey(5);
assert(5 !in c);
}
unittest {
import std.typecons;
int i = 1;
int j = 2;
string k = "hi";
string m = "bi";
alias Tuple!(int*,"i",string,"k") Tup;
alias MultiIndexContainer!(Tup,
IndexedBy!(HashedUnique!("a.i"), HashedUnique!("a.k")), Allocator, MutableView)
C;
C c = C.create();
c.get_index!0 .insert(Tup(&i,"hi"));
c.get_index!0 .insert(Tup(&j,"bi"));
foreach(entry; c.get_index!0 .opSlice()) {
writefln(" i=%x, k=%s", entry.i, entry.k);
}
assert(c.get_index!0 .length == 2);
auto r = PSR(c.index!1 .equalRange("bi"));
auto replace_count = c.index!0 .replace(r.front, Tup(null, "bi"));
assert(replace_count == 1);
foreach(entry; c.get_index!0 .opSlice()) {
writefln(" i=%x, k=%s", entry.i, entry.k);
}
r = PSR(c.index!1 .equalRange("bi"));
writefln("try to replace bi with %x, bi", &i);
replace_count = c.index!0 .replace(r.front, Tup(&j, "bi"));
assert(replace_count == 1);
}
unittest{
class A{
int i;
int j;
this(int _i, int _j) {
i = _i;
j = _j;
}
}
alias MultiIndexContainer!(A, IndexedBy!(HashedUnique!("a.i")),
MutableView, Allocator) C1;
C1 c = C1.create();
c.insert(new A(1,2));
c.front.j = 65;
c[].front.j = 85;
c[1].j = 95;
}
unittest{
class A{
}
alias MultiIndexContainer!(A, IndexedBy!(HashedUnique!()),
MutableView, Allocator) C1;
C1 c = C1.create();
auto a1 = new A();
auto a2 = new A();
c.insert(a1);
c.insert(a2);
c.insert(a1);
assert(c.length == 2);
}
unittest{
alias MultiIndexContainer!(int, IndexedBy!(HashedNonUnique!("a")), Allocator) C1;
C1 c = C1.create;
for(auto i = 0; i < 1000; i++) {
c.insert(1);
c.insert(1544);
}
assert(c.length == 2000);
}
}
mixin Testsies!(GCAllocator) a1;
mixin Testsies!(MallocAllocator) a2;
|
D
|
instance DIA_ToughGuy_NEWS(C_Info)
{
nr = 1;
condition = DIA_ToughGuy_NEWS_Condition;
information = DIA_ToughGuy_NEWS_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_ToughGuy_NEWS_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (self.aivar[AIV_LastFightAgainstPlayer] != FIGHT_NONE) && (self.aivar[AIV_LastFightComment] == FALSE))
{
return TRUE;
};
};
func void DIA_ToughGuy_NEWS_Info()
{
if(self.aivar[AIV_LastFightAgainstPlayer] == FIGHT_LOST)
{
B_Say(self,other,"$TOUGHGUY_ATTACKLOST");
}
else if(self.aivar[AIV_LastFightAgainstPlayer] == FIGHT_WON)
{
B_Say(self,other,"$TOUGHGUY_ATTACKWON");
}
else
{
B_Say(self,other,"$TOUGHGUY_PLAYERATTACK");
};
self.aivar[AIV_LastFightComment] = TRUE;
if(Hlp_GetInstanceID(self) == Hlp_GetInstanceID(Skinner))
{
AI_Output(self,other,"DIA_Addon_Skinner_ToughguyNews_08_00"); //... but I don't want to talk to you...
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
};
func void B_AssignToughGuyNEWS(var C_Npc slf)
{
DIA_ToughGuy_NEWS.npc = Hlp_GetInstanceID(slf);
};
|
D
|
/++
A module containing the Visual Trial reporter used to send data to the
Visual Studio Code plugin
Copyright: © 2017 Szabo Bogdan
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Szabo Bogdan
+/
module trial.reporters.visualtrial;
import std.conv;
import std.string;
import std.algorithm;
import std.stdio;
import std.datetime;
import std.exception;
version(Have_fluent_asserts) {
import fluentasserts.core.base;
import fluentasserts.core.results;
}
import trial.interfaces;
import trial.reporters.writer;
enum Tokens : string {
beginTest = "BEGIN TEST;",
endTest = "END TEST;",
suite = "suite",
test = "test",
file = "file",
line = "line",
labels = "labels",
status = "status",
errorFile = "errorFile",
errorLine = "errorLine",
message = "message"
}
/// This reporter will print the results using thr Test anything protocol version 13
class VisualTrialReporter : ILifecycleListener, ITestCaseLifecycleListener
{
private {
ReportWriter writer;
}
///
this()
{
writer = defaultWriter;
}
///
this(ReportWriter writer)
{
this.writer = writer;
}
///
void begin(ulong testCount) {
writer.writeln("", ReportWriter.Context._default);
writer.writeln("", ReportWriter.Context._default);
}
///
void update() { }
///
void end(SuiteResult[]) { }
///
void begin(string suite, ref TestResult result)
{
std.stdio.stdout.flush;
std.stdio.stderr.flush;
writer.writeln("BEGIN TEST;", ReportWriter.Context._default);
writer.writeln("suite:" ~ suite, ReportWriter.Context._default);
writer.writeln("test:" ~ result.name, ReportWriter.Context._default);
writer.writeln("file:" ~ result.fileName, ReportWriter.Context._default);
writer.writeln("line:" ~ result.line.to!string, ReportWriter.Context._default);
writer.writeln("labels:[" ~ result.labels.map!(a => a.toString).join(", ") ~ "]", ReportWriter.Context._default);
std.stdio.stdout.flush;
std.stdio.stderr.flush;
}
///
void end(string suite, ref TestResult test)
{
std.stdio.stdout.flush;
std.stdio.stderr.flush;
writer.writeln("status:" ~ test.status.to!string, ReportWriter.Context._default);
if(test.status != TestResult.Status.success) {
if(test.throwable !is null) {
writer.writeln("errorFile:" ~ test.throwable.file, ReportWriter.Context._default);
writer.writeln("errorLine:" ~ test.throwable.line.to!string, ReportWriter.Context._default);
writer.writeln("message:" ~ test.throwable.msg.split("\n")[0], ReportWriter.Context._default);
writer.write("error:", ReportWriter.Context._default);
writer.writeln(test.throwable.toString, ReportWriter.Context._default);
}
}
writer.writeln("END TEST;", ReportWriter.Context._default);
std.stdio.stdout.flush;
std.stdio.stderr.flush;
}
}
/// it should print "The Plan" at the beginning
unittest {
auto writer = new BufferedWriter;
auto reporter = new VisualTrialReporter(writer);
reporter.begin(10);
writer.buffer.should.equal("\n\n");
}
/// it should print the test location
unittest
{
auto writer = new BufferedWriter;
auto reporter = new VisualTrialReporter(writer);
auto test = new TestResult("other test");
test.fileName = "someFile.d";
test.line = 100;
test.labels = [ Label("name", "value"), Label("name1", "value1") ];
test.status = TestResult.Status.success;
reporter.begin("some suite", test);
writer.buffer.should.equal("BEGIN TEST;\n" ~
"suite:some suite\n" ~
"test:other test\n" ~
"file:someFile.d\n" ~
"line:100\n" ~
`labels:[{ "name": "name", "value": "value" }, { "name": "name1", "value": "value1" }]` ~ "\n");
}
/// it should print a sucess test
unittest
{
auto writer = new BufferedWriter;
auto reporter = new VisualTrialReporter(writer);
auto test = new TestResult("other test");
test.fileName = "someFile.d";
test.line = 100;
test.status = TestResult.Status.success;
reporter.end("some suite", test);
writer.buffer.should.equal("status:success\nEND TEST;\n");
}
/// it should print a failing test with a basic throwable
unittest
{
auto writer = new BufferedWriter;
auto reporter = new VisualTrialReporter(writer);
auto test = new TestResult("other's test");
test.status = TestResult.Status.failure;
test.throwable = new Exception("Test's failure", "file.d", 42);
reporter.end("some suite", test);
writer.buffer.should.equal("status:failure\n" ~
"errorFile:file.d\n" ~
"errorLine:42\n" ~
"message:Test's failure\n" ~
"error:object.Exception@file.d(42): Test's failure\n" ~
"END TEST;\n");
}
/// it should not print the YAML if the throwable is missing
unittest
{
auto writer = new BufferedWriter;
auto reporter = new VisualTrialReporter(writer);
auto test = new TestResult("other's test");
test.status = TestResult.Status.failure;
reporter.end("some suite", test);
writer.buffer.should.equal("status:failure\nEND TEST;\n");
}
/// it should print the results of a TestException
unittest {
IResult[] results = [
cast(IResult) new MessageResult("message"),
cast(IResult) new ExtraMissingResult("a", "b") ];
auto exception = new TestException(results, "unknown", 0);
auto writer = new BufferedWriter;
auto reporter = new VisualTrialReporter(writer);
auto test = new TestResult("other's test");
test.status = TestResult.Status.failure;
test.throwable = exception;
reporter.end("some suite", test);
writer.buffer.should.equal("status:failure\n" ~
"errorFile:unknown\n" ~
"errorLine:0\n" ~
"message:message\n" ~
"error:fluentasserts.core.base.TestException@unknown(0): message\n\n" ~
" Extra:a\n" ~
" Missing:b\n\n" ~
"END TEST;\n");
}
/// Parse the output from the visual trial reporter
class VisualTrialReporterParser {
TestResult testResult;
string suite;
bool readingTest;
alias ResultEvent = void delegate(TestResult);
alias OutputEvent = void delegate(string);
ResultEvent onResult;
OutputEvent onOutput;
private {
bool readingErrorMessage;
}
/// add a line to the parser
void add(string line) {
if(line == Tokens.beginTest) {
if(testResult is null) {
testResult = new TestResult("unknown");
}
readingTest = true;
testResult.begin = Clock.currTime;
testResult.end = Clock.currTime;
return;
}
if(line == Tokens.endTest) {
enforce(testResult !is null, "The test result was not created!");
readingTest = false;
if(onResult !is null) {
onResult(testResult);
}
readingErrorMessage = false;
testResult = null;
return;
}
if(!readingTest) {
return;
}
if(readingErrorMessage) {
testResult.throwable.msg ~= "\n" ~ line;
return;
}
auto pos = line.indexOf(":");
if(pos == -1) {
if(onOutput !is null) {
onOutput(line);
}
return;
}
string token = line[0 .. pos];
string value = line[pos+1 .. $];
switch(token) {
case Tokens.suite:
suite = value;
break;
case Tokens.test:
testResult.name = value;
break;
case Tokens.file:
testResult.fileName = value;
break;
case Tokens.line:
testResult.line = value.to!size_t;
break;
case Tokens.labels:
testResult.labels = Label.fromJsonArray(value);
break;
case Tokens.status:
testResult.status = value.to!(TestResult.Status);
break;
case Tokens.errorFile:
if(testResult.throwable is null) {
testResult.throwable = new ParsedVisualTrialException();
}
testResult.throwable.file = value;
break;
case Tokens.errorLine:
if(testResult.throwable is null) {
testResult.throwable = new ParsedVisualTrialException();
}
testResult.throwable.line = value.to!size_t;
break;
case Tokens.message:
enforce(testResult.throwable !is null, "The throwable must exist!");
testResult.throwable.msg = value;
readingErrorMessage = true;
break;
default:
if(onOutput !is null) {
onOutput(line);
}
}
}
}
/// Parse a successful test
unittest {
auto parser = new VisualTrialReporterParser();
parser.testResult.should.beNull;
auto begin = Clock.currTime;
parser.add("BEGIN TEST;");
parser.testResult.should.not.beNull;
parser.testResult.begin.should.be.greaterOrEqualTo(begin);
parser.testResult.end.should.be.greaterOrEqualTo(begin);
parser.testResult.status.should.equal(TestResult.Status.created);
parser.add("suite:suite name");
parser.suite.should.equal("suite name");
parser.add("test:test name");
parser.testResult.name.should.equal("test name");
parser.add("file:some file.d");
parser.testResult.fileName.should.equal("some file.d");
parser.add("line:22");
parser.testResult.line.should.equal(22);
parser.add(`labels:[ { "name": "name1", "value": "label1" }, { "name": "name2", "value": "label2" }]`);
parser.testResult.labels.should.equal([Label("name1", "label1"), Label("name2", "label2")]);
parser.add("status:success");
parser.testResult.status.should.equal(TestResult.Status.success);
parser.add("END TEST;");
parser.testResult.should.beNull;
}
/// Parse a failing test
unittest {
auto parser = new VisualTrialReporterParser();
parser.testResult.should.beNull;
auto begin = Clock.currTime;
parser.add("BEGIN TEST;");
parser.add("errorFile:file.d");
parser.add("errorLine:147");
parser.add("message:line1");
parser.add("line2");
parser.add("line3");
parser.testResult.throwable.should.not.beNull;
parser.testResult.throwable.file.should.equal("file.d");
parser.testResult.throwable.line.should.equal(147);
parser.add("END TEST;");
parser.testResult.should.beNull;
}
/// Raise an event when the test is ended
unittest {
bool called;
void checkResult(TestResult result) {
called = true;
result.should.not.beNull;
}
auto parser = new VisualTrialReporterParser();
parser.onResult = &checkResult;
parser.add("BEGIN TEST;");
parser.add("END TEST;");
called.should.equal(true);
}
/// It should not replace a test result that was already assigned
unittest {
auto testResult = new TestResult("");
auto parser = new VisualTrialReporterParser();
parser.testResult = testResult;
parser.add("BEGIN TEST;");
parser.testResult.should.equal(testResult);
parser.add("END TEST;");
parser.testResult.should.beNull;
}
/// It should raise an event with unparsed lines
unittest {
bool raised;
auto parser = new VisualTrialReporterParser();
void onOutput(string line) {
line.should.equal("some output");
raised = true;
}
parser.onOutput = &onOutput;
parser.add("BEGIN TEST;");
parser.add("some output");
raised.should.equal(true);
}
class ParsedVisualTrialException : Exception {
this() {
super("");
}
}
|
D
|
/Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/HistoricalScheduler.o : /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Deprecated.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Cancelable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObserverType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Reactive.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/RecursiveLock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Errors.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/AtomicInt.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Event.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/First.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/Platform.Linux.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.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/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/Target\ Support\ Files/RxAtomic/RxAtomic-umbrella.h /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxAtomic/RxAtomic/include/RxAtomic.h /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxAtomic/RxAtomic.modulemap /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxAtomic.build/module.modulemap /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxSwift/RxSwift.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/HistoricalScheduler~partial.swiftmodule : /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Deprecated.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Cancelable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObserverType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Reactive.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/RecursiveLock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Errors.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/AtomicInt.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Event.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/First.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/Platform.Linux.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.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/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/Target\ Support\ Files/RxAtomic/RxAtomic-umbrella.h /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxAtomic/RxAtomic/include/RxAtomic.h /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxAtomic/RxAtomic.modulemap /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxAtomic.build/module.modulemap /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxSwift/RxSwift.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/HistoricalScheduler~partial.swiftdoc : /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Deprecated.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Cancelable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObserverType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Reactive.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/RecursiveLock.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Errors.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/AtomicInt.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Event.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/First.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Rx.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/Platform/Platform.Linux.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.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/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/Target\ Support\ Files/RxAtomic/RxAtomic-umbrella.h /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Pods/RxAtomic/RxAtomic/include/RxAtomic.h /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxAtomic/RxAtomic.modulemap /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/RxSwiftDemo20190402/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RxAtomic.build/module.modulemap /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxSwift/RxSwift.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/imports/test64a.d(1): Error: module imports from file fail_compilation/imports/test64a.d conflicts with package name imports
---
*/
// PERMUTE_ARGS:
//import std.stdio;
import imports.test64a;
int main(string[] args)
{
//writefln(file1);
return 0;
}
|
D
|
instance VLK_427_Buergerin(Npc_Default)
{
name[0] = NAME_Buergerin;
guild = GIL_VLK;
id = 427;
voice = 16;
flags = 0;
npcType = NPCTYPE_AMBIENT;
B_SetAttributesToChapter(self,1);
fight_tactic = FAI_HUMAN_COWARD;
B_CreateAmbientInv(self);
EquipItem(self,ItMw_1h_Vlk_Dagger);
B_SetNpcVisual(self,FEMALE,"Hum_Head_BabeHair",FaceBabe_N_HairAndCloth,BodyTex_N,ITAR_BauBabe_L);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Babe.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = Rtn_Start_427;
};
func void Rtn_Start_427()
{
TA_Cook_Stove(4,30,12,0,"NW_CITY_MERCHANT_SHOP01_IN_03_B");
TA_Stand_Sweeping(12,0,13,2,"NW_CITY_MERCHANT_SHOP01_FRONT_02_B");
TA_Smalltalk(13,2,14,5,"NW_CITY_MERCHANT_SHOP01_FRONT_03_E");
TA_Cook_Stove(14,5,16,0,"NW_CITY_MERCHANT_SHOP01_IN_03_B");
TA_Stand_Sweeping(16,0,17,2,"NW_CITY_MERCHANT_SHOP01_FRONT_02_B");
TA_Smalltalk(17,2,18,5,"NW_CITY_MERCHANT_SHOP01_FRONT_03_E");
TA_Cook_Stove(18,5,20,0,"NW_CITY_MERCHANT_SHOP01_IN_03_B");
TA_Sit_Chair(20,0,23,30,"NW_CITY_MERCHANT_SHOP01_IN_01");
TA_Sleep(23,30,4,30,"NW_CITY_MERCHANT_SHOP01_IN_01");
};
|
D
|
import std.stdio;
import std.string;
import std.socket;
import parser;
import database;
const int BUFFER_SIZE = 4096;
@safe
void print_prompt() {
"simple_db> ".write();
}
@safe
void send_prompt(Socket client) {
client.send("simple_db> ");
}
class ExitException : Exception {
pure this(string msg = null, string file = __FILE__, size_t line = __LINE__) {
super(msg, file, line);
}
}
void clearBuffer(char[] buffer, int size) {
for (int i = 0; i < size; i++) buffer[i] = 0;
}
void handle_metacommand(Statement statement) {
switch(statement.metacommand) {
case MetaCommandResult.META_COMMAND_EXIT:
throw new ExitException;
default:
break;
}
}
void handle_command(Statement statement, database.Database!string db, Socket client) {
import std.conv;
if (statement.metacommand != MetaCommandResult.META_COMMAND_NOT_FOUND) {
handle_metacommand(statement);
return;
}
switch(statement.command) {
case CommandResult.COMMAND_SET:
db.set(statement.key, statement.value);
client.send("OK\n");
break;
case CommandResult.COMMAND_GET:
auto result = db.get(statement.key);
if (result.found) {
client.send(result.value ~ "\n");
}
else {
client.send("(empty string)\n");
}
break;
case CommandResult.COMMAND_DELETE:
client.send(db.remove(statement.key).to!string ~ "\n");
break;
case CommandResult.COMMAND_KEYS:
client.send("not implemented\n");
break;
default:
break;
}
}
void main() {
import core.thread;
import std.conv;
// auto idb = new database.IndexedDatabase!string("/tmp/tmpdb.db");
auto idb = new database.Database!string;
auto server = new TcpSocket;
server.setOption(SocketOptionLevel.SOCKET, SocketOption.REUSEADDR, true);
server.bind(new InternetAddress(10000));
server.listen(3);
"[INFO] Server Listening".writeln;
while (true) {
auto client = server.accept();
new Thread({
char[BUFFER_SIZE] buffer;
"[INFO] client connected with IP = %s".writefln(client.remoteAddress.toString);
while (true) {
send_prompt(client);
auto read = client.receive(buffer);
if (read == 0) {
break;
}
auto input = buffer[0..read].to!string;
if (input.isEmpty) {
client.send("\n");
break;
}
else {
input = input.strip;
}
try {
auto parseResult = parser.parse(input);
parseResult.handle_command(idb, client);
}
catch (ParseException ex) {
client.send(ex.msg ~ "\n");
}
catch (ExitException) {
break;
}
clearBuffer(buffer, BUFFER_SIZE);
}
}).start();
}
}
|
D
|
/Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/Objects-normal/x86_64/UITableView+CollectionSkeleton.o : /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Appearance/SkeletonAppearance.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDataSource.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/Recoverable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+IBInspectable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/SkeletonTransitionStyle.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Frame.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UILabel+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UITextView+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+UIApplicationDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/RecoverableViewState.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonConfig.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/Swizzling.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Debug/SkeletonDebug.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/SkeletonReusableCell.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/RecursiveProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/PrepareForSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Extension.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIColor+Skeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/UIView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/UITableView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/UICollectionView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonAnimationBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonMultilineLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonLayer.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/Int+Whitespaces.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SubviewsSkeletonables.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/SkeletonTableViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/SkeletonCollectionViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/CALayer+Extensions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UITableView+VisibleSections.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/UIView+Transitions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonGradient.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/ProcessInfo+XCTest.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Autolayout.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/ContainsMultilineText.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/GenericCollectionView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonFlow.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/AssociationPolicy.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/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/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/haruna/Documents/iOSdev/yelpy/Pods/Target\ Support\ Files/SkeletonView/SkeletonView-umbrella.h /Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/Objects-normal/x86_64/UITableView+CollectionSkeleton~partial.swiftmodule : /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Appearance/SkeletonAppearance.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDataSource.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/Recoverable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+IBInspectable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/SkeletonTransitionStyle.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Frame.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UILabel+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UITextView+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+UIApplicationDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/RecoverableViewState.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonConfig.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/Swizzling.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Debug/SkeletonDebug.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/SkeletonReusableCell.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/RecursiveProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/PrepareForSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Extension.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIColor+Skeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/UIView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/UITableView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/UICollectionView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonAnimationBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonMultilineLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonLayer.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/Int+Whitespaces.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SubviewsSkeletonables.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/SkeletonTableViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/SkeletonCollectionViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/CALayer+Extensions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UITableView+VisibleSections.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/UIView+Transitions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonGradient.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/ProcessInfo+XCTest.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Autolayout.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/ContainsMultilineText.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/GenericCollectionView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonFlow.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/AssociationPolicy.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/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/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/haruna/Documents/iOSdev/yelpy/Pods/Target\ Support\ Files/SkeletonView/SkeletonView-umbrella.h /Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/Objects-normal/x86_64/UITableView+CollectionSkeleton~partial.swiftdoc : /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Appearance/SkeletonAppearance.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDataSource.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/Recoverable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+IBInspectable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/SkeletonTransitionStyle.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Frame.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UILabel+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UITextView+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+UIApplicationDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/RecoverableViewState.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonConfig.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/Swizzling.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Debug/SkeletonDebug.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/SkeletonReusableCell.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/RecursiveProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/PrepareForSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Extension.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIColor+Skeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/UIView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/UITableView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/UICollectionView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonAnimationBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonMultilineLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonLayer.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/Int+Whitespaces.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SubviewsSkeletonables.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/SkeletonTableViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/SkeletonCollectionViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/CALayer+Extensions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UITableView+VisibleSections.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/UIView+Transitions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonGradient.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/ProcessInfo+XCTest.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Autolayout.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/ContainsMultilineText.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/GenericCollectionView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonFlow.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/AssociationPolicy.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/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/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/haruna/Documents/iOSdev/yelpy/Pods/Target\ Support\ Files/SkeletonView/SkeletonView-umbrella.h /Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/Objects-normal/x86_64/UITableView+CollectionSkeleton~partial.swiftsourceinfo : /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Appearance/SkeletonAppearance.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDataSource.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/Recoverable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+IBInspectable.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/SkeletonTransitionStyle.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Frame.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UILabel+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/UITextView+Multiline.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+UIApplicationDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/SkeletonCollectionDelegate.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Recoverable/RecoverableViewState.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonConfig.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/Swizzling.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Debug/SkeletonDebug.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/SkeletonReusableCell.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/RecursiveProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/PrepareForSkeletonProtocol.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Extension.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIColor+Skeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/UIView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/UITableView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/UICollectionView+CollectionSkeleton.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonAnimationBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonMultilineLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Builders/SkeletonLayerBuilder.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonLayer.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/Int+Whitespaces.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SubviewsSkeletonables.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/TableViews/SkeletonTableViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/CollectionViews/SkeletonCollectionViewProtocols.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/CALayer+Extensions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UITableView+VisibleSections.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Transitions/UIView+Transitions.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonGradient.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/ProcessInfo+XCTest.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Extensions/UIView+Autolayout.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Multilines/ContainsMultilineText.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Collections/Generics/GenericCollectionView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonView.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/SkeletonFlow.swift /Users/haruna/Documents/iOSdev/yelpy/Pods/SkeletonView/Sources/Helpers/AssociationPolicy.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/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/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/haruna/Documents/iOSdev/yelpy/Pods/Target\ Support\ Files/SkeletonView/SkeletonView-umbrella.h /Users/haruna/Documents/iOSdev/yelpy/Build/Intermediates/Pods.build/Debug-iphonesimulator/SkeletonView.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.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.7.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.7.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/**********************************************************
**
** LOGRAMM
** Interpreter
**
** (c) 2009-2014, Dr.Kameleon
**
**********************************************************
** safety.d
**********************************************************/
module safety;
//================================================
// Imports
//================================================
import std.stdio;
import std.file;
import std.conv;
import panic;
import components.functionDecl;
import components.expression;
import components.expressions;
import value;
//================================================
// Constants
//================================================
//================================================
// Functions
//================================================
class Safety
{
static bool numArgumentsMatch(Value[] v, string[] t)
{
if (v.length==t.length) {
// writeln("numArgumentsMatch : true");
}
else {
// writefln("numArgumentsMatch : false, v.l = %s, t.l = %s",to!string(v.length),to!string(t.length) );
}
return (v.length == t.length);
}
static bool typeArgumentsMatch(Value[] v, string[] t)
{
for (int j=0; j<v.length; j++)
{
if (!checkType(v[j], t[j])) { /*writefln("typeArgumentsMatch :==> false. Found : %s, Expected : %s",v[j].type,t[j]);*/ return false; }
}
//writeln("typeArgumentsMatch :==> true");
return true;
}
static bool checkType(Value v, string t)
{
if ((t is null)||(t=="")) return true;
if (t=="any") return true;
if ((v.type==ValueType.numberValue) && (t=="number")) return true;
else if ((v.type==ValueType.realValue) && (t=="number")) return true;
else if ((v.type==ValueType.stringValue) && (t=="string")) return true;
else if ((v.type==ValueType.booleanValue) && (t=="boolean")) return true;
else if ((v.type==ValueType.arrayValue) && (t=="array")) return true;
else if ((v.type==ValueType.dictionaryValue) && (t=="dictionary")) return true;
else
return false;
}
static Value[] checkFunctionCallAndEvaluateParameters(FunctionDecl f, Expressions e)
{
// Check if equal number of params
if (e.list.length!=f.parameters.list.length)
Panic.runtimeError("Wrong number of arguments for : " ~ f.name ~ ". Expected : " ~ to!string(f.parameters.list.length));
// Check param types one by one
Value[] ret = [];
for (int i=0; i<e.list.length; i++)
{
Expression eX = e.list[i];
Value eV = eX.evaluate();
ret ~= eV;
if ((i<f.params.length)&&(f.params[i] !is null))
{
if (!checkType(eV,f.params[i]))
Panic.runtimeError("Wrong argument for : " ~ f.name ~ ". Expected : " ~ f.params[i]);
}
}
// Return calculated values,
// so that we save some time
return ret;
}
}
|
D
|
/**
Some additional alogorithm functions.
Copyright: © 2019 Arne Ludwig <arne.ludwig@posteo.de>
License: Subject to the terms of the MIT license, as written in the
included LICENSE file.
Authors: Arne Ludwig <arne.ludwig@posteo.de>
*/
module dalicious.algorithm.searching;
import std.algorithm :
copy,
countUntil,
min,
OpenRight,
uniq;
import std.conv : to;
import std.functional : binaryFun, unaryFun;
import std.traits : isDynamicArray;
import std.typecons : Yes;
import std.range.primitives;
/**
Find an optimal solution using backtracking.
*/
T[] backtracking(alias isFeasible, alias score, T)(
T[] candidates,
T[] solution = [],
)
{
auto optimalSolution = solution;
auto optimalScore = score(optimalSolution);
foreach (i, candidate; candidates)
{
if (isFeasible(cast(const(T[])) solution ~ candidate))
{
auto newSolution = backtracking!(isFeasible, score)(
candidates[0 .. i] ~ candidates[i + 1 .. $],
solution ~ candidate,
);
auto newScore = score(cast(const(T[])) newSolution);
if (newScore > optimalScore)
optimalSolution = newSolution;
}
}
return optimalSolution;
}
|
D
|
/**
Convert CSV formatted data to TSV format.
This program converts comma-separated value data to tab-separated format.
Copyright (c) 2016-2017, eBay Software Foundation
Initially written by Jon Degenhardt
License: Boost Licence 1.0 (http://boost.org/LICENSE_1_0.txt)
*/
import std.stdio;
import std.format : format;
import std.range;
import std.traits;
import std.typecons : Nullable, tuple;
auto helpText = q"EOS
Synopsis: csv2tsv [options] [file...]
csv2tsv converts comma-separated text (CSV) to tab-separated format (TSV). Records
are read from files or standard input, converted records written to standard output.
Use '--help-verbose' for details the CSV formats accepted.
Options:
EOS";
auto helpTextVerbose = q"EOS
Synopsis: csv2tsv [options] [file...]
csv2tsv converts CSV (comma-separated) text to TSV (tab-separated) format. Records
are read from files or standard input, converted records written to standard output.
Both formats represent tabular data, each record on its own line, fields separated
by a delimiter character. The key difference is that CSV uses escape sequences to
represent newlines and field separators in the data, whereas TSV disallows these
characters in the data. The most common field delimiters are comma for CSV and tab
for TSV, but any character can be used.
Conversion to TSV is done by removing CSV escape syntax, changing field delimiters,
and replacing newlines and field delimiters in the data. By default, newlines and
field delimiters in the data are replaced by spaces. Most details are customizable.
There is no single spec for CSV, any number of variants can be found. The escape
syntax is common enough: fields containing newlines or field delimiters are placed
in double quotes. Inside a quoted field, a double quote is represented by a pair of
double quotes. As with field separators, the quoting character is customizable.
Behaviors of this program that often vary between CSV implementations:
* Newlines are supported in quoted fields.
* Double quotes are permitted in a non-quoted field. However, a field starting
with a quote must follow quoting rules.
* Each record can have a different numbers of fields.
* The three common forms of newlines are supported: CR, CRLF, LF.
* A newline will be added if the file does not end with one.
* No whitespace trimming is done.
This program does not validate CSV correctness, but will terminate with an error
upon reaching an inconsistent state. Improperly terminated quoted fields are the
primary cause.
UTF-8 input is assumed. Convert other encodings prior to invoking this tool.
Options:
EOS";
/**
Container for command line options.
*/
struct Csv2tsvOptions {
bool helpVerbose = false; // --help-verbose
bool hasHeader = false; // --header
char csvQuoteChar = '"'; // --q|quote
char csvDelimChar = ','; // --c|csv-delim
char tsvDelimChar = '\t'; // --t|tsv-delim
string tsvDelimReplacement = " "; // --r|replacement
auto processArgs (ref string[] cmdArgs) {
import std.algorithm : canFind;
import std.getopt;
try {
auto r = getopt(
cmdArgs,
"help-verbose", " Print full help.", &helpVerbose,
std.getopt.config.caseSensitive,
"H|header", " Treat the first line of each file as a header. Only the header of the first file is output.", &hasHeader,
std.getopt.config.caseSensitive,
"q|quote", "CHR Quoting character in CSV data. Default: double-quote (\")", &csvQuoteChar,
"c|csv-delim", "CHR Field delimiter in CSV data. Default: comma (,).", &csvDelimChar,
"t|tsv-delim", "CHR Field delimiter in TSV data. Default: TAB", &tsvDelimChar,
"r|replacement", "STR Replacement for newline and TSV field delimiters found in CSV input. Default: Space.", &tsvDelimReplacement,
);
if (r.helpWanted) {
defaultGetoptPrinter(helpText, r.options);
return tuple(false, 0);
} else if (helpVerbose) {
defaultGetoptPrinter(helpTextVerbose, r.options);
return tuple(false, 0);
}
/* Consistency checks. */
if (csvQuoteChar == '\n' || csvQuoteChar == '\r') {
throw new Exception ("CSV quote character cannot be newline (--q|quote).");
}
if (csvQuoteChar == csvDelimChar) {
throw new Exception("CSV quote and CSV field delimiter characters must be different (--q|quote, --c|csv-delim).");
}
if (csvQuoteChar == tsvDelimChar) {
throw new Exception("CSV quote and TSV field delimiter characters must be different (--q|quote, --t|tsv-delim).");
}
if (csvDelimChar == '\n' || csvDelimChar == '\r') {
throw new Exception ("CSV field delimiter cannot be newline (--c|csv-delim).");
}
if (tsvDelimChar == '\n' || tsvDelimChar == '\r') {
throw new Exception ("TSV field delimiter cannot be newline (--t|tsv-delimiter).");
}
if (canFind!(c => (c == '\n' || c == '\r' || c == tsvDelimChar))(tsvDelimReplacement)) {
throw new Exception ("Replacement character cannot contain newlines or TSV field delimiters (--r|replacement).");
}
} catch (Exception exc) {
stderr.writeln("Error processing command line arguments: ", exc.msg);
return tuple(false, 1);
}
return tuple(true, 0);
}
}
version(unittest)
{
// No main in unittest
}
else
{
int main(string[] cmdArgs) {
Csv2tsvOptions cmdopt;
auto r = cmdopt.processArgs(cmdArgs);
if (!r[0]) {
return r[1];
}
try {
csv2tsvFiles(cmdopt, cmdArgs[1..$]);
}
catch (Exception exc) {
writeln();
stdin.flush();
stderr.writeln("Error: ", exc.msg);
return 1;
}
return 0;
}
}
/* This uses a D feature where a type can reserve a single value to represent null. */
alias NullableSizeT = Nullable!(size_t, size_t.max);
/**
csv2tsvFiles reads multiple files and standard input and writes the results to standard
output.
*/
void csv2tsvFiles(in Csv2tsvOptions cmdopt, in string[] inputFiles) {
import std.algorithm : joiner;
import std.array;
ubyte[1024 * 1024] fileRawBuf;
ubyte[] stdinRawBuf = fileRawBuf[0..1024];
auto stdoutWriter = stdout.lockingTextWriter;
bool firstFile = true;
foreach (filename; (inputFiles.length > 0) ? inputFiles : ["-"]) {
auto ubyteChunkedStream = (filename == "-") ?
stdin.byChunk(stdinRawBuf) : filename.File.byChunk(fileRawBuf);
auto ubyteStream = ubyteChunkedStream.joiner;
if (firstFile || !cmdopt.hasHeader) {
csv2tsv(ubyteStream, stdoutWriter, filename, 0,
cmdopt.csvQuoteChar, cmdopt.csvDelimChar,
cmdopt.tsvDelimChar, cmdopt.tsvDelimReplacement);
}
else {
/* Don't write the header on subsequent files. Write the first
* record to a null sink instead.
*/
auto nullWriter = NullSink();
csv2tsv(ubyteStream, nullWriter, filename, 0,
cmdopt.csvQuoteChar, cmdopt.csvDelimChar,
cmdopt.tsvDelimChar, cmdopt.tsvDelimReplacement,
NullableSizeT(1));
csv2tsv(ubyteStream, stdoutWriter, filename, 1,
cmdopt.csvQuoteChar, cmdopt.csvDelimChar,
cmdopt.tsvDelimChar, cmdopt.tsvDelimReplacement);
}
firstFile = false;
}
}
/**
Read CSV from an input source, convert to TSV and write to an output source.
Params:
InputRange = A ubyte input range to read CSV text from. A ubyte range
matches byChunk. It also avoids conversion to dchar by front().
OutputRange = An output range to write TSV text to.
filename = Name of file to use when reporting errors. A descriptive name can
be used in lieu of a file name.
currFileLineNumber = First line being processed. Used when reporting errors. Needed
only when part of the input has already been processed.
csvQuote = The quoting character used in the input CSV file.
csvDelim = The field delimiter character used in the input CSV file.
tsvDelim = The field delimiter character to use in the generated TSV file.
tsvDelimReplacement = A string to use when replacing newlines and TSV field delimiters
occurring in CSV fields.
maxRecords = The maximum number of records to process (output lines). This is
intended to support processing the header line separately.
Throws: Exception on finding inconsistent CSV. Exception text includes the filename and
line number where the error was identified.
*/
void csv2tsv(InputRange, OutputRange)
(ref InputRange inputStream, ref OutputRange outputStream,
string filename = "(none)", size_t currFileLineNumber = 0,
char csvQuote = '"', char csvDelim = ',', char tsvDelim = '\t',
string tsvDelimReplacement = " ",
NullableSizeT maxRecords=NullableSizeT.init,
)
if (isInputRange!InputRange && isOutputRange!(OutputRange, char) &&
is(Unqual!(ElementType!InputRange) == ubyte))
{
enum State { FieldEnd, NonQuotedField, QuotedField, QuoteInQuotedField }
State currState = State.FieldEnd;
size_t recordNum = 1; // Record number. Output line number.
size_t fieldNum = 0; // Field on current line.
InputLoop: while (!inputStream.empty)
{
char nextChar = inputStream.front;
inputStream.popFront;
if (nextChar == '\r') {
/* Collapse newline cases to '\n'. */
if (!inputStream.empty && inputStream.front == '\n') {
inputStream.popFront;
}
nextChar = '\n';
}
final switch (currState) {
case State.FieldEnd:
/* Start of input, or after consuming a field terminator. */
++fieldNum;
if (nextChar == csvQuote) {
currState = State.QuotedField;
break;
} else {
currState = State.NonQuotedField;
goto case State.NonQuotedField;
}
case State.NonQuotedField:
if (nextChar == csvDelim) {
put(outputStream, tsvDelim);
currState = State.FieldEnd;
} else if (nextChar == tsvDelim) {
put(outputStream, tsvDelimReplacement);
} else if (nextChar == '\n') {
put(outputStream, '\n');
++recordNum;
fieldNum = 0;
currState = State.FieldEnd;
if (!maxRecords.isNull && recordNum > maxRecords) {
break InputLoop;
}
} else {
put(outputStream, nextChar);
}
break;
case State.QuotedField:
if (nextChar == csvQuote) {
/* Quote in a quoted field. Need to look at the next character.*/
if (!inputStream.empty) {
currState = State.QuoteInQuotedField;
} else {
/* End of input. A rare case: Quoted field on last line with no
* following trailing newline. Reset the state to avoid triggering
* an invalid quoted field exception, plus adding additional newline.
*/
currState = State.FieldEnd;
}
}
else if (nextChar == '\n') {
/* Newline in a quoted field. */
put(outputStream, tsvDelimReplacement);
} else if (nextChar == tsvDelim) {
put(outputStream, tsvDelimReplacement);
} else {
put(outputStream, nextChar);
}
break;
case State.QuoteInQuotedField:
/* Just processed a quote in a quoted field. */
if (nextChar == csvQuote) {
put(outputStream, csvQuote);
currState = State.QuotedField;
} else if (nextChar == csvDelim) {
put(outputStream, tsvDelim);
currState = State.FieldEnd;
} else if (nextChar == '\n') {
put(outputStream, '\n');
++recordNum;
fieldNum = 0;
currState = State.FieldEnd;
if (!maxRecords.isNull && recordNum > maxRecords) {
break InputLoop;
}
} else {
throw new Exception(
format("Invalid CSV. Improperly terminated quoted field. File: %s, Line: %d",
(filename == "-") ? "Standard Input" : filename,
currFileLineNumber + recordNum));
}
break;
}
}
if (currState == State.QuotedField) {
throw new Exception(
format("Invalid CSV. Improperly terminated quoted field. File: %s, Line: %d",
(filename == "-") ? "Standard Input" : filename,
currFileLineNumber + recordNum));
}
if (fieldNum > 0) {
put(outputStream, '\n');
}
}
unittest {
/* Unit tests for the csv2tsv function.
*
* These unit tests exercise different CSV combinations and escaping cases. The CSV
* data content is the same for each corresponding test string, except the delimiters
* have been changed. e.g csv6a and csv6b have the same data content.
*
* A property used in these tests is that changing the CSV delimiters doesn't change
* the resulting TSV. However, changing the TSV delimiters will change the TSV result,
* as TSV doesn't support having it's delimiters in the data. This allows having a
* single TSV expected set that is generated by CSVs with different delimter sets.
*
* This test set does not test main, file handling, or error messages. These are
* handled by tests run against the executable.
*/
/* Default CSV. */
auto csv1a = "a,b,c";
auto csv2a = "a,bc,,,def";
auto csv3a = ",a, b , cd ,";
auto csv4a = "ß,ßÀß,あめりか物語,书名: 五色石";
auto csv5a = "\"\n\",\"\n\n\",\"\n\n\n\"";
auto csv6a = "\"\t\",\"\t\t\",\"\t\t\t\"";
auto csv7a = "\",\",\",,\",\",,,\"";
auto csv8a = "\"\",\"\"\"\",\"\"\"\"\"\"";
auto csv9a = "\"ab, de\tfg\"\"\nhij\"";
auto csv10a = "";
auto csv11a = ",";
auto csv12a = ",,";
auto csv13a = "\"\r\",\"\r\r\",\"\r\r\r\"";
auto csv14a = "\"\r\n\",\"\r\n\r\n\",\"\r\n\r\n\r\n\"";
auto csv15a = "\"ab, de\tfg\"\"\rhij\"";
auto csv16a = "\"ab, de\tfg\"\"\r\nhij\"";
auto csv17a = "ab\",ab\"cd";
auto csv18a = "\n\n\n";
auto csv19a = "\t";
auto csv20a = "\t\t";
auto csv21a = "a\n";
auto csv22a = "a,\n";
auto csv23a = "a,b\n";
auto csv24a = ",\n";
auto csv25a = "#";
auto csv26a = "^";
auto csv27a = "#^#";
auto csv28a = "^#^";
auto csv29a = "$";
auto csv30a = "$,$\n\"$\",\"$$\",$$\n^#$,$#^,#$^,^$#\n";
auto csv31a = "1-1\n2-1,2-2\n3-1,3-2,3-3\n\n,5-2\n,,6-3\n";
auto csv32a = ",1-2,\"1-3\"\n\"2-1\",\"2-2\",\n\"3-1\",,\"3-3\"";
/* Set B has the same data and TSV results as set A, but uses # for quote and ^ for comma. */
auto csv1b = "a^b^c";
auto csv2b = "a^bc^^^def";
auto csv3b = "^a^ b ^ cd ^";
auto csv4b = "ß^ßÀß^あめりか物語^书名: 五色石";
auto csv5b = "#\n#^#\n\n#^#\n\n\n#";
auto csv6b = "#\t#^#\t\t#^#\t\t\t#";
auto csv7b = "#,#^#,,#^#,,,#";
auto csv8b = "##^#\"#^#\"\"#";
auto csv9b = "#ab, de\tfg\"\nhij#";
auto csv10b = "";
auto csv11b = "^";
auto csv12b = "^^";
auto csv13b = "#\r#^#\r\r#^#\r\r\r#";
auto csv14b = "#\r\n#^#\r\n\r\n#^#\r\n\r\n\r\n#";
auto csv15b = "#ab, de\tfg\"\rhij#";
auto csv16b = "#ab, de\tfg\"\r\nhij#";
auto csv17b = "ab\"^ab\"cd";
auto csv18b = "\n\n\n";
auto csv19b = "\t";
auto csv20b = "\t\t";
auto csv21b = "a\n";
auto csv22b = "a^\n";
auto csv23b = "a^b\n";
auto csv24b = "^\n";
auto csv25b = "####";
auto csv26b = "#^#";
auto csv27b = "###^###";
auto csv28b = "#^##^#";
auto csv29b = "$";
auto csv30b = "$^$\n#$#^#$$#^$$\n#^##$#^#$##^#^###$^#^#^$###\n";
auto csv31b = "1-1\n2-1^2-2\n3-1^3-2^3-3\n\n^5-2\n^^6-3\n";
auto csv32b = "^1-2^#1-3#\n#2-1#^#2-2#^\n#3-1#^^#3-3#";
/* The expected results for csv sets A and B. This is for the default TSV delimiters.*/
auto tsv1 = "a\tb\tc\n";
auto tsv2 = "a\tbc\t\t\tdef\n";
auto tsv3 = "\ta\t b \t cd \t\n";
auto tsv4 = "ß\tßÀß\tあめりか物語\t书名: 五色石\n";
auto tsv5 = " \t \t \n";
auto tsv6 = " \t \t \n";
auto tsv7 = ",\t,,\t,,,\n";
auto tsv8 = "\t\"\t\"\"\n";
auto tsv9 = "ab, de fg\" hij\n";
auto tsv10 = "";
auto tsv11 = "\t\n";
auto tsv12 = "\t\t\n";
auto tsv13 = " \t \t \n";
auto tsv14 = " \t \t \n";
auto tsv15 = "ab, de fg\" hij\n";
auto tsv16 = "ab, de fg\" hij\n";
auto tsv17 = "ab\"\tab\"cd\n";
auto tsv18 = "\n\n\n";
auto tsv19 = " \n";
auto tsv20 = " \n";
auto tsv21 = "a\n";
auto tsv22 = "a\t\n";
auto tsv23 = "a\tb\n";
auto tsv24 = "\t\n";
auto tsv25 = "#\n";
auto tsv26 = "^\n";
auto tsv27 = "#^#\n";
auto tsv28 = "^#^\n";
auto tsv29 = "$\n";
auto tsv30 = "$\t$\n$\t$$\t$$\n^#$\t$#^\t#$^\t^$#\n";
auto tsv31 = "1-1\n2-1\t2-2\n3-1\t3-2\t3-3\n\n\t5-2\n\t\t6-3\n";
auto tsv32 = "\t1-2\t1-3\n2-1\t2-2\t\n3-1\t\t3-3\n";
/* The TSV results for CSV sets 1a and 1b, but with $ as the delimiter rather than tab.
* This will also result in different replacements when TAB and $ appear in the CSV.
*/
auto tsv1_x = "a$b$c\n";
auto tsv2_x = "a$bc$$$def\n";
auto tsv3_x = "$a$ b $ cd $\n";
auto tsv4_x = "ß$ßÀß$あめりか物語$书名: 五色石\n";
auto tsv5_x = " $ $ \n";
auto tsv6_x = "\t$\t\t$\t\t\t\n";
auto tsv7_x = ",$,,$,,,\n";
auto tsv8_x = "$\"$\"\"\n";
auto tsv9_x = "ab, de\tfg\" hij\n";
auto tsv10_x = "";
auto tsv11_x = "$\n";
auto tsv12_x = "$$\n";
auto tsv13_x = " $ $ \n";
auto tsv14_x = " $ $ \n";
auto tsv15_x = "ab, de\tfg\" hij\n";
auto tsv16_x = "ab, de\tfg\" hij\n";
auto tsv17_x = "ab\"$ab\"cd\n";
auto tsv18_x = "\n\n\n";
auto tsv19_x = "\t\n";
auto tsv20_x = "\t\t\n";
auto tsv21_x = "a\n";
auto tsv22_x = "a$\n";
auto tsv23_x = "a$b\n";
auto tsv24_x = "$\n";
auto tsv25_x = "#\n";
auto tsv26_x = "^\n";
auto tsv27_x = "#^#\n";
auto tsv28_x = "^#^\n";
auto tsv29_x = " \n";
auto tsv30_x = " $ \n $ $ \n^# $ #^$# ^$^ #\n";
auto tsv31_x = "1-1\n2-1$2-2\n3-1$3-2$3-3\n\n$5-2\n$$6-3\n";
auto tsv32_x = "$1-2$1-3\n2-1$2-2$\n3-1$$3-3\n";
/* The TSV results for CSV sets 1a and 1b, but with $ as the delimiter rather than tab,
* and with the delimiter/newline replacement string being |--|. Basically, newlines
* and '$' in the original data are replaced by |--|.
*/
auto tsv1_y = "a$b$c\n";
auto tsv2_y = "a$bc$$$def\n";
auto tsv3_y = "$a$ b $ cd $\n";
auto tsv4_y = "ß$ßÀß$あめりか物語$书名: 五色石\n";
auto tsv5_y = "|--|$|--||--|$|--||--||--|\n";
auto tsv6_y = "\t$\t\t$\t\t\t\n";
auto tsv7_y = ",$,,$,,,\n";
auto tsv8_y = "$\"$\"\"\n";
auto tsv9_y = "ab, de\tfg\"|--|hij\n";
auto tsv10_y = "";
auto tsv11_y = "$\n";
auto tsv12_y = "$$\n";
auto tsv13_y = "|--|$|--||--|$|--||--||--|\n";
auto tsv14_y = "|--|$|--||--|$|--||--||--|\n";
auto tsv15_y = "ab, de\tfg\"|--|hij\n";
auto tsv16_y = "ab, de\tfg\"|--|hij\n";
auto tsv17_y = "ab\"$ab\"cd\n";
auto tsv18_y = "\n\n\n";
auto tsv19_y = "\t\n";
auto tsv20_y = "\t\t\n";
auto tsv21_y = "a\n";
auto tsv22_y = "a$\n";
auto tsv23_y = "a$b\n";
auto tsv24_y = "$\n";
auto tsv25_y = "#\n";
auto tsv26_y = "^\n";
auto tsv27_y = "#^#\n";
auto tsv28_y = "^#^\n";
auto tsv29_y = "|--|\n";
auto tsv30_y = "|--|$|--|\n|--|$|--||--|$|--||--|\n^#|--|$|--|#^$#|--|^$^|--|#\n";
auto tsv31_y = "1-1\n2-1$2-2\n3-1$3-2$3-3\n\n$5-2\n$$6-3\n";
auto tsv32_y = "$1-2$1-3\n2-1$2-2$\n3-1$$3-3\n";
auto csvSet1a = [csv1a, csv2a, csv3a, csv4a, csv5a, csv6a, csv7a, csv8a, csv9a, csv10a,
csv11a, csv12a, csv13a, csv14a, csv15a, csv16a, csv17a, csv18a, csv19a, csv20a,
csv21a, csv22a, csv23a, csv24a, csv25a, csv26a, csv27a, csv28a, csv29a, csv30a,
csv31a, csv32a];
auto csvSet1b = [csv1b, csv2b, csv3b, csv4b, csv5b, csv6b, csv7b, csv8b, csv9b, csv10b,
csv11b, csv12b, csv13b, csv14b, csv15b, csv16b, csv17b, csv18b, csv19b, csv20b,
csv21b, csv22b, csv23b, csv24b, csv25b, csv26b, csv27b, csv28b, csv29b, csv30b,
csv31b, csv32b];
auto tsvSet1 = [tsv1, tsv2, tsv3, tsv4, tsv5, tsv6, tsv7, tsv8, tsv9, tsv10,
tsv11, tsv12, tsv13, tsv14, tsv15, tsv16, tsv17, tsv18, tsv19, tsv20,
tsv21, tsv22, tsv23, tsv24, tsv25, tsv26, tsv27, tsv28, tsv29, tsv30,
tsv31, tsv32];
auto tsvSet1_x = [tsv1_x, tsv2_x, tsv3_x, tsv4_x, tsv5_x, tsv6_x, tsv7_x, tsv8_x, tsv9_x, tsv10_x,
tsv11_x, tsv12_x, tsv13_x, tsv14_x, tsv15_x, tsv16_x, tsv17_x, tsv18_x, tsv19_x, tsv20_x,
tsv21_x, tsv22_x, tsv23_x, tsv24_x, tsv25_x, tsv26_x, tsv27_x, tsv28_x, tsv29_x, tsv30_x,
tsv31_x, tsv32_x];
auto tsvSet1_y = [tsv1_y, tsv2_y, tsv3_y, tsv4_y, tsv5_y, tsv6_y, tsv7_y, tsv8_y, tsv9_y, tsv10_y,
tsv11_y, tsv12_y, tsv13_y, tsv14_y, tsv15_y, tsv16_y, tsv17_y, tsv18_y, tsv19_y, tsv20_y,
tsv21_y, tsv22_y, tsv23_y, tsv24_y, tsv25_y, tsv26_y, tsv27_y, tsv28_y, tsv29_y, tsv30_y,
tsv31_y, tsv32_y];
foreach (i, csva, csvb, tsv, tsv_x, tsv_y; lockstep(csvSet1a, csvSet1b, tsvSet1, tsvSet1_x, tsvSet1_y)) {
import std.conv;
/* Byte streams for csv2tsv. Consumed by csv2tsv, so need to be reset when re-used. */
ubyte[] csvInputA = cast(ubyte[])csva;
ubyte[] csvInputB = cast(ubyte[])csvb;
/* CSV Set A vs TSV expected. */
auto tsvResultA = appender!(char[])();
csv2tsv(csvInputA, tsvResultA, "csvInputA_defaultTSV", i);
assert(tsv == tsvResultA.data,
format("Unittest failure. tsv != tsvResultA.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csva, tsv, tsvResultA.data));
/* CSV Set B vs TSV expected. Different CSV delimiters, same TSV results as CSV Set A.*/
auto tsvResultB = appender!(char[])();
csv2tsv(csvInputB, tsvResultB, "csvInputB_defaultTSV", i, '#', '^');
assert(tsv == tsvResultB.data,
format("Unittest failure. tsv != tsvResultB.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csvb, tsv, tsvResultB.data));
/* CSV Set A and TSV with $ separator.*/
csvInputA = cast(ubyte[])csva;
auto tsvResult_XA = appender!(char[])();
csv2tsv(csvInputA, tsvResult_XA, "csvInputA_TSV_WithDollarDelimiter", i, '"', ',', '$');
assert(tsv_x == tsvResult_XA.data,
format("Unittest failure. tsv_x != tsvResult_XA.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csva, tsv_x, tsvResult_XA.data));
/* CSV Set B and TSV with $ separator. Same TSV results as CSV Set A.*/
csvInputB = cast(ubyte[])csvb;
auto tsvResult_XB = appender!(char[])();
csv2tsv(csvInputB, tsvResult_XB, "csvInputB__TSV_WithDollarDelimiter", i, '#', '^', '$');
assert(tsv_x == tsvResult_XB.data,
format("Unittest failure. tsv_x != tsvResult_XB.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csvb, tsv_x, tsvResult_XB.data));
/* CSV Set A and TSV with $ separator and tsv delimiter/newline replacement. */
csvInputA = cast(ubyte[])csva;
auto tsvResult_YA = appender!(char[])();
csv2tsv(csvInputA, tsvResult_YA, "csvInputA_TSV_WithDollarAndDelimReplacement", i, '"', ',', '$', "|--|");
assert(tsv_y == tsvResult_YA.data,
format("Unittest failure. tsv_y != tsvResult_YA.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csva, tsv_y, tsvResult_YA.data));
/* CSV Set A and TSV with $ separator and tsv delimiter/newline replacement. Same TSV as CSV Set A.*/
csvInputB = cast(ubyte[])csvb;
auto tsvResult_YB = appender!(char[])();
csv2tsv(csvInputB, tsvResult_YB, "csvInputB__TSV_WithDollarAndDelimReplacement", i, '#', '^', '$', "|--|");
assert(tsv_y == tsvResult_YB.data,
format("Unittest failure. tsv_y != tsvResult_YB.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csvb, tsv_y, tsvResult_YB.data));
}
}
unittest {
/* Unit tests for 'maxRecords' feature of the csv2tsv function.
*/
/* Input CSV. */
auto csv1 = "";
auto csv2 = ",";
auto csv3 = "a";
auto csv4 = "a\n";
auto csv5 = "a\nb";
auto csv6 = "a\nb\n";
auto csv7 = "a\nb\nc";
auto csv8 = "a\nb\nc\n";
auto csv9 = "a,aa";
auto csv10 = "a,aa\n";
auto csv11 = "a,aa\nb,bb";
auto csv12 = "a,aa\nb,bb\n";
auto csv13 = "a,aa\nb,bb\nc,cc";
auto csv14 = "a,aa\nb,bb\nc,cc\n";
auto csv15 = "\"a\",\"aa\"";
auto csv16 = "\"a\",\"aa\"\n";
auto csv17 = "\"a\",\"aa\"\n\"b\",\"bb\"";
auto csv18 = "\"a\",\"aa\"\n\"b\",\"bb\"\n";
auto csv19 = "\"a\",\"aa\"\n\"b\",\"bb\"\n\"c\",\"cc\"";
auto csv20 = "\"a\",\"aa\"\n\"b\",\"bb\"\n\"c\",\"cc\"\n";
/* TSV with max 1 record. */
auto tsv1_max1 = "";
auto tsv2_max1 = "\t\n";
auto tsv3_max1 = "a\n";
auto tsv4_max1 = "a\n";
auto tsv5_max1 = "a\n";
auto tsv6_max1 = "a\n";
auto tsv7_max1 = "a\n";
auto tsv8_max1 = "a\n";
auto tsv9_max1 = "a\taa\n";
auto tsv10_max1 = "a\taa\n";
auto tsv11_max1 = "a\taa\n";
auto tsv12_max1 = "a\taa\n";
auto tsv13_max1 = "a\taa\n";
auto tsv14_max1 = "a\taa\n";
auto tsv15_max1 = "a\taa\n";
auto tsv16_max1 = "a\taa\n";
auto tsv17_max1 = "a\taa\n";
auto tsv18_max1 = "a\taa\n";
auto tsv19_max1 = "a\taa\n";
auto tsv20_max1 = "a\taa\n";
/* Remaining TSV converted after first call. */
auto tsv1_max1_rest = "";
auto tsv2_max1_rest = "";
auto tsv3_max1_rest = "";
auto tsv4_max1_rest = "";
auto tsv5_max1_rest = "b\n";
auto tsv6_max1_rest = "b\n";
auto tsv7_max1_rest = "b\nc\n";
auto tsv8_max1_rest = "b\nc\n";
auto tsv9_max1_rest = "";
auto tsv10_max1_rest = "";
auto tsv11_max1_rest = "b\tbb\n";
auto tsv12_max1_rest = "b\tbb\n";
auto tsv13_max1_rest = "b\tbb\nc\tcc\n";
auto tsv14_max1_rest = "b\tbb\nc\tcc\n";
auto tsv15_max1_rest = "";
auto tsv16_max1_rest = "";
auto tsv17_max1_rest = "b\tbb\n";
auto tsv18_max1_rest = "b\tbb\n";
auto tsv19_max1_rest = "b\tbb\nc\tcc\n";
auto tsv20_max1_rest = "b\tbb\nc\tcc\n";
/* TSV with max 2 records. */
auto tsv1_max2 = "";
auto tsv2_max2 = "\t\n";
auto tsv3_max2 = "a\n";
auto tsv4_max2 = "a\n";
auto tsv5_max2 = "a\nb\n";
auto tsv6_max2 = "a\nb\n";
auto tsv7_max2 = "a\nb\n";
auto tsv8_max2 = "a\nb\n";
auto tsv9_max2 = "a\taa\n";
auto tsv10_max2 = "a\taa\n";
auto tsv11_max2 = "a\taa\nb\tbb\n";
auto tsv12_max2 = "a\taa\nb\tbb\n";
auto tsv13_max2 = "a\taa\nb\tbb\n";
auto tsv14_max2 = "a\taa\nb\tbb\n";
auto tsv15_max2 = "a\taa\n";
auto tsv16_max2 = "a\taa\n";
auto tsv17_max2 = "a\taa\nb\tbb\n";
auto tsv18_max2 = "a\taa\nb\tbb\n";
auto tsv19_max2 = "a\taa\nb\tbb\n";
auto tsv20_max2 = "a\taa\nb\tbb\n";
/* Remaining TSV converted after first call. */
auto tsv1_max2_rest = "";
auto tsv2_max2_rest = "";
auto tsv3_max2_rest = "";
auto tsv4_max2_rest = "";
auto tsv5_max2_rest = "";
auto tsv6_max2_rest = "";
auto tsv7_max2_rest = "c\n";
auto tsv8_max2_rest = "c\n";
auto tsv9_max2_rest = "";
auto tsv10_max2_rest = "";
auto tsv11_max2_rest = "";
auto tsv12_max2_rest = "";
auto tsv13_max2_rest = "c\tcc\n";
auto tsv14_max2_rest = "c\tcc\n";
auto tsv15_max2_rest = "";
auto tsv16_max2_rest = "";
auto tsv17_max2_rest = "";
auto tsv18_max2_rest = "";
auto tsv19_max2_rest = "c\tcc\n";
auto tsv20_max2_rest = "c\tcc\n";
auto csvSet1 =
[csv1, csv2, csv3, csv4, csv5, csv6, csv7,
csv8, csv9, csv10, csv11, csv12, csv13, csv14,
csv15, csv16, csv17, csv18, csv19, csv20 ];
auto tsvMax1Set1 =
[tsv1_max1, tsv2_max1, tsv3_max1, tsv4_max1, tsv5_max1, tsv6_max1, tsv7_max1,
tsv8_max1, tsv9_max1, tsv10_max1, tsv11_max1, tsv12_max1, tsv13_max1, tsv14_max1,
tsv15_max1, tsv16_max1, tsv17_max1, tsv18_max1, tsv19_max1, tsv20_max1];
auto tsvMax1RestSet1 =
[tsv1_max1_rest, tsv2_max1_rest, tsv3_max1_rest, tsv4_max1_rest, tsv5_max1_rest, tsv6_max1_rest, tsv7_max1_rest,
tsv8_max1_rest, tsv9_max1_rest, tsv10_max1_rest, tsv11_max1_rest, tsv12_max1_rest, tsv13_max1_rest, tsv14_max1_rest,
tsv15_max1_rest, tsv16_max1_rest, tsv17_max1_rest, tsv18_max1_rest, tsv19_max1_rest, tsv20_max1_rest];
auto tsvMax2Set1 =
[tsv1_max2, tsv2_max2, tsv3_max2, tsv4_max2, tsv5_max2, tsv6_max2, tsv7_max2,
tsv8_max2, tsv9_max2, tsv10_max2, tsv11_max2, tsv12_max2, tsv13_max2, tsv14_max2,
tsv15_max2, tsv16_max2, tsv17_max2, tsv18_max2, tsv19_max2, tsv20_max2];
auto tsvMax2RestSet1 =
[tsv1_max2_rest, tsv2_max2_rest, tsv3_max2_rest, tsv4_max2_rest, tsv5_max2_rest, tsv6_max2_rest, tsv7_max2_rest,
tsv8_max2_rest, tsv9_max2_rest, tsv10_max2_rest, tsv11_max2_rest, tsv12_max2_rest, tsv13_max2_rest, tsv14_max2_rest,
tsv15_max2_rest, tsv16_max2_rest, tsv17_max2_rest, tsv18_max2_rest, tsv19_max2_rest, tsv20_max2_rest];
foreach (i, csv, tsv_max1, tsv_max1_rest, tsv_max2, tsv_max2_rest;
lockstep(csvSet1, tsvMax1Set1, tsvMax1RestSet1, tsvMax2Set1, tsvMax2RestSet1))
{
/* Byte stream for csv2tsv. Consumed by csv2tsv, so need to be reset when re-used. */
ubyte[] csvInput = cast(ubyte[])csv;
/* Call with maxRecords == 1. */
auto tsvMax1Result = appender!(char[])();
csv2tsv(csvInput, tsvMax1Result, "maxRecords-one", i, '"', ',', '\t', " ", NullableSizeT(1));
assert(tsv_max1 == tsvMax1Result.data,
format("Unittest failure. tsv_max1 != tsvMax1Result.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csv, tsv_max1, tsvMax1Result.data));
/* Follow-up call getting all records remaining after the maxRecords==1 call. */
auto tsvMax1RestResult = appender!(char[])();
csv2tsv(csvInput, tsvMax1RestResult, "maxRecords-one-followup", i);
assert(tsv_max1_rest == tsvMax1RestResult.data,
format("Unittest failure. tsv_max1_rest != tsvMax1RestResult.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csv, tsv_max1_rest, tsvMax1RestResult.data));
/* Reset the input stream for maxRecords == 2. */
csvInput = cast(ubyte[])csv;
/* Call with maxRecords == 2. */
auto tsvMax2Result = appender!(char[])();
csv2tsv(csvInput, tsvMax2Result, "maxRecords-two", i, '"', ',', '\t', " ", NullableSizeT(2));
assert(tsv_max2 == tsvMax2Result.data,
format("Unittest failure. tsv_max2 != tsvMax2Result.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csv, tsv_max2, tsvMax2Result.data));
/* Follow-up call getting all records remaining after the maxRecords==2 call. */
auto tsvMax2RestResult = appender!(char[])();
csv2tsv(csvInput, tsvMax2RestResult, "maxRecords-two-followup", i);
assert(tsv_max2_rest == tsvMax2RestResult.data,
format("Unittest failure. tsv_max2_rest != tsvMax2RestResult.data. Test: %d\ncsv: |%s|\ntsv: |%s|\nres: |%s|\n",
i + 1, csv, tsv_max2_rest, tsvMax2RestResult.data));
}
}
|
D
|
/Users/cejuca/Desktop/First/build/Build/Intermediates.noindex/First.build/Debug-iphonesimulator/First.build/Objects-normal/x86_64/ViewController.o : /Users/cejuca/Desktop/First/First/AppDelegate.swift /Users/cejuca/Desktop/First/First/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/cejuca/Desktop/First/build/Build/Intermediates.noindex/First.build/Debug-iphonesimulator/First.build/Objects-normal/x86_64/ViewController~partial.swiftmodule : /Users/cejuca/Desktop/First/First/AppDelegate.swift /Users/cejuca/Desktop/First/First/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/cejuca/Desktop/First/build/Build/Intermediates.noindex/First.build/Debug-iphonesimulator/First.build/Objects-normal/x86_64/ViewController~partial.swiftdoc : /Users/cejuca/Desktop/First/First/AppDelegate.swift /Users/cejuca/Desktop/First/First/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
version https://git-lfs.github.com/spec/v1
oid sha256:329f711bd13a3e9b7d51683f1ff54643ae394ada90be9555777270b6640a31d8
size 683
|
D
|
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Vapor.build/Response/ResponseCodable.swift.o : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/ConsoleLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.3/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rsa.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.3/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ec.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.3/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.3/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bn.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.3/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.3/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.3/include/openssl/buffer.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.3/include/openssl/err.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.3/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslv.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509_vfy.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Vapor.build/ResponseCodable~partial.swiftmodule : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/ConsoleLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.3/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rsa.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.3/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ec.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.3/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.3/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bn.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.3/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.3/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.3/include/openssl/buffer.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.3/include/openssl/err.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.3/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslv.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509_vfy.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Vapor.build/ResponseCodable~partial.swiftdoc : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/ConsoleLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.3/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rsa.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.3/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ec.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.3/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.3/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bn.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.3/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.3/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.3/include/openssl/buffer.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.3/include/openssl/err.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.3/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslv.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509_vfy.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/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
|
; 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_iput_short_20.java
.class public dot.junit.opcodes.iput_short.d.T_iput_short_20
.super java/lang/Object
.field public st_o Ljava/lang/Object;
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run()V
.limit regs 4
iput-short v3, v3, dot.junit.opcodes.iput_short.d.T_iput_short_20.st_o Ljava/lang/Object;
return-void
.end method
|
D
|
/**
* ...
*
* Copyright: Copyright Benjamin Thaut 2010 - 2013.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Benjamin Thaut, Sean Kelly
* Source: $(DRUNTIMESRC core/sys/windows/_stacktrace.d)
*/
module core.sys.windows.stacktrace;
version (Windows):
import core.demangle;
import core.runtime;
import core.stdc.stdlib;
import core.stdc.string;
import core.sys.windows.dbghelp;
import core.sys.windows.windows;
//debug=PRINTF;
debug(PRINTF) import core.stdc.stdio;
extern(Windows) void RtlCaptureContext(CONTEXT* ContextRecord);
extern(Windows) DWORD GetEnvironmentVariableA(LPCSTR lpName, LPSTR pBuffer, DWORD nSize);
extern(Windows) alias USHORT function(ULONG FramesToSkip, ULONG FramesToCapture, PVOID *BackTrace, PULONG BackTraceHash) RtlCaptureStackBackTraceFunc;
private __gshared RtlCaptureStackBackTraceFunc RtlCaptureStackBackTrace;
private __gshared immutable bool initialized;
class StackTrace : Throwable.TraceInfo
{
public:
/**
* Constructor
* Params:
* skip = The number of stack frames to skip.
* context = The context to receive the stack trace from. Can be null.
*/
this(size_t skip, CONTEXT* context)
{
if(context is null)
{
version(LDC)
static enum INTERNALFRAMES = 0;
else version(Win64)
static enum INTERNALFRAMES = 3;
else version(Win32)
static enum INTERNALFRAMES = 2;
skip += INTERNALFRAMES; //skip the stack frames within the StackTrace class
}
else
{
//When a exception context is given the first stack frame is repeated for some reason
version(Win64)
static enum INTERNALFRAMES = 1;
else version(Win32)
static enum INTERNALFRAMES = 1;
skip += INTERNALFRAMES;
}
if( initialized )
m_trace = trace(skip, context);
}
int opApply( scope int delegate(ref const(char[])) dg ) const
{
return opApply( (ref size_t, ref const(char[]) buf)
{
return dg( buf );
});
}
int opApply( scope int delegate(ref size_t, ref const(char[])) dg ) const
{
int result;
foreach( i, e; resolve(m_trace) )
{
if( (result = dg( i, e )) != 0 )
break;
}
return result;
}
@trusted override string toString() const
{
string result;
foreach( e; this )
{
result ~= e ~ "\n";
}
return result;
}
/**
* Receive a stack trace in the form of an address list.
* Params:
* skip = How many stack frames should be skipped.
* context = The context that should be used. If null the current context is used.
* Returns:
* A list of addresses that can be passed to resolve at a later point in time.
*/
static ulong[] trace(size_t skip = 0, CONTEXT* context = null)
{
synchronized( typeid(StackTrace) )
{
return traceNoSync(skip, context);
}
}
/**
* Resolve a stack trace.
* Params:
* addresses = A list of addresses to resolve.
* Returns:
* An array of strings with the results.
*/
@trusted static char[][] resolve(const(ulong)[] addresses)
{
synchronized( typeid(StackTrace) )
{
return resolveNoSync(addresses);
}
}
private:
ulong[] m_trace;
static ulong[] traceNoSync(size_t skip, CONTEXT* context)
{
auto dbghelp = DbgHelp.get();
if(dbghelp is null)
return []; // dbghelp.dll not available
if(RtlCaptureStackBackTrace !is null && context is null)
{
size_t[63] buffer = void; // On windows xp the sum of "frames to skip" and "frames to capture" can't be greater then 63
auto backtraceLength = RtlCaptureStackBackTrace(cast(ULONG)skip, cast(ULONG)(buffer.length - skip), cast(void**)buffer.ptr, null);
// If we get a backtrace and it does not have the maximum length use it.
// Otherwise rely on tracing through StackWalk64 which is slower but works when no frame pointers are available.
if(backtraceLength > 1 && backtraceLength < buffer.length - skip)
{
debug(PRINTF) printf("Using result from RtlCaptureStackBackTrace\n");
version(Win64)
{
return buffer[0..backtraceLength].dup;
}
else version(Win32)
{
auto result = new ulong[backtraceLength];
foreach(i, ref e; result)
{
e = buffer[i];
}
return result;
}
}
}
HANDLE hThread = GetCurrentThread();
HANDLE hProcess = GetCurrentProcess();
CONTEXT ctxt;
if(context is null)
{
ctxt.ContextFlags = CONTEXT_FULL;
RtlCaptureContext(&ctxt);
}
else
{
ctxt = *context;
}
//x86
STACKFRAME64 stackframe;
with (stackframe)
{
version(X86)
{
enum Flat = ADDRESS_MODE.AddrModeFlat;
AddrPC.Offset = ctxt.Eip;
AddrPC.Mode = Flat;
AddrFrame.Offset = ctxt.Ebp;
AddrFrame.Mode = Flat;
AddrStack.Offset = ctxt.Esp;
AddrStack.Mode = Flat;
}
else version(X86_64)
{
enum Flat = ADDRESS_MODE.AddrModeFlat;
AddrPC.Offset = ctxt.Rip;
AddrPC.Mode = Flat;
AddrFrame.Offset = ctxt.Rbp;
AddrFrame.Mode = Flat;
AddrStack.Offset = ctxt.Rsp;
AddrStack.Mode = Flat;
}
}
version (X86) enum imageType = IMAGE_FILE_MACHINE_I386;
else version (X86_64) enum imageType = IMAGE_FILE_MACHINE_AMD64;
else static assert(0, "unimplemented");
ulong[] result;
size_t frameNum = 0;
// do ... while so that we don't skip the first stackframe
do
{
if( stackframe.AddrPC.Offset == stackframe.AddrReturn.Offset )
{
debug(PRINTF) printf("Endless callstack\n");
break;
}
if(frameNum >= skip)
{
result ~= stackframe.AddrPC.Offset;
}
frameNum++;
}
while (dbghelp.StackWalk64(imageType, hProcess, hThread, &stackframe,
&ctxt, null, null, null, null));
return result;
}
static char[][] resolveNoSync(const(ulong)[] addresses)
{
auto dbghelp = DbgHelp.get();
if(dbghelp is null)
return []; // dbghelp.dll not available
HANDLE hProcess = GetCurrentProcess();
static struct BufSymbol
{
align(1):
IMAGEHLP_SYMBOLA64 _base;
TCHAR[1024] _buf;
}
BufSymbol bufSymbol=void;
IMAGEHLP_SYMBOLA64* symbol = &bufSymbol._base;
symbol.SizeOfStruct = IMAGEHLP_SYMBOLA64.sizeof;
symbol.MaxNameLength = bufSymbol._buf.length;
char[][] trace;
version (LDC) bool haveEncounteredDThrowException = false;
foreach(pc; addresses)
{
if( pc != 0 )
{
char[] res;
if (dbghelp.SymGetSymFromAddr64(hProcess, pc, null, symbol) &&
*symbol.Name.ptr)
{
version (LDC)
{
// when encountering the first `_d_throw_exception()` frame,
// clear the current trace and continue with the next frame
if (!haveEncounteredDThrowException)
{
auto len = strlen(symbol.Name.ptr);
// ignore missing leading underscore (Win64 release) or additional module prefix (Win64 debug)
//import core.stdc.stdio; printf("RAW: %s\n", symbol.Name.ptr);
if (len >= 17 && symbol.Name.ptr[len-17 .. len] == "d_throw_exception")
{
haveEncounteredDThrowException = true;
trace.length = 0;
continue;
}
}
}
DWORD disp;
IMAGEHLP_LINEA64 line=void;
line.SizeOfStruct = IMAGEHLP_LINEA64.sizeof;
if (dbghelp.SymGetLineFromAddr64(hProcess, pc, &disp, &line))
res = formatStackFrame(cast(void*)pc, symbol.Name.ptr,
line.FileName, line.LineNumber);
else
res = formatStackFrame(cast(void*)pc, symbol.Name.ptr);
}
else
res = formatStackFrame(cast(void*)pc);
trace ~= res;
}
}
return trace;
}
static char[] formatStackFrame(void* pc)
{
import core.stdc.stdio : snprintf;
char[2+2*size_t.sizeof+1] buf=void;
immutable len = snprintf(buf.ptr, buf.length, "0x%p", pc);
cast(uint)len < buf.length || assert(0);
return buf[0 .. len].dup;
}
static char[] formatStackFrame(void* pc, char* symName)
{
char[2048] demangleBuf=void;
auto res = formatStackFrame(pc);
res ~= " in ";
const(char)[] tempSymName = symName[0 .. strlen(symName)];
//Deal with dmd mangling of long names
version(DigitalMars) version(Win32)
{
size_t decodeIndex = 0;
tempSymName = decodeDmdString(tempSymName, decodeIndex);
}
res ~= demangle(tempSymName, demangleBuf);
return res;
}
static char[] formatStackFrame(void* pc, char* symName,
in char* fileName, uint lineNum)
{
import core.stdc.stdio : snprintf;
char[11] buf=void;
auto res = formatStackFrame(pc, symName);
res ~= " at ";
res ~= fileName[0 .. strlen(fileName)];
res ~= "(";
immutable len = snprintf(buf.ptr, buf.length, "%u", lineNum);
cast(uint)len < buf.length || assert(0);
res ~= buf[0 .. len];
res ~= ")";
return res;
}
}
// Workaround OPTLINK bug (Bugzilla 8263)
extern(Windows) BOOL FixupDebugHeader(HANDLE hProcess, ULONG ActionCode,
ulong CallbackContext, ulong UserContext)
{
if (ActionCode == CBA_READ_MEMORY)
{
auto p = cast(IMAGEHLP_CBA_READ_MEMORY*)CallbackContext;
if (!(p.addr & 0xFF) && p.bytes == 0x1C &&
// IMAGE_DEBUG_DIRECTORY.PointerToRawData
(*cast(DWORD*)(p.addr + 24) & 0xFF) == 0x20)
{
immutable base = DbgHelp.get().SymGetModuleBase64(hProcess, p.addr);
// IMAGE_DEBUG_DIRECTORY.AddressOfRawData
if (base + *cast(DWORD*)(p.addr + 20) == p.addr + 0x1C &&
*cast(DWORD*)(p.addr + 0x1C) == 0 &&
*cast(DWORD*)(p.addr + 0x20) == ('N'|'B'<<8|'0'<<16|'9'<<24))
{
debug(PRINTF) printf("fixup IMAGE_DEBUG_DIRECTORY.AddressOfRawData\n");
memcpy(p.buf, cast(void*)p.addr, 0x1C);
*cast(DWORD*)(p.buf + 20) = cast(DWORD)(p.addr - base) + 0x20;
*p.bytesread = 0x1C;
return TRUE;
}
}
}
return FALSE;
}
private string generateSearchPath()
{
__gshared string[3] defaultPathList = ["_NT_SYMBOL_PATH",
"_NT_ALTERNATE_SYMBOL_PATH",
"SYSTEMROOT"];
string path;
char[2048] temp;
DWORD len;
foreach( e; defaultPathList )
{
if( (len = GetEnvironmentVariableA( e.ptr, temp.ptr, temp.length )) > 0 )
{
path ~= temp[0 .. len];
path ~= ";";
}
}
path ~= "\0";
return path;
}
shared static this()
{
auto dbghelp = DbgHelp.get();
if( dbghelp is null )
return; // dbghelp.dll not available
auto kernel32Handle = LoadLibraryA( "kernel32.dll" );
if(kernel32Handle !is null)
{
RtlCaptureStackBackTrace = cast(RtlCaptureStackBackTraceFunc) GetProcAddress(kernel32Handle, "RtlCaptureStackBackTrace");
debug(PRINTF)
{
if(RtlCaptureStackBackTrace !is null)
printf("Found RtlCaptureStackBackTrace\n");
}
}
debug(PRINTF)
{
API_VERSION* dbghelpVersion = dbghelp.ImagehlpApiVersion();
printf("DbgHelp Version %d.%d.%d\n", dbghelpVersion.MajorVersion, dbghelpVersion.MinorVersion, dbghelpVersion.Revision);
}
HANDLE hProcess = GetCurrentProcess();
DWORD symOptions = dbghelp.SymGetOptions();
symOptions |= SYMOPT_LOAD_LINES;
symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS;
symOptions |= SYMOPT_DEFERRED_LOAD;
symOptions = dbghelp.SymSetOptions( symOptions );
debug(PRINTF) printf("Search paths: %s\n", generateSearchPath().ptr);
if (!dbghelp.SymInitialize(hProcess, generateSearchPath().ptr, TRUE))
return;
version (LDC) {} else
dbghelp.SymRegisterCallback64(hProcess, &FixupDebugHeader, 0);
initialized = true;
}
|
D
|
instance BDT_1047_Bandit_L (Npc_Default)
{
// ------ NSC ------
name = NAME_BANDIT;
guild = GIL_BDT;
id = 1047;
voice = 10;
flags = 0;
npctype = NPCTYPE_AMBIENT;
//--------Aivars-----------
aivar[AIV_EnemyOverride] = TRUE;
// ------ Attribute ------
B_SetAttributesToChapter (self, 1);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_COWARD;
// ------ Equippte Waffen ------
EquipItem (self, ItMw_1h_Bau_Mace);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------
B_SetNpcVisual (self, MALE, "Hum_Head_Fatbald", Face_N_Cipher_neu, BodyTex_N, ITAR_Leather_L);
Mdl_SetModelFatness (self, 0);
Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 30);
// ------ TA ------
daily_routine = Rtn_Start_1047;
};
// ------ TA ------
FUNC VOID RTn_Start_1047()
{
TA_Sit_Campfire (00,00,12,00,"NW_CASTLEMINE_TOWER_CAMPFIRE_01");
TA_Sit_Campfire (12,00,00,00,"NW_CASTLEMINE_TOWER_CAMPFIRE_01");
};
|
D
|
/**
* The runtime module exposes information specific to the D runtime code.
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Sean Kelly
* Source: $(LINK2 https://github.com/dlang/druntime/blob/master/src/core/runtime.d, _runtime.d)
* Documentation: https://dlang.org/phobos/core_runtime.html
*/
module core.runtime;
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
version (DRuntime_Use_Libunwind)
{
import core.internal.backtrace.libunwind;
// This shouldn't be necessary but ensure that code doesn't get mixed
// It does however prevent the unittest SEGV handler to be installed,
// which is desireable as it uses backtrace directly.
private enum hasExecinfo = false;
}
else
import core.internal.execinfo;
/// C interface for Runtime.loadLibrary
extern (C) void* rt_loadLibrary(const char* name);
/// ditto
version (Windows) extern (C) void* rt_loadLibraryW(const wchar* name);
/// C interface for Runtime.unloadLibrary, returns 1/0 instead of bool
extern (C) int rt_unloadLibrary(void* ptr);
/// C interface for Runtime.initialize, returns 1/0 instead of bool
extern(C) int rt_init();
/// C interface for Runtime.terminate, returns 1/0 instead of bool
extern(C) int rt_term();
/**
* This type is returned by the module unit test handler to indicate testing
* results.
*/
struct UnitTestResult
{
/**
* Number of modules which were tested
*/
size_t executed;
/**
* Number of modules passed the unittests
*/
size_t passed;
/**
* Should the main function be run or not? This is ignored if any tests
* failed.
*/
bool runMain;
/**
* Should we print a summary of the results?
*/
bool summarize;
/**
* Simple check for whether execution should continue after unit tests
* have been run. Works with legacy code that expected a bool return.
*
* Returns:
* true if execution should continue after testing is complete, false if
* not.
*/
bool opCast(T : bool)() const
{
return runMain && (executed == passed);
}
/// Simple return code that says unit tests pass, and main should be run
enum UnitTestResult pass = UnitTestResult(0, 0, true, false);
/// Simple return code that says unit tests failed.
enum UnitTestResult fail = UnitTestResult(1, 0, false, false);
}
/// Legacy module unit test handler
alias bool function() ModuleUnitTester;
/// Module unit test handler
alias UnitTestResult function() ExtendedModuleUnitTester;
private
{
alias bool function(Object) CollectHandler;
alias Throwable.TraceInfo function( void* ptr ) TraceHandler;
alias void delegate( Throwable ) ExceptionHandler;
extern (C) void _d_print_throwable(Throwable t);
extern (C) void* thread_stackBottom();
}
shared static this()
{
// NOTE: Some module ctors will run before this handler is set, so it's
// still possible the app could exit without a stack trace. If
// this becomes an issue, the handler could be set in C main
// before the module ctors are run.
Runtime.traceHandler = &defaultTraceHandler;
}
///////////////////////////////////////////////////////////////////////////////
// Runtime
///////////////////////////////////////////////////////////////////////////////
/**
* Stores the unprocessed arguments supplied when the
* process was started.
*/
struct CArgs
{
int argc; /// The argument count.
char** argv; /// The arguments as a C array of strings.
}
/**
* This struct encapsulates all functionality related to the underlying runtime
* module for the calling context.
*/
struct Runtime
{
/**
* Initializes the runtime. This call is to be used in instances where the
* standard program initialization process is not executed. This is most
* often in shared libraries or in libraries linked to a C program.
* If the runtime was already successfully initialized this returns true.
* Each call to initialize must be paired by a call to $(LREF terminate).
*
* Returns:
* true if initialization succeeded or false if initialization failed.
*/
static bool initialize()
{
return !!rt_init();
}
/**
* Terminates the runtime. This call is to be used in instances where the
* standard program termination process will not be not executed. This is
* most often in shared libraries or in libraries linked to a C program.
* If the runtime was not successfully initialized the function returns false.
*
* Returns:
* true if termination succeeded or false if termination failed.
*/
static bool terminate()
{
return !!rt_term();
}
/**
* Returns the arguments supplied when the process was started.
*
* Returns:
* The arguments supplied when this process was started.
*/
extern(C) pragma(mangle, "rt_args") static @property string[] args();
/**
* Returns the unprocessed C arguments supplied when the process was started.
* Use this when you need to supply argc and argv to C libraries.
*
* Returns:
* A $(LREF CArgs) struct with the arguments supplied when this process was started.
*
* Example:
* ---
* import core.runtime;
*
* // A C library function requiring char** arguments
* extern(C) void initLibFoo(int argc, char** argv);
*
* void main()
* {
* auto args = Runtime.cArgs;
* initLibFoo(args.argc, args.argv);
* }
* ---
*/
extern(C) pragma(mangle, "rt_cArgs") static @property CArgs cArgs() @nogc;
/**
* Locates a dynamic library with the supplied library name and dynamically
* loads it into the caller's address space. If the library contains a D
* runtime it will be integrated with the current runtime.
*
* Params:
* name = The name of the dynamic library to load.
*
* Returns:
* A reference to the library or null on error.
*/
static void* loadLibrary()(const scope char[] name)
{
import core.stdc.stdlib : free, malloc;
version (Windows)
{
import core.sys.windows.winnls : CP_UTF8, MultiByteToWideChar;
import core.sys.windows.winnt : WCHAR;
if (name.length == 0) return null;
// Load a DLL at runtime
auto len = MultiByteToWideChar(
CP_UTF8, 0, name.ptr, cast(int)name.length, null, 0);
if (len == 0)
return null;
auto buf = cast(WCHAR*)malloc((len+1) * WCHAR.sizeof);
if (buf is null) return null;
scope (exit) free(buf);
len = MultiByteToWideChar(
CP_UTF8, 0, name.ptr, cast(int)name.length, buf, len);
if (len == 0)
return null;
buf[len] = '\0';
return rt_loadLibraryW(buf);
}
else version (Posix)
{
/* Need a 0-terminated C string for the dll name
*/
immutable len = name.length;
auto buf = cast(char*)malloc(len + 1);
if (!buf) return null;
scope (exit) free(buf);
buf[0 .. len] = name[];
buf[len] = 0;
return rt_loadLibrary(buf);
}
}
/**
* Unloads the dynamic library referenced by p. If this library contains a
* D runtime then any necessary finalization or cleanup of that runtime
* will be performed.
*
* Params:
* p = A reference to the library to unload.
*/
static bool unloadLibrary()(void* p)
{
return !!rt_unloadLibrary(p);
}
/**
* Overrides the default trace mechanism with a user-supplied version. A
* trace represents the context from which an exception was thrown, and the
* trace handler will be called when this occurs. The pointer supplied to
* this routine indicates the base address from which tracing should occur.
* If the supplied pointer is null then the trace routine should determine
* an appropriate calling context from which to begin the trace.
*
* Params:
* h = The new trace handler. Set to null to disable exception backtracing.
*/
extern(C) pragma(mangle, "rt_setTraceHandler") static @property void traceHandler(TraceHandler h);
/**
* Gets the current trace handler.
*
* Returns:
* The current trace handler or null if none has been set.
*/
extern(C) pragma(mangle, "rt_getTraceHandler") static @property TraceHandler traceHandler();
/**
* Overrides the default collect hander with a user-supplied version. This
* routine will be called for each resource object that is finalized in a
* non-deterministic manner--typically during a garbage collection cycle.
* If the supplied routine returns true then the object's dtor will called
* as normal, but if the routine returns false than the dtor will not be
* called. The default behavior is for all object dtors to be called.
*
* Params:
* h = The new collect handler. Set to null to use the default handler.
*/
extern(C) pragma(mangle, "rt_setCollectHandler") static @property void collectHandler( CollectHandler h );
/**
* Gets the current collect handler.
*
* Returns:
* The current collect handler or null if none has been set.
*/
extern(C) pragma(mangle, "rt_getCollectHandler") static @property CollectHandler collectHandler();
/**
* Overrides the default module unit tester with a user-supplied version.
* This routine will be called once on program initialization. The return
* value of this routine indicates to the runtime whether the tests ran
* without error.
*
* There are two options for handlers. The `bool` version is deprecated but
* will be kept for legacy support. Returning `true` from the handler is
* equivalent to returning `UnitTestResult.pass` from the extended version.
* Returning `false` from the handler is equivalent to returning
* `UnitTestResult.fail` from the extended version.
*
* See the documentation for `UnitTestResult` to see how you should set up
* the return structure.
*
* See the documentation for `runModuleUnitTests` for how the default
* algorithm works, or read the example below.
*
* Params:
* h = The new unit tester. Set both to null to use the default unit
* tester.
*
* Example:
* ---------
* shared static this()
* {
* import core.runtime;
*
* Runtime.extendedModuleUnitTester = &customModuleUnitTester;
* }
*
* UnitTestResult customModuleUnitTester()
* {
* import std.stdio;
*
* writeln("Using customModuleUnitTester");
*
* // Do the same thing as the default moduleUnitTester:
* UnitTestResult result;
* foreach (m; ModuleInfo)
* {
* if (m)
* {
* auto fp = m.unitTest;
*
* if (fp)
* {
* ++result.executed;
* try
* {
* fp();
* ++result.passed;
* }
* catch (Throwable e)
* {
* writeln(e);
* }
* }
* }
* }
* if (result.executed != result.passed)
* {
* result.runMain = false; // don't run main
* result.summarize = true; // print failure
* }
* else
* {
* result.runMain = true; // all UT passed
* result.summarize = false; // be quiet about it.
* }
* return result;
* }
* ---------
*/
static @property void extendedModuleUnitTester( ExtendedModuleUnitTester h )
{
sm_extModuleUnitTester = h;
}
/// Ditto
static @property void moduleUnitTester( ModuleUnitTester h )
{
sm_moduleUnitTester = h;
}
/**
* Gets the current legacy module unit tester.
*
* This property should not be used, but is supported for legacy purposes.
*
* Note that if the extended unit test handler is set, this handler will
* be ignored.
*
* Returns:
* The current legacy module unit tester handler or null if none has been
* set.
*/
static @property ModuleUnitTester moduleUnitTester()
{
return sm_moduleUnitTester;
}
/**
* Gets the current module unit tester.
*
* This handler overrides any legacy module unit tester set by the
* moduleUnitTester property.
*
* Returns:
* The current module unit tester handler or null if none has been
* set.
*/
static @property ExtendedModuleUnitTester extendedModuleUnitTester()
{
return sm_extModuleUnitTester;
}
private:
// NOTE: This field will only ever be set in a static ctor and should
// never occur within any but the main thread, so it is safe to
// make it __gshared.
__gshared ExtendedModuleUnitTester sm_extModuleUnitTester = null;
__gshared ModuleUnitTester sm_moduleUnitTester = null;
}
/**
* Set source file path for coverage reports.
*
* Params:
* path = The new path name.
* Note:
* This is a dmd specific setting.
*/
extern (C) void dmd_coverSourcePath(string path);
/**
* Set output path for coverage reports.
*
* Params:
* path = The new path name.
* Note:
* This is a dmd specific setting.
*/
extern (C) void dmd_coverDestPath(string path);
/**
* Enable merging of coverage reports with existing data.
*
* Params:
* flag = enable/disable coverage merge mode
* Note:
* This is a dmd specific setting.
*/
extern (C) void dmd_coverSetMerge(bool flag);
/**
* Set the output file name for profile reports (-profile switch).
* An empty name will set the output to stdout.
*
* Params:
* name = file name
* Note:
* This is a dmd specific setting.
*/
extern (C) void trace_setlogfilename(string name);
/**
* Set the output file name for the optimized profile linker DEF file (-profile switch).
* An empty name will set the output to stdout.
*
* Params:
* name = file name
* Note:
* This is a dmd specific setting.
*/
extern (C) void trace_setdeffilename(string name);
/**
* Set the output file name for memory profile reports (-profile=gc switch).
* An empty name will set the output to stdout.
*
* Params:
* name = file name
* Note:
* This is a dmd specific setting.
*/
extern (C) void profilegc_setlogfilename(string name);
///////////////////////////////////////////////////////////////////////////////
// Overridable Callbacks
///////////////////////////////////////////////////////////////////////////////
/**
* This routine is called by the runtime to run module unit tests on startup.
* The user-supplied unit tester will be called if one has been set,
* otherwise all unit tests will be run in sequence.
*
* If the extended unittest handler is registered, this function returns the
* result from that handler directly.
*
* If a legacy boolean returning custom handler is used, `false` maps to
* `UnitTestResult.fail`, and `true` maps to `UnitTestResult.pass`. This was
* the original behavior of the unit testing system.
*
* If no unittest custom handlers are registered, the following algorithm is
* executed (the behavior can be affected by the `--DRT-testmode` switch
* below):
* 1. Execute any unittests present. For each that fails, print the stack
* trace and continue.
* 2. If no unittests were present, set summarize to false, and runMain to
* true.
* 3. Otherwise, set summarize to true, and runMain to false.
*
* See the documentation for `UnitTestResult` for details on how the runtime
* treats the return value from this function.
*
* If the switch `--DRT-testmode` is passed to the executable, it can have
* one of 3 values:
* 1. "run-main": even if unit tests are run (and all pass), runMain is set
to true.
* 2. "test-or-main": any unit tests present will cause the program to
* summarize the results and exit regardless of the result. This is the
* default.
* 3. "test-only", runMain is set to false, even with no tests present.
*
* This command-line parameter does not affect custom unit test handlers.
*
* Returns:
* A `UnitTestResult` struct indicating the result of running unit tests.
*/
extern (C) UnitTestResult runModuleUnitTests()
{
version (Windows)
import core.sys.windows.stacktrace;
static if (hasExecinfo)
{
import core.sys.posix.signal; // segv handler
static extern (C) void unittestSegvHandler( int signum, siginfo_t* info, void* ptr ) nothrow
{
static enum MAXFRAMES = 128;
void*[MAXFRAMES] callstack;
auto numframes = backtrace( callstack.ptr, MAXFRAMES );
backtrace_symbols_fd( callstack.ptr, numframes, 2 );
}
sigaction_t action = void;
sigaction_t oldseg = void;
sigaction_t oldbus = void;
(cast(byte*) &action)[0 .. action.sizeof] = 0;
sigfillset( &action.sa_mask ); // block other signals
action.sa_flags = SA_SIGINFO | SA_RESETHAND;
action.sa_sigaction = &unittestSegvHandler;
sigaction( SIGSEGV, &action, &oldseg );
sigaction( SIGBUS, &action, &oldbus );
scope( exit )
{
sigaction( SIGSEGV, &oldseg, null );
sigaction( SIGBUS, &oldbus, null );
}
}
if (Runtime.sm_extModuleUnitTester !is null)
return Runtime.sm_extModuleUnitTester();
else if (Runtime.sm_moduleUnitTester !is null)
return Runtime.sm_moduleUnitTester() ? UnitTestResult.pass : UnitTestResult.fail;
UnitTestResult results;
foreach ( m; ModuleInfo )
{
if ( !m )
continue;
auto fp = m.unitTest;
if ( !fp )
continue;
import core.exception;
++results.executed;
try
{
fp();
++results.passed;
}
catch ( Throwable e )
{
if ( typeid(e) == typeid(AssertError) )
{
// Crude heuristic to figure whether the assertion originates in
// the unittested module. TODO: improve.
auto moduleName = m.name;
if (moduleName.length && e.file.length > moduleName.length
&& e.file[0 .. moduleName.length] == moduleName)
{
import core.stdc.stdio;
printf("%.*s(%llu): [unittest] %.*s\n",
cast(int) e.file.length, e.file.ptr, cast(ulong) e.line,
cast(int) e.message.length, e.message.ptr);
// Exception originates in the same module, don't print
// the stack trace.
// TODO: omit stack trace only if assert was thrown
// directly by the unittest.
continue;
}
}
// TODO: perhaps indent all of this stuff.
_d_print_throwable(e);
}
}
import core.internal.parseoptions : rt_configOption;
if (results.passed != results.executed)
{
// by default, we always print a summary if there are failures.
results.summarize = true;
}
else switch (rt_configOption("testmode", null, false))
{
case "run-main":
results.runMain = true;
break;
case "test-only":
// Never run main, always summarize
results.summarize = true;
break;
case "":
// By default, do not run main if tests are present.
case "test-or-main":
// only run main if there were no tests. Only summarize if we are not
// running main.
results.runMain = (results.executed == 0);
results.summarize = !results.runMain;
break;
default:
assert(0, "Unknown --DRT-testmode option: " ~ rt_configOption("testmode", null, false));
}
return results;
}
/**
* Get the default `Throwable.TraceInfo` implementation for the platform
*
* This functions returns a trace handler, allowing to inspect the
* current stack trace.
*
* Params:
* ptr = (Windows only) The context to get the stack trace from.
* When `null` (the default), start from the current frame.
*
* Returns:
* A `Throwable.TraceInfo` implementation suitable to iterate over the stack,
* or `null`. If called from a finalizer (destructor), always returns `null`
* as trace handlers allocate.
*/
Throwable.TraceInfo defaultTraceHandler( void* ptr = null )
{
// avoid recursive GC calls in finalizer, trace handlers should be made @nogc instead
import core.memory : GC;
if (GC.inFinalizer)
return null;
version (Windows)
{
import core.sys.windows.stacktrace;
static if (__traits(compiles, new StackTrace(0, null)))
{
import core.sys.windows.winnt : CONTEXT;
version (Win64)
enum FIRSTFRAME = 4;
else version (Win32)
enum FIRSTFRAME = 0;
return new StackTrace(FIRSTFRAME, cast(CONTEXT*)ptr);
}
else
return null;
}
else static if (__traits(compiles, new DefaultTraceInfo()))
return new DefaultTraceInfo();
else
return null;
}
/// Example of a simple program printing its stack trace
unittest
{
import core.runtime;
import core.stdc.stdio;
void main()
{
auto trace = defaultTraceHandler(null);
foreach (line; trace)
{
printf("%.*s\n", cast(int)line.length, line.ptr);
}
}
}
version (DRuntime_Use_Libunwind)
{
import core.internal.backtrace.handler;
alias DefaultTraceInfo = LibunwindHandler;
}
/// Default implementation for most POSIX systems
else static if (hasExecinfo) private class DefaultTraceInfo : Throwable.TraceInfo
{
import core.demangle;
import core.stdc.stdlib : free;
import core.stdc.string : strlen, memchr, memmove;
this()
{
// it may not be 1 but it is good enough to get
// in CALL instruction address range for backtrace
enum CALL_INSTRUCTION_SIZE = 1;
static if (__traits(compiles, backtrace((void**).init, int.init)))
numframes = cast(int) backtrace(this.callstack.ptr, MAXFRAMES);
// Backtrace succeeded, adjust the frame to point to the caller
if (numframes >= 2)
foreach (ref elem; this.callstack)
elem -= CALL_INSTRUCTION_SIZE;
else // backtrace() failed, do it ourselves
{
static void** getBasePtr()
{
version (D_InlineAsm_X86)
asm { naked; mov EAX, EBP; ret; }
else
version (D_InlineAsm_X86_64)
asm { naked; mov RAX, RBP; ret; }
else
return null;
}
auto stackTop = getBasePtr();
auto stackBottom = cast(void**) thread_stackBottom();
void* dummy;
if ( stackTop && &dummy < stackTop && stackTop < stackBottom )
{
auto stackPtr = stackTop;
for ( numframes = 0; stackTop <= stackPtr &&
stackPtr < stackBottom &&
numframes < MAXFRAMES; )
{
callstack[numframes++] = *(stackPtr + 1) - CALL_INSTRUCTION_SIZE;
stackPtr = cast(void**) *stackPtr;
}
}
}
}
override int opApply( scope int delegate(ref const(char[])) dg ) const
{
return opApply( (ref size_t, ref const(char[]) buf)
{
return dg( buf );
} );
}
override int opApply( scope int delegate(ref size_t, ref const(char[])) dg ) const
{
version (linux) enum enableDwarf = true;
else version (FreeBSD) enum enableDwarf = true;
else version (DragonFlyBSD) enum enableDwarf = true;
else version (OpenBSD) enum enableDwarf = true;
else version (Darwin) enum enableDwarf = true;
else enum enableDwarf = false;
const framelist = backtrace_symbols( callstack.ptr, numframes );
scope(exit) free(cast(void*) framelist);
static if (enableDwarf)
{
import core.internal.backtrace.dwarf;
return traceHandlerOpApplyImpl(numframes,
i => callstack[i],
(i) { auto str = framelist[i][0 .. strlen(framelist[i])]; return getMangledSymbolName(str); },
dg);
}
else
{
int ret = 0;
for (size_t pos = 0; pos < numframes; ++pos)
{
char[4096] fixbuf = void;
auto buf = framelist[pos][0 .. strlen(framelist[pos])];
buf = fixline( buf, fixbuf );
ret = dg( pos, buf );
if ( ret )
break;
}
return ret;
}
}
override string toString() const
{
string buf;
foreach ( i, line; this )
buf ~= i ? "\n" ~ line : line;
return buf;
}
private:
int numframes;
static enum MAXFRAMES = 128;
void*[MAXFRAMES] callstack = void;
private:
const(char)[] fixline( const(char)[] buf, return ref char[4096] fixbuf ) const
{
size_t symBeg, symEnd;
getMangledSymbolName(buf, symBeg, symEnd);
enum min = (size_t a, size_t b) => a <= b ? a : b;
if (symBeg == symEnd || symBeg >= fixbuf.length)
{
immutable len = min(buf.length, fixbuf.length);
fixbuf[0 .. len] = buf[0 .. len];
return fixbuf[0 .. len];
}
else
{
fixbuf[0 .. symBeg] = buf[0 .. symBeg];
auto sym = demangle(buf[symBeg .. symEnd], fixbuf[symBeg .. $]);
if (sym.ptr !is fixbuf.ptr + symBeg)
{
// demangle reallocated the buffer, copy the symbol to fixbuf
immutable len = min(fixbuf.length - symBeg, sym.length);
memmove(fixbuf.ptr + symBeg, sym.ptr, len);
if (symBeg + len == fixbuf.length)
return fixbuf[];
}
immutable pos = symBeg + sym.length;
assert(pos < fixbuf.length);
immutable tail = buf.length - symEnd;
immutable len = min(fixbuf.length - pos, tail);
fixbuf[pos .. pos + len] = buf[symEnd .. symEnd + len];
return fixbuf[0 .. pos + len];
}
}
}
|
D
|
/Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/Internal/FileIOError.swift.o : /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastEpisodeMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastCompatibleWebsiteItemMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/String+Normalized.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/DeploymentMethod.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFileMode.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Page.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagDetailsPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagListPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ShellOutError+PublishingErrorConvertible.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PublishingPipeline.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Predicate.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Website.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishedWebsite.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Tag.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Array+Appending.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Path.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ContentProtocol.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Item.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/AnyItem.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Plugin.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Favicon.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Location.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme+Foundation.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagHTMLConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/FeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/RSSFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Section.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Video.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Audio.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SectionMap.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingStep.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Folder+Group.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/File+SwiftPackageFolder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownMetadataDecoder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SortOrder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownFileHandler.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/StringWrapper.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastAuthor.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/FileIOError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ContentError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/HTMLGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/RSSFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/SiteMapGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ItemRSSProperties.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Mutations.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PlotComponents.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Content.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/CommandLine+Output.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingContext.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Index.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownContentFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Metal.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/AppKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/PublishCLICore.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Splash.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/SplashPublishPlugin.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/Internal/FileIOError~partial.swiftmodule : /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastEpisodeMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastCompatibleWebsiteItemMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/String+Normalized.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/DeploymentMethod.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFileMode.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Page.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagDetailsPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagListPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ShellOutError+PublishingErrorConvertible.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PublishingPipeline.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Predicate.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Website.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishedWebsite.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Tag.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Array+Appending.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Path.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ContentProtocol.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Item.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/AnyItem.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Plugin.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Favicon.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Location.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme+Foundation.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagHTMLConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/FeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/RSSFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Section.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Video.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Audio.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SectionMap.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingStep.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Folder+Group.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/File+SwiftPackageFolder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownMetadataDecoder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SortOrder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownFileHandler.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/StringWrapper.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastAuthor.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/FileIOError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ContentError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/HTMLGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/RSSFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/SiteMapGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ItemRSSProperties.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Mutations.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PlotComponents.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Content.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/CommandLine+Output.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingContext.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Index.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownContentFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Metal.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/AppKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/PublishCLICore.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Splash.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/SplashPublishPlugin.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/Internal/FileIOError~partial.swiftdoc : /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastEpisodeMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastCompatibleWebsiteItemMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/String+Normalized.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/DeploymentMethod.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFileMode.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Page.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagDetailsPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagListPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ShellOutError+PublishingErrorConvertible.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PublishingPipeline.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Predicate.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Website.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishedWebsite.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Tag.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Array+Appending.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Path.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ContentProtocol.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Item.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/AnyItem.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Plugin.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Favicon.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Location.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme+Foundation.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagHTMLConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/FeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/RSSFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Section.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Video.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Audio.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SectionMap.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingStep.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Folder+Group.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/File+SwiftPackageFolder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownMetadataDecoder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SortOrder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownFileHandler.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/StringWrapper.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastAuthor.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/FileIOError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ContentError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/HTMLGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/RSSFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/SiteMapGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ItemRSSProperties.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Mutations.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PlotComponents.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Content.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/CommandLine+Output.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingContext.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Index.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownContentFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Metal.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/AppKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/PublishCLICore.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Splash.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/SplashPublishPlugin.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/Internal/FileIOError~partial.swiftsourceinfo : /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastEpisodeMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastCompatibleWebsiteItemMetadata.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/String+Normalized.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/DeploymentMethod.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFileMode.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Page.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagDetailsPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagListPage.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ShellOutError+PublishingErrorConvertible.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PublishingPipeline.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Predicate.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Website.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishedWebsite.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Tag.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Array+Appending.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Path.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ContentProtocol.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Item.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/AnyItem.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Plugin.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Favicon.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Location.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Theme+Foundation.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/TagHTMLConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/FeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/RSSFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastFeedConfiguration.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Section.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Video.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Audio.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SectionMap.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingStep.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/Folder+Group.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/File+SwiftPackageFolder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownMetadataDecoder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/SortOrder.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownFileHandler.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/StringWrapper.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PodcastAuthor.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/FileIOError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/ContentError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastError.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/HTMLGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/RSSFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/PodcastFeedGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/SiteMapGenerator.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/ItemRSSProperties.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Mutations.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PlotComponents.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Content.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/CommandLine+Output.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/PublishingContext.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/Index.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/API/HTMLFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/checkouts/publish/Sources/Publish/Internal/MarkdownContentFactory.swift /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Metal.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreLocation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CloudKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/AppKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.swiftmodule /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Codextended.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/PublishCLICore.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Splash.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Publish.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Ink.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/SplashPublishPlugin.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Sweep.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Files.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/Plot.build/module.modulemap /Users/lucasfarah/Documents/lucasfarah.github.io/.build/x86_64-apple-macosx/debug/ShellOut.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.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/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CloudKit.framework/Headers/CloudKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module test.http.router.handler.chain;
import hunt.http.$;
import hunt.http.client.http2.SimpleResponse;
import hunt.web.server.HttpServerBuilder;
import hunt.http.utils.concurrent.Promise;
import hunt.util.Assert;
import hunt.util.Test;
import test.http.router.handler.AbstractHttpHandlerTest;
import java.util.concurrent.TimeUnit;
/**
*
*/
public class TestRouterChain extends AbstractHttpHandlerTest {
public void testChain() {
HttpServerBuilder httpServer = $.httpServer();
httpServer.router().get("/routerChain").asyncHandler(ctx -> {
ctx.setAttribute("reqId", 1000);
ctx.write("enter router 1\r\n")
.<string>nextFuture()
.thenAccept(result -> ctx.write("router 1 success\r\n").end(result))
.exceptionally(ex -> {
ctx.end(ex.getMessage());
return null;
});
}).router().get("/routerChain").asyncHandler(ctx -> {
Integer reqId = (Integer) ctx.getAttribute("reqId");
ctx.write("enter router 2, request id " ~ reqId ~ "\r\n")
.<string>nextFuture()
.thenAccept(result -> ctx.write("router 2 success, request id " ~ reqId ~ "\r\n").succeed(result))
.exceptionally(ex -> {
ctx.fail(ex);
return null;
});
}).router().get("/routerChain").asyncHandler(ctx -> {
Integer reqId = (Integer) ctx.getAttribute("reqId");
ctx.write("enter router 3, request id " ~ reqId ~ "\r\n")
.<string>complete()
.thenAccept(result -> ctx.write("router 3 success, request id " ~ reqId ~ "\r\n").succeed(result))
.exceptionally(ex -> {
ctx.fail(ex);
return null;
});
ctx.succeed("request complete");
}).listen(host, port);
SimpleResponse response = $.httpClient().get(uri ~ "/routerChain").submit().get(2, TimeUnit.SECONDS);
writeln(response.getStringBody());
Assert.assertThat(response.getStringBody(), is(
"enter router 1\r\n" ~
"enter router 2, request id 1000\r\n" ~
"enter router 3, request id 1000\r\n" ~
"router 3 success, request id 1000\r\n" ~
"router 2 success, request id 1000\r\n" ~
"router 1 success\r\n" ~
"request complete"));
httpServer.stop();
$.httpClient().stop();
}
}
|
D
|
func void b_bartok_shitanorc()
{
AI_Output(self,other,"DIA_Bartok_Angekommen_04_02"); //(себе под нос) Орк прямо у ворот города - Черт побери...
};
|
D
|
module deimos.cbor.streaming;
import deimos.cbor.callbacks;
import deimos.cbor.data;
/*
* Copyright (c) 2014-2019 Pavel Kalvoda <me@pavelkalvoda.com>
*
* libcbor is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
extern (C):
/** Stateless decoder
*
* Will try parsing the \p buffer and will invoke the appropriate callback on
* success. Decodes one item at a time. No memory allocations occur.
*
* @param buffer Input buffer
* @param buffer_size Length of the buffer
* @param callbacks The callback bundle
* @param context An arbitrary pointer to allow for maintaining context.
*/
cbor_decoder_result cbor_stream_decode(cbor_data buffer, size_t buffer_size,
const cbor_callbacks* callbacks, void* context);
|
D
|
cmd_Release/obj.target/snowball.node := g++ -shared -pthread -rdynamic -m64 -Wl,-soname=snowball.node -o Release/obj.target/snowball.node -Wl,--start-group Release/obj.target/snowball/src/snowball.o Release/obj.target/snowball/src/NativeExtension.o Release/obj.target/snowball/src/libstemmer/libstemmer/libstemmer.o Release/obj.target/snowball/src/libstemmer/runtime/api.o Release/obj.target/snowball/src/libstemmer/runtime/utilities.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_danish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_dutch.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_english.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_finnish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_french.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_german.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_hungarian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_italian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_norwegian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_porter.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_portuguese.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_spanish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_1_swedish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_2_hungarian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_ISO_8859_2_romanian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_KOI8_R_russian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_arabic.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_danish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_dutch.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_english.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_finnish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_french.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_german.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_hungarian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_italian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_norwegian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_porter.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_portuguese.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_romanian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_russian.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_spanish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_swedish.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_tamil.o Release/obj.target/snowball/src/libstemmer/src_c/stem_UTF_8_turkish.o -Wl,--end-group
|
D
|
/Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/build/MTAVPlayerView.build/Debug-iphoneos/MTAVPlayerView.build/Objects-normal/armv7s/MTAVPlayerDownload.o : /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerDownload.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerStorage.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerManager.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/SwiftOnoneSupport.swiftmodule /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerView.h /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/build/MTAVPlayerView.build/Debug-iphoneos/MTAVPlayerView.build/unextended-module.modulemap
/Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/build/MTAVPlayerView.build/Debug-iphoneos/MTAVPlayerView.build/Objects-normal/armv7s/MTAVPlayerDownload~partial.swiftmodule : /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerDownload.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerStorage.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerManager.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/SwiftOnoneSupport.swiftmodule /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerView.h /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/build/MTAVPlayerView.build/Debug-iphoneos/MTAVPlayerView.build/unextended-module.modulemap
/Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/build/MTAVPlayerView.build/Debug-iphoneos/MTAVPlayerView.build/Objects-normal/armv7s/MTAVPlayerDownload~partial.swiftdoc : /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerDownload.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerStorage.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerManager.swift /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7s/SwiftOnoneSupport.swiftmodule /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/MTAVPlayerView/MTAVPlayerView.h /Users/nolan/Desktop/ZT/HYMusic/MTAVPlayerView/build/MTAVPlayerView.build/Debug-iphoneos/MTAVPlayerView.build/unextended-module.modulemap
|
D
|
prototype MST_DEFAULT_DRAGON_ICE(C_NPC)
{
name[0] = "Ledový drak";
guild = GIL_DRAGON;
aivar[AIV_MM_REAL_ID] = ID_DRAGON_ICE;
level = 600;
bodystateinterruptableoverride = TRUE;
attribute[ATR_STRENGTH] = 200;
attribute[ATR_DEXTERITY] = 200;
attribute[ATR_HITPOINTS_MAX] = 1000;
attribute[ATR_HITPOINTS] = 1000;
attribute[ATR_MANA_MAX] = 1000;
attribute[ATR_MANA] = 1000;
protection[PROT_BLUNT] = 180;
protection[PROT_EDGE] = 180;
protection[PROT_POINT] = 180;
protection[PROT_FIRE] = 180;
protection[PROT_FLY] = 180;
protection[PROT_MAGIC] = 180;
damagetype = DAM_FIRE | DAM_FLY;
damage[DAM_INDEX_FIRE] = 159;
damage[DAM_INDEX_FLY] = 1;
fight_tactic = FAI_DRAGON;
senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL;
senses_range = PERC_DIST_DRAGON_ACTIVE_MAX;
aivar[AIV_MM_FOLLOWTIME] = FOLLOWTIME_MEDIUM;
aivar[AIV_MM_FOLLOWINWATER] = FALSE;
aivar[AIV_MAXDISTTOWP] = 10000;
aivar[AIV_ORIGINALFIGHTTACTIC] = FAI_DRAGON;
start_aistate = zs_mm_rtn_dragonrest;
aivar[AIV_MM_RESTSTART] = ONLYROUTINE;
};
func void b_setvisuals_dragon_ice()
{
Mdl_SetVisual(self,"Dragon.mds");
Mdl_SetVisualBody(self,"Dragon_Ice_Body",DEFAULT,DEFAULT,"",DEFAULT,DEFAULT,-1);
};
instance DRAGON_ICE(MST_DEFAULT_DRAGON_ICE)
{
name[0] = "Finkregh";
flags = NPC_FLAG_IMMORTAL;
b_setvisuals_dragon_ice();
Npc_SetToFistMode(self);
};
|
D
|
module std.internal.unicode_norm;
import std.internal.unicode_tables;
static if (size_t.sizeof == 8)
{
//1696 bytes
enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x20, 0x60],
[0x100, 0x100, 0x1d00], [0x302020202020100, 0x205020202020204,
0x602020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1000000000000, 0x200000000, 0x5000400030000,
0x8000000070006, 0xa0009, 0x0, 0xb000000000000,
0xc000000000000, 0xf0000000e000d, 0x0,
0x1000000000, 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x14001300120000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x17000000160015,
0x190018, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1a0000, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b00120012, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x10361f8081a9fdf,
0x401000000000003f, 0x80, 0x0, 0x0, 0x380000, 0x0, 0x0,
0x1000000000000000, 0xff000000, 0x4000000000000000,
0xb0800000, 0x48000000000000,
0x4e000000, 0x0, 0x0, 0x4000000000000000, 0x30c00000,
0x4000000000000000, 0x800000, 0x0, 0x400000, 0x0,
0x600004, 0x4000000000000000,
0x800000, 0x0, 0x80008400, 0x0, 0x168020010842008,
0x200108420080002, 0x0, 0x400000000000, 0x0, 0x0,
0x0, 0x0, 0x3ffffe00000000,
0xffffff0000000000, 0x7, 0x20000000000000, 0x0, 0x0, 0x0, 0x0,
0x2aaa000000000000, 0x4800000000000000,
0x2a00c80808080a00,
0x3, 0x0, 0x0, 0x0, 0xc4000000000, 0x0, 0x0, 0x0,
0x60000000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0,
0x0, 0x6000000, 0x0, 0xffffffffffffffff,
0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xfffffc657fe53fff,
0xffff3fffffffffff, 0xffffffffffffffff, 0x3ffffff,
0x5f7ffc00a0000000, 0x7fdb, 0x0, 0x0,
0x0, 0x0, 0x400000000000000, 0x0, 0x8000000000, 0x0, 0x0, 0x0,
0x4000000000000000,
0x800000, 0x0, 0x0, 0x0, 0x0, 0x2401000000000000, 0x0, 0x0,
0x0, 0x800000000000, 0x0,
0x0, 0x1fc0000000, 0xf800000000000000, 0x1, 0x3fffffff, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//2016 bytes
enum nfdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x20, 0x70],
[0x100, 0x140, 0x2300], [0x504030202020100, 0x207020202020206,
0x802020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x3000200010000, 0x5000600050004, 0x9000800070005,
0xc0005000b000a,
0x500050005000d, 0x5000500050005, 0xe000500050005,
0x10000f00050005, 0x14001300120011, 0x5000500050005,
0x5001500050005, 0x5000500050005, 0x5000500050016,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x17001700170017, 0x17001700170017, 0x17001700170017,
0x17001700170017, 0x17001700170017,
0x17001700170017, 0x17001700170017, 0x17001700170017,
0x17001700170017, 0x17001700170017, 0x18001700170017,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005,
0x1a001900170005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x1d0005001c001b, 0x50005001f001e, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005,
0x5000500200005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5002100170017, 0x5000500050005,
0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005, 0x5000500050005,
0x5000500050005, 0x5000500050005,
0x5000500050005, 0x0, 0x0, 0x0, 0xbe7effbf3e7effbf,
0x7ef1ff3ffffcffff,
0x7fffff3ffff3f1f8, 0x1800300000000,
0xff31ffcfdfffe000, 0xfffc0cfffffff, 0x0, 0x0, 0x0, 0x0,
0x401000000000001b, 0x1fc000001d7e0, 0x187c00,
0x20000000200708b,
0xc00000708b0000, 0x0, 0x33ffcfcfccf0006, 0x0, 0x0, 0x0, 0x0,
0x7c00000000, 0x0, 0x0, 0x80005,
0x12020000000000,
0xff000000, 0x0, 0xb0001800, 0x48000000000000, 0x4e000000, 0x0,
0x0, 0x0, 0x30001900,
0x100000, 0x1c00, 0x0, 0x100, 0x0, 0xd81, 0x0, 0x1c00, 0x0,
0x74000000, 0x0, 0x168020010842008,
0x200108420080002, 0x0, 0x4000000000, 0x0, 0x0, 0x0,
0x2800000000045540, 0xb, 0x0, 0x0, 0xffffffffffffffff,
0xffffffffffffffff,
0xffffffff0bffffff, 0x3ffffffffffffff,
0xffffffff3f3fffff, 0x3fffffffaaff3f3f, 0x5fdfffffffffffff,
0x3fdcffffefcfffde, 0x3, 0x0, 0x0, 0x0, 0xc4000000000, 0x0,
0x40000c000000, 0xe000, 0x5000001210, 0x333e00500000292,
0xf00000000333, 0x3c0f00000000, 0x60000000000, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x10000000, 0x0, 0x36db02a555555000,
0x5555500040100000, 0x4790000036db02a5,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0xfffffffff, 0x0, 0xfffffc657fe53fff, 0xffff3fffffffffff,
0xffffffffffffffff,
0x3ffffff, 0x5f7ffc00a0000000, 0x7fdb, 0x0, 0x0, 0x0, 0x0,
0x80014000000,
0x0, 0xc00000000000, 0x0, 0x0, 0x0, 0x0, 0x1800, 0x0, 0x0, 0x0,
0x0,
0x5800000000000000, 0x0, 0x0, 0x0, 0xc00000000000000, 0x0, 0x0,
0x1fc0000000, 0xf800000000000000,
0x1, 0x3fffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//2720 bytes
enum nfkcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x20, 0x70],
[0x100, 0x140, 0x3900], [0x402030202020100, 0x706020202020205,
0x802020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x3000200010000, 0x4000600050004, 0x9000800070004,
0xd000c000b000a,
0x40004000f000e, 0x4000400040004, 0x10000400040004,
0x13001200110004, 0x17001600150014, 0x4000400040018,
0x4001900040004, 0x1d001c001b001a, 0x210020001f001e,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x23002200040004, 0x24000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x26002500210004, 0x29002800270021, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x2c0004002b002a, 0x40004002e002d,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x40004002f0004, 0x33003200310030, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4003400040004,
0x4003600350004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4003700210021, 0x4000400040004,
0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004, 0x4000400040004,
0x4000400040004, 0x4000400040004,
0x4000400040004, 0x0, 0x0, 0x773c850100000000,
0x0, 0x800c000000000000, 0x8000000000000201,
0x0, 0xe000000001ff0, 0x0, 0x0, 0x1ff000000000000,
0x1f3f000000, 0x10361f8081a9fdf,
0x441000000000003f,
0xb0, 0x2370000007f0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80,
0x0, 0x0, 0x1e0000000380000,
0x0, 0x0, 0x1000000000000000, 0xff000000, 0x4000000000000000,
0xb0800000, 0x48000000000000, 0x4e000000, 0x0,
0x0, 0x4000000000000000,
0x30c00000, 0x4000000000000000, 0x800000, 0x0, 0x400000, 0x0,
0x600004, 0x4000000000000000, 0x800000, 0x0,
0x80008400, 0x8000000000000,
0x0, 0x8000000000000, 0x30000000, 0x1000, 0x3e8020010842008,
0x200108420080002, 0x0, 0x400000000000, 0x0, 0x0,
0x1000000000000000, 0x0, 0x3ffffe00000000,
0xffffff0000000000, 0x7, 0x20000000000000, 0x0, 0x0, 0x0,
0xf7ff700000000000, 0x10007ffffffbfff, 0xfffffffff8000000,
0x0, 0x0, 0x0,
0xc000000, 0x0, 0x0, 0x2aaa000000000000, 0xe800000000000000,
0x6a00e808e808ea03, 0x50d88070008207ff, 0xfff3000080800380,
0x1001fff7fff, 0x0, 0xfbfbbd573e6ffeef,
0xffffffffffff03e1, 0x200, 0x0, 0x1b00000000000, 0x0, 0x0, 0x0,
0x60000000000, 0x0, 0x0, 0x0, 0x0,
0xffffffff00000000,
0xffffffffffffffff, 0x7ffffffffff, 0x1000, 0x70000000000000,
0x0, 0x10000000, 0x0, 0x3000000000000000,
0x0,
0x0, 0x0, 0x800000000000, 0x0, 0x0, 0x0, 0x0, 0x80000000,
0x8000000000000, 0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0x3fffff,
0x740000000000001, 0x0, 0x9e000000, 0x8000000000000000,
0xfffe000000000000, 0xffffffffffffffff,
0xfffc7fff, 0x0, 0xffffffff7fffffff, 0x7fffffffffff00ff,
0xffffffffffffffff,
0x7fffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0x0, 0x30000000,
0x0, 0x0, 0x1000000000000, 0x0, 0x300000000000000,
0x0, 0xf0000000, 0x0, 0x0,
0xfffffc657fe53fff, 0xffff3fffffffffff, 0xffffffffffffffff, 0x3ffffff,
0x5f7fffffa0f8007f, 0xffffffffffffffdb, 0x3ffffffffffff,
0xfffffffffff80000, 0x3fffffffffffffff, 0xffffffffffff0000,
0xfffffffffffcffff, 0x1fff0000000000ff, 0xffff000003ff0000,
0xffd70f7ffff7ff9f,
0xffffffffffffffff, 0x1fffffffffffffff, 0xfffffffffffffffe,
0xffffffffffffffff, 0x7fffffffffffffff, 0x7f7f1cfcfcfc, 0x0,
0x0, 0x400000000000000, 0x0,
0x8000000000, 0x0,
0x0, 0x0, 0x4000000000000000, 0x800000, 0x0, 0x0, 0x0, 0x0,
0x2401000000000000, 0x0, 0x0, 0x0,
0x800000000000, 0x0, 0x0, 0x1fc0000000, 0xf800000000000000,
0x1, 0xffffffffffffffff, 0xffffffffffdfffff,
0xebffde64dfffffff, 0xffffffffffffffef, 0x7bffffffdfdfe7bf,
0xfffffffffffdfc5f,
0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffff3fffffffff,
0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffcfff,
0xaf7fe96ffffffef,
0x5ef7f796aa96ea84,
0xffffbee0ffffbff, 0x0, 0xffff7fffffff07ff,
0xc000000ffff, 0x10000, 0x0, 0xfffffffffff0007, 0x301ff, 0x0,
0x0, 0x3fffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//2816 bytes
enum nfkdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x20, 0x78],
[0x100, 0x160, 0x3a00], [0x504030202020100, 0x807020202020206,
0x902020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x202020202020202,
0x202020202020202, 0x202020202020202, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x3000200010000, 0x7000600050004, 0xa000900080007,
0xe000d000c000b,
0x700070007000f, 0x7000700070007, 0x10000700070007,
0x13001200110007, 0x17001600150014, 0x7000700070018,
0x7001900070007, 0x1d001c001b001a, 0x210020001f001e,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x23002200070007, 0x24000700070007,
0x21002100210021, 0x21002100210021, 0x21002100210021,
0x21002100210021, 0x21002100210021,
0x21002100210021, 0x21002100210021, 0x21002100210021,
0x21002100210021, 0x21002100210021, 0x25002100210021,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007,
0x27002600210007, 0x2a002900280021, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x2d0007002c002b, 0x70007002f002e, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007,
0x7000700300007, 0x34003300320031, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7003500070007, 0x7003700360007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7003800210021, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007, 0x7000700070007, 0x7000700070007,
0x7000700070007,
0x7000700070007, 0x0, 0x0, 0x773c850100000000,
0xbe7effbf3e7effbf, 0xfefdff3ffffcffff,
0xffffff3ffff3f3f9, 0x1800300000000, 0xff3fffcfdffffff0,
0xfffc0cfffffff, 0x0, 0x1ff000000000000, 0x1f3f000000,
0x0, 0x441000000000001b, 0x1fc000001d7f0, 0x2370000007f7c00,
0x20000000200708b, 0xc00000708b0000, 0x0,
0x33ffcfcfccf0006, 0x0, 0x0, 0x80,
0x0, 0x7c00000000, 0x1e0000000000000, 0x0, 0x80005, 0x0, 0x0,
0x0, 0x0, 0x12020000000000, 0xff000000,
0x0, 0xb0001800, 0x48000000000000, 0x4e000000, 0x0, 0x0, 0x0,
0x30001900,
0x100000, 0x1c00, 0x0, 0x100, 0x0, 0xd81, 0x0, 0x1c00, 0x0,
0x74000000, 0x8000000000000, 0x0,
0x8000000000000,
0x30000000, 0x1000, 0x3e8020010842008, 0x200108420080002, 0x0,
0x4000000000, 0x0, 0x0, 0x1000000000000000,
0x2800000000045540, 0xb, 0x0, 0x0, 0xf7ff700000000000,
0x10007ffffffbfff, 0xfffffffff8000000, 0x0, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffff0fffffff,
0x3ffffffffffffff, 0xffffffff3f3fffff, 0x3fffffffaaff3f3f,
0xffdfffffffffffff,
0x7fdcffffefcfffdf,
0x50d88070008207ff, 0xfff3000080800380,
0x1001fff7fff, 0x0, 0xfbfbbd573e6ffeef, 0xffffffffffff03e1,
0x40000c000200, 0xe000, 0x1b05000001210, 0x333e00500000292,
0xf00000000333, 0x3c0f00000000, 0x60000000000,
0x0, 0x0, 0x0, 0x0, 0xffffffff00000000, 0xffffffffffffffff,
0x7ffffffffff, 0x1000, 0x70000000000000,
0x0, 0x10000000,
0x0, 0x3000000000000000, 0x0, 0x0, 0x0, 0x800000000000, 0x0,
0x0, 0x0, 0x0, 0x80000000, 0x8000000000000,
0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0x3fffff, 0x740000000000001,
0x36db02a555555000, 0x55555000d8100000, 0xc790000036db02a5,
0xfffe000000000000, 0xffffffffffffffff, 0xfffc7fff, 0x0,
0xffffffff7fffffff,
0x7fffffffffff00ff,
0xffffffffffffffff, 0x7fffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0x0, 0x0, 0x30000000, 0x0, 0x0,
0x1000000000000, 0x0, 0x300000000000000,
0x0, 0xf0000000, 0x0, 0x0, 0xffffffffffffffff,
0xffffffffffffffff, 0xfffffffff, 0x0,
0xfffffc657fe53fff, 0xffff3fffffffffff, 0xffffffffffffffff,
0x3ffffff, 0x5f7fffffa0f8007f, 0xffffffffffffffdb,
0x3ffffffffffff, 0xfffffffffff80000, 0x3fffffffffffffff,
0xffffffffffff0000, 0xfffffffffffcffff, 0x1fff0000000000ff,
0xffff000003ff0000, 0xffd70f7ffff7ff9f, 0xffffffffffffffff,
0x1fffffffffffffff, 0xfffffffffffffffe, 0xffffffffffffffff,
0x7fffffffffffffff, 0x7f7f1cfcfcfc, 0x0, 0x0, 0x80014000000,
0x0, 0xc00000000000, 0x0, 0x0,
0x0, 0x0, 0x1800, 0x0, 0x0, 0x0, 0x0, 0x5800000000000000, 0x0,
0x0, 0x0, 0xc00000000000000,
0x0, 0x0, 0x1fc0000000, 0xf800000000000000, 0x1, 0xffffffffffffffff,
0xffffffffffdfffff, 0xebffde64dfffffff, 0xffffffffffffffef,
0x7bffffffdfdfe7bf, 0xfffffffffffdfc5f, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0xffffff3fffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffcfff, 0xaf7fe96ffffffef,
0x5ef7f796aa96ea84, 0xffffbee0ffffbff, 0x0,
0xffff7fffffff07ff,
0xc000000ffff, 0x10000, 0x0,
0xfffffffffff0007, 0x301ff, 0x0, 0x0, 0x3fffffff, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0]);
}
static if (size_t.sizeof == 4)
{
//1696 bytes
enum nfcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x40, 0xc0],
[0x100, 0x100, 0x1d00], [0x2020100,
0x3020202, 0x2020204, 0x2050202, 0x2020202, 0x6020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000,
0x0, 0x2, 0x30000, 0x50004, 0x70006, 0x80000, 0xa0009, 0x0,
0x0, 0x0, 0x0, 0xb0000, 0x0, 0xc0000, 0xe000d, 0xf0000, 0x0,
0x0, 0x0, 0x10, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x120000, 0x140013, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x160015, 0x170000,
0x190018, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1a0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x120012, 0x1b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x81a9fdf, 0x10361f8, 0x3f,
0x40100000, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x380000, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x10000000, 0xff000000, 0x0, 0x0,
0x40000000,
0xb0800000, 0x0, 0x0, 0x480000, 0x4e000000, 0x0, 0x0, 0x0, 0x0,
0x0,
0x0, 0x40000000, 0x30c00000, 0x0, 0x0, 0x40000000, 0x800000,
0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0, 0x600004, 0x0, 0x0,
0x40000000, 0x800000, 0x0, 0x0, 0x0, 0x80008400, 0x0, 0x0, 0x0,
0x10842008,
0x1680200, 0x20080002, 0x2001084, 0x0, 0x0, 0x0, 0x4000, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3ffffe, 0x0,
0xffffff00, 0x7, 0x0, 0x0, 0x200000, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x2aaa0000, 0x0, 0x48000000, 0x8080a00,
0x2a00c808, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc40,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x600, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x0,
0x0, 0x0, 0x0, 0x6000000, 0x0, 0x0, 0x0, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0x7fe53fff, 0xfffffc65,
0xffffffff, 0xffff3fff, 0xffffffff,
0xffffffff, 0x3ffffff,
0x0, 0xa0000000, 0x5f7ffc00, 0x7fdb, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x0, 0x80, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x800000, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24010000, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x8000, 0x0, 0x0, 0x0, 0x0,
0xc0000000, 0x1f, 0x0, 0xf8000000, 0x1, 0x0, 0x3fffffff, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//2016 bytes
enum nfdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x40, 0xe0],
[0x100, 0x140, 0x2300], [0x2020100,
0x5040302, 0x2020206, 0x2070202, 0x2020202, 0x8020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000,
0x30002, 0x50004, 0x50006, 0x70005, 0x90008, 0xb000a, 0xc0005,
0x5000d, 0x50005, 0x50005, 0x50005,
0x50005, 0xe0005, 0x50005, 0x10000f, 0x120011, 0x140013,
0x50005, 0x50005, 0x50005, 0x50015, 0x50005,
0x50005, 0x50016, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x170017, 0x170017,
0x170017, 0x170017, 0x170017, 0x170017, 0x170017, 0x170017,
0x170017, 0x170017, 0x170017, 0x170017,
0x170017,
0x170017, 0x170017, 0x170017, 0x170017, 0x170017, 0x170017,
0x170017, 0x170017, 0x180017,
0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x170005, 0x1a0019, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x1c001b, 0x1d0005,
0x1f001e, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x200005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x170017, 0x50021, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005,
0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x50005, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x3e7effbf, 0xbe7effbf, 0xfffcffff, 0x7ef1ff3f, 0xfff3f1f8,
0x7fffff3f, 0x0, 0x18003, 0xdfffe000,
0xff31ffcf, 0xcfffffff, 0xfffc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x1b, 0x40100000, 0x1d7e0, 0x1fc00, 0x187c00, 0x0,
0x200708b, 0x2000000,
0x708b0000, 0xc00000, 0x0, 0x0, 0xfccf0006, 0x33ffcfc, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7c, 0x0, 0x0, 0x0,
0x0, 0x80005, 0x0, 0x0, 0x120200, 0xff000000, 0x0, 0x0, 0x0,
0xb0001800, 0x0, 0x0, 0x480000, 0x4e000000, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x30001900, 0x0, 0x100000, 0x0, 0x1c00, 0x0,
0x0, 0x0, 0x100, 0x0, 0x0, 0x0, 0xd81, 0x0, 0x0, 0x0, 0x1c00,
0x0, 0x0, 0x0, 0x74000000, 0x0, 0x0, 0x0, 0x10842008,
0x1680200,
0x20080002, 0x2001084, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x45540, 0x28000000, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xbffffff, 0xffffffff, 0xffffffff,
0x3ffffff, 0x3f3fffff, 0xffffffff, 0xaaff3f3f,
0x3fffffff, 0xffffffff,
0x5fdfffff, 0xefcfffde, 0x3fdcffff, 0x3, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0xc40, 0x0, 0x0, 0xc000000, 0x4000, 0xe000,
0x0, 0x1210, 0x50, 0x292, 0x333e005, 0x333, 0xf000, 0x0,
0x3c0f, 0x0, 0x600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x55555000,
0x36db02a5, 0x40100000, 0x55555000,
0x36db02a5, 0x47900000, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xf, 0x0, 0x0,
0x7fe53fff, 0xfffffc65, 0xffffffff,
0xffff3fff, 0xffffffff,
0xffffffff, 0x3ffffff, 0x0, 0xa0000000, 0x5f7ffc00, 0x7fdb,
0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14000000, 0x800, 0x0,
0x0, 0x0, 0xc000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x58000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000000, 0x0,
0x0, 0x0, 0x0, 0xc0000000, 0x1f, 0x0, 0xf8000000, 0x1, 0x0,
0x3fffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0]);
//2720 bytes
enum nfkcQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x40, 0xe0],
[0x100, 0x140, 0x3900], [0x2020100,
0x4020302, 0x2020205, 0x7060202, 0x2020202, 0x8020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000,
0x30002, 0x50004, 0x40006, 0x70004, 0x90008, 0xb000a, 0xd000c,
0xf000e, 0x40004, 0x40004, 0x40004,
0x40004, 0x100004, 0x110004, 0x130012, 0x150014, 0x170016,
0x40018, 0x40004, 0x40004, 0x40019,
0x1b001a,
0x1d001c, 0x1f001e, 0x210020, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x230022,
0x40004, 0x240004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x210004, 0x260025,
0x270021, 0x290028, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x2b002a,
0x2c0004, 0x2e002d, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x2f0004, 0x40004,
0x310030, 0x330032, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40034, 0x350004, 0x40036,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x210021, 0x40037, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004,
0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x40004, 0x0, 0x0,
0x0, 0x0, 0x0, 0x773c8501, 0x0, 0x0, 0x0, 0x800c0000, 0x201,
0x80000000, 0x0, 0x0, 0x1ff0, 0xe0000, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1ff0000,
0x3f000000, 0x1f, 0x81a9fdf, 0x10361f8, 0x3f, 0x44100000, 0xb0,
0x0, 0x7f0000, 0x2370000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0,
0x380000, 0x1e00000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000,
0xff000000, 0x0,
0x0, 0x40000000, 0xb0800000, 0x0, 0x0, 0x480000, 0x4e000000,
0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x30c00000, 0x0, 0x0,
0x40000000, 0x800000, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0,
0x600004, 0x0, 0x0, 0x40000000, 0x800000, 0x0, 0x0, 0x0,
0x80008400,
0x0, 0x0, 0x80000, 0x0, 0x0, 0x0, 0x80000, 0x30000000, 0x0,
0x1000,
0x0, 0x10842008, 0x3e80200, 0x20080002, 0x2001084, 0x0, 0x0,
0x0, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x0,
0x0, 0x3ffffe, 0x0, 0xffffff00, 0x7, 0x0, 0x0, 0x200000, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf7ff7000, 0xffffbfff,
0x10007ff,
0xf8000000, 0xffffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xc000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2aaa0000, 0x0,
0xe8000000, 0xe808ea03, 0x6a00e808,
0x8207ff, 0x50d88070, 0x80800380, 0xfff30000, 0x1fff7fff,
0x100, 0x0, 0x0, 0x3e6ffeef, 0xfbfbbd57,
0xffff03e1, 0xffffffff, 0x200, 0x0, 0x0, 0x0, 0x0, 0x1b000,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x600, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff,
0x7ff, 0x1000, 0x0, 0x0, 0x700000, 0x0, 0x0, 0x10000000, 0x0,
0x0, 0x0, 0x0, 0x30000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000000,
0x0,
0x0, 0x80000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0x3fffff,
0x0, 0x1, 0x7400000, 0x0, 0x0, 0x9e000000, 0x0, 0x0,
0x80000000, 0x0, 0xfffe0000,
0xffffffff, 0xffffffff, 0xfffc7fff, 0x0, 0x0, 0x0, 0x7fffffff,
0xffffffff, 0xffff00ff, 0x7fffffff,
0xffffffff, 0xffffffff,
0xffffffff, 0x7fffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff,
0xffffffff, 0x0, 0x0, 0x0, 0x0, 0x30000000, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x3000000, 0x0, 0x0,
0xf0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7fe53fff, 0xfffffc65,
0xffffffff, 0xffff3fff, 0xffffffff, 0xffffffff,
0x3ffffff, 0x0, 0xa0f8007f, 0x5f7fffff, 0xffffffdb, 0xffffffff,
0xffffffff, 0x3ffff, 0xfff80000, 0xffffffff,
0xffffffff, 0x3fffffff,
0xffff0000, 0xffffffff, 0xfffcffff, 0xffffffff, 0xff,
0x1fff0000, 0x3ff0000, 0xffff0000, 0xfff7ff9f, 0xffd70f7f,
0xffffffff, 0xffffffff,
0xffffffff, 0x1fffffff, 0xfffffffe, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0x7fffffff,
0x1cfcfcfc, 0x7f7f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000000, 0x0,
0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000,
0x800000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x24010000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8000, 0x0,
0x0, 0x0, 0x0, 0xc0000000, 0x1f, 0x0, 0xf8000000, 0x1, 0x0,
0xffffffff, 0xffffffff, 0xffdfffff,
0xffffffff, 0xdfffffff, 0xebffde64, 0xffffffef, 0xffffffff,
0xdfdfe7bf, 0x7bffffff, 0xfffdfc5f, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffff3f, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffcfff, 0xffffffff,
0xffffffef, 0xaf7fe96, 0xaa96ea84,
0x5ef7f796, 0xffffbff,
0xffffbee, 0x0, 0x0, 0xffff07ff, 0xffff7fff, 0xffff, 0xc00,
0x10000,
0x0, 0x0, 0x0, 0xffff0007, 0xfffffff, 0x301ff, 0x0, 0x0, 0x0,
0x0, 0x0, 0x3fffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
//2816 bytes
enum nfkdQCTrieEntries = TrieEntry!(bool, 8, 5, 8)([0x0, 0x40, 0xf0],
[0x100, 0x160, 0x3a00], [0x2020100,
0x5040302, 0x2020206, 0x8070202, 0x2020202, 0x9020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x2020202, 0x2020202, 0x2020202,
0x2020202, 0x2020202,
0x2020202, 0x2020202, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000,
0x30002, 0x50004, 0x70006, 0x80007, 0xa0009, 0xc000b, 0xe000d,
0x7000f, 0x70007, 0x70007, 0x70007,
0x70007, 0x100007, 0x110007, 0x130012, 0x150014, 0x170016,
0x70018, 0x70007, 0x70007, 0x70019,
0x1b001a,
0x1d001c, 0x1f001e, 0x210020, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x230022,
0x70007, 0x240007, 0x210021, 0x210021,
0x210021, 0x210021, 0x210021, 0x210021, 0x210021, 0x210021,
0x210021, 0x210021, 0x210021, 0x210021,
0x210021,
0x210021, 0x210021, 0x210021, 0x210021, 0x210021, 0x210021,
0x210021, 0x210021, 0x250021,
0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x210007, 0x270026, 0x280021,
0x2a0029, 0x70007, 0x70007, 0x70007,
0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x2c002b, 0x2d0007,
0x2f002e, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x300007, 0x70007,
0x320031, 0x340033, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70035, 0x360007, 0x70037, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x210021, 0x70038, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007, 0x70007,
0x70007, 0x70007,
0x70007, 0x0, 0x0, 0x0, 0x0, 0x0, 0x773c8501, 0x3e7effbf,
0xbe7effbf, 0xfffcffff, 0xfefdff3f,
0xfff3f3f9, 0xffffff3f, 0x0, 0x18003, 0xdffffff0, 0xff3fffcf,
0xcfffffff, 0xfffc0,
0x0, 0x0, 0x0, 0x1ff0000, 0x3f000000, 0x1f, 0x0, 0x0, 0x1b,
0x44100000, 0x1d7f0, 0x1fc00,
0x7f7c00, 0x2370000, 0x200708b, 0x2000000, 0x708b0000,
0xc00000, 0x0, 0x0,
0xfccf0006, 0x33ffcfc, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0,
0x0, 0x7c, 0x0, 0x1e00000, 0x0, 0x0, 0x80005, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x120200, 0xff000000, 0x0,
0x0, 0x0, 0xb0001800, 0x0, 0x0, 0x480000, 0x4e000000, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x30001900, 0x0, 0x100000, 0x0,
0x1c00, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0, 0x0, 0xd81, 0x0, 0x0,
0x0, 0x1c00, 0x0, 0x0, 0x0, 0x74000000, 0x0, 0x0, 0x80000, 0x0,
0x0, 0x0, 0x80000, 0x30000000, 0x0, 0x1000, 0x0, 0x10842008,
0x3e80200,
0x20080002, 0x2001084, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0,
0x0, 0x10000000, 0x45540, 0x28000000, 0xb, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0xf7ff7000,
0xffffbfff, 0x10007ff, 0xf8000000, 0xffffffff, 0x0, 0x0,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xfffffff, 0xffffffff,
0xffffffff, 0x3ffffff, 0x3f3fffff, 0xffffffff, 0xaaff3f3f,
0x3fffffff, 0xffffffff, 0xffdfffff, 0xefcfffdf,
0x7fdcffff, 0x8207ff,
0x50d88070, 0x80800380, 0xfff30000, 0x1fff7fff, 0x100, 0x0,
0x0, 0x3e6ffeef, 0xfbfbbd57, 0xffff03e1,
0xffffffff, 0xc000200, 0x4000, 0xe000, 0x0, 0x1210, 0x1b050,
0x292,
0x333e005, 0x333, 0xf000, 0x0, 0x3c0f, 0x0, 0x600, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffff, 0xffffffff,
0xffffffff,
0xffffffff, 0x7ff, 0x1000, 0x0, 0x0, 0x700000, 0x0, 0x0,
0x10000000, 0x0, 0x0, 0x0, 0x0, 0x30000000, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x80000000, 0x0, 0x0, 0x80000, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0x3fffff,
0x0, 0x1, 0x7400000, 0x55555000, 0x36db02a5, 0xd8100000,
0x55555000, 0x36db02a5, 0xc7900000,
0x0, 0xfffe0000,
0xffffffff, 0xffffffff, 0xfffc7fff, 0x0, 0x0, 0x0, 0x7fffffff,
0xffffffff, 0xffff00ff, 0x7fffffff,
0xffffffff, 0xffffffff,
0xffffffff, 0x7fffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff,
0xffffffff, 0x0, 0x0, 0x0, 0x0, 0x30000000, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x3000000, 0x0, 0x0,
0xf0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff,
0xf, 0x0, 0x0, 0x7fe53fff, 0xfffffc65, 0xffffffff, 0xffff3fff,
0xffffffff, 0xffffffff, 0x3ffffff,
0x0, 0xa0f8007f,
0x5f7fffff, 0xffffffdb, 0xffffffff, 0xffffffff, 0x3ffff,
0xfff80000, 0xffffffff, 0xffffffff, 0x3fffffff,
0xffff0000, 0xffffffff, 0xfffcffff,
0xffffffff, 0xff, 0x1fff0000, 0x3ff0000, 0xffff0000,
0xfff7ff9f, 0xffd70f7f, 0xffffffff, 0xffffffff, 0xffffffff,
0x1fffffff, 0xfffffffe,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x7fffffff,
0x1cfcfcfc, 0x7f7f,
0x0, 0x0, 0x0, 0x0, 0x14000000, 0x800, 0x0, 0x0, 0x0, 0xc000,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1800, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x58000000, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0xc000000, 0x0, 0x0, 0x0, 0x0, 0xc0000000,
0x1f, 0x0, 0xf8000000, 0x1, 0x0, 0xffffffff, 0xffffffff,
0xffdfffff, 0xffffffff, 0xdfffffff, 0xebffde64,
0xffffffef,
0xffffffff, 0xdfdfe7bf, 0x7bffffff, 0xfffdfc5f, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffff3f, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffcfff,
0xffffffff, 0xffffffef, 0xaf7fe96, 0xaa96ea84, 0x5ef7f796,
0xffffbff, 0xffffbee, 0x0, 0x0, 0xffff07ff,
0xffff7fff, 0xffff, 0xc00, 0x10000, 0x0, 0x0, 0x0, 0xffff0007,
0xfffffff, 0x301ff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3fffffff, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
}
|
D
|
module armos.graphics.image;
import armos.graphics;
import armos.math;
/++
画像のファイルフォーマットを表します
+/
enum ImageFormat{
BMP = 0,
ICO = 1,
JPEG = 2,
JNG = 3,
KOALA = 4,
LBM = 5,
IFF = LBM,
MNG = 6,
PBM = 7,
PBMRAW = 8,
PCD = 9,
PCX = 10,
PGM = 11,
PGMRAW = 12,
PNG = 13,
PPM = 14,
PPMRAW = 15,
RAS = 16,
TARGA = 17,
TIFF = 18,
WBMP = 19,
PSD = 20,
CUT = 21,
XBM = 22,
XPM = 23,
DDS = 24,
GIF = 25,
HDR = 26,
FAXG3 = 27,
SGI = 28,
EXR = 29,
J2K = 30,
JP2 = 31,
PFM = 32,
PICT = 33,
RAW = 34
}
import derelict.freeimage.freeimage;
/++
画像を表すクラスです.
load()で画像を読み込み,draw()で表示することができます.
+/
class Image {
public{
this(){
if(!isInitializedFreeImage){
DerelictFI.load();
FreeImage_Initialise();
isInitializedFreeImage = true;
}
_material = (new DefaultMaterial);
_material.attr("diffuse", Vector4f(1, 1, 1, 1));
}
/++
Load image.
画像を読み込みます.
+/
Image load(string pathInDataDir){
import std.string;
FIBITMAP * freeImageBitmap = null;
_bitmap = Bitmap!(char)();
import armos.utils;
string fileName = absolutePath(pathInDataDir);
FREE_IMAGE_FORMAT freeImageFormat = FIF_UNKNOWN;
freeImageFormat = FreeImage_GetFileType(fileName.toStringz , 0);
if(freeImageFormat == FIF_UNKNOWN) {
freeImageFormat = FreeImage_GetFIFFromFilename(fileName.toStringz);
}
if((freeImageFormat != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(freeImageFormat)) {
freeImageBitmap = FreeImage_Load(freeImageFormat, fileName.toStringz, 0);
if (freeImageBitmap != null){
_isLoaded = true;
}
}
if ( _isLoaded ){
//TODO: bring freeImageBitmap to Bitmap
bitmap(freeImageBitmap);
}
if (freeImageBitmap != null){
FreeImage_Unload(freeImageBitmap);
}
allocate;
_material.texture("tex0", this._texture);
return this;
}
Image drawCropped(T)(
in T x, in T y,
in T startX, in T startY,
in T endX, in T endY
){
drawCropped(x, y, T(0), startX, startY, endX, endY);
return this;
}
Image drawCropped(T)(
in T x, in T y, in T z,
in T startX, in T startY,
in T endX, in T endY
){
if(_isLoaded){
import std.conv;
_rect.texCoords[0] = Vector4f(startX.to!float/_texture.width, startY.to!float/_texture.height, 0, 1);
_rect.texCoords[1] = Vector4f(startX.to!float/_texture.width, endY.to!float/_texture.height, 0, 1);
_rect.texCoords[2] = Vector4f(endX.to!float/_texture.width, endY.to!float/_texture.height, 0, 1);
_rect.texCoords[3] = Vector4f(endX.to!float/_texture.width, startY.to!float/_texture.height, 0, 1);
// _rect.texCoords[0] = Vector4f(0, 0, 0, 1);
// _rect.texCoords[1] = Vector4f(0, 1, 0, 1);
// _rect.texCoords[2] = Vector4f(1, 1, 0, 1);
// _rect.texCoords[3] = Vector4f(1, , 0, 1);
_rect.vertices[0] = Vector4f(0f, 0f, 0f, 1f);
_rect.vertices[1] = Vector4f(0f, endY-startY, 0f, 1f);
_rect.vertices[2] = Vector4f(endX-startX, endY-startY, 0f, 1f);
_rect.vertices[3] = Vector4f(endX-startX, 0f, 0f, 1f);
pushMatrix;
translate(x, y, z);
_material.begin;
_rect.drawFill();
_material.end;
popMatrix;
}
return this;
}
/++
Draw image data which loaded in advance.
読み込んだ画像データを画面に描画します.
+/
Image draw(T)(in T x, in T y, in T z = T(0)){
drawCropped(x, y, z, 0, 0, bitmap.width, bitmap.height);
return this;
}
/++
Draw image data which loaded in advance.
読み込んだ画像データを画面に描画します.
+/
Image draw(T)(in T position)const{
static if(position.data.length == 2)
draw(position[0], position[1]);
else if(position.data.length == 3)
draw(position[0], position[1], position[2]);
else
static assert(0, "arg is invalid dimention");
return this;
}
/++
Return image size.
画像のサイズを返します.
+/
Vector2i size()const{return _size;}
/++
Return width.
画像の幅を返します.
+/
int width()const{return _size[0];}
/++
Return height.
画像の高さを返します.
+/
int height()const{return _size[1];}
/++
Return bitmap pointer.
画像のビットマップデータを返します.
+/
Bitmap!(char) bitmap(){return _bitmap;}
/++
Set bitmap
+/
Image bitmap(Bitmap!(char) data){
_bitmap = data;
allocate();
_isLoaded = true;
return this;
}
/++
Generate a image from the aligned pixels
一次元配列からImageを生成します
+/
Image setFromAlignedPixels(T)(T* pixels, int width, int height, ColorFormat format){
_bitmap.setFromAlignedPixels(cast(char*)pixels, width, height, format);
allocate;
_isLoaded = true;
_material.texture("tex0", this._texture);
return this;
}
/++
与えられたbitmapを元にtextureとrectを生成します
+/
Image allocate(){
_texture = new Texture;
_texture.allocate(_bitmap);
_rect = new Mesh;
_rect.primitiveMode = PrimitiveMode.TriangleStrip ;
float x = _bitmap.width;
float y = _bitmap.height;
_rect.vertices = [
Vector4f(0.0, 0.0, 0.0, 1.0f),
Vector4f(0.0, y, 0.0, 1.0f),
Vector4f(x, y, 0.0, 1.0f),
Vector4f(x, 0.0, 0.0, 1.0f),
];
_rect.texCoords0= [
Vector4f(0f, 0f, 0f, 1f),
Vector4f(0, 1f*_bitmap.height/_texture.height, 0f, 1f),
Vector4f(1f*_bitmap.width/_texture.width, 1f*_bitmap.height/_texture.height, 0f, 1f),
Vector4f(1f*_bitmap.width/_texture.width, 0, 0f, 1f),
];
_rect.indices = [
0, 1, 2,
2, 3, 0,
];
return this;
}
/++
Retun true if the image was loaded.
画像が読み込まれている場合trueを,そうでない場合はfalseを返します.
+/
bool isLoaded()const{
return _isLoaded;
}
/++
+/
Texture texture(){
return _texture;
}
/++
+/
Image minMagFilter(in TextureMinFilter minFilter, in TextureMagFilter magFilter){
_texture.minMagFilter(minFilter, magFilter);
return this;
}
/++
+/
Image minFilter(in TextureMinFilter filter){
_texture.minFilter(filter);
return this;
}
///
Image magFilter(in TextureMagFilter filter){
_texture.magFilter(filter);
return this;
}
///
Material material(){
return _material;
}
}//public
private{
static bool isInitializedFreeImage = false;
Vector2i _size;
Bitmap!(char) _bitmap;
Texture _texture;
Mesh _rect;
bool _isLoaded = false;
Material _material;
/++
ImageのbitmapにfreeImageのbitmapを指定します.
+/
void bitmap(FIBITMAP* freeImageBitmap, bool swapForLittleEndian = true){
FREE_IMAGE_TYPE imageType = FreeImage_GetImageType(freeImageBitmap);
uint bits = char.sizeof;
import std.stdio;
FIBITMAP* bitmapConverted;
bitmapConverted = FreeImage_ConvertTo32Bits(freeImageBitmap);
freeImageBitmap = bitmapConverted;
uint width = FreeImage_GetWidth(freeImageBitmap);
uint height = FreeImage_GetHeight(freeImageBitmap);
uint bpp = FreeImage_GetBPP(freeImageBitmap);
uint channels = (bpp / bits) / 8;
uint pitch = FreeImage_GetPitch(freeImageBitmap);
ColorFormat armosColorFormat;
switch (channels) {
case 1:
armosColorFormat = ColorFormat.Gray;
break;
case 2:
armosColorFormat = ColorFormat.Gray;
break;
case 3:
armosColorFormat = ColorFormat.RGB;
break;
case 4:
armosColorFormat = ColorFormat.RGBA;
break;
default:
break;
}
FreeImage_FlipVertical(freeImageBitmap);
char* bitmapBits = cast(char*)FreeImage_GetBits(freeImageBitmap);
_bitmap.setFromAlignedPixels(bitmapBits, width, height, armosColorFormat);
_bitmap.swapRAndB;
_size = _bitmap.size;
}
}//private
}//class Image
|
D
|
/*******************************************************************************
Simple client for testing neo requests.
copyright:
Copyright (c) 2017 sociomantic labs GmbH. All rights reserved
License:
Boost Software License Version 1.0. See LICENSE.txt for details.
*******************************************************************************/
module neotest.main;
import ocean.transition;
import ocean.io.Stdout;
import ocean.text.convert.Integer;
import ocean.task.Task;
import ocean.task.Scheduler;
import ocean.task.util.Timer;
import swarm.neo.client.requests.NotificationFormatter;
import dhtproto.client.DhtClient;
import swarm.neo.client.requests.NotificationFormatter;
class DhtTest : Task
{
import swarm.neo.authentication.HmacDef: Key;
import swarm.neo.AddrPort;
protected DhtClient dht;
this ( )
{
auto auth_name = "neotest";
ubyte[] auth_key = Key.init.content;
this.dht = new DhtClient(theScheduler.epoll, auth_name, auth_key,
&this.connNotifier);
this.dht.neo.enableSocketNoDelay();
this.dht.neo.addNode("127.0.0.1", 10_100);
}
override public void run ( )
{
try
{
this.dht.blocking.waitAllHashRangesKnown();
Stdout.formatln("All nodes connected");
this.go();
}
finally
{
Stderr.formatln("Shutting down epoll");
theScheduler.shutdown();
}
}
private void connNotifier ( DhtClient.Neo.DhtConnNotification info )
{
with ( info.Active ) switch ( info.active )
{
case connected:
Stdout.formatln("Connected to {}:{}",
info.connected.node_addr.address_bytes, info.connected.node_addr.port);
break;
case hash_range_queried:
Stdout.formatln("Got hash-range of {}:{}",
info.hash_range_queried.node_addr.address_bytes, info.hash_range_queried.node_addr.port);
break;
case connection_error:
Stderr.formatln("Connection error '{}' on {}:{}",
getMsg(info.connection_error.e),
info.connection_error.node_addr.address_bytes, info.connection_error.node_addr.port);
break;
default:
assert(false);
}
}
abstract protected void go ( );
}
class Put : DhtTest
{
override protected void go ( )
{
auto res = this.dht.blocking.put("test".dup, 0, "hello".dup);
assert(res.succeeded);
Stdout.formatln("Put succeeded");
}
}
class Fill : DhtTest
{
private hash_t max;
private cstring[] channels;
this ( hash_t max, cstring[] channels )
{
this.max = max;
if ( channels.length == 0 )
this.channels = ["test".dup];
else
this.channels = channels;
}
override protected void go ( )
{
for ( hash_t k = 0; k < this.max; k++ )
{
foreach ( channel; this.channels )
{
auto res = this.dht.blocking.put(channel, k, "hello".dup);
assert(res.succeeded);
if ( (k + 1) % 100 == 0 )
Stdout.formatln("{} Puts succeeded", k + 1);
}
}
}
}
class Fetch : DhtTest
{
private hash_t max;
this ( hash_t max )
{
this.max = max;
}
override protected void go ( )
{
void[] buf;
for ( hash_t k = 0; k < this.max; k++ )
{
auto res = this.dht.blocking.get("test".dup, k, buf);
assert(res.succeeded);
wait(500_000);
if ( (k + 1) % 100 == 0 )
Stdout.formatln("{} Gets succeeded", k + 1);
}
}
}
class Get : DhtTest
{
override protected void go ( )
{
void[] buf;
auto res = this.dht.blocking.get("test".dup, 0, buf);
assert(res.succeeded);
Stdout.formatln("Get succeeded, value: {}", cast(mstring)res.value);
}
}
class Update : DhtTest
{
import core.thread : Thread;
import ocean.core.Time;
import ocean.core.array.Mutation : copy;
/// When the record has been received, pause 5s before sending back the
/// updated value. (This is useful for testing what happens when 2 clients
/// update the same record at once.)
bool pause;
override protected void go ( )
{
this.dht.neo.update("test".dup, 0, &this.notifier);
this.suspend();
}
private void notifier ( DhtClient.Neo.Update.Notification info,
Const!(DhtClient.Neo.Update.Args) args )
{
with ( info.Active ) final switch ( info.active )
{
case received:
auto received_record = info.received.value;
(*info.received.updated_value).copy(received_record);
(*info.received.updated_value) ~= [cast(ubyte)'X'];
if ( this.pause )
{
Stdout.formatln("Pausing 5s");
Thread.sleep(seconds(5));
Stdout.formatln("Continuing");
}
break;
case conflict: // Another client updated the same record. Try again.
Stdout.formatln("Finished: conflict");
this.resume();
break;
case succeeded: // Updated successfully.
case no_record: // Record not in DHT. Use Put to write a new record.
Stdout.formatln("Finished: OK");
this.resume();
break;
case error:
case no_node:
case node_disconnected:
case node_error:
case wrong_node:
case unsupported:
Stdout.formatln("Finished: error");
this.resume();
break;
mixin(typeof(info).handleInvalidCases);
}
}
}
class GetAll : DhtTest
{
uint c;
override protected void go ( )
{
this.dht.neo.getAll("test", &this.notifier);
this.suspend();
Stdout.formatln("GetAll finished after receiving {} records", this.c);
this.c = 0;
}
private void notifier ( DhtClient.Neo.GetAll.Notification info,
Const!(DhtClient.Neo.GetAll.Args) args )
{
with ( info.Active ) switch ( info.active )
{
case received:
this.c++;
if ( this.c % 100 == 0 )
Stdout.formatln("Received {} records", this.c);
break;
case finished:
this.resume();
break;
default:
break;
}
}
}
class Mirror : DhtTest
{
uint c;
override protected void go ( )
{
DhtClient.Neo.Mirror.Settings s;
s.periodic_refresh_s = 5;
this.dht.neo.mirror("test", &this.notifier, s);
this.suspend();
Stdout.formatln("Mirror finished after receiving {} records", this.c);
this.c = 0;
}
private void notifier ( DhtClient.Neo.Mirror.Notification info,
Const!(DhtClient.Neo.Mirror.Args) args )
{
mstring buf;
//~ Stdout.formatln(formatNotification(info, buf));
with ( info.Active ) switch ( info.active )
{
case updated:
this.c++;
if ( this.c % 100 == 0 )
Stdout.formatln("{} Mirror updates", this.c);
break;
case refreshed:
this.c++;
if ( this.c % 1000 == 0 )
Stdout.formatln("{} Mirror updates", this.c);
break;
case channel_removed:
this.resume();
break;
case updates_lost:
Stdout.formatln("Updates lost! :(");
break;
default:
break;
}
}
}
class MirrorFill : DhtTest
{
override protected void go ( )
{
this.dht.neo.mirror("test", &this.notifier);
for ( hash_t k = 0; k < hash_t.max; k++ )
{
auto res = this.dht.blocking.put("test", k, "hello".dup);
assert(res.succeeded);
if ( (k + 1) % 100 == 0 )
Stdout.formatln("{} Puts succeeded", k + 1);
}
}
private void notifier ( DhtClient.Neo.Mirror.Notification info,
Const!(DhtClient.Neo.Mirror.Args) args )
{
mstring buf;
Stdout.formatln(formatNotification(info, buf));
}
}
class MultiMirror : DhtTest
{
private cstring[] channels;
public this ( cstring[] channels )
{
this.channels = channels;
}
override protected void go ( )
{
foreach ( channel; this.channels )
this.dht.neo.mirror(channel, &this.notifier);
this.suspend();
Stdout.formatln("At least one Mirror ended");
}
private void notifier ( DhtClient.Neo.Mirror.Notification info,
Const!(DhtClient.Neo.Mirror.Args) args )
{
mstring buf;
Stdout.formatln("{}: {}", args.channel, formatNotification(info, buf));
with ( info.Active ) switch ( info.active )
{
case channel_removed:
this.resume();
break;
default:
break;
}
}
}
void main ( cstring[] args )
{
assert(args.length >= 2);
SchedulerConfiguration config;
initScheduler(config);
auto cmd = args[1];
auto params = args[2..$];
switch ( cmd )
{
case "put":
assert(params.length == 0);
theScheduler.schedule(new Put);
break;
case "get":
assert(params.length == 0);
theScheduler.schedule(new Get);
break;
case "update":
assert(params.length == 0);
theScheduler.schedule(new Update);
break;
case "update_pause":
assert(params.length == 0);
auto update = new Update;
update.pause = true;
theScheduler.schedule(update);
break;
case "getall":
assert(params.length == 0);
theScheduler.schedule(new GetAll);
break;
case "mirror":
assert(params.length == 0);
theScheduler.schedule(new Mirror);
break;
case "mirrorfill":
assert(params.length == 0);
theScheduler.schedule(new MirrorFill);
break;
case "multimirror":
assert(params.length >= 1);
theScheduler.schedule(new MultiMirror(params));
break;
case "fill":
assert(params.length >= 1);
hash_t max;
toInteger(args[2], max);
theScheduler.schedule(new Fill(max, params[1..$]));
break;
case "fetch":
assert(params.length == 1);
hash_t max;
toInteger(params[0], max);
theScheduler.schedule(new Fetch(max));
break;
default:
Stderr.formatln("Unknown command '{}'", cmd);
}
theScheduler.eventLoop();
}
|
D
|
module android.java.android.app.usage.StorageStatsManager_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import0 = android.java.java.util.UUID_d_interface;
import import4 = android.java.java.lang.Class_d_interface;
import import1 = android.java.android.app.usage.StorageStats_d_interface;
import import2 = android.java.android.os.UserHandle_d_interface;
import import3 = android.java.android.app.usage.ExternalStorageStats_d_interface;
final class StorageStatsManager : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import long getTotalBytes(import0.UUID);
@Import long getFreeBytes(import0.UUID);
@Import import1.StorageStats queryStatsForPackage(import0.UUID, string, import2.UserHandle);
@Import import1.StorageStats queryStatsForUid(import0.UUID, int);
@Import import1.StorageStats queryStatsForUser(import0.UUID, import2.UserHandle);
@Import import3.ExternalStorageStats queryExternalStatsForUser(import0.UUID, import2.UserHandle);
@Import import4.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/app/usage/StorageStatsManager;";
}
|
D
|
/Users/sergio.orozco/Documents/RWPickFlavor/DerivedData/RWPickFlavor/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager.o : /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/MultipartFormData.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Timeline.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Alamofire.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Response.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/TaskDelegate.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/SessionDelegate.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/ParameterEncoding.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Validation.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/ResponseSerialization.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/SessionManager.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/AFError.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Notifications.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Result.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Request.swift /Users/sergio.orozco/Documents/RWPickFlavor/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/sergio.orozco/Documents/RWPickFlavor/Pods/Headers/Public/Alamofire/Alamofire-umbrella.h /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Headers/Public/Alamofire/Alamofire.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sergio.orozco/Documents/RWPickFlavor/DerivedData/RWPickFlavor/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftmodule : /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/MultipartFormData.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Timeline.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Alamofire.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Response.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/TaskDelegate.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/SessionDelegate.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/ParameterEncoding.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Validation.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/ResponseSerialization.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/SessionManager.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/AFError.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Notifications.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Result.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Request.swift /Users/sergio.orozco/Documents/RWPickFlavor/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/sergio.orozco/Documents/RWPickFlavor/Pods/Headers/Public/Alamofire/Alamofire-umbrella.h /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Headers/Public/Alamofire/Alamofire.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sergio.orozco/Documents/RWPickFlavor/DerivedData/RWPickFlavor/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftdoc : /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/MultipartFormData.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Timeline.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Alamofire.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Response.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/TaskDelegate.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/SessionDelegate.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/ParameterEncoding.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Validation.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/ResponseSerialization.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/SessionManager.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/AFError.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Notifications.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Result.swift /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Alamofire/Source/Request.swift /Users/sergio.orozco/Documents/RWPickFlavor/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/sergio.orozco/Documents/RWPickFlavor/Pods/Headers/Public/Alamofire/Alamofire-umbrella.h /Users/sergio.orozco/Documents/RWPickFlavor/Pods/Headers/Public/Alamofire/Alamofire.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module mruby.hash;
import mruby.mrb_class;
import mruby.object;
import mruby.variable;
import mruby.value;
import mruby;
extern (C):
struct kh_ht;
struct RHash
{
enum mrb_vtype
{
MRB_TT_FALSE = 0,
MRB_TT_FREE = 1,
MRB_TT_TRUE = 2,
MRB_TT_FIXNUM = 3,
MRB_TT_SYMBOL = 4,
MRB_TT_UNDEF = 5,
MRB_TT_FLOAT = 6,
MRB_TT_CPTR = 7,
MRB_TT_OBJECT = 8,
MRB_TT_CLASS = 9,
MRB_TT_MODULE = 10,
MRB_TT_ICLASS = 11,
MRB_TT_SCLASS = 12,
MRB_TT_PROC = 13,
MRB_TT_ARRAY = 14,
MRB_TT_HASH = 15,
MRB_TT_STRING = 16,
MRB_TT_RANGE = 17,
MRB_TT_EXCEPTION = 18,
MRB_TT_FILE = 19,
MRB_TT_ENV = 20,
MRB_TT_DATA = 21,
MRB_TT_FIBER = 22,
MRB_TT_MAXDEFINE = 23
}
mrb_vtype tt;
uint color;
uint flags;
RClass* c;
RBasic* gcnext;
iv_tbl* iv;
kh_ht* ht;
}
mrb_value mrb_hash_new_capa (mrb_state*, int);
mrb_value mrb_hash_new (mrb_state* mrb);
void mrb_hash_set (mrb_state* mrb, mrb_value hash, mrb_value key, mrb_value val);
mrb_value mrb_hash_get (mrb_state* mrb, mrb_value hash, mrb_value key);
mrb_value mrb_hash_fetch (mrb_state* mrb, mrb_value hash, mrb_value key, mrb_value def);
mrb_value mrb_hash_delete_key (mrb_state* mrb, mrb_value hash, mrb_value key);
mrb_value mrb_hash_keys (mrb_state* mrb, mrb_value hash);
mrb_value mrb_check_hash_type (mrb_state* mrb, mrb_value hash);
mrb_value mrb_hash_empty_p (mrb_state* mrb, mrb_value self);
mrb_value mrb_hash_clear (mrb_state* mrb, mrb_value hash);
kh_ht* mrb_hash_tbl (mrb_state* mrb, mrb_value hash);
void mrb_gc_mark_hash (mrb_state*, RHash*);
size_t mrb_gc_mark_hash_size (mrb_state*, RHash*);
void mrb_gc_free_hash (mrb_state*, RHash*);
|
D
|
/*******************************************************************************
* Copyright (c) 2005, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwtx.jface.viewers.TreeNode;
import dwtx.jface.util.Util;
import dwt.dwthelper.utils;
/**
* A simple data structure that is useful for implemented tree models. This can
* be returned by
* {@link dwtx.jface.viewers.IStructuredContentProvider#getElements(Object)}.
* It allows simple delegation of methods from
* {@link dwtx.jface.viewers.ITreeContentProvider} such as
* {@link dwtx.jface.viewers.ITreeContentProvider#getChildren(Object)},
* {@link dwtx.jface.viewers.ITreeContentProvider#getParent(Object)} and
* {@link dwtx.jface.viewers.ITreeContentProvider#hasChildren(Object)}
*
* @since 3.2
*/
public class TreeNode {
/**
* The array of child tree nodes for this tree node. If there are no
* children, then this value may either by an empty array or
* <code>null</code>. There should be no <code>null</code> children in
* the array.
*/
private TreeNode[] children;
/**
* The parent tree node for this tree node. This value may be
* <code>null</code> if there is no parent.
*/
private TreeNode parent;
/**
* The value contained in this node. This value may be anything.
*/
protected Object value;
/**
* Constructs a new instance of <code>TreeNode</code>.
*
* @param value
* The value held by this node; may be anything.
*/
public this(Object value) {
this.value = value;
}
public override int opEquals(Object object) {
if ( auto tn = cast(TreeNode)object ) {
return Util.opEquals(this.value, tn.value);
}
return false;
}
/**
* Returns the child nodes. Empty arrays are converted to <code>null</code>
* before being returned.
*
* @return The child nodes; may be <code>null</code>, but never empty.
* There should be no <code>null</code> children in the array.
*/
public TreeNode[] getChildren() {
if (children !is null && children.length is 0) {
return null;
}
return children;
}
/**
* Returns the parent node.
*
* @return The parent node; may be <code>null</code> if there are no
* parent nodes.
*/
public TreeNode getParent() {
return parent;
}
/**
* Returns the value held by this node.
*
* @return The value; may be anything.
*/
public Object getValue() {
return value;
}
/**
* Returns whether the tree has any children.
*
* @return <code>true</code> if its array of children is not
* <code>null</code> and is non-empty; <code>false</code>
* otherwise.
*/
public bool hasChildren() {
return children !is null && children.length > 0;
}
public override hash_t toHash() {
return Util.toHash(value);
}
/**
* Sets the children for this node.
*
* @param children
* The child nodes; may be <code>null</code> or empty. There
* should be no <code>null</code> children in the array.
*/
public void setChildren(TreeNode[] children) {
this.children = children;
}
/**
* Sets the parent for this node.
*
* @param parent
* The parent node; may be <code>null</code>.
*/
public void setParent(TreeNode parent) {
this.parent = parent;
}
}
|
D
|
import std.stdio;
class DGC {
char[] data;
this(){
data = new char[2000];
}
}
void load_memory (){
DGC[100000] l;
foreach(i; 0..(l.length) ){
auto d = new DGC();
l[i] = d;
destroy(d);
}
}
void load_obj(){
auto d = new DGC();
}
void main() {
// load_memory();
foreach(i; 0..1000000) load_obj();
char[] buf;
stdin.readln(buf);
}
|
D
|
import std.string;
alias pos = sizediff_t;
alias Cell delegate(pos) GetCell;
alias void delegate(Cell, pos) SetCell;
enum Cell {
Unknown, // Must be initial value.
Fill,
Empty
}
class Position {
immutable pos x;
immutable pos y;
this(pos x, pos y) {
this.x = x;
this.y = y;
}
public override string toString() {
return format("(%d, %d)", x, y);
}
}
class ExclusiveException : Exception {
private pos x;
private pos y;
this(string message) {
super(message);
}
this(pos x, pos y, string message = "") {
super(format("%s@(%d, %d)", message, x, y));
this.x = x;
this.y = y;
}
this(Position at, string message="") {
this(at.x, at.y, message);
}
}
|
D
|
/Users/sales/Documents/XCTestDemo/build/UIKitCatalog.build/Debug-iphoneos/UIKitCatalog.build/Objects-normal/arm64/PickerViewController.o : /Users/sales/Documents/XCTestDemo/UIKitCatalog/UIColor+ApplicationSpecific.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/AppDelegate.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DatePickerController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/WebViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TextFieldViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchShowResultsInSourceViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ImageViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchControllerBaseViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SwitchViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/StackViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SegmentedControlViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/PageControlViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ButtonViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/CustomSearchBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DefaultSearchBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchBarEmbeddedInNavigationBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchPresentOverNavigationBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TintedToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/CustomToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DefaultToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SliderViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/PickerViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/AlertControllerViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/StepperViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ActivityIndicatorViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ProgressViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchResultsViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TextViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/sales/Documents/XCTestDemo/build/UIKitCatalog.build/Debug-iphoneos/UIKitCatalog.build/Objects-normal/arm64/PickerViewController~partial.swiftmodule : /Users/sales/Documents/XCTestDemo/UIKitCatalog/UIColor+ApplicationSpecific.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/AppDelegate.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DatePickerController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/WebViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TextFieldViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchShowResultsInSourceViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ImageViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchControllerBaseViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SwitchViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/StackViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SegmentedControlViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/PageControlViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ButtonViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/CustomSearchBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DefaultSearchBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchBarEmbeddedInNavigationBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchPresentOverNavigationBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TintedToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/CustomToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DefaultToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SliderViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/PickerViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/AlertControllerViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/StepperViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ActivityIndicatorViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ProgressViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchResultsViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TextViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/sales/Documents/XCTestDemo/build/UIKitCatalog.build/Debug-iphoneos/UIKitCatalog.build/Objects-normal/arm64/PickerViewController~partial.swiftdoc : /Users/sales/Documents/XCTestDemo/UIKitCatalog/UIColor+ApplicationSpecific.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/AppDelegate.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DatePickerController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/WebViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TextFieldViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchShowResultsInSourceViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ImageViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchControllerBaseViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SwitchViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/StackViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SegmentedControlViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/PageControlViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ButtonViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/CustomSearchBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DefaultSearchBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchBarEmbeddedInNavigationBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchPresentOverNavigationBarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TintedToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/CustomToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/DefaultToolbarViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SliderViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/PickerViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/AlertControllerViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/StepperViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ActivityIndicatorViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/ProgressViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/SearchResultsViewController.swift /Users/sales/Documents/XCTestDemo/UIKitCatalog/TextViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
import std.stdio;
import std.typecons;
import pegged.grammar;
mixin("enum GLSL_WIP = `" ~ import("GLSL_WIP.peg") ~ "`;");
mixin(grammar(GLSL_WIP));
alias Tuple!(string[], "tree", bool, "expected") TestCaseInfo;
// identifier
unittest
{
writeln("Running Identifier cases...");
TestCaseInfo[string] cases = [
"bool " : TestCaseInfo(["bool"], false),
"boolVar" : TestCaseInfo(["boolVar"], true),
"vec2bool" : TestCaseInfo(["vec2bool"], true),
"bool," : TestCaseInfo(["bool"], false),
"int" : TestCaseInfo(["int"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Identifier(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Floats
unittest
{
writeln("Running Float cases...");
TestCaseInfo[string] cases = [
"3.14" : TestCaseInfo(["3.14"], true),
"0.0.2" : TestCaseInfo(["0.0.2"], false),
".32" : TestCaseInfo([".32"], true),
"3.14f" : TestCaseInfo(["3.14f"], true),
"3.14F" : TestCaseInfo(["3.14F"], true),
"4e2" : TestCaseInfo(["4e2"], true),
"4.20e203" : TestCaseInfo(["4.20e203"], true),
"3e-2" : TestCaseInfo(["3e-2"], true),
"0.2" : TestCaseInfo(["0.2"], true),
"0.2 " : TestCaseInfo(["0.2"], true),
" 0.2" : TestCaseInfo(["0.2"], false),
"23" : TestCaseInfo(["23"], false),
"2e" : TestCaseInfo(["2e"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.FloatingLiteral(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Integers
unittest
{
writeln("Running Integer cases...");
TestCaseInfo[string] cases = [
"4" : TestCaseInfo(["4"], true),
"0030" : TestCaseInfo(["0030"], true),
"1" : TestCaseInfo(["1"], true),
"0x1353afd" : TestCaseInfo(["0x1353afd"], true),
"0X1353afd" : TestCaseInfo(["0X1353afd"], true),
"0X1245Q" : TestCaseInfo(["0X1245Q"], false),
"0123357" : TestCaseInfo(["0123357"], true),
"4u" : TestCaseInfo(["4u"], true),
"0x3512fadU" : TestCaseInfo(["0x3512fadU"], true),
"|" : TestCaseInfo(["|"], false),
"a" : TestCaseInfo(["a"], false),
"||" : TestCaseInfo(["||"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.IntegerLiteral(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// BoolLiteral
unittest
{
writeln("Running Bool cases...");
TestCaseInfo[string] cases = [
"true" : TestCaseInfo(["true"], true),
"false" : TestCaseInfo(["false"], true),
" bob" : TestCaseInfo(["bob"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.BooleanLiteral(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Postfix
unittest
{
writeln("Running Postfix cases...");
TestCaseInfo[string] cases = [
"1++" : TestCaseInfo(["1", "++"], true),
"1.0--" : TestCaseInfo(["1.0", "--"], true),
"arr[1]" : TestCaseInfo(["arr", "[", "1", "]"], true),
"arr[one()]" : TestCaseInfo(["arr", "[", "one", "(", ")", "]"], true),
"asdf.bob" : TestCaseInfo(["asdf", ".", "bob"], true),
"vec.bob" : TestCaseInfo(["vec", ".", "bob"], true),
"thing().bob " : TestCaseInfo(["thing", "(", ")", ".", "bob"], true),
"arr[1].bob" : TestCaseInfo(["arr", "[", "1", "]", ".", "bob"], true),
"bob.sue(1.0, true)" : TestCaseInfo(["bob", "," ,"sue", "(", "1.0", ",", "true", ")"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Postfix(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Prefix
unittest
{
writeln("Running Prefix cases...");
TestCaseInfo[string] cases = [
"!true" : TestCaseInfo(["!", "true"], true),
"-arr[0]" : TestCaseInfo(["-", "arr", "[", "0", "]"], true),
"!one(arr[1.0])" : TestCaseInfo(["!", "one", "(", "arr", "[", "1.0", "]", ")"], true),
"(true)" : TestCaseInfo(["(", "true", ")"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Prefix(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Multiplicative
unittest
{
writeln("Running Multiplicative cases...");
TestCaseInfo[string] cases = [
"1.0 * 4e2" : TestCaseInfo(["1.0", "*", "4e2"], true),
"arr[0] % bob()" : TestCaseInfo(["arr", "[", "0", "]", "%", "bob", "(", ")"], true),
"1 * 2 / 3 % 4" : TestCaseInfo(["1", "*", "2", "/", "3", "%", "4"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Multiplicative(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Additive
unittest
{
writeln("Running Additive cases...");
TestCaseInfo[string] cases = [
"1+2" : TestCaseInfo(["1", "+", "2"], true),
"1 +2 / 3" : TestCaseInfo(["1", "+", "2", "/", "3"] , true),
"1 - (arr[5])" : TestCaseInfo(["1", "-", "(", "arr", "[", "5", "]", ")"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Additive(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Shift
unittest
{
writeln("Running Shift cases...");
TestCaseInfo[string] cases = [
"1 << 2" : TestCaseInfo(["1", "<<", "2"], true),
"bob() >> 2 - 3" : TestCaseInfo(["bob", "(", ")", ">>", "2", "-", "3"], true),
"3 + - veec().bob" : TestCaseInfo(["3", "+", "-", "veec", "(", ")", ".", "bob"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Shift(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Relational Expression
unittest
{
writeln("Running Relational cases...");
TestCaseInfo[string] cases = [
"a > b" : TestCaseInfo(["a", ">", "b"], true),
"vec2() <= bool(1,2)" : TestCaseInfo(["vec2", "(", ")", "<=", "bool", "(", "1", ",", "2", ")"], true),
" 1 < 2 > 3" : TestCaseInfo(["1", "<", "2", ">", "3"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Relational(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Equality
unittest
{
writeln("Running Equality cases...");
TestCaseInfo[string] cases = [
"1 << 2 == 3" : TestCaseInfo(["1", "<<", "2", "==", "3"], true),
"+2 * vec2() != thing.bob" : TestCaseInfo(["+", "2", "*", "vec2",
"(", ")", "!=", "thing",
".", "bob"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Equality(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Bitwise Ops
unittest
{
writeln("Running BitwiseOps cases...");
TestCaseInfo[string] cases = [
"1 & 2 | 3 ^ 4" : TestCaseInfo(["1", "&", "2", "|", "3", "^", "4"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.BitwiseOr(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Logical Ops
unittest
{
writeln("Running LogicalOps cases...");
TestCaseInfo[string] cases = [
"bob || sue && tim ^^ b" : TestCaseInfo(["bob", "||", "sue", "&&", "tim", "^^", "b"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.LogicalOr(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Selection
unittest
{
writeln("Running Selection cases...");
TestCaseInfo[string] cases = [
"bob ? a : b" : TestCaseInfo(["bob", "?", "a", ":", "b"], true),
"3 ? 1 + 2 : vec2().x" : TestCaseInfo(["3", "?", "1", "+", "2", ":",
"vec2", "(", ")", ".", "x" ], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Selection(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// AssignmentOps
unittest
{
writeln("Running AssignmentOps cases...");
TestCaseInfo[string] cases = [
"bob = 1 + 2" : TestCaseInfo(["bob", "=", "1", "+", "2"], true),
"one &= 2" : TestCaseInfo(["one", "&=", "2"], true),
"it <<= a ? b : vec3()" : TestCaseInfo(["it", "<<=", "a", "?", "b", ":",
"vec3", "(", ")"], true),
"bob = {1}" : TestCaseInfo(["bob", "=", "{", "1", "}"], true),
"true || false = {1}" : TestCaseInfo(["true", "||", "false", "=", "{", "1", "}"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.AssignmentOps(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Intializer
unittest
{
writeln("Running Initializer cases...");
TestCaseInfo[string] cases = [
"{ 1, 2+3, 4=5, bob}" : TestCaseInfo(["{", "1", ",", "2", "+", "3",
",", "4", "=", "5", ",", "bob", "}"], true),
"{ { 1, 0}, { bob} }" : TestCaseInfo(["{", "{", "1", ",", "0", "}", ",", "{",
"bob", "}", "}"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.Initializer(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Storage Qualifiers
unittest
{
writeln("Running Storage Qualifier cases...");
TestCaseInfo[string] cases = [
"const" : TestCaseInfo(["const"], true),
"inout" : TestCaseInfo(["inout"], true),
"patch" : TestCaseInfo(["patch"], true),
"subroutine" : TestCaseInfo(["subroutine"], true),
"subroutine ( bob )" : TestCaseInfo(["subroutine", "(", "bob", ")"], true),
"subroutine(int, float, sue)" : TestCaseInfo(["subroutine", "(", "int", ",", "float", ",", "sue", ")"], false),
"subroutine( ) " : TestCaseInfo(["subroutine", "(", ")"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.StorageQualifier(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Layout Qualifiers
unittest
{
writeln("Running Layout Qualifier cases...");
TestCaseInfo[string] cases = [
"layout(bob)" : TestCaseInfo(["layout", "(", "bob", ")"], true),
"layout(location = 1)" : TestCaseInfo(["layout", "(", "location", "=", "1", ")"], true),
"layout()" : TestCaseInfo(["layout", "(", ")"], false),
"layout(a=1, b=2)" : TestCaseInfo(["layout", "(", "a", "=", "1", ",", "b", "=", "2", ")"], true),
"layout (int)" : TestCaseInfo(["layout", "(", "int", ")"], false),
"layout(a=1.2)" : TestCaseInfo(["layout", "(", "a", "=", "1.2", ")"], false),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.LayoutQualifier(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Function Call
unittest
{
writeln("Running Function Call cases...");
TestCaseInfo[string] cases = [
"bob()" : TestCaseInfo(["bob", "(", ")"], true),
"bob(void)" : TestCaseInfo(["bob", "(", "void", ")"], true),
"bob(bob(), bob(void))" : TestCaseInfo(["bob", "(", "bob", "(", ")", ",", "bob", "(", "void", ")", ")"], true),
"vec2(1.0, true)" : TestCaseInfo(["vec2", "(", "1.0", ",", "true", ")"], true),
"vec2(1.0, true" : TestCaseInfo(["vec2", "(", "1.0", ",", "true"], false),
"vec2 1.0, true)" : TestCaseInfo(["vec2", "1.0", ",", "true", ")"], false),
"vec2 (1.0, true)" : TestCaseInfo(["vec2", "(", "1.0", ",", "true", ")"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.FunctionCall(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// Parameter
unittest
{
writeln("Running Parameter cases...");
TestCaseInfo[string] cases = [
"int bob" : TestCaseInfo(["int", "bob"], true),
"int bob, int bob" : TestCaseInfo(["int", "bob", ",", "int", "bob"], true),
"int, int" : TestCaseInfo(["int", ",", "int"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.ParameterList(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
// FunctionPrototype
unittest
{
writeln("Running FunctionPrototype cases...");
TestCaseInfo[string] cases = [
"int bob()" : TestCaseInfo(["int", "bob", "(", ")"], true),
"vec2 thing(int one, vec2 two)" : TestCaseInfo(["vec2", "thing", "(", "int", "one", ",", "vec2", "two", ")"], true),
"float bob(int, float)" : TestCaseInfo(["float", "bob", "(", "int", ",", "float",")"], true),
"const uint sue(int, int bob)" : TestCaseInfo(["const", "uint", "sue", "(", "int", ",", "int", "bob", ")"], true),
];
foreach (testCase; cases.keys)
{
auto parseTree = GLSL.FunctionPrototype(testCase);
auto info = cases[testCase];
assert((parseTree.matches == info.tree) == info.expected, "Fail: " ~ testCase);
}
}
void main()
{
import std.string;
}
|
D
|
/*******************************************************************************
@file UnicodeFile.d
Copyright (c) 2004 Kris Bell
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for damages
of any kind arising from the use of this software.
Permission is hereby granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and/or
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment within documentation of
said product would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any distribution
of the source.
4. Derivative works are permitted, but they must carry this notice
in full and credit the original source.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@version Initial version; December 2005
@author Kris
*******************************************************************************/
module mango.io.UnicodeFile;
public import mango.io.FilePath;
public import mango.convert.Unicode;
private import mango.io.FileProxy,
mango.io.Exception,
mango.io.FileConduit;
private import mango.sys.ByteSwap;
private import mango.convert.UnicodeBom;
/*******************************************************************************
Read and write unicode files
For our purposes, unicode files are an encoding of textual material.
The goal of this module is to interface that external-encoding with
a programmer-defined internal-encoding. This internal encoding is
declared via the template argument T, whilst the external encoding
is either specified or derived.
Three internal encodings are supported: char, wchar, and dchar. The
methods herein operate upon arrays of this type. For example, read()
returns an array of the type, whilst write() and append() expect an
array of said type.
Supported external encodings are as follow (from Unicode.d):
Unicode.Unknown
Unicode.UTF_8
Unicode.UTF_8N
Unicode.UTF_16
Unicode.UTF_16BE
Unicode.UTF_16LE
Unicode.UTF_32
Unicode.UTF_32BE
Unicode.UTF_32LE
These can be divided into non-explicit and explicit encodings:
Unicode.Unknown
Unicode.UTF_8
Unicode.UTF_16
Unicode.UTF_32
Unicode.UTF_8N
Unicode.UTF_16BE
Unicode.UTF_16LE
Unicode.UTF_32BE
Unicode.UTF_32LE
The former group of non-explicit encodings may be used to 'discover'
an unknown encoding, by examining the first few bytes of the file
content for a signature. This signature is optional for all files,
but is often written such that the content is self-describing. When
the encoding is unknown, using one of the non-explicit encodings will
cause the read() method to look for a signature and adjust itself
accordingly. It is possible that a ZWNBSP character might be confused
with the signature; today's files are supposed to use the WORD-JOINER
character instead.
The group of explicit encodings are for use when the file encoding is
known. These *must* be used when writing or appending, since written
content must be in a known format. It should be noted that, during a
read operation, the presence of a signature is in conflict with these
explicit varieties.
Method read() returns the current content of the file, whilst write()
sets the file content, and file length, to the provided array. Method
append() adds content to the tail of the file. When appending, it is
your responsibility to ensure the existing and current encodings are
correctly matched.
Methods to inspect the file system, check the status of a file or
directory, and other facilities are made available via the FileProxy
superclass.
See
$(LINK http://www.utf-8.com/)
$(LINK http://www.hackcraft.net/xmlUnicode/)
$(LINK http://www.unicode.org/faq/utf_bom.html/)
$(LINK http://www.azillionmonkeys.com/qed/unicode.html/)
$(LINK http://icu.sourceforge.net/docs/papers/forms_of_unicode/)
*******************************************************************************/
class UnicodeFileT(T) : FileProxy
{
private UnicodeBomT!(T) unicode;
/***********************************************************************
Construct a UnicodeFile from the provided FilePath. The given
encoding represents the external file encoding, and should
be one of the Unicode.xx types
***********************************************************************/
this (FilePath path, int encoding)
{
super (path);
unicode = new UnicodeBomT!(T)(encoding);
}
/***********************************************************************
Construct a UnicodeFile from a text string. The provided
encoding represents the external file encoding, and should
be one of the Unicode.xx types
***********************************************************************/
this (char[] path, int encoding)
{
this (new FilePath(path), encoding);
}
/***********************************************************************
Return the current encoding. This is either the originally
specified encoding, or a derived one obtained by inspecting
the file content for a BOM. The latter is performed as part
of the read() method.
***********************************************************************/
int getEncoding ()
{
return unicode.getEncoding();
}
/***********************************************************************
Return the content of the file. The content is inspected
for a BOM signature, which is stripped. An exception is
thrown if a signature is present when, according to the
encoding type, it should not be. Conversely, An exception
is thrown if there is no known signature where the current
encoding expects one to be present.
***********************************************************************/
T[] read ()
{
auto conduit = new FileConduit (this);
try {
// allocate enough space for the entire file
auto content = new ubyte [conduit.length];
//read the content
if (conduit.read (content) != content.length)
throw new IOException ("unexpected eof");
return unicode.decode (content);
} finally {
conduit.close();
}
}
/***********************************************************************
Set the file content and length to reflect the given array.
The content will be encoded accordingly.
***********************************************************************/
UnicodeFileT write (T[] content, bool bom = false)
{
return write (content, FileStyle.ReadWriteCreate, bom);
}
/***********************************************************************
Append content to the file; the content will be encoded
accordingly.
Note that it is your responsibility to ensure the
existing and current encodings are correctly matched.
***********************************************************************/
UnicodeFileT append (T[] content)
{
return write (content, FileStyle.WriteAppending, false);
}
/***********************************************************************
Internal method to perform writing of content. Note that
the encoding must be of the explicit variety by the time
we get here.
***********************************************************************/
private final UnicodeFileT write (T[] content, FileStyle.Bits style, bool bom)
{
// convert to external representation
void[] converted = unicode.encode (content);
// open file after conversion ~ in case of exceptions
scope FileConduit conduit = new FileConduit (this, style);
try {
if (bom)
conduit.flush (unicode.getSignature);
// and write
conduit.flush (converted);
} finally {
conduit.close();
}
return this;
}
}
// convenience aliases
alias UnicodeFileT!(char) UnicodeFile;
|
D
|
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.build/Terminal/ANSI.swift.o : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Console.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.build/Terminal/ANSI~partial.swiftmodule : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Console.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.build/Terminal/ANSI~partial.swiftdoc : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Console.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module hunt.imf.ConnectionEventBaseHandler;
import hunt.net;
import hunt.imf.ConnectBase;
class ConnectionEventBaseHandler : ConnectionEventHandler
{
alias ConnCallBack = void delegate( ConnectBase connection);
alias MsgCallBack = void delegate(Connection connection ,Object message);
override
void connectionOpened(Connection connection) {}
override
void connectionClosed(Connection connection) {}
override
void messageReceived(Connection connection, Object message) {}
override
void exceptionCaught(Connection connection, Throwable t) {}
override
void failedOpeningConnection(int connectionId, Throwable t) { }
override
void failedAcceptingConnection(int connectionId, Throwable t) { }
void setOnConnection(ConnCallBack callback)
{
}
void setOnClosed(ConnCallBack callback)
{
}
void setOnMessage(MsgCallBack callback)
{
}
}
|
D
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_All_agm-2215144439.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_All_agm-2215144439.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
// auto-generated HCL2 simulator; DO NOT EDIT THIS FILE
/+++++++++++++++++ generated from the following HCL: ++++++++++++++++++
###################### begin builtin signals ##########################
### constants:
const STAT_BUB = 0b000, STAT_AOK = 0b001, STAT_HLT = 0b010; # expected behavior
const STAT_ADR = 0b011, STAT_INS = 0b100, STAT_PIP = 0b110; # error conditions
const REG_RAX = 0b0000, REG_RCX = 0b0001, REG_RDX = 0b0010, REG_RBX = 0b0011;
const REG_RSP = 0b0100, REG_RBP = 0b0101, REG_RSI = 0b0110, REG_RDI = 0b0111;
const REG_R8 = 0b1000, REG_R9 = 0b1001, REG_R10 = 0b1010, REG_R11 = 0b1011;
const REG_R12 = 0b1100, REG_R13 = 0b1101, REG_R14 = 0b1110, REG_NONE= 0b1111;
# icodes; see figure 4.2
const HALT = 0b0000, NOP = 0b0001, RRMOVQ = 0b0010, IRMOVQ = 0b0011;
const RMMOVQ = 0b0100, MRMOVQ = 0b0101, OPQ = 0b0110, JXX = 0b0111;
const CALL = 0b1000, RET = 0b1001, PUSHQ = 0b1010, POPQ = 0b1011;
const CMOVXX = RRMOVQ;
# ifuns; see figure 4.3
const ALWAYS = 0b0000, LE = 0b0001, LT = 0b0010, EQ = 0b0011;
const NE = 0b0100, GE = 0b0101, GT = 0b0110;
const ADDQ = 0b0000, SUBQ = 0b0001, ANDQ = 0b0010, XORQ = 0b0011;
### fixed-functionality inputs (things you should assign to in your HCL)
wire Stat:3; # should be one of the STAT_... constants
wire pc:64; # put the address of the next instruction into this
wire reg_srcA:4, reg_srcB:4; # use to pick which program registers to read from
wire reg_dstE:4, reg_dstM:4; # use to pick which program registers to write to
wire reg_inputE:64, reg_inputM:64; # use to provide values to write to program registers
wire mem_writebit:1, mem_readbit:1; # set at most one of these two to 1 to access memory
wire mem_addr:64; # if accessing memory, put the address accessed here
wire mem_input:64; # if writing to memory, put the value to write here
### fixed-functionality outputs (things you should use but not assign to)
wire i10bytes:80; # output value of instruction read; linked to pc
wire reg_outputA:64, reg_outputB:64; # values from registers; linked to reg_srcA and reg_srcB
wire mem_output:64; # value read from memory; linked to mem_readbit and mem_addr
####################### end builtin signals ###########################
/* Neha Telhan (nt7ab) */
# An example file in our custom HCL variant, with lots of comments
register pP {
# our own internal register. P_pc is its output, p_pc is its input.
pc:64 = 0; # 64-bits wide; 0 is its default value.
# we could add other registers to the P register bank
# register bank should be a lower-case letter and an upper-case letter, in that order.
# there are also two other signals we can optionally use:
# "bubble_P = true" resets every register in P to its default value
# "stall_P = true" causes P_pc not to change, ignoring p_pc's value
}
# "pc" is a pre-defined input to the instruction memory and is the
# address to fetch 6 bytes from (into pre-defined output "i6bytes").
pc = P_pc;
# we can define our own input/output "wires" of any number of 0<bits<=80
wire opcode:8, icode:4, increment:64;
# the x[i..j] means "just the bits between i and j". x[0..1] is the
# low-order bit, similar to what the c code "x&1" does; "x&7" is x[0..3]
opcode = i10bytes[0..8]; # first byte read from instruction memory
icode = opcode[4..8]; # top nibble of that byte
/* we could also have done i10bytes[4..8] directly, but I wanted to
* demonstrate more bit slicing... and all 3 kinds of comments */
// this is the third kind of comment
# named constants can help make code readable
const TOO_BIG = 0xC; # the first unused icode in Y86-64
# some named constants are built-in: the icodes, ifuns, STAT_??? and REG_???
# Stat is a built-in output; STAT_HLT means "stop", STAT_AOK means
# "continue". The following uses the mux syntax described in the
# textbook
Stat = [
icode == JXX : STAT_INS;
icode == CALL : STAT_INS;
icode == RET : STAT_INS;
icode == HALT : STAT_HLT;
1 : STAT_AOK;
];
#you will need to change it so that uses a mux to select what number is added to pc.
#Note: you cannot use a mux as an operand to a mathematical operator like +, so either# put the addition inside the mux or store the added variable in a new wire.This will set the value of the wire 'Increment' to the appropriate integer to add to the PC.
increment = [
(icode in {HALT, NOP, RET}) : 1;
(icode in {RRMOVQ, OPQ, CMOVXX, PUSHQ, POPQ}) : 2;
(icode in {IRMOVQ, RMMOVQ, MRMOVQ}) : 10;
(icode in {JXX, CALL}) : 9;
1 : 10;
];
/* I used the textbook page 357 to get the proper increment amounts for each unique opcode*/
p_pc = P_pc + increment;
++++++++++++++++++ generated from the preceeding HCL ++++++++++++++++++/
/////////////////////// int type bigger than long ///////////////////
private template negOneList(uint length) {
static if (length == 1) enum negOneList = "-1";
else enum negOneList = negOneList!(length-1)~", -1";
}
struct bvec(uint bits) if (bits != 0) {
static enum words = (bits+31)/32;
static enum min = bvec.init;
mixin("static enum max = bvec(["~negOneList!words~"]);");
uint[words] data;
ubyte *data_bytes() { return cast(ubyte*)&(this.data[0]); }
this(uint x) { data[0] = x; truncate; }
this(ulong x) { data[0] = cast(uint)x; static if (words > 1) data[1] = cast(uint)(x>>32); truncate; }
this(uint[] dat) { this.data[] = dat[]; truncate; }
this(uint o)(bvec!o x) if (o < bits) { data[0..x.words] = x.data[]; truncate; }
this(uint o)(bvec!o x) if (o > bits) { data[] = x.data[0..words]; truncate; }
ref bvec opAssign(uint x) { data[0] = x; static if(words > 1) data[1..$] = 0; return truncate; }
ref bvec opAssign(ulong x) { data[0] = cast(uint)x; static if (words > 1) data[1] = cast(uint)(x>>32); static if(words > 2) data[2..$] = 0; return truncate; }
ref bvec opAssign(uint[] dat) { this.data[] = dat[]; return truncate; }
ref bvec opAssign(uint o)(bvec!o x) if (o < bits) { data[0..x.words] = x.data[]; static if (x.words < words) data[x.words..$] = 0; return truncate; }
ref bvec opAssign(uint o)(bvec!o x) if (o > bits) { data[] = x.data[0..words]; return truncate; }
ref bvec truncate() {
static if ((bits&31) != 0) {
data[$-1] &= 0xffffffffU >> (32-(bits&31));
}
return this;
}
bvec!(bits+b1) cat(uint b2)(bvec!b2 other) {
bvec!(bits+b1) ans;
foreach(i,v; data) ans.data[i] = v;
static if ((bits&31) == 0) {
foreach(i,v; other.data) ans.data[i+words] = v;
} else {
foreach(i,v; other.data) {
ans.data[i+words-1] |= (v<<(bits&31));
if (i+words < ans.words) ans.data[i+words] = (v>>(32-(bits&31)));
}
}
return ans;
}
bvec!(e-s) slice(uint s, uint e)() if (s <= e && e <= bits) {
bvec!(e-s) ans;
static if ((s&31) == 0) {
ans.data[] = data[s/32 .. s/32+ans.words];
} else {
foreach(i; s/32..((e-s)+31)/32) {
ans.data[i-s/32] = data[i]>>(s&31);
if(i > s/32) ans.data[i-s/32-1] |= data[i]<<(32-(s&31));
}
}
return ans.truncate;
}
string hex() {
import std.format, std.range;
static if (words > 0) {
return format("%0"~format("%d",((bits&31)+3)/4)~"x%(%08x%)", data[$-1], retro(data[0..$-1]));
} else {
return format("%0"~format("%d",(bits+3)/4)~"x", data[0]);
}
}
string smallhex() {
auto ans = hex;
while (ans.length > 1 && ans[0] == '0') ans = ans[1..$];
return ans;
}
version (BigEndian) {
pragma(msg, "hexbytes not implemented on big endian hardware");
} else {
string hexbytes() {
import std.format;
return format("%(%02x%| %)", data_bytes[0..((bits+7)/8)]);
}
}
string toString() {
return "0x"~smallhex;
}
string bin() {
import std.format, std.range;
ubyte[words*4] tmp = *(cast(ubyte[words*4]*)&data);
static if (bits <= 8) {
return format("%0"~format("%d",bits)~"b", tmp[0]);
} else static if ((bits&7) != 0) {
return format("%0"~format("%d",bits&7)~"b_%(%08b%|_%)", tmp[(bits-1)/8], retro(tmp[0..(bits-1)/8]));
} else {
return format("%(%08b%|_%)", retro(tmp[0..bits/8]));
}
}
static bvec hex(string s)
in {
assert(s.length <= (bits+3)/4, "too many hex digits for this type");
foreach(c; s) assert((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'), "expected a raw hex string");
if (s.length > bits/4) assert(s[0]-'0' < (1<<(bits&3)), "most-significant digit too big for this type");
} body {
uint place = 0, shift = 0;
bvec ans;
foreach_reverse(c; s) {
uint val = c - (c < 'Z' ? c < 'A' ? '0' : 'A'-10 : 'a'-10);
ans.data[place] |= shift ? val<<shift : val;
shift += 4;
place += shift>=32;
shift &= 31;
}
return ans; // no need to truncate; the in conditions take care of that
}
bool getBit(uint i) pure nothrow {
return i >= bits ? false
: ((0==(i&31)) ? data[i/32]&1 : data[i/32]&(1<<(i&31))) != 0;
}
ref bvec setBit(uint i, bool v) pure nothrow
in { assert(i < bits, "illegal bit index"); }
body {
if (v) if (0==(i&31)) data[i/32]|=1;
else data[i/32]|=(1<<(i&31));
else if (0==(i&31)) data[i/32]&=~1;
else data[i/32]&=~(1<<(i&31));
return this;
}
int opCmp(T)(T x) if (is(T : uint)) {
foreach(i; 1..data.length) if (data[i] != 0) return 1;
return data[0] < x ? -1 : data[0] == x ? 0 : 1;
}
int opCmp(uint b2)(bvec!b2 x) {
static if (x.words == words) {
foreach_reverse(i; 0..x.words) if (data[i] != x.data[i]) return data[i] < x.data[i] ? -1 : 1;
return 0;
} else static if (x.words < words) {
foreach(i; x.words..words) if (data[i] != 0) return 1;
foreach_reverse(i; 0..x.words) if (data[i] != x.data[i]) return data[i] < x.data[i] ? -1 : 1;
return 0;
} else {
foreach(i; words..x.words) if (x.data[i] != 0) return -1;
foreach_reverse(i; 0..words) if (data[i] != x.data[i]) return data[i] < x.data[i] ? -1 : 1;
return 0;
}
}
bool opEquals(T)(T x) { return this.opCmp(x) == 0; }
T opCast(T)() if (is(T == bool)) { return opCmp!uint(0) != 0; }
T opCast(T)() if (is(T == ulong)) {
static if (words > 1) return ((cast(ulong)data[1])<<32) | data[0];
return data[0];
}
T opCast(T)() if (is(T == uint)) { return data[0]; }
ref bvec opOpAssign(string op)(bvec s) pure nothrow if (op == "<<" || op == ">>") {
if (s >= bits) data[] = 0;
return this.opOpAssign!s(data[0]);
}
ref bvec opOpAssign(string op)(ulong s) pure nothrow if (op == "<<" || op == ">>") {
return opOpAssign!op(cast(uint)s);
}
ref bvec opOpAssign(string op)(uint s) pure nothrow if (op == "<<") {
if (s >= bits) data[] = 0;
else {
if (s >= 32) {
auto ds = s/32;
s &= 31;
data[ds..$] = data[0..$-ds].dup;
data[0..ds] = 0;
}
if (s != 0)
foreach_reverse(i; 0..words)
data[i] = (data[i]<<s) | (i > 0 ? data[i-1]>>(32-s) : 0);
}
return this.truncate;
}
ref bvec opOpAssign(string op)(uint s) pure nothrow if (op == ">>") {
if (s >= bits) data[] = 0;
else {
if (s >= 32) {
auto ds = s/32;
s &= 31;
data[0..$-ds] = data[ds..$].dup;
data[$-ds..$] = 0;
}
if (s != 0)
foreach(i; 0..words)
data[i] = (data[i]>>s) | (i+1 < data.length ? data[i+1]<<(32-s) : 0);
}
return this.truncate;
}
ref bvec opOpAssign(string op)(bvec x) pure nothrow if (op == "&" || op == "|" || op == "^") {
foreach(i,ref v; this.data) mixin("v "~op~"= x.data[i];");
return this.truncate;
}
ref bvec opOpAssign(string s)(bvec x) pure nothrow if (s == "+" || s == "-") {
ulong carry = s == "+" ? 0 : 1;
foreach(i, ref v; data) {
carry += v;
carry += s == "+" ? x.data[i] : ~x.data[i];
v = cast(uint)carry;
carry >>= 32;
}
return this.truncate;
}
ref bvec opOpAssign(string op)(bvec x) pure nothrow if (op == "*") {
bvec ans;
ulong carry = 0;
foreach(digit; 0..words) {
ulong accum = carry&uint.max;
carry >>= 32;
foreach(i; 0..digit+1) {
ulong tmp = data[i] * cast(ulong)x.data[digit-i];
accum += tmp&uint.max;
carry += tmp>>32;
}
ans.data[digit] = cast(uint)accum;
carry += accum>>32;
}
this.data[] = ans.data[];
return this.truncate;
}
ref bvec opOpAssign(string s)(bvec div) pure nothrow if (s == "/" || s == "%") {
import std.stdio;
bvec rem = this;
bvec num;
uint place = 0;
while (div < rem && !div.getBit(bits-1)) { place += 1; div <<= 1; }
while (true) {
if (rem >= div) {
num.setBit(place, true);
rem -= div;
}
if (place == 0) break;
div >>= 1;
place -= 1;
}
static if (s == "/") this.data[] = num.data[];
else this.data[] = rem.data[];
return this;
}
ref bvec opOpAssign(string s)(ulong x) pure nothrow if (s != "<<" && s != ">>") {
return this.opOpAssign!s(bvec(x));
}
ref bvec opOpAssign(string s)(uint x) pure nothrow if (s != "<<" && s != ">>") {
return this.opOpAssign!s(bvec(x));
}
bvec opUnary(string s)() pure nothrow if (s == "~") {
bvec ans = this;
foreach(i,ref v; ans.data) v ^= max.data[i];
return ans;
}
bvec opUnary(string s)() pure nothrow if (s == "-") { bvec ans; ans -= this; return ans; }
bvec opBinary(string op, T)(T x) if (__traits(compiles, this.opOpAssign!op(x))) {
bvec ans = this; return ans.opOpAssign!op(x);
}
}
unittest { bvec!10 x = [-1]; assert(x.data[0] == 0x3ff,"expected 0x3ff"); }
unittest { bvec!40 x = [-1,-1]; assert(x.data == [0xffffffffU,0xffu]); }
unittest { bvec!64 x = [-1,-1]; assert(x.data == [0xffffffffU,0xffffffffu]); }
unittest {
bvec!35 x = [0x40000000,0x2];
assert((x>>1).data == [0x20000000,0x1]);
assert((x<<1).data == [0x80000000,0x4]);
assert((x<<2).data == [0x00000000,0x1]);
}
unittest {
bvec!128 x = [0x4,0x40000000,0x2, 0x4];
assert((x<<33).data == [0,0x8,0x80000000,0x4]);
assert((x>>33).data == [0x20000000,0x1,0x2,0]);
}alias bvec!80 ulonger;
/////////////////////////// register file ///////////////////////////
ulong[15] __regfile = [0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0];
////////////////////////////// memory ///////////////////////////////
ubyte[ulong] __memory;
bool __can_read_imem(ulong mem_addr) { return mem_addr < ulong.max-10; }
bool __can_read_dmem(ulong mem_addr) { return mem_addr < ulong.max-8; }
bool __can_write_dmem(ulong mem_addr) { return mem_addr < ulong.max-8; }
ubyte[] __read_bytes(ulong baseAddr, uint bytes) {
ubyte[] ans = new ubyte[bytes];
foreach_reverse(i; 0..bytes) {
if ((baseAddr + i) in __memory) ans[i] = __memory[baseAddr+i];
else ans[i] = 0;
}
return ans;
}
ulong __asUlong(ubyte[] arg) {
ulong ans = 0;
foreach_reverse(i; 0..8) if (i < arg.length) {
ans <<= 8;
ans |= arg[i];
}
return ans;
}
ulonger __asUlonger(ubyte[] arg) {
ulonger ans = 0;
foreach_reverse(i; 0..10) if (i < arg.length) {
ans <<= 8;
ans |= arg[i];
}
return ans;
}
void __write_bytes(ulong baseAddr, ulong value, uint bytes) {
foreach(i; 0..bytes) {
__memory[baseAddr+i] = cast(ubyte)value;
value >>= 8;
}
}
ulonger __read_imem(ulong mem_addr) { return __asUlonger(__read_bytes(mem_addr, 10)); }
ulong __read_dmem(ulong mem_addr) { return __asUlong(__read_bytes(mem_addr, 8)); }
void __write_dmem(ulong mem_addr, ulong value) { __write_bytes(mem_addr, value, 8); }
//////////////// pipeline registers' initial values ////////////////
// register bank P:
bool _HCL_bubble_P = false;
bool _HCL_stall_P = false;
ulong _HCL_P_pc = 0;
////////////////////////// disassembler /////////////////////////////
enum RNAMES = [ "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
"%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "none"];
enum OPNAMES = [ "addq", "subq", "andq", "xorq", "op4", "op5", "op6", "op7",
"op8", "op9", "op10", "op11", "op12", "op13", "op14", "op15"];
enum JMPNAMES = [ "jmp", "jle", "jl", "je", "jne", "jge", "jg", "jXX",
"jXX", "jXX", "jXX", "jXX", "jXX", "jXX", "jXX", "jXX"];
enum RRMOVQNAMES = [ "rrmovq", "cmovle", "cmovl", "cmove", "cmovne", "cmovge", "cmovg", "cmovXX",
"cmovXX", "cmovXX", "cmovXX", "cmovXX", "cmovXX", "cmovXX", "cmovXX", "cmovXX"];
string disas(ulonger i10bytes) {
auto b = i10bytes.data_bytes;
auto s = i10bytes.hexbytes;
switch((i10bytes.data[0]&0xf0)>>4) {
case 0 : return s[0..3*1-1]~" : halt";
case 1 : return s[0..3*1-1]~" : nop";
case 2 : return s[0..3*2-1]~" : "~RRMOVQNAMES[b[0]&0xf]~" "~RNAMES[(b[1]>>4)&0xf]~", "~RNAMES[b[1]&0xf];
case 3 : return s[0..3*10-1]~" : irmovq $0x"~(i10bytes.slice!(16,80).smallhex)~", "~RNAMES[b[1]&0xf];
case 4 : return s[0..3*10-1]~" : rmmovq "~RNAMES[(b[1]>>4)&0xf]~", 0x"~(i10bytes.slice!(16,80).smallhex)~"("~RNAMES[b[1]&0xf]~")";
case 5 : return s[0..3*10-1]~" : mrmovq 0x"~(i10bytes.slice!(16,80).smallhex)~"("~RNAMES[b[1]&0xf]~"), "~RNAMES[(b[1]>>4)&0xf];
case 6 : return s[0..3*2-1]~" : "~OPNAMES[b[0]&0xf]~" "~RNAMES[(b[1]>>4)&0xf]~", "~RNAMES[b[1]&0xf];
case 7 : return s[0..3*9-1]~" : "~JMPNAMES[b[0]&0xf]~" 0x"~(i10bytes.slice!(8,72).smallhex);
case 8 : return s[0..3*9-1]~" : call 0x"~(i10bytes.slice!(8,72).smallhex);
case 9 : return s[0..3*1-1]~" : ret";
case 10 : return s[0..3*2-1]~" : pushq "~RNAMES[(b[1]>>4)&0xf];
case 11 : return s[0..3*2-1]~" : popq "~RNAMES[(b[1]>>4)&0xf];
default: return "unknown operation";
}
}
////////////////////////// update cycle /////////////////////////////
int tick(bool showpc=true, bool showall=false) {
ulong _HCL_pc = _HCL_P_pc;
_HCL_pc &= 0xffffffffffffffff;
if (showall) writefln("set pc to 0x%x",_HCL_pc);
ulonger _HCL_i10bytes = __read_imem(_HCL_pc);
if (showpc) writef(`pc = 0x%x; `, _HCL_pc);
if (showall || showpc) writefln(`loaded [%s]`, disas(_HCL_i10bytes));
ulong _HCL_opcode = cast(ulong)(((_HCL_i10bytes)>>0UL)&0xff);
_HCL_opcode &= 0xff;
if (showall) writefln("set opcode to 0x%x",_HCL_opcode);
ulong _HCL_icode = cast(ulong)(((_HCL_opcode)>>4UL)&0xf);
_HCL_icode &= 0xf;
if (showall) writefln("set icode to 0x%x",_HCL_icode);
ulong _HCL_Stat = (((_HCL_icode)==(7)) ? (4) :
((_HCL_icode)==(8)) ? (4) :
((_HCL_icode)==(9)) ? (4) :
((_HCL_icode)==(0)) ? (2) :
(1));
_HCL_Stat &= 0x7;
if (showall) writefln("set Stat to 0x%x",_HCL_Stat);
ulong _HCL_increment = (((((((_HCL_icode)==(0)))||(((_HCL_icode)==(1))))||(((_HCL_icode)==(9))))) ? (1UL) :
((((((((_HCL_icode)==(2)))||(((_HCL_icode)==(6))))||(((_HCL_icode)==(2))))||(((_HCL_icode)==(10))))||(((_HCL_icode)==(11))))) ? (2UL) :
((((((_HCL_icode)==(3)))||(((_HCL_icode)==(4))))||(((_HCL_icode)==(5))))) ? (10UL) :
(((((_HCL_icode)==(7)))||(((_HCL_icode)==(8))))) ? (9UL) :
(10UL));
_HCL_increment &= 0xffffffffffffffff;
if (showall) writefln("set increment to 0x%x",_HCL_increment);
ulong _HCL_p_pc = (_HCL_P_pc)+(_HCL_increment);
_HCL_p_pc &= 0xffffffffffffffff;
if (showall) writefln("set p_pc to 0x%x",_HCL_p_pc);
// rising clock edge: lock register writes
if (_HCL_bubble_P) _HCL_P_pc = 0;
else if (!_HCL_stall_P) _HCL_P_pc = _HCL_p_pc;
pragma(msg,`INFO: did not specify mem_readbit/mem_writebit; disabling data memory`);
pragma(msg,`INFO: did not specify reg_srcA; disabling register read port A`);
pragma(msg,`INFO: did not specify reg_srcB; disabling register read port B`);
pragma(msg,`INFO: did not specify reg_dstE; disabling register write port E`);
pragma(msg,`INFO: did not specify reg_dstM; disabling register write port M`);
return cast(int)_HCL_Stat;
}
pragma(msg,`Estimated clock delay: 56`);
enum tpt = 56;
import std.stdio, std.file, std.string, std.conv, std.algorithm;
int main(string[] args) {
bool verbose = true;
bool pause = false;
bool showall = false;
uint maxsteps = 10000;
string fname;
foreach(a; args[1..$]) {
if (a == "-i" || a == "--interactive") pause = true;
else if (a == "-d" || a == "--debug" ) showall = true;
else if (a == "-q" || a == "--quiet" ) verbose = false;
else if (exists(a)) {
if (fname.length > 0)
writeln("WARNING: multiple files; ignoring \"",a,"\" in preference of \"",fname,"\"");
else
fname = a;
} else if (a[0] > '0' && a[0] <= '9') {
maxsteps = to!uint(a);
} else {
writeln("ERROR: unexpected argument \"",a,"\"");
return 1;
}
}
if (showall && !verbose) {
writeln("ERROR: cannot be in both quiet and debug mode");
return 2;
}
if (fname.length == 0) {
writeln("USAGE: ",args[0]," [options] somefile.yo");
writeln("Options:");
writefln(" [a number] : time out after that many steps (default: %d)",maxsteps);
writeln(" -i --interactive : pause every clock cycle");
writeln(" -q --quiet : only show final state");
writeln(" -d --debug : show every action during simulation");
return 3;
}
// load .yo input
auto f = File(fname,"r");
foreach(string line; lines(f)) {
// each line is 0xaddress : hex data | junk, or just junk
// fixed width:
// 01234567890123456789012345678...
// 0x000: 30f40001000000000000 | irmovq $0x100,%rsp # Initialize stack pointer
if (line[0..2] == "0x") {
auto address = to!uint(line[2..5], 16);
auto datas = line[7..27].strip;
for(uint i=0; i < datas.length; i += 2) {
__memory[address+(i>>1)] = to!ubyte(datas[i..i+2],16);
}
}
}
void dumpstate() {
writefln("| RAX: % 16x RCX: % 16x RDX: % 16x |", __regfile[0], __regfile[1], __regfile[2]);
writefln("| RBX: % 16x RSP: % 16x RBP: % 16x |", __regfile[3], __regfile[4], __regfile[5]);
writefln("| RSI: % 16x RDI: % 16x R8: % 16x |", __regfile[6], __regfile[7], __regfile[8]);
writefln("| R9: % 16x R10: % 16x R11: % 16x |", __regfile[9], __regfile[10], __regfile[11]);
writefln("| R12: % 16x R13: % 16x R14: % 16x |", __regfile[12], __regfile[13], __regfile[14]);
write(`| register pP(`,(_HCL_bubble_P?'B':_HCL_stall_P?'S':'N'));
writefln(`) { pc=%016x } |`, _HCL_P_pc);
auto set = __memory.keys; sort(set);
writeln("| used memory: _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f |");
ulong last = 0;
foreach(a; set) {
if (a >= last) {
last = ((a>>4)<<4);
writef("| 0x%07x_: ", last>>4);
foreach(j; 0..16) {
if (last+j in __memory) { writef(" %02x", __memory[last+j]); }
else write(" ");
if (j == 7) write(" ");
if (j == 3 || j == 11) write(" ");
}
writeln(" |");
if (last + 16 < last) break;
last += 16;
}
}
}
// loop, possibly pausing
foreach(i; 0..maxsteps) {
if (verbose) {
writefln("+------------------- between cycles %4d and %4d ----------------------+", i, i+1);
dumpstate();
writeln("+-----------------------------------------------------------------------+");
if (pause) {
write("(press enter to continue)");
stdin.readln();
}
}
auto code = tick(verbose, showall);
if (code == 2) {
writeln("+----------------------- halted in state: ------------------------------+");
dumpstate();
writeln("+--------------------- (end of halted state) ---------------------------+");
writeln("Cycles run: ",i+1);
writeln("Time used: ", (i+1)*tpt);
return 0;
}
if (code > 2) {
writeln("+------------------- error caused in state: ----------------------------+");
dumpstate();
writeln("+-------------------- (end of error state) -----------------------------+");
writeln("Cycles run: ",i+1);
writeln("Time used: ", (i+1)*tpt);
write("Error code: ", code);
if (code < 6) writeln(" (", ["Bubble","OK","Halt","Invalid Address", "Invalid Instruction", "Pipeline Error"][code],")");
else writeln(" (user-defined status code)");
return 0;
}
}
writefln("+------------ timed out after %5d cycles in state: -------------------+", maxsteps);
dumpstate();
writeln("+-----------------------------------------------------------------------+");
return 0;
}
|
D
|
/**
* Authors: Steve Teale - steve.teale@britseyeview.com
*
* Date: 2007/05/19
* History: V0.1
* License: Use freely for any purpose.
*
* This is an example of a service built on class ServiceImplementation.
*/
module bevutils.beepservice;
import std.stdio;
import std.c.windows.windows;
import bevutils.log4d;
import bevutils.eventlogger;
import bevutils.propertyfile;
import bevutils.servicebase;
import bevutils.serviceimplementation;
extern (Windows)
{
BOOL Beep(DWORD dwFreq, DWORD dwDuration);
}
/++
+ To implement the service you must implement one or more classes derived from interface WorkerThread
+ and a class derived from ServiceImplementation.
+ You must also provide a stereotyped version of main().
+
+ ------------------------------------------------------
class BeepWorker : WorkerThread
{
Log4D _log;
ServiceImplementation _si;
EventLogger _elog;
PropertyFile _props;
uint _frequency;
uint _duration;
this(uint freq, uint dur)
{
_frequency = freq;
_duration = dur;
}
void setLog(Log4D log) { _log = log; }
void setHost(ServiceImplementation si) { _si = si; }
void setProperties(PropertyFile pf) { _props = pf; }
void setEventLogger(EventLogger el) { _elog = el; }
char[] threadName() { return "Beeper"; }
int threadProc()
{
for (;;)
{
Beep(_frequency, _duration);
_log.logMessage("INFO", "Beeped");
for (int i = 0; i < 20; i++)
{
Sleep(500);
if (_si.StopFlag)
{
_log.logMessage("INFO", "Beeper stopping");
return 0;
}
}
}
return 0;
}
}
class BeepService : ServiceImplementation
{
this()
{
super("Beeper", "BPR");
}
public WorkerThread getThreadImpl(int n)
{
if (n == 0)
return new BeepWorker(200, 500);
else
return new BeepWorker(650, 200);
}
}
void main(char[][] args)
{
try
{
ServiceImplementation si = new BeepService();
ServiceBase.implementMain(args);
}
catch (Exception ex)
{
writefln(ex.toString());
}
}
+ ------------------------------------------------------
+/
class BeepWorker : WorkerThread
{
Log4D _log;
ServiceImplementation _si;
EventLogger _elog;
PropertyFile _props;
uint _frequency;
uint _duration;
this(uint freq, uint dur)
{
_frequency = freq;
_duration = dur;
}
void setLog(Log4D log) { _log = log; }
void setHost(ServiceImplementation si) { _si = si; }
void setProperties(PropertyFile pf) { _props = pf; }
void setEventLogger(EventLogger el) { _elog = el; }
char[] threadName() { return "Beeper"; }
int threadProc()
{
for (;;)
{
Beep(_frequency, _duration);
_log.logMessage("INFO", "Beeped");
for (int i = 0; i < 20; i++)
{
Sleep(500);
if (_si.StopFlag)
{
_log.logMessage("INFO", "Beeper stopping");
return 0;
}
}
}
return 0;
}
}
/**
* You must also override class ServiceImplementation to provide appropriate
* information to its constructor, and to provide an implementation for
* getThreadImpl.
*/
class BeepService : ServiceImplementation
{
this()
{
super("Beeper", "BPR");
}
public WorkerThread getThreadImpl(int n)
{
if (n == 0)
return new BeepWorker(200, 500);
else
return new BeepWorker(650, 200);
}
}
/**
* Main is completely stereotyped.
*
* The properties file for this service should be as follows:
* ---------------------------------------------------------
* <?xml version="1.0" ?>
* <Properties layout="1">
* <logpath type="string">d:\logs</logpath>
* <numlogs type="int">10</numlogs>
* <maxlogsize type="int">1000000</maxlogsize>
* <threads type="int">2</threads>
* </Properties>
* ---------------------------------------------------------
* You could of course put the beep frequencies and durations
* in an int[] in the properties file.
*/
void main(char[][] args)
{
try
{
ServiceImplementation si = new BeepService();
ServiceBase.implementMain(args);
}
catch (Exception ex)
{
writefln(ex.toString());
}
}
|
D
|
module ddoc_template;
import
std.stdio;
import
iz.memory;
import
dparse.ast, dparse.lexer, dparse.parser, dparse.rollback_allocator;
/**
* Finds the declaration at caretLine and write its ddoc template
* in the standard output.
*/
void getDdocTemplate(const(Module) mod, int caretLine, bool plusComment)
{
DDocTemplateGenerator dtg = construct!DDocTemplateGenerator(caretLine, plusComment);
dtg.visit(mod);
}
final class DDocTemplateGenerator: ASTVisitor
{
alias visit = ASTVisitor.visit;
private:
immutable int _caretline;
immutable char c1;
immutable char[2] c2;
public:
this(int caretline, bool plusComment)
{
_caretline = caretline;
c1 = plusComment ? '+' : '*';
c2 = plusComment ? "++" : "**";
}
override void visit(const(FunctionDeclaration) decl)
{
if (decl.name.line == _caretline)
{
writeln("/", c2, "\n ", c1, " <short description> \n ", c1, " \n ", c1, " <detailed description>\n ", c1);
if (decl.templateParameters || decl.parameters)
{
writeln(" ", c1, " Params:");
if (decl.templateParameters && decl.templateParameters.templateParameterList)
{
foreach(const TemplateParameter p; decl.templateParameters
.templateParameterList.items)
{
if (p.templateAliasParameter)
writeln(" ", c1, " ", p.templateAliasParameter.identifier.text, " = <description>");
else if (p.templateTupleParameter)
writeln(" ", c1, " ", p.templateTupleParameter.identifier.text, " = <description>");
else if (p.templateTypeParameter)
writeln(" ", c1, " ", p.templateTypeParameter.identifier.text, " = <description>");
else if (p.templateValueParameter)
writeln(" ", c1, " ", p.templateValueParameter.identifier.text, " = <description>");
}
}
if (decl.parameters)
{
foreach(i, const Parameter p; decl.parameters.parameters)
{
if (p.name.text != "")
writeln(" ", c1, " ", p.name.text, " = <description>");
else
writeln(" ", c1, " __param", i, " = <description>");
}
}
}
if (decl.returnType)
{
if (decl.returnType.type2 && decl.returnType.type2
&& decl.returnType.type2.builtinType != tok!"void")
writeln(" ", c1, " \n ", c1, " Returns: <return description>");
}
writeln(" ", c1, "/");
}
else if (decl.name.line > _caretline)
return;
decl.accept(this);
}
override void visit(const(TemplateDeclaration) decl)
{
visitTemplateOrAggregate(decl);
}
override void visit(const(ClassDeclaration) decl)
{
visitTemplateOrAggregate(decl);
}
override void visit(const(StructDeclaration) decl)
{
visitTemplateOrAggregate(decl);
}
override void visit(const(UnionDeclaration) decl)
{
visitTemplateOrAggregate(decl);
}
override void visit(const(AutoDeclarationPart) decl)
{
if (decl.templateParameters)
visitTemplateOrAggregate(decl);
}
private void visitTemplateOrAggregate(T)(const(T) decl)
{
size_t line;
static if (__traits(hasMember, T, "name"))
line = decl.name.line;
else
line = decl.identifier.line;
if (_caretline == line)
{
writeln("/", c2, "\n ", c1, " <short description> \n ", c1, " \n ", c1, " <detailed description>\n ", c1);
if (decl.templateParameters)
{
writeln(" ", c1, " Params:");
if (decl.templateParameters && decl.templateParameters.templateParameterList)
{
foreach(const TemplateParameter p; decl.templateParameters
.templateParameterList.items)
{
if (p.templateAliasParameter)
writeln(" ", c1, " ", p.templateAliasParameter.identifier.text, " = <description>");
else if (p.templateTupleParameter)
writeln(" ", c1, " ", p.templateTupleParameter.identifier.text, " = <description>");
else if (p.templateTypeParameter)
writeln(" ", c1, " ", p.templateTypeParameter.identifier.text, " = <description>");
else if (p.templateValueParameter)
writeln(" ", c1, " ", p.templateValueParameter.identifier.text, " = <description>");
}
}
}
writeln(" ", c1, "/");
}
else if (line > _caretline)
return;
decl.accept(this);
}
}
version(unittest)
{
DDocTemplateGenerator parseAndVisit(const(char)[] source, int caretLine, bool p = false)
{
writeln;
RollbackAllocator allocator;
LexerConfig config = LexerConfig("", StringBehavior.source, WhitespaceBehavior.skip);
StringCache cache = StringCache(StringCache.defaultBucketCount);
const(Token)[] tokens = getTokensForParser(cast(ubyte[]) source, config, &cache);
Module mod = parseModule(tokens, "", &allocator);
DDocTemplateGenerator result = construct!(DDocTemplateGenerator)(caretLine, p);
result.visit(mod);
return result;
}
}
unittest
{
q{ module a;
void foo(A...)(A a){}
}.parseAndVisit(2, true);
}
unittest
{
q{ module a;
void foo()(){}
}.parseAndVisit(2);
}
unittest
{
q{ module a;
int foo(int){}
}.parseAndVisit(2, true);
}
unittest
{
q{ module a;
class Foo(T, A...){}
}.parseAndVisit(2);
}
unittest
{
q{ module a;
struct Foo(alias Fun, A...){}
}.parseAndVisit(2);
}
unittest
{
q{ module a;
enum trait(alias Variable) = whatever;
}.parseAndVisit(2);
}
|
D
|
// Written in the D programming language.
/**
This module implements the formatting functionality for strings and
I/O. It's comparable to C99's `vsprintf()` and uses a similar
_format encoding scheme.
For an introductory look at $(B std._format)'s capabilities and how to use
this module see the dedicated
$(LINK2 http://wiki.dlang.org/Defining_custom_print_format_specifiers, DWiki article).
This module centers around two functions:
$(BOOKTABLE ,
$(TR $(TH Function Name) $(TH Description)
)
$(TR $(TD $(LREF formattedRead))
$(TD Reads values according to the format string from an InputRange.
))
$(TR $(TD $(LREF formattedWrite))
$(TD Formats its arguments according to the format string and puts them
to an OutputRange.
))
)
Please see the documentation of function $(LREF formattedWrite) for a
description of the format string.
Two functions have been added for convenience:
$(BOOKTABLE ,
$(TR $(TH Function Name) $(TH Description)
)
$(TR $(TD $(LREF format))
$(TD Returns a GC-allocated string with the formatting result.
))
$(TR $(TD $(LREF sformat))
$(TD Puts the formatting result into a preallocated array.
))
)
These two functions are publicly imported by $(MREF std, string)
to be easily available.
The functions $(LREF formatValue) and $(LREF unformatValue) are
used for the plumbing.
Copyright: Copyright The D Language Foundation 2000-2013.
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP walterbright.com, Walter Bright), $(HTTP 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.vararg;
import std.exception;
import std.meta;
import std.range.primitives;
import std.traits;
/**
Signals a mismatch between a format and its corresponding argument.
*/
class FormatException : Exception
{
@safe @nogc pure nothrow
this()
{
super("format error");
}
@safe @nogc pure nothrow
this(string msg, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null)
{
super(msg, fn, ln, next);
}
}
///
@safe unittest
{
import std.exception : assertThrown;
assertThrown!FormatException(format("%d", "foo"));
}
private alias enforceFmt = enforce!FormatException;
/**********************************************************************
Interprets variadic argument list `args`, formats them according
to `fmt`, and sends the resulting characters to `w`. The
encoding of the output is the same as `Char`. The type `Writer`
must satisfy $(D $(REF isOutputRange, std,range,primitives)!(Writer, Char)).
The variadic arguments are normally consumed in order. POSIX-style
$(HTTP 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 `w`. As many
arguments as specified in the format string are consumed and
formatted. If there are fewer arguments than format specifiers, a
`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 %() and $(B %)). Each
matching pair of $(B %() and $(B %)) 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
$(REF Appender!string, std,array) and $(REF LockingTextWriter, std,stdio).
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 Separator) $(I Precision) $(I FormatChar)
$(B '%$(LPAREN)') $(I FormatString) $(B '%$(RPAREN)')
$(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 Separator):
$(I empty)
$(B ',')
$(B ',') $(B '?')
$(B ',') $(B '*') $(B '?')
$(B ',') $(I Integer) $(B '?')
$(B ',') $(B '*')
$(B ',') $(I Integer)
$(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 'c')|$(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')|$(B '|')
)
$(BOOKTABLE Flags affect formatting depending on the specifier as
follows., $(TR $(TH Flag) $(TH Types 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 '0')) $(TD numeric) $(TD Use leading
zeros to pad rather than spaces (except for the floating point
values `nan` and `infinity`). Ignore if there's a $(I
Precision).))
$(TR $(TD $(B ' ')) $(TD numeric) $(TD 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 *), an additional argument of type $(B int),
preceding the actual argument, 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 *), an additional argument of type $(B int),
preceding the actual argument, is taken as the precision.
If it is negative, it is as if there was no $(I Precision) specifier.)
$(DT $(I Separator))
$(DD Inserts the separator symbols ',' every $(I X) digits, from right
to left, into numeric values to increase readability.
The fractional part of floating point values inserts the separator
from left to right.
Entering an integer after the ',' allows to specify $(I X).
If a '*' is placed after the ',' then $(I X) is specified by an
additional parameter to the format function.
Adding a '?' after the ',' or $(I X) specifier allows to specify
the separator character as an additional parameter.
)
$(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 `"true"` or `"false"`.)
$(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 structs)
$(DD If the struct defines a $(B toString()) method the result is
the string returned from this function. Otherwise the result is
StructName(field<sub>0</sub>, field<sub>1</sub>, ...) where
field<sub>n</sub> is the nth element formatted with the default
format.)
$(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 unions)
$(DD If the union defines a $(B toString()) method the result is
the string returned from this function. Otherwise the result is
the name of the union, without its contents.)
$(DT non-string static and dynamic arrays)
$(DD The result is [s<sub>0</sub>, s<sub>1</sub>, ...]
where s<sub>n</sub> is the nth element
formatted with the default format.)
$(DT associative arrays)
$(DD The result is the equivalent of what the initializer
would look like for the contents of the associative array,
e.g.: ["red" : 10, "blue" : 20].)
))
$(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),
±, followed by at least a two digit exponent:
$(I d.dddddd)e$(I ±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 ±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 ±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.)
))
)
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.
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:
$(CONSOLE
My items are 1 2 3.
My items are 1, 2, 3.
)
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:
$(CONSOLE
My items are -1-, -2-, -3-.
)
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:
$(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]]
)
Inside a compound format specifier, strings and characters are escaped
automatically. To avoid this behavior, add $(B '-') flag to
`"%$(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:
$(CONSOLE
My friends are ["John", "Nancy"].
My friends are "John", "Nancy".
My friends are John, Nancy.
)
*/
uint formattedWrite(alias fmt, Writer, A...)(auto ref Writer w, A args)
if (isSomeString!(typeof(fmt)))
{
alias e = checkFormatException!(fmt, A);
static assert(!e, e.msg);
return .formattedWrite(w, fmt, args);
}
/// The format string can be checked at compile-time (see $(LREF format) for details):
@safe pure unittest
{
import std.array : appender;
auto writer = appender!string();
writer.formattedWrite!"%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");
}
/// ditto
uint formattedWrite(Writer, Char, A...)(auto ref Writer w, const scope Char[] fmt, A args)
{
import std.conv : text;
auto spec = FormatSpec!Char(fmt);
// Are we already done with formats? Then just dump each parameter in turn
uint currentArg = 0;
while (spec.writeUpToNextSpec(w))
{
if (currentArg == A.length && !spec.indexStart)
{
// leftover spec?
enforceFmt(fmt.length == 0,
text("Orphan format specifier: %", spec.spec));
break;
}
if (spec.width == spec.DYNAMIC)
{
auto width = getNthInt!"integer width"(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, "The index must be greater than zero");
auto width = getNthInt!"integer width"(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 = getNthInt!"integer precision"(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, "The precision must be greater than zero");
auto precision = getNthInt!"integer precision"(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;
}
if (spec.separators == spec.DYNAMIC)
{
auto separators = getNthInt!"separator digit width"(currentArg, args);
spec.separators = separators;
++currentArg;
}
if (spec.separatorCharPos == spec.DYNAMIC)
{
auto separatorChar =
getNth!("separator character", isSomeChar, dchar)(currentArg, args);
spec.separatorChar = separatorChar;
++currentArg;
}
if (currentArg == A.length && !spec.indexStart)
{
// leftover spec?
enforceFmt(fmt.length == 0,
text("Orphan format specifier: %", spec.spec));
break;
}
// Format an argument
// This switch uses a static foreach to generate a jump table.
// Currently `spec.indexStart` use the special value '0' to signal
// we should use the current argument. An enhancement would be to
// always store the index.
size_t index = currentArg;
if (spec.indexStart != 0)
index = spec.indexStart - 1;
else
++currentArg;
SWITCH: switch (index)
{
foreach (i, Tunused; A)
{
case i:
formatValue(w, args[i], spec);
if (currentArg < spec.indexEnd)
currentArg = spec.indexEnd;
// A little know feature of format is to format a range
// of arguments, e.g. `%1:3$` will format the first 3
// arguments. Since they have to be consecutive we can
// just use explicit fallthrough to cover that case.
if (i + 1 < spec.indexEnd)
{
// You cannot goto case if the next case is the default
static if (i + 1 < A.length)
goto case;
else
goto default;
}
else
break SWITCH;
}
default:
throw new FormatException(
text("Positional specifier %", spec.indexStart, '$', spec.spec,
" index exceeds ", A.length));
}
}
return currentArg;
}
///
@safe unittest
{
assert(format("%,d", 1000) == "1,000");
assert(format("%,f", 1234567.891011) == "1,234,567.891011");
assert(format("%,?d", '?', 1000) == "1?000");
assert(format("%,1d", 1000) == "1,0,0,0", format("%,1d", 1000));
assert(format("%,*d", 4, -12345) == "-1,2345");
assert(format("%,*?d", 4, '_', -12345) == "-1_2345");
assert(format("%,6?d", '_', -12345678) == "-12_345678");
assert(format("%12,3.3f", 1234.5678) == " 1,234.568", "'" ~
format("%12,3.3f", 1234.5678) ~ "'");
}
@safe pure unittest
{
import std.array;
auto w = appender!string();
formattedWrite(w, "%s %d", "@safe/pure", 42);
assert(w.data == "@safe/pure 42");
}
@safe pure unittest
{
char[20] buf;
auto w = buf[];
formattedWrite(w, "%s %d", "@safe/pure", 42);
assert(buf[0 .. $ - w.length] == "@safe/pure 42");
}
/**
Reads characters from $(REF_ALTTEXT input range, isInputRange, std,range,primitives)
`r`, converts them according to `fmt`, and writes them to `args`.
Params:
r = The range to read from.
fmt = The format of the data to read.
args = The drain of the data read.
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.
Throws:
A `FormatException` if `S.length == 0` and `fmt` has format specifiers.
*/
uint formattedRead(alias fmt, R, S...)(auto ref R r, auto ref S args)
if (isSomeString!(typeof(fmt)))
{
alias e = checkFormatException!(fmt, S);
static assert(!e, e.msg);
return .formattedRead(r, fmt, args);
}
/// ditto
uint formattedRead(R, Char, S...)(auto ref R r, const(Char)[] fmt, auto ref S args)
{
import std.typecons : isTuple;
auto spec = FormatSpec!Char(fmt);
static if (!S.length)
{
spec.readUpToNextSpec(r);
enforceFmt(spec.trailing.empty, "Trailing characters in formattedRead format string");
return 0;
}
else
{
enum hasPointer = isPointer!(typeof(args[0]));
// 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;
}
static if (hasPointer)
alias A = typeof(*args[0]);
else
alias A = typeof(args[0]);
static if (isTuple!A)
{
foreach (i, T; A.Types)
{
static if (hasPointer)
(*args[0])[i] = unformatValue!(T)(r, spec);
else
args[0][i] = unformatValue!(T)(r, spec);
skipUnstoredFields();
}
}
else
{
static if (hasPointer)
*args[0] = unformatValue!(A)(r, spec);
else
args[0] = unformatValue!(A)(r, spec);
}
return 1 + formattedRead(r, spec.trailing, args[1 .. $]);
}
}
/// The format string can be checked at compile-time (see $(LREF format) for details):
@safe pure unittest
{
string s = "hello!124:34.5";
string a;
int b;
double c;
s.formattedRead!"%s!%s:%s"(a, b, c);
assert(a == "hello" && b == 124 && c == 34.5);
}
@safe unittest
{
import std.math;
string s = " 1.2 3.4 ";
double x, y, z;
assert(formattedRead(s, " %s %s %s ", x, y, z) == 2);
assert(s.empty);
assert(approxEqual(x, 1.2));
assert(approxEqual(y, 3.4));
assert(isNaN(z));
}
// for backwards compatibility
@system pure 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);
// mix pointers and auto-ref
s = "world!200:42.25";
formattedRead(s, "%s!%s:%s", a, &b, &c);
assert(a == "world" && b == 200 && c == 42.25);
s = "world1!201:42.5";
formattedRead(s, "%s!%s:%s", &a, &b, c);
assert(a == "world1" && b == 201 && c == 42.5);
s = "world2!202:42.75";
formattedRead(s, "%s!%s:%s", a, b, &c);
assert(a == "world2" && b == 202 && c == 42.75);
}
// for backwards compatibility
@system pure unittest
{
import std.math;
string s = " 1.2 3.4 ";
double x, y, z;
assert(formattedRead(s, " %s %s %s ", &x, &y, &z) == 2);
assert(s.empty);
assert(approxEqual(x, 1.2));
assert(approxEqual(y, 3.4));
assert(isNaN(z));
}
@system pure 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);
}
@system pure unittest
{
union B
{
char[int.sizeof] untyped;
int typed;
}
B b;
b.typed = 5;
char[] input = b.untyped[];
int witness;
formattedRead(input, "%r", &witness);
assert(witness == b.typed);
}
@system pure 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);
}
@system pure unittest
{
import std.typecons;
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);
}
@system pure unittest
{
string line;
char c1, c2;
line = "abc";
formattedRead(line, "%s%c", &c1, &c2);
assert(c1 == 'a' && c2 == 'b');
assert(line == "c");
}
@system pure unittest
{
string line;
line = "[1,2,3]";
int[] s1;
formattedRead(line, "%s", &s1);
assert(s1 == [1,2,3]);
}
@system pure 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"]);
}
@system pure 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));
}
@system pure 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!FormatException(formattedRead(input, "[%(%s,%)]", &sa2));
}
@system pure 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");
}
@system pure 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]);
}
// test rvalue using
@system pure unittest
{
string[int] aa1;
formattedRead!("%s")(`[1:"hello", 2:"world"]`, aa1);
assert(aa1 == [1:"hello", 2:"world"]);
int[string] aa2;
formattedRead(`{"hello"=1; "world"=2}`, "{%(%s=%s; %)}", aa2);
assert(aa2 == ["hello":1, "world":2]);
}
template FormatSpec(Char)
if (!is(Unqual!Char == Char))
{
alias FormatSpec = FormatSpec!(Unqual!Char);
}
/**
* A General handler for `printf` style format specifiers. Used for building more
* specific formatting functions.
*/
struct FormatSpec(Char)
if (is(Unqual!Char == Char))
{
import std.algorithm.searching : startsWith;
import std.ascii : isDigit, isPunctuation, isAlpha;
import std.conv : parse, text, to;
/**
Minimum _width, default `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;
/**
Number of digits printed between _separators.
*/
int separators = UNSPECIFIED;
/**
Set to `DYNAMIC` when the separator character is supplied at runtime.
*/
int separatorCharPos = UNSPECIFIED;
/**
Character to insert between digits.
*/
dchar separatorChar = ',';
/**
Special value for width and precision. `DYNAMIC` width or
precision means that they were specified with `'*'` 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, `'s'` by default.
*/
char spec = 's';
/**
Index of the argument for positional parameters, from `1` to
`ubyte.max`. (`0` means not used).
*/
ubyte indexStart;
/**
Index of the last argument for positional parameter range, from
`1` to `ubyte.max`. (`0` means not used).
*/
ubyte indexEnd;
version (StdDdoc)
{
/**
The format specifier contained a `'-'` (`printf`
compatibility).
*/
bool flDash;
/**
The format specifier contained a `'0'` (`printf`
compatibility).
*/
bool flZero;
/**
The format specifier contained a $(D ' ') (`printf`
compatibility).
*/
bool flSpace;
/**
The format specifier contained a `'+'` (`printf`
compatibility).
*/
bool flPlus;
/**
The format specifier contained a `'#'` (`printf`
compatibility).
*/
bool flHash;
/**
The format specifier contained a `','`
*/
bool flSeparator;
// Fake field to allow compilation
ubyte allFlags;
}
else
{
union
{
import std.bitmanip : bitfields;
mixin(bitfields!(
bool, "flDash", 1,
bool, "flZero", 1,
bool, "flSpace", 1,
bool, "flPlus", 1,
bool, "flHash", 1,
bool, "flSeparator", 1,
ubyte, "", 2));
ubyte allFlags;
}
}
/**
In case of a compound format specifier starting with $(D
"%$(LPAREN)") and ending with `"%$(RPAREN)"`, `_nested`
contains the string contained within the two separators.
*/
const(Char)[] nested;
/**
In case of a compound format specifier, `_sep` contains the
string positioning after `"%|"`.
`sep is null` means no separator else `sep.empty` means 0 length
separator.
*/
const(Char)[] sep;
/**
`_trailing` contains the rest of the format string.
*/
const(Char)[] trailing;
/*
This string is inserted before each sequence (e.g. array)
formatted (by default `"["`).
*/
enum immutable(Char)[] seqBefore = "[";
/*
This string is inserted after each sequence formatted (by
default `"]"`).
*/
enum immutable(Char)[] seqAfter = "]";
/*
This string is inserted after each element keys of a sequence (by
default `":"`).
*/
enum immutable(Char)[] keySeparator = ":";
/*
This string is inserted in between elements of a sequence (by
default $(D ", ")).
*/
enum immutable(Char)[] seqSeparator = ", ";
/**
Construct a new `FormatSpec` using the format string `fmt`, no
processing is done until needed.
*/
this(in Char[] fmt) @safe pure
{
trailing = fmt;
}
bool writeUpToNextSpec(OutputRange)(ref OutputRange writer) scope
{
if (trailing.empty)
return false;
for (size_t i = 0; i < trailing.length; ++i)
{
if (trailing[i] != '%') continue;
put(writer, trailing[0 .. i]);
trailing = trailing[i .. $];
enforceFmt(trailing.length >= 2, `Unterminated format specifier: "%"`);
trailing = trailing[1 .. $];
if (trailing[0] != '%')
{
// Spec found. Fill up the spec, and bailout
fillUp();
return true;
}
// Doubled! Reset and Keep going
i = 0;
}
// no format spec found
put(writer, trailing);
trailing = null;
return false;
}
@safe unittest
{
import std.array;
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 == "%%%");
f = FormatSpec("a%%b%%c%");
w.clear();
assertThrown!FormatException(f.writeUpToNextSpec(w));
assert(w.data == "a%b%c" && f.trailing == "%");
}
private void fillUp() scope
{
// Reset content
if (__ctfe)
{
flDash = false;
flZero = false;
flSpace = false;
flPlus = false;
flHash = false;
flSeparator = 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;
// Get the matching balanced paren
for (uint innerParens;;)
{
enforceFmt(j + 1 < trailing.length,
text("Incorrect format specifier: %", trailing[i .. $]));
if (trailing[j++] != '%')
{
// skip, we're waiting for %( and %)
continue;
}
if (trailing[j] == '-') // for %-(
{
++j; // skip
enforceFmt(j < trailing.length,
text("Incorrect format specifier: %", trailing[i .. $]));
}
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 FormatException(
text("Incorrect format specifier: %",
trailing[j .. $]));
}
nested = trailing[i + 1 .. k - 1];
sep = trailing[k + 1 .. j - 1];
}
else
{
nested = trailing[i + 1 .. j - 1];
sep = null; // no separator
}
//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;
enforceFmt(trailing[i++] == '$',
"$ expected");
}
else
{
// read result
width = DYNAMIC;
}
break;
case '1': .. case '9':
auto tmp = trailing[i .. $];
const widthOrArgIndex = parse!uint(tmp);
enforceFmt(tmp.length,
text("Incorrect format specifier %", trailing[i .. $]));
i = arrayPtrDiff(tmp, trailing);
if (tmp.startsWith('$'))
{
// index of the form %n$
indexEnd = indexStart = to!ubyte(widthOrArgIndex);
++i;
}
else if (tmp.startsWith(':'))
{
// 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 = arrayPtrDiff(tmp, trailing);
enforceFmt(trailing[i++] == '$',
"$ expected");
}
else
{
// width
width = to!int(widthOrArgIndex);
}
break;
case ',':
// Precision
++i;
flSeparator = true;
if (trailing[i] == '*')
{
++i;
// read result
separators = DYNAMIC;
}
else if (isDigit(trailing[i]))
{
auto tmp = trailing[i .. $];
separators = parse!int(tmp);
i = arrayPtrDiff(tmp, trailing);
}
else
{
// "," was specified, but nothing after it
separators = 3;
}
if (trailing[i] == '?')
{
separatorCharPos = DYNAMIC;
++i;
}
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);
enforceFmt(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 = arrayPtrDiff(tmp, trailing);
}
else if (isDigit(trailing[i]))
{
auto tmp = trailing[i .. $];
precision = parse!int(tmp);
i = arrayPtrDiff(tmp, trailing);
}
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 FormatException(text("Incorrect format specifier: ", trailing));
}
//--------------------------------------------------------------------------
private bool readUpToNextSpec(R)(ref R r) scope
{
import std.ascii : isLower, isWhite;
import std.utf : stride;
// Reset content
if (__ctfe)
{
flDash = false;
flZero = false;
flSpace = false;
flPlus = false;
flHash = false;
flSeparator = false;
}
else
{
allFlags = 0;
}
width = 0;
precision = UNSPECIFIED;
nested = null;
// Parse the spec
while (trailing.length)
{
const c = trailing[0];
if (c == '%' && trailing.length > 1)
{
const c2 = trailing[1];
if (c2 == '%')
{
assert(!r.empty, "Required at least one more input");
// Require a '%'
if (r.front != '%') break;
trailing = trailing[2 .. $];
r.popFront();
}
else
{
enforceFmt(isLower(c2) || c2 == '*' ||
c2 == '(',
text("'%", c2,
"' not supported with formatted read"));
trailing = trailing[1 .. $];
fillUp();
return true;
}
}
else
{
if (c == ' ')
{
while (!r.empty && isWhite(r.front)) r.popFront();
//r = std.algorithm.find!(not!(isWhite))(r);
}
else
{
enforceFmt(!r.empty,
text("parseToFormatSpec: Cannot find character '",
c, "' in the input string."));
if (r.front != trailing.front) break;
r.popFront();
}
trailing = trailing[stride(trailing, 0) .. $];
}
}
return false;
}
private string getCurFmtStr() const
{
import std.array : appender;
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 (flSeparator) 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;
}
@safe unittest
{
// issue 5237
import std.array;
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()
{
import std.array : appender;
auto w = appender!(typeof(return))();
auto tr = trailing;
while (tr.length)
{
if (tr[0] == '%')
{
if (tr.length > 1 && tr[1] == '%')
{
tr = tr[2 .. $];
w.put('%');
}
else
break;
}
else
{
w.put(tr.front);
tr.popFront();
}
}
return w.data;
}
/**
* Gives a string containing all of the member variables on their own
* line.
*
* Params:
* writer = A `char` accepting
* $(REF_ALTTEXT output range, isOutputRange, std, range, primitives)
* Returns:
* A `string` when not using an output range; `void` otherwise.
*/
string toString() const @safe pure
{
import std.array : appender;
auto app = appender!string();
app.reserve(200 + trailing.length);
toString(app);
return app.data;
}
/// ditto
void toString(OutputRange)(ref OutputRange writer) const
if (isOutputRange!(OutputRange, char))
{
auto s = singleSpec("%s");
put(writer, "address = ");
formatValue(writer, &this, s);
put(writer, "\nwidth = ");
formatValue(writer, width, s);
put(writer, "\nprecision = ");
formatValue(writer, precision, s);
put(writer, "\nspec = ");
formatValue(writer, spec, s);
put(writer, "\nindexStart = ");
formatValue(writer, indexStart, s);
put(writer, "\nindexEnd = ");
formatValue(writer, indexEnd, s);
put(writer, "\nflDash = ");
formatValue(writer, flDash, s);
put(writer, "\nflZero = ");
formatValue(writer, flZero, s);
put(writer, "\nflSpace = ");
formatValue(writer, flSpace, s);
put(writer, "\nflPlus = ");
formatValue(writer, flPlus, s);
put(writer, "\nflHash = ");
formatValue(writer, flHash, s);
put(writer, "\nflSeparator = ");
formatValue(writer, flSeparator, s);
put(writer, "\nnested = ");
formatValue(writer, nested, s);
put(writer, "\ntrailing = ");
formatValue(writer, trailing, s);
put(writer, '\n');
}
}
///
@safe pure unittest
{
import std.array;
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');
}
// Issue 14059
@safe unittest
{
import std.array : appender;
auto a = appender!(string)();
auto f = FormatSpec!char("%-(%s%"); // %)")
assertThrown!FormatException(f.writeUpToNextSpec(a));
f = FormatSpec!char("%(%-"); // %)")
assertThrown!FormatException(f.writeUpToNextSpec(a));
}
@safe unittest
{
import std.array : appender;
auto a = appender!(string)();
auto f = FormatSpec!char("%,d");
f.writeUpToNextSpec(a);
assert(f.spec == 'd', format("%s", f.spec));
assert(f.precision == FormatSpec!char.UNSPECIFIED);
assert(f.separators == 3);
f = FormatSpec!char("%5,10f");
f.writeUpToNextSpec(a);
assert(f.spec == 'f', format("%s", f.spec));
assert(f.separators == 10);
assert(f.width == 5);
f = FormatSpec!char("%5,10.4f");
f.writeUpToNextSpec(a);
assert(f.spec == 'f', format("%s", f.spec));
assert(f.separators == 10);
assert(f.width == 5);
assert(f.precision == 4);
}
@safe pure unittest
{
import std.algorithm.searching : canFind, findSplitBefore;
auto expected = "width = 2" ~
"\nprecision = 5" ~
"\nspec = f" ~
"\nindexStart = 0" ~
"\nindexEnd = 0" ~
"\nflDash = false" ~
"\nflZero = false" ~
"\nflSpace = false" ~
"\nflPlus = false" ~
"\nflHash = false" ~
"\nflSeparator = false" ~
"\nnested = " ~
"\ntrailing = \n";
auto spec = singleSpec("%2.5f");
auto res = spec.toString();
// make sure the address exists, then skip it
assert(res.canFind("address"));
assert(res.findSplitBefore("width")[1] == expected);
}
/**
Helper function that returns a `FormatSpec` for a single specifier given
in `fmt`.
Params:
fmt = A format specifier.
Returns:
A `FormatSpec` with the specifier parsed.
Throws:
A `FormatException` when more than one specifier is given or the specifier
is malformed.
*/
FormatSpec!Char singleSpec(Char)(Char[] fmt)
{
import std.conv : text;
enforceFmt(fmt.length >= 2, "fmt must be at least 2 characters long");
enforceFmt(fmt.front == '%', "fmt must start with a '%' character");
static struct DummyOutputRange {
void put(C)(scope const C[] buf) {} // eat elements
}
auto a = DummyOutputRange();
auto spec = FormatSpec!Char(fmt);
//dummy write
spec.writeUpToNextSpec(a);
enforceFmt(spec.trailing.empty,
text("Trailing characters in fmt string: '", spec.trailing));
return spec;
}
///
@safe pure unittest
{
import std.exception : assertThrown;
auto spec = singleSpec("%2.3e");
assert(spec.trailing == "");
assert(spec.spec == 'e');
assert(spec.width == 2);
assert(spec.precision == 3);
assertThrown!FormatException(singleSpec(""));
assertThrown!FormatException(singleSpec("2.3e"));
assertThrown!FormatException(singleSpec("%2.3eTest"));
}
/**
* Formats any value into `Char` accepting `OutputRange`, using the given `FormatSpec`.
*
* Aggregates:
* `struct`, `union`, `class`, and `interface` are formatted by calling `toString`.
*
* `toString` should have one of the following signatures:
*
* ---
* void toString(W)(ref W w, scope const ref FormatSpec fmt)
* void toString(W)(ref W w)
* string toString();
* ---
*
* Where `W` is an $(REF_ALTTEXT output range, isOutputRange, std,range,primitives)
* which accepts characters. The template type does not have to be called `W`.
*
* The following overloads are also accepted for legacy reasons or for use in virtual
* functions. It's recommended that any new code forgo these overloads if possible for
* speed and attribute acceptance reasons.
*
* ---
* void toString(scope void delegate(const(char)[]) sink, const ref FormatSpec fmt);
* void toString(scope void delegate(const(char)[]) sink, string fmt);
* void toString(scope void delegate(const(char)[]) sink);
* ---
*
* For the class objects which have input range interface,
* $(UL
* $(LI If the instance `toString` has overridden `Object.toString`, it is used.)
* $(LI Otherwise, the objects are formatted as input range.)
* )
*
* For the `struct` and `union` objects which does not have `toString`,
* $(UL
* $(LI If they have range interface, formatted as input range.)
* $(LI Otherwise, they are formatted like `Type(field1, filed2, ...)`.)
* )
*
* Otherwise, are formatted just as their type name.
*
* Params:
* w = The $(REF_ALTTEXT output range, isOutputRange, std,range,primitives) to write to.
* val = The value to write.
* f = The $(REF FormatSpec, std, format) defining how to write the value.
*/
void formatValue(Writer, T, Char)(auto ref Writer w, auto ref T val, scope const ref FormatSpec!Char f)
{
formatValueImpl(w, val, f);
}
/++
The following code compares the use of `formatValue` and `formattedWrite`.
+/
@safe pure unittest
{
import std.array : appender;
auto writer1 = appender!string();
writer1.formattedWrite("%08b", 42);
auto writer2 = appender!string();
auto f = singleSpec("%08b");
writer2.formatValue(42, f);
assert(writer1.data == writer2.data && writer1.data == "00101010");
}
/**
* `bool`s are formatted as `"true"` or `"false"` with `%s` and as `1` or
* `0` with integral-specific format specs.
*/
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
formatValue(w, true, spec);
assert(w.data == "true");
}
/// `null` literal is formatted as `"null"`.
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
formatValue(w, null, spec);
assert(w.data == "null");
}
/// Integrals are formatted like $(REF printf, core, stdc, stdio).
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%d");
formatValue(w, 1337, spec);
assert(w.data == "1337");
}
/// Floating-point values are formatted like $(REF printf, core, stdc, stdio)
@safe unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%.1f");
formatValue(w, 1337.7, spec);
assert(w.data == "1337.7");
}
/**
* Individual characters (`char, `wchar`, or `dchar`) are formatted as
* Unicode characters with `%s` and as integers with integral-specific format
* specs.
*/
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%c");
formatValue(w, 'a', spec);
assert(w.data == "a");
}
/// Strings are formatted like $(REF printf, core, stdc, stdio)
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
formatValue(w, "hello", spec);
assert(w.data == "hello");
}
/// Static-size arrays are formatted as dynamic arrays.
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
char[2] two = ['a', 'b'];
formatValue(w, two, spec);
assert(w.data == "ab");
}
/**
* Dynamic arrays are formatted as input ranges.
*
* Specializations:
* $(UL
* $(LI `void[]` is formatted like `ubyte[]`.)
* $(LI Const array is converted to input range by removing its qualifier.)
* )
*/
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
auto two = [1, 2];
formatValue(w, two, spec);
assert(w.data == "[1, 2]");
}
/**
* Associative arrays are formatted by using `':'` and `", "` as
* separators, and enclosed by `'['` and `']'`.
*/
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
auto aa = ["H":"W"];
formatValue(w, aa, spec);
assert(w.data == "[\"H\":\"W\"]", w.data);
}
/// `enum`s are formatted like their base value
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
enum A { first, second, third }
formatValue(w, A.second, spec);
assert(w.data == "second");
}
/**
* Formatting a struct by defining a method `toString`, which takes an output
* range.
*
* It's recommended that any `toString` using $(REF_ALTTEXT output ranges, isOutputRange, std,range,primitives)
* use $(REF put, std,range,primitives) rather than use the `put` method of the range
* directly.
*/
@safe unittest
{
import std.array : appender;
import std.range.primitives;
static struct Point
{
int x, y;
void toString(W)(ref W writer, scope const ref FormatSpec!char f)
if (isOutputRange!(W, char))
{
// std.range.primitives.put
put(writer, "(");
formatValue(writer, x, f);
put(writer, ",");
formatValue(writer, y, f);
put(writer, ")");
}
}
auto w = appender!string();
auto spec = singleSpec("%s");
auto p = Point(16, 11);
formatValue(w, p, spec);
assert(w.data == "(16,11)");
}
/**
* Another example of formatting a `struct` with a defined `toString`,
* this time using the `scope delegate` method.
*
* $(RED This method is now discouraged for non-virtual functions).
* If possible, please use the output range method instead.
*/
@safe unittest
{
static struct Point
{
int x, y;
void toString(scope void delegate(scope const(char)[]) @safe sink,
scope const FormatSpec!char fmt) const
{
sink("(");
sink.formatValue(x, fmt);
sink(",");
sink.formatValue(y, fmt);
sink(")");
}
}
auto p = Point(16,11);
assert(format("%03d", p) == "(016,011)");
assert(format("%02x", p) == "(10,0b)");
}
/// Pointers are formatted as hex integers.
@system pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
auto q = cast(void*) 0xFFEECCAA;
formatValue(w, q, spec);
assert(w.data == "FFEECCAA");
}
/// SIMD vectors are formatted as arrays.
@safe unittest
{
import core.simd;
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
static if (is(float4))
{
version (X86) {}
else
{
float4 f4;
f4.array[0] = 1;
f4.array[1] = 2;
f4.array[2] = 3;
f4.array[3] = 4;
formatValue(w, f4, spec);
assert(w.data == "[1, 2, 3, 4]");
}
}
}
/// Delegates are formatted by `ReturnType delegate(Parameters) FunctionAttributes`
@safe unittest
{
import std.conv : to;
int i;
int foo(short k) @nogc
{
return i + k;
}
@system int delegate(short) @nogc bar() nothrow pure
{
int* p = new int(1);
i = *p;
return &foo;
}
assert(to!string(&bar) == "int delegate(short) @nogc delegate() pure nothrow @system");
assert(() @trusted { return bar()(3); }() == 4);
}
/*
`bool`s are formatted as `"true"` or `"false"` with `%s` and as `1` or
`0` with integral-specific format specs.
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(BooleanTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
BooleanTypeOf!T val = obj;
if (f.spec == 's')
{
string s = val ? "true" : "false";
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
formatValueImpl(w, cast(int) val, f);
}
@safe pure unittest
{
assertCTFEable!(
{
formatTest( false, "false" );
formatTest( true, "true" );
});
}
@system unittest
{
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" );
}
@safe pure unittest
{
string t1 = format("[%6s] [%6s] [%-6s]", true, false, true);
assert(t1 == "[ true] [ false] [true ]");
string t2 = format("[%3s] [%-2s]", true, false);
assert(t2 == "[true] [false]");
}
/*
`null` literal is formatted as `"null"`
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(Unqual!T == typeof(null)) && !is(T == enum) && !hasToString!(T, Char))
{
const spec = f.spec;
enforceFmt(spec == 's',
"null literal cannot match %" ~ spec);
put(w, "null");
}
@safe pure unittest
{
assert(collectExceptionMsg!FormatException(format("%p", null)).back == 'p');
assertCTFEable!(
{
formatTest( null, "null" );
});
}
/*
Integrals are formatted like $(REF printf, core, stdc, stdio).
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(IntegralTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
alias U = IntegralTypeOf!T;
U val = obj; // Extracting alias this may be impure/system/may-throw
const spec = f.spec;
if (spec == 'r')
{
// raw write, skip all else and write the thing
auto raw = (ref val)@trusted{
return (cast(const char*) &val)[0 .. val.sizeof];
}(val);
if (needToSwapEndianess(f))
{
foreach_reverse (c; raw)
put(w, c);
}
else
{
foreach (c; raw)
put(w, c);
}
return;
}
immutable uint base =
spec == 'x' || spec == 'X' ? 16 :
spec == 'o' ? 8 :
spec == 'b' ? 2 :
spec == 's' || spec == 'd' || spec == 'u' ? 10 :
0;
enforceFmt(base > 0,
"incompatible format character for integral argument: %" ~ spec);
// Forward on to formatIntegral to handle both U and const(U)
// Saves duplication of code for both versions.
static if (is(ucent) && (is(U == cent) || is(U == ucent)))
alias C = U;
else static if (isSigned!U)
alias C = long;
else
alias C = ulong;
formatIntegral(w, cast(C) val, f, base, Unsigned!U.max);
}
private void formatIntegral(Writer, T, Char)(ref Writer w, const(T) val, scope const ref FormatSpec!Char fs,
uint base, ulong mask)
{
T arg = val;
immutable negative = (base == 10 && arg < 0);
if (negative)
{
arg = -arg;
}
// All unsigned integral types should fit in ulong.
static if (is(ucent) && is(typeof(arg) == ucent))
formatUnsigned(w, (cast(ucent) arg) & mask, fs, base, negative);
else
formatUnsigned(w, (cast(ulong) arg) & mask, fs, base, negative);
}
private void formatUnsigned(Writer, T, Char)
(ref Writer w, T arg, scope const ref FormatSpec!Char fs, uint base, bool negative)
{
/* Write string:
* leftpad prefix1 prefix2 zerofill digits rightpad
*/
/* Convert arg to digits[].
* Note that 0 becomes an empty digits[]
*/
char[64] buffer = void; // 64 bits in base 2 at most
char[] digits;
if (arg < base && base <= 10 && arg)
{
// Most numbers are a single digit - avoid expensive divide
buffer[0] = cast(char)(arg + '0');
digits = buffer[0 .. 1];
}
else
{
size_t i = buffer.length;
while (arg)
{
--i;
char c = cast(char) (arg % base);
arg /= base;
if (c < 10)
buffer[i] = cast(char)(c + '0');
else
buffer[i] = cast(char)(c + (fs.spec == 'x' ? 'a' - 10 : 'A' - 10));
}
digits = buffer[i .. $]; // got the digits without the sign
}
immutable precision = (fs.precision == fs.UNSPECIFIED) ? 1 : fs.precision;
char padChar = 0;
if (!fs.flDash)
{
padChar = (fs.flZero && fs.precision == fs.UNSPECIFIED) ? '0' : ' ';
}
// Compute prefix1 and prefix2
char prefix1 = 0;
char prefix2 = 0;
if (base == 10)
{
if (negative)
prefix1 = '-';
else if (fs.flPlus)
prefix1 = '+';
else if (fs.flSpace)
prefix1 = ' ';
}
else if (base == 16 && fs.flHash && digits.length)
{
prefix1 = '0';
prefix2 = fs.spec == 'x' ? 'x' : 'X';
}
// adjust precision to print a '0' for octal if alternate format is on
else if (base == 8 && fs.flHash &&
(precision <= 1 || precision <= digits.length) && // too low precision
digits.length > 0)
prefix1 = '0';
size_t zerofill = precision > digits.length ? precision - digits.length : 0;
size_t leftpad = 0;
size_t rightpad = 0;
immutable prefixWidth = (prefix1 != 0) + (prefix2 != 0);
size_t finalWidth, separatorsCount;
if (fs.flSeparator != 0)
{
finalWidth = prefixWidth + digits.length + ((digits.length > 0) ? (digits.length - 1) / fs.separators : 0);
if (finalWidth < fs.width)
finalWidth = fs.width + (padChar == '0') * (((fs.width - prefixWidth) % (fs.separators + 1) == 0) ? 1 : 0);
separatorsCount = (padChar == '0') ? (finalWidth - prefixWidth - 1) / (fs.separators + 1) :
((digits.length > 0) ? (digits.length - 1) / fs.separators : 0);
}
else
{
import std.algorithm.comparison : max;
finalWidth = max(fs.width, prefixWidth + digits.length);
}
immutable ptrdiff_t spacesToPrint =
finalWidth - (
+ prefixWidth
+ zerofill
+ digits.length
+ separatorsCount
);
if (spacesToPrint > 0) // need to do some padding
{
if (padChar == '0')
zerofill += spacesToPrint;
else if (padChar)
leftpad = spacesToPrint;
else
rightpad = spacesToPrint;
}
// Print
foreach (i ; 0 .. leftpad)
put(w, ' ');
if (prefix1) put(w, prefix1);
if (prefix2) put(w, prefix2);
if (fs.flSeparator)
{
if (zerofill > 0)
{
put(w, '0');
--zerofill;
}
int j = cast(int) (finalWidth - prefixWidth - separatorsCount - 1);
for (size_t i = 0; i < zerofill; ++i, --j)
{
if (j % fs.separators == 0)
{
put(w, fs.separatorChar);
}
put(w, '0');
}
}
else
{
foreach (i ; 0 .. zerofill)
put(w, '0');
}
if (fs.flSeparator)
{
for (size_t j = 0; j < digits.length; ++j)
{
if (((j != 0) || ((spacesToPrint > 0) && (padChar == '0'))) && (digits.length - j) % fs.separators == 0)
{
put(w, fs.separatorChar);
}
put(w, digits[j]);
}
}
else
{
put(w, digits);
}
foreach (i ; 0 .. rightpad)
put(w, ' ');
}
@safe pure unittest // bugzilla 18838
{
assert("%12,d".format(0) == " 0");
}
@safe pure unittest
{
assert(collectExceptionMsg!FormatException(format("%c", 5)).back == 'c');
assertCTFEable!(
{
formatTest(9, "9");
formatTest( 10, "10" );
});
}
@system unittest
{
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" );
}
// bugzilla 9117
@safe unittest
{
static struct Frop {}
static struct Foo
{
int n = 0;
alias n this;
T opCast(T) () if (is(T == Frop))
{
return Frop();
}
string toString()
{
return "Foo";
}
}
static struct Bar
{
Foo foo;
alias foo this;
string toString()
{
return "Bar";
}
}
const(char)[] result;
void put(scope const char[] s){ result ~= s; }
Foo foo;
formattedWrite(&put, "%s", foo); // OK
assert(result == "Foo");
result = null;
Bar bar;
formattedWrite(&put, "%s", bar); // NG
assert(result == "Bar");
result = null;
int i = 9;
formattedWrite(&put, "%s", 9);
assert(result == "9");
}
// bugzilla 20064
@safe unittest
{
assert(format( "%03,d", 1234) == "1,234");
assert(format( "%04,d", 1234) == "1,234");
assert(format( "%05,d", 1234) == "1,234");
assert(format( "%06,d", 1234) == "01,234");
assert(format( "%07,d", 1234) == "001,234");
assert(format( "%08,d", 1234) == "0,001,234");
assert(format( "%09,d", 1234) == "0,001,234");
assert(format("%010,d", 1234) == "00,001,234");
assert(format("%011,d", 1234) == "000,001,234");
assert(format("%012,d", 1234) == "0,000,001,234");
assert(format("%013,d", 1234) == "0,000,001,234");
assert(format("%014,d", 1234) == "00,000,001,234");
assert(format("%015,d", 1234) == "000,000,001,234");
assert(format("%016,d", 1234) == "0,000,000,001,234");
assert(format("%017,d", 1234) == "0,000,000,001,234");
assert(format( "%03,d", -1234) == "-1,234");
assert(format( "%04,d", -1234) == "-1,234");
assert(format( "%05,d", -1234) == "-1,234");
assert(format( "%06,d", -1234) == "-1,234");
assert(format( "%07,d", -1234) == "-01,234");
assert(format( "%08,d", -1234) == "-001,234");
assert(format( "%09,d", -1234) == "-0,001,234");
assert(format("%010,d", -1234) == "-0,001,234");
assert(format("%011,d", -1234) == "-00,001,234");
assert(format("%012,d", -1234) == "-000,001,234");
assert(format("%013,d", -1234) == "-0,000,001,234");
assert(format("%014,d", -1234) == "-0,000,001,234");
assert(format("%015,d", -1234) == "-00,000,001,234");
assert(format("%016,d", -1234) == "-000,000,001,234");
assert(format("%017,d", -1234) == "-0,000,000,001,234");
}
private enum ctfpMessage = "Cannot format floating point types at compile-time";
/*
Floating-point values are formatted like $(REF printf, core, stdc, stdio)
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(FloatingPointTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
import std.algorithm.comparison : min;
import std.algorithm.searching : find;
import std.string : indexOf, indexOfAny, indexOfNeither;
import std.math : isInfinity, isNaN, signbit;
import std.ascii : isUpper;
string nanInfStr(scope const ref FormatSpec!Char f, const bool nan,
const bool inf, const int sb, const bool up) @safe pure nothrow
{
return nan
? up
? sb ? "-NAN" : f.flPlus ? "+NAN" : "NAN"
: sb ? "-nan" : f.flPlus ? "+nan" : "nan"
: inf
? up
? sb ? "-INF" : f.flPlus ? "+INF" : "INF"
: sb ? "-inf" : f.flPlus ? "+inf" : "inf"
: "";
}
FloatingPointTypeOf!T val = obj;
const char spec = f.spec;
if (spec == 'r')
{
// raw write, skip all else and write the thing
auto raw = (ref val)@trusted{
return (cast(const char*) &val)[0 .. val.sizeof];
}(val);
if (needToSwapEndianess(f))
{
foreach_reverse (c; raw)
put(w, c);
}
else
{
foreach (c; raw)
put(w, c);
}
return;
}
enforceFmt(find("fgFGaAeEs", spec).length,
"incompatible format character for floating point argument: %" ~ spec);
enforceFmt(!__ctfe, ctfpMessage);
version (CRuntime_Microsoft)
{
// convert early to get "inf" in case of overflow
// windows handels inf and nan strange
// https://devblogs.microsoft.com/oldnewthing/20130228-01/?p=5103
immutable double tval = val;
}
else
{
alias tval = val;
}
const nan = isNaN(tval);
const inf = isInfinity(tval);
if (nan || inf)
{
const sb = signbit(tval);
const up = isUpper(spec);
string ns = nanInfStr(f, nan, inf, sb, up);
FormatSpec!Char co;
co.spec = 's';
co.width = f.width;
co.flDash = f.flDash;
formatValue(w, ns, co);
return;
}
FormatSpec!Char fs = f; // fs is copy for change its values.
const spec2 = spec == 's' ? 'g' : spec;
char[1 /*%*/ + 5 /*flags*/ + 3 /*width.prec*/ + 2 /*format*/
+ 1 /*\0*/] sprintfSpec = 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++] = spec2;
sprintfSpec[i] = 0;
//printf("format: '%s'; geeba: %g\n", sprintfSpec.ptr, val);
char[512] buf = void;
//writefln("'%s'", sprintfSpec[0 .. i]);
immutable n = ()@trusted{
import core.stdc.stdio : snprintf;
return snprintf(buf.ptr, buf.length,
sprintfSpec.ptr,
fs.width,
// negative precision is same as no precision specified
fs.precision == fs.UNSPECIFIED ? -1 : fs.precision,
tval);
}();
enforceFmt(n >= 0,
"floating point formatting failure");
size_t len = min(n, buf.length-1);
if (fs.flSeparator)
{
ptrdiff_t indexOfRemovable()
{
if (len < 2)
return -1;
size_t start = (buf[0 .. 1].indexOfAny(" 0123456789") == -1) ? 1 : 0;
if (len < 2 + start)
return -1;
if ((buf[start] == ' ') || (buf[start] == '0' && buf[start + 1] != '.'))
return start;
return -1;
}
ptrdiff_t dot, firstDigit, ePos, dotIdx, firstLen;
size_t separatorScoreCnt;
while (true)
{
dot = buf[0 .. len].indexOf('.');
firstDigit = buf[0 .. len].indexOfAny("0123456789");
ePos = buf[0 .. len].indexOf('e');
dotIdx = dot == -1 ? ePos == -1 ? len : ePos : dot;
firstLen = dotIdx - firstDigit;
separatorScoreCnt = (firstLen > 0) ? (firstLen - 1) / fs.separators : 0;
ptrdiff_t removableIdx = (len + separatorScoreCnt > fs.width) ? indexOfRemovable() : -1;
if ((removableIdx != -1) &&
((firstLen - (buf[removableIdx] == '0' ? 2 : 1)) / fs.separators + len - 1 >= fs.width))
{
buf[removableIdx .. $ - 1] = buf.dup[removableIdx + 1 .. $];
len--;
}
else
break;
}
immutable afterDotIdx = (ePos != -1) ? ePos : len;
// plus, minus, prefix
if (firstDigit > 0)
{
put(w, buf[0 .. firstDigit]);
}
// digits until dot with separator
for (auto j = 0; j < firstLen; ++j)
{
if (j > 0 && (firstLen - j) % fs.separators == 0)
{
put(w, fs.separatorChar);
}
put(w, buf[j + firstDigit]);
}
// print dot for decimal numbers only or with '#' format specifier
if (dot != -1 || fs.flHash)
{
put(w, '.');
}
// digits after dot
for (auto j = dotIdx + 1; j < afterDotIdx; ++j)
{
put(w, buf[j]);
}
// rest
if (ePos != -1)
{
put(w, buf[afterDotIdx .. len]);
}
}
else
{
put(w, buf[0 .. len]);
}
}
@safe unittest
{
assert(format("%.1f", 1337.7) == "1337.7");
assert(format("%,3.2f", 1331.982) == "1,331.98");
assert(format("%,3.0f", 1303.1982) == "1,303");
assert(format("%#,3.4f", 1303.1982) == "1,303.1982");
assert(format("%#,3.0f", 1303.1982) == "1,303.");
}
@safe /*pure*/ unittest // formatting floating point values is now impure
{
import std.conv : to;
assert(collectExceptionMsg!FormatException(format("%d", 5.1)).back == 'd');
static foreach (T; AliasSeq!(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" );
formatTest( T.nan, "nan" );
}
}
@system 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" );
}
// bugzilla 19939
@safe unittest
{
assert(format("^%13,3.2f$", 1.00) == "^ 1.00$");
assert(format("^%13,3.2f$", 10.00) == "^ 10.00$");
assert(format("^%13,3.2f$", 100.00) == "^ 100.00$");
assert(format("^%13,3.2f$", 1_000.00) == "^ 1,000.00$");
assert(format("^%13,3.2f$", 10_000.00) == "^ 10,000.00$");
assert(format("^%13,3.2f$", 100_000.00) == "^ 100,000.00$");
assert(format("^%13,3.2f$", 1_000_000.00) == "^ 1,000,000.00$");
assert(format("^%13,3.2f$", 10_000_000.00) == "^10,000,000.00$");
}
// bugzilla 20069
@safe unittest
{
assert(format("%012,f", -1234.0) == "-1,234.000000");
assert(format("%013,f", -1234.0) == "-1,234.000000");
assert(format("%014,f", -1234.0) == "-01,234.000000");
assert(format("%011,f", 1234.0) == "1,234.000000");
assert(format("%012,f", 1234.0) == "1,234.000000");
assert(format("%013,f", 1234.0) == "01,234.000000");
assert(format("%014,f", 1234.0) == "001,234.000000");
assert(format("%015,f", 1234.0) == "0,001,234.000000");
assert(format("%016,f", 1234.0) == "0,001,234.000000");
assert(format( "%08,.2f", -1234.0) == "-1,234.00");
assert(format( "%09,.2f", -1234.0) == "-1,234.00");
assert(format("%010,.2f", -1234.0) == "-01,234.00");
assert(format("%011,.2f", -1234.0) == "-001,234.00");
assert(format("%012,.2f", -1234.0) == "-0,001,234.00");
assert(format("%013,.2f", -1234.0) == "-0,001,234.00");
assert(format("%014,.2f", -1234.0) == "-00,001,234.00");
assert(format( "%08,.2f", 1234.0) == "1,234.00");
assert(format( "%09,.2f", 1234.0) == "01,234.00");
assert(format("%010,.2f", 1234.0) == "001,234.00");
assert(format("%011,.2f", 1234.0) == "0,001,234.00");
assert(format("%012,.2f", 1234.0) == "0,001,234.00");
assert(format("%013,.2f", 1234.0) == "00,001,234.00");
assert(format("%014,.2f", 1234.0) == "000,001,234.00");
assert(format("%015,.2f", 1234.0) == "0,000,001,234.00");
assert(format("%016,.2f", 1234.0) == "0,000,001,234.00");
}
/*
Formatting a `creal` is deprecated but still kept around for a while.
*/
deprecated("Use of complex types is deprecated. Use std.complex")
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(Unqual!T : creal) && !is(T == enum) && !hasToString!(T, Char))
{
immutable creal val = obj;
formatValueImpl(w, val.re, f);
if (val.im >= 0)
{
put(w, '+');
}
formatValueImpl(w, val.im, f);
put(w, 'i');
}
version (TestComplex)
deprecated
@safe /*pure*/ unittest // formatting floating point values is now impure
{
import std.conv : to;
static foreach (T; AliasSeq!(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" );
}
static foreach (T; AliasSeq!(cfloat, cdouble, creal))
{
formatTest( to!( T)(0 - 3i), "0-3i" );
formatTest( to!( const T)(0 - 3i), "0-3i" );
formatTest( to!(immutable T)(0 - 3i), "0-3i" );
}
}
version (TestComplex)
deprecated
@system 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 `ireal` is deprecated but still kept around for a while.
*/
deprecated("Use of imaginary types is deprecated. Use std.complex")
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(Unqual!T : ireal) && !is(T == enum) && !hasToString!(T, Char))
{
immutable ireal val = obj;
formatValueImpl(w, val.im, f);
put(w, 'i');
}
version (TestComplex)
deprecated
@safe /*pure*/ unittest // formatting floating point values is now impure
{
import std.conv : to;
static foreach (T; AliasSeq!(ifloat, idouble, ireal))
{
formatTest( to!( T)(1i), "1i" );
formatTest( to!( const T)(1i), "1i" );
formatTest( to!(immutable T)(1i), "1i" );
}
}
version (TestComplex)
deprecated
@system 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 are formatted as Unicode characters with `%s`
and as integers with integral-specific format specs
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(CharTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
CharTypeOf!T val = obj;
if (f.spec == 's' || f.spec == 'c')
{
put(w, val);
}
else
{
alias U = AliasSeq!(ubyte, ushort, uint)[CharTypeOf!T.sizeof/2];
formatValueImpl(w, cast(U) val, f);
}
}
@safe pure unittest
{
assertCTFEable!(
{
formatTest( 'c', "c" );
});
}
@system unittest
{
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" );
}
@safe unittest
{
//Little Endian
formatTest( "%-r", cast( char)'c', ['c' ] );
formatTest( "%-r", cast(wchar)'c', ['c', 0 ] );
formatTest( "%-r", cast(dchar)'c', ['c', 0, 0, 0] );
formatTest( "%-r", '本', ['\x2c', '\x67'] );
//Big Endian
formatTest( "%+r", cast( char)'c', [ 'c'] );
formatTest( "%+r", cast(wchar)'c', [0, 'c'] );
formatTest( "%+r", cast(dchar)'c', [0, 0, 0, 'c'] );
formatTest( "%+r", '本', ['\x67', '\x2c'] );
}
/*
Strings are formatted like $(REF printf, core, stdc, stdio)
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, scope T obj, scope const ref FormatSpec!Char f)
if (is(StringTypeOf!T) && !is(StaticArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
Unqual!(StringTypeOf!T) val = obj; // for `alias this`, see bug5371
formatRange(w, val, f);
}
@safe unittest
{
formatTest( "abc", "abc" );
}
@system 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" );
}
@system 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" );
}
@safe pure unittest
{
//Little Endian
formatTest( "%-r", "ab"c, ['a' , 'b' ] );
formatTest( "%-r", "ab"w, ['a', 0 , 'b', 0 ] );
formatTest( "%-r", "ab"d, ['a', 0, 0, 0, 'b', 0, 0, 0] );
formatTest( "%-r", "日本語"c, ['\xe6', '\x97', '\xa5', '\xe6', '\x9c', '\xac', '\xe8', '\xaa', '\x9e'] );
formatTest( "%-r", "日本語"w, ['\xe5', '\x65', '\x2c', '\x67', '\x9e', '\x8a']);
formatTest( "%-r", "日本語"d, ['\xe5', '\x65', '\x00', '\x00', '\x2c', '\x67',
'\x00', '\x00', '\x9e', '\x8a', '\x00', '\x00'] );
//Big Endian
formatTest( "%+r", "ab"c, [ 'a', 'b'] );
formatTest( "%+r", "ab"w, [ 0, 'a', 0, 'b'] );
formatTest( "%+r", "ab"d, [0, 0, 0, 'a', 0, 0, 0, 'b'] );
formatTest( "%+r", "日本語"c, ['\xe6', '\x97', '\xa5', '\xe6', '\x9c', '\xac', '\xe8', '\xaa', '\x9e'] );
formatTest( "%+r", "日本語"w, ['\x65', '\xe5', '\x67', '\x2c', '\x8a', '\x9e'] );
formatTest( "%+r", "日本語"d, ['\x00', '\x00', '\x65', '\xe5', '\x00', '\x00',
'\x67', '\x2c', '\x00', '\x00', '\x8a', '\x9e'] );
}
/*
Static-size arrays are formatted as dynamic arrays.
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, auto ref T obj, scope const ref FormatSpec!Char f)
if (is(StaticArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
formatValueImpl(w, obj[], f);
}
@safe unittest // Test for issue 8310
{
import std.array : appender;
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.
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(DynamicArrayTypeOf!T) && !is(StringTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
static if (is(const(ArrayTypeOf!T) == const(void[])))
{
formatValueImpl(w, cast(const ubyte[]) obj, f);
}
else static if (!isInputRange!T)
{
alias U = Unqual!(ArrayTypeOf!T);
static assert(isInputRange!U, U.stringof ~ " must be an InputRange");
U val = obj;
formatValueImpl(w, val, f);
}
else
{
formatRange(w, obj, f);
}
}
// alias this, input range I/F, and toString()
@system unittest
{
struct S(int 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");
}
@system 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]" );
}
@safe 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]" );
}
@safe unittest
{
// 6640
struct Range
{
@safe:
string value;
@property bool empty() const { return !value.length; }
@property dchar front() const { return value.front; }
void popFront() { value.popFront(); }
@property size_t length() const { 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]);
}
}
@system unittest
{
// string literal from valid UTF sequence is encoding free.
static foreach (StrType; AliasSeq!(string, wstring, dstring))
{
// Valid and printable (ASCII)
formatTest( [cast(StrType)"hello"],
`["hello"]` );
// 1 character escape sequences (' is not escaped in strings)
formatTest( [cast(StrType)"\"'\0\\\a\b\f\n\r\t\v"],
`["\"'\0\\\a\b\f\n\r\t\v"]` );
// 1 character optional escape sequences
formatTest( [cast(StrType)"\'\?"],
`["'?"]` );
// Valid and non-printable code point (<= U+FF)
formatTest( [cast(StrType)"\x10\x1F\x20test"],
`["\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]` );
}
}
@safe unittest
{
// nested range formatting with array of string
formatTest( "%({%(%02x %)}%| %)", ["test", "msg"],
`{74 65 73 74} {6d 73 67}` );
}
@safe 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"`, `2:"world", 1:"hello"`] );
formatTest( "%-(%s:%s, %)", aa1, [`1:hello, 2:world`, `2:world, 1:hello`] );
auto aa2 = [1:["ab", "cd"], 2:["ef", "gh"]];
formatTest( "%-(%s:%s, %)", aa2, [`1:["ab", "cd"], 2:["ef", "gh"]`, `2:["ef", "gh"], 1:["ab", "cd"]`] );
formatTest( "%-(%s:%(%s%), %)", aa2, [`1:"ab""cd", 2:"ef""gh"`, `2:"ef""gh", 1:"ab""cd"`] );
formatTest( "%-(%s:%-(%s%)%|, %)", aa2, [`1:abcd, 2:efgh`, `2:efgh, 1:abcd`] );
}
// input range formatting
private void formatRange(Writer, T, Char)(ref Writer w, ref T val, scope const ref FormatSpec!Char f)
if (isInputRange!T)
{
// in this mode, we just want to do a representative print to discover if the format spec is valid
enum formatTestMode = is(Writer == NoOpSink);
import std.conv : text;
// Formatting character ranges like string
if (f.spec == 's')
{
alias E = ElementType!T;
static if (!is(E == enum) && is(CharTypeOf!E))
{
static if (is(StringTypeOf!T))
{
scope s = val[0 .. f.precision < $ ? f.precision : $];
size_t width;
if (f.width > 0)
{
// strings that are fully made of ASCII characters
// can be aligned w/o graphemeStride
bool onlyAscii = true;
for (size_t i; i < s.length; i++)
{
if (s[i] > 0x7F)
{
onlyAscii = false;
break;
}
}
if (!onlyAscii)
{
//TODO: optimize this
import std.uni : graphemeStride;
for (size_t i; i < s.length; i += graphemeStride(s, i))
width++;
}
else width = s.length;
}
else width = s.length;
if (!f.flDash)
{
// right align
if (f.width > width)
foreach (i ; 0 .. f.width - width) put(w, ' ');
put(w, s);
}
else
{
// left align
put(w, s);
if (f.width > width)
foreach (i ; 0 .. f.width - width) put(w, ' ');
}
}
else
{
if (!f.flDash)
{
static if (hasLength!T)
{
// right align
auto len = val.length;
}
else static if (isForwardRange!T && !isInfinite!T)
{
auto len = walkLength(val.save);
}
else
{
enforceFmt(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);
static if (formatTestMode) break; // one is enough to test
}
}
}
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, ' ');
}
}
}
else
{
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 (formatTestMode) break; // one is enough to test
}
}
static if (!isInfinite!T) put(w, f.seqAfter);
}
}
else if (f.spec == 'r')
{
static if (is(DynamicArrayTypeOf!T))
{
alias ARR = DynamicArrayTypeOf!T;
scope a = cast(ARR) val;
foreach (e ; a)
{
formatValue(w, e, f);
static if (formatTestMode) break; // one is enough to test
}
}
else
{
for (size_t i; !val.empty; val.popFront(), ++i)
{
formatValue(w, val.front, f);
static if (formatTestMode) break; // one is enough to test
}
}
}
else if (f.spec == '(')
{
if (val.empty)
return;
// Nested specifier is to be used
for (;;)
{
auto fmt = FormatSpec!Char(f.nested);
w: while (true)
{
immutable r = fmt.writeUpToNextSpec(w);
// There was no format specifier, so break
if (!r)
break;
if (f.flDash)
formatValue(w, val.front, fmt);
else
formatElement(w, val.front, fmt);
// Check if there will be a format specifier farther on in the
// string. If so, continue the loop, otherwise break. This
// prevents extra copies of the `sep` from showing up.
foreach (size_t i; 0 .. fmt.trailing.length)
if (fmt.trailing[i] == '%')
continue w;
break w;
}
static if (formatTestMode)
{
break; // one is enough to test
}
else
{
if (f.sep !is null)
{
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 FormatException(text("Incorrect format specifier for range: %", f.spec));
}
@safe pure unittest // Issue 18778
{
assert(format("%-(%1$s - %1$s, %)", ["A", "B", "C"]) == "A - A, B - B, C - C");
}
@safe pure unittest
{
assert(collectExceptionMsg(format("%d", "hi")).back == 'd');
}
// character formatting with ecaping
private void formatChar(Writer)(ref Writer w, in dchar c, in char quote)
{
import std.uni : isGraphical;
string fmt;
if (isGraphical(c))
{
if (c == quote || c == '\\')
put(w, '\\');
put(w, c);
return;
}
else if (c <= 0xFF)
{
if (c < 0x20)
{
foreach (i, k; "\n\r\t\a\b\f\v\0")
{
if (c == k)
{
put(w, '\\');
put(w, "nrtabfv0"[i]);
return;
}
}
}
fmt = "\\x%02X";
}
else if (c <= 0xFFFF)
fmt = "\\u%04X";
else
fmt = "\\U%08X";
formattedWrite(w, fmt, cast(uint) c);
}
// undocumented because of deprecation
// string elements are formatted like UTF-8 string literals.
void formatElement(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(StringTypeOf!T) && !is(T == enum))
{
import std.array : appender;
import std.utf : decode, UTFException;
StringTypeOf!T str = val; // bug 8015
if (f.spec == 's')
{
try
{
// ignore other specifications and quote
for (size_t i = 0; i < str.length; )
{
auto c = decode(str, i);
// \uFFFE and \uFFFF are considered valid by isValidDchar,
// so need checking for interchange.
if (c == 0xFFFE || c == 0xFFFF)
goto LinvalidSeq;
}
put(w, '\"');
for (size_t i = 0; i < str.length; )
{
auto c = decode(str, i);
formatChar(w, c, '"');
}
put(w, '\"');
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 IntArr = const(ubyte)[];
}
else static if (is(typeof(str[0]) : const(wchar)))
{
enum postfix = 'w';
alias IntArr = const(ushort)[];
}
else static if (is(typeof(str[0]) : const(dchar)))
{
enum postfix = 'd';
alias IntArr = const(uint)[];
}
formattedWrite(w, "x\"%(%02X %)\"%s", cast(IntArr) str, postfix);
}
else
formatValue(w, str, f);
}
@safe pure unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
formatElement(w, "Hello World", spec);
assert(w.data == "\"Hello World\"");
}
@safe unittest
{
// Test for bug 8015
import std.typecons;
struct MyStruct {
string str;
@property string toStr() {
return str;
}
alias toStr this;
}
Tuple!(MyStruct) t;
}
// undocumented because of deprecation
// Character elements are formatted like UTF-8 character literals.
void formatElement(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(CharTypeOf!T) && !is(T == enum))
{
if (f.spec == 's')
{
put(w, '\'');
formatChar(w, val, '\'');
put(w, '\'');
}
else
formatValue(w, val, f);
}
///
@safe unittest
{
import std.array : appender;
auto w = appender!string();
auto spec = singleSpec("%s");
formatElement(w, "H", spec);
assert(w.data == "\"H\"", w.data);
}
// undocumented
// Maybe T is noncopyable struct, so receive it by 'auto ref'.
void formatElement(Writer, T, Char)(auto ref Writer w, auto ref T val, scope const ref FormatSpec!Char f)
if (!is(StringTypeOf!T) && !is(CharTypeOf!T) || is(T == enum))
{
formatValue(w, val, f);
}
/*
Associative arrays are formatted by using `':'` and $(D ", ") as
separators, and enclosed by `'['` and `']'`.
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T obj, scope const ref FormatSpec!Char f)
if (is(AssocArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
{
AssocArrayTypeOf!T val = obj;
const spec = f.spec;
enforceFmt(spec == 's' || spec == '(',
"incompatible format character for associative array argument: %" ~ spec);
enum const(Char)[] defSpec = "%s" ~ f.keySeparator ~ "%s" ~ f.seqSeparator;
auto fmtSpec = spec == '(' ? f.nested : defSpec;
size_t i = 0;
immutable end = val.length;
if (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 !is null)
{
fmt.writeUpToNextSpec(w);
if (++i != end)
put(w, f.sep);
}
else
{
if (++i != end)
fmt.writeUpToNextSpec(w);
}
}
if (spec == 's')
put(w, f.seqAfter);
}
@safe unittest
{
assert(collectExceptionMsg!FormatException(format("%d", [0:1])).back == 'd');
int[string] aa0;
formatTest( aa0, `[]` );
// elements escaping
formatTest( ["aaa":1, "bbb":2],
[`["aaa":1, "bbb":2]`, `["bbb":2, "aaa":1]`] );
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"}`, `{2:"world" $ 1:"hello"}`]);
// 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]}`, `{[0002->w.o.r.l.d] $ [0001->h.e.l.l.o]}`] );
// issue 12135
formatTest("%(%s:<%s>%|,%)", [1:2], "1:<2>");
formatTest("%(%s:<%s>%|%)" , [1:2], "1:<2>");
}
@system 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]`, `['d':2, 'c':1]`] );
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]`, `['d':2, 'c':1]`] );
formatTest( S2(['c':1, 'd':2]), "S" );
}
@safe unittest // Issue 8921
{
enum E : char { A = 'a', B = 'b', C = 'c' }
E[3] e = [E.A, E.B, E.C];
formatTest(e, "[A, B, C]");
E[] e2 = [E.A, E.B, E.C];
formatTest(e2, "[A, B, C]");
}
private enum HasToStringResult
{
none,
hasSomeToString,
constCharSink,
constCharSinkFormatString,
constCharSinkFormatSpec,
customPutWriter,
customPutWriterFormatSpec,
}
private 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 = HasToStringResult.none;
}
else static if (is(typeof(
{T val = void;
const FormatSpec!Char f;
static struct S {void put(scope Char s){}}
S s;
val.toString(s, f);
// force toString to take parameters by ref
static assert(!__traits(compiles, val.toString(s, FormatSpec!Char())));
static assert(!__traits(compiles, val.toString(S(), f)));}
)))
{
enum hasToString = HasToStringResult.customPutWriterFormatSpec;
}
else static if (is(typeof(
{T val = void;
static struct S {void put(scope Char s){}}
S s;
val.toString(s);
// force toString to take parameters by ref
static assert(!__traits(compiles, val.toString(S())));}
)))
{
enum hasToString = HasToStringResult.customPutWriter;
}
else static if (is(typeof({ T val = void; FormatSpec!Char f; val.toString((scope const(char)[] s){}, f); })))
{
enum hasToString = HasToStringResult.constCharSinkFormatSpec;
}
else static if (is(typeof({ T val = void; val.toString((scope const(char)[] s){}, "%s"); })))
{
enum hasToString = HasToStringResult.constCharSinkFormatString;
}
else static if (is(typeof({ T val = void; val.toString((scope const(char)[] s){}); })))
{
enum hasToString = HasToStringResult.constCharSink;
}
else static if (is(typeof({ T val = void; return val.toString(); }()) S) && isSomeString!S)
{
enum hasToString = HasToStringResult.hasSomeToString;
}
else
{
enum hasToString = HasToStringResult.none;
}
}
@safe unittest
{
static struct A
{
void toString(Writer)(ref Writer w)
if (isOutputRange!(Writer, string))
{}
}
static struct B
{
void toString(scope void delegate(scope const(char)[]) sink, scope FormatSpec!char fmt) {}
}
static struct C
{
void toString(scope void delegate(scope const(char)[]) sink, string fmt) {}
}
static struct D
{
void toString(scope void delegate(scope const(char)[]) sink) {}
}
static struct E
{
string toString() {return "";}
}
static struct F
{
void toString(Writer)(ref Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct G
{
string toString() {return "";}
void toString(Writer)(ref Writer w) if (isOutputRange!(Writer, string)) {}
}
static struct H
{
string toString() {return "";}
void toString(Writer)(ref Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct I
{
void toString(Writer)(ref Writer w) if (isOutputRange!(Writer, string)) {}
void toString(Writer)(ref Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct J
{
string toString() {return "";}
void toString(Writer)(ref Writer w, scope ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct K
{
void toString(Writer)(Writer w, scope const ref FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
static struct L
{
void toString(Writer)(ref Writer w, scope const FormatSpec!char fmt)
if (isOutputRange!(Writer, string))
{}
}
with(HasToStringResult)
{
static assert(hasToString!(A, char) == customPutWriter);
static assert(hasToString!(B, char) == constCharSinkFormatSpec);
static assert(hasToString!(C, char) == constCharSinkFormatString);
static assert(hasToString!(D, char) == constCharSink);
static assert(hasToString!(E, char) == hasSomeToString);
static assert(hasToString!(F, char) == customPutWriterFormatSpec);
static assert(hasToString!(G, char) == customPutWriter);
static assert(hasToString!(H, char) == customPutWriterFormatSpec);
static assert(hasToString!(I, char) == customPutWriterFormatSpec);
static assert(hasToString!(J, char) == hasSomeToString);
static assert(hasToString!(K, char) == constCharSinkFormatSpec);
static assert(hasToString!(L, char) == none);
}
}
// Like NullSink, but toString() isn't even called at all. Used to test the format string.
private struct NoOpSink
{
void put(E)(scope const E) pure @safe @nogc nothrow {}
}
// object formatting with toString
private void formatObject(Writer, T, Char)(ref Writer w, ref T val, scope const ref FormatSpec!Char f)
if (hasToString!(T, Char))
{
enum overload = hasToString!(T, Char);
enum noop = is(Writer == NoOpSink);
static if (overload == HasToStringResult.customPutWriterFormatSpec)
{
static if (!noop) val.toString(w, f);
}
else static if (overload == HasToStringResult.customPutWriter)
{
static if (!noop) val.toString(w);
}
else static if (overload == HasToStringResult.constCharSinkFormatSpec)
{
static if (!noop) val.toString((scope const(char)[] s) { put(w, s); }, f);
}
else static if (overload == HasToStringResult.constCharSinkFormatString)
{
static if (!noop) val.toString((scope const(char)[] s) { put(w, s); }, f.getCurFmtStr());
}
else static if (overload == HasToStringResult.constCharSink)
{
static if (!noop) val.toString((scope const(char)[] s) { put(w, s); });
}
else static if (overload == HasToStringResult.hasSomeToString)
{
static if (!noop) put(w, val.toString());
}
else
{
static assert(0, "No way found to format " ~ T.stringof ~ " as string");
}
}
void enforceValidFormatSpec(T, Char)(scope const ref FormatSpec!Char f)
{
enum overload = hasToString!(T, Char);
static if (!isInputRange!T &&
overload != HasToStringResult.constCharSinkFormatSpec &&
overload != HasToStringResult.customPutWriterFormatSpec)
{
enforceFmt(f.spec == 's',
"Expected '%s' format specifier for type '" ~ T.stringof ~ "'");
}
}
@system unittest
{
static interface IF1 { }
class CIF1 : IF1 { }
static struct SF1 { }
static union UF1 { }
static class CF1 { }
static interface IF2 { string toString(); }
static class CIF2 : IF2 { override string toString() { return ""; } }
static struct SF2 { string toString() { return ""; } }
static union UF2 { string toString() { return ""; } }
static class CF2 { override string toString() { return ""; } }
static interface IK1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const; }
static class CIK1 : IK1 { override void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("CIK1"); } }
static struct KS1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("KS1"); } }
static union KU1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("KU1"); } }
static class KC1 { void toString(scope void delegate(scope const(char)[]) sink,
FormatSpec!char) const { sink("KC1"); } }
IF1 cif1 = new CIF1;
assertThrown!FormatException(format("%f", cif1));
assertThrown!FormatException(format("%f", SF1()));
assertThrown!FormatException(format("%f", UF1()));
assertThrown!FormatException(format("%f", new CF1()));
IF2 cif2 = new CIF2;
assertThrown!FormatException(format("%f", cif2));
assertThrown!FormatException(format("%f", SF2()));
assertThrown!FormatException(format("%f", UF2()));
assertThrown!FormatException(format("%f", new CF2()));
IK1 cik1 = new CIK1;
assert(format("%f", cik1) == "CIK1");
assert(format("%f", KS1()) == "KS1");
assert(format("%f", KU1()) == "KU1");
assert(format("%f", new KC1()) == "KC1");
}
/*
Aggregates
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(T == class) && !is(T == enum))
{
enforceValidFormatSpec!(T, Char)(f);
// TODO: remove this check once `@disable override` deprecation cycle is finished
static if (__traits(hasMember, T, "toString") && isSomeFunction!(val.toString))
static assert(!__traits(isDisabled, T.toString), T.stringof ~
" cannot be formatted because its `toString` is marked with `@disable`");
if (val is null)
put(w, "null");
else
{
import std.algorithm.comparison : among;
enum overload = hasToString!(T, Char);
with(HasToStringResult)
static if ((is(T == immutable) || is(T == const) || is(T == shared)) && overload == none)
{
// issue 7879, remove this when Object gets const toString
static if (is(T == immutable))
put(w, "immutable(");
else static if (is(T == const))
put(w, "const(");
else static if (is(T == shared))
put(w, "shared(");
put(w, typeid(Unqual!T).name);
put(w, ')');
}
else static if (overload.among(constCharSink, constCharSinkFormatString, constCharSinkFormatSpec) ||
(!isInputRange!T && !is(BuiltinTypeOf!T)))
{
formatObject!(Writer, T, Char)(w, val, f);
}
else
{
//string delegate() dg = &val.toString;
Object o = val; // workaround
string delegate() dg = &o.toString;
scope Object object = new Object();
if (dg.funcptr != (&object.toString).funcptr) // 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;
formatValueImpl(w, x, f);
}
else
{
formatObject(w, val, f);
}
}
}
}
@system unittest
{
import std.array : appender;
import std.range.interfaces;
// 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" );
}
@system 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(scope const(char)[]) dg,
scope const 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]" );
}
// outside the unittest block, otherwise the FQN of the
// class contains the line number of the unittest
version (unittest)
{
private class C {}
}
// issue 7879
@safe unittest
{
const(C) c;
auto s = format("%s", c);
assert(s == "null");
immutable(C) c2 = new C();
s = format("%s", c2);
assert(s == "immutable(std.format.C)");
const(C) c3 = new C();
s = format("%s", c3);
assert(s == "const(std.format.C)");
shared(C) c4 = new C();
s = format("%s", c4);
assert(s == "shared(std.format.C)");
}
// https://issues.dlang.org/show_bug.cgi?id=19003
@safe unittest
{
struct S
{
int i;
@disable this();
invariant { assert(this.i); }
this(int i) @safe in { assert(i); } do { this.i = i; }
string toString() { return "S"; }
}
S s = S(1);
format!"%s"(s);
}
// https://issues.dlang.org/show_bug.cgi?id=20218
@safe pure unittest
{
void notCalled()
{
import std.range : repeat;
auto value = 1.repeat;
// test that range is not evaluated to completion at compiletime
format!"%s"(value);
}
}
// https://issues.dlang.org/show_bug.cgi?id=7879
@safe unittest
{
class F
{
override string toString() const @safe
{
return "Foo";
}
}
const(F) c;
auto s = format("%s", c);
assert(s == "null");
const(F) c2 = new F();
s = format("%s", c2);
assert(s == "Foo", s);
}
// ditto
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(T == interface) && (hasToString!(T, Char) || !is(BuiltinTypeOf!T)) && !is(T == enum))
{
enforceValidFormatSpec!(T, Char)(f);
if (val is null)
put(w, "null");
else
{
static if (__traits(hasMember, T, "toString") && isSomeFunction!(val.toString))
static assert(!__traits(isDisabled, T.toString), T.stringof ~
" cannot be formatted because its `toString` is marked with `@disable`");
static if (hasToString!(T, Char) != HasToStringResult.none)
{
formatObject(w, val, f);
}
else static if (isInputRange!T)
{
formatRange(w, val, f);
}
else
{
version (Windows)
{
import core.sys.windows.com : IUnknown;
static if (is(T : IUnknown))
{
formatValueImpl(w, *cast(void**)&val, f);
}
else
{
formatValueImpl(w, cast(Object) val, f);
}
}
else
{
formatValueImpl(w, cast(Object) val, f);
}
}
}
}
@system unittest
{
// interface
import std.range.interfaces;
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" );
// Issue 11175
version (Windows)
{
import core.sys.windows.com : IUnknown, IID;
import core.sys.windows.windef : HRESULT;
interface IUnknown2 : IUnknown { }
class D : IUnknown2
{
extern(Windows) HRESULT QueryInterface(const(IID)* riid, void** pvObject) { return typeof(return).init; }
extern(Windows) uint AddRef() { return 0; }
extern(Windows) uint Release() { return 0; }
}
IUnknown2 d = new D;
string expected = format("%X", cast(void*) d);
formatTest(d, expected);
}
}
/// ditto
// Maybe T is noncopyable struct, so receive it by 'auto ref'.
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, auto ref T val, scope const ref FormatSpec!Char f)
if ((is(T == struct) || is(T == union)) && (hasToString!(T, Char) || !is(BuiltinTypeOf!T)) && !is(T == enum))
{
static if (__traits(hasMember, T, "toString") && isSomeFunction!(val.toString))
static assert(!__traits(isDisabled, T.toString), T.stringof ~
" cannot be formatted because its `toString` is marked with `@disable`");
enforceValidFormatSpec!(T, Char)(f);
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);
}
}
@safe 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" );
}
@safe unittest
{
// 3890
struct Int{ int n; }
struct Pair{ string s; Int i; }
formatTest( Pair("hello", Int(5)),
`Pair("hello", Int(5))` );
}
@system 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" );
}
@system unittest
{
import std.array;
// 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)`);
}
@safe unittest
{
import std.array : appender;
static struct S{ @disable this(this); }
S s;
FormatSpec!char f;
auto w = appender!string();
formatValue(w, s, f);
assert(w.data == "S()");
}
@safe unittest
{
//struct Foo { @disable string toString(); }
//Foo foo;
interface Bar { @disable string toString(); }
Bar bar;
import std.array : appender;
auto w = appender!(char[])();
FormatSpec!char f;
// NOTE: structs cant be tested : the assertion is correct so compilation
// continues and fails when trying to link the unimplemented toString.
//static assert(!__traits(compiles, formatValue(w, foo, f)));
static assert(!__traits(compiles, formatValue(w, bar, f)));
}
/*
`enum`s are formatted like their base value
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, T val, scope const ref FormatSpec!Char f)
if (is(T == enum))
{
if (f.spec == 's')
{
foreach (i, e; EnumMembers!T)
{
if (val == e)
{
formatValueImpl(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), "OriginalType!" ~ T.stringof ~
"must not be equal to " ~ T.stringof);
}
formatValueImpl(w, cast(OriginalType!T) val, f);
}
@safe unittest
{
enum A { first, second, third }
formatTest( A.second, "second" );
formatTest( cast(A) 72, "cast(A)72" );
}
@safe unittest
{
enum A : string { one = "uno", two = "dos", three = "tres" }
formatTest( A.three, "three" );
formatTest( cast(A)"mill\ón", "cast(A)mill\ón" );
}
@safe unittest
{
enum A : bool { no, yes }
formatTest( A.yes, "yes" );
formatTest( A.no, "no" );
}
@safe 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.
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, scope T val, scope const ref FormatSpec!Char f)
if (isPointer!T && !is(T == enum) && !hasToString!(T, Char))
{
static if (isInputRange!T)
{
if (val !is null)
{
formatRange(w, *val, f);
return;
}
}
static if (is(typeof({ shared const void* p = val; })))
alias SharedOf(T) = shared(T);
else
alias SharedOf(T) = T;
const SharedOf!(void*) p = val;
const pnum = ()@trusted{ return cast(ulong) p; }();
if (f.spec == 's')
{
if (p is null)
{
put(w, "null");
return;
}
FormatSpec!Char fs = f; // fs is copy for change its values.
fs.spec = 'X';
formatValueImpl(w, pnum, fs);
}
else
{
enforceFmt(f.spec == 'X' || f.spec == 'x',
"Expected one of %s, %x or %X for pointer type.");
formatValueImpl(w, pnum, f);
}
}
/*
SIMD vectors are formatted as arrays.
*/
private void formatValueImpl(Writer, V, Char)(auto ref Writer w, V val, scope const ref FormatSpec!Char f)
if (isSIMDVector!V)
{
formatValueImpl(w, val.array, f);
}
@safe unittest
{
import core.simd;
static if (is(float4))
{
version (X86)
{
version (OSX) {/* issue 17823 */}
}
else
{
float4 f;
f.array[0] = 1;
f.array[1] = 2;
f.array[2] = 3;
f.array[3] = 4;
formatTest(f, "[1, 2, 3, 4]");
}
}
}
@safe pure unittest
{
// pointer
import std.range;
auto r = retro([1,2,3,4]);
auto p = ()@trusted{ auto p = &r; return p; }();
formatTest( p, "[4, 3, 2, 1]" );
assert(p.empty);
p = null;
formatTest( p, "null" );
auto q = ()@trusted{ return cast(void*) 0xFFEECCAA; }();
formatTest( q, "FFEECCAA" );
}
@system pure 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" );
}
@system unittest
{
// Test for issue 8186
class B
{
int*a;
this(){ a = new int; }
alias a this;
}
formatTest( B.init, "null" );
}
@system pure unittest
{
// Test for issue 9336
shared int i;
format("%s", &i);
}
@system pure unittest
{
// Test for issue 11778
int* p = null;
assertThrown!FormatException(format("%d", p));
assertThrown!FormatException(format("%04d", p + 2));
}
@safe pure unittest
{
// Test for issue 12505
void* p = null;
formatTest( "%08X", p, "00000000" );
}
/*
Delegates are formatted by `ReturnType delegate(Parameters) FunctionAttributes`
*/
private void formatValueImpl(Writer, T, Char)(auto ref Writer w, scope T, scope const ref FormatSpec!Char f)
if (isDelegate!T)
{
formatValueImpl(w, T.stringof, f);
}
@safe unittest
{
void func() @system { __gshared int x; ++x; throw new Exception("msg"); }
version (linux) formatTest( &func, "void delegate() @system" );
}
@safe pure 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(string kind, A...)(uint index, A args)
{
return getNth!(kind, isIntegral,int)(index, args);
}
private T getNth(string kind, alias Condition, T, A...)(uint index, A args)
{
import std.conv : text, to;
switch (index)
{
foreach (n, _; A)
{
case n:
static if (Condition!(typeof(args[n])))
{
return to!T(args[n]);
}
else
{
throw new FormatException(
text(kind, " expected, not ", typeof(args[n]).stringof,
" for argument #", index + 1));
}
}
default:
throw new FormatException(
text("Missing ", kind, " argument"));
}
}
@safe unittest
{
// width/precision
assert(collectExceptionMsg!FormatException(format("%*.d", 5.1, 2))
== "integer width expected, not double for argument #1");
assert(collectExceptionMsg!FormatException(format("%-1*.d", 5.1, 2))
== "integer width expected, not double for argument #1");
assert(collectExceptionMsg!FormatException(format("%.*d", '5', 2))
== "integer precision expected, not char for argument #1");
assert(collectExceptionMsg!FormatException(format("%-1.*d", 4.7, 3))
== "integer precision expected, not double for argument #1");
assert(collectExceptionMsg!FormatException(format("%.*d", 5))
== "Orphan format specifier: %d");
assert(collectExceptionMsg!FormatException(format("%*.*d", 5))
== "Missing integer precision argument");
// separatorCharPos
assert(collectExceptionMsg!FormatException(format("%,?d", 5))
== "separator character expected, not int for argument #1");
assert(collectExceptionMsg!FormatException(format("%,?d", '?'))
== "Orphan format specifier: %d");
assert(collectExceptionMsg!FormatException(format("%.*,*?d", 5))
== "Missing separator digit width argument");
}
/* ======================== Unit Tests ====================================== */
version (unittest)
private void formatTest(T)(T val, string expected, size_t ln = __LINE__, string fn = __FILE__)
{
import core.exception : AssertError;
import std.array : appender;
import std.conv : text;
FormatSpec!char f;
auto w = appender!string();
formatValue(w, val, f);
enforce!AssertError(
w.data == expected,
text("expected = `", expected, "`, result = `", w.data, "`"), fn, ln);
}
version (unittest)
private void formatTest(T)(string fmt, T val, string expected, size_t ln = __LINE__, string fn = __FILE__) @safe
{
import core.exception : AssertError;
import std.array : appender;
import std.conv : text;
auto w = appender!string();
formattedWrite(w, fmt, val);
enforce!AssertError(
w.data == expected,
text("expected = `", expected, "`, result = `", w.data, "`"), fn, ln);
}
version (unittest)
private void formatTest(T)(T val, string[] expected, size_t ln = __LINE__, string fn = __FILE__)
{
import core.exception : AssertError;
import std.array : appender;
import std.conv : text;
FormatSpec!char f;
auto w = appender!string();
formatValue(w, val, f);
foreach (cur; expected)
{
if (w.data == cur) return;
}
enforce!AssertError(
false,
text("expected one of `", expected, "`, result = `", w.data, "`"), fn, ln);
}
version (unittest)
private void formatTest(T)(string fmt, T val, string[] expected, size_t ln = __LINE__, string fn = __FILE__) @safe
{
import core.exception : AssertError;
import std.array : appender;
import std.conv : text;
auto w = appender!string();
formattedWrite(w, fmt, val);
foreach (cur; expected)
{
if (w.data == cur) return;
}
enforce!AssertError(
false,
text("expected one of `", expected, "`, result = `", w.data, "`"), fn, ln);
}
@safe /*pure*/ unittest // formatting floating point values is now impure
{
import std.array;
auto stream = appender!string();
formattedWrite(stream, "%s", 1.1);
assert(stream.data == "1.1", stream.data);
}
@safe pure unittest
{
import std.algorithm;
import std.array;
auto 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");
}
@safe pure unittest
{
import std.array;
auto stream = appender!string();
formattedWrite(stream, "%u", 42);
assert(stream.data == "42", stream.data);
}
@safe pure unittest
{
// testing raw writes
import std.array;
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);
}
@safe pure unittest
{
// testing positional parameters
import std.array;
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);
assert(collectExceptionMsg!FormatException(formattedWrite(w, "%1$s, %3$s", 1, 2))
== "Positional specifier %3$s index exceeds 2");
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);
}
@safe unittest
{
import core.stdc.string : strlen;
import std.array : appender;
import std.conv : text, octal;
import core.stdc.stdio : snprintf;
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);
// core.stdc.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 (CRuntime_Glibc)
{
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 version (MinGW)
{
assert(stream.data == "1.67 -0XA.3D70A3D70A3D8P-3 nan",
stream.data);
}
else version (CRuntime_Microsoft)
{
assert(stream.data == "1.67 -0X1.47AE14P+0 nan"
|| stream.data == "1.67 -0X1.47AE147AE147BP+0 nan", // MSVCRT 14+ (VS 2015)
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);
version (CRuntime_Microsoft)
assert(stream.data == "0x1.51eb85p+0 0X1.B1EB86P+2"
|| stream.data == "0x1.51eb851eb851fp+0 0X1.B1EB860000000P+2"); // MSVCRT 14+ (VS 2015)
else
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;
//core.stdc.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");
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:
@trusted void* deadBeef() { return cast(void*) 0xDEADBEEF; }
stream.clear(); formattedWrite(stream, "%s", deadBeef());
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");
@trusted void ObjectTest()
{
Object c = null;
stream.clear(); formattedWrite(stream, "%s", c);
assert(stream.data == "null");
}
ObjectTest();
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);
//core.stdc.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 ~ "<");
}
@safe unittest
{
import std.array;
import std.stdio;
immutable(char[5])[int] aa = ([3:"hello", 4:"betty"]);
assert(aa[3] == "hello");
assert(aa[4] == "betty");
auto stream = appender!(char[])();
alias AllNumerics =
AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong,
float, double, real);
foreach (T; AllNumerics)
{
T value = 1;
stream.clear();
formattedWrite(stream, "%s", value);
assert(stream.data == "1");
}
stream.clear();
formattedWrite(stream, "%s", aa);
}
@system 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)
private void formatReflectTest(T)(ref T val, string fmt, string formatted, string fn = __FILE__, size_t ln = __LINE__)
{
import core.exception : AssertError;
import std.array : appender;
auto w = appender!string();
formattedWrite(w, fmt, val);
auto input = w.data;
enforce!AssertError(
input == formatted,
input, fn, ln);
T val2;
formattedRead(input, fmt, &val2);
static if (isAssociativeArray!T)
if (__ctfe)
{
alias aa1 = val;
alias aa2 = val2;
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;
}
enforce!AssertError(
val == val2,
input, fn, ln);
}
version (unittest)
private void formatReflectTest(T)(ref T val, string fmt, string[] formatted, string fn = __FILE__, size_t ln = __LINE__)
{
import core.exception : AssertError;
import std.array : appender;
auto w = appender!string();
formattedWrite(w, fmt, val);
auto input = w.data;
foreach (cur; formatted)
{
if (input == cur) return;
}
enforce!AssertError(
false,
input,
fn,
ln);
T val2;
formattedRead(input, fmt, &val2);
static if (isAssociativeArray!T)
if (__ctfe)
{
alias aa1 = val;
alias aa2 = val2;
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;
}
enforce!AssertError(
val == val2,
input, fn, ln);
}
@system 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`);
version (MinGW)
formatReflectTest(f, "%e", `3.140000e+000`);
else
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"]`, `[2:"world", 1:"hello"]`]);
formatReflectTest(aa, "[%(%s->%s, %)]", [`[1->"hello", 2->"world"]`, `[2->"world", 1->"hello"]`]);
formatReflectTest(aa, "{%([%s=%(%c%)]%|; %)}", [`{[1=hello]; [2=world]}`, `{[2=world]; [1=hello]}`]);
}
import std.exception;
assertCTFEable!(
{
booleanTest();
integerTest();
if (!__ctfe) floatingTest(); // snprintf
charTest();
strTest();
daTest();
saTest();
aaTest();
return true;
});
}
//------------------------------------------------------------------------------
private void skipData(Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
{
import std.ascii : isDigit;
import std.conv : text;
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 value from the given _input range according to spec
* and returns it as type `T`.
*
* Params:
* T = the type to return
* input = the _input range to read from
* spec = the `FormatSpec` to use when reading from `input`
* Returns:
* A value from `input` of type `T`
* Throws:
* A `FormatException` if `spec` cannot read a type `T`
* See_Also:
* $(REF parse, std, conv) and $(REF to, std, conv)
*/
T unformatValue(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
{
return unformatValueImpl!T(input, spec);
}
/// Booleans
@safe pure unittest
{
auto str = "false";
auto spec = singleSpec("%s");
assert(unformatValue!bool(str, spec) == false);
str = "1";
spec = singleSpec("%d");
assert(unformatValue!bool(str, spec));
}
/// Null values
@safe pure unittest
{
auto str = "null";
auto spec = singleSpec("%s");
assert(str.unformatValue!(typeof(null))(spec) == null);
}
/// Integrals
@safe pure unittest
{
auto str = "123";
auto spec = singleSpec("%s");
assert(str.unformatValue!int(spec) == 123);
str = "ABC";
spec = singleSpec("%X");
assert(str.unformatValue!int(spec) == 2748);
str = "11610";
spec = singleSpec("%o");
assert(str.unformatValue!int(spec) == 5000);
}
/// Floating point numbers
@safe pure unittest
{
import std.math : approxEqual;
auto str = "123.456";
auto spec = singleSpec("%s");
assert(str.unformatValue!double(spec).approxEqual(123.456));
}
/// Character input ranges
@safe pure unittest
{
auto str = "aaa";
auto spec = singleSpec("%s");
assert(str.unformatValue!char(spec) == 'a');
// Using a numerical format spec reads a Unicode value from a string
str = "65";
spec = singleSpec("%d");
assert(str.unformatValue!char(spec) == 'A');
str = "41";
spec = singleSpec("%x");
assert(str.unformatValue!char(spec) == 'A');
str = "10003";
spec = singleSpec("%d");
assert(str.unformatValue!dchar(spec) == '✓');
}
/// Arrays and static arrays
@safe pure unittest
{
string str = "aaa";
auto spec = singleSpec("%s");
assert(str.unformatValue!(dchar[])(spec) == "aaa"d);
str = "aaa";
spec = singleSpec("%s");
dchar[3] ret = ['a', 'a', 'a'];
assert(str.unformatValue!(dchar[3])(spec) == ret);
str = "[1, 2, 3, 4]";
spec = singleSpec("%s");
assert(str.unformatValue!(int[])(spec) == [1, 2, 3, 4]);
str = "[1, 2, 3, 4]";
spec = singleSpec("%s");
int[4] ret2 = [1, 2, 3, 4];
assert(str.unformatValue!(int[4])(spec) == ret2);
}
/// Associative arrays
@safe pure unittest
{
auto str = `["one": 1, "two": 2]`;
auto spec = singleSpec("%s");
assert(str.unformatValue!(int[string])(spec) == ["one": 1, "two": 2]);
}
@safe pure unittest
{
// 7241
string input = "a";
auto spec = FormatSpec!char("%s");
spec.readUpToNextSpec(input);
auto result = unformatValue!(dchar[1])(input, spec);
assert(result[0] == 'a');
}
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
if (isInputRange!Range && is(Unqual!T == bool))
{
import std.algorithm.searching : find;
import std.conv : parse, text;
if (spec.spec == 's') return parse!T(input);
enforceFmt(find(acceptedSpecs!long, spec.spec).length,
text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof));
return unformatValue!long(input, spec) != 0;
}
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
if (isInputRange!Range && is(T == typeof(null)))
{
import std.conv : parse, text;
enforceFmt(spec.spec == 's',
text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof));
return parse!T(input);
}
/// ditto
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
if (isInputRange!Range && isIntegral!T && !is(T == enum) && isSomeChar!(ElementType!Range))
{
import std.algorithm.searching : find;
import std.conv : parse, text;
if (spec.spec == 'r')
{
static if (is(Unqual!(ElementEncodingType!Range) == char)
|| is(Unqual!(ElementEncodingType!Range) == byte)
|| is(Unqual!(ElementEncodingType!Range) == ubyte))
return rawRead!T(input);
else
throw new FormatException(
"The raw read specifier %r may only be used with narrow strings and ranges of bytes."
);
}
enforceFmt(find(acceptedSpecs!T, spec.spec).length,
text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof));
enforceFmt(spec.width == 0, "Parsing integers with a width specification is not implemented"); // TODO
immutable 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, "base must be not equal to zero");
return parse!T(input, base);
}
/// ditto
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
if (isFloatingPoint!T && !is(T == enum) && isInputRange!Range
&& isSomeChar!(ElementType!Range)&& !is(Range == enum))
{
import std.algorithm.searching : find;
import std.conv : parse, text;
if (spec.spec == 'r')
{
static if (is(Unqual!(ElementEncodingType!Range) == char)
|| is(Unqual!(ElementEncodingType!Range) == byte)
|| is(Unqual!(ElementEncodingType!Range) == ubyte))
return rawRead!T(input);
else
throw new FormatException(
"The raw read specifier %r may only be used with narrow strings and ranges of bytes."
);
}
enforceFmt(find(acceptedSpecs!T, spec.spec).length,
text("Wrong unformat specifier '%", spec.spec , "' for ", T.stringof));
return parse!T(input);
}
/// ditto
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
if (isInputRange!Range && isSomeChar!T && !is(T == enum) && isSomeChar!(ElementType!Range))
{
import std.algorithm.searching : find;
import std.conv : to, text;
if (spec.spec == 's' || spec.spec == 'c')
{
auto result = to!T(input.front);
input.popFront();
return result;
}
enforceFmt(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(false, T.stringof ~ ".sizeof must be 1, 2, or 4 not " ~
to!string(T.sizeof));
}
/// ditto
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char fmt)
if (isInputRange!Range && is(StringTypeOf!T) && !isAggregateType!T && !is(T == enum))
{
import std.conv : text;
const spec = fmt.spec;
if (spec == '(')
{
return unformatRange!T(input, fmt);
}
enforceFmt(spec == 's',
text("Wrong unformat specifier '%", spec , "' for ", T.stringof));
static if (isStaticArray!T)
{
T result;
auto app = result[];
}
else
{
import std.array : appender;
auto app = appender!T();
}
if (fmt.trailing.empty)
{
for (; !input.empty; input.popFront())
{
static if (isStaticArray!T)
if (app.empty)
break;
app.put(input.front);
}
}
else
{
immutable end = fmt.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)
{
enforceFmt(app.empty, "need more input");
return result;
}
else
return app.data;
}
/// ditto
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char fmt)
if (isInputRange!Range && isArray!T && !is(StringTypeOf!T) && !isAggregateType!T && !is(T == enum))
{
import std.conv : parse, text;
const spec = fmt.spec;
if (spec == '(')
{
return unformatRange!T(input, fmt);
}
enforceFmt(spec == 's',
text("Wrong unformat specifier '%", spec , "' for ", T.stringof));
return parse!T(input);
}
/// ditto
private T unformatValueImpl(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char fmt)
if (isInputRange!Range && isAssociativeArray!T && !is(T == enum))
{
import std.conv : parse, text;
const spec = fmt.spec;
if (spec == '(')
{
return unformatRange!T(input, fmt);
}
enforceFmt(spec == 's',
text("Wrong unformat specifier '%", spec , "' for ", T.stringof));
return parse!T(input);
}
/**
* Function that performs raw reading. Used by unformatValue
* for integral and float types.
*/
private T rawRead(T, Range)(ref Range input)
if (is(Unqual!(ElementEncodingType!Range) == char)
|| is(Unqual!(ElementEncodingType!Range) == byte)
|| is(Unqual!(ElementEncodingType!Range) == ubyte))
{
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] = input.front;
input.popFront();
}
}
return x.typed;
}
//debug = unformatRange;
private T unformatRange(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
in
{
const char ss = spec.spec;
assert(ss == '(', "spec.spec must be '(' not " ~ ss);
}
do
{
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);
enforceFmt(!input.empty, "Unexpected end of input when parsing range");
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)
{
import std.conv : WideElementType;
result ~= unformatElement!(WideElementType!T)(input, fmt);
}
else static if (isAssociativeArray!T)
{
auto key = unformatElement!(typeof(T.init.keys[0]))(input, fmt);
fmt.readUpToNextSpec(input); // eat key separator
result[key] = unformatElement!(typeof(T.init.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);
enforceFmt(i <= T.length, "Too many format specifiers for static array of length %d".format(T.length));
}
if (spec.sep !is null)
fmt.readUpToNextSpec(input);
auto sep = spec.sep !is null ? 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)
{
enforceFmt(!input.empty, "Unexpected end of input when parsing range separator");
enforceFmt(input.front == sep.front, "Unexpected character when parsing range separator");
input.popFront();
sep.popFront();
}
debug (unformatRange) printf("input.front = %c\n", input.front);
}
}
}
static if (isStaticArray!T)
{
enforceFmt(i == T.length, "Too few (%d) format specifiers for static array of length %d".format(i, T.length));
}
return result;
}
// Undocumented
T unformatElement(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char spec)
if (isInputRange!Range)
{
import std.conv : parseElement;
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
// @@@DEPRECATED_2019-01@@@
deprecated("Use std.demangle")
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',
}
private bool needToSwapEndianess(Char)(scope const ref FormatSpec!Char f)
{
import std.system : endian, Endian;
return endian == Endian.littleEndian && f.flPlus
|| endian == Endian.bigEndian && f.flDash;
}
/* ======================== Unit Tests ====================================== */
@system unittest
{
import std.conv : octal;
int i;
string s;
debug(format) printf("std.format.format.unittest\n");
s = format("hello world! %s %s %s%s%s", true, 57, 1_000_000_000, 'x', " foo");
assert(s == "hello world! true 57 1000000000x foo");
s = format("%s %A %s", 1.67, -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
version (MinGW)
assert(s == "1.67 -0XA.3D70A3D70A3D8P-3 nan", s);
else version (CRuntime_Microsoft)
assert(s == "1.67 -0X1.47AE14P+0 nan"
|| s == "1.67 -0X1.47AE147AE147BP+0 nan", s); // MSVCRT 14+ (VS 2015)
else
assert(s == "1.67 -0X1.47AE147AE147BP+0 nan", s);
s = format("%x %X", 0x1234AF, 0xAFAFAFAF);
assert(s == "1234af AFAFAFAF");
s = format("%b %o", 0x1234AF, 0xAFAFAFAF);
assert(s == "100100011010010101111 25753727657");
s = format("%d %s", 0x1234AF, 0xAFAFAFAF);
assert(s == "1193135 2947526575");
}
version (TestComplex)
deprecated
@system unittest
{
string s = format("%s", 1.2 + 3.4i);
assert(s == "1.2+3.4i", s);
}
@system unittest
{
import std.conv : octal;
string s;
int i;
s = format("%#06.*f",2,12.345);
assert(s == "012.35");
s = format("%#0*.*f",6,2,12.345);
assert(s == "012.35");
s = format("%7.4g:", 12.678);
assert(s == " 12.68:");
s = format("%7.4g:", 12.678L);
assert(s == " 12.68:");
s = format("%04f|%05d|%#05x|%#5x",-4.0,-10,1,1);
assert(s == "-4.000000|-0010|0x001| 0x1");
i = -10;
s = 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 = 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 = 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 = 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 = format("%d|%3d|%03d|%1d|%01.4f",i,i,i,i,cast(double) i);
assert(s == "10| 10|010|10|10.0000");
s = format("%.0d", 0);
assert(s == "");
s = format("%.g", .34);
assert(s == "0.3");
s = format("%.0g", .34);
assert(s == "0.3");
s = format("%.2g", .34);
assert(s == "0.34");
s = format("%0.0008f", 1e-08);
assert(s == "0.00000001");
s = format("%0.0008f", 1e-05);
assert(s == "0.00001000");
s = "helloworld";
string r;
r = format("%.2s", s[0 .. 5]);
assert(r == "he");
r = format("%.20s", s[0 .. 5]);
assert(r == "hello");
r = format("%8s", s[0 .. 5]);
assert(r == " hello");
byte[] arrbyte = new byte[4];
arrbyte[0] = 100;
arrbyte[1] = -99;
arrbyte[3] = 0;
r = format("%s", arrbyte);
assert(r == "[100, -99, 0, 0]");
ubyte[] arrubyte = new ubyte[4];
arrubyte[0] = 100;
arrubyte[1] = 200;
arrubyte[3] = 0;
r = format("%s", arrubyte);
assert(r == "[100, 200, 0, 0]");
short[] arrshort = new short[4];
arrshort[0] = 100;
arrshort[1] = -999;
arrshort[3] = 0;
r = 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 = format("%s", arrushort);
assert(r == "[100, 20000, 0, 0]");
int[] arrint = new int[4];
arrint[0] = 100;
arrint[1] = -999;
arrint[3] = 0;
r = format("%s", arrint);
assert(r == "[100, -999, 0, 0]");
long[] arrlong = new long[4];
arrlong[0] = 100;
arrlong[1] = -999;
arrlong[3] = 0;
r = format("%s", arrlong);
assert(r == "[100, -999, 0, 0]");
ulong[] arrulong = new ulong[4];
arrulong[0] = 100;
arrulong[1] = 999;
arrulong[3] = 0;
r = format("%s", arrulong);
assert(r == "[100, 999, 0, 0]");
string[] arr2 = new string[4];
arr2[0] = "hello";
arr2[1] = "world";
arr2[3] = "foo";
r = format("%s", arr2);
assert(r == `["hello", "world", "", "foo"]`);
r = format("%.8d", 7);
assert(r == "00000007");
r = format("%.8x", 10);
assert(r == "0000000a");
r = format("%-3d", 7);
assert(r == "7 ");
r = format("%-1*d", 4, 3);
assert(r == "3 ");
r = format("%*d", -3, 7);
assert(r == "7 ");
r = format("%.*d", -3, 7);
assert(r == "7");
r = format("%-1.*f", 2, 3.1415);
assert(r == "3.14");
r = format("abc"c);
assert(r == "abc");
//format() returns the same type as inputted.
wstring wr;
wr = format("def"w);
assert(wr == "def"w);
dstring dr;
dr = format("ghi"d);
assert(dr == "ghi"d);
void* p = cast(void*) 0xDEADBEEF;
r = format("%s", p);
assert(r == "DEADBEEF");
r = format("%#x", 0xabcd);
assert(r == "0xabcd");
r = format("%#X", 0xABCD);
assert(r == "0XABCD");
r = format("%#o", octal!12345);
assert(r == "012345");
r = format("%o", 9);
assert(r == "11");
r = format("%#o", 0); // issue 15663
assert(r == "0");
r = format("%+d", 123);
assert(r == "+123");
r = format("%+d", -123);
assert(r == "-123");
r = format("% d", 123);
assert(r == " 123");
r = format("% d", -123);
assert(r == "-123");
r = format("%%");
assert(r == "%");
r = format("%d", true);
assert(r == "1");
r = format("%d", false);
assert(r == "0");
r = format("%d", 'a');
assert(r == "97");
wchar wc = 'a';
r = format("%d", wc);
assert(r == "97");
dchar dc = 'a';
r = format("%d", dc);
assert(r == "97");
byte b = byte.max;
r = format("%x", b);
assert(r == "7f");
r = format("%x", ++b);
assert(r == "80");
r = format("%x", ++b);
assert(r == "81");
short sh = short.max;
r = format("%x", sh);
assert(r == "7fff");
r = format("%x", ++sh);
assert(r == "8000");
r = format("%x", ++sh);
assert(r == "8001");
i = int.max;
r = format("%x", i);
assert(r == "7fffffff");
r = format("%x", ++i);
assert(r == "80000000");
r = format("%x", ++i);
assert(r == "80000001");
r = format("%x", 10);
assert(r == "a");
r = format("%X", 10);
assert(r == "A");
r = format("%x", 15);
assert(r == "f");
r = format("%X", 15);
assert(r == "F");
Object c = null;
r = format("%s", c);
assert(r == "null");
enum TestEnum
{
Value1, Value2
}
r = format("%s", TestEnum.Value2);
assert(r == "Value2");
immutable(char[5])[int] aa = ([3:"hello", 4:"betty"]);
r = format("%s", aa.values);
assert(r == `["hello", "betty"]` || r == `["betty", "hello"]`);
r = format("%s", aa);
assert(r == `[3:"hello", 4:"betty"]` || r == `[4:"betty", 3:"hello"]`);
static const dchar[] ds = ['a','b'];
for (int j = 0; j < ds.length; ++j)
{
r = format(" %d", ds[j]);
if (j == 0)
assert(r == " 97");
else
assert(r == " 98");
}
r = format(">%14d<, %s", 15, [1,2,3]);
assert(r == "> 15<, [1, 2, 3]");
assert(format("%8s", "bar") == " bar");
assert(format("%8s", "b\u00e9ll\u00f4") == " b\u00e9ll\u00f4");
}
@safe pure unittest // bugzilla 18205
{
assert("|%8s|".format("abc") == "| abc|");
assert("|%8s|".format("αβγ") == "| αβγ|");
assert("|%8s|".format(" ") == "| |");
assert("|%8s|".format("été"d) == "| été|");
assert("|%8s|".format("été 2018"w) == "|été 2018|");
assert("%2s".format("e\u0301"w) == " e\u0301");
assert("%2s".format("a\u0310\u0337"d) == " a\u0310\u0337");
}
@safe unittest
{
// bugzilla 3479
import std.array;
auto stream = appender!(char[])();
formattedWrite(stream, "%2$.*1$d", 12, 10);
assert(stream.data == "000000000010", stream.data);
}
@safe unittest
{
// bug 6893
import std.array;
enum E : ulong { A, B, C }
auto stream = appender!(char[])();
formattedWrite(stream, "%s", E.C);
assert(stream.data == "C");
}
// Used to check format strings are compatible with argument types
package static const checkFormatException(alias fmt, Args...) =
{
import std.conv : text;
try
{
auto n = .formattedWrite(NoOpSink(), fmt, Args.init);
enforceFmt(n == Args.length, text("Orphan format arguments: args[", n, "..", Args.length, "]"));
}
catch (Exception e)
return (e.msg == ctfpMessage) ? null : e;
return null;
}();
/**
* Format arguments into a string.
*
* If the format string is fixed, passing it as a template parameter checks the
* type correctness of the parameters at compile-time. This also can result in
* better performance.
*
* Params: fmt = Format string. For detailed specification, see $(LREF formattedWrite).
* args = Variadic list of arguments to format into returned string.
*
* Throws:
* $(LREF, FormatException) if the number of arguments doesn't match the number
* of format parameters and vice-versa.
*/
typeof(fmt) format(alias fmt, Args...)(Args args)
if (isSomeString!(typeof(fmt)))
{
import std.array : appender;
alias e = checkFormatException!(fmt, Args);
alias Char = Unqual!(ElementEncodingType!(typeof(fmt)));
static assert(!e, e.msg);
auto w = appender!(immutable(Char)[]);
// no need to traverse the string twice during compile time
if (!__ctfe)
{
enum len = guessLength!Char(fmt);
w.reserve(len);
}
else
{
w.reserve(fmt.length);
}
formattedWrite(w, fmt, args);
return w.data;
}
/// Type checking can be done when fmt is known at compile-time:
@safe unittest
{
auto s = format!"%s is %s"("Pi", 3.14);
assert(s == "Pi is 3.14");
static assert(!__traits(compiles, {s = format!"%l"();})); // missing arg
static assert(!__traits(compiles, {s = format!""(404);})); // surplus arg
static assert(!__traits(compiles, {s = format!"%d"(4.03);})); // incompatible arg
}
// called during compilation to guess the length of the
// result of format
private size_t guessLength(Char, S)(S fmtString)
{
import std.array : appender;
size_t len;
auto output = appender!(immutable(Char)[])();
auto spec = FormatSpec!Char(fmtString);
while (spec.writeUpToNextSpec(output))
{
// take a guess
if (spec.width == 0 && (spec.precision == spec.UNSPECIFIED || spec.precision == spec.DYNAMIC))
{
switch (spec.spec)
{
case 'c':
++len;
break;
case 'd':
case 'x':
case 'X':
len += 3;
break;
case 'b':
len += 8;
break;
case 'f':
case 'F':
len += 10;
break;
case 's':
case 'e':
case 'E':
case 'g':
case 'G':
len += 12;
break;
default: break;
}
continue;
}
if ((spec.spec == 'e' || spec.spec == 'E' || spec.spec == 'g' ||
spec.spec == 'G' || spec.spec == 'f' || spec.spec == 'F') &&
spec.precision != spec.UNSPECIFIED && spec.precision != spec.DYNAMIC &&
spec.width == 0
)
{
len += spec.precision + 5;
continue;
}
if (spec.width == spec.precision)
len += spec.width;
else if (spec.width > 0 && spec.width != spec.DYNAMIC &&
(spec.precision == spec.UNSPECIFIED || spec.width > spec.precision))
{
len += spec.width;
}
else if (spec.precision != spec.UNSPECIFIED && spec.precision > spec.width)
len += spec.precision;
}
len += output.data.length;
return len;
}
@safe pure
unittest
{
assert(guessLength!char("%c") == 1);
assert(guessLength!char("%d") == 3);
assert(guessLength!char("%x") == 3);
assert(guessLength!char("%b") == 8);
assert(guessLength!char("%f") == 10);
assert(guessLength!char("%s") == 12);
assert(guessLength!char("%02d") == 2);
assert(guessLength!char("%02d") == 2);
assert(guessLength!char("%4.4d") == 4);
assert(guessLength!char("%2.4f") == 4);
assert(guessLength!char("%02d:%02d:%02d") == 8);
assert(guessLength!char("%0.2f") == 7);
assert(guessLength!char("%0*d") == 0);
}
/// ditto
immutable(Char)[] format(Char, Args...)(in Char[] fmt, Args args)
if (isSomeChar!Char)
{
import std.array : appender;
auto w = appender!(immutable(Char)[]);
auto n = formattedWrite(w, fmt, args);
version (all)
{
// In the future, this check will be removed to increase consistency
// with formattedWrite
import std.conv : text;
enforceFmt(n == args.length, text("Orphan format arguments: args[", n, "..", args.length, "]"));
}
return w.data;
}
@safe pure unittest
{
import core.exception;
import std.exception;
assertCTFEable!(
{
// assert(format(null) == "");
assert(format("foo") == "foo");
assert(format("foo%%") == "foo%");
assert(format("foo%s", 'C') == "fooC");
assert(format("%s foo", "bar") == "bar foo");
assert(format("%s foo %s", "bar", "abc") == "bar foo abc");
assert(format("foo %d", -123) == "foo -123");
assert(format("foo %d", 123) == "foo 123");
assertThrown!FormatException(format("foo %s"));
assertThrown!FormatException(format("foo %s", 123, 456));
assert(format("hel%slo%s%s%s", "world", -138, 'c', true) ==
"helworldlo-138ctrue");
});
assert(is(typeof(format("happy")) == string));
assert(is(typeof(format("happy"w)) == wstring));
assert(is(typeof(format("happy"d)) == dstring));
}
// https://issues.dlang.org/show_bug.cgi?id=16661
@safe unittest
{
assert(format("%.2f"d, 0.4) == "0.40");
assert("%02d"d.format(1) == "01"d);
}
/*****************************************************
* Format arguments into buffer $(I buf) which must be large
* enough to hold the result.
*
* Returns:
* The slice of `buf` containing the formatted string.
*
* Throws:
* A `RangeError` if `buf` isn't large enough to hold the
* formatted string.
*
* A $(LREF FormatException) if the length of `args` is different
* than the number of format specifiers in `fmt`.
*/
char[] sformat(alias fmt, Args...)(char[] buf, Args args)
if (isSomeString!(typeof(fmt)))
{
alias e = checkFormatException!(fmt, Args);
static assert(!e, e.msg);
return .sformat(buf, fmt, args);
}
/// ditto
char[] sformat(Char, Args...)(return scope char[] buf, scope const(Char)[] fmt, Args args)
{
import core.exception : RangeError;
import std.utf : encode;
static struct Sink
{
char[] buf;
size_t i;
void put(dchar c)
{
char[4] enc;
auto n = encode(enc, c);
if (buf.length < i + n)
throw new RangeError(__FILE__, __LINE__);
buf[i .. i + n] = enc[0 .. n];
i += n;
}
void put(scope const(char)[] s)
{
if (buf.length < i + s.length)
throw new RangeError(__FILE__, __LINE__);
buf[i .. i + s.length] = s[];
i += s.length;
}
void put(scope const(wchar)[] s)
{
for (; !s.empty; s.popFront())
put(s.front);
}
void put(scope const(dchar)[] s)
{
for (; !s.empty; s.popFront())
put(s.front);
}
}
auto sink = Sink(buf);
auto n = formattedWrite(sink, fmt, args);
version (all)
{
// In the future, this check will be removed to increase consistency
// with formattedWrite
import std.conv : text;
enforceFmt(
n == args.length,
text("Orphan format arguments: args[", n, " .. ", args.length, "]")
);
}
return buf[0 .. sink.i];
}
/// The format string can be checked at compile-time (see $(LREF format) for details):
@system unittest
{
char[10] buf;
assert(buf[].sformat!"foo%s"('C') == "fooC");
assert(sformat(buf[], "%s foo", "bar") == "bar foo");
}
@system unittest
{
import core.exception;
debug(string) trustedPrintf("std.string.sformat.unittest\n");
import std.exception;
assertCTFEable!(
{
char[10] buf;
assert(sformat(buf[], "foo") == "foo");
assert(sformat(buf[], "foo%%") == "foo%");
assert(sformat(buf[], "foo%s", 'C') == "fooC");
assert(sformat(buf[], "%s foo", "bar") == "bar foo");
assertThrown!RangeError(sformat(buf[], "%s foo %s", "bar", "abc"));
assert(sformat(buf[], "foo %d", -123) == "foo -123");
assert(sformat(buf[], "foo %d", 123) == "foo 123");
assertThrown!FormatException(sformat(buf[], "foo %s"));
assertThrown!FormatException(sformat(buf[], "foo %s", 123, 456));
assert(sformat(buf[], "%s %s %s", "c"c, "w"w, "d"d) == "c w d");
});
}
@system unittest // ensure that sformat avoids the GC
{
import core.memory : GC;
const a = ["foo", "bar"];
const u = GC.stats().usedSize;
char[20] buf;
sformat(buf, "%d", 123);
sformat(buf, "%s", a);
assert(u == GC.stats().usedSize);
}
/*****************************
* The .ptr is unsafe because it could be dereferenced and the length of the array may be 0.
* Returns:
* the difference between the starts of the arrays
*/
@trusted private pure nothrow @nogc
ptrdiff_t arrayPtrDiff(T)(const T[] array1, const T[] array2)
{
return array1.ptr - array2.ptr;
}
@safe unittest
{
assertCTFEable!({
auto tmp = format("%,d", 1000);
assert(tmp == "1,000", "'" ~ tmp ~ "'");
tmp = format("%,?d", 'z', 1234567);
assert(tmp == "1z234z567", "'" ~ tmp ~ "'");
tmp = format("%10,?d", 'z', 1234567);
assert(tmp == " 1z234z567", "'" ~ tmp ~ "'");
tmp = format("%11,2?d", 'z', 1234567);
assert(tmp == " 1z23z45z67", "'" ~ tmp ~ "'");
tmp = format("%11,*?d", 2, 'z', 1234567);
assert(tmp == " 1z23z45z67", "'" ~ tmp ~ "'");
tmp = format("%11,*d", 2, 1234567);
assert(tmp == " 1,23,45,67", "'" ~ tmp ~ "'");
tmp = format("%11,2d", 1234567);
assert(tmp == " 1,23,45,67", "'" ~ tmp ~ "'");
});
}
@safe unittest
{
auto tmp = format("%,f", 1000.0);
assert(tmp == "1,000.000000", "'" ~ tmp ~ "'");
tmp = format("%,f", 1234567.891011);
assert(tmp == "1,234,567.891011", "'" ~ tmp ~ "'");
tmp = format("%,f", -1234567.891011);
assert(tmp == "-1,234,567.891011", "'" ~ tmp ~ "'");
tmp = format("%,2f", 1234567.891011);
assert(tmp == "1,23,45,67.891011", "'" ~ tmp ~ "'");
tmp = format("%18,f", 1234567.891011);
assert(tmp == " 1,234,567.891011", "'" ~ tmp ~ "'");
tmp = format("%18,?f", '.', 1234567.891011);
assert(tmp == " 1.234.567.891011", "'" ~ tmp ~ "'");
tmp = format("%,?.3f", 'ä', 1234567.891011);
assert(tmp == "1ä234ä567.891", "'" ~ tmp ~ "'");
tmp = format("%,*?.3f", 1, 'ä', 1234567.891011);
assert(tmp == "1ä2ä3ä4ä5ä6ä7.891", "'" ~ tmp ~ "'");
tmp = format("%,4?.3f", '_', 1234567.891011);
assert(tmp == "123_4567.891", "'" ~ tmp ~ "'");
tmp = format("%12,3.3f", 1234.5678);
assert(tmp == " 1,234.568", "'" ~ tmp ~ "'");
tmp = format("%,e", 3.141592653589793238462);
assert(tmp == "3.141593e+00", "'" ~ tmp ~ "'");
tmp = format("%15,e", 3.141592653589793238462);
assert(tmp == " 3.141593e+00", "'" ~ tmp ~ "'");
tmp = format("%15,e", -3.141592653589793238462);
assert(tmp == " -3.141593e+00", "'" ~ tmp ~ "'");
tmp = format("%.4,*e", 2, 3.141592653589793238462);
assert(tmp == "3.1416e+00", "'" ~ tmp ~ "'");
tmp = format("%13.4,*e", 2, 3.141592653589793238462);
assert(tmp == " 3.1416e+00", "'" ~ tmp ~ "'");
tmp = format("%,.0f", 3.14);
assert(tmp == "3", "'" ~ tmp ~ "'");
tmp = format("%3,g", 1_000_000.123456);
assert(tmp == "1e+06", "'" ~ tmp ~ "'");
tmp = format("%19,?f", '.', -1234567.891011);
assert(tmp == " -1.234.567.891011", "'" ~ tmp ~ "'");
}
// Test for multiple indexes
@safe unittest
{
auto tmp = format("%2:5$s", 1, 2, 3, 4, 5);
assert(tmp == "2345", tmp);
}
// Issue 18047
@safe unittest
{
auto cmp = " 123,456";
assert(cmp.length == 12, format("%d", cmp.length));
auto tmp = format("%12,d", 123456);
assert(tmp.length == 12, format("%d", tmp.length));
assert(tmp == cmp, "'" ~ tmp ~ "'");
}
// Issue 17459
@safe unittest
{
auto cmp = "100";
auto tmp = format("%0d", 100);
assert(tmp == cmp, tmp);
cmp = "0100";
tmp = format("%04d", 100);
assert(tmp == cmp, tmp);
cmp = "0,000,000,100";
tmp = format("%012,3d", 100);
assert(tmp == cmp, tmp);
cmp = "0,000,001,000";
tmp = format("%012,3d", 1_000);
assert(tmp == cmp, tmp);
cmp = "0,000,100,000";
tmp = format("%012,3d", 100_000);
assert(tmp == cmp, tmp);
cmp = "0,001,000,000";
tmp = format("%012,3d", 1_000_000);
assert(tmp == cmp, tmp);
cmp = "0,100,000,000";
tmp = format("%012,3d", 100_000_000);
assert(tmp == cmp, tmp);
}
// Issue 17459
@safe unittest
{
auto cmp = "100,000";
auto tmp = format("%06,d", 100_000);
assert(tmp == cmp, tmp);
cmp = "100,000";
tmp = format("%07,d", 100_000);
assert(tmp == cmp, tmp);
cmp = "0,100,000";
tmp = format("%08,d", 100_000);
assert(tmp == cmp, tmp);
}
// Issue 20288
@safe unittest
{
string s = format("%,.2f", double.nan);
assert(s == "nan", s);
s = format("%,.2F", double.nan);
assert(s == "NAN", s);
s = format("%,.2f", -double.nan);
assert(s == "-nan", s);
s = format("%,.2F", -double.nan);
assert(s == "-NAN", s);
string g = format("^%13s$", "nan");
string h = "^ nan$";
assert(g == h, "\ngot:" ~ g ~ "\nexp:" ~ h);
string a = format("^%13,3.2f$", double.nan);
string b = format("^%13,3.2F$", double.nan);
string c = format("^%13,3.2f$", -double.nan);
string d = format("^%13,3.2F$", -double.nan);
assert(a == "^ nan$", "\ngot:'"~ a ~ "'\nexp:'^ nan$'");
assert(b == "^ NAN$", "\ngot:'"~ b ~ "'\nexp:'^ NAN$'");
assert(c == "^ -nan$", "\ngot:'"~ c ~ "'\nexp:'^ -nan$'");
assert(d == "^ -NAN$", "\ngot:'"~ d ~ "'\nexp:'^ -NAN$'");
a = format("^%-13,3.2f$", double.nan);
b = format("^%-13,3.2F$", double.nan);
c = format("^%-13,3.2f$", -double.nan);
d = format("^%-13,3.2F$", -double.nan);
assert(a == "^nan $", "\ngot:'"~ a ~ "'\nexp:'^nan $'");
assert(b == "^NAN $", "\ngot:'"~ b ~ "'\nexp:'^NAN $'");
assert(c == "^-nan $", "\ngot:'"~ c ~ "'\nexp:'^-nan $'");
assert(d == "^-NAN $", "\ngot:'"~ d ~ "'\nexp:'^-NAN $'");
a = format("^%+13,3.2f$", double.nan);
b = format("^%+13,3.2F$", double.nan);
c = format("^%+13,3.2f$", -double.nan);
d = format("^%+13,3.2F$", -double.nan);
assert(a == "^ +nan$", "\ngot:'"~ a ~ "'\nexp:'^ +nan$'");
assert(b == "^ +NAN$", "\ngot:'"~ b ~ "'\nexp:'^ +NAN$'");
assert(c == "^ -nan$", "\ngot:'"~ c ~ "'\nexp:'^ -nan$'");
assert(d == "^ -NAN$", "\ngot:'"~ d ~ "'\nexp:'^ -NAN$'");
a = format("^%-+13,3.2f$", double.nan);
b = format("^%-+13,3.2F$", double.nan);
c = format("^%-+13,3.2f$", -double.nan);
d = format("^%-+13,3.2F$", -double.nan);
assert(a == "^+nan $", "\ngot:'"~ a ~ "'\nexp:'^+nan $'");
assert(b == "^+NAN $", "\ngot:'"~ b ~ "'\nexp:'^+NAN $'");
assert(c == "^-nan $", "\ngot:'"~ c ~ "'\nexp:'^-nan $'");
assert(d == "^-NAN $", "\ngot:'"~ d ~ "'\nexp:'^-NAN $'");
}
|
D
|
module dwinbar.widgets.battery;
import dwinbar.backend.dbus;
import dwinbar.widget;
import dwinbar.bar;
import std.algorithm;
import std.array;
import std.conv;
import std.datetime.stopwatch;
import std.exception;
import std.file;
import std.math;
import std.path;
import std.range;
import std.stdio;
import std.typecons;
import std.uni;
import tinyevent;
class BatteryWidget : Widget
{
this()
{
}
this(FontFamily font)
{
this.font = font;
}
this(FontFamily font, ObjectPath batteryDevice)
{
this.font = font;
loadIcons();
setDevice(batteryDevice);
updateClock.start();
}
void loadIcons()
{
batteryFullIcon = read_image("res/icon/battery-charging-full.png").premultiply;
batteryIcon.loadAll("res/icon/battery-");
chargingIcon.loadAll("res/icon/battery-charging-");
if (!batteryIcon.images.length)
throw new Exception("No battery icons found");
unknownIcon = batteryIcon.imageFor(0);
}
void setDevice(ObjectPath device)
{
systemBus.attach();
batteryInterface = new PathIface(systemBus.conn, busName("org.freedesktop.UPower"),
device, interfaceName("org.freedesktop.DBus.Properties"));
}
override void loadBase(WidgetConfig config)
{
this.font = config.bar.fontFamily;
updateClock.start();
}
override bool setProperty(string property, Json value)
{
switch (property)
{
case "batteryDevice":
case "device":
setDevice(ObjectPath(value.to!string));
return true;
default:
return false;
}
}
override int width(bool) const
{
return 18 + cast(int) ceil(measureText(cast() font, 1, batteryLevel.to!string)[0]);
}
override int height(bool) const
{
return 16;
}
override bool hasHover() @property
{
return false;
}
override IFImage redraw(bool vertical, Bar bar, bool hovered)
{
IFImage canvas;
canvas.w = width(vertical);
canvas.h = height(vertical);
canvas.c = ColFmt.RGBA;
canvas.pixels.length = canvas.w * canvas.h * canvas.c;
IFImage icon;
switch (batteryState)
{
case BatteryState.charging:
icon = chargingIcon.imageFor(animatedBatteryLevel);
break;
case BatteryState.fullyCharged:
icon = batteryFullIcon;
break;
case BatteryState.empty:
icon = batteryIcon.imageFor(0);
break;
case BatteryState.unknown:
icon = unknownIcon;
break;
default:
icon = batteryIcon.imageFor(batteryLevel);
break;
}
canvas.draw(icon, 0, 0);
canvas.drawText(font, 1, batteryLevel.to!string, 17, 14,
cast(ubyte[4])[0xFF, 0xFF, 0xFF, 0xFF]);
return canvas;
}
override void update(Bar bar)
{
if (updateClock.peek <= 400.msecs)
return;
updateClock.reset();
updateDBus();
double energy = batteryInterface.Get("org.freedesktop.UPower.Device", "Percentage").to!double;
int newBatteryLevel = cast(int) round(energy);
auto newState = cast(BatteryState) batteryInterface.Get("org.freedesktop.UPower.Device",
"State").to!uint;
if (newBatteryLevel != batteryLevel)
{
batteryLevel = newBatteryLevel;
queueRedraw();
}
if (newState != batteryState)
{
batteryState = newState;
animatedBatteryLevel = batteryLevel;
queueRedraw();
}
if (batteryState == BatteryState.charging)
{
animatedBatteryLevel += 5;
if (animatedBatteryLevel > 105)
animatedBatteryLevel = batteryLevel;
queueRedraw();
}
}
protected:
FontFamily font;
PathIface batteryInterface;
BatteryState batteryState;
int batteryLevel;
int animatedBatteryLevel;
IFImage batteryFullIcon, unknownIcon;
ImageRange batteryIcon, chargingIcon;
StopWatch updateClock;
}
enum BatteryState : uint
{
unknown,
charging,
discharging,
empty,
fullyCharged,
pendingCharge,
pendingDischarge
}
|
D
|
/Users/pacmac/Documents/GitHub/Blockchain/substarte_blockchain/substrate-node-template/target/debug/deps/scopeguard-e2b5b8c524eef9e8.rmeta: /Users/pacmac/.cargo/registry/src/github.com-1ecc6299db9ec823/scopeguard-1.1.0/src/lib.rs
/Users/pacmac/Documents/GitHub/Blockchain/substarte_blockchain/substrate-node-template/target/debug/deps/scopeguard-e2b5b8c524eef9e8.d: /Users/pacmac/.cargo/registry/src/github.com-1ecc6299db9ec823/scopeguard-1.1.0/src/lib.rs
/Users/pacmac/.cargo/registry/src/github.com-1ecc6299db9ec823/scopeguard-1.1.0/src/lib.rs:
|
D
|
/**
* Windows API header module
*
* Translated from MinGW API for MS-Windows 3.10
*
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC src/core/sys/windows/_winbase.d)
*/
module core.sys.windows.winbase;
version (Windows):
version (ANSI) {} else version = Unicode;
pragma(lib, "kernel32");
/**
Translation Notes:
The following macros are obsolete, and have no effect.
LockSegment(w), MakeProcInstance(p, i), UnlockResource(h), UnlockSegment(w)
FreeModule(m), FreeProcInstance(p), GetFreeSpace(w), DefineHandleTable(w)
SetSwapAreaSize(w), LimitEmsPages(n), Yield()
// These are not required for DMD.
//FIXME:
// #ifndef UNDER_CE
int WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
#else
int WinMain(HINSTANCE, HINSTANCE, LPWSTR, int);
#endif
int wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int);
*/
import core.sys.windows.windef, core.sys.windows.winver;
private import core.sys.windows.basetyps, core.sys.windows.w32api, core.sys.windows.winnt;
// FIXME:
//alias void va_list;
import core.stdc.stdarg : va_list;
// COMMPROP structure, used by GetCommProperties()
// -----------------------------------------------
// Communications provider type
enum : DWORD {
PST_UNSPECIFIED,
PST_RS232,
PST_PARALLELPORT,
PST_RS422,
PST_RS423,
PST_RS449,
PST_MODEM, // = 6
PST_FAX = 0x0021,
PST_SCANNER = 0x0022,
PST_NETWORK_BRIDGE = 0x0100,
PST_LAT = 0x0101,
PST_TCPIP_TELNET = 0x0102,
PST_X25 = 0x0103
}
// Max baud rate
enum : DWORD {
BAUD_075 = 0x00000001,
BAUD_110 = 0x00000002,
BAUD_134_5 = 0x00000004,
BAUD_150 = 0x00000008,
BAUD_300 = 0x00000010,
BAUD_600 = 0x00000020,
BAUD_1200 = 0x00000040,
BAUD_1800 = 0x00000080,
BAUD_2400 = 0x00000100,
BAUD_4800 = 0x00000200,
BAUD_7200 = 0x00000400,
BAUD_9600 = 0x00000800,
BAUD_14400 = 0x00001000,
BAUD_19200 = 0x00002000,
BAUD_38400 = 0x00004000,
BAUD_56K = 0x00008000,
BAUD_128K = 0x00010000,
BAUD_115200 = 0x00020000,
BAUD_57600 = 0x00040000,
BAUD_USER = 0x10000000
}
// Comm capabilities
enum : DWORD {
PCF_DTRDSR = 0x0001,
PCF_RTSCTS = 0x0002,
PCF_RLSD = 0x0004,
PCF_PARITY_CHECK = 0x0008,
PCF_XONXOFF = 0x0010,
PCF_SETXCHAR = 0x0020,
PCF_TOTALTIMEOUTS = 0x0040,
PCF_INTTIMEOUTS = 0x0080,
PCF_SPECIALCHARS = 0x0100,
PCF_16BITMODE = 0x0200
}
enum : DWORD {
SP_PARITY = 1,
SP_BAUD = 2,
SP_DATABITS = 4,
SP_STOPBITS = 8,
SP_HANDSHAKING = 16,
SP_PARITY_CHECK = 32,
SP_RLSD = 64
}
enum : DWORD {
DATABITS_5 = 1,
DATABITS_6 = 2,
DATABITS_7 = 4,
DATABITS_8 = 8,
DATABITS_16 = 16,
DATABITS_16X = 32
}
enum : WORD {
STOPBITS_10 = 0x0001,
STOPBITS_15 = 0x0002,
STOPBITS_20 = 0x0004,
PARITY_NONE = 0x0100,
PARITY_ODD = 0x0200,
PARITY_EVEN = 0x0400,
PARITY_MARK = 0x0800,
PARITY_SPACE = 0x1000
}
// used by dwServiceMask
enum SP_SERIALCOMM = 1;
struct COMMPROP {
WORD wPacketLength;
WORD wPacketVersion;
DWORD dwServiceMask;
DWORD dwReserved1;
DWORD dwMaxTxQueue;
DWORD dwMaxRxQueue;
DWORD dwMaxBaud;
DWORD dwProvSubType;
DWORD dwProvCapabilities;
DWORD dwSettableParams;
DWORD dwSettableBaud;
WORD wSettableData;
WORD wSettableStopParity;
DWORD dwCurrentTxQueue;
DWORD dwCurrentRxQueue;
DWORD dwProvSpec1;
DWORD dwProvSpec2;
WCHAR _wcProvChar = 0;
WCHAR* wcProvChar() return { return &_wcProvChar; }
}
alias COMMPROP* LPCOMMPROP;
// ----------
// for DEBUG_EVENT
enum : DWORD {
EXCEPTION_DEBUG_EVENT = 1,
CREATE_THREAD_DEBUG_EVENT,
CREATE_PROCESS_DEBUG_EVENT,
EXIT_THREAD_DEBUG_EVENT,
EXIT_PROCESS_DEBUG_EVENT,
LOAD_DLL_DEBUG_EVENT,
UNLOAD_DLL_DEBUG_EVENT,
OUTPUT_DEBUG_STRING_EVENT,
RIP_EVENT
}
enum HFILE HFILE_ERROR = cast(HFILE) (-1);
// for SetFilePointer()
enum : DWORD {
FILE_BEGIN = 0,
FILE_CURRENT = 1,
FILE_END = 2
}
enum DWORD INVALID_SET_FILE_POINTER = -1;
// for OpenFile()
deprecated enum : UINT {
OF_READ = 0,
OF_WRITE = 0x0001,
OF_READWRITE = 0x0002,
OF_SHARE_COMPAT = 0,
OF_SHARE_EXCLUSIVE = 0x0010,
OF_SHARE_DENY_WRITE = 0x0020,
OF_SHARE_DENY_READ = 0x0030,
OF_SHARE_DENY_NONE = 0x0040,
OF_PARSE = 0x0100,
OF_DELETE = 0x0200,
OF_VERIFY = 0x0400,
OF_CANCEL = 0x0800,
OF_CREATE = 0x1000,
OF_PROMPT = 0x2000,
OF_EXIST = 0x4000,
OF_REOPEN = 0x8000
}
enum : DWORD {
NMPWAIT_NOWAIT = 1,
NMPWAIT_WAIT_FOREVER = -1,
NMPWAIT_USE_DEFAULT_WAIT = 0
}
// for ClearCommError()
enum DWORD
CE_RXOVER = 0x0001,
CE_OVERRUN = 0x0002,
CE_RXPARITY = 0x0004,
CE_FRAME = 0x0008,
CE_BREAK = 0x0010,
CE_TXFULL = 0x0100,
CE_PTO = 0x0200,
CE_IOE = 0x0400,
CE_DNS = 0x0800,
CE_OOP = 0x1000,
CE_MODE = 0x8000;
// for CopyProgressRoutine callback.
enum : DWORD {
PROGRESS_CONTINUE = 0,
PROGRESS_CANCEL = 1,
PROGRESS_STOP = 2,
PROGRESS_QUIET = 3
}
enum : DWORD {
CALLBACK_CHUNK_FINISHED = 0,
CALLBACK_STREAM_SWITCH = 1
}
// CopyFileEx()
enum : DWORD {
COPY_FILE_FAIL_IF_EXISTS = 1,
COPY_FILE_RESTARTABLE = 2
}
enum : DWORD {
FILE_MAP_COPY = 1,
FILE_MAP_WRITE = 2,
FILE_MAP_READ = 4,
FILE_MAP_ALL_ACCESS = 0x000F001F
}
enum : DWORD {
MUTEX_ALL_ACCESS = 0x001f0001,
MUTEX_MODIFY_STATE = 0x00000001,
SEMAPHORE_ALL_ACCESS = 0x001f0003,
SEMAPHORE_MODIFY_STATE = 0x00000002,
EVENT_ALL_ACCESS = 0x001f0003,
EVENT_MODIFY_STATE = 0x00000002
}
// CreateNamedPipe()
enum : DWORD {
PIPE_ACCESS_INBOUND = 1,
PIPE_ACCESS_OUTBOUND = 2,
PIPE_ACCESS_DUPLEX = 3
}
enum DWORD
PIPE_TYPE_BYTE = 0,
PIPE_TYPE_MESSAGE = 4,
PIPE_READMODE_BYTE = 0,
PIPE_READMODE_MESSAGE = 2,
PIPE_WAIT = 0,
PIPE_NOWAIT = 1;
// GetNamedPipeInfo()
enum DWORD
PIPE_CLIENT_END = 0,
PIPE_SERVER_END = 1;
enum DWORD PIPE_UNLIMITED_INSTANCES = 255;
// dwCreationFlags for CreateProcess() and CreateProcessAsUser()
enum : DWORD {
DEBUG_PROCESS = 0x00000001,
DEBUG_ONLY_THIS_PROCESS = 0x00000002,
CREATE_SUSPENDED = 0x00000004,
DETACHED_PROCESS = 0x00000008,
CREATE_NEW_CONSOLE = 0x00000010,
NORMAL_PRIORITY_CLASS = 0x00000020,
IDLE_PRIORITY_CLASS = 0x00000040,
HIGH_PRIORITY_CLASS = 0x00000080,
REALTIME_PRIORITY_CLASS = 0x00000100,
CREATE_NEW_PROCESS_GROUP = 0x00000200,
CREATE_UNICODE_ENVIRONMENT = 0x00000400,
CREATE_SEPARATE_WOW_VDM = 0x00000800,
CREATE_SHARED_WOW_VDM = 0x00001000,
CREATE_FORCEDOS = 0x00002000,
BELOW_NORMAL_PRIORITY_CLASS = 0x00004000,
ABOVE_NORMAL_PRIORITY_CLASS = 0x00008000,
CREATE_BREAKAWAY_FROM_JOB = 0x01000000,
CREATE_WITH_USERPROFILE = 0x02000000,
CREATE_DEFAULT_ERROR_MODE = 0x04000000,
CREATE_NO_WINDOW = 0x08000000,
PROFILE_USER = 0x10000000,
PROFILE_KERNEL = 0x20000000,
PROFILE_SERVER = 0x40000000
}
enum DWORD CONSOLE_TEXTMODE_BUFFER = 1;
// CreateFile()
enum : DWORD {
CREATE_NEW = 1,
CREATE_ALWAYS,
OPEN_EXISTING,
OPEN_ALWAYS,
TRUNCATE_EXISTING
}
// CreateFile()
enum DWORD
FILE_FLAG_WRITE_THROUGH = 0x80000000,
FILE_FLAG_OVERLAPPED = 0x40000000,
FILE_FLAG_NO_BUFFERING = 0x20000000,
FILE_FLAG_RANDOM_ACCESS = 0x10000000,
FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000,
FILE_FLAG_DELETE_ON_CLOSE = 0x04000000,
FILE_FLAG_BACKUP_SEMANTICS = 0x02000000,
FILE_FLAG_POSIX_SEMANTICS = 0x01000000,
FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000,
FILE_FLAG_OPEN_NO_RECALL = 0x00100000;
static if (_WIN32_WINNT >= 0x500) {
enum DWORD FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000;
}
// for CreateFile()
enum DWORD
SECURITY_ANONYMOUS = SECURITY_IMPERSONATION_LEVEL.SecurityAnonymous<<16,
SECURITY_IDENTIFICATION = SECURITY_IMPERSONATION_LEVEL.SecurityIdentification<<16,
SECURITY_IMPERSONATION = SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation<<16,
SECURITY_DELEGATION = SECURITY_IMPERSONATION_LEVEL.SecurityDelegation<<16,
SECURITY_CONTEXT_TRACKING = 0x00040000,
SECURITY_EFFECTIVE_ONLY = 0x00080000,
SECURITY_SQOS_PRESENT = 0x00100000,
SECURITY_VALID_SQOS_FLAGS = 0x001F0000;
// Thread exit code
enum DWORD STILL_ACTIVE = 0x103;
/* ??? The only documentation of this seems to be about Windows CE and to
* state what _doesn't_ support it.
*/
enum DWORD FIND_FIRST_EX_CASE_SENSITIVE = 1;
// GetBinaryType()
enum : DWORD {
SCS_32BIT_BINARY = 0,
SCS_DOS_BINARY,
SCS_WOW_BINARY,
SCS_PIF_BINARY,
SCS_POSIX_BINARY,
SCS_OS216_BINARY
}
enum size_t
MAX_COMPUTERNAME_LENGTH = 15,
HW_PROFILE_GUIDLEN = 39,
MAX_PROFILE_LEN = 80;
// HW_PROFILE_INFO
enum DWORD
DOCKINFO_UNDOCKED = 1,
DOCKINFO_DOCKED = 2,
DOCKINFO_USER_SUPPLIED = 4,
DOCKINFO_USER_UNDOCKED = DOCKINFO_USER_SUPPLIED | DOCKINFO_UNDOCKED,
DOCKINFO_USER_DOCKED = DOCKINFO_USER_SUPPLIED | DOCKINFO_DOCKED;
// DriveType(), RealDriveType()
enum : int {
DRIVE_UNKNOWN = 0,
DRIVE_NO_ROOT_DIR,
DRIVE_REMOVABLE,
DRIVE_FIXED,
DRIVE_REMOTE,
DRIVE_CDROM,
DRIVE_RAMDISK
}
// GetFileType()
enum : DWORD {
FILE_TYPE_UNKNOWN = 0,
FILE_TYPE_DISK,
FILE_TYPE_CHAR,
FILE_TYPE_PIPE,
FILE_TYPE_REMOTE = 0x8000
}
// Get/SetHandleInformation()
enum DWORD
HANDLE_FLAG_INHERIT = 0x01,
HANDLE_FLAG_PROTECT_FROM_CLOSE = 0x02;
enum : DWORD {
STD_INPUT_HANDLE = 0xFFFFFFF6,
STD_OUTPUT_HANDLE = 0xFFFFFFF5,
STD_ERROR_HANDLE = 0xFFFFFFF4
}
enum HANDLE INVALID_HANDLE_VALUE = cast(HANDLE) (-1);
enum : DWORD {
GET_TAPE_MEDIA_INFORMATION = 0,
GET_TAPE_DRIVE_INFORMATION = 1
}
enum : DWORD {
SET_TAPE_MEDIA_INFORMATION = 0,
SET_TAPE_DRIVE_INFORMATION = 1
}
// SetThreadPriority()/GetThreadPriority()
enum : int {
THREAD_PRIORITY_IDLE = -15,
THREAD_PRIORITY_LOWEST = -2,
THREAD_PRIORITY_BELOW_NORMAL = -1,
THREAD_PRIORITY_NORMAL = 0,
THREAD_PRIORITY_ABOVE_NORMAL = 1,
THREAD_PRIORITY_HIGHEST = 2,
THREAD_PRIORITY_TIME_CRITICAL = 15,
THREAD_PRIORITY_ERROR_RETURN = 2147483647
}
enum : DWORD {
TIME_ZONE_ID_UNKNOWN,
TIME_ZONE_ID_STANDARD,
TIME_ZONE_ID_DAYLIGHT,
TIME_ZONE_ID_INVALID = 0xFFFFFFFF
}
enum DWORD
FS_CASE_SENSITIVE = 1,
FS_CASE_IS_PRESERVED = 2,
FS_UNICODE_STORED_ON_DISK = 4,
FS_PERSISTENT_ACLS = 8,
FS_FILE_COMPRESSION = 16,
FS_VOL_IS_COMPRESSED = 32768;
// Flags for GlobalAlloc
enum UINT
GMEM_FIXED = 0,
GMEM_MOVEABLE = 0x0002,
GMEM_ZEROINIT = 0x0040,
GPTR = 0x0040,
GHND = 0x0042,
GMEM_MODIFY = 0x0080, // used only for GlobalRealloc
GMEM_VALID_FLAGS = 0x7F72;
/+ // Obselete flags (Win16 only)
GMEM_NOCOMPACT=16;
GMEM_NODISCARD=32;
GMEM_DISCARDABLE=256;
GMEM_NOT_BANKED=4096;
GMEM_LOWER=4096;
GMEM_SHARE=8192;
GMEM_DDESHARE=8192;
GMEM_LOCKCOUNT=255;
// for GlobalFlags()
GMEM_DISCARDED = 16384;
GMEM_INVALID_HANDLE = 32768;
GMEM_NOTIFY = 16384;
+/
enum UINT
LMEM_FIXED = 0,
LMEM_MOVEABLE = 0x0002,
LMEM_NONZEROLPTR = 0,
NONZEROLPTR = 0,
LMEM_NONZEROLHND = 0x0002,
NONZEROLHND = 0x0002,
LMEM_DISCARDABLE = 0x0F00,
LMEM_NOCOMPACT = 0x0010,
LMEM_NODISCARD = 0x0020,
LMEM_ZEROINIT = 0x0040,
LPTR = 0x0040,
LHND = 0x0042,
LMEM_MODIFY = 0x0080,
LMEM_LOCKCOUNT = 0x00FF,
LMEM_DISCARDED = 0x4000,
LMEM_INVALID_HANDLE = 0x8000;
// used in EXCEPTION_RECORD
enum : DWORD {
STATUS_WAIT_0 = 0,
STATUS_ABANDONED_WAIT_0 = 0x00000080,
STATUS_USER_APC = 0x000000C0,
STATUS_TIMEOUT = 0x00000102,
STATUS_PENDING = 0x00000103,
STATUS_SEGMENT_NOTIFICATION = 0x40000005,
STATUS_GUARD_PAGE_VIOLATION = 0x80000001,
STATUS_DATATYPE_MISALIGNMENT = 0x80000002,
STATUS_BREAKPOINT = 0x80000003,
STATUS_SINGLE_STEP = 0x80000004,
STATUS_ACCESS_VIOLATION = 0xC0000005,
STATUS_IN_PAGE_ERROR = 0xC0000006,
STATUS_INVALID_HANDLE = 0xC0000008,
STATUS_NO_MEMORY = 0xC0000017,
STATUS_ILLEGAL_INSTRUCTION = 0xC000001D,
STATUS_NONCONTINUABLE_EXCEPTION = 0xC0000025,
STATUS_INVALID_DISPOSITION = 0xC0000026,
STATUS_ARRAY_BOUNDS_EXCEEDED = 0xC000008C,
STATUS_FLOAT_DENORMAL_OPERAND = 0xC000008D,
STATUS_FLOAT_DIVIDE_BY_ZERO = 0xC000008E,
STATUS_FLOAT_INEXACT_RESULT = 0xC000008F,
STATUS_FLOAT_INVALID_OPERATION = 0xC0000090,
STATUS_FLOAT_OVERFLOW = 0xC0000091,
STATUS_FLOAT_STACK_CHECK = 0xC0000092,
STATUS_FLOAT_UNDERFLOW = 0xC0000093,
STATUS_INTEGER_DIVIDE_BY_ZERO = 0xC0000094,
STATUS_INTEGER_OVERFLOW = 0xC0000095,
STATUS_PRIVILEGED_INSTRUCTION = 0xC0000096,
STATUS_STACK_OVERFLOW = 0xC00000FD,
STATUS_CONTROL_C_EXIT = 0xC000013A,
STATUS_DLL_INIT_FAILED = 0xC0000142,
STATUS_DLL_INIT_FAILED_LOGOFF = 0xC000026B,
CONTROL_C_EXIT = STATUS_CONTROL_C_EXIT,
EXCEPTION_ACCESS_VIOLATION = STATUS_ACCESS_VIOLATION,
EXCEPTION_DATATYPE_MISALIGNMENT = STATUS_DATATYPE_MISALIGNMENT,
EXCEPTION_BREAKPOINT = STATUS_BREAKPOINT,
EXCEPTION_SINGLE_STEP = STATUS_SINGLE_STEP,
EXCEPTION_ARRAY_BOUNDS_EXCEEDED = STATUS_ARRAY_BOUNDS_EXCEEDED,
EXCEPTION_FLT_DENORMAL_OPERAND = STATUS_FLOAT_DENORMAL_OPERAND,
EXCEPTION_FLT_DIVIDE_BY_ZERO = STATUS_FLOAT_DIVIDE_BY_ZERO,
EXCEPTION_FLT_INEXACT_RESULT = STATUS_FLOAT_INEXACT_RESULT,
EXCEPTION_FLT_INVALID_OPERATION = STATUS_FLOAT_INVALID_OPERATION,
EXCEPTION_FLT_OVERFLOW = STATUS_FLOAT_OVERFLOW,
EXCEPTION_FLT_STACK_CHECK = STATUS_FLOAT_STACK_CHECK,
EXCEPTION_FLT_UNDERFLOW = STATUS_FLOAT_UNDERFLOW,
EXCEPTION_INT_DIVIDE_BY_ZERO = STATUS_INTEGER_DIVIDE_BY_ZERO,
EXCEPTION_INT_OVERFLOW = STATUS_INTEGER_OVERFLOW,
EXCEPTION_PRIV_INSTRUCTION = STATUS_PRIVILEGED_INSTRUCTION,
EXCEPTION_IN_PAGE_ERROR = STATUS_IN_PAGE_ERROR,
EXCEPTION_ILLEGAL_INSTRUCTION = STATUS_ILLEGAL_INSTRUCTION,
EXCEPTION_NONCONTINUABLE_EXCEPTION = STATUS_NONCONTINUABLE_EXCEPTION,
EXCEPTION_STACK_OVERFLOW = STATUS_STACK_OVERFLOW,
EXCEPTION_INVALID_DISPOSITION = STATUS_INVALID_DISPOSITION,
EXCEPTION_GUARD_PAGE = STATUS_GUARD_PAGE_VIOLATION,
EXCEPTION_INVALID_HANDLE = STATUS_INVALID_HANDLE
}
// for PROCESS_HEAP_ENTRY
enum WORD
PROCESS_HEAP_REGION = 1,
PROCESS_HEAP_UNCOMMITTED_RANGE = 2,
PROCESS_HEAP_ENTRY_BUSY = 4,
PROCESS_HEAP_ENTRY_MOVEABLE = 16,
PROCESS_HEAP_ENTRY_DDESHARE = 32;
// for LoadLibraryEx()
enum DWORD
DONT_RESOLVE_DLL_REFERENCES = 0x01, // not for WinME and earlier
LOAD_LIBRARY_AS_DATAFILE = 0x02,
LOAD_WITH_ALTERED_SEARCH_PATH = 0x08,
LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x10; // only for XP and later
// for LockFile()
enum DWORD
LOCKFILE_FAIL_IMMEDIATELY = 1,
LOCKFILE_EXCLUSIVE_LOCK = 2;
enum MAXIMUM_WAIT_OBJECTS = 64;
enum MAXIMUM_SUSPEND_COUNT = 0x7F;
enum WAIT_OBJECT_0 = 0;
enum WAIT_ABANDONED_0 = 128;
//const WAIT_TIMEOUT=258; // also in winerror.h
enum : DWORD {
WAIT_IO_COMPLETION = 0x000000C0,
WAIT_ABANDONED = 0x00000080,
WAIT_FAILED = 0xFFFFFFFF
}
// PurgeComm()
enum DWORD
PURGE_TXABORT = 1,
PURGE_RXABORT = 2,
PURGE_TXCLEAR = 4,
PURGE_RXCLEAR = 8;
// ReadEventLog()
enum DWORD
EVENTLOG_SEQUENTIAL_READ = 1,
EVENTLOG_SEEK_READ = 2,
EVENTLOG_FORWARDS_READ = 4,
EVENTLOG_BACKWARDS_READ = 8;
// ReportEvent()
enum : WORD {
EVENTLOG_SUCCESS = 0,
EVENTLOG_ERROR_TYPE = 1,
EVENTLOG_WARNING_TYPE = 2,
EVENTLOG_INFORMATION_TYPE = 4,
EVENTLOG_AUDIT_SUCCESS = 8,
EVENTLOG_AUDIT_FAILURE = 16
}
// FormatMessage()
enum DWORD
FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x0100,
FORMAT_MESSAGE_IGNORE_INSERTS = 0x0200,
FORMAT_MESSAGE_FROM_STRING = 0x0400,
FORMAT_MESSAGE_FROM_HMODULE = 0x0800,
FORMAT_MESSAGE_FROM_SYSTEM = 0x1000,
FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x2000;
enum DWORD FORMAT_MESSAGE_MAX_WIDTH_MASK = 255;
// also in ddk/ntapi.h
// To restore default error mode, call SetErrorMode(0)
enum {
SEM_FAILCRITICALERRORS = 0x0001,
SEM_NOGPFAULTERRORBOX = 0x0002,
SEM_NOALIGNMENTFAULTEXCEPT = 0x0004,
SEM_NOOPENFILEERRORBOX = 0x8000
}
// end ntapi.h
enum {
SLE_ERROR = 1,
SLE_MINORERROR,
SLE_WARNING
}
enum SHUTDOWN_NORETRY = 1;
// Return type for exception filters.
enum : LONG {
EXCEPTION_EXECUTE_HANDLER = 1,
EXCEPTION_CONTINUE_EXECUTION = -1,
EXCEPTION_CONTINUE_SEARCH = 0
}
enum : ATOM {
MAXINTATOM = 0xC000,
INVALID_ATOM = 0
}
enum IGNORE = 0;
enum INFINITE = 0xFFFFFFFF;
// EscapeCommFunction()
enum {
SETXOFF = 1,
SETXON,
SETRTS,
CLRRTS,
SETDTR,
CLRDTR, // = 6
SETBREAK = 8,
CLRBREAK = 9
}
// for SetCommMask()
enum DWORD
EV_RXCHAR = 0x0001,
EV_RXFLAG = 0x0002,
EV_TXEMPTY = 0x0004,
EV_CTS = 0x0008,
EV_DSR = 0x0010,
EV_RLSD = 0x0020,
EV_BREAK = 0x0040,
EV_ERR = 0x0080,
EV_RING = 0x0100,
EV_PERR = 0x0200,
EV_RX80FULL = 0x0400,
EV_EVENT1 = 0x0800,
EV_EVENT2 = 0x1000;
// GetCommModemStatus()
enum DWORD
MS_CTS_ON = 0x0010,
MS_DSR_ON = 0x0020,
MS_RING_ON = 0x0040,
MS_RLSD_ON = 0x0080;
// DCB
enum : BYTE {
NOPARITY = 0,
ODDPARITY,
EVENPARITY,
MARKPARITY,
SPACEPARITY
}
// DCB
enum : BYTE {
ONESTOPBIT = 0,
ONE5STOPBITS,
TWOSTOPBITS
}
// DCB
enum : DWORD {
CBR_110 = 110,
CBR_300 = 300,
CBR_600 = 600,
CBR_1200 = 1200,
CBR_2400 = 2400,
CBR_4800 = 4800,
CBR_9600 = 9600,
CBR_14400 = 14400,
CBR_19200 = 19200,
CBR_38400 = 38400,
CBR_56000 = 56000,
CBR_57600 = 57600,
CBR_115200 = 115200,
CBR_128000 = 128000,
CBR_256000 = 256000
}
// DCB, 2-bit bitfield
enum {
DTR_CONTROL_DISABLE = 0,
DTR_CONTROL_ENABLE,
DTR_CONTROL_HANDSHAKE
}
// DCB, 2-bit bitfield
enum {
RTS_CONTROL_DISABLE = 0,
RTS_CONTROL_ENABLE,
RTS_CONTROL_HANDSHAKE,
RTS_CONTROL_TOGGLE,
}
// WIN32_STREAM_ID
enum : DWORD {
BACKUP_INVALID = 0,
BACKUP_DATA,
BACKUP_EA_DATA,
BACKUP_SECURITY_DATA,
BACKUP_ALTERNATE_DATA,
BACKUP_LINK,
BACKUP_PROPERTY_DATA,
BACKUP_OBJECT_ID,
BACKUP_REPARSE_DATA,
BACKUP_SPARSE_BLOCK
}
// WIN32_STREAM_ID
enum : DWORD {
STREAM_NORMAL_ATTRIBUTE = 0,
STREAM_MODIFIED_WHEN_READ = 1,
STREAM_CONTAINS_SECURITY = 2,
STREAM_CONTAINS_PROPERTIES = 4
}
// STARTUPINFO
enum DWORD
STARTF_USESHOWWINDOW = 0x0001,
STARTF_USESIZE = 0x0002,
STARTF_USEPOSITION = 0x0004,
STARTF_USECOUNTCHARS = 0x0008,
STARTF_USEFILLATTRIBUTE = 0x0010,
STARTF_RUNFULLSCREEN = 0x0020,
STARTF_FORCEONFEEDBACK = 0x0040,
STARTF_FORCEOFFFEEDBACK = 0x0080,
STARTF_USESTDHANDLES = 0x0100,
STARTF_USEHOTKEY = 0x0200;
// ???
enum {
TC_NORMAL = 0,
TC_HARDERR = 1,
TC_GP_TRAP = 2,
TC_SIGNAL = 3
}
/+ These seem to be Windows CE-specific
enum {
AC_LINE_OFFLINE = 0,
AC_LINE_ONLINE = 1,
AC_LINE_BACKUP_POWER = 2,
AC_LINE_UNKNOWN = 255
}
enum {
BATTERY_FLAG_HIGH = 1,
BATTERY_FLAG_LOW = 2,
BATTERY_FLAG_CRITICAL = 4,
BATTERY_FLAG_CHARGING = 8,
BATTERY_FLAG_NO_BATTERY = 128,
BATTERY_FLAG_UNKNOWN = 255,
BATTERY_PERCENTAGE_UNKNOWN = 255,
BATTERY_LIFE_UNKNOWN = 0xFFFFFFFF
}
+/
// ???
enum HINSTANCE_ERROR = 32;
// returned from GetFileSize()
enum DWORD INVALID_FILE_SIZE = 0xFFFFFFFF;
enum DWORD TLS_OUT_OF_INDEXES = 0xFFFFFFFF;
// GetWriteWatch()
enum DWORD WRITE_WATCH_FLAG_RESET = 1;
// for LogonUser()
enum : DWORD {
LOGON32_LOGON_INTERACTIVE = 2,
LOGON32_LOGON_NETWORK = 3,
LOGON32_LOGON_BATCH = 4,
LOGON32_LOGON_SERVICE = 5,
LOGON32_LOGON_UNLOCK = 7
}
// for LogonUser()
enum : DWORD {
LOGON32_PROVIDER_DEFAULT,
LOGON32_PROVIDER_WINNT35,
LOGON32_PROVIDER_WINNT40,
LOGON32_PROVIDER_WINNT50
}
// for MoveFileEx()
enum DWORD
MOVEFILE_REPLACE_EXISTING = 1,
MOVEFILE_COPY_ALLOWED = 2,
MOVEFILE_DELAY_UNTIL_REBOOT = 4,
MOVEFILE_WRITE_THROUGH = 8;
// DefineDosDevice()
enum DWORD
DDD_RAW_TARGET_PATH = 1,
DDD_REMOVE_DEFINITION = 2,
DDD_EXACT_MATCH_ON_REMOVE = 4;
static if (_WIN32_WINNT >= 0x500) {
enum : DWORD {
LOGON32_LOGON_NETWORK_CLEARTEXT = 8,
LOGON32_LOGON_NEW_CREDENTIALS = 9
}
// ReplaceFile()
enum DWORD
REPLACEFILE_WRITE_THROUGH = 1,
REPLACEFILE_IGNORE_MERGE_ERRORS = 2;
}
static if (_WIN32_WINNT >= 0x501) {
enum DWORD
GET_MODULE_HANDLE_EX_FLAG_PIN = 1,
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT = 2,
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS = 4;
// for ACTCTX
enum DWORD
ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID = 0x01,
ACTCTX_FLAG_LANGID_VALID = 0x02,
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID = 0x04,
ACTCTX_FLAG_RESOURCE_NAME_VALID = 0x08,
ACTCTX_FLAG_SET_PROCESS_DEFAULT = 0x10,
ACTCTX_FLAG_APPLICATION_NAME_VALID = 0x20,
ACTCTX_FLAG_HMODULE_VALID = 0x80;
// DeactivateActCtx()
enum DWORD DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION = 1;
// FindActCtxSectionString()
enum DWORD FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX = 1;
// QueryActCtxW()
enum DWORD
QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX = 0x04,
QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE = 0x08,
QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS = 0x10;
enum {
LOGON_WITH_PROFILE = 1,
LOGON_NETCREDENTIALS_ONLY
}
}
// ----
struct FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
}
alias FILETIME* PFILETIME, LPFILETIME;
struct BY_HANDLE_FILE_INFORMATION {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD dwVolumeSerialNumber;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD nNumberOfLinks;
DWORD nFileIndexHigh;
DWORD nFileIndexLow;
}
alias BY_HANDLE_FILE_INFORMATION* LPBY_HANDLE_FILE_INFORMATION;
struct DCB {
DWORD DCBlength = DCB.sizeof;
DWORD BaudRate;
/+
DWORD fBinary:1; // Binary Mode (skip EOF check)
DWORD fParity:1; // Enable parity checking
DWORD fOutxCtsFlow:1; // CTS handshaking on output
DWORD fOutxDsrFlow:1; // DSR handshaking on output
DWORD fDtrControl:2; // DTR Flow control
DWORD fDsrSensitivity:1; // DSR Sensitivity
DWORD fTXContinueOnXoff:1; // Continue TX when Xoff sent
DWORD fOutX:1; // Enable output X-ON/X-OFF
DWORD fInX:1; // Enable input X-ON/X-OFF
DWORD fErrorChar:1; // Enable Err Replacement
DWORD fNull:1; // Enable Null stripping
DWORD fRtsControl:2; // Rts Flow control
DWORD fAbortOnError:1; // Abort all reads and writes on Error
DWORD fDummy2:17; // Reserved
+/
uint _bf;
bool fBinary(bool f) { _bf = (_bf & ~0x0001) | f; return f; }
bool fParity(bool f) { _bf = (_bf & ~0x0002) | (f<<1); return f; }
bool fOutxCtsFlow(bool f) { _bf = (_bf & ~0x0004) | (f<<2); return f; }
bool fOutxDsrFlow(bool f) { _bf = (_bf & ~0x0008) | (f<<3); return f; }
byte fDtrControl(byte x) { _bf = (_bf & ~0x0030) | (x<<4); return cast(byte)(x & 3); }
bool fDsrSensitivity(bool f) { _bf = (_bf & ~0x0040) | (f<<6); return f; }
bool fTXContinueOnXoff(bool f) { _bf = (_bf & ~0x0080) | (f<<7); return f; }
bool fOutX(bool f) { _bf = (_bf & ~0x0100) | (f<<8); return f; }
bool fInX(bool f) { _bf = (_bf & ~0x0200) | (f<<9); return f; }
bool fErrorChar(bool f) { _bf = (_bf & ~0x0400) | (f<<10); return f; }
bool fNull(bool f) { _bf = (_bf & ~0x0800) | (f<<11); return f; }
byte fRtsControl(byte x) { _bf = (_bf & ~0x3000) | (x<<12); return cast(byte)(x & 3); }
bool fAbortOnError(bool f) { _bf = (_bf & ~0x4000) | (f<<14); return f; }
bool fBinary() { return cast(bool) (_bf & 1); }
bool fParity() { return cast(bool) (_bf & 2); }
bool fOutxCtsFlow() { return cast(bool) (_bf & 4); }
bool fOutxDsrFlow() { return cast(bool) (_bf & 8); }
byte fDtrControl() { return cast(byte) ((_bf & (32+16))>>4); }
bool fDsrSensitivity() { return cast(bool) (_bf & 64); }
bool fTXContinueOnXoff() { return cast(bool) (_bf & 128); }
bool fOutX() { return cast(bool) (_bf & 256); }
bool fInX() { return cast(bool) (_bf & 512); }
bool fErrorChar() { return cast(bool) (_bf & 1024); }
bool fNull() { return cast(bool) (_bf & 2048); }
byte fRtsControl() { return cast(byte) ((_bf & (4096+8192))>>12); }
bool fAbortOnError() { return cast(bool) (_bf & 16384); }
WORD wReserved;
WORD XonLim;
WORD XoffLim;
BYTE ByteSize;
BYTE Parity;
BYTE StopBits;
char XonChar = 0;
char XoffChar = 0;
char ErrorChar = 0;
char EofChar = 0;
char EvtChar = 0;
WORD wReserved1;
}
alias DCB* LPDCB;
struct COMMCONFIG {
DWORD dwSize = COMMCONFIG.sizeof;
WORD wVersion;
WORD wReserved;
DCB dcb;
DWORD dwProviderSubType;
DWORD dwProviderOffset;
DWORD dwProviderSize;
WCHAR _wcProviderData = 0;
WCHAR* wcProviderData() return { return &_wcProviderData; }
}
alias COMMCONFIG* LPCOMMCONFIG;
struct COMMTIMEOUTS {
DWORD ReadIntervalTimeout;
DWORD ReadTotalTimeoutMultiplier;
DWORD ReadTotalTimeoutConstant;
DWORD WriteTotalTimeoutMultiplier;
DWORD WriteTotalTimeoutConstant;
}
alias COMMTIMEOUTS* LPCOMMTIMEOUTS;
struct COMSTAT {
/+
DWORD fCtsHold:1;
DWORD fDsrHold:1;
DWORD fRlsdHold:1;
DWORD fXoffHold:1;
DWORD fXoffSent:1;
DWORD fEof:1;
DWORD fTxim:1;
DWORD fReserved:25;
+/
DWORD _bf;
bool fCtsHold(bool f) { _bf = (_bf & ~1) | f; return f; }
bool fDsrHold(bool f) { _bf = (_bf & ~2) | (f<<1); return f; }
bool fRlsdHold(bool f) { _bf = (_bf & ~4) | (f<<2); return f; }
bool fXoffHold(bool f) { _bf = (_bf & ~8) | (f<<3); return f; }
bool fXoffSent(bool f) { _bf = (_bf & ~16) | (f<<4); return f; }
bool fEof(bool f) { _bf = (_bf & ~32) | (f<<5); return f; }
bool fTxim(bool f) { _bf = (_bf & ~64) | (f<<6); return f; }
bool fCtsHold() { return cast(bool) (_bf & 1); }
bool fDsrHold() { return cast(bool) (_bf & 2); }
bool fRlsdHold() { return cast(bool) (_bf & 4); }
bool fXoffHold() { return cast(bool) (_bf & 8); }
bool fXoffSent() { return cast(bool) (_bf & 16); }
bool fEof() { return cast(bool) (_bf & 32); }
bool fTxim() { return cast(bool) (_bf & 64); }
DWORD cbInQue;
DWORD cbOutQue;
}
alias COMSTAT* LPCOMSTAT;
struct CREATE_PROCESS_DEBUG_INFO {
HANDLE hFile;
HANDLE hProcess;
HANDLE hThread;
LPVOID lpBaseOfImage;
DWORD dwDebugInfoFileOffset;
DWORD nDebugInfoSize;
LPVOID lpThreadLocalBase;
LPTHREAD_START_ROUTINE lpStartAddress;
LPVOID lpImageName;
WORD fUnicode;
}
alias CREATE_PROCESS_DEBUG_INFO* LPCREATE_PROCESS_DEBUG_INFO;
struct CREATE_THREAD_DEBUG_INFO {
HANDLE hThread;
LPVOID lpThreadLocalBase;
LPTHREAD_START_ROUTINE lpStartAddress;
}
alias CREATE_THREAD_DEBUG_INFO* LPCREATE_THREAD_DEBUG_INFO;
struct EXCEPTION_DEBUG_INFO {
EXCEPTION_RECORD ExceptionRecord;
DWORD dwFirstChance;
}
alias EXCEPTION_DEBUG_INFO* LPEXCEPTION_DEBUG_INFO;
struct EXIT_THREAD_DEBUG_INFO {
DWORD dwExitCode;
}
alias EXIT_THREAD_DEBUG_INFO* LPEXIT_THREAD_DEBUG_INFO;
struct EXIT_PROCESS_DEBUG_INFO {
DWORD dwExitCode;
}
alias EXIT_PROCESS_DEBUG_INFO* LPEXIT_PROCESS_DEBUG_INFO;
struct LOAD_DLL_DEBUG_INFO {
HANDLE hFile;
LPVOID lpBaseOfDll;
DWORD dwDebugInfoFileOffset;
DWORD nDebugInfoSize;
LPVOID lpImageName;
WORD fUnicode;
}
alias LOAD_DLL_DEBUG_INFO* LPLOAD_DLL_DEBUG_INFO;
struct UNLOAD_DLL_DEBUG_INFO {
LPVOID lpBaseOfDll;
}
alias UNLOAD_DLL_DEBUG_INFO* LPUNLOAD_DLL_DEBUG_INFO;
struct OUTPUT_DEBUG_STRING_INFO {
LPSTR lpDebugStringData;
WORD fUnicode;
WORD nDebugStringLength;
}
alias OUTPUT_DEBUG_STRING_INFO* LPOUTPUT_DEBUG_STRING_INFO;
struct RIP_INFO {
DWORD dwError;
DWORD dwType;
}
alias RIP_INFO* LPRIP_INFO;
struct DEBUG_EVENT {
DWORD dwDebugEventCode;
DWORD dwProcessId;
DWORD dwThreadId;
union {
EXCEPTION_DEBUG_INFO Exception;
CREATE_THREAD_DEBUG_INFO CreateThread;
CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
EXIT_THREAD_DEBUG_INFO ExitThread;
EXIT_PROCESS_DEBUG_INFO ExitProcess;
LOAD_DLL_DEBUG_INFO LoadDll;
UNLOAD_DLL_DEBUG_INFO UnloadDll;
OUTPUT_DEBUG_STRING_INFO DebugString;
RIP_INFO RipInfo;
}
}
alias DEBUG_EVENT* LPDEBUG_EVENT;
struct OVERLAPPED {
ULONG_PTR Internal;
ULONG_PTR InternalHigh;
union {
struct {
DWORD Offset;
DWORD OffsetHigh;
}
PVOID Pointer;
}
HANDLE hEvent;
}
alias OVERLAPPED* POVERLAPPED, LPOVERLAPPED;
struct STARTUPINFOA {
DWORD cb = STARTUPINFOA.sizeof;
LPSTR lpReserved;
LPSTR lpDesktop;
LPSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
PBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
}
alias STARTUPINFOA* LPSTARTUPINFOA;
struct STARTUPINFOW {
DWORD cb = STARTUPINFOW.sizeof;
LPWSTR lpReserved;
LPWSTR lpDesktop;
LPWSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
PBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
}
alias STARTUPINFOW STARTUPINFO_W;
alias STARTUPINFOW* LPSTARTUPINFOW, LPSTARTUPINFO_W;
struct PROCESS_INFORMATION {
HANDLE hProcess;
HANDLE hThread;
DWORD dwProcessId;
DWORD dwThreadId;
}
alias PROCESS_INFORMATION* PPROCESS_INFORMATION, LPPROCESS_INFORMATION;
/*
struct CRITICAL_SECTION_DEBUG {
WORD Type;
WORD CreatorBackTraceIndex;
CRITICAL_SECTION* CriticalSection;
LIST_ENTRY ProcessLocksList;
DWORD EntryCount;
DWORD ContentionCount;
DWORD[2] Spare;
}
alias CRITICAL_SECTION_DEBUG* PCRITICAL_SECTION_DEBUG;
struct CRITICAL_SECTION {
PCRITICAL_SECTION_DEBUG DebugInfo;
LONG LockCount;
LONG RecursionCount;
HANDLE OwningThread;
HANDLE LockSemaphore;
DWORD SpinCount;
}
alias CRITICAL_SECTION* PCRITICAL_SECTION, LPCRITICAL_SECTION;
*/
alias CRITICAL_SECTION_DEBUG = RTL_CRITICAL_SECTION_DEBUG;
alias CRITICAL_SECTION_DEBUG* PCRITICAL_SECTION_DEBUG;
alias CRITICAL_SECTION = RTL_CRITICAL_SECTION;
alias CRITICAL_SECTION* PCRITICAL_SECTION, LPCRITICAL_SECTION;
struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
}
alias SYSTEMTIME* LPSYSTEMTIME;
struct WIN32_FILE_ATTRIBUTE_DATA {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
}
alias WIN32_FILE_ATTRIBUTE_DATA* LPWIN32_FILE_ATTRIBUTE_DATA;
struct WIN32_FIND_DATAA {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
// #ifdef _WIN32_WCE
// DWORD dwOID;
// #else
DWORD dwReserved0;
DWORD dwReserved1;
// #endif
CHAR[MAX_PATH] cFileName = 0;
// #ifndef _WIN32_WCE
CHAR[14] cAlternateFileName = 0;
// #endif
}
alias WIN32_FIND_DATAA* PWIN32_FIND_DATAA, LPWIN32_FIND_DATAA;
struct WIN32_FIND_DATAW {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
// #ifdef _WIN32_WCE
// DWORD dwOID;
// #else
DWORD dwReserved0;
DWORD dwReserved1;
// #endif
WCHAR[MAX_PATH] cFileName = 0;
// #ifndef _WIN32_WCE
WCHAR[14] cAlternateFileName = 0;
// #endif
}
alias WIN32_FIND_DATAW* PWIN32_FIND_DATAW, LPWIN32_FIND_DATAW;
struct WIN32_STREAM_ID {
DWORD dwStreamId;
DWORD dwStreamAttributes;
LARGE_INTEGER Size;
DWORD dwStreamNameSize;
WCHAR _cStreamName = 0;
WCHAR* cStreamName() return { return &_cStreamName; }
}
alias WIN32_STREAM_ID* LPWIN32_STREAM_ID;
static if (_WIN32_WINNT >= 0x601) {
enum FINDEX_INFO_LEVELS {
FindExInfoStandard,
FindExInfoBasic,
FindExInfoMaxInfoLevel,
}
} else {
enum FINDEX_INFO_LEVELS {
FindExInfoStandard,
FindExInfoMaxInfoLevel,
}
}
enum FINDEX_SEARCH_OPS {
FindExSearchNameMatch,
FindExSearchLimitToDirectories,
FindExSearchLimitToDevices,
FindExSearchMaxSearchOp
}
enum ACL_INFORMATION_CLASS {
AclRevisionInformation = 1,
AclSizeInformation
}
struct HW_PROFILE_INFOA {
DWORD dwDockInfo;
CHAR[HW_PROFILE_GUIDLEN] szHwProfileGuid = 0;
CHAR[MAX_PROFILE_LEN] szHwProfileName = 0;
}
alias HW_PROFILE_INFOA* LPHW_PROFILE_INFOA;
struct HW_PROFILE_INFOW {
DWORD dwDockInfo;
WCHAR[HW_PROFILE_GUIDLEN] szHwProfileGuid = 0;
WCHAR[MAX_PROFILE_LEN] szHwProfileName = 0;
}
alias HW_PROFILE_INFOW* LPHW_PROFILE_INFOW;
/* ??? MSDN documents this only for Windows CE/Mobile, but it's used by
* GetFileAttributesEx, which is in desktop Windows.
*/
enum GET_FILEEX_INFO_LEVELS {
GetFileExInfoStandard,
GetFileExMaxInfoLevel
}
struct SYSTEM_INFO {
union {
DWORD dwOemId;
struct {
WORD wProcessorArchitecture;
WORD wReserved;
}
}
DWORD dwPageSize;
PVOID lpMinimumApplicationAddress;
PVOID lpMaximumApplicationAddress;
DWORD_PTR dwActiveProcessorMask;
DWORD dwNumberOfProcessors;
DWORD dwProcessorType;
DWORD dwAllocationGranularity;
WORD wProcessorLevel;
WORD wProcessorRevision;
}
alias SYSTEM_INFO* LPSYSTEM_INFO;
static if (_WIN32_WINNT >= 0x500) {
struct SYSTEM_POWER_STATUS {
BYTE ACLineStatus;
BYTE BatteryFlag;
BYTE BatteryLifePercent;
BYTE Reserved1;
DWORD BatteryLifeTime;
DWORD BatteryFullLifeTime;
}
alias SYSTEM_POWER_STATUS* LPSYSTEM_POWER_STATUS;
}
struct TIME_ZONE_INFORMATION {
LONG Bias;
WCHAR[32] StandardName = 0;
SYSTEMTIME StandardDate;
LONG StandardBias;
WCHAR[32] DaylightName = 0;
SYSTEMTIME DaylightDate;
LONG DaylightBias;
}
alias TIME_ZONE_INFORMATION* LPTIME_ZONE_INFORMATION;
// Does not exist in Windows headers, only MSDN
// documentation (for TIME_ZONE_INFORMATION).
// Provided solely for compatibility with the old
// core.sys.windows.windows
struct REG_TZI_FORMAT {
LONG Bias;
LONG StandardBias;
LONG DaylightBias;
SYSTEMTIME StandardDate;
SYSTEMTIME DaylightDate;
}
// MSDN documents this, possibly erroneously, as Win2000+.
struct MEMORYSTATUS {
DWORD dwLength;
DWORD dwMemoryLoad;
SIZE_T dwTotalPhys;
SIZE_T dwAvailPhys;
SIZE_T dwTotalPageFile;
SIZE_T dwAvailPageFile;
SIZE_T dwTotalVirtual;
SIZE_T dwAvailVirtual;
}
alias MEMORYSTATUS* LPMEMORYSTATUS;
static if (_WIN32_WINNT >= 0x500) {
struct MEMORYSTATUSEX {
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
}
alias MEMORYSTATUSEX* LPMEMORYSTATUSEX;
}
struct LDT_ENTRY {
WORD LimitLow;
WORD BaseLow;
struct {
BYTE BaseMid;
BYTE Flags1;
BYTE Flags2;
BYTE BaseHi;
byte Type(byte f) { Flags1 = cast(BYTE) ((Flags1 & 0xE0) | f); return cast(byte)(f & 0x1F); }
byte Dpl(byte f) { Flags1 = cast(BYTE) ((Flags1 & 0x9F) | (f<<5)); return cast(byte)(f & 3); }
bool Pres(bool f) { Flags1 = cast(BYTE) ((Flags1 & 0x7F) | (f<<7)); return f; }
byte LimitHi(byte f) { Flags2 = cast(BYTE) ((Flags2 & 0xF0) | (f&0x0F)); return cast(byte)(f & 0x0F); }
bool Sys(bool f) { Flags2 = cast(BYTE) ((Flags2 & 0xEF) | (f<<4)); return f; }
// Next bit is reserved
bool Default_Big(bool f) { Flags2 = cast(BYTE) ((Flags2 & 0xBF) | (f<<6)); return f; }
bool Granularity(bool f) { Flags2 = cast(BYTE) ((Flags2 & 0x7F) | (f<<7)); return f; }
byte Type() { return cast(byte) (Flags1 & 0x1F); }
byte Dpl() { return cast(byte) ((Flags1 & 0x60)>>5); }
bool Pres() { return cast(bool) (Flags1 & 0x80); }
byte LimitHi() { return cast(byte) (Flags2 & 0x0F); }
bool Sys() { return cast(bool) (Flags2 & 0x10); }
bool Default_Big() { return cast(bool) (Flags2 & 0x40); }
bool Granularity() { return cast(bool) (Flags2 & 0x80); }
}
/+
union HighWord {
struct Bytes {
BYTE BaseMid;
BYTE Flags1;
BYTE Flags2;
BYTE BaseHi;
}
struct Bits {
DWORD BaseMid:8;
DWORD Type:5;
DWORD Dpl:2;
DWORD Pres:1;
DWORD LimitHi:4;
DWORD Sys:1;
DWORD Reserved_0:1;
DWORD Default_Big:1;
DWORD Granularity:1;
DWORD BaseHi:8;
}
}
+/
}
alias LDT_ENTRY* PLDT_ENTRY, LPLDT_ENTRY;
/* As with the other memory management functions and structures, MSDN's
* Windows version info shall be taken with a cup of salt.
*/
struct PROCESS_HEAP_ENTRY {
PVOID lpData;
DWORD cbData;
BYTE cbOverhead;
BYTE iRegionIndex;
WORD wFlags;
union {
struct _Block {
HANDLE hMem;
DWORD[3] dwReserved;
}
_Block Block;
struct _Region {
DWORD dwCommittedSize;
DWORD dwUnCommittedSize;
LPVOID lpFirstBlock;
LPVOID lpLastBlock;
}
_Region Region;
}
}
alias PROCESS_HEAP_ENTRY* LPPROCESS_HEAP_ENTRY;
struct OFSTRUCT {
BYTE cBytes = OFSTRUCT.sizeof;
BYTE fFixedDisk;
WORD nErrCode;
WORD Reserved1;
WORD Reserved2;
CHAR[128] szPathName = 0; // const OFS_MAXPATHNAME = 128;
}
alias OFSTRUCT* LPOFSTRUCT, POFSTRUCT;
/* ??? MSDN documents this only for Windows CE, but it's used by
* ImageGetCertificateData, which is in desktop Windows.
*/
struct WIN_CERTIFICATE {
DWORD dwLength;
WORD wRevision;
WORD wCertificateType;
BYTE _bCertificate;
BYTE* bCertificate() return { return &_bCertificate; }
}
alias WIN_CERTIFICATE* LPWIN_CERTIFICATE;
static if (_WIN32_WINNT >= 0x500) {
enum COMPUTER_NAME_FORMAT {
ComputerNameNetBIOS,
ComputerNameDnsHostname,
ComputerNameDnsDomain,
ComputerNameDnsFullyQualified,
ComputerNamePhysicalNetBIOS,
ComputerNamePhysicalDnsHostname,
ComputerNamePhysicalDnsDomain,
ComputerNamePhysicalDnsFullyQualified,
ComputerNameMax
}
}
static if (_WIN32_WINNT >= 0x501) {
struct ACTCTXA {
ULONG cbSize = this.sizeof;
DWORD dwFlags;
LPCSTR lpSource;
USHORT wProcessorArchitecture;
LANGID wLangId;
LPCSTR lpAssemblyDirectory;
LPCSTR lpResourceName;
LPCSTR lpApplicationName;
HMODULE hModule;
}
alias ACTCTXA* PACTCTXA;
alias const(ACTCTXA)* PCACTCTXA;
struct ACTCTXW {
ULONG cbSize = this.sizeof;
DWORD dwFlags;
LPCWSTR lpSource;
USHORT wProcessorArchitecture;
LANGID wLangId;
LPCWSTR lpAssemblyDirectory;
LPCWSTR lpResourceName;
LPCWSTR lpApplicationName;
HMODULE hModule;
}
alias ACTCTXW* PACTCTXW;
alias const(ACTCTXW)* PCACTCTXW;
struct ACTCTX_SECTION_KEYED_DATA {
ULONG cbSize = this.sizeof;
ULONG ulDataFormatVersion;
PVOID lpData;
ULONG ulLength;
PVOID lpSectionGlobalData;
ULONG ulSectionGlobalDataLength;
PVOID lpSectionBase;
ULONG ulSectionTotalLength;
HANDLE hActCtx;
HANDLE ulAssemblyRosterIndex;
}
alias ACTCTX_SECTION_KEYED_DATA* PACTCTX_SECTION_KEYED_DATA;
alias const(ACTCTX_SECTION_KEYED_DATA)* PCACTCTX_SECTION_KEYED_DATA;
enum MEMORY_RESOURCE_NOTIFICATION_TYPE {
LowMemoryResourceNotification,
HighMemoryResourceNotification
}
} // (_WIN32_WINNT >= 0x501)
static if (_WIN32_WINNT >= 0x410) {
/* apparently used only by SetThreadExecutionState (Win2000+)
* and DDK functions (version compatibility not established)
*/
alias DWORD EXECUTION_STATE;
}
// Callbacks
extern (Windows) {
alias DWORD function(LPVOID) LPTHREAD_START_ROUTINE;
alias DWORD function(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER,
DWORD, DWORD, HANDLE, HANDLE, LPVOID) LPPROGRESS_ROUTINE;
alias void function(PVOID) LPFIBER_START_ROUTINE;
alias BOOL function(HMODULE, LPCSTR, LPCSTR, WORD, LONG_PTR) ENUMRESLANGPROCA;
alias BOOL function(HMODULE, LPCWSTR, LPCWSTR, WORD, LONG_PTR) ENUMRESLANGPROCW;
alias BOOL function(HMODULE, LPCSTR, LPSTR, LONG_PTR) ENUMRESNAMEPROCA;
alias BOOL function(HMODULE, LPCWSTR, LPWSTR, LONG_PTR) ENUMRESNAMEPROCW;
alias BOOL function(HMODULE, LPSTR, LONG_PTR) ENUMRESTYPEPROCA;
alias BOOL function(HMODULE, LPWSTR, LONG_PTR) ENUMRESTYPEPROCW;
alias void function(DWORD, DWORD, LPOVERLAPPED) LPOVERLAPPED_COMPLETION_ROUTINE;
alias LONG function(LPEXCEPTION_POINTERS) PTOP_LEVEL_EXCEPTION_FILTER;
alias PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
alias void function(ULONG_PTR) PAPCFUNC;
alias void function(PVOID, DWORD, DWORD) PTIMERAPCROUTINE;
static if (_WIN32_WINNT >= 0x500) {
alias void function(PVOID, BOOLEAN) WAITORTIMERCALLBACK;
}
}
LPTSTR MAKEINTATOM()(ushort i) {
return cast(LPTSTR) cast(size_t) i;
}
extern (Windows) nothrow @nogc {
// The following Win16 functions are obselete in Win32.
int _hread(HFILE, LPVOID, int);
int _hwrite(HFILE, LPCSTR, int);
HFILE _lclose(HFILE);
HFILE _lcreat(LPCSTR, int);
LONG _llseek(HFILE, LONG, int);
HFILE _lopen(LPCSTR, int);
UINT _lread(HFILE, LPVOID, UINT);
UINT _lwrite(HFILE, LPCSTR, UINT);
SIZE_T GlobalCompact(DWORD);
VOID GlobalFix(HGLOBAL);
// MSDN contradicts itself on GlobalFlags:
// "This function is provided only for compatibility with 16-bit versions of Windows."
// but also requires Windows 2000 or above
UINT GlobalFlags(HGLOBAL);
VOID GlobalUnfix(HGLOBAL);
BOOL GlobalUnWire(HGLOBAL);
PVOID GlobalWire(HGLOBAL);
SIZE_T LocalCompact(UINT);
UINT LocalFlags(HLOCAL);
SIZE_T LocalShrink(HLOCAL, UINT);
/+
//--------------------------------------
// These functions are problematic
version (UseNtoSKernel) {}else {
/* CAREFUL: These are exported from ntoskrnl.exe and declared in winddk.h
as __fastcall functions, but are exported from kernel32.dll as __stdcall */
static if (_WIN32_WINNT >= 0x501) {
VOID InitializeSListHead(PSLIST_HEADER);
}
LONG InterlockedCompareExchange(LPLONG, LONG, LONG);
// PVOID WINAPI InterlockedCompareExchangePointer(PVOID*, PVOID, PVOID);
(PVOID)InterlockedCompareExchange((LPLONG)(d) (PVOID)InterlockedCompareExchange((LPLONG)(d), (LONG)(e), (LONG)(c))
LONG InterlockedDecrement(LPLONG);
LONG InterlockedExchange(LPLONG, LONG);
// PVOID WINAPI InterlockedExchangePointer(PVOID*, PVOID);
(PVOID)InterlockedExchange((LPLONG)((PVOID)InterlockedExchange((LPLONG)(t), (LONG)(v))
LONG InterlockedExchangeAdd(LPLONG, LONG);
static if (_WIN32_WINNT >= 0x501) {
PSLIST_ENTRY InterlockedFlushSList(PSLIST_HEADER);
}
LONG InterlockedIncrement(LPLONG);
static if (_WIN32_WINNT >= 0x501) {
PSLIST_ENTRY InterlockedPopEntrySList(PSLIST_HEADER);
PSLIST_ENTRY InterlockedPushEntrySList(PSLIST_HEADER, PSLIST_ENTRY);
}
} // #endif // __USE_NTOSKRNL__
//--------------------------------------
+/
LONG InterlockedIncrement(LPLONG lpAddend);
LONG InterlockedDecrement(LPLONG lpAddend);
LONG InterlockedExchange(LPLONG Target, LONG Value);
LONG InterlockedExchangeAdd(LPLONG Addend, LONG Value);
LONG InterlockedCompareExchange(LONG *Destination, LONG Exchange, LONG Comperand);
ATOM AddAtomA(LPCSTR);
ATOM AddAtomW(LPCWSTR);
BOOL AreFileApisANSI();
BOOL Beep(DWORD, DWORD);
HANDLE BeginUpdateResourceA(LPCSTR, BOOL);
HANDLE BeginUpdateResourceW(LPCWSTR, BOOL);
BOOL BuildCommDCBA(LPCSTR, LPDCB);
BOOL BuildCommDCBW(LPCWSTR, LPDCB);
BOOL BuildCommDCBAndTimeoutsA(LPCSTR, LPDCB, LPCOMMTIMEOUTS);
BOOL BuildCommDCBAndTimeoutsW(LPCWSTR, LPDCB, LPCOMMTIMEOUTS);
BOOL CallNamedPipeA(LPCSTR, PVOID, DWORD, PVOID, DWORD, PDWORD, DWORD);
BOOL CallNamedPipeW(LPCWSTR, PVOID, DWORD, PVOID, DWORD, PDWORD, DWORD);
BOOL CancelDeviceWakeupRequest(HANDLE);
BOOL CheckTokenMembership(HANDLE, PSID, PBOOL);
BOOL ClearCommBreak(HANDLE);
BOOL ClearCommError(HANDLE, PDWORD, LPCOMSTAT);
BOOL CloseHandle(HANDLE) @trusted;
BOOL CommConfigDialogA(LPCSTR, HWND, LPCOMMCONFIG);
BOOL CommConfigDialogW(LPCWSTR, HWND, LPCOMMCONFIG);
LONG CompareFileTime(const(FILETIME)*, const(FILETIME)*);
BOOL ContinueDebugEvent(DWORD, DWORD, DWORD);
BOOL CopyFileA(LPCSTR, LPCSTR, BOOL);
BOOL CopyFileW(LPCWSTR, LPCWSTR, BOOL);
BOOL CopyFileExA(LPCSTR, LPCSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
BOOL CopyFileExW(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
/+ FIXME
alias memmove RtlMoveMemory;
alias memcpy RtlCopyMemory;
void RtlFillMemory(PVOID dest, SIZE_T len, BYTE fill) {
memset(dest, fill, len);
}
void RtlZeroMemory(PVOID dest, SIZE_T len) {
RtlFillMemory(dest, len, 0);
}
alias RtlMoveMemory MoveMemory;
alias RtlCopyMemory CopyMemory;
alias RtlFillMemory FillMemory;
alias RtlZeroMemory ZeroMemory;
+/
BOOL CreateDirectoryA(LPCSTR, LPSECURITY_ATTRIBUTES);
BOOL CreateDirectoryW(LPCWSTR, LPSECURITY_ATTRIBUTES);
BOOL CreateDirectoryExA(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
BOOL CreateDirectoryExW(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
HANDLE CreateEventA(LPSECURITY_ATTRIBUTES, BOOL, BOOL, LPCSTR);
HANDLE CreateEventW(LPSECURITY_ATTRIBUTES, BOOL, BOOL, LPCWSTR);
HANDLE CreateFileA(LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
HANDLE CreateFileW(LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
HANDLE CreateIoCompletionPort(HANDLE, HANDLE, ULONG_PTR, DWORD);
HANDLE CreateMailslotA(LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES);
HANDLE CreateMailslotW(LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES);
HANDLE CreateMutexA(LPSECURITY_ATTRIBUTES, BOOL, LPCSTR);
HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES, BOOL, LPCWSTR);
BOOL CreatePipe(PHANDLE, PHANDLE, LPSECURITY_ATTRIBUTES, DWORD);
BOOL CreateProcessA(LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, PVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
BOOL CreateProcessW(LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, PVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
HANDLE CreateSemaphoreA(LPSECURITY_ATTRIBUTES, LONG, LONG, LPCSTR) @trusted;
HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES, LONG, LONG, LPCWSTR) @trusted;
HANDLE CreateThread(LPSECURITY_ATTRIBUTES, SIZE_T, LPTHREAD_START_ROUTINE, PVOID, DWORD, PDWORD);
BOOL DebugActiveProcess(DWORD);
void DebugBreak();
ATOM DeleteAtom(ATOM);
void DeleteCriticalSection(PCRITICAL_SECTION);
BOOL DeleteFileA(LPCSTR);
BOOL DeleteFileW(LPCWSTR);
BOOL DisableThreadLibraryCalls(HMODULE);
BOOL DosDateTimeToFileTime(WORD, WORD, LPFILETIME);
BOOL DuplicateHandle(HANDLE, HANDLE, HANDLE, PHANDLE, DWORD, BOOL, DWORD);
BOOL EndUpdateResourceA(HANDLE, BOOL);
BOOL EndUpdateResourceW(HANDLE, BOOL);
void EnterCriticalSection(LPCRITICAL_SECTION);
void EnterCriticalSection(shared(CRITICAL_SECTION)*);
BOOL EnumResourceLanguagesA(HMODULE, LPCSTR, LPCSTR, ENUMRESLANGPROC, LONG_PTR);
BOOL EnumResourceLanguagesW(HMODULE, LPCWSTR, LPCWSTR, ENUMRESLANGPROC, LONG_PTR);
BOOL EnumResourceNamesA(HMODULE, LPCSTR, ENUMRESNAMEPROC, LONG_PTR);
BOOL EnumResourceNamesW(HMODULE, LPCWSTR, ENUMRESNAMEPROC, LONG_PTR);
BOOL EnumResourceTypesA(HMODULE, ENUMRESTYPEPROC, LONG_PTR);
BOOL EnumResourceTypesW(HMODULE, ENUMRESTYPEPROC, LONG_PTR);
BOOL EscapeCommFunction(HANDLE, DWORD);
void ExitProcess(UINT); // Never returns
void ExitThread(DWORD); // Never returns
DWORD ExpandEnvironmentStringsA(LPCSTR, LPSTR, DWORD);
DWORD ExpandEnvironmentStringsW(LPCWSTR, LPWSTR, DWORD);
void FatalAppExitA(UINT, LPCSTR);
void FatalAppExitW(UINT, LPCWSTR);
void FatalExit(int);
BOOL FileTimeToDosDateTime(const(FILETIME)*, LPWORD, LPWORD);
BOOL FileTimeToLocalFileTime(const(FILETIME)*, LPFILETIME);
BOOL FileTimeToSystemTime(const(FILETIME)*, LPSYSTEMTIME);
ATOM FindAtomA(LPCSTR);
ATOM FindAtomW(LPCWSTR);
BOOL FindClose(HANDLE);
BOOL FindCloseChangeNotification(HANDLE);
HANDLE FindFirstChangeNotificationA(LPCSTR, BOOL, DWORD);
HANDLE FindFirstChangeNotificationW(LPCWSTR, BOOL, DWORD);
HANDLE FindFirstFileA(LPCSTR, LPWIN32_FIND_DATAA);
HANDLE FindFirstFileW(LPCWSTR, LPWIN32_FIND_DATAW);
BOOL FindNextChangeNotification(HANDLE);
BOOL FindNextFileA(HANDLE, LPWIN32_FIND_DATAA);
BOOL FindNextFileW(HANDLE, LPWIN32_FIND_DATAW);
HRSRC FindResourceA(HMODULE, LPCSTR, LPCSTR);
HRSRC FindResourceW(HINSTANCE, LPCWSTR, LPCWSTR);
HRSRC FindResourceExA(HINSTANCE, LPCSTR, LPCSTR, WORD);
HRSRC FindResourceExW(HINSTANCE, LPCWSTR, LPCWSTR, WORD);
BOOL FlushFileBuffers(HANDLE);
BOOL FlushInstructionCache(HANDLE, PCVOID, SIZE_T);
DWORD FormatMessageA(DWORD, PCVOID, DWORD, DWORD, LPSTR, DWORD, va_list*);
DWORD FormatMessageW(DWORD, PCVOID, DWORD, DWORD, LPWSTR, DWORD, va_list*);
BOOL FreeEnvironmentStringsA(LPSTR);
BOOL FreeEnvironmentStringsW(LPWSTR);
BOOL FreeLibrary(HMODULE);
void FreeLibraryAndExitThread(HMODULE, DWORD); // never returns
BOOL FreeResource(HGLOBAL);
UINT GetAtomNameA(ATOM, LPSTR, int);
UINT GetAtomNameW(ATOM, LPWSTR, int);
LPSTR GetCommandLineA();
LPWSTR GetCommandLineW();
BOOL GetCommConfig(HANDLE, LPCOMMCONFIG, PDWORD);
BOOL GetCommMask(HANDLE, PDWORD);
BOOL GetCommModemStatus(HANDLE, PDWORD);
BOOL GetCommProperties(HANDLE, LPCOMMPROP);
BOOL GetCommState(HANDLE, LPDCB);
BOOL GetCommTimeouts(HANDLE, LPCOMMTIMEOUTS);
BOOL GetComputerNameA(LPSTR, PDWORD);
BOOL GetComputerNameW(LPWSTR, PDWORD);
DWORD GetCurrentDirectoryA(DWORD, LPSTR);
DWORD GetCurrentDirectoryW(DWORD, LPWSTR);
HANDLE GetCurrentProcess();
DWORD GetCurrentProcessId();
HANDLE GetCurrentThread();
/* In MinGW:
#ifdef _WIN32_WCE
extern DWORD GetCurrentThreadId(void);
#else
WINBASEAPI DWORD WINAPI GetCurrentThreadId(void);
#endif
*/
DWORD GetCurrentThreadId();
alias GetTickCount GetCurrentTime;
BOOL GetDefaultCommConfigA(LPCSTR, LPCOMMCONFIG, PDWORD);
BOOL GetDefaultCommConfigW(LPCWSTR, LPCOMMCONFIG, PDWORD);
BOOL GetDiskFreeSpaceA(LPCSTR, PDWORD, PDWORD, PDWORD, PDWORD);
BOOL GetDiskFreeSpaceW(LPCWSTR, PDWORD, PDWORD, PDWORD, PDWORD);
BOOL GetDiskFreeSpaceExA(LPCSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
BOOL GetDiskFreeSpaceExW(LPCWSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
UINT GetDriveTypeA(LPCSTR);
UINT GetDriveTypeW(LPCWSTR);
LPSTR GetEnvironmentStringsA();
LPWSTR GetEnvironmentStringsW();
DWORD GetEnvironmentVariableA(LPCSTR, LPSTR, DWORD);
DWORD GetEnvironmentVariableW(LPCWSTR, LPWSTR, DWORD);
BOOL GetExitCodeProcess(HANDLE, PDWORD);
BOOL GetExitCodeThread(HANDLE, PDWORD);
DWORD GetFileAttributesA(LPCSTR);
DWORD GetFileAttributesW(LPCWSTR);
BOOL GetFileInformationByHandle(HANDLE, LPBY_HANDLE_FILE_INFORMATION);
DWORD GetFileSize(HANDLE, PDWORD);
BOOL GetFileTime(HANDLE, LPFILETIME, LPFILETIME, LPFILETIME);
DWORD GetFileType(HANDLE);
DWORD GetFullPathNameA(LPCSTR, DWORD, LPSTR, LPSTR*);
DWORD GetFullPathNameW(LPCWSTR, DWORD, LPWSTR, LPWSTR*);
DWORD GetLastError() @trusted;
void GetLocalTime(LPSYSTEMTIME);
DWORD GetLogicalDrives();
DWORD GetLogicalDriveStringsA(DWORD, LPSTR);
DWORD GetLogicalDriveStringsW(DWORD, LPWSTR);
BOOL GetMailslotInfo(HANDLE, PDWORD, PDWORD, PDWORD, PDWORD);
DWORD GetModuleFileNameA(HINSTANCE, LPSTR, DWORD);
DWORD GetModuleFileNameW(HINSTANCE, LPWSTR, DWORD);
HMODULE GetModuleHandleA(LPCSTR);
HMODULE GetModuleHandleW(LPCWSTR);
BOOL GetNamedPipeHandleStateA(HANDLE, PDWORD, PDWORD, PDWORD, PDWORD, LPSTR, DWORD);
BOOL GetNamedPipeHandleStateW(HANDLE, PDWORD, PDWORD, PDWORD, PDWORD, LPWSTR, DWORD);
BOOL GetNamedPipeInfo(HANDLE, PDWORD, PDWORD, PDWORD, PDWORD);
BOOL GetOverlappedResult(HANDLE, LPOVERLAPPED, PDWORD, BOOL);
DWORD GetPriorityClass(HANDLE);
UINT GetPrivateProfileIntA(LPCSTR, LPCSTR, INT, LPCSTR);
UINT GetPrivateProfileIntW(LPCWSTR, LPCWSTR, INT, LPCWSTR);
DWORD GetPrivateProfileSectionA(LPCSTR, LPSTR, DWORD, LPCSTR);
DWORD GetPrivateProfileSectionW(LPCWSTR, LPWSTR, DWORD, LPCWSTR);
DWORD GetPrivateProfileSectionNamesA(LPSTR, DWORD, LPCSTR);
DWORD GetPrivateProfileSectionNamesW(LPWSTR, DWORD, LPCWSTR);
DWORD GetPrivateProfileStringA(LPCSTR, LPCSTR, LPCSTR, LPSTR, DWORD, LPCSTR);
DWORD GetPrivateProfileStringW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, DWORD, LPCWSTR);
BOOL GetPrivateProfileStructA(LPCSTR, LPCSTR, LPVOID, UINT, LPCSTR);
BOOL GetPrivateProfileStructW(LPCWSTR, LPCWSTR, LPVOID, UINT, LPCWSTR);
FARPROC GetProcAddress(HMODULE, LPCSTR); // 1st param wrongly HINSTANCE in MinGW
BOOL GetProcessAffinityMask(HANDLE, PDWORD_PTR, PDWORD_PTR);
DWORD GetProcessVersion(DWORD);
UINT GetProfileIntA(LPCSTR, LPCSTR, INT);
UINT GetProfileIntW(LPCWSTR, LPCWSTR, INT);
DWORD GetProfileSectionA(LPCSTR, LPSTR, DWORD);
DWORD GetProfileSectionW(LPCWSTR, LPWSTR, DWORD);
DWORD GetProfileStringA(LPCSTR, LPCSTR, LPCSTR, LPSTR, DWORD);
DWORD GetProfileStringW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, DWORD);
DWORD GetShortPathNameA(LPCSTR, LPSTR, DWORD);
DWORD GetShortPathNameW(LPCWSTR, LPWSTR, DWORD);
VOID GetStartupInfoA(LPSTARTUPINFOA);
VOID GetStartupInfoW(LPSTARTUPINFOW);
HANDLE GetStdHandle(DWORD);
UINT GetSystemDirectoryA(LPSTR, UINT);
UINT GetSystemDirectoryW(LPWSTR, UINT);
VOID GetSystemInfo(LPSYSTEM_INFO);
VOID GetSystemTime(LPSYSTEMTIME);
BOOL GetSystemTimeAdjustment(PDWORD, PDWORD, PBOOL);
void GetSystemTimeAsFileTime(LPFILETIME);
UINT GetTempFileNameA(LPCSTR, LPCSTR, UINT, LPSTR);
UINT GetTempFileNameW(LPCWSTR, LPCWSTR, UINT, LPWSTR);
DWORD GetTempPathA(DWORD, LPSTR);
DWORD GetTempPathW(DWORD, LPWSTR);
BOOL GetThreadContext(HANDLE, LPCONTEXT);
int GetThreadPriority(HANDLE);
BOOL GetThreadSelectorEntry(HANDLE, DWORD, LPLDT_ENTRY);
DWORD GetTickCount();
DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
BOOL GetUserNameA (LPSTR, PDWORD);
BOOL GetUserNameW(LPWSTR, PDWORD);
DWORD GetVersion();
BOOL GetVersionExA(LPOSVERSIONINFOA);
BOOL GetVersionExW(LPOSVERSIONINFOW);
BOOL GetVolumeInformationA(LPCSTR, LPSTR, DWORD, PDWORD, PDWORD, PDWORD, LPSTR, DWORD);
BOOL GetVolumeInformationW(LPCWSTR, LPWSTR, DWORD, PDWORD, PDWORD, PDWORD, LPWSTR, DWORD);
UINT GetWindowsDirectoryA(LPSTR, UINT);
UINT GetWindowsDirectoryW(LPWSTR, UINT);
DWORD GetWindowThreadProcessId(HWND, PDWORD);
ATOM GlobalAddAtomA(LPCSTR);
ATOM GlobalAddAtomW(LPCWSTR);
ATOM GlobalDeleteAtom(ATOM);
ATOM GlobalFindAtomA(LPCSTR);
ATOM GlobalFindAtomW(LPCWSTR);
UINT GlobalGetAtomNameA(ATOM, LPSTR, int);
UINT GlobalGetAtomNameW(ATOM, LPWSTR, int);
bool HasOverlappedIoCompleted(LPOVERLAPPED lpOverlapped) {
return lpOverlapped.Internal != STATUS_PENDING;
}
BOOL InitAtomTable(DWORD);
VOID InitializeCriticalSection(LPCRITICAL_SECTION) @trusted;
/* ??? The next two are allegedly obsolete and "supported only for
* backward compatibility with the 16-bit Windows API". Yet the
* replacements IsBadReadPtr and IsBadWritePtr are apparently Win2000+
* only. Where's the mistake?
*/
BOOL IsBadHugeReadPtr(PCVOID, UINT_PTR);
BOOL IsBadHugeWritePtr(PVOID, UINT_PTR);
BOOL IsBadReadPtr(PCVOID, UINT_PTR);
BOOL IsBadStringPtrA(LPCSTR, UINT_PTR);
BOOL IsBadStringPtrW(LPCWSTR, UINT_PTR);
BOOL IsBadWritePtr(PVOID, UINT_PTR);
void LeaveCriticalSection(LPCRITICAL_SECTION);
void LeaveCriticalSection(shared(CRITICAL_SECTION)*);
HINSTANCE LoadLibraryA(LPCSTR);
HINSTANCE LoadLibraryW(LPCWSTR);
HINSTANCE LoadLibraryExA(LPCSTR, HANDLE, DWORD);
HINSTANCE LoadLibraryExW(LPCWSTR, HANDLE, DWORD);
DWORD LoadModule(LPCSTR, PVOID);
HGLOBAL LoadResource(HINSTANCE, HRSRC);
BOOL LocalFileTimeToFileTime(const(FILETIME)*, LPFILETIME);
BOOL LockFile(HANDLE, DWORD, DWORD, DWORD, DWORD);
PVOID LockResource(HGLOBAL);
LPSTR lstrcatA(LPSTR, LPCSTR);
LPWSTR lstrcatW(LPWSTR, LPCWSTR);
int lstrcmpA(LPCSTR, LPCSTR);
int lstrcmpiA(LPCSTR, LPCSTR);
int lstrcmpiW(LPCWSTR, LPCWSTR);
int lstrcmpW(LPCWSTR, LPCWSTR);
LPSTR lstrcpyA(LPSTR, LPCSTR);
LPSTR lstrcpynA(LPSTR, LPCSTR, int);
LPWSTR lstrcpynW(LPWSTR, LPCWSTR, int);
LPWSTR lstrcpyW(LPWSTR, LPCWSTR);
int lstrlenA(LPCSTR);
int lstrlenW(LPCWSTR);
BOOL MoveFileA(LPCSTR, LPCSTR);
BOOL MoveFileW(LPCWSTR, LPCWSTR);
int MulDiv(int, int, int);
HANDLE OpenEventA(DWORD, BOOL, LPCSTR);
HANDLE OpenEventW(DWORD, BOOL, LPCWSTR);
deprecated HFILE OpenFile(LPCSTR, LPOFSTRUCT, UINT);
HANDLE OpenMutexA(DWORD, BOOL, LPCSTR);
HANDLE OpenMutexW(DWORD, BOOL, LPCWSTR);
HANDLE OpenProcess(DWORD, BOOL, DWORD);
HANDLE OpenSemaphoreA(DWORD, BOOL, LPCSTR);
HANDLE OpenSemaphoreW(DWORD, BOOL, LPCWSTR);
void OutputDebugStringA(LPCSTR);
void OutputDebugStringW(LPCWSTR);
BOOL PeekNamedPipe(HANDLE, PVOID, DWORD, PDWORD, PDWORD, PDWORD);
BOOL PulseEvent(HANDLE);
BOOL PurgeComm(HANDLE, DWORD);
BOOL QueryPerformanceCounter(PLARGE_INTEGER);
BOOL QueryPerformanceFrequency(PLARGE_INTEGER);
DWORD QueueUserAPC(PAPCFUNC, HANDLE, ULONG_PTR);
void RaiseException(DWORD, DWORD, DWORD, const(ULONG_PTR)*);
BOOL ReadFile(HANDLE, PVOID, DWORD, PDWORD, LPOVERLAPPED);
BOOL ReadFileEx(HANDLE, PVOID, DWORD, LPOVERLAPPED, LPOVERLAPPED_COMPLETION_ROUTINE);
BOOL ReadProcessMemory(HANDLE, PCVOID, PVOID, SIZE_T, SIZE_T*);
BOOL ReleaseMutex(HANDLE);
BOOL ReleaseSemaphore(HANDLE, LONG, LPLONG);
BOOL RemoveDirectoryA(LPCSTR);
BOOL RemoveDirectoryW(LPCWSTR);
/* In MinGW:
#ifdef _WIN32_WCE
extern BOOL ResetEvent(HANDLE);
#else
WINBASEAPI BOOL WINAPI ResetEvent(HANDLE);
#endif
*/
BOOL ResetEvent(HANDLE);
DWORD ResumeThread(HANDLE);
DWORD SearchPathA(LPCSTR, LPCSTR, LPCSTR, DWORD, LPSTR, LPSTR*);
DWORD SearchPathW(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPWSTR, LPWSTR*);
BOOL SetCommBreak(HANDLE);
BOOL SetCommConfig(HANDLE, LPCOMMCONFIG, DWORD);
BOOL SetCommMask(HANDLE, DWORD);
BOOL SetCommState(HANDLE, LPDCB);
BOOL SetCommTimeouts(HANDLE, LPCOMMTIMEOUTS);
BOOL SetComputerNameA(LPCSTR);
BOOL SetComputerNameW(LPCWSTR);
BOOL SetCurrentDirectoryA(LPCSTR);
BOOL SetCurrentDirectoryW(LPCWSTR);
BOOL SetDefaultCommConfigA(LPCSTR, LPCOMMCONFIG, DWORD);
BOOL SetDefaultCommConfigW(LPCWSTR, LPCOMMCONFIG, DWORD);
BOOL SetEndOfFile(HANDLE);
BOOL SetEnvironmentVariableA(LPCSTR, LPCSTR);
BOOL SetEnvironmentVariableW(LPCWSTR, LPCWSTR);
UINT SetErrorMode(UINT);
/* In MinGW:
#ifdef _WIN32_WCE
extern BOOL SetEvent(HANDLE);
#else
WINBASEAPI BOOL WINAPI SetEvent(HANDLE);
#endif
*/
BOOL SetEvent(HANDLE);
VOID SetFileApisToANSI();
VOID SetFileApisToOEM();
BOOL SetFileAttributesA(LPCSTR, DWORD);
BOOL SetFileAttributesW(LPCWSTR, DWORD);
DWORD SetFilePointer(HANDLE, LONG, PLONG, DWORD);
BOOL SetFileTime(HANDLE, const(FILETIME)*, const(FILETIME)*, const(FILETIME)*);
deprecated UINT SetHandleCount(UINT);
void SetLastError(DWORD);
void SetLastErrorEx(DWORD, DWORD);
BOOL SetLocalTime(const(SYSTEMTIME)*);
BOOL SetMailslotInfo(HANDLE, DWORD);
BOOL SetNamedPipeHandleState(HANDLE, PDWORD, PDWORD, PDWORD);
BOOL SetPriorityClass(HANDLE, DWORD);
BOOL SetStdHandle(DWORD, HANDLE);
BOOL SetSystemTime(const(SYSTEMTIME)*);
DWORD_PTR SetThreadAffinityMask(HANDLE, DWORD_PTR);
BOOL SetThreadContext(HANDLE, const(CONTEXT)*);
BOOL SetThreadPriority(HANDLE, int);
BOOL SetTimeZoneInformation(const(TIME_ZONE_INFORMATION)*);
LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER);
BOOL SetupComm(HANDLE, DWORD, DWORD);
BOOL SetVolumeLabelA(LPCSTR, LPCSTR);
BOOL SetVolumeLabelW(LPCWSTR, LPCWSTR);
DWORD SizeofResource(HINSTANCE, HRSRC);
void Sleep(DWORD);
DWORD SleepEx(DWORD, BOOL);
DWORD SuspendThread(HANDLE);
BOOL SystemTimeToFileTime(const(SYSTEMTIME)*, LPFILETIME);
BOOL TerminateProcess(HANDLE, UINT);
BOOL TerminateThread(HANDLE, DWORD);
DWORD TlsAlloc();
BOOL TlsFree(DWORD);
PVOID TlsGetValue(DWORD);
BOOL TlsSetValue(DWORD, PVOID);
BOOL TransactNamedPipe(HANDLE, PVOID, DWORD, PVOID, DWORD, PDWORD, LPOVERLAPPED);
BOOL TransmitCommChar(HANDLE, char);
LONG UnhandledExceptionFilter(LPEXCEPTION_POINTERS);
BOOL UnlockFile(HANDLE, DWORD, DWORD, DWORD, DWORD);
BOOL WaitCommEvent(HANDLE, PDWORD, LPOVERLAPPED);
BOOL WaitForDebugEvent(LPDEBUG_EVENT, DWORD);
DWORD WaitForMultipleObjects(DWORD, const(HANDLE)*, BOOL, DWORD);
DWORD WaitForMultipleObjectsEx(DWORD, const(HANDLE)*, BOOL, DWORD, BOOL);
DWORD WaitForSingleObject(HANDLE, DWORD);
DWORD WaitForSingleObjectEx(HANDLE, DWORD, BOOL);
BOOL WaitNamedPipeA(LPCSTR, DWORD);
BOOL WaitNamedPipeW(LPCWSTR, DWORD);
// undocumented on MSDN
BOOL WinLoadTrustProvider(GUID*);
BOOL WriteFile(HANDLE, PCVOID, DWORD, PDWORD, LPOVERLAPPED);
BOOL WriteFileEx(HANDLE, PCVOID, DWORD, LPOVERLAPPED, LPOVERLAPPED_COMPLETION_ROUTINE);
BOOL WritePrivateProfileSectionA(LPCSTR, LPCSTR, LPCSTR);
BOOL WritePrivateProfileSectionW(LPCWSTR, LPCWSTR, LPCWSTR);
BOOL WritePrivateProfileStringA(LPCSTR, LPCSTR, LPCSTR, LPCSTR);
BOOL WritePrivateProfileStringW(LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR);
BOOL WritePrivateProfileStructA(LPCSTR, LPCSTR, LPVOID, UINT, LPCSTR);
BOOL WritePrivateProfileStructW(LPCWSTR, LPCWSTR, LPVOID, UINT, LPCWSTR);
BOOL WriteProcessMemory(HANDLE, LPVOID, LPCVOID, SIZE_T, SIZE_T*);
BOOL WriteProfileSectionA(LPCSTR, LPCSTR);
BOOL WriteProfileSectionW(LPCWSTR, LPCWSTR);
BOOL WriteProfileStringA(LPCSTR, LPCSTR, LPCSTR);
BOOL WriteProfileStringW(LPCWSTR, LPCWSTR, LPCWSTR);
/* Memory allocation functions.
* MSDN documents these erroneously as Win2000+; thus it is uncertain what
* version compatibility they really have.
*/
HGLOBAL GlobalAlloc(UINT, SIZE_T);
HGLOBAL GlobalDiscard(HGLOBAL);
HGLOBAL GlobalFree(HGLOBAL);
HGLOBAL GlobalHandle(PCVOID);
LPVOID GlobalLock(HGLOBAL);
VOID GlobalMemoryStatus(LPMEMORYSTATUS);
HGLOBAL GlobalReAlloc(HGLOBAL, SIZE_T, UINT);
SIZE_T GlobalSize(HGLOBAL);
BOOL GlobalUnlock(HGLOBAL);
PVOID HeapAlloc(HANDLE, DWORD, SIZE_T);
SIZE_T HeapCompact(HANDLE, DWORD);
HANDLE HeapCreate(DWORD, SIZE_T, SIZE_T);
BOOL HeapDestroy(HANDLE);
BOOL HeapFree(HANDLE, DWORD, PVOID);
BOOL HeapLock(HANDLE);
PVOID HeapReAlloc(HANDLE, DWORD, PVOID, SIZE_T);
SIZE_T HeapSize(HANDLE, DWORD, PCVOID);
BOOL HeapUnlock(HANDLE);
BOOL HeapValidate(HANDLE, DWORD, PCVOID);
BOOL HeapWalk(HANDLE, LPPROCESS_HEAP_ENTRY);
HLOCAL LocalAlloc(UINT, SIZE_T);
HLOCAL LocalDiscard(HLOCAL);
HLOCAL LocalFree(HLOCAL);
HLOCAL LocalHandle(LPCVOID);
PVOID LocalLock(HLOCAL);
HLOCAL LocalReAlloc(HLOCAL, SIZE_T, UINT);
SIZE_T LocalSize(HLOCAL);
BOOL LocalUnlock(HLOCAL);
PVOID VirtualAlloc(PVOID, SIZE_T, DWORD, DWORD);
PVOID VirtualAllocEx(HANDLE, PVOID, SIZE_T, DWORD, DWORD);
BOOL VirtualFree(PVOID, SIZE_T, DWORD);
BOOL VirtualFreeEx(HANDLE, PVOID, SIZE_T, DWORD);
BOOL VirtualLock(PVOID, SIZE_T);
BOOL VirtualProtect(PVOID, SIZE_T, DWORD, PDWORD);
BOOL VirtualProtectEx(HANDLE, PVOID, SIZE_T, DWORD, PDWORD);
SIZE_T VirtualQuery(LPCVOID, PMEMORY_BASIC_INFORMATION, SIZE_T);
SIZE_T VirtualQueryEx(HANDLE, LPCVOID, PMEMORY_BASIC_INFORMATION, SIZE_T);
BOOL VirtualUnlock(PVOID, SIZE_T);
// not in MinGW 4.0 - ???
static if (_WIN32_WINNT >= 0x600) {
BOOL CancelIoEx(HANDLE, LPOVERLAPPED);
}
BOOL CancelIo(HANDLE);
BOOL CancelWaitableTimer(HANDLE);
PVOID ConvertThreadToFiber(PVOID);
LPVOID CreateFiber(SIZE_T, LPFIBER_START_ROUTINE, LPVOID);
HANDLE CreateWaitableTimerA(LPSECURITY_ATTRIBUTES, BOOL, LPCSTR);
HANDLE CreateWaitableTimerW(LPSECURITY_ATTRIBUTES, BOOL, LPCWSTR);
void DeleteFiber(PVOID);
BOOL GetFileAttributesExA(LPCSTR, GET_FILEEX_INFO_LEVELS, PVOID);
BOOL GetFileAttributesExW(LPCWSTR, GET_FILEEX_INFO_LEVELS, PVOID);
DWORD GetLongPathNameA(LPCSTR, LPSTR, DWORD);
DWORD GetLongPathNameW(LPCWSTR, LPWSTR, DWORD);
BOOL InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION, DWORD);
BOOL IsDebuggerPresent();
HANDLE OpenWaitableTimerA(DWORD, BOOL, LPCSTR);
HANDLE OpenWaitableTimerW(DWORD, BOOL, LPCWSTR);
DWORD QueryDosDeviceA(LPCSTR, LPSTR, DWORD);
DWORD QueryDosDeviceW(LPCWSTR, LPWSTR, DWORD);
BOOL SetWaitableTimer(HANDLE, const(LARGE_INTEGER)*, LONG, PTIMERAPCROUTINE, PVOID, BOOL);
void SwitchToFiber(PVOID);
static if (_WIN32_WINNT >= 0x500) {
HANDLE OpenThread(DWORD, BOOL, DWORD);
}
BOOL AccessCheck(PSECURITY_DESCRIPTOR, HANDLE, DWORD, PGENERIC_MAPPING, PPRIVILEGE_SET, PDWORD, PDWORD, PBOOL);
BOOL AccessCheckAndAuditAlarmA(LPCSTR, LPVOID, LPSTR, LPSTR, PSECURITY_DESCRIPTOR, DWORD, PGENERIC_MAPPING, BOOL, PDWORD, PBOOL, PBOOL);
BOOL AccessCheckAndAuditAlarmW(LPCWSTR, LPVOID, LPWSTR, LPWSTR, PSECURITY_DESCRIPTOR, DWORD, PGENERIC_MAPPING, BOOL, PDWORD, PBOOL, PBOOL);
BOOL AddAccessAllowedAce(PACL, DWORD, DWORD, PSID);
BOOL AddAccessDeniedAce(PACL, DWORD, DWORD, PSID);
BOOL AddAce(PACL, DWORD, DWORD, PVOID, DWORD);
BOOL AddAuditAccessAce(PACL, DWORD, DWORD, PSID, BOOL, BOOL);
BOOL AdjustTokenGroups(HANDLE, BOOL, PTOKEN_GROUPS, DWORD, PTOKEN_GROUPS, PDWORD);
BOOL AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
BOOL AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY, BYTE, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, PSID*);
BOOL AllocateLocallyUniqueId(PLUID);
BOOL AreAllAccessesGranted(DWORD, DWORD);
BOOL AreAnyAccessesGranted(DWORD, DWORD);
BOOL BackupEventLogA(HANDLE, LPCSTR);
BOOL BackupEventLogW(HANDLE, LPCWSTR);
BOOL BackupRead(HANDLE, LPBYTE, DWORD, LPDWORD, BOOL, BOOL, LPVOID*);
BOOL BackupSeek(HANDLE, DWORD, DWORD, LPDWORD, LPDWORD, LPVOID*);
BOOL BackupWrite(HANDLE, LPBYTE, DWORD, LPDWORD, BOOL, BOOL, LPVOID*);
BOOL ClearEventLogA(HANDLE, LPCSTR);
BOOL ClearEventLogW(HANDLE, LPCWSTR);
BOOL CloseEventLog(HANDLE);
BOOL ConnectNamedPipe(HANDLE, LPOVERLAPPED);
BOOL CopySid(DWORD, PSID, PSID);
HANDLE CreateNamedPipeA(LPCSTR, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPSECURITY_ATTRIBUTES);
HANDLE CreateNamedPipeW(LPCWSTR, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPSECURITY_ATTRIBUTES);
BOOL CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR*, BOOL, HANDLE, PGENERIC_MAPPING);
BOOL CreateProcessAsUserA(HANDLE, LPCSTR, LPSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, PVOID, LPCSTR, LPSTARTUPINFOA, LPPROCESS_INFORMATION);
BOOL CreateProcessAsUserW(HANDLE, LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, PVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
HANDLE CreateRemoteThread(HANDLE, LPSECURITY_ATTRIBUTES, SIZE_T, LPTHREAD_START_ROUTINE, LPVOID, DWORD, LPDWORD);
DWORD CreateTapePartition(HANDLE, DWORD, DWORD, DWORD);
BOOL DefineDosDeviceA(DWORD, LPCSTR, LPCSTR);
BOOL DefineDosDeviceW(DWORD, LPCWSTR, LPCWSTR);
BOOL DeleteAce(PACL, DWORD);
BOOL DeregisterEventSource(HANDLE);
BOOL DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR*);
BOOL DeviceIoControl(HANDLE, DWORD, PVOID, DWORD, PVOID, DWORD, PDWORD, POVERLAPPED);
BOOL DisconnectNamedPipe(HANDLE);
BOOL DuplicateToken(HANDLE, SECURITY_IMPERSONATION_LEVEL, PHANDLE);
BOOL DuplicateTokenEx(HANDLE, DWORD, LPSECURITY_ATTRIBUTES, SECURITY_IMPERSONATION_LEVEL, TOKEN_TYPE, PHANDLE);
BOOL EqualPrefixSid(PSID, PSID);
BOOL EqualSid(PSID, PSID);
DWORD EraseTape(HANDLE, DWORD, BOOL);
HANDLE FindFirstFileExA(LPCSTR, FINDEX_INFO_LEVELS, PVOID, FINDEX_SEARCH_OPS, PVOID, DWORD);
HANDLE FindFirstFileExW(LPCWSTR, FINDEX_INFO_LEVELS, PVOID, FINDEX_SEARCH_OPS, PVOID, DWORD);
BOOL FindFirstFreeAce(PACL, PVOID*);
PVOID FreeSid(PSID);
BOOL GetAce(PACL, DWORD, LPVOID*);
BOOL GetAclInformation(PACL, PVOID, DWORD, ACL_INFORMATION_CLASS);
BOOL GetBinaryTypeA(LPCSTR, PDWORD);
BOOL GetBinaryTypeW(LPCWSTR, PDWORD);
DWORD GetCompressedFileSizeA(LPCSTR, PDWORD);
DWORD GetCompressedFileSizeW(LPCWSTR, PDWORD);
BOOL GetCurrentHwProfileA(LPHW_PROFILE_INFOA);
BOOL GetCurrentHwProfileW(LPHW_PROFILE_INFOW);
BOOL GetFileSecurityA(LPCSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, DWORD, PDWORD);
BOOL GetFileSecurityW(LPCWSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, DWORD, PDWORD);
BOOL GetHandleInformation(HANDLE, PDWORD);
BOOL GetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, DWORD, PDWORD);
DWORD GetLengthSid(PSID);
BOOL GetNumberOfEventLogRecords(HANDLE, PDWORD);
BOOL GetOldestEventLogRecord(HANDLE, PDWORD);
BOOL GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, DWORD, PDWORD);
BOOL GetProcessPriorityBoost(HANDLE, PBOOL);
BOOL GetProcessShutdownParameters(PDWORD, PDWORD);
BOOL GetProcessTimes(HANDLE, LPFILETIME, LPFILETIME, LPFILETIME, LPFILETIME);
HWINSTA GetProcessWindowStation();
BOOL GetProcessWorkingSetSize(HANDLE, PSIZE_T, PSIZE_T);
BOOL GetQueuedCompletionStatus(HANDLE, PDWORD, PULONG_PTR, LPOVERLAPPED*, DWORD);
BOOL GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL, PDWORD);
BOOL GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR, LPBOOL, PACL*, LPBOOL);
BOOL GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID*, LPBOOL);
DWORD GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
BOOL GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID*, LPBOOL);
BOOL GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR, LPBOOL, PACL*, LPBOOL);
PSID_IDENTIFIER_AUTHORITY GetSidIdentifierAuthority(PSID);
DWORD GetSidLengthRequired(UCHAR);
PDWORD GetSidSubAuthority(PSID, DWORD);
PUCHAR GetSidSubAuthorityCount(PSID);
DWORD GetTapeParameters(HANDLE, DWORD, PDWORD, PVOID);
DWORD GetTapePosition(HANDLE, DWORD, PDWORD, PDWORD, PDWORD);
DWORD GetTapeStatus(HANDLE);
BOOL GetThreadPriorityBoost(HANDLE, PBOOL);
BOOL GetThreadTimes(HANDLE, LPFILETIME, LPFILETIME, LPFILETIME, LPFILETIME);
BOOL GetTokenInformation(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, DWORD, PDWORD);
BOOL ImpersonateLoggedOnUser(HANDLE);
BOOL ImpersonateNamedPipeClient(HANDLE);
BOOL ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
BOOL InitializeAcl(PACL, DWORD, DWORD);
DWORD SetCriticalSectionSpinCount(LPCRITICAL_SECTION, DWORD);
BOOL InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR, DWORD);
BOOL InitializeSid(PSID, PSID_IDENTIFIER_AUTHORITY, BYTE);
BOOL IsProcessorFeaturePresent(DWORD);
BOOL IsTextUnicode(PCVOID, int, LPINT);
BOOL IsValidAcl(PACL);
BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
BOOL IsValidSid(PSID);
BOOL LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED);
BOOL LogonUserA(LPSTR, LPSTR, LPSTR, DWORD, DWORD, PHANDLE);
BOOL LogonUserW(LPWSTR, LPWSTR, LPWSTR, DWORD, DWORD, PHANDLE);
BOOL LookupAccountNameA(LPCSTR, LPCSTR, PSID, PDWORD, LPSTR, PDWORD, PSID_NAME_USE);
BOOL LookupAccountNameW(LPCWSTR, LPCWSTR, PSID, PDWORD, LPWSTR, PDWORD, PSID_NAME_USE);
BOOL LookupAccountSidA(LPCSTR, PSID, LPSTR, PDWORD, LPSTR, PDWORD, PSID_NAME_USE);
BOOL LookupAccountSidW(LPCWSTR, PSID, LPWSTR, PDWORD, LPWSTR, PDWORD, PSID_NAME_USE);
BOOL LookupPrivilegeDisplayNameA(LPCSTR, LPCSTR, LPSTR, PDWORD, PDWORD);
BOOL LookupPrivilegeDisplayNameW(LPCWSTR, LPCWSTR, LPWSTR, PDWORD, PDWORD);
BOOL LookupPrivilegeNameA(LPCSTR, PLUID, LPSTR, PDWORD);
BOOL LookupPrivilegeNameW(LPCWSTR, PLUID, LPWSTR, PDWORD);
BOOL LookupPrivilegeValueA(LPCSTR, LPCSTR, PLUID);
BOOL LookupPrivilegeValueW(LPCWSTR, LPCWSTR, PLUID);
BOOL MakeAbsoluteSD(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR, PDWORD, PACL, PDWORD, PACL, PDWORD, PSID, PDWORD, PSID, PDWORD);
BOOL MakeSelfRelativeSD(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR, PDWORD);
VOID MapGenericMask(PDWORD, PGENERIC_MAPPING);
BOOL MoveFileExA(LPCSTR, LPCSTR, DWORD);
BOOL MoveFileExW(LPCWSTR, LPCWSTR, DWORD);
BOOL NotifyChangeEventLog(HANDLE, HANDLE);
BOOL ObjectCloseAuditAlarmA(LPCSTR, PVOID, BOOL);
BOOL ObjectCloseAuditAlarmW(LPCWSTR, PVOID, BOOL);
BOOL ObjectDeleteAuditAlarmA(LPCSTR, PVOID, BOOL);
BOOL ObjectDeleteAuditAlarmW(LPCWSTR, PVOID, BOOL);
BOOL ObjectOpenAuditAlarmA(LPCSTR, PVOID, LPSTR, LPSTR, PSECURITY_DESCRIPTOR, HANDLE, DWORD, DWORD, PPRIVILEGE_SET, BOOL, BOOL, PBOOL);
BOOL ObjectOpenAuditAlarmW(LPCWSTR, PVOID, LPWSTR, LPWSTR, PSECURITY_DESCRIPTOR, HANDLE, DWORD, DWORD, PPRIVILEGE_SET, BOOL, BOOL, PBOOL);
BOOL ObjectPrivilegeAuditAlarmA(LPCSTR, PVOID, HANDLE, DWORD, PPRIVILEGE_SET, BOOL);
BOOL ObjectPrivilegeAuditAlarmW(LPCWSTR, PVOID, HANDLE, DWORD, PPRIVILEGE_SET, BOOL);
HANDLE OpenBackupEventLogA(LPCSTR, LPCSTR);
HANDLE OpenBackupEventLogW(LPCWSTR, LPCWSTR);
HANDLE OpenEventLogA(LPCSTR, LPCSTR);
HANDLE OpenEventLogW(LPCWSTR, LPCWSTR);
BOOL OpenProcessToken(HANDLE, DWORD, PHANDLE);
BOOL OpenThreadToken(HANDLE, DWORD, BOOL, PHANDLE);
BOOL PostQueuedCompletionStatus(HANDLE, DWORD, ULONG_PTR, LPOVERLAPPED);
DWORD PrepareTape(HANDLE, DWORD, BOOL);
BOOL PrivilegeCheck(HANDLE, PPRIVILEGE_SET, PBOOL);
BOOL PrivilegedServiceAuditAlarmA(LPCSTR, LPCSTR, HANDLE, PPRIVILEGE_SET, BOOL);
BOOL PrivilegedServiceAuditAlarmW(LPCWSTR, LPCWSTR, HANDLE, PPRIVILEGE_SET, BOOL);
BOOL ReadDirectoryChangesW(HANDLE, PVOID, DWORD, BOOL, DWORD, PDWORD, LPOVERLAPPED, LPOVERLAPPED_COMPLETION_ROUTINE);
BOOL ReadEventLogA(HANDLE, DWORD, DWORD, PVOID, DWORD, DWORD*, DWORD*);
BOOL ReadEventLogW(HANDLE, DWORD, DWORD, PVOID, DWORD, DWORD*, DWORD*);
BOOL ReadFileScatter(HANDLE, FILE_SEGMENT_ELEMENT*, DWORD, LPDWORD, LPOVERLAPPED);
HANDLE RegisterEventSourceA (LPCSTR, LPCSTR);
HANDLE RegisterEventSourceW(LPCWSTR, LPCWSTR);
BOOL ReportEventA(HANDLE, WORD, WORD, DWORD, PSID, WORD, DWORD, LPCSTR*, PVOID);
BOOL ReportEventW(HANDLE, WORD, WORD, DWORD, PSID, WORD, DWORD, LPCWSTR*, PVOID);
BOOL RevertToSelf();
BOOL SetAclInformation(PACL, PVOID, DWORD, ACL_INFORMATION_CLASS);
BOOL SetFileSecurityA(LPCSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR);
BOOL SetFileSecurityW(LPCWSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR);
BOOL SetHandleInformation(HANDLE, DWORD, DWORD);
BOOL SetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR);
BOOL SetPrivateObjectSecurity(SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR*, PGENERIC_MAPPING, HANDLE);
BOOL SetProcessAffinityMask(HANDLE, DWORD_PTR);
BOOL SetProcessPriorityBoost(HANDLE, BOOL);
BOOL SetProcessShutdownParameters(DWORD, DWORD);
BOOL SetProcessWorkingSetSize(HANDLE, SIZE_T, SIZE_T);
BOOL SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL);
BOOL SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID, BOOL);
BOOL SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID, BOOL);
BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL);
BOOL SetSystemTimeAdjustment(DWORD, BOOL);
DWORD SetTapeParameters(HANDLE, DWORD, PVOID);
DWORD SetTapePosition(HANDLE, DWORD, DWORD, DWORD, DWORD, BOOL);
BOOL SetThreadPriorityBoost(HANDLE, BOOL);
BOOL SetThreadToken(PHANDLE, HANDLE);
BOOL SetTokenInformation(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, DWORD);
DWORD SignalObjectAndWait(HANDLE, HANDLE, DWORD, BOOL);
BOOL SwitchToThread();
BOOL SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION, LPSYSTEMTIME, LPSYSTEMTIME);
BOOL TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION, LPSYSTEMTIME, LPSYSTEMTIME);
BOOL TryEnterCriticalSection(LPCRITICAL_SECTION);
BOOL TryEnterCriticalSection(shared(CRITICAL_SECTION)*);
BOOL UnlockFileEx(HANDLE, DWORD, DWORD, DWORD, LPOVERLAPPED);
BOOL UpdateResourceA(HANDLE, LPCSTR, LPCSTR, WORD, PVOID, DWORD);
BOOL UpdateResourceW(HANDLE, LPCWSTR, LPCWSTR, WORD, PVOID, DWORD);
BOOL WriteFileGather(HANDLE, FILE_SEGMENT_ELEMENT*, DWORD, LPDWORD, LPOVERLAPPED);
DWORD WriteTapemark(HANDLE, DWORD, DWORD, BOOL);
static if (_WIN32_WINNT >= 0x500) {
BOOL AddAccessAllowedAceEx(PACL, DWORD, DWORD, DWORD, PSID);
BOOL AddAccessDeniedAceEx(PACL, DWORD, DWORD, DWORD, PSID);
PVOID AddVectoredExceptionHandler(ULONG, PVECTORED_EXCEPTION_HANDLER);
BOOL AllocateUserPhysicalPages(HANDLE, PULONG_PTR, PULONG_PTR);
BOOL AssignProcessToJobObject(HANDLE, HANDLE);
BOOL ChangeTimerQueueTimer(HANDLE,HANDLE,ULONG,ULONG);
LPVOID CreateFiberEx(SIZE_T, SIZE_T, DWORD, LPFIBER_START_ROUTINE, LPVOID);
HANDLE CreateFileMappingA(HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCSTR);
HANDLE CreateFileMappingW(HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCWSTR);
BOOL CreateHardLinkA(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
BOOL CreateHardLinkW(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
HANDLE CreateJobObjectA(LPSECURITY_ATTRIBUTES, LPCSTR);
HANDLE CreateJobObjectW(LPSECURITY_ATTRIBUTES, LPCWSTR);
BOOL CreateProcessWithLogonW(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPCWSTR, LPWSTR, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
HANDLE CreateTimerQueue();
BOOL CreateTimerQueueTimer(PHANDLE, HANDLE, WAITORTIMERCALLBACK, PVOID, DWORD, DWORD, ULONG);
BOOL DeleteTimerQueue(HANDLE);
BOOL DeleteTimerQueueEx(HANDLE, HANDLE);
BOOL DeleteTimerQueueTimer(HANDLE, HANDLE, HANDLE);
BOOL DeleteVolumeMountPointA(LPCSTR);
BOOL DeleteVolumeMountPointW(LPCWSTR);
BOOL DnsHostnameToComputerNameA(LPCSTR, LPSTR, LPDWORD);
BOOL DnsHostnameToComputerNameW(LPCWSTR, LPWSTR, LPDWORD);
BOOL EncryptFileA(LPCSTR);
BOOL EncryptFileW(LPCWSTR);
BOOL FileEncryptionStatusA(LPCSTR, LPDWORD);
BOOL FileEncryptionStatusW(LPCWSTR, LPDWORD);
HANDLE FindFirstVolumeA(LPCSTR, DWORD);
HANDLE FindFirstVolumeMountPointA(LPSTR, LPSTR, DWORD);
HANDLE FindFirstVolumeMountPointW(LPWSTR, LPWSTR, DWORD);
HANDLE FindFirstVolumeW(LPCWSTR, DWORD);
BOOL FindNextVolumeA(HANDLE, LPCSTR, DWORD);
BOOL FindNextVolumeW(HANDLE, LPWSTR, DWORD);
BOOL FindNextVolumeMountPointA(HANDLE, LPSTR, DWORD);
BOOL FindNextVolumeMountPointW(HANDLE, LPWSTR, DWORD);
BOOL FindVolumeClose(HANDLE);
BOOL FindVolumeMountPointClose(HANDLE);
BOOL FlushViewOfFile(PCVOID, SIZE_T);
BOOL FreeUserPhysicalPages(HANDLE, PULONG_PTR, PULONG_PTR);
BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD);
BOOL GetComputerNameExW(COMPUTER_NAME_FORMAT, LPWSTR, LPDWORD);
BOOL GetFileSizeEx(HANDLE, PLARGE_INTEGER);
BOOL GetModuleHandleExA(DWORD, LPCSTR, HMODULE*);
BOOL GetModuleHandleExW(DWORD, LPCWSTR, HMODULE*);
HANDLE GetProcessHeap();
DWORD GetProcessHeaps(DWORD, PHANDLE);
BOOL GetProcessIoCounters(HANDLE, PIO_COUNTERS);
BOOL GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
UINT GetSystemWindowsDirectoryA(LPSTR, UINT);
UINT GetSystemWindowsDirectoryW(LPWSTR, UINT);
BOOL GetVolumeNameForVolumeMountPointA(LPCSTR, LPSTR, DWORD);
BOOL GetVolumeNameForVolumeMountPointW(LPCWSTR, LPWSTR, DWORD);
BOOL GetVolumePathNameA(LPCSTR, LPSTR, DWORD);
BOOL GetVolumePathNameW(LPCWSTR, LPWSTR, DWORD);
BOOL GlobalMemoryStatusEx(LPMEMORYSTATUSEX);
BOOL IsBadCodePtr(FARPROC);
BOOL IsSystemResumeAutomatic();
BOOL MapUserPhysicalPages(PVOID, ULONG_PTR, PULONG_PTR);
BOOL MapUserPhysicalPagesScatter(PVOID*, ULONG_PTR, PULONG_PTR);
PVOID MapViewOfFile(HANDLE, DWORD, DWORD, DWORD, SIZE_T);
PVOID MapViewOfFileEx(HANDLE, DWORD, DWORD, DWORD, SIZE_T, PVOID);
HANDLE OpenFileMappingA(DWORD, BOOL, LPCSTR);
HANDLE OpenFileMappingW(DWORD, BOOL, LPCWSTR);
BOOL ProcessIdToSessionId(DWORD, DWORD*);
BOOL QueryInformationJobObject(HANDLE, JOBOBJECTINFOCLASS, LPVOID, DWORD, LPDWORD);
ULONG RemoveVectoredExceptionHandler(PVOID);
BOOL ReplaceFileA(LPCSTR, LPCSTR, LPCSTR, DWORD, LPVOID, LPVOID);
BOOL ReplaceFileW(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPVOID, LPVOID);
BOOL SetComputerNameExA(COMPUTER_NAME_FORMAT, LPCSTR);
BOOL SetComputerNameExW(COMPUTER_NAME_FORMAT, LPCWSTR);
BOOL SetFilePointerEx(HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD);
BOOL SetInformationJobObject(HANDLE, JOBOBJECTINFOCLASS, LPVOID, DWORD);
BOOL SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR, SECURITY_DESCRIPTOR_CONTROL, SECURITY_DESCRIPTOR_CONTROL);
BOOL SetSystemPowerState(BOOL, BOOL);
EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE);
DWORD SetThreadIdealProcessor(HANDLE, DWORD);
BOOL SetVolumeMountPointA(LPCSTR, LPCSTR);
BOOL SetVolumeMountPointW(LPCWSTR, LPCWSTR);
BOOL TerminateJobObject(HANDLE, UINT);
BOOL UnmapViewOfFile(PCVOID);
BOOL UnregisterWait(HANDLE);
BOOL UnregisterWaitEx(HANDLE, HANDLE);
BOOL VerifyVersionInfoA(LPOSVERSIONINFOEXA, DWORD, DWORDLONG);
BOOL VerifyVersionInfoW(LPOSVERSIONINFOEXW, DWORD, DWORDLONG);
}
static if (_WIN32_WINNT >= 0x501) {
BOOL ActivateActCtx(HANDLE, ULONG_PTR*);
void AddRefActCtx(HANDLE);
BOOL CheckNameLegalDOS8Dot3A(LPCSTR, LPSTR, DWORD, PBOOL, PBOOL);
BOOL CheckNameLegalDOS8Dot3W(LPCWSTR, LPSTR, DWORD, PBOOL, PBOOL);
BOOL CheckRemoteDebuggerPresent(HANDLE, PBOOL);
BOOL ConvertFiberToThread();
HANDLE CreateActCtxA(PCACTCTXA);
HANDLE CreateActCtxW(PCACTCTXW);
HANDLE CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE);
BOOL DeactivateActCtx(DWORD, ULONG_PTR);
BOOL DebugActiveProcessStop(DWORD);
BOOL DebugBreakProcess(HANDLE);
BOOL DebugSetProcessKillOnExit(BOOL);
BOOL FindActCtxSectionGuid(DWORD, const(GUID)*, ULONG, const(GUID)*,
PACTCTX_SECTION_KEYED_DATA);
BOOL FindActCtxSectionStringA(DWORD, const(GUID)*, ULONG, LPCSTR,
PACTCTX_SECTION_KEYED_DATA);
BOOL FindActCtxSectionStringW(DWORD, const(GUID)*, ULONG, LPCWSTR,
PACTCTX_SECTION_KEYED_DATA);
BOOL GetCurrentActCtx(HANDLE*);
VOID GetNativeSystemInfo(LPSYSTEM_INFO);
BOOL GetProcessHandleCount(HANDLE, PDWORD);
BOOL GetSystemRegistryQuota(PDWORD, PDWORD);
BOOL GetSystemTimes(LPFILETIME, LPFILETIME, LPFILETIME);
UINT GetSystemWow64DirectoryA(LPSTR, UINT);
UINT GetSystemWow64DirectoryW(LPWSTR, UINT);
BOOL GetThreadIOPendingFlag(HANDLE, PBOOL);
BOOL GetVolumePathNamesForVolumeNameA(LPCSTR, LPSTR, DWORD, PDWORD);
BOOL GetVolumePathNamesForVolumeNameW(LPCWSTR, LPWSTR, DWORD, PDWORD);
UINT GetWriteWatch(DWORD, PVOID, SIZE_T, PVOID*, PULONG_PTR, PULONG);
BOOL HeapQueryInformation(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
BOOL HeapSetInformation(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T);
BOOL IsProcessInJob(HANDLE, HANDLE, PBOOL);
BOOL IsWow64Process(HANDLE, PBOOL);
BOOL QueryActCtxW(DWORD, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T*);
BOOL QueryMemoryResourceNotification(HANDLE, PBOOL);
void ReleaseActCtx(HANDLE);
UINT ResetWriteWatch(LPVOID, SIZE_T);
BOOL SetFileShortNameA(HANDLE, LPCSTR);
BOOL SetFileShortNameW(HANDLE, LPCWSTR);
BOOL SetFileValidData(HANDLE, LONGLONG);
BOOL ZombifyActCtx(HANDLE);
}
static if (_WIN32_WINNT >= 0x502) {
DWORD GetFirmwareEnvironmentVariableA(LPCSTR, LPCSTR, PVOID, DWORD);
DWORD GetFirmwareEnvironmentVariableW(LPCWSTR, LPCWSTR, PVOID, DWORD);
DWORD GetDllDirectoryA(DWORD, LPSTR);
DWORD GetDllDirectoryW(DWORD, LPWSTR);
DWORD GetThreadId(HANDLE);
DWORD GetProcessId(HANDLE);
HANDLE ReOpenFile(HANDLE, DWORD, DWORD, DWORD);
BOOL SetDllDirectoryA(LPCSTR);
BOOL SetDllDirectoryW(LPCWSTR);
BOOL SetFirmwareEnvironmentVariableA(LPCSTR, LPCSTR, PVOID, DWORD);
BOOL SetFirmwareEnvironmentVariableW(LPCWSTR, LPCWSTR, PVOID, DWORD);
}
// ???
static if (_WIN32_WINNT >= 0x510) {
VOID RestoreLastError(DWORD);
}
}
// For compatibility with old core.sys.windows.windows:
version (LittleEndian) nothrow @nogc
{
BOOL QueryPerformanceCounter(long* lpPerformanceCount) { return QueryPerformanceCounter(cast(PLARGE_INTEGER)lpPerformanceCount); }
BOOL QueryPerformanceFrequency(long* lpFrequency) { return QueryPerformanceFrequency(cast(PLARGE_INTEGER)lpFrequency); }
}
mixin DECLARE_AW!("STARTUPINFO");
version (Unicode) {
//alias STARTUPINFOW STARTUPINFO;
alias WIN32_FIND_DATAW WIN32_FIND_DATA;
alias ENUMRESLANGPROCW ENUMRESLANGPROC;
alias ENUMRESNAMEPROCW ENUMRESNAMEPROC;
alias ENUMRESTYPEPROCW ENUMRESTYPEPROC;
alias AddAtomW AddAtom;
alias BeginUpdateResourceW BeginUpdateResource;
alias BuildCommDCBW BuildCommDCB;
alias BuildCommDCBAndTimeoutsW BuildCommDCBAndTimeouts;
alias CallNamedPipeW CallNamedPipe;
alias CommConfigDialogW CommConfigDialog;
alias CopyFileW CopyFile;
alias CopyFileExW CopyFileEx;
alias CreateDirectoryW CreateDirectory;
alias CreateDirectoryExW CreateDirectoryEx;
alias CreateEventW CreateEvent;
alias CreateFileW CreateFile;
alias CreateMailslotW CreateMailslot;
alias CreateMutexW CreateMutex;
alias CreateProcessW CreateProcess;
alias CreateSemaphoreW CreateSemaphore;
alias DeleteFileW DeleteFile;
alias EndUpdateResourceW EndUpdateResource;
alias EnumResourceLanguagesW EnumResourceLanguages;
alias EnumResourceNamesW EnumResourceNames;
alias EnumResourceTypesW EnumResourceTypes;
alias ExpandEnvironmentStringsW ExpandEnvironmentStrings;
alias FatalAppExitW FatalAppExit;
alias FindAtomW FindAtom;
alias FindFirstChangeNotificationW FindFirstChangeNotification;
alias FindFirstFileW FindFirstFile;
alias FindNextFileW FindNextFile;
alias FindResourceW FindResource;
alias FindResourceExW FindResourceEx;
alias FormatMessageW FormatMessage;
alias FreeEnvironmentStringsW FreeEnvironmentStrings;
alias GetAtomNameW GetAtomName;
alias GetCommandLineW GetCommandLine;
alias GetComputerNameW GetComputerName;
alias GetCurrentDirectoryW GetCurrentDirectory;
alias GetDefaultCommConfigW GetDefaultCommConfig;
alias GetDiskFreeSpaceW GetDiskFreeSpace;
alias GetDiskFreeSpaceExW GetDiskFreeSpaceEx;
alias GetDriveTypeW GetDriveType;
alias GetEnvironmentStringsW GetEnvironmentStrings;
alias GetEnvironmentVariableW GetEnvironmentVariable;
alias GetFileAttributesW GetFileAttributes;
alias GetFullPathNameW GetFullPathName;
alias GetLogicalDriveStringsW GetLogicalDriveStrings;
alias GetModuleFileNameW GetModuleFileName;
alias GetModuleHandleW GetModuleHandle;
alias GetNamedPipeHandleStateW GetNamedPipeHandleState;
alias GetPrivateProfileIntW GetPrivateProfileInt;
alias GetPrivateProfileSectionW GetPrivateProfileSection;
alias GetPrivateProfileSectionNamesW GetPrivateProfileSectionNames;
alias GetPrivateProfileStringW GetPrivateProfileString;
alias GetPrivateProfileStructW GetPrivateProfileStruct;
alias GetProfileIntW GetProfileInt;
alias GetProfileSectionW GetProfileSection;
alias GetProfileStringW GetProfileString;
alias GetShortPathNameW GetShortPathName;
alias GetStartupInfoW GetStartupInfo;
alias GetSystemDirectoryW GetSystemDirectory;
alias GetTempFileNameW GetTempFileName;
alias GetTempPathW GetTempPath;
alias GetUserNameW GetUserName;
alias GetVersionExW GetVersionEx;
alias GetVolumeInformationW GetVolumeInformation;
alias GetWindowsDirectoryW GetWindowsDirectory;
alias GlobalAddAtomW GlobalAddAtom;
alias GlobalFindAtomW GlobalFindAtom;
alias GlobalGetAtomNameW GlobalGetAtomName;
alias IsBadStringPtrW IsBadStringPtr;
alias LoadLibraryW LoadLibrary;
alias LoadLibraryExW LoadLibraryEx;
alias lstrcatW lstrcat;
alias lstrcmpW lstrcmp;
alias lstrcmpiW lstrcmpi;
alias lstrcpyW lstrcpy;
alias lstrcpynW lstrcpyn;
alias lstrlenW lstrlen;
alias MoveFileW MoveFile;
alias OpenEventW OpenEvent;
alias OpenMutexW OpenMutex;
alias OpenSemaphoreW OpenSemaphore;
alias OutputDebugStringW OutputDebugString;
alias RemoveDirectoryW RemoveDirectory;
alias SearchPathW SearchPath;
alias SetComputerNameW SetComputerName;
alias SetCurrentDirectoryW SetCurrentDirectory;
alias SetDefaultCommConfigW SetDefaultCommConfig;
alias SetEnvironmentVariableW SetEnvironmentVariable;
alias SetFileAttributesW SetFileAttributes;
alias SetVolumeLabelW SetVolumeLabel;
alias WaitNamedPipeW WaitNamedPipe;
alias WritePrivateProfileSectionW WritePrivateProfileSection;
alias WritePrivateProfileStringW WritePrivateProfileString;
alias WritePrivateProfileStructW WritePrivateProfileStruct;
alias WriteProfileSectionW WriteProfileSection;
alias WriteProfileStringW WriteProfileString;
alias CreateWaitableTimerW CreateWaitableTimer;
alias GetFileAttributesExW GetFileAttributesEx;
alias GetLongPathNameW GetLongPathName;
alias QueryDosDeviceW QueryDosDevice;
alias HW_PROFILE_INFOW HW_PROFILE_INFO;
alias AccessCheckAndAuditAlarmW AccessCheckAndAuditAlarm;
alias BackupEventLogW BackupEventLog;
alias ClearEventLogW ClearEventLog;
alias CreateNamedPipeW CreateNamedPipe;
alias CreateProcessAsUserW CreateProcessAsUser;
alias DefineDosDeviceW DefineDosDevice;
alias FindFirstFileExW FindFirstFileEx;
alias GetBinaryTypeW GetBinaryType;
alias GetCompressedFileSizeW GetCompressedFileSize;
alias GetFileSecurityW GetFileSecurity;
alias LogonUserW LogonUser;
alias LookupAccountNameW LookupAccountName;
alias LookupAccountSidW LookupAccountSid;
alias LookupPrivilegeDisplayNameW LookupPrivilegeDisplayName;
alias LookupPrivilegeNameW LookupPrivilegeName;
alias LookupPrivilegeValueW LookupPrivilegeValue;
alias MoveFileExW MoveFileEx;
alias ObjectCloseAuditAlarmW ObjectCloseAuditAlarm;
alias ObjectDeleteAuditAlarmW ObjectDeleteAuditAlarm;
alias ObjectOpenAuditAlarmW ObjectOpenAuditAlarm;
alias ObjectPrivilegeAuditAlarmW ObjectPrivilegeAuditAlarm;
alias OpenBackupEventLogW OpenBackupEventLog;
alias OpenEventLogW OpenEventLog;
alias PrivilegedServiceAuditAlarmW PrivilegedServiceAuditAlarm;
alias ReadEventLogW ReadEventLog;
alias RegisterEventSourceW RegisterEventSource;
alias ReportEventW ReportEvent;
alias SetFileSecurityW SetFileSecurity;
alias UpdateResourceW UpdateResource;
static if (_WIN32_WINNT >= 0x500) {
alias CreateFileMappingW CreateFileMapping;
alias CreateHardLinkW CreateHardLink;
alias CreateJobObjectW CreateJobObject;
alias DeleteVolumeMountPointW DeleteVolumeMountPoint;
alias DnsHostnameToComputerNameW DnsHostnameToComputerName;
alias EncryptFileW EncryptFile;
alias FileEncryptionStatusW FileEncryptionStatus;
alias FindFirstVolumeW FindFirstVolume;
alias FindFirstVolumeMountPointW FindFirstVolumeMountPoint;
alias FindNextVolumeW FindNextVolume;
alias FindNextVolumeMountPointW FindNextVolumeMountPoint;
alias GetModuleHandleExW GetModuleHandleEx;
alias GetSystemWindowsDirectoryW GetSystemWindowsDirectory;
alias GetVolumeNameForVolumeMountPointW GetVolumeNameForVolumeMountPoint;
alias GetVolumePathNameW GetVolumePathName;
alias OpenFileMappingW OpenFileMapping;
alias ReplaceFileW ReplaceFile;
alias SetVolumeMountPointW SetVolumeMountPoint;
alias VerifyVersionInfoW VerifyVersionInfo;
}
static if (_WIN32_WINNT >= 0x501) {
alias ACTCTXW ACTCTX;
alias CheckNameLegalDOS8Dot3W CheckNameLegalDOS8Dot3;
alias CreateActCtxW CreateActCtx;
alias FindActCtxSectionStringW FindActCtxSectionString;
alias GetSystemWow64DirectoryW GetSystemWow64Directory;
alias GetVolumePathNamesForVolumeNameW GetVolumePathNamesForVolumeName;
alias SetFileShortNameW SetFileShortName;
}
static if (_WIN32_WINNT >= 0x502) {
alias SetFirmwareEnvironmentVariableW SetFirmwareEnvironmentVariable;
alias SetDllDirectoryW SetDllDirectory;
alias GetDllDirectoryW GetDllDirectory;
}
} else {
//alias STARTUPINFOA STARTUPINFO;
alias WIN32_FIND_DATAA WIN32_FIND_DATA;
alias ENUMRESLANGPROCW ENUMRESLANGPROC;
alias ENUMRESNAMEPROCW ENUMRESNAMEPROC;
alias ENUMRESTYPEPROCW ENUMRESTYPEPROC;
alias AddAtomA AddAtom;
alias BeginUpdateResourceA BeginUpdateResource;
alias BuildCommDCBA BuildCommDCB;
alias BuildCommDCBAndTimeoutsA BuildCommDCBAndTimeouts;
alias CallNamedPipeA CallNamedPipe;
alias CommConfigDialogA CommConfigDialog;
alias CopyFileA CopyFile;
alias CopyFileExA CopyFileEx;
alias CreateDirectoryA CreateDirectory;
alias CreateDirectoryExA CreateDirectoryEx;
alias CreateEventA CreateEvent;
alias CreateFileA CreateFile;
alias CreateMailslotA CreateMailslot;
alias CreateMutexA CreateMutex;
alias CreateProcessA CreateProcess;
alias CreateSemaphoreA CreateSemaphore;
alias DeleteFileA DeleteFile;
alias EndUpdateResourceA EndUpdateResource;
alias EnumResourceLanguagesA EnumResourceLanguages;
alias EnumResourceNamesA EnumResourceNames;
alias EnumResourceTypesA EnumResourceTypes;
alias ExpandEnvironmentStringsA ExpandEnvironmentStrings;
alias FatalAppExitA FatalAppExit;
alias FindAtomA FindAtom;
alias FindFirstChangeNotificationA FindFirstChangeNotification;
alias FindFirstFileA FindFirstFile;
alias FindNextFileA FindNextFile;
alias FindResourceA FindResource;
alias FindResourceExA FindResourceEx;
alias FormatMessageA FormatMessage;
alias FreeEnvironmentStringsA FreeEnvironmentStrings;
alias GetAtomNameA GetAtomName;
alias GetCommandLineA GetCommandLine;
alias GetComputerNameA GetComputerName;
alias GetCurrentDirectoryA GetCurrentDirectory;
alias GetDefaultCommConfigA GetDefaultCommConfig;
alias GetDiskFreeSpaceA GetDiskFreeSpace;
alias GetDiskFreeSpaceExA GetDiskFreeSpaceEx;
alias GetDriveTypeA GetDriveType;
alias GetEnvironmentStringsA GetEnvironmentStrings;
alias GetEnvironmentVariableA GetEnvironmentVariable;
alias GetFileAttributesA GetFileAttributes;
alias GetFullPathNameA GetFullPathName;
alias GetLogicalDriveStringsA GetLogicalDriveStrings;
alias GetNamedPipeHandleStateA GetNamedPipeHandleState;
alias GetModuleHandleA GetModuleHandle;
alias GetModuleFileNameA GetModuleFileName;
alias GetPrivateProfileIntA GetPrivateProfileInt;
alias GetPrivateProfileSectionA GetPrivateProfileSection;
alias GetPrivateProfileSectionNamesA GetPrivateProfileSectionNames;
alias GetPrivateProfileStringA GetPrivateProfileString;
alias GetPrivateProfileStructA GetPrivateProfileStruct;
alias GetProfileIntA GetProfileInt;
alias GetProfileSectionA GetProfileSection;
alias GetProfileStringA GetProfileString;
alias GetShortPathNameA GetShortPathName;
alias GetStartupInfoA GetStartupInfo;
alias GetSystemDirectoryA GetSystemDirectory;
alias GetTempFileNameA GetTempFileName;
alias GetTempPathA GetTempPath;
alias GetUserNameA GetUserName;
alias GetVersionExA GetVersionEx;
alias GetVolumeInformationA GetVolumeInformation;
alias GetWindowsDirectoryA GetWindowsDirectory;
alias GlobalAddAtomA GlobalAddAtom;
alias GlobalFindAtomA GlobalFindAtom;
alias GlobalGetAtomNameA GlobalGetAtomName;
alias IsBadStringPtrA IsBadStringPtr;
alias LoadLibraryA LoadLibrary;
alias LoadLibraryExA LoadLibraryEx;
alias lstrcatA lstrcat;
alias lstrcmpA lstrcmp;
alias lstrcmpiA lstrcmpi;
alias lstrcpyA lstrcpy;
alias lstrcpynA lstrcpyn;
alias lstrlenA lstrlen;
alias MoveFileA MoveFile;
alias OpenEventA OpenEvent;
alias OpenMutexA OpenMutex;
alias OpenSemaphoreA OpenSemaphore;
alias OutputDebugStringA OutputDebugString;
alias RemoveDirectoryA RemoveDirectory;
alias SearchPathA SearchPath;
alias SetComputerNameA SetComputerName;
alias SetCurrentDirectoryA SetCurrentDirectory;
alias SetDefaultCommConfigA SetDefaultCommConfig;
alias SetEnvironmentVariableA SetEnvironmentVariable;
alias SetFileAttributesA SetFileAttributes;
alias SetVolumeLabelA SetVolumeLabel;
alias WaitNamedPipeA WaitNamedPipe;
alias WritePrivateProfileSectionA WritePrivateProfileSection;
alias WritePrivateProfileStringA WritePrivateProfileString;
alias WritePrivateProfileStructA WritePrivateProfileStruct;
alias WriteProfileSectionA WriteProfileSection;
alias WriteProfileStringA WriteProfileString;
alias CreateWaitableTimerA CreateWaitableTimer;
alias GetFileAttributesExA GetFileAttributesEx;
alias GetLongPathNameA GetLongPathName;
alias QueryDosDeviceA QueryDosDevice;
alias HW_PROFILE_INFOA HW_PROFILE_INFO;
alias AccessCheckAndAuditAlarmA AccessCheckAndAuditAlarm;
alias BackupEventLogA BackupEventLog;
alias ClearEventLogA ClearEventLog;
alias CreateNamedPipeA CreateNamedPipe;
alias CreateProcessAsUserA CreateProcessAsUser;
alias DefineDosDeviceA DefineDosDevice;
alias FindFirstFileExA FindFirstFileEx;
alias GetBinaryTypeA GetBinaryType;
alias GetCompressedFileSizeA GetCompressedFileSize;
alias GetFileSecurityA GetFileSecurity;
alias LogonUserA LogonUser;
alias LookupAccountNameA LookupAccountName;
alias LookupAccountSidA LookupAccountSid;
alias LookupPrivilegeDisplayNameA LookupPrivilegeDisplayName;
alias LookupPrivilegeNameA LookupPrivilegeName;
alias LookupPrivilegeValueA LookupPrivilegeValue;
alias MoveFileExA MoveFileEx;
alias ObjectCloseAuditAlarmA ObjectCloseAuditAlarm;
alias ObjectDeleteAuditAlarmA ObjectDeleteAuditAlarm;
alias ObjectOpenAuditAlarmA ObjectOpenAuditAlarm;
alias ObjectPrivilegeAuditAlarmA ObjectPrivilegeAuditAlarm;
alias OpenBackupEventLogA OpenBackupEventLog;
alias OpenEventLogA OpenEventLog;
alias PrivilegedServiceAuditAlarmA PrivilegedServiceAuditAlarm;
alias ReadEventLogA ReadEventLog;
alias RegisterEventSourceA RegisterEventSource;
alias ReportEventA ReportEvent;
alias SetFileSecurityA SetFileSecurity;
alias UpdateResourceA UpdateResource;
static if (_WIN32_WINNT >= 0x500) {
alias CreateFileMappingA CreateFileMapping;
alias CreateHardLinkA CreateHardLink;
alias CreateJobObjectA CreateJobObject;
alias DeleteVolumeMountPointA DeleteVolumeMountPoint;
alias DnsHostnameToComputerNameA DnsHostnameToComputerName;
alias EncryptFileA EncryptFile;
alias FileEncryptionStatusA FileEncryptionStatus;
alias FindFirstVolumeA FindFirstVolume;
alias FindFirstVolumeMountPointA FindFirstVolumeMountPoint;
alias FindNextVolumeA FindNextVolume;
alias FindNextVolumeMountPointA FindNextVolumeMountPoint;
alias GetModuleHandleExA GetModuleHandleEx;
alias GetSystemWindowsDirectoryA GetSystemWindowsDirectory;
alias GetVolumeNameForVolumeMountPointA GetVolumeNameForVolumeMountPoint;
alias GetVolumePathNameA GetVolumePathName;
alias OpenFileMappingA OpenFileMapping;
alias ReplaceFileA ReplaceFile;
alias SetVolumeMountPointA SetVolumeMountPoint;
alias VerifyVersionInfoA VerifyVersionInfo;
}
static if (_WIN32_WINNT >= 0x501) {
alias ACTCTXA ACTCTX;
alias CheckNameLegalDOS8Dot3A CheckNameLegalDOS8Dot3;
alias CreateActCtxA CreateActCtx;
alias FindActCtxSectionStringA FindActCtxSectionString;
alias GetSystemWow64DirectoryA GetSystemWow64Directory;
alias GetVolumePathNamesForVolumeNameA GetVolumePathNamesForVolumeName;
alias SetFileShortNameA SetFileShortName;
}
static if (_WIN32_WINNT >= 0x502) {
alias GetDllDirectoryA GetDllDirectory;
alias SetDllDirectoryA SetDllDirectory;
alias SetFirmwareEnvironmentVariableA SetFirmwareEnvironmentVariable;
}
}
alias STARTUPINFO* LPSTARTUPINFO;
alias WIN32_FIND_DATA* LPWIN32_FIND_DATA;
alias HW_PROFILE_INFO* LPHW_PROFILE_INFO;
static if (_WIN32_WINNT >= 0x501) {
alias ACTCTX* PACTCTX, PCACTCTX;
}
|
D
|
the federal department responsible for maintaining a national energy policy of the United States
mature female of mammals of which the male is called `buck'
|
D
|
/Users/trietnguyen/Documents/Blockchain Development/NEAR SEPTEMBER/NEAR-Hackathon/smart-cert/contract/target/debug/build/num-rational-b4f27f3b820a70d7/build_script_build-b4f27f3b820a70d7: /Users/trietnguyen/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.3.2/build.rs
/Users/trietnguyen/Documents/Blockchain Development/NEAR SEPTEMBER/NEAR-Hackathon/smart-cert/contract/target/debug/build/num-rational-b4f27f3b820a70d7/build_script_build-b4f27f3b820a70d7.d: /Users/trietnguyen/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.3.2/build.rs
/Users/trietnguyen/.cargo/registry/src/github.com-1ecc6299db9ec823/num-rational-0.3.2/build.rs:
|
D
|
// Copyright © 2016, Bernard Helyer. All rights reserved.
// See copyright notice in src/volt/license.d (BOOST ver. 1.0).
module volt.semantic.folder;
import volt.semantic.evaluate : foldBinOp, foldUnary;
import volt.interfaces : Pass;
import volt.visitor.visitor : accept, NullVisitor;
import ir = volt.ir.ir;
class ExpFolder : NullVisitor, Pass
{
override void transform(ir.Module mod)
{
accept(mod, this);
}
override void close()
{
}
override Status enter(ref ir.Exp exp, ir.BinOp binop)
{
auto constant = foldBinOp(exp, binop);
return ContinueParent;
}
override Status enter(ref ir.Exp exp, ir.Unary unary)
{
auto constant = foldUnary(exp, unary);
return ContinueParent;
}
}
|
D
|
import std.stdio;
void main() {
writeln("THTSim, by Kadin Tucker");
writeln("Visual display yet to come");
}
|
D
|
/Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Intermediates/FareDeal.build/Debug-iphonesimulator/FareDeal.build/Objects-normal/x86_64/InitialScreenVC.o : /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/StoreVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ProfileModel.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteVenue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealDetaislVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealDetailsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesTVController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ProfileVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataSaving.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FoodCategories.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardOverlayView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/GradientView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDetailController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SavedDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/VenueDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/InitialScreenVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/APICalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deals.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Restaurant.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Venue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC2.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/HomeSwipeViewController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CustomActivityView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessHome.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AuthenticationCalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AppDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardContentView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Constants.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Validation.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealCardCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC3.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Reachability.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/FareDeal-Bridging-Header.h /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTTAttributedLabel.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTCounterLabel.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Dynamic.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealmUtil.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMMigration_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMListBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMResults.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMRealm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMPlatform.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObject.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMMigration.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMCollection.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMArray.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/Realm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/SWActionSheet.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetStringPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetLocalePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/DistancePickerView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDistancePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDatePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPickerDelegate.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/AbstractActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker-3.0-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/AssetsLibrary.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/Koloda.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPLayerExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDecayAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPCustomAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPBasicAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimator.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPPropertyAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPSpringAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPGeometry.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationEvent.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationTracer.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimatableProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POP.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/pop-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/KeyboardManager.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIView+IQKeyboardToolbar.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQToolbar.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQTitleBarButtonItem.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQBarButtonItem.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQTextView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQSegmentedNextPrevious.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardReturnKeyHandler.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManager.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManagerConstantsInternal.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIWindow+Hierarchy.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIViewController+Additions.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManagerConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIView+Hierarchy.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUITextFieldView+Additions.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQNSArray+Sort.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManager-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Modules/module.modulemap
/Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Intermediates/FareDeal.build/Debug-iphonesimulator/FareDeal.build/Objects-normal/x86_64/InitialScreenVC~partial.swiftmodule : /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/StoreVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ProfileModel.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteVenue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealDetaislVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealDetailsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesTVController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ProfileVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataSaving.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FoodCategories.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardOverlayView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/GradientView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDetailController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SavedDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/VenueDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/InitialScreenVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/APICalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deals.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Restaurant.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Venue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC2.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/HomeSwipeViewController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CustomActivityView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessHome.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AuthenticationCalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AppDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardContentView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Constants.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Validation.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealCardCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC3.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Reachability.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/FareDeal-Bridging-Header.h /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTTAttributedLabel.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTCounterLabel.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Dynamic.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealmUtil.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMMigration_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMListBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMResults.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMRealm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMPlatform.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObject.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMMigration.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMCollection.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMArray.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/Realm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/SWActionSheet.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetStringPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetLocalePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/DistancePickerView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDistancePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDatePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPickerDelegate.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/AbstractActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker-3.0-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/AssetsLibrary.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/Koloda.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPLayerExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDecayAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPCustomAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPBasicAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimator.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPPropertyAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPSpringAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPGeometry.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationEvent.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationTracer.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimatableProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POP.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/pop-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/KeyboardManager.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIView+IQKeyboardToolbar.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQToolbar.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQTitleBarButtonItem.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQBarButtonItem.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQTextView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQSegmentedNextPrevious.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardReturnKeyHandler.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManager.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManagerConstantsInternal.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIWindow+Hierarchy.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIViewController+Additions.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManagerConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIView+Hierarchy.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUITextFieldView+Additions.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQNSArray+Sort.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManager-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Modules/module.modulemap
/Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Intermediates/FareDeal.build/Debug-iphonesimulator/FareDeal.build/Objects-normal/x86_64/InitialScreenVC~partial.swiftdoc : /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/StoreVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ProfileModel.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteVenue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDealDetaislVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoriteHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealDetailsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesTVController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ProfileVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DataSaving.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FoodCategories.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardOverlayView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/GradientView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RestaurantDetailController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/ForgotPasswordVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SavedDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/VenueDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/InitialScreenVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/APICalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/FavoritesCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealsCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Deals.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Restaurant.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessDeal.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Venue.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC2.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/HomeSwipeViewController.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CustomActivityView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/BusinessHome.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AuthenticationCalls.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/AppDelegate.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/CardContentView.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/SignInUserVC.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealHeaderCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Constants.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Validation.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/DealCardCell.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/RegisterRestaurantVC3.swift /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/FareDeal/Reachability.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/FareDeal-Bridging-Header.h /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTTAttributedLabel.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/angelasmith/Desktop/Develop/FareDeal/FareDeal/TTCounterLabel.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealm_Dynamic.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMRealmUtil.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMMigration_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMListBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMResults.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMRealm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMPlatform.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectSchema.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObjectBase.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMObject.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMMigration.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMCollection.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/RLMArray.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Headers/Realm.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Realm.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Headers/RealmSwift-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/RealmSwift.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/SwiftyJSON.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/SWActionSheet.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetStringPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetLocalePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/DistancePickerView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDistancePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetDatePicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPickerDelegate.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetCustomPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/AbstractActionSheetPicker.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Headers/ActionSheetPicker-3.0-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/ActionSheetPicker_3_0.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/AssetsLibrary.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/Koloda.swiftmodule/x86_64.swiftmodule /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-Swift.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Headers/Koloda-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/Koloda.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPLayerExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDecayAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPCustomAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPBasicAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimator.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPPropertyAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPSpringAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPDefines.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationExtras.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPGeometry.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationEvent.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimationTracer.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimation.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POPAnimatableProperty.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/POP.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Headers/pop-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/pop.framework/Modules/module.modulemap /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/KeyboardManager.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIView+IQKeyboardToolbar.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQToolbar.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQTitleBarButtonItem.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQBarButtonItem.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQTextView.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQSegmentedNextPrevious.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardReturnKeyHandler.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManager.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManagerConstantsInternal.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIWindow+Hierarchy.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIViewController+Additions.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManagerConstants.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUIView+Hierarchy.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQUITextFieldView+Additions.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQNSArray+Sort.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Headers/IQKeyboardManager-umbrella.h /Users/angelasmith/Desktop/SourceTree/Develop2/FareDeal/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/IQKeyboardManager.framework/Modules/module.modulemap
|
D
|
/Users/xiaohongwei/projects/for_offer/target/debug/deps/thread_local-bae6ac9bf5379b25.rmeta: /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/lib.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/thread_id.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/unreachable.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/cached.rs
/Users/xiaohongwei/projects/for_offer/target/debug/deps/libthread_local-bae6ac9bf5379b25.rlib: /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/lib.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/thread_id.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/unreachable.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/cached.rs
/Users/xiaohongwei/projects/for_offer/target/debug/deps/thread_local-bae6ac9bf5379b25.d: /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/lib.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/thread_id.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/unreachable.rs /Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/cached.rs
/Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/lib.rs:
/Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/thread_id.rs:
/Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/unreachable.rs:
/Users/xiaohongwei/.cargo/registry/src/mirrors.ustc.edu.cn-b63e9dae659fc205/thread_local-1.0.1/src/cached.rs:
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/fail315.d-mixin-17(17): Error: found `;` when expecting `,`
fail_compilation/fail315.d-mixin-17(17): Error: expression expected, not `}`
fail_compilation/fail315.d-mixin-17(17): Error: found `End of File` when expecting `,`
fail_compilation/fail315.d-mixin-17(17): Error: found `End of File` when expecting `]`
fail_compilation/fail315.d-mixin-17(17): Error: found `End of File` when expecting `;` following `return` statement
fail_compilation/fail315.d-mixin-17(17): Error: matching `}` expected following compound statement, not `End of File`
fail_compilation/fail315.d-mixin-17(17): unmatched `{`
fail_compilation/fail315.d(22): Error: template instance `fail315.foo!()` error instantiating
---
*/
void foo(S...)(S u)
{
alias typeof(mixin("{ return a[1;}()")) z;
}
void main()
{
foo!()(0);
}
|
D
|
instance DIA_DRAGON_GOLD_EXIT(C_Info)
{
npc = none_103_dragon_gold;
nr = 999;
condition = dia_dragon_gold_exit_condition;
information = dia_dragon_gold_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int dia_dragon_gold_exit_condition()
{
return TRUE;
};
func void dia_dragon_gold_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_DRAGON_GOLD_HELLO(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_hello_condition;
information = dia_dragon_gold_hello_info;
important = TRUE;
};
func int dia_dragon_gold_hello_condition()
{
return TRUE;
};
func void dia_dragon_gold_hello_info()
{
B_GivePlayerXP(500);
AI_Output(self,other,"DIA_Dragon_Gold_Hello_01_00"); //Человек?!
AI_Output(self,other,"DIA_Dragon_Gold_Hello_01_01"); //Как давно я не видел людей...
AI_Output(other,self,"DIA_Dragon_Gold_Hello_01_02"); //Так вот что скрывали Зодчие за этим порталом! Еще один дракон - кто бы мог подумать.
AI_Output(other,self,"DIA_Dragon_Gold_Hello_01_05"); //Кто ты?
AI_Output(self,other,"DIA_Dragon_Gold_Hello_01_06"); //Я - Аш'Тар, золотой дракон. Немногие удостаивались этой чести.
AI_Output(other,self,"DIA_Dragon_Gold_Hello_01_11"); //Чести? Быть съеденным драконом, по-твоему, это честь?
AI_Output(self,other,"DIA_Dragon_Gold_Hello_01_12"); //А ты смешной, человек! Давно меня так никто не веселил.
AI_Output(other,self,"DIA_Dragon_Gold_Hello_01_14"); //А разве драконы не являются порождением тьмы, чей истинный смысл существования - это уничтожение всего живого?
AI_Output(self,other,"DIA_Dragon_Gold_Hello_01_18"); //В этом мире существует как добро, так и зло, представленные в одинаковом обличии, человек.
AI_Output(other,self,"DIA_Dragon_Gold_Hello_01_20"); //Хочешь сказать, что ты не несешь зло в этот мир?
AI_Output(self,other,"DIA_Dragon_Gold_Hello_01_22"); //Только действия имеют значение - только они могут определять истинный смысл существования!
AI_Output(self,other,"DIA_Dragon_Gold_Hello_01_21"); //Вижу смятение в твоих глазах...
self.name[0] = "Аш'Тар";
DRAGONGOLDMEET = TRUE;
if(MIS_GOLDDRAGONPORTAL == LOG_Running)
{
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"В древних руинах Зодчих я обнаружил портал. Я смог активировать его с помощью странного магического камня, который нашел в храме Аданоса. Портал привел меня в небольшую долину, где, как оказалось, меня ждала очень интересная встреча.");
}
else
{
Log_CreateTopic(TOPIC_GOLDDRAGONPORTAL,LOG_MISSION);
Log_SetTopicStatus(TOPIC_GOLDDRAGONPORTAL,LOG_Running);
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"В древних руинах Зодчих я обнаружил портал. Я смог активировать его с помощью странного магического камня, который нашел в храме Аданоса. Портал привел меня в небольшую долину, где, как оказалось, меня ждала очень интересная встреча.");
MIS_GOLDDRAGONPORTAL = LOG_Running;
};
};
instance DIA_DRAGON_GOLD_WHOCREATE(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_whocreate_condition;
information = dia_dragon_gold_whocreate_info;
permanent = FALSE;
description = "Что ты тут делаешь?";
};
func int dia_dragon_gold_whocreate_condition()
{
if(Npc_KnowsInfo(hero,dia_dragon_gold_hello))
{
return TRUE;
};
};
func void dia_dragon_gold_whocreate_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_00"); //Что ты тут делаешь?
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_01"); //Я хотел задать тебе тот же вопрос. Как ТЫ смог оказаться здесь?
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_03"); //У меня был магический камень по типу фокусирующего, с помощью него я и активировал портал, ведущий сюда.
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_04"); //Под этими словами ты, наверное, имел в виду Ключ Солнца, ибо только он смог бы открыть тебе дорогу сюда.
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_06"); //Но как он попал к тебе? Лишь его Хранители - Стражи Солнца - владели этим тайным знанием и имели доступ в мою обитель.
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_08"); //Там, где я обнаружил этот артефакт, не было никаких Хранителей или Стражей Солнца.
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_09"); //Там вообще никого не было, кроме кучки бандитов.
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_12"); //И, сдается мне, тех, кого ты называешь Стражами Солнца, мы называем - Зодчие. Так знай: их цивилизация давно угасла.
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_13"); //Не понимаю! Но... как это могло случиться?
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_14"); //Судя по тому, что я знаю, - они нашли один мощный артефакт, с которым они не смогли совладать, но который смог совладать с ними.
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_16"); //И их постигло проклятье Аданоса: была такая катастрофа - жуткое наводнение. Потом вода ушла.
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_17"); //Сейчас вокруг только полуразрушенные храмы.
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_18"); //Мою долину не коснулись эти ужасы. А что за люди, про которых ты говорил?
AI_Output(other,self,"DIA_Dragon_Gold_WhoCreate_01_20"); //Бандиты, которые искали золото и артефакт - Коготь Белиара - который и был причиной падения Зодчих.
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_27"); //Коготь?! Так я и думал...
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_28"); //Значит... если это так, значит... они не послушались меня. Они не уничтожили его... глупцы!
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_29"); //Теперь мне все стало ясно...
AI_Output(self,other,"DIA_Dragon_Gold_WhoCreate_01_31"); //...зло уже вырвалось на свободу, и ничто не помешает ему осуществить великий план своего создателя.
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар был поражен новостью о гибели Зодчих. Судя по всему, золотой дракон играл существенную роль в жизни этого некогда великого народа и являлся неотъемлемой частью культуры Зодчих. Но еще больше его огорчило то, что Коготь Белиара так и не был уничтожен Зодчими, на чем настаивал в свое время Аш'Тар.");
};
instance DIA_DRAGON_GOLD_ADANOSVALLEY(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_ADANOSVALLEY_condition;
information = dia_dragon_gold_ADANOSVALLEY_info;
permanent = FALSE;
description = "Эту каменную табличку я нашел в храме Зодчих.";
};
func int dia_dragon_gold_ADANOSVALLEY_condition()
{
if((Npc_KnowsInfo(hero,dia_dragon_gold_whatdo)) && (Npc_HasItems(hero,ItWr_CroneAdanos) >= 1) && (MIS_AdanosCrone == LOG_Running))
{
return TRUE;
};
};
func void dia_dragon_gold_ADANOSVALLEY_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_01"); //Эту каменную табличку я нашел в храме Зодчих. Ты знаешь, что это такое?
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_02"); //Дай мне взглянуть на нее.
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_03"); //Вот.
B_GiveInvItems(other,self,ItWr_CroneAdanos,1);
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_04"); //Каменную табличку? Человек сильно рассмешил меня.
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_05"); //То, что ты называешь каменной табличкой, на самом деле является магическим свитком Древних!
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_06"); //Так это магический свиток Зодчих?
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_07"); //Да. Но, судя по тому, на каком языке он написан, - время этого предмета уходит ко временам зарождения этого мира.
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_08"); //Правда, сейчас я не ощущаю в этом предмете ни капли магии.
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_09"); //Но ты хотя бы можешь перевести, что там написано?
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_10"); //Конечно.
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_11"); //Судя по тексту, этот свиток использовался для призыва...
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_12"); //...для призыва?
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_13"); //Для призыва древних стражей самого Аданоса.
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_14"); //Интересно. А что это за древние стражи?
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_15"); //Как я понимаю, речь идет о созданиях, которые в свое время охраняли храм Аданоса.
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_16"); //Однако, насколько мне известно, их время уже давно прошло.
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_17"); //Это все, что там написано?
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_18"); //Тут еще упоминается какой-то могущественный артефакт, который охраняли эти древние создания.
AI_Output(other,self,"DIA_Dragon_Gold_ADANOSVALLEY_01_19"); //Вот это уже интересней. И о каком именно артефакте идет речь?
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_20"); //Тут об этом не сказано...
AI_Output(self,other,"DIA_Dragon_Gold_ADANOSVALLEY_01_21"); //Так что, если кто-то еще и знает об этом предмете, то только его хранители.
B_GiveInvItems(self,other,ItWr_CroneAdanos,1);
B_LogEntry(TOPIC_AdanosCrone,"Хвала Инносу! Золотой дракон помог мне перевести эти древние записи. Похоже, эта каменная табличка когда-то являлась магическим свитком призыва каких-то древних существ, которых Аш'Тар назвал Стражами. Кроме того, в ней упоминалось о каком-то могущественном артефакте, который эти древние создания охраняли.");
KnowsTextAdanos = TRUE;
};
instance DIA_DRAGON_GOLD_AWAKEGUARDS(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_AWAKEGUARDS_condition;
information = dia_dragon_gold_AWAKEGUARDS_info;
permanent = FALSE;
description = "Ты сказал, что это свиток призыва.";
};
func int dia_dragon_gold_AWAKEGUARDS_condition()
{
if(KnowsTextAdanos == TRUE)
{
return TRUE;
};
};
func void dia_dragon_gold_AWAKEGUARDS_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_AWAKEGUARDS_01_00"); //Ты сказал, что это свиток призыва.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_01"); //Так оно и есть.
AI_Output(other,self,"DIA_Dragon_Gold_AWAKEGUARDS_01_02"); //Тогда почему бы нам не вызвать этих стражей и не спросить у них про артефакт?
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_03"); //Это слишком опасно... Гнев этих созданий запросто может убить тебя.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_04"); //К тому же для использования этого свитка сперва его необходимо вновь наполнить магией...
AI_Output(other,self,"DIA_Dragon_Gold_AWAKEGUARDS_01_05"); //И как это можно сделать?
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_06"); //А ты, как я погляжу, настроен решительно, раз тебя даже не останавливает опасность собственной смерти...
AI_Output(other,self,"DIA_Dragon_Gold_AWAKEGUARDS_01_08"); //Мне не привыкать смотреть смерти в глаза.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_09"); //Ну, если так... Тогда я знаю один способ, как можно вернуть этому предмету магическую силу.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_11"); //Насколько мне известно, в одном из храмов Древних когда-то хранился особый рунический алтарь.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_12"); //Зодчие использовали его для переноса магии из одного предмета в другой.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_13"); //С его помощью ты можешь попробовать перенести магию в этот древний свиток.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_14"); //Для этого сгодится любой другой магический предмет, который содержит в себе магию Зодчих.
AI_Output(other,self,"DIA_Dragon_Gold_AWAKEGUARDS_01_16"); //Кажется, ничего сложного. И, если у меня все получится, где мне использовать свиток, чтобы пробудить стражей?
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_17"); //Это мне неизвестно... Но на твоем месте я бы попробовал использовать его в самом сердце храма.
AI_Output(self,other,"DIA_Dragon_Gold_AWAKEGUARDS_01_18"); //Там, где все пропитано древней магией... Возможно, это сработает.
AI_Output(other,self,"DIA_Dragon_Gold_AWAKEGUARDS_01_19"); //Ладно, попробую отыскать это место.
KnowsMakeOldMgic = TRUE;
B_LogEntry(TOPIC_AdanosCrone,"Я решил рискнуть и вызвать этих древних созданий. Но для начала необходимо вернуть магию самому предмету. Аш'Тар подсказал мне, что в одном из храмов Древних когда-то был особый рунический стол, с помощью которого Зодчие переносили магию из одного предмета в другой. Чтобы перенести магию в каменную табличку, мне понадобится предмет, содержащий хотя бы частицу магии Зодчих. И, если у меня все получится, мне нужно будет найти место, где можно использовать свиток призыва. Золотой дракон посоветовал мне сделать это в самом центре храма.");
};
instance DIA_DRAGON_GOLD_AboutAntientGuards(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = DIA_DRAGON_GOLD_AboutAntientGuards_condition;
information = DIA_DRAGON_GOLD_AboutAntientGuards_info;
permanent = FALSE;
description = "Как можно одолеть древних стражей Аданоса?";
};
func int DIA_DRAGON_GOLD_AboutAntientGuards_condition()
{
if((KnowAboutAdVal == TRUE) && (RavenIsDead == FALSE) && (StoneBossIsDead == FALSE) && (TellAboutAdanosWeapon == FALSE))
{
return TRUE;
};
};
func void DIA_DRAGON_GOLD_aboutantientguards_info()
{
B_GivePlayerXP(200);
AI_Output(other,self,"DIA_DRAGON_GOLD_AboutAntientGuards_01_01"); //Как можно одолеть древних стражей Аданоса?
AI_Output(self,other,"DIA_DRAGON_GOLD_AboutAntientGuards_01_02"); //Для этого человеку нужен Бич Стражей. Только с его помощью ты сможешь сокрушить этих древних созданий.
AI_Output(other,self,"DIA_DRAGON_GOLD_AboutAntientGuards_01_04"); //И где мне его искать?
AI_Output(self,other,"DIA_DRAGON_GOLD_AboutAntientGuards_01_05"); //Люди хранили его в одном из своих храмов. Попробуй поискать там.
B_LogEntry(TOPIC_AdanosCrone,"В храме у меня возникли проблемы с древним каменным хранителем, поскольку обычным оружием я не смог его одолеть. Аш'Тар поведал мне о существовании некоего оружия, с помощью которого древние усмиряли этих монстров. Возможно, оно поможет и мне. Искать его следует в одном из храмов в Долине.");
TellAboutAdanosWeapon = TRUE;
AI_StopProcessInfos(self);
};
instance DIA_DRAGON_GOLD_AVGO(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = DIA_DRAGON_GOLD_AVGO_condition;
information = DIA_DRAGON_GOLD_AVGO_info;
permanent = FALSE;
description = "Тут у меня есть еще одна каменная табличка.";
};
func int DIA_DRAGON_GOLD_AVGO_condition()
{
if((KnowAboutAdVal == TRUE) && (Npc_HasItems(hero,ItWr_StoneAdanosPortal) >= 1))
{
return TRUE;
};
};
func void DIA_DRAGON_GOLD_AVGO_info()
{
B_GivePlayerXP(400);
AI_Output(other,self,"DIA_DRAGON_GOLD_AVGO_01_00"); //Тут у меня есть еще одна каменная табличка. Ты можешь ее перевести?
B_GiveInvItems(other,self,ItWr_StoneAdanosPortal,1);
Npc_RemoveInvItems(self,ItWr_StoneAdanosPortal,1);
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_04"); //Очень интересно...
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_06"); //Здесь описано, каким образом можно открыть портал, ведущий на великое Плато Древних.
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_08"); //Эта земля - священная вотчина Аданоса, где он впервые прикоснулся к этому миру.
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_09"); //Прекрасное, вечнозеленое место, где веками царили только покой и благоденствие.
AI_Output(other,self,"DIA_DRAGON_GOLD_AVGO_01_10"); //Значит, по всей видимости, артефакт находится именно там. И как же туда попасть?
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_11"); //Для начала тебе необходимо рунное сердце Стража. Его надлежит использовать непосредственно перед магическим порталом.
AI_Output(other,self,"DIA_DRAGON_GOLD_AVGO_01_13"); //Отлично! Одно такое у меня уже есть.
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_14"); //Откуда оно у тебя? Неужели тебе все-таки удалось призвать древних Стражей в этот мир?
AI_Output(other,self,"DIA_DRAGON_GOLD_AVGO_01_15"); //Да, одного. Чтобы заполучить его сердце, сперва мне пришлось его убить.
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_16"); //Меня до сих пор удивляет, как маленький человек вроде тебя может противостоять таким древним созданиям.
AI_Output(other,self,"DIA_DRAGON_GOLD_AVGO_01_17"); //Меня порой тоже.
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_18"); //Похоже, сами боги благоволят тебе, раз после стольких испытаний ты до сих пор жив. Иного объяснения у меня просто нет.
AI_Output(other,self,"DIA_DRAGON_GOLD_AVGO_01_20"); //Это все, конечно, хорошо, но мы отвлеклись от главного. Где же находится сам портал?
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_21"); //Тут сказано, что он расположен на севере этой долины.
AI_Output(other,self,"DIA_DRAGON_GOLD_AVGO_01_22"); //А можно поточней?
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_23"); //Это все, что тут написано... Так что тебе придется самому отыскать это место.
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_25"); //И еще: хочу тебя предостеречь... Плато Древних может оказаться крайне опасным местом для простого смертного вроде тебя.
AI_Output(self,other,"DIA_DRAGON_GOLD_AVGO_01_27"); //Так что хорошо подготовься, прежде чем отправиться туда...
B_LogEntry(TOPIC_AdanosCrone,"Аш'Тар перевел свиток стража храма. Там упомянут магический портал на севере долины, который ведет на великое Плато Древних - место, где сам Аданос впервые вступил в этот мир! Загадочный артефакт, который мы ищем, должен находиться именно там. Для активации портала мне необходимо использовать рунное сердце Стража. Аш'Тар предупредил меня, что Плато может оказаться очень опасным местом. Мне нужно тщательно подготовиться к этому походу.");
InsFireShadowGuards = TRUE;
AI_StopProcessInfos(self);
};
instance DIA_DRAGON_GOLD_WHATDO(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_whatdo_condition;
information = dia_dragon_gold_whatdo_info;
permanent = FALSE;
description = "А в чем смысл твоего существования, дракон?";
};
func int dia_dragon_gold_whatdo_condition()
{
if(Npc_KnowsInfo(hero,dia_dragon_gold_hello))
{
return TRUE;
};
};
func void dia_dragon_gold_whatdo_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_WhatDo_01_00"); //А в чем смысл твоего существования, дракон?
AI_Output(self,other,"DIA_Dragon_Gold_WhatDo_01_01"); //Ты задаешь этот вопрос мне, человек, но разве ты можешь утверждать, что осознаешь то, что привело тебя в этот мир?
AI_Output(other,self,"DIA_Dragon_Gold_WhatDo_01_03"); //Конечно. Моя цель заключается в том, чтобы искоренить то зло, которое сеют по этой земле твои сородичи.
AI_Output(self,other,"DIA_Dragon_Gold_WhatDo_01_05"); //Я понимаю, к чему ты ведешь, человек. Если ты так хочешь, ты можешь сразиться со мной.
AI_Output(self,other,"DIA_Dragon_Gold_WhatDo_01_06"); //Но это не сделает мир лучше, как ты рассчитываешь. Ибо только в жизни может зародиться новая жизнь, но не в смерти.
AI_Output(other,self,"DIA_Dragon_Gold_WhatDo_01_09"); //Хммм... А ты и впрямь не похож на служителя Тьмы.
AI_Output(self,other,"DIA_Dragon_Gold_WhatDo_01_10"); //(обиженно) Много ли ты видел драконов в своей жизни, человек, чтобы так рассуждать?
AI_Output(self,other,"DIA_Dragon_Gold_WhatDo_01_11"); //Да... Как сильно изменился этот мир.
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар - золотой дракон, обитающий в этой долине, также был удивлен моему появлению. Невероятно, но его намерения относительно меня не носили враждебный характер, а можно даже сказать - наоборот. Возможно, стоит поговорить об этом с Сатурасом.");
};
instance DIA_DRAGON_GOLD_ABOUTCLAW(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_aboutclaw_condition;
information = dia_dragon_gold_aboutclaw_info;
permanent = FALSE;
description = "Какое зло? Что ты имеешь в виду?";
};
func int dia_dragon_gold_aboutclaw_condition()
{
if(Npc_KnowsInfo(hero,dia_dragon_gold_whocreate))
{
return TRUE;
};
};
func void dia_dragon_gold_aboutclaw_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_AboutClaw_01_00"); //Какое зло? Что ты имеешь в виду?
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_01"); //Найдя Коготь Белиара, Стражи Солнца рассчитывали, что это оружие поможет им в битве со злом.
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_03"); //Они даже не догадывались, что именно этот меч и есть истинное зло!
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_06"); //И я подсказал им единственное правильное решение - уничтожить этот меч, пока зло не вырвалось на свободу.
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_07"); //Но, как я вижу, жажда могущества настолько ослепила Стражей, что они забыли об этом.
AI_Output(other,self,"DIA_Dragon_Gold_AboutClaw_01_10"); //А что в этом мече такого плохого?
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_11"); //Коготь Белиара и сам по себе достаточно мощный артефакт, но его истинное предназначение заключено в другом.
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_13"); //Вся магическая сила Когтя сосредоточена в основании его клинка - в темном кристалле, что хранит душу могущественного архидемона С'эньяка!
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_15"); //Темный Бог ковал это оружие специально для него, чтобы тот нес еще больше зла в наш мир...
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_17"); //В конечном счете, с огромными усилиями, архидемон был повержен. А его душа была помещена в заточение в его же собственное оружие... какая ирония...
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_20"); //После этого клинок был сокрыт на многие тысячелетия от посторонних глаз. Пока Стражи Солнца случайно не наткнулись на него.
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_22"); //Это и стало началом их конца!
AI_Output(other,self,"DIA_Dragon_Gold_AboutClaw_01_23"); //Почему демон не был уничтожен?
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_24"); //Это мне неведомо. Одно могу сказать: если он вырвется на свободу - мир содрогнется под его поступью...
AI_Output(other,self,"DIA_Dragon_Gold_AboutClaw_01_27"); //Ты уверен в том, что он вырвался на свободу?
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_28"); //Нельзя быть ни в чем уверенным - к сожалению, только сам Коготь мог бы дать ответ на этот вопрос.
AI_Output(other,self,"DIA_Dragon_Gold_AboutClaw_01_34"); //А что если я принесу тебе Коготь?
AI_Output(self,other,"DIA_Dragon_Gold_AboutClaw_01_37"); //О, Аданос. Неси его скорее, возможно, они не успели совершить непоправимое.
TASKFINDCLAW = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар рассказал мне об угрозе, которую скрывает Коготь. Будучи когда-то оружием одного из архидемонов - С'эньяка, этот клинок хранит в себе бессмертную душу своего господина. Аш'Тар был очень обеспокоен, что С'эньяк смог освободиться. Чтобы точно ответить на этот вопрос, золотой дракон попросил меня принести ему Коготь. Вероятно, тогда станет ясно, насколько большие у нас проблемы.");
};
instance DIA_DRAGON_GOLD_WHATMAN(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_whatman_condition;
information = dia_dragon_gold_whatman_info;
permanent = FALSE;
description = "Посмотри на Коготь.";
};
func int dia_dragon_gold_whatman_condition()
{
if(Npc_KnowsInfo(hero,dia_dragon_gold_aboutclaw) && C_ScHasBeliarsWeapon())
{
return TRUE;
};
};
func void dia_dragon_gold_whatman_info()
{
B_GivePlayerXP(100);
AI_Output(other,self,"DIA_Dragon_Gold_WhatMan_01_00"); //Посмотри на Коготь.
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_01"); //Хорошо. Дай мне взглянуть на него.
if((Npc_HasItems(other,itru_beliarsrune01) == TRUE) || (Npc_HasItems(other,itru_beliarsrune02) == TRUE) || (Npc_HasItems(other,itru_beliarsrune03) == TRUE) || (Npc_HasItems(other,itru_beliarsrune04) == TRUE) || (Npc_HasItems(other,itru_beliarsrune05) == TRUE) || (Npc_HasItems(other,itru_beliarsrune06) == TRUE))
{
AI_Output(other,self,"DIA_Dragon_Gold_WhatMan_01_02"); //Хмм... Только я перенес силу Когтя в руну.
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_03"); //Это неважно, кристалл должен испускать энергию как в руне, так и в мече.
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_09"); //(внимательно вглядывается) Я так и знал!
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_10"); //Символ на руне тускл, и я не ощущаю в нем энергии.
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_11"); //А это может означать только одно - С'эньяк освободился!
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_13"); //Это ОЧЕНЬ плохо - ты даже не представляешь, насколько!
AI_Output(other,self,"DIA_Dragon_Gold_WhatMan_01_16"); //И что же теперь делать?
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Худшие опасения подтвердились. Символ руны Когтя тускл и безжизнен - а это значит, что древний архидемон С'эньяк вырвался на свободу. Чувствует мое сердце, что эта история c архидемоном не обойдет стороной и меня...");
}
else
{
if(C_ScHasEquippedBeliarsWeapon() == TRUE)
{
AI_ReadyMeleeWeapon(other);
};
AI_Output(other,self,"DIA_Dragon_Gold_WhatMan_01_06"); //Вот, смотри.
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_09"); //(внимательно вглядывается) Я так и знал!
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_21"); //Темный кристалл душ тускл и я не ощущаю в нем магической энергии...
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_11"); //А это может означать только одно - С'эньяк освободился!
if(C_ScHasEquippedBeliarsWeapon() == TRUE)
{
AI_RemoveWeapon(other);
};
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_13"); //Это ОЧЕНЬ плохо - ты даже не представляешь, насколько!
AI_Output(other,self,"DIA_Dragon_Gold_WhatMan_01_16"); //И что же теперь делать?
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Худшие опасения подтвердились. Символ руны Когтя тускл и безжизнен - а это значит, что древний архидемон С'эньяк вырвался на свободу. Чувствует мое сердце, что эта история c архидемоном не обойдет стороной и меня...");
};
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_28"); //Необходимо уничтожить демона, пока еще есть время и пока он слаб.
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_32"); //Проклятие Аданоса - лишь отеческое порицание в сравнении с тем, что сотворит этот демон!
AI_Output(other,self,"DIA_Dragon_Gold_WhatMan_01_33"); //Ого, ничего себе!
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_35"); //У нас мало времени, и еще меньше шансов.
AI_Output(self,other,"DIA_Dragon_Gold_WhatMan_01_36"); //С'эньяк, конечно, не успел восстановить свои силы после пребывания в заточении, но он все равно очень опасен.
};
instance DIA_DRAGON_GOLD_DESTROYWAY(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_destroyway_condition;
information = dia_dragon_gold_destroyway_info;
permanent = FALSE;
description = "Как можно уничтожить С'эньяка?";
};
func int dia_dragon_gold_destroyway_condition()
{
if(Npc_KnowsInfo(hero,dia_dragon_gold_whatman))
{
return TRUE;
};
};
func void dia_dragon_gold_destroyway_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWay_01_00"); //Как можно уничтожить С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_01"); //Поскольку обычным оружием его не победить, существуют только два способа, как это можно сделать.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_04"); //Способ первый - с помощью Стихий, истинных Творцов этого мира.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWay_01_05"); //Стихий?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_07"); //Да, а именно с помощью древнего могущественного заклинания, способного отнять жизнь у любого существа! Его называют Крест Стихий.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_10"); //И неважно, кто это будет - демон, человек или мясной жук. Это заклинание убьет всякого, на кого оно будет возложено.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWay_01_12"); //И где мне искать этот Крест Стихий?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_13"); //Подожди, я расскажу все по порядку.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_17"); //Смысл необходимого нам заклинания заключается в объединении всех стихий этого мира воедино.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_18"); //Огонь, Вода, Скала и Тьма - только вместе эти элементы смогут образовать Крест Стихий.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWay_01_22"); //А я уж думал, ты отправишь меня собирать какую-нибудь мерзость по всяким склепам, пещерам и подземельям.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_23"); //Только абсолютные сущности этих элементов способны придать этому заклинанию должный эффект...
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWay_01_24"); //Что это за сущности?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_25"); //У каждой стихии она своя, и содержит в себе первоисточник ее могущества. Эту сущность называют сферой.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_29"); //Поэтому тебе как можно скорее необходимо отыскать все четыре сферы каждой стихии...
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_30"); //...и лишь только после этого из них можно будет сделать Крест Стихий.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWay_01_31"); //Где я смогу найти эти сферы?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_32"); //К сожалению, я не знаю места их расположения, но, боюсь, тебе придется полазить 'по всяким склепам, пещерам и подземельям'.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWay_01_33"); //А когда ты их найдешь - возвращайся ко мне. Я буду ждать тебя здесь.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWay_01_34"); //Хорошо, Аш'Тар! Я отправляюсь.
TASKFINDSPHERE = TRUE;
SENYAKSEEKSWORD = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Похоже, мне и тут придется потягаться с тем, что до меня не смогли сделать древние умники. На этот раз это архидемон С'эньяк. Аш'Тар подсказал мне один способ, с помощью которого можно будет уничтожить его. Для этого мне необходимо заполучить одно могущественное заклинание древности - Крест Стихий. Чтобы это сделать, необходимо отыскать все важные компоненты для создания этого заклинания. А именно некие источники сущности стихий - сферы огня, воды, скалы и тьмы. Вот только где их искать?");
};
instance DIA_DRAGON_GOLD_DESTROYWAYTWO(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_destroywaytwo_condition;
information = dia_dragon_gold_destroywaytwo_info;
permanent = FALSE;
description = "Ты сказал, что знаешь два способа.";
};
func int dia_dragon_gold_destroywaytwo_condition()
{
if(Npc_KnowsInfo(hero,dia_dragon_gold_destroyway) && (DESTROYCLAW == FALSE))
{
return TRUE;
};
};
func void dia_dragon_gold_destroywaytwo_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_00"); //Ты сказал, что знаешь два способа уничтожить С'эньяка.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_01"); //Да... Есть и еще один.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_03"); //Второй способ заключается в том, чтобы пленить его душу таким же образом, как это было сделано когда-то.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_06"); //Интересно. И как можно пленить душу С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_07"); //(с сожалением) Ты повторяешь ошибки Древних...
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_09"); //Для того чтобы пленить демона, тебе понадобится одно очень древнее заклинание.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_11"); //Оно называется Мора Уларту.На языке Древних это означает 'Темница Душ'.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_12"); //Ты должен будешь наложить его на С'эньяка, а после этого лишить его физической оболочки.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_13"); //Проще говоря, убить... А заклинание, в свою очередь, не даст ускользнуть душе после смерти...
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_16"); //Тебе также понадобится темный кристалл, чтобы поместить туда пойманную душу С'эньяка.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_17"); //А тот кристалл, что находится в Когте - его все еще можно использовать?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_18"); //Хммм... думаю, да. Но, как видишь, это не слишком надежное место.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_19"); //Хотя, безусловно, есть и плюсы: поместив его душу обратно в Коготь, ты вернешь ему былую мощь.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_21"); //Однако одно неловкое движение, одна ошибка - и С'эньяк снова обретет свободу.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_1W"); //Хорошо, я все понял. Но скажи, где мне искать это заклинание, о котором ты говорил?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_2W"); //Я ничего не знаю про это. Мора Уларту - дар темного бога. Возможно, тот, кто владеет магией Тьмы и знает что-то об этом...
if(Kapitel >= 5)
{
if(!Npc_IsDead(none_102_kreol))
{
if(KREOL_MYTEACHER == TRUE)
{
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_22"); //Хммм... Думаю, я знаю одного из тех, кто ей владеет.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_23"); //...(рычит)
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_24"); //А после того как я найду это заклинание, где мне искать С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_25"); //Сначала найди Темницу Душ, а потом мы поговорим о твоей встрече с ним.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_27"); //Поспеши, дорога каждая минута!
TASKFINDDARKSOUL = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар поведал мне еще один способ уничтожить С'эньяка. Точнее, не совсем уничтожить, а лишь пленить его душу тем же образом, каким когда-то это сделали Древние. Мне необходимо достать одно очень редкое заклинание - Мора Уларту. Дракон предположил, что тот, кто связан с темной магией, мог бы помочь мне в этом. Надо бы поговорить с Креолом.");
}
else
{
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_28"); //Хммм... С этим могут возникнуть проблемы...
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_23"); //...(рычит)
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_24"); //А после того как я найду это заклинание, где мне искать С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_25"); //Сначала найди Темницу Душ, а потом мы поговорим о твоей встрече с ним.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_27"); //Поспеши, дорога каждая минута!
TASKFINDDARKSOUL = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар поведал мне еще один способ уничтожить С'эньяка. Точнее, не совсем уничтожить, а лишь пленить его душу тем же образом, каким когда-то это сделали Древние. Мне необходимо достать одно очень редкое заклинание - Мора Уларту. Дракон предположил, что тот, кто связан с темной магией, мог бы помочь мне в этом. Вот только где найти такого?");
};
}
else
{
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_34"); //Хммм... Боюсь, я не знаю того, кто мог бы мне помочь.
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_35"); //Тогда не теряй времени и отправляйся на поиски сфер.
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар поведал мне еще один способ уничтожить С'эньяка. Точнее не совсем уничтожить, а лишь пленить его душу тем же образом, каким когда-то это сделали Древние. Мне необходимо достать одно очень редкое заклинание - Мора Уларту. Дракон предположил, что тот, кто связан с темной магией, мог бы помочь мне в этом. Вот только где найти такого? Похоже, мне придется выкинуть эту затею из головы...");
};
}
else
{
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_37"); //Хммм... Думаю, я знаю одного из тех, кто ей владеет.
AI_Output(other,self,"DIA_Dragon_Gold_DestroyWayTwo_01_24"); //А после того как я найду это заклинание - где мне искать С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_25"); //Сначала найди Темницу Душ, а потом мы поговорим о твоей встрече с ним...
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_27"); //Поспеши, дорога каждая минута!
TASKFINDDARKSOUL = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар поведал мне еще один способ уничтожить С'эньяка. Точнее не совсем уничтожить, а лишь пленить его душу тем же образом, каким когда-то это сделали Древние. Для этого мне необходимо достать одно очень редкое заклинание - Мора Уларту, что на языке древних означает 'Темница душ'. Дракон предположил, что тот, кто связан с темной магией, мог бы помочь мне в этом. Надо бы поговорить с Ксардасом.");
};
};
instance DIA_DRAGON_GOLD_CLAWCARE(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_clawcare_condition;
information = dia_dragon_gold_clawcare_info;
permanent = FALSE;
description = "А что насчет Когтя?";
};
func int dia_dragon_gold_clawcare_condition()
{
if(TASKFINDSPHERE == TRUE)
{
return TRUE;
};
};
func void dia_dragon_gold_clawcare_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_ClawCare_01_00"); //А что насчет Когтя?
AI_Output(self,other,"DIA_Dragon_Gold_ClawCare_01_01"); //Ты можешь оставить его себе. Хотя Коготь Белиара - артефакт Тьмы, он может послужить и добру.
AI_Output(self,other,"DIA_Dragon_Gold_ClawCare_01_02"); //Но не забывай: меч был выкован для самого С'эньяка, и если демон вернет себе меч, он станет практически непобедим!
AI_Output(self,other,"DIA_Dragon_Gold_ClawCare_01_08"); //Если ты не уверен в том, что сможешь противостоять этому злу, то лучшее решение в данной ситуации...
AI_Output(self,other,"DIA_Dragon_Gold_ClawCare_01_09"); //...отдать этот меч мне. Я уничтожу этот источник зла раз и навсегда!
AI_Output(other,self,"DIA_Dragon_Gold_ClawCare_01_11"); //Хорошо. Я обдумаю твое предложение.
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Аш'Тар может уничтожить Коготь, если я решу, что эта ноша мне не по силам.");
};
instance DIA_DRAGON_GOLD_CLAWDESTROY(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_clawdestroy_condition;
information = dia_dragon_gold_clawdestroy_info;
permanent = TRUE;
description = "Уничтожь Коготь!";
};
func int dia_dragon_gold_clawdestroy_condition()
{
if(Npc_KnowsInfo(hero,dia_dragon_gold_clawcare) && (DESTROYCLAW == FALSE) && C_ScHasBeliarsWeapon())
{
return TRUE;
};
};
func void dia_dragon_gold_clawdestroy_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_ClawDestroy_01_00"); //Уничтожь Коготь!
AI_Output(other,self,"DIA_Dragon_Gold_ClawDestroy_01_03"); //Думаю, это будет самое лучшее решение.
AI_Output(self,other,"DIA_Dragon_Gold_ClawDestroy_01_04"); //Ты в этом уверен?..
Info_AddChoice(dia_dragon_gold_clawdestroy,"Нет, постой!",dia_dragon_gold_clawdestroy_no);
Info_AddChoice(dia_dragon_gold_clawdestroy,"Да!",dia_dragon_gold_clawdestroy_yes);
};
func void dia_dragon_gold_clawdestroy_yes()
{
B_GivePlayerXP(2500);
B_ClearBeliarsWeapon();
Wld_PlayEffect("spellFX_Innoseye",self,self,0,0,0,FALSE);
Wld_PlayEffect("spellFX_LIGHTSTAR_RED",self,self,0,0,0,FALSE);
Wld_PlayEffect("FX_EarthQuake",self,self,0,0,0,FALSE);
Snd_Play("DEM_WARN");
AI_PlayAni(self,"T_SURPRISE_CCW");
AI_PlayAni(self,"T_SURPRISE_CW");
AI_Output(self,other,"DIA_Dragon_Gold_DestroyWayTwo_01_23"); //...(рычит)
AI_Output(self,other,"DIA_Dragon_Gold_ClawDestroy_Yes_01_01"); //Вот и все... Когтя больше нет!
AI_Output(self,other,"DIA_Dragon_Gold_ClawDestroy_Yes_01_02"); //Его зло никогда больше не потревожит этот мир.
DESTROYCLAW = TRUE;
TOPIC_END_Klaue = TRUE;
Log_SetTopicStatus(TOPIC_Addon_Klaue,LOG_Success);
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Я отдал меч Аш'Тару и тот уничтожил его.");
Info_ClearChoices(dia_dragon_gold_clawdestroy);
};
func void dia_dragon_gold_clawdestroy_no()
{
AI_Output(other,self,"DIA_Dragon_Gold_ClawDestroy_No_01_00"); //Нет, постой!
AI_Output(self,other,"DIA_Dragon_Gold_ClawDestroy_No_01_01"); //Как скажешь.
Info_ClearChoices(dia_dragon_gold_clawdestroy);
};
instance DIA_DRAGON_GOLD_HAVEONEORALL(C_Info)
{
npc = none_103_dragon_gold;
nr = 1;
condition = dia_dragon_gold_haveoneorall_condition;
information = dia_dragon_gold_haveoneorall_info;
permanent = TRUE;
description = "Насчет нашего дела...";
};
func int dia_dragon_gold_haveoneorall_condition()
{
if(((TASKFINDDARKSOUL == TRUE) && (DESTROYCLAW == FALSE)) || (TASKFINDSPHERE == TRUE))
{
if(MISSSOULFOREVER == FALSE)
{
return TRUE;
};
};
};
func void dia_dragon_gold_haveoneorall_info()
{
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_01_00"); //Насчет нашего дела...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_01_01"); //Тебе есть что сказать, человек? Ты принес Сферы?
Info_ClearChoices(dia_dragon_gold_haveoneorall);
Info_AddChoice(dia_dragon_gold_haveoneorall,"Пока нет.",dia_dragon_gold_haveoneorall_none);
if((TASKFINDDARKSOUL == TRUE) && (Npc_HasItems(other,itru_moraulartu) >= 1) && (DESTROYCLAW == FALSE) && (TELLGDMU == FALSE))
{
Info_AddChoice(dia_dragon_gold_haveoneorall,"Я достал Мора Уларту!",dia_dragon_gold_haveoneorall_mora);
};
if((TASKFINDSPHERE == TRUE) && (Npc_HasItems(other,itmi_fireshpere) >= 1) && (Npc_HasItems(other,itmi_watershpere) >= 1) && (Npc_HasItems(other,itmi_stoneshpere) >= 1) && (Npc_HasItems(other,itmi_darkshpere) >= 1))
{
Info_AddChoice(dia_dragon_gold_haveoneorall,"Я достал все Сферы!",dia_dragon_gold_haveoneorall_sphere);
};
if((MIS_STONNOSTEST == LOG_SUCCESS) && (MISSSHEPREFOREVER == TRUE) && (MISSSOULFOREVER == FALSE))
{
Info_AddChoice(dia_dragon_gold_haveoneorall,"Я отдал их Хранителям.",dia_dragon_gold_haveoneorall_spheregone);
};
};
func void dia_dragon_gold_haveoneorall_none()
{
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_None_01_00"); //Пока нет.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_None_01_01"); //Тогда чего ты ждешь?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_None_01_02"); //Иди и принеси то, о чем я тебе говорил! И поспеши - у нас мало времени...
AI_StopProcessInfos(self);
};
func void dia_dragon_gold_haveoneorall_spheregone()
{
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_00"); //Нет. Я отдал их Хранителям.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_01"); //(рычит) Зачем ты это сделал?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_02"); //Без них у тебя не будет и малейшего шанса одолеть С'эньяка!
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_03"); //У меня не было другого выбора.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_06"); //Тогда тебе придется сражаться с архидемоном без какой-либо помощи, и, скорее всего, ты проиграешь...
if((TASKFINDDARKSOUL == TRUE) && (Npc_HasItems(other,itru_moraulartu) >= 1) && (DESTROYCLAW == FALSE) && (TELLGDMU == FALSE))
{
B_GivePlayerXP(200);
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_08"); //Но у меня еще есть Мора Уларту! Как насчет этого?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_09"); //(рычит) Значит, ты умудрился достать этот артефакт.
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_14"); //Да, но было бы неплохо понять, как эта штука работает.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_15"); //Просто - перед тем как начать битву с С'эньяком, используй на нем это заклинание.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_16"); //А после того как архидемон будет повержен, забери из его плоти камень с заточенной душой.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_17"); //Затем возьми этот камень и соедини его с Когтем Белиара на алтаре Темного бога - кристалл в основании клинка поглотит душу С'эньяка, и меч вновь обретет былую мощь!
TELLGDMU = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Если я намереваюсь использовать Мора Уларту, чтобы пленить душу С'эньяка, мне следует соединить камень с душой архидемона и Коготь Белиара, чтобы последний поглотил содержимое камня. Это вернет оружию его былую мощь.");
}
else if((TASKFINDDARKSOUL == TRUE) && (TELLGDMU == FALSE))
{
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_22"); //А если мне удастся достать Мора Уларту?
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_25"); //Как я смогу его использовать?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_15"); //Просто - перед тем как начать битву с С'эньяком, используй на нем это заклинание.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_16"); //А после того как архидемон будет повержен, забери из его плоти камень с заточенной душой.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_17"); //Затем возьми этот камень и соедини его с Когтем Белиара на алтаре Темного бога - кристалл в основании клинка поглотит душу С'эньяка, и меч вновь обретет былую мощь!
TELLGDMU = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Если я намереваюсь использовать Мора Уларту, чтобы пленить душу С'эньяка, мне следует соединить камень с душой архидемона и 'Коготь Белиара', чтобы последний поглотил содержимое камня. Это вернет оружию его былую мощь.");
}
else
{
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_33"); //Ну, это мы еще посмотрим.
};
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_34"); //Теперь ты мне скажешь, как добраться до С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_36"); //Его обитель находится в самом центре Лэнга, в мире демонов. Ни одному смертному туда просто так никогда не попасть.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_37"); //Поэтому единственный способ заставить С'эньяка сразиться с тобой - призвать его в этот мир!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_39"); //Просто возьми эту вещь.
B_GiveInvItems(self,other,ITMI_DRAGONGOLDGORN,1);
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_40"); //Что это?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_41"); //Золотой рог Ахианти - магический артефакт, звук которого способен призвать любое существо к его владельцу. Но только один раз!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_42"); //С'эньяк не сможет противостоять силе этого артефакта и явится на твой зов.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_43"); //Место встречи с С'эньяком ты выберешь сам. Постарайся сделать это с умом.
KNOWS_CRESTMAKE = TRUE;
AshtarLastWarn = TRUE;
MISSSOULFOREVER = TRUE;
AI_StopProcessInfos(self);
};
func void dia_dragon_gold_haveoneorall_mora()
{
B_GivePlayerXP(200);
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_00"); //Я достал Мора Уларту!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_09"); //Аргхх...(рычит) Значит, ты как-то умудрился достать этот артефакт.
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_14"); //Да, но было бы неплохо понять, как эта штука работает.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_15"); //Просто - перед тем как начать битву с С'эньяком, используй на нем это заклинание.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_16"); //А после того как архидемон будет повержен, забери из его плоти камень с заточенной душой.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_17"); //Затем возьми этот камень и соедини его с Когтем Белиара на алтаре Темного бога - кристалл в основании клинка поглотит душу С'эньяка, и меч вновь обретет былую мощь!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_13"); //Но хочу тебя сразу предупредить: после того как используешь на С'эньяке магию Мора Уларту...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_14"); //...Ты не сможешь воспользоваться Крестом Стихий!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_16"); //Сила Мора Уларту не сможет противостоять ужасающей мощи этого заклинания, и камень души будет уничтожен.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_17"); //Поэтому здесь тебе придется сражаться с С'эньяком в честном бою. И скажу прямо: у тебя мало шансов.
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_33"); //Ну, это мы еще посмотрим.
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_1W"); //Теперь ты мне скажешь, как добраться до С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_20"); //Нет...
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_21"); //Но почему?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_23"); //Ты должен иметь при себе Крест Стихий, как запасной вариант.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_25"); //Если что-то пойдет не так, это заклинание - наш единственный шанс уничтожить С'эньяка!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_26"); //Поэтому принеси мне те сферы. Тогда мы поговорим о твоей встрече с архидемоном.
TELLGDMU = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Если я намереваюсь использовать Мора Уларту, чтобы пленить душу С'эньяка, мне не следует потом использовать Крест Стихий, ибо это заклинание уничтожит демона вместе с его душой. После того как с С'эньяком будет покончено, мне необходимо соединить камень с душой архидемона и 'Коготь Белиара', чтобы последний поглотил содержимое камня. Это вернет оружию его былую мощь. Но в любом случае мне необходимо иметь при себе Крест Стихий.");
Info_ClearChoices(dia_dragon_gold_haveoneorall);
};
func void dia_dragon_gold_haveoneorall_sphere()
{
B_GivePlayerXP(500);
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_00"); //Я достал все сферы.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_01"); //Очень хорошо.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_02"); //Теперь у тебя есть почти все необходимое, чтобы сделать Крест Стихий и уничтожить С'эньяка!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_04"); //Да, не хватает последней детали...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_06"); //МОЕГО СЕРДЦА!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_08"); //Только с его помощью ты сможешь объединить сферы элементов и сотворить из них Крест Стихий!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_09"); //Однажды ты спросил меня, человек, - в чем смысл моего существования...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_11"); //Именно в этом он и заключается - дать шанс смертному, как ты, одолеть такое несокрушимое зло, как С'эньяк!
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_14"); //Ты принесешь себя в жертву?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_16"); //Не думай об этом. Ты сейчас должен думать только об одном - о своей предстоящей битве с С'эньяком!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Sphere_01_17"); //А теперь отойди...
AshtarLastWarn = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Когда я показал Аш'Тару сферы элементов, он поведал мне, как создать Крест Стихий. К сожалению, ему пришлось заплатить мне за помощь своей жизнью, ибо для создания этого заклинания требуется магическая эссенция из его сердца - из сердца золотого дракона! Кроме того, Аш'Тар рассказал мне и некоторые другие детали, которые помогут мне при встрече с С'эньяком.");
Info_ClearChoices(dia_dragon_gold_haveoneorall);
Info_AddChoice(dia_dragon_gold_haveoneorall,"(отойти)",dia_dragon_gold_haveoneorall_giveheart);
};
func void dia_dragon_gold_haveoneorall_giveheart()
{
AI_Dodge(other);
Wld_PlayEffect("spellFX_Innoseye",self,self,0,0,0,FALSE);
Wld_PlayEffect("spellFX_LIGHTSTAR_RED",self,self,0,0,0,FALSE);
Wld_PlayEffect("FX_EarthQuake",self,self,0,0,0,FALSE);
Snd_Play("DEM_WARN");
KNOWS_CRESTMAKE = TRUE;
AI_Print("Обучен изготовлению руны - 'Крест Стихий'");
AI_PlayAni(self,"T_SURPRISE_CCW");
AI_PlayAni(self,"T_SURPRISE_CW");
B_GiveInvItems(self,other,itat_golddragonheart,1);
AI_Wait(self,5);
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_00"); //Вот, возьми его...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_03"); //Для того чтобы сделать Крест Стихий, окропи все сферы магической эссенцией, взятой из моего сердца, а потом просто соедини их вместе. Используй для этого рунический стол.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_04"); //После того как сделаешь это, настанет время встретиться с архидемоном.
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_05"); //Как добраться до С'эньяка?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_36"); //Его обитель находится в самом центре Лэнга, в мире демонов. Ни одному смертному туда просто так никогда не попасть.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_37"); //Поэтому единственный способ заставить С'эньяка сразиться с тобой - это призвать его в этот мир!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_39"); //Просто возьми эту вещь.
B_GiveInvItems(self,other,ITMI_DRAGONGOLDGORN,1);
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_40"); //Что это?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_41"); //Золотой рог Ахианти - магический артефакт, звук которого способен призвать любое существо к его владельцу. Но только лишь один раз.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_42"); //С'эньяк не сможет противостоять силе этого артефакта и явится на твой зов.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_43"); //Как ты уже наверняка понял, место встречи с С'эньяком ты выберешь сам. Поэтому постарайся использовать его с умом.
if((TASKFINDDARKSOUL == TRUE) && (Npc_HasItems(other,itru_moraulartu) >= 1) && (DESTROYCLAW == FALSE) && (TELLGDMU == FALSE))
{
B_GivePlayerXP(500);
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_18"); //У меня также есть Мора Уларту!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_09"); //Аргхх...(рычит) Значит, ты как-то умудрился достать этот артефакт.
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_14"); //Да, но было бы неплохо понять, как эта штука работает.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_15"); //Просто - перед тем как начать битву с С'эньяком, используй на нем это заклинание.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_16"); //А после того как архидемон будет повержен, забери из его плоти камень с заточенной душой.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_17"); //Затем возьми этот камень и соедини его с Когтем Белиара на алтаре Темного бога - кристалл в основании клинка поглотит душу С'эньяка, и меч вновь обретет былую мощь!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_13"); //Но хочу тебя сразу предупредить: после того как используешь на С'эньяке магию Мора Уларту...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_14"); //...Ты не сможешь воспользоваться Крестом Стихий!
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_15"); //Но почему?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_16"); //Сила Мора Уларту не сможет противостоять ужасающей мощи этого заклинания и, камень души будет уничтожен!
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Mora_01_17"); //И тогда тебе придется сражаться с С'эньяком в честном бою. И скажу прямо: у тебя мало шансов.
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_33"); //Ну, это мы еще посмотрим.
TELLGDMU = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Если я намереваюсь использовать Мора Уларту, чтобы пленить душу С'эньяка, мне не следует потом использовать Крест Стихий, ибо это заклинание уничтожит демона вместе с его душой. После того как с С'эньяком будет покончено, мне необходимо соединить камень с душой архидемона и 'Коготь Белиара', чтобы последний поглотил содержимое камня. Это вернет оружию его былую мощь.");
}
else if((TASKFINDDARKSOUL == TRUE) && (TELLGDMU == FALSE))
{
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_22"); //А если мне удастся достать Мора Уларту - как я смогу его использовать?
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_15"); //Просто - перед тем, как начать битву с С'эньяком, используй на нем это заклинание.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_16"); //А после того как архидемон будет повержен - забери из его плоти камень с заточенной душой.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_17"); //Затем, возьми этот камень и соедини его с Когтем Белиара на алтаре Темного Бога - кристалл в основании клинка поглотит душу С'эньяка и меч вновь обретет былую мощь!
TELLGDMU = TRUE;
B_LogEntry(TOPIC_GOLDDRAGONPORTAL,"Если я намереваюсь использовать Мора Уларту, чтобы пленить душу С'эньяка - мне не следует потом использовать Крест Стихий, ибо это заклинание уничтожит демона вместе с его душой. После того как с С'эньяком будет покончено - мне необходимо соединить камень с душой архидемона и 'Коготь Белиара', чтобы последний поглотил содержимое камня. Это вернет оружию его былую мощь!");
}
else
{
AI_Output(other,self,"DIA_Dragon_Gold_HaveOneOrAll_SphereGone_01_33"); //Ну, это мы еще посмотрим.
};
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_57"); //Теперь это все, что тебе следует знать
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_58"); //И, кажется, мое время вышло...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_59"); //Я уже чувствую, как мои силы уходят - я слабею...
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_61"); //...(рычит от боли)
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_GiveHeart_01_62"); //Ступай человек, и запомни все, что я тебе сказал.
AI_Output(self,other,"DIA_Dragon_Gold_HaveOneOrAll_Dead_01_00"); //(умирая) Не подведи меня...
Info_ClearChoices(dia_dragon_gold_haveoneorall);
Info_AddChoice(dia_dragon_gold_haveoneorall,Dialog_Ende,dia_dragon_gold_haveoneorall_dead);
};
func void dia_dragon_gold_haveoneorall_dead()
{
AI_StopProcessInfos(self);
DragonGoldIsDead = TRUE;
HeroNotMobsi = FALSE;
PLAYER_MOBSI_PRODUCTION = MOBSI_NONE;
Wld_StopEffect("DIALOGSCOPE_FX");
};
//---------------------Дракон Аданоса-------------------------------------------
instance DIA_Dragon_AV_EXIT(C_Info)
{
npc = Dragon_AV;
nr = 999;
condition = dia_Dragon_AV_exit_condition;
information = dia_Dragon_AV_exit_info;
permanent = TRUE;
description = Dialog_Ende;
};
func int dia_Dragon_AV_exit_condition()
{
return TRUE;
};
func void dia_Dragon_AV_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_Dragon_AV_HELLO(C_Info)
{
npc = Dragon_AV;
nr = 1;
condition = dia_Dragon_AV_hello_condition;
information = dia_Dragon_AV_hello_info;
important = TRUE;
};
func int dia_Dragon_AV_hello_condition()
{
return TRUE;
};
func void dia_Dragon_AV_Hello_info()
{
B_GivePlayerXP(2000);
AI_Output(self,other,"DIA_Dragon_AV_Hello_01_00"); //Наконец-то ты здесь... Я так долго ждал тебя!
AI_Output(other,self,"DIA_Dragon_AV_Hello_01_01"); //Ты меня ждал? И как это понимать?
AI_Output(self,other,"DIA_Dragon_AV_Hello_01_02"); //Ты ведь тот, кого Аданос выбрал в качестве своего избранника.
AI_Output(other,self,"DIA_Dragon_AV_Hello_01_03"); //С чего ты так решил?
AI_Output(self,other,"DIA_Dragon_AV_Hello_01_04"); //Ты носишь его символы власти, и к тому же смог добраться до этого места.
AI_Output(self,other,"DIA_Dragon_AV_Hello_01_05"); //А это может означать только одно: Аданос выбрал тебя!
AI_Output(other,self,"DIA_Dragon_AV_Hello_01_06"); //Ну, допустим. И что теперь?
AI_Output(self,other,"DIA_Dragon_AV_Hello_01_07"); //Теперь пришло время выполнить возложенную им на тебя обязанность!
AI_Output(other,self,"DIA_Dragon_AV_Hello_01_08"); //Какую еще обязанность?
AI_Output(self,other,"DIA_Dragon_AV_Hello_01_09"); //Уничтожить то зло, что когда-то посмело вторгнуться в его священную вотчину.
AI_Output(self,other,"DIA_Dragon_AV_Hello_01_10"); //Зло, которое я охраняю здесь уже много веков!
};
instance DIA_Dragon_AV_Evil(C_Info)
{
npc = Dragon_AV;
nr = 1;
condition = dia_Dragon_AV_Evil_condition;
information = dia_Dragon_AV_Evil_info;
permanent = FALSE;
description = "Что это за зло?";
};
func int dia_Dragon_AV_Evil_condition()
{
return TRUE;
};
func void dia_Dragon_AV_Evil_info()
{
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_00"); //Что это за зло?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_01"); //Очень древнее и опасное... Зло, которое было порождено одним из братьев Аданоса.
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_02"); //Ты имеешь ввиду Инноса или Белиара?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_03"); //Белиара! Только он способен сотворить такое.
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_04"); //Хорошо. И как же выглядит это зло?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_05"); //За несколько тысячелетий своего существования оно принимало самые различные формы и очертания.
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_06"); //Как оно выглядит сейчас, я не знаю. Но я чувствую его присутствие... чувствую, что оно до сих пор там.
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_07"); //Там - это где?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_08"); //В храме, что позади меня.
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_09"); //Хочешь сказать, что я должен буду отправиться в этот храм и уничтожить это ЗЛО?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_12"); //Именно так. Такова воля Аданоса!
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_13"); //Ну хорошо. И как мне победить его?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_14"); //Этого я не знаю. Я лишь только страж...
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_15"); //Ох, ну ладно, разберусь как-нибудь сам. А как мне попасть в храм?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_17"); //Я открою двери храма, как только ты скажешь, что готов к этому.
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_18"); //Но хочу предупредить тебя... Кроме меня, храм еще охраняют бессмертные стражи.
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_19"); //Время, проведенное ими внутри, под влиянием могущественного зла превратило их в чудовищных монстров.
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_20"); //Раньше они не посмели бы напасть на избранника самого Аданоса. Но теперь...
AI_Output(other,self,"DIA_Dragon_AV_Evil_01_21"); //Полагаешь, что теперь они захотят сделать мне больно?
AI_Output(self,other,"DIA_Dragon_AV_Evil_01_22"); //Теперь они служат этому злу, и наверняка будут до конца защищать своего господина.
};
var int HramDoorOpen;
instance DIA_Dragon_AV_OpenHram(C_Info)
{
npc = Dragon_AV;
nr = 1;
condition = dia_Dragon_AV_OpenHram_condition;
information = dia_Dragon_AV_OpenHram_info;
permanent = TRUE;
description = "Открой ворота храм, страж!";
};
func int dia_Dragon_AV_OpenHram_condition()
{
if(Npc_KnowsInfo(hero,DIA_Dragon_AV_Evil) && (HramDoorOpen == FALSE))
{
return TRUE;
};
};
func void dia_Dragon_AV_OpenHram_info()
{
AI_Output(other,self,"DIA_Dragon_AV_OpenHram_01_00"); //Открой ворота храма, страж!
AI_Output(self,other,"DIA_Dragon_AV_OpenHram_01_01"); //Ты уверен, что готов к этой битве?
AI_Output(self,other,"DIA_Dragon_AV_OpenHram_01_02"); //Если ты потерпишь неудачу, то зло вновь вырвется наружу, и я уже буду не в силах его остановить.
Info_ClearChoices(DIA_Dragon_AV_OpenHram);
Info_AddChoice(DIA_Dragon_AV_OpenHram,"Нет, постой.",DIA_Dragon_AV_OpenHram_No);
Info_AddChoice(DIA_Dragon_AV_OpenHram,"Открывай уже!",DIA_Dragon_AV_OpenHram_Yes);
};
func void DIA_Dragon_AV_OpenHram_No()
{
AI_Output(other,self,"DIA_Dragon_AV_OpenHram_No_01_00"); //Нет, постой.
AI_Output(self,other,"DIA_Dragon_AV_OpenHram_No_01_01"); //Твоя неуверенность немного пугает меня...
AI_Output(self,other,"DIA_Dragon_AV_OpenHram_No_01_02"); //Однако действительно лучше хорошо подготовиться, ибо предстоящий бой будет тяжелым.
Info_ClearChoices(DIA_Dragon_AV_OpenHram);
};
func void DIA_Dragon_AV_OpenHram_Yes()
{
AI_Output(other,self,"DIA_Dragon_AV_OpenHram_Yes_01_00"); //Открывай уже!
AI_Output(self,other,"DIA_Dragon_AV_OpenHram_Yes_01_01"); //Ворота храма открыты... Удачи тебе в битве, избранник! И да пребудет с тобой Аданос.
AI_StopProcessInfos(self);
Wld_PlayEffect("SPELLFX_THUNDERSTORM_RAIN_NOCOL",hero,hero,0,0,0,FALSE);
Wld_PlayEffect("SPELLFX_THUNDERSTORM_SCREENBLEND",hero,hero,0,0,0,FALSE);
Wld_PlayEffect("spellFX_INCOVATION_WHITE",hero,hero,0,0,0,FALSE);
Wld_SendTrigger("EVT_RAVENTEMPLEDOOR_01");
HramDoorOpen = TRUE;
if(SBMODE == TRUE)
{
Wld_InsertNpc(Stoneguardian_Undead,"FP_ROAM_OASE_8");
Wld_InsertNpc(Stoneguardian_Undead,"FP_ROAM_OASE_16");
Wld_InsertNpc(Stoneguardian_Undead,"FP_ROAM_OASE_15");
Wld_InsertNpc(Stoneguardian_Undead,"FP_ROAM_OASE_10");
Wld_InsertNpc(Stoneguardian_Undead,"FP_ROAM_OASE_11");
Wld_InsertNpc(Stoneguardian_Undead,"FP_ROAM_OASE_4");
Wld_InsertNpc(Stoneguardian_Undead,"FP_ROAM_OASE_5");
};
};
|
D
|
/*********************************************************
Copyright: (C) 2008 by Steven Schveighoffer.
All rights reserved
License: $(LICENSE)
**********************************************************/
module col.model.Iterator;
enum : бцел
{
/**
* Возвращается из длина(), когда length не поддерживается
*/
ДЛИНА_НЕ_ПОДДЕРЖИВАЕТСЯ = ~0
}
/**
* Basic обходчик. Allows iterating over all the элементы of an object.
*/
interface Обходчик(V)
{
/**
* If supported, returns the number of элементы that will be iterated.
*
* If not supported, returns ДЛИНА_НЕ_ПОДДЕРЖИВАЕТСЯ.
*/
бцел длина(); alias длина length;
/**
* foreach operator.
*/
цел opApply(цел delegate(ref V v) дг);
}
/**
* Обходчик с ключами. This allows one to view the ключ of the элемент as well
* as the значение while iterating.
*/
interface Ключник(K, V) : Обходчик!(V)
{
alias Обходчик!(V).opApply opApply;
/**
* iterate over both ключи и значения
*/
цел opApply(цел delegate(ref K k, ref V v) дг);
}
/**
* A очистить обходчик is используется to очистить значения from a collection. This works by
* telling the обходчик that you want обх to удали the значение последн iterated.
*/
interface Чистящий(V)
{
/**
* iterate over the значения of the обходчик, telling обх which значения to
* удали. To удали a значение, установи чистить_ли to true перед exiting the
* loop.
*
* Make sure you specify ref for the чистить_ли parameter:
*
* -----
* foreach(ref чистить_ли, v; &чистящий.очистить){
* ...
* -----
*/
цел очистить(цел delegate(ref бул чистить_ли, ref V v) дг);
}
/**
* A очистить обходчик for keyed containers.
*/
interface ЧистящийКлючи(K, V) : Чистящий!(V)
{
/**
* iterate over the ключ/значение pairs of the обходчик, telling обх which ones
* to удали.
*
* Make sure you specify ref for the чистить_ли parameter:
*
* -----
* foreach(ref чистить_ли, k, v; &чистящий.чисть_ключ){
* ...
* -----
*
* TODO: note this should have the имя очистить, but because of asonine
* lookup rules, обх makes обх difficult to specify this version over the
* base version. Once this is fixed, обх's highly likely that this goes
* тыл to the имя очистить.
*
* See bugzilla #2498
*/
цел чисть_ключ(цел delegate(ref бул чистить_ли, ref K k, ref V v) дг);
}
|
D
|
void main() { runSolver(); }
void problem() {
auto N = scan!int;
auto A = scan!int;
auto WXV = scan!int(3 * N).chunks(3).array;
struct Fish {
int value;
real x, v;
void sim(real t) {
x += t * v;
}
}
auto solve() {
auto fishes = WXV.map!(f => Fish(f[0], f[1], f[2])).array;
int calc(real t) {
auto moved = fishes.dup;
foreach(ref f; moved) f.sim(t);
moved.sort!"a.x < b.x";
int left;
int total;
int ret;
foreach(i, f; moved) {
total += f.value;
while(moved[left].x < f.x - A) {
total -= moved[left].value;
left++;
}
ret = max(ret, total);
}
return ret;
}
long ans;
ans = max(ans, ternarySearch(&calc, 1.0, 0.0, TernarySearchTarget.Max)[1]);
ans = max(ans, ternarySearch(&calc, 0.0, 1000000.0, TernarySearchTarget.Max)[1]);
return ans;
}
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;
import std.algorithm.setops;
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"];
// -----------------------------------------------
enum TernarySearchTarget { Min, Max }
Tuple!(T, K) ternarySearch(T, K)(K delegate(T) fn, T l, T r, TernarySearchTarget target = TernarySearchTarget.Min) {
auto low = l;
auto high = r;
const T THREE = 3;
bool again() {
static if (is(T == float) || is(T == double) || is(T == real)) {
return !high.approxEqual(low, 1e-10, 1e-10);
} else {
return low != high;
}
}
auto compare = (K a, K b) => target == TernarySearchTarget.Min ? a > b : a < b;
while(again()) {
const v1 = (low * 2 + high) / THREE;
const v2 = (low + high * 2) / THREE;
if (compare(fn(v1), fn(v2))) {
low = v1 == low ? v2 : v1;
} else {
high = v2 == high ? v1 : v2;
}
}
return tuple(low, fn(low));
}
|
D
|
(*
* magic - this is a D1 program that checks the 'magic'
* quality of a series of numbers
*)
program check_for_magic;
var
N: integer;
Odd: boolean;
terms: byte;
i: integer;
procedure NextTerm;
procedure CheckOdd;
begin
if (N mod 2 = 0) then
odd := false
else
odd := true
end;
procedure DownStep;
begin
N := N / 2
end;
procedure UpStep;
begin
N := 3 * N + 1
end;
begin { NextTerm }
CheckOdd;
if Odd then
UpStep
else
DownStep
end;
procedure check_magic_N;
begin { main program }
writeln('Checking magic quality for:');
writeln(N);
terms := 0;
while N > 1 do
begin
WriteLn(N);
nextterm;
terms := terms + 1;
end;
writeln('Magic terms:');
writeln(terms);
writeln(' ');
end;
begin {main}
writeln('Magic quality checker!');
for i := 2 to 200 do
begin
n := i;
check_magic_n;
end;
writeln('Goodbye!');
end.
|
D
|
instance VLK_502_Buddler (Npc_Default)
{
//-------- primary data --------
name = Name_Buddler;
npctype = npctype_Ambient;
guild = GIL_VLK;
level = 2;
voice = 4;
id = 502;
//-------- abilities --------
attribute[ATR_STRENGTH] = 13;
attribute[ATR_DEXTERITY] = 10;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 64;
attribute[ATR_HITPOINTS] = 64;
//-------- visuals --------
// animations
Mdl_SetVisual (self,"HUMANS.MDS");
Mdl_ApplyOverlayMds (self,"Humans_Tired.mds");
// body mesh,head mesh,hairmesh,face-tex,hair-tex,skin
Mdl_SetVisualBody (self,"hum_body_Naked0",3,1,"Hum_Head_Pony",68,4,VLK_ARMOR_L);
B_Scale (self);
Mdl_SetModelFatness (self,-1);
Npc_SetAivar(self,AIV_IMPORTANT, TRUE);
fight_tactic = FAI_HUMAN_COWARD;
//-------- Talents --------
//-------- inventory --------
EquipItem (self,DEF_MW_1H);
CreateInvItem (self,ItMiLute);
CreateInvItem (self,Itfo_Potion_Water_01);
//-------------Daily Routine-------------
/*B_InitNPCAddins(self);*/ daily_routine = Rtn_start_502;
};
FUNC VOID Rtn_start_502 ()
{
TA_Sleep (22,00,07,00,"OCR_HUT_10");
TA_Cook (07,00,17,00,"OCR_COOK_AT_HUT_10");
TA_PlayTune (17,00,22,00,"OCR_OUTSIDE_HUT_10");
};
|
D
|
/**
* Generate $(LINK2 https://dlang.org/dmd-windows.html#interface-files, D interface files).
*
* Also used to convert AST nodes to D code in general, e.g. for error messages or `printf` debugging.
*
* Copyright: Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/hdrgen.d, _hdrgen.d)
* Documentation: https://dlang.org/phobos/dmd_hdrgen.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/hdrgen.d
*/
module dmd.hdrgen;
import core.stdc.ctype;
import core.stdc.stdio;
import core.stdc.string;
import dmd.aggregate;
import dmd.aliasthis;
import dmd.arraytypes;
import dmd.astenums;
import dmd.attrib;
import dmd.cond;
import dmd.ctfeexpr;
import dmd.dclass;
import dmd.declaration;
import dmd.denum;
import dmd.dimport;
import dmd.dmodule;
import dmd.doc;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dtemplate;
import dmd.dversion;
import dmd.expression;
import dmd.func;
import dmd.globals;
import dmd.id;
import dmd.identifier;
import dmd.init;
import dmd.mtype;
import dmd.nspace;
import dmd.parse;
import dmd.root.complex;
import dmd.root.ctfloat;
import dmd.common.outbuffer;
import dmd.root.rootobject;
import dmd.root.string;
import dmd.statement;
import dmd.staticassert;
import dmd.target;
import dmd.tokens;
import dmd.utils;
import dmd.visitor;
struct HdrGenState
{
bool hdrgen; /// true if generating header file
bool ddoc; /// true if generating Ddoc file
bool fullDump; /// true if generating a full AST dump file
bool fullQual; /// fully qualify types when printing
int tpltMember;
int autoMember;
int forStmtInit;
int insideFuncBody;
bool declstring; // set while declaring alias for string,wstring or dstring
EnumDeclaration inEnumDecl;
}
enum TEST_EMIT_ALL = 0;
extern (C++) void genhdrfile(Module m)
{
OutBuffer buf;
buf.doindent = 1;
buf.printf("// D import file generated from '%s'", m.srcfile.toChars());
buf.writenl();
HdrGenState hgs;
hgs.hdrgen = true;
toCBuffer(m, &buf, &hgs);
writeFile(m.loc, m.hdrfile.toString(), buf[]);
}
/**
* Dumps the full contents of module `m` to `buf`.
* Params:
* buf = buffer to write to.
* m = module to visit all members of.
*/
extern (C++) void moduleToBuffer(OutBuffer* buf, Module m)
{
HdrGenState hgs;
hgs.fullDump = true;
toCBuffer(m, buf, &hgs);
}
void moduleToBuffer2(Module m, OutBuffer* buf, HdrGenState* hgs)
{
if (m.md)
{
if (m.userAttribDecl)
{
buf.writestring("@(");
argsToBuffer(m.userAttribDecl.atts, buf, hgs);
buf.writeByte(')');
buf.writenl();
}
if (m.md.isdeprecated)
{
if (m.md.msg)
{
buf.writestring("deprecated(");
m.md.msg.expressionToBuffer(buf, hgs);
buf.writestring(") ");
}
else
buf.writestring("deprecated ");
}
buf.writestring("module ");
buf.writestring(m.md.toChars());
buf.writeByte(';');
buf.writenl();
}
foreach (s; *m.members)
{
s.dsymbolToBuffer(buf, hgs);
}
}
private void statementToBuffer(Statement s, OutBuffer* buf, HdrGenState* hgs)
{
scope v = new StatementPrettyPrintVisitor(buf, hgs);
s.accept(v);
}
private extern (C++) final class StatementPrettyPrintVisitor : Visitor
{
alias visit = Visitor.visit;
public:
OutBuffer* buf;
HdrGenState* hgs;
extern (D) this(OutBuffer* buf, HdrGenState* hgs)
{
this.buf = buf;
this.hgs = hgs;
}
override void visit(Statement s)
{
buf.writestring("Statement::toCBuffer()");
buf.writenl();
assert(0);
}
override void visit(ErrorStatement s)
{
buf.writestring("__error__");
buf.writenl();
}
override void visit(ExpStatement s)
{
if (s.exp && s.exp.op == EXP.declaration &&
(cast(DeclarationExp)s.exp).declaration)
{
// bypass visit(DeclarationExp)
(cast(DeclarationExp)s.exp).declaration.dsymbolToBuffer(buf, hgs);
return;
}
if (s.exp)
s.exp.expressionToBuffer(buf, hgs);
buf.writeByte(';');
if (!hgs.forStmtInit)
buf.writenl();
}
override void visit(CompileStatement s)
{
buf.writestring("mixin(");
argsToBuffer(s.exps, buf, hgs, null);
buf.writestring(");");
if (!hgs.forStmtInit)
buf.writenl();
}
override void visit(CompoundStatement s)
{
foreach (sx; *s.statements)
{
if (sx)
sx.accept(this);
}
}
override void visit(CompoundDeclarationStatement s)
{
bool anywritten = false;
foreach (sx; *s.statements)
{
auto ds = sx ? sx.isExpStatement() : null;
if (ds && ds.exp.op == EXP.declaration)
{
auto d = (cast(DeclarationExp)ds.exp).declaration;
assert(d.isDeclaration());
if (auto v = d.isVarDeclaration())
{
scope ppv = new DsymbolPrettyPrintVisitor(buf, hgs);
ppv.visitVarDecl(v, anywritten);
}
else
d.dsymbolToBuffer(buf, hgs);
anywritten = true;
}
}
buf.writeByte(';');
if (!hgs.forStmtInit)
buf.writenl();
}
override void visit(UnrolledLoopStatement s)
{
buf.writestring("/*unrolled*/ {");
buf.writenl();
buf.level++;
foreach (sx; *s.statements)
{
if (sx)
sx.accept(this);
}
buf.level--;
buf.writeByte('}');
buf.writenl();
}
override void visit(ScopeStatement s)
{
buf.writeByte('{');
buf.writenl();
buf.level++;
if (s.statement)
s.statement.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
override void visit(WhileStatement s)
{
buf.writestring("while (");
if (auto p = s.param)
{
// Print condition assignment
StorageClass stc = p.storageClass;
if (!p.type && !stc)
stc = STC.auto_;
if (stcToBuffer(buf, stc))
buf.writeByte(' ');
if (p.type)
typeToBuffer(p.type, p.ident, buf, hgs);
else
buf.writestring(p.ident.toString());
buf.writestring(" = ");
}
s.condition.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
if (s._body)
s._body.accept(this);
}
override void visit(DoStatement s)
{
buf.writestring("do");
buf.writenl();
if (s._body)
s._body.accept(this);
buf.writestring("while (");
s.condition.expressionToBuffer(buf, hgs);
buf.writestring(");");
buf.writenl();
}
override void visit(ForStatement s)
{
buf.writestring("for (");
if (s._init)
{
hgs.forStmtInit++;
s._init.accept(this);
hgs.forStmtInit--;
}
else
buf.writeByte(';');
if (s.condition)
{
buf.writeByte(' ');
s.condition.expressionToBuffer(buf, hgs);
}
buf.writeByte(';');
if (s.increment)
{
buf.writeByte(' ');
s.increment.expressionToBuffer(buf, hgs);
}
buf.writeByte(')');
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
if (s._body)
s._body.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
private void foreachWithoutBody(ForeachStatement s)
{
buf.writestring(Token.toString(s.op));
buf.writestring(" (");
foreach (i, p; *s.parameters)
{
if (i)
buf.writestring(", ");
if (stcToBuffer(buf, p.storageClass))
buf.writeByte(' ');
if (p.type)
typeToBuffer(p.type, p.ident, buf, hgs);
else
buf.writestring(p.ident.toString());
}
buf.writestring("; ");
s.aggr.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
}
override void visit(ForeachStatement s)
{
foreachWithoutBody(s);
buf.writeByte('{');
buf.writenl();
buf.level++;
if (s._body)
s._body.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
private void foreachRangeWithoutBody(ForeachRangeStatement s)
{
buf.writestring(Token.toString(s.op));
buf.writestring(" (");
if (s.prm.type)
typeToBuffer(s.prm.type, s.prm.ident, buf, hgs);
else
buf.writestring(s.prm.ident.toString());
buf.writestring("; ");
s.lwr.expressionToBuffer(buf, hgs);
buf.writestring(" .. ");
s.upr.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
}
override void visit(ForeachRangeStatement s)
{
foreachRangeWithoutBody(s);
buf.writeByte('{');
buf.writenl();
buf.level++;
if (s._body)
s._body.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
override void visit(StaticForeachStatement s)
{
buf.writestring("static ");
if (s.sfe.aggrfe)
{
visit(s.sfe.aggrfe);
}
else
{
assert(s.sfe.rangefe);
visit(s.sfe.rangefe);
}
}
override void visit(ForwardingStatement s)
{
s.statement.accept(this);
}
override void visit(IfStatement s)
{
buf.writestring("if (");
if (Parameter p = s.prm)
{
StorageClass stc = p.storageClass;
if (!p.type && !stc)
stc = STC.auto_;
if (stcToBuffer(buf, stc))
buf.writeByte(' ');
if (p.type)
typeToBuffer(p.type, p.ident, buf, hgs);
else
buf.writestring(p.ident.toString());
buf.writestring(" = ");
}
s.condition.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
if (s.ifbody.isScopeStatement())
{
s.ifbody.accept(this);
}
else
{
buf.level++;
s.ifbody.accept(this);
buf.level--;
}
if (s.elsebody)
{
buf.writestring("else");
if (!s.elsebody.isIfStatement())
{
buf.writenl();
}
else
{
buf.writeByte(' ');
}
if (s.elsebody.isScopeStatement() || s.elsebody.isIfStatement())
{
s.elsebody.accept(this);
}
else
{
buf.level++;
s.elsebody.accept(this);
buf.level--;
}
}
}
override void visit(ConditionalStatement s)
{
s.condition.conditionToBuffer(buf, hgs);
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
if (s.ifbody)
s.ifbody.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
if (s.elsebody)
{
buf.writestring("else");
buf.writenl();
buf.writeByte('{');
buf.level++;
buf.writenl();
s.elsebody.accept(this);
buf.level--;
buf.writeByte('}');
}
buf.writenl();
}
override void visit(PragmaStatement s)
{
buf.writestring("pragma (");
buf.writestring(s.ident.toString());
if (s.args && s.args.length)
{
buf.writestring(", ");
argsToBuffer(s.args, buf, hgs);
}
buf.writeByte(')');
if (s._body)
{
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
s._body.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
else
{
buf.writeByte(';');
buf.writenl();
}
}
override void visit(StaticAssertStatement s)
{
s.sa.dsymbolToBuffer(buf, hgs);
}
override void visit(SwitchStatement s)
{
buf.writestring(s.isFinal ? "final switch (" : "switch (");
s.condition.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
if (s._body)
{
if (!s._body.isScopeStatement())
{
buf.writeByte('{');
buf.writenl();
buf.level++;
s._body.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
else
{
s._body.accept(this);
}
}
}
override void visit(CaseStatement s)
{
buf.writestring("case ");
s.exp.expressionToBuffer(buf, hgs);
buf.writeByte(':');
buf.writenl();
s.statement.accept(this);
}
override void visit(CaseRangeStatement s)
{
buf.writestring("case ");
s.first.expressionToBuffer(buf, hgs);
buf.writestring(": .. case ");
s.last.expressionToBuffer(buf, hgs);
buf.writeByte(':');
buf.writenl();
s.statement.accept(this);
}
override void visit(DefaultStatement s)
{
buf.writestring("default:");
buf.writenl();
s.statement.accept(this);
}
override void visit(GotoDefaultStatement s)
{
buf.writestring("goto default;");
buf.writenl();
}
override void visit(GotoCaseStatement s)
{
buf.writestring("goto case");
if (s.exp)
{
buf.writeByte(' ');
s.exp.expressionToBuffer(buf, hgs);
}
buf.writeByte(';');
buf.writenl();
}
override void visit(SwitchErrorStatement s)
{
buf.writestring("SwitchErrorStatement::toCBuffer()");
buf.writenl();
}
override void visit(ReturnStatement s)
{
buf.writestring("return ");
if (s.exp)
s.exp.expressionToBuffer(buf, hgs);
buf.writeByte(';');
buf.writenl();
}
override void visit(BreakStatement s)
{
buf.writestring("break");
if (s.ident)
{
buf.writeByte(' ');
buf.writestring(s.ident.toString());
}
buf.writeByte(';');
buf.writenl();
}
override void visit(ContinueStatement s)
{
buf.writestring("continue");
if (s.ident)
{
buf.writeByte(' ');
buf.writestring(s.ident.toString());
}
buf.writeByte(';');
buf.writenl();
}
override void visit(SynchronizedStatement s)
{
buf.writestring("synchronized");
if (s.exp)
{
buf.writeByte('(');
s.exp.expressionToBuffer(buf, hgs);
buf.writeByte(')');
}
if (s._body)
{
buf.writeByte(' ');
s._body.accept(this);
}
}
override void visit(WithStatement s)
{
buf.writestring("with (");
s.exp.expressionToBuffer(buf, hgs);
buf.writestring(")");
buf.writenl();
if (s._body)
s._body.accept(this);
}
override void visit(TryCatchStatement s)
{
buf.writestring("try");
buf.writenl();
if (s._body)
{
if (s._body.isScopeStatement())
{
s._body.accept(this);
}
else
{
buf.level++;
s._body.accept(this);
buf.level--;
}
}
foreach (c; *s.catches)
{
visit(c);
}
}
override void visit(TryFinallyStatement s)
{
buf.writestring("try");
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
s._body.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
buf.writestring("finally");
buf.writenl();
if (s.finalbody.isScopeStatement())
{
s.finalbody.accept(this);
}
else
{
buf.level++;
s.finalbody.accept(this);
buf.level--;
}
}
override void visit(ScopeGuardStatement s)
{
buf.writestring(Token.toString(s.tok));
buf.writeByte(' ');
if (s.statement)
s.statement.accept(this);
}
override void visit(ThrowStatement s)
{
buf.writestring("throw ");
s.exp.expressionToBuffer(buf, hgs);
buf.writeByte(';');
buf.writenl();
}
override void visit(DebugStatement s)
{
if (s.statement)
{
s.statement.accept(this);
}
}
override void visit(GotoStatement s)
{
buf.writestring("goto ");
buf.writestring(s.ident.toString());
buf.writeByte(';');
buf.writenl();
}
override void visit(LabelStatement s)
{
buf.writestring(s.ident.toString());
buf.writeByte(':');
buf.writenl();
if (s.statement)
s.statement.accept(this);
}
override void visit(AsmStatement s)
{
buf.writestring("asm { ");
Token* t = s.tokens;
buf.level++;
while (t)
{
buf.writestring(t.toChars());
if (t.next &&
t.value != TOK.min &&
t.value != TOK.comma && t.next.value != TOK.comma &&
t.value != TOK.leftBracket && t.next.value != TOK.leftBracket &&
t.next.value != TOK.rightBracket &&
t.value != TOK.leftParenthesis && t.next.value != TOK.leftParenthesis &&
t.next.value != TOK.rightParenthesis &&
t.value != TOK.dot && t.next.value != TOK.dot)
{
buf.writeByte(' ');
}
t = t.next;
}
buf.level--;
buf.writestring("; }");
buf.writenl();
}
override void visit(ImportStatement s)
{
foreach (imp; *s.imports)
{
imp.dsymbolToBuffer(buf, hgs);
}
}
void visit(Catch c)
{
buf.writestring("catch");
if (c.type)
{
buf.writeByte('(');
typeToBuffer(c.type, c.ident, buf, hgs);
buf.writeByte(')');
}
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
if (c.handler)
c.handler.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
}
private void dsymbolToBuffer(Dsymbol s, OutBuffer* buf, HdrGenState* hgs)
{
scope v = new DsymbolPrettyPrintVisitor(buf, hgs);
s.accept(v);
}
private extern (C++) final class DsymbolPrettyPrintVisitor : Visitor
{
alias visit = Visitor.visit;
public:
OutBuffer* buf;
HdrGenState* hgs;
extern (D) this(OutBuffer* buf, HdrGenState* hgs)
{
this.buf = buf;
this.hgs = hgs;
}
////////////////////////////////////////////////////////////////////////////
override void visit(Dsymbol s)
{
buf.writestring(s.toChars());
}
override void visit(StaticAssert s)
{
buf.writestring(s.kind());
buf.writeByte('(');
s.exp.expressionToBuffer(buf, hgs);
if (s.msgs)
{
foreach (m; (*s.msgs)[])
{
buf.writestring(", ");
m.expressionToBuffer(buf, hgs);
}
}
buf.writestring(");");
buf.writenl();
}
override void visit(DebugSymbol s)
{
buf.writestring("debug = ");
if (s.ident)
buf.writestring(s.ident.toString());
else
buf.print(s.level);
buf.writeByte(';');
buf.writenl();
}
override void visit(VersionSymbol s)
{
buf.writestring("version = ");
if (s.ident)
buf.writestring(s.ident.toString());
else
buf.print(s.level);
buf.writeByte(';');
buf.writenl();
}
override void visit(EnumMember em)
{
if (em.type)
typeToBuffer(em.type, em.ident, buf, hgs);
else
buf.writestring(em.ident.toString());
if (em.value)
{
buf.writestring(" = ");
em.value.expressionToBuffer(buf, hgs);
}
}
override void visit(Import imp)
{
if (hgs.hdrgen && imp.id == Id.object)
return; // object is imported by default
if (imp.isstatic)
buf.writestring("static ");
buf.writestring("import ");
if (imp.aliasId)
{
buf.printf("%s = ", imp.aliasId.toChars());
}
foreach (const pid; imp.packages)
{
buf.printf("%s.", pid.toChars());
}
buf.writestring(imp.id.toString());
if (imp.names.length)
{
buf.writestring(" : ");
foreach (const i, const name; imp.names)
{
if (i)
buf.writestring(", ");
const _alias = imp.aliases[i];
if (_alias)
buf.printf("%s = %s", _alias.toChars(), name.toChars());
else
buf.writestring(name.toChars());
}
}
buf.writeByte(';');
buf.writenl();
}
override void visit(AliasThis d)
{
buf.writestring("alias ");
buf.writestring(d.ident.toString());
buf.writestring(" this;\n");
}
override void visit(AttribDeclaration d)
{
bool hasSTC;
if (auto stcd = d.isStorageClassDeclaration)
{
hasSTC = stcToBuffer(buf, stcd.stc);
}
if (!d.decl)
{
buf.writeByte(';');
buf.writenl();
return;
}
if (d.decl.length == 0 || (hgs.hdrgen && d.decl.length == 1 && (*d.decl)[0].isUnitTestDeclaration()))
{
// hack for bugzilla 8081
if (hasSTC) buf.writeByte(' ');
buf.writestring("{}");
}
else if (d.decl.length == 1)
{
if (hasSTC) buf.writeByte(' ');
(*d.decl)[0].accept(this);
return;
}
else
{
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (de; *d.decl)
de.accept(this);
buf.level--;
buf.writeByte('}');
}
buf.writenl();
}
override void visit(StorageClassDeclaration d)
{
visit(cast(AttribDeclaration)d);
}
override void visit(DeprecatedDeclaration d)
{
buf.writestring("deprecated(");
d.msg.expressionToBuffer(buf, hgs);
buf.writestring(") ");
visit(cast(AttribDeclaration)d);
}
override void visit(LinkDeclaration d)
{
buf.writestring("extern (");
buf.writestring(linkageToString(d.linkage));
buf.writestring(") ");
visit(cast(AttribDeclaration)d);
}
override void visit(CPPMangleDeclaration d)
{
string s;
final switch (d.cppmangle)
{
case CPPMANGLE.asClass:
s = "class";
break;
case CPPMANGLE.asStruct:
s = "struct";
break;
case CPPMANGLE.def:
break;
}
buf.writestring("extern (C++, ");
buf.writestring(s);
buf.writestring(") ");
visit(cast(AttribDeclaration)d);
}
override void visit(VisibilityDeclaration d)
{
visibilityToBuffer(buf, d.visibility);
AttribDeclaration ad = cast(AttribDeclaration)d;
if (ad.decl.length <= 1)
buf.writeByte(' ');
if (ad.decl.length == 1 && (*ad.decl)[0].isVisibilityDeclaration)
visit(cast(AttribDeclaration)(*ad.decl)[0]);
else
visit(cast(AttribDeclaration)d);
}
override void visit(AlignDeclaration d)
{
if (d.exps)
{
foreach (i, exp; (*d.exps)[])
{
if (i)
buf.writeByte(' ');
buf.printf("align (%s)", exp.toChars());
}
if (d.decl && d.decl.length < 2)
buf.writeByte(' ');
}
else
buf.writestring("align ");
visit(d.isAttribDeclaration());
}
override void visit(AnonDeclaration d)
{
buf.writestring(d.isunion ? "union" : "struct");
buf.writenl();
buf.writestring("{");
buf.writenl();
buf.level++;
if (d.decl)
{
foreach (de; *d.decl)
de.accept(this);
}
buf.level--;
buf.writestring("}");
buf.writenl();
}
override void visit(PragmaDeclaration d)
{
buf.writestring("pragma (");
buf.writestring(d.ident.toString());
if (d.args && d.args.length)
{
buf.writestring(", ");
argsToBuffer(d.args, buf, hgs);
}
buf.writeByte(')');
// https://issues.dlang.org/show_bug.cgi?id=14690
// Unconditionally perform a full output dump
// for `pragma(inline)` declarations.
bool savedFullDump = global.params.dihdr.fullOutput;
if (d.ident == Id.Pinline)
global.params.dihdr.fullOutput = true;
visit(cast(AttribDeclaration)d);
global.params.dihdr.fullOutput = savedFullDump;
}
override void visit(ConditionalDeclaration d)
{
d.condition.conditionToBuffer(buf, hgs);
if (d.decl || d.elsedecl)
{
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
if (d.decl)
{
foreach (de; *d.decl)
de.accept(this);
}
buf.level--;
buf.writeByte('}');
if (d.elsedecl)
{
buf.writenl();
buf.writestring("else");
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (de; *d.elsedecl)
de.accept(this);
buf.level--;
buf.writeByte('}');
}
}
else
buf.writeByte(':');
buf.writenl();
}
override void visit(StaticForeachDeclaration s)
{
void foreachWithoutBody(ForeachStatement s)
{
buf.writestring(Token.toString(s.op));
buf.writestring(" (");
foreach (i, p; *s.parameters)
{
if (i)
buf.writestring(", ");
if (stcToBuffer(buf, p.storageClass))
buf.writeByte(' ');
if (p.type)
typeToBuffer(p.type, p.ident, buf, hgs);
else
buf.writestring(p.ident.toString());
}
buf.writestring("; ");
s.aggr.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
}
void foreachRangeWithoutBody(ForeachRangeStatement s)
{
/* s.op ( prm ; lwr .. upr )
*/
buf.writestring(Token.toString(s.op));
buf.writestring(" (");
if (s.prm.type)
typeToBuffer(s.prm.type, s.prm.ident, buf, hgs);
else
buf.writestring(s.prm.ident.toString());
buf.writestring("; ");
s.lwr.expressionToBuffer(buf, hgs);
buf.writestring(" .. ");
s.upr.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
}
buf.writestring("static ");
if (s.sfe.aggrfe)
{
foreachWithoutBody(s.sfe.aggrfe);
}
else
{
assert(s.sfe.rangefe);
foreachRangeWithoutBody(s.sfe.rangefe);
}
buf.writeByte('{');
buf.writenl();
buf.level++;
visit(cast(AttribDeclaration)s);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
override void visit(CompileDeclaration d)
{
buf.writestring("mixin(");
argsToBuffer(d.exps, buf, hgs, null);
buf.writestring(");");
buf.writenl();
}
override void visit(UserAttributeDeclaration d)
{
buf.writestring("@(");
argsToBuffer(d.atts, buf, hgs);
buf.writeByte(')');
visit(cast(AttribDeclaration)d);
}
override void visit(TemplateDeclaration d)
{
version (none)
{
// Should handle template functions for doc generation
if (onemember && onemember.isFuncDeclaration())
buf.writestring("foo ");
}
if ((hgs.hdrgen || hgs.fullDump) && visitEponymousMember(d))
return;
if (hgs.ddoc)
buf.writestring(d.kind());
else
buf.writestring("template");
buf.writeByte(' ');
buf.writestring(d.ident.toString());
buf.writeByte('(');
visitTemplateParameters(hgs.ddoc ? d.origParameters : d.parameters);
buf.writeByte(')');
visitTemplateConstraint(d.constraint);
if (hgs.hdrgen || hgs.fullDump)
{
hgs.tpltMember++;
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (s; *d.members)
s.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
hgs.tpltMember--;
}
}
bool visitEponymousMember(TemplateDeclaration d)
{
if (!d.members || d.members.length != 1)
return false;
Dsymbol onemember = (*d.members)[0];
if (onemember.ident != d.ident)
return false;
if (FuncDeclaration fd = onemember.isFuncDeclaration())
{
assert(fd.type);
if (stcToBuffer(buf, fd.storage_class))
buf.writeByte(' ');
functionToBufferFull(cast(TypeFunction)fd.type, buf, d.ident, hgs, d);
visitTemplateConstraint(d.constraint);
hgs.tpltMember++;
bodyToBuffer(fd);
hgs.tpltMember--;
return true;
}
if (AggregateDeclaration ad = onemember.isAggregateDeclaration())
{
buf.writestring(ad.kind());
buf.writeByte(' ');
buf.writestring(ad.ident.toString());
buf.writeByte('(');
visitTemplateParameters(hgs.ddoc ? d.origParameters : d.parameters);
buf.writeByte(')');
visitTemplateConstraint(d.constraint);
visitBaseClasses(ad.isClassDeclaration());
hgs.tpltMember++;
if (ad.members)
{
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (s; *ad.members)
s.accept(this);
buf.level--;
buf.writeByte('}');
}
else
buf.writeByte(';');
buf.writenl();
hgs.tpltMember--;
return true;
}
if (VarDeclaration vd = onemember.isVarDeclaration())
{
if (d.constraint)
return false;
if (stcToBuffer(buf, vd.storage_class))
buf.writeByte(' ');
if (vd.type)
typeToBuffer(vd.type, vd.ident, buf, hgs);
else
buf.writestring(vd.ident.toString());
buf.writeByte('(');
visitTemplateParameters(hgs.ddoc ? d.origParameters : d.parameters);
buf.writeByte(')');
if (vd._init)
{
buf.writestring(" = ");
ExpInitializer ie = vd._init.isExpInitializer();
if (ie && (ie.exp.op == EXP.construct || ie.exp.op == EXP.blit))
(cast(AssignExp)ie.exp).e2.expressionToBuffer(buf, hgs);
else
vd._init.initializerToBuffer(buf, hgs);
}
buf.writeByte(';');
buf.writenl();
return true;
}
return false;
}
void visitTemplateParameters(TemplateParameters* parameters)
{
if (!parameters || !parameters.length)
return;
foreach (i, p; *parameters)
{
if (i)
buf.writestring(", ");
p.templateParameterToBuffer(buf, hgs);
}
}
void visitTemplateConstraint(Expression constraint)
{
if (!constraint)
return;
buf.writestring(" if (");
constraint.expressionToBuffer(buf, hgs);
buf.writeByte(')');
}
override void visit(TemplateInstance ti)
{
buf.writestring(ti.name.toChars());
tiargsToBuffer(ti, buf, hgs);
if (hgs.fullDump)
{
buf.writenl();
dumpTemplateInstance(ti, buf, hgs);
}
}
override void visit(TemplateMixin tm)
{
buf.writestring("mixin ");
typeToBuffer(tm.tqual, null, buf, hgs);
tiargsToBuffer(tm, buf, hgs);
if (tm.ident && memcmp(tm.ident.toChars(), cast(const(char)*)"__mixin", 7) != 0)
{
buf.writeByte(' ');
buf.writestring(tm.ident.toString());
}
buf.writeByte(';');
buf.writenl();
if (hgs.fullDump)
dumpTemplateInstance(tm, buf, hgs);
}
override void visit(EnumDeclaration d)
{
auto oldInEnumDecl = hgs.inEnumDecl;
scope(exit) hgs.inEnumDecl = oldInEnumDecl;
hgs.inEnumDecl = d;
buf.writestring("enum ");
if (d.ident)
{
buf.writestring(d.ident.toString());
}
if (d.memtype)
{
buf.writestring(" : ");
typeToBuffer(d.memtype, null, buf, hgs);
}
if (!d.members)
{
buf.writeByte(';');
buf.writenl();
return;
}
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (em; *d.members)
{
if (!em)
continue;
em.accept(this);
buf.writeByte(',');
buf.writenl();
}
buf.level--;
buf.writeByte('}');
buf.writenl();
}
override void visit(Nspace d)
{
buf.writestring("extern (C++, ");
buf.writestring(d.ident.toString());
buf.writeByte(')');
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (s; *d.members)
s.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
override void visit(StructDeclaration d)
{
buf.writestring(d.kind());
buf.writeByte(' ');
if (!d.isAnonymous())
buf.writestring(d.toChars());
if (!d.members)
{
buf.writeByte(';');
buf.writenl();
return;
}
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (s; *d.members)
s.accept(this);
buf.level--;
buf.writeByte('}');
buf.writenl();
}
override void visit(ClassDeclaration d)
{
if (!d.isAnonymous())
{
buf.writestring(d.kind());
buf.writeByte(' ');
buf.writestring(d.ident.toString());
}
visitBaseClasses(d);
if (d.members)
{
buf.writenl();
buf.writeByte('{');
buf.writenl();
buf.level++;
foreach (s; *d.members)
s.accept(this);
buf.level--;
buf.writeByte('}');
}
else
buf.writeByte(';');
buf.writenl();
}
void visitBaseClasses(ClassDeclaration d)
{
if (!d || !d.baseclasses.length)
return;
if (!d.isAnonymous())
buf.writestring(" : ");
foreach (i, b; *d.baseclasses)
{
if (i)
buf.writestring(", ");
typeToBuffer(b.type, null, buf, hgs);
}
}
override void visit(AliasDeclaration d)
{
if (d.storage_class & STC.local)
return;
buf.writestring("alias ");
if (d.aliassym)
{
buf.writestring(d.ident.toString());
buf.writestring(" = ");
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
/*
https://issues.dlang.org/show_bug.cgi?id=23223
https://issues.dlang.org/show_bug.cgi?id=23222
This special case (initially just for modules) avoids some segfaults
and nicer -vcg-ast output.
*/
if (d.aliassym.isModule())
{
buf.writestring(d.aliassym.ident.toString());
}
else
{
d.aliassym.accept(this);
}
}
else if (d.type.ty == Tfunction)
{
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
typeToBuffer(d.type, d.ident, buf, hgs);
}
else if (d.ident)
{
hgs.declstring = (d.ident == Id.string || d.ident == Id.wstring || d.ident == Id.dstring);
buf.writestring(d.ident.toString());
buf.writestring(" = ");
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
typeToBuffer(d.type, null, buf, hgs);
hgs.declstring = false;
}
buf.writeByte(';');
buf.writenl();
}
override void visit(AliasAssign d)
{
buf.writestring(d.ident.toString());
buf.writestring(" = ");
if (d.aliassym)
d.aliassym.accept(this);
else // d.type
typeToBuffer(d.type, null, buf, hgs);
buf.writeByte(';');
buf.writenl();
}
override void visit(VarDeclaration d)
{
if (d.storage_class & STC.local)
return;
visitVarDecl(d, false);
buf.writeByte(';');
buf.writenl();
}
void visitVarDecl(VarDeclaration v, bool anywritten)
{
if (anywritten)
{
buf.writestring(", ");
buf.writestring(v.ident.toString());
}
else
{
if (stcToBuffer(buf, v.storage_class))
buf.writeByte(' ');
if (v.type)
typeToBuffer(v.type, v.ident, buf, hgs);
else
buf.writestring(v.ident.toString());
}
if (v._init)
{
buf.writestring(" = ");
auto ie = v._init.isExpInitializer();
if (ie && (ie.exp.op == EXP.construct || ie.exp.op == EXP.blit))
(cast(AssignExp)ie.exp).e2.expressionToBuffer(buf, hgs);
else
v._init.initializerToBuffer(buf, hgs);
}
}
override void visit(FuncDeclaration f)
{
//printf("FuncDeclaration::toCBuffer() '%s'\n", f.toChars());
if (stcToBuffer(buf, f.storage_class))
buf.writeByte(' ');
auto tf = cast(TypeFunction)f.type;
typeToBuffer(tf, f.ident, buf, hgs);
if (hgs.hdrgen)
{
// if the return type is missing (e.g. ref functions or auto)
if (!tf.next || f.storage_class & STC.auto_)
{
hgs.autoMember++;
bodyToBuffer(f);
hgs.autoMember--;
}
else if (hgs.tpltMember == 0 && global.params.dihdr.fullOutput == false && !hgs.insideFuncBody)
{
if (!f.fbody)
{
// this can happen on interfaces / abstract functions, see `allowsContractWithoutBody`
if (f.fensures || f.frequires)
buf.writenl();
contractsToBuffer(f);
}
buf.writeByte(';');
buf.writenl();
}
else
bodyToBuffer(f);
}
else
bodyToBuffer(f);
}
/// Returns: whether `do` is needed to write the function body
bool contractsToBuffer(FuncDeclaration f)
{
bool requireDo = false;
// in{}
if (f.frequires)
{
foreach (frequire; *f.frequires)
{
buf.writestring("in");
if (auto es = frequire.isExpStatement())
{
assert(es.exp && es.exp.op == EXP.assert_);
buf.writestring(" (");
(cast(AssertExp)es.exp).e1.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
requireDo = false;
}
else
{
buf.writenl();
frequire.statementToBuffer(buf, hgs);
requireDo = true;
}
}
}
// out{}
if (f.fensures)
{
foreach (fensure; *f.fensures)
{
buf.writestring("out");
if (auto es = fensure.ensure.isExpStatement())
{
assert(es.exp && es.exp.op == EXP.assert_);
buf.writestring(" (");
if (fensure.id)
{
buf.writestring(fensure.id.toString());
}
buf.writestring("; ");
(cast(AssertExp)es.exp).e1.expressionToBuffer(buf, hgs);
buf.writeByte(')');
buf.writenl();
requireDo = false;
}
else
{
if (fensure.id)
{
buf.writeByte('(');
buf.writestring(fensure.id.toString());
buf.writeByte(')');
}
buf.writenl();
fensure.ensure.statementToBuffer(buf, hgs);
requireDo = true;
}
}
}
return requireDo;
}
void bodyToBuffer(FuncDeclaration f)
{
if (!f.fbody || (hgs.hdrgen && global.params.dihdr.fullOutput == false && !hgs.autoMember && !hgs.tpltMember && !hgs.insideFuncBody))
{
if (!f.fbody && (f.fensures || f.frequires))
{
buf.writenl();
contractsToBuffer(f);
}
buf.writeByte(';');
buf.writenl();
return;
}
// there is no way to know if a function is nested
// or not after parsing. We need scope information
// for that, which is avaible during semantic
// analysis. To overcome that, a simple mechanism
// is implemented: everytime we print a function
// body (templated or not) we increment a counter.
// We decredement the counter when we stop
// printing the function body.
++hgs.insideFuncBody;
scope(exit) { --hgs.insideFuncBody; }
const savetlpt = hgs.tpltMember;
const saveauto = hgs.autoMember;
hgs.tpltMember = 0;
hgs.autoMember = 0;
buf.writenl();
bool requireDo = contractsToBuffer(f);
if (requireDo)
{
buf.writestring("do");
buf.writenl();
}
buf.writeByte('{');
buf.writenl();
buf.level++;
f.fbody.statementToBuffer(buf, hgs);
buf.level--;
buf.writeByte('}');
buf.writenl();
hgs.tpltMember = savetlpt;
hgs.autoMember = saveauto;
}
override void visit(FuncLiteralDeclaration f)
{
if (f.type.ty == Terror)
{
buf.writestring("__error");
return;
}
if (f.tok != TOK.reserved)
{
buf.writestring(f.kind());
buf.writeByte(' ');
}
TypeFunction tf = cast(TypeFunction)f.type;
if (!f.inferRetType && tf.next)
typeToBuffer(tf.next, null, buf, hgs);
parametersToBuffer(tf.parameterList, buf, hgs);
// https://issues.dlang.org/show_bug.cgi?id=20074
void printAttribute(string str)
{
buf.writeByte(' ');
buf.writestring(str);
}
tf.attributesApply(&printAttribute);
CompoundStatement cs = f.fbody.isCompoundStatement();
Statement s1;
if (f.semanticRun >= PASS.semantic3done && cs)
{
s1 = (*cs.statements)[cs.statements.length - 1];
}
else
s1 = !cs ? f.fbody : null;
ReturnStatement rs = s1 ? s1.endsWithReturnStatement() : null;
if (rs && rs.exp)
{
buf.writestring(" => ");
rs.exp.expressionToBuffer(buf, hgs);
}
else
{
hgs.tpltMember++;
bodyToBuffer(f);
hgs.tpltMember--;
}
}
override void visit(PostBlitDeclaration d)
{
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
buf.writestring("this(this)");
bodyToBuffer(d);
}
override void visit(DtorDeclaration d)
{
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
buf.writestring("~this()");
bodyToBuffer(d);
}
override void visit(StaticCtorDeclaration d)
{
if (stcToBuffer(buf, d.storage_class & ~STC.static_))
buf.writeByte(' ');
if (d.isSharedStaticCtorDeclaration())
buf.writestring("shared ");
buf.writestring("static this()");
if (hgs.hdrgen && !hgs.tpltMember)
{
buf.writeByte(';');
buf.writenl();
}
else
bodyToBuffer(d);
}
override void visit(StaticDtorDeclaration d)
{
if (stcToBuffer(buf, d.storage_class & ~STC.static_))
buf.writeByte(' ');
if (d.isSharedStaticDtorDeclaration())
buf.writestring("shared ");
buf.writestring("static ~this()");
if (hgs.hdrgen && !hgs.tpltMember)
{
buf.writeByte(';');
buf.writenl();
}
else
bodyToBuffer(d);
}
override void visit(InvariantDeclaration d)
{
if (hgs.hdrgen)
return;
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
buf.writestring("invariant");
if(auto es = d.fbody.isExpStatement())
{
assert(es.exp && es.exp.op == EXP.assert_);
buf.writestring(" (");
(cast(AssertExp)es.exp).e1.expressionToBuffer(buf, hgs);
buf.writestring(");");
buf.writenl();
}
else
{
bodyToBuffer(d);
}
}
override void visit(UnitTestDeclaration d)
{
if (hgs.hdrgen)
return;
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
buf.writestring("unittest");
bodyToBuffer(d);
}
override void visit(BitFieldDeclaration d)
{
if (stcToBuffer(buf, d.storage_class))
buf.writeByte(' ');
Identifier id = d.isAnonymous() ? null : d.ident;
typeToBuffer(d.type, id, buf, hgs);
buf.writestring(" : ");
d.width.expressionToBuffer(buf, hgs);
buf.writeByte(';');
buf.writenl();
}
override void visit(NewDeclaration d)
{
if (stcToBuffer(buf, d.storage_class & ~STC.static_))
buf.writeByte(' ');
buf.writestring("new();");
}
override void visit(Module m)
{
moduleToBuffer2(m, buf, hgs);
}
}
/*********************************************
* Print expression to buffer.
*/
private void expressionPrettyPrint(Expression e, OutBuffer* buf, HdrGenState* hgs)
{
void visit(Expression e)
{
buf.writestring(EXPtoString(e.op));
}
void visitInteger(IntegerExp e)
{
const dinteger_t v = e.toInteger();
if (e.type)
{
Type t = e.type;
L1:
switch (t.ty)
{
case Tenum:
{
TypeEnum te = cast(TypeEnum)t;
auto sym = te.sym;
if (sym && sym.members && (!hgs.inEnumDecl || hgs.inEnumDecl != sym))
{
foreach (em; *sym.members)
{
if ((cast(EnumMember)em).value.toInteger == v)
{
buf.printf("%s.%s", sym.toChars(), em.ident.toChars());
return ;
}
}
}
buf.printf("cast(%s)", te.sym.toChars());
t = te.sym.memtype;
goto L1;
}
case Tchar:
case Twchar:
case Tdchar:
{
const o = buf.length;
writeSingleCharLiteral(*buf, cast(dchar) v);
if (hgs.ddoc)
escapeDdocString(buf, o);
break;
}
case Tint8:
buf.writestring("cast(byte)");
goto L2;
case Tint16:
buf.writestring("cast(short)");
goto L2;
case Tint32:
L2:
buf.printf("%d", cast(int)v);
break;
case Tuns8:
buf.writestring("cast(ubyte)");
goto case Tuns32;
case Tuns16:
buf.writestring("cast(ushort)");
goto case Tuns32;
case Tuns32:
buf.printf("%uu", cast(uint)v);
break;
case Tint64:
if (v == long.min)
{
// https://issues.dlang.org/show_bug.cgi?id=23173
// This is a special case because - is not part of the
// integer literal and 9223372036854775808L overflows a long
buf.writestring("cast(long)-9223372036854775808");
}
else
{
buf.printf("%lldL", v);
}
break;
case Tuns64:
buf.printf("%lluLU", v);
break;
case Tbool:
buf.writestring(v ? "true" : "false");
break;
case Tpointer:
buf.writestring("cast(");
buf.writestring(t.toChars());
buf.writeByte(')');
if (target.ptrsize == 8)
goto case Tuns64;
else if (target.ptrsize == 4 ||
target.ptrsize == 2)
goto case Tuns32;
else
assert(0);
case Tvoid:
buf.writestring("cast(void)0");
break;
default:
/* This can happen if errors, such as
* the type is painted on like in fromConstInitializer().
*/
if (!global.errors)
{
assert(0);
}
break;
}
}
else if (v & 0x8000000000000000L)
buf.printf("0x%llx", v);
else
buf.print(v);
}
void visitError(ErrorExp e)
{
buf.writestring("__error");
}
void visitVoidInit(VoidInitExp e)
{
buf.writestring("__void");
}
void floatToBuffer(Type type, real_t value)
{
.floatToBuffer(type, value, buf, hgs.hdrgen);
}
void visitReal(RealExp e)
{
floatToBuffer(e.type, e.value);
}
void visitComplex(ComplexExp e)
{
/* Print as:
* (re+imi)
*/
buf.writeByte('(');
floatToBuffer(e.type, creall(e.value));
buf.writeByte('+');
floatToBuffer(e.type, cimagl(e.value));
buf.writestring("i)");
}
void visitIdentifier(IdentifierExp e)
{
if (hgs.hdrgen || hgs.ddoc)
buf.writestring(e.ident.toHChars2());
else
buf.writestring(e.ident.toString());
}
void visitDsymbol(DsymbolExp e)
{
buf.writestring(e.s.toChars());
}
void visitThis(ThisExp e)
{
buf.writestring("this");
}
void visitSuper(SuperExp e)
{
buf.writestring("super");
}
void visitNull(NullExp e)
{
buf.writestring("null");
}
void visitString(StringExp e)
{
buf.writeByte('"');
const o = buf.length;
foreach (i; 0 .. e.len)
{
writeCharLiteral(*buf, e.getCodeUnit(i));
}
if (hgs.ddoc)
escapeDdocString(buf, o);
buf.writeByte('"');
if (e.postfix)
buf.writeByte(e.postfix);
}
void visitArrayLiteral(ArrayLiteralExp e)
{
buf.writeByte('[');
argsToBuffer(e.elements, buf, hgs, e.basis);
buf.writeByte(']');
}
void visitAssocArrayLiteral(AssocArrayLiteralExp e)
{
buf.writeByte('[');
foreach (i, key; *e.keys)
{
if (i)
buf.writestring(", ");
expToBuffer(key, PREC.assign, buf, hgs);
buf.writeByte(':');
auto value = (*e.values)[i];
expToBuffer(value, PREC.assign, buf, hgs);
}
buf.writeByte(']');
}
void visitStructLiteral(StructLiteralExp e)
{
buf.writestring(e.sd.toChars());
buf.writeByte('(');
// CTFE can generate struct literals that contain an AddrExp pointing
// to themselves, need to avoid infinite recursion:
// struct S { this(int){ this.s = &this; } S* s; }
// const foo = new S(0);
if (e.stageflags & stageToCBuffer)
buf.writestring("<recursion>");
else
{
const old = e.stageflags;
e.stageflags |= stageToCBuffer;
argsToBuffer(e.elements, buf, hgs);
e.stageflags = old;
}
buf.writeByte(')');
}
void visitCompoundLiteral(CompoundLiteralExp e)
{
buf.writeByte('(');
typeToBuffer(e.type, null, buf, hgs);
buf.writeByte(')');
e.initializer.initializerToBuffer(buf, hgs);
}
void visitType(TypeExp e)
{
typeToBuffer(e.type, null, buf, hgs);
}
void visitScope(ScopeExp e)
{
if (e.sds.isTemplateInstance())
{
e.sds.dsymbolToBuffer(buf, hgs);
}
else if (hgs !is null && hgs.ddoc)
{
// fixes bug 6491
if (auto m = e.sds.isModule())
buf.writestring(m.md.toChars());
else
buf.writestring(e.sds.toChars());
}
else
{
buf.writestring(e.sds.kind());
buf.writeByte(' ');
buf.writestring(e.sds.toChars());
}
}
void visitTemplate(TemplateExp e)
{
buf.writestring(e.td.toChars());
}
void visitNew(NewExp e)
{
if (e.thisexp)
{
expToBuffer(e.thisexp, PREC.primary, buf, hgs);
buf.writeByte('.');
}
buf.writestring("new ");
typeToBuffer(e.newtype, null, buf, hgs);
if (e.arguments && e.arguments.length)
{
buf.writeByte('(');
argsToBuffer(e.arguments, buf, hgs);
buf.writeByte(')');
}
}
void visitNewAnonClass(NewAnonClassExp e)
{
if (e.thisexp)
{
expToBuffer(e.thisexp, PREC.primary, buf, hgs);
buf.writeByte('.');
}
buf.writestring("new");
buf.writestring(" class ");
if (e.arguments && e.arguments.length)
{
buf.writeByte('(');
argsToBuffer(e.arguments, buf, hgs);
buf.writeByte(')');
}
if (e.cd)
e.cd.dsymbolToBuffer(buf, hgs);
}
void visitSymOff(SymOffExp e)
{
if (e.offset)
buf.printf("(& %s%+lld)", e.var.toChars(), e.offset);
else if (e.var.isTypeInfoDeclaration())
buf.writestring(e.var.toChars());
else
buf.printf("& %s", e.var.toChars());
}
void visitVar(VarExp e)
{
buf.writestring(e.var.toChars());
}
void visitOver(OverExp e)
{
buf.writestring(e.vars.ident.toString());
}
void visitTuple(TupleExp e)
{
if (e.e0)
{
buf.writeByte('(');
e.e0.expressionPrettyPrint(buf, hgs);
buf.writestring(", tuple(");
argsToBuffer(e.exps, buf, hgs);
buf.writestring("))");
}
else
{
buf.writestring("tuple(");
argsToBuffer(e.exps, buf, hgs);
buf.writeByte(')');
}
}
void visitFunc(FuncExp e)
{
e.fd.dsymbolToBuffer(buf, hgs);
//buf.writestring(e.fd.toChars());
}
void visitDeclaration(DeclarationExp e)
{
/* Normal dmd execution won't reach here - regular variable declarations
* are handled in visit(ExpStatement), so here would be used only when
* we'll directly call Expression.toChars() for debugging.
*/
if (e.declaration)
{
if (auto var = e.declaration.isVarDeclaration())
{
// For debugging use:
// - Avoid printing newline.
// - Intentionally use the format (Type var;)
// which isn't correct as regular D code.
buf.writeByte('(');
scope v = new DsymbolPrettyPrintVisitor(buf, hgs);
v.visitVarDecl(var, false);
buf.writeByte(';');
buf.writeByte(')');
}
else e.declaration.dsymbolToBuffer(buf, hgs);
}
}
void visitTypeid(TypeidExp e)
{
buf.writestring("typeid(");
objectToBuffer(e.obj, buf, hgs);
buf.writeByte(')');
}
void visitTraits(TraitsExp e)
{
buf.writestring("__traits(");
if (e.ident)
buf.writestring(e.ident.toString());
if (e.args)
{
foreach (arg; *e.args)
{
buf.writestring(", ");
objectToBuffer(arg, buf, hgs);
}
}
buf.writeByte(')');
}
void visitHalt(HaltExp e)
{
buf.writestring("halt");
}
void visitIs(IsExp e)
{
buf.writestring("is(");
typeToBuffer(e.targ, e.id, buf, hgs);
if (e.tok2 != TOK.reserved)
{
buf.printf(" %s %s", Token.toChars(e.tok), Token.toChars(e.tok2));
}
else if (e.tspec)
{
if (e.tok == TOK.colon)
buf.writestring(" : ");
else
buf.writestring(" == ");
typeToBuffer(e.tspec, null, buf, hgs);
}
if (e.parameters && e.parameters.length)
{
buf.writestring(", ");
scope v = new DsymbolPrettyPrintVisitor(buf, hgs);
v.visitTemplateParameters(e.parameters);
}
buf.writeByte(')');
}
void visitUna(UnaExp e)
{
buf.writestring(EXPtoString(e.op));
expToBuffer(e.e1, precedence[e.op], buf, hgs);
}
void visitBin(BinExp e)
{
expToBuffer(e.e1, precedence[e.op], buf, hgs);
buf.writeByte(' ');
buf.writestring(EXPtoString(e.op));
buf.writeByte(' ');
expToBuffer(e.e2, cast(PREC)(precedence[e.op] + 1), buf, hgs);
}
void visitComma(CommaExp e)
{
// CommaExp is generated by the compiler so it shouldn't
// appear in error messages or header files.
// For now, this treats the case where the compiler
// generates CommaExp for temporaries by calling
// the `sideeffect.copyToTemp` function.
auto ve = e.e2.isVarExp();
// not a CommaExp introduced for temporaries, go on
// the old path
if (!ve || !(ve.var.storage_class & STC.temp))
{
visitBin(cast(BinExp)e);
return;
}
// CommaExp that contain temporaries inserted via
// `copyToTemp` are usually of the form
// ((T __temp = exp), __tmp).
// Asserts are here to easily spot
// missing cases where CommaExp
// are used for other constructs
auto vd = ve.var.isVarDeclaration();
assert(vd && vd._init);
if (auto ei = vd._init.isExpInitializer())
{
Expression commaExtract;
auto exp = ei.exp;
if (auto ce = exp.isConstructExp())
commaExtract = ce.e2;
else if (auto se = exp.isStructLiteralExp())
commaExtract = se;
if (commaExtract)
{
expToBuffer(commaExtract, precedence[exp.op], buf, hgs);
return;
}
}
// not one of the known cases, go on the old path
visitBin(cast(BinExp)e);
return;
}
void visitMixin(MixinExp e)
{
buf.writestring("mixin(");
argsToBuffer(e.exps, buf, hgs, null);
buf.writeByte(')');
}
void visitImport(ImportExp e)
{
buf.writestring("import(");
expToBuffer(e.e1, PREC.assign, buf, hgs);
buf.writeByte(')');
}
void visitAssert(AssertExp e)
{
buf.writestring("assert(");
expToBuffer(e.e1, PREC.assign, buf, hgs);
if (e.msg)
{
buf.writestring(", ");
expToBuffer(e.msg, PREC.assign, buf, hgs);
}
buf.writeByte(')');
}
void visitThrow(ThrowExp e)
{
buf.writestring("throw ");
expToBuffer(e.e1, PREC.unary, buf, hgs);
}
void visitDotId(DotIdExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
if (e.arrow)
buf.writestring("->");
else
buf.writeByte('.');
buf.writestring(e.ident.toString());
}
void visitDotTemplate(DotTemplateExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('.');
buf.writestring(e.td.toChars());
}
void visitDotVar(DotVarExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('.');
buf.writestring(e.var.toChars());
}
void visitDotTemplateInstance(DotTemplateInstanceExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('.');
e.ti.dsymbolToBuffer(buf, hgs);
}
void visitDelegate(DelegateExp e)
{
buf.writeByte('&');
if (!e.func.isNested() || e.func.needThis())
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('.');
}
buf.writestring(e.func.toChars());
}
void visitDotType(DotTypeExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('.');
buf.writestring(e.sym.toChars());
}
void visitCall(CallExp e)
{
if (e.e1.op == EXP.type)
{
/* Avoid parens around type to prevent forbidden cast syntax:
* (sometype)(arg1)
* This is ok since types in constructor calls
* can never depend on parens anyway
*/
e.e1.expressionPrettyPrint(buf, hgs);
}
else
expToBuffer(e.e1, precedence[e.op], buf, hgs);
buf.writeByte('(');
argsToBuffer(e.arguments, buf, hgs);
buf.writeByte(')');
}
void visitPtr(PtrExp e)
{
buf.writeByte('*');
expToBuffer(e.e1, precedence[e.op], buf, hgs);
}
void visitDelete(DeleteExp e)
{
buf.writestring("delete ");
expToBuffer(e.e1, precedence[e.op], buf, hgs);
}
void visitCast(CastExp e)
{
buf.writestring("cast(");
if (e.to)
typeToBuffer(e.to, null, buf, hgs);
else
{
MODtoBuffer(buf, e.mod);
}
buf.writeByte(')');
expToBuffer(e.e1, precedence[e.op], buf, hgs);
}
void visitVector(VectorExp e)
{
buf.writestring("cast(");
typeToBuffer(e.to, null, buf, hgs);
buf.writeByte(')');
expToBuffer(e.e1, precedence[e.op], buf, hgs);
}
void visitVectorArray(VectorArrayExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writestring(".array");
}
void visitSlice(SliceExp e)
{
expToBuffer(e.e1, precedence[e.op], buf, hgs);
buf.writeByte('[');
if (e.upr || e.lwr)
{
if (e.lwr)
sizeToBuffer(e.lwr, buf, hgs);
else
buf.writeByte('0');
buf.writestring("..");
if (e.upr)
sizeToBuffer(e.upr, buf, hgs);
else
buf.writeByte('$');
}
buf.writeByte(']');
}
void visitArrayLength(ArrayLengthExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writestring(".length");
}
void visitInterval(IntervalExp e)
{
expToBuffer(e.lwr, PREC.assign, buf, hgs);
buf.writestring("..");
expToBuffer(e.upr, PREC.assign, buf, hgs);
}
void visitDelegatePtr(DelegatePtrExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writestring(".ptr");
}
void visitDelegateFuncptr(DelegateFuncptrExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writestring(".funcptr");
}
void visitArray(ArrayExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('[');
argsToBuffer(e.arguments, buf, hgs);
buf.writeByte(']');
}
void visitDot(DotExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('.');
expToBuffer(e.e2, PREC.primary, buf, hgs);
}
void visitIndex(IndexExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writeByte('[');
sizeToBuffer(e.e2, buf, hgs);
buf.writeByte(']');
}
void visitPost(PostExp e)
{
expToBuffer(e.e1, precedence[e.op], buf, hgs);
buf.writestring(EXPtoString(e.op));
}
void visitPre(PreExp e)
{
buf.writestring(EXPtoString(e.op));
expToBuffer(e.e1, precedence[e.op], buf, hgs);
}
void visitRemove(RemoveExp e)
{
expToBuffer(e.e1, PREC.primary, buf, hgs);
buf.writestring(".remove(");
expToBuffer(e.e2, PREC.assign, buf, hgs);
buf.writeByte(')');
}
void visitCond(CondExp e)
{
expToBuffer(e.econd, PREC.oror, buf, hgs);
buf.writestring(" ? ");
expToBuffer(e.e1, PREC.expr, buf, hgs);
buf.writestring(" : ");
expToBuffer(e.e2, PREC.cond, buf, hgs);
}
void visitDefaultInit(DefaultInitExp e)
{
buf.writestring(EXPtoString(e.op));
}
void visitClassReference(ClassReferenceExp e)
{
buf.writestring(e.value.toChars());
}
switch (e.op)
{
default:
if (auto be = e.isBinExp())
return visitBin(be);
else if (auto ue = e.isUnaExp())
return visitUna(ue);
else if (auto de = e.isDefaultInitExp())
return visitDefaultInit(e.isDefaultInitExp());
return visit(e);
case EXP.int64: return visitInteger(e.isIntegerExp());
case EXP.error: return visitError(e.isErrorExp());
case EXP.void_: return visitVoidInit(e.isVoidInitExp());
case EXP.float64: return visitReal(e.isRealExp());
case EXP.complex80: return visitComplex(e.isComplexExp());
case EXP.identifier: return visitIdentifier(e.isIdentifierExp());
case EXP.dSymbol: return visitDsymbol(e.isDsymbolExp());
case EXP.this_: return visitThis(e.isThisExp());
case EXP.super_: return visitSuper(e.isSuperExp());
case EXP.null_: return visitNull(e.isNullExp());
case EXP.string_: return visitString(e.isStringExp());
case EXP.arrayLiteral: return visitArrayLiteral(e.isArrayLiteralExp());
case EXP.assocArrayLiteral: return visitAssocArrayLiteral(e.isAssocArrayLiteralExp());
case EXP.structLiteral: return visitStructLiteral(e.isStructLiteralExp());
case EXP.compoundLiteral: return visitCompoundLiteral(e.isCompoundLiteralExp());
case EXP.type: return visitType(e.isTypeExp());
case EXP.scope_: return visitScope(e.isScopeExp());
case EXP.template_: return visitTemplate(e.isTemplateExp());
case EXP.new_: return visitNew(e.isNewExp());
case EXP.newAnonymousClass: return visitNewAnonClass(e.isNewAnonClassExp());
case EXP.symbolOffset: return visitSymOff(e.isSymOffExp());
case EXP.variable: return visitVar(e.isVarExp());
case EXP.overloadSet: return visitOver(e.isOverExp());
case EXP.tuple: return visitTuple(e.isTupleExp());
case EXP.function_: return visitFunc(e.isFuncExp());
case EXP.declaration: return visitDeclaration(e.isDeclarationExp());
case EXP.typeid_: return visitTypeid(e.isTypeidExp());
case EXP.traits: return visitTraits(e.isTraitsExp());
case EXP.halt: return visitHalt(e.isHaltExp());
case EXP.is_: return visitIs(e.isExp());
case EXP.comma: return visitComma(e.isCommaExp());
case EXP.mixin_: return visitMixin(e.isMixinExp());
case EXP.import_: return visitImport(e.isImportExp());
case EXP.assert_: return visitAssert(e.isAssertExp());
case EXP.throw_: return visitThrow(e.isThrowExp());
case EXP.dotIdentifier: return visitDotId(e.isDotIdExp());
case EXP.dotTemplateDeclaration: return visitDotTemplate(e.isDotTemplateExp());
case EXP.dotVariable: return visitDotVar(e.isDotVarExp());
case EXP.dotTemplateInstance: return visitDotTemplateInstance(e.isDotTemplateInstanceExp());
case EXP.delegate_: return visitDelegate(e.isDelegateExp());
case EXP.dotType: return visitDotType(e.isDotTypeExp());
case EXP.call: return visitCall(e.isCallExp());
case EXP.star: return visitPtr(e.isPtrExp());
case EXP.delete_: return visitDelete(e.isDeleteExp());
case EXP.cast_: return visitCast(e.isCastExp());
case EXP.vector: return visitVector(e.isVectorExp());
case EXP.vectorArray: return visitVectorArray(e.isVectorArrayExp());
case EXP.slice: return visitSlice(e.isSliceExp());
case EXP.arrayLength: return visitArrayLength(e.isArrayLengthExp());
case EXP.interval: return visitInterval(e.isIntervalExp());
case EXP.delegatePointer: return visitDelegatePtr(e.isDelegatePtrExp());
case EXP.delegateFunctionPointer: return visitDelegateFuncptr(e.isDelegateFuncptrExp());
case EXP.array: return visitArray(e.isArrayExp());
case EXP.dot: return visitDot(e.isDotExp());
case EXP.index: return visitIndex(e.isIndexExp());
case EXP.minusMinus:
case EXP.plusPlus: return visitPost(e.isPostExp());
case EXP.preMinusMinus:
case EXP.prePlusPlus: return visitPre(e.isPreExp());
case EXP.remove: return visitRemove(e.isRemoveExp());
case EXP.question: return visitCond(e.isCondExp());
case EXP.classReference: return visitClassReference(e.isClassReferenceExp());
}
}
/**
* Formats `value` as a literal of type `type` into `buf`.
*
* Params:
* type = literal type (e.g. Tfloat)
* value = value to print
* buf = target buffer
* allowHex = whether hex floating point literals may be used
* for greater accuracy
*/
void floatToBuffer(Type type, const real_t value, OutBuffer* buf, const bool allowHex)
{
/** sizeof(value)*3 is because each byte of mantissa is max
of 256 (3 characters). The string will be "-M.MMMMe-4932".
(ie, 8 chars more than mantissa). Plus one for trailing \0.
Plus one for rounding. */
const(size_t) BUFFER_LEN = value.sizeof * 3 + 8 + 1 + 1;
char[BUFFER_LEN] buffer = void;
CTFloat.sprint(buffer.ptr, 'g', value);
assert(strlen(buffer.ptr) < BUFFER_LEN);
if (allowHex)
{
bool isOutOfRange;
real_t r = CTFloat.parse(buffer.ptr, isOutOfRange);
//assert(!isOutOfRange); // test/compilable/test22725.c asserts here
if (r != value) // if exact duplication
CTFloat.sprint(buffer.ptr, 'a', value);
}
buf.writestring(buffer.ptr);
if (buffer.ptr[strlen(buffer.ptr) - 1] == '.')
buf.remove(buf.length() - 1, 1);
if (type)
{
Type t = type.toBasetype();
switch (t.ty)
{
case Tfloat32:
case Timaginary32:
case Tcomplex32:
buf.writeByte('F');
break;
case Tfloat80:
case Timaginary80:
case Tcomplex80:
buf.writeByte('L');
break;
default:
break;
}
if (t.isimaginary())
buf.writeByte('i');
}
}
private void templateParameterToBuffer(TemplateParameter tp, OutBuffer* buf, HdrGenState* hgs)
{
scope v = new TemplateParameterPrettyPrintVisitor(buf, hgs);
tp.accept(v);
}
private extern (C++) final class TemplateParameterPrettyPrintVisitor : Visitor
{
alias visit = Visitor.visit;
public:
OutBuffer* buf;
HdrGenState* hgs;
extern (D) this(OutBuffer* buf, HdrGenState* hgs)
{
this.buf = buf;
this.hgs = hgs;
}
override void visit(TemplateTypeParameter tp)
{
buf.writestring(tp.ident.toString());
if (tp.specType)
{
buf.writestring(" : ");
typeToBuffer(tp.specType, null, buf, hgs);
}
if (tp.defaultType)
{
buf.writestring(" = ");
typeToBuffer(tp.defaultType, null, buf, hgs);
}
}
override void visit(TemplateThisParameter tp)
{
buf.writestring("this ");
visit(cast(TemplateTypeParameter)tp);
}
override void visit(TemplateAliasParameter tp)
{
buf.writestring("alias ");
if (tp.specType)
typeToBuffer(tp.specType, tp.ident, buf, hgs);
else
buf.writestring(tp.ident.toString());
if (tp.specAlias)
{
buf.writestring(" : ");
objectToBuffer(tp.specAlias, buf, hgs);
}
if (tp.defaultAlias)
{
buf.writestring(" = ");
objectToBuffer(tp.defaultAlias, buf, hgs);
}
}
override void visit(TemplateValueParameter tp)
{
typeToBuffer(tp.valType, tp.ident, buf, hgs);
if (tp.specValue)
{
buf.writestring(" : ");
tp.specValue.expressionToBuffer(buf, hgs);
}
if (tp.defaultValue)
{
buf.writestring(" = ");
tp.defaultValue.expressionToBuffer(buf, hgs);
}
}
override void visit(TemplateTupleParameter tp)
{
buf.writestring(tp.ident.toString());
buf.writestring("...");
}
}
private void conditionToBuffer(Condition c, OutBuffer* buf, HdrGenState* hgs)
{
scope v = new ConditionPrettyPrintVisitor(buf, hgs);
c.accept(v);
}
private extern (C++) final class ConditionPrettyPrintVisitor : Visitor
{
alias visit = Visitor.visit;
public:
OutBuffer* buf;
HdrGenState* hgs;
extern (D) this(OutBuffer* buf, HdrGenState* hgs)
{
this.buf = buf;
this.hgs = hgs;
}
override void visit(DebugCondition c)
{
buf.writestring("debug (");
if (c.ident)
buf.writestring(c.ident.toString());
else
buf.print(c.level);
buf.writeByte(')');
}
override void visit(VersionCondition c)
{
buf.writestring("version (");
if (c.ident)
buf.writestring(c.ident.toString());
else
buf.print(c.level);
buf.writeByte(')');
}
override void visit(StaticIfCondition c)
{
buf.writestring("static if (");
c.exp.expressionToBuffer(buf, hgs);
buf.writeByte(')');
}
}
void toCBuffer(const Statement s, OutBuffer* buf, HdrGenState* hgs)
{
scope v = new StatementPrettyPrintVisitor(buf, hgs);
(cast() s).accept(v);
}
void toCBuffer(const Type t, OutBuffer* buf, const Identifier ident, HdrGenState* hgs)
{
typeToBuffer(cast() t, ident, buf, hgs);
}
void toCBuffer(Dsymbol s, OutBuffer* buf, HdrGenState* hgs)
{
scope v = new DsymbolPrettyPrintVisitor(buf, hgs);
s.accept(v);
}
// used from TemplateInstance::toChars() and TemplateMixin::toChars()
void toCBufferInstance(const TemplateInstance ti, OutBuffer* buf, bool qualifyTypes = false)
{
HdrGenState hgs;
hgs.fullQual = qualifyTypes;
scope v = new DsymbolPrettyPrintVisitor(buf, &hgs);
v.visit(cast() ti);
}
void toCBuffer(const Initializer iz, OutBuffer* buf, HdrGenState* hgs)
{
initializerToBuffer(cast() iz, buf, hgs);
}
bool stcToBuffer(OutBuffer* buf, StorageClass stc)
{
//printf("stc: %llx\n", stc);
bool result = false;
if (stc & STC.scopeinferred)
{
//buf.writestring("scope-inferred ");
stc &= ~(STC.scope_ | STC.scopeinferred);
}
if (stc & STC.returninferred)
{
//buf.writestring((stc & STC.returnScope) ? "return-scope-inferred " : "return-ref-inferred ");
stc &= ~(STC.return_ | STC.returninferred);
}
/* Put scope ref return into a standard order
*/
string rrs;
const isout = (stc & STC.out_) != 0;
//printf("bsr = %d %llx\n", buildScopeRef(stc), stc);
final switch (buildScopeRef(stc))
{
case ScopeRef.None:
case ScopeRef.Scope:
case ScopeRef.Ref:
case ScopeRef.Return:
break;
case ScopeRef.ReturnScope: rrs = "return scope"; goto L1;
case ScopeRef.ReturnRef: rrs = isout ? "return out" : "return ref"; goto L1;
case ScopeRef.RefScope: rrs = isout ? "out scope" : "ref scope"; goto L1;
case ScopeRef.ReturnRef_Scope: rrs = isout ? "return out scope" : "return ref scope"; goto L1;
case ScopeRef.Ref_ReturnScope: rrs = isout ? "out return scope" : "ref return scope"; goto L1;
L1:
buf.writestring(rrs);
result = true;
stc &= ~(STC.out_ | STC.scope_ | STC.ref_ | STC.return_);
break;
}
while (stc)
{
const s = stcToString(stc);
if (!s.length)
break;
if (result)
buf.writeByte(' ');
result = true;
buf.writestring(s);
}
return result;
}
/*************************************************
* Pick off one of the storage classes from stc,
* and return a string representation of it.
* stc is reduced by the one picked.
*/
string stcToString(ref StorageClass stc)
{
static struct SCstring
{
StorageClass stc;
string id;
}
// Note: The identifier needs to be `\0` terminated
// as some code assumes it (e.g. when printing error messages)
static immutable SCstring[] table =
[
SCstring(STC.auto_, Token.toString(TOK.auto_)),
SCstring(STC.scope_, Token.toString(TOK.scope_)),
SCstring(STC.static_, Token.toString(TOK.static_)),
SCstring(STC.extern_, Token.toString(TOK.extern_)),
SCstring(STC.const_, Token.toString(TOK.const_)),
SCstring(STC.final_, Token.toString(TOK.final_)),
SCstring(STC.abstract_, Token.toString(TOK.abstract_)),
SCstring(STC.synchronized_, Token.toString(TOK.synchronized_)),
SCstring(STC.deprecated_, Token.toString(TOK.deprecated_)),
SCstring(STC.override_, Token.toString(TOK.override_)),
SCstring(STC.lazy_, Token.toString(TOK.lazy_)),
SCstring(STC.alias_, Token.toString(TOK.alias_)),
SCstring(STC.out_, Token.toString(TOK.out_)),
SCstring(STC.in_, Token.toString(TOK.in_)),
SCstring(STC.manifest, Token.toString(TOK.enum_)),
SCstring(STC.immutable_, Token.toString(TOK.immutable_)),
SCstring(STC.shared_, Token.toString(TOK.shared_)),
SCstring(STC.nothrow_, Token.toString(TOK.nothrow_)),
SCstring(STC.wild, Token.toString(TOK.inout_)),
SCstring(STC.pure_, Token.toString(TOK.pure_)),
SCstring(STC.ref_, Token.toString(TOK.ref_)),
SCstring(STC.return_, Token.toString(TOK.return_)),
SCstring(STC.gshared, Token.toString(TOK.gshared)),
SCstring(STC.nogc, "@nogc"),
SCstring(STC.live, "@live"),
SCstring(STC.property, "@property"),
SCstring(STC.safe, "@safe"),
SCstring(STC.trusted, "@trusted"),
SCstring(STC.system, "@system"),
SCstring(STC.disable, "@disable"),
SCstring(STC.future, "@__future"),
SCstring(STC.local, "__local"),
];
foreach (ref entry; table)
{
const StorageClass tbl = entry.stc;
assert(tbl & STC.visibleStorageClasses);
if (stc & tbl)
{
stc &= ~tbl;
return entry.id;
}
}
//printf("stc = %llx\n", stc);
return null;
}
private void linkageToBuffer(OutBuffer* buf, LINK linkage)
{
const s = linkageToString(linkage);
if (s.length)
{
buf.writestring("extern (");
buf.writestring(s);
buf.writeByte(')');
}
}
const(char)* linkageToChars(LINK linkage)
{
/// Works because we return a literal
return linkageToString(linkage).ptr;
}
string linkageToString(LINK linkage) pure nothrow
{
final switch (linkage)
{
case LINK.default_:
return null;
case LINK.d:
return "D";
case LINK.c:
return "C";
case LINK.cpp:
return "C++";
case LINK.windows:
return "Windows";
case LINK.objc:
return "Objective-C";
case LINK.system:
return "System";
}
}
void visibilityToBuffer(OutBuffer* buf, Visibility vis)
{
buf.writestring(visibilityToString(vis.kind));
if (vis.kind == Visibility.Kind.package_ && vis.pkg)
{
buf.writeByte('(');
buf.writestring(vis.pkg.toPrettyChars(true));
buf.writeByte(')');
}
}
/**
* Returns:
* a human readable representation of `kind`
*/
const(char)* visibilityToChars(Visibility.Kind kind)
{
// Null terminated because we return a literal
return visibilityToString(kind).ptr;
}
/// Ditto
extern (D) string visibilityToString(Visibility.Kind kind) nothrow pure
{
final switch (kind)
{
case Visibility.Kind.undefined:
return null;
case Visibility.Kind.none:
return "none";
case Visibility.Kind.private_:
return "private";
case Visibility.Kind.package_:
return "package";
case Visibility.Kind.protected_:
return "protected";
case Visibility.Kind.public_:
return "public";
case Visibility.Kind.export_:
return "export";
}
}
// Print the full function signature with correct ident, attributes and template args
void functionToBufferFull(TypeFunction tf, OutBuffer* buf, const Identifier ident, HdrGenState* hgs, TemplateDeclaration td)
{
//printf("TypeFunction::toCBuffer() this = %p\n", this);
visitFuncIdentWithPrefix(tf, ident, td, buf, hgs);
}
// ident is inserted before the argument list and will be "function" or "delegate" for a type
void functionToBufferWithIdent(TypeFunction tf, OutBuffer* buf, const(char)* ident, bool isStatic)
{
HdrGenState hgs;
visitFuncIdentWithPostfix(tf, ident.toDString(), buf, &hgs, isStatic);
}
void toCBuffer(const Expression e, OutBuffer* buf, HdrGenState* hgs)
{
expressionPrettyPrint(cast()e, buf, hgs);
}
/**************************************************
* Write out argument types to buf.
*/
void argExpTypesToCBuffer(OutBuffer* buf, Expressions* arguments)
{
if (!arguments || !arguments.length)
return;
HdrGenState hgs;
foreach (i, arg; *arguments)
{
if (i)
buf.writestring(", ");
typeToBuffer(arg.type, null, buf, &hgs);
}
}
void toCBuffer(const TemplateParameter tp, OutBuffer* buf, HdrGenState* hgs)
{
scope v = new TemplateParameterPrettyPrintVisitor(buf, hgs);
(cast() tp).accept(v);
}
void arrayObjectsToBuffer(OutBuffer* buf, Objects* objects)
{
if (!objects || !objects.length)
return;
HdrGenState hgs;
foreach (i, o; *objects)
{
if (i)
buf.writestring(", ");
objectToBuffer(o, buf, &hgs);
}
}
/*************************************************************
* Pretty print function parameters.
* Params:
* pl = parameter list to print
* Returns: Null-terminated string representing parameters.
*/
extern (C++) const(char)* parametersTypeToChars(ParameterList pl)
{
OutBuffer buf;
HdrGenState hgs;
parametersToBuffer(pl, &buf, &hgs);
return buf.extractChars();
}
/*************************************************************
* Pretty print function parameter.
* Params:
* parameter = parameter to print.
* tf = TypeFunction which holds parameter.
* fullQual = whether to fully qualify types.
* Returns: Null-terminated string representing parameters.
*/
const(char)* parameterToChars(Parameter parameter, TypeFunction tf, bool fullQual)
{
OutBuffer buf;
HdrGenState hgs;
hgs.fullQual = fullQual;
parameterToBuffer(parameter, &buf, &hgs);
if (tf.parameterList.varargs == VarArg.typesafe && parameter == tf.parameterList[tf.parameterList.parameters.length - 1])
{
buf.writestring("...");
}
return buf.extractChars();
}
/*************************************************
* Write ParameterList to buffer.
* Params:
* pl = parameter list to serialize
* buf = buffer to write it to
* hgs = context
*/
private void parametersToBuffer(ParameterList pl, OutBuffer* buf, HdrGenState* hgs)
{
buf.writeByte('(');
foreach (i; 0 .. pl.length)
{
if (i)
buf.writestring(", ");
pl[i].parameterToBuffer(buf, hgs);
}
final switch (pl.varargs)
{
case VarArg.none:
break;
case VarArg.variadic:
if (pl.length)
buf.writestring(", ");
if (stcToBuffer(buf, pl.stc))
buf.writeByte(' ');
goto case VarArg.typesafe;
case VarArg.typesafe:
buf.writestring("...");
break;
}
buf.writeByte(')');
}
/***********************************************************
* Write parameter `p` to buffer `buf`.
* Params:
* p = parameter to serialize
* buf = buffer to write it to
* hgs = context
*/
private void parameterToBuffer(Parameter p, OutBuffer* buf, HdrGenState* hgs)
{
if (p.userAttribDecl)
{
buf.writeByte('@');
bool isAnonymous = p.userAttribDecl.atts.length > 0 && !(*p.userAttribDecl.atts)[0].isCallExp();
if (isAnonymous)
buf.writeByte('(');
argsToBuffer(p.userAttribDecl.atts, buf, hgs);
if (isAnonymous)
buf.writeByte(')');
buf.writeByte(' ');
}
if (p.storageClass & STC.auto_)
buf.writestring("auto ");
StorageClass stc = p.storageClass;
if (p.storageClass & STC.in_)
{
buf.writestring("in ");
if (global.params.previewIn && p.storageClass & STC.ref_)
stc &= ~STC.ref_;
}
else if (p.storageClass & STC.lazy_)
buf.writestring("lazy ");
else if (p.storageClass & STC.alias_)
buf.writestring("alias ");
if (p.type && p.type.mod & MODFlags.shared_)
stc &= ~STC.shared_;
if (stcToBuffer(buf, stc & (STC.const_ | STC.immutable_ | STC.wild | STC.shared_ |
STC.return_ | STC.returninferred | STC.scope_ | STC.scopeinferred | STC.out_ | STC.ref_ | STC.returnScope)))
buf.writeByte(' ');
if (p.storageClass & STC.alias_)
{
if (p.ident)
buf.writestring(p.ident.toString());
}
else if (p.type.ty == Tident &&
(cast(TypeIdentifier)p.type).ident.toString().length > 3 &&
strncmp((cast(TypeIdentifier)p.type).ident.toChars(), "__T", 3) == 0)
{
// print parameter name, instead of undetermined type parameter
buf.writestring(p.ident.toString());
}
else
{
typeToBuffer(p.type, p.ident, buf, hgs, (stc & STC.in_) ? MODFlags.const_ : 0);
}
if (p.defaultArg)
{
buf.writestring(" = ");
p.defaultArg.expToBuffer(PREC.assign, buf, hgs);
}
}
/**************************************************
* Write out argument list to buf.
*/
private void argsToBuffer(Expressions* expressions, OutBuffer* buf, HdrGenState* hgs, Expression basis = null)
{
if (!expressions || !expressions.length)
return;
version (all)
{
foreach (i, el; *expressions)
{
if (i)
buf.writestring(", ");
if (!el)
el = basis;
if (el)
expToBuffer(el, PREC.assign, buf, hgs);
}
}
else
{
// Sparse style formatting, for debug use only
// [0..length: basis, 1: e1, 5: e5]
if (basis)
{
buf.writestring("0..");
buf.print(expressions.length);
buf.writestring(": ");
expToBuffer(basis, PREC.assign, buf, hgs);
}
foreach (i, el; *expressions)
{
if (el)
{
if (basis)
{
buf.writestring(", ");
buf.print(i);
buf.writestring(": ");
}
else if (i)
buf.writestring(", ");
expToBuffer(el, PREC.assign, buf, hgs);
}
}
}
}
private void sizeToBuffer(Expression e, OutBuffer* buf, HdrGenState* hgs)
{
if (e.type == Type.tsize_t)
{
Expression ex = (e.op == EXP.cast_ ? (cast(CastExp)e).e1 : e);
ex = ex.optimize(WANTvalue);
const dinteger_t uval = ex.op == EXP.int64 ? ex.toInteger() : cast(dinteger_t)-1;
if (cast(sinteger_t)uval >= 0)
{
dinteger_t sizemax = void;
if (target.ptrsize == 8)
sizemax = 0xFFFFFFFFFFFFFFFFUL;
else if (target.ptrsize == 4)
sizemax = 0xFFFFFFFFU;
else if (target.ptrsize == 2)
sizemax = 0xFFFFU;
else
assert(0);
if (uval <= sizemax && uval <= 0x7FFFFFFFFFFFFFFFUL)
{
buf.print(uval);
return;
}
}
}
expToBuffer(e, PREC.assign, buf, hgs);
}
private void expressionToBuffer(Expression e, OutBuffer* buf, HdrGenState* hgs)
{
expressionPrettyPrint(e, buf, hgs);
}
/**************************************************
* Write expression out to buf, but wrap it
* in ( ) if its precedence is less than pr.
*/
private void expToBuffer(Expression e, PREC pr, OutBuffer* buf, HdrGenState* hgs)
{
debug
{
if (precedence[e.op] == PREC.zero)
printf("precedence not defined for token '%s'\n", EXPtoString(e.op).ptr);
}
if (e.op == 0xFF)
{
buf.writestring("<FF>");
return;
}
assert(precedence[e.op] != PREC.zero);
assert(pr != PREC.zero);
/* Despite precedence, we don't allow a<b<c expressions.
* They must be parenthesized.
*/
if (precedence[e.op] < pr || (pr == PREC.rel && precedence[e.op] == pr)
|| (pr >= PREC.or && pr <= PREC.and && precedence[e.op] == PREC.rel))
{
buf.writeByte('(');
e.expressionToBuffer(buf, hgs);
buf.writeByte(')');
}
else
{
e.expressionToBuffer(buf, hgs);
}
}
/**************************************************
* An entry point to pretty-print type.
*/
private void typeToBuffer(Type t, const Identifier ident, OutBuffer* buf, HdrGenState* hgs,
ubyte modMask = 0)
{
if (auto tf = t.isTypeFunction())
{
visitFuncIdentWithPrefix(tf, ident, null, buf, hgs);
return;
}
visitWithMask(t, modMask, buf, hgs);
if (ident)
{
buf.writeByte(' ');
buf.writestring(ident.toString());
}
}
private void visitWithMask(Type t, ubyte modMask, OutBuffer* buf, HdrGenState* hgs)
{
// Tuples and functions don't use the type constructor syntax
if (modMask == t.mod || t.ty == Tfunction || t.ty == Ttuple)
{
typeToBufferx(t, buf, hgs);
}
else
{
ubyte m = t.mod & ~(t.mod & modMask);
if (m & MODFlags.shared_)
{
MODtoBuffer(buf, MODFlags.shared_);
buf.writeByte('(');
}
if (m & MODFlags.wild)
{
MODtoBuffer(buf, MODFlags.wild);
buf.writeByte('(');
}
if (m & (MODFlags.const_ | MODFlags.immutable_))
{
MODtoBuffer(buf, m & (MODFlags.const_ | MODFlags.immutable_));
buf.writeByte('(');
}
typeToBufferx(t, buf, hgs);
if (m & (MODFlags.const_ | MODFlags.immutable_))
buf.writeByte(')');
if (m & MODFlags.wild)
buf.writeByte(')');
if (m & MODFlags.shared_)
buf.writeByte(')');
}
}
private void dumpTemplateInstance(TemplateInstance ti, OutBuffer* buf, HdrGenState* hgs)
{
buf.writeByte('{');
buf.writenl();
buf.level++;
if (ti.aliasdecl)
{
ti.aliasdecl.dsymbolToBuffer(buf, hgs);
buf.writenl();
}
else if (ti.members)
{
foreach(m;*ti.members)
m.dsymbolToBuffer(buf, hgs);
}
buf.level--;
buf.writeByte('}');
buf.writenl();
}
private void tiargsToBuffer(TemplateInstance ti, OutBuffer* buf, HdrGenState* hgs)
{
buf.writeByte('!');
if (ti.nest)
{
buf.writestring("(...)");
return;
}
if (!ti.tiargs)
{
buf.writestring("()");
return;
}
if (ti.tiargs.length == 1)
{
RootObject oarg = (*ti.tiargs)[0];
if (Type t = isType(oarg))
{
if (t.equals(Type.tstring) || t.equals(Type.twstring) || t.equals(Type.tdstring) || t.mod == 0 && (t.isTypeBasic() || t.ty == Tident && (cast(TypeIdentifier)t).idents.length == 0))
{
buf.writestring(t.toChars());
return;
}
}
else if (Expression e = isExpression(oarg))
{
if (e.op == EXP.int64 || e.op == EXP.float64 || e.op == EXP.null_ || e.op == EXP.string_ || e.op == EXP.this_)
{
buf.writestring(e.toChars());
return;
}
}
}
buf.writeByte('(');
ti.nestUp();
foreach (i, arg; *ti.tiargs)
{
if (i)
buf.writestring(", ");
objectToBuffer(arg, buf, hgs);
}
ti.nestDown();
buf.writeByte(')');
}
/****************************************
* This makes a 'pretty' version of the template arguments.
* It's analogous to genIdent() which makes a mangled version.
*/
private void objectToBuffer(RootObject oarg, OutBuffer* buf, HdrGenState* hgs)
{
//printf("objectToBuffer()\n");
/* The logic of this should match what genIdent() does. The _dynamic_cast()
* function relies on all the pretty strings to be unique for different classes
* See https://issues.dlang.org/show_bug.cgi?id=7375
* Perhaps it would be better to demangle what genIdent() does.
*/
if (auto t = isType(oarg))
{
//printf("\tt: %s ty = %d\n", t.toChars(), t.ty);
typeToBuffer(t, null, buf, hgs);
}
else if (auto e = isExpression(oarg))
{
if (e.op == EXP.variable)
e = e.optimize(WANTvalue); // added to fix https://issues.dlang.org/show_bug.cgi?id=7375
expToBuffer(e, PREC.assign, buf, hgs);
}
else if (Dsymbol s = isDsymbol(oarg))
{
const p = s.ident ? s.ident.toChars() : s.toChars();
buf.writestring(p);
}
else if (auto v = isTuple(oarg))
{
auto args = &v.objects;
foreach (i, arg; *args)
{
if (i)
buf.writestring(", ");
objectToBuffer(arg, buf, hgs);
}
}
else if (auto p = isParameter(oarg))
{
parameterToBuffer(p, buf, hgs);
}
else if (!oarg)
{
buf.writestring("NULL");
}
else
{
debug
{
printf("bad Object = %p\n", oarg);
}
assert(0);
}
}
private void visitFuncIdentWithPostfix(TypeFunction t, const char[] ident, OutBuffer* buf, HdrGenState* hgs, bool isStatic)
{
if (t.inuse)
{
t.inuse = 2; // flag error to caller
return;
}
t.inuse++;
if (t.linkage > LINK.d && hgs.ddoc != 1 && !hgs.hdrgen)
{
linkageToBuffer(buf, t.linkage);
buf.writeByte(' ');
}
if (t.linkage == LINK.objc && isStatic)
buf.write("static ");
if (t.next)
{
typeToBuffer(t.next, null, buf, hgs);
if (ident)
buf.writeByte(' ');
}
else if (hgs.ddoc)
buf.writestring("auto ");
if (ident)
buf.writestring(ident);
parametersToBuffer(t.parameterList, buf, hgs);
/* Use postfix style for attributes
*/
if (t.mod)
{
buf.writeByte(' ');
MODtoBuffer(buf, t.mod);
}
void dg(string str)
{
buf.writeByte(' ');
buf.writestring(str);
}
t.attributesApply(&dg);
t.inuse--;
}
private void visitFuncIdentWithPrefix(TypeFunction t, const Identifier ident, TemplateDeclaration td,
OutBuffer* buf, HdrGenState* hgs)
{
if (t.inuse)
{
t.inuse = 2; // flag error to caller
return;
}
t.inuse++;
/* Use 'storage class' (prefix) style for attributes
*/
if (t.mod)
{
MODtoBuffer(buf, t.mod);
buf.writeByte(' ');
}
void ignoreReturn(string str)
{
if (str != "return")
{
// don't write 'ref' for ctors
if ((ident == Id.ctor) && str == "ref")
return;
buf.writestring(str);
buf.writeByte(' ');
}
}
t.attributesApply(&ignoreReturn);
if (t.linkage > LINK.d && hgs.ddoc != 1 && !hgs.hdrgen)
{
linkageToBuffer(buf, t.linkage);
buf.writeByte(' ');
}
if (ident && ident.toHChars2() != ident.toChars())
{
// Don't print return type for ctor, dtor, unittest, etc
}
else if (t.next)
{
typeToBuffer(t.next, null, buf, hgs);
if (ident)
buf.writeByte(' ');
}
else if (hgs.ddoc)
buf.writestring("auto ");
if (ident)
buf.writestring(ident.toHChars2());
if (td)
{
buf.writeByte('(');
foreach (i, p; *td.origParameters)
{
if (i)
buf.writestring(", ");
p.templateParameterToBuffer(buf, hgs);
}
buf.writeByte(')');
}
parametersToBuffer(t.parameterList, buf, hgs);
if (t.isreturn)
{
buf.writestring(" return");
}
t.inuse--;
}
private void initializerToBuffer(Initializer inx, OutBuffer* buf, HdrGenState* hgs)
{
void visitError(ErrorInitializer iz)
{
buf.writestring("__error__");
}
void visitVoid(VoidInitializer iz)
{
buf.writestring("void");
}
void visitStruct(StructInitializer si)
{
//printf("StructInitializer::toCBuffer()\n");
buf.writeByte('{');
foreach (i, const id; si.field)
{
if (i)
buf.writestring(", ");
if (id)
{
buf.writestring(id.toString());
buf.writeByte(':');
}
if (auto iz = si.value[i])
initializerToBuffer(iz, buf, hgs);
}
buf.writeByte('}');
}
void visitArray(ArrayInitializer ai)
{
buf.writeByte('[');
foreach (i, ex; ai.index)
{
if (i)
buf.writestring(", ");
if (ex)
{
ex.expressionToBuffer(buf, hgs);
buf.writeByte(':');
}
if (auto iz = ai.value[i])
initializerToBuffer(iz, buf, hgs);
}
buf.writeByte(']');
}
void visitExp(ExpInitializer ei)
{
ei.exp.expressionToBuffer(buf, hgs);
}
void visitC(CInitializer ci)
{
buf.writeByte('{');
foreach (i, ref DesigInit di; ci.initializerList)
{
if (i)
buf.writestring(", ");
if (di.designatorList)
{
foreach (ref Designator d; (*di.designatorList)[])
{
if (d.exp)
{
buf.writeByte('[');
toCBuffer(d.exp, buf, hgs);
buf.writeByte(']');
}
else
{
buf.writeByte('.');
buf.writestring(d.ident.toString());
}
}
buf.writeByte('=');
}
initializerToBuffer(di.initializer, buf, hgs);
}
buf.writeByte('}');
}
final switch (inx.kind)
{
case InitKind.error: return visitError (inx.isErrorInitializer ());
case InitKind.void_: return visitVoid (inx.isVoidInitializer ());
case InitKind.struct_: return visitStruct(inx.isStructInitializer());
case InitKind.array: return visitArray (inx.isArrayInitializer ());
case InitKind.exp: return visitExp (inx.isExpInitializer ());
case InitKind.C_: return visitC (inx.isCInitializer ());
}
}
private void typeToBufferx(Type t, OutBuffer* buf, HdrGenState* hgs)
{
void visitType(Type t)
{
printf("t = %p, ty = %d\n", t, t.ty);
assert(0);
}
void visitError(TypeError t)
{
buf.writestring("_error_");
}
void visitBasic(TypeBasic t)
{
//printf("TypeBasic::toCBuffer2(t.mod = %d)\n", t.mod);
buf.writestring(t.dstring);
}
void visitTraits(TypeTraits t)
{
//printf("TypeBasic::toCBuffer2(t.mod = %d)\n", t.mod);
t.exp.expressionToBuffer(buf, hgs);
}
void visitVector(TypeVector t)
{
//printf("TypeVector::toCBuffer2(t.mod = %d)\n", t.mod);
buf.writestring("__vector(");
visitWithMask(t.basetype, t.mod, buf, hgs);
buf.writestring(")");
}
void visitSArray(TypeSArray t)
{
visitWithMask(t.next, t.mod, buf, hgs);
buf.writeByte('[');
sizeToBuffer(t.dim, buf, hgs);
buf.writeByte(']');
}
void visitDArray(TypeDArray t)
{
Type ut = t.castMod(0);
if (hgs.declstring)
goto L1;
if (ut.equals(Type.tstring))
buf.writestring("string");
else if (ut.equals(Type.twstring))
buf.writestring("wstring");
else if (ut.equals(Type.tdstring))
buf.writestring("dstring");
else
{
L1:
visitWithMask(t.next, t.mod, buf, hgs);
buf.writestring("[]");
}
}
void visitAArray(TypeAArray t)
{
visitWithMask(t.next, t.mod, buf, hgs);
buf.writeByte('[');
visitWithMask(t.index, 0, buf, hgs);
buf.writeByte(']');
}
void visitPointer(TypePointer t)
{
//printf("TypePointer::toCBuffer2() next = %d\n", t.next.ty);
if (t.next.ty == Tfunction)
visitFuncIdentWithPostfix(cast(TypeFunction)t.next, "function", buf, hgs, false);
else
{
visitWithMask(t.next, t.mod, buf, hgs);
buf.writeByte('*');
}
}
void visitReference(TypeReference t)
{
visitWithMask(t.next, t.mod, buf, hgs);
buf.writeByte('&');
}
void visitFunction(TypeFunction t)
{
//printf("TypeFunction::toCBuffer2() t = %p, ref = %d\n", t, t.isref);
visitFuncIdentWithPostfix(t, null, buf, hgs, false);
}
void visitDelegate(TypeDelegate t)
{
visitFuncIdentWithPostfix(cast(TypeFunction)t.next, "delegate", buf, hgs, false);
}
void visitTypeQualifiedHelper(TypeQualified t)
{
foreach (id; t.idents)
{
switch (id.dyncast()) with (DYNCAST)
{
case dsymbol:
buf.writeByte('.');
TemplateInstance ti = cast(TemplateInstance)id;
ti.dsymbolToBuffer(buf, hgs);
break;
case expression:
buf.writeByte('[');
(cast(Expression)id).expressionToBuffer(buf, hgs);
buf.writeByte(']');
break;
case type:
buf.writeByte('[');
typeToBufferx(cast(Type)id, buf, hgs);
buf.writeByte(']');
break;
default:
buf.writeByte('.');
buf.writestring(id.toString());
}
}
}
void visitIdentifier(TypeIdentifier t)
{
buf.writestring(t.ident.toString());
visitTypeQualifiedHelper(t);
}
void visitInstance(TypeInstance t)
{
t.tempinst.dsymbolToBuffer(buf, hgs);
visitTypeQualifiedHelper(t);
}
void visitTypeof(TypeTypeof t)
{
buf.writestring("typeof(");
t.exp.expressionToBuffer(buf, hgs);
buf.writeByte(')');
visitTypeQualifiedHelper(t);
}
void visitReturn(TypeReturn t)
{
buf.writestring("typeof(return)");
visitTypeQualifiedHelper(t);
}
void visitEnum(TypeEnum t)
{
buf.writestring(hgs.fullQual ? t.sym.toPrettyChars() : t.sym.toChars());
}
void visitStruct(TypeStruct t)
{
// https://issues.dlang.org/show_bug.cgi?id=13776
// Don't use ti.toAlias() to avoid forward reference error
// while printing messages.
TemplateInstance ti = t.sym.parent ? t.sym.parent.isTemplateInstance() : null;
if (ti && ti.aliasdecl == t.sym)
buf.writestring(hgs.fullQual ? ti.toPrettyChars() : ti.toChars());
else
buf.writestring(hgs.fullQual ? t.sym.toPrettyChars() : t.sym.toChars());
}
void visitClass(TypeClass t)
{
// https://issues.dlang.org/show_bug.cgi?id=13776
// Don't use ti.toAlias() to avoid forward reference error
// while printing messages.
TemplateInstance ti = t.sym.parent ? t.sym.parent.isTemplateInstance() : null;
if (ti && ti.aliasdecl == t.sym)
buf.writestring(hgs.fullQual ? ti.toPrettyChars() : ti.toChars());
else
buf.writestring(hgs.fullQual ? t.sym.toPrettyChars() : t.sym.toChars());
}
void visitTag(TypeTag t)
{
if (t.mod & MODFlags.const_)
buf.writestring("const ");
buf.writestring(Token.toChars(t.tok));
buf.writeByte(' ');
if (t.id)
buf.writestring(t.id.toChars());
if (t.tok == TOK.enum_ && t.base.ty != TY.Tint32)
{
buf.writestring(" : ");
visitWithMask(t.base, t.mod, buf, hgs);
}
}
void visitTuple(TypeTuple t)
{
parametersToBuffer(ParameterList(t.arguments, VarArg.none), buf, hgs);
}
void visitSlice(TypeSlice t)
{
visitWithMask(t.next, t.mod, buf, hgs);
buf.writeByte('[');
sizeToBuffer(t.lwr, buf, hgs);
buf.writestring(" .. ");
sizeToBuffer(t.upr, buf, hgs);
buf.writeByte(']');
}
void visitNull(TypeNull t)
{
buf.writestring("typeof(null)");
}
void visitMixin(TypeMixin t)
{
buf.writestring("mixin(");
argsToBuffer(t.exps, buf, hgs, null);
buf.writeByte(')');
}
void visitNoreturn(TypeNoreturn t)
{
buf.writestring("noreturn");
}
switch (t.ty)
{
default: return t.isTypeBasic() ?
visitBasic(cast(TypeBasic)t) :
visitType(t);
case Terror: return visitError(cast(TypeError)t);
case Ttraits: return visitTraits(cast(TypeTraits)t);
case Tvector: return visitVector(cast(TypeVector)t);
case Tsarray: return visitSArray(cast(TypeSArray)t);
case Tarray: return visitDArray(cast(TypeDArray)t);
case Taarray: return visitAArray(cast(TypeAArray)t);
case Tpointer: return visitPointer(cast(TypePointer)t);
case Treference: return visitReference(cast(TypeReference)t);
case Tfunction: return visitFunction(cast(TypeFunction)t);
case Tdelegate: return visitDelegate(cast(TypeDelegate)t);
case Tident: return visitIdentifier(cast(TypeIdentifier)t);
case Tinstance: return visitInstance(cast(TypeInstance)t);
case Ttypeof: return visitTypeof(cast(TypeTypeof)t);
case Treturn: return visitReturn(cast(TypeReturn)t);
case Tenum: return visitEnum(cast(TypeEnum)t);
case Tstruct: return visitStruct(cast(TypeStruct)t);
case Tclass: return visitClass(cast(TypeClass)t);
case Ttuple: return visitTuple (cast(TypeTuple)t);
case Tslice: return visitSlice(cast(TypeSlice)t);
case Tnull: return visitNull(cast(TypeNull)t);
case Tmixin: return visitMixin(cast(TypeMixin)t);
case Tnoreturn: return visitNoreturn(cast(TypeNoreturn)t);
case Ttag: return visitTag(cast(TypeTag)t);
}
}
/****************************************
* Convert EXP to char*.
*/
string EXPtoString(EXP op)
{
static immutable char*[EXP.max + 1] strings =
[
EXP.type : "type",
EXP.error : "error",
EXP.objcClassReference : "class",
EXP.typeof_ : "typeof",
EXP.mixin_ : "mixin",
EXP.import_ : "import",
EXP.dotVariable : "dotvar",
EXP.scope_ : "scope",
EXP.identifier : "identifier",
EXP.this_ : "this",
EXP.super_ : "super",
EXP.int64 : "long",
EXP.float64 : "double",
EXP.complex80 : "creal",
EXP.null_ : "null",
EXP.string_ : "string",
EXP.arrayLiteral : "arrayliteral",
EXP.assocArrayLiteral : "assocarrayliteral",
EXP.classReference : "classreference",
EXP.file : "__FILE__",
EXP.fileFullPath : "__FILE_FULL_PATH__",
EXP.line : "__LINE__",
EXP.moduleString : "__MODULE__",
EXP.functionString : "__FUNCTION__",
EXP.prettyFunction : "__PRETTY_FUNCTION__",
EXP.typeid_ : "typeid",
EXP.is_ : "is",
EXP.assert_ : "assert",
EXP.halt : "halt",
EXP.template_ : "template",
EXP.dSymbol : "symbol",
EXP.function_ : "function",
EXP.variable : "var",
EXP.symbolOffset : "symoff",
EXP.structLiteral : "structLiteral",
EXP.compoundLiteral : "compoundliteral",
EXP.arrayLength : "arraylength",
EXP.delegatePointer : "delegateptr",
EXP.delegateFunctionPointer : "delegatefuncptr",
EXP.remove : "remove",
EXP.tuple : "tuple",
EXP.traits : "__traits",
EXP.default_ : "default",
EXP.overloadSet : "__overloadset",
EXP.void_ : "void",
EXP.vectorArray : "vectorarray",
EXP._Generic : "_Generic",
// post
EXP.dotTemplateInstance : "dotti",
EXP.dotIdentifier : "dotid",
EXP.dotTemplateDeclaration : "dottd",
EXP.dot : ".",
EXP.dotType : "dottype",
EXP.plusPlus : "++",
EXP.minusMinus : "--",
EXP.prePlusPlus : "++",
EXP.preMinusMinus : "--",
EXP.call : "call",
EXP.slice : "..",
EXP.array : "[]",
EXP.index : "[i]",
EXP.delegate_ : "delegate",
EXP.address : "&",
EXP.star : "*",
EXP.negate : "-",
EXP.uadd : "+",
EXP.not : "!",
EXP.tilde : "~",
EXP.delete_ : "delete",
EXP.new_ : "new",
EXP.newAnonymousClass : "newanonclass",
EXP.cast_ : "cast",
EXP.vector : "__vector",
EXP.pow : "^^",
EXP.mul : "*",
EXP.div : "/",
EXP.mod : "%",
EXP.add : "+",
EXP.min : "-",
EXP.concatenate : "~",
EXP.leftShift : "<<",
EXP.rightShift : ">>",
EXP.unsignedRightShift : ">>>",
EXP.lessThan : "<",
EXP.lessOrEqual : "<=",
EXP.greaterThan : ">",
EXP.greaterOrEqual : ">=",
EXP.in_ : "in",
EXP.equal : "==",
EXP.notEqual : "!=",
EXP.identity : "is",
EXP.notIdentity : "!is",
EXP.and : "&",
EXP.xor : "^",
EXP.or : "|",
EXP.andAnd : "&&",
EXP.orOr : "||",
EXP.question : "?",
EXP.assign : "=",
EXP.construct : "=",
EXP.blit : "=",
EXP.addAssign : "+=",
EXP.minAssign : "-=",
EXP.concatenateAssign : "~=",
EXP.concatenateElemAssign : "~=",
EXP.concatenateDcharAssign : "~=",
EXP.mulAssign : "*=",
EXP.divAssign : "/=",
EXP.modAssign : "%=",
EXP.powAssign : "^^=",
EXP.leftShiftAssign : "<<=",
EXP.rightShiftAssign : ">>=",
EXP.unsignedRightShiftAssign : ">>>=",
EXP.andAssign : "&=",
EXP.orAssign : "|=",
EXP.xorAssign : "^=",
EXP.comma : ",",
EXP.declaration : "declaration",
EXP.interval : "interval",
];
const p = strings[op];
if (!p)
{
printf("error: EXP %d has no string\n", op);
return "XXXXX";
//assert(0);
}
assert(p);
return p[0 .. strlen(p)];
}
|
D
|
import std.stdio;
import std.process : execute;
int main(string[] args)
{
writefln("Executing init test - fail");
auto script = args[0] ~ ".sh";
auto dubInit = execute(script);
return dubInit.status;
}
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/fail12604.d(14): Error: mismatched array lengths, 1 and 3
fail_compilation/fail12604.d(15): Error: mismatched array lengths, 1 and 3
fail_compilation/fail12604.d(17): Error: mismatched array lengths, 1 and 3
fail_compilation/fail12604.d(18): Error: mismatched array lengths, 1 and 3
fail_compilation/fail12604.d(20): Error: cannot implicitly convert expression `[65536]` of type `int[]` to `short[]`
fail_compilation/fail12604.d(21): Error: cannot implicitly convert expression `[65536, 2, 3]` of type `int[]` to `short[]`
---
*/
void main()
{
int[1] a1 = [1,2,3];
short[1] a2 = [1,2,3];
int[1] b1; b1 = [1,2,3];
short[1] b2; b2 = [1,2,3];
short[1] c = [65536];
short[1] d = [65536,2,3];
}
/*
TEST_OUTPUT:
---
fail_compilation/fail12604.d(39): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(40): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(41): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(42): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(43): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(44): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(45): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(46): Error: mismatched array lengths, 2 and 3
---
*/
void test12606a() // AssignExp::semantic
{
uint[2] a1 = [1, 2, 3][];
ushort[2] a2 = [1, 2, 3][];
uint[2] a3 = [1, 2, 3][0 .. 3];
ushort[2] a4 = [1, 2, 3][0 .. 3];
a1 = [1, 2, 3][];
a2 = [1, 2, 3][];
a3 = [1, 2, 3][0 .. 3];
a4 = [1, 2, 3][0 .. 3];
}
/*
TEST_OUTPUT:
---
fail_compilation/fail12604.d(60): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(61): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(62): Error: mismatched array lengths, 2 and 3
fail_compilation/fail12604.d(63): Error: mismatched array lengths, 2 and 3
---
*/
void test12606b() // ExpInitializer::semantic
{
static uint[2] a1 = [1, 2, 3][];
static uint[2] a2 = [1, 2, 3][0 .. 3];
static ushort[2] a3 = [1, 2, 3][];
static ushort[2] a4 = [1, 2, 3][0 .. 3];
}
/*
TEST_OUTPUT:
---
fail_compilation/fail12604.d(77): Error: mismatched array lengths, 4 and 3
fail_compilation/fail12604.d(78): Error: mismatched array lengths, 4 and 3
---
*/
void testc()
{
int[4] sa1;
int[3] sa2;
sa1[0..4] = [1,2,3];
sa1[0..4] = sa2;
}
|
D
|
/Users/christopherdugan/rust_projects/pong/target/debug/build/winapi-570ee04b6ea1f687/build_script_build-570ee04b6ea1f687: /Users/christopherdugan/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.7/build.rs
/Users/christopherdugan/rust_projects/pong/target/debug/build/winapi-570ee04b6ea1f687/build_script_build-570ee04b6ea1f687.d: /Users/christopherdugan/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.7/build.rs
/Users/christopherdugan/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.7/build.rs:
|
D
|
/*
Copyright © 2020, Luna Nielsen
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna Nielsen
*/
module game.tiles.mahjong;
import game.tiles;
import engine;
import game;
import std.conv : text;
/**
Width of tile (A2 in cm)
*/
enum MahjongTileWidth = 0.26;
/**
Height of tile (A2 in cm)
*/
enum MahjongTileHeight = 0.35;
/**
Length/Depth of tile (A2 in cm)
*/
enum MahjongTileLength = 0.20;
/**
Scaling factor for a mahjong tile's width to be 1 pixel wide
*/
enum MahjongScaleFactor = 1/MahjongTileWidth;
/**
Types of tiles in a Mahjong set
A set consists of:
- 9 Dots/Coins (1-9)
- 9 Bams/Bamboos (1-9)
- 9 Craks/Kanji (1-9)
- 3 Dragons (Red, Green, White)
- 4 Winds (East, South, West, North)
- 4 Flowers (Plum, Orchid, Bamboo and Chrysanthemum)
- 4 Seasons (Spring, Summer, Autumn, Winter)
- Jokers
Kitsune Mahjong on top has a few extra tiles special game boards may use for various purposes
- Red Tile
- Green Tile
- Blue Tile
- Orange Tile
- Pink Tile
- Fox June Tile (Tile with drawing of June on it)
- Fox April Tile (Tile with drawing of April on it)
- Fox Mei Tile (Tile with drawing of Mei on it)
*/
enum TileType : int {
/// 🀙
Dot1,
/// 🀚
Dot2,
/// 🀛
Dot3,
/// 🀜
Dot4,
/// 🀝
Dot5,
/// 🀞
Dot6,
/// 🀟
Dot7,
/// 🀠
Dot8,
/// 🀡
Dot9,
/// 🀐
Bam1,
/// 🀑
Bam2,
/// 🀒
Bam3,
/// 🀓
Bam4,
/// 🀔
Bam5,
/// 🀕
Bam6,
/// 🀖
Bam7,
/// 🀗
Bam8,
/// 🀘
Bam9,
/// 🀇
Crak1,
/// 🀈
Crak2,
/// 🀉
Crak3,
/// 🀊
Crak4,
/// 🀋
Crak5,
/// 🀌
Crak6,
/// 🀍
Crak7,
/// 🀎
Crak8,
/// 🀏
Crak9,
/// 🀄
RedDragon,
/// 🀅
GreenDragon,
/// 🀆
WhiteDragon,
/// 🀀
EastWind,
/// 🀁
SouthWind,
// 🀂
WestWind,
/// 🀃
NorthWind,
/// 🀢
Plum,
/// 🀣
Orchid,
/// 🀤
Chrysanthemum,
/// 🀥
Bamboo,
/// 🀦
Spring,
/// 🀧
Summer,
/// 🀨
Autumn,
/// 🀩
Winter,
/// 🀪
Joker,
/// Red general purpose tile
Red,
/// Green general purpose tile
Green,
/// Blue general purpose tile
Blue,
/// Orange general purpose tile
Orange,
/// Pink general purpose tile
Pink,
/// June general purpose tile
June,
/// April general purpose tile
April,
/// Mei general purpose tile
Mei,
/// Count of tiles in a set with only suits
SuitsCount = Crak9+1,
/// Count of tiles in a set with all bonus tiles
SuitsAndBonusCount = Joker+1,
/// Count of tiles in the extended set (Tiles added by Kitsune Mahjong)
ExtendedSetTileCount = Mei+1,
// An unmarked tile without any face
Unmarked = -1,
}
/**
How many of a type of tile there usually is in a set
*/
enum TileTypeCount : int {
Dots = 4,
Bams = 4,
Craks = 4,
Winds = 4,
Dragons = 4,
Flowers = 1,
Seasons = 1
}
private {
static TextureAtlas mahjongAtlas;
void fillMahjongAtlas(string tileset) {
import std.format : format;
import std.path : buildPath;
try {
mahjongAtlas.add("TileCap", buildPath("assets", "tiles", tileset, "TileCap.png"));
mahjongAtlas.add("TileSide", buildPath("assets", "tiles", tileset, "TileSide.png"));
mahjongAtlas.add("TileBack", buildPath("assets", "tiles", tileset, "TileBack.png"));
mahjongAtlas.add("TileUnmarked", buildPath("assets", "tiles", tileset, "TileBack.png"));
foreach(i; 0..cast(int)TileType.ExtendedSetTileCount) {
mahjongAtlas.add(
"Tile%s".format(text(cast(TileType)i)),
buildPath("assets", "tiles", tileset, "Tile%s.png".format(text(cast(TileType)i)))
);
}
} catch(Exception ex) {
AppLog.fatal("MahjongTile", "Error loading tile set: %s", ex.msg);
}
}
}
/**
Initialize mahjong
*/
void initMahjong(string tileset) {
mahjongAtlas = new TextureAtlas(vec2i(2048, 2048));
fillMahjongAtlas(tileset);
}
/**
Change the active tile set
*/
void changeTileset(string tileset) {
mahjongAtlas.clear();
fillMahjongAtlas(tileset);
}
/**
A mahjong tile
*/
class MahjongTile : Tile {
protected:
TileMesh mesh;
TileType type_;
public:
/**
Constructor
*/
this(TileType type = TileType.Unmarked) {
super();
this.type_ = type;
mesh = new TileMesh(
vec3(MahjongTileWidth, MahjongTileHeight, MahjongTileLength),
mahjongAtlas,
"Tile"~type.text,
"TileBack",
"TileSide",
"TileCap"
);
}
/**
The type of the tile
*/
TileType type() {
return type_;
}
/**
Change the type of the tile
*/
void changeType(TileType type) {
this.type_ = type;
mesh.setTexture(TileMeshSide.Front, mahjongAtlas["Tile"~type.text]);
}
/**
Draws the tile
*/
override void draw(Camera camera) {
mesh.draw(camera, transform.matrix);
}
/**
Draw the tile in a 2D plane
*/
override void draw2d(Camera2D camera, vec2 position, float scale = 1, quat rotation = quat.identity) {
mesh.draw2d(camera, position, scale, rotation);
}
/**
Update the tile
*/
override void update() {
collider.position = transform.position;
collider.size = vec3(MahjongTileWidth/2, MahjongTileHeight/2, MahjongTileLength/2);
collider.rotation = transform.rotation;
}
}
|
D
|
c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Short: #
Long: progress-bar
Help: Display transfer progress as a bar
Category: verbose
Example: -# -O $URL
Added: 5.10
See-also: styled-output
Multi: boolean
---
Make curl display transfer progress as a simple progress bar instead of the
standard, more informational, meter.
This progress bar draws a single line of '#' characters across the screen and
shows a percentage if the transfer size is known. For transfers without a
known size, there will be space ship (-=o=-) that moves back and forth but
only while data is being transferred, with a set of flying hash sign symbols on
top.
This option is global and does not need to be specified for each use of
--next.
|
D
|
module tpl.weakref;
/******************************************************************************
Генерная СлабаяСсылка
******************************************************************************/
alias СлабаяСсылка!(Объект) СлабУк;
class СлабаяСсылка (T : Объект)
{
public alias получи opCall;
private ук слабук;
this (T об)
{
слабук = смСоздайСлабУк (об);
}
~this ()
{
сотри;
}
final проц установи (T об)
{
сотри;
слабук = смСоздайСлабУк (об);
}
final проц сотри ()
{
смУдалиСлабУк (слабук);
слабук = пусто;
}
final T получи ()
{
return cast(T) смДайСлабУк (слабук);
}
}
/////////////////////////////////////////////////////////////
СлабУк сделайСлабУк ()
{
return new СлабУк (new Объект);
}
|
D
|
module dpk.dflags;
import std.algorithm, std.array, std.getopt, std.string, std.conv;
import std.stdio;
struct DFlags
{
this(string[] args, string[] defaults=null)
{
string[] scan = defaults;
Lagain:
foreach(arg; scan)
{
switch (arg)
{
case "-debug":
this.buildstyle = DFlags.style.dbg;
break;
case "-release":
this.buildstyle = DFlags.style.rls;
break;
case "-m32":
this.wordsize = 32;
break;
case "-m64":
this.wordsize = 64;
break;
case "-profile":
this.profile = true;
break;
case "-cov":
this.coverage = true;
break;
case "-gc":
this.dinfo = DFlags.debuginfo.gc;
break;
case "-g":
this.dinfo = DFlags.debuginfo.g;
break;
case "-vv":
this.verbose = 2;
break;
case "-v":
this.verbose = 1;
break;
default:
this.additional ~= arg;
break;
}
}
if (scan.ptr != args.ptr)
{
scan = args;
goto Lagain;
}
}
@property string suffix() const {
string result;
if (this.buildstyle == style.dbg)
result ~= "_d";
if (this.profile)
result ~= "_profile";
if (this.coverage)
result ~= "_cov";
return result;
}
@property string[] args() const {
string[] res;
final switch (buildstyle)
{
case style.no: break;
case style.dbg: res ~= "-debug"; break;
case style.rls: res ~= "-release"; break;
}
switch (wordsize)
{
case 32: res ~= "-m32"; break;
case 64: res ~= "-m64"; break;
default: assert(0);
}
final switch (dinfo)
{
case debuginfo.no: break;
case debuginfo.gc: res ~= "-gc"; break;
case debuginfo.g: res ~= "-g"; break;
}
if (profile)
res ~= "-profile";
if (coverage)
res ~= "-cov";
switch (verbose)
{
case 1: break;
case 2: res ~= "-v"; break;
default: break;
}
res ~= additional;
return res;
}
enum style { no, dbg, rls };
enum debuginfo { no, gc, g };
style buildstyle;
// TODO: ugly heuristic for dmd default wordsize
uint wordsize = size_t.sizeof == 8 ? 64 : 32;
debuginfo dinfo;
bool profile, coverage;
uint verbose;
string[] additional;
}
unittest {
assert(DFlags().suffix == "");
assert(DFlags(["-debug"]).suffix == "_d");
assert(DFlags(["-debug", "-m64", "-gc", "-profile", "-cov"]).suffix == "_d_profile_cov");
assert(DFlags(["-debug", "-cov", "-profile", "-m64", "-gc"]).suffix == "_d_profile_cov");
assert(DFlags(["-debug"], ["-release"]).suffix == "_d");
assert(DFlags(["-m64"], ["-debug"]).suffix == "_d");
assert(DFlags(["--m64 -release -inline -O"], ["-m64 -debug -gc -w -wi"]).suffix == "");
}
|
D
|
/**
Contains routines for high level path handling.
Copyright: © 2012-2015 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module vibe.core.path;
import std.algorithm : canFind, min;
import std.array;
import std.conv;
import std.exception;
import std.string;
/** Computes the relative path from `base_path` to this path.
Params:
path = The destination path
base_path = The path from which the relative path starts
See_also: `relativeToWeb`
*/
Path relativeTo(Path path, Path base_path)
{
assert(path.absolute && base_path.absolute);
version (Windows) {
// a path such as ..\C:\windows is not valid, so force the path to stay absolute in this case
if (path.absolute && !path.empty &&
(path[0].toString().endsWith(":") && !base_path.startsWith(path[0 .. 1]) ||
path[0] == "\\" && !base_path.startsWith(path[0 .. min(2, $)])))
{
return path;
}
}
int nup = 0;
while (base_path.length > nup && !path.startsWith(base_path[0 .. base_path.length-nup])) {
nup++;
}
Path ret = Path(null, false);
ret.m_endsWithSlash = true;
foreach (i; 0 .. nup) ret ~= "..";
ret ~= Path(path.nodes[base_path.length-nup .. $], false);
ret.m_endsWithSlash = path.m_endsWithSlash;
return ret;
}
///
unittest {
assert(Path("/some/path").relativeTo(Path("/")) == Path("some/path"));
assert(Path("/some/path/").relativeTo(Path("/some/other/path/")) == Path("../../path/"));
assert(Path("/some/path/").relativeTo(Path("/some/other/path")) == Path("../../path/"));
}
/** Computes the relative path to this path from `base_path` using web path rules.
The difference to `relativeTo` is that a path not ending in a slash
will not be considered as a path to a directory and the parent path
will instead be used.
Params:
path = The destination path
base_path = The path from which the relative path starts
See_also: `relativeTo`
*/
Path relativeToWeb(Path path, Path base_path)
{
if (!base_path.endsWithSlash) {
if (base_path.length > 0) base_path = base_path[0 .. $-1];
else base_path = Path("/");
}
return path.relativeTo(base_path);
}
///
unittest {
assert(Path("/some/path").relativeToWeb(Path("/")) == Path("some/path"));
assert(Path("/some/path/").relativeToWeb(Path("/some/other/path/")) == Path("../../path/"));
assert(Path("/some/path/").relativeToWeb(Path("/some/other/path")) == Path("../path/"));
}
/**
Represents an absolute or relative file system path.
This struct allows to do safe operations on paths, such as concatenation and sub paths. Checks
are done to disallow invalid operations such as concatenating two absolute paths. It also
validates path strings and allows for easy checking of malicious relative paths.
*/
struct Path {
private {
immutable(PathEntry)[] m_nodes;
bool m_absolute = false;
bool m_endsWithSlash = false;
}
hash_t toHash()
const nothrow @trusted {
hash_t ret;
auto strhash = &typeid(string).getHash;
try foreach (n; nodes) ret ^= strhash(&n.m_name);
catch (Throwable) assert(false);
if (m_absolute) ret ^= 0xfe3c1738;
if (m_endsWithSlash) ret ^= 0x6aa4352d;
return ret;
}
pure:
/// Constructs a Path object by parsing a path string.
this(string pathstr)
{
m_nodes = splitPath(pathstr);
m_absolute = (pathstr.startsWith("/") || m_nodes.length > 0 && (m_nodes[0].toString().canFind(':') || m_nodes[0] == "\\"));
m_endsWithSlash = pathstr.endsWith("/");
}
/// Constructs a path object from a list of PathEntry objects.
this(immutable(PathEntry)[] nodes, bool absolute)
{
m_nodes = nodes;
m_absolute = absolute;
}
/// Constructs a relative path with one path entry.
this(PathEntry entry)
{
m_nodes = [entry];
m_absolute = false;
}
/// Determines if the path is absolute.
@property bool absolute() const { return m_absolute; }
/// Resolves all '.' and '..' path entries as far as possible.
void normalize()
{
immutable(PathEntry)[] newnodes;
foreach( n; m_nodes ){
switch(n.toString()){
default:
newnodes ~= n;
break;
case "", ".": break;
case "..":
enforce(!m_absolute || newnodes.length > 0, "Path goes below root node.");
if( newnodes.length > 0 && newnodes[$-1] != ".." ) newnodes = newnodes[0 .. $-1];
else newnodes ~= n;
break;
}
}
m_nodes = newnodes;
}
/// Converts the Path back to a string representation using slashes.
string toString()
const {
if (m_nodes.empty)
return absolute ? "/" : endsWithSlash ? "./" : "";
Appender!string ret;
// for absolute paths start with /
if( absolute ) ret.put('/');
foreach( i, f; m_nodes ){
if( i > 0 ) ret.put('/');
ret.put(f.toString());
}
if( m_nodes.length > 0 && m_endsWithSlash )
ret.put('/');
return ret.data;
}
/// Converts the Path object to a native path string (backslash as path separator on Windows).
string toNativeString() nothrow
const {
Appender!string ret;
// for absolute unix paths start with /
version(Posix) { if (m_absolute) ret.put('/'); }
foreach( i, f; m_nodes ){
version(Windows) { if( i > 0 ) ret.put('\\'); }
else version(Posix) { if( i > 0 ) ret.put('/'); }
else static assert(false, "Unsupported OS");
ret.put(f.toString());
}
if( m_nodes.length > 0 && m_endsWithSlash ){
version(Windows) { ret.put('\\'); }
version(Posix) { ret.put('/'); }
}
return ret.data;
}
/// Tests if `rhs` is an anchestor or the same as this path.
bool startsWith(const Path rhs) const {
if( rhs.m_nodes.length > m_nodes.length ) return false;
foreach( i; 0 .. rhs.m_nodes.length )
if( m_nodes[i] != rhs.m_nodes[i] )
return false;
return true;
}
/// The last entry of the path
@property ref immutable(PathEntry) head() const { enforce(m_nodes.length > 0); return m_nodes[$-1]; }
/// The parent path
@property Path parentPath() const { return this[0 .. length-1]; }
/// The ist of path entries of which this path is composed
@property immutable(PathEntry)[] nodes() const { return m_nodes; }
/// The number of path entries of which this path is composed
@property size_t length() const { return m_nodes.length; }
/// True if the path contains no entries
@property bool empty() const { return m_nodes.length == 0; }
/// Determines if the path ends with a slash (i.e. is a directory)
@property bool endsWithSlash() const { return m_endsWithSlash; }
/// ditto
@property void endsWithSlash(bool v) { m_endsWithSlash = v; }
/// Determines if this path goes outside of its base path (i.e. begins with '..').
@property bool external() const { return !m_absolute && m_nodes.length > 0 && m_nodes[0].m_name == ".."; }
ref immutable(PathEntry) opIndex(size_t idx) const { return m_nodes[idx]; }
Path opSlice(size_t start, size_t end) const {
auto ret = Path(m_nodes[start .. end], start == 0 ? absolute : false);
ret.m_endsWithSlash = end == m_nodes.length ? m_endsWithSlash : true;
return ret;
}
size_t opDollar(int dim)() const if(dim == 0) { return m_nodes.length; }
Path opBinary(string OP)(const Path rhs) const if( OP == "~" )
{
assert(!rhs.absolute, "Trying to append absolute path.");
if (!rhs.length) return this;
Path ret;
ret.m_nodes = m_nodes;
ret.m_absolute = m_absolute;
ret.m_endsWithSlash = rhs.m_endsWithSlash;
ret.normalize(); // needed to avoid "."~".." become "" instead of ".."
foreach (folder; rhs.m_nodes) {
switch (folder.toString()) {
default: ret.m_nodes = ret.m_nodes ~ folder; break;
case "", ".": break;
case "..":
enforce(!ret.absolute || ret.m_nodes.length > 0, "Relative path goes below root node!");
if( ret.m_nodes.length > 0 && ret.m_nodes[$-1].toString() != ".." )
ret.m_nodes = ret.m_nodes[0 .. $-1];
else ret.m_nodes = ret.m_nodes ~ folder;
break;
}
}
return ret;
}
Path opBinary(string OP)(string rhs) const if( OP == "~" ) { return opBinary!"~"(Path(rhs)); }
Path opBinary(string OP)(PathEntry rhs) const if( OP == "~" ) { return opBinary!"~"(Path(rhs)); }
void opOpAssign(string OP)(string rhs) if( OP == "~" ) { opOpAssign!"~"(Path(rhs)); }
void opOpAssign(string OP)(PathEntry rhs) if( OP == "~" ) { opOpAssign!"~"(Path(rhs)); }
void opOpAssign(string OP)(immutable(PathEntry)[] rhs) if( OP == "~" ) { opOpAssign!"~"(Path(rhs, false)); }
void opOpAssign(string OP)(Path rhs) if( OP == "~" )
{
assert(!rhs.absolute, "Trying to append absolute path.");
if (!rhs.length) return;
auto p = this ~ rhs;
m_nodes = p.m_nodes;
m_endsWithSlash = rhs.m_endsWithSlash;
}
/// Tests two paths for equality using '=='.
bool opEquals(ref const Path rhs) const {
if( m_absolute != rhs.m_absolute ) return false;
if( m_endsWithSlash != rhs.m_endsWithSlash ) return false;
if( m_nodes.length != rhs.length ) return false;
foreach( i; 0 .. m_nodes.length )
if( m_nodes[i] != rhs.m_nodes[i] )
return false;
return true;
}
/// ditto
bool opEquals(const Path other) const { return opEquals(other); }
int opCmp(ref const Path rhs) const {
if( m_absolute != rhs.m_absolute ) return cast(int)m_absolute - cast(int)rhs.m_absolute;
foreach( i; 0 .. min(m_nodes.length, rhs.m_nodes.length) )
if( m_nodes[i] != rhs.m_nodes[i] )
return m_nodes[i].opCmp(rhs.m_nodes[i]);
if( m_nodes.length > rhs.m_nodes.length ) return 1;
if( m_nodes.length < rhs.m_nodes.length ) return -1;
return 0;
}
}
unittest
{
{
auto unc = "\\\\server\\share\\path";
auto uncp = Path(unc);
uncp.normalize();
version(Windows) assert(uncp.toNativeString() == unc);
assert(uncp.absolute);
assert(!uncp.endsWithSlash);
}
{
auto abspath = "/test/path/";
auto abspathp = Path(abspath);
assert(abspathp.toString() == abspath);
version(Windows) {} else assert(abspathp.toNativeString() == abspath);
assert(abspathp.absolute);
assert(abspathp.endsWithSlash);
assert(abspathp.length == 2);
assert(abspathp[0] == "test");
assert(abspathp[1] == "path");
}
{
auto relpath = "test/path/";
auto relpathp = Path(relpath);
assert(relpathp.toString() == relpath);
version(Windows) assert(relpathp.toNativeString() == "test\\path\\");
else assert(relpathp.toNativeString() == relpath);
assert(!relpathp.absolute);
assert(relpathp.endsWithSlash);
assert(relpathp.length == 2);
assert(relpathp[0] == "test");
assert(relpathp[1] == "path");
}
{
auto winpath = "C:\\windows\\test";
auto winpathp = Path(winpath);
assert(winpathp.toString() == "/C:/windows/test");
version(Windows) assert(winpathp.toNativeString() == winpath);
else assert(winpathp.toNativeString() == "/C:/windows/test");
assert(winpathp.absolute);
assert(!winpathp.endsWithSlash);
assert(winpathp.length == 3);
assert(winpathp[0] == "C:");
assert(winpathp[1] == "windows");
assert(winpathp[2] == "test");
}
{
auto dotpath = "/test/../test2/././x/y";
auto dotpathp = Path(dotpath);
assert(dotpathp.toString() == "/test/../test2/././x/y");
dotpathp.normalize();
assert(dotpathp.toString() == "/test2/x/y");
}
{
auto dotpath = "/test/..////test2//./x/y";
auto dotpathp = Path(dotpath);
assert(dotpathp.toString() == "/test/..////test2//./x/y");
dotpathp.normalize();
assert(dotpathp.toString() == "/test2/x/y");
}
{
auto parentpath = "/path/to/parent";
auto parentpathp = Path(parentpath);
auto subpath = "/path/to/parent/sub/";
auto subpathp = Path(subpath);
auto subpath_rel = "sub/";
assert(subpathp.relativeTo(parentpathp).toString() == subpath_rel);
auto subfile = "/path/to/parent/child";
auto subfilep = Path(subfile);
auto subfile_rel = "child";
assert(subfilep.relativeTo(parentpathp).toString() == subfile_rel);
}
{ // relative paths across Windows devices are not allowed
version (Windows) {
auto p1 = Path("\\\\server\\share"); assert(p1.absolute);
auto p2 = Path("\\\\server\\othershare"); assert(p2.absolute);
auto p3 = Path("\\\\otherserver\\share"); assert(p3.absolute);
auto p4 = Path("C:\\somepath"); assert(p4.absolute);
auto p5 = Path("C:\\someotherpath"); assert(p5.absolute);
auto p6 = Path("D:\\somepath"); assert(p6.absolute);
assert(p4.relativeTo(p5) == Path("../somepath"));
assert(p4.relativeTo(p6) == Path("C:\\somepath"));
assert(p4.relativeTo(p1) == Path("C:\\somepath"));
assert(p1.relativeTo(p2) == Path("../share"));
assert(p1.relativeTo(p3) == Path("\\\\server\\share"));
assert(p1.relativeTo(p4) == Path("\\\\server\\share"));
}
}
{ // relative path, trailing slash
auto p1 = Path("/some/path");
auto p2 = Path("/some/path/");
assert(p1.relativeTo(p1).toString() == "");
assert(p1.relativeTo(p2).toString() == "");
assert(p2.relativeTo(p2).toString() == "./");
assert(p2.relativeTo(p1).toString() == "./");
}
}
struct PathEntry {
private {
string m_name;
}
pure:
this(string str)
{
assert(!str.canFind('/') && (!str.canFind('\\') || str.length == 1), "Invalid path entry: " ~ str);
m_name = str;
}
string toString() const nothrow { return m_name; }
Path opBinary(string OP)(PathEntry rhs) const if( OP == "~" ) { return Path([this, rhs], false); }
bool opEquals(ref const PathEntry rhs) const { return m_name == rhs.m_name; }
bool opEquals(PathEntry rhs) const { return m_name == rhs.m_name; }
bool opEquals(string rhs) const { return m_name == rhs; }
int opCmp(ref const PathEntry rhs) const { return m_name.cmp(rhs.m_name); }
int opCmp(string rhs) const { return m_name.cmp(rhs); }
}
private bool isValidFilename(string str)
pure {
foreach( ch; str )
if( ch == '/' || /*ch == ':' ||*/ ch == '\\' ) return false;
return true;
}
/// Joins two path strings. subpath must be relative.
string joinPath(string basepath, string subpath)
pure {
Path p1 = Path(basepath);
Path p2 = Path(subpath);
return (p1 ~ p2).toString();
}
/// Splits up a path string into its elements/folders
PathEntry[] splitPath(string path)
pure {
if( path.startsWith("/") || path.startsWith("\\") ) path = path[1 .. $];
if( path.empty ) return null;
if( path.endsWith("/") || path.endsWith("\\") ) path = path[0 .. $-1];
// count the number of path nodes
size_t nelements = 0;
foreach( i, char ch; path )
if( ch == '\\' || ch == '/' )
nelements++;
nelements++;
// reserve space for the elements
PathEntry[] storage;
/*if (alloc) {
auto mem = alloc.alloc(nelements * PathEntry.sizeof);
mem[] = 0;
storage = cast(PathEntry[])mem;
} else*/ storage = new PathEntry[nelements];
size_t startidx = 0;
size_t eidx = 0;
// detect UNC path
if(path.startsWith("\\"))
{
storage[eidx++] = PathEntry(path[0 .. 1]);
path = path[1 .. $];
}
// read and return the elements
foreach( i, char ch; path )
if( ch == '\\' || ch == '/' ){
storage[eidx++] = PathEntry(path[startidx .. i]);
startidx = i+1;
}
storage[eidx++] = PathEntry(path[startidx .. $]);
assert(eidx == nelements);
return storage;
}
|
D
|
/**
* Written in the D programming language.
* Module initialization routines.
*
* Copyright: Copyright Digital Mars 2000 - 2013.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Walter Bright, Sean Kelly
* Source: $(DRUNTIMESRC src/rt/_minfo.d)
*/
module rt.minfo;
import core.stdc.stdlib; // alloca
import core.stdc.string; // memcpy
import rt.sections;
enum
{
MIctorstart = 0x1, // we've started constructing it
MIctordone = 0x2, // finished construction
MIstandalone = 0x4, // module ctor does not depend on other module
// ctors being done first
MItlsctor = 8,
MItlsdtor = 0x10,
MIctor = 0x20,
MIdtor = 0x40,
MIxgetMembers = 0x80,
MIictor = 0x100,
MIunitTest = 0x200,
MIimportedModules = 0x400,
MIlocalClasses = 0x800,
MIname = 0x1000,
}
/*****
* A ModuleGroup is an unordered collection of modules.
* There is exactly one for:
* 1. all statically linked in D modules, either directely or as shared libraries
* 2. each call to rt_loadLibrary()
*/
struct ModuleGroup
{
this(immutable(ModuleInfo*)[] modules)
{
_modules = modules;
}
@property immutable(ModuleInfo*)[] modules() const pure nothrow @nogc
{
return _modules;
}
/******************************
* Allocate and fill in _ctors[] and _tlsctors[].
* Modules are inserted into the arrays in the order in which the constructors
* need to be run.
* Throws:
* Exception if it fails.
*/
void sortCtors()
{
immutable len = _modules.length;
if (!len)
return;
static struct StackRec
{
@property immutable(ModuleInfo)* mod()
{
return _mods[_idx];
}
immutable(ModuleInfo*)[] _mods;
size_t _idx;
}
auto stack = (cast(StackRec*).calloc(len, StackRec.sizeof))[0 .. len];
// TODO: reuse GCBits by moving it to rt.util.container or core.internal
immutable nwords = (len + 8 * size_t.sizeof - 1) / (8 * size_t.sizeof);
auto ctorstart = cast(size_t*).malloc(nwords * size_t.sizeof);
auto ctordone = cast(size_t*).malloc(nwords * size_t.sizeof);
if (!stack.ptr || ctorstart is null || ctordone is null)
assert(0);
scope (exit) { .free(stack.ptr); .free(ctorstart); .free(ctordone); }
int findModule(in ModuleInfo* mi)
{
foreach (i, m; _modules)
if (m is mi) return cast(int)i;
return -1;
}
void sort(ref immutable(ModuleInfo)*[] ctors, uint mask)
{
import core.bitop;
ctors = (cast(immutable(ModuleInfo)**).malloc(len * size_t.sizeof))[0 .. len];
if (!ctors.ptr)
assert(0);
// clean flags
memset(ctorstart, 0, nwords * size_t.sizeof);
memset(ctordone, 0, nwords * size_t.sizeof);
size_t stackidx = 0;
size_t cidx;
immutable(ModuleInfo*)[] mods = _modules;
size_t idx;
while (true)
{
while (idx < mods.length)
{
auto m = mods[idx];
immutable bitnum = findModule(m);
if (bitnum < 0 || bt(ctordone, bitnum))
{
/* If the module can't be found among the ones to be
* sorted it's an imported module from another DSO.
* Those don't need to be considered during sorting as
* the OS is responsible for the DSO load order and
* module construction is done during DSO loading.
*/
++idx;
continue;
}
else if (bt(ctorstart, bitnum))
{
/* Trace back to the begin of the cycle.
*/
bool ctorInCycle;
size_t start = stackidx;
while (start--)
{
auto sm = stack[start].mod;
if (sm == m)
break;
immutable sbitnum = findModule(sm);
assert(sbitnum >= 0);
if (bt(ctorstart, sbitnum))
ctorInCycle = true;
}
assert(stack[start].mod == m);
if (ctorInCycle)
{
/* This is an illegal cycle, no partial order can be established
* because the import chain have contradicting ctor/dtor
* constraints.
*/
string msg = "Aborting: Cycle detected between modules with ";
if (mask & (MIctor | MIdtor))
msg ~= "shared ";
msg ~= "ctors/dtors:\n";
foreach (e; stack[start .. stackidx])
{
msg ~= e.mod.name;
if (e.mod.flags & mask)
msg ~= '*';
msg ~= " ->\n";
}
msg ~= stack[start].mod.name;
free();
throw new Exception(msg);
}
else
{
/* This is also a cycle, but the import chain does not constrain
* the order of initialization, either because the imported
* modules have no ctors or the ctors are standalone.
*/
++idx;
}
}
else
{
if (m.flags & mask)
{
if (m.flags & MIstandalone || !m.importedModules.length)
{ // trivial ctor => sort in
ctors[cidx++] = m;
bts(ctordone, bitnum);
}
else
{ // non-trivial ctor => defer
bts(ctorstart, bitnum);
}
}
else // no ctor => mark as visited
{
bts(ctordone, bitnum);
}
if (m.importedModules.length)
{
/* Internal runtime error, recursion exceeds number of modules.
*/
(stackidx < _modules.length) || assert(0);
// recurse
stack[stackidx++] = StackRec(mods, idx);
idx = 0;
mods = m.importedModules;
}
}
}
if (stackidx)
{ // pop old value from stack
--stackidx;
mods = stack[stackidx]._mods;
idx = stack[stackidx]._idx;
auto m = mods[idx++];
immutable bitnum = findModule(m);
assert(bitnum >= 0);
if (m.flags & mask && !bts(ctordone, bitnum))
ctors[cidx++] = m;
}
else // done
break;
}
// store final number and shrink array
ctors = (cast(immutable(ModuleInfo)**).realloc(ctors.ptr, cidx * size_t.sizeof))[0 .. cidx];
}
/* Do two passes: ctor/dtor, tlsctor/tlsdtor
*/
sort(_ctors, MIctor | MIdtor);
sort(_tlsctors, MItlsctor | MItlsdtor);
}
void runCtors()
{
// run independent ctors
runModuleFuncs!(m => m.ictor)(_modules);
// sorted module ctors
runModuleFuncs!(m => m.ctor)(_ctors);
}
void runTlsCtors()
{
runModuleFuncs!(m => m.tlsctor)(_tlsctors);
}
void runTlsDtors()
{
runModuleFuncsRev!(m => m.tlsdtor)(_tlsctors);
}
void runDtors()
{
runModuleFuncsRev!(m => m.dtor)(_ctors);
}
void free()
{
if (_ctors.ptr)
.free(_ctors.ptr);
_ctors = null;
if (_tlsctors.ptr)
.free(_tlsctors.ptr);
_tlsctors = null;
// _modules = null; // let the owner free it
}
private:
immutable(ModuleInfo*)[] _modules;
immutable(ModuleInfo)*[] _ctors;
immutable(ModuleInfo)*[] _tlsctors;
}
/********************************************
* Iterate over all module infos.
*/
int moduleinfos_apply(scope int delegate(immutable(ModuleInfo*)) dg)
{
foreach (ref sg; SectionGroup)
{
foreach (m; sg.modules)
{
// TODO: Should null ModuleInfo be allowed?
if (m !is null)
{
if (auto res = dg(m))
return res;
}
}
}
return 0;
}
/********************************************
* Module constructor and destructor routines.
*/
extern (C)
{
void rt_moduleCtor()
{
foreach (ref sg; SectionGroup)
{
sg.moduleGroup.sortCtors();
sg.moduleGroup.runCtors();
}
}
void rt_moduleTlsCtor()
{
foreach (ref sg; SectionGroup)
{
sg.moduleGroup.runTlsCtors();
}
}
void rt_moduleTlsDtor()
{
foreach_reverse (ref sg; SectionGroup)
{
sg.moduleGroup.runTlsDtors();
}
}
void rt_moduleDtor()
{
foreach_reverse (ref sg; SectionGroup)
{
sg.moduleGroup.runDtors();
sg.moduleGroup.free();
}
}
version (Win32)
{
// Alternate names for backwards compatibility with older DLL code
void _moduleCtor()
{
rt_moduleCtor();
}
void _moduleDtor()
{
rt_moduleDtor();
}
void _moduleTlsCtor()
{
rt_moduleTlsCtor();
}
void _moduleTlsDtor()
{
rt_moduleTlsDtor();
}
}
}
/********************************************
*/
void runModuleFuncs(alias getfp)(const(immutable(ModuleInfo)*)[] modules)
{
foreach (m; modules)
{
if (auto fp = getfp(m))
(*fp)();
}
}
void runModuleFuncsRev(alias getfp)(const(immutable(ModuleInfo)*)[] modules)
{
foreach_reverse (m; modules)
{
if (auto fp = getfp(m))
(*fp)();
}
}
unittest
{
static void assertThrown(T : Throwable, E)(lazy E expr)
{
try
expr;
catch (T)
return;
assert(0);
}
static void stub()
{
}
static struct UTModuleInfo
{
this(uint flags)
{
mi._flags = flags;
}
void setImports(immutable(ModuleInfo)*[] imports...)
{
import core.bitop;
assert(flags & MIimportedModules);
immutable nfuncs = popcnt(flags & (MItlsctor|MItlsdtor|MIctor|MIdtor|MIictor));
immutable size = nfuncs * (void function()).sizeof +
size_t.sizeof + imports.length * (ModuleInfo*).sizeof;
assert(size <= pad.sizeof);
pad[nfuncs] = imports.length;
.memcpy(&pad[nfuncs+1], imports.ptr, imports.length * imports[0].sizeof);
}
immutable ModuleInfo mi;
size_t[8] pad;
alias mi this;
}
static UTModuleInfo mockMI(uint flags)
{
auto mi = UTModuleInfo(flags | MIimportedModules);
auto p = cast(void function()*)&mi.pad;
if (flags & MItlsctor) *p++ = &stub;
if (flags & MItlsdtor) *p++ = &stub;
if (flags & MIctor) *p++ = &stub;
if (flags & MIdtor) *p++ = &stub;
if (flags & MIictor) *p++ = &stub;
*cast(size_t*)p++ = 0; // number of imported modules
assert(cast(void*)p <= &mi + 1);
return mi;
}
static void checkExp(
immutable(ModuleInfo*)[] modules,
immutable(ModuleInfo*)[] dtors=null,
immutable(ModuleInfo*)[] tlsdtors=null)
{
auto mgroup = ModuleGroup(modules);
mgroup.sortCtors();
foreach (m; mgroup._modules)
assert(!(m.flags & (MIctorstart | MIctordone)));
assert(mgroup._ctors == dtors);
assert(mgroup._tlsctors == tlsdtors);
}
// no ctors
{
auto m0 = mockMI(0);
auto m1 = mockMI(0);
auto m2 = mockMI(0);
checkExp([&m0.mi, &m1.mi, &m2.mi]);
}
// independent ctors
{
auto m0 = mockMI(MIictor);
auto m1 = mockMI(0);
auto m2 = mockMI(MIictor);
auto mgroup = ModuleGroup([&m0.mi, &m1.mi, &m2.mi]);
checkExp([&m0.mi, &m1.mi, &m2.mi]);
}
// standalone ctor
{
auto m0 = mockMI(MIstandalone | MIctor);
auto m1 = mockMI(0);
auto m2 = mockMI(0);
auto mgroup = ModuleGroup([&m0.mi, &m1.mi, &m2.mi]);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m0.mi]);
}
// imported standalone => no dependency
{
auto m0 = mockMI(MIstandalone | MIctor);
auto m1 = mockMI(MIstandalone | MIctor);
auto m2 = mockMI(0);
m1.setImports(&m0.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m0.mi, &m1.mi]);
}
{
auto m0 = mockMI(MIstandalone | MIctor);
auto m1 = mockMI(MIstandalone | MIctor);
auto m2 = mockMI(0);
m0.setImports(&m1.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m0.mi, &m1.mi]);
}
// standalone may have cycle
{
auto m0 = mockMI(MIstandalone | MIctor);
auto m1 = mockMI(MIstandalone | MIctor);
auto m2 = mockMI(0);
m0.setImports(&m1.mi);
m1.setImports(&m0.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m0.mi, &m1.mi]);
}
// imported ctor => ordered ctors
{
auto m0 = mockMI(MIctor);
auto m1 = mockMI(MIctor);
auto m2 = mockMI(0);
m1.setImports(&m0.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m0.mi, &m1.mi], []);
}
{
auto m0 = mockMI(MIctor);
auto m1 = mockMI(MIctor);
auto m2 = mockMI(0);
m0.setImports(&m1.mi);
assert(m0.importedModules == [&m1.mi]);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m1.mi, &m0.mi], []);
}
// detects ctors cycles
{
auto m0 = mockMI(MIctor);
auto m1 = mockMI(MIctor);
auto m2 = mockMI(0);
m0.setImports(&m1.mi);
m1.setImports(&m0.mi);
assertThrown!Throwable(checkExp([&m0.mi, &m1.mi, &m2.mi]));
}
// imported ctor/tlsctor => ordered ctors/tlsctors
{
auto m0 = mockMI(MIctor);
auto m1 = mockMI(MIctor);
auto m2 = mockMI(MItlsctor);
m0.setImports(&m1.mi, &m2.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m1.mi, &m0.mi], [&m2.mi]);
}
{
auto m0 = mockMI(MIctor | MItlsctor);
auto m1 = mockMI(MIctor);
auto m2 = mockMI(MItlsctor);
m0.setImports(&m1.mi, &m2.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m1.mi, &m0.mi], [&m2.mi, &m0.mi]);
}
// no cycle between ctors/tlsctors
{
auto m0 = mockMI(MIctor);
auto m1 = mockMI(MIctor);
auto m2 = mockMI(MItlsctor);
m0.setImports(&m1.mi, &m2.mi);
m2.setImports(&m0.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m1.mi, &m0.mi], [&m2.mi]);
}
// detects tlsctors cycle
{
auto m0 = mockMI(MItlsctor);
auto m1 = mockMI(MIctor);
auto m2 = mockMI(MItlsctor);
m0.setImports(&m2.mi);
m2.setImports(&m0.mi);
assertThrown!Throwable(checkExp([&m0.mi, &m1.mi, &m2.mi]));
}
// closed ctors cycle
{
auto m0 = mockMI(MIctor);
auto m1 = mockMI(MIstandalone | MIctor);
auto m2 = mockMI(MIstandalone | MIctor);
m0.setImports(&m1.mi);
m1.setImports(&m2.mi);
m2.setImports(&m0.mi);
checkExp([&m0.mi, &m1.mi, &m2.mi], [&m1.mi, &m2.mi, &m0.mi]);
}
}
version (CRuntime_Microsoft)
{
// Dummy so Win32 code can still call it
extern(C) void _minit() { }
}
|
D
|
// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/diag10768.d(36): Error: cannot implicitly override base class method diag10768.Frop.frop with diag10768.Foo.frop; add 'override' attribute
---
*/
struct CirBuff(T)
{
import std.traits: isArray;
CirBuff!T opAssign(R)(R) if (isArray!R)
{}
T[] toArray()
{
T[] ret; // = new T[this.length];
return ret;
}
alias toArray this;
}
class Bar(T=int)
{
CirBuff!T _bar;
}
class Once
{
Bar!Foo _foobar;
}
class Foo : Frop
{
// override
public int frop() { return 1; }
}
class Frop
{
public int frop() { return 0; }
}
|
D
|
module godot.staticbody2d;
import std.meta : AliasSeq, staticIndexOf;
import std.traits : Unqual;
import godot.d.meta;
import godot.core;
import godot.c;
import godot.d.bind;
import godot.object;
import godot.classdb;
import godot.physicsbody2d;
@GodotBaseClass struct StaticBody2D
{
static immutable string _GODOT_internal_name = "StaticBody2D";
public:
union { godot_object _godot_object; PhysicsBody2D base; }
alias base this;
alias BaseClasses = AliasSeq!(typeof(base), typeof(base).BaseClasses);
bool opEquals(in StaticBody2D other) const { return _godot_object.ptr is other._godot_object.ptr; }
StaticBody2D opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
mixin baseCasts;
static StaticBody2D _new()
{
static godot_class_constructor constructor;
if(constructor is null) constructor = godot_get_class_constructor("StaticBody2D");
if(constructor is null) return typeof(this).init;
return cast(StaticBody2D)(constructor());
}
package(godot) static GodotMethod!(void, Vector2) _GODOT_set_constant_linear_velocity;
package(godot) alias _GODOT_methodBindInfo(string name : "set_constant_linear_velocity") = _GODOT_set_constant_linear_velocity;
void set_constant_linear_velocity(in Vector2 vel)
{
_GODOT_set_constant_linear_velocity.bind("StaticBody2D", "set_constant_linear_velocity");
ptrcall!(void)(_GODOT_set_constant_linear_velocity, _godot_object, vel);
}
package(godot) static GodotMethod!(void, float) _GODOT_set_constant_angular_velocity;
package(godot) alias _GODOT_methodBindInfo(string name : "set_constant_angular_velocity") = _GODOT_set_constant_angular_velocity;
void set_constant_angular_velocity(in float vel)
{
_GODOT_set_constant_angular_velocity.bind("StaticBody2D", "set_constant_angular_velocity");
ptrcall!(void)(_GODOT_set_constant_angular_velocity, _godot_object, vel);
}
package(godot) static GodotMethod!(Vector2) _GODOT_get_constant_linear_velocity;
package(godot) alias _GODOT_methodBindInfo(string name : "get_constant_linear_velocity") = _GODOT_get_constant_linear_velocity;
Vector2 get_constant_linear_velocity() const
{
_GODOT_get_constant_linear_velocity.bind("StaticBody2D", "get_constant_linear_velocity");
return ptrcall!(Vector2)(_GODOT_get_constant_linear_velocity, _godot_object);
}
package(godot) static GodotMethod!(float) _GODOT_get_constant_angular_velocity;
package(godot) alias _GODOT_methodBindInfo(string name : "get_constant_angular_velocity") = _GODOT_get_constant_angular_velocity;
float get_constant_angular_velocity() const
{
_GODOT_get_constant_angular_velocity.bind("StaticBody2D", "get_constant_angular_velocity");
return ptrcall!(float)(_GODOT_get_constant_angular_velocity, _godot_object);
}
package(godot) static GodotMethod!(void, float) _GODOT_set_friction;
package(godot) alias _GODOT_methodBindInfo(string name : "set_friction") = _GODOT_set_friction;
void set_friction(in float friction)
{
_GODOT_set_friction.bind("StaticBody2D", "set_friction");
ptrcall!(void)(_GODOT_set_friction, _godot_object, friction);
}
package(godot) static GodotMethod!(float) _GODOT_get_friction;
package(godot) alias _GODOT_methodBindInfo(string name : "get_friction") = _GODOT_get_friction;
float get_friction() const
{
_GODOT_get_friction.bind("StaticBody2D", "get_friction");
return ptrcall!(float)(_GODOT_get_friction, _godot_object);
}
package(godot) static GodotMethod!(void, float) _GODOT_set_bounce;
package(godot) alias _GODOT_methodBindInfo(string name : "set_bounce") = _GODOT_set_bounce;
void set_bounce(in float bounce)
{
_GODOT_set_bounce.bind("StaticBody2D", "set_bounce");
ptrcall!(void)(_GODOT_set_bounce, _godot_object, bounce);
}
package(godot) static GodotMethod!(float) _GODOT_get_bounce;
package(godot) alias _GODOT_methodBindInfo(string name : "get_bounce") = _GODOT_get_bounce;
float get_bounce() const
{
_GODOT_get_bounce.bind("StaticBody2D", "get_bounce");
return ptrcall!(float)(_GODOT_get_bounce, _godot_object);
}
}
|
D
|
/home/wayne/workspace/rust-projects/guess_game/target/debug/deps/rand-471273aa7956b9af.rmeta: /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/lib.rs /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/distributions/mod.rs /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/rand_impls.rs
/home/wayne/workspace/rust-projects/guess_game/target/debug/deps/librand-471273aa7956b9af.rlib: /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/lib.rs /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/distributions/mod.rs /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/rand_impls.rs
/home/wayne/workspace/rust-projects/guess_game/target/debug/deps/rand-471273aa7956b9af.d: /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/lib.rs /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/distributions/mod.rs /home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/rand_impls.rs
/home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/lib.rs:
/home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/distributions/mod.rs:
/home/wayne/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.23/src/rand_impls.rs:
|
D
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkArrayToTable;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import vtkTableAlgorithm;
class vtkArrayToTable : vtkTableAlgorithm.vtkTableAlgorithm {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkArrayToTable_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkArrayToTable obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new object.Exception("C++ destructor does not have public access");
}
swigCPtr = null;
super.dispose();
}
}
}
public static vtkArrayToTable New() {
void* cPtr = vtkd_im.vtkArrayToTable_New();
vtkArrayToTable ret = (cPtr is null) ? null : new vtkArrayToTable(cPtr, false);
return ret;
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkArrayToTable_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkArrayToTable SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkArrayToTable_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkArrayToTable ret = (cPtr is null) ? null : new vtkArrayToTable(cPtr, false);
return ret;
}
public vtkArrayToTable NewInstance() const {
void* cPtr = vtkd_im.vtkArrayToTable_NewInstance(cast(void*)swigCPtr);
vtkArrayToTable ret = (cPtr is null) ? null : new vtkArrayToTable(cPtr, false);
return ret;
}
alias vtkTableAlgorithm.vtkTableAlgorithm.NewInstance NewInstance;
}
|
D
|
# FIXED
mqttsn-transport/transport.obj: ../mqttsn-transport/transport.c
mqttsn-transport/transport.obj: ../mqttsn-transport/transport.h
mqttsn-transport/transport.obj: C:/ti/simplelink_cc13x0_sdk_1_50_00_08/source/ti/drivers/UART.h
mqttsn-transport/transport.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stddef.h
mqttsn-transport/transport.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdint.h
mqttsn-transport/transport.obj: C:/Users/shlomi/workspace_v7/simple_peripheral_cc1350lp_app_FlashROM/Application/tx_rx_channel.h
mqttsn-transport/transport.obj: C:/ti/simplelink_cc13x0_sdk_1_50_00_08/source/ti/blestack/hal/src/target/_common/hal_types.h
mqttsn-transport/transport.obj: C:/ti/simplelink_cc13x0_sdk_1_50_00_08/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h
mqttsn-transport/transport.obj: C:/ti/simplelink_cc13x0_sdk_1_50_00_08/examples/rtos/CC1350_LAUNCHXL/blestack/simple_peripheral/src/app/simple_peripheral.h
../mqttsn-transport/transport.c:
../mqttsn-transport/transport.h:
C:/ti/simplelink_cc13x0_sdk_1_50_00_08/source/ti/drivers/UART.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stddef.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdint.h:
C:/Users/shlomi/workspace_v7/simple_peripheral_cc1350lp_app_FlashROM/Application/tx_rx_channel.h:
C:/ti/simplelink_cc13x0_sdk_1_50_00_08/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_50_00_08/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h:
C:/ti/simplelink_cc13x0_sdk_1_50_00_08/examples/rtos/CC1350_LAUNCHXL/blestack/simple_peripheral/src/app/simple_peripheral.h:
|
D
|
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.build/HTTPTypes.swift.o : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPPipelineSetup.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPUpgradeHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPServerPipelineHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPServerProtocolErrorHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPResponseCompressor.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPTypes.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 /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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOZlib/include/c_nio_zlib.h /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/CNIOHTTPParser/include/c_nio_http_parser.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
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.build/HTTPTypes~partial.swiftmodule : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPPipelineSetup.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPUpgradeHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPServerPipelineHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPServerProtocolErrorHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPResponseCompressor.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPTypes.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 /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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOZlib/include/c_nio_zlib.h /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/CNIOHTTPParser/include/c_nio_http_parser.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
/Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.build/HTTPTypes~partial.swiftdoc : /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPPipelineSetup.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPDecoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPEncoder.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPUpgradeHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPServerPipelineHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPServerProtocolErrorHandler.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPResponseCompressor.swift /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/NIOHTTP1/HTTPTypes.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 /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 /Users/lb/Documents/Project/LearnVapor/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/lb/Documents/Project/LearnVapor/.build/checkouts/swift-nio.git-8756902686293799568/Sources/CNIOZlib/include/c_nio_zlib.h /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/CNIOHTTPParser/include/c_nio_http_parser.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
|
D
|
instance DIA_Bronko_EXIT(C_Info)
{
npc = BAU_935_Bronko;
nr = 999;
condition = DIA_Bronko_EXIT_Condition;
information = DIA_Bronko_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Bronko_EXIT_Condition()
{
return TRUE;
};
func void DIA_Bronko_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Bronko_HALLO(C_Info)
{
npc = BAU_935_Bronko;
nr = 1;
condition = DIA_Bronko_HALLO_Condition;
information = DIA_Bronko_HALLO_Info;
important = TRUE;
};
func int DIA_Bronko_HALLO_Condition()
{
return TRUE;
};
func void DIA_Bronko_HALLO_Info()
{
AI_Output(self,other,"DIA_Bronko_HALLO_06_00"); //(fatherly) So, where are we headed, then?
AI_Output(other,self,"DIA_Bronko_HALLO_15_01"); //Are you the foreman here?
if(hero.guild == GIL_NONE)
{
AI_Output(self,other,"DIA_Bronko_HALLO_06_02"); //I'll give you one upside the head, you rascal.
};
AI_Output(self,other,"DIA_Bronko_HALLO_06_03"); //If you want to go ambling across my land, you'll pay me 5 gold coins, or you're in for a good thrashing!
Info_ClearChoices(DIA_Bronko_HALLO);
Info_AddChoice(DIA_Bronko_HALLO,"Forget it. You won't get anything from me.",DIA_Bronko_HALLO_vergisses);
Info_AddChoice(DIA_Bronko_HALLO,"If I have no choice - here's your money.",DIA_Bronko_HALLO_hiergeld);
Info_AddChoice(DIA_Bronko_HALLO,"Your land? Are you the farmer here?",DIA_Bronko_HALLO_deinland);
};
func void DIA_Bronko_HALLO_deinland()
{
AI_Output(other,self,"DIA_Bronko_HALLO_deinland_15_00"); //Your land? Are you the farmer here?
AI_Output(self,other,"DIA_Bronko_HALLO_deinland_06_01"); //You can bet on that. Why else would I make you pay me a toll?
AI_Output(self,other,"DIA_Bronko_HALLO_deinland_06_02"); //I don't mind if you go ask the others about me. Heh heh!
};
func void DIA_Bronko_HALLO_hiergeld()
{
AI_Output(other,self,"DIA_Bronko_HALLO_hiergeld_15_00"); //If I have no choice - here's your money.
if(Npc_HasItems(other,ItMi_Gold) >= 5)
{
B_GiveInvItems(other,self,ItMi_Gold,5);
AI_Output(self,other,"DIA_Bronko_HALLO_hiergeld_06_01"); //(mischievously) Thank you. And have a nice day.
AI_StopProcessInfos(self);
}
else
{
AI_Output(self,other,"DIA_Bronko_HALLO_hiergeld_06_02"); //You don't even have 5 gold coins. Trying to pull a fast one, are you?
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
};
func void DIA_Bronko_HALLO_vergisses()
{
AI_Output(other,self,"DIA_Bronko_HALLO_vergisses_15_00"); //Forget it. You won't get anything from me.
if((hero.guild == GIL_NONE) || (hero.guild == GIL_SLD) || (hero.guild == GIL_DJG))
{
AI_Output(self,other,"DIA_Bronko_HALLO_vergisses_06_01"); //Then, I'm afraid, I'm going to have to tan your hide.
}
else
{
if((hero.guild == GIL_MIL) || (hero.guild == GIL_PAL))
{
AI_Output(self,other,"DIA_Bronko_HALLO_vergisses_06_02"); //You boys from the city guard are short of money, huh?
};
if(hero.guild == GIL_KDF)
{
AI_Output(self,other,"DIA_Bronko_HALLO_vergisses_06_03"); //I don't care if you are a magician. You'll have to pay. Understood?
};
};
Info_ClearChoices(DIA_Bronko_HALLO);
Info_AddChoice(DIA_Bronko_HALLO,"If I have no choice - here's your money.",DIA_Bronko_HALLO_hiergeld);
Info_AddChoice(DIA_Bronko_HALLO,"Come on and try it, then.",DIA_Bronko_HALLO_attack);
};
func void DIA_Bronko_HALLO_attack()
{
AI_Output(other,self,"DIA_Bronko_HALLO_attack_15_00"); //Come on and try it, then.
AI_Output(self,other,"DIA_Bronko_HALLO_attack_06_01"); //Well, in that case...
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
instance DIA_Bronko_KEINBAUER(C_Info)
{
npc = BAU_935_Bronko;
nr = 2;
condition = DIA_Bronko_KEINBAUER_Condition;
information = DIA_Bronko_KEINBAUER_Info;
permanent = TRUE;
description = "You, the farmer? Don't make me laugh. You're nobody, really.";
};
var int DIA_Bronko_KEINBAUER_noPerm;
func int DIA_Bronko_KEINBAUER_Condition()
{
if(((MIS_Sekob_Bronko_eingeschuechtert == LOG_Running) || (Babera_BronkoKeinBauer == TRUE)) && (self.aivar[AIV_LastFightAgainstPlayer] != FIGHT_LOST) && (DIA_Bronko_KEINBAUER_noPerm == FALSE))
{
return TRUE;
};
};
func void DIA_Bronko_KEINBAUER_Info()
{
AI_Output(other,self,"DIA_Bronko_KEINBAUER_15_00"); //You, the farmer? Don't make me laugh. You're nobody, really.
AI_Output(self,other,"DIA_Bronko_KEINBAUER_06_01"); //Whaaat? Want me to smash your face in?
Info_ClearChoices(DIA_Bronko_KEINBAUER);
if(hero.guild == GIL_NONE)
{
if(Babera_BronkoKeinBauer == TRUE)
{
Info_AddChoice(DIA_Bronko_KEINBAUER,"(threaten Bronko to fetch mercenaries)",DIA_Bronko_KEINBAUER_SLD);
};
if(MIS_Sekob_Bronko_eingeschuechtert == LOG_Running)
{
Info_AddChoice(DIA_Bronko_KEINBAUER,"Sekob is the farmer here, and you're nothing but a small-time crook.",DIA_Bronko_KEINBAUER_sekobderbauer);
};
};
Info_AddChoice(DIA_Bronko_KEINBAUER,"Well, let's see what you've got.",DIA_Bronko_KEINBAUER_attack);
Info_AddChoice(DIA_Bronko_KEINBAUER,"Never mind!",DIA_Bronko_KEINBAUER_schongut);
};
func void DIA_Bronko_KEINBAUER_attack()
{
AI_Output(other,self,"DIA_Bronko_KEINBAUER_attack_15_00"); //Well, let's see then what you've got.
AI_Output(self,other,"DIA_Bronko_KEINBAUER_attack_06_01"); //I hoped you would say that.
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
func void DIA_Bronko_KEINBAUER_sekobderbauer()
{
AI_Output(other,self,"DIA_Bronko_KEINBAUER_sekobderbauer_15_00"); //Sekob is the farmer here, and you're nothing but a small-time crook who's trying to wangle money out of people's pockets.
AI_Output(self,other,"DIA_Bronko_KEINBAUER_sekobderbauer_06_01"); //Says who?
AI_Output(other,self,"DIA_Bronko_KEINBAUER_sekobderbauer_15_02"); //Says me. Sekob wants you to go back to work instead of loafing around here.
AI_Output(self,other,"DIA_Bronko_KEINBAUER_sekobderbauer_06_03"); //So what? What are you going to do now?
};
func void DIA_Bronko_KEINBAUER_schongut()
{
AI_Output(other,self,"DIA_Bronko_KEINBAUER_schongut_15_00"); //Never mind!
AI_Output(self,other,"DIA_Bronko_KEINBAUER_schongut_06_01"); //Scram!
AI_StopProcessInfos(self);
};
func void DIA_Bronko_KEINBAUER_SLD()
{
AI_Output(other,self,"DIA_Bronko_KEINBAUER_SLD_15_00"); //All right, then I guess I'll have to tell Onar the landowner that there's a farmer mouthing off here who refuses to pay his rent.
AI_Output(self,other,"DIA_Bronko_KEINBAUER_SLD_06_01"); //Ahem. Wait a minute. Onar will send all his mercenaries after me.
AI_Output(other,self,"DIA_Bronko_KEINBAUER_SLD_15_02"); //So what?
AI_Output(self,other,"DIA_Bronko_KEINBAUER_SLD_06_03"); //All right, all right. I'll give you whatever you want, but leave the mercenaries out of this, OK?
if(B_GiveInvItems(self,other,ItMi_Gold,Npc_HasItems(self,ItMi_Gold)))
{
AI_Output(self,other,"DIA_Bronko_KEINBAUER_SLD_06_04"); //Here, I'll even give you all my gold.
};
AI_Output(self,other,"DIA_Bronko_KEINBAUER_SLD_06_05"); //And I'll go back to my field. Anything but the mercenaries.
AI_StopProcessInfos(self);
DIA_Bronko_KEINBAUER_noPerm = TRUE;
Npc_ExchangeRoutine(self,"Start");
MIS_Sekob_Bronko_eingeschuechtert = LOG_SUCCESS;
B_GivePlayerXP(XP_Ambient);
};
instance DIA_Bronko_FLEISSIG(C_Info)
{
npc = BAU_935_Bronko;
nr = 3;
condition = DIA_Bronko_FLEISSIG_Condition;
information = DIA_Bronko_FLEISSIG_Info;
permanent = TRUE;
description = "(taunt Bronko)";
};
func int DIA_Bronko_FLEISSIG_Condition()
{
if((MIS_Sekob_Bronko_eingeschuechtert == LOG_SUCCESS) || (self.aivar[AIV_LastFightAgainstPlayer] == FIGHT_LOST))
{
return TRUE;
};
};
func void DIA_Bronko_FLEISSIG_Info()
{
if(MIS_Sekob_Bronko_eingeschuechtert == LOG_SUCCESS)
{
AI_Output(other,self,"DIA_Bronko_FLEISSIG_15_00"); //So? Busy as a bee, are you?
}
else
{
AI_Output(other,self,"DIA_Bronko_FLEISSIG_15_01"); //So? Still got that big mouth?
};
if((hero.guild == GIL_SLD) || (hero.guild == GIL_DJG))
{
AI_Output(self,other,"DIA_Bronko_FLEISSIG_06_02"); //You're a mercenary, aren't you? I might have known.
}
else if(MIS_Sekob_Bronko_eingeschuechtert == LOG_SUCCESS)
{
AI_Output(self,other,"DIA_Bronko_FLEISSIG_06_03"); //(fearfully) You won't go fetch those mercenaries, huh?
};
if((self.aivar[AIV_LastFightAgainstPlayer] == FIGHT_LOST) || (hero.guild == GIL_SLD) || (hero.guild == GIL_DJG))
{
AI_Output(self,other,"DIA_Bronko_FLEISSIG_06_04"); //Don't beat me, please.
};
AI_Output(self,other,"DIA_Bronko_FLEISSIG_06_05"); //I'll even go back to work, OK?
MIS_Sekob_Bronko_eingeschuechtert = LOG_SUCCESS;
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"Start");
};
instance DIA_Bronko_PICKPOCKET(C_Info)
{
npc = BAU_935_Bronko;
nr = 900;
condition = DIA_Bronko_PICKPOCKET_Condition;
information = DIA_Bronko_PICKPOCKET_Info;
permanent = TRUE;
description = Pickpocket_60;
};
func int DIA_Bronko_PICKPOCKET_Condition()
{
return C_Beklauen(54,80);
};
func void DIA_Bronko_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Bronko_PICKPOCKET);
Info_AddChoice(DIA_Bronko_PICKPOCKET,Dialog_Back,DIA_Bronko_PICKPOCKET_BACK);
Info_AddChoice(DIA_Bronko_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Bronko_PICKPOCKET_DoIt);
};
func void DIA_Bronko_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Bronko_PICKPOCKET);
};
func void DIA_Bronko_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Bronko_PICKPOCKET);
};
|
D
|
/*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
module dwt.dnd.ImageTransfer;
import dwt.DWT;
import dwt.graphics.Image;
import dwt.graphics.ImageData;
import dwt.graphics.RGB;
import dwt.internal.win32.OS;
import dwt.internal.ole.win32.COM;
import dwt.internal.ole.win32.OBJIDL;
import dwt.dnd.ByteArrayTransfer;
import dwt.dnd.TransferData;
import dwt.dnd.DND;
import dwt.dwthelper.utils;
/**
* The class <code>ImageTransfer</code> provides a platform specific mechanism
* for converting an Image represented as a java <code>ImageData</code> to a
* platform specific representation of the data and vice versa.
*
* <p>An example of a java <code>ImageData</code> is shown below:</p>
*
* <code><pre>
* Image image = new Image(display, "C:\temp\img1.gif");
* ImageData imgData = image.getImageData();
* </code></pre>
*
* @see Transfer
*
* @since 3.4
*/
public class ImageTransfer : ByteArrayTransfer {
private static ImageTransfer _instance;
private static const String CF_DIB = "CF_DIB"; //$NON-NLS-1$
private static const int CF_DIBID = COM.CF_DIB;
static this(){
_instance = new ImageTransfer();
}
private this() {
}
/**
* Returns the singleton instance of the ImageTransfer class.
*
* @return the singleton instance of the ImageTransfer class
*/
public static ImageTransfer getInstance () {
return _instance;
}
/**
* This implementation of <code>javaToNative</code> converts an ImageData object represented
* by java <code>ImageData</code> to a platform specific representation.
*
* @param object a java <code>ImageData</code> containing the ImageData to be converted
* @param transferData an empty <code>TransferData</code> object that will
* be filled in on return with the platform specific format of the data
*
* @see Transfer#nativeToJava
*/
public void javaToNative(Object object, TransferData transferData) {
if (!checkImage(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
ImageData imgData = cast(ImageData)object;
if (imgData is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
int imageSize = imgData.data.length;
int imageHeight = imgData.height;
int bytesPerLine = imgData.bytesPerLine;
BITMAPINFOHEADER bmiHeader;
bmiHeader.biSize = BITMAPINFOHEADER.sizeof;
bmiHeader.biSizeImage = imageSize;
bmiHeader.biWidth = imgData.width;
bmiHeader.biHeight = imageHeight;
bmiHeader.biPlanes = 1;
bmiHeader.biBitCount = cast(short)imgData.depth;
bmiHeader.biCompression = OS.DIB_RGB_COLORS;
int colorSize = 0;
if (bmiHeader.biBitCount <= 8) {
colorSize += (1 << bmiHeader.biBitCount) * 4;
}
byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + colorSize];
OS.MoveMemory(bmi.ptr, &bmiHeader, BITMAPINFOHEADER.sizeof);
RGB[] rgbs = imgData.palette.getRGBs();
if (rgbs !is null && colorSize > 0) {
int offset = BITMAPINFOHEADER.sizeof;
for (int j = 0; j < rgbs.length; j++) {
bmi[offset] = cast(byte)rgbs[j].blue;
bmi[offset + 1] = cast(byte)rgbs[j].green;
bmi[offset + 2] = cast(byte)rgbs[j].red;
bmi[offset + 3] = 0;
offset += 4;
}
}
auto newPtr = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, BITMAPINFOHEADER.sizeof + colorSize + imageSize);
OS.MoveMemory(newPtr, bmi.ptr, bmi.length);
auto pBitDest = newPtr + BITMAPINFOHEADER.sizeof + colorSize;
if (imageHeight <= 0) {
OS.MoveMemory(pBitDest, imgData.data.ptr, imageSize);
} else {
int offset = 0;
pBitDest += bytesPerLine * (imageHeight - 1);
byte[] scanline = new byte[bytesPerLine];
for (int i = 0; i < imageHeight; i++) {
System.arraycopy(imgData.data, offset, scanline, 0, bytesPerLine);
OS.MoveMemory(pBitDest, scanline.ptr, bytesPerLine);
offset += bytesPerLine;
pBitDest -= bytesPerLine;
}
}
transferData.stgmedium = new STGMEDIUM();
transferData.stgmedium.tymed = COM.TYMED_HGLOBAL;
transferData.stgmedium.unionField = newPtr;
transferData.stgmedium.pUnkForRelease = null;
transferData.result = COM.S_OK;
}
/**
* This implementation of <code>nativeToJava</code> converts a platform specific
* representation of an image to java <code>ImageData</code>.
*
* @param transferData the platform specific representation of the data to be converted
* @return a java <code>ImageData</code> of the image if the conversion was successful;
* otherwise null
*
* @see Transfer#javaToNative
*/
public Object nativeToJava(TransferData transferData) {
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
IDataObject dataObject = cast(IDataObject)(transferData.pIDataObject);
dataObject.AddRef();
FORMATETC* formatetc = new FORMATETC();
formatetc.cfFormat = COM.CF_DIB;
formatetc.ptd = null;
formatetc.dwAspect = COM.DVASPECT_CONTENT;
formatetc.lindex = -1;
formatetc.tymed = COM.TYMED_HGLOBAL;
STGMEDIUM* stgmedium = new STGMEDIUM();
stgmedium.tymed = COM.TYMED_HGLOBAL;
transferData.result = getData(dataObject, formatetc, stgmedium);
if (transferData.result !is COM.S_OK) return null;
HANDLE hMem = stgmedium.unionField;
dataObject.Release();
try {
auto ptr = OS.GlobalLock(hMem);
if (ptr is null) return null;
try {
BITMAPINFOHEADER bmiHeader;
OS.MoveMemory(&bmiHeader, ptr, BITMAPINFOHEADER.sizeof);
void* pBits;
auto memDib = OS.CreateDIBSection(null, cast(BITMAPINFO*)ptr, OS.DIB_RGB_COLORS, &pBits, null, 0);
if (memDib is null) DWT.error(DWT.ERROR_NO_HANDLES);
void* bits = ptr + bmiHeader.biSize;
if (bmiHeader.biBitCount <= 8) {
bits += (1 << bmiHeader.biBitCount) * 4;
} else if (bmiHeader.biCompression is OS.BI_BITFIELDS) {
bits += 12;
}
if (bmiHeader.biHeight < 0) {
OS.MoveMemory(pBits, bits, bmiHeader.biSizeImage);
} else {
DIBSECTION dib;
OS.GetObject(memDib, DIBSECTION.sizeof, &dib);
int biHeight = dib.dsBmih.biHeight;
int scanline = dib.dsBmih.biSizeImage / biHeight;
auto pDestBits = pBits;
auto pSourceBits = bits + scanline * (biHeight - 1);
for (int i = 0; i < biHeight; i++) {
OS.MoveMemory(pDestBits, pSourceBits, scanline);
pDestBits += scanline;
pSourceBits -= scanline;
}
}
Image image = Image.win32_new(null, DWT.BITMAP, memDib);
ImageData data = image.getImageData();
OS.DeleteObject(memDib);
image.dispose();
return data;
} finally {
OS.GlobalUnlock(hMem);
}
} finally {
OS.GlobalFree(hMem);
}
}
protected int[] getTypeIds(){
return [CF_DIBID];
}
protected String[] getTypeNames(){
return [CF_DIB];
}
bool checkImage(Object object) {
if (object is null || !(null !is cast(ImageData)object )) return false;
return true;
}
protected bool validate(Object object) {
return checkImage(object);
}
}
|
D
|
//Гоблин Шаман
prototype Mst_Default_Gobbo_MAG(C_Npc)
{
name[0] = "Гоблин - Шаман";
guild = GIL_GOBBO;
aivar[AIV_MM_REAL_ID] = ID_GOBBO_MAGE;
level = 9;
B_DS_SetMst_Attribute(cMst_Default_Gobbo_MAG);
protection[PROT_BLUNT] = 60;
protection[PROT_EDGE] = 60;
protection[PROT_POINT] = 60;
protection[PROT_FIRE] = 60;
protection[PROT_FLY] = 60;
protection[PROT_MAGIC] = 60;
damagetype = DAM_EDGE;
fight_tactic = FAI_GOBBO;
senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL;
senses_range = PERC_DIST_ORC_ACTIVE_MAX;
aivar[AIV_MM_ThreatenBeforeAttack] = TRUE;
aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM;
aivar[AIV_MM_FollowInWater] = FALSE;
aivar[AIV_MM_Packhunter] = TRUE;
start_aistate = ZS_MM_AllScheduler;
aivar[AIV_MM_OrcSitStart] = 6;
aivar[AIV_MM_OrcSitEnd] = 20;
aivar[AIV_MM_RestStart] = 20;
aivar[AIV_MM_RestEnd] = 6;
};
func void B_SetVisuals_Gobbo_MAG()
{
Mdl_SetVisual(self,"Gobbo.mds");
Mdl_SetVisualBody(self,"GOB_ShamanBody",1,DEFAULT,"",DEFAULT,DEFAULT,-1);
};
func void B_SetVisuals_Gobbo_MAG0()
{
Mdl_SetVisual(self,"Gobbo.mds");
Mdl_SetVisualBody(self,"GOB_ShamanBody",0,DEFAULT,"",DEFAULT,DEFAULT,-1);
};
func void B_SetVisuals_Gobbo_MAG2()
{
Mdl_SetVisual(self,"Gobbo.mds");
Mdl_SetVisualBody(self,"GOB_ShamanBody",2,DEFAULT,"",DEFAULT,DEFAULT,-1);
};
func void B_SetVisuals_Gobbo_MAG3()
{
Mdl_SetVisual(self,"Gobbo.mds");
Mdl_SetVisualBody(self,"GOB_ShamanBody",3,DEFAULT,"",DEFAULT,DEFAULT,-1);
};
|
D
|
import std.algorithm;
import std.file;
import std.path;
import std.range;
import std.stdio;
import std.string;
// Скрипт ходит по папкам и считает количество строк в исходниках
// самым тупым образом
int sutableStringsCount(T)( T range ) {
return range
.map!(a => a.strip!() ) // выкидываем пробелы
.filter!( a => !a.empty ) // не считаем пустые строки
//.filter!( a => !a.startsWith!()("//") ) // не комментарии
.array // ??? зачем-то в массив нужно склеивать
.length;
}
void calc( string path ) {
dirEntries(path, SpanMode.breadth)
.filter!(a => a.isFile)
//.filter!(a => a.name.endsWith!()("cpp") || a.name.endsWith!()("h") || a.name.endsWith!()("cxx") || a.name.endsWith!()("hxx") )
.filter!(a => a.name.endsWith!()("cpp") || a.name.endsWith!()("h") || a.name.endsWith!()("qml")
//|| a.name.endsWith!()("cxx") || a.name.endsWith!()("hxx")
)
.filter!(a => a.name.find( "_PROJEC" ).empty() )
//.filter!(a => a.name.find( "Presentation" ).empty() )
//.filter!(a => a.name.find( "G2D" ).empty() )
//.filter!(a => a.name.find( "G3D" ).empty() )
//.filter!(a => a.name.find( "Widget" ).empty() )
//.filter!(a => !(a.name.endsWith!()("_t.cpp") || a.name.endsWith!()("_t.h")) )
//.filter!(a => !(a.name.endsWith!()("Mock.cpp") || a.name.endsWith!()("Mock.h")) )
.map!(a => (cast(string) std.file.read(a)))
.map!(a => a.splitLines)
.map!sutableStringsCount
.sum
.writeln;
}
void main() {
//calc(`F:\Work\DAC\designgui\src\Repository\MeasRepoSQLImpl`);
calc(`F:\Work\DAC\designgui\src\`);
}
|
D
|
/*******************************************
* NSC benutzt Kochkessel *
*******************************************/
FUNC VOID ZS_MineBellows ()
{
//PrintDebugNpc (PD_TA_FRAME,"ZS_MineBellows");
B_SetPerception (self);
if (!C_BodyStateContains(self, BS_MOBINTERACT_INTERRUPT))
{
AI_SetWalkmode (self,NPC_WALK); // Walkmode für den Zustand
if ((Hlp_StrCmp(Npc_GetNearestWp (self),self.wp)== 0))
{
AI_GotoWP (self, self.wp);
};
};
};
FUNC VOID ZS_MineBellows_Loop()
{
//PrintDebugNpc (PD_TA_LOOP,"ZS_MineBellows_Loop");
AI_UseMob(self,"BELLOW",1); // Benutze den Mob einmal bis zum angegebenen State
AI_UseMob (self,"BELLOW",0); //Verlassen sie bitte ihr Mobsi
};
FUNC VOID ZS_MineBellows_End()
{
//PrintDebugNpc (PD_TA_FRAME,"ZS_MineBellows_End");
AI_UseMob (self,"BELLOW",-1); //Verlassen sie bitte ihr Mobsi
};
|
D
|
module UnrealScript.UnrealEd.InterpTrackLinearColorPropHelper;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.UnrealEd.InterpTrackVectorPropHelper;
extern(C++) interface InterpTrackLinearColorPropHelper : InterpTrackVectorPropHelper
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class UnrealEd.InterpTrackLinearColorPropHelper")); }
private static __gshared InterpTrackLinearColorPropHelper mDefaultProperties;
@property final static InterpTrackLinearColorPropHelper DefaultProperties() { mixin(MGDPC("InterpTrackLinearColorPropHelper", "InterpTrackLinearColorPropHelper UnrealEd.Default__InterpTrackLinearColorPropHelper")); }
}
|
D
|
/Users/ThiagoBevi/Dev-iOS/Marvel/Build/Intermediates/Pods.build/Debug-iphonesimulator/Quick.build/Objects-normal/x86_64/NSBundle+CurrentTestBundle.o : /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/DSL/World+DSL.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/DSL/DSL.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ExampleMetadata.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/World.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Example.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/URL+FileName.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Callsite.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/QuickTestSuite.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Configuration/Configuration.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Configuration/QuickConfiguration.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ExampleGroup.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Filter.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Behavior.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/Closures.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ErrorUtility.swift /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QCKDSL.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick-umbrella.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QuickSpec.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QuickConfiguration.h /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick.modulemap /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ThiagoBevi/Dev-iOS/Marvel/Build/Intermediates/Pods.build/Debug-iphonesimulator/Quick.build/Objects-normal/x86_64/NSBundle+CurrentTestBundle~partial.swiftmodule : /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/DSL/World+DSL.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/DSL/DSL.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ExampleMetadata.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/World.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Example.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/URL+FileName.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Callsite.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/QuickTestSuite.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Configuration/Configuration.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Configuration/QuickConfiguration.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ExampleGroup.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Filter.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Behavior.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/Closures.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ErrorUtility.swift /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QCKDSL.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick-umbrella.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QuickSpec.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QuickConfiguration.h /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick.modulemap /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ThiagoBevi/Dev-iOS/Marvel/Build/Intermediates/Pods.build/Debug-iphonesimulator/Quick.build/Objects-normal/x86_64/NSBundle+CurrentTestBundle~partial.swiftdoc : /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/DSL/World+DSL.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/DSL/DSL.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ExampleMetadata.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/World.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Example.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/URL+FileName.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Callsite.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/QuickTestSuite.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Configuration/Configuration.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Configuration/QuickConfiguration.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ExampleGroup.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Filter.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Behavior.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/Closures.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Quick/Sources/Quick/ErrorUtility.swift /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/XCTest.swiftmodule /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QCKDSL.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick-umbrella.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QuickSpec.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick.h /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/QuickConfiguration.h /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap /Users/ThiagoBevi/Dev-iOS/Marvel/Pods/Headers/Public/Quick/Quick.modulemap /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/objc/ObjectiveC.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/Darwin.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/ThiagoBevi/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/Users/lanussebaptiste/Desktop/NSURLSessionDownload/Build/Intermediates/NSURLSessionDownload.build/Debug-iphoneos/NSURLSessionDownload.build/Objects-normal/arm64/ViewController.o : /Users/lanussebaptiste/Desktop/NSURLSessionDownload/NSURLSessionDownload/ViewController.swift /Users/lanussebaptiste/Desktop/NSURLSessionDownload/NSURLSessionDownload/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreImage.swiftmodule
/Users/lanussebaptiste/Desktop/NSURLSessionDownload/Build/Intermediates/NSURLSessionDownload.build/Debug-iphoneos/NSURLSessionDownload.build/Objects-normal/arm64/ViewController~partial.swiftmodule : /Users/lanussebaptiste/Desktop/NSURLSessionDownload/NSURLSessionDownload/ViewController.swift /Users/lanussebaptiste/Desktop/NSURLSessionDownload/NSURLSessionDownload/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreImage.swiftmodule
/Users/lanussebaptiste/Desktop/NSURLSessionDownload/Build/Intermediates/NSURLSessionDownload.build/Debug-iphoneos/NSURLSessionDownload.build/Objects-normal/arm64/ViewController~partial.swiftdoc : /Users/lanussebaptiste/Desktop/NSURLSessionDownload/NSURLSessionDownload/ViewController.swift /Users/lanussebaptiste/Desktop/NSURLSessionDownload/NSURLSessionDownload/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreImage.swiftmodule
|
D
|
module pebble.grect;
import pebble.gpoint;
@nogc:
nothrow:
/**
* Represents a rectangle and defining it using the origin of
* the upper-lefthand corner and its size.
*/
struct GRect {
GPoint origin;
GSize size;
/// Create a rectangle with an origin and a size.
@nogc @safe pure nothrow
this(GPoint origin, GSize size) {
this.origin = origin;
this.size = size;
}
deprecated(
"Use GRect(GPoint(x, y), GSize(w, h)) "
"instead of GRect(x, y, w, h)"
)
@nogc @safe pure nothrow
this(short x, short y, short w, short h) {
this(GPoint(x, y), GSize(w, h));
}
/**
* Tests whether the size of the rectangle is (0, 0).
*
* Note: If the width and/or height of a rectangle is negative, this
* function will return `true`!
*
* Returns: `true` if the rectangle its size is (0, 0), or `false` if not.
*/
@nogc @safe pure nothrow
@property bool is_empty() const {
return size.w == 0 && size.h == 0;
}
/**
* Converts the rectangle's values so that the components of its size
* (width and/or height) are both positive.
*
* If the width and/or height are negative, the origin will offset,
* so that the final rectangle overlaps with the original.
*
* For example, a GRect with size (-10, -5) and origin (20, 20),
* will be standardized to size (10, 5) and origin (10, 15).
*/
@nogc @safe pure nothrow
void standardize() {
if (size.w < 0) {
origin.x += size.w;
size.w = -size.w;
}
if (size.h < 0) {
origin.y += size.h;
size.h = -size.h;
}
}
}
/// A zero GRect.
enum GRectZero = GRect.init;
deprecated("Use x == y instead of grect_equal(&x, &y)")
@safe pure
bool grect_equal(const GRect* rect_a, const GRect* rect_b) {
return *rect_a == *rect_b;
}
deprecated("Use x.is_empty instead of grect_is_empty(&x)")
@safe pure
bool grect_is_empty(const GRect* rect) {
return rect.is_empty;
}
deprecated("Use x.standardize() instead of grect_standardize(&x)")
@safe pure
void grect_standardize(GRect* rect) {
rect.standardize();
}
// TODO: Implement this in D instead.
/// Clip one rectangle with another.
extern(C) void grect_clip(GRect* rect_to_clip, const GRect* rect_clipper);
/**
* Tests whether a rectangle contains a point.
*
* Params:
* rect = The rectangle
* point = The point
*
* Returns: `true` if the rectangle contains the point, or `false` if it
* does not.
*/
extern(C) bool grect_contains_point(const(GRect)* rect, const(GPoint)* point);
/**
* Convenience function to compute the center-point of a given rectangle.
*
* This is equal to `(rect->x + rect->width / 2, rect->y + rect->height / 2)`.
*
* Params:
* rect = The rectangle for which to calculate the center point.
*
* Returns: The point at the center of `rect`
*/
extern(C) GPoint grect_center_point(const(GRect)* rect);
/**
* Reduce the width and height of a rectangle by insetting each of the edges
* with a fixed inset. The returned rectangle will be centered relative to
* the input rectangle.
*
* Note: The function will trip an assertion if the crop yields a rectangle
* with negative width or height.
*
* A positive inset value results in a smaller rectangle, while negative
* inset value results in a larger rectangle.
*
* Params:
* rect = The rectangle that will be inset.
* crop_size_px = The inset by which each of the rectangle will be inset.
*
* Returns: The cropped rectangle.
*/
extern(C) GRect grect_crop(GRect rect, const int crop_size_px);
/**
* Values to specify how two things should be aligned relative to each other.
*
* See_Also: bitmap_layer_set_alignment()
*/
enum GAlign {
/// Align by centering.
center = 0,
/// Align by making the top edges overlap and left edges overlap.
topLeft = 1,
/// Align by making the top edges overlap and left edges overlap.
topRight = 2,
/// Align by making the top edges overlap and centered horizontally.
top = 3,
/// Align by making the left edges overlap and centered vertically.
left = 4,
/// Align by making the bottom edges overlap and centered horizontally.
bottom = 5,
/// Align by making the right edges overlap and centered vertically.
right = 6,
/// Align by making the bottom edges overlap and right edges overlap.
bottomRight = 7,
/// Align by making the bottom edges overlap and left edges overlap.
bottomLeft = 8
}
///
alias GAlignCenter = GAlign.center;
///
alias GAlignTopLeft = GAlign.topLeft;
///
alias GAlignTopRight = GAlign.topRight;
///
alias GAlignTop = GAlign.top;
///
alias GAlignLeft = GAlign.left;
///
alias GAlignBottom = GAlign.bottom;
///
alias GAlignRight = GAlign.right;
///
alias GAlignBottomRight = GAlign.bottomRight;
///
alias GAlignBottomLeft = GAlign.bottomLeft;
/**
* Aligns one rectangle within another rectangle, using an alignment parameter.
* The relative coordinate systems of both rectangles are assumed to be the
* same. When clip is true, `rect` is also clipped by the constraint.
*
* Params:
* rect = The rectangle to align (in place).
* inside_rect = The rectangle in which to align `rect`.
* alignment = Determines the alignment of `rect` within `inside_rect` by
* specifying what edges of should overlap.
* clip = Determines whether `rect` should be trimmed using the edges of
* `inside_rect` in case `rect` extends outside of the area that
* `inside_rect` covers after the alignment.
*/
extern(C) void grect_align(GRect* rect, const(GRect)* inside_rect,
const GAlign alignment, const bool clip);
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.graphics.ImageLoaderEvent;
import java.lang.all;
public import org.eclipse.swt.internal.SWTEventObject;
public import org.eclipse.swt.graphics.ImageLoader;
public import org.eclipse.swt.graphics.ImageData;
/**
* Instances of this class are sent as a result of the incremental
* loading of image data.
* <p>
* <b>Notes:</b>
* </p><ul>
* <li>The number of events which will be sent when loading images
* is not constant. It varies by image type, and for JPEG images it
* varies from image to image.</li>
* <li>For image sources which contain multiple images, the
* <code>endOfImage</code> flag in the event will be set to true
* after each individual image is loaded.</li>
* </ul>
*
* @see ImageLoader
* @see ImageLoaderListener
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public class ImageLoaderEvent : SWTEventObject {
/**
* if the <code>endOfImage</code> flag is false, then this is a
* partially complete copy of the current <code>ImageData</code>,
* otherwise this is a completely loaded <code>ImageData</code>
*/
public ImageData imageData;
/**
* the zero-based count of image data increments -- this is
* equivalent to the number of events that have been generated
* while loading a particular image
*/
public int incrementCount;
/**
* If this flag is true, then the current image data has been
* completely loaded, otherwise the image data is only partially
* loaded, and further ImageLoader events will occur unless an
* exception is thrown
*/
public bool endOfImage;
//static final long serialVersionUID = 3257284738325558065L;
/**
* Constructs a new instance of this class given the event source and
* the values to store in its fields.
*
* @param source the ImageLoader that was loading when the event occurred
* @param imageData the image data for the event
* @param incrementCount the image data increment for the event
* @param endOfImage the end of image flag for the event
*/
public this(ImageLoader source, ImageData imageData, int incrementCount, bool endOfImage) {
super(source);
this.imageData = imageData;
this.incrementCount = incrementCount;
this.endOfImage = endOfImage;
}
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the event
*/
public override String toString () {
return Format( "ImageLoaderEvent {{source={} imageData={} incrementCount={} endOfImage={}}", source, imageData, incrementCount, endOfImage); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
}
|
D
|
/home/bahroz/Desktop/11-usart/target/debug/build/typenum-33bd231a262037b9/build_script_main-33bd231a262037b9: /home/bahroz/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.11.2/build/main.rs /home/bahroz/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.11.2/build/op.rs
/home/bahroz/Desktop/11-usart/target/debug/build/typenum-33bd231a262037b9/build_script_main-33bd231a262037b9.d: /home/bahroz/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.11.2/build/main.rs /home/bahroz/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.11.2/build/op.rs
/home/bahroz/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.11.2/build/main.rs:
/home/bahroz/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.11.2/build/op.rs:
|
D
|
/**
This module contains the core functionality of the vibe.d framework.
See `runApplication` for the main entry point for typical vibe.d
server or GUI applications.
Copyright: © 2012-2016 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module vibe.core.core;
public import vibe.core.driver;
import vibe.core.args;
import vibe.core.concurrency;
import vibe.core.log;
import vibe.utils.array;
import std.algorithm;
import std.conv;
import std.encoding;
import core.exception;
import std.exception;
import std.functional;
import std.range : empty, front, popFront;
import std.string;
import std.variant;
import std.typecons : Typedef, Tuple, tuple;
import core.atomic;
import core.sync.condition;
import core.sync.mutex;
import core.stdc.stdlib;
import core.thread;
alias TaskEventCb = void function(TaskEvent, Task) nothrow;
version(Posix)
{
import core.sys.posix.signal;
import core.sys.posix.unistd;
import core.sys.posix.pwd;
static if (__traits(compiles, {import core.sys.posix.grp; getgrgid(0);})) {
import core.sys.posix.grp;
} else {
extern (C) {
struct group {
char* gr_name;
char* gr_passwd;
gid_t gr_gid;
char** gr_mem;
}
group* getgrgid(gid_t);
group* getgrnam(in char*);
}
}
}
version (Windows)
{
import core.stdc.signal;
}
/**************************************************************************************************/
/* Public functions */
/**************************************************************************************************/
/**
Performs final initialization and runs the event loop.
This function performs three tasks:
$(OL
$(LI Makes sure that no unrecognized command line options are passed to
the application and potentially displays command line help. See also
`vibe.core.args.finalizeCommandLineOptions`.)
$(LI Performs privilege lowering if required.)
$(LI Runs the event loop and blocks until it finishes.)
)
Params:
args_out = Optional parameter to receive unrecognized command line
arguments. If left to `null`, an error will be reported if
any unrecognized argument is passed.
See_also: ` vibe.core.args.finalizeCommandLineOptions`, `lowerPrivileges`,
`runEventLoop`
*/
int runApplication(scope void delegate(string[]) args_out = null)
{
try {
string[] args;
if (!finalizeCommandLineOptions(args_out is null ? null : &args)) return 0;
if (args_out) args_out(args);
} catch (Exception e) {
logDiagnostic("Error processing command line: %s", e.msg);
return 1;
}
lowerPrivileges();
logDiagnostic("Running event loop...");
int status;
version (VibeDebugCatchAll) {
try {
status = runEventLoop();
} catch( Throwable th ){
logError("Unhandled exception in event loop: %s", th.msg);
logDiagnostic("Full exception: %s", th.toString().sanitize());
return 1;
}
} else {
status = runEventLoop();
}
logDiagnostic("Event loop exited with status %d.", status);
return status;
}
/// A simple echo server, listening on a privileged TCP port.
unittest {
import vibe.core.core;
import vibe.core.net;
int main()
{
// first, perform any application specific setup (privileged ports still
// available if run as root)
listenTCP(7, (conn) { conn.pipe(conn); });
// then use runApplication to perform the remaining initialization and
// to run the event loop
return runApplication();
}
}
/** The same as above, but performing the initialization sequence manually.
This allows to skip any additional initialization (opening the listening
port) if an invalid command line argument or the `--help` switch is
passed to the application.
*/
unittest {
import vibe.core.core;
import vibe.core.net;
int main()
{
// process the command line first, to be able to skip the application
// setup if not required
if (!finalizeCommandLineOptions()) return 0;
// then set up the application
listenTCP(7, (conn) { conn.pipe(conn); });
// finally, perform privilege lowering (safe to skip for non-server
// applications)
lowerPrivileges();
// and start the event loop
return runEventLoop();
}
}
/**
Starts the vibe.d event loop for the calling thread.
Note that this function is usually called automatically by the vibe.d
framework. However, if you provide your own `main()` function, you may need
to call either this or `runApplication` manually.
The event loop will by default continue running during the whole life time
of the application, but calling `runEventLoop` multiple times in sequence
is allowed. Tasks will be started and handled only while the event loop is
running.
Returns:
The returned value is the suggested code to return to the operating
system from the `main` function.
See_Also: `runApplication`
*/
int runEventLoop()
{
setupSignalHandlers();
logDebug("Starting event loop.");
s_eventLoopRunning = true;
scope (exit) {
s_eventLoopRunning = false;
s_exitEventLoop = false;
st_threadShutdownCondition.notifyAll();
}
// runs any yield()ed tasks first
assert(!s_exitEventLoop);
s_exitEventLoop = false;
driverCore.notifyIdle();
if (getExitFlag()) return 0;
// handle exit flag in the main thread to exit when
// exitEventLoop(true) is called from a thread)
if (Thread.getThis() is st_threads[0].thread)
runTask(toDelegate(&watchExitFlag));
if (auto err = getEventDriver().runEventLoop() != 0) {
if (err == 1) {
logDebug("No events active, exiting message loop.");
return 0;
}
logError("Error running event loop: %d", err);
return 1;
}
logDebug("Event loop done.");
return 0;
}
/**
Stops the currently running event loop.
Calling this function will cause the event loop to stop event processing and
the corresponding call to runEventLoop() will return to its caller.
Params:
shutdown_all_threads = If true, exits event loops of all threads -
false by default. Note that the event loops of all threads are
automatically stopped when the main thread exits, so usually
there is no need to set shutdown_all_threads to true.
*/
void exitEventLoop(bool shutdown_all_threads = false)
{
logDebug("exitEventLoop called (%s)", shutdown_all_threads);
assert(s_eventLoopRunning || shutdown_all_threads,
"Trying to exit event loop when no loop is running.");
if (shutdown_all_threads) {
atomicStore(st_term, true);
st_threadsSignal.emit();
}
// shutdown the calling thread
s_exitEventLoop = true;
if (s_eventLoopRunning) getEventDriver().exitEventLoop();
}
/**
Process all pending events without blocking.
Checks if events are ready to trigger immediately, and run their callbacks if so.
Returns: Returns false $(I iff) exitEventLoop was called in the process.
*/
bool processEvents()
{
if (!getEventDriver().processEvents()) return false;
driverCore.notifyIdle();
return true;
}
/**
Sets a callback that is called whenever no events are left in the event queue.
The callback delegate is called whenever all events in the event queue have been
processed. Returning true from the callback will cause another idle event to
be triggered immediately after processing any events that have arrived in the
meantime. Returning false will instead wait until another event has arrived first.
*/
void setIdleHandler(void delegate() @safe del)
{
s_idleHandler = { del(); return false; };
}
/// ditto
void setIdleHandler(bool delegate() @safe del)
{
s_idleHandler = del;
}
/// Scheduled for deprecation - use a `@safe` callback instead.
void setIdleHandler(void delegate() @system del)
@system {
s_idleHandler = () @trusted { del(); return false; };
}
/// ditto
void setIdleHandler(bool delegate() @system del)
@system {
s_idleHandler = () @trusted => del();
}
/**
Runs a new asynchronous task.
task will be called synchronously from within the vibeRunTask call. It will
continue to run until vibeYield() or any of the I/O or wait functions is
called.
Note that the maximum size of all args must not exceed `maxTaskParameterSize`.
*/
Task runTask(ARGS...)(void delegate(ARGS) @safe task, ARGS args)
{
auto tfi = makeTaskFuncInfo(task, args);
return runTask_internal(tfi);
}
/// ditto
Task runTask(ARGS...)(void delegate(ARGS) task, ARGS args)
{
auto tfi = makeTaskFuncInfo(task, args);
return runTask_internal(tfi);
}
private Task runTask_internal(ref TaskFuncInfo tfi)
@safe nothrow {
import std.typecons : Tuple, tuple;
CoreTask f;
while (!f && !s_availableFibers.empty) {
f = s_availableFibers.back;
s_availableFibers.popBack();
if (() @trusted nothrow { return f.state; } () != Fiber.State.HOLD) f = null;
}
if (f is null) {
// if there is no fiber available, create one.
if (s_availableFibers.capacity == 0) s_availableFibers.capacity = 1024;
logDebugV("Creating new fiber...");
s_fiberCount++;
f = new CoreTask;
}
f.m_taskFunc = tfi;
f.bumpTaskCounter();
auto handle = f.task();
debug Task self = Task.getThis();
debug if (s_taskEventCallback) {
if (self != Task.init) () @trusted { s_taskEventCallback(TaskEvent.yield, self); } ();
() @trusted { s_taskEventCallback(TaskEvent.preStart, handle); } ();
}
driverCore.resumeTask(handle, null, true);
debug if (s_taskEventCallback) {
() @trusted { s_taskEventCallback(TaskEvent.postStart, handle); } ();
if (self != Task.init) () @trusted { s_taskEventCallback(TaskEvent.resume, self); } ();
}
return handle;
}
@safe unittest {
runTask({});
}
/**
Runs a new asynchronous task in a worker thread.
Only function pointers with weakly isolated arguments are allowed to be
able to guarantee thread-safety.
*/
void runWorkerTask(FT, ARGS...)(FT func, auto ref ARGS args)
if (is(typeof(*func) == function))
{
foreach (T; ARGS) static assert(isWeaklyIsolated!T, "Argument type "~T.stringof~" is not safe to pass between threads.");
runWorkerTask_unsafe(func, args);
}
/// ditto
void runWorkerTask(alias method, T, ARGS...)(shared(T) object, auto ref ARGS args)
if (is(typeof(__traits(getMember, object, __traits(identifier, method)))))
{
foreach (T; ARGS) static assert(isWeaklyIsolated!T, "Argument type "~T.stringof~" is not safe to pass between threads.");
auto func = &__traits(getMember, object, __traits(identifier, method));
runWorkerTask_unsafe(func, args);
}
/**
Runs a new asynchronous task in a worker thread, returning the task handle.
This function will yield and wait for the new task to be created and started
in the worker thread, then resume and return it.
Only function pointers with weakly isolated arguments are allowed to be
able to guarantee thread-safety.
*/
Task runWorkerTaskH(FT, ARGS...)(FT func, auto ref ARGS args)
if (is(typeof(*func) == function))
{
foreach (T; ARGS) static assert(isWeaklyIsolated!T, "Argument type "~T.stringof~" is not safe to pass between threads.");
alias PrivateTask = Typedef!(Task, Task.init, __PRETTY_FUNCTION__);
Task caller = Task.getThis();
// workaround for runWorkerTaskH to work when called outside of a task
if (caller == Task.init) {
Task ret;
runTask({ ret = runWorkerTaskH(func, args); }).join();
return ret;
}
assert(caller != Task.init, "runWorkderTaskH can currently only be called from within a task.");
static void taskFun(Task caller, FT func, ARGS args) {
PrivateTask callee = Task.getThis();
caller.prioritySendCompat(callee);
mixin(callWithMove!ARGS("func", "args"));
}
runWorkerTask_unsafe(&taskFun, caller, func, args);
return () @trusted { return cast(Task)receiveOnlyCompat!PrivateTask(); } ();
}
/// ditto
Task runWorkerTaskH(alias method, T, ARGS...)(shared(T) object, auto ref ARGS args)
if (is(typeof(__traits(getMember, object, __traits(identifier, method)))))
{
foreach (T; ARGS) static assert(isWeaklyIsolated!T, "Argument type "~T.stringof~" is not safe to pass between threads.");
auto func = &__traits(getMember, object, __traits(identifier, method));
alias FT = typeof(func);
alias PrivateTask = Typedef!(Task, Task.init, __PRETTY_FUNCTION__);
Task caller = Task.getThis();
// workaround for runWorkerTaskH to work when called outside of a task
if (caller == Task.init) {
Task ret;
runTask({ ret = runWorkerTaskH!method(object, args); }).join();
return ret;
}
assert(caller != Task.init, "runWorkderTaskH can currently only be called from within a task.");
static void taskFun(Task caller, FT func, ARGS args) {
PrivateTask callee = Task.getThis();
() @trusted { caller.prioritySendCompat(callee); } ();
mixin(callWithMove!ARGS("func", "args"));
}
runWorkerTask_unsafe(&taskFun, caller, func, args);
return cast(Task)receiveOnlyCompat!PrivateTask();
}
/// Running a worker task using a function
unittest {
static void workerFunc(int param)
{
logInfo("Param: %s", param);
}
static void test()
{
runWorkerTask(&workerFunc, 42);
runWorkerTask(&workerFunc, cast(ubyte)42); // implicit conversion #719
runWorkerTaskDist(&workerFunc, 42);
runWorkerTaskDist(&workerFunc, cast(ubyte)42); // implicit conversion #719
}
}
/// Running a worker task using a class method
unittest {
static class Test {
void workerMethod(int param)
shared {
logInfo("Param: %s", param);
}
}
static void test()
{
auto cls = new shared Test;
runWorkerTask!(Test.workerMethod)(cls, 42);
runWorkerTask!(Test.workerMethod)(cls, cast(ubyte)42); // #719
runWorkerTaskDist!(Test.workerMethod)(cls, 42);
runWorkerTaskDist!(Test.workerMethod)(cls, cast(ubyte)42); // #719
}
}
/// Running a worker task using a function and communicating with it
unittest {
static void workerFunc(Task caller)
{
int counter = 10;
while (receiveOnlyCompat!string() == "ping" && --counter) {
logInfo("pong");
caller.sendCompat("pong");
}
caller.sendCompat("goodbye");
}
static void test()
{
Task callee = runWorkerTaskH(&workerFunc, Task.getThis);
do {
logInfo("ping");
callee.sendCompat("ping");
} while (receiveOnlyCompat!string() == "pong");
}
static void work719(int) {}
static void test719() { runWorkerTaskH(&work719, cast(ubyte)42); }
}
/// Running a worker task using a class method and communicating with it
unittest {
static class Test {
void workerMethod(Task caller) shared {
int counter = 10;
while (receiveOnlyCompat!string() == "ping" && --counter) {
logInfo("pong");
caller.sendCompat("pong");
}
caller.sendCompat("goodbye");
}
}
static void test()
{
auto cls = new shared Test;
Task callee = runWorkerTaskH!(Test.workerMethod)(cls, Task.getThis());
do {
logInfo("ping");
callee.sendCompat("ping");
} while (receiveOnlyCompat!string() == "pong");
}
static class Class719 {
void work(int) shared {}
}
static void test719() {
auto cls = new shared Class719;
runWorkerTaskH!(Class719.work)(cls, cast(ubyte)42);
}
}
unittest { // run and join worker task from outside of a task
__gshared int i = 0;
auto t = runWorkerTaskH({ sleep(5.msecs); i = 1; });
// FIXME: joining between threads not yet supported
//t.join();
//assert(i == 1);
}
private void runWorkerTask_unsafe(CALLABLE, ARGS...)(CALLABLE callable, ref ARGS args)
{
import std.traits : ParameterTypeTuple;
import vibe.internal.meta.traits : areConvertibleTo;
import vibe.internal.meta.typetuple;
alias FARGS = ParameterTypeTuple!CALLABLE;
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
"Cannot convert arguments '"~ARGS.stringof~"' to function arguments '"~FARGS.stringof~"'.");
setupWorkerThreads();
auto tfi = makeTaskFuncInfo(callable, args);
() @trusted {
synchronized (st_threadsMutex) st_workerTasks ~= tfi;
st_threadsSignal.emit();
} ();
}
/**
Runs a new asynchronous task in all worker threads concurrently.
This function is mainly useful for long-living tasks that distribute their
work across all CPU cores. Only function pointers with weakly isolated
arguments are allowed to be able to guarantee thread-safety.
The number of tasks started is guaranteed to be equal to
`workerThreadCount`.
*/
void runWorkerTaskDist(FT, ARGS...)(FT func, auto ref ARGS args)
if (is(typeof(*func) == function))
{
foreach (T; ARGS) static assert(isWeaklyIsolated!T, "Argument type "~T.stringof~" is not safe to pass between threads.");
runWorkerTaskDist_unsafe(func, args);
}
/// ditto
void runWorkerTaskDist(alias method, T, ARGS...)(shared(T) object, ARGS args)
{
auto func = &__traits(getMember, object, __traits(identifier, method));
foreach (T; ARGS) static assert(isWeaklyIsolated!T, "Argument type "~T.stringof~" is not safe to pass between threads.");
runWorkerTaskDist_unsafe(func, args);
}
private void runWorkerTaskDist_unsafe(CALLABLE, ARGS...)(ref CALLABLE callable, ref ARGS args)
{
import std.traits : ParameterTypeTuple;
import vibe.internal.meta.traits : areConvertibleTo;
import vibe.internal.meta.typetuple;
alias FARGS = ParameterTypeTuple!CALLABLE;
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
"Cannot convert arguments '"~ARGS.stringof~"' to function arguments '"~FARGS.stringof~"'.");
setupWorkerThreads();
auto tfi = makeTaskFuncInfo(callable, args);
synchronized (st_threadsMutex) {
foreach (ref ctx; st_threads)
if (ctx.isWorker)
ctx.taskQueue ~= tfi;
}
st_threadsSignal.emit();
}
private TaskFuncInfo makeTaskFuncInfo(CALLABLE, ARGS...)(ref CALLABLE callable, ref ARGS args)
{
import std.algorithm : move;
import std.traits : hasElaborateAssign;
static struct TARGS { ARGS expand; }
static assert(CALLABLE.sizeof <= TaskFuncInfo.callable.length);
static assert(TARGS.sizeof <= maxTaskParameterSize,
"The arguments passed to run(Worker)Task must not exceed "~
maxTaskParameterSize.to!string~" bytes in total size.");
static void callDelegate(TaskFuncInfo* tfi) {
assert(tfi.func is &callDelegate);
// copy original call data to stack
CALLABLE c;
TARGS args;
move(*(cast(CALLABLE*)tfi.callable.ptr), c);
move(*(cast(TARGS*)tfi.args.ptr), args);
// reset the info
tfi.func = null;
// make the call
mixin(callWithMove!ARGS("c", "args.expand"));
}
TaskFuncInfo tfi;
tfi.func = &callDelegate;
static if (hasElaborateAssign!CALLABLE) tfi.initCallable!CALLABLE();
static if (hasElaborateAssign!TARGS) tfi.initArgs!TARGS();
() @trusted {
tfi.typedCallable!CALLABLE = callable;
foreach (i, A; ARGS) {
static if (needsMove!A) args[i].move(tfi.typedArgs!TARGS.expand[i]);
else tfi.typedArgs!TARGS.expand[i] = args[i];
}
} ();
return tfi;
}
import core.cpuid : threadsPerCPU;
/**
Sets up the thread pool used for executing worker tasks.
This function gives explicit control over the number of worker threads.
Note, to have an effect the function must be called before any worker
tasks are started. Otherwise the default number of worker threads
(`logicalProcessorCount`) will be used automatically.
Params:
num = The number of worker threads to initialize. Defaults to
`logicalProcessorCount`.
See_also: `runWorkerTask`, `runWorkerTaskH`, `runWorkerTaskDist`
*/
public void setupWorkerThreads(uint num = logicalProcessorCount())
@safe {
static bool s_workerThreadsStarted = false;
if (s_workerThreadsStarted) return;
s_workerThreadsStarted = true;
() @trusted {
synchronized (st_threadsMutex) {
if (st_threads.any!(t => t.isWorker))
return;
foreach (i; 0 .. num) {
auto thr = new Thread(&workerThreadFunc);
thr.name = format("Vibe Task Worker #%s", i);
st_threads ~= ThreadContext(thr, true);
thr.start();
}
}
} ();
}
/**
Determines the number of logical processors in the system.
This number includes virtual cores on hyper-threading enabled CPUs.
*/
public @property uint logicalProcessorCount()
{
import std.parallelism : totalCPUs;
return totalCPUs;
}
/**
Suspends the execution of the calling task to let other tasks and events be
handled.
Calling this function in short intervals is recommended if long CPU
computations are carried out by a task. It can also be used in conjunction
with Signals to implement cross-fiber events with no polling.
Throws:
May throw an `InterruptException` if `Task.interrupt()` gets called on
the calling task.
*/
void yield()
@safe {
// throw any deferred exceptions
driverCore.processDeferredExceptions();
auto t = CoreTask.getThis();
if (t && t !is CoreTask.ms_coreTask) {
assert(!t.m_queue, "Calling yield() when already yielded!?");
if (!t.m_queue)
s_yieldedTasks.insertBack(t);
scope (exit) assert(t.m_queue is null, "Task not removed from yielders queue after being resumed.");
rawYield();
} else {
// Let yielded tasks execute
() @trusted { driverCore.notifyIdle(); } ();
}
}
/**
Yields execution of this task until an event wakes it up again.
Beware that the task will starve if no event wakes it up.
*/
void rawYield()
@safe {
driverCore.yieldForEvent();
}
/**
Suspends the execution of the calling task for the specified amount of time.
Note that other tasks of the same thread will continue to run during the
wait time, in contrast to $(D core.thread.Thread.sleep), which shouldn't be
used in vibe.d applications.
*/
void sleep(Duration timeout)
@safe {
assert(timeout >= 0.seconds, "Argument to sleep must not be negative.");
if (timeout <= 0.seconds) return;
auto tm = setTimer(timeout, null);
tm.wait();
}
///
unittest {
import vibe.core.core : sleep;
import vibe.core.log : logInfo;
import core.time : msecs;
void test()
{
logInfo("Sleeping for half a second...");
sleep(500.msecs);
logInfo("Done sleeping.");
}
}
/**
Returns a new armed timer.
Note that timers can only work if an event loop is running.
Passing a `@system` callback is scheduled for deprecation. Use a
`@safe` callback instead.
Params:
timeout = Determines the minimum amount of time that elapses before the timer fires.
callback = This delegate will be called when the timer fires
periodic = Speficies if the timer fires repeatedly or only once
Returns:
Returns a Timer object that can be used to identify and modify the timer.
See_also: createTimer
*/
Timer setTimer(Duration timeout, void delegate() @safe callback, bool periodic = false)
@safe {
auto tm = createTimer(callback);
tm.rearm(timeout, periodic);
return tm;
}
/// ditto
Timer setTimer(Duration timeout, void delegate() @system callback, bool periodic = false)
@system {
return setTimer(timeout, () @trusted => callback(), periodic);
}
///
unittest {
void printTime()
@safe {
import std.datetime;
logInfo("The time is: %s", Clock.currTime());
}
void test()
{
import vibe.core.core;
// start a periodic timer that prints the time every second
setTimer(1.seconds, &printTime, true);
}
}
/**
Creates a new timer without arming it.
Passing a `@system` callback is scheduled for deprecation. Use a
`@safe` callback instead.
See_also: setTimer
*/
Timer createTimer(void delegate() @safe callback)
@safe {
auto drv = getEventDriver();
return Timer(drv, drv.createTimer(callback));
}
/// ditto
Timer createTimer(void delegate() @system callback)
@system {
return createTimer(() @trusted => callback());
}
/**
Creates an event to wait on an existing file descriptor.
The file descriptor usually needs to be a non-blocking socket for this to
work.
Params:
file_descriptor = The Posix file descriptor to watch
event_mask = Specifies which events will be listened for
event_mode = Specifies event waiting mode
Returns:
Returns a newly created FileDescriptorEvent associated with the given
file descriptor.
*/
FileDescriptorEvent createFileDescriptorEvent(int file_descriptor, FileDescriptorEvent.Trigger event_mask, FileDescriptorEvent.Mode event_mode = FileDescriptorEvent.Mode.persistent)
{
auto drv = getEventDriver();
return drv.createFileDescriptorEvent(file_descriptor, event_mask, event_mode);
}
/**
Sets the stack size to use for tasks.
The default stack size is set to 512 KiB on 32-bit systems and to 16 MiB
on 64-bit systems, which is sufficient for most tasks. Tuning this value
can be used to reduce memory usage for large numbers of concurrent tasks
or to avoid stack overflows for applications with heavy stack use.
Note that this function must be called at initialization time, before any
task is started to have an effect.
Also note that the stack will initially not consume actual physical memory -
it just reserves virtual address space. Only once the stack gets actually
filled up with data will physical memory then be reserved page by page. This
means that the stack can safely be set to large sizes on 64-bit systems
without having to worry about memory usage.
*/
void setTaskStackSize(size_t sz)
{
s_taskStackSize = sz;
}
/**
The number of worker threads used for processing worker tasks.
Note that this function will cause the worker threads to be started,
if they haven't already.
See_also: `runWorkerTask`, `runWorkerTaskH`, `runWorkerTaskDist`,
`setupWorkerThreads`
*/
@property size_t workerThreadCount()
out(count) { assert(count > 0); }
body {
setupWorkerThreads();
return st_threads.count!(c => c.isWorker);
}
/**
Disables the signal handlers usually set up by vibe.d.
During the first call to `runEventLoop`, vibe.d usually sets up a set of
event handlers for SIGINT, SIGTERM and SIGPIPE. Since in some situations
this can be undesirable, this function can be called before the first
invocation of the event loop to avoid this.
Calling this function after `runEventLoop` will have no effect.
*/
void disableDefaultSignalHandlers()
{
synchronized (st_threadsMutex)
s_disableSignalHandlers = true;
}
/**
Sets the effective user and group ID to the ones configured for privilege lowering.
This function is useful for services run as root to give up on the privileges that
they only need for initialization (such as listening on ports <= 1024 or opening
system log files).
Note that this function is called automatically by vibe.d's default main
implementation, as well as by `runApplication`.
*/
void lowerPrivileges(string uname, string gname) @safe
{
if (!isRoot()) return;
if (uname != "" || gname != "") {
static bool tryParse(T)(string s, out T n)
{
import std.conv, std.ascii;
if (!isDigit(s[0])) return false;
n = parse!T(s);
return s.length==0;
}
int uid = -1, gid = -1;
if (uname != "" && !tryParse(uname, uid)) uid = getUID(uname);
if (gname != "" && !tryParse(gname, gid)) gid = getGID(gname);
setUID(uid, gid);
} else logWarn("Vibe was run as root, and no user/group has been specified for privilege lowering. Running with full permissions.");
}
// ditto
void lowerPrivileges() @safe
{
lowerPrivileges(s_privilegeLoweringUserName, s_privilegeLoweringGroupName);
}
/**
Sets a callback that is invoked whenever a task changes its status.
This function is useful mostly for implementing debuggers that
analyze the life time of tasks, including task switches. Note that
the callback will only be called for debug builds.
*/
void setTaskEventCallback(TaskEventCb func)
{
debug s_taskEventCallback = func;
}
/**
A version string representing the current vibe.d version
*/
enum vibeVersionString = "0.8.6-beta.1";
/**
The maximum combined size of all parameters passed to a task delegate
See_Also: runTask
*/
enum maxTaskParameterSize = 128;
/**
Represents a timer.
*/
struct Timer {
@safe:
private {
EventDriver m_driver;
size_t m_id;
debug uint m_magicNumber = 0x4d34f916;
}
private this(EventDriver driver, size_t id)
{
m_driver = driver;
m_id = id;
}
this(this)
{
debug assert(m_magicNumber == 0x4d34f916);
if (m_driver) m_driver.acquireTimer(m_id);
}
~this()
{
debug assert(m_magicNumber == 0x4d34f916);
if (m_driver && driverCore) m_driver.releaseTimer(m_id);
}
/// True if the timer is yet to fire.
@property bool pending() { return m_driver.isTimerPending(m_id); }
/// The internal ID of the timer.
@property size_t id() const { return m_id; }
bool opCast() const { return m_driver !is null; }
/** Resets the timer to the specified timeout
*/
void rearm(Duration dur, bool periodic = false)
in { assert(dur > 0.seconds); }
body { m_driver.rearmTimer(m_id, dur, periodic); }
/** Resets the timer and avoids any firing.
*/
void stop() nothrow { m_driver.stopTimer(m_id); }
/** Waits until the timer fires.
*/
void wait() { m_driver.waitTimer(m_id); }
}
/**
Implements a task local storage variable.
Task local variables, similar to thread local variables, exist separately
in each task. Consequently, they do not need any form of synchronization
when accessing them.
Note, however, that each TaskLocal variable will increase the memory footprint
of any task that uses task local storage. There is also an overhead to access
TaskLocal variables, higher than for thread local variables, but generelly
still O(1) (since actual storage acquisition is done lazily the first access
can require a memory allocation with unknown computational costs).
Notice:
FiberLocal instances MUST be declared as static/global thread-local
variables. Defining them as a temporary/stack variable will cause
crashes or data corruption!
Examples:
---
TaskLocal!string s_myString = "world";
void taskFunc()
{
assert(s_myString == "world");
s_myString = "hello";
assert(s_myString == "hello");
}
shared static this()
{
// both tasks will get independent storage for s_myString
runTask(&taskFunc);
runTask(&taskFunc);
}
---
*/
struct TaskLocal(T)
{
private {
size_t m_offset = size_t.max;
size_t m_id;
T m_initValue;
bool m_hasInitValue = false;
}
this(T init_val) { m_initValue = init_val; m_hasInitValue = true; }
@disable this(this);
void opAssign(T value) { this.storage = value; }
@property ref T storage()
{
auto fiber = CoreTask.getThis();
// lazily register in FLS storage
if (m_offset == size_t.max) {
static assert(T.alignof <= 8, "Unsupported alignment for type "~T.stringof);
assert(CoreTask.ms_flsFill % 8 == 0, "Misaligned fiber local storage pool.");
m_offset = CoreTask.ms_flsFill;
m_id = CoreTask.ms_flsCounter++;
CoreTask.ms_flsFill += T.sizeof;
while (CoreTask.ms_flsFill % 8 != 0)
CoreTask.ms_flsFill++;
}
// make sure the current fiber has enough FLS storage
if (fiber.m_fls.length < CoreTask.ms_flsFill) {
fiber.m_fls.length = CoreTask.ms_flsFill + 128;
fiber.m_flsInit.length = CoreTask.ms_flsCounter + 64;
}
// return (possibly default initialized) value
auto data = fiber.m_fls.ptr[m_offset .. m_offset+T.sizeof];
if (!fiber.m_flsInit[m_id]) {
fiber.m_flsInit[m_id] = true;
import std.traits : hasElaborateDestructor, hasAliasing;
static if (hasElaborateDestructor!T || hasAliasing!T) {
void function(void[], size_t) destructor = (void[] fls, size_t offset){
static if (hasElaborateDestructor!T) {
auto obj = cast(T*)&fls[offset];
// call the destructor on the object if a custom one is known declared
obj.destroy();
}
else static if (hasAliasing!T) {
// zero the memory to avoid false pointers
foreach (size_t i; offset .. offset + T.sizeof) {
ubyte* u = cast(ubyte*)&fls[i];
*u = 0;
}
}
};
FLSInfo fls_info;
fls_info.fct = destructor;
fls_info.offset = m_offset;
// make sure flsInfo has enough space
if (fiber.ms_flsInfo.length <= m_id)
fiber.ms_flsInfo.length = m_id + 64;
fiber.ms_flsInfo[m_id] = fls_info;
}
if (m_hasInitValue) {
static if (__traits(compiles, emplace!T(data, m_initValue)))
emplace!T(data, m_initValue);
else assert(false, "Cannot emplace initialization value for type "~T.stringof);
} else emplace!T(data);
}
return (cast(T[])data)[0];
}
alias storage this;
}
private struct FLSInfo {
void function(void[], size_t) fct;
size_t offset;
void destroy(void[] fls) {
fct(fls, offset);
}
}
/**
High level state change events for a Task
*/
enum TaskEvent {
preStart, /// Just about to invoke the fiber which starts execution
postStart, /// After the fiber has returned for the first time (by yield or exit)
start, /// Just about to start execution
yield, /// Temporarily paused
resume, /// Resumed from a prior yield
end, /// Ended normally
fail /// Ended with an exception
}
/**************************************************************************************************/
/* private types */
/**************************************************************************************************/
private class CoreTask : TaskFiber {
import std.bitmanip;
private {
static CoreTask ms_coreTask;
CoreTask m_nextInQueue;
CoreTaskQueue* m_queue;
TaskFuncInfo m_taskFunc;
Exception m_exception;
Task[] m_yielders;
// task local storage
static FLSInfo[] ms_flsInfo;
static size_t ms_flsFill = 0; // thread-local
static size_t ms_flsCounter = 0;
BitArray m_flsInit;
void[] m_fls;
}
static CoreTask getThis()
@safe nothrow {
auto f = () @trusted nothrow {
return Fiber.getThis();
} ();
if (f) return cast(CoreTask)f;
if (!ms_coreTask) ms_coreTask = new CoreTask;
return ms_coreTask;
}
this()
@trusted nothrow {
super(&run, s_taskStackSize);
}
// expose Fiber.state as @safe on older DMD versions
static if (!__traits(compiles, () @safe { return Fiber.init.state; } ()))
@property State state() @trusted const nothrow { return super.state; }
@property size_t taskCounter() const { return m_taskCounter; }
private void run()
{
version (VibeDebugCatchAll) alias UncaughtException = Throwable;
else alias UncaughtException = Exception;
try {
while(true){
while (!m_taskFunc.func) {
try {
Fiber.yield();
} catch( Exception e ){
logWarn("CoreTaskFiber was resumed with exception but without active task!");
logDiagnostic("Full error: %s", e.toString().sanitize());
}
}
auto task = m_taskFunc;
m_taskFunc = TaskFuncInfo.init;
Task handle = this.task;
try {
m_running = true;
scope(exit) m_running = false;
static import std.concurrency;
std.concurrency.thisTid; // force creation of a new Tid
debug if (s_taskEventCallback) s_taskEventCallback(TaskEvent.start, handle);
if (!s_eventLoopRunning) {
logTrace("Event loop not running at task start - yielding.");
.yield();
logTrace("Initial resume of task.");
}
task.func(&task);
debug if (s_taskEventCallback) s_taskEventCallback(TaskEvent.end, handle);
} catch( Exception e ){
debug if (s_taskEventCallback) s_taskEventCallback(TaskEvent.fail, handle);
import std.encoding;
logCritical("Task terminated with uncaught exception: %s", e.msg);
logDebug("Full error: %s", e.toString().sanitize());
}
this.tidInfo.ident = Tid.init; // reset Tid
// check for any unhandled deferred exceptions
if (m_exception !is null) {
if (cast(InterruptException)m_exception) {
logDebug("InterruptException not handled by task before exit.");
} else {
logCritical("Deferred exception not handled by task before exit: %s", m_exception.msg);
logDebug("Full error: %s", m_exception.toString().sanitize());
}
}
foreach (t; m_yielders) s_yieldedTasks.insertBack(cast(CoreTask)t.fiber);
m_yielders.length = 0;
// make sure that the task does not get left behind in the yielder queue if terminated during yield()
if (m_queue) {
s_core.resumeYieldedTasks();
assert(m_queue is null, "Still in yielder queue at the end of task after resuming all yielders!?");
}
// zero the fls initialization ByteArray for memory safety
foreach (size_t i, ref bool b; m_flsInit) {
if (b) {
if (ms_flsInfo !is null && ms_flsInfo.length >= i && ms_flsInfo[i] != FLSInfo.init)
ms_flsInfo[i].destroy(m_fls);
b = false;
}
}
// make the fiber available for the next task
if (s_availableFibers.full)
s_availableFibers.capacity = 2 * s_availableFibers.capacity;
// clear the message queue for the next task
messageQueue.clear();
s_availableFibers.put(this);
}
} catch (UncaughtException th) {
logCritical("CoreTaskFiber was terminated unexpectedly: %s", th.msg);
logDiagnostic("Full error: %s", th.toString().sanitize());
s_fiberCount--;
}
}
override void join()
{
auto caller = Task.getThis();
if (!m_running) return;
if (caller != Task.init) {
assert(caller.fiber !is this, "A task cannot join itself.");
assert(caller.thread is this.thread, "Joining tasks in foreign threads is currently not supported.");
m_yielders ~= caller;
} else assert(() @trusted { return Thread.getThis(); } () is this.thread, "Joining tasks in different threads is not yet supported.");
auto run_count = m_taskCounter;
if (caller == Task.init) () @trusted { return s_core; } ().resumeYieldedTasks(); // let the task continue (it must be yielded currently)
while (m_running && run_count == m_taskCounter) rawYield();
}
override void interrupt()
{
auto caller = Task.getThis();
if (caller != Task.init) {
assert(caller != this.task, "A task cannot interrupt itself.");
assert(caller.thread is this.thread, "Interrupting tasks in different threads is not yet supported.");
} else assert(Thread.getThis() is this.thread, "Interrupting tasks in different threads is not yet supported.");
s_core.yieldAndResumeTask(this.task, new InterruptException);
}
override void terminate()
{
assert(false, "Not implemented");
}
}
private class VibeDriverCore : DriverCore {
@safe:
private {
Duration m_gcCollectTimeout;
Timer m_gcTimer;
bool m_ignoreIdleForGC = false;
Exception m_eventException;
}
private void setupGcTimer()
{
m_gcTimer = createTimer(&collectGarbage);
m_gcCollectTimeout = dur!"seconds"(2);
}
@property void eventException(Exception e) { m_eventException = e; }
void yieldForEventDeferThrow()
@safe nothrow {
yieldForEventDeferThrow(Task.getThis());
}
void processDeferredExceptions()
@safe {
processDeferredExceptions(Task.getThis());
}
void yieldForEvent()
@safe {
auto task = Task.getThis();
processDeferredExceptions(task);
yieldForEventDeferThrow(task);
processDeferredExceptions(task);
}
void resumeTask(Task task, Exception event_exception = null)
@safe nothrow {
assert(Task.getThis() == Task.init, "Calling resumeTask from another task.");
resumeTask(task, event_exception, false);
}
void yieldAndResumeTask(Task task, Exception event_exception = null)
@safe {
auto thisct = CoreTask.getThis();
if (thisct is null || thisct is CoreTask.ms_coreTask) {
resumeTask(task, event_exception);
return;
}
auto otherct = cast(CoreTask)task.fiber;
assert(!thisct || otherct.thread is thisct.thread, "Resuming task in foreign thread.");
assert(() @trusted { return otherct.state; } () == Fiber.State.HOLD, "Resuming fiber that is not on HOLD.");
if (event_exception) otherct.m_exception = event_exception;
if (!otherct.m_queue) s_yieldedTasks.insertBack(otherct);
yield();
}
void resumeTask(Task task, Exception event_exception, bool initial_resume)
@safe nothrow {
assert(initial_resume || task.running, "Resuming terminated task.");
resumeCoreTask(cast(CoreTask)task.fiber, event_exception);
}
void resumeCoreTask(CoreTask ctask, Exception event_exception = null)
nothrow @safe {
assert(ctask.thread is () @trusted { return Thread.getThis(); } (), "Resuming task in foreign thread.");
assert(() @trusted nothrow { return ctask.state; } () == Fiber.State.HOLD, "Resuming fiber that is not on HOLD");
if (event_exception) {
extrap();
assert(!ctask.m_exception, "Resuming task with exception that is already scheduled to be resumed with exception.");
ctask.m_exception = event_exception;
}
// do nothing if the task is aready scheduled to be resumed
if (ctask.m_queue) return;
try () @trusted { ctask.call!(Fiber.Rethrow.yes)(); } ();
catch (Exception e) {
extrap();
assert(() @trusted nothrow { return ctask.state; } () == Fiber.State.TERM);
logError("Task terminated with unhandled exception: %s", e.msg);
logDebug("Full error: %s", () @trusted { return e.toString().sanitize; } ());
}
}
void notifyIdle()
{
bool again = !getExitFlag();
while (again) {
if (s_idleHandler)
again = s_idleHandler();
else again = false;
resumeYieldedTasks();
again = (again || !s_yieldedTasks.empty) && !getExitFlag();
if (again && !getEventDriver().processEvents()) {
logDebug("Setting exit flag due to driver signalling exit");
s_exitEventLoop = true;
return;
}
}
if (!s_yieldedTasks.empty) logDebug("Exiting from idle processing although there are still yielded tasks (exit=%s)", getExitFlag());
if (() @trusted { return Thread.getThis() is st_mainThread; } ()) {
if (!m_ignoreIdleForGC && m_gcTimer) {
m_gcTimer.rearm(m_gcCollectTimeout);
} else m_ignoreIdleForGC = false;
}
}
bool isScheduledForResume(Task t)
{
if (t == Task.init) return false;
if (!t.running) return false;
auto cf = cast(CoreTask)t.fiber;
return cf.m_queue !is null;
}
private void resumeYieldedTasks()
nothrow @safe {
for (auto limit = s_yieldedTasks.length; limit > 0 && !s_yieldedTasks.empty; limit--) {
auto tf = s_yieldedTasks.front;
s_yieldedTasks.popFront();
if (tf.state == Fiber.State.HOLD) resumeCoreTask(tf);
}
}
private void yieldForEventDeferThrow(Task task)
@safe nothrow {
if (task != Task.init) {
debug if (s_taskEventCallback) () @trusted { s_taskEventCallback(TaskEvent.yield, task); } ();
() @trusted { task.fiber.yield(); } ();
debug if (s_taskEventCallback) () @trusted { s_taskEventCallback(TaskEvent.resume, task); } ();
// leave fiber.m_exception untouched, so that it gets thrown on the next yieldForEvent call
} else {
assert(!s_eventLoopRunning, "Event processing outside of a fiber should only happen before the event loop is running!?");
m_eventException = null;
() @trusted nothrow { resumeYieldedTasks(); } (); // let tasks that yielded because they were started outside of an event loop
try if (auto err = () @trusted { return getEventDriver().runEventLoopOnce(); } ()) {
logError("Error running event loop: %d", err);
assert(err != 1, "No events registered, exiting event loop.");
assert(false, "Error waiting for events.");
}
catch (Exception e) {
assert(false, "Driver.runEventLoopOnce() threw: "~e.msg);
}
// leave m_eventException untouched, so that it gets thrown on the next yieldForEvent call
}
}
private void processDeferredExceptions(Task task)
@safe {
if (task != Task.init) {
auto fiber = cast(CoreTask)task.fiber;
if (auto e = fiber.m_exception) {
fiber.m_exception = null;
throw e;
}
} else {
if (auto e = m_eventException) {
m_eventException = null;
throw e;
}
}
}
private void collectGarbage()
{
import core.memory;
logTrace("gc idle collect");
() @trusted {
GC.collect();
GC.minimize();
} ();
m_ignoreIdleForGC = true;
}
}
private struct ThreadContext {
Thread thread;
bool isWorker;
TaskFuncInfo[] taskQueue;
this(Thread thr, bool worker) { this.thread = thr; this.isWorker = worker; }
}
private struct TaskFuncInfo {
void function(TaskFuncInfo*) func;
void[2*size_t.sizeof] callable;
void[maxTaskParameterSize] args;
@property ref C typedCallable(C)()
@trusted {
static assert(C.sizeof <= callable.sizeof);
return *cast(C*)callable.ptr;
}
@property ref A typedArgs(A)()
@trusted {
static assert(A.sizeof <= args.sizeof);
return *cast(A*)args.ptr;
}
void initCallable(C)()
@trusted {
C cinit;
this.callable[0 .. C.sizeof] = cast(void[])(&cinit)[0 .. 1];
}
void initArgs(A)()
@trusted {
A ainit;
this.args[0 .. A.sizeof] = cast(void[])(&ainit)[0 .. 1];
}
}
alias TaskArgsVariant = VariantN!maxTaskParameterSize;
/**************************************************************************************************/
/* private functions */
/**************************************************************************************************/
private {
static if ((void*).sizeof >= 8) enum defaultTaskStackSize = 16*1024*1024;
else enum defaultTaskStackSize = 512*1024;
__gshared VibeDriverCore s_core;
__gshared size_t s_taskStackSize = defaultTaskStackSize;
__gshared core.sync.mutex.Mutex st_threadsMutex;
__gshared ManualEvent st_threadsSignal;
__gshared Thread st_mainThread;
__gshared ThreadContext[] st_threads;
__gshared TaskFuncInfo[] st_workerTasks;
__gshared Condition st_threadShutdownCondition;
__gshared debug TaskEventCb s_taskEventCallback;
shared bool st_term = false;
bool s_exitEventLoop = false;
bool s_eventLoopRunning = false;
bool delegate() @safe s_idleHandler;
CoreTaskQueue s_yieldedTasks;
Variant[string] s_taskLocalStorageGlobal; // for use outside of a task
FixedRingBuffer!CoreTask s_availableFibers;
size_t s_fiberCount;
string s_privilegeLoweringUserName;
string s_privilegeLoweringGroupName;
__gshared bool s_disableSignalHandlers = false;
}
private static @property VibeDriverCore driverCore() @trusted nothrow { return s_core; }
private bool getExitFlag()
@trusted nothrow {
return s_exitEventLoop || atomicLoad(st_term);
}
private void setupSignalHandlers()
{
__gshared bool s_setup = false;
// only initialize in main thread
synchronized (st_threadsMutex) {
if (s_setup) return;
s_setup = true;
if (s_disableSignalHandlers) return;
logTrace("setup signal handler");
version(Posix){
// support proper shutdown using signals
sigset_t sigset;
sigemptyset(&sigset);
sigaction_t siginfo;
siginfo.sa_handler = &onSignal;
siginfo.sa_mask = sigset;
siginfo.sa_flags = SA_RESTART;
sigaction(SIGINT, &siginfo, null);
sigaction(SIGTERM, &siginfo, null);
siginfo.sa_handler = &onBrokenPipe;
sigaction(SIGPIPE, &siginfo, null);
}
version(Windows){
// WORKAROUND: we don't care about viral @nogc attribute here!
import std.traits;
signal(SIGABRT, cast(ParameterTypeTuple!signal[1])&onSignal);
signal(SIGTERM, cast(ParameterTypeTuple!signal[1])&onSignal);
signal(SIGINT, cast(ParameterTypeTuple!signal[1])&onSignal);
}
}
}
// per process setup
shared static this()
{
st_mainThread = Thread.getThis();
version(Windows){
version(VibeLibeventDriver) enum need_wsa = true;
else version(VibeWin32Driver) enum need_wsa = true;
else enum need_wsa = false;
static if (need_wsa) {
logTrace("init winsock");
// initialize WinSock2
import core.sys.windows.winsock2;
WSADATA data;
WSAStartup(0x0202, &data);
}
}
// COMPILER BUG: Must be some kind of module constructor order issue:
// without this, the stdout/stderr handles are not initialized before
// the log module is set up.
import std.stdio; File f; f.close();
initializeLogModule();
logTrace("create driver core");
s_core = new VibeDriverCore;
st_threadsMutex = new Mutex;
st_threadShutdownCondition = new Condition(st_threadsMutex);
auto thisthr = Thread.getThis();
thisthr.name = "Main";
assert(st_threads.length == 0, "Main thread not the first thread!?");
st_threads ~= ThreadContext(thisthr, false);
setupDriver();
st_threadsSignal = getEventDriver().createManualEvent();
version(VibeIdleCollect){
logTrace("setup gc");
driverCore.setupGcTimer();
}
version (VibeNoDefaultArgs) {}
else {
readOption("uid|user", &s_privilegeLoweringUserName, "Sets the user name or id used for privilege lowering.");
readOption("gid|group", &s_privilegeLoweringGroupName, "Sets the group name or id used for privilege lowering.");
}
// set up vibe.d compatibility for std.concurrency
static import std.concurrency;
std.concurrency.scheduler = new VibedScheduler;
}
shared static ~this()
{
deleteEventDriver();
size_t tasks_left;
synchronized (st_threadsMutex) {
if( !st_workerTasks.empty ) tasks_left = st_workerTasks.length;
}
if (!s_yieldedTasks.empty) tasks_left += s_yieldedTasks.length;
if (tasks_left > 0) {
logWarn("There were still %d tasks running at exit.", tasks_left);
}
destroy(s_core);
s_core = null;
}
// per thread setup
static this()
{
/// workaround for:
// object.Exception@src/rt/minfo.d(162): Aborting: Cycle detected between modules with ctors/dtors:
// vibe.core.core -> vibe.core.drivers.native -> vibe.core.drivers.libasync -> vibe.core.core
if (Thread.getThis().isDaemon && Thread.getThis().name == "CmdProcessor") return;
assert(s_core !is null);
auto thisthr = Thread.getThis();
synchronized (st_threadsMutex)
if (!st_threads.any!(c => c.thread is thisthr))
st_threads ~= ThreadContext(thisthr, false);
//CoreTask.ms_coreTask = new CoreTask;
setupDriver();
}
static ~this()
{
// Issue #1374: Sometimes Druntime for some reason calls `static ~this` after `shared static ~this`
if (!s_core) return;
version(VibeLibasyncDriver) {
import vibe.core.drivers.libasync;
if (LibasyncDriver.isControlThread)
return;
}
auto thisthr = Thread.getThis();
bool is_main_thread = false;
synchronized (st_threadsMutex) {
auto idx = st_threads.countUntil!(c => c.thread is thisthr);
// if we are the main thread, wait for all others before terminating
is_main_thread = idx == 0;
if (is_main_thread) { // we are the main thread, wait for others
atomicStore(st_term, true);
st_threadsSignal.emit();
// wait for all non-daemon threads to shut down
while (st_threads[1 .. $].any!(th => !th.thread.isDaemon)) {
logDiagnostic("Main thread still waiting for other threads: %s",
st_threads[1 .. $].map!(t => t.thread.name ~ (t.isWorker ? " (worker thread)" : "")).join(", "));
st_threadShutdownCondition.wait();
}
logDiagnostic("Main thread exiting");
}
assert(idx >= 0, "No more threads registered");
if (idx >= 0) {
st_threads[idx] = st_threads[$-1];
st_threads.length--;
}
}
// delay deletion of the main event driver to "~shared static this()"
if (!is_main_thread) deleteEventDriver();
st_threadShutdownCondition.notifyAll();
}
package void setupDriver()
{
if (getEventDriver(true) !is null) return;
logTrace("create driver");
setupEventDriver(driverCore);
logTrace("driver %s created", (cast(Object)getEventDriver()).classinfo.name);
}
private void workerThreadFunc()
nothrow {
try {
assert(s_core !is null);
if (getExitFlag()) return;
logDebug("entering worker thread");
runTask(toDelegate(&handleWorkerTasks));
logDebug("running event loop");
if (!getExitFlag()) runEventLoop();
logDebug("Worker thread exit.");
} catch (Exception e) {
scope (failure) abort();
logFatal("Worker thread terminated due to uncaught exception: %s", e.msg);
logDebug("Full error: %s", e.toString().sanitize());
} catch (Throwable th) {
scope (exit) abort();
logFatal("Worker thread terminated due to uncaught error: %s (%s)", th.msg);
logFatal("Error type: %s", th.classinfo.name);
logDebug("Full error: %s", th.toString().sanitize());
}
}
private void handleWorkerTasks()
{
logDebug("worker thread enter");
auto thisthr = Thread.getThis();
logDebug("worker thread loop enter");
while(true){
auto emit_count = st_threadsSignal.emitCount;
TaskFuncInfo task;
synchronized (st_threadsMutex) {
auto idx = st_threads.countUntil!(c => c.thread is thisthr);
assert(idx >= 0);
logDebug("worker thread check");
if (getExitFlag()) {
if (st_threads[idx].taskQueue.length > 0)
logWarn("Worker thread shuts down with specific worker tasks left in its queue.");
if (st_threads.count!(c => c.isWorker) == 1 && st_workerTasks.length > 0)
logWarn("Worker threads shut down with worker tasks still left in the queue.");
break;
}
if (!st_workerTasks.empty) {
logDebug("worker thread got task");
task = st_workerTasks.front;
st_workerTasks.popFront();
} else if (!st_threads[idx].taskQueue.empty) {
logDebug("worker thread got specific task");
task = st_threads[idx].taskQueue.front;
st_threads[idx].taskQueue.popFront();
}
}
if (task.func !is null) runTask_internal(task);
else emit_count = st_threadsSignal.wait(emit_count);
}
logDebug("worker thread exit");
getEventDriver().exitEventLoop();
}
private void watchExitFlag()
{
auto emit_count = st_threadsSignal.emitCount;
while (true) {
synchronized (st_threadsMutex) {
if (getExitFlag()) break;
}
emit_count = st_threadsSignal.wait(emit_count);
}
logDebug("main thread exit");
getEventDriver().exitEventLoop();
}
private extern(C) void extrap()
@safe nothrow {
logTrace("exception trap");
}
private extern(C) void onSignal(int signal)
nothrow {
atomicStore(st_term, true);
try st_threadsSignal.emit(); catch (Throwable) {}
logInfo("Received signal %d. Shutting down.", signal);
}
private extern(C) void onBrokenPipe(int signal)
nothrow {
logTrace("Broken pipe.");
}
version(Posix)
{
private bool isRoot() @safe { return geteuid() == 0; }
private void setUID(int uid, int gid) @safe
{
logInfo("Lowering privileges to uid=%d, gid=%d...", uid, gid);
if (gid >= 0) {
enforce(() @trusted { return getgrgid(gid); }() !is null, "Invalid group id!");
enforce(setegid(gid) == 0, "Error setting group id!");
}
//if( initgroups(const char *user, gid_t group);
if (uid >= 0) {
enforce(() @trusted { return getpwuid(uid); }() !is null, "Invalid user id!");
enforce(seteuid(uid) == 0, "Error setting user id!");
}
}
private int getUID(string name) @safe
{
auto pw = () @trusted { return getpwnam(name.toStringz()); }();
enforce(pw !is null, "Unknown user name: "~name);
return pw.pw_uid;
}
private int getGID(string name) @safe
{
auto gr = () @trusted { return getgrnam(name.toStringz()); }();
enforce(gr !is null, "Unknown group name: "~name);
return gr.gr_gid;
}
} else version(Windows){
private bool isRoot() @safe { return false; }
private void setUID(int uid, int gid) @safe
{
enforce(false, "UID/GID not supported on Windows.");
}
private int getUID(string name) @safe
{
enforce(false, "Privilege lowering not supported on Windows.");
assert(false);
}
private int getGID(string name) @safe
{
enforce(false, "Privilege lowering not supported on Windows.");
assert(false);
}
}
private struct CoreTaskQueue {
@safe nothrow:
CoreTask first, last;
size_t length;
@disable this(this);
@property bool empty() const { return first is null; }
@property CoreTask front() { return first; }
void insertBack(CoreTask task)
{
assert(task.m_queue == null, "Task is already scheduled to be resumed!");
assert(task.m_nextInQueue is null, "Task has m_nextInQueue set without being in a queue!?");
task.m_queue = &this;
if (empty)
first = task;
else
last.m_nextInQueue = task;
last = task;
length++;
}
void popFront()
{
if (first is last) last = null;
assert(first && first.m_queue == &this);
auto next = first.m_nextInQueue;
first.m_nextInQueue = null;
first.m_queue = null;
first = next;
length--;
}
}
// mixin string helper to call a function with arguments that potentially have
// to be moved
private string callWithMove(ARGS...)(string func, string args)
{
import std.string;
string ret = func ~ "(";
foreach (i, T; ARGS) {
if (i > 0) ret ~= ", ";
ret ~= format("%s[%s]", args, i);
static if (needsMove!T) ret ~= ".move";
}
return ret ~ ");";
}
private template needsMove(T)
{
template isCopyable(T)
{
enum isCopyable = __traits(compiles, (T a) { return a; });
}
template isMoveable(T)
{
enum isMoveable = __traits(compiles, (T a) { return a.move; });
}
enum needsMove = !isCopyable!T;
static assert(isCopyable!T || isMoveable!T,
"Non-copyable type "~T.stringof~" must be movable with a .move property.");
}
unittest {
enum E { a, move }
static struct S {
@disable this(this);
@property S move() { return S.init; }
}
static struct T { @property T move() { return T.init; } }
static struct U { }
static struct V {
@disable this();
@disable this(this);
@property V move() { return V.init; }
}
static struct W { @disable this(); }
static assert(needsMove!S);
static assert(!needsMove!int);
static assert(!needsMove!string);
static assert(!needsMove!E);
static assert(!needsMove!T);
static assert(!needsMove!U);
static assert(needsMove!V);
static assert(!needsMove!W);
}
// DMD currently has no option to set merging of coverage files at compile-time
// This needs to be done via a Druntime API
// As this option is solely for Vibed's internal testsuite, it's hidden behind
// a long version
version(VibedSetCoverageMerge)
shared static this() {
import core.runtime : dmd_coverSetMerge;
dmd_coverSetMerge(true);
}
|
D
|
// Written in the D programming language.
/**
Standard I/O functions that extend $(B core.stdc.stdio). $(B core.stdc.stdio)
is $(D_PARAM public)ally imported when importing $(B std.stdio).
Source: $(PHOBOSSRC std/_stdio.d)
Macros:
WIKI=Phobos/StdStdio
Copyright: Copyright Digital Mars 2007-.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB digitalmars.com, Walter Bright),
$(WEB erdani.org, Andrei Alexandrescu),
Alex Rønne Petersen
*/
module std.stdio;
public import core.stdc.stdio;
import std.typecons;// Flag
import std.stdiobase;
import core.stdc.stddef;// wchar_t
import std.range.primitives;// empty, front, isBidirectionalRange
import std.traits;// Unqual, isSomeChar, isSomeString
/++
If flag $(D KeepTerminator) is set to $(D KeepTerminator.yes), then the delimiter
is included in the strings returned.
+/
alias KeepTerminator = Flag!"keepTerminator";
version (CRuntime_Microsoft)
{
version = MICROSOFT_STDIO;
}
else version (CRuntime_DigitalMars)
{
// Specific to the way Digital Mars C does stdio
version = DIGITAL_MARS_STDIO;
}
version (CRuntime_Glibc)
{
// Specific to the way Gnu C does stdio
version = GCC_IO;
version = HAS_GETDELIM;
}
version (OSX)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}
version (FreeBSD)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}
version (NetBSD)
{
version = GENERIC_IO;
version = HAS_GETDELIM;
}
version (Solaris)
{
version = GENERIC_IO;
version = NO_GETDELIM;
}
version (CRuntime_Bionic)
{
version = GENERIC_IO;
version = NO_GETDELIM;
}
// Character type used for operating system filesystem APIs
version (Windows)
{
private alias FSChar = wchar;
}
else version (Posix)
{
private alias FSChar = char;
}
else
static assert(0);
version(Windows)
{
// core.stdc.stdio.fopen expects file names to be
// encoded in CP_ACP on Windows instead of UTF-8.
/+ Waiting for druntime pull 299
+/
extern (C) nothrow @nogc FILE* _wfopen(in wchar* filename, in wchar* mode);
import core.sys.windows.windows : HANDLE;
}
version (DIGITAL_MARS_STDIO)
{
extern (C)
{
/* **
* Digital Mars under-the-hood C I/O functions.
* Use _iobuf* for the unshared version of FILE*,
* usable when the FILE is locked.
*/
nothrow:
@nogc:
int _fputc_nlock(int, _iobuf*);
int _fputwc_nlock(int, _iobuf*);
int _fgetc_nlock(_iobuf*);
int _fgetwc_nlock(_iobuf*);
int __fp_lock(FILE*);
void __fp_unlock(FILE*);
int setmode(int, int);
}
alias FPUTC = _fputc_nlock;
alias FPUTWC = _fputwc_nlock;
alias FGETC = _fgetc_nlock;
alias FGETWC = _fgetwc_nlock;
alias FLOCK = __fp_lock;
alias FUNLOCK = __fp_unlock;
alias _setmode = setmode;
enum _O_BINARY = 0x8000;
int _fileno(FILE* f) { return f._file; }
alias fileno = _fileno;
}
else version (MICROSOFT_STDIO)
{
extern (C)
{
/* **
* Microsoft under-the-hood C I/O functions
*/
nothrow:
@nogc:
int _fputc_nolock(int, _iobuf*);
int _fputwc_nolock(int, _iobuf*);
int _fgetc_nolock(_iobuf*);
int _fgetwc_nolock(_iobuf*);
void _lock_file(FILE*);
void _unlock_file(FILE*);
int _setmode(int, int);
int _fileno(FILE*);
FILE* _fdopen(int, const (char)*);
int _fseeki64(FILE*, long, int);
long _ftelli64(FILE*);
}
alias FPUTC = _fputc_nolock;
alias FPUTWC = _fputwc_nolock;
alias FGETC = _fgetc_nolock;
alias FGETWC = _fgetwc_nolock;
alias FLOCK = _lock_file;
alias FUNLOCK = _unlock_file;
enum
{
_O_RDONLY = 0x0000,
_O_APPEND = 0x0004,
_O_TEXT = 0x4000,
_O_BINARY = 0x8000,
}
}
else version (GCC_IO)
{
/* **
* Gnu under-the-hood C I/O functions; see
* http://gnu.org/software/libc/manual/html_node/I_002fO-on-Streams.html
*/
extern (C)
{
nothrow:
@nogc:
int fputc_unlocked(int, _iobuf*);
int fputwc_unlocked(wchar_t, _iobuf*);
int fgetc_unlocked(_iobuf*);
int fgetwc_unlocked(_iobuf*);
void flockfile(FILE*);
void funlockfile(FILE*);
private size_t fwrite_unlocked(const(void)* ptr,
size_t size, size_t n, _iobuf *stream);
}
alias FPUTC = fputc_unlocked;
alias FPUTWC = fputwc_unlocked;
alias FGETC = fgetc_unlocked;
alias FGETWC = fgetwc_unlocked;
alias FLOCK = flockfile;
alias FUNLOCK = funlockfile;
}
else version (GENERIC_IO)
{
nothrow:
@nogc:
extern (C)
{
void flockfile(FILE*);
void funlockfile(FILE*);
}
int fputc_unlocked(int c, _iobuf* fp) { return fputc(c, cast(shared) fp); }
int fputwc_unlocked(wchar_t c, _iobuf* fp)
{
import core.stdc.wchar_ : fputwc;
return fputwc(c, cast(shared) fp);
}
int fgetc_unlocked(_iobuf* fp) { return fgetc(cast(shared) fp); }
int fgetwc_unlocked(_iobuf* fp)
{
import core.stdc.wchar_ : fgetwc;
return fgetwc(cast(shared) fp);
}
alias FPUTC = fputc_unlocked;
alias FPUTWC = fputwc_unlocked;
alias FGETC = fgetc_unlocked;
alias FGETWC = fgetwc_unlocked;
alias FLOCK = flockfile;
alias FUNLOCK = funlockfile;
}
else
{
static assert(0, "unsupported C I/O system");
}
version(HAS_GETDELIM) extern(C) nothrow @nogc
{
ptrdiff_t getdelim(char**, size_t*, int, FILE*);
// getline() always comes together with getdelim()
ptrdiff_t getline(char**, size_t*, FILE*);
}
//------------------------------------------------------------------------------
struct ByRecord(Fields...)
{
private:
import std.typecons : Tuple;
File file;
char[] line;
Tuple!(Fields) current;
string format;
public:
this(File f, string format)
{
assert(f.isOpen);
file = f;
this.format = format;
popFront(); // prime the range
}
/// Range primitive implementations.
@property bool empty()
{
return !file.isOpen;
}
/// Ditto
@property ref Tuple!(Fields) front()
{
return current;
}
/// Ditto
void popFront()
{
import std.conv : text;
import std.exception : enforce;
import std.format : formattedRead;
import std.string : chomp;
enforce(file.isOpen, "ByRecord: File must be open");
file.readln(line);
if (!line.length)
{
file.detach();
}
else
{
line = chomp(line);
formattedRead(line, format, ¤t);
enforce(line.empty, text("Leftover characters in record: `",
line, "'"));
}
}
}
template byRecord(Fields...)
{
ByRecord!(Fields) byRecord(File f, string format)
{
return typeof(return)(f, format);
}
}
/**
Encapsulates a $(D FILE*). Generally D does not attempt to provide
thin wrappers over equivalent functions in the C standard library, but
manipulating $(D FILE*) values directly is unsafe and error-prone in
many ways. The $(D File) type ensures safe manipulation, automatic
file closing, and a lot of convenience.
The underlying $(D FILE*) handle is maintained in a reference-counted
manner, such that as soon as the last $(D File) variable bound to a
given $(D FILE*) goes out of scope, the underlying $(D FILE*) is
automatically closed.
Example:
----
// test.d
void main(string[] args)
{
auto f = File("test.txt", "w"); // open for writing
f.write("Hello");
if (args.length > 1)
{
auto g = f; // now g and f write to the same file
// internal reference count is 2
g.write(", ", args[1]);
// g exits scope, reference count decreases to 1
}
f.writeln("!");
// f exits scope, reference count falls to zero,
// underlying $(D FILE*) is closed.
}
----
$(CONSOLE
% rdmd test.d Jimmy
% cat test.txt
Hello, Jimmy!
% __
)
*/
struct File
{
import std.traits : isScalarType, isArray;
import std.range.primitives : ElementEncodingType;
enum Orientation { unknown, narrow, wide }
private struct Impl
{
FILE * handle = null; // Is null iff this Impl is closed by another File
uint refs = uint.max / 2;
bool isPopened; // true iff the stream has been created by popen()
Orientation orientation;
}
private Impl* _p;
private string _name;
package this(FILE* handle, string name, uint refs = 1, bool isPopened = false) @trusted
{
import core.stdc.stdlib : malloc;
import std.exception : enforce;
assert(!_p);
_p = cast(Impl*) enforce(malloc(Impl.sizeof), "Out of memory");
_p.handle = handle;
_p.refs = refs;
_p.isPopened = isPopened;
_p.orientation = Orientation.unknown;
_name = name;
}
/**
Constructor taking the name of the file to open and the open mode.
Copying one $(D File) object to another results in the two $(D File)
objects referring to the same underlying file.
The destructor automatically closes the file as soon as no $(D File)
object refers to it anymore.
Params:
name = range or string representing the file _name
stdioOpenmode = range or string represting the open mode
(with the same semantics as in the C standard library
$(WEB cplusplus.com/reference/clibrary/cstdio/fopen.html, fopen)
function)
Throws: $(D ErrnoException) if the file could not be opened.
*/
this(string name, in char[] stdioOpenmode = "rb") @safe
{
import std.conv : text;
import std.exception : errnoEnforce;
this(errnoEnforce(.fopen(name, stdioOpenmode),
text("Cannot open file `", name, "' in mode `",
stdioOpenmode, "'")),
name);
// MSVCRT workaround (issue 14422)
version (MICROSOFT_STDIO)
{
bool append, update;
foreach (c; stdioOpenmode)
if (c == 'a')
append = true;
else
if (c == '+')
update = true;
if (append && !update)
seek(size);
}
}
/// ditto
this(R1, R2)(R1 name)
if (isInputRange!R1 && isSomeChar!(ElementEncodingType!R1))
{
import std.conv : to;
this(name.to!string, "rb");
}
/// ditto
this(R1, R2)(R1 name, R2 mode)
if (isInputRange!R1 && isSomeChar!(ElementEncodingType!R1) &&
isInputRange!R2 && isSomeChar!(ElementEncodingType!R2))
{
import std.conv : to;
this(name.to!string, mode.to!string);
}
@safe unittest
{
static import std.file;
import std.utf : byChar;
auto deleteme = testFilename();
auto f = File(deleteme.byChar, "w".byChar);
f.close();
std.file.remove(deleteme);
}
~this() @safe
{
detach();
}
this(this) @safe nothrow
{
if (!_p) return;
assert(_p.refs);
++_p.refs;
}
/**
Assigns a file to another. The target of the assignment gets detached
from whatever file it was attached to, and attaches itself to the new
file.
*/
void opAssign(File rhs) @safe
{
import std.algorithm : swap;
swap(this, rhs);
}
/**
First calls $(D detach) (throwing on failure), and then attempts to
_open file $(D name) with mode $(D stdioOpenmode). The mode has the
same semantics as in the C standard library $(WEB
cplusplus.com/reference/clibrary/cstdio/fopen.html, fopen) function.
Throws: $(D ErrnoException) in case of error.
*/
void open(string name, in char[] stdioOpenmode = "rb") @safe
{
detach();
this = File(name, stdioOpenmode);
}
/**
First calls $(D detach) (throwing on failure), and then runs a command
by calling the C standard library function $(WEB
opengroup.org/onlinepubs/007908799/xsh/_popen.html, _popen).
Throws: $(D ErrnoException) in case of error.
*/
version(Posix) void popen(string command, in char[] stdioOpenmode = "r") @safe
{
import std.exception : errnoEnforce;
detach();
this = File(errnoEnforce(.popen(command, stdioOpenmode),
"Cannot run command `"~command~"'"),
command, 1, true);
}
/**
First calls $(D detach) (throwing on failure), and then attempts to
associate the given file descriptor with the $(D File). The mode must
be compatible with the mode of the file descriptor.
Throws: $(D ErrnoException) in case of error.
*/
void fdopen(int fd, in char[] stdioOpenmode = "rb") @safe
{
fdopen(fd, stdioOpenmode, null);
}
package void fdopen(int fd, in char[] stdioOpenmode, string name) @trusted
{
import std.internal.cstring : tempCString;
import std.exception : errnoEnforce;
auto modez = stdioOpenmode.tempCString();
detach();
version (DIGITAL_MARS_STDIO)
{
// This is a re-implementation of DMC's fdopen, but without the
// mucking with the file descriptor. POSIX standard requires the
// new fdopen'd file to retain the given file descriptor's
// position.
import core.stdc.stdio : fopen;
auto fp = fopen("NUL", modez);
errnoEnforce(fp, "Cannot open placeholder NUL stream");
FLOCK(fp);
auto iob = cast(_iobuf*)fp;
.close(iob._file);
iob._file = fd;
iob._flag &= ~_IOTRAN;
FUNLOCK(fp);
}
else
{
version (Windows) // MSVCRT
auto fp = _fdopen(fd, modez);
else version (Posix)
{
import core.sys.posix.stdio : fdopen;
auto fp = fdopen(fd, modez);
}
errnoEnforce(fp);
}
this = File(fp, name);
}
// Declare a dummy HANDLE to allow generating documentation
// for Windows-only methods.
version(StdDdoc) { version(Windows) {} else alias HANDLE = int; }
/**
First calls $(D detach) (throwing on failure), and then attempts to
associate the given Windows $(D HANDLE) with the $(D File). The mode must
be compatible with the access attributes of the handle. Windows only.
Throws: $(D ErrnoException) in case of error.
*/
version(StdDdoc)
void windowsHandleOpen(HANDLE handle, in char[] stdioOpenmode);
version(Windows)
void windowsHandleOpen(HANDLE handle, in char[] stdioOpenmode)
{
import std.exception : errnoEnforce;
import std.format : format;
// Create file descriptors from the handles
version (DIGITAL_MARS_STDIO)
auto fd = _handleToFD(handle, FHND_DEVICE);
else // MSVCRT
{
int mode;
modeLoop:
foreach (c; stdioOpenmode)
switch (c)
{
case 'r': mode |= _O_RDONLY; break;
case '+': mode &=~_O_RDONLY; break;
case 'a': mode |= _O_APPEND; break;
case 'b': mode |= _O_BINARY; break;
case 't': mode |= _O_TEXT; break;
case ',': break modeLoop;
default: break;
}
auto fd = _open_osfhandle(cast(intptr_t)handle, mode);
}
errnoEnforce(fd >= 0, "Cannot open Windows HANDLE");
fdopen(fd, stdioOpenmode, "HANDLE(%s)".format(handle));
}
/** Returns $(D true) if the file is opened. */
@property bool isOpen() const @safe pure nothrow
{
return _p !is null && _p.handle;
}
/**
Returns $(D true) if the file is at end (see $(WEB
cplusplus.com/reference/clibrary/cstdio/feof.html, feof)).
Throws: $(D Exception) if the file is not opened.
*/
@property bool eof() const @trusted pure
{
import std.exception : enforce;
enforce(_p && _p.handle, "Calling eof() against an unopened file.");
return .feof(cast(FILE*) _p.handle) != 0;
}
/** Returns the name of the last opened file, if any.
If a $(D File) was created with $(LREF tmpfile) and $(LREF wrapFile)
it has no name.*/
@property string name() const @safe pure nothrow
{
return _name;
}
/**
If the file is not opened, returns $(D true). Otherwise, returns
$(WEB cplusplus.com/reference/clibrary/cstdio/ferror.html, ferror) for
the file handle.
*/
@property bool error() const @trusted pure nothrow
{
return !isOpen || .ferror(cast(FILE*) _p.handle);
}
@safe unittest
{
// Issue 12349
static import std.file;
auto deleteme = testFilename();
auto f = File(deleteme, "w");
scope(exit) std.file.remove(deleteme);
f.close();
assert(f.error);
}
/**
Detaches from the underlying file. If the sole owner, calls $(D close).
Throws: $(D ErrnoException) on failure if closing the file.
*/
void detach() @safe
{
if (!_p) return;
if (_p.refs == 1)
close();
else
{
assert(_p.refs);
--_p.refs;
_p = null;
}
}
@safe unittest
{
static import std.file;
auto deleteme = testFilename();
scope(exit) std.file.remove(deleteme);
auto f = File(deleteme, "w");
{
auto f2 = f;
f2.detach();
}
assert(f._p.refs == 1);
f.close();
}
/**
If the file was unopened, succeeds vacuously. Otherwise closes the
file (by calling $(WEB
cplusplus.com/reference/clibrary/cstdio/fclose.html, fclose)),
throwing on error. Even if an exception is thrown, afterwards the $(D
File) object is empty. This is different from $(D detach) in that it
always closes the file; consequently, all other $(D File) objects
referring to the same handle will see a closed file henceforth.
Throws: $(D ErrnoException) on error.
*/
void close() @trusted
{
import core.stdc.stdlib : free;
import std.exception : errnoEnforce;
if (!_p) return; // succeed vacuously
scope(exit)
{
assert(_p.refs);
if (!--_p.refs)
free(_p);
_p = null; // start a new life
}
if (!_p.handle) return; // Impl is closed by another File
scope(exit) _p.handle = null; // nullify the handle anyway
version (Posix)
{
import std.format : format;
import core.sys.posix.stdio : pclose;
if (_p.isPopened)
{
auto res = pclose(_p.handle);
errnoEnforce(res != -1,
"Could not close pipe `"~_name~"'");
errnoEnforce(res == 0, format("Command returned %d", res));
return;
}
}
//fprintf(core.stdc.stdio.stderr, ("Closing file `"~name~"`.\n\0").ptr);
errnoEnforce(.fclose(_p.handle) == 0,
"Could not close file `"~_name~"'");
}
/**
If the file is not opened, succeeds vacuously. Otherwise, returns
$(WEB cplusplus.com/reference/clibrary/cstdio/_clearerr.html,
_clearerr) for the file handle.
*/
void clearerr() @safe pure nothrow
{
_p is null || _p.handle is null ||
.clearerr(_p.handle);
}
/**
Flushes the C $(D FILE) buffers.
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_fflush.html, _fflush)
for the file handle.
Throws: $(D Exception) if the file is not opened or if the call to $(D fflush) fails.
*/
void flush() @trusted
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to flush() in an unopened file");
errnoEnforce(.fflush(_p.handle) == 0);
}
@safe unittest
{
// Issue 12349
static import std.file;
import std.exception: assertThrown;
auto deleteme = testFilename();
auto f = File(deleteme, "w");
scope(exit) std.file.remove(deleteme);
f.close();
assertThrown(f.flush());
}
/**
Forces any data buffered by the OS to be written to disk.
Call $(LREF flush) before calling this function to flush the C $(D FILE) buffers first.
This function calls
$(WEB msdn.microsoft.com/en-us/library/windows/desktop/aa364439%28v=vs.85%29.aspx,
$(D FlushFileBuffers)) on Windows and
$(WEB pubs.opengroup.org/onlinepubs/7908799/xsh/fsync.html,
$(D fsync)) on POSIX for the file handle.
Throws: $(D Exception) if the file is not opened or if the OS call fails.
*/
void sync() @trusted
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to sync() an unopened file");
version (Windows)
wenforce(FlushFileBuffers(windowsHandle), "FlushFileBuffers failed");
else
{
import core.sys.posix.unistd : fsync;
errnoEnforce(fsync(fileno) == 0, "fsync failed");
}
}
/**
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/fread.html, fread) for the
file handle. The number of items to read and the size of
each item is inferred from the size and type of the input array, respectively.
Returns: The slice of $(D buffer) containing the data that was actually read.
This will be shorter than $(D buffer) if EOF was reached before the buffer
could be filled.
Throws: $(D Exception) if $(D buffer) is empty.
$(D ErrnoException) if the file is not opened or the call to $(D fread) fails.
$(D rawRead) always reads in binary mode on Windows.
*/
T[] rawRead(T)(T[] buffer)
{
import std.exception : errnoEnforce;
if (!buffer.length)
throw new Exception("rawRead must take a non-empty buffer");
version(Windows)
{
immutable fd = ._fileno(_p.handle);
immutable mode = ._setmode(fd, _O_BINARY);
scope(exit) ._setmode(fd, mode);
version(DIGITAL_MARS_STDIO)
{
import core.atomic;
// @@@BUG@@@ 4243
immutable info = __fhnd_info[fd];
atomicOp!"&="(__fhnd_info[fd], ~FHND_TEXT);
scope(exit) __fhnd_info[fd] = info;
}
}
immutable freadResult =
fread(buffer.ptr, T.sizeof, buffer.length, _p.handle);
assert (freadResult <= buffer.length); // fread return guarantee
if (freadResult != buffer.length) // error or eof
{
errnoEnforce(!error);
return buffer[0 .. freadResult];
}
return buffer;
}
///
unittest
{
static import std.file;
auto testFile = testFilename();
std.file.write(testFile, "\r\n\n\r\n");
scope(exit) std.file.remove(testFile);
auto f = File(testFile, "r");
auto buf = f.rawRead(new char[5]);
f.close();
assert(buf == "\r\n\n\r\n");
}
/**
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/fwrite.html, fwrite) for the file
handle. The number of items to write and the size of each
item is inferred from the size and type of the input array, respectively. An
error is thrown if the buffer could not be written in its entirety.
$(D rawWrite) always writes in binary mode on Windows.
Throws: $(D ErrnoException) if the file is not opened or if the call to $(D fwrite) fails.
*/
void rawWrite(T)(in T[] buffer)
{
import std.conv : text;
import std.exception : errnoEnforce;
version(Windows)
{
flush(); // before changing translation mode
immutable fd = ._fileno(_p.handle);
immutable mode = ._setmode(fd, _O_BINARY);
scope(exit) ._setmode(fd, mode);
version(DIGITAL_MARS_STDIO)
{
import core.atomic;
// @@@BUG@@@ 4243
immutable info = __fhnd_info[fd];
atomicOp!"&="(__fhnd_info[fd], ~FHND_TEXT);
scope(exit) __fhnd_info[fd] = info;
}
scope(exit) flush(); // before restoring translation mode
}
auto result =
.fwrite(buffer.ptr, T.sizeof, buffer.length, _p.handle);
if (result == result.max) result = 0;
errnoEnforce(result == buffer.length,
text("Wrote ", result, " instead of ", buffer.length,
" objects of type ", T.stringof, " to file `",
_name, "'"));
}
///
unittest
{
static import std.file;
auto testFile = testFilename();
auto f = File(testFile, "w");
scope(exit) std.file.remove(testFile);
f.rawWrite("\r\n\n\r\n");
f.close();
assert(std.file.read(testFile) == "\r\n\n\r\n");
}
/**
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/fseek.html, fseek)
for the file handle.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) if the call to $(D fseek) fails.
*/
void seek(long offset, int origin = SEEK_SET) @trusted
{
import std.exception : enforce, errnoEnforce;
import std.conv : to, text;
enforce(isOpen, "Attempting to seek() in an unopened file");
version (Windows)
{
version (CRuntime_Microsoft)
{
alias fseekFun = _fseeki64;
alias off_t = long;
}
else
{
alias fseekFun = fseek;
alias off_t = int;
}
}
else version (Posix)
{
import core.sys.posix.stdio : fseeko, off_t;
alias fseekFun = fseeko;
}
errnoEnforce(fseekFun(_p.handle, to!off_t(offset), origin) == 0,
"Could not seek in file `"~_name~"'");
}
unittest
{
static import std.file;
auto deleteme = testFilename();
auto f = File(deleteme, "w+");
scope(exit) { f.close(); std.file.remove(deleteme); }
f.rawWrite("abcdefghijklmnopqrstuvwxyz");
f.seek(7);
assert(f.readln() == "hijklmnopqrstuvwxyz");
import std.conv : text;
version (CRuntime_DigitalMars)
auto bigOffset = int.max - 100;
else
version (CRuntime_Bionic)
auto bigOffset = int.max - 100;
else
auto bigOffset = cast(ulong) int.max + 100;
f.seek(bigOffset);
assert(f.tell == bigOffset, text(f.tell));
// Uncomment the tests below only if you want to wait for
// a long time
// f.rawWrite("abcdefghijklmnopqrstuvwxyz");
// f.seek(-3, SEEK_END);
// assert(f.readln() == "xyz");
}
/**
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/ftell.html, ftell) for the
managed file handle.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) if the call to $(D ftell) fails.
*/
@property ulong tell() const @trusted
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to tell() in an unopened file");
version (Windows)
{
version (CRuntime_Microsoft)
immutable result = _ftelli64(cast(FILE*) _p.handle);
else
immutable result = ftell(cast(FILE*) _p.handle);
}
else version (Posix)
{
import core.sys.posix.stdio : ftello;
immutable result = ftello(cast(FILE*) _p.handle);
}
errnoEnforce(result != -1,
"Query ftell() failed for file `"~_name~"'");
return result;
}
///
unittest
{
static import std.file;
import std.conv : text;
auto testFile = testFilename();
std.file.write(testFile, "abcdefghijklmnopqrstuvwqxyz");
scope(exit) { std.file.remove(testFile); }
auto f = File(testFile);
auto a = new ubyte[4];
f.rawRead(a);
assert(f.tell == 4, text(f.tell));
}
/**
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_rewind.html, _rewind)
for the file handle.
Throws: $(D Exception) if the file is not opened.
*/
void rewind() @safe
{
import std.exception : enforce;
enforce(isOpen, "Attempting to rewind() an unopened file");
.rewind(_p.handle);
}
/**
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_setvbuf.html, _setvbuf) for
the file handle.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) if the call to $(D setvbuf) fails.
*/
void setvbuf(size_t size, int mode = _IOFBF) @trusted
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to call setvbuf() on an unopened file");
errnoEnforce(.setvbuf(_p.handle, null, mode, size) == 0,
"Could not set buffering for file `"~_name~"'");
}
/**
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_setvbuf.html,
_setvbuf) for the file handle.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) if the call to $(D setvbuf) fails.
*/
void setvbuf(void[] buf, int mode = _IOFBF) @trusted
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to call setvbuf() on an unopened file");
errnoEnforce(.setvbuf(_p.handle,
cast(char*) buf.ptr, mode, buf.length) == 0,
"Could not set buffering for file `"~_name~"'");
}
version(Windows)
{
import core.sys.windows.windows;
private BOOL lockImpl(alias F, Flags...)(ulong start, ulong length,
Flags flags)
{
if (!start && !length)
length = ulong.max;
ULARGE_INTEGER liStart = void, liLength = void;
liStart.QuadPart = start;
liLength.QuadPart = length;
OVERLAPPED overlapped;
overlapped.Offset = liStart.LowPart;
overlapped.OffsetHigh = liStart.HighPart;
overlapped.hEvent = null;
return F(windowsHandle, flags, 0, liLength.LowPart,
liLength.HighPart, &overlapped);
}
private static T wenforce(T)(T cond, string str)
{
import std.windows.syserror;
if (cond) return cond;
throw new Exception(str ~ ": " ~ sysErrorString(GetLastError()));
}
}
version(Posix)
{
private int lockImpl(int operation, short l_type,
ulong start, ulong length)
{
import std.conv : to;
import core.sys.posix.fcntl : fcntl, flock, off_t;
import core.sys.posix.unistd : getpid;
flock fl = void;
fl.l_type = l_type;
fl.l_whence = SEEK_SET;
fl.l_start = to!off_t(start);
fl.l_len = to!off_t(length);
fl.l_pid = getpid();
return fcntl(fileno, operation, &fl);
}
}
/**
Locks the specified file segment. If the file segment is already locked
by another process, waits until the existing lock is released.
If both $(D start) and $(D length) are zero, the entire file is locked.
Locks created using $(D lock) and $(D tryLock) have the following properties:
$(UL
$(LI All locks are automatically released when the process terminates.)
$(LI Locks are not inherited by child processes.)
$(LI Closing a file will release all locks associated with the file. On POSIX,
even locks acquired via a different $(D File) will be released as well.)
$(LI Not all NFS implementations correctly implement file locking.)
)
*/
void lock(LockType lockType = LockType.readWrite,
ulong start = 0, ulong length = 0)
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to call lock() on an unopened file");
version (Posix)
{
import core.sys.posix.fcntl : F_RDLCK, F_SETLKW, F_WRLCK;
immutable short type = lockType == LockType.readWrite
? F_WRLCK : F_RDLCK;
errnoEnforce(lockImpl(F_SETLKW, type, start, length) != -1,
"Could not set lock for file `"~_name~"'");
}
else
version(Windows)
{
immutable type = lockType == LockType.readWrite ?
LOCKFILE_EXCLUSIVE_LOCK : 0;
wenforce(lockImpl!LockFileEx(start, length, type),
"Could not set lock for file `"~_name~"'");
}
else
static assert(false);
}
/**
Attempts to lock the specified file segment.
If both $(D start) and $(D length) are zero, the entire file is locked.
Returns: $(D true) if the lock was successful, and $(D false) if the
specified file segment was already locked.
*/
bool tryLock(LockType lockType = LockType.readWrite,
ulong start = 0, ulong length = 0)
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to call tryLock() on an unopened file");
version (Posix)
{
import core.stdc.errno : EACCES, EAGAIN, errno;
import core.sys.posix.fcntl : F_RDLCK, F_SETLK, F_WRLCK;
immutable short type = lockType == LockType.readWrite
? F_WRLCK : F_RDLCK;
immutable res = lockImpl(F_SETLK, type, start, length);
if (res == -1 && (errno == EACCES || errno == EAGAIN))
return false;
errnoEnforce(res != -1, "Could not set lock for file `"~_name~"'");
return true;
}
else
version(Windows)
{
immutable type = lockType == LockType.readWrite
? LOCKFILE_EXCLUSIVE_LOCK : 0;
immutable res = lockImpl!LockFileEx(start, length,
type | LOCKFILE_FAIL_IMMEDIATELY);
if (!res && (GetLastError() == ERROR_IO_PENDING
|| GetLastError() == ERROR_LOCK_VIOLATION))
return false;
wenforce(res, "Could not set lock for file `"~_name~"'");
return true;
}
else
static assert(false);
}
/**
Removes the lock over the specified file segment.
*/
void unlock(ulong start = 0, ulong length = 0)
{
import std.exception : enforce, errnoEnforce;
enforce(isOpen, "Attempting to call unlock() on an unopened file");
version (Posix)
{
import core.sys.posix.fcntl : F_SETLK, F_UNLCK;
errnoEnforce(lockImpl(F_SETLK, F_UNLCK, start, length) != -1,
"Could not remove lock for file `"~_name~"'");
}
else
version(Windows)
{
wenforce(lockImpl!UnlockFileEx(start, length),
"Could not remove lock for file `"~_name~"'");
}
else
static assert(false);
}
version(Windows)
unittest
{
static import std.file;
auto deleteme = testFilename();
scope(exit) std.file.remove(deleteme);
auto f = File(deleteme, "wb");
assert(f.tryLock());
auto g = File(deleteme, "wb");
assert(!g.tryLock());
assert(!g.tryLock(LockType.read));
f.unlock();
f.lock(LockType.read);
assert(!g.tryLock());
assert(g.tryLock(LockType.read));
f.unlock();
g.unlock();
}
version(Posix)
unittest
{
static import std.file;
auto deleteme = testFilename();
scope(exit) std.file.remove(deleteme);
// Since locks are per-process, we cannot test lock failures within
// the same process. fork() is used to create a second process.
static void runForked(void delegate() code)
{
import core.stdc.stdlib : exit;
import core.sys.posix.unistd;
import core.sys.posix.sys.wait;
int child, status;
if ((child = fork()) == 0)
{
code();
exit(0);
}
else
{
assert(wait(&status) != -1);
assert(status == 0, "Fork crashed");
}
}
auto f = File(deleteme, "w+b");
runForked
({
auto g = File(deleteme, "a+b");
assert(g.tryLock());
g.unlock();
assert(g.tryLock(LockType.read));
});
assert(f.tryLock());
runForked
({
auto g = File(deleteme, "a+b");
assert(!g.tryLock());
assert(!g.tryLock(LockType.read));
});
f.unlock();
f.lock(LockType.read);
runForked
({
auto g = File(deleteme, "a+b");
assert(!g.tryLock());
assert(g.tryLock(LockType.read));
g.unlock();
});
f.unlock();
}
/**
Writes its arguments in text format to the file.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) on an error writing to the file.
*/
void write(S...)(S args)
{
import std.traits : isBoolean, isIntegral, isAggregateType;
auto w = lockingTextWriter();
foreach (arg; args)
{
alias A = typeof(arg);
static if (isAggregateType!A || is(A == enum))
{
import std.format : formattedWrite;
formattedWrite(w, "%s", arg);
}
else static if (isSomeString!A)
{
import std.range.primitives : put;
put(w, arg);
}
else static if (isIntegral!A)
{
import std.conv : toTextRange;
toTextRange(arg, w);
}
else static if (isBoolean!A)
{
put(w, arg ? "true" : "false");
}
else static if (isSomeChar!A)
{
import std.range.primitives : put;
put(w, arg);
}
else
{
import std.format : formattedWrite;
// Most general case
formattedWrite(w, "%s", arg);
}
}
}
/**
Writes its arguments in text format to the file, followed by a newline.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) on an error writing to the file.
*/
void writeln(S...)(S args)
{
write(args, '\n');
}
/**
Writes its arguments in text format to the file, according to the
format in the first argument.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) on an error writing to the file.
*/
void writef(Char, A...)(in Char[] fmt, A args)
{
import std.format : formattedWrite;
formattedWrite(lockingTextWriter(), fmt, args);
}
/**
Writes its arguments in text format to the file, according to the
format in the first argument, followed by a newline.
Throws: $(D Exception) if the file is not opened.
$(D ErrnoException) on an error writing to the file.
*/
void writefln(Char, A...)(in Char[] fmt, A args)
{
import std.format : formattedWrite;
auto w = lockingTextWriter();
formattedWrite(w, fmt, args);
w.put('\n');
}
/**
Read line from the file handle and return it as a specified type.
This version manages its own read buffer, which means one memory allocation per call. If you are not
retaining a reference to the read data, consider the $(D File.readln(buf)) version, which may offer
better performance as it can reuse its read buffer.
Params:
S = Template parameter; the type of the allocated buffer, and the type returned. Defaults to $(D string).
terminator = Line terminator (by default, $(D '\n')).
Note:
String terminators are not supported due to ambiguity with readln(buf) below.
Returns:
The line that was read, including the line terminator character.
Throws:
$(D StdioException) on I/O error, or $(D UnicodeException) on Unicode conversion error.
Example:
---
// Reads $(D stdin) and writes it to $(D stdout).
import std.stdio;
void main()
{
string line;
while ((line = stdin.readln()) !is null)
write(line);
}
---
*/
S readln(S = string)(dchar terminator = '\n')
if (isSomeString!S)
{
Unqual!(ElementEncodingType!S)[] buf;
readln(buf, terminator);
return cast(S)buf;
}
unittest
{
static import std.file;
import std.algorithm : equal;
import std.meta : AliasSeq;
auto deleteme = testFilename();
std.file.write(deleteme, "hello\nworld\n");
scope(exit) std.file.remove(deleteme);
foreach (String; AliasSeq!(string, char[], wstring, wchar[], dstring, dchar[]))
{
auto witness = [ "hello\n", "world\n" ];
auto f = File(deleteme);
uint i = 0;
String buf;
while ((buf = f.readln!String()).length)
{
assert(i < witness.length);
assert(equal(buf, witness[i++]));
}
assert(i == witness.length);
}
}
unittest
{
static import std.file;
import std.typecons : Tuple;
auto deleteme = testFilename();
std.file.write(deleteme, "cześć \U0002000D");
scope(exit) std.file.remove(deleteme);
uint[] lengths = [12,8,7];
foreach (uint i, C; Tuple!(char, wchar, dchar).Types)
{
immutable(C)[] witness = "cześć \U0002000D";
auto buf = File(deleteme).readln!(immutable(C)[])();
assert(buf.length == lengths[i]);
assert(buf == witness);
}
}
/**
Read line from the file handle and write it to $(D buf[]), including
terminating character.
This can be faster than $(D line = File.readln()) because you can reuse
the buffer for each call. Note that reusing the buffer means that you
must copy the previous contents if you wish to retain them.
Params:
buf = Buffer used to store the resulting line data. buf is
resized as necessary.
terminator = Line terminator (by default, $(D '\n')). Use
$(XREF ascii, newline) for portability (unless the file was opened in
text mode).
Returns:
0 for end of file, otherwise number of characters read
Throws: $(D StdioException) on I/O error, or $(D UnicodeException) on Unicode
conversion error.
Example:
---
// Read lines from $(D stdin) into a string
// Ignore lines starting with '#'
// Write the string to $(D stdout)
void main()
{
string output;
char[] buf;
while (stdin.readln(buf))
{
if (buf[0] == '#')
continue;
output ~= buf;
}
write(output);
}
---
This method can be more efficient than the one in the previous example
because $(D stdin.readln(buf)) reuses (if possible) memory allocated
for $(D buf), whereas $(D line = stdin.readln()) makes a new memory allocation
for every line.
For even better performance you can help $(D readln) by passing in a
large buffer to avoid memory reallocations. This can be done by reusing the
largest buffer returned by $(D readln):
Example:
---
// Read lines from $(D stdin) and count words
void main()
{
char[] buf;
size_t words = 0;
while (!stdin.eof)
{
char[] line = buf;
stdin.readln(line);
if (line.length > buf.length)
buf = line;
words += line.split.length;
}
writeln(words);
}
---
This is actually what $(LREF byLine) does internally, so its usage
is recommended if you want to process a complete file.
*/
size_t readln(C)(ref C[] buf, dchar terminator = '\n')
if (isSomeChar!C && is(Unqual!C == C) && !is(C == enum))
{
import std.exception : enforce;
static if (is(C == char))
{
enforce(_p && _p.handle, "Attempt to read from an unopened file.");
if (_p.orientation == Orientation.unknown)
{
import core.stdc.wchar_ : fwide;
auto w = fwide(_p.handle, 0);
if (w < 0) _p.orientation = Orientation.narrow;
else if (w > 0) _p.orientation = Orientation.wide;
}
return readlnImpl(_p.handle, buf, terminator, _p.orientation);
}
else
{
// TODO: optimize this
string s = readln(terminator);
buf.length = 0;
if (!s.length) return 0;
foreach (C c; s)
{
buf ~= c;
}
return buf.length;
}
}
unittest
{
static import std.file;
auto deleteme = testFilename();
std.file.write(deleteme, "123\n456789");
scope(exit) std.file.remove(deleteme);
auto file = File(deleteme);
char[] buffer = new char[10];
char[] line = buffer;
file.readln(line);
auto beyond = line.length;
buffer[beyond] = 'a';
file.readln(line); // should not write buffer beyond line
assert(buffer[beyond] == 'a');
}
unittest // bugzilla 15293
{
static import std.file;
auto deleteme = testFilename();
std.file.write(deleteme, "a\n\naa");
scope(exit) std.file.remove(deleteme);
auto file = File(deleteme);
char[] buffer;
char[] line;
file.readln(buffer, '\n');
line = buffer;
file.readln(line, '\n');
line = buffer;
file.readln(line, '\n');
assert(line[0 .. 1].capacity == 0);
}
/** ditto */
size_t readln(C, R)(ref C[] buf, R terminator)
if (isSomeChar!C && is(Unqual!C == C) && !is(C == enum) &&
isBidirectionalRange!R && is(typeof(terminator.front == dchar.init)))
{
import std.algorithm : endsWith, swap;
import std.range.primitives : back;
auto last = terminator.back;
C[] buf2;
swap(buf, buf2);
for (;;) {
if (!readln(buf2, last) || endsWith(buf2, terminator)) {
if (buf.empty) {
buf = buf2;
} else {
buf ~= buf2;
}
break;
}
buf ~= buf2;
}
return buf.length;
}
unittest
{
static import std.file;
import std.typecons : Tuple;
auto deleteme = testFilename();
std.file.write(deleteme, "hello\n\rworld\nhow\n\rare ya");
scope(exit) std.file.remove(deleteme);
foreach (C; Tuple!(char, wchar, dchar).Types)
{
immutable(C)[][] witness = [ "hello\n\r", "world\nhow\n\r", "are ya" ];
auto f = File(deleteme);
uint i = 0;
C[] buf;
while (f.readln(buf, "\n\r"))
{
assert(i < witness.length);
assert(buf == witness[i++]);
}
assert(buf.length==0);
}
}
/**
* Read data from the file according to the specified
* $(LINK2 std_format.html#_format-string, format specifier) using
* $(XREF _format,formattedRead).
*/
uint readf(Data...)(in char[] format, Data data)
{
import std.format : formattedRead;
assert(isOpen);
auto input = LockingTextReader(this);
return formattedRead(input, format, data);
}
///
unittest
{
static import std.file;
auto deleteme = testFilename();
std.file.write(deleteme, "hello\nworld\ntrue\nfalse\n");
scope(exit) std.file.remove(deleteme);
string s;
auto f = File(deleteme);
f.readf("%s\n", &s);
assert(s == "hello", "["~s~"]");
f.readf("%s\n", &s);
assert(s == "world", "["~s~"]");
// Issue 11698
bool b1, b2;
f.readf("%s\n%s\n", &b1, &b2);
assert(b1 == true && b2 == false);
}
/**
Returns a temporary file by calling $(WEB
cplusplus.com/reference/clibrary/cstdio/_tmpfile.html, _tmpfile).
Note that the created file has no $(LREF name).*/
static File tmpfile() @safe
{
import std.exception : errnoEnforce;
return File(errnoEnforce(.tmpfile(),
"Could not create temporary file with tmpfile()"),
null);
}
/**
Unsafe function that wraps an existing $(D FILE*). The resulting $(D
File) never takes the initiative in closing the file.
Note that the created file has no $(LREF name)*/
/*private*/ static File wrapFile(FILE* f) @safe
{
import std.exception : enforce;
return File(enforce(f, "Could not wrap null FILE*"),
null, /*uint.max / 2*/ 9999);
}
/**
Returns the $(D FILE*) corresponding to this object.
*/
FILE* getFP() @safe pure
{
import std.exception : enforce;
enforce(_p && _p.handle,
"Attempting to call getFP() on an unopened file");
return _p.handle;
}
unittest
{
static import core.stdc.stdio;
assert(stdout.getFP() == core.stdc.stdio.stdout);
}
/**
Returns the file number corresponding to this object.
*/
/*version(Posix) */@property int fileno() const @trusted
{
import std.exception : enforce;
enforce(isOpen, "Attempting to call fileno() on an unopened file");
return .fileno(cast(FILE*) _p.handle);
}
/**
Returns the underlying operating system $(D HANDLE) (Windows only).
*/
version(StdDdoc)
@property HANDLE windowsHandle();
version(Windows)
@property HANDLE windowsHandle()
{
version (DIGITAL_MARS_STDIO)
return _fdToHandle(fileno);
else
return cast(HANDLE)_get_osfhandle(fileno);
}
// Note: This was documented until 2013/08
/*
Range that reads one line at a time. Returned by $(LREF byLine).
Allows to directly use range operations on lines of a file.
*/
struct ByLine(Char, Terminator)
{
private:
import std.typecons;
/* Ref-counting stops the source range's Impl
* from getting out of sync after the range is copied, e.g.
* when accessing range.front, then using std.range.take,
* then accessing range.front again. */
alias PImpl = RefCounted!(Impl, RefCountedAutoInitialize.no);
PImpl impl;
static if (isScalarType!Terminator)
enum defTerm = '\n';
else
enum defTerm = cast(Terminator)"\n";
public:
this(File f, KeepTerminator kt = KeepTerminator.no,
Terminator terminator = defTerm)
{
impl = PImpl(f, kt, terminator);
}
@property bool empty()
{
return impl.refCountedPayload.empty;
}
@property Char[] front()
{
return impl.refCountedPayload.front;
}
void popFront()
{
impl.refCountedPayload.popFront();
}
private:
struct Impl
{
private:
File file;
Char[] line;
Char[] buffer;
Terminator terminator;
KeepTerminator keepTerminator;
public:
this(File f, KeepTerminator kt, Terminator terminator)
{
file = f;
this.terminator = terminator;
keepTerminator = kt;
popFront();
}
// Range primitive implementations.
@property bool empty()
{
return line is null;
}
@property Char[] front()
{
return line;
}
void popFront()
{
import std.algorithm : endsWith;
assert(file.isOpen);
line = buffer;
file.readln(line, terminator);
if (line.length > buffer.length)
{
buffer = line;
}
if (line.empty)
{
file.detach();
line = null;
}
else if (keepTerminator == KeepTerminator.no
&& endsWith(line, terminator))
{
static if (isScalarType!Terminator)
enum tlen = 1;
else static if (isArray!Terminator)
{
static assert(
is(Unqual!(ElementEncodingType!Terminator) == Char));
const tlen = terminator.length;
}
else
static assert(false);
line = line.ptr[0 .. line.length - tlen];
}
}
}
}
/**
Returns an input range set up to read from the file handle one line
at a time.
The element type for the range will be $(D Char[]). Range primitives
may throw $(D StdioException) on I/O error.
Note:
Each $(D front) will not persist after $(D
popFront) is called, so the caller must copy its contents (e.g. by
calling $(D to!string)) when retention is needed. If the caller needs
to retain a copy of every line, use the $(LREF byLineCopy) function
instead.
Params:
Char = Character type for each line, defaulting to $(D char).
keepTerminator = Use $(D KeepTerminator.yes) to include the
terminator at the end of each line.
terminator = Line separator ($(D '\n') by default). Use
$(XREF ascii, newline) for portability (unless the file was opened in
text mode).
Example:
----
import std.algorithm, std.stdio, std.string;
// Count words in a file using ranges.
void main()
{
auto file = File("file.txt"); // Open for reading
const wordCount = file.byLine() // Read lines
.map!split // Split into words
.map!(a => a.length) // Count words per line
.sum(); // Total word count
writeln(wordCount);
}
----
Example:
----
import std.range, std.stdio;
// Read lines using foreach.
void main()
{
auto file = File("file.txt"); // Open for reading
auto range = file.byLine();
// Print first three lines
foreach (line; range.take(3))
writeln(line);
// Print remaining lines beginning with '#'
foreach (line; range)
{
if (!line.empty && line[0] == '#')
writeln(line);
}
}
----
Notice that neither example accesses the line data returned by
$(D front) after the corresponding $(D popFront) call is made (because
the contents may well have changed).
*/
auto byLine(Terminator = char, Char = char)
(KeepTerminator keepTerminator = KeepTerminator.no,
Terminator terminator = '\n')
if (isScalarType!Terminator)
{
return ByLine!(Char, Terminator)(this, keepTerminator, terminator);
}
/// ditto
auto byLine(Terminator, Char = char)
(KeepTerminator keepTerminator, Terminator terminator)
if (is(Unqual!(ElementEncodingType!Terminator) == Char))
{
return ByLine!(Char, Terminator)(this, keepTerminator, terminator);
}
unittest
{
static import std.file;
auto deleteme = testFilename();
std.file.write(deleteme, "hi");
scope(success) std.file.remove(deleteme);
import std.meta : AliasSeq;
foreach (T; AliasSeq!(char, wchar, dchar))
{
auto blc = File(deleteme).byLine!(T, T);
assert(blc.front == "hi");
// check front is cached
assert(blc.front is blc.front);
}
}
private struct ByLineCopy(Char, Terminator)
{
private:
import std.typecons;
/* Ref-counting stops the source range's ByLineCopyImpl
* from getting out of sync after the range is copied, e.g.
* when accessing range.front, then using std.range.take,
* then accessing range.front again. */
alias Impl = RefCounted!(ByLineCopyImpl!(Char, Terminator),
RefCountedAutoInitialize.no);
Impl impl;
public:
this(File f, KeepTerminator kt, Terminator terminator)
{
impl = Impl(f, kt, terminator);
}
@property bool empty()
{
return impl.refCountedPayload.empty;
}
@property Char[] front()
{
return impl.refCountedPayload.front;
}
void popFront()
{
impl.refCountedPayload.popFront();
}
}
private struct ByLineCopyImpl(Char, Terminator)
{
ByLine!(Unqual!Char, Terminator).Impl impl;
bool gotFront;
Char[] line;
public:
this(File f, KeepTerminator kt, Terminator terminator)
{
impl = ByLine!(Unqual!Char, Terminator).Impl(f, kt, terminator);
}
@property bool empty()
{
return impl.empty;
}
@property front()
{
if (!gotFront)
{
line = impl.front.dup;
gotFront = true;
}
return line;
}
void popFront()
{
impl.popFront();
gotFront = false;
}
}
/**
Returns an input range set up to read from the file handle one line
at a time. Each line will be newly allocated. $(D front) will cache
its value to allow repeated calls without unnecessary allocations.
Note: Due to caching byLineCopy can be more memory-efficient than
$(D File.byLine.map!idup).
The element type for the range will be $(D Char[]). Range
primitives may throw $(D StdioException) on I/O error.
Params:
Char = Character type for each line, defaulting to $(D immutable char).
keepTerminator = Use $(D KeepTerminator.yes) to include the
terminator at the end of each line.
terminator = Line separator ($(D '\n') by default). Use
$(XREF ascii, newline) for portability (unless the file was opened in
text mode).
Example:
----
import std.algorithm, std.array, std.stdio;
// Print sorted lines of a file.
void main()
{
auto sortedLines = File("file.txt") // Open for reading
.byLineCopy() // Read persistent lines
.array() // into an array
.sort(); // then sort them
foreach (line; sortedLines)
writeln(line);
}
----
See_Also:
$(XREF file,readText)
*/
auto byLineCopy(Terminator = char, Char = immutable char)
(KeepTerminator keepTerminator = KeepTerminator.no,
Terminator terminator = '\n')
if (isScalarType!Terminator)
{
return ByLineCopy!(Char, Terminator)(this, keepTerminator, terminator);
}
/// ditto
auto byLineCopy(Terminator, Char = immutable char)
(KeepTerminator keepTerminator, Terminator terminator)
if (is(Unqual!(ElementEncodingType!Terminator) == Unqual!Char))
{
return ByLineCopy!(Char, Terminator)(this, keepTerminator, terminator);
}
unittest
{
static assert(is(typeof(File("").byLine.front) == char[]));
static assert(is(typeof(File("").byLineCopy.front) == string));
static assert(
is(typeof(File("").byLineCopy!(char, char).front) == char[]));
}
unittest
{
static import std.file;
import std.algorithm : equal;
import std.range;
//printf("Entering test at line %d\n", __LINE__);
scope(failure) printf("Failed test at line %d\n", __LINE__);
auto deleteme = testFilename();
std.file.write(deleteme, "");
scope(success) std.file.remove(deleteme);
// Test empty file
auto f = File(deleteme);
foreach (line; f.byLine())
{
assert(false);
}
f.detach();
assert(!f.isOpen);
void test(Terminator)(string txt, in string[] witness,
KeepTerminator kt, Terminator term, bool popFirstLine = false)
{
import std.conv : text;
import std.algorithm : sort;
import std.range.primitives : walkLength;
uint i;
std.file.write(deleteme, txt);
auto f = File(deleteme);
scope(exit)
{
f.close();
assert(!f.isOpen);
}
auto lines = f.byLine(kt, term);
if (popFirstLine)
{
lines.popFront();
i = 1;
}
assert(lines.empty || lines.front is lines.front);
foreach (line; lines)
{
assert(line == witness[i++]);
}
assert(i == witness.length, text(i, " != ", witness.length));
// Issue 11830
auto walkedLength = File(deleteme).byLine(kt, term).walkLength;
assert(walkedLength == witness.length, text(walkedLength, " != ", witness.length));
// test persistent lines
assert(File(deleteme).byLineCopy(kt, term).array.sort() == witness.dup.sort());
}
KeepTerminator kt = KeepTerminator.no;
test("", null, kt, '\n');
test("\n", [ "" ], kt, '\n');
test("asd\ndef\nasdf", [ "asd", "def", "asdf" ], kt, '\n');
test("asd\ndef\nasdf", [ "asd", "def", "asdf" ], kt, '\n', true);
test("asd\ndef\nasdf\n", [ "asd", "def", "asdf" ], kt, '\n');
test("foo", [ "foo" ], kt, '\n', true);
test("bob\r\nmarge\r\nsteve\r\n", ["bob", "marge", "steve"],
kt, "\r\n");
test("sue\r", ["sue"], kt, '\r');
kt = KeepTerminator.yes;
test("", null, kt, '\n');
test("\n", [ "\n" ], kt, '\n');
test("asd\ndef\nasdf", [ "asd\n", "def\n", "asdf" ], kt, '\n');
test("asd\ndef\nasdf\n", [ "asd\n", "def\n", "asdf\n" ], kt, '\n');
test("asd\ndef\nasdf\n", [ "asd\n", "def\n", "asdf\n" ], kt, '\n', true);
test("foo", [ "foo" ], kt, '\n');
test("bob\r\nmarge\r\nsteve\r\n", ["bob\r\n", "marge\r\n", "steve\r\n"],
kt, "\r\n");
test("sue\r", ["sue\r"], kt, '\r');
}
unittest
{
import std.algorithm : equal;
import std.range;
version(Win64)
{
static import std.file;
/* the C function tmpfile doesn't seem to work, even when called from C */
auto deleteme = testFilename();
auto file = File(deleteme, "w+");
scope(success) std.file.remove(deleteme);
}
else version(CRuntime_Bionic)
{
static import std.file;
/* the C function tmpfile doesn't work when called from a shared
library apk:
https://code.google.com/p/android/issues/detail?id=66815 */
auto deleteme = testFilename();
auto file = File(deleteme, "w+");
scope(success) std.file.remove(deleteme);
}
else
auto file = File.tmpfile();
file.write("1\n2\n3\n");
// bug 9599
file.rewind();
File.ByLine!(char, char) fbl = file.byLine();
auto fbl2 = fbl;
assert(fbl.front == "1");
assert(fbl.front is fbl2.front);
assert(fbl.take(1).equal(["1"]));
assert(fbl.equal(["2", "3"]));
assert(fbl.empty);
assert(file.isOpen); // we still have a valid reference
file.rewind();
fbl = file.byLine();
assert(!fbl.drop(2).empty);
assert(fbl.equal(["3"]));
assert(fbl.empty);
assert(file.isOpen);
file.detach();
assert(!file.isOpen);
}
unittest
{
static import std.file;
auto deleteme = testFilename();
std.file.write(deleteme, "hi");
scope(success) std.file.remove(deleteme);
auto blc = File(deleteme).byLineCopy;
assert(!blc.empty);
// check front is cached
assert(blc.front is blc.front);
}
/**
Creates an input range set up to parse one line at a time from the file
into a tuple.
Range primitives may throw $(D StdioException) on I/O error.
Params:
file = file handle to parse from
format = tuple record $(REF_ALTTEXT _format, formattedRead, std, _format)
Returns:
The input range set up to parse one line at a time into a record tuple.
See_Also:
It is similar to $(LREF byLine) and uses
$(REF_ALTTEXT _format, formattedRead, std, _format) under the hood.
*/
template byRecord(Fields...)
{
ByRecord!(Fields) byRecord(string format)
{
return typeof(return)(this, format);
}
}
///
unittest
{
static import std.file;
// prepare test file
auto testFile = testFilename();
scope(failure) printf("Failed test at line %d\n", __LINE__);
std.file.write(testFile, "1 2\n4 1\n5 100");
scope(exit) std.file.remove(testFile);
File f = File(testFile);
scope(exit) f.close();
auto expected = [tuple(1, 2), tuple(4, 1), tuple(5, 100)];
uint i;
foreach (e; f.byRecord!(int, int)("%s %s"))
{
assert(e == expected[i++]);
}
}
// Note: This was documented until 2013/08
/*
* Range that reads a chunk at a time.
*/
struct ByChunk
{
private:
File file_;
ubyte[] chunk_;
void prime()
{
chunk_ = file_.rawRead(chunk_);
if (chunk_.length == 0)
file_.detach();
}
public:
this(File file, size_t size)
{
this(file, new ubyte[](size));
}
this(File file, ubyte[] buffer)
{
import std.exception;
enforce(buffer.length, "size must be larger than 0");
file_ = file;
chunk_ = buffer;
prime();
}
// $(D ByChunk)'s input range primitive operations.
@property nothrow
bool empty() const
{
return !file_.isOpen;
}
/// Ditto
@property nothrow
ubyte[] front()
{
version(assert)
{
import core.exception : RangeError;
if (empty)
throw new RangeError();
}
return chunk_;
}
/// Ditto
void popFront()
{
version(assert)
{
import core.exception : RangeError;
if (empty)
throw new RangeError();
}
prime();
}
}
/**
Returns an input range set up to read from the file handle a chunk at a
time.
The element type for the range will be $(D ubyte[]). Range primitives
may throw $(D StdioException) on I/O error.
Example:
---------
void main()
{
// Read standard input 4KB at a time
foreach (ubyte[] buffer; stdin.byChunk(4096))
{
... use buffer ...
}
}
---------
The parameter may be a number (as shown in the example above) dictating the
size of each chunk. Alternatively, $(D byChunk) accepts a
user-provided buffer that it uses directly.
Example:
---------
void main()
{
// Read standard input 4KB at a time
foreach (ubyte[] buffer; stdin.byChunk(new ubyte[4096]))
{
... use buffer ...
}
}
---------
In either case, the content of the buffer is reused across calls. That means
$(D front) will not persist after $(D popFront) is called, so if retention is
needed, the caller must copy its contents (e.g. by calling $(D buffer.dup)).
In the example above, $(D buffer.length) is 4096 for all iterations, except
for the last one, in which case $(D buffer.length) may be less than 4096 (but
always greater than zero).
With the mentioned limitations, $(D byChunks) works with any algorithm
compatible with input ranges.
Example:
---
// Efficient file copy, 1MB at a time.
import std.algorithm, std.stdio;
void main()
{
stdin.byChunk(1024 * 1024).copy(stdout.lockingTextWriter());
}
---
$(XREF_PACK algorithm,iteration,joiner) can be used to join chunks together into
a single range lazily.
Example:
---
import std.algorithm, std.stdio;
void main()
{
//Range of ranges
static assert(is(typeof(stdin.byChunk(4096).front) == ubyte[]));
//Range of elements
static assert(is(typeof(stdin.byChunk(4096).joiner.front) == ubyte));
}
---
Returns: A call to $(D byChunk) returns a range initialized with the $(D File)
object and the appropriate buffer.
Throws: If the user-provided size is zero or the user-provided buffer
is empty, throws an $(D Exception). In case of an I/O error throws
$(D StdioException).
*/
auto byChunk(size_t chunkSize)
{
return ByChunk(this, chunkSize);
}
/// Ditto
ByChunk byChunk(ubyte[] buffer)
{
return ByChunk(this, buffer);
}
unittest
{
static import std.file;
scope(failure) printf("Failed test at line %d\n", __LINE__);
auto deleteme = testFilename();
std.file.write(deleteme, "asd\ndef\nasdf");
auto witness = ["asd\n", "def\n", "asdf" ];
auto f = File(deleteme);
scope(exit)
{
f.close();
assert(!f.isOpen);
std.file.remove(deleteme);
}
uint i;
foreach (chunk; f.byChunk(4))
assert(chunk == cast(ubyte[])witness[i++]);
assert(i == witness.length);
}
unittest
{
static import std.file;
scope(failure) printf("Failed test at line %d\n", __LINE__);
auto deleteme = testFilename();
std.file.write(deleteme, "asd\ndef\nasdf");
auto witness = ["asd\n", "def\n", "asdf" ];
auto f = File(deleteme);
scope(exit)
{
f.close();
assert(!f.isOpen);
std.file.remove(deleteme);
}
uint i;
foreach (chunk; f.byChunk(new ubyte[4]))
assert(chunk == cast(ubyte[])witness[i++]);
assert(i == witness.length);
}
// Note: This was documented until 2013/08
/*
$(D Range) that locks the file and allows fast writing to it.
*/
struct LockingTextWriter
{
private:
import std.range.primitives : ElementType, isInfinite, isInputRange;
// the shared file handle
FILE* fps_;
// the unshared version of fps
@property _iobuf* handle_() @trusted { return cast(_iobuf*) fps_; }
// the file's orientation (byte- or wide-oriented)
int orientation_;
public:
this(ref File f) @trusted
{
import core.stdc.wchar_ : fwide;
import std.exception : enforce;
enforce(f._p && f._p.handle, "Attempting to write to closed File");
fps_ = f._p.handle;
orientation_ = fwide(fps_, 0);
FLOCK(fps_);
}
~this() @trusted
{
if (fps_)
{
FUNLOCK(fps_);
fps_ = null;
}
}
this(this) @trusted
{
if (fps_)
{
FLOCK(fps_);
}
}
/// Range primitive implementations.
void put(A)(A writeme)
if (is(ElementType!A : const(dchar)) &&
isInputRange!A &&
!isInfinite!A)
{
import std.exception : errnoEnforce;
alias C = ElementEncodingType!A;
static assert(!is(C == void));
static if (isSomeString!A && C.sizeof == 1)
{
if (orientation_ <= 0)
{
//file.write(writeme); causes infinite recursion!!!
//file.rawWrite(writeme);
static auto trustedFwrite(in void* ptr, size_t size, size_t nmemb, FILE* stream) @trusted
{
return .fwrite(ptr, size, nmemb, stream);
}
auto result =
trustedFwrite(writeme.ptr, C.sizeof, writeme.length, fps_);
if (result != writeme.length) errnoEnforce(0);
return;
}
}
// put each character in turn
foreach (dchar c; writeme)
{
put(c);
}
}
// @@@BUG@@@ 2340
//void front(C)(C c) if (is(C : dchar)) {
/// ditto
void put(C)(C c) @safe if (is(C : const(dchar)))
{
import std.traits : Parameters;
static auto trustedFPUTC(int ch, _iobuf* h) @trusted
{
return FPUTC(ch, h);
}
static auto trustedFPUTWC(Parameters!FPUTWC[0] ch, _iobuf* h) @trusted
{
return FPUTWC(ch, h);
}
static if (c.sizeof == 1)
{
// simple char
if (orientation_ <= 0) trustedFPUTC(c, handle_);
else trustedFPUTWC(c, handle_);
}
else static if (c.sizeof == 2)
{
import std.utf : toUTF8;
if (orientation_ <= 0)
{
if (c <= 0x7F)
{
trustedFPUTC(c, handle_);
}
else
{
char[4] buf;
auto b = toUTF8(buf, c);
foreach (i ; 0 .. b.length)
trustedFPUTC(b[i], handle_);
}
}
else
{
trustedFPUTWC(c, handle_);
}
}
else // 32-bit characters
{
import std.utf : toUTF8;
if (orientation_ <= 0)
{
if (c <= 0x7F)
{
trustedFPUTC(c, handle_);
}
else
{
char[4] buf = void;
auto b = toUTF8(buf, c);
foreach (i ; 0 .. b.length)
trustedFPUTC(b[i], handle_);
}
}
else
{
version (Windows)
{
import std.utf : isValidDchar;
assert(isValidDchar(c));
if (c <= 0xFFFF)
{
trustedFPUTWC(c, handle_);
}
else
{
trustedFPUTWC(cast(wchar)
((((c - 0x10000) >> 10) & 0x3FF)
+ 0xD800), handle_);
trustedFPUTWC(cast(wchar)
(((c - 0x10000) & 0x3FF) + 0xDC00),
handle_);
}
}
else version (Posix)
{
trustedFPUTWC(c, handle_);
}
else
{
static assert(0);
}
}
}
}
}
/** Returns an output range that locks the file and allows fast writing to it.
See $(LREF byChunk) for an example.
*/
auto lockingTextWriter() @safe
{
return LockingTextWriter(this);
}
// An output range which optionally locks the file and puts it into
// binary mode (similar to rawWrite). Because it needs to restore
// the file mode on destruction, it is RefCounted on Windows.
struct BinaryWriterImpl(bool locking)
{
private:
FILE* fps;
string name;
version (Windows)
{
int fd, oldMode;
version (DIGITAL_MARS_STDIO)
ubyte oldInfo;
}
package:
this(ref File f)
{
import std.exception : enforce;
enforce(f._p && f._p.handle);
name = f._name;
fps = f._p.handle;
static if (locking)
FLOCK(fps);
version (Windows)
{
.fflush(fps); // before changing translation mode
fd = ._fileno(fps);
oldMode = ._setmode(fd, _O_BINARY);
version (DIGITAL_MARS_STDIO)
{
import core.atomic;
// @@@BUG@@@ 4243
oldInfo = __fhnd_info[fd];
atomicOp!"&="(__fhnd_info[fd], ~FHND_TEXT);
}
}
}
public:
~this()
{
if (!fps)
return;
version (Windows)
{
.fflush(fps); // before restoring translation mode
version (DIGITAL_MARS_STDIO)
{
// @@@BUG@@@ 4243
__fhnd_info[fd] = oldInfo;
}
._setmode(fd, oldMode);
}
FUNLOCK(fps);
fps = null;
}
void rawWrite(T)(in T[] buffer)
{
import std.conv : text;
import std.exception : errnoEnforce;
auto result =
.fwrite(buffer.ptr, T.sizeof, buffer.length, fps);
if (result == result.max) result = 0;
errnoEnforce(result == buffer.length,
text("Wrote ", result, " instead of ", buffer.length,
" objects of type ", T.stringof, " to file `",
name, "'"));
}
version (Windows)
{
@disable this(this);
}
else
{
this(this)
{
if (fps)
{
FLOCK(fps);
}
}
}
void put(T)(auto ref in T value)
if (!hasIndirections!T &&
!isInputRange!T)
{
rawWrite((&value)[0..1]);
}
void put(T)(in T[] array)
if (!hasIndirections!T &&
!isInputRange!T)
{
rawWrite(array);
}
}
/** Returns an output range that locks the file and allows fast writing to it.
Example:
Produce a grayscale image of the $(LUCKY Mandelbrot set)
in binary $(LUCKY Netpbm format) to standard output.
---
import std.algorithm, std.range, std.stdio;
void main()
{
enum size = 500;
writef("P5\n%d %d %d\n", size, size, ubyte.max);
iota(-1, 3, 2.0/size).map!(y =>
iota(-1.5, 0.5, 2.0/size).map!(x =>
cast(ubyte)(1+
recurrence!((a, n) => x + y*1i + a[n-1]^^2)(0+0i)
.take(ubyte.max)
.countUntil!(z => z.re^^2 + z.im^^2 > 4))
)
)
.copy(stdout.lockingBinaryWriter);
}
---
*/
auto lockingBinaryWriter()
{
alias LockingBinaryWriterImpl = BinaryWriterImpl!true;
version (Windows)
{
import std.typecons : RefCounted;
alias LockingBinaryWriter = RefCounted!LockingBinaryWriterImpl;
}
else
alias LockingBinaryWriter = LockingBinaryWriterImpl;
return LockingBinaryWriter(this);
}
unittest
{
import std.algorithm : copy, reverse;
static import std.file;
import std.exception : collectException;
import std.range : only, retro, put;
import std.string : format;
auto deleteme = testFilename();
scope(exit) collectException(std.file.remove(deleteme));
auto output = File(deleteme, "wb");
auto writer = output.lockingBinaryWriter();
auto input = File(deleteme, "rb");
T[] readExact(T)(T[] buf)
{
auto result = input.rawRead(buf);
assert(result.length == buf.length,
"Read %d out of %d bytes"
.format(result.length, buf.length));
return result;
}
// test raw values
ubyte byteIn = 42;
byteIn.only.copy(writer); output.flush();
ubyte byteOut = readExact(new ubyte[1])[0];
assert(byteIn == byteOut);
// test arrays
ubyte[] bytesIn = [1, 2, 3, 4, 5];
bytesIn.copy(writer); output.flush();
ubyte[] bytesOut = readExact(new ubyte[bytesIn.length]);
scope(failure) .writeln(bytesOut);
assert(bytesIn == bytesOut);
// test ranges of values
bytesIn.retro.copy(writer); output.flush();
bytesOut = readExact(bytesOut);
bytesOut.reverse();
assert(bytesIn == bytesOut);
// test string
"foobar".copy(writer); output.flush();
char[] charsOut = readExact(new char[6]);
assert(charsOut == "foobar");
// test ranges of arrays
only("foo", "bar").copy(writer); output.flush();
charsOut = readExact(charsOut);
assert(charsOut == "foobar");
// test that we are writing arrays as is,
// without UTF-8 transcoding
"foo"d.copy(writer); output.flush();
dchar[] dcharsOut = readExact(new dchar[3]);
assert(dcharsOut == "foo");
}
/// Get the size of the file, ulong.max if file is not searchable, but still throws if an actual error occurs.
@property ulong size() @safe
{
import std.exception : collectException;
ulong pos = void;
if (collectException(pos = tell)) return ulong.max;
scope(exit) seek(pos);
seek(0, SEEK_END);
return tell;
}
}
unittest
{
@system struct SystemToString
{
string toString()
{
return "system";
}
}
@trusted struct TrustedToString
{
string toString()
{
return "trusted";
}
}
@safe struct SafeToString
{
string toString()
{
return "safe";
}
}
@system void systemTests()
{
//system code can write to files/stdout with anything!
if (false)
{
auto f = File();
f.write("just a string");
f.write("string with arg: ", 47);
f.write(SystemToString());
f.write(TrustedToString());
f.write(SafeToString());
write("just a string");
write("string with arg: ", 47);
write(SystemToString());
write(TrustedToString());
write(SafeToString());
f.writeln("just a string");
f.writeln("string with arg: ", 47);
f.writeln(SystemToString());
f.writeln(TrustedToString());
f.writeln(SafeToString());
writeln("just a string");
writeln("string with arg: ", 47);
writeln(SystemToString());
writeln(TrustedToString());
writeln(SafeToString());
f.writef("string with arg: %s", 47);
f.writef("%s", SystemToString());
f.writef("%s", TrustedToString());
f.writef("%s", SafeToString());
writef("string with arg: %s", 47);
writef("%s", SystemToString());
writef("%s", TrustedToString());
writef("%s", SafeToString());
f.writefln("string with arg: %s", 47);
f.writefln("%s", SystemToString());
f.writefln("%s", TrustedToString());
f.writefln("%s", SafeToString());
writefln("string with arg: %s", 47);
writefln("%s", SystemToString());
writefln("%s", TrustedToString());
writefln("%s", SafeToString());
}
}
@safe void safeTests()
{
auto f = File();
//safe code can write to files only with @safe and @trusted code...
if (false)
{
f.write("just a string");
f.write("string with arg: ", 47);
f.write(TrustedToString());
f.write(SafeToString());
write("just a string");
write("string with arg: ", 47);
write(TrustedToString());
write(SafeToString());
f.writeln("just a string");
f.writeln("string with arg: ", 47);
f.writeln(TrustedToString());
f.writeln(SafeToString());
writeln("just a string");
writeln("string with arg: ", 47);
writeln(TrustedToString());
writeln(SafeToString());
f.writef("string with arg: %s", 47);
f.writef("%s", TrustedToString());
f.writef("%s", SafeToString());
writef("string with arg: %s", 47);
writef("%s", TrustedToString());
writef("%s", SafeToString());
f.writefln("string with arg: %s", 47);
f.writefln("%s", TrustedToString());
f.writefln("%s", SafeToString());
writefln("string with arg: %s", 47);
writefln("%s", TrustedToString());
writefln("%s", SafeToString());
}
static assert(!__traits(compiles, f.write(SystemToString().toString())));
static assert(!__traits(compiles, f.writeln(SystemToString())));
static assert(!__traits(compiles, f.writef("%s", SystemToString())));
static assert(!__traits(compiles, f.writefln("%s", SystemToString())));
static assert(!__traits(compiles, write(SystemToString().toString())));
static assert(!__traits(compiles, writeln(SystemToString())));
static assert(!__traits(compiles, writef("%s", SystemToString())));
static assert(!__traits(compiles, writefln("%s", SystemToString())));
}
systemTests();
safeTests();
}
unittest
{
static import std.file;
import std.exception : collectException;
auto deleteme = testFilename();
scope(exit) collectException(std.file.remove(deleteme));
std.file.write(deleteme, "1 2 3");
auto f = File(deleteme);
assert(f.size == 5);
assert(f.tell == 0);
}
unittest
{
static import std.file;
import std.range;
auto deleteme = testFilename();
scope(exit) std.file.remove(deleteme);
{
File f = File(deleteme, "w");
auto writer = f.lockingTextWriter();
static assert(isOutputRange!(typeof(writer), dchar));
writer.put("日本語");
writer.put("日本語"w);
writer.put("日本語"d);
writer.put('日');
writer.put(chain(only('本'), only('語')));
writer.put(repeat('#', 12)); // BUG 11945
}
assert(File(deleteme).readln() == "日本語日本語日本語日本語############");
}
@safe unittest
{
import std.exception: collectException;
auto e = collectException({ File f; f.writeln("Hello!"); }());
assert(e && e.msg == "Attempting to write to closed File");
}
/// Used to specify the lock type for $(D File.lock) and $(D File.tryLock).
enum LockType
{
/// Specifies a _read (shared) lock. A _read lock denies all processes
/// write access to the specified region of the file, including the
/// process that first locks the region. All processes can _read the
/// locked region. Multiple simultaneous _read locks are allowed, as
/// long as there are no exclusive locks.
read,
/// Specifies a read/write (exclusive) lock. A read/write lock denies all
/// other processes both read and write access to the locked file region.
/// If a segment has an exclusive lock, it may not have any shared locks
/// or other exclusive locks.
readWrite
}
struct LockingTextReader
{
private File _f;
private char _front;
private bool _hasChar;
this(File f)
{
import std.exception : enforce;
enforce(f.isOpen, "LockingTextReader: File must be open");
_f = f;
FLOCK(_f._p.handle);
}
this(this)
{
FLOCK(_f._p.handle);
}
~this()
{
if (_hasChar)
ungetc(_front, cast(FILE*)_f._p.handle);
// File locking has its own reference count
if (_f.isOpen) FUNLOCK(_f._p.handle);
}
void opAssign(LockingTextReader r)
{
import std.algorithm : swap;
swap(this, r);
}
@property bool empty()
{
if (!_hasChar)
{
if (!_f.isOpen || _f.eof)
return true;
immutable int c = FGETC(cast(_iobuf*) _f._p.handle);
if (c == EOF)
{
.destroy(_f);
return true;
}
_front = cast(char)c;
_hasChar = true;
}
return false;
}
@property char front()
{
if (!_hasChar)
{
version(assert)
{
import core.exception : RangeError;
if (empty)
throw new RangeError();
}
else
{
empty;
}
}
return _front;
}
void popFront()
{
if (!_hasChar)
empty;
_hasChar = false;
}
}
unittest
{
static import std.file;
import std.range.primitives : isInputRange;
static assert(isInputRange!LockingTextReader);
auto deleteme = testFilename();
std.file.write(deleteme, "1 2 3");
scope(exit) std.file.remove(deleteme);
int x, y;
auto f = File(deleteme);
f.readf("%s ", &x);
assert(x == 1);
f.readf("%d ", &x);
assert(x == 2);
f.readf("%d ", &x);
assert(x == 3);
//pragma(msg, "--- todo: readf ---");
}
unittest // bugzilla 13686
{
static import std.file;
import std.algorithm : equal;
auto deleteme = testFilename();
std.file.write(deleteme, "Тест");
scope(exit) std.file.remove(deleteme);
string s;
File(deleteme).readf("%s", &s);
assert(s == "Тест");
import std.utf;
auto ltr = LockingTextReader(File(deleteme)).byDchar;
assert(equal(ltr, "Тест".byDchar));
}
unittest // bugzilla 12320
{
static import std.file;
auto deleteme = testFilename();
std.file.write(deleteme, "ab");
scope(exit) std.file.remove(deleteme);
auto ltr = LockingTextReader(File(deleteme));
assert(ltr.front == 'a');
ltr.popFront();
assert(ltr.front == 'b');
ltr.popFront();
assert(ltr.empty);
}
unittest // bugzilla 14861
{
static import std.file;
auto deleteme = testFilename();
File fw = File(deleteme, "w");
for (int i; i != 5000; i++)
fw.writeln(i, ";", "Иванов;Пётр;Петрович");
fw.close();
scope(exit) std.file.remove(deleteme);
// Test read
File fr = File(deleteme, "r");
scope (exit) fr.close();
int nom; string fam, nam, ot;
// Error format read
while (!fr.eof)
fr.readf("%s;%s;%s;%s\n", &nom, &fam, &nam, &ot);
}
/**
* Indicates whether $(D T) is a file handle of some kind.
*/
template isFileHandle(T)
{
enum isFileHandle = is(T : FILE*) ||
is(T : File);
}
unittest
{
static assert(isFileHandle!(FILE*));
static assert(isFileHandle!(File));
}
/**
* Property used by writeln/etc. so it can infer @safe since stdout is __gshared
*/
private @property File trustedStdout() @trusted { return stdout; }
/***********************************
For each argument $(D arg) in $(D args), format the argument (as per
$(LINK2 std_conv.html, to!(string)(arg))) and write the resulting
string to $(D args[0]). A call without any arguments will fail to
compile.
Throws: In case of an I/O error, throws an $(D StdioException).
*/
void write(T...)(T args) if (!is(T[0] : File))
{
trustedStdout.write(args);
}
unittest
{
static import std.file;
//printf("Entering test at line %d\n", __LINE__);
scope(failure) printf("Failed test at line %d\n", __LINE__);
void[] buf;
if (false) write(buf);
// test write
auto deleteme = testFilename();
auto f = File(deleteme, "w");
f.write("Hello, ", "world number ", 42, "!");
f.close();
scope(exit) { std.file.remove(deleteme); }
assert(cast(char[]) std.file.read(deleteme) == "Hello, world number 42!");
// // test write on stdout
//auto saveStdout = stdout;
//scope(exit) stdout = saveStdout;
//stdout.open(file, "w");
Object obj;
//write("Hello, ", "world number ", 42, "! ", obj);
//stdout.close();
// auto result = cast(char[]) std.file.read(file);
// assert(result == "Hello, world number 42! null", result);
}
/***********************************
* Equivalent to $(D write(args, '\n')). Calling $(D writeln) without
* arguments is valid and just prints a newline to the standard
* output.
*/
void writeln(T...)(T args)
{
import std.traits : isAggregateType;
static if (T.length == 0)
{
import std.exception : enforce;
enforce(fputc('\n', .trustedStdout._p.handle) == '\n', "fputc failed");
}
else static if (T.length == 1 &&
is(typeof(args[0]) : const(char)[]) &&
!is(typeof(args[0]) == enum) &&
!is(Unqual!(typeof(args[0])) == typeof(null)) &&
!isAggregateType!(typeof(args[0])))
{
import std.exception : enforce;
// Specialization for strings - a very frequent case
auto w = .trustedStdout.lockingTextWriter();
static if (isStaticArray!(typeof(args[0])))
{
w.put(args[0][]);
}
else
{
w.put(args[0]);
}
w.put('\n');
}
else
{
// Most general instance
trustedStdout.write(args, '\n');
}
}
@safe unittest
{
// Just make sure the call compiles
if (false) writeln();
if (false) writeln("wyda");
// bug 8040
if (false) writeln(null);
if (false) writeln(">", null, "<");
// Bugzilla 14041
if (false)
{
char[8] a;
writeln(a);
}
}
unittest
{
static import std.file;
//printf("Entering test at line %d\n", __LINE__);
scope(failure) printf("Failed test at line %d\n", __LINE__);
// test writeln
auto deleteme = testFilename();
auto f = File(deleteme, "w");
scope(exit) { std.file.remove(deleteme); }
f.writeln("Hello, ", "world number ", 42, "!");
f.close();
version (Windows)
assert(cast(char[]) std.file.read(deleteme) ==
"Hello, world number 42!\r\n");
else
assert(cast(char[]) std.file.read(deleteme) ==
"Hello, world number 42!\n");
// test writeln on stdout
auto saveStdout = stdout;
scope(exit) stdout = saveStdout;
stdout.open(deleteme, "w");
writeln("Hello, ", "world number ", 42, "!");
stdout.close();
version (Windows)
assert(cast(char[]) std.file.read(deleteme) ==
"Hello, world number 42!\r\n");
else
assert(cast(char[]) std.file.read(deleteme) ==
"Hello, world number 42!\n");
stdout.open(deleteme, "w");
writeln("Hello!"c);
writeln("Hello!"w); // bug 8386
writeln("Hello!"d); // bug 8386
writeln("embedded\0null"c); // bug 8730
stdout.close();
version (Windows)
assert(cast(char[]) std.file.read(deleteme) ==
"Hello!\r\nHello!\r\nHello!\r\nembedded\0null\r\n");
else
assert(cast(char[]) std.file.read(deleteme) ==
"Hello!\nHello!\nHello!\nembedded\0null\n");
}
unittest
{
static import std.file;
auto deleteme = testFilename();
auto f = File(deleteme, "w");
scope(exit) { std.file.remove(deleteme); }
enum EI : int { A, B }
enum ED : double { A, B }
enum EC : char { A, B }
enum ES : string { A = "aaa", B = "bbb" }
f.writeln(EI.A); // false, but A on 2.058
f.writeln(EI.B); // true, but B on 2.058
f.writeln(ED.A); // A
f.writeln(ED.B); // B
f.writeln(EC.A); // A
f.writeln(EC.B); // B
f.writeln(ES.A); // A
f.writeln(ES.B); // B
f.close();
version (Windows)
assert(cast(char[]) std.file.read(deleteme) ==
"A\r\nB\r\nA\r\nB\r\nA\r\nB\r\nA\r\nB\r\n");
else
assert(cast(char[]) std.file.read(deleteme) ==
"A\nB\nA\nB\nA\nB\nA\nB\n");
}
unittest
{
static auto useInit(T)(T ltw)
{
T val;
val = ltw;
val = T.init;
return val;
}
useInit(stdout.lockingTextWriter());
}
/***********************************
Writes formatted data to standard output (without a trailing newline).
Params:
args = The first argument $(D args[0]) should be the format string, specifying
how to format the rest of the arguments. For a full description of the syntax
of the format string and how it controls the formatting of the rest of the
arguments, please refer to the documentation for $(XREF format,
formattedWrite).
Note: In older versions of Phobos, it used to be possible to write:
------
writef(stderr, "%s", "message");
------
to print a message to $(D stderr). This syntax is no longer supported, and has
been superceded by:
------
stderr.writef("%s", "message");
------
*/
void writef(T...)(T args)
{
trustedStdout.writef(args);
}
unittest
{
static import std.file;
//printf("Entering test at line %d\n", __LINE__);
scope(failure) printf("Failed test at line %d\n", __LINE__);
// test writef
auto deleteme = testFilename();
auto f = File(deleteme, "w");
scope(exit) { std.file.remove(deleteme); }
f.writef("Hello, %s world number %s!", "nice", 42);
f.close();
assert(cast(char[]) std.file.read(deleteme) == "Hello, nice world number 42!");
// test write on stdout
auto saveStdout = stdout;
scope(exit) stdout = saveStdout;
stdout.open(deleteme, "w");
writef("Hello, %s world number %s!", "nice", 42);
stdout.close();
assert(cast(char[]) std.file.read(deleteme) == "Hello, nice world number 42!");
}
/***********************************
* Equivalent to $(D writef(args, '\n')).
*/
void writefln(T...)(T args)
{
trustedStdout.writefln(args);
}
unittest
{
static import std.file;
//printf("Entering test at line %d\n", __LINE__);
scope(failure) printf("Failed test at line %d\n", __LINE__);
// test writefln
auto deleteme = testFilename();
auto f = File(deleteme, "w");
scope(exit) { std.file.remove(deleteme); }
f.writefln("Hello, %s world number %s!", "nice", 42);
f.close();
version (Windows)
assert(cast(char[]) std.file.read(deleteme) ==
"Hello, nice world number 42!\r\n");
else
assert(cast(char[]) std.file.read(deleteme) ==
"Hello, nice world number 42!\n",
cast(char[]) std.file.read(deleteme));
// test write on stdout
// auto saveStdout = stdout;
// scope(exit) stdout = saveStdout;
// stdout.open(file, "w");
// assert(stdout.isOpen);
// writefln("Hello, %s world number %s!", "nice", 42);
// foreach (F ; AliasSeq!(ifloat, idouble, ireal))
// {
// F a = 5i;
// F b = a % 2;
// writeln(b);
// }
// stdout.close();
// auto read = cast(char[]) std.file.read(file);
// version (Windows)
// assert(read == "Hello, nice world number 42!\r\n1\r\n1\r\n1\r\n", read);
// else
// assert(read == "Hello, nice world number 42!\n1\n1\n1\n", "["~read~"]");
}
/**
* Read data from $(D stdin) according to the specified
* $(LINK2 std_format.html#format-string, format specifier) using
* $(XREF format,formattedRead).
*/
uint readf(A...)(in char[] format, A args)
{
return stdin.readf(format, args);
}
unittest
{
float f;
if (false) uint x = readf("%s", &f);
char a;
wchar b;
dchar c;
if (false) readf("%s %s %s", &a,&b,&c);
}
/**********************************
* Read line from $(D stdin).
*
* This version manages its own read buffer, which means one memory allocation per call. If you are not
* retaining a reference to the read data, consider the $(D readln(buf)) version, which may offer
* better performance as it can reuse its read buffer.
*
* Returns:
* The line that was read, including the line terminator character.
* Params:
* S = Template parameter; the type of the allocated buffer, and the type returned. Defaults to $(D string).
* terminator = Line terminator (by default, $(D '\n')).
* Note:
* String terminators are not supported due to ambiguity with readln(buf) below.
* Throws:
* $(D StdioException) on I/O error, or $(D UnicodeException) on Unicode conversion error.
* Example:
* Reads $(D stdin) and writes it to $(D stdout).
---
import std.stdio;
void main()
{
string line;
while ((line = readln()) !is null)
write(line);
}
---
*/
S readln(S = string)(dchar terminator = '\n')
if (isSomeString!S)
{
return stdin.readln!S(terminator);
}
/**********************************
* Read line from $(D stdin) and write it to buf[], including terminating character.
*
* This can be faster than $(D line = readln()) because you can reuse
* the buffer for each call. Note that reusing the buffer means that you
* must copy the previous contents if you wish to retain them.
*
* Returns:
* $(D size_t) 0 for end of file, otherwise number of characters read
* Params:
* buf = Buffer used to store the resulting line data. buf is resized as necessary.
* terminator = Line terminator (by default, $(D '\n')). Use $(XREF ascii, newline)
* for portability (unless the file was opened in text mode).
* Throws:
* $(D StdioException) on I/O error, or $(D UnicodeException) on Unicode conversion error.
* Example:
* Reads $(D stdin) and writes it to $(D stdout).
---
import std.stdio;
void main()
{
char[] buf;
while (readln(buf))
write(buf);
}
---
*/
size_t readln(C)(ref C[] buf, dchar terminator = '\n')
if (isSomeChar!C && is(Unqual!C == C) && !is(C == enum))
{
return stdin.readln(buf, terminator);
}
/** ditto */
size_t readln(C, R)(ref C[] buf, R terminator)
if (isSomeChar!C && is(Unqual!C == C) && !is(C == enum) &&
isBidirectionalRange!R && is(typeof(terminator.front == dchar.init)))
{
return stdin.readln(buf, terminator);
}
unittest
{
import std.meta : AliasSeq;
//we can't actually test readln, so at the very least,
//we test compilability
void foo()
{
readln();
readln('\t');
foreach (String; AliasSeq!(string, char[], wstring, wchar[], dstring, dchar[]))
{
readln!String();
readln!String('\t');
}
foreach (String; AliasSeq!(char[], wchar[], dchar[]))
{
String buf;
readln(buf);
readln(buf, '\t');
readln(buf, "<br />");
}
}
}
/*
* Convenience function that forwards to $(D core.sys.posix.stdio.fopen)
* (to $(D _wfopen) on Windows)
* with appropriately-constructed C-style strings.
*/
private FILE* fopen(R1, R2)(R1 name, R2 mode = "r")
if ((isInputRange!R1 && isSomeChar!(ElementEncodingType!R1) || isSomeString!R1) &&
(isInputRange!R2 && isSomeChar!(ElementEncodingType!R2) || isSomeString!R2))
{
import std.internal.cstring : tempCString;
auto namez = name.tempCString!FSChar();
auto modez = mode.tempCString!FSChar();
static fopenImpl(const(FSChar)* namez, const(FSChar)* modez) @trusted nothrow @nogc
{
version(Windows)
{
return _wfopen(namez, modez);
}
else version(Posix)
{
/*
* The new opengroup large file support API is transparently
* included in the normal C bindings. http://opengroup.org/platform/lfs.html#1.0
* if _FILE_OFFSET_BITS in druntime is 64, off_t is 64 bit and
* the normal functions work fine. If not, then large file support
* probably isn't available. Do not use the old transitional API
* (the native extern(C) fopen64, http://www.unix.org/version2/whatsnew/lfs20mar.html#3.0)
*/
import core.sys.posix.stdio : fopen;
return fopen(namez, modez);
}
else
{
return .fopen(namez, modez);
}
}
return fopenImpl(namez, modez);
}
version (Posix)
{
/***********************************
* Convenience function that forwards to $(D core.sys.posix.stdio.popen)
* with appropriately-constructed C-style strings.
*/
FILE* popen(R1, R2)(R1 name, R2 mode = "r") @trusted nothrow @nogc
if ((isInputRange!R1 && isSomeChar!(ElementEncodingType!R1) || isSomeString!R1) &&
(isInputRange!R2 && isSomeChar!(ElementEncodingType!R2) || isSomeString!R2))
{
import std.internal.cstring : tempCString;
auto namez = name.tempCString!FSChar();
auto modez = mode.tempCString!FSChar();
static popenImpl(const(FSChar)* namez, const(FSChar)* modez) @trusted nothrow @nogc
{
import core.sys.posix.stdio : popen;
return popen(namez, modez);
}
return popenImpl(namez, modez);
}
}
/*
* Convenience function that forwards to $(D core.stdc.stdio.fwrite)
* and throws an exception upon error
*/
private void binaryWrite(T)(FILE* f, T obj)
{
immutable result = fwrite(obj.ptr, obj[0].sizeof, obj.length, f);
if (result != obj.length) StdioException();
}
/**
* Iterates through the lines of a file by using $(D foreach).
*
* Example:
*
---------
void main()
{
foreach (string line; lines(stdin))
{
... use line ...
}
}
---------
The line terminator ($(D '\n') by default) is part of the string read (it
could be missing in the last line of the file). Several types are
supported for $(D line), and the behavior of $(D lines)
changes accordingly:
$(OL $(LI If $(D line) has type $(D string), $(D
wstring), or $(D dstring), a new string of the respective type
is allocated every read.) $(LI If $(D line) has type $(D
char[]), $(D wchar[]), $(D dchar[]), the line's content
will be reused (overwritten) across reads.) $(LI If $(D line)
has type $(D immutable(ubyte)[]), the behavior is similar to
case (1), except that no UTF checking is attempted upon input.) $(LI
If $(D line) has type $(D ubyte[]), the behavior is
similar to case (2), except that no UTF checking is attempted upon
input.))
In all cases, a two-symbols versions is also accepted, in which case
the first symbol (of integral type, e.g. $(D ulong) or $(D
uint)) tracks the zero-based number of the current line.
Example:
----
foreach (ulong i, string line; lines(stdin))
{
... use line ...
}
----
In case of an I/O error, an $(D StdioException) is thrown.
See_Also:
$(LREF byLine)
*/
struct lines
{
private File f;
private dchar terminator = '\n';
// private string fileName; // Curretly, no use
/**
Constructor.
Params:
f = File to read lines from.
terminator = Line separator ($(D '\n') by default).
*/
this(File f, dchar terminator = '\n')
{
this.f = f;
this.terminator = terminator;
}
// Keep these commented lines for later, when Walter fixes the
// exception model.
// static lines opCall(string fName, dchar terminator = '\n')
// {
// auto f = enforce(fopen(fName),
// new StdioException("Cannot open file `"~fName~"' for reading"));
// auto result = lines(f, terminator);
// result.fileName = fName;
// return result;
// }
int opApply(D)(scope D dg)
{
// scope(exit) {
// if (fileName.length && fclose(f))
// StdioException("Could not close file `"~fileName~"'");
// }
import std.traits : Parameters;
alias Parms = Parameters!(dg);
static if (isSomeString!(Parms[$ - 1]))
{
enum bool duplicate = is(Parms[$ - 1] == string)
|| is(Parms[$ - 1] == wstring) || is(Parms[$ - 1] == dstring);
int result = 0;
static if (is(Parms[$ - 1] : const(char)[]))
alias C = char;
else static if (is(Parms[$ - 1] : const(wchar)[]))
alias C = wchar;
else static if (is(Parms[$ - 1] : const(dchar)[]))
alias C = dchar;
C[] line;
static if (Parms.length == 2)
Parms[0] i = 0;
for (;;)
{
import std.conv : to;
if (!f.readln(line, terminator)) break;
auto copy = to!(Parms[$ - 1])(line);
static if (Parms.length == 2)
{
result = dg(i, copy);
++i;
}
else
{
result = dg(copy);
}
if (result != 0) break;
}
return result;
}
else
{
// raw read
return opApplyRaw(dg);
}
}
// no UTF checking
int opApplyRaw(D)(scope D dg)
{
import std.exception : assumeUnique;
import std.conv : to;
import std.traits : Parameters;
alias Parms = Parameters!(dg);
enum duplicate = is(Parms[$ - 1] : immutable(ubyte)[]);
int result = 1;
int c = void;
FLOCK(f._p.handle);
scope(exit) FUNLOCK(f._p.handle);
ubyte[] buffer;
static if (Parms.length == 2)
Parms[0] line = 0;
while ((c = FGETC(cast(_iobuf*)f._p.handle)) != -1)
{
buffer ~= to!(ubyte)(c);
if (c == terminator)
{
static if (duplicate)
auto arg = assumeUnique(buffer);
else
alias arg = buffer;
// unlock the file while calling the delegate
FUNLOCK(f._p.handle);
scope(exit) FLOCK(f._p.handle);
static if (Parms.length == 1)
{
result = dg(arg);
}
else
{
result = dg(line, arg);
++line;
}
if (result) break;
static if (!duplicate)
buffer.length = 0;
}
}
// can only reach when FGETC returned -1
if (!f.eof) throw new StdioException("Error in reading file"); // error occured
return result;
}
}
unittest
{
static import std.file;
import std.meta : AliasSeq;
//printf("Entering test at line %d\n", __LINE__);
scope(failure) printf("Failed test at line %d\n", __LINE__);
auto deleteme = testFilename();
scope(exit) { std.file.remove(deleteme); }
alias TestedWith =
AliasSeq!(string, wstring, dstring,
char[], wchar[], dchar[]);
foreach (T; TestedWith) {
// test looping with an empty file
std.file.write(deleteme, "");
auto f = File(deleteme, "r");
foreach (T line; lines(f))
{
assert(false);
}
f.close();
// test looping with a file with three lines
std.file.write(deleteme, "Line one\nline two\nline three\n");
f.open(deleteme, "r");
uint i = 0;
foreach (T line; lines(f))
{
if (i == 0) assert(line == "Line one\n");
else if (i == 1) assert(line == "line two\n");
else if (i == 2) assert(line == "line three\n");
else assert(false);
++i;
}
f.close();
// test looping with a file with three lines, last without a newline
std.file.write(deleteme, "Line one\nline two\nline three");
f.open(deleteme, "r");
i = 0;
foreach (T line; lines(f))
{
if (i == 0) assert(line == "Line one\n");
else if (i == 1) assert(line == "line two\n");
else if (i == 2) assert(line == "line three");
else assert(false);
++i;
}
f.close();
}
// test with ubyte[] inputs
alias TestedWith2 = AliasSeq!(immutable(ubyte)[], ubyte[]);
foreach (T; TestedWith2) {
// test looping with an empty file
std.file.write(deleteme, "");
auto f = File(deleteme, "r");
foreach (T line; lines(f))
{
assert(false);
}
f.close();
// test looping with a file with three lines
std.file.write(deleteme, "Line one\nline two\nline three\n");
f.open(deleteme, "r");
uint i = 0;
foreach (T line; lines(f))
{
if (i == 0) assert(cast(char[]) line == "Line one\n");
else if (i == 1) assert(cast(char[]) line == "line two\n",
T.stringof ~ " " ~ cast(char[]) line);
else if (i == 2) assert(cast(char[]) line == "line three\n");
else assert(false);
++i;
}
f.close();
// test looping with a file with three lines, last without a newline
std.file.write(deleteme, "Line one\nline two\nline three");
f.open(deleteme, "r");
i = 0;
foreach (T line; lines(f))
{
if (i == 0) assert(cast(char[]) line == "Line one\n");
else if (i == 1) assert(cast(char[]) line == "line two\n");
else if (i == 2) assert(cast(char[]) line == "line three");
else assert(false);
++i;
}
f.close();
}
foreach (T; AliasSeq!(ubyte[]))
{
// test looping with a file with three lines, last without a newline
// using a counter too this time
std.file.write(deleteme, "Line one\nline two\nline three");
auto f = File(deleteme, "r");
uint i = 0;
foreach (ulong j, T line; lines(f))
{
if (i == 0) assert(cast(char[]) line == "Line one\n");
else if (i == 1) assert(cast(char[]) line == "line two\n");
else if (i == 2) assert(cast(char[]) line == "line three");
else assert(false);
++i;
}
f.close();
}
}
/**
Iterates through a file a chunk at a time by using $(D foreach).
Example:
---------
void main()
{
foreach (ubyte[] buffer; chunks(stdin, 4096))
{
... use buffer ...
}
}
---------
The content of $(D buffer) is reused across calls. In the
example above, $(D buffer.length) is 4096 for all iterations,
except for the last one, in which case $(D buffer.length) may
be less than 4096 (but always greater than zero).
In case of an I/O error, an $(D StdioException) is thrown.
*/
auto chunks(File f, size_t size)
{
return ChunksImpl(f, size);
}
private struct ChunksImpl
{
private File f;
private size_t size;
// private string fileName; // Currently, no use
this(File f, size_t size)
in
{
assert(size, "size must be larger than 0");
}
body
{
this.f = f;
this.size = size;
}
// static chunks opCall(string fName, size_t size)
// {
// auto f = enforce(fopen(fName),
// new StdioException("Cannot open file `"~fName~"' for reading"));
// auto result = chunks(f, size);
// result.fileName = fName;
// return result;
// }
int opApply(D)(scope D dg)
{
import core.stdc.stdlib : alloca;
enum maxStackSize = 1024 * 16;
ubyte[] buffer = void;
if (size < maxStackSize)
buffer = (cast(ubyte*) alloca(size))[0 .. size];
else
buffer = new ubyte[size];
size_t r = void;
int result = 1;
uint tally = 0;
while ((r = fread(buffer.ptr, buffer[0].sizeof, size, f._p.handle)) > 0)
{
assert(r <= size);
if (r != size)
{
// error occured
if (!f.eof) throw new StdioException(null);
buffer.length = r;
}
static if (is(typeof(dg(tally, buffer)))) {
if ((result = dg(tally, buffer)) != 0) break;
} else {
if ((result = dg(buffer)) != 0) break;
}
++tally;
}
return result;
}
}
unittest
{
static import std.file;
//printf("Entering test at line %d\n", __LINE__);
scope(failure) printf("Failed test at line %d\n", __LINE__);
auto deleteme = testFilename();
scope(exit) { std.file.remove(deleteme); }
// test looping with an empty file
std.file.write(deleteme, "");
auto f = File(deleteme, "r");
foreach (ubyte[] line; chunks(f, 4))
{
assert(false);
}
f.close();
// test looping with a file with three lines
std.file.write(deleteme, "Line one\nline two\nline three\n");
f = File(deleteme, "r");
uint i = 0;
foreach (ubyte[] line; chunks(f, 3))
{
if (i == 0) assert(cast(char[]) line == "Lin");
else if (i == 1) assert(cast(char[]) line == "e o");
else if (i == 2) assert(cast(char[]) line == "ne\n");
else break;
++i;
}
f.close();
}
/**
Writes an array or range to a file.
Shorthand for $(D data.copy(File(fileName, "wb").lockingBinaryWriter)).
Similar to $(XREF file,write), strings are written as-is,
rather than encoded according to the $(D File)'s $(WEB
en.cppreference.com/w/c/io#Narrow_and_wide_orientation,
orientation).
*/
void toFile(T)(T data, string fileName)
if (is(typeof(std.algorithm.mutation.copy(data, stdout.lockingBinaryWriter))))
{
std.algorithm.mutation.copy(data, File(fileName, "wb").lockingBinaryWriter);
}
unittest
{
static import std.file;
auto deleteme = testFilename();
scope(exit) { std.file.remove(deleteme); }
"Test".toFile(deleteme);
assert(std.file.readText(deleteme) == "Test");
}
/*********************
* Thrown if I/O errors happen.
*/
class StdioException : Exception
{
static import core.stdc.errno;
/// Operating system error code.
uint errno;
/**
Initialize with a message and an error code.
*/
this(string message, uint e = core.stdc.errno.errno)
{
import std.conv : to;
errno = e;
version (Posix)
{
import core.stdc.string : strerror_r;
char[256] buf = void;
version (CRuntime_Glibc)
{
auto s = strerror_r(errno, buf.ptr, buf.length);
}
else
{
strerror_r(errno, buf.ptr, buf.length);
auto s = buf.ptr;
}
}
else
{
import core.stdc.string : strerror;
auto s = core.stdc.string.strerror(errno);
}
auto sysmsg = to!string(s);
// If e is 0, we don't use the system error message. (The message
// is "Success", which is rather pointless for an exception.)
super(e == 0 ? message
: (message.ptr ? message ~ " (" ~ sysmsg ~ ")" : sysmsg));
}
/** Convenience functions that throw an $(D StdioException). */
static void opCall(string msg)
{
throw new StdioException(msg);
}
/// ditto
static void opCall()
{
throw new StdioException(null, core.stdc.errno.errno);
}
}
extern(C) void std_stdio_static_this()
{
static import core.stdc.stdio;
//Bind stdin, stdout, stderr
__gshared File.Impl stdinImpl;
stdinImpl.handle = core.stdc.stdio.stdin;
.stdin._p = &stdinImpl;
// stdout
__gshared File.Impl stdoutImpl;
stdoutImpl.handle = core.stdc.stdio.stdout;
.stdout._p = &stdoutImpl;
// stderr
__gshared File.Impl stderrImpl;
stderrImpl.handle = core.stdc.stdio.stderr;
.stderr._p = &stderrImpl;
}
//---------
__gshared
{
/** The standard input stream.
*/
File stdin;
///
unittest
{
// Read stdin, sort lines, write to stdout
import std.stdio, std.array, std.algorithm : sort, copy;
void main() {
stdin // read from stdin
.byLineCopy(KeepTerminator.yes) // copying each line
.array() // convert to array of lines
.sort() // sort the lines
.copy( // copy output of .sort to an OutputRange
stdout.lockingTextWriter()); // the OutputRange
}
}
File stdout; /// The standard output stream.
File stderr; /// The standard error stream.
}
unittest
{
static import std.file;
import std.typecons : tuple;
scope(failure) printf("Failed test at line %d\n", __LINE__);
auto deleteme = testFilename();
std.file.write(deleteme, "1 2\n4 1\n5 100");
scope(exit) std.file.remove(deleteme);
{
File f = File(deleteme);
scope(exit) f.close();
auto t = [ tuple(1, 2), tuple(4, 1), tuple(5, 100) ];
uint i;
foreach (e; f.byRecord!(int, int)("%s %s"))
{
//writeln(e);
assert(e == t[i++]);
}
assert(i == 3);
}
}
// roll our own appender, but with "safe" arrays
private struct ReadlnAppender
{
import core.stdc.string;
char[] buf;
size_t pos;
bool safeAppend = false;
void initialize(char[] b)
{
buf = b;
pos = 0;
}
@property char[] data()
{
if (safeAppend)
assumeSafeAppend(buf.ptr[0..pos]);
return buf.ptr[0..pos];
}
bool reserveWithoutAllocating(size_t n)
{
if (buf.length >= pos + n) // buf is already large enough
return true;
immutable curCap = buf.capacity;
if (curCap >= pos + n)
{
buf.length = curCap;
/* Any extra capacity we end up not using can safely be claimed
by someone else. */
safeAppend = true;
return true;
}
return false;
}
void reserve(size_t n)
{
if (!reserveWithoutAllocating(n))
{
size_t ncap = buf.length * 2 + 128 + n;
char[] nbuf = new char[ncap];
memcpy(nbuf.ptr, buf.ptr, pos);
buf = nbuf;
// Allocated a new buffer. No one else knows about it.
safeAppend = true;
}
}
void putchar(char c)
{
reserve(1);
buf.ptr[pos++] = c;
}
void putdchar(dchar dc)
{
import std.utf : toUTF8;
char[4] ubuf;
char[] u = toUTF8(ubuf, dc);
reserve(u.length);
foreach (c; u)
buf.ptr[pos++] = c;
}
void putonly(char[] b)
{
assert(pos == 0); // assume this is the only put call
if (reserveWithoutAllocating(b.length))
memcpy(buf.ptr + pos, b.ptr, b.length);
else
buf = b.dup;
pos = b.length;
}
}
// Private implementation of readln
version (DIGITAL_MARS_STDIO)
private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orientation /*ignored*/)
{
FLOCK(fps);
scope(exit) FUNLOCK(fps);
/* Since fps is now locked, we can create an "unshared" version
* of fp.
*/
auto fp = cast(_iobuf*)fps;
ReadlnAppender app;
app.initialize(buf);
if (__fhnd_info[fp._file] & FHND_WCHAR)
{ /* Stream is in wide characters.
* Read them and convert to chars.
*/
static assert(wchar_t.sizeof == 2);
for (int c = void; (c = FGETWC(fp)) != -1; )
{
if ((c & ~0x7F) == 0)
{
app.putchar(cast(char) c);
if (c == terminator)
break;
}
else
{
if (c >= 0xD800 && c <= 0xDBFF)
{
int c2 = void;
if ((c2 = FGETWC(fp)) != -1 ||
c2 < 0xDC00 && c2 > 0xDFFF)
{
StdioException("unpaired UTF-16 surrogate");
}
c = ((c - 0xD7C0) << 10) + (c2 - 0xDC00);
}
app.putdchar(cast(dchar)c);
}
}
if (ferror(fps))
StdioException();
}
else if (fp._flag & _IONBF)
{
/* Use this for unbuffered I/O, when running
* across buffer boundaries, or for any but the common
* cases.
*/
L1:
int c;
while ((c = FGETC(fp)) != -1) {
app.putchar(cast(char) c);
if (c == terminator) {
buf = app.data;
return buf.length;
}
}
if (ferror(fps))
StdioException();
}
else
{
int u = fp._cnt;
char* p = fp._ptr;
int i;
if (fp._flag & _IOTRAN)
{ /* Translated mode ignores \r and treats ^Z as end-of-file
*/
char c;
while (1)
{
if (i == u) // if end of buffer
goto L1; // give up
c = p[i];
i++;
if (c != '\r')
{
if (c == terminator)
break;
if (c != 0x1A)
continue;
goto L1;
}
else
{ if (i != u && p[i] == terminator)
break;
goto L1;
}
}
app.putonly(p[0..i]);
app.buf.ptr[i - 1] = cast(char)terminator;
if (terminator == '\n' && c == '\r')
i++;
}
else
{
while (1)
{
if (i == u) // if end of buffer
goto L1; // give up
auto c = p[i];
i++;
if (c == terminator)
break;
}
app.putonly(p[0..i]);
}
fp._cnt -= i;
fp._ptr += i;
}
buf = app.data;
return buf.length;
}
version (MICROSOFT_STDIO)
private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orientation /*ignored*/)
{
import core.memory;
FLOCK(fps);
scope(exit) FUNLOCK(fps);
/* Since fps is now locked, we can create an "unshared" version
* of fp.
*/
auto fp = cast(_iobuf*)fps;
ReadlnAppender app;
app.initialize(buf);
int c;
while ((c = FGETC(fp)) != -1) {
app.putchar(cast(char) c);
if (c == terminator) {
buf = app.data;
return buf.length;
}
}
if (ferror(fps))
StdioException();
buf = app.data;
return buf.length;
}
version (HAS_GETDELIM)
private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orientation orientation)
{
import core.memory;
import core.stdc.stdlib : free;
import core.stdc.wchar_ : fwide;
if (orientation == File.Orientation.wide)
{
/* Stream is in wide characters.
* Read them and convert to chars.
*/
FLOCK(fps);
scope(exit) FUNLOCK(fps);
auto fp = cast(_iobuf*)fps;
version (Windows)
{
buf.length = 0;
for (int c = void; (c = FGETWC(fp)) != -1; )
{
if ((c & ~0x7F) == 0)
{ buf ~= c;
if (c == terminator)
break;
}
else
{
if (c >= 0xD800 && c <= 0xDBFF)
{
int c2 = void;
if ((c2 = FGETWC(fp)) != -1 ||
c2 < 0xDC00 && c2 > 0xDFFF)
{
StdioException("unpaired UTF-16 surrogate");
}
c = ((c - 0xD7C0) << 10) + (c2 - 0xDC00);
}
import std.utf : encode;
encode(buf, c);
}
}
if (ferror(fp))
StdioException();
return buf.length;
}
else version (Posix)
{
buf.length = 0;
for (int c; (c = FGETWC(fp)) != -1; )
{
import std.utf : encode;
if ((c & ~0x7F) == 0)
buf ~= cast(char)c;
else
encode(buf, cast(dchar)c);
if (c == terminator)
break;
}
if (ferror(fps))
StdioException();
return buf.length;
}
else
{
static assert(0);
}
}
static char *lineptr = null;
static size_t n = 0;
scope(exit)
{
if (n > 128 * 1024)
{
// Bound memory used by readln
free(lineptr);
lineptr = null;
n = 0;
}
}
auto s = getdelim(&lineptr, &n, terminator, fps);
if (s < 0)
{
if (ferror(fps))
StdioException();
buf.length = 0; // end of file
return 0;
}
if (s <= buf.length)
{
buf = buf.ptr[0 .. s];
buf[] = lineptr[0 .. s];
}
else
{
buf = lineptr[0 .. s].dup;
}
return s;
}
version (NO_GETDELIM)
private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orientation orientation)
{
import core.stdc.wchar_ : fwide;
FLOCK(fps);
scope(exit) FUNLOCK(fps);
auto fp = cast(_iobuf*)fps;
if (orientation == File.Orientation.wide)
{
/* Stream is in wide characters.
* Read them and convert to chars.
*/
version (Windows)
{
buf.length = 0;
for (int c; (c = FGETWC(fp)) != -1; )
{
if ((c & ~0x7F) == 0)
{ buf ~= c;
if (c == terminator)
break;
}
else
{
if (c >= 0xD800 && c <= 0xDBFF)
{
int c2 = void;
if ((c2 = FGETWC(fp)) != -1 ||
c2 < 0xDC00 && c2 > 0xDFFF)
{
StdioException("unpaired UTF-16 surrogate");
}
c = ((c - 0xD7C0) << 10) + (c2 - 0xDC00);
}
import std.utf : encode;
encode(buf, c);
}
}
if (ferror(fp))
StdioException();
return buf.length;
}
else version (Posix)
{
buf.length = 0;
for (int c; (c = FGETWC(fp)) != -1; )
{
if ((c & ~0x7F) == 0)
buf ~= cast(char)c;
else
std.utf.encode(buf, cast(dchar)c);
if (c == terminator)
break;
}
if (ferror(fps))
StdioException();
return buf.length;
}
else
{
static assert(0);
}
}
// Narrow stream
// First, fill the existing buffer
for (size_t bufPos = 0; bufPos < buf.length; )
{
immutable c = FGETC(fp);
if (c == -1)
{
buf.length = bufPos;
goto endGame;
}
buf.ptr[bufPos++] = cast(char) c;
if (c == terminator)
{
// No need to test for errors in file
buf.length = bufPos;
return bufPos;
}
}
// Then, append to it
for (int c; (c = FGETC(fp)) != -1; )
{
buf ~= cast(char)c;
if (c == terminator)
{
// No need to test for errors in file
return buf.length;
}
}
endGame:
if (ferror(fps))
StdioException();
return buf.length;
}
unittest
{
static import std.file;
auto deleteme = testFilename();
scope(exit) std.file.remove(deleteme);
std.file.write(deleteme, "abcd\n0123456789abcde\n1234\n");
File f = File(deleteme, "rb");
char[] ln = new char[2];
//assert(ln.capacity > 5);
char* lnptr = ln.ptr;
f.readln(ln);
assert(ln == "abcd\n");
//assert(lnptr == ln.ptr); // should not reallocate
char[] t = ln[0..2];
t ~= 't';
assert(t == "abt");
assert(ln == "abcd\n"); // bug 13856: ln stomped to "abtd"
// it can also stomp the array length
ln = new char[4];
//assert(ln.capacity < 16);
lnptr = ln.ptr;
f.readln(ln);
assert(ln == "0123456789abcde\n");
//assert(ln.ptr != lnptr); // used to write to ln, overwriting allocation length byte
char[100] buf;
ln = buf[];
f.readln(ln);
assert(ln == "1234\n");
assert(ln.ptr == buf.ptr); // avoid allocation, buffer is good enough
}
/** Experimental network access via the File interface
Opens a TCP connection to the given host and port, then returns
a File struct with read and write access through the same interface
as any other file (meaning writef and the byLine ranges work!).
Authors:
Adam D. Ruppe
Bugs:
Only works on Linux
*/
version(linux)
{
File openNetwork(string host, ushort port)
{
static import sock = core.sys.posix.sys.socket;
static import core.sys.posix.unistd;
import core.stdc.string : memcpy;
import core.sys.posix.arpa.inet : htons;
import core.sys.posix.netdb : gethostbyname;
import core.sys.posix.netinet.in_ : sockaddr_in;
import std.conv : to;
import std.exception : enforce;
import std.internal.cstring : tempCString;
auto h = enforce( gethostbyname(host.tempCString()),
new StdioException("gethostbyname"));
int s = sock.socket(sock.AF_INET, sock.SOCK_STREAM, 0);
enforce(s != -1, new StdioException("socket"));
scope(failure)
{
// want to make sure it doesn't dangle if something throws. Upon
// normal exit, the File struct's reference counting takes care of
// closing, so we don't need to worry about success
core.sys.posix.unistd.close(s);
}
sockaddr_in addr;
addr.sin_family = sock.AF_INET;
addr.sin_port = htons(port);
memcpy(&addr.sin_addr.s_addr, h.h_addr, h.h_length);
enforce(sock.connect(s, cast(sock.sockaddr*) &addr, addr.sizeof) != -1,
new StdioException("Connect failed"));
File f;
f.fdopen(s, "w+", host ~ ":" ~ to!string(port));
return f;
}
}
version(unittest) string testFilename(string file = __FILE__, size_t line = __LINE__) @safe
{
import std.conv : text;
import std.file : deleteme;
import std.path : baseName;
// filename intentionally contains non-ASCII (Russian) characters for test Issue 7648
return text(deleteme, "-детка.", baseName(file), ".", line);
}
|
D
|
module android.java.android.media.browse.MediaBrowser_MediaItem;
public import android.java.android.media.browse.MediaBrowser_MediaItem_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!MediaBrowser_MediaItem;
import import2 = android.java.java.lang.Class;
|
D
|
// https://bugzilla.gdcproject.org/show_bug.cgi?id=67
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
__vector(float[4])[2] d; // ICE
|
D
|
instance PAL_212_Schiffswache(Npc_Default)
{
name[0] = NAME_Schiffswache;
guild = GIL_PAL;
id = 212;
voice = 8;
flags = NPC_FLAG_IMMORTAL;
npcType = npctype_main;
B_SetAttributesToChapter(self,6);
fight_tactic = FAI_NAILED;
EquipItem(self,ItMw_2h_Pal_Sword);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Fighter",Face_L_Scatty,BodyTex_L,ItAr_PAL_M);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,65);
daily_routine = Rtn_Start_212;
};
func void Rtn_Start_212()
{
TA_Guard_Passage(8,0,23,0,"NW_CITY_SHIP_GUARD_02");
TA_Guard_Passage(23,0,8,0,"NW_CITY_SHIP_GUARD_02");
};
func void Rtn_ShipFree_212()
{
TA_Smalltalk(8,0,23,0,"NW_CITY_PALCAMP_01");
TA_Smalltalk(23,0,8,0,"NW_CITY_PALCAMP_01");
};
|
D
|
/**
* Dlang vulkan function pointer prototypes, declarations and loader from vkGetInstanceProcAddr
*
* Copyright: Copyright 2015-2016 The Khronos Group Inc.; Copyright 2016 Alex Parrill, Peter Particle.
* License: $(https://opensource.org/licenses/MIT, MIT License).
* Authors: Copyright 2016 Alex Parrill, Peter Particle
*/
module erupted.functions;
public import erupted.types;
nothrow @nogc:
/// function type aliases
extern( System ) {
// VK_VERSION_1_0
alias PFN_vkCreateInstance = VkResult function( const( VkInstanceCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkInstance* pInstance );
alias PFN_vkDestroyInstance = void function( VkInstance instance, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkEnumeratePhysicalDevices = VkResult function( VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices );
alias PFN_vkGetPhysicalDeviceFeatures = void function( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures );
alias PFN_vkGetPhysicalDeviceFormatProperties = void function( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties );
alias PFN_vkGetPhysicalDeviceImageFormatProperties = VkResult function( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties );
alias PFN_vkGetPhysicalDeviceProperties = void function( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties );
alias PFN_vkGetPhysicalDeviceQueueFamilyProperties = void function( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties );
alias PFN_vkGetPhysicalDeviceMemoryProperties = void function( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties );
alias PFN_vkGetInstanceProcAddr = PFN_vkVoidFunction function( VkInstance instance, const( char )* pName );
alias PFN_vkGetDeviceProcAddr = PFN_vkVoidFunction function( VkDevice device, const( char )* pName );
alias PFN_vkCreateDevice = VkResult function( VkPhysicalDevice physicalDevice, const( VkDeviceCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkDevice* pDevice );
alias PFN_vkDestroyDevice = void function( VkDevice device, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkEnumerateInstanceExtensionProperties = VkResult function( const( char )* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties );
alias PFN_vkEnumerateDeviceExtensionProperties = VkResult function( VkPhysicalDevice physicalDevice, const( char )* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties );
alias PFN_vkEnumerateInstanceLayerProperties = VkResult function( uint32_t* pPropertyCount, VkLayerProperties* pProperties );
alias PFN_vkEnumerateDeviceLayerProperties = VkResult function( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties );
alias PFN_vkGetDeviceQueue = void function( VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue );
alias PFN_vkQueueSubmit = VkResult function( VkQueue queue, uint32_t submitCount, const( VkSubmitInfo )* pSubmits, VkFence fence );
alias PFN_vkQueueWaitIdle = VkResult function( VkQueue queue );
alias PFN_vkDeviceWaitIdle = VkResult function( VkDevice device );
alias PFN_vkAllocateMemory = VkResult function( VkDevice device, const( VkMemoryAllocateInfo )* pAllocateInfo, const( VkAllocationCallbacks )* pAllocator, VkDeviceMemory* pMemory );
alias PFN_vkFreeMemory = void function( VkDevice device, VkDeviceMemory memory, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkMapMemory = VkResult function( VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData );
alias PFN_vkUnmapMemory = void function( VkDevice device, VkDeviceMemory memory );
alias PFN_vkFlushMappedMemoryRanges = VkResult function( VkDevice device, uint32_t memoryRangeCount, const( VkMappedMemoryRange )* pMemoryRanges );
alias PFN_vkInvalidateMappedMemoryRanges = VkResult function( VkDevice device, uint32_t memoryRangeCount, const( VkMappedMemoryRange )* pMemoryRanges );
alias PFN_vkGetDeviceMemoryCommitment = void function( VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes );
alias PFN_vkBindBufferMemory = VkResult function( VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset );
alias PFN_vkBindImageMemory = VkResult function( VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset );
alias PFN_vkGetBufferMemoryRequirements = void function( VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements );
alias PFN_vkGetImageMemoryRequirements = void function( VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements );
alias PFN_vkGetImageSparseMemoryRequirements = void function( VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements );
alias PFN_vkGetPhysicalDeviceSparseImageFormatProperties = void function( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties );
alias PFN_vkQueueBindSparse = VkResult function( VkQueue queue, uint32_t bindInfoCount, const( VkBindSparseInfo )* pBindInfo, VkFence fence );
alias PFN_vkCreateFence = VkResult function( VkDevice device, const( VkFenceCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkFence* pFence );
alias PFN_vkDestroyFence = void function( VkDevice device, VkFence fence, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkResetFences = VkResult function( VkDevice device, uint32_t fenceCount, const( VkFence )* pFences );
alias PFN_vkGetFenceStatus = VkResult function( VkDevice device, VkFence fence );
alias PFN_vkWaitForFences = VkResult function( VkDevice device, uint32_t fenceCount, const( VkFence )* pFences, VkBool32 waitAll, uint64_t timeout );
alias PFN_vkCreateSemaphore = VkResult function( VkDevice device, const( VkSemaphoreCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkSemaphore* pSemaphore );
alias PFN_vkDestroySemaphore = void function( VkDevice device, VkSemaphore semaphore, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateEvent = VkResult function( VkDevice device, const( VkEventCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkEvent* pEvent );
alias PFN_vkDestroyEvent = void function( VkDevice device, VkEvent event, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkGetEventStatus = VkResult function( VkDevice device, VkEvent event );
alias PFN_vkSetEvent = VkResult function( VkDevice device, VkEvent event );
alias PFN_vkResetEvent = VkResult function( VkDevice device, VkEvent event );
alias PFN_vkCreateQueryPool = VkResult function( VkDevice device, const( VkQueryPoolCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkQueryPool* pQueryPool );
alias PFN_vkDestroyQueryPool = void function( VkDevice device, VkQueryPool queryPool, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkGetQueryPoolResults = VkResult function( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags );
alias PFN_vkCreateBuffer = VkResult function( VkDevice device, const( VkBufferCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkBuffer* pBuffer );
alias PFN_vkDestroyBuffer = void function( VkDevice device, VkBuffer buffer, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateBufferView = VkResult function( VkDevice device, const( VkBufferViewCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkBufferView* pView );
alias PFN_vkDestroyBufferView = void function( VkDevice device, VkBufferView bufferView, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateImage = VkResult function( VkDevice device, const( VkImageCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkImage* pImage );
alias PFN_vkDestroyImage = void function( VkDevice device, VkImage image, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkGetImageSubresourceLayout = void function( VkDevice device, VkImage image, const( VkImageSubresource )* pSubresource, VkSubresourceLayout* pLayout );
alias PFN_vkCreateImageView = VkResult function( VkDevice device, const( VkImageViewCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkImageView* pView );
alias PFN_vkDestroyImageView = void function( VkDevice device, VkImageView imageView, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateShaderModule = VkResult function( VkDevice device, const( VkShaderModuleCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkShaderModule* pShaderModule );
alias PFN_vkDestroyShaderModule = void function( VkDevice device, VkShaderModule shaderModule, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreatePipelineCache = VkResult function( VkDevice device, const( VkPipelineCacheCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkPipelineCache* pPipelineCache );
alias PFN_vkDestroyPipelineCache = void function( VkDevice device, VkPipelineCache pipelineCache, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkGetPipelineCacheData = VkResult function( VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData );
alias PFN_vkMergePipelineCaches = VkResult function( VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const( VkPipelineCache )* pSrcCaches );
alias PFN_vkCreateGraphicsPipelines = VkResult function( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const( VkGraphicsPipelineCreateInfo )* pCreateInfos, const( VkAllocationCallbacks )* pAllocator, VkPipeline* pPipelines );
alias PFN_vkCreateComputePipelines = VkResult function( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const( VkComputePipelineCreateInfo )* pCreateInfos, const( VkAllocationCallbacks )* pAllocator, VkPipeline* pPipelines );
alias PFN_vkDestroyPipeline = void function( VkDevice device, VkPipeline pipeline, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreatePipelineLayout = VkResult function( VkDevice device, const( VkPipelineLayoutCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkPipelineLayout* pPipelineLayout );
alias PFN_vkDestroyPipelineLayout = void function( VkDevice device, VkPipelineLayout pipelineLayout, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateSampler = VkResult function( VkDevice device, const( VkSamplerCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkSampler* pSampler );
alias PFN_vkDestroySampler = void function( VkDevice device, VkSampler sampler, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateDescriptorSetLayout = VkResult function( VkDevice device, const( VkDescriptorSetLayoutCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkDescriptorSetLayout* pSetLayout );
alias PFN_vkDestroyDescriptorSetLayout = void function( VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateDescriptorPool = VkResult function( VkDevice device, const( VkDescriptorPoolCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkDescriptorPool* pDescriptorPool );
alias PFN_vkDestroyDescriptorPool = void function( VkDevice device, VkDescriptorPool descriptorPool, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkResetDescriptorPool = VkResult function( VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags );
alias PFN_vkAllocateDescriptorSets = VkResult function( VkDevice device, const( VkDescriptorSetAllocateInfo )* pAllocateInfo, VkDescriptorSet* pDescriptorSets );
alias PFN_vkFreeDescriptorSets = VkResult function( VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const( VkDescriptorSet )* pDescriptorSets );
alias PFN_vkUpdateDescriptorSets = void function( VkDevice device, uint32_t descriptorWriteCount, const( VkWriteDescriptorSet )* pDescriptorWrites, uint32_t descriptorCopyCount, const( VkCopyDescriptorSet )* pDescriptorCopies );
alias PFN_vkCreateFramebuffer = VkResult function( VkDevice device, const( VkFramebufferCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkFramebuffer* pFramebuffer );
alias PFN_vkDestroyFramebuffer = void function( VkDevice device, VkFramebuffer framebuffer, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateRenderPass = VkResult function( VkDevice device, const( VkRenderPassCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkRenderPass* pRenderPass );
alias PFN_vkDestroyRenderPass = void function( VkDevice device, VkRenderPass renderPass, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkGetRenderAreaGranularity = void function( VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity );
alias PFN_vkCreateCommandPool = VkResult function( VkDevice device, const( VkCommandPoolCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkCommandPool* pCommandPool );
alias PFN_vkDestroyCommandPool = void function( VkDevice device, VkCommandPool commandPool, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkResetCommandPool = VkResult function( VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags );
alias PFN_vkAllocateCommandBuffers = VkResult function( VkDevice device, const( VkCommandBufferAllocateInfo )* pAllocateInfo, VkCommandBuffer* pCommandBuffers );
alias PFN_vkFreeCommandBuffers = void function( VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const( VkCommandBuffer )* pCommandBuffers );
alias PFN_vkBeginCommandBuffer = VkResult function( VkCommandBuffer commandBuffer, const( VkCommandBufferBeginInfo )* pBeginInfo );
alias PFN_vkEndCommandBuffer = VkResult function( VkCommandBuffer commandBuffer );
alias PFN_vkResetCommandBuffer = VkResult function( VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags );
alias PFN_vkCmdBindPipeline = void function( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline );
alias PFN_vkCmdSetViewport = void function( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const( VkViewport )* pViewports );
alias PFN_vkCmdSetScissor = void function( VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const( VkRect2D )* pScissors );
alias PFN_vkCmdSetLineWidth = void function( VkCommandBuffer commandBuffer, float lineWidth );
alias PFN_vkCmdSetDepthBias = void function( VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor );
alias PFN_vkCmdSetBlendConstants = void function( VkCommandBuffer commandBuffer, const float[4] blendConstants );
alias PFN_vkCmdSetDepthBounds = void function( VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds );
alias PFN_vkCmdSetStencilCompareMask = void function( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask );
alias PFN_vkCmdSetStencilWriteMask = void function( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask );
alias PFN_vkCmdSetStencilReference = void function( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference );
alias PFN_vkCmdBindDescriptorSets = void function( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const( VkDescriptorSet )* pDescriptorSets, uint32_t dynamicOffsetCount, const( uint32_t )* pDynamicOffsets );
alias PFN_vkCmdBindIndexBuffer = void function( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType );
alias PFN_vkCmdBindVertexBuffers = void function( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const( VkBuffer )* pBuffers, const( VkDeviceSize )* pOffsets );
alias PFN_vkCmdDraw = void function( VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance );
alias PFN_vkCmdDrawIndexed = void function( VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance );
alias PFN_vkCmdDrawIndirect = void function( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride );
alias PFN_vkCmdDrawIndexedIndirect = void function( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride );
alias PFN_vkCmdDispatch = void function( VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ );
alias PFN_vkCmdDispatchIndirect = void function( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset );
alias PFN_vkCmdCopyBuffer = void function( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const( VkBufferCopy )* pRegions );
alias PFN_vkCmdCopyImage = void function( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const( VkImageCopy )* pRegions );
alias PFN_vkCmdBlitImage = void function( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const( VkImageBlit )* pRegions, VkFilter filter );
alias PFN_vkCmdCopyBufferToImage = void function( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const( VkBufferImageCopy )* pRegions );
alias PFN_vkCmdCopyImageToBuffer = void function( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const( VkBufferImageCopy )* pRegions );
alias PFN_vkCmdUpdateBuffer = void function( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const( void )* pData );
alias PFN_vkCmdFillBuffer = void function( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data );
alias PFN_vkCmdClearColorImage = void function( VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const( VkClearColorValue )* pColor, uint32_t rangeCount, const( VkImageSubresourceRange )* pRanges );
alias PFN_vkCmdClearDepthStencilImage = void function( VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const( VkClearDepthStencilValue )* pDepthStencil, uint32_t rangeCount, const( VkImageSubresourceRange )* pRanges );
alias PFN_vkCmdClearAttachments = void function( VkCommandBuffer commandBuffer, uint32_t attachmentCount, const( VkClearAttachment )* pAttachments, uint32_t rectCount, const( VkClearRect )* pRects );
alias PFN_vkCmdResolveImage = void function( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const( VkImageResolve )* pRegions );
alias PFN_vkCmdSetEvent = void function( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask );
alias PFN_vkCmdResetEvent = void function( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask );
alias PFN_vkCmdWaitEvents = void function( VkCommandBuffer commandBuffer, uint32_t eventCount, const( VkEvent )* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const( VkMemoryBarrier )* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const( VkBufferMemoryBarrier )* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const( VkImageMemoryBarrier )* pImageMemoryBarriers );
alias PFN_vkCmdPipelineBarrier = void function( VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const( VkMemoryBarrier )* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const( VkBufferMemoryBarrier )* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const( VkImageMemoryBarrier )* pImageMemoryBarriers );
alias PFN_vkCmdBeginQuery = void function( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags );
alias PFN_vkCmdEndQuery = void function( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query );
alias PFN_vkCmdResetQueryPool = void function( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount );
alias PFN_vkCmdWriteTimestamp = void function( VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query );
alias PFN_vkCmdCopyQueryPoolResults = void function( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags );
alias PFN_vkCmdPushConstants = void function( VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const( void )* pValues );
alias PFN_vkCmdBeginRenderPass = void function( VkCommandBuffer commandBuffer, const( VkRenderPassBeginInfo )* pRenderPassBegin, VkSubpassContents contents );
alias PFN_vkCmdNextSubpass = void function( VkCommandBuffer commandBuffer, VkSubpassContents contents );
alias PFN_vkCmdEndRenderPass = void function( VkCommandBuffer commandBuffer );
alias PFN_vkCmdExecuteCommands = void function( VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const( VkCommandBuffer )* pCommandBuffers );
// VK_VERSION_1_1
alias PFN_vkEnumerateInstanceVersion = VkResult function( uint32_t* pApiVersion );
alias PFN_vkBindBufferMemory2 = VkResult function( VkDevice device, uint32_t bindInfoCount, const( VkBindBufferMemoryInfo )* pBindInfos );
alias PFN_vkBindImageMemory2 = VkResult function( VkDevice device, uint32_t bindInfoCount, const( VkBindImageMemoryInfo )* pBindInfos );
alias PFN_vkGetDeviceGroupPeerMemoryFeatures = void function( VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures );
alias PFN_vkCmdSetDeviceMask = void function( VkCommandBuffer commandBuffer, uint32_t deviceMask );
alias PFN_vkCmdDispatchBase = void function( VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ );
alias PFN_vkEnumeratePhysicalDeviceGroups = VkResult function( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties );
alias PFN_vkGetImageMemoryRequirements2 = void function( VkDevice device, const( VkImageMemoryRequirementsInfo2 )* pInfo, VkMemoryRequirements2* pMemoryRequirements );
alias PFN_vkGetBufferMemoryRequirements2 = void function( VkDevice device, const( VkBufferMemoryRequirementsInfo2 )* pInfo, VkMemoryRequirements2* pMemoryRequirements );
alias PFN_vkGetImageSparseMemoryRequirements2 = void function( VkDevice device, const( VkImageSparseMemoryRequirementsInfo2 )* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements );
alias PFN_vkGetPhysicalDeviceFeatures2 = void function( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures );
alias PFN_vkGetPhysicalDeviceProperties2 = void function( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties );
alias PFN_vkGetPhysicalDeviceFormatProperties2 = void function( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties );
alias PFN_vkGetPhysicalDeviceImageFormatProperties2 = VkResult function( VkPhysicalDevice physicalDevice, const( VkPhysicalDeviceImageFormatInfo2 )* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties );
alias PFN_vkGetPhysicalDeviceQueueFamilyProperties2 = void function( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties );
alias PFN_vkGetPhysicalDeviceMemoryProperties2 = void function( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties );
alias PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 = void function( VkPhysicalDevice physicalDevice, const( VkPhysicalDeviceSparseImageFormatInfo2 )* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties );
alias PFN_vkTrimCommandPool = void function( VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags );
alias PFN_vkGetDeviceQueue2 = void function( VkDevice device, const( VkDeviceQueueInfo2 )* pQueueInfo, VkQueue* pQueue );
alias PFN_vkCreateSamplerYcbcrConversion = VkResult function( VkDevice device, const( VkSamplerYcbcrConversionCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion );
alias PFN_vkDestroySamplerYcbcrConversion = void function( VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateDescriptorUpdateTemplate = VkResult function( VkDevice device, const( VkDescriptorUpdateTemplateCreateInfo )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate );
alias PFN_vkDestroyDescriptorUpdateTemplate = void function( VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkUpdateDescriptorSetWithTemplate = void function( VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const( void )* pData );
alias PFN_vkGetPhysicalDeviceExternalBufferProperties = void function( VkPhysicalDevice physicalDevice, const( VkPhysicalDeviceExternalBufferInfo )* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties );
alias PFN_vkGetPhysicalDeviceExternalFenceProperties = void function( VkPhysicalDevice physicalDevice, const( VkPhysicalDeviceExternalFenceInfo )* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties );
alias PFN_vkGetPhysicalDeviceExternalSemaphoreProperties = void function( VkPhysicalDevice physicalDevice, const( VkPhysicalDeviceExternalSemaphoreInfo )* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties );
alias PFN_vkGetDescriptorSetLayoutSupport = void function( VkDevice device, const( VkDescriptorSetLayoutCreateInfo )* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport );
// VK_KHR_surface
alias PFN_vkDestroySurfaceKHR = void function( VkInstance instance, VkSurfaceKHR surface, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkGetPhysicalDeviceSurfaceSupportKHR = VkResult function( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported );
alias PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = VkResult function( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities );
alias PFN_vkGetPhysicalDeviceSurfaceFormatsKHR = VkResult function( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats );
alias PFN_vkGetPhysicalDeviceSurfacePresentModesKHR = VkResult function( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes );
// VK_KHR_swapchain
alias PFN_vkCreateSwapchainKHR = VkResult function( VkDevice device, const( VkSwapchainCreateInfoKHR )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkSwapchainKHR* pSwapchain );
alias PFN_vkDestroySwapchainKHR = void function( VkDevice device, VkSwapchainKHR swapchain, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkGetSwapchainImagesKHR = VkResult function( VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages );
alias PFN_vkAcquireNextImageKHR = VkResult function( VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex );
alias PFN_vkQueuePresentKHR = VkResult function( VkQueue queue, const( VkPresentInfoKHR )* pPresentInfo );
alias PFN_vkGetDeviceGroupPresentCapabilitiesKHR = VkResult function( VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities );
alias PFN_vkGetDeviceGroupSurfacePresentModesKHR = VkResult function( VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes );
alias PFN_vkGetPhysicalDevicePresentRectanglesKHR = VkResult function( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects );
alias PFN_vkAcquireNextImage2KHR = VkResult function( VkDevice device, const( VkAcquireNextImageInfoKHR )* pAcquireInfo, uint32_t* pImageIndex );
// VK_KHR_display
alias PFN_vkGetPhysicalDeviceDisplayPropertiesKHR = VkResult function( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties );
alias PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = VkResult function( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties );
alias PFN_vkGetDisplayPlaneSupportedDisplaysKHR = VkResult function( VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays );
alias PFN_vkGetDisplayModePropertiesKHR = VkResult function( VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties );
alias PFN_vkCreateDisplayModeKHR = VkResult function( VkPhysicalDevice physicalDevice, VkDisplayKHR display, const( VkDisplayModeCreateInfoKHR )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkDisplayModeKHR* pMode );
alias PFN_vkGetDisplayPlaneCapabilitiesKHR = VkResult function( VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities );
alias PFN_vkCreateDisplayPlaneSurfaceKHR = VkResult function( VkInstance instance, const( VkDisplaySurfaceCreateInfoKHR )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkSurfaceKHR* pSurface );
// VK_KHR_display_swapchain
alias PFN_vkCreateSharedSwapchainsKHR = VkResult function( VkDevice device, uint32_t swapchainCount, const( VkSwapchainCreateInfoKHR )* pCreateInfos, const( VkAllocationCallbacks )* pAllocator, VkSwapchainKHR* pSwapchains );
// VK_KHR_external_memory_fd
alias PFN_vkGetMemoryFdKHR = VkResult function( VkDevice device, const( VkMemoryGetFdInfoKHR )* pGetFdInfo, int* pFd );
alias PFN_vkGetMemoryFdPropertiesKHR = VkResult function( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties );
// VK_KHR_external_semaphore_fd
alias PFN_vkImportSemaphoreFdKHR = VkResult function( VkDevice device, const( VkImportSemaphoreFdInfoKHR )* pImportSemaphoreFdInfo );
alias PFN_vkGetSemaphoreFdKHR = VkResult function( VkDevice device, const( VkSemaphoreGetFdInfoKHR )* pGetFdInfo, int* pFd );
// VK_KHR_push_descriptor
alias PFN_vkCmdPushDescriptorSetKHR = void function( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const( VkWriteDescriptorSet )* pDescriptorWrites );
alias PFN_vkCmdPushDescriptorSetWithTemplateKHR = void function( VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const( void )* pData );
// VK_KHR_shared_presentable_image
alias PFN_vkGetSwapchainStatusKHR = VkResult function( VkDevice device, VkSwapchainKHR swapchain );
// VK_KHR_external_fence_fd
alias PFN_vkImportFenceFdKHR = VkResult function( VkDevice device, const( VkImportFenceFdInfoKHR )* pImportFenceFdInfo );
alias PFN_vkGetFenceFdKHR = VkResult function( VkDevice device, const( VkFenceGetFdInfoKHR )* pGetFdInfo, int* pFd );
// VK_KHR_get_surface_capabilities2
alias PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR = VkResult function( VkPhysicalDevice physicalDevice, const( VkPhysicalDeviceSurfaceInfo2KHR )* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities );
alias PFN_vkGetPhysicalDeviceSurfaceFormats2KHR = VkResult function( VkPhysicalDevice physicalDevice, const( VkPhysicalDeviceSurfaceInfo2KHR )* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats );
// VK_EXT_debug_report
alias PFN_vkCreateDebugReportCallbackEXT = VkResult function( VkInstance instance, const( VkDebugReportCallbackCreateInfoEXT )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkDebugReportCallbackEXT* pCallback );
alias PFN_vkDestroyDebugReportCallbackEXT = void function( VkInstance instance, VkDebugReportCallbackEXT callback, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkDebugReportMessageEXT = void function( VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const( char )* pLayerPrefix, const( char )* pMessage );
// VK_EXT_debug_marker
alias PFN_vkDebugMarkerSetObjectTagEXT = VkResult function( VkDevice device, const( VkDebugMarkerObjectTagInfoEXT )* pTagInfo );
alias PFN_vkDebugMarkerSetObjectNameEXT = VkResult function( VkDevice device, const( VkDebugMarkerObjectNameInfoEXT )* pNameInfo );
alias PFN_vkCmdDebugMarkerBeginEXT = void function( VkCommandBuffer commandBuffer, const( VkDebugMarkerMarkerInfoEXT )* pMarkerInfo );
alias PFN_vkCmdDebugMarkerEndEXT = void function( VkCommandBuffer commandBuffer );
alias PFN_vkCmdDebugMarkerInsertEXT = void function( VkCommandBuffer commandBuffer, const( VkDebugMarkerMarkerInfoEXT )* pMarkerInfo );
// VK_AMD_draw_indirect_count
alias PFN_vkCmdDrawIndirectCountAMD = void function( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride );
alias PFN_vkCmdDrawIndexedIndirectCountAMD = void function( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride );
// VK_AMD_shader_info
alias PFN_vkGetShaderInfoAMD = VkResult function( VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo );
// VK_NV_external_memory_capabilities
alias PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = VkResult function( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties );
// VK_NVX_device_generated_commands
alias PFN_vkCmdProcessCommandsNVX = void function( VkCommandBuffer commandBuffer, const( VkCmdProcessCommandsInfoNVX )* pProcessCommandsInfo );
alias PFN_vkCmdReserveSpaceForCommandsNVX = void function( VkCommandBuffer commandBuffer, const( VkCmdReserveSpaceForCommandsInfoNVX )* pReserveSpaceInfo );
alias PFN_vkCreateIndirectCommandsLayoutNVX = VkResult function( VkDevice device, const( VkIndirectCommandsLayoutCreateInfoNVX )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout );
alias PFN_vkDestroyIndirectCommandsLayoutNVX = void function( VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkCreateObjectTableNVX = VkResult function( VkDevice device, const( VkObjectTableCreateInfoNVX )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkObjectTableNVX* pObjectTable );
alias PFN_vkDestroyObjectTableNVX = void function( VkDevice device, VkObjectTableNVX objectTable, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkRegisterObjectsNVX = VkResult function( VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const( VkObjectTableEntryNVX* )* ppObjectTableEntries, const( uint32_t )* pObjectIndices );
alias PFN_vkUnregisterObjectsNVX = VkResult function( VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const( VkObjectEntryTypeNVX )* pObjectEntryTypes, const( uint32_t )* pObjectIndices );
alias PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = void function( VkPhysicalDevice physicalDevice, VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, VkDeviceGeneratedCommandsLimitsNVX* pLimits );
// VK_NV_clip_space_w_scaling
alias PFN_vkCmdSetViewportWScalingNV = void function( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const( VkViewportWScalingNV )* pViewportWScalings );
// VK_EXT_direct_mode_display
alias PFN_vkReleaseDisplayEXT = VkResult function( VkPhysicalDevice physicalDevice, VkDisplayKHR display );
// VK_EXT_display_surface_counter
alias PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT = VkResult function( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities );
// VK_EXT_display_control
alias PFN_vkDisplayPowerControlEXT = VkResult function( VkDevice device, VkDisplayKHR display, const( VkDisplayPowerInfoEXT )* pDisplayPowerInfo );
alias PFN_vkRegisterDeviceEventEXT = VkResult function( VkDevice device, const( VkDeviceEventInfoEXT )* pDeviceEventInfo, const( VkAllocationCallbacks )* pAllocator, VkFence* pFence );
alias PFN_vkRegisterDisplayEventEXT = VkResult function( VkDevice device, VkDisplayKHR display, const( VkDisplayEventInfoEXT )* pDisplayEventInfo, const( VkAllocationCallbacks )* pAllocator, VkFence* pFence );
alias PFN_vkGetSwapchainCounterEXT = VkResult function( VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue );
// VK_GOOGLE_display_timing
alias PFN_vkGetRefreshCycleDurationGOOGLE = VkResult function( VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties );
alias PFN_vkGetPastPresentationTimingGOOGLE = VkResult function( VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings );
// VK_EXT_discard_rectangles
alias PFN_vkCmdSetDiscardRectangleEXT = void function( VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const( VkRect2D )* pDiscardRectangles );
// VK_EXT_hdr_metadata
alias PFN_vkSetHdrMetadataEXT = void function( VkDevice device, uint32_t swapchainCount, const( VkSwapchainKHR )* pSwapchains, const( VkHdrMetadataEXT )* pMetadata );
// VK_EXT_debug_utils
alias PFN_vkSetDebugUtilsObjectNameEXT = VkResult function( VkDevice device, const( VkDebugUtilsObjectNameInfoEXT )* pNameInfo );
alias PFN_vkSetDebugUtilsObjectTagEXT = VkResult function( VkDevice device, const( VkDebugUtilsObjectTagInfoEXT )* pTagInfo );
alias PFN_vkQueueBeginDebugUtilsLabelEXT = void function( VkQueue queue, const( VkDebugUtilsLabelEXT )* pLabelInfo );
alias PFN_vkQueueEndDebugUtilsLabelEXT = void function( VkQueue queue );
alias PFN_vkQueueInsertDebugUtilsLabelEXT = void function( VkQueue queue, const( VkDebugUtilsLabelEXT )* pLabelInfo );
alias PFN_vkCmdBeginDebugUtilsLabelEXT = void function( VkCommandBuffer commandBuffer, const( VkDebugUtilsLabelEXT )* pLabelInfo );
alias PFN_vkCmdEndDebugUtilsLabelEXT = void function( VkCommandBuffer commandBuffer );
alias PFN_vkCmdInsertDebugUtilsLabelEXT = void function( VkCommandBuffer commandBuffer, const( VkDebugUtilsLabelEXT )* pLabelInfo );
alias PFN_vkCreateDebugUtilsMessengerEXT = VkResult function( VkInstance instance, const( VkDebugUtilsMessengerCreateInfoEXT )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkDebugUtilsMessengerEXT* pMessenger );
alias PFN_vkDestroyDebugUtilsMessengerEXT = void function( VkInstance instance, VkDebugUtilsMessengerEXT messenger, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkSubmitDebugUtilsMessageEXT = void function( VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const( VkDebugUtilsMessengerCallbackDataEXT )* pCallbackData );
// VK_EXT_sample_locations
alias PFN_vkCmdSetSampleLocationsEXT = void function( VkCommandBuffer commandBuffer, const( VkSampleLocationsInfoEXT )* pSampleLocationsInfo );
alias PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT = void function( VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties );
// VK_EXT_validation_cache
alias PFN_vkCreateValidationCacheEXT = VkResult function( VkDevice device, const( VkValidationCacheCreateInfoEXT )* pCreateInfo, const( VkAllocationCallbacks )* pAllocator, VkValidationCacheEXT* pValidationCache );
alias PFN_vkDestroyValidationCacheEXT = void function( VkDevice device, VkValidationCacheEXT validationCache, const( VkAllocationCallbacks )* pAllocator );
alias PFN_vkMergeValidationCachesEXT = VkResult function( VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const( VkValidationCacheEXT )* pSrcCaches );
alias PFN_vkGetValidationCacheDataEXT = VkResult function( VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData );
// VK_EXT_external_memory_host
alias PFN_vkGetMemoryHostPointerPropertiesEXT = VkResult function( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const( void )* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties );
// VK_AMD_buffer_marker
alias PFN_vkCmdWriteBufferMarkerAMD = void function( VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker );
}
/// function declarations
__gshared {
// VK_VERSION_1_0
PFN_vkCreateInstance vkCreateInstance;
PFN_vkDestroyInstance vkDestroyInstance;
PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures;
PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties;
PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties;
PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
PFN_vkCreateDevice vkCreateDevice;
PFN_vkDestroyDevice vkDestroyDevice;
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties;
PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties;
PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties;
PFN_vkGetDeviceQueue vkGetDeviceQueue;
PFN_vkQueueSubmit vkQueueSubmit;
PFN_vkQueueWaitIdle vkQueueWaitIdle;
PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
PFN_vkAllocateMemory vkAllocateMemory;
PFN_vkFreeMemory vkFreeMemory;
PFN_vkMapMemory vkMapMemory;
PFN_vkUnmapMemory vkUnmapMemory;
PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment;
PFN_vkBindBufferMemory vkBindBufferMemory;
PFN_vkBindImageMemory vkBindImageMemory;
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements;
PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties;
PFN_vkQueueBindSparse vkQueueBindSparse;
PFN_vkCreateFence vkCreateFence;
PFN_vkDestroyFence vkDestroyFence;
PFN_vkResetFences vkResetFences;
PFN_vkGetFenceStatus vkGetFenceStatus;
PFN_vkWaitForFences vkWaitForFences;
PFN_vkCreateSemaphore vkCreateSemaphore;
PFN_vkDestroySemaphore vkDestroySemaphore;
PFN_vkCreateEvent vkCreateEvent;
PFN_vkDestroyEvent vkDestroyEvent;
PFN_vkGetEventStatus vkGetEventStatus;
PFN_vkSetEvent vkSetEvent;
PFN_vkResetEvent vkResetEvent;
PFN_vkCreateQueryPool vkCreateQueryPool;
PFN_vkDestroyQueryPool vkDestroyQueryPool;
PFN_vkGetQueryPoolResults vkGetQueryPoolResults;
PFN_vkCreateBuffer vkCreateBuffer;
PFN_vkDestroyBuffer vkDestroyBuffer;
PFN_vkCreateBufferView vkCreateBufferView;
PFN_vkDestroyBufferView vkDestroyBufferView;
PFN_vkCreateImage vkCreateImage;
PFN_vkDestroyImage vkDestroyImage;
PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
PFN_vkCreateImageView vkCreateImageView;
PFN_vkDestroyImageView vkDestroyImageView;
PFN_vkCreateShaderModule vkCreateShaderModule;
PFN_vkDestroyShaderModule vkDestroyShaderModule;
PFN_vkCreatePipelineCache vkCreatePipelineCache;
PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
PFN_vkGetPipelineCacheData vkGetPipelineCacheData;
PFN_vkMergePipelineCaches vkMergePipelineCaches;
PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
PFN_vkCreateComputePipelines vkCreateComputePipelines;
PFN_vkDestroyPipeline vkDestroyPipeline;
PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
PFN_vkCreateSampler vkCreateSampler;
PFN_vkDestroySampler vkDestroySampler;
PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
PFN_vkResetDescriptorPool vkResetDescriptorPool;
PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
PFN_vkCreateFramebuffer vkCreateFramebuffer;
PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
PFN_vkCreateRenderPass vkCreateRenderPass;
PFN_vkDestroyRenderPass vkDestroyRenderPass;
PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity;
PFN_vkCreateCommandPool vkCreateCommandPool;
PFN_vkDestroyCommandPool vkDestroyCommandPool;
PFN_vkResetCommandPool vkResetCommandPool;
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
PFN_vkEndCommandBuffer vkEndCommandBuffer;
PFN_vkResetCommandBuffer vkResetCommandBuffer;
PFN_vkCmdBindPipeline vkCmdBindPipeline;
PFN_vkCmdSetViewport vkCmdSetViewport;
PFN_vkCmdSetScissor vkCmdSetScissor;
PFN_vkCmdSetLineWidth vkCmdSetLineWidth;
PFN_vkCmdSetDepthBias vkCmdSetDepthBias;
PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants;
PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds;
PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask;
PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask;
PFN_vkCmdSetStencilReference vkCmdSetStencilReference;
PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
PFN_vkCmdDraw vkCmdDraw;
PFN_vkCmdDrawIndexed vkCmdDrawIndexed;
PFN_vkCmdDrawIndirect vkCmdDrawIndirect;
PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect;
PFN_vkCmdDispatch vkCmdDispatch;
PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect;
PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
PFN_vkCmdCopyImage vkCmdCopyImage;
PFN_vkCmdBlitImage vkCmdBlitImage;
PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage;
PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer;
PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer;
PFN_vkCmdFillBuffer vkCmdFillBuffer;
PFN_vkCmdClearColorImage vkCmdClearColorImage;
PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage;
PFN_vkCmdClearAttachments vkCmdClearAttachments;
PFN_vkCmdResolveImage vkCmdResolveImage;
PFN_vkCmdSetEvent vkCmdSetEvent;
PFN_vkCmdResetEvent vkCmdResetEvent;
PFN_vkCmdWaitEvents vkCmdWaitEvents;
PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
PFN_vkCmdBeginQuery vkCmdBeginQuery;
PFN_vkCmdEndQuery vkCmdEndQuery;
PFN_vkCmdResetQueryPool vkCmdResetQueryPool;
PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp;
PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults;
PFN_vkCmdPushConstants vkCmdPushConstants;
PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
PFN_vkCmdNextSubpass vkCmdNextSubpass;
PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
PFN_vkCmdExecuteCommands vkCmdExecuteCommands;
// VK_VERSION_1_1
PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion;
PFN_vkBindBufferMemory2 vkBindBufferMemory2;
PFN_vkBindImageMemory2 vkBindImageMemory2;
PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures;
PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask;
PFN_vkCmdDispatchBase vkCmdDispatchBase;
PFN_vkEnumeratePhysicalDeviceGroups vkEnumeratePhysicalDeviceGroups;
PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2;
PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2;
PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2;
PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2;
PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2;
PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2;
PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2;
PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2;
PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2;
PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 vkGetPhysicalDeviceSparseImageFormatProperties2;
PFN_vkTrimCommandPool vkTrimCommandPool;
PFN_vkGetDeviceQueue2 vkGetDeviceQueue2;
PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion;
PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion;
PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate;
PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate;
PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate;
PFN_vkGetPhysicalDeviceExternalBufferProperties vkGetPhysicalDeviceExternalBufferProperties;
PFN_vkGetPhysicalDeviceExternalFenceProperties vkGetPhysicalDeviceExternalFenceProperties;
PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties;
PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport;
// VK_KHR_surface
PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR;
PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR;
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
// VK_KHR_swapchain
PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR;
PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
PFN_vkQueuePresentKHR vkQueuePresentKHR;
PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR;
PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR;
PFN_vkGetPhysicalDevicePresentRectanglesKHR vkGetPhysicalDevicePresentRectanglesKHR;
PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR;
// VK_KHR_display
PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR;
PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR;
PFN_vkGetDisplayPlaneSupportedDisplaysKHR vkGetDisplayPlaneSupportedDisplaysKHR;
PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR;
PFN_vkCreateDisplayModeKHR vkCreateDisplayModeKHR;
PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR;
PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR;
// VK_KHR_display_swapchain
PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR;
// VK_KHR_external_memory_fd
PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR;
PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR;
// VK_KHR_external_semaphore_fd
PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR;
PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR;
// VK_KHR_push_descriptor
PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR;
PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR;
// VK_KHR_shared_presentable_image
PFN_vkGetSwapchainStatusKHR vkGetSwapchainStatusKHR;
// VK_KHR_external_fence_fd
PFN_vkImportFenceFdKHR vkImportFenceFdKHR;
PFN_vkGetFenceFdKHR vkGetFenceFdKHR;
// VK_KHR_get_surface_capabilities2
PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR;
PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR;
// VK_EXT_debug_report
PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT;
PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT;
PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT;
// VK_EXT_debug_marker
PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT;
PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT;
PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT;
PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT;
PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT;
// VK_AMD_draw_indirect_count
PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD;
PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD;
// VK_AMD_shader_info
PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD;
// VK_NV_external_memory_capabilities
PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV vkGetPhysicalDeviceExternalImageFormatPropertiesNV;
// VK_NVX_device_generated_commands
PFN_vkCmdProcessCommandsNVX vkCmdProcessCommandsNVX;
PFN_vkCmdReserveSpaceForCommandsNVX vkCmdReserveSpaceForCommandsNVX;
PFN_vkCreateIndirectCommandsLayoutNVX vkCreateIndirectCommandsLayoutNVX;
PFN_vkDestroyIndirectCommandsLayoutNVX vkDestroyIndirectCommandsLayoutNVX;
PFN_vkCreateObjectTableNVX vkCreateObjectTableNVX;
PFN_vkDestroyObjectTableNVX vkDestroyObjectTableNVX;
PFN_vkRegisterObjectsNVX vkRegisterObjectsNVX;
PFN_vkUnregisterObjectsNVX vkUnregisterObjectsNVX;
PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX;
// VK_NV_clip_space_w_scaling
PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV;
// VK_EXT_direct_mode_display
PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT;
// VK_EXT_display_surface_counter
PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT;
// VK_EXT_display_control
PFN_vkDisplayPowerControlEXT vkDisplayPowerControlEXT;
PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT;
PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT;
PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT;
// VK_GOOGLE_display_timing
PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE;
PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE;
// VK_EXT_discard_rectangles
PFN_vkCmdSetDiscardRectangleEXT vkCmdSetDiscardRectangleEXT;
// VK_EXT_hdr_metadata
PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT;
// VK_EXT_debug_utils
PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT;
PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT;
PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT;
PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT;
PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT;
PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT;
PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT;
PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT;
PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT;
PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT;
PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT;
// VK_EXT_sample_locations
PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT;
PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT;
// VK_EXT_validation_cache
PFN_vkCreateValidationCacheEXT vkCreateValidationCacheEXT;
PFN_vkDestroyValidationCacheEXT vkDestroyValidationCacheEXT;
PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT;
PFN_vkGetValidationCacheDataEXT vkGetValidationCacheDataEXT;
// VK_EXT_external_memory_host
PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT;
// VK_AMD_buffer_marker
PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD;
// VK_KHR_get_physical_device_properties2
alias vkGetPhysicalDeviceFeatures2KHR = vkGetPhysicalDeviceFeatures2;
alias vkGetPhysicalDeviceProperties2KHR = vkGetPhysicalDeviceProperties2;
alias vkGetPhysicalDeviceFormatProperties2KHR = vkGetPhysicalDeviceFormatProperties2;
alias vkGetPhysicalDeviceImageFormatProperties2KHR = vkGetPhysicalDeviceImageFormatProperties2;
alias vkGetPhysicalDeviceQueueFamilyProperties2KHR = vkGetPhysicalDeviceQueueFamilyProperties2;
alias vkGetPhysicalDeviceMemoryProperties2KHR = vkGetPhysicalDeviceMemoryProperties2;
alias vkGetPhysicalDeviceSparseImageFormatProperties2KHR = vkGetPhysicalDeviceSparseImageFormatProperties2;
// VK_KHR_device_group
alias vkGetDeviceGroupPeerMemoryFeaturesKHR = vkGetDeviceGroupPeerMemoryFeatures;
alias vkCmdSetDeviceMaskKHR = vkCmdSetDeviceMask;
alias vkCmdDispatchBaseKHR = vkCmdDispatchBase;
// VK_KHR_maintenance1
alias vkTrimCommandPoolKHR = vkTrimCommandPool;
// VK_KHR_device_group_creation
alias vkEnumeratePhysicalDeviceGroupsKHR = vkEnumeratePhysicalDeviceGroups;
// VK_KHR_external_memory_capabilities
alias vkGetPhysicalDeviceExternalBufferPropertiesKHR = vkGetPhysicalDeviceExternalBufferProperties;
// VK_KHR_external_semaphore_capabilities
alias vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = vkGetPhysicalDeviceExternalSemaphoreProperties;
// VK_KHR_descriptor_update_template
alias vkCreateDescriptorUpdateTemplateKHR = vkCreateDescriptorUpdateTemplate;
alias vkDestroyDescriptorUpdateTemplateKHR = vkDestroyDescriptorUpdateTemplate;
alias vkUpdateDescriptorSetWithTemplateKHR = vkUpdateDescriptorSetWithTemplate;
// VK_KHR_external_fence_capabilities
alias vkGetPhysicalDeviceExternalFencePropertiesKHR = vkGetPhysicalDeviceExternalFenceProperties;
// VK_KHR_get_memory_requirements2
alias vkGetImageMemoryRequirements2KHR = vkGetImageMemoryRequirements2;
alias vkGetBufferMemoryRequirements2KHR = vkGetBufferMemoryRequirements2;
alias vkGetImageSparseMemoryRequirements2KHR = vkGetImageSparseMemoryRequirements2;
// VK_KHR_sampler_ycbcr_conversion
alias vkCreateSamplerYcbcrConversionKHR = vkCreateSamplerYcbcrConversion;
alias vkDestroySamplerYcbcrConversionKHR = vkDestroySamplerYcbcrConversion;
// VK_KHR_bind_memory2
alias vkBindBufferMemory2KHR = vkBindBufferMemory2;
alias vkBindImageMemory2KHR = vkBindImageMemory2;
// VK_KHR_maintenance3
alias vkGetDescriptorSetLayoutSupportKHR = vkGetDescriptorSetLayoutSupport;
}
/// sets vkCreateInstance function pointer and acquires basic functions to retrieve information about the implementation
/// and create an instance: vkEnumerateInstanceExtensionProperties, vkEnumerateInstanceLayerProperties, vkCreateInstance
void loadGlobalLevelFunctions( PFN_vkGetInstanceProcAddr getInstanceProcAddr ) {
vkGetInstanceProcAddr = getInstanceProcAddr;
// VK_VERSION_1_0
vkCreateInstance = cast( PFN_vkCreateInstance ) vkGetInstanceProcAddr( null, "vkCreateInstance" );
vkEnumerateInstanceExtensionProperties = cast( PFN_vkEnumerateInstanceExtensionProperties ) vkGetInstanceProcAddr( null, "vkEnumerateInstanceExtensionProperties" );
vkEnumerateInstanceLayerProperties = cast( PFN_vkEnumerateInstanceLayerProperties ) vkGetInstanceProcAddr( null, "vkEnumerateInstanceLayerProperties" );
// VK_VERSION_1_1
vkEnumerateInstanceVersion = cast( PFN_vkEnumerateInstanceVersion ) vkGetInstanceProcAddr( null, "vkEnumerateInstanceVersion" );
}
/// with a valid VkInstance call this function to retrieve additional VkInstance, VkPhysicalDevice, ... related functions
void loadInstanceLevelFunctions( VkInstance instance ) {
assert( vkGetInstanceProcAddr !is null, "Function pointer vkGetInstanceProcAddr is null!\nCall loadGlobalLevelFunctions -> loadInstanceLevelFunctions" );
// VK_VERSION_1_0
vkDestroyInstance = cast( PFN_vkDestroyInstance ) vkGetInstanceProcAddr( instance, "vkDestroyInstance" );
vkEnumeratePhysicalDevices = cast( PFN_vkEnumeratePhysicalDevices ) vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDevices" );
vkGetPhysicalDeviceFeatures = cast( PFN_vkGetPhysicalDeviceFeatures ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures" );
vkGetPhysicalDeviceFormatProperties = cast( PFN_vkGetPhysicalDeviceFormatProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties" );
vkGetPhysicalDeviceImageFormatProperties = cast( PFN_vkGetPhysicalDeviceImageFormatProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties" );
vkGetPhysicalDeviceProperties = cast( PFN_vkGetPhysicalDeviceProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties" );
vkGetPhysicalDeviceQueueFamilyProperties = cast( PFN_vkGetPhysicalDeviceQueueFamilyProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties" );
vkGetPhysicalDeviceMemoryProperties = cast( PFN_vkGetPhysicalDeviceMemoryProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties" );
vkGetDeviceProcAddr = cast( PFN_vkGetDeviceProcAddr ) vkGetInstanceProcAddr( instance, "vkGetDeviceProcAddr" );
vkCreateDevice = cast( PFN_vkCreateDevice ) vkGetInstanceProcAddr( instance, "vkCreateDevice" );
vkEnumerateDeviceExtensionProperties = cast( PFN_vkEnumerateDeviceExtensionProperties ) vkGetInstanceProcAddr( instance, "vkEnumerateDeviceExtensionProperties" );
vkEnumerateDeviceLayerProperties = cast( PFN_vkEnumerateDeviceLayerProperties ) vkGetInstanceProcAddr( instance, "vkEnumerateDeviceLayerProperties" );
vkGetPhysicalDeviceSparseImageFormatProperties = cast( PFN_vkGetPhysicalDeviceSparseImageFormatProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties" );
// VK_VERSION_1_1
vkEnumeratePhysicalDeviceGroups = cast( PFN_vkEnumeratePhysicalDeviceGroups ) vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDeviceGroups" );
vkGetPhysicalDeviceFeatures2 = cast( PFN_vkGetPhysicalDeviceFeatures2 ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures2" );
vkGetPhysicalDeviceProperties2 = cast( PFN_vkGetPhysicalDeviceProperties2 ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties2" );
vkGetPhysicalDeviceFormatProperties2 = cast( PFN_vkGetPhysicalDeviceFormatProperties2 ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties2" );
vkGetPhysicalDeviceImageFormatProperties2 = cast( PFN_vkGetPhysicalDeviceImageFormatProperties2 ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties2" );
vkGetPhysicalDeviceQueueFamilyProperties2 = cast( PFN_vkGetPhysicalDeviceQueueFamilyProperties2 ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties2" );
vkGetPhysicalDeviceMemoryProperties2 = cast( PFN_vkGetPhysicalDeviceMemoryProperties2 ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties2" );
vkGetPhysicalDeviceSparseImageFormatProperties2 = cast( PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties2" );
vkGetPhysicalDeviceExternalBufferProperties = cast( PFN_vkGetPhysicalDeviceExternalBufferProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalBufferProperties" );
vkGetPhysicalDeviceExternalFenceProperties = cast( PFN_vkGetPhysicalDeviceExternalFenceProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalFenceProperties" );
vkGetPhysicalDeviceExternalSemaphoreProperties = cast( PFN_vkGetPhysicalDeviceExternalSemaphoreProperties ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalSemaphoreProperties" );
// VK_KHR_surface
vkDestroySurfaceKHR = cast( PFN_vkDestroySurfaceKHR ) vkGetInstanceProcAddr( instance, "vkDestroySurfaceKHR" );
vkGetPhysicalDeviceSurfaceSupportKHR = cast( PFN_vkGetPhysicalDeviceSurfaceSupportKHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceSupportKHR" );
vkGetPhysicalDeviceSurfaceCapabilitiesKHR = cast( PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR" );
vkGetPhysicalDeviceSurfaceFormatsKHR = cast( PFN_vkGetPhysicalDeviceSurfaceFormatsKHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceFormatsKHR" );
vkGetPhysicalDeviceSurfacePresentModesKHR = cast( PFN_vkGetPhysicalDeviceSurfacePresentModesKHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfacePresentModesKHR" );
// VK_KHR_swapchain
vkGetPhysicalDevicePresentRectanglesKHR = cast( PFN_vkGetPhysicalDevicePresentRectanglesKHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDevicePresentRectanglesKHR" );
// VK_KHR_display
vkGetPhysicalDeviceDisplayPropertiesKHR = cast( PFN_vkGetPhysicalDeviceDisplayPropertiesKHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPropertiesKHR" );
vkGetPhysicalDeviceDisplayPlanePropertiesKHR = cast( PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR" );
vkGetDisplayPlaneSupportedDisplaysKHR = cast( PFN_vkGetDisplayPlaneSupportedDisplaysKHR ) vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneSupportedDisplaysKHR" );
vkGetDisplayModePropertiesKHR = cast( PFN_vkGetDisplayModePropertiesKHR ) vkGetInstanceProcAddr( instance, "vkGetDisplayModePropertiesKHR" );
vkCreateDisplayModeKHR = cast( PFN_vkCreateDisplayModeKHR ) vkGetInstanceProcAddr( instance, "vkCreateDisplayModeKHR" );
vkGetDisplayPlaneCapabilitiesKHR = cast( PFN_vkGetDisplayPlaneCapabilitiesKHR ) vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneCapabilitiesKHR" );
vkCreateDisplayPlaneSurfaceKHR = cast( PFN_vkCreateDisplayPlaneSurfaceKHR ) vkGetInstanceProcAddr( instance, "vkCreateDisplayPlaneSurfaceKHR" );
// VK_KHR_get_surface_capabilities2
vkGetPhysicalDeviceSurfaceCapabilities2KHR = cast( PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR" );
vkGetPhysicalDeviceSurfaceFormats2KHR = cast( PFN_vkGetPhysicalDeviceSurfaceFormats2KHR ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceFormats2KHR" );
// VK_EXT_debug_report
vkCreateDebugReportCallbackEXT = cast( PFN_vkCreateDebugReportCallbackEXT ) vkGetInstanceProcAddr( instance, "vkCreateDebugReportCallbackEXT" );
vkDestroyDebugReportCallbackEXT = cast( PFN_vkDestroyDebugReportCallbackEXT ) vkGetInstanceProcAddr( instance, "vkDestroyDebugReportCallbackEXT" );
vkDebugReportMessageEXT = cast( PFN_vkDebugReportMessageEXT ) vkGetInstanceProcAddr( instance, "vkDebugReportMessageEXT" );
// VK_NV_external_memory_capabilities
vkGetPhysicalDeviceExternalImageFormatPropertiesNV = cast( PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV" );
// VK_NVX_device_generated_commands
vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = cast( PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX" );
// VK_EXT_direct_mode_display
vkReleaseDisplayEXT = cast( PFN_vkReleaseDisplayEXT ) vkGetInstanceProcAddr( instance, "vkReleaseDisplayEXT" );
// VK_EXT_display_surface_counter
vkGetPhysicalDeviceSurfaceCapabilities2EXT = cast( PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilities2EXT" );
// VK_EXT_debug_utils
vkCreateDebugUtilsMessengerEXT = cast( PFN_vkCreateDebugUtilsMessengerEXT ) vkGetInstanceProcAddr( instance, "vkCreateDebugUtilsMessengerEXT" );
vkDestroyDebugUtilsMessengerEXT = cast( PFN_vkDestroyDebugUtilsMessengerEXT ) vkGetInstanceProcAddr( instance, "vkDestroyDebugUtilsMessengerEXT" );
vkSubmitDebugUtilsMessageEXT = cast( PFN_vkSubmitDebugUtilsMessageEXT ) vkGetInstanceProcAddr( instance, "vkSubmitDebugUtilsMessageEXT" );
// VK_EXT_sample_locations
vkGetPhysicalDeviceMultisamplePropertiesEXT = cast( PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT ) vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMultisamplePropertiesEXT" );
}
/// with a valid VkInstance call this function to retrieve VkDevice, VkQueue and VkCommandBuffer related functions
/// the functions call indirectly through the VkInstance and will be internally dispatched by the implementation
/// use loadDeviceLevelFunctions( VkDevice device ) bellow to avoid this indirection and get the pointers directly form a VkDevice
void loadDeviceLevelFunctions( VkInstance instance ) {
assert( vkGetInstanceProcAddr !is null, "Function pointer vkGetInstanceProcAddr is null!\nCall loadGlobalLevelFunctions -> loadDeviceLevelFunctions( instance )" );
// VK_VERSION_1_0
vkDestroyDevice = cast( PFN_vkDestroyDevice ) vkGetInstanceProcAddr( instance, "vkDestroyDevice" );
vkGetDeviceQueue = cast( PFN_vkGetDeviceQueue ) vkGetInstanceProcAddr( instance, "vkGetDeviceQueue" );
vkQueueSubmit = cast( PFN_vkQueueSubmit ) vkGetInstanceProcAddr( instance, "vkQueueSubmit" );
vkQueueWaitIdle = cast( PFN_vkQueueWaitIdle ) vkGetInstanceProcAddr( instance, "vkQueueWaitIdle" );
vkDeviceWaitIdle = cast( PFN_vkDeviceWaitIdle ) vkGetInstanceProcAddr( instance, "vkDeviceWaitIdle" );
vkAllocateMemory = cast( PFN_vkAllocateMemory ) vkGetInstanceProcAddr( instance, "vkAllocateMemory" );
vkFreeMemory = cast( PFN_vkFreeMemory ) vkGetInstanceProcAddr( instance, "vkFreeMemory" );
vkMapMemory = cast( PFN_vkMapMemory ) vkGetInstanceProcAddr( instance, "vkMapMemory" );
vkUnmapMemory = cast( PFN_vkUnmapMemory ) vkGetInstanceProcAddr( instance, "vkUnmapMemory" );
vkFlushMappedMemoryRanges = cast( PFN_vkFlushMappedMemoryRanges ) vkGetInstanceProcAddr( instance, "vkFlushMappedMemoryRanges" );
vkInvalidateMappedMemoryRanges = cast( PFN_vkInvalidateMappedMemoryRanges ) vkGetInstanceProcAddr( instance, "vkInvalidateMappedMemoryRanges" );
vkGetDeviceMemoryCommitment = cast( PFN_vkGetDeviceMemoryCommitment ) vkGetInstanceProcAddr( instance, "vkGetDeviceMemoryCommitment" );
vkBindBufferMemory = cast( PFN_vkBindBufferMemory ) vkGetInstanceProcAddr( instance, "vkBindBufferMemory" );
vkBindImageMemory = cast( PFN_vkBindImageMemory ) vkGetInstanceProcAddr( instance, "vkBindImageMemory" );
vkGetBufferMemoryRequirements = cast( PFN_vkGetBufferMemoryRequirements ) vkGetInstanceProcAddr( instance, "vkGetBufferMemoryRequirements" );
vkGetImageMemoryRequirements = cast( PFN_vkGetImageMemoryRequirements ) vkGetInstanceProcAddr( instance, "vkGetImageMemoryRequirements" );
vkGetImageSparseMemoryRequirements = cast( PFN_vkGetImageSparseMemoryRequirements ) vkGetInstanceProcAddr( instance, "vkGetImageSparseMemoryRequirements" );
vkQueueBindSparse = cast( PFN_vkQueueBindSparse ) vkGetInstanceProcAddr( instance, "vkQueueBindSparse" );
vkCreateFence = cast( PFN_vkCreateFence ) vkGetInstanceProcAddr( instance, "vkCreateFence" );
vkDestroyFence = cast( PFN_vkDestroyFence ) vkGetInstanceProcAddr( instance, "vkDestroyFence" );
vkResetFences = cast( PFN_vkResetFences ) vkGetInstanceProcAddr( instance, "vkResetFences" );
vkGetFenceStatus = cast( PFN_vkGetFenceStatus ) vkGetInstanceProcAddr( instance, "vkGetFenceStatus" );
vkWaitForFences = cast( PFN_vkWaitForFences ) vkGetInstanceProcAddr( instance, "vkWaitForFences" );
vkCreateSemaphore = cast( PFN_vkCreateSemaphore ) vkGetInstanceProcAddr( instance, "vkCreateSemaphore" );
vkDestroySemaphore = cast( PFN_vkDestroySemaphore ) vkGetInstanceProcAddr( instance, "vkDestroySemaphore" );
vkCreateEvent = cast( PFN_vkCreateEvent ) vkGetInstanceProcAddr( instance, "vkCreateEvent" );
vkDestroyEvent = cast( PFN_vkDestroyEvent ) vkGetInstanceProcAddr( instance, "vkDestroyEvent" );
vkGetEventStatus = cast( PFN_vkGetEventStatus ) vkGetInstanceProcAddr( instance, "vkGetEventStatus" );
vkSetEvent = cast( PFN_vkSetEvent ) vkGetInstanceProcAddr( instance, "vkSetEvent" );
vkResetEvent = cast( PFN_vkResetEvent ) vkGetInstanceProcAddr( instance, "vkResetEvent" );
vkCreateQueryPool = cast( PFN_vkCreateQueryPool ) vkGetInstanceProcAddr( instance, "vkCreateQueryPool" );
vkDestroyQueryPool = cast( PFN_vkDestroyQueryPool ) vkGetInstanceProcAddr( instance, "vkDestroyQueryPool" );
vkGetQueryPoolResults = cast( PFN_vkGetQueryPoolResults ) vkGetInstanceProcAddr( instance, "vkGetQueryPoolResults" );
vkCreateBuffer = cast( PFN_vkCreateBuffer ) vkGetInstanceProcAddr( instance, "vkCreateBuffer" );
vkDestroyBuffer = cast( PFN_vkDestroyBuffer ) vkGetInstanceProcAddr( instance, "vkDestroyBuffer" );
vkCreateBufferView = cast( PFN_vkCreateBufferView ) vkGetInstanceProcAddr( instance, "vkCreateBufferView" );
vkDestroyBufferView = cast( PFN_vkDestroyBufferView ) vkGetInstanceProcAddr( instance, "vkDestroyBufferView" );
vkCreateImage = cast( PFN_vkCreateImage ) vkGetInstanceProcAddr( instance, "vkCreateImage" );
vkDestroyImage = cast( PFN_vkDestroyImage ) vkGetInstanceProcAddr( instance, "vkDestroyImage" );
vkGetImageSubresourceLayout = cast( PFN_vkGetImageSubresourceLayout ) vkGetInstanceProcAddr( instance, "vkGetImageSubresourceLayout" );
vkCreateImageView = cast( PFN_vkCreateImageView ) vkGetInstanceProcAddr( instance, "vkCreateImageView" );
vkDestroyImageView = cast( PFN_vkDestroyImageView ) vkGetInstanceProcAddr( instance, "vkDestroyImageView" );
vkCreateShaderModule = cast( PFN_vkCreateShaderModule ) vkGetInstanceProcAddr( instance, "vkCreateShaderModule" );
vkDestroyShaderModule = cast( PFN_vkDestroyShaderModule ) vkGetInstanceProcAddr( instance, "vkDestroyShaderModule" );
vkCreatePipelineCache = cast( PFN_vkCreatePipelineCache ) vkGetInstanceProcAddr( instance, "vkCreatePipelineCache" );
vkDestroyPipelineCache = cast( PFN_vkDestroyPipelineCache ) vkGetInstanceProcAddr( instance, "vkDestroyPipelineCache" );
vkGetPipelineCacheData = cast( PFN_vkGetPipelineCacheData ) vkGetInstanceProcAddr( instance, "vkGetPipelineCacheData" );
vkMergePipelineCaches = cast( PFN_vkMergePipelineCaches ) vkGetInstanceProcAddr( instance, "vkMergePipelineCaches" );
vkCreateGraphicsPipelines = cast( PFN_vkCreateGraphicsPipelines ) vkGetInstanceProcAddr( instance, "vkCreateGraphicsPipelines" );
vkCreateComputePipelines = cast( PFN_vkCreateComputePipelines ) vkGetInstanceProcAddr( instance, "vkCreateComputePipelines" );
vkDestroyPipeline = cast( PFN_vkDestroyPipeline ) vkGetInstanceProcAddr( instance, "vkDestroyPipeline" );
vkCreatePipelineLayout = cast( PFN_vkCreatePipelineLayout ) vkGetInstanceProcAddr( instance, "vkCreatePipelineLayout" );
vkDestroyPipelineLayout = cast( PFN_vkDestroyPipelineLayout ) vkGetInstanceProcAddr( instance, "vkDestroyPipelineLayout" );
vkCreateSampler = cast( PFN_vkCreateSampler ) vkGetInstanceProcAddr( instance, "vkCreateSampler" );
vkDestroySampler = cast( PFN_vkDestroySampler ) vkGetInstanceProcAddr( instance, "vkDestroySampler" );
vkCreateDescriptorSetLayout = cast( PFN_vkCreateDescriptorSetLayout ) vkGetInstanceProcAddr( instance, "vkCreateDescriptorSetLayout" );
vkDestroyDescriptorSetLayout = cast( PFN_vkDestroyDescriptorSetLayout ) vkGetInstanceProcAddr( instance, "vkDestroyDescriptorSetLayout" );
vkCreateDescriptorPool = cast( PFN_vkCreateDescriptorPool ) vkGetInstanceProcAddr( instance, "vkCreateDescriptorPool" );
vkDestroyDescriptorPool = cast( PFN_vkDestroyDescriptorPool ) vkGetInstanceProcAddr( instance, "vkDestroyDescriptorPool" );
vkResetDescriptorPool = cast( PFN_vkResetDescriptorPool ) vkGetInstanceProcAddr( instance, "vkResetDescriptorPool" );
vkAllocateDescriptorSets = cast( PFN_vkAllocateDescriptorSets ) vkGetInstanceProcAddr( instance, "vkAllocateDescriptorSets" );
vkFreeDescriptorSets = cast( PFN_vkFreeDescriptorSets ) vkGetInstanceProcAddr( instance, "vkFreeDescriptorSets" );
vkUpdateDescriptorSets = cast( PFN_vkUpdateDescriptorSets ) vkGetInstanceProcAddr( instance, "vkUpdateDescriptorSets" );
vkCreateFramebuffer = cast( PFN_vkCreateFramebuffer ) vkGetInstanceProcAddr( instance, "vkCreateFramebuffer" );
vkDestroyFramebuffer = cast( PFN_vkDestroyFramebuffer ) vkGetInstanceProcAddr( instance, "vkDestroyFramebuffer" );
vkCreateRenderPass = cast( PFN_vkCreateRenderPass ) vkGetInstanceProcAddr( instance, "vkCreateRenderPass" );
vkDestroyRenderPass = cast( PFN_vkDestroyRenderPass ) vkGetInstanceProcAddr( instance, "vkDestroyRenderPass" );
vkGetRenderAreaGranularity = cast( PFN_vkGetRenderAreaGranularity ) vkGetInstanceProcAddr( instance, "vkGetRenderAreaGranularity" );
vkCreateCommandPool = cast( PFN_vkCreateCommandPool ) vkGetInstanceProcAddr( instance, "vkCreateCommandPool" );
vkDestroyCommandPool = cast( PFN_vkDestroyCommandPool ) vkGetInstanceProcAddr( instance, "vkDestroyCommandPool" );
vkResetCommandPool = cast( PFN_vkResetCommandPool ) vkGetInstanceProcAddr( instance, "vkResetCommandPool" );
vkAllocateCommandBuffers = cast( PFN_vkAllocateCommandBuffers ) vkGetInstanceProcAddr( instance, "vkAllocateCommandBuffers" );
vkFreeCommandBuffers = cast( PFN_vkFreeCommandBuffers ) vkGetInstanceProcAddr( instance, "vkFreeCommandBuffers" );
vkBeginCommandBuffer = cast( PFN_vkBeginCommandBuffer ) vkGetInstanceProcAddr( instance, "vkBeginCommandBuffer" );
vkEndCommandBuffer = cast( PFN_vkEndCommandBuffer ) vkGetInstanceProcAddr( instance, "vkEndCommandBuffer" );
vkResetCommandBuffer = cast( PFN_vkResetCommandBuffer ) vkGetInstanceProcAddr( instance, "vkResetCommandBuffer" );
vkCmdBindPipeline = cast( PFN_vkCmdBindPipeline ) vkGetInstanceProcAddr( instance, "vkCmdBindPipeline" );
vkCmdSetViewport = cast( PFN_vkCmdSetViewport ) vkGetInstanceProcAddr( instance, "vkCmdSetViewport" );
vkCmdSetScissor = cast( PFN_vkCmdSetScissor ) vkGetInstanceProcAddr( instance, "vkCmdSetScissor" );
vkCmdSetLineWidth = cast( PFN_vkCmdSetLineWidth ) vkGetInstanceProcAddr( instance, "vkCmdSetLineWidth" );
vkCmdSetDepthBias = cast( PFN_vkCmdSetDepthBias ) vkGetInstanceProcAddr( instance, "vkCmdSetDepthBias" );
vkCmdSetBlendConstants = cast( PFN_vkCmdSetBlendConstants ) vkGetInstanceProcAddr( instance, "vkCmdSetBlendConstants" );
vkCmdSetDepthBounds = cast( PFN_vkCmdSetDepthBounds ) vkGetInstanceProcAddr( instance, "vkCmdSetDepthBounds" );
vkCmdSetStencilCompareMask = cast( PFN_vkCmdSetStencilCompareMask ) vkGetInstanceProcAddr( instance, "vkCmdSetStencilCompareMask" );
vkCmdSetStencilWriteMask = cast( PFN_vkCmdSetStencilWriteMask ) vkGetInstanceProcAddr( instance, "vkCmdSetStencilWriteMask" );
vkCmdSetStencilReference = cast( PFN_vkCmdSetStencilReference ) vkGetInstanceProcAddr( instance, "vkCmdSetStencilReference" );
vkCmdBindDescriptorSets = cast( PFN_vkCmdBindDescriptorSets ) vkGetInstanceProcAddr( instance, "vkCmdBindDescriptorSets" );
vkCmdBindIndexBuffer = cast( PFN_vkCmdBindIndexBuffer ) vkGetInstanceProcAddr( instance, "vkCmdBindIndexBuffer" );
vkCmdBindVertexBuffers = cast( PFN_vkCmdBindVertexBuffers ) vkGetInstanceProcAddr( instance, "vkCmdBindVertexBuffers" );
vkCmdDraw = cast( PFN_vkCmdDraw ) vkGetInstanceProcAddr( instance, "vkCmdDraw" );
vkCmdDrawIndexed = cast( PFN_vkCmdDrawIndexed ) vkGetInstanceProcAddr( instance, "vkCmdDrawIndexed" );
vkCmdDrawIndirect = cast( PFN_vkCmdDrawIndirect ) vkGetInstanceProcAddr( instance, "vkCmdDrawIndirect" );
vkCmdDrawIndexedIndirect = cast( PFN_vkCmdDrawIndexedIndirect ) vkGetInstanceProcAddr( instance, "vkCmdDrawIndexedIndirect" );
vkCmdDispatch = cast( PFN_vkCmdDispatch ) vkGetInstanceProcAddr( instance, "vkCmdDispatch" );
vkCmdDispatchIndirect = cast( PFN_vkCmdDispatchIndirect ) vkGetInstanceProcAddr( instance, "vkCmdDispatchIndirect" );
vkCmdCopyBuffer = cast( PFN_vkCmdCopyBuffer ) vkGetInstanceProcAddr( instance, "vkCmdCopyBuffer" );
vkCmdCopyImage = cast( PFN_vkCmdCopyImage ) vkGetInstanceProcAddr( instance, "vkCmdCopyImage" );
vkCmdBlitImage = cast( PFN_vkCmdBlitImage ) vkGetInstanceProcAddr( instance, "vkCmdBlitImage" );
vkCmdCopyBufferToImage = cast( PFN_vkCmdCopyBufferToImage ) vkGetInstanceProcAddr( instance, "vkCmdCopyBufferToImage" );
vkCmdCopyImageToBuffer = cast( PFN_vkCmdCopyImageToBuffer ) vkGetInstanceProcAddr( instance, "vkCmdCopyImageToBuffer" );
vkCmdUpdateBuffer = cast( PFN_vkCmdUpdateBuffer ) vkGetInstanceProcAddr( instance, "vkCmdUpdateBuffer" );
vkCmdFillBuffer = cast( PFN_vkCmdFillBuffer ) vkGetInstanceProcAddr( instance, "vkCmdFillBuffer" );
vkCmdClearColorImage = cast( PFN_vkCmdClearColorImage ) vkGetInstanceProcAddr( instance, "vkCmdClearColorImage" );
vkCmdClearDepthStencilImage = cast( PFN_vkCmdClearDepthStencilImage ) vkGetInstanceProcAddr( instance, "vkCmdClearDepthStencilImage" );
vkCmdClearAttachments = cast( PFN_vkCmdClearAttachments ) vkGetInstanceProcAddr( instance, "vkCmdClearAttachments" );
vkCmdResolveImage = cast( PFN_vkCmdResolveImage ) vkGetInstanceProcAddr( instance, "vkCmdResolveImage" );
vkCmdSetEvent = cast( PFN_vkCmdSetEvent ) vkGetInstanceProcAddr( instance, "vkCmdSetEvent" );
vkCmdResetEvent = cast( PFN_vkCmdResetEvent ) vkGetInstanceProcAddr( instance, "vkCmdResetEvent" );
vkCmdWaitEvents = cast( PFN_vkCmdWaitEvents ) vkGetInstanceProcAddr( instance, "vkCmdWaitEvents" );
vkCmdPipelineBarrier = cast( PFN_vkCmdPipelineBarrier ) vkGetInstanceProcAddr( instance, "vkCmdPipelineBarrier" );
vkCmdBeginQuery = cast( PFN_vkCmdBeginQuery ) vkGetInstanceProcAddr( instance, "vkCmdBeginQuery" );
vkCmdEndQuery = cast( PFN_vkCmdEndQuery ) vkGetInstanceProcAddr( instance, "vkCmdEndQuery" );
vkCmdResetQueryPool = cast( PFN_vkCmdResetQueryPool ) vkGetInstanceProcAddr( instance, "vkCmdResetQueryPool" );
vkCmdWriteTimestamp = cast( PFN_vkCmdWriteTimestamp ) vkGetInstanceProcAddr( instance, "vkCmdWriteTimestamp" );
vkCmdCopyQueryPoolResults = cast( PFN_vkCmdCopyQueryPoolResults ) vkGetInstanceProcAddr( instance, "vkCmdCopyQueryPoolResults" );
vkCmdPushConstants = cast( PFN_vkCmdPushConstants ) vkGetInstanceProcAddr( instance, "vkCmdPushConstants" );
vkCmdBeginRenderPass = cast( PFN_vkCmdBeginRenderPass ) vkGetInstanceProcAddr( instance, "vkCmdBeginRenderPass" );
vkCmdNextSubpass = cast( PFN_vkCmdNextSubpass ) vkGetInstanceProcAddr( instance, "vkCmdNextSubpass" );
vkCmdEndRenderPass = cast( PFN_vkCmdEndRenderPass ) vkGetInstanceProcAddr( instance, "vkCmdEndRenderPass" );
vkCmdExecuteCommands = cast( PFN_vkCmdExecuteCommands ) vkGetInstanceProcAddr( instance, "vkCmdExecuteCommands" );
// VK_VERSION_1_1
vkBindBufferMemory2 = cast( PFN_vkBindBufferMemory2 ) vkGetInstanceProcAddr( instance, "vkBindBufferMemory2" );
vkBindImageMemory2 = cast( PFN_vkBindImageMemory2 ) vkGetInstanceProcAddr( instance, "vkBindImageMemory2" );
vkGetDeviceGroupPeerMemoryFeatures = cast( PFN_vkGetDeviceGroupPeerMemoryFeatures ) vkGetInstanceProcAddr( instance, "vkGetDeviceGroupPeerMemoryFeatures" );
vkCmdSetDeviceMask = cast( PFN_vkCmdSetDeviceMask ) vkGetInstanceProcAddr( instance, "vkCmdSetDeviceMask" );
vkCmdDispatchBase = cast( PFN_vkCmdDispatchBase ) vkGetInstanceProcAddr( instance, "vkCmdDispatchBase" );
vkGetImageMemoryRequirements2 = cast( PFN_vkGetImageMemoryRequirements2 ) vkGetInstanceProcAddr( instance, "vkGetImageMemoryRequirements2" );
vkGetBufferMemoryRequirements2 = cast( PFN_vkGetBufferMemoryRequirements2 ) vkGetInstanceProcAddr( instance, "vkGetBufferMemoryRequirements2" );
vkGetImageSparseMemoryRequirements2 = cast( PFN_vkGetImageSparseMemoryRequirements2 ) vkGetInstanceProcAddr( instance, "vkGetImageSparseMemoryRequirements2" );
vkTrimCommandPool = cast( PFN_vkTrimCommandPool ) vkGetInstanceProcAddr( instance, "vkTrimCommandPool" );
vkGetDeviceQueue2 = cast( PFN_vkGetDeviceQueue2 ) vkGetInstanceProcAddr( instance, "vkGetDeviceQueue2" );
vkCreateSamplerYcbcrConversion = cast( PFN_vkCreateSamplerYcbcrConversion ) vkGetInstanceProcAddr( instance, "vkCreateSamplerYcbcrConversion" );
vkDestroySamplerYcbcrConversion = cast( PFN_vkDestroySamplerYcbcrConversion ) vkGetInstanceProcAddr( instance, "vkDestroySamplerYcbcrConversion" );
vkCreateDescriptorUpdateTemplate = cast( PFN_vkCreateDescriptorUpdateTemplate ) vkGetInstanceProcAddr( instance, "vkCreateDescriptorUpdateTemplate" );
vkDestroyDescriptorUpdateTemplate = cast( PFN_vkDestroyDescriptorUpdateTemplate ) vkGetInstanceProcAddr( instance, "vkDestroyDescriptorUpdateTemplate" );
vkUpdateDescriptorSetWithTemplate = cast( PFN_vkUpdateDescriptorSetWithTemplate ) vkGetInstanceProcAddr( instance, "vkUpdateDescriptorSetWithTemplate" );
vkGetDescriptorSetLayoutSupport = cast( PFN_vkGetDescriptorSetLayoutSupport ) vkGetInstanceProcAddr( instance, "vkGetDescriptorSetLayoutSupport" );
// VK_KHR_swapchain
vkCreateSwapchainKHR = cast( PFN_vkCreateSwapchainKHR ) vkGetInstanceProcAddr( instance, "vkCreateSwapchainKHR" );
vkDestroySwapchainKHR = cast( PFN_vkDestroySwapchainKHR ) vkGetInstanceProcAddr( instance, "vkDestroySwapchainKHR" );
vkGetSwapchainImagesKHR = cast( PFN_vkGetSwapchainImagesKHR ) vkGetInstanceProcAddr( instance, "vkGetSwapchainImagesKHR" );
vkAcquireNextImageKHR = cast( PFN_vkAcquireNextImageKHR ) vkGetInstanceProcAddr( instance, "vkAcquireNextImageKHR" );
vkQueuePresentKHR = cast( PFN_vkQueuePresentKHR ) vkGetInstanceProcAddr( instance, "vkQueuePresentKHR" );
vkGetDeviceGroupPresentCapabilitiesKHR = cast( PFN_vkGetDeviceGroupPresentCapabilitiesKHR ) vkGetInstanceProcAddr( instance, "vkGetDeviceGroupPresentCapabilitiesKHR" );
vkGetDeviceGroupSurfacePresentModesKHR = cast( PFN_vkGetDeviceGroupSurfacePresentModesKHR ) vkGetInstanceProcAddr( instance, "vkGetDeviceGroupSurfacePresentModesKHR" );
vkAcquireNextImage2KHR = cast( PFN_vkAcquireNextImage2KHR ) vkGetInstanceProcAddr( instance, "vkAcquireNextImage2KHR" );
// VK_KHR_display_swapchain
vkCreateSharedSwapchainsKHR = cast( PFN_vkCreateSharedSwapchainsKHR ) vkGetInstanceProcAddr( instance, "vkCreateSharedSwapchainsKHR" );
// VK_KHR_external_memory_fd
vkGetMemoryFdKHR = cast( PFN_vkGetMemoryFdKHR ) vkGetInstanceProcAddr( instance, "vkGetMemoryFdKHR" );
vkGetMemoryFdPropertiesKHR = cast( PFN_vkGetMemoryFdPropertiesKHR ) vkGetInstanceProcAddr( instance, "vkGetMemoryFdPropertiesKHR" );
// VK_KHR_external_semaphore_fd
vkImportSemaphoreFdKHR = cast( PFN_vkImportSemaphoreFdKHR ) vkGetInstanceProcAddr( instance, "vkImportSemaphoreFdKHR" );
vkGetSemaphoreFdKHR = cast( PFN_vkGetSemaphoreFdKHR ) vkGetInstanceProcAddr( instance, "vkGetSemaphoreFdKHR" );
// VK_KHR_push_descriptor
vkCmdPushDescriptorSetKHR = cast( PFN_vkCmdPushDescriptorSetKHR ) vkGetInstanceProcAddr( instance, "vkCmdPushDescriptorSetKHR" );
vkCmdPushDescriptorSetWithTemplateKHR = cast( PFN_vkCmdPushDescriptorSetWithTemplateKHR ) vkGetInstanceProcAddr( instance, "vkCmdPushDescriptorSetWithTemplateKHR" );
// VK_KHR_shared_presentable_image
vkGetSwapchainStatusKHR = cast( PFN_vkGetSwapchainStatusKHR ) vkGetInstanceProcAddr( instance, "vkGetSwapchainStatusKHR" );
// VK_KHR_external_fence_fd
vkImportFenceFdKHR = cast( PFN_vkImportFenceFdKHR ) vkGetInstanceProcAddr( instance, "vkImportFenceFdKHR" );
vkGetFenceFdKHR = cast( PFN_vkGetFenceFdKHR ) vkGetInstanceProcAddr( instance, "vkGetFenceFdKHR" );
// VK_EXT_debug_marker
vkDebugMarkerSetObjectTagEXT = cast( PFN_vkDebugMarkerSetObjectTagEXT ) vkGetInstanceProcAddr( instance, "vkDebugMarkerSetObjectTagEXT" );
vkDebugMarkerSetObjectNameEXT = cast( PFN_vkDebugMarkerSetObjectNameEXT ) vkGetInstanceProcAddr( instance, "vkDebugMarkerSetObjectNameEXT" );
vkCmdDebugMarkerBeginEXT = cast( PFN_vkCmdDebugMarkerBeginEXT ) vkGetInstanceProcAddr( instance, "vkCmdDebugMarkerBeginEXT" );
vkCmdDebugMarkerEndEXT = cast( PFN_vkCmdDebugMarkerEndEXT ) vkGetInstanceProcAddr( instance, "vkCmdDebugMarkerEndEXT" );
vkCmdDebugMarkerInsertEXT = cast( PFN_vkCmdDebugMarkerInsertEXT ) vkGetInstanceProcAddr( instance, "vkCmdDebugMarkerInsertEXT" );
// VK_AMD_draw_indirect_count
vkCmdDrawIndirectCountAMD = cast( PFN_vkCmdDrawIndirectCountAMD ) vkGetInstanceProcAddr( instance, "vkCmdDrawIndirectCountAMD" );
vkCmdDrawIndexedIndirectCountAMD = cast( PFN_vkCmdDrawIndexedIndirectCountAMD ) vkGetInstanceProcAddr( instance, "vkCmdDrawIndexedIndirectCountAMD" );
// VK_AMD_shader_info
vkGetShaderInfoAMD = cast( PFN_vkGetShaderInfoAMD ) vkGetInstanceProcAddr( instance, "vkGetShaderInfoAMD" );
// VK_NVX_device_generated_commands
vkCmdProcessCommandsNVX = cast( PFN_vkCmdProcessCommandsNVX ) vkGetInstanceProcAddr( instance, "vkCmdProcessCommandsNVX" );
vkCmdReserveSpaceForCommandsNVX = cast( PFN_vkCmdReserveSpaceForCommandsNVX ) vkGetInstanceProcAddr( instance, "vkCmdReserveSpaceForCommandsNVX" );
vkCreateIndirectCommandsLayoutNVX = cast( PFN_vkCreateIndirectCommandsLayoutNVX ) vkGetInstanceProcAddr( instance, "vkCreateIndirectCommandsLayoutNVX" );
vkDestroyIndirectCommandsLayoutNVX = cast( PFN_vkDestroyIndirectCommandsLayoutNVX ) vkGetInstanceProcAddr( instance, "vkDestroyIndirectCommandsLayoutNVX" );
vkCreateObjectTableNVX = cast( PFN_vkCreateObjectTableNVX ) vkGetInstanceProcAddr( instance, "vkCreateObjectTableNVX" );
vkDestroyObjectTableNVX = cast( PFN_vkDestroyObjectTableNVX ) vkGetInstanceProcAddr( instance, "vkDestroyObjectTableNVX" );
vkRegisterObjectsNVX = cast( PFN_vkRegisterObjectsNVX ) vkGetInstanceProcAddr( instance, "vkRegisterObjectsNVX" );
vkUnregisterObjectsNVX = cast( PFN_vkUnregisterObjectsNVX ) vkGetInstanceProcAddr( instance, "vkUnregisterObjectsNVX" );
// VK_NV_clip_space_w_scaling
vkCmdSetViewportWScalingNV = cast( PFN_vkCmdSetViewportWScalingNV ) vkGetInstanceProcAddr( instance, "vkCmdSetViewportWScalingNV" );
// VK_EXT_display_control
vkDisplayPowerControlEXT = cast( PFN_vkDisplayPowerControlEXT ) vkGetInstanceProcAddr( instance, "vkDisplayPowerControlEXT" );
vkRegisterDeviceEventEXT = cast( PFN_vkRegisterDeviceEventEXT ) vkGetInstanceProcAddr( instance, "vkRegisterDeviceEventEXT" );
vkRegisterDisplayEventEXT = cast( PFN_vkRegisterDisplayEventEXT ) vkGetInstanceProcAddr( instance, "vkRegisterDisplayEventEXT" );
vkGetSwapchainCounterEXT = cast( PFN_vkGetSwapchainCounterEXT ) vkGetInstanceProcAddr( instance, "vkGetSwapchainCounterEXT" );
// VK_GOOGLE_display_timing
vkGetRefreshCycleDurationGOOGLE = cast( PFN_vkGetRefreshCycleDurationGOOGLE ) vkGetInstanceProcAddr( instance, "vkGetRefreshCycleDurationGOOGLE" );
vkGetPastPresentationTimingGOOGLE = cast( PFN_vkGetPastPresentationTimingGOOGLE ) vkGetInstanceProcAddr( instance, "vkGetPastPresentationTimingGOOGLE" );
// VK_EXT_discard_rectangles
vkCmdSetDiscardRectangleEXT = cast( PFN_vkCmdSetDiscardRectangleEXT ) vkGetInstanceProcAddr( instance, "vkCmdSetDiscardRectangleEXT" );
// VK_EXT_hdr_metadata
vkSetHdrMetadataEXT = cast( PFN_vkSetHdrMetadataEXT ) vkGetInstanceProcAddr( instance, "vkSetHdrMetadataEXT" );
// VK_EXT_debug_utils
vkSetDebugUtilsObjectNameEXT = cast( PFN_vkSetDebugUtilsObjectNameEXT ) vkGetInstanceProcAddr( instance, "vkSetDebugUtilsObjectNameEXT" );
vkSetDebugUtilsObjectTagEXT = cast( PFN_vkSetDebugUtilsObjectTagEXT ) vkGetInstanceProcAddr( instance, "vkSetDebugUtilsObjectTagEXT" );
vkQueueBeginDebugUtilsLabelEXT = cast( PFN_vkQueueBeginDebugUtilsLabelEXT ) vkGetInstanceProcAddr( instance, "vkQueueBeginDebugUtilsLabelEXT" );
vkQueueEndDebugUtilsLabelEXT = cast( PFN_vkQueueEndDebugUtilsLabelEXT ) vkGetInstanceProcAddr( instance, "vkQueueEndDebugUtilsLabelEXT" );
vkQueueInsertDebugUtilsLabelEXT = cast( PFN_vkQueueInsertDebugUtilsLabelEXT ) vkGetInstanceProcAddr( instance, "vkQueueInsertDebugUtilsLabelEXT" );
vkCmdBeginDebugUtilsLabelEXT = cast( PFN_vkCmdBeginDebugUtilsLabelEXT ) vkGetInstanceProcAddr( instance, "vkCmdBeginDebugUtilsLabelEXT" );
vkCmdEndDebugUtilsLabelEXT = cast( PFN_vkCmdEndDebugUtilsLabelEXT ) vkGetInstanceProcAddr( instance, "vkCmdEndDebugUtilsLabelEXT" );
vkCmdInsertDebugUtilsLabelEXT = cast( PFN_vkCmdInsertDebugUtilsLabelEXT ) vkGetInstanceProcAddr( instance, "vkCmdInsertDebugUtilsLabelEXT" );
// VK_EXT_sample_locations
vkCmdSetSampleLocationsEXT = cast( PFN_vkCmdSetSampleLocationsEXT ) vkGetInstanceProcAddr( instance, "vkCmdSetSampleLocationsEXT" );
// VK_EXT_validation_cache
vkCreateValidationCacheEXT = cast( PFN_vkCreateValidationCacheEXT ) vkGetInstanceProcAddr( instance, "vkCreateValidationCacheEXT" );
vkDestroyValidationCacheEXT = cast( PFN_vkDestroyValidationCacheEXT ) vkGetInstanceProcAddr( instance, "vkDestroyValidationCacheEXT" );
vkMergeValidationCachesEXT = cast( PFN_vkMergeValidationCachesEXT ) vkGetInstanceProcAddr( instance, "vkMergeValidationCachesEXT" );
vkGetValidationCacheDataEXT = cast( PFN_vkGetValidationCacheDataEXT ) vkGetInstanceProcAddr( instance, "vkGetValidationCacheDataEXT" );
// VK_EXT_external_memory_host
vkGetMemoryHostPointerPropertiesEXT = cast( PFN_vkGetMemoryHostPointerPropertiesEXT ) vkGetInstanceProcAddr( instance, "vkGetMemoryHostPointerPropertiesEXT" );
// VK_AMD_buffer_marker
vkCmdWriteBufferMarkerAMD = cast( PFN_vkCmdWriteBufferMarkerAMD ) vkGetInstanceProcAddr( instance, "vkCmdWriteBufferMarkerAMD" );
}
/// with a valid VkDevice call this function to retrieve VkDevice, VkQueue and VkCommandBuffer related functions
/// the functions call directly VkDevice and related resources and can be retrieved for one and only one VkDevice
/// calling this function again with another VkDevices will overwrite the __gshared functions retrieved previously
/// see module erupted.dispatch_device if multiple VkDevices will be used
void loadDeviceLevelFunctions( VkDevice device ) {
assert( vkGetDeviceProcAddr !is null, "Function pointer vkGetDeviceProcAddr is null!\nCall loadGlobalLevelFunctions -> loadInstanceLevelFunctions -> loadDeviceLevelFunctions( device )" );
// VK_VERSION_1_0
vkDestroyDevice = cast( PFN_vkDestroyDevice ) vkGetDeviceProcAddr( device, "vkDestroyDevice" );
vkGetDeviceQueue = cast( PFN_vkGetDeviceQueue ) vkGetDeviceProcAddr( device, "vkGetDeviceQueue" );
vkQueueSubmit = cast( PFN_vkQueueSubmit ) vkGetDeviceProcAddr( device, "vkQueueSubmit" );
vkQueueWaitIdle = cast( PFN_vkQueueWaitIdle ) vkGetDeviceProcAddr( device, "vkQueueWaitIdle" );
vkDeviceWaitIdle = cast( PFN_vkDeviceWaitIdle ) vkGetDeviceProcAddr( device, "vkDeviceWaitIdle" );
vkAllocateMemory = cast( PFN_vkAllocateMemory ) vkGetDeviceProcAddr( device, "vkAllocateMemory" );
vkFreeMemory = cast( PFN_vkFreeMemory ) vkGetDeviceProcAddr( device, "vkFreeMemory" );
vkMapMemory = cast( PFN_vkMapMemory ) vkGetDeviceProcAddr( device, "vkMapMemory" );
vkUnmapMemory = cast( PFN_vkUnmapMemory ) vkGetDeviceProcAddr( device, "vkUnmapMemory" );
vkFlushMappedMemoryRanges = cast( PFN_vkFlushMappedMemoryRanges ) vkGetDeviceProcAddr( device, "vkFlushMappedMemoryRanges" );
vkInvalidateMappedMemoryRanges = cast( PFN_vkInvalidateMappedMemoryRanges ) vkGetDeviceProcAddr( device, "vkInvalidateMappedMemoryRanges" );
vkGetDeviceMemoryCommitment = cast( PFN_vkGetDeviceMemoryCommitment ) vkGetDeviceProcAddr( device, "vkGetDeviceMemoryCommitment" );
vkBindBufferMemory = cast( PFN_vkBindBufferMemory ) vkGetDeviceProcAddr( device, "vkBindBufferMemory" );
vkBindImageMemory = cast( PFN_vkBindImageMemory ) vkGetDeviceProcAddr( device, "vkBindImageMemory" );
vkGetBufferMemoryRequirements = cast( PFN_vkGetBufferMemoryRequirements ) vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements" );
vkGetImageMemoryRequirements = cast( PFN_vkGetImageMemoryRequirements ) vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements" );
vkGetImageSparseMemoryRequirements = cast( PFN_vkGetImageSparseMemoryRequirements ) vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements" );
vkQueueBindSparse = cast( PFN_vkQueueBindSparse ) vkGetDeviceProcAddr( device, "vkQueueBindSparse" );
vkCreateFence = cast( PFN_vkCreateFence ) vkGetDeviceProcAddr( device, "vkCreateFence" );
vkDestroyFence = cast( PFN_vkDestroyFence ) vkGetDeviceProcAddr( device, "vkDestroyFence" );
vkResetFences = cast( PFN_vkResetFences ) vkGetDeviceProcAddr( device, "vkResetFences" );
vkGetFenceStatus = cast( PFN_vkGetFenceStatus ) vkGetDeviceProcAddr( device, "vkGetFenceStatus" );
vkWaitForFences = cast( PFN_vkWaitForFences ) vkGetDeviceProcAddr( device, "vkWaitForFences" );
vkCreateSemaphore = cast( PFN_vkCreateSemaphore ) vkGetDeviceProcAddr( device, "vkCreateSemaphore" );
vkDestroySemaphore = cast( PFN_vkDestroySemaphore ) vkGetDeviceProcAddr( device, "vkDestroySemaphore" );
vkCreateEvent = cast( PFN_vkCreateEvent ) vkGetDeviceProcAddr( device, "vkCreateEvent" );
vkDestroyEvent = cast( PFN_vkDestroyEvent ) vkGetDeviceProcAddr( device, "vkDestroyEvent" );
vkGetEventStatus = cast( PFN_vkGetEventStatus ) vkGetDeviceProcAddr( device, "vkGetEventStatus" );
vkSetEvent = cast( PFN_vkSetEvent ) vkGetDeviceProcAddr( device, "vkSetEvent" );
vkResetEvent = cast( PFN_vkResetEvent ) vkGetDeviceProcAddr( device, "vkResetEvent" );
vkCreateQueryPool = cast( PFN_vkCreateQueryPool ) vkGetDeviceProcAddr( device, "vkCreateQueryPool" );
vkDestroyQueryPool = cast( PFN_vkDestroyQueryPool ) vkGetDeviceProcAddr( device, "vkDestroyQueryPool" );
vkGetQueryPoolResults = cast( PFN_vkGetQueryPoolResults ) vkGetDeviceProcAddr( device, "vkGetQueryPoolResults" );
vkCreateBuffer = cast( PFN_vkCreateBuffer ) vkGetDeviceProcAddr( device, "vkCreateBuffer" );
vkDestroyBuffer = cast( PFN_vkDestroyBuffer ) vkGetDeviceProcAddr( device, "vkDestroyBuffer" );
vkCreateBufferView = cast( PFN_vkCreateBufferView ) vkGetDeviceProcAddr( device, "vkCreateBufferView" );
vkDestroyBufferView = cast( PFN_vkDestroyBufferView ) vkGetDeviceProcAddr( device, "vkDestroyBufferView" );
vkCreateImage = cast( PFN_vkCreateImage ) vkGetDeviceProcAddr( device, "vkCreateImage" );
vkDestroyImage = cast( PFN_vkDestroyImage ) vkGetDeviceProcAddr( device, "vkDestroyImage" );
vkGetImageSubresourceLayout = cast( PFN_vkGetImageSubresourceLayout ) vkGetDeviceProcAddr( device, "vkGetImageSubresourceLayout" );
vkCreateImageView = cast( PFN_vkCreateImageView ) vkGetDeviceProcAddr( device, "vkCreateImageView" );
vkDestroyImageView = cast( PFN_vkDestroyImageView ) vkGetDeviceProcAddr( device, "vkDestroyImageView" );
vkCreateShaderModule = cast( PFN_vkCreateShaderModule ) vkGetDeviceProcAddr( device, "vkCreateShaderModule" );
vkDestroyShaderModule = cast( PFN_vkDestroyShaderModule ) vkGetDeviceProcAddr( device, "vkDestroyShaderModule" );
vkCreatePipelineCache = cast( PFN_vkCreatePipelineCache ) vkGetDeviceProcAddr( device, "vkCreatePipelineCache" );
vkDestroyPipelineCache = cast( PFN_vkDestroyPipelineCache ) vkGetDeviceProcAddr( device, "vkDestroyPipelineCache" );
vkGetPipelineCacheData = cast( PFN_vkGetPipelineCacheData ) vkGetDeviceProcAddr( device, "vkGetPipelineCacheData" );
vkMergePipelineCaches = cast( PFN_vkMergePipelineCaches ) vkGetDeviceProcAddr( device, "vkMergePipelineCaches" );
vkCreateGraphicsPipelines = cast( PFN_vkCreateGraphicsPipelines ) vkGetDeviceProcAddr( device, "vkCreateGraphicsPipelines" );
vkCreateComputePipelines = cast( PFN_vkCreateComputePipelines ) vkGetDeviceProcAddr( device, "vkCreateComputePipelines" );
vkDestroyPipeline = cast( PFN_vkDestroyPipeline ) vkGetDeviceProcAddr( device, "vkDestroyPipeline" );
vkCreatePipelineLayout = cast( PFN_vkCreatePipelineLayout ) vkGetDeviceProcAddr( device, "vkCreatePipelineLayout" );
vkDestroyPipelineLayout = cast( PFN_vkDestroyPipelineLayout ) vkGetDeviceProcAddr( device, "vkDestroyPipelineLayout" );
vkCreateSampler = cast( PFN_vkCreateSampler ) vkGetDeviceProcAddr( device, "vkCreateSampler" );
vkDestroySampler = cast( PFN_vkDestroySampler ) vkGetDeviceProcAddr( device, "vkDestroySampler" );
vkCreateDescriptorSetLayout = cast( PFN_vkCreateDescriptorSetLayout ) vkGetDeviceProcAddr( device, "vkCreateDescriptorSetLayout" );
vkDestroyDescriptorSetLayout = cast( PFN_vkDestroyDescriptorSetLayout ) vkGetDeviceProcAddr( device, "vkDestroyDescriptorSetLayout" );
vkCreateDescriptorPool = cast( PFN_vkCreateDescriptorPool ) vkGetDeviceProcAddr( device, "vkCreateDescriptorPool" );
vkDestroyDescriptorPool = cast( PFN_vkDestroyDescriptorPool ) vkGetDeviceProcAddr( device, "vkDestroyDescriptorPool" );
vkResetDescriptorPool = cast( PFN_vkResetDescriptorPool ) vkGetDeviceProcAddr( device, "vkResetDescriptorPool" );
vkAllocateDescriptorSets = cast( PFN_vkAllocateDescriptorSets ) vkGetDeviceProcAddr( device, "vkAllocateDescriptorSets" );
vkFreeDescriptorSets = cast( PFN_vkFreeDescriptorSets ) vkGetDeviceProcAddr( device, "vkFreeDescriptorSets" );
vkUpdateDescriptorSets = cast( PFN_vkUpdateDescriptorSets ) vkGetDeviceProcAddr( device, "vkUpdateDescriptorSets" );
vkCreateFramebuffer = cast( PFN_vkCreateFramebuffer ) vkGetDeviceProcAddr( device, "vkCreateFramebuffer" );
vkDestroyFramebuffer = cast( PFN_vkDestroyFramebuffer ) vkGetDeviceProcAddr( device, "vkDestroyFramebuffer" );
vkCreateRenderPass = cast( PFN_vkCreateRenderPass ) vkGetDeviceProcAddr( device, "vkCreateRenderPass" );
vkDestroyRenderPass = cast( PFN_vkDestroyRenderPass ) vkGetDeviceProcAddr( device, "vkDestroyRenderPass" );
vkGetRenderAreaGranularity = cast( PFN_vkGetRenderAreaGranularity ) vkGetDeviceProcAddr( device, "vkGetRenderAreaGranularity" );
vkCreateCommandPool = cast( PFN_vkCreateCommandPool ) vkGetDeviceProcAddr( device, "vkCreateCommandPool" );
vkDestroyCommandPool = cast( PFN_vkDestroyCommandPool ) vkGetDeviceProcAddr( device, "vkDestroyCommandPool" );
vkResetCommandPool = cast( PFN_vkResetCommandPool ) vkGetDeviceProcAddr( device, "vkResetCommandPool" );
vkAllocateCommandBuffers = cast( PFN_vkAllocateCommandBuffers ) vkGetDeviceProcAddr( device, "vkAllocateCommandBuffers" );
vkFreeCommandBuffers = cast( PFN_vkFreeCommandBuffers ) vkGetDeviceProcAddr( device, "vkFreeCommandBuffers" );
vkBeginCommandBuffer = cast( PFN_vkBeginCommandBuffer ) vkGetDeviceProcAddr( device, "vkBeginCommandBuffer" );
vkEndCommandBuffer = cast( PFN_vkEndCommandBuffer ) vkGetDeviceProcAddr( device, "vkEndCommandBuffer" );
vkResetCommandBuffer = cast( PFN_vkResetCommandBuffer ) vkGetDeviceProcAddr( device, "vkResetCommandBuffer" );
vkCmdBindPipeline = cast( PFN_vkCmdBindPipeline ) vkGetDeviceProcAddr( device, "vkCmdBindPipeline" );
vkCmdSetViewport = cast( PFN_vkCmdSetViewport ) vkGetDeviceProcAddr( device, "vkCmdSetViewport" );
vkCmdSetScissor = cast( PFN_vkCmdSetScissor ) vkGetDeviceProcAddr( device, "vkCmdSetScissor" );
vkCmdSetLineWidth = cast( PFN_vkCmdSetLineWidth ) vkGetDeviceProcAddr( device, "vkCmdSetLineWidth" );
vkCmdSetDepthBias = cast( PFN_vkCmdSetDepthBias ) vkGetDeviceProcAddr( device, "vkCmdSetDepthBias" );
vkCmdSetBlendConstants = cast( PFN_vkCmdSetBlendConstants ) vkGetDeviceProcAddr( device, "vkCmdSetBlendConstants" );
vkCmdSetDepthBounds = cast( PFN_vkCmdSetDepthBounds ) vkGetDeviceProcAddr( device, "vkCmdSetDepthBounds" );
vkCmdSetStencilCompareMask = cast( PFN_vkCmdSetStencilCompareMask ) vkGetDeviceProcAddr( device, "vkCmdSetStencilCompareMask" );
vkCmdSetStencilWriteMask = cast( PFN_vkCmdSetStencilWriteMask ) vkGetDeviceProcAddr( device, "vkCmdSetStencilWriteMask" );
vkCmdSetStencilReference = cast( PFN_vkCmdSetStencilReference ) vkGetDeviceProcAddr( device, "vkCmdSetStencilReference" );
vkCmdBindDescriptorSets = cast( PFN_vkCmdBindDescriptorSets ) vkGetDeviceProcAddr( device, "vkCmdBindDescriptorSets" );
vkCmdBindIndexBuffer = cast( PFN_vkCmdBindIndexBuffer ) vkGetDeviceProcAddr( device, "vkCmdBindIndexBuffer" );
vkCmdBindVertexBuffers = cast( PFN_vkCmdBindVertexBuffers ) vkGetDeviceProcAddr( device, "vkCmdBindVertexBuffers" );
vkCmdDraw = cast( PFN_vkCmdDraw ) vkGetDeviceProcAddr( device, "vkCmdDraw" );
vkCmdDrawIndexed = cast( PFN_vkCmdDrawIndexed ) vkGetDeviceProcAddr( device, "vkCmdDrawIndexed" );
vkCmdDrawIndirect = cast( PFN_vkCmdDrawIndirect ) vkGetDeviceProcAddr( device, "vkCmdDrawIndirect" );
vkCmdDrawIndexedIndirect = cast( PFN_vkCmdDrawIndexedIndirect ) vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirect" );
vkCmdDispatch = cast( PFN_vkCmdDispatch ) vkGetDeviceProcAddr( device, "vkCmdDispatch" );
vkCmdDispatchIndirect = cast( PFN_vkCmdDispatchIndirect ) vkGetDeviceProcAddr( device, "vkCmdDispatchIndirect" );
vkCmdCopyBuffer = cast( PFN_vkCmdCopyBuffer ) vkGetDeviceProcAddr( device, "vkCmdCopyBuffer" );
vkCmdCopyImage = cast( PFN_vkCmdCopyImage ) vkGetDeviceProcAddr( device, "vkCmdCopyImage" );
vkCmdBlitImage = cast( PFN_vkCmdBlitImage ) vkGetDeviceProcAddr( device, "vkCmdBlitImage" );
vkCmdCopyBufferToImage = cast( PFN_vkCmdCopyBufferToImage ) vkGetDeviceProcAddr( device, "vkCmdCopyBufferToImage" );
vkCmdCopyImageToBuffer = cast( PFN_vkCmdCopyImageToBuffer ) vkGetDeviceProcAddr( device, "vkCmdCopyImageToBuffer" );
vkCmdUpdateBuffer = cast( PFN_vkCmdUpdateBuffer ) vkGetDeviceProcAddr( device, "vkCmdUpdateBuffer" );
vkCmdFillBuffer = cast( PFN_vkCmdFillBuffer ) vkGetDeviceProcAddr( device, "vkCmdFillBuffer" );
vkCmdClearColorImage = cast( PFN_vkCmdClearColorImage ) vkGetDeviceProcAddr( device, "vkCmdClearColorImage" );
vkCmdClearDepthStencilImage = cast( PFN_vkCmdClearDepthStencilImage ) vkGetDeviceProcAddr( device, "vkCmdClearDepthStencilImage" );
vkCmdClearAttachments = cast( PFN_vkCmdClearAttachments ) vkGetDeviceProcAddr( device, "vkCmdClearAttachments" );
vkCmdResolveImage = cast( PFN_vkCmdResolveImage ) vkGetDeviceProcAddr( device, "vkCmdResolveImage" );
vkCmdSetEvent = cast( PFN_vkCmdSetEvent ) vkGetDeviceProcAddr( device, "vkCmdSetEvent" );
vkCmdResetEvent = cast( PFN_vkCmdResetEvent ) vkGetDeviceProcAddr( device, "vkCmdResetEvent" );
vkCmdWaitEvents = cast( PFN_vkCmdWaitEvents ) vkGetDeviceProcAddr( device, "vkCmdWaitEvents" );
vkCmdPipelineBarrier = cast( PFN_vkCmdPipelineBarrier ) vkGetDeviceProcAddr( device, "vkCmdPipelineBarrier" );
vkCmdBeginQuery = cast( PFN_vkCmdBeginQuery ) vkGetDeviceProcAddr( device, "vkCmdBeginQuery" );
vkCmdEndQuery = cast( PFN_vkCmdEndQuery ) vkGetDeviceProcAddr( device, "vkCmdEndQuery" );
vkCmdResetQueryPool = cast( PFN_vkCmdResetQueryPool ) vkGetDeviceProcAddr( device, "vkCmdResetQueryPool" );
vkCmdWriteTimestamp = cast( PFN_vkCmdWriteTimestamp ) vkGetDeviceProcAddr( device, "vkCmdWriteTimestamp" );
vkCmdCopyQueryPoolResults = cast( PFN_vkCmdCopyQueryPoolResults ) vkGetDeviceProcAddr( device, "vkCmdCopyQueryPoolResults" );
vkCmdPushConstants = cast( PFN_vkCmdPushConstants ) vkGetDeviceProcAddr( device, "vkCmdPushConstants" );
vkCmdBeginRenderPass = cast( PFN_vkCmdBeginRenderPass ) vkGetDeviceProcAddr( device, "vkCmdBeginRenderPass" );
vkCmdNextSubpass = cast( PFN_vkCmdNextSubpass ) vkGetDeviceProcAddr( device, "vkCmdNextSubpass" );
vkCmdEndRenderPass = cast( PFN_vkCmdEndRenderPass ) vkGetDeviceProcAddr( device, "vkCmdEndRenderPass" );
vkCmdExecuteCommands = cast( PFN_vkCmdExecuteCommands ) vkGetDeviceProcAddr( device, "vkCmdExecuteCommands" );
// VK_VERSION_1_1
vkBindBufferMemory2 = cast( PFN_vkBindBufferMemory2 ) vkGetDeviceProcAddr( device, "vkBindBufferMemory2" );
vkBindImageMemory2 = cast( PFN_vkBindImageMemory2 ) vkGetDeviceProcAddr( device, "vkBindImageMemory2" );
vkGetDeviceGroupPeerMemoryFeatures = cast( PFN_vkGetDeviceGroupPeerMemoryFeatures ) vkGetDeviceProcAddr( device, "vkGetDeviceGroupPeerMemoryFeatures" );
vkCmdSetDeviceMask = cast( PFN_vkCmdSetDeviceMask ) vkGetDeviceProcAddr( device, "vkCmdSetDeviceMask" );
vkCmdDispatchBase = cast( PFN_vkCmdDispatchBase ) vkGetDeviceProcAddr( device, "vkCmdDispatchBase" );
vkGetImageMemoryRequirements2 = cast( PFN_vkGetImageMemoryRequirements2 ) vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements2" );
vkGetBufferMemoryRequirements2 = cast( PFN_vkGetBufferMemoryRequirements2 ) vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements2" );
vkGetImageSparseMemoryRequirements2 = cast( PFN_vkGetImageSparseMemoryRequirements2 ) vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements2" );
vkTrimCommandPool = cast( PFN_vkTrimCommandPool ) vkGetDeviceProcAddr( device, "vkTrimCommandPool" );
vkGetDeviceQueue2 = cast( PFN_vkGetDeviceQueue2 ) vkGetDeviceProcAddr( device, "vkGetDeviceQueue2" );
vkCreateSamplerYcbcrConversion = cast( PFN_vkCreateSamplerYcbcrConversion ) vkGetDeviceProcAddr( device, "vkCreateSamplerYcbcrConversion" );
vkDestroySamplerYcbcrConversion = cast( PFN_vkDestroySamplerYcbcrConversion ) vkGetDeviceProcAddr( device, "vkDestroySamplerYcbcrConversion" );
vkCreateDescriptorUpdateTemplate = cast( PFN_vkCreateDescriptorUpdateTemplate ) vkGetDeviceProcAddr( device, "vkCreateDescriptorUpdateTemplate" );
vkDestroyDescriptorUpdateTemplate = cast( PFN_vkDestroyDescriptorUpdateTemplate ) vkGetDeviceProcAddr( device, "vkDestroyDescriptorUpdateTemplate" );
vkUpdateDescriptorSetWithTemplate = cast( PFN_vkUpdateDescriptorSetWithTemplate ) vkGetDeviceProcAddr( device, "vkUpdateDescriptorSetWithTemplate" );
vkGetDescriptorSetLayoutSupport = cast( PFN_vkGetDescriptorSetLayoutSupport ) vkGetDeviceProcAddr( device, "vkGetDescriptorSetLayoutSupport" );
// VK_KHR_swapchain
vkCreateSwapchainKHR = cast( PFN_vkCreateSwapchainKHR ) vkGetDeviceProcAddr( device, "vkCreateSwapchainKHR" );
vkDestroySwapchainKHR = cast( PFN_vkDestroySwapchainKHR ) vkGetDeviceProcAddr( device, "vkDestroySwapchainKHR" );
vkGetSwapchainImagesKHR = cast( PFN_vkGetSwapchainImagesKHR ) vkGetDeviceProcAddr( device, "vkGetSwapchainImagesKHR" );
vkAcquireNextImageKHR = cast( PFN_vkAcquireNextImageKHR ) vkGetDeviceProcAddr( device, "vkAcquireNextImageKHR" );
vkQueuePresentKHR = cast( PFN_vkQueuePresentKHR ) vkGetDeviceProcAddr( device, "vkQueuePresentKHR" );
vkGetDeviceGroupPresentCapabilitiesKHR = cast( PFN_vkGetDeviceGroupPresentCapabilitiesKHR ) vkGetDeviceProcAddr( device, "vkGetDeviceGroupPresentCapabilitiesKHR" );
vkGetDeviceGroupSurfacePresentModesKHR = cast( PFN_vkGetDeviceGroupSurfacePresentModesKHR ) vkGetDeviceProcAddr( device, "vkGetDeviceGroupSurfacePresentModesKHR" );
vkAcquireNextImage2KHR = cast( PFN_vkAcquireNextImage2KHR ) vkGetDeviceProcAddr( device, "vkAcquireNextImage2KHR" );
// VK_KHR_display_swapchain
vkCreateSharedSwapchainsKHR = cast( PFN_vkCreateSharedSwapchainsKHR ) vkGetDeviceProcAddr( device, "vkCreateSharedSwapchainsKHR" );
// VK_KHR_external_memory_fd
vkGetMemoryFdKHR = cast( PFN_vkGetMemoryFdKHR ) vkGetDeviceProcAddr( device, "vkGetMemoryFdKHR" );
vkGetMemoryFdPropertiesKHR = cast( PFN_vkGetMemoryFdPropertiesKHR ) vkGetDeviceProcAddr( device, "vkGetMemoryFdPropertiesKHR" );
// VK_KHR_external_semaphore_fd
vkImportSemaphoreFdKHR = cast( PFN_vkImportSemaphoreFdKHR ) vkGetDeviceProcAddr( device, "vkImportSemaphoreFdKHR" );
vkGetSemaphoreFdKHR = cast( PFN_vkGetSemaphoreFdKHR ) vkGetDeviceProcAddr( device, "vkGetSemaphoreFdKHR" );
// VK_KHR_push_descriptor
vkCmdPushDescriptorSetKHR = cast( PFN_vkCmdPushDescriptorSetKHR ) vkGetDeviceProcAddr( device, "vkCmdPushDescriptorSetKHR" );
vkCmdPushDescriptorSetWithTemplateKHR = cast( PFN_vkCmdPushDescriptorSetWithTemplateKHR ) vkGetDeviceProcAddr( device, "vkCmdPushDescriptorSetWithTemplateKHR" );
// VK_KHR_shared_presentable_image
vkGetSwapchainStatusKHR = cast( PFN_vkGetSwapchainStatusKHR ) vkGetDeviceProcAddr( device, "vkGetSwapchainStatusKHR" );
// VK_KHR_external_fence_fd
vkImportFenceFdKHR = cast( PFN_vkImportFenceFdKHR ) vkGetDeviceProcAddr( device, "vkImportFenceFdKHR" );
vkGetFenceFdKHR = cast( PFN_vkGetFenceFdKHR ) vkGetDeviceProcAddr( device, "vkGetFenceFdKHR" );
// VK_EXT_debug_marker
vkDebugMarkerSetObjectTagEXT = cast( PFN_vkDebugMarkerSetObjectTagEXT ) vkGetDeviceProcAddr( device, "vkDebugMarkerSetObjectTagEXT" );
vkDebugMarkerSetObjectNameEXT = cast( PFN_vkDebugMarkerSetObjectNameEXT ) vkGetDeviceProcAddr( device, "vkDebugMarkerSetObjectNameEXT" );
vkCmdDebugMarkerBeginEXT = cast( PFN_vkCmdDebugMarkerBeginEXT ) vkGetDeviceProcAddr( device, "vkCmdDebugMarkerBeginEXT" );
vkCmdDebugMarkerEndEXT = cast( PFN_vkCmdDebugMarkerEndEXT ) vkGetDeviceProcAddr( device, "vkCmdDebugMarkerEndEXT" );
vkCmdDebugMarkerInsertEXT = cast( PFN_vkCmdDebugMarkerInsertEXT ) vkGetDeviceProcAddr( device, "vkCmdDebugMarkerInsertEXT" );
// VK_AMD_draw_indirect_count
vkCmdDrawIndirectCountAMD = cast( PFN_vkCmdDrawIndirectCountAMD ) vkGetDeviceProcAddr( device, "vkCmdDrawIndirectCountAMD" );
vkCmdDrawIndexedIndirectCountAMD = cast( PFN_vkCmdDrawIndexedIndirectCountAMD ) vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirectCountAMD" );
// VK_AMD_shader_info
vkGetShaderInfoAMD = cast( PFN_vkGetShaderInfoAMD ) vkGetDeviceProcAddr( device, "vkGetShaderInfoAMD" );
// VK_NVX_device_generated_commands
vkCmdProcessCommandsNVX = cast( PFN_vkCmdProcessCommandsNVX ) vkGetDeviceProcAddr( device, "vkCmdProcessCommandsNVX" );
vkCmdReserveSpaceForCommandsNVX = cast( PFN_vkCmdReserveSpaceForCommandsNVX ) vkGetDeviceProcAddr( device, "vkCmdReserveSpaceForCommandsNVX" );
vkCreateIndirectCommandsLayoutNVX = cast( PFN_vkCreateIndirectCommandsLayoutNVX ) vkGetDeviceProcAddr( device, "vkCreateIndirectCommandsLayoutNVX" );
vkDestroyIndirectCommandsLayoutNVX = cast( PFN_vkDestroyIndirectCommandsLayoutNVX ) vkGetDeviceProcAddr( device, "vkDestroyIndirectCommandsLayoutNVX" );
vkCreateObjectTableNVX = cast( PFN_vkCreateObjectTableNVX ) vkGetDeviceProcAddr( device, "vkCreateObjectTableNVX" );
vkDestroyObjectTableNVX = cast( PFN_vkDestroyObjectTableNVX ) vkGetDeviceProcAddr( device, "vkDestroyObjectTableNVX" );
vkRegisterObjectsNVX = cast( PFN_vkRegisterObjectsNVX ) vkGetDeviceProcAddr( device, "vkRegisterObjectsNVX" );
vkUnregisterObjectsNVX = cast( PFN_vkUnregisterObjectsNVX ) vkGetDeviceProcAddr( device, "vkUnregisterObjectsNVX" );
// VK_NV_clip_space_w_scaling
vkCmdSetViewportWScalingNV = cast( PFN_vkCmdSetViewportWScalingNV ) vkGetDeviceProcAddr( device, "vkCmdSetViewportWScalingNV" );
// VK_EXT_display_control
vkDisplayPowerControlEXT = cast( PFN_vkDisplayPowerControlEXT ) vkGetDeviceProcAddr( device, "vkDisplayPowerControlEXT" );
vkRegisterDeviceEventEXT = cast( PFN_vkRegisterDeviceEventEXT ) vkGetDeviceProcAddr( device, "vkRegisterDeviceEventEXT" );
vkRegisterDisplayEventEXT = cast( PFN_vkRegisterDisplayEventEXT ) vkGetDeviceProcAddr( device, "vkRegisterDisplayEventEXT" );
vkGetSwapchainCounterEXT = cast( PFN_vkGetSwapchainCounterEXT ) vkGetDeviceProcAddr( device, "vkGetSwapchainCounterEXT" );
// VK_GOOGLE_display_timing
vkGetRefreshCycleDurationGOOGLE = cast( PFN_vkGetRefreshCycleDurationGOOGLE ) vkGetDeviceProcAddr( device, "vkGetRefreshCycleDurationGOOGLE" );
vkGetPastPresentationTimingGOOGLE = cast( PFN_vkGetPastPresentationTimingGOOGLE ) vkGetDeviceProcAddr( device, "vkGetPastPresentationTimingGOOGLE" );
// VK_EXT_discard_rectangles
vkCmdSetDiscardRectangleEXT = cast( PFN_vkCmdSetDiscardRectangleEXT ) vkGetDeviceProcAddr( device, "vkCmdSetDiscardRectangleEXT" );
// VK_EXT_hdr_metadata
vkSetHdrMetadataEXT = cast( PFN_vkSetHdrMetadataEXT ) vkGetDeviceProcAddr( device, "vkSetHdrMetadataEXT" );
// VK_EXT_debug_utils
vkSetDebugUtilsObjectNameEXT = cast( PFN_vkSetDebugUtilsObjectNameEXT ) vkGetDeviceProcAddr( device, "vkSetDebugUtilsObjectNameEXT" );
vkSetDebugUtilsObjectTagEXT = cast( PFN_vkSetDebugUtilsObjectTagEXT ) vkGetDeviceProcAddr( device, "vkSetDebugUtilsObjectTagEXT" );
vkQueueBeginDebugUtilsLabelEXT = cast( PFN_vkQueueBeginDebugUtilsLabelEXT ) vkGetDeviceProcAddr( device, "vkQueueBeginDebugUtilsLabelEXT" );
vkQueueEndDebugUtilsLabelEXT = cast( PFN_vkQueueEndDebugUtilsLabelEXT ) vkGetDeviceProcAddr( device, "vkQueueEndDebugUtilsLabelEXT" );
vkQueueInsertDebugUtilsLabelEXT = cast( PFN_vkQueueInsertDebugUtilsLabelEXT ) vkGetDeviceProcAddr( device, "vkQueueInsertDebugUtilsLabelEXT" );
vkCmdBeginDebugUtilsLabelEXT = cast( PFN_vkCmdBeginDebugUtilsLabelEXT ) vkGetDeviceProcAddr( device, "vkCmdBeginDebugUtilsLabelEXT" );
vkCmdEndDebugUtilsLabelEXT = cast( PFN_vkCmdEndDebugUtilsLabelEXT ) vkGetDeviceProcAddr( device, "vkCmdEndDebugUtilsLabelEXT" );
vkCmdInsertDebugUtilsLabelEXT = cast( PFN_vkCmdInsertDebugUtilsLabelEXT ) vkGetDeviceProcAddr( device, "vkCmdInsertDebugUtilsLabelEXT" );
// VK_EXT_sample_locations
vkCmdSetSampleLocationsEXT = cast( PFN_vkCmdSetSampleLocationsEXT ) vkGetDeviceProcAddr( device, "vkCmdSetSampleLocationsEXT" );
// VK_EXT_validation_cache
vkCreateValidationCacheEXT = cast( PFN_vkCreateValidationCacheEXT ) vkGetDeviceProcAddr( device, "vkCreateValidationCacheEXT" );
vkDestroyValidationCacheEXT = cast( PFN_vkDestroyValidationCacheEXT ) vkGetDeviceProcAddr( device, "vkDestroyValidationCacheEXT" );
vkMergeValidationCachesEXT = cast( PFN_vkMergeValidationCachesEXT ) vkGetDeviceProcAddr( device, "vkMergeValidationCachesEXT" );
vkGetValidationCacheDataEXT = cast( PFN_vkGetValidationCacheDataEXT ) vkGetDeviceProcAddr( device, "vkGetValidationCacheDataEXT" );
// VK_EXT_external_memory_host
vkGetMemoryHostPointerPropertiesEXT = cast( PFN_vkGetMemoryHostPointerPropertiesEXT ) vkGetDeviceProcAddr( device, "vkGetMemoryHostPointerPropertiesEXT" );
// VK_AMD_buffer_marker
vkCmdWriteBufferMarkerAMD = cast( PFN_vkCmdWriteBufferMarkerAMD ) vkGetDeviceProcAddr( device, "vkCmdWriteBufferMarkerAMD" );
}
|
D
|
/Users/jennielee/Documents/PSU 2020-2021/SPRING2021/CS510/yew-tutorial/target/wasm32-unknown-unknown/release/deps/itoa-a16b6896f8a3e0bf.rmeta: /Users/jennielee/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.7/src/lib.rs
/Users/jennielee/Documents/PSU 2020-2021/SPRING2021/CS510/yew-tutorial/target/wasm32-unknown-unknown/release/deps/libitoa-a16b6896f8a3e0bf.rlib: /Users/jennielee/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.7/src/lib.rs
/Users/jennielee/Documents/PSU 2020-2021/SPRING2021/CS510/yew-tutorial/target/wasm32-unknown-unknown/release/deps/itoa-a16b6896f8a3e0bf.d: /Users/jennielee/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.7/src/lib.rs
/Users/jennielee/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.7/src/lib.rs:
|
D
|
/home/tuan/rust_projects/iron-gcd/target/debug/build/httparse-a9a7ec16f694f23c/build_script_build-a9a7ec16f694f23c: /home/tuan/.cargo/registry/src/github.com-1ecc6299db9ec823/httparse-1.3.5/build.rs
/home/tuan/rust_projects/iron-gcd/target/debug/build/httparse-a9a7ec16f694f23c/build_script_build-a9a7ec16f694f23c.d: /home/tuan/.cargo/registry/src/github.com-1ecc6299db9ec823/httparse-1.3.5/build.rs
/home/tuan/.cargo/registry/src/github.com-1ecc6299db9ec823/httparse-1.3.5/build.rs:
|
D
|
c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: socks4a
Arg: <host[:port]>
Help: SOCKS4a proxy on given host + port
Added: 7.18.0
Category: proxy
Example: --socks4a hostname:4096 $URL
See-also: socks4 socks5 socks5-hostname
Multi: single
---
Use the specified SOCKS4a proxy. If the port number is not specified, it is
assumed at port 1080. This asks the proxy to resolve the host name.
To specify proxy on a unix domain socket, use localhost for host, e.g.
socks4a://localhost/path/to/socket.sock
This option overrides any previous use of --proxy, as they are mutually
exclusive.
This option is superfluous since you can specify a socks4a proxy with --proxy
using a socks4a:// protocol prefix. (Added in 7.21.7)
Since 7.52.0, --preproxy can be used to specify a SOCKS proxy at the same time
--proxy is used with an HTTP/HTTPS proxy. In such a case curl first connects to
the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy.
|
D
|
/*
Copyright (c) 2014-2021 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/**
* High dynamic range images
*
* Copyright: Timur Gafarov 2013-2021.
* License: $(LINK2 boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Timur Gafarov
*/
module dlib.image.hdri;
import core.stdc.string;
import std.math;
import dlib.core.memory;
import dlib.image.image;
import dlib.image.color;
import dlib.math.vector;
import dlib.math.utils;
/// Linear floating-point pixel formats
enum FloatPixelFormat: uint
{
RGBAF32 = 8
//TODO:
//RGBAF64 = 9
//RGBAF16 = 10
}
/**
* HDR image interface
*/
abstract class SuperHDRImage: SuperImage
{
override @property uint pixelFormat()
{
return FloatPixelFormat.RGBAF32;
}
}
/**
* Extension of standard Image that is based on FloatPixelFormat.RGBAF32
*/
class HDRImage: SuperHDRImage
{
public:
@property uint width()
{
return _width;
}
@property uint height()
{
return _height;
}
@property uint bitDepth()
{
return _bitDepth;
}
@property uint channels()
{
return _channels;
}
@property uint pixelSize()
{
return _pixelSize;
}
@property ubyte[] data()
{
return _data;
}
@property SuperImage dup()
{
auto res = new HDRImage(_width, _height);
res.data[] = data[];
return res;
}
SuperImage createSameFormat(uint w, uint h)
{
return new HDRImage(w, h);
}
this(uint w, uint h)
{
_width = w;
_height = h;
_bitDepth = 32;
_channels = 4;
_pixelSize = (_bitDepth / 8) * _channels;
allocateData();
}
Color4f opIndex(int x, int y)
{
while(x >= _width) x = _width-1;
while(y >= _height) y = _height-1;
while(x < 0) x = 0;
while(y < 0) y = 0;
float r, g, b, a;
auto dataptr = data.ptr + (y * _width + x) * _pixelSize;
memcpy(&r, dataptr, 4);
memcpy(&g, dataptr + 4, 4);
memcpy(&b, dataptr + 4 * 2, 4);
memcpy(&a, dataptr + 4 * 3, 4);
return Color4f(r, g, b, a);
}
Color4f opIndexAssign(Color4f c, int x, int y)
{
while(x >= _width) x = _width-1;
while(y >= _height) y = _height-1;
while(x < 0) x = 0;
while(y < 0) y = 0;
auto dataptr = data.ptr + (y * _width + x) * _pixelSize;
memcpy(dataptr, &c.arrayof[0], 4);
memcpy(dataptr + 4, &c.arrayof[1], 4);
memcpy(dataptr + 4 * 2, &c.arrayof[2], 4);
memcpy(dataptr + 4 * 3, &c.arrayof[3], 4);
return c;
}
protected void allocateData()
{
_data = new ubyte[_width * _height * _pixelSize];
}
void free()
{
// Do nothing, let GC delete the object
}
protected:
uint _width;
uint _height;
uint _bitDepth;
uint _channels;
uint _pixelSize;
ubyte[] _data;
}
/// Clamp pixels luminance to a specified range
SuperImage clamp(SuperImage img, float minv, float maxv)
{
foreach(x; 0..img.width)
foreach(y; 0..img.height)
{
img[x, y] = img[x, y].clamped(minv, maxv);
}
return img;
}
/**
* Factory interface for HDR images
*/
interface SuperHDRImageFactory
{
SuperHDRImage createImage(uint w, uint h);
}
/**
* Factory class for HDR images
*/
class HDRImageFactory: SuperHDRImageFactory
{
SuperHDRImage createImage(uint w, uint h)
{
return new HDRImage(w, h);
}
}
private SuperHDRImageFactory _defaultHDRImageFactory;
/**
* Get default SuperHDRImageFactory singleton
*/
SuperHDRImageFactory defaultHDRImageFactory()
{
if (!_defaultHDRImageFactory)
_defaultHDRImageFactory = new HDRImageFactory();
return _defaultHDRImageFactory;
}
/**
* HDRImage that uses dlib.core.memory instead of GC
*/
class UnmanagedHDRImage: HDRImage
{
override @property SuperImage dup()
{
auto res = New!(UnmanagedHDRImage)(_width, _height);
res.data[] = data[];
return res;
}
override SuperImage createSameFormat(uint w, uint h)
{
return New!(UnmanagedHDRImage)(w, h);
}
this(uint w, uint h)
{
super(w, h);
}
~this()
{
Delete(_data);
}
protected override void allocateData()
{
_data = New!(ubyte[])(_width * _height * _pixelSize);
}
override void free()
{
Delete(this);
}
}
/**
* Factory class for UnmanagedHDRImageFactory
*/
class UnmanagedHDRImageFactory: SuperHDRImageFactory
{
SuperHDRImage createImage(uint w, uint h)
{
return New!UnmanagedHDRImage(w, h);
}
}
/// Simple exponentiation tonal compression
SuperImage hdrTonemapGamma(SuperHDRImage img, SuperImage output, float gamma)
{
SuperImage res;
if (output)
res = output;
else
res = image(img.width, img.height, img.channels);
foreach(y; 0..img.height)
foreach(x; 0..img.width)
{
Color4f c = img[x, y];
float r = c.r ^^ gamma;
float g = c.g ^^ gamma;
float b = c.b ^^ gamma;
res[x, y] = Color4f(r, g, b, c.a);
}
return res;
}
/// ditto
SuperImage hdrTonemapGamma(SuperHDRImage img, float gamma)
{
return hdrTonemapGamma(img, null, gamma);
}
/// Reinhard tonal compression
SuperImage hdrTonemapReinhard(SuperHDRImage img, SuperImage output, float exposure, float gamma)
{
SuperImage res;
if (output)
res = output;
else
res = image(img.width, img.height, img.channels);
foreach(y; 0..img.height)
foreach(x; 0..img.width)
{
Color4f c = img[x, y];
Vector3f v = c * exposure;
v = v / (v + 1.0f);
float r = v.r ^^ gamma;
float g = v.g ^^ gamma;
float b = v.b ^^ gamma;
res[x, y] = Color4f(r, g, b, c.a);
}
return res;
}
/// ditto
SuperImage hdrTonemapReinhard(SuperHDRImage img, float exposure, float gamma)
{
return hdrTonemapReinhard(img, null, exposure, gamma);
}
/// Hable (Uncharted 2) tonal compression
SuperImage hdrTonemapHable(SuperHDRImage img, SuperImage output, float exposure, float gamma)
{
SuperImage res;
if (output)
res = output;
else
res = image(img.width, img.height, img.channels);
foreach(y; 0..img.height)
foreach(x; 0..img.width)
{
Color4f c = img[x, y];
Vector3f v = c * exposure;
Vector3f one = Vector3f(1.0f, 1.0f, 1.0f);
Vector3f W = Vector3f(11.2f, 11.2f, 11.2f);
v = hableFunc(v * 2.0f) * (one / hableFunc(W));
float r = v.r ^^ gamma;
float g = v.g ^^ gamma;
float b = v.b ^^ gamma;
res[x, y] = Color4f(r, g, b, c.a);
}
return res;
}
/// ditto
SuperImage hdrTonemapHable(SuperHDRImage img, float exposure, float gamma)
{
return hdrTonemapHable(img, null, exposure, gamma);
}
Vector3f hableFunc(Vector3f x)
{
return ((x * (x * 0.15f + 0.1f * 0.5f) + 0.2f * 0.02f) / (x * (x * 0.15f + 0.5f) + 0.2f * 0.3f)) - 0.02f / 0.3f;
}
/// ACES curve tonal compression
SuperImage hdrTonemapACES(SuperHDRImage img, SuperImage output, float exposure, float gamma)
{
SuperImage res;
if (output)
res = output;
else
res = image(img.width, img.height, img.channels);
float a = 2.51;
float b = 0.03;
float c = 2.43;
float d = 0.59;
float e = 0.14;
foreach(y; 0..img.height)
foreach(x; 0..img.width)
{
Color4f col = img[x, y];
Color4f v = col * exposure * 0.6;
v = ((v * (v * a + b)) / (v * (v * c + d) + e)).clamped(0.0, 1.0);
res[x, y] = Color4f(
v.r ^^ gamma,
v.g ^^ gamma,
v.b ^^ gamma,
col.a);
}
return res;
}
/// ditto
SuperImage hdrTonemapACES(SuperHDRImage img, float exposure, float gamma)
{
return hdrTonemapACES(img, null, exposure, gamma);
}
/// Average luminance tonal compression
SuperImage hdrTonemapAverageLuminance(SuperHDRImage img, SuperImage output, float a, float gamma)
{
SuperImage res;
if (output)
res = output;
else
res = image(img.width, img.height, img.channels);
float lumAverage = averageLuminance(img);
float aOverLumAverage = a / lumAverage;
foreach(y; 0..img.height)
foreach(x; 0..img.width)
{
auto col = img[x, y];
float Lw = col.luminance;
float L = Lw * aOverLumAverage;
float Ld = L / (1.0f + L);
Color4f nRGB = col / Lw;
Color4f dRGB = nRGB * Ld;
float r = dRGB.r ^^ gamma;
float g = dRGB.g ^^ gamma;
float b = dRGB.b ^^ gamma;
res[x, y] = Color4f(r, g, b, col.a);
}
return res;
}
/// ditto
SuperImage hdrTonemapAverageLuminance(SuperHDRImage img, float a, float gamma)
{
return hdrTonemapAverageLuminance(img, null, a, gamma);
}
float averageLuminance(SuperHDRImage img)
{
float sumLuminance = 0.0f;
foreach(y; 0..img.height)
foreach(x; 0..img.width)
{
sumLuminance += log(EPSILON + img[x, y].luminance);
}
float N = img.width * img.height;
float lumAverage = exp(sumLuminance / N);
return lumAverage;
}
|
D
|
.source T_if_gtz_9.java
.class public dot.junit.opcodes.if_gtz.d.T_if_gtz_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(I)Z
.limit regs 6
if-gtz v5, Label8
const/4 v0, 0
return v0
Label8:
const v0, 0
return v0
.end method
|
D
|
/Users/konstafer/ITMO-FILES/Watermark/DerivedData/Watermark-cqwfdathjgcaeadrqbaafokwyrkl/Build/Intermediates.noindex/Watermark.build/Debug/Watermark.build/Objects-normal/x86_64/ViewController.o : /Users/konstafer/ITMO-FILES/Watermark/Watermark/AppDelegate.swift /Users/konstafer/ITMO-FILES/Watermark/Watermark/ViewController.swift /Users/konstafer/ITMO-FILES/Watermark/Watermark/as.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/XPC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuartzCore.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/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/konstafer/ITMO-FILES/Watermark/Watermark/Watermark-Bridging-Header.h
/Users/konstafer/ITMO-FILES/Watermark/DerivedData/Watermark-cqwfdathjgcaeadrqbaafokwyrkl/Build/Intermediates.noindex/Watermark.build/Debug/Watermark.build/Objects-normal/x86_64/ViewController~partial.swiftmodule : /Users/konstafer/ITMO-FILES/Watermark/Watermark/AppDelegate.swift /Users/konstafer/ITMO-FILES/Watermark/Watermark/ViewController.swift /Users/konstafer/ITMO-FILES/Watermark/Watermark/as.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/XPC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuartzCore.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/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/konstafer/ITMO-FILES/Watermark/Watermark/Watermark-Bridging-Header.h
/Users/konstafer/ITMO-FILES/Watermark/DerivedData/Watermark-cqwfdathjgcaeadrqbaafokwyrkl/Build/Intermediates.noindex/Watermark.build/Debug/Watermark.build/Objects-normal/x86_64/ViewController~partial.swiftdoc : /Users/konstafer/ITMO-FILES/Watermark/Watermark/AppDelegate.swift /Users/konstafer/ITMO-FILES/Watermark/Watermark/ViewController.swift /Users/konstafer/ITMO-FILES/Watermark/Watermark/as.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/XPC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuartzCore.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/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/konstafer/ITMO-FILES/Watermark/Watermark/Watermark-Bridging-Header.h
|
D
|
module UnrealScript.Engine.UIDataStore_OnlineGameSettings;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.OnlineGameSettings;
import UnrealScript.Engine.LocalPlayer;
import UnrealScript.Engine.UIDataStore_Settings;
import UnrealScript.Engine.UIDataProvider_Settings;
import UnrealScript.Engine.UIDataProvider;
extern(C++) interface UIDataStore_OnlineGameSettings : UIDataStore_Settings
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.UIDataStore_OnlineGameSettings")); }
private static __gshared UIDataStore_OnlineGameSettings mDefaultProperties;
@property final static UIDataStore_OnlineGameSettings DefaultProperties() { mixin(MGDPC("UIDataStore_OnlineGameSettings", "UIDataStore_OnlineGameSettings Engine.Default__UIDataStore_OnlineGameSettings")); }
static struct Functions
{
private static __gshared
{
ScriptFunction mOnSettingProviderChanged;
ScriptFunction mCreateGame;
ScriptFunction mGetCurrentGameSettings;
ScriptFunction mGetCurrentProvider;
ScriptFunction mSetCurrentByIndex;
ScriptFunction mSetCurrentByName;
ScriptFunction mMoveToNext;
ScriptFunction mMoveToPrevious;
ScriptFunction mRegistered;
ScriptFunction mUnregistered;
}
public @property static final
{
ScriptFunction OnSettingProviderChanged() { mixin(MGF("mOnSettingProviderChanged", "Function Engine.UIDataStore_OnlineGameSettings.OnSettingProviderChanged")); }
ScriptFunction CreateGame() { mixin(MGF("mCreateGame", "Function Engine.UIDataStore_OnlineGameSettings.CreateGame")); }
ScriptFunction GetCurrentGameSettings() { mixin(MGF("mGetCurrentGameSettings", "Function Engine.UIDataStore_OnlineGameSettings.GetCurrentGameSettings")); }
ScriptFunction GetCurrentProvider() { mixin(MGF("mGetCurrentProvider", "Function Engine.UIDataStore_OnlineGameSettings.GetCurrentProvider")); }
ScriptFunction SetCurrentByIndex() { mixin(MGF("mSetCurrentByIndex", "Function Engine.UIDataStore_OnlineGameSettings.SetCurrentByIndex")); }
ScriptFunction SetCurrentByName() { mixin(MGF("mSetCurrentByName", "Function Engine.UIDataStore_OnlineGameSettings.SetCurrentByName")); }
ScriptFunction MoveToNext() { mixin(MGF("mMoveToNext", "Function Engine.UIDataStore_OnlineGameSettings.MoveToNext")); }
ScriptFunction MoveToPrevious() { mixin(MGF("mMoveToPrevious", "Function Engine.UIDataStore_OnlineGameSettings.MoveToPrevious")); }
ScriptFunction Registered() { mixin(MGF("mRegistered", "Function Engine.UIDataStore_OnlineGameSettings.Registered")); }
ScriptFunction Unregistered() { mixin(MGF("mUnregistered", "Function Engine.UIDataStore_OnlineGameSettings.Unregistered")); }
}
}
struct GameSettingsCfg
{
private ubyte __buffer__[20];
public extern(D):
private static __gshared ScriptStruct mStaticClass;
@property final static ScriptStruct StaticClass() { mixin(MGSCS("ScriptStruct Engine.UIDataStore_OnlineGameSettings.GameSettingsCfg")); }
@property final auto ref
{
ScriptName SettingsName() { mixin(MGPS("ScriptName", 12)); }
OnlineGameSettings GameSettings() { mixin(MGPS("OnlineGameSettings", 8)); }
UIDataProvider_Settings Provider() { mixin(MGPS("UIDataProvider_Settings", 4)); }
ScriptClass GameSettingsClass() { mixin(MGPS("ScriptClass", 0)); }
}
}
@property final auto ref
{
ScriptArray!(UIDataStore_OnlineGameSettings.GameSettingsCfg) GameSettingsCfgList() { mixin(MGPC("ScriptArray!(UIDataStore_OnlineGameSettings.GameSettingsCfg)", 120)); }
int SelectedIndex() { mixin(MGPC("int", 136)); }
ScriptClass SettingsProviderClass() { mixin(MGPC("ScriptClass", 132)); }
}
final:
void OnSettingProviderChanged(UIDataProvider SourceProvider, ScriptName* SettingsName = null)
{
ubyte params[12];
params[] = 0;
*cast(UIDataProvider*)params.ptr = SourceProvider;
if (SettingsName !is null)
*cast(ScriptName*)¶ms[4] = *SettingsName;
(cast(ScriptObject)this).ProcessEvent(Functions.OnSettingProviderChanged, params.ptr, cast(void*)0);
}
bool CreateGame(ubyte ControllerIndex)
{
ubyte params[8];
params[] = 0;
params[0] = ControllerIndex;
(cast(ScriptObject)this).ProcessEvent(Functions.CreateGame, params.ptr, cast(void*)0);
return *cast(bool*)¶ms[4];
}
OnlineGameSettings GetCurrentGameSettings()
{
ubyte params[4];
params[] = 0;
(cast(ScriptObject)this).ProcessEvent(Functions.GetCurrentGameSettings, params.ptr, cast(void*)0);
return *cast(OnlineGameSettings*)params.ptr;
}
UIDataProvider_Settings GetCurrentProvider()
{
ubyte params[4];
params[] = 0;
(cast(ScriptObject)this).ProcessEvent(Functions.GetCurrentProvider, params.ptr, cast(void*)0);
return *cast(UIDataProvider_Settings*)params.ptr;
}
void SetCurrentByIndex(int NewIndex)
{
ubyte params[4];
params[] = 0;
*cast(int*)params.ptr = NewIndex;
(cast(ScriptObject)this).ProcessEvent(Functions.SetCurrentByIndex, params.ptr, cast(void*)0);
}
void SetCurrentByName(ScriptName SettingsName)
{
ubyte params[8];
params[] = 0;
*cast(ScriptName*)params.ptr = SettingsName;
(cast(ScriptObject)this).ProcessEvent(Functions.SetCurrentByName, params.ptr, cast(void*)0);
}
void MoveToNext()
{
(cast(ScriptObject)this).ProcessEvent(Functions.MoveToNext, cast(void*)0, cast(void*)0);
}
void MoveToPrevious()
{
(cast(ScriptObject)this).ProcessEvent(Functions.MoveToPrevious, cast(void*)0, cast(void*)0);
}
void Registered(LocalPlayer PlayerOwner)
{
ubyte params[4];
params[] = 0;
*cast(LocalPlayer*)params.ptr = PlayerOwner;
(cast(ScriptObject)this).ProcessEvent(Functions.Registered, params.ptr, cast(void*)0);
}
void Unregistered(LocalPlayer PlayerOwner)
{
ubyte params[4];
params[] = 0;
*cast(LocalPlayer*)params.ptr = PlayerOwner;
(cast(ScriptObject)this).ProcessEvent(Functions.Unregistered, params.ptr, cast(void*)0);
}
}
|
D
|
var int Scatty_ItemsGiven_Chapter_1;
var int Scatty_ItemsGiven_Chapter_2;
var int Scatty_ItemsGiven_Chapter_3;
var int Scatty_ItemsGiven_Chapter_4;
var int Scatty_ItemsGiven_Chapter_5;
FUNC VOID B_GiveTradeInv_Addon_Scatty (var C_NPC slf)
{
if ((Kapitel >= 1)
&& (Scatty_ItemsGiven_Chapter_1 == FALSE))
{
//Special
CreateInvItems (slf,ItMi_GoldNugget_Addon,7);
//Food
CreateInvItems (slf, ItMw_2H_Axe_L_01,2);
CreateInvItems (slf,ItFo_Cheese, 5);
CreateInvItems (slf,ItFo_Bread , 5);
CreateInvItems (slf,ItFo_Water , 5);
CreateInvItems (slf,ItFo_Stew , 5);
//Tränke
CreateInvItems (slf,ItPo_Mana_02 , 4);
CreateInvItems (slf,ItPo_Health_02 , 4);
//Muni
CreateInvItems (slf, ItRw_Arrow, 50);
CreateInvItems (slf, ItRw_Bolt, 50);
CreateInvItems (slf, ItMw_Schwert2,1);
CreateInvItems (slf, ItMw_Zweihaender1,1);
CreateInvItems (slf, ItRw_Crossbow_L_02,1);
CreateInvItems (slf, ItMw_Schwert5,1);
CreateInvItems (slf, ItMw_Streitaxt2,1);
CreateInvItems (slf, ItMw_Inquisitor,1);
Scatty_ItemsGiven_Chapter_1 = TRUE;
};
if ((Kapitel >= 2)
&& (Scatty_ItemsGiven_Chapter_2 == FALSE))
{
//Food
CreateInvItems (slf, ItMw_2H_Axe_L_01,2);
CreateInvItems (slf,ItFo_Cheese, 5);
CreateInvItems (slf,ItFo_Bread , 5);
CreateInvItems (slf,ItFo_Water , 5);
CreateInvItems (slf,ItFo_Stew , 5);
//Tränke
CreateInvItems (slf,ItPo_Mana_02 , 4);
CreateInvItems (slf,ItPo_Health_02 , 4);
//Muni
CreateInvItems (slf, ItRw_Arrow, 50);
CreateInvItems (slf, ItRw_Bolt, 50);
Scatty_ItemsGiven_Chapter_2 = TRUE;
};
if ((Kapitel >= 3)
&& (Scatty_ItemsGiven_Chapter_3 == FALSE))
{
//Food
CreateInvItems (slf, ItMw_2H_Axe_L_01,2);
CreateInvItems (slf,ItFo_Cheese, 5);
CreateInvItems (slf,ItFo_Bread , 5);
CreateInvItems (slf,ItFo_Water , 5);
CreateInvItems (slf,ItFo_Stew , 5);
//Tränke
CreateInvItems (slf,ItPo_Mana_02 , 4);
CreateInvItems (slf,ItPo_Health_02 , 4);
//Muni
CreateInvItems (slf, ItRw_Arrow, 50);
CreateInvItems (slf, ItRw_Bolt, 50);
Scatty_ItemsGiven_Chapter_3 = TRUE;
};
if ((Kapitel >= 4)
&& (Scatty_ItemsGiven_Chapter_4 == FALSE))
{
//Food
CreateInvItems (slf, ItMw_2H_Axe_L_01,2);
CreateInvItems (slf,ItFo_Cheese, 5);
CreateInvItems (slf,ItFo_Bread , 5);
CreateInvItems (slf,ItFo_Water , 5);
CreateInvItems (slf,ItFo_Stew , 5);
//Tränke
CreateInvItems (slf,ItPo_Mana_02 , 4);
CreateInvItems (slf,ItPo_Health_02 , 4);
//Muni
CreateInvItems (slf, ItRw_Arrow, 50);
CreateInvItems (slf, ItRw_Bolt, 50);
Scatty_ItemsGiven_Chapter_4 = TRUE;
};
if ((Kapitel >= 5)
&& (Scatty_ItemsGiven_Chapter_5 == FALSE))
{
//Food
CreateInvItems (slf, ItMw_2H_Axe_L_01,2);
CreateInvItems (slf,ItFo_Cheese, 5);
CreateInvItems (slf,ItFo_Bread , 5);
CreateInvItems (slf,ItFo_Water , 5);
CreateInvItems (slf,ItFo_Stew , 5);
//Tränke
CreateInvItems (slf,ItPo_Mana_02 , 4);
CreateInvItems (slf,ItPo_Health_02 , 4);
//Muni
CreateInvItems (slf, ItRw_Arrow, 50);
CreateInvItems (slf, ItRw_Bolt, 50);
Scatty_ItemsGiven_Chapter_5 = TRUE;
};
};
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.