code
stringlengths 3
10M
| language
stringclasses 31
values |
---|---|
// Copyright Ferdinand Majerech 2011 - 2012.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
module dgamevfs.test;
import dgamevfs._;
import std.algorithm;
import std.file;
import std.stdio;
import std.traits;
import std.typecons;
//collectException has some kind of bug (probably lazy expressions),
//so using this instead:
bool fail(D)(D dg) if(isDelegate!D)
{
try{dg();}
catch(VFSException e){return true;}
return false;
}
bool testVFSFileInfo(VFSDir parent, string name,
Flag!"exists" exists, Flag!"writable" writable)
{
auto file = parent.file(name);
if(file.path != parent.path ~ "/" ~ name) {return false;}
if(file.exists != exists || file.writable != writable){return false;}
if(!exists && (!fail(&file.bytes) || !fail(&file.input))){return false;}
if(exists && (fail(&file.bytes) || fail(&file.input))) {return false;}
return true;
}
bool testVFSFileRead(VFSDir parent, string name, string expected)
{
auto file = parent.file(name);
VFSFileInput refcountTestIn(VFSFileInput i){return i;}
//read what we've written before
{
auto i = refcountTestIn(file.input);
auto buf = new char[expected.length * 2];
auto slice = i.read(cast(void[])buf);
if(slice.length != file.bytes || cast(string)slice != expected)
{
return false;
}
}
//should be automatically closed
if(file.open){return false;}
return true;
}
bool testVFSFileIO(VFSDir parent, string name, string data)
{
auto file = parent.file(name);
VFSFileOutput refcountTestOut(VFSFileOutput o){return o;}
//write, this should create the file if it doesn't exist yet
{
auto o = refcountTestOut(file.output);
o.write(cast(const void[])data);
}
//should be automatically closed
if(file.open){return false;}
if(fail(&file.bytes) || file.bytes != data.length || fail(&file.input))
{
return false;
}
if(!testVFSFileRead(parent, name, data))
{
return false;
}
return true;
}
bool testVFSFileSeek(VFSDir parent, string name)
{
auto file = parent.file(name);
{
auto output = file.output;
output.write(cast(const void[])"Teh smdert iz");
if(!fail({output.seek(-4, Seek.Set);}) ||
!fail({output.seek(4, Seek.End);}))
{
return false;
}
output.seek(0, Seek.Set);
output.write(cast(const void[])"The");
output.write(cast(const void[])" answaa");
output.seek(-2, Seek.Current);
output.write(cast(const void[])"er");
output.seek(-2, Seek.End);
output.write(cast(const void[])"is 42.");
}
{
auto input = file.input;
if(!fail({input.seek(-4, Seek.Set);}) ||
!fail({input.seek(4, Seek.End);}))
{
return false;
}
auto buffer = new char[3];
input.read(cast(void[])buffer);
if(buffer != "The"){return false;}
input.seek(-3, Seek.End);
input.read(cast(void[])buffer);
if(buffer != "42."){return false;}
input.seek(0, Seek.Set);
buffer = new char[file.bytes];
input.read(cast(void[])buffer);
if(buffer != "The answer is 42."){return false;}
}
return true;
}
bool testVFSDirInfo(VFSDir parent, string name, Flag!"exists" exists,
Flag!"writable" writable, Flag!"create" create)
{
auto dir = parent.dir(name);
if(dir.path != parent.path ~ "/" ~ name) {return false;}
if(dir.exists != exists || dir.writable != writable){return false;}
if(!create){return true;}
dir.create();
if(!dir.exists){return false;}
return true;
}
bool testVFSDirFiles(VFSDir dir, Flag!"deep" deep)
{
foreach(file; dir.files(deep))
{
auto sepsAdded = count(file.path, '/') - count(dir.path, '/');
if(sepsAdded < 1){return false;}
if(!file.exists){return false;}
}
return true;
}
bool testVFSDirDirs(VFSDir dir, Flag!"deep" deep)
{
foreach(sub; dir.dirs(deep))
{
auto sepsAdded = count(sub.path, '/') - count(dir.path, '/');
if(sepsAdded < 1){return false;}
if(!sub.exists){return false;}
}
return true;
}
bool testVFSDirContents(VFSDir dir, string[] expectedFiles, string[] expectedDirs, string glob = null)
{
alias std.algorithm.remove remove;
foreach(file; dir.files(Yes.deep, glob))
{
if(!canFind(expectedFiles, file.path))
{
writeln("FAILED file iteration (unexpected file ", file.path, ")");
//Unexpected file.
return false;
}
expectedFiles = remove!((string a){return a == file.path;})(expectedFiles);
}
foreach(sub; dir.dirs(Yes.deep, glob))
{
if(!canFind(expectedDirs, sub.path))
{
writeln("FAILED directory iteration (unexpected directory ", sub.path, ")");
//Unexpected directory.
return false;
}
expectedDirs = remove!((string a){return a == sub.path;})(expectedDirs);
}
if(expectedFiles.length > 0 || expectedDirs.length > 0)
{
writeln("FAILED file/directory iteration (unexpected files, dirs: ",
expectedFiles, expectedDirs, ")");
//Missing file/directory.
return false;
}
return true;
}
bool testVFSDirGlob(VFSDir root)
{
assert(root.path == "root");
auto dirsCreate = ["fonts",
"fonts/ttf",
"fonts/otf",
"fonts/extra",
"shaders",
"shaders/extra",
"txt"];
auto filesCreate = ["fonts/config.txt",
"fonts/ttf/a.ttf",
"fonts/ttf/info.txt",
"fonts/ttf/b.ttf",
"fonts/otf/a.otf",
"fonts/otf/otf.txt",
"fonts/extra/bitmapfont.png",
"shaders/extra/info.txt",
"shaders/extra/effect.frag",
"shaders/extra/effect.vert"];
with(root)
{
foreach(subdir; dirsCreate)
{
dir(subdir).create();
}
foreach(subfile; filesCreate)
{
file(subfile).output.write(cast(const void[])"42");
}
//Containing font:
auto fontDirs = ["root/fonts",
"root/fonts/ttf",
"root/fonts/otf",
"root/fonts/extra"];
auto fontFiles = ["root/fonts/config.txt",
"root/fonts/ttf/a.ttf",
"root/fonts/ttf/info.txt",
"root/fonts/ttf/b.ttf",
"root/fonts/otf/a.otf",
"root/fonts/otf/otf.txt",
"root/fonts/extra/bitmapfont.png"];
//Containing extra:
auto extraDirs = ["root/fonts/extra", "root/shaders/extra"];
auto extraFiles = ["root/fonts/extra/bitmapfont.png",
"root/shaders/extra/info.txt",
"root/shaders/extra/effect.frag",
"root/shaders/extra/effect.vert"];
//Ending with ttf:
auto ttfDirs = ["root/fonts/ttf"];
auto ttfFiles = ["root/fonts/ttf/a.ttf", "root/fonts/ttf/b.ttf"];
//Ending with .txt:
auto txtDirs = cast(string[])[];
auto txtFiles = ["root/fonts/config.txt",
"root/fonts/ttf/info.txt",
"root/fonts/otf/otf.txt",
"root/shaders/extra/info.txt"];
//Containing tf:
auto tfDirs = ["root/fonts/ttf", "root/fonts/otf"];
auto tfFiles = ["root/fonts/ttf/a.ttf",
"root/fonts/ttf/info.txt",
"root/fonts/ttf/b.ttf",
"root/fonts/otf/a.otf",
"root/fonts/otf/otf.txt"];
if(!testVFSDirContents(root, fontFiles, fontDirs, "*font*") ||
!testVFSDirContents(root, extraFiles, extraDirs, "*extra*") ||
!testVFSDirContents(root, ttfFiles, ttfDirs, "*ttf") ||
!testVFSDirContents(root, txtFiles, txtDirs, "*.txt") ||
!testVFSDirContents(root, tfFiles, tfDirs, "*tf*"))
{
return false;
}
}
return true;
}
bool testVFSStream(VFSFile file)
{
{
auto output = VFSStream(file.output);
auto buf = "42\n";
output.writeExact(cast(void*)buf.ptr, buf.length);
output.writefln("%d * %d == %d", 6, 9, 42);
}
if(file.open){return false;}
{
auto input = VFSStream(file.input, file.bytes);
if(input.getc() != '4' || input.getc() != '2' || input.getc() != '\n')
{
return false;
}
auto line = input.readLine();
if(line != "6 * 9 == 42") {return false;}
if(input.stream.available > 0){return false;}
}
if(file.open){return false;}
return true;
}
bool testVFSDirMain(VFSDir root)
{
//We expect these to be true from the start.
if(!root.exists || !root.writable || root.path != "root"){return false;}
string answer = "The answer is 42.";
//Nonexistent file:
if(!testVFSFileInfo(root, "file1", No.exists, Yes.writable) ||
!testVFSFileIO(root, "file1", answer))
{
writeln("FAILED nonexistent file");
return false;
}
//Direct file access: (file1 exists now)
if(!testVFSFileInfo(root, "file1", Yes.exists, Yes.writable) ||
!testVFSFileRead(root, "file1", answer))
{
writeln("FAILED existing file");
return false;
}
//Invalid file paths:
if(!fail({root.file("a::c");}) || !fail({root.file("nonexistent_subdir/file");}))
{
writeln("FAILED invalid file paths");
return false;
}
//Creating subdirectories:
if(!testVFSDirInfo(root, "sub1", No.exists, Yes.writable, Yes.create) ||
!testVFSDirInfo(root, "sub1/sub2", No.exists, Yes.writable, Yes.create))
{
writeln("FAILED creating subdirectories");
return false;
}
foreach(char c; 'A' .. 'Z')
{
auto name = "sub1/sub2/sub" ~ c;
if(!testVFSDirInfo(root, name, No.exists, Yes.writable, Yes.create))
{
writeln("FAILED creating many subdirectories");
return false;
}
auto sub = root.dir(name);
foreach(char f; '1' .. '9')
{
auto fname = "file" ~ f;
if(!testVFSFileInfo(sub, fname, No.exists, Yes.writable) ||
!testVFSFileIO(sub, fname, answer))
{
writeln("FAILED creating files in subdirectories");
return false;
}
}
}
//File in a subdirectory:
if(!testVFSFileInfo(root, "sub1/sub2/subN/file5", Yes.exists, Yes.writable) ||
!testVFSFileIO(root, "sub1/sub2/subN/file5", answer))
{
writeln("FAILED file in a subdirectory");
return false;
}
//Seeking:
if(!testVFSFileSeek(root, "seek_test"))
{
writeln("FAILED file seeking");
return false;
}
//Subdirectory:
{
auto sub = root.dir("subdir");
//sub doesn't exist yet:
if(!fail({sub.file("file");}))
{
writeln("FAILED subdirectory file/dir access");
return false;
}
sub.create();
//Now it exists:
if(fail({sub.file("file");}))
{
writeln("FAILED subdirectory file/dir access");
return false;
}
//Looking for a file in a subdir of sub that doesn't exist:
if(!fail({sub.file("subdir2/file");}))
{
writeln("FAILED subdirectory file/dir access");
return false;
}
}
//files()/dirs():
if(!testVFSDirFiles(root, No.deep) || !testVFSDirFiles(root, Yes.deep) ||
!testVFSDirDirs(root, No.deep) || !testVFSDirDirs(root, Yes.deep))
{
writeln("FAILED file/directory iteration");
return false;
}
//Globbing:
if(!testVFSDirGlob(root))
{
writeln("FAILED globbing");
return false;
}
//created before
auto sub = root.dir("sub1");
//files()/dirs() from a subdir:
if(!testVFSDirFiles(sub, No.deep) || !testVFSDirFiles(sub, Yes.deep) ||
!testVFSDirDirs(sub, No.deep) || !testVFSDirDirs(sub, Yes.deep))
{
writeln("FAILED file/directory iteration in a subdirectory");
return false;
}
//We added some files to subdirs, so files().length should be less that files(Yes.deep).length:
if(root.files().length >= root.files(Yes.deep).length ||
root.dirs().length >= root.dirs(Yes.deep).length)
{
writeln("FAILED file/directory iteration item count");
return false;
}
//Nonexistent dir:
{
auto dir = root.dir("nonexistent");
if(!fail({dir.file("file");}) ||
!fail({dir.dir("dir");}) ||
!fail({dir.files();}) ||
!fail({dir.dirs();}))
{
writeln("FAILED nonexistent directory");
return false;
}
}
//VFSStream:
if(!testVFSStream(root.file("stream")))
{
writeln("FAILED VFSStream");
return false;
}
return true;
}
bool testMemoryDir()
{
auto memoryDir = new MemoryDir("root");
//basic info methods
if(!memoryDir.writable || memoryDir.exists ||
memoryDir.path != memoryDir.name || memoryDir.path != "root")
{
writeln("FAILED MemoryDir info");
return false;
}
//create
memoryDir.create();
if(!memoryDir.exists)
{
writeln("FAILED MemoryDir create");
return false;
}
if(!testVFSDirMain(memoryDir))
{
writeln("FAILED MemoryDir general");
return false;
}
//remove
memoryDir.dir("subdir").create();
memoryDir.remove();
if(memoryDir.exists)
{
writeln("FAILED memoryDir remove");
return false;
}
return true;
}
bool testStackDirMount()
{
auto cycle1 = new StackDir("cycle1");
auto cycle2 = new StackDir("cycle2");
cycle1.mount(cycle2);
if(!fail({cycle2.mount(cycle1);}))
{
writeln("FAILED circular mounting");
return false;
}
auto parent = new StackDir("parent");
auto child = new MemoryDir("child");
auto main = new StackDir("main");
parent.mount(child);
if(fail({main.mount(child);}))
{
writeln("FAILED mounting a dir with parent");
return false;
}
auto child2 = new StackDir("child");
if(!fail({parent.mount(child2);}))
{
writeln("FAILED mounting a dir with same name");
return false;
}
return true;
}
bool testStackDirStacking()
{
//Initialize directory structure:
auto mainPkg = new MemoryDir("main");
with(mainPkg)
{
create();
dir("fonts").create();
dir("fonts/ttf").create();
dir("fonts/otf").create();
file("fonts/ttf/a.ttf").output.write(cast(const void[])"42");
file("fonts/otf/b.otf").output.write(cast(const void[])"42");
dir("logs").create();
dir("shaders").create();
file("shaders/font.vert").output.write(cast(const void[])"42");
file("shaders/font.frag").output.write(cast(const void[])"42");
writable = false;
}
auto userPkg = new MemoryDir("user");
with(userPkg)
{
create();
dir("fonts").create();
dir("fonts/ttf").create();
file("fonts/ttf/a.ttf").output.write(cast(const void[])"42");
dir("logs").create();
dir("shaders").create();
dir("maps").create();
}
auto modPkg = new MemoryDir("mod");
auto modLog = "mod/logs/memory.log";
with(modPkg)
{
create();
dir("logs").create();
dir("shaders").create();
file("shaders/font.vert").output.write(cast(const void[])"42");
file("logs/memory.log").output.write(cast(const void[])modLog);
writable = false;
}
auto stackDir = new StackDir("root");
stackDir.mount(mainPkg);
stackDir.mount(userPkg);
stackDir.mount(modPkg);
if(!stackDir.writable || !stackDir.exists)
{
writeln("FAILED stackdir info");
return false;
}
//File/dir access:
{
//Should find the right file to get bytes() and read from:
if(!testVFSFileRead(stackDir.dir("logs"), "memory.log", modLog))
{
writeln("FAILED stackdir read");
return false;
}
//This should write to the "user" package.
stackDir.dir("logs").file("memory.log").output.write(cast(const void[])"out");
//This should read from the "mod" package
if(!testVFSFileRead(stackDir.dir("logs"), "memory.log", modLog))
{
writeln("FAILED stackdir read shadowing written");
return false;
}
if(!testVFSFileRead(stackDir.dir("user::logs"), "memory.log", "out"))
{
writeln("FAILED stackdir explicitly read written");
return false;
}
}
//File/dir iteration:
auto expectedFiles = ["root/logs/memory.log",
"root/shaders/font.vert",
"root/shaders/font.frag",
"root/fonts/ttf/a.ttf",
"root/fonts/otf/b.otf"];
auto expectedDirs = ["root/logs",
"root/shaders",
"root/maps",
"root/fonts",
"root/fonts/ttf",
"root/fonts/otf"];
if(!testVFSDirContents(stackDir, expectedFiles, expectedDirs))
{
writeln("FAILED file/directory iteration");
return false;
}
expectedFiles = ["root/fonts/ttf/a.ttf",
"root/fonts/otf/b.otf"];
expectedDirs = ["root/fonts/ttf",
"root/fonts/otf"];
if(!testVFSDirContents(stackDir.dir("fonts"), expectedFiles, expectedDirs))
{
writeln("FAILED file/directory iteration in a subdirectory");
return false;
}
return true;
}
bool testStackDir()
{
//General:
{
auto mainPkg = new MemoryDir("main");
auto userPkg = new MemoryDir("user");
auto stackDir = new StackDir("root");
stackDir.mount(mainPkg);
stackDir.mount(userPkg);
//basic info methods
if(!stackDir.writable || stackDir.exists ||
stackDir.path != stackDir.name || stackDir.path != "root")
{
writeln("FAILED StackDir info");
return false;
}
//create
stackDir.create();
if(!stackDir.exists)
{
writeln("FAILED StackDir create");
return false;
}
if(!testVFSDirMain(stackDir))
{
writeln("FAILED StackDir general");
return false;
}
//remove
stackDir.dir("subdir").create();
stackDir.remove();
if(stackDir.exists)
{
writeln("FAILED stackDir remove");
return false;
}
}
//Mounting:
if(!testStackDirMount())
{
writeln("FAILED StackDir mount");
return false;
}
//Stacking:
if(!testStackDirStacking())
{
writeln("FAILED StackDir stacking");
return false;
}
return true;
}
bool testFSDir()
{
auto path = "testFSDir";
if(exists(path)){rmdirRecurse(path);}
mkdir(path);
scope(exit){rmdirRecurse(path);}
auto fsDir = new FSDir("root", path ~ "/root", Yes.writable);
//basic info methods
if(!fsDir.writable || fsDir.exists ||
fsDir.path != fsDir.name || fsDir.path != "root")
{
writeln(cast(bool)fsDir.writable, " ", fsDir.exists, " ",
fsDir.path, " ", fsDir.name);
writeln("FAILED FSDir info");
return false;
}
//create
fsDir.create();
if(!fsDir.exists)
{
writeln("FAILED FSDir create");
return false;
}
if(!testVFSDirMain(fsDir))
{
writeln("FAILED FSDir general");
return false;
}
//remove
fsDir.dir("subdir").create();
fsDir.remove();
if(fsDir.exists)
{
writeln("FAILED FSDir remove");
return false;
}
return true;
}
unittest
{
writeln("---------- ",
testMemoryDir() ? "SUCCESS" : "FAILURE",
" MemoryDir unittest ", "----------");
writeln("---------- ",
testStackDir() ? "SUCCESS" : "FAILURE",
" StackDir unittest ", "----------");
writeln("---------- ",
testFSDir() ? "SUCCESS" : "FAILURE",
" FSDir unittest ", "----------");
}
void main()
{
writeln("Done");
}
| D |
an unhappy and worried mental state
(physics) a secondary influence on a system that causes it to deviate slightly
activity that is a malfunction, intrusion, or interruption
a disposition that is confused or nervous and upset
the act of causing disorder
| D |
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/target.d, _target.d)
* Documentation: https://dlang.org/phobos/dmd_target.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/target.d
*/
module dmd.target;
import dmd.argtypes;
import core.stdc.string : strlen;
import dmd.cppmangle;
import dmd.cppmanglewin;
import dmd.dclass;
import dmd.declaration;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.expression;
import dmd.func;
import dmd.globals;
import dmd.id;
import dmd.identifier;
import dmd.mtype;
import dmd.typesem;
import dmd.tokens : TOK;
import dmd.utils : toDString;
import dmd.root.ctfloat;
import dmd.root.outbuffer;
/**
* Describes a back-end target. At present it is incomplete, but in the future
* it should grow to contain most or all target machine and target O/S specific
* information.
*
* In many cases, calls to sizeof() can't be used directly for getting data type
* sizes since cross compiling is supported and would end up using the host
* sizes rather than the target sizes.
*/
struct Target
{
// D ABI
uint ptrsize; /// size of a pointer in bytes
uint realsize; /// size a real consumes in memory
uint realpad; /// padding added to the CPU real size to bring it up to realsize
uint realalignsize; /// alignment for reals
uint classinfosize; /// size of `ClassInfo`
ulong maxStaticDataSize; /// maximum size of static data
// C ABI
uint c_longsize; /// size of a C `long` or `unsigned long` type
uint c_long_doublesize; /// size of a C `long double`
uint criticalSectionSize; /// size of os critical section
// C++ ABI
bool reverseCppOverloads; /// set if overloaded functions are grouped and in reverse order (such as in dmc and cl)
bool cppExceptions; /// set if catching C++ exceptions is supported
bool twoDtorInVtable; /// target C++ ABI puts deleting and non-deleting destructor into vtable
/**
* Values representing all properties for floating point types
*/
extern (C++) struct FPTypeProperties(T)
{
real_t max; /// largest representable value that's not infinity
real_t min_normal; /// smallest representable normalized value that's not 0
real_t nan; /// NaN value
real_t snan; /// signalling NaN value
real_t infinity; /// infinity value
real_t epsilon; /// smallest increment to the value 1
d_int64 dig = T.dig; /// number of decimal digits of precision
d_int64 mant_dig = T.mant_dig; /// number of bits in mantissa
d_int64 max_exp = T.max_exp; /// maximum int value such that 2$(SUPERSCRIPT `max_exp-1`) is representable
d_int64 min_exp = T.min_exp; /// minimum int value such that 2$(SUPERSCRIPT `min_exp-1`) is representable as a normalized value
d_int64 max_10_exp = T.max_10_exp; /// maximum int value such that 10$(SUPERSCRIPT `max_10_exp` is representable)
d_int64 min_10_exp = T.min_10_exp; /// minimum int value such that 10$(SUPERSCRIPT `min_10_exp`) is representable as a normalized value
void _init()
{
max = T.max;
min_normal = T.min_normal;
nan = T.nan;
snan = T.init;
infinity = T.infinity;
epsilon = T.epsilon;
}
}
FPTypeProperties!float FloatProperties; ///
FPTypeProperties!double DoubleProperties; ///
FPTypeProperties!real_t RealProperties; ///
/**
* Initialize the Target
*/
extern (C++) void _init(ref const Param params)
{
FloatProperties._init();
DoubleProperties._init();
RealProperties._init();
// These have default values for 32 bit code, they get
// adjusted for 64 bit code.
ptrsize = 4;
classinfosize = 0x4C; // 76
/* gcc uses int.max for 32 bit compilations, and long.max for 64 bit ones.
* Set to int.max for both, because the rest of the compiler cannot handle
* 2^64-1 without some pervasive rework. The trouble is that much of the
* front and back end uses 32 bit ints for sizes and offsets. Since C++
* silently truncates 64 bit ints to 32, finding all these dependencies will be a problem.
*/
maxStaticDataSize = int.max;
if (params.isLP64)
{
ptrsize = 8;
classinfosize = 0x98; // 152
}
if (params.isLinux || params.isFreeBSD || params.isOpenBSD || params.isDragonFlyBSD || params.isSolaris)
{
realsize = 12;
realpad = 2;
realalignsize = 4;
c_longsize = 4;
twoDtorInVtable = true;
}
else if (params.isOSX)
{
realsize = 16;
realpad = 6;
realalignsize = 16;
c_longsize = 4;
twoDtorInVtable = true;
}
else if (params.isWindows)
{
realsize = 10;
realpad = 0;
realalignsize = 2;
reverseCppOverloads = true;
twoDtorInVtable = false;
c_longsize = 4;
if (ptrsize == 4)
{
/* Optlink cannot deal with individual data chunks
* larger than 16Mb
*/
maxStaticDataSize = 0x100_0000; // 16Mb
}
}
else
assert(0);
if (params.is64bit)
{
if (params.isLinux || params.isFreeBSD || params.isDragonFlyBSD || params.isSolaris)
{
realsize = 16;
realpad = 6;
realalignsize = 16;
c_longsize = 8;
}
else if (params.isOSX)
{
c_longsize = 8;
}
}
c_long_doublesize = realsize;
if (params.is64bit && params.isWindows)
c_long_doublesize = 8;
criticalSectionSize = getCriticalSectionSize(params);
cppExceptions = params.isLinux || params.isFreeBSD ||
params.isDragonFlyBSD || params.isOSX;
}
/**
* Deinitializes the global state of the compiler.
*
* This can be used to restore the state set by `_init` to its original
* state.
*/
void deinitialize()
{
this = this.init;
}
/**
* Requested target memory alignment size of the given type.
* Params:
* type = type to inspect
* Returns:
* alignment in bytes
*/
extern (C++) uint alignsize(Type type)
{
assert(type.isTypeBasic());
switch (type.ty)
{
case Tfloat80:
case Timaginary80:
case Tcomplex80:
return target.realalignsize;
case Tcomplex32:
if (global.params.isLinux || global.params.isOSX || global.params.isFreeBSD || global.params.isOpenBSD ||
global.params.isDragonFlyBSD || global.params.isSolaris)
return 4;
break;
case Tint64:
case Tuns64:
case Tfloat64:
case Timaginary64:
case Tcomplex64:
if (global.params.isLinux || global.params.isOSX || global.params.isFreeBSD || global.params.isOpenBSD ||
global.params.isDragonFlyBSD || global.params.isSolaris)
return global.params.is64bit ? 8 : 4;
break;
default:
break;
}
return cast(uint)type.size(Loc.initial);
}
/**
* Requested target field alignment size of the given type.
* Params:
* type = type to inspect
* Returns:
* alignment in bytes
*/
extern (C++) uint fieldalign(Type type)
{
const size = type.alignsize();
if ((global.params.is64bit || global.params.isOSX) && (size == 16 || size == 32))
return size;
return (8 < size) ? 8 : size;
}
/**
* Size of the target OS critical section.
* Returns:
* size in bytes
*/
extern (C++) uint critsecsize()
{
return criticalSectionSize;
}
private static uint getCriticalSectionSize(ref const Param params) pure
{
if (params.isWindows)
{
// sizeof(CRITICAL_SECTION) for Windows.
return params.isLP64 ? 40 : 24;
}
else if (params.isLinux)
{
// sizeof(pthread_mutex_t) for Linux.
if (params.is64bit)
return params.isLP64 ? 40 : 32;
else
return params.isLP64 ? 40 : 24;
}
else if (params.isFreeBSD)
{
// sizeof(pthread_mutex_t) for FreeBSD.
return params.isLP64 ? 8 : 4;
}
else if (params.isOpenBSD)
{
// sizeof(pthread_mutex_t) for OpenBSD.
return params.isLP64 ? 8 : 4;
}
else if (params.isDragonFlyBSD)
{
// sizeof(pthread_mutex_t) for DragonFlyBSD.
return params.isLP64 ? 8 : 4;
}
else if (params.isOSX)
{
// sizeof(pthread_mutex_t) for OSX.
return params.isLP64 ? 64 : 44;
}
else if (params.isSolaris)
{
// sizeof(pthread_mutex_t) for Solaris.
return 24;
}
assert(0);
}
/**
* Type for the `va_list` type for the target.
* NOTE: For Posix/x86_64 this returns the type which will really
* be used for passing an argument of type va_list.
* Returns:
* `Type` that represents `va_list`.
*/
extern (C++) Type va_listType()
{
if (global.params.isWindows)
{
return Type.tchar.pointerTo();
}
else if (global.params.isLinux || global.params.isFreeBSD || global.params.isOpenBSD || global.params.isDragonFlyBSD ||
global.params.isSolaris || global.params.isOSX)
{
if (global.params.is64bit)
{
return (new TypeIdentifier(Loc.initial, Identifier.idPool("__va_list_tag"))).pointerTo();
}
else
{
return Type.tchar.pointerTo();
}
}
else
{
assert(0);
}
}
/**
* Checks whether the target supports a vector type.
* Params:
* sz = vector type size in bytes
* type = vector element type
* Returns:
* 0 vector type is supported,
* 1 vector type is not supported on the target at all
* 2 vector element type is not supported
* 3 vector size is not supported
*/
extern (C++) int isVectorTypeSupported(int sz, Type type)
{
if (!global.params.is64bit && !global.params.isOSX)
return 1; // not supported
switch (type.ty)
{
case Tvoid:
case Tint8:
case Tuns8:
case Tint16:
case Tuns16:
case Tint32:
case Tuns32:
case Tfloat32:
case Tint64:
case Tuns64:
case Tfloat64:
break;
default:
return 2; // wrong base type
}
if (sz != 16 && !(global.params.cpu >= CPU.avx && sz == 32))
return 3; // wrong size
return 0;
}
/**
* Checks whether the target supports the given operation for vectors.
* Params:
* type = target type of operation
* op = the unary or binary op being done on the `type`
* t2 = type of second operand if `op` is a binary operation
* Returns:
* true if the operation is supported or type is not a vector
*/
extern (C++) bool isVectorOpSupported(Type type, ubyte op, Type t2 = null)
{
import dmd.tokens;
if (type.ty != Tvector)
return true; // not a vector op
auto tvec = cast(TypeVector) type;
bool supported;
switch (op)
{
case TOK.negate, TOK.uadd:
supported = tvec.isscalar();
break;
case TOK.lessThan, TOK.greaterThan, TOK.lessOrEqual, TOK.greaterOrEqual, TOK.equal, TOK.notEqual, TOK.identity, TOK.notIdentity:
supported = false;
break;
case TOK.leftShift, TOK.leftShiftAssign, TOK.rightShift, TOK.rightShiftAssign, TOK.unsignedRightShift, TOK.unsignedRightShiftAssign:
supported = false;
break;
case TOK.add, TOK.addAssign, TOK.min, TOK.minAssign:
supported = tvec.isscalar();
break;
case TOK.mul, TOK.mulAssign:
// only floats and short[8]/ushort[8] (PMULLW)
if (tvec.isfloating() || tvec.elementType().size(Loc.initial) == 2 ||
// int[4]/uint[4] with SSE4.1 (PMULLD)
global.params.cpu >= CPU.sse4_1 && tvec.elementType().size(Loc.initial) == 4)
supported = true;
else
supported = false;
break;
case TOK.div, TOK.divAssign:
supported = tvec.isfloating();
break;
case TOK.mod, TOK.modAssign:
supported = false;
break;
case TOK.and, TOK.andAssign, TOK.or, TOK.orAssign, TOK.xor, TOK.xorAssign:
supported = tvec.isintegral();
break;
case TOK.not:
supported = false;
break;
case TOK.tilde:
supported = tvec.isintegral();
break;
case TOK.pow, TOK.powAssign:
supported = false;
break;
default:
// import std.stdio : stderr, writeln;
// stderr.writeln(op);
assert(0, "unhandled op " ~ Token.toString(cast(TOK)op));
}
return supported;
}
/**
* Mangle the given symbol for C++ ABI.
* Params:
* s = declaration with C++ linkage
* Returns:
* string mangling of symbol
*/
extern (C++) const(char)* toCppMangle(Dsymbol s)
{
static if (TARGET.Linux || TARGET.OSX || TARGET.FreeBSD || TARGET.OpenBSD || TARGET.DragonFlyBSD || TARGET.Solaris)
return toCppMangleItanium(s);
else static if (TARGET.Windows)
return toCppMangleMSVC(s);
else
static assert(0, "fix this");
}
/**
* Get RTTI mangling of the given class declaration for C++ ABI.
* Params:
* cd = class with C++ linkage
* Returns:
* string mangling of C++ typeinfo
*/
extern (C++) const(char)* cppTypeInfoMangle(ClassDeclaration cd)
{
static if (TARGET.Linux || TARGET.OSX || TARGET.FreeBSD || TARGET.OpenBSD || TARGET.Solaris || TARGET.DragonFlyBSD)
return cppTypeInfoMangleItanium(cd);
else static if (TARGET.Windows)
return cppTypeInfoMangleMSVC(cd);
else
static assert(0, "fix this");
}
/**
* Gets vendor-specific type mangling for C++ ABI.
* Params:
* t = type to inspect
* Returns:
* string if type is mangled specially on target
* null if unhandled
*/
extern (C++) const(char)* cppTypeMangle(Type t)
{
return null;
}
/**
* Get the type that will really be used for passing the given argument
* to an `extern(C++)` function.
* Params:
* p = parameter to be passed.
* Returns:
* `Type` to use for parameter `p`.
*/
extern (C++) Type cppParameterType(Parameter p)
{
Type t = p.type.merge2();
if (p.storageClass & (STC.out_ | STC.ref_))
t = t.referenceTo();
else if (p.storageClass & STC.lazy_)
{
// Mangle as delegate
Type td = new TypeFunction(ParameterList(), t, LINK.d);
td = new TypeDelegate(td);
t = merge(t);
}
return t;
}
/**
* Checks whether type is a vendor-specific fundamental type.
* Params:
* t = type to inspect
* isFundamental = where to store result
* Returns:
* true if isFundamental was set by function
*/
extern (C++) bool cppFundamentalType(const Type t, ref bool isFundamental)
{
return false;
}
/**
* Default system linkage for the target.
* Returns:
* `LINK` to use for `extern(System)`
*/
extern (C++) LINK systemLinkage()
{
return global.params.isWindows ? LINK.windows : LINK.c;
}
/**
* Describes how an argument type is passed to a function on target.
* Params:
* t = type to break down
* Returns:
* tuple of types if type is passed in one or more registers
* empty tuple if type is always passed on the stack
* null if the type is a `void` or argtypes aren't supported by the target
*/
extern (C++) TypeTuple toArgTypes(Type t)
{
if (global.params.is64bit && global.params.isWindows)
return null;
return .toArgTypes(t);
}
/**
* Determine return style of function - whether in registers or
* through a hidden pointer to the caller's stack.
* Params:
* tf = function type to check
* needsThis = true if the function type is for a non-static member function
* Returns:
* true if return value from function is on the stack
*/
extern (C++) bool isReturnOnStack(TypeFunction tf, bool needsThis)
{
if (tf.isref)
{
//printf(" ref false\n");
return false; // returns a pointer
}
Type tn = tf.next.toBasetype();
//printf("tn = %s\n", tn.toChars());
d_uns64 sz = tn.size();
Type tns = tn;
if (global.params.isWindows && global.params.is64bit)
{
// http://msdn.microsoft.com/en-us/library/7572ztz4.aspx
if (tns.ty == Tcomplex32)
return true;
if (tns.isscalar())
return false;
tns = tns.baseElemOf();
if (tns.ty == Tstruct)
{
StructDeclaration sd = (cast(TypeStruct)tns).sym;
if (tf.linkage == LINK.cpp && needsThis)
return true;
if (!sd.isPOD() || sz > 8)
return true;
if (sd.fields.dim == 0)
return true;
}
if (sz <= 16 && !(sz & (sz - 1)))
return false;
return true;
}
else if (global.params.isWindows && global.params.mscoff)
{
Type tb = tns.baseElemOf();
if (tb.ty == Tstruct)
{
if (tf.linkage == LINK.cpp && needsThis)
return true;
}
}
Lagain:
if (tns.ty == Tsarray)
{
tns = tns.baseElemOf();
if (tns.ty != Tstruct)
{
L2:
if (global.params.isLinux && tf.linkage != LINK.d && !global.params.is64bit)
{
// 32 bit C/C++ structs always on stack
}
else
{
switch (sz)
{
case 1:
case 2:
case 4:
case 8:
//printf(" sarray false\n");
return false; // return small structs in regs
// (not 3 byte structs!)
default:
break;
}
}
//printf(" sarray true\n");
return true;
}
}
if (tns.ty == Tstruct)
{
StructDeclaration sd = (cast(TypeStruct)tns).sym;
if (global.params.isLinux && tf.linkage != LINK.d && !global.params.is64bit)
{
//printf(" 2 true\n");
return true; // 32 bit C/C++ structs always on stack
}
if (global.params.isWindows && tf.linkage == LINK.cpp && !global.params.is64bit &&
sd.isPOD() && sd.ctor)
{
// win32 returns otherwise POD structs with ctors via memory
return true;
}
if (sd.arg1type && !sd.arg2type)
{
tns = sd.arg1type;
if (tns.ty != Tstruct)
goto L2;
goto Lagain;
}
else if (global.params.is64bit && !sd.arg1type && !sd.arg2type)
return true;
else if (sd.isPOD())
{
switch (sz)
{
case 1:
case 2:
case 4:
case 8:
//printf(" 3 false\n");
return false; // return small structs in regs
// (not 3 byte structs!)
case 16:
if (!global.params.isWindows && global.params.is64bit)
return false;
break;
default:
break;
}
}
//printf(" 3 true\n");
return true;
}
else if ((global.params.isLinux || global.params.isOSX ||
global.params.isFreeBSD || global.params.isSolaris ||
global.params.isDragonFlyBSD) &&
tf.linkage == LINK.c &&
tns.iscomplex())
{
if (tns.ty == Tcomplex32)
return false; // in EDX:EAX, not ST1:ST0
else
return true;
}
else
{
//assert(sz <= 16);
//printf(" 4 false\n");
return false;
}
}
/***
* Determine the size a value of type `t` will be when it
* is passed on the function parameter stack.
* Params:
* loc = location to use for error messages
* t = type of parameter
* Returns:
* size used on parameter stack
*/
extern (C++) ulong parameterSize(const ref Loc loc, Type t)
{
if (!global.params.is64bit &&
(global.params.isFreeBSD || global.params.isOSX))
{
/* These platforms use clang, which regards a struct
* with size 0 as being of size 0 on the parameter stack,
* even while sizeof(struct) is 1.
* It's an ABI incompatibility with gcc.
*/
if (t.ty == Tstruct)
{
auto ts = cast(TypeStruct)t;
if (ts.sym.hasNoFields)
return 0;
}
}
const sz = t.size(loc);
return global.params.is64bit ? (sz + 7) & ~7 : (sz + 3) & ~3;
}
// this guarantees `getTargetInfo` and `allTargetInfos` remain in sync
private enum TargetInfoKeys
{
cppRuntimeLibrary,
cppStd,
floatAbi,
objectFormat,
}
/**
* Get targetInfo by key
* Params:
* name = name of targetInfo to get
* loc = location to use for error messages
* Returns:
* Expression for the requested targetInfo
*/
extern (C++) Expression getTargetInfo(const(char)* name, const ref Loc loc)
{
StringExp stringExp(const(char)[] sval)
{
return new StringExp(loc, cast(void*)sval.ptr, sval.length);
}
switch (name.toDString) with (TargetInfoKeys)
{
case objectFormat.stringof:
if (global.params.isWindows)
return stringExp(global.params.mscoff ? "coff" : "omf");
else if (global.params.isOSX)
return stringExp("macho");
else
return stringExp("elf");
case floatAbi.stringof:
return stringExp("hard");
case cppRuntimeLibrary.stringof:
if (global.params.isWindows)
{
if (global.params.mscoff)
return stringExp(global.params.mscrtlib);
return stringExp("snn");
}
return stringExp("");
case cppStd.stringof:
return new IntegerExp(cast(uint)global.params.cplusplus);
default:
return null;
}
}
}
extern (C++) __gshared Target target;
| D |
a former kingdom in north-central Europe including present-day northern Germany and northern Poland
| D |
/Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Leaf.build/Buffer/Buffer+Leaf.swift.o : /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/libc.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Polymorphic.swiftmodule
/Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Leaf.build/Buffer+Leaf~partial.swiftmodule : /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/libc.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Polymorphic.swiftmodule
/Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Leaf.build/Buffer+Leaf~partial.swiftdoc : /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Argument.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Byte+Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Constants.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Context.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/HTMLEscape.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafComponent.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/LeafError.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Link.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/List.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Node+Rendered.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/NSData+File.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Parameter.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Render.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem+Spawn.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Stem.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer+Leaf.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/Buffer.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Buffer/BufferProtocol.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/BasicTag.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Tag.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/TagTemplate.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Else.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Embed.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Equal.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Export.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Extend.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/If.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Import.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Index.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Loop.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Raw.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Uppercased.swift /Users/okasho/serverProject/tryswift/get_and_post/swift/Packages/Leaf-1.0.6/Sources/Leaf/Tag/Models/Variable.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Core.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/libc.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Node.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/PathIndexable.swiftmodule /Users/okasho/serverProject/tryswift/get_and_post/swift/.build/debug/Polymorphic.swiftmodule
| D |
module zyre.message;
import zyre.generated;
import zyre.resource;
import zyre.logger;
import std.experimental.allocator : theAllocator, make, dispose;
class ZyreMessage(bool owner) {
private {
SharedResource _msg;
}
@property inout(zmsg_t)** handle() inout @trusted pure nothrow {
return cast(typeof(return)) _msg.handle;
}
@property inout(zmsg_t)* unsafeHandle() inout @trusted pure nothrow {
return cast(typeof(return)) *handle;
}
@property bool valid() {
DEBUG!"valid check (%d %d)"(handle != null, unsafeHandle != null);
if (handle != null) {
if (unsafeHandle != null) {
return true;
}
}
return false;
}
@property int signal() in {
assert(valid, "should be valid");
} do {
return zmsg_signal(unsafeHandle);
}
@property size_t length() in {
assert(valid, "should be valid");
} do {
return zmsg_size(unsafeHandle);
}
@property size_t contentLength() in {
assert(valid, "should be valid");
} do {
return zmsg_content_size(unsafeHandle);
}
ZyreMessage dup() in {
assert(valid, "should be valid");
} do {
zmsg_t* msg = zmsg_dup(unsafeHandle);
if (msg == null) {
throw new Exception("failed to duplicate");
}
return theAllocator.make!(ZyreMessage)(msg);
}
void print() in {
assert(valid, "should be valid");
} do {
zmsg_print(unsafeHandle);
}
// Ownership is toggleable (i.e ZyreMessage!(false)(msg); )
this(zmsg_t* msg) {
assert(msg != null, "message should not be null");
assert(zmsg_is(msg), "should look like a message");
static Exception release(shared(void)* ptr) @trusted nothrow {
zmsg_t** n = cast(zmsg_t**)ptr;
if (n == null) {
return new Exception("did not expect safe pointer to be freed");
}
static if (owner) {
zmsg_destroy(n);
}
theAllocator.dispose(n);
return null;
}
zmsg_t** safePtr = theAllocator.make!(zmsg_t*)();
assert(safePtr != null, "memory allocation failed");
*safePtr = msg;
_msg = SharedResource(cast(shared)safePtr, &release);
}
import std.stdio : File;
this(File f) {
zmsg_t* msg = zmsg_load(cast(FILE*)f.getFP());
if (msg == null) {
throw new Exception("could not read message");
}
this(msg);
}
this(string path) {
// load
import std.path : buildNormalizedPath, expandTilde;
File f = File(path.expandTilde.buildNormalizedPath);
this(f);
f.close();
}
this(zframe_t* frame) {
zmsg_t* msg = zmsg_decode(frame);
if (msg == null) {
throw new Exception("could not decode message");
}
this(msg);
}
this() {
this(zmsg_new());
}
}
| D |
/Users/hdcui/blind_sig_project/bld_sig/target/release/build/hyper-30d3e9b90c56b628/build_script_build-30d3e9b90c56b628: /Users/hdcui/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.12.35/build.rs
/Users/hdcui/blind_sig_project/bld_sig/target/release/build/hyper-30d3e9b90c56b628/build_script_build-30d3e9b90c56b628.d: /Users/hdcui/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.12.35/build.rs
/Users/hdcui/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.12.35/build.rs:
| D |
/Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Outlaw.build/Objects-normal/x86_64/Date+Value.o : /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSON.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Updatable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexUpdatable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+Extractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+IndexExtractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Serializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSONSerializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexSerializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Deserializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexDeserializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/URL+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Date+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/String+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Bool+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Float+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Int+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/UInt+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+Enum.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+Enum.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSONCollection.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+map.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/OutlawError.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/UpdatableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexUpdatableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/SerializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexSerializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/DeserializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexDeserializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Index.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Key.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary.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 /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Target\ Support\ Files/Outlaw/Outlaw-umbrella.h /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Outlaw.build/unextended-module.modulemap
/Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Outlaw.build/Objects-normal/x86_64/Date+Value~partial.swiftmodule : /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSON.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Updatable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexUpdatable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+Extractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+IndexExtractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Serializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSONSerializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexSerializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Deserializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexDeserializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/URL+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Date+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/String+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Bool+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Float+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Int+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/UInt+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+Enum.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+Enum.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSONCollection.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+map.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/OutlawError.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/UpdatableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexUpdatableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/SerializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexSerializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/DeserializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexDeserializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Index.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Key.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary.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 /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Target\ Support\ Files/Outlaw/Outlaw-umbrella.h /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Outlaw.build/unextended-module.modulemap
/Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Outlaw.build/Objects-normal/x86_64/Date+Value~partial.swiftdoc : /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSON.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Updatable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexUpdatable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+Extractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+IndexExtractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Serializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSONSerializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexSerializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Deserializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexDeserializable.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/URL+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Date+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/String+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Bool+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Float+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Int+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/UInt+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Value.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+Enum.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+Enum.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/JSONCollection.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+map.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/OutlawError.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/UpdatableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexUpdatableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/SerializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexSerializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/DeserializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexDeserializableWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Extractable+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/IndexExtractable+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Set+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary+ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/ValueWithContext.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Index.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Array.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Key.swift /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Outlaw/Sources/Outlaw/Dictionary.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 /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Pods/Target\ Support\ Files/Outlaw/Outlaw-umbrella.h /Volumes/Element-Mac/_development/_ios/_training/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Outlaw.build/unextended-module.modulemap
| D |
instance DIA_Biff_DI_EXIT(C_Info)
{
npc = DJG_713_Biff_DI;
nr = 999;
condition = DIA_Biff_DI_EXIT_Condition;
information = DIA_Biff_DI_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Biff_DI_EXIT_Condition()
{
return TRUE;
};
func void DIA_Biff_DI_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Biff_DI_HALLO(C_Info)
{
npc = DJG_713_Biff_DI;
nr = 10;
condition = DIA_Biff_DI_HALLO_Condition;
information = DIA_Biff_DI_HALLO_Info;
important = TRUE;
};
func int DIA_Biff_DI_HALLO_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (Npc_IsDead(UndeadDragon) == FALSE))
{
return TRUE;
};
};
func void DIA_Biff_DI_HALLO_Info()
{
AI_Output(self,other,"DIA_Biff_DI_HALLO_07_00"); //And? Where are the riches you promised me?
if(Npc_KnowsInfo(other,DIA_Biff_DI_ORKS) == FALSE)
{
AI_Output(other,self,"DIA_Biff_DI_HALLO_15_01"); //So what did I tell you earlier, at sea?
};
AI_Output(other,self,"DIA_Biff_DI_HALLO_15_02"); //For now, your task is to guard this ship.
AI_Output(other,self,"DIA_Biff_DI_HALLO_15_03"); //I don't fancy swimming all the way back.
AI_Output(self,other,"DIA_Biff_DI_HALLO_07_04"); //Crap. If I had known that, I'd have stayed in Khorinis.
AI_StopProcessInfos(self);
};
instance DIA_Biff_DI_perm(C_Info)
{
npc = DJG_713_Biff_DI;
nr = 5;
condition = DIA_Biff_DI_perm_Condition;
information = DIA_Biff_DI_perm_Info;
permanent = TRUE;
description = "All ship-shape aboard?";
};
func int DIA_Biff_DI_perm_Condition()
{
if(Npc_KnowsInfo(other,DIA_Biff_DI_HALLO) && (Npc_IsDead(UndeadDragon) == FALSE))
{
return TRUE;
};
};
func void DIA_Biff_DI_perm_Info()
{
AI_Output(other,self,"DIA_Biff_DI_perm_15_00"); //All ship-shape aboard?
AI_Output(self,other,"DIA_Biff_DI_perm_07_01"); //(irritated) Yeah, yeah. All is quiet.
AI_StopProcessInfos(self);
};
instance DIA_Biff_DI_ORKS(C_Info)
{
npc = DJG_713_Biff_DI;
nr = 5;
condition = DIA_Biff_DI_ORKS_Condition;
information = DIA_Biff_DI_ORKS_Info;
important = TRUE;
};
func int DIA_Biff_DI_ORKS_Condition()
{
if((Npc_GetDistToWP(self,"DI_SHIP_03") < 1000) && (ORkSturmDI == TRUE) && (Npc_IsDead(UndeadDragon) == FALSE))
{
return TRUE;
};
};
func void DIA_Biff_DI_ORKS_Info()
{
AI_Output(self,other,"DIA_Biff_DI_ORKS_07_00"); //Those dirty beasts!
AI_Output(other,self,"DIA_Biff_DI_ORKS_15_01"); //Damnit, what are you doing up here? You're supposed to guard the ship.
AI_Output(self,other,"DIA_Biff_DI_ORKS_07_02"); //It's not going to sink any time soon, man.
B_GivePlayerXP(XP_Ambient);
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"Start");
};
instance DIA_Biff_DI_UNDEADDRGDEAD(C_Info)
{
npc = DJG_713_Biff_DI;
nr = 4;
condition = DIA_Biff_DI_UNDEADDRGDEAD_Condition;
information = DIA_Biff_DI_UNDEADDRGDEAD_Info;
important = TRUE;
};
func int DIA_Biff_DI_UNDEADDRGDEAD_Condition()
{
if(Npc_IsDead(UndeadDragon))
{
return TRUE;
};
};
func void DIA_Biff_DI_UNDEADDRGDEAD_Info()
{
AI_Output(self,other,"DIA_Biff_DI_UNDEADDRGDEAD_07_00"); //Was that it, then?
AI_Output(other,self,"DIA_Biff_DI_UNDEADDRGDEAD_15_01"); //That was it for now.
AI_Output(self,other,"DIA_Biff_DI_UNDEADDRGDEAD_07_02"); //Now, can I ...
AI_Output(other,self,"DIA_Biff_DI_UNDEADDRGDEAD_15_03"); //You can raid the entire island for all I care.
AI_Output(self,other,"DIA_Biff_DI_UNDEADDRGDEAD_07_04"); //Great.
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"PlunderTempel");
};
instance DIA_Biff_DI_plunder(C_Info)
{
npc = DJG_713_Biff_DI;
nr = 5;
condition = DIA_Biff_DI_plunder_Condition;
information = DIA_Biff_DI_plunder_Info;
important = TRUE;
};
func int DIA_Biff_DI_plunder_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && Npc_KnowsInfo(other,DIA_Biff_DI_plunder) && Npc_IsDead(UndeadDragon))
{
return TRUE;
};
};
func void DIA_Biff_DI_plunder_Info()
{
AI_Output(self,other,"DIA_Biff_DI_plunder_07_00"); //Damn. Not now.
AI_StopProcessInfos(self);
};
instance DIA_Biff_DI_PICKPOCKET(C_Info)
{
npc = DJG_713_Biff_DI;
nr = 900;
condition = DIA_Biff_DI_PICKPOCKET_Condition;
information = DIA_Biff_DI_PICKPOCKET_Info;
permanent = TRUE;
description = Pickpocket_100;
};
func int DIA_Biff_DI_PICKPOCKET_Condition()
{
return C_Beklauen(92,450);
};
func void DIA_Biff_DI_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Biff_DI_PICKPOCKET);
Info_AddChoice(DIA_Biff_DI_PICKPOCKET,Dialog_Back,DIA_Biff_DI_PICKPOCKET_BACK);
Info_AddChoice(DIA_Biff_DI_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Biff_DI_PICKPOCKET_DoIt);
};
func void DIA_Biff_DI_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Biff_DI_PICKPOCKET);
};
func void DIA_Biff_DI_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Biff_DI_PICKPOCKET);
};
| D |
/*
* Copyright (c) 2017-2018 sel-project
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
/**
* Copyright: 2017-2018 sel-project
* License: MIT
* Authors: Kripth
* Source: $(HTTP github.com/sel-project/selery/source/selery/node/plugin/config.d, selery/node/plugin/config.d)
*/
module selery.node.plugin.config;
import std.ascii : newline;
import std.conv : to, ConvException;
import std.string : split, join, strip, indexOf;
import std.traits : isArray;
import selery.node.plugin.file;
enum _;
struct Value(T) {
alias Type = T;
string name;
T def;
}
Value!T value(T)(string name, T def) {
return Value!T(name, def);
}
/**
* Container for configuration files with compile-time format
* and members.
*
* The file is saved in a text file in format "field: value",
* one per line, with every value converted into a string.
* Supported values are the basic numeric types, string and
* arrays of these two.
*
* Use $(D value) to indicate a field with a static type, $(D _) to
* insert an empty line and a string to insert a comment.
*
* Example:
* ---
* Config!(Value!string("name"), _, Value!uint("players", 0), Value!uint("max", 256), _, Value!(uint[])("array")) example;
* assert(example.players == 0);
* assert(example.max == 256);
*
* alias Example = Config!("comment", value("field", "value"), _, value("int", 12u));
* Example.init.save("example.txt");
* assert(read("example.txt") == "# comment\nfield: value\n\nint: 12\n"); // with posix's line-endings
* ---
*/
struct Config(E...) if(areValidArgs!E) {
private string file;
mixin((){
string ret;
foreach(immutable i, T; E) {
static if(!is(T == _) && !is(typeof(T) : string)) {
ret ~= "E[" ~ to!string(i) ~ "].Type " ~ T.name ~ "=E[" ~ to!string(i) ~ "].def;";
}
}
return ret;
}());
/**
* Loads the values from a file.
* Throws:
* ConvException if one of the value cannot be converted from string to the requested one
* FileException on file error
*/
public void load(string sep=":", string mod=__MODULE__)(string file) {
if(exists!mod(file)) {
string[] lines = (cast(string)read!mod(file)).split("\n");
foreach(string line ; lines) {
if(line.length && line[0] != '#') {
auto index = line.indexOf(sep);
if(index > 0) {
string name = line[0..index].strip;
string value = line[index+1..$].strip;
foreach(immutable i, T; E) {
static if(!is(T == _) && !is(typeof(T) : string)) {
if(name == T.name) {
static if(!isArray!(T.Type) || is(T.Type : string)) {
try {
mixin("this." ~ T.name ~ " = to!(T.Type)(value);");
} catch(ConvException) {}
} else {
foreach(el ; value.split(",")) {
try {
mixin("this." ~ T.name ~ " ~= to!(typeof(T.Type.init[0]))(el.strip);");
} catch(ConvException) {}
}
}
}
}
}
}
}
}
}
this.file = file;
}
/**
* Saves the field's values into a file. If none is given
* the values are saved in the same file they have been
* loaded from (if the load method has been called), otherwise
* the file is not saved.
* Throws:
* FileException on file error
* Example:
* ---
* example.save("example.txt");
* example.save("dir/test.txt");
* assert(read("example.txt") == read("dir/test.txt"));
* ---
*/
public void save(string sep=":", string mod=__MODULE__)(string file) {
string data;
foreach(immutable i, T; E) {
static if(is(T == _)) {
data ~= newline;
} else static if(is(typeof(T) : string)) {
data ~= "# " ~ T ~ newline;
} else {
data ~= T.name ~ sep ~ " ";
static if(!isArray!(T.Type) || is(T.Type : string)) {
mixin("data ~= to!string(this." ~ T.name ~ ");");
} else {
mixin("auto array = this." ~ T.name ~ ";");
string[] d;
foreach(a ; array) d ~= to!string(a);
data ~= d.join(", ");
}
data ~= newline;
}
}
write!mod(file, data);
}
/// ditto
public void save(string sep=":", string mod=__MODULE__)() {
if(this.file.length) this.save!(sep, mod)(this.file);
}
}
private bool areValidArgs(E...)() {
foreach(T ; E) {
static if(!is(T == _) && !is(typeof(T) : string) && !is(T == struct) && !is(typeof(T.name) == string) && !is(typeof(T.def) == T.Type)) return false;
}
return true;
}
| D |
/* Digital Mars DMDScript source code.
* Copyright (c) 2000-2002 by Chromium Communications
* D version Copyright (c) 2004-2010 by Digital Mars
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
* written by Walter Bright
* http://www.digitalmars.com
*
* D2 port by Dmitry Olshansky
*
* DMDScript is implemented in the D Programming Language,
* http://www.digitalmars.com/d/
*
* For a C++ implementation of DMDScript, including COM support, see
* http://www.digitalmars.com/dscript/cppscript.html
*/
module dmdscript.iterator;
import std.algorithm.sorting;
import dmdscript.script;
import dmdscript.dobject;
import dmdscript.value;
import dmdscript.property;
Dobject getPrototype(Dobject o)
{
version(all)
{
return o.internal_prototype; // use internal [[Prototype]]
}
else
{
// use "prototype"
Value *v;
v = o.Get(TEXT_prototype);
if(!v || v.isPrimitive())
return null;
o = v.toObject();
return o;
}
}
struct Iterator
{
Value[] keys;
size_t keyindex;
Dobject o;
Dobject ostart;
CallContext* callcontext;
debug
{
enum uint ITERATOR_VALUE = 0x1992836;
uint foo = ITERATOR_VALUE;
}
invariant()
{
debug assert(foo == ITERATOR_VALUE);
}
void ctor(CallContext* cc, Dobject o)
{
debug foo = ITERATOR_VALUE;
//writef("Iterator: o = %p, p = %p\n", o, p);
ostart = o;
this.o = o;
this.callcontext = cc;
keys = o.proptable.table.keys.sort!((a, b) => a.compare(cc, b) < 0).release;
keyindex = 0;
}
Value *next()
{
Property* p;
//writef("Iterator::done() p = %p\n", p);
for(;; keyindex++)
{
while(keyindex == keys.length)
{
destroy(keys);
o = getPrototype(o);
if(!o)
return null;
keys = o.proptable.table.keys.sort!((a, b) => a.compare(this.callcontext, b) < 0).release;
keyindex = 0;
}
Value* key = &keys[keyindex];
p = *key in o.proptable.table;
if(!p) // if no longer in property table
continue;
if(p.attributes & DontEnum)
continue;
else
{
// ECMA 12.6.3
// Do not enumerate those properties in prototypes
// that are overridden
if(o != ostart)
{
for(Dobject ot = ostart; ot != o; ot = getPrototype(ot))
{
// If property p is in t, don't enumerate
if(*key in ot.proptable.table)
goto Lcontinue;
}
}
keyindex++;
return key; //&p.value;
Lcontinue:
;
}
}
assert(0);
}
}
| D |
// PERMUTE_ARGS:
// REQUIRED_ARGS: -D -Dd${RESULTS_DIR}/compilable -o-
// POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh
module ddoc10325;
/** */
template templ(T...)
if (someConstraint!T)
{
}
/** */
void foo(T)(T t)
if (someConstraint!T)
{
}
| D |
module std.typeinfo.ti_Along;
import kernel.core.system;
// long[]
class TypeInfo_Al : TypeInfo
{
char[] toString() { return "long[]"; }
hash_t getHash(void *p)
{ long[] s = *cast(long[]*)p;
size_t len = s.length;
auto str = s.ptr;
hash_t hash = 0;
while (len)
{
hash *= 9;
hash += *cast(uint *)str + *(cast(uint *)str + 1);
str++;
len--;
}
return hash;
}
int equals(void *p1, void *p2)
{
long[] s1 = *cast(long[]*)p1;
long[] s2 = *cast(long[]*)p2;
return s1.length == s2.length &&
memcmp(cast(ubyte*)s1.ptr, cast(ubyte*)s2.ptr, s1.length * long.sizeof) == 0;
}
int compare(void *p1, void *p2)
{
long[] s1 = *cast(long[]*)p1;
long[] s2 = *cast(long[]*)p2;
size_t len = s1.length;
if (s2.length < len)
len = s2.length;
for (size_t u = 0; u < len; u++)
{
if (s1[u] < s2[u])
return -1;
else if (s1[u] > s2[u])
return 1;
}
if (s1.length < s2.length)
return -1;
else if (s1.length > s2.length)
return 1;
return 0;
}
size_t tsize()
{
return (long[]).sizeof;
}
uint flags()
{
return 1;
}
TypeInfo next()
{
return typeid(long);
}
}
// ulong[]
class TypeInfo_Am : TypeInfo_Al
{
char[] toString() { return "ulong[]"; }
int compare(void *p1, void *p2)
{
ulong[] s1 = *cast(ulong[]*)p1;
ulong[] s2 = *cast(ulong[]*)p2;
size_t len = s1.length;
if (s2.length < len)
len = s2.length;
for (size_t u = 0; u < len; u++)
{
if (s1[u] < s2[u])
return -1;
else if (s1[u] > s2[u])
return 1;
}
if (s1.length < s2.length)
return -1;
else if (s1.length > s2.length)
return 1;
return 0;
}
TypeInfo next()
{
return typeid(ulong);
}
}
| D |
/*
Copyright (c) 2013 Andrey Penechko
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license the "Software" to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module anchovy.graphics.interfaces.irenderer;
private import std.stdio;
public import anchovy.graphics.texrectarray;
public import anchovy.graphics.font.fontmanager;
private {
import std.stdio;
import std.string;
//import anchovy.graphics.mesh;
import anchovy.core.types;
import anchovy.graphics.texture;
import anchovy.graphics.shaderprogram;
}
interface IRenderer
{
void bindShaderProgram(uint shaderName);
void bindShaderProgram(ref ShaderProgram program);
//void renderMesh(Mesh mesh);
Texture createTexture(string filename);
void bindTexture(Texture texture, uint textureUnit = 0);
void enableAlphaBlending();
void disableAlphaBlending();
uint createShaderProgram(string vertexSource, string fragmentSource);
uint registerShaderProgram(ShaderProgram program);
void drawRect(Rect rect);
void fillRect(Rect rect);
final void drawTexRect(Rect target, ivec2 sourcePos, Texture texture)
{
drawTexRect(target, Rect(sourcePos, target.size), texture);
}
void drawTexRect(Rect target, Rect source, Texture texture);
void drawTexRectArray(TexRectArray array, ivec2 position, Texture texture, ShaderProgram customProgram = null);
void setColor(in Color newColor);
void setColor(in Color4f newColor);
void setClearColor(in Color color);
uvec2 windowSize();
void flush();
} | D |
a measuring instrument for determining the specific gravity of a liquid or solid
| D |
a type of inflatable air mattress
| 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_6_MobileMedia-2557776751.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_6_MobileMedia-2557776751.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
/Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/Objects-normal/x86_64/AppDelegate.o : /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/Lab8.3/AppDelegate.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Lab8_3+CoreDataModel.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/Lab8.3/ViewController.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Students+CoreDataProperties.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Students+CoreDataClass.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/Lab8.3/AppDelegate.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Lab8_3+CoreDataModel.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/Lab8.3/ViewController.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Students+CoreDataProperties.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Students+CoreDataClass.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/Lab8.3/AppDelegate.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Lab8_3+CoreDataModel.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/Lab8.3/ViewController.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Students+CoreDataProperties.swift /Users/danielmuraveyko/Google\ Drive/Xcode/Lab8.3/DerivedData/Lab8.3/Build/Intermediates/Lab8.3.build/Debug-iphonesimulator/Lab8.3.build/DerivedSources/CoreDataGenerated/Lab8_3/Students+CoreDataClass.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
| D |
/Users/Juli/Documents/Swift/Eventy/Build/Intermediates.noindex/IBDesignables/Intermediates.noindex/Eventy.build/Debug-iphonesimulator/Eventy.build/Objects-normal/x86_64/DateAndTimeControl.o : /Users/Juli/Documents/Swift/Eventy/Eventy/AppDelegate.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventTableViewCell.swift /Users/Juli/Documents/Swift/Eventy/Eventy/DateAndTimeControl.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventTableViewController.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventViewController.swift /Users/Juli/Documents/Swift/Eventy/Eventy/Event.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/os.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/os.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/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Juli/Documents/Swift/Eventy/Build/Intermediates.noindex/IBDesignables/Intermediates.noindex/Eventy.build/Debug-iphonesimulator/Eventy.build/Objects-normal/x86_64/DateAndTimeControl~partial.swiftmodule : /Users/Juli/Documents/Swift/Eventy/Eventy/AppDelegate.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventTableViewCell.swift /Users/Juli/Documents/Swift/Eventy/Eventy/DateAndTimeControl.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventTableViewController.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventViewController.swift /Users/Juli/Documents/Swift/Eventy/Eventy/Event.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/os.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/os.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/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Juli/Documents/Swift/Eventy/Build/Intermediates.noindex/IBDesignables/Intermediates.noindex/Eventy.build/Debug-iphonesimulator/Eventy.build/Objects-normal/x86_64/DateAndTimeControl~partial.swiftdoc : /Users/Juli/Documents/Swift/Eventy/Eventy/AppDelegate.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventTableViewCell.swift /Users/Juli/Documents/Swift/Eventy/Eventy/DateAndTimeControl.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventTableViewController.swift /Users/Juli/Documents/Swift/Eventy/Eventy/EventViewController.swift /Users/Juli/Documents/Swift/Eventy/Eventy/Event.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/os.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/os.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/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
// This file is part of Visual D
//
// Visual D integrates the D programming language into Visual Studio
// Copyright (c) 2010-2011 by Rainer Schuetze, All Rights Reserved
//
// License for redistribution is given by the Artistic License 2.0
// see file LICENSE for further details
module vdc.parser.decl;
import vdc.util;
import vdc.lexer;
import vdc.parser.engine;
import vdc.parser.expr;
import vdc.parser.misc;
import vdc.parser.tmpl;
import vdc.parser.mod;
import ast = vdc.ast.all;
//-- GRAMMAR_BEGIN --
//Declaration:
// alias LinkageAttribute_opt Decl
// typedef Decl /* for legacy code */
// Decl
// alias Identifier this
class Declaration
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_alias:
p.pushState(&shiftAlias);
return Accept;
case TOK_typedef:
p.pushState(&shiftTypedef);
p.pushState(&Decl!true.enter);
return Accept;
default:
return Decl!true.enter(p);
}
}
static Action shiftAlias(Parser p)
{
switch(p.tok.id)
{
case TOK_extern:
p.pushState(&shiftAliasLinkage);
p.pushState(&Decl!true.enter);
return LinkageAttribute.enter(p);
case TOK_Identifier:
p.pushToken(p.tok);
p.pushState(&shiftAliasIdentifier);
return Accept;
default:
p.pushState(&shiftTypedef);
return Decl!true.enter(p);
}
}
static Action shiftAliasLinkage(Parser p)
{
auto decl = p.popNode!(ast.Decl)();
auto link = p.popNode!(ast.AttributeSpecifier)();
p.combineAttributes(decl.attr, link.attr);
p.pushNode(decl);
return Forward;
}
// assumes identifier token on the info stack
static Action shiftAliasIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_this:
auto tok = p.popToken();
p.pushNode(new ast.AliasThis(tok));
p.pushState(&shiftAliasThis);
return Accept;
default:
p.pushState(&shiftTypedef);
return Decl!true.enterTypeIdentifier(p);
}
}
static Action shiftAliasThis(Parser p)
{
switch(p.tok.id)
{
case TOK_semicolon:
return Accept;
default:
return p.parseError("semicolon expected after alias this;");
}
}
static Action shiftTypedef(Parser p)
{
//p.appendReplaceTopNode(new ast.AliasDeclaration(p.tok));
p.topNode!(ast.Decl)().isAlias = true;
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//Decl:
// StorageClasses Decl
// BasicType BasicTypes2_opt Declarators ;
// BasicType BasicTypes2_opt Declarator FunctionBody
// AutoDeclaration
//
//AutoDeclaration:
// StorageClasses Identifier = AssignExpression ;
class Decl(bool checkSemi = true)
{
// storage class stored in Decl.attr, first child is Type (TOK_auto if not present)
static Action enter(Parser p)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// switch here from AttributeSpecifier when detecting a '(' after const,etc
// assumes modifier token on the info stack
static Action enterAttributeSpecifier(Parser p)
{
assert(p.tok.id == TOK_lparen);
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
// disambiguate "const x" and "const(int) x"
// assumes modifier token on the info stack
static Action shiftTypeModifier(Parser p)
{
if(p.tok.id == TOK_lparen)
{
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
auto decl = p.topNode!(ast.Decl)();
Token tok = p.popToken();
p.combineAttributes(decl.attr, tokenToAttribute(tok.id));
return shiftStorageClass(p);
}
static Action enterAfterStorageClass(Parser p, TokenId storage)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
decl.attr = tokenToAttribute(storage);
return shiftStorageClass(p);
}
static Action shiftStorageClass(Parser p)
{
if(p.tok.id == TOK_Identifier)
{
p.pushToken(p.tok);
p.pushState(&shiftIdentifier);
return Accept;
}
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
auto decl = p.topNode!(ast.Decl)();
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// switch here from Statement when detecting a declaration after an identifier
// assumes identifier token on the info stack
static Action enterTypeIdentifier(Parser p)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
// assumes identifier token on the info stack
static Action enterIdentifier(Parser p)
{
auto decl = new ast.Decl(p.tok);
decl.hasSemi = checkSemi;
p.pushNode(decl);
return shiftIdentifier(p);
}
// assumes identifier token on the info stack
static Action shiftIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_assign:
auto bt = new ast.AutoType(TOK_auto, p.topToken().span);
p.topNode!(ast.Decl)().addMember(bt);
p.pushState(&shiftDeclarators);
return Declarators.enterAfterIdentifier(p);
case TOK_lparen:
// storageclass identifier(... must be function with auto return
auto bt = new ast.AutoType(TOK_auto, p.topToken().span);
p.topNode!(ast.Decl).addMember(bt);
p.pushState(&shiftDeclarators);
return Declarators.enterAfterIdentifier(p);
default:
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
}
// assumes identifier token on the info stack
static Action enterAutoReturn(Parser p)
{
assert(p.tok.id == TOK_lparen);
auto decl = new ast.Decl(p.topToken());
decl.hasSemi = checkSemi;
p.pushNode(decl);
auto bt = new ast.AutoType(TOK_auto, p.topToken().span);
decl.addMember(bt);
p.pushState(&shiftDeclarators);
return Declarators.enterAfterIdentifier(p);
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicTypes2);
return BasicTypes2.enter(p);
default:
return shiftBasicTypes2(p);
}
}
static Action shiftBasicTypes2(Parser p)
{
p.popAppendTopNode!(ast.Decl, ast.Type)();
p.pushState(&shiftDeclarators);
return Declarators.enter(p);
}
static Action shiftDeclarators(Parser p)
{
p.popAppendTopNode!(ast.Decl)();
static if(checkSemi)
{
if(p.tok.id == TOK_RECOVER)
return Forward;
auto decl = p.topNode!(ast.Decl)();
if(decl.members.length == 2 && // BasicType and Declarators
decl.members[1].members.length == 1 && // only one declarator
FunctionBody.isInitTerminal(p.tok))
{
decl.hasSemi = false;
p.pushState(&shiftFunctionBody);
return FunctionBody.enter(p);
}
if(p.tok.id != TOK_semicolon)
return p.parseError("semicolon expected after declaration");
return Accept;
}
else
{
return Forward;
}
}
static Action shiftFunctionBody(Parser p)
{
p.popAppendTopNode!(ast.Decl)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//Declarators:
// DeclaratorInitializer
// DeclaratorInitializer , DeclaratorIdentifierList
class Declarators
{
mixin ListNode!(ast.Declarators, DeclaratorInitializer, TOK_comma);
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
p.pushNode(new ast.Declarators(p.tok));
p.pushState(&shift);
return DeclaratorInitializer.enterAfterIdentifier(p);
}
}
//-- GRAMMAR_BEGIN --
//DeclaratorInitializer:
// Declarator
// Declarator = Initializer
class DeclaratorInitializer
{
mixin OptionalNode!(ast.DeclaratorInitializer, Declarator, TOK_assign, Initializer);
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_assign:
auto tok = p.popToken();
p.pushNode(new ast.Declarator(tok));
return shiftSubType1(p);
default:
p.pushState(&shiftSubType1);
return Declarator.enterAfterIdentifier(p);
}
}
}
//-- GRAMMAR_BEGIN --
//DeclaratorIdentifierList:
// DeclaratorIdentifier
// DeclaratorIdentifier , DeclaratorIdentifierList
class DeclaratorIdentifierList
{
mixin ListNode!(ast.DeclaratorIdentifierList, DeclaratorIdentifier, TOK_comma);
}
//-- GRAMMAR_BEGIN --
//DeclaratorIdentifier:
// Identifier
// Identifier = Initializer
class DeclaratorIdentifier
{
mixin OptionalNode!(ast.DeclaratorIdentifier, Identifier, TOK_assign, Initializer);
}
//-- GRAMMAR_BEGIN --
//Initializer:
// VoidInitializer
// NonVoidInitializer
//
//NonVoidInitializer:
// AssignExpression
// ArrayInitializer /* same as ArrayLiteral? */
// StructInitializer
class Initializer
{
static Action enter(Parser p)
{
if(p.tok.id == TOK_void)
{
p.pushRollback(&rollbackVoid);
p.pushState(&shiftVoid);
return Accept;
}
// StructInitializer not implemented
return AssignExpression.enter(p);
}
static Action shiftVoid(Parser p)
{
switch(p.tok.id)
{
case TOK_dot:
return p.parseError("unexpected '.' in void initializer");
default:
p.popRollback();
p.pushNode(new ast.VoidInitializer(p.tok));
return Forward;
}
}
static Action rollbackVoid(Parser p)
{
return AssignExpression.enter(p);
}
}
//-- GRAMMAR_BEGIN --
//BasicType:
// BasicTypeX
// . IdentifierList
// IdentifierList
// Typeof
// Typeof . IdentifierList
// ModifiedType
// VectorType
//
//ModifiedType:
// const ( Type )
// immutable ( Type )
// shared ( Type )
// inout ( Type )
class BasicType
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_dot:
case TOK_Identifier:
p.pushNode(new ast.IdentifierType(p.tok));
p.pushState(&shiftIdentifierList);
return GlobalIdentifierList.enter(p);
case TOK_typeof:
p.pushState(&shiftTypeof);
return Typeof.enter(p);
mixin(case_TOKs_BasicTypeX);
p.pushNode(new ast.BasicType(p.tok));
return Accept;
mixin(case_TOKs_TypeModifier);
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
case TOK___vector:
return VectorType.enter(p);
default:
return p.parseError("unexpected token in BasicType");
}
}
// assumes modifier token on the info stack
static Action shiftTypeModifier(Parser p)
{
Token tok = p.popToken();
p.pushNode(new ast.ModifiedType(tok));
switch(p.tok.id)
{
case TOK_lparen:
p.pushState(&shiftParenType);
p.pushState(&Type.enter);
return Accept;
default:
p.pushState(&shiftType);
return Type.enter(p);
}
}
static Action shiftParenType(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected");
p.popAppendTopNode();
return Accept;
}
static Action shiftType(Parser p)
{
p.popAppendTopNode();
return Forward;
}
// entry point on token after identifier
// assumes identifier token on the info stack
static Action enterIdentifier(Parser p)
{
p.pushNode(new ast.IdentifierType(p.topToken()));
p.pushState(&shiftIdentifierList);
return IdentifierList.enterAfterIdentifier(p);
}
static Action shiftIdentifierList(Parser p)
{
p.popAppendTopNode!(ast.IdentifierType)();
return Forward;
}
static Action shiftTypeof(Parser p)
{
if(p.tok.id != TOK_dot)
return Forward;
p.pushState(&shiftTypeofIdentifierList);
p.pushState(&IdentifierList.enter);
return Accept;
}
static Action shiftTypeofIdentifierList(Parser p)
{
p.popAppendTopNode!(ast.Typeof, ast.IdentifierList)();
return Forward;
}
}
enum case_TOKs_TypeModifier = q{
case TOK_const:
case TOK_shared:
case TOK_immutable:
case TOK_inout:
};
bool isTypeModifier(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_TypeModifier);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//BasicTypeX:
// bool
// byte
// ubyte
// short
// ushort
// int
// uint
// long
// ulong
// char
// wchar
// dchar
// float
// double
// real
// ifloat
// idouble
// ireal
// cfloat
// cdouble
// creal
// void
enum case_TOKs_BasicTypeX = q{
case TOK_bool:
case TOK_byte:
case TOK_ubyte:
case TOK_short:
case TOK_ushort:
case TOK_int:
case TOK_uint:
case TOK_long:
case TOK_ulong:
case TOK_char:
case TOK_wchar:
case TOK_dchar:
case TOK_float:
case TOK_double:
case TOK_real:
case TOK_ifloat:
case TOK_idouble:
case TOK_ireal:
case TOK_cfloat:
case TOK_cdouble:
case TOK_creal:
case TOK_void:
};
bool isBasicTypeX(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_BasicTypeX);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//VectorType:
// __vector ( Type )
class VectorType
{
mixin SequenceNode!(ast.VectorType, TOK___vector, TOK_lparen, Type, TOK_rparen);
}
//-- GRAMMAR_BEGIN --
//Typeof:
// typeof ( Expression )
// typeof ( return )
class Typeof
{
static Action enter(Parser p)
{
if(p.tok.id != TOK_typeof)
return p.parseError("typeof expected");
p.pushNode(new ast.Typeof(p.tok));
p.pushState(&shiftLparen);
return Accept;
}
static Action shiftLparen(Parser p)
{
if(p.tok.id != TOK_lparen)
return p.parseError("opening parenthesis expected");
p.pushState(&shiftArgument);
return Accept;
}
static Action shiftArgument(Parser p)
{
if(p.tok.id == TOK_return)
{
p.topNode!(ast.Typeof).id = TOK_return;
p.pushState(&shiftRparen);
return Accept;
}
p.pushState(&shiftExpression);
return Expression.enter(p);
}
static Action shiftExpression(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected");
p.popAppendTopNode!(ast.Typeof)();
return Accept;
}
static Action shiftRparen(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected");
return Accept;
}
}
//-- GRAMMAR_BEGIN --
//Declarator:
// Identifier DeclaratorSuffixes_opt
class Declarator
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_Identifier:
p.pushNode(new ast.Declarator(p.tok));
p.pushState(&shiftIdentifier);
return Accept;
default:
return p.parseError("unexpected token in Declarator");
}
}
static Action shiftIdentifier(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
case TOK_lbracket:
return DeclaratorSuffixes.enter(p); // appends to Declarator
default:
return Forward;
}
}
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
auto tok = p.popToken();
p.pushNode(new ast.Declarator(tok));
return shiftIdentifier(p);
}
}
//-- GRAMMAR_BEGIN --
// always optional
//BasicType2:
// *
// [ ]
// [ AssignExpression ]
// [ AssignExpression .. AssignExpression ]
// [ Type ]
// delegate Parameters FunctionAttributes_opt
// function Parameters FunctionAttributes_opt
class BasicType2
{
enum case_TOKs = q{
case TOK_mul:
case TOK_lbracket:
case TOK_delegate:
case TOK_function:
};
static Action enter(Parser p)
{
assert(p.topNode!(ast.Type));
switch(p.tok.id)
{
case TOK_mul:
p.appendReplaceTopNode(new ast.TypePointer(p.tok));
return Accept;
case TOK_lbracket:
p.pushState(&shiftLbracket);
return Accept;
case TOK_delegate:
p.appendReplaceTopNode(new ast.TypeDelegate(p.tok));
p.pushState(&shiftParameters);
p.pushState(&Parameters.enter);
return Accept;
case TOK_function:
p.appendReplaceTopNode(new ast.TypeFunction(p.tok));
p.pushState(&shiftParameters);
p.pushState(&Parameters.enter);
return Accept;
default:
return p.parseError("unexpected token in BasicType2");
}
}
static Action shiftLbracket(Parser p)
{
switch(p.tok.id)
{
case TOK_rbracket:
p.appendReplaceTopNode(new ast.TypeDynamicArray(p.tok));
return Accept;
default:
p.pushState(&shiftTypeOrExpression);
return TypeOrExpression!TOK_rbracket.enter(p);
}
}
static Action shiftTypeOrExpression(Parser p)
{
if(cast(ast.Type) p.topNode())
{
auto keyType = p.popNode!(ast.Type);
p.appendReplaceTopNode(new ast.TypeAssocArray(p.tok));
p.topNode().addMember(keyType);
if(p.tok.id != TOK_rbracket)
return p.parseError("']' expected");
return Accept;
}
switch(p.tok.id)
{
case TOK_rbracket:
auto dim = p.popNode!(ast.Expression);
p.appendReplaceTopNode(new ast.TypeStaticArray(p.tok));
p.topNode().addMember(dim);
return Accept;
case TOK_slice:
auto low = p.popNode!(ast.Expression);
p.appendReplaceTopNode(new ast.TypeArraySlice(p.tok));
p.topNode().addMember(low);
p.pushState(&shiftSliceUpper);
p.pushState(&AssignExpression.enter);
return Accept;
default:
return p.parseError("']' expected");
}
}
static Action shiftSliceUpper(Parser p)
{
p.popAppendTopNode!(ast.TypeArraySlice)();
switch(p.tok.id)
{
case TOK_rbracket:
return Accept;
default:
return p.parseError("']' expected");
}
}
static Action shiftParameters(Parser p)
{
p.popAppendTopNode();
return shiftAttributes(p);
}
static Action shiftAttributes(Parser p)
{
switch(p.tok.id)
{
mixin(case_TOKs_MemberFunctionAttribute); // no member attributes?
auto type = p.topNode!(ast.Type);
p.combineAttributes(type.attr, tokenToAttribute(p.tok.id));
p.pushState(&shiftAttributes);
return Accept;
default:
return Forward;
}
}
}
//-- GRAMMAR_BEGIN --
//BasicTypes2:
// BasicType2
// BasicType2 BasicTypes2
class BasicTypes2
{
static Action enter(Parser p)
{
assert(p.topNode!(ast.Type));
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicType);
return BasicType2.enter(p);
default:
return p.parseError("unexpected token in BasicType2");
}
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicType);
return BasicType2.enter(p);
default:
return Forward;
}
}
}
//-- GRAMMAR_BEGIN --
//DeclaratorSuffixes:
// DeclaratorSuffix
// DeclaratorSuffix DeclaratorSuffixes
//
// obsolete C-style?
//DeclaratorSuffix:
// TemplateParameterList_opt Parameters MemberFunctionAttributes_opt Constraint_opt
// [ ]
// [ AssignExpression ]
// [ Type ]
class DeclaratorSuffixes
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
p.pushRollback(&rollbackParametersFailure);
p.pushState(&shiftParameters);
return Parameters.enter(p);
case TOK_lbracket:
p.pushState(&shiftLbracket);
return Accept;
default:
return p.parseError("opening parenthesis or bracket expected");
}
}
static Action nextSuffix(Parser p)
{
switch(p.tok.id)
{
case TOK_lbracket:
p.pushState(&shiftLbracket);
return Accept;
default:
return Forward;
}
}
static Action shiftLbracket(Parser p)
{
switch(p.tok.id)
{
case TOK_rbracket:
p.topNode().addMember(new ast.SuffixDynamicArray(p.tok));
p.pushState(&nextSuffix);
return Accept;
default:
p.pushState(&shiftTypeOrExpression);
return TypeOrExpression!(TOK_rbracket).enter(p);
}
// return p.notImplementedError("C style declarators");
}
static Action shiftTypeOrExpression(Parser p)
{
switch(p.tok.id)
{
case TOK_rbracket:
auto node = p.popNode();
ast.Node n;
if(cast(Type) node)
n = new ast.SuffixAssocArray(p.tok);
else
n = new ast.SuffixStaticArray(p.tok);
n.addMember(node);
p.topNode().addMember(n);
p.pushState(&nextSuffix);
return Accept;
default:
return p.parseError("']' expected in C style declarator");
}
}
static Action shiftParameters(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
// somehow made it through the parameters, but another parameters list follow...
return Reject; // so rollback to retry with template parameter list
mixin(case_TOKs_MemberFunctionAttribute);
p.popRollback();
auto param = p.topNode!(ast.ParameterList);
p.combineAttributes(param.attr, tokenToAttribute(p.tok.id));
p.pushState(&shiftMemberFunctionAttribute);
return Accept;
case TOK_if:
p.popRollback();
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
p.pushState(&shiftConstraint);
return Constraint.enter(p);
default:
p.popRollback();
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
return Forward;
}
}
static Action shiftMemberFunctionAttribute(Parser p)
{
switch(p.tok.id)
{
mixin(case_TOKs_MemberFunctionAttribute);
auto param = p.topNode!(ast.ParameterList);
p.combineAttributes(param.attr, tokenToAttribute(p.tok.id));
p.pushState(&shiftMemberFunctionAttribute);
return Accept;
case TOK_if:
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
p.pushState(&shiftConstraint);
return Constraint.enter(p);
default:
p.popAppendTopNode!(ast.Declarator, ast.ParameterList)();
return Forward;
}
}
static Action shiftConstraint(Parser p)
{
p.popAppendTopNode!(ast.Declarator, ast.Constraint)();
return Forward;
}
static Action rollbackParametersFailure(Parser p)
{
p.pushState(&shiftTemplateParameterList);
return TemplateParameters.enter(p);
}
static Action shiftTemplateParameterList(Parser p)
{
p.popAppendTopNode(); // append to declarator
switch(p.tok.id)
{
case TOK_lparen:
p.pushState(&shiftParametersAfterTempl);
return Parameters.enter(p);
default:
return p.parseError("parameter list expected after template arguments");
}
}
static Action shiftParametersAfterTempl(Parser p)
{
return shiftMemberFunctionAttribute(p);
}
}
//-- GRAMMAR_BEGIN --
//GlobalIdentifierList:
// IdentifierList
// . IdentifierList
class GlobalIdentifierList
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_dot:
return IdentifierList.enterGlobal(p);
default:
return IdentifierList.enter(p);
}
}
}
//-- GRAMMAR_BEGIN --
//IdentifierList:
// Identifier
// Identifier . IdentifierList
// TemplateInstance
// TemplateInstance . IdentifierList
//
// using IdentifierOrTemplateInstance
class IdentifierList
{
mixin ListNode!(ast.IdentifierList, IdentifierOrTemplateInstance, TOK_dot);
// if preceded by '.', enter here fore global scope
static Action enterGlobal(Parser p)
{
assert(p.tok.id == TOK_dot);
auto list = new ast.IdentifierList(p.tok);
list.global = true;
p.pushNode(list);
p.pushState(&shift);
p.pushState(&IdentifierOrTemplateInstance.enter);
return Accept;
}
// assumes identifier token on the info stack
static Action enterAfterIdentifier(Parser p)
{
auto list = new ast.IdentifierList(p.topToken());
p.pushNode(list);
p.pushState(&shift);
return IdentifierOrTemplateInstance.enterIdentifier(p);
}
}
class Identifier
{
static Action enter(Parser p)
{
if(p.tok.id != TOK_Identifier)
return p.parseError("identifier expected");
p.pushNode(new ast.Identifier(p.tok));
return Accept;
}
}
//-- GRAMMAR_BEGIN --
//StorageClasses:
// StorageClass
// StorageClass StorageClasses
//
//StorageClass:
// AttributeOrStorageClass
// extern
// nothrow
// pure
// synchronized
bool isStorageClass(TokenId tok)
{
switch(tok)
{
case TOK_extern:
case TOK_synchronized:
mixin(case_TOKs_FunctionAttribute);
mixin(case_TOKs_AttributeOrStorageClass);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//AttributeOrStorageClass:
// deprecated
// static
// final
// override
// abstract
// const
// auto
// scope
// __gshared
// __thread
// shared
// immutable
// inout
// ref
enum case_TOKs_AttributeOrStorageClass = q{
case TOK_deprecated:
case TOK_static:
case TOK_final:
case TOK_override:
case TOK_abstract:
case TOK_const:
case TOK_auto:
case TOK_scope:
case TOK_volatile:
case TOK___gshared:
case TOK___thread:
case TOK_shared:
case TOK_immutable:
case TOK_inout:
case TOK_ref:
};
bool isAttributeOrStorageClass(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_AttributeOrStorageClass);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//Type:
// BasicType
// BasicType Declarator2
//
//Declarator2:
// BasicType2 Declarator2
// ( Declarator2 )
// ( Declarator2 ) DeclaratorSuffixes
//
class Type
{
static Action enter(Parser p)
{
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicType);
return BasicType2.enter(p);
case TOK_lparen:
// not implemented, better forward, it might also be constructor arguments
// p.pushState(&shiftDeclarator2);
// return Accept;
default:
return Forward;
}
}
// entry point from EnumMember: Type Identifier = AssignExpression
// and ForeachType: ref_opt Type_opt Identifier
// assumes identifier pushed onto token stack
static Action enterIdentifier(Parser p)
{
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
static Action enterTypeModifier(Parser p)
{
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
static Action shiftDeclarator2(Parser p)
{
return p.notImplementedError();
}
}
//-- GRAMMAR_BEGIN --
//TypeWithModifier:
// Type
// const TypeWithModifier
// immutable TypeWithModifier
// inout TypeWithModifier
// shared TypeWithModifier
class TypeWithModifier
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_const:
case TOK_immutable:
case TOK_inout:
case TOK_shared:
p.pushToken(p.tok);
p.pushState(&shiftModifier);
return Accept;
default:
return Type.enter(p);
}
}
static Action shiftModifier(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
return Type.enterTypeModifier(p);
default:
auto tok = p.popToken();
p.pushNode(new ast.ModifiedType(tok));
p.pushState(&shiftModifiedType);
return enter(p);
}
}
static Action shiftModifiedType(Parser p)
{
p.popAppendTopNode!(ast.ModifiedType)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//Parameters:
// ( ParameterList )
// ( )
class Parameters
{
static Action enter(Parser p)
{
switch(p.tok.id)
{
case TOK_lparen:
p.pushState(&shiftLparen);
return Accept;
default:
return p.parseError("opening parenthesis expected in parameter list");
}
}
static Action shiftLparen(Parser p)
{
if(p.tok.id == TOK_rparen)
{
p.pushNode(new ast.ParameterList(p.tok));
return Accept;
}
p.pushState(&shiftParameterList);
return ParameterList.enter(p);
}
static Action shiftParameterList(Parser p)
{
if(p.tok.id != TOK_rparen)
return p.parseError("closing parenthesis expected for parameter list");
return Accept;
}
}
//-- GRAMMAR_BEGIN --
//ParameterList:
// Parameter
// Parameter , ParameterList
// Parameter ...
// ...
class ParameterList
{
static Action enter(Parser p)
{
p.pushNode(new ast.ParameterList(p.tok));
return shift(p);
}
static Action shift(Parser p)
{
switch(p.tok.id)
{
case TOK_dotdotdot:
p.topNode!(ast.ParameterList)().anonymous_varargs = true;
return Accept;
default:
p.pushState(&shiftParameter);
return Parameter.enter(p);
}
}
static Action shiftParameter(Parser p)
{
p.popAppendTopNode!(ast.ParameterList)();
switch(p.tok.id)
{
case TOK_dotdotdot:
p.topNode!(ast.ParameterList)().varargs = true;
return Accept;
case TOK_comma:
p.pushState(&shift);
return Accept;
default:
return Forward;
}
}
}
//-- GRAMMAR_BEGIN --
///* Declarator replaced with ParameterDeclarator */
//Parameter:
// InOut_opt ParameterDeclarator DefaultInitializerExpression_opt
//
//DefaultInitializerExpression:
// = AssignExpression
// = __FILE__ // already in primary expression
// = __LINE__ // already in primary expression
class Parameter
{
static Action enter(Parser p)
{
p.pushNode(new ast.Parameter(p.tok));
p.pushState(&shiftParameterDeclarator);
if(isInOut(p.tok.id))
{
p.topNode!(ast.Parameter)().io = p.tok.id;
p.pushState(&ParameterDeclarator.enter);
return Accept;
}
return ParameterDeclarator.enter(p);
}
static Action shiftParameterDeclarator(Parser p)
{
p.popAppendTopNode!(ast.Parameter)();
if(p.tok.id != TOK_assign)
return Forward;
p.pushState(&shiftInitializer);
p.pushState(&AssignExpression.enter);
return Accept;
}
static Action shiftInitializer(Parser p)
{
p.popAppendTopNode!(ast.Parameter)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//ParameterDeclarator:
// StorageClasses_opt BasicType BasicTypes2_opt Declarator_opt
// /*Identifier DeclaratorSuffixes_opt*/
class ParameterDeclarator
{
// very similar to Decl, combine?
// differences: no auto, single Declarator only
static Action enter(Parser p)
{
auto decl = new ast.ParameterDeclarator(p.tok);
p.pushNode(decl);
return shift(p);
}
static Action shift(Parser p)
{
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
auto decl = p.topNode!(ast.ParameterDeclarator)();
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// disambiguate "const x" and "const(int) x"
// assumes modifier token on the info stack
static Action shiftTypeModifier(Parser p)
{
if(p.tok.id == TOK_lparen)
{
p.pushState(&shiftBasicType);
return BasicType.shiftTypeModifier(p);
}
auto decl = p.topNode!(ast.ParameterDeclarator)();
Token tok = p.popToken();
p.combineAttributes(decl.attr, tokenToAttribute(tok.id));
return shift(p);
}
static Action shiftStorageClass(Parser p)
{
if(isTypeModifier(p.tok.id))
{
// could be storage class or BasicType
p.pushToken(p.tok);
p.pushState(&shiftTypeModifier);
return Accept;
}
if(isStorageClass(p.tok.id))
{
auto decl = p.topNode!(ast.ParameterDeclarator)();
p.combineAttributes(decl.attr, tokenToAttribute(p.tok.id));
p.combineAnnotations(decl.annotation, tokenToAnnotation(p.tok.id));
p.pushState(&shiftStorageClass);
return Accept;
}
p.pushState(&shiftBasicType);
return BasicType.enter(p);
}
// switch here from TemplateValueParameter when detecting a declaration after an identifier
// assumes identifier token on the info stack
static Action enterTypeIdentifier(Parser p)
{
auto decl = new ast.ParameterDeclarator(p.tok);
p.pushNode(decl);
p.pushState(&shiftBasicType);
return BasicType.enterIdentifier(p);
}
static Action shiftBasicType(Parser p)
{
switch(p.tok.id)
{
mixin(BasicType2.case_TOKs);
p.pushState(&shiftBasicTypes2);
return BasicTypes2.enter(p);
default:
return shiftBasicTypes2(p);
}
}
static Action shiftBasicTypes2(Parser p)
{
p.popAppendTopNode!(ast.ParameterDeclarator, ast.Type)();
if(p.tok.id != TOK_Identifier)
return Forward;
p.pushState(&shiftDeclarator);
return Declarator.enter(p);
}
static Action shiftDeclarator(Parser p)
{
p.popAppendTopNode!(ast.ParameterDeclarator)();
return Forward;
}
}
//-- GRAMMAR_BEGIN --
//InOut:
// in
// out
// ref
// lazy
// scope /* ? */
enum case_TOKs_InOut = q{
case TOK_in:
case TOK_out:
case TOK_ref:
case TOK_lazy:
case TOK_scope:
};
bool isInOut(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_InOut);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//FunctionAttributes:
// FunctionAttribute
// FunctionAttribute FunctionAttributes
//
//FunctionAttribute:
// nothrow
// pure
enum case_TOKs_FunctionAttribute = q{
case TOK_nothrow:
case TOK_pure:
case TOK_safe:
case TOK_system:
case TOK_trusted:
case TOK_property:
case TOK_disable:
};
bool isFunctionAttribute(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_FunctionAttribute);
return true;
default:
return false;
}
}
//-- GRAMMAR_BEGIN --
//MemberFunctionAttributes:
// MemberFunctionAttribute
// MemberFunctionAttribute MemberFunctionAttributes
//
//MemberFunctionAttribute:
// const
// immutable
// inout
// shared
// FunctionAttribute
//
enum case_TOKs_MemberFunctionAttribute = q{
case TOK_const:
case TOK_immutable:
case TOK_inout:
case TOK_shared:
} ~ case_TOKs_FunctionAttribute;
bool isMemberFunctionAttribute(TokenId tok)
{
switch(tok)
{
mixin(case_TOKs_MemberFunctionAttribute);
return true;
default:
return false;
}
}
| D |
/**
Utility functions for memory management
Note that this module currently is a big sand box for testing allocation related stuff.
Nothing here, including the interfaces, is final but rather a lot of experimentation.
Copyright: © 2012-2013 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.utils.memory;
import vibe.core.log;
import core.exception : OutOfMemoryError;
import core.stdc.stdlib;
import core.memory;
import std.conv;
import std.exception : enforceEx;
import std.traits;
import std.algorithm;
shared(Allocator) defaultAllocator()
{
version(VibeManualMemoryManagement){
return manualAllocator();
} else {
static shared Allocator alloc;
if( !alloc ){
alloc = new shared GCAllocator;
//alloc = new AutoFreeListAllocator(alloc);
//alloc = new DebugAllocator(alloc);
}
return alloc;
}
}
shared(Allocator) manualAllocator()
{
static shared Allocator alloc;
if( !alloc ){
alloc = new shared MallocAllocator;
alloc = new shared AutoFreeListAllocator(alloc);
//alloc = new shared DebugAllocator(alloc);
}
return alloc;
}
auto allocObject(T, bool MANAGED = true, ARGS...)(Allocator allocator, ARGS args)
{
auto mem = allocator.alloc(AllocSize!T);
static if( MANAGED ){
static if( hasIndirections!T )
GC.addRange(mem.ptr, mem.length);
auto ret = emplace!T(mem, args);
}
else static if( is(T == class) ) return cast(T)mem.ptr;
else return cast(T*)mem.ptr;
}
T[] allocArray(T, bool MANAGED = true)(shared(Allocator) allocator, size_t n)
{
auto mem = allocator.alloc(T.sizeof * n);
auto ret = cast(T[])mem;
static if( MANAGED ){
static if( hasIndirections!T )
GC.addRange(mem.ptr, mem.length);
// TODO: use memset for class, pointers and scalars
foreach (ref el; ret) {
emplace!T(cast(void[])((&el)[0 .. 1]));
}
}
return ret;
}
void freeArray(T, bool MANAGED = true)(shared(Allocator) allocator, ref T[] array)
{
static if (MANAGED && hasIndirections!T)
GC.removeRange(array.ptr);
allocator.free(cast(void[])array);
array = null;
}
shared interface Allocator {
enum size_t alignment = 0x10;
enum size_t alignmentMask = alignment-1;
void[] alloc(size_t sz)
out { assert((cast(size_t)__result.ptr & alignmentMask) == 0, "alloc() returned misaligned data."); }
void[] realloc(void[] mem, size_t new_sz)
in { assert((cast(size_t)mem.ptr & alignmentMask) == 0, "misaligned pointer passed to realloc()."); }
out { assert((cast(size_t)__result.ptr & alignmentMask) == 0, "realloc() returned misaligned data."); }
void free(void[] mem)
in { assert((cast(size_t)mem.ptr & alignmentMask) == 0, "misaligned pointer passed to free()."); }
}
synchronized class DebugAllocator : Allocator {
private {
shared(Allocator) m_baseAlloc;
size_t[void*] m_blocks;
size_t m_bytes;
size_t m_maxBytes;
}
shared this(shared(Allocator) base_allocator)
{
m_baseAlloc = base_allocator;
}
@property size_t allocatedBlockCount() const { return m_blocks.length; }
@property size_t bytesAllocated() const { return m_bytes; }
@property size_t maxBytesAllocated() const { return m_maxBytes; }
void[] alloc(size_t sz)
{
auto ret = m_baseAlloc.alloc(sz);
assert(ret.length == sz, "base.alloc() returned block with wrong size.");
assert(ret !in m_blocks, "base.alloc() returned block that is already allocated.");
m_blocks[ret.ptr] = sz;
m_bytes += sz;
if( m_bytes > m_maxBytes ){
m_maxBytes = m_bytes;
logDebug("New allocation maximum: %d (%d blocks)", m_maxBytes, m_blocks.length);
}
return ret;
}
void[] realloc(void[] mem, size_t new_size)
{
auto pb = mem.ptr in m_blocks;
assert(pb, "realloc() called with non-allocated pointer.");
assert(*pb == mem.length, "realloc() called with block of wrong size.");
auto ret = m_baseAlloc.realloc(mem, new_size);
assert(ret.length == new_size, "base.realloc() returned block with wrong size.");
assert(ret.ptr !in m_blocks, "base.realloc() returned block that is already allocated.");
m_bytes -= *pb;
m_blocks.remove(mem.ptr);
m_blocks[ret.ptr] = new_size;
m_bytes += new_size;
return ret;
}
void free(void[] mem)
{
auto pb = mem.ptr in m_blocks;
assert(pb, "free() called with non-allocated object.");
assert(*pb == mem.length, "free() called with block of wrong size.");
m_baseAlloc.free(mem);
m_bytes -= *pb;
m_blocks.remove(mem.ptr);
}
}
shared class MallocAllocator : Allocator {
void[] alloc(size_t sz)
{
auto ptr = .malloc(sz + Allocator.alignment);
enforceEx!OutOfMemoryError(ptr !is null);
return adjustPointerAlignment(ptr)[0 .. sz];
}
void[] realloc(void[] mem, size_t new_size)
{
size_t csz = min(mem.length, new_size);
auto p = extractUnalignedPointer(mem.ptr);
size_t oldmisalign = mem.ptr - p;
auto pn = cast(ubyte*).realloc(p, new_size+Allocator.alignment);
if (p == pn) return pn[oldmisalign .. new_size+oldmisalign];
auto pna = cast(ubyte*)adjustPointerAlignment(pn);
auto newmisalign = pna - pn;
// account for changed alignment after realloc (move memory back to aligned position)
if (oldmisalign != newmisalign) {
if (newmisalign > oldmisalign) {
foreach_reverse (i; 0 .. mem.length)
pn[i + newmisalign] = pn[i + oldmisalign];
} else {
foreach (i; 0 .. mem.length)
pn[i + newmisalign] = pn[i + oldmisalign];
}
}
return pna[0 .. new_size];
}
void free(void[] mem)
{
.free(extractUnalignedPointer(mem.ptr));
}
}
shared class GCAllocator : Allocator {
void[] alloc(size_t sz)
{
return adjustPointerAlignment(GC.malloc(sz+Allocator.alignment))[0 .. sz];
}
void[] realloc(void[] mem, size_t new_size)
{
size_t csz = min(mem.length, new_size);
auto p = extractUnalignedPointer(mem.ptr);
size_t misalign = mem.ptr - p;
auto pn = cast(ubyte*)GC.realloc(p, new_size+Allocator.alignment);
if (p == pn) return pn[misalign .. new_size+misalign];
auto pna = cast(ubyte*)adjustPointerAlignment(pn);
// account for both, possibly changed alignment and a possible
// GC bug where only part of the old memory chunk is copied to
// the new one
pna[0 .. csz] = (cast(ubyte[])mem)[0 .. csz];
return pna[0 .. new_size];
}
void free(void[] mem)
{
// For safety reasons, the GCAllocator should never explicitly free memory.
//GC.free(extractUnalignedPointer(mem.ptr));
}
}
synchronized class AutoFreeListAllocator : Allocator {
private {
FreeListAlloc[] m_freeLists;
shared(Allocator) m_baseAlloc;
}
shared this(shared(Allocator) base_allocator)
{
m_baseAlloc = base_allocator;
foreach( i; 3 .. 12 )
m_freeLists ~= new shared FreeListAlloc(1<<i, m_baseAlloc);
m_freeLists ~= new shared FreeListAlloc(65540, m_baseAlloc);
}
void[] alloc(size_t sz)
{
void[] ret;
foreach( fl; m_freeLists )
if( sz <= fl.elementSize ){
ret = fl.alloc(fl.elementSize)[0 .. sz];
break;
}
if( !ret ) ret = m_baseAlloc.alloc(sz);
//logTrace("AFL alloc %08X(%d)", ret.ptr, sz);
return ret;
}
void[] realloc(void[] data, size_t sz)
{
foreach (fl; m_freeLists)
if (data.length <= fl.elementSize) {
// just grow the slice if it still fits into the free list slot
if (sz <= fl.elementSize)
return data.ptr[0 .. sz];
// otherwise re-allocate
auto newd = alloc(sz);
assert(newd.ptr+sz <= data.ptr || newd.ptr >= data.ptr+data.length, "New block overlaps old one!?");
auto len = min(data.length, sz);
newd[0 .. len] = data[0 .. len];
free(data);
return newd;
}
// forward large blocks to the base allocator
return m_baseAlloc.realloc(data, sz);
}
void free(void[] data)
{
//logTrace("AFL free %08X(%s)", data.ptr, data.length);
foreach( fl; m_freeLists )
if( data.length <= fl.elementSize ){
fl.free(data.ptr[0 .. fl.elementSize]);
return;
}
return m_baseAlloc.free(data);
}
}
synchronized class PoolAllocator : Allocator {
static struct Pool { Pool* next; void[] data; void[] remaining; }
static struct Destructor { Destructor* next; void function(void*) destructor; void* object; }
private {
shared(Allocator) m_baseAllocator;
Pool* m_freePools;
Pool* m_fullPools;
Destructor* m_destructors;
size_t m_poolSize;
}
shared this(size_t pool_size, shared(Allocator) base)
{
m_poolSize = pool_size;
m_baseAllocator = base;
}
@property size_t totalSize()
{
size_t amt = 0;
for (auto p = m_fullPools; p; p = p.next)
amt += p.data.length;
for (auto p = m_freePools; p; p = p.next)
amt += p.data.length;
return amt;
}
@property size_t allocatedSize()
{
size_t amt = 0;
for (auto p = m_fullPools; p; p = p.next)
amt += p.data.length;
for (auto p = m_freePools; p; p = p.next)
amt += p.data.length - p.remaining.length;
return amt;
}
void[] alloc(size_t sz)
{
auto aligned_sz = alignedSize(sz);
Pool* pprev = null;
Pool* p = cast(Pool*)m_freePools;
while( p && p.remaining.length < aligned_sz ){
pprev = p;
p = p.next;
}
if( !p ){
auto pmem = m_baseAllocator.alloc(AllocSize!Pool);
p = emplace!Pool(pmem);
p.data = m_baseAllocator.alloc(max(aligned_sz, m_poolSize));
p.remaining = p.data;
p.next = cast(Pool*)m_freePools;
m_freePools = cast(shared)p;
pprev = null;
}
auto ret = p.remaining[0 .. aligned_sz];
p.remaining = p.remaining[aligned_sz .. $];
if( !p.remaining.length ){
if( pprev ){
pprev.next = p.next;
} else {
m_freePools = cast(shared)p.next;
}
p.next = cast(Pool*)m_fullPools;
m_fullPools = cast(shared)p;
}
return ret[0 .. sz];
}
void[] realloc(void[] arr, size_t newsize)
{
auto aligned_sz = alignedSize(arr.length);
auto aligned_newsz = alignedSize(newsize);
if( aligned_newsz <= aligned_sz ) return arr[0 .. newsize]; // TODO: back up remaining
auto pool = m_freePools;
bool last_in_pool = pool && arr.ptr+aligned_sz == pool.remaining.ptr;
if( last_in_pool && pool.remaining.length+aligned_sz >= aligned_newsz ){
pool.remaining = pool.remaining[aligned_newsz-aligned_sz .. $];
arr = arr.ptr[0 .. aligned_newsz];
assert(arr.ptr+arr.length == pool.remaining.ptr, "Last block does not align with the remaining space!?");
return arr[0 .. newsize];
} else {
auto ret = alloc(newsize);
assert(ret.ptr >= arr.ptr+aligned_sz || ret.ptr+ret.length <= arr.ptr, "New block overlaps old one!?");
ret[0 .. min(arr.length, newsize)] = arr[0 .. min(arr.length, newsize)];
return ret;
}
}
void free(void[] mem)
{
}
void freeAll()
{
version(VibeManualMemoryManagement){
// destroy all initialized objects
for (auto d = m_destructors; d; d = d.next)
d.destructor(cast(void*)d.object);
m_destructors = null;
// put all full Pools into the free pools list
for (Pool* p = cast(Pool*)m_fullPools, pnext; p; p = pnext) {
pnext = p.next;
p.next = cast(Pool*)m_freePools;
m_freePools = cast(shared(Pool)*)p;
}
// free up all pools
for (Pool* p = cast(Pool*)m_freePools; p; p = p.next)
p.remaining = p.data;
}
}
void reset()
{
version(VibeManualMemoryManagement){
freeAll();
Pool* pnext;
for (auto p = cast(Pool*)m_freePools; p; p = pnext) {
pnext = p.next;
m_baseAllocator.free(p.data);
m_baseAllocator.free((cast(void*)p)[0 .. AllocSize!Pool]);
}
m_freePools = null;
}
}
private static destroy(T)(void* ptr)
{
static if( is(T == class) ) .destroy(cast(T)ptr);
else .destroy(*cast(T*)ptr);
}
}
synchronized class FreeListAlloc : Allocator
{
private static struct FreeListSlot { FreeListSlot* next; }
private {
immutable size_t m_elemSize;
shared(Allocator) m_baseAlloc;
FreeListSlot* m_firstFree = null;
size_t m_nalloc = 0;
size_t m_nfree = 0;
}
shared this(size_t elem_size, shared(Allocator) base_allocator)
{
assert(elem_size >= size_t.sizeof);
m_elemSize = elem_size;
m_baseAlloc = base_allocator;
logDebug("Create FreeListAlloc %d", m_elemSize);
}
@property size_t elementSize() const { return m_elemSize; }
void[] alloc(size_t sz)
{
assert(sz == m_elemSize, "Invalid allocation size.");
void[] mem;
if( m_firstFree ){
auto slot = m_firstFree;
m_firstFree = slot.next;
slot.next = null;
mem = (cast(void*)slot)[0 .. m_elemSize];
m_nfree--;
} else {
mem = m_baseAlloc.alloc(m_elemSize);
//logInfo("Alloc %d bytes: alloc: %d, free: %d", SZ, s_nalloc, s_nfree);
}
m_nalloc++;
//logInfo("Alloc %d bytes: alloc: %d, free: %d", SZ, s_nalloc, s_nfree);
return mem;
}
void[] realloc(void[] mem, size_t sz)
{
assert(mem.length == m_elemSize);
assert(sz == m_elemSize);
return mem;
}
void free(void[] mem)
{
assert(mem.length == m_elemSize, "Memory block passed to free has wrong size.");
auto s = cast(shared(FreeListSlot)*)mem.ptr;
s.next = m_firstFree;
m_firstFree = s;
m_nalloc--;
m_nfree++;
}
}
template FreeListObjectAlloc(T, bool USE_GC = true, bool INIT = true)
{
enum ElemSize = AllocSize!T;
static if( is(T == class) ){
alias T TR;
} else {
alias T* TR;
}
TR alloc(ARGS...)(ARGS args)
{
//logInfo("alloc %s/%d", T.stringof, ElemSize);
auto mem = manualAllocator().alloc(ElemSize);
static if( hasIndirections!T ) GC.addRange(mem.ptr, ElemSize);
static if( INIT ) return emplace!T(mem, args);
else return cast(TR)mem.ptr;
}
void free(TR obj)
{
static if( INIT ){
auto objc = obj;
.destroy(objc);//typeid(T).destroy(cast(void*)obj);
}
static if( hasIndirections!T ) GC.removeRange(cast(void*)obj);
manualAllocator().free((cast(void*)obj)[0 .. ElemSize]);
}
}
template AllocSize(T)
{
static if (is(T == class)) {
// workaround for a strange bug where AllocSize!SSLStream == 0: TODO: dustmite!
enum dummy = T.stringof ~ __traits(classInstanceSize, T).stringof;
enum AllocSize = __traits(classInstanceSize, T);
} else {
enum AllocSize = T.sizeof;
}
}
struct FreeListRef(T, bool INIT = true)
{
enum ElemSize = AllocSize!T;
static if( is(T == class) ){
alias T TR;
} else {
alias T* TR;
}
private TR m_object;
private size_t m_magic = 0x1EE75817; // workaround for compiler bug
static FreeListRef opCall(ARGS...)(ARGS args)
{
//logInfo("refalloc %s/%d", T.stringof, ElemSize);
FreeListRef ret;
auto mem = manualAllocator().alloc(ElemSize + int.sizeof);
static if( hasIndirections!T ) GC.addRange(mem.ptr, ElemSize);
static if( INIT ) ret.m_object = emplace!T(mem, args);
else ret.m_object = cast(TR)mem.ptr;
ret.refCount = 1;
return ret;
}
~this()
{
//if( m_object ) logInfo("~this!%s(): %d", T.stringof, this.refCount);
//if( m_object ) logInfo("ref %s destructor %d", T.stringof, refCount);
//else logInfo("ref %s destructor %d", T.stringof, 0);
clear();
m_magic = 0;
m_object = null;
}
this(this)
{
checkInvariants();
if( m_object ){
//if( m_object ) logInfo("this!%s(this): %d", T.stringof, this.refCount);
this.refCount++;
}
}
void opAssign(FreeListRef other)
{
clear();
m_object = other.m_object;
if( m_object ){
//logInfo("opAssign!%s(): %d", T.stringof, this.refCount);
refCount++;
}
}
void clear()
{
checkInvariants();
if( m_object ){
if( --this.refCount == 0 ){
static if( INIT ){
//logInfo("ref %s destroy", T.stringof);
//typeid(T).destroy(cast(void*)m_object);
auto objc = m_object;
.destroy(objc);
//logInfo("ref %s destroyed", T.stringof);
}
static if( hasIndirections!T ) GC.removeRange(cast(void*)m_object);
manualAllocator().free((cast(void*)m_object)[0 .. ElemSize+int.sizeof]);
}
}
m_object = null;
m_magic = 0x1EE75817;
}
@property const(TR) get() const { checkInvariants(); return m_object; }
@property TR get() { checkInvariants(); return m_object; }
alias get this;
private @property ref int refCount()
const {
auto ptr = cast(ubyte*)cast(void*)m_object;
ptr += ElemSize;
return *cast(int*)ptr;
}
private void checkInvariants()
const {
assert(m_magic == 0x1EE75817);
assert(!m_object || refCount > 0);
}
}
private void* extractUnalignedPointer(void* base)
{
ubyte misalign = *(cast(ubyte*)base-1);
assert(misalign <= Allocator.alignment);
return base - misalign;
}
private void* adjustPointerAlignment(void* base)
{
ubyte misalign = Allocator.alignment - (cast(size_t)base & Allocator.alignmentMask);
base += misalign;
*(cast(ubyte*)base-1) = misalign;
return base;
}
unittest {
void test_align(void* p, size_t adjustment) {
void* pa = adjustPointerAlignment(p);
assert((cast(size_t)pa & Allocator.alignmentMask) == 0, "Non-aligned pointer.");
assert(*(cast(ubyte*)pa-1) == adjustment, "Invalid adjustment "~to!string(p)~": "~to!string(*(cast(ubyte*)pa-1)));
void* pr = extractUnalignedPointer(pa);
assert(pr == p, "Recovered base != original");
}
void* ptr = .malloc(0x40);
ptr += Allocator.alignment - (cast(size_t)ptr & Allocator.alignmentMask);
test_align(ptr++, 0x10);
test_align(ptr++, 0x0F);
test_align(ptr++, 0x0E);
test_align(ptr++, 0x0D);
test_align(ptr++, 0x0C);
test_align(ptr++, 0x0B);
test_align(ptr++, 0x0A);
test_align(ptr++, 0x09);
test_align(ptr++, 0x08);
test_align(ptr++, 0x07);
test_align(ptr++, 0x06);
test_align(ptr++, 0x05);
test_align(ptr++, 0x04);
test_align(ptr++, 0x03);
test_align(ptr++, 0x02);
test_align(ptr++, 0x01);
test_align(ptr++, 0x10);
}
private size_t alignedSize(size_t sz)
{
return ((sz + Allocator.alignment - 1) / Allocator.alignment) * Allocator.alignment;
}
unittest {
foreach( i; 0 .. 20 ){
auto ia = alignedSize(i);
assert(ia >= i);
assert((ia & Allocator.alignmentMask) == 0);
assert(ia < i+Allocator.alignment);
}
}
| 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_2_agm-6238854976.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_2_agm-6238854976.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
instance TPL_1406_Templer(Npc_Default)
{
name[0] = "Ochroniarz Kaloma";
npcType = npctype_main;
guild = GIL_TPL;
level = 25;
voice = 13;
id = 1406;
attribute[ATR_STRENGTH] = 100;
attribute[ATR_DEXTERITY] = 80;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 292;
attribute[ATR_HITPOINTS] = 292;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Bald",63,2,tpl_armor_h);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_MASTER;
Npc_SetTalentSkill(self,NPC_TALENT_2H,2);
EquipItem(self,ItMw_2H_Sword_Light_02);
CreateInvItem(self,ItFoSoup);
CreateInvItem(self,ItMiJoint_1);
daily_routine = Rtn_start_1406;
};
func void Rtn_start_1406()
{
TA_GuardPassage(9,0,21,0,"PSI_LABOR_GUARD_1");
TA_GuardPassage(21,0,9,0,"PSI_LABOR_GUARD_1");
};
| D |
module lua_api;
import std.stdio;
import std.string;
import riverd.lua;
import riverd.lua.types;
import program;
import viewport;
import pixmap;
/**
register some functions for a lua program
*/
void registerFunctions(Program program)
{
auto lua = program.lua;
//Setup the userdata
auto prog = cast(Program*) lua_newuserdata(lua, Program.sizeof);
*prog = program;
lua_setglobal(lua, "__program");
extern (C) int panic(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
prog.shutdown();
writeln("Shit hit the fan!");
return 0;
}
lua_atpanic(lua, &panic);
/// exit(code)
extern (C) int exit(lua_State* L) @trusted
{
const code = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
prog.shutdown();
return 0;
}
lua_register(lua, "exit", &exit);
/// exec(filename)
extern (C) int exec(lua_State* L) @trusted
{
const filename = lua_tostring(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
prog.machine.startProgram(cast(string) fromStringz(filename));
return 0;
}
lua_register(lua, "exec", &exec);
/// print(message)
extern (C) int print(lua_State* L) @trusted
{
const msg = lua_tostring(L, -1);
writeln("Program says: " ~ fromStringz(msg));
return 0;
}
lua_register(lua, "print", &print);
/// createscreen(mode, colorbits): id
extern (C) int createscreen(lua_State* L) @trusted
{
const mode = lua_tointeger(L, -2);
const colorBits = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.createScreen(cast(ubyte) mode, cast(ubyte) colorBits));
return 1;
}
lua_register(lua, "createscreen", &createscreen);
/// changescreenmode(screenID, mode, colorbits)
extern (C) int changescreenmode(lua_State* L) @trusted
{
const screenId = lua_tointeger(L, -3);
const mode = lua_tointeger(L, -2);
const colorBits = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
Viewport vp = prog.machine.mainScreen;
if (screenId > 0)
{
vp = prog.viewports[cast(uint) screenId];
}
if (!vp)
{
lua_pushstring(L, "Invalid viewport!");
lua_error(L);
return 0;
}
vp.changeMode(cast(ubyte) mode, cast(ubyte) colorBits);
return 0;
}
lua_register(lua, "changescreenmode", &changescreenmode);
/// createviewport(parent, left, top, width, height): id
extern (C) int createviewport(lua_State* L) @trusted
{
const parentId = lua_tointeger(L, -5);
const left = lua_tonumber(L, -4);
const top = lua_tonumber(L, -3);
const width = lua_tonumber(L, -2);
const height = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.createViewport(cast(uint) parentId, cast(int) left,
cast(int) top, cast(uint) width, cast(uint) height));
return 1;
}
lua_register(lua, "createviewport", &createviewport);
/// activeviewport(vpID)
extern (C) int activeviewport(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
auto vp = prog.viewports[cast(uint) vpId];
if (!vp)
{
lua_pushstring(L, "Invalid viewport!");
lua_error(L);
return 0;
}
prog.activeViewport = vp;
return 0;
}
lua_register(lua, "activeviewport", &activeviewport);
/// moveviewport(vpID, left, top)
extern (C) int moveviewport(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -3);
const left = lua_tonumber(L, -2);
const top = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
auto vp = prog.viewports[cast(uint) vpId];
if (!vp)
{
lua_pushstring(L, "Invalid viewport!");
lua_error(L);
return 0;
}
vp.move(cast(int) left, cast(int) top);
return 0;
}
lua_register(lua, "moveviewport", &moveviewport);
/// resizeviewport(vpID, left, top)
extern (C) int resizeviewport(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -3);
const width = lua_tonumber(L, -2);
const height = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
auto vp = prog.viewports[cast(uint) vpId];
if (!vp)
{
lua_pushstring(L, "Invalid viewport!");
lua_error(L);
return 0;
}
vp.resize(cast(uint) width, cast(uint) height);
return 0;
}
lua_register(lua, "resizeviewport", &resizeviewport);
/// showviewport(vpID, visible)
extern (C) int showviewport(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -2);
const visible = lua_toboolean(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
auto vp = prog.viewports[cast(uint) vpId];
if (!vp)
{
lua_pushstring(L, "Invalid viewport!");
lua_error(L);
return 0;
}
vp.visible = cast(bool) visible;
return 0;
}
lua_register(lua, "showviewport", &showviewport);
/// viewportleft(vpID): left
extern (C) int viewportleft(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.viewports[cast(uint) vpId].left);
return 1;
}
lua_register(lua, "viewportleft", &viewportleft);
/// viewporttop(vpID): top
extern (C) int viewporttop(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.viewports[cast(uint) vpId].top);
return 1;
}
lua_register(lua, "viewporttop", &viewporttop);
/// viewportwidth(vpID): width
extern (C) int viewportwidth(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.viewports[cast(uint) vpId].pixmap.width);
return 1;
}
lua_register(lua, "viewportwidth", &viewportwidth);
/// viewportheight(vpID): height
extern (C) int viewportheight(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.viewports[cast(uint) vpId].pixmap.height);
return 1;
}
lua_register(lua, "viewportheight", &viewportheight);
/// viewportfocused(vpID): focused
extern (C) int viewportfocused(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushboolean(L,
prog.viewports[cast(uint) vpId].containsViewport(prog.machine.focusedViewport));
return 1;
}
lua_register(lua, "viewportfocused", &viewportfocused);
/// focusviewport(vpID)
extern (C) int focusviewport(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
prog.machine.focusViewport(prog.viewports[cast(uint) vpId]);
return 1;
}
lua_register(lua, "focusviewport", &focusviewport);
/// removeviewport(vpID)
extern (C) int removeviewport(lua_State* L) @trusted
{
const vpId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
prog.removeViewport(cast(uint) vpId);
return 0;
}
lua_register(lua, "removeviewport", &removeviewport);
/// getinputtext(): text
extern (C) int getinputtext(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
lua_pushstring(L, toStringz(prog.activeViewport.textinput.getText()));
return 1;
}
lua_register(lua, "getinputtext", &getinputtext);
/// getinputpos(): position
extern (C) int getinputpos(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
lua_pushinteger(L, prog.activeViewport.textinput.posBytes);
return 1;
}
lua_register(lua, "getinputpos", &getinputpos);
/// getinputselected(): selection
extern (C) int getinputselected(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
lua_pushinteger(L, prog.activeViewport.textinput.selectedBytes);
return 1;
}
lua_register(lua, "getinputselected", &getinputselected);
/// setinputtext(text)
extern (C) int setinputtext(lua_State* L) @trusted
{
const text = lua_tostring(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
prog.activeViewport.textinput.setText(cast(string) fromStringz(text));
return 0;
}
lua_register(lua, "setinputtext", &setinputtext);
/// setinputpos(pos)
extern (C) int setinputpos(lua_State* L) @trusted
{
const pos = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
prog.activeViewport.textinput.setPosBytes(cast(uint) pos);
return 0;
}
lua_register(lua, "setinputpos", &setinputpos);
/// setinputselected(selected)
extern (C) int setinputselected(lua_State* L) @trusted
{
const selected = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
prog.activeViewport.textinput.setSelectedBytes(cast(uint) selected);
return 0;
}
lua_register(lua, "setinputselected", &setinputselected);
/// hotkey(): hotkey
extern (C) int hotkey(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
lua_pushstring(L, toStringz("" ~ prog.activeViewport.hotkey));
return 1;
}
lua_register(lua, "hotkey", &hotkey);
/// mousex(): x
extern (C) int mousex(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
lua_pushinteger(L, prog.activeViewport.mouseX);
return 1;
}
lua_register(lua, "mousex", &mousex);
/// mousey(): y
extern (C) int mousey(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
lua_pushinteger(L, prog.activeViewport.mouseY);
return 1;
}
lua_register(lua, "mousey", &mousey);
/// mousebtn(): btn
extern (C) int mousebtn(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
lua_pushinteger(L, prog.activeViewport.mouseBtn);
return 1;
}
lua_register(lua, "mousebtn", &mousebtn);
/// createimage(width, height, colorbits): id
extern (C) int createimage(lua_State* L) @trusted
{
const width = lua_tonumber(L, -3);
const height = lua_tonumber(L, -2);
const colorBits = lua_tointeger(L, -1);
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.createPixmap(cast(uint) width, cast(uint) height, cast(ubyte) colorBits));
return 1;
}
lua_register(lua, "createimage", &createimage);
/// loadimage(filename): id
extern (C) int loadimage(lua_State* L) @trusted
{
auto filename = fromStringz(lua_tostring(L, -1));
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.loadPixmap(cast(string) filename));
return 1;
}
lua_register(lua, "loadimage", &loadimage);
/// loadanimation(filename): id
extern (C) int loadanimation(lua_State* L) @trusted
{
auto filename = fromStringz(lua_tostring(L, -1));
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
uint[] anim = prog.loadAnimation(cast(string) filename);
lua_createtable(L, cast(uint) anim.length, 0);
for (uint i = 0; i < anim.length; i++)
{
lua_pushinteger(L, anim[i]);
lua_rawseti(L, -2, i + 1);
}
return 1;
}
lua_register(lua, "loadanimation", &loadanimation);
/// imagewidth(imgID): width
extern (C) int imagewidth(lua_State* L) @trusted
{
const imgId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.pixmaps[cast(uint) imgId].width);
return 1;
}
lua_register(lua, "imagewidth", &imagewidth);
/// imageheight(imgID): height
extern (C) int imageheight(lua_State* L) @trusted
{
const imgId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.pixmaps[cast(uint) imgId].height);
return 1;
}
lua_register(lua, "imageheight", &imageheight);
/// imageduration(imgID): height
extern (C) int imageduration(lua_State* L) @trusted
{
const imgId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.pixmaps[cast(uint) imgId].duration);
return 1;
}
lua_register(lua, "imageduration", &imageduration);
/// copymode(mode)
extern (C) int copymode(lua_State* L) @trusted
{
const mode = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
prog.activeViewport.pixmap.copymode = cast(CopyMode) mode;
return 0;
}
lua_register(lua, "copymode", ©mode);
/// drawimage(imgID, x, y, imgx, imgy, width, height)
extern (C) int drawimage(lua_State* L) @trusted
{
const imgID = lua_tointeger(L, -7);
const x = lua_tonumber(L, -6);
const y = lua_tonumber(L, -5);
const imgx = lua_tonumber(L, -4);
const imgy = lua_tonumber(L, -3);
const width = lua_tonumber(L, -2);
const height = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
if (imgID >= prog.pixmaps.length || !prog.pixmaps[cast(uint) imgID])
{
lua_pushstring(L, "Invalid image!");
lua_error(L);
return 0;
}
prog.activeViewport.pixmap.copyFrom(prog.pixmaps[cast(uint) imgID],
cast(int) imgx, cast(int) imgy, cast(int) x, cast(int) y,
cast(uint) width, cast(uint) height);
return 0;
}
lua_register(lua, "drawimage", &drawimage);
/// copyimage(imgID, x, y, imgx, imgy, width, height)
extern (C) int copyimage(lua_State* L) @trusted
{
const imgID = lua_tonumber(L, -7);
const x = lua_tonumber(L, -6);
const y = lua_tonumber(L, -5);
const imgx = lua_tonumber(L, -4);
const imgy = lua_tonumber(L, -3);
const width = lua_tonumber(L, -2);
const height = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
if (!prog.pixmaps[cast(uint) imgID])
{
lua_pushstring(L, "Invalid image!");
lua_error(L);
return 0;
}
prog.pixmaps[cast(uint) imgID].copyFrom(prog.activeViewport.pixmap,
cast(int) x, cast(int) y, cast(int) imgx, cast(int) imgy,
cast(uint) width, cast(uint) height);
return 0;
}
lua_register(lua, "copyimage", ©image);
/// copypalette(imgID)
extern (C) int copypalette(lua_State* L) @trusted
{
const imgID = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
if (!prog.pixmaps[cast(uint) imgID])
{
lua_pushstring(L, "Invalid image!");
lua_error(L);
return 0;
}
prog.pixmaps[cast(uint) imgID].copyPaletteFrom(prog.activeViewport.pixmap);
return 0;
}
lua_register(lua, "copypalette", ©palette);
/// usepalette(imgID)
extern (C) int usepalette(lua_State* L) @trusted
{
const imgID = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
if (!prog.pixmaps[cast(uint) imgID])
{
lua_pushstring(L, "Invalid image!");
lua_error(L);
return 0;
}
prog.activeViewport.pixmap.copyPaletteFrom(prog.pixmaps[cast(uint) imgID]);
return 0;
}
lua_register(lua, "usepalette", &usepalette);
/// forgetimage(imgID)
extern (C) int forgetimage(lua_State* L) @trusted
{
const imgId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
prog.removePixmap(cast(uint) imgId);
return 0;
}
lua_register(lua, "forgetimage", &forgetimage);
/// cls()
extern (C) int cls(lua_State* L) @trusted
{
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
prog.activeViewport.pixmap.cls();
return 0;
}
lua_register(lua, "cls", &cls);
/// setcolor(color, red, green, blue)
extern (C) int setcolor(lua_State* L) @trusted
{
const c = lua_tointeger(L, -4);
const r = lua_tonumber(L, -3);
const g = lua_tonumber(L, -2);
const b = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
prog.activeViewport.pixmap.setColor(cast(uint) c, cast(ubyte) r, cast(ubyte) g, cast(ubyte) b);
return 0;
}
lua_register(lua, "setcolor", &setcolor);
/// getcolor(color, channel): value
extern (C) int getcolor(lua_State* L) @trusted
{
const col = lua_tointeger(L, -2);
const chan = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
return 0;
}
const i = cast(uint)((col * 3 + chan) % prog.activeViewport.pixmap.palette.length);
lua_pushinteger(L, prog.activeViewport.pixmap.palette[i] % 16);
return 1;
}
lua_register(lua, "getcolor", &getcolor);
/// fgcolor(index)
extern (C) int fgcolor(lua_State* L) @trusted
{
const cindex = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (prog.activeViewport)
{
prog.activeViewport.pixmap.fgColor = cast(ubyte) cindex;
}
else
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
}
return 0;
}
lua_register(lua, "fgcolor", &fgcolor);
/// bgcolor(index)
extern (C) int bgcolor(lua_State* L) @trusted
{
const cindex = lua_tonumber(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (prog.activeViewport)
{
prog.activeViewport.pixmap.bgColor = cast(ubyte) cindex;
}
else
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
}
return 0;
}
lua_register(lua, "bgcolor", &bgcolor);
/// pget(x, y): color
extern (C) int pget(lua_State* L) @trusted
{
const x = lua_tonumber(L, -2);
const y = lua_tonumber(L, -1);
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
}
lua_pushinteger(L, prog.activeViewport.pixmap.pget(cast(uint) x, cast(uint) y));
return 1;
}
lua_register(lua, "pget", &pget);
/// plot(x, y)
extern (C) int plot(lua_State* L) @trusted
{
const x = lua_tonumber(L, -2);
const y = lua_tonumber(L, -1);
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (prog.activeViewport)
{
prog.activeViewport.pixmap.plot(cast(uint) x, cast(uint) y);
}
else
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
}
return 0;
}
lua_register(lua, "plot", &plot);
/// bar(x, y, width, height)
extern (C) int bar(lua_State* L) @trusted
{
const x = lua_tonumber(L, -4);
const y = lua_tonumber(L, -3);
const width = lua_tonumber(L, -2);
const height = lua_tonumber(L, -1);
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
}
prog.activeViewport.pixmap.bar(cast(int) x, cast(int) y, cast(uint) width, cast(uint) height);
return 0;
}
lua_register(lua, "bar", &bar);
/// line(x1, y1, x2, y2)
extern (C) int line(lua_State* L) @trusted
{
const x1 = lua_tonumber(L, -4);
const y1 = lua_tonumber(L, -3);
const x2 = lua_tonumber(L, -2);
const y2 = lua_tonumber(L, -1);
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
}
prog.activeViewport.pixmap.line(cast(int) x1, cast(int) y1, cast(int) x2, cast(int) y2);
return 0;
}
lua_register(lua, "line", &line);
/// loadfont(filename): id
extern (C) int loadfont(lua_State* L) @trusted
{
auto filename = fromStringz(lua_tostring(L, -1));
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
lua_pushinteger(L, prog.loadFont(cast(string) filename));
return 1;
}
lua_register(lua, "loadfont", &loadfont);
/// forgetfont(imgID)
extern (C) int forgetfont(lua_State* L) @trusted
{
const imgId = lua_tointeger(L, -1);
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
prog.removeFont(cast(uint) imgId);
return 0;
}
lua_register(lua, "forgetfont", &forgetfont);
/// text(text, font, x, y): width
extern (C) int text(lua_State* L) @trusted
{
const text = lua_tostring(L, -4);
const font = lua_tointeger(L, -3);
const x = lua_tonumber(L, -2);
const y = lua_tonumber(L, -1);
//Get the pointer
lua_getglobal(L, "__program");
auto prog = cast(Program*) lua_touserdata(L, -1);
if (!prog.activeViewport)
{
lua_pushstring(L, "No active viewport!");
lua_error(L);
}
if (!prog.fonts[cast(uint) font])
{
lua_pushstring(L, "Invalid font!");
lua_error(L);
}
prog.activeViewport.pixmap.text(cast(string) fromStringz(text),
prog.fonts[cast(uint) font], cast(int) x, cast(int) y);
return 0;
}
lua_register(lua, "text", &text);
}
| D |
import std.stdio;
int main(string[] args)
{
writeln("Hello, World!");
return 0;
} | D |
// generated by fakerjsgenerator
///
module faked.faker_en_us;
import faked.base;
///
class Faker_en_us : Faker {
@safe:
import std.random;
import std.array;
import std.format;
import std.conv : to;
///
this(int seed) {
super(seed);
}
///
string phoneNumberExchangeCode() {
auto data = [
"201",
"202",
"203",
"205",
"206",
"207",
"208",
"209",
"210",
"212",
"213",
"214",
"215",
"216",
"217",
"218",
"219",
"224",
"225",
"227",
"228",
"229",
"231",
"234",
"239",
"240",
"248",
"251",
"252",
"253",
"254",
"256",
"260",
"262",
"267",
"269",
"270",
"276",
"281",
"283",
"301",
"302",
"303",
"304",
"305",
"307",
"308",
"309",
"310",
"312",
"313",
"314",
"315",
"316",
"317",
"318",
"319",
"320",
"321",
"323",
"330",
"331",
"334",
"336",
"337",
"339",
"347",
"351",
"352",
"360",
"361",
"386",
"401",
"402",
"404",
"405",
"406",
"407",
"408",
"409",
"410",
"412",
"413",
"414",
"415",
"417",
"419",
"423",
"424",
"425",
"434",
"435",
"440",
"443",
"445",
"464",
"469",
"470",
"475",
"478",
"479",
"480",
"484",
"501",
"502",
"503",
"504",
"505",
"507",
"508",
"509",
"510",
"512",
"513",
"515",
"516",
"517",
"518",
"520",
"530",
"540",
"541",
"551",
"557",
"559",
"561",
"562",
"563",
"564",
"567",
"570",
"571",
"573",
"574",
"580",
"585",
"586",
"601",
"602",
"603",
"605",
"606",
"607",
"608",
"609",
"610",
"612",
"614",
"615",
"616",
"617",
"618",
"619",
"620",
"623",
"626",
"630",
"631",
"636",
"641",
"646",
"650",
"651",
"660",
"661",
"662",
"667",
"678",
"682",
"701",
"702",
"703",
"704",
"706",
"707",
"708",
"712",
"713",
"714",
"715",
"716",
"717",
"718",
"719",
"720",
"724",
"727",
"731",
"732",
"734",
"737",
"740",
"754",
"757",
"760",
"763",
"765",
"770",
"772",
"773",
"774",
"775",
"781",
"785",
"786",
"801",
"802",
"803",
"804",
"805",
"806",
"808",
"810",
"812",
"813",
"814",
"815",
"816",
"817",
"818",
"828",
"830",
"831",
"832",
"835",
"843",
"845",
"847",
"848",
"850",
"856",
"857",
"858",
"859",
"860",
"862",
"863",
"864",
"865",
"870",
"872",
"878",
"901",
"903",
"904",
"906",
"907",
"908",
"909",
"910",
"912",
"913",
"914",
"915",
"916",
"917",
"918",
"919",
"920",
"925",
"928",
"931",
"936",
"937",
"940",
"941",
"947",
"949",
"952",
"954",
"956",
"959",
"970",
"971",
"972",
"973",
"975",
"978",
"979",
"980",
"984",
"985",
"989"
];
return choice(data, this.rnd);
}
///
string phoneNumberAreaCode() {
auto data = [
"201",
"202",
"203",
"205",
"206",
"207",
"208",
"209",
"210",
"212",
"213",
"214",
"215",
"216",
"217",
"218",
"219",
"224",
"225",
"227",
"228",
"229",
"231",
"234",
"239",
"240",
"248",
"251",
"252",
"253",
"254",
"256",
"260",
"262",
"267",
"269",
"270",
"276",
"281",
"283",
"301",
"302",
"303",
"304",
"305",
"307",
"308",
"309",
"310",
"312",
"313",
"314",
"315",
"316",
"317",
"318",
"319",
"320",
"321",
"323",
"330",
"331",
"334",
"336",
"337",
"339",
"347",
"351",
"352",
"360",
"361",
"386",
"401",
"402",
"404",
"405",
"406",
"407",
"408",
"409",
"410",
"412",
"413",
"414",
"415",
"417",
"419",
"423",
"424",
"425",
"434",
"435",
"440",
"443",
"445",
"464",
"469",
"470",
"475",
"478",
"479",
"480",
"484",
"501",
"502",
"503",
"504",
"505",
"507",
"508",
"509",
"510",
"512",
"513",
"515",
"516",
"517",
"518",
"520",
"530",
"540",
"541",
"551",
"557",
"559",
"561",
"562",
"563",
"564",
"567",
"570",
"571",
"573",
"574",
"580",
"585",
"586",
"601",
"602",
"603",
"605",
"606",
"607",
"608",
"609",
"610",
"612",
"614",
"615",
"616",
"617",
"618",
"619",
"620",
"623",
"626",
"630",
"631",
"636",
"641",
"646",
"650",
"651",
"660",
"661",
"662",
"667",
"678",
"682",
"701",
"702",
"703",
"704",
"706",
"707",
"708",
"712",
"713",
"714",
"715",
"716",
"717",
"718",
"719",
"720",
"724",
"727",
"731",
"732",
"734",
"737",
"740",
"754",
"757",
"760",
"763",
"765",
"770",
"772",
"773",
"774",
"775",
"781",
"785",
"786",
"801",
"802",
"803",
"804",
"805",
"806",
"808",
"810",
"812",
"813",
"814",
"815",
"816",
"817",
"818",
"828",
"830",
"831",
"832",
"835",
"843",
"845",
"847",
"848",
"850",
"856",
"857",
"858",
"859",
"860",
"862",
"863",
"864",
"865",
"870",
"872",
"878",
"901",
"903",
"904",
"906",
"907",
"908",
"909",
"910",
"912",
"913",
"914",
"915",
"916",
"917",
"918",
"919",
"920",
"925",
"928",
"931",
"936",
"937",
"940",
"941",
"947",
"949",
"952",
"954",
"956",
"959",
"970",
"971",
"972",
"973",
"975",
"978",
"979",
"980",
"984",
"985",
"989"
];
return choice(data, this.rnd);
}
///
override string internetDomainSuffix() {
auto data = [
"com",
"us",
"biz",
"info",
"name",
"net",
"org'"
];
return choice(data, this.rnd);
}
override string addressStreet() {
final switch(uniform(0, 2, this.rnd)) {
case 0: return nameFirstName() ~ " " ~ addressStreetSuffix();
case 1: return nameLastName() ~ " " ~ addressStreetSuffix();
}
}
override string addressCity() {
final switch(uniform(0, 4, this.rnd)) {
case 0: return addressCityPrefix() ~ " " ~ nameFirstName() ~ addressCitySuffix();
case 1: return addressCityPrefix() ~ " " ~ nameFirstName();
case 2: return nameFirstName() ~ addressCitySuffix();
case 3: return nameLastName() ~ addressCitySuffix();
}
}
///
override string addressDefaultCountry() {
auto data = [
"United States",
"United States of America",
"USA'"
];
return choice(data, this.rnd);
}
}
| D |
/*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
*/
module hunt.quartz.spi.InstanceIdGenerator;
import hunt.quartz.Exceptions;
/**
* <p>
* An InstanceIdGenerator is responsible for generating the clusterwide unique
* instance id for a <code>Scheduler</code> node.
* </p>
*
* <p>
* This interface may be of use to those wishing to have specific control over
* the mechanism by which the <code>Scheduler</code> instances in their
* application are named.
* </p>
*
* @see hunt.quartz.simpl.SimpleInstanceIdGenerator
*/
interface InstanceIdGenerator {
/**
* Generate the instance id for a <code>Scheduler</code>
*
* @return The clusterwide unique instance id.
*/
string generateInstanceId();
} | D |
/Users/phungdu/Documents/code/vapor/TILApp/Build/Intermediates/TILApp.build/Debug/Routing.build/Objects-normal/x86_64/Route.o : /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/Deprecated.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/RouterNode.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/Route.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/ParameterValue.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/RouterOption.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/Parameter.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/TrieRouter.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/RoutingError.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/Parameters.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/Exports.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/RoutableComponent.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/PathComponent.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/cpp_magic.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/ifaddrs-android.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Headers/CNIODarwin.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/CNIOAtomics.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/CNIOLinux.h /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--5226887469817572071/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/phungdu/Documents/code/vapor/TILApp/Build/Intermediates/TILApp.build/Debug/Routing.build/Objects-normal/x86_64/Route~partial.swiftmodule : /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/Deprecated.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/RouterNode.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/Route.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/ParameterValue.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/RouterOption.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/Parameter.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/TrieRouter.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/RoutingError.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/Parameters.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/Exports.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/RoutableComponent.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/PathComponent.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/cpp_magic.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/ifaddrs-android.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Headers/CNIODarwin.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/CNIOAtomics.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/CNIOLinux.h /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--5226887469817572071/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/phungdu/Documents/code/vapor/TILApp/Build/Intermediates/TILApp.build/Debug/Routing.build/Objects-normal/x86_64/Route~partial.swiftdoc : /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/Deprecated.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/RouterNode.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/Route.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/ParameterValue.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/RouterOption.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/Parameter.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/TrieRouter.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/RoutingError.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Parameter/Parameters.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Utilities/Exports.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Routing/RoutableComponent.swift /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/routing.git-4533504815497113673/Sources/Routing/Register/PathComponent.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/cpp_magic.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/ifaddrs-android.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Headers/CNIODarwin.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Headers/CNIOAtomics.h /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Headers/CNIOLinux.h /Users/phungdu/Documents/code/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--5226887469817572071/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIODarwin.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOAtomics.framework/Modules/module.modulemap /Users/phungdu/Documents/code/vapor/TILApp/Build/Products/Debug/CNIOLinux.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
module Main;
private {
import tango.core.tools.TraceExceptions;
import xf.Common;
import xf.mem.ChunkQueue;
import xf.core.Registry;
import xf.nucleus.kdef.model.IKDefRegistry;
import xf.nucleus.graph.KernelGraph;
import xf.nucleus.graph.KernelGraphOps;
import xf.nucleus.kdef.KDefGraphBuilder;
import xf.nucleus.Log : error = nucleusError;
import xf.nucleus.kernel.KernelDef;
import xf.nucleus.TypeSystem;
import xf.nucleus.graph.GraphMisc;
import xf.nucleus.TypeConversion;
import tango.text.convert.Format;
import tango.io.Stdout;
import tango.io.device.File;
import tango.io.vfs.FileFolder;
}
import tango.core.Memory;
void main() {
{
GC.disable();
final vfs = new FileFolder(".");
final registry = create!(IKDefRegistry)();
registry.setVFS(vfs);
registry.registerFolder(".");
registry.doSemantics();
registry.dumpInfo();
// TODO
foreach (g; ®istry.graphs) {
auto kg = createKernelGraph();
buildKernelGraph(
g,
kg
);
convertKernelNodesToFuncNodes(
kg,
(cstring kname, cstring fname) {
final kernel = registry.getKernel(kname);
if (kernel is null) {
error(
"convertKernelNodesToFuncNodes requested a nonexistent"
" kernel '{}'", kname
);
}
if (kernel.bestImpl is null) {
error(
"The '{}' kernel requested by convertKernelNodesToFuncNodes"
" has no implemenation.", kname
);
}
final quark = cast(QuarkDef)kernel.bestImpl;
return quark.getFunction(fname);
}
);
verifyDataFlowNames(kg, ®istry.getKernel);
convertGraphDataFlow(kg, ®istry.converters, ®istry.getKernel);
verifyDataFlowNames(kg, ®istry.getKernel);
File.set("graph.dot", toGraphviz(kg));
disposeKernelGraph(kg);
}
}
Stdout.formatln("Test passed!");
}
| D |
a complex polymer
| D |
/* crypto/stack/stack.h */
/* Copyright (C) 1995-1998 Eric Young ([email protected])
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young ([email protected]).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson ([email protected]).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young ([email protected])"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson ([email protected])"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
module deimos.openssl.stack;
import deimos.openssl._d_util;
extern (C):
nothrow:
struct stack_st {
int num;
char** data;
int sorted;
int num_alloc;
ExternC!(int function(const(void)*, const(void)*)) comp;
}
alias stack_st _STACK; /* Use STACK_OF(...) instead */
int M_sk_num()(_STACK* sk) { return (sk ? sk.num : -1); }
char* M_sk_value()(_STACK* sk, size_t n) { return (sk ? sk.data[n] : null); }
int OPENSSL_sk_num(const(_STACK)*);
void* OPENSSL_sk_value(const(_STACK)*, int);
void* OPENSSL_sk_set(_STACK*, int, void*);
_STACK* OPENSSL_sk_new(ExternC!(int function(const(void)*, const(void)*)) cmp);
_STACK* OPENSSL_sk_new_null();
void OPENSSL_sk_free(_STACK*);
void OPENSSL_sk_pop_free(_STACK* st, ExternC!(void function(void*)) func);
int OPENSSL_sk_insert(_STACK* sk, void* data, int where);
void* OPENSSL_sk_delete(_STACK* st, int loc);
void* OPENSSL_sk_delete_ptr(_STACK* st, void* p);
int OPENSSL_sk_find(_STACK* st, void* data);
int OPENSSL_sk_find_ex(_STACK* st, void* data);
int OPENSSL_sk_push(_STACK* st, void* data);
int OPENSSL_sk_unshift(_STACK* st, void* data);
void* OPENSSL_sk_shift(_STACK* st);
void* OPENSSL_sk_pop(_STACK* st);
void OPENSSL_sk_zero(_STACK* st);
int function(const(void)*, const(void)*) OPENSSL_sk_set_cmp_func(_STACK* sk, ExternC!(int function(const(void)*, const(void)*)) c);
_STACK* OPENSSL_sk_dup(_STACK* st);
void OPENSSL_sk_sort(_STACK* st);
int OPENSSL_sk_is_sorted(const(_STACK)* st);
| D |
/Users/patricerapaport/Desktop/swift/PRMacControls/Build/Intermediates.noindex/PRMacControls.build/Debug/PRMacControls.build/Objects-normal/x86_64/myBox.o : /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myControlDoc.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfield.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/web/webService.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTable.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/sourcetable.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myOutline.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldTelephone.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldAdresse.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldDate.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldDecimal.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/selectorsProtocol.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myControl.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/mytoolbarItem.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTabviewitem.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldNum.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/cmyButton.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCombo.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/web/downloadManager.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/preferenceManager.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/baseController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/documentPopoverController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/popoverController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/editController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/listController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/user.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/listeControles.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/dates.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/alertes.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/strings.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/nums.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/enumerations.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/keyboardKeys.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldInt.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/baseView.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/myView.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/myWindow.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myBox.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCustomCheckbox.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCheckbox.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /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/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/PRMacControls.h /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Intermediates.noindex/PRMacControls.build/Debug/PRMacControls.build/unextended-module.modulemap /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/xpc/XPC.apinotes /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/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/patricerapaport/Desktop/swift/PRMacControls/Build/Intermediates.noindex/PRMacControls.build/Debug/PRMacControls.build/Objects-normal/x86_64/myBox~partial.swiftmodule : /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myControlDoc.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfield.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/web/webService.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTable.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/sourcetable.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myOutline.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldTelephone.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldAdresse.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldDate.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldDecimal.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/selectorsProtocol.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myControl.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/mytoolbarItem.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTabviewitem.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldNum.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/cmyButton.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCombo.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/web/downloadManager.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/preferenceManager.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/baseController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/documentPopoverController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/popoverController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/editController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/listController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/user.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/listeControles.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/dates.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/alertes.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/strings.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/nums.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/enumerations.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/keyboardKeys.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldInt.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/baseView.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/myView.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/myWindow.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myBox.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCustomCheckbox.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCheckbox.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /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/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/PRMacControls.h /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Intermediates.noindex/PRMacControls.build/Debug/PRMacControls.build/unextended-module.modulemap /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/xpc/XPC.apinotes /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/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/patricerapaport/Desktop/swift/PRMacControls/Build/Intermediates.noindex/PRMacControls.build/Debug/PRMacControls.build/Objects-normal/x86_64/myBox~partial.swiftdoc : /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myControlDoc.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfield.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/web/webService.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTable.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/sourcetable.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myOutline.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldTelephone.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldAdresse.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldDate.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldDecimal.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/selectorsProtocol.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myControl.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/mytoolbarItem.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTabviewitem.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldNum.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/cmyButton.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCombo.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/web/downloadManager.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/preferenceManager.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/baseController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/documentPopoverController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/popoverController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/editController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/listController.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/user.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/listeControles.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/dates.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/alertes.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/strings.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/nums.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/enumerations.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/misc/keyboardKeys.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myTextfieldInt.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/baseView.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/myView.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/windows/myWindow.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myBox.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCustomCheckbox.swift /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/controles/myCheckbox.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /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/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/patricerapaport/Desktop/swift/PRMacControls/PRMacControls/PRMacControls.h /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Intermediates.noindex/PRMacControls.build/Debug/PRMacControls.build/unextended-module.modulemap /Users/patricerapaport/Desktop/swift/PRMacControls/Build/Products/Debug/Alamofire/Alamofire.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/xpc/XPC.apinotes /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/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/**
* Copyright 2010-2011 Bernard Helyer
* Copyright 2011 Jakob Ovrum
* This file is part of SDC. SDC is licensed under the GPL.
* See LICENCE or sdc.d for more details.
*/
module runner;
import std.algorithm;
import std.concurrency;
import std.conv;
import std.file;
alias std.file file;
import std.getopt;
import std.process;
import std.range;
import std.stdio;
import std.string;
import core.stdc.stdlib;
version (linux) import core.sys.posix.unistd;
immutable SDC = "../bin/sdc";
version (Windows) {
immutable EXE_EXTENSION = ".exe";
} else {
immutable EXE_EXTENSION = ".bin";
}
string getTestFilename(int n)
{
return format("test%04s.d",n);
}
bool getBool(string s)
{
return s == "yes";
}
int getInt(string s)
{
return parse!int(s);
}
void test(string filename, string compiler)
{
auto managerTid = receiveOnly!Tid();
bool has = true;
bool expectedToCompile = true;
int expectedRetval = 0;
string[] dependencies;
assert(exists(filename));
auto f = File(filename, "r");
foreach (line; f.byLine) {
if (line.length < 3 || line[0 .. 3] != "//T") {
continue;
}
auto words = split(line);
if (words.length != 2) {
stderr.writefln("%s: malformed test.", filename);
managerTid.send(filename, false, has);
return;
}
auto set = split(words[1], ":");
if (set.length < 2) {
stderr.writefln("%s: malformed test.", filename);
managerTid.send(filename, false, has);
return;
}
auto var = set[0].idup;
auto val = set[1].idup;
switch (var) {
case "compiles":
expectedToCompile = getBool(val);
break;
case "retval":
expectedRetval = getInt(val);
break;
case "dependency":
dependencies ~= val;
break;
case "has-passed":
has = getBool(val);
break;
default:
stderr.writefln("%s: invalid command.", filename);
managerTid.send(filename, false, has);
return;
}
}
f.close();
string command;
string cmdDeps = reduce!((string deps, string dep){ return format(`%s"%s" `, deps, dep); })("", dependencies);
version (Windows) string exeName;
else string exeName = "./";
exeName ~= filename ~ EXE_EXTENSION;
if (file.exists(exeName)) {
file.remove(exeName);
}
if (compiler == SDC) {
command = format(`%s -o %s "%s" %s`, SDC, exeName, filename, cmdDeps);
} else {
command = format(`%s %s "%s" %s`, compiler, exeName, filename, cmdDeps);
}
// For some reasons &> is read as & > /dev/null causing the compiler to return 0.
version (Posix) if(!expectedToCompile || true) command ~= " 2> /dev/null 1> /dev/null";
auto retval = system(command);
if (expectedToCompile && retval != 0) {
stderr.writefln("%s: test expected to compile, did not.", filename);
managerTid.send(filename, false, has);
return;
}
if (!expectedToCompile && retval == 0) {
stderr.writefln("%s: test expected to not compile, did.", filename);
managerTid.send(filename, false, has);
return;
}
if (!expectedToCompile && retval != 0) {
managerTid.send(filename, true, has);
return;
}
assert(expectedToCompile);
command = exeName;
version (Posix) command ~= " 2> /dev/null 1> /dev/null";
retval = system(command);
if (retval != expectedRetval) {
stderr.writefln("%s: expected retval %s, got %s", filename, expectedRetval, retval);
managerTid.send(filename, false, has);
return;
}
managerTid.send(filename, true, has);
}
void main(string[] args)
{
string compiler = SDC;
version (linux) size_t jobCount = sysconf(_SC_NPROCESSORS_ONLN);
else size_t jobCount = 1;
bool displayOnlyFailed = false;
bool waitOnExit = false;
getopt(args,
"compiler", &compiler,
"j", &jobCount,
"only-failed", &displayOnlyFailed,
"wait-on-exit", &waitOnExit,
"help", delegate {usage(); exit(0);});
if (args.length > 1) {
int testNumber = to!int(args[1]);
auto testName = getTestFilename(testNumber);
auto job = spawn(&test, testName, compiler);
job.send(thisTid);
auto result = receiveOnly!(string, bool, bool)();
bool regressed = !result[1] & result[2];
bool fixed = result[1] & !result[2];
if (result[1]) {
if (!displayOnlyFailed) writef("%s: %s", result[0], "SUCCEEDED");
} else {
writef("%s: %s", result[0], "FAILED");
}
if (fixed) {
if (!displayOnlyFailed) writefln(", FIXED");
} else if (regressed) {
writeln(", REGRESSION");
} else {
writeln();
}
return;
}
// Figure out how many tests there are.
int testNumber = -1;
while (exists(getTestFilename(++testNumber))) {}
if (testNumber < 0) {
stderr.writeln("No tests found.");
return;
}
auto tests = array( map!getTestFilename(iota(0, testNumber)) );
size_t testIndex = 0;
int passed = 0;
int regressions = 0;
int improvments = 0;
while (testIndex < tests.length) {
Tid[] jobs;
// spawn $jobCount concurrent jobs.
while (jobs.length < jobCount && testIndex < tests.length) {
jobs ~= spawn(&test, tests[testIndex], compiler);
jobs[$ - 1].send(thisTid);
testIndex++;
}
foreach (job; jobs) {
auto testResult = receiveOnly!(string, bool, bool)();
bool regressed = !testResult[1] & testResult[2];
bool fixed = testResult[1] & !testResult[2];
passed += testResult[1];
regressions += regressed;
improvments += fixed;
if (testResult[1]) {
if (!displayOnlyFailed) writef("%s: %s", testResult[0], "SUCCEEDED");
} else {
writef("%s: %s", testResult[0], "FAILED");
}
if (fixed) {
if (!displayOnlyFailed) writefln(", FIXED");
} else if (regressed) {
writefln(", REGRESSION");
} else {
if ((displayOnlyFailed && !testResult[1]) || !displayOnlyFailed) {
writefln("");
}
}
}
}
if (testNumber > 0) {
writefln("Summary: %s tests, %s pass%s, %s failure%s, %.2f%% pass rate, "
"%s regressions, %s improvements.",
testNumber, passed, passed == 1 ? "" : "es",
testNumber - passed, (testNumber - passed) == 1 ? "" : "s",
(cast(real)passed / testNumber) * 100,
regressions, improvments);
}
if (waitOnExit) {
write("Press any key to exit...");
readln();
}
if(regressions) exit(-1);
}
/// Print usage to stdout.
void usage()
{
writeln("runner [options] [specific test]");
writeln(" run with no arguments to run test suite.");
writeln(" --compiler: which compiler to run.");
writeln(" -j: how many tests to do at once.");
writeln(" (on Linux this will automatically be number of processors)");
writeln(" --only-failed: only display failed tests.");
writeln(" --wait-on-exit: wait for user input before exiting.");
writeln(" --help: display this message and exit.");
}
| D |
module dinu.command;
import
core.sync.mutex,
std.conv,
std.array,
std.string,
std.path,
std.process,
std.parallelism,
std.algorithm,
std.array,
std.stdio,
std.datetime,
std.file,
std.math,
std.regex,
ws.context,
dinu.util,
dinu.xclient,
dinu.dinu,
dinu.commandBuilder,
dinu.draw;
__gshared:
enum Type {
none,
script,
desktop,
history,
file,
directory,
output,
special,
bashCompletion,
processInfo
}
class Command {
string name;
Type type;
string color;
string parameter;
protected this(){}
this(string name){
this.name = name;
type = Type.file;
color = options.colorFile;
}
string serialize(){
return name;
}
string text(){
return name;
}
string filterText(){
return name;
}
string hint(){
return "";
}
size_t score(){
return 0;
}
abstract void run();
int draw(DrawingContext dc, int[2] pos, bool selected){
int origX = pos.x;
pos.x += dc.text(pos, text, color);
pos.x += dc.text(pos, ' ' ~ parameter, options.colorInput);
return pos.x-origX;
}
void spawnCommand(string command, string arguments=""){
options.configPath.execute(type.to!string, serialize.replace("!", "\\!"), command, arguments.replace("!", "\\!"));
}
}
| D |
/Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/TurnstileWeb.build/Protocols/OAuth/OAuthDelegator.swift.o : /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/AuthorizationCode.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Google.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/URLSession+Turnstile.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Facebook.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/WebMemoryRealm.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Token.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthEcho.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Error.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthDelegator.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthParameters.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Digits.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/Turnstile.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/TurnstileCrypto.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/TurnstileWeb.build/OAuthDelegator~partial.swiftmodule : /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/AuthorizationCode.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Google.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/URLSession+Turnstile.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Facebook.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/WebMemoryRealm.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Token.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthEcho.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Error.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthDelegator.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthParameters.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Digits.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/Turnstile.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/TurnstileCrypto.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/TurnstileWeb.build/OAuthDelegator~partial.swiftdoc : /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/AuthorizationCode.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Google.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/URLSession+Turnstile.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Facebook.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/WebMemoryRealm.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Token.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthEcho.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth2/OAuth2Error.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthDelegator.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/Protocols/OAuth/OAuthParameters.swift /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/checkouts/Turnstile.git-2443676010155639616/Sources/TurnstileWeb/LoginProviders/Digits.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/Turnstile.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/glasses/Documents/GitHub/Perfect-Turnstile-PostgreSQL-Demo/.build/x86_64-apple-macosx10.10/debug/TurnstileCrypto.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
/*
TEST_OUTPUT:
---
fail_compilation/casttuple.d(104): Error: cannot cast `__tup1_field_0` of type `int` to type sequence `(string)`
fail_compilation/casttuple.d(107): Error: cannot cast `AliasSeq!(__tup2_field_0, __tup2_field_1)` of type `(int, int)` to type sequence `(string, string)`
fail_compilation/casttuple.d(111): Error: cannot cast `AliasSeq!(foo, 123)` of type `(int, int)` to type sequence `(string, string)`
---
*/
alias tuple(T...) = T;
#line 100
void nomatch()
{
tuple!int tup1;
auto x = cast(tuple!string) tup1;
tuple!(int, int) tup2;
auto y = cast(tuple!(string, string)) tup2;
int foo;
alias tup3 = tuple!(foo, 123);
auto z = cast(tuple!(string, string)) tup3;
}
| D |
instance MENU_STATUS(C_MENU_DEF)
{
items[0] = "MENU_ITEM_PLAYERGUILD_TITLE";
items[1] = "MENU_ITEM_PLAYERGUILD";
items[2] = "MENU_ITEM_LEVEL_TITLE";
items[3] = "MENU_ITEM_EXP_TITLE";
items[4] = "MENU_ITEM_LEVEL_NEXT_TITLE";
items[5] = "MENU_ITEM_LEARN_TITLE";
items[6] = "MENU_ITEM_LEVEL";
items[7] = "MENU_ITEM_EXP";
items[8] = "MENU_ITEM_LEVEL_NEXT";
items[9] = "MENU_ITEM_LEARN";
items[10] = "MENU_ITEM_ATTRIBUTE_HEADING";
items[11] = "MENU_ITEM_ATTRIBUTE_1_TITLE";
items[12] = "MENU_ITEM_ATTRIBUTE_2_TITLE";
items[13] = "MENU_ITEM_ATTRIBUTE_3_TITLE";
items[14] = "MENU_ITEM_ATTRIBUTE_4_TITLE";
items[15] = "MENU_ITEM_ATTRIBUTE_1";
items[16] = "MENU_ITEM_ATTRIBUTE_2";
items[17] = "MENU_ITEM_ATTRIBUTE_3";
items[18] = "MENU_ITEM_ATTRIBUTE_4";
items[19] = "MENU_ITEM_ARMOR_HEADING";
items[20] = "MENU_ITEM_ARMOR_1_TITLE";
items[21] = "MENU_ITEM_ARMOR_2_TITLE";
items[22] = "MENU_ITEM_ARMOR_3_TITLE";
items[23] = "MENU_ITEM_ARMOR_4_TITLE";
items[24] = "MENU_ITEM_ARMOR_1";
items[25] = "MENU_ITEM_ARMOR_2";
items[26] = "MENU_ITEM_ARMOR_3";
items[27] = "MENU_ITEM_ARMOR_4";
items[28] = "MENU_ITEM_TALENTS_WEAPON_HEADING";
items[29] = "MENU_ITEM_TALENTS_THIEF_HEADING";
items[30] = "MENU_ITEM_TALENTS_SPECIAL_HEADING";
items[31] = "MENU_ITEM_TALENT_1_TITLE";
items[32] = "MENU_ITEM_TALENT_1_SKILL";
items[33] = "MENU_ITEM_TALENT_1";
items[34] = "MENU_ITEM_TALENT_2_TITLE";
items[35] = "MENU_ITEM_TALENT_2_SKILL";
items[36] = "MENU_ITEM_TALENT_2";
items[37] = "MENU_ITEM_TALENT_3_TITLE";
items[38] = "MENU_ITEM_TALENT_3_SKILL";
items[39] = "MENU_ITEM_TALENT_3";
items[40] = "MENU_ITEM_TALENT_4_TITLE";
items[41] = "MENU_ITEM_TALENT_4_SKILL";
items[42] = "MENU_ITEM_TALENT_4";
items[43] = "MENU_ITEM_TALENT_5_TITLE";
items[44] = "MENU_ITEM_TALENT_5_SKILL";
items[45] = "MENU_ITEM_TALENT_5";
items[46] = "MENU_ITEM_TALENT_6_TITLE";
items[47] = "MENU_ITEM_TALENT_6_SKILL";
items[48] = "MENU_ITEM_TALENT_6";
items[49] = "MENU_ITEM_TALENT_7_TITLE";
items[50] = "MENU_ITEM_TALENT_7_SKILL";
items[51] = "MENU_ITEM_TALENT_8_TITLE";
items[52] = "MENU_ITEM_TALENT_8_SKILL";
items[53] = "MENU_ITEM_TALENT_9_TITLE";
items[54] = "MENU_ITEM_TALENT_9_SKILL";
items[55] = "MENU_ITEM_TALENT_10_TITLE";
items[56] = "MENU_ITEM_TALENT_10_SKILL";
items[57] = "MENU_ITEM_TALENT_11_TITLE";
items[58] = "MENU_ITEM_TALENT_11_SKILL";
items[59] = "MENU_ITEM_TALENT_12_TITLE";
items[60] = "MENU_ITEM_TALENT_12_SKILL";
items[61] = "MENU_ITEM_TALENT_13_TITLE";
items[62] = "MENU_ITEM_TALENT_13_SKILL";
dimx = 8192;
dimy = 8192;
flags = flags | MENU_OVERTOP | MENU_NOANI;
backpic = STAT_BACK_PIC;
};
const int STAT_DY = 300;
const int STAT_PLY_Y = 1000;
const int STAT_ATR_Y = 2800;
const int STAT_ARM_Y = 5200;
const int STAT_TAL_Y = 1000;
const int STAT_A_X1 = 500;
const int STAT_A_X2 = 1300;
const int STAT_A_X3 = 2300;
const int STAT_B_X1 = 3500;
const int STAT_B_X2 = 5700;
const int STAT_B_X3 = 7200;
instance MENU_ITEM_PLAYERGUILD_TITLE(C_MENU_ITEM_DEF)
{
text[0] = "Společ.:";
posx = STAT_A_X1;
posy = STAT_PLY_Y + (STAT_DY * 0);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_PLAYERGUILD(C_MENU_ITEM_DEF)
{
posx = STAT_A_X2;
posy = STAT_PLY_Y + (STAT_DY * 0);
dimx = STAT_B_X1 - STAT_A_X2;
dimy = STAT_DY;
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_LEVEL_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_PLY_Y + (1 * STAT_DY);
text[0] = "Úroveň";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_EXP_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_PLY_Y + (2 * STAT_DY);
text[0] = "Zkušenost";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_LEVEL_NEXT_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_PLY_Y + (3 * STAT_DY);
text[0] = "Další úroveň";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_LEARN_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_PLY_Y + (4 * STAT_DY);
text[0] = "Zkušenostní body";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_LEVEL(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_PLY_Y + (1 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_EXP(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_PLY_Y + (2 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_LEVEL_NEXT(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_PLY_Y + (3 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_LEARN(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_PLY_Y + (4 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_HEADING(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_ATR_Y + (0 * STAT_DY);
text[0] = "VLASTNOSTI";
fontname = STAT_FONT_TITLE;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_1_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_ATR_Y + (1 * STAT_DY);
text[0] = "Síla";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_2_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_ATR_Y + (2 * STAT_DY);
text[0] = "Obratnost";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_3_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_ATR_Y + (3 * STAT_DY);
text[0] = "Mana";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_4_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_A_X1;
posy = STAT_ATR_Y + (4 * STAT_DY);
text[0] = "Zdraví";
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_1(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ATR_Y + (1 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_2(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ATR_Y + (2 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_3(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ATR_Y + (3 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ATTRIBUTE_4(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ATR_Y + (4 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_HEADING(C_MENU_ITEM_DEF)
{
text[0] = "OCHRANA";
fontname = STAT_FONT_TITLE;
posx = STAT_A_X1;
posy = STAT_ARM_Y + (0 * STAT_DY);
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_1_TITLE(C_MENU_ITEM_DEF)
{
text[0] = "proti zbraním";
posx = STAT_A_X1;
posy = STAT_ARM_Y + (1 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_2_TITLE(C_MENU_ITEM_DEF)
{
text[0] = "proti šípům";
posx = STAT_A_X1;
posy = STAT_ARM_Y + (2 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_3_TITLE(C_MENU_ITEM_DEF)
{
text[0] = "proti ohni";
posx = STAT_A_X1;
posy = STAT_ARM_Y + (3 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_4_TITLE(C_MENU_ITEM_DEF)
{
text[0] = "proti magii";
posx = STAT_A_X1;
posy = STAT_ARM_Y + (4 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_1(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ARM_Y + (1 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_2(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ARM_Y + (2 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_3(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ARM_Y + (3 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_ARMOR_4(C_MENU_ITEM_DEF)
{
posx = STAT_A_X3;
posy = STAT_ARM_Y + (4 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENTS_WEAPON_HEADING(C_MENU_ITEM_DEF)
{
text[0] = "BOJOVÉ DOVEDNOSTI / KRITICKÝ ÚDER";
posx = STAT_B_X1;
posy = STAT_TAL_Y + (STAT_DY * 0);
fontname = STAT_FONT_TITLE;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENTS_THIEF_HEADING(C_MENU_ITEM_DEF)
{
text[0] = "ZLODĚJ. DOVEDNOSTI / MOŽNOST PŘISTIŽENÍ";
posx = STAT_B_X1;
posy = STAT_TAL_Y + (STAT_DY * 6);
fontname = STAT_FONT_TITLE;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENTS_SPECIAL_HEADING(C_MENU_ITEM_DEF)
{
text[0] = "ZVLÁŠTNÍ DOVEDNOSTI";
posx = STAT_B_X1;
posy = STAT_TAL_Y + (STAT_DY * 14);
fontname = STAT_FONT_TITLE;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_1_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (1 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_1_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (1 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_1(C_MENU_ITEM_DEF)
{
posx = STAT_B_X3;
posy = STAT_TAL_Y + (1 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_2_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (2 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_2_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (2 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_2(C_MENU_ITEM_DEF)
{
posx = STAT_B_X3;
posy = STAT_TAL_Y + (2 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_3_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (3 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_3_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (3 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_3(C_MENU_ITEM_DEF)
{
posx = STAT_B_X3;
posy = STAT_TAL_Y + (3 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_4_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (4 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_4_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (4 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_4(C_MENU_ITEM_DEF)
{
posx = STAT_B_X3;
posy = STAT_TAL_Y + (4 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_5_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (7 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_5_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (7 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_5(C_MENU_ITEM_DEF)
{
posx = STAT_B_X3;
posy = STAT_TAL_Y + (7 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_6_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (8 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_6_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (8 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_6(C_MENU_ITEM_DEF)
{
posx = STAT_B_X3;
posy = STAT_TAL_Y + (8 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_7_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (11 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_7_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (11 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_8_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (15 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_8_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (15 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_9_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (16 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_9_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (16 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_10_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (17 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_10_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (17 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_11_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (18 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_11_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (18 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_12_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (19 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_12_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (19 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_13_TITLE(C_MENU_ITEM_DEF)
{
posx = STAT_B_X1;
posy = STAT_TAL_Y + (20 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
instance MENU_ITEM_TALENT_13_SKILL(C_MENU_ITEM_DEF)
{
posx = STAT_B_X2;
posy = STAT_TAL_Y + (20 * STAT_DY);
fontname = STAT_FONT_DEFAULT;
flags = flags & ~IT_SELECTABLE;
};
| D |
var int rakeplace[50];
const int Greg_FirstSecret = 1;
const int RAKE_BUDDEL_DIST_MAX = 300;
const int RAKE_BUDDEL_DIST_MIN = 200;
func void RakeTreasureSuccess(var C_Item itm)
{
Wld_PlayEffect("spellFX_ItemAusbuddeln",itm,itm,0,0,0,FALSE);
B_Say_Overlay(self,self,"$FOUNDTREASURE");
B_GivePlayerXP(XP_Ambient);
};
func void B_SCUsesRake(var C_Npc slf)
{
};
func void B_SCGetTreasure_S1()
{
var C_Item GregsArmor;
if(Hlp_GetInstanceID(self) == Hlp_GetInstanceID(hero))
{
// Snd_Play("GOL_AMBIENT_A2");
// AI_PlayAni(hero,"T_PLUNDER");
if((Npc_GetDistToWP(hero,"NW_BIGFARM_LAKE_CAVE_07") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[1] == FALSE))
{
Wld_InsertItem(ItSe_GoldPocket25,"NW_BIGFARM_LAKE_CAVE_07");
RAKEPLACE[1] = TRUE;
RakeTreasureSuccess(ItSe_GoldPocket25);
GregsArmor = Npc_GetEquippedArmor(Greg_NW);
if(!Hlp_IsItem(GregsArmor,ITAR_PIR_H_Addon))
{
AI_EquipArmor(Greg_NW,ITAR_PIR_H_Addon);
};
}
else if((Npc_GetDistToWP(hero,"NW_LAKE_GREG_TREASURE_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[2] == FALSE))
{
Wld_InsertItem(ItSe_GoldPocket100,"NW_LAKE_GREG_TREASURE_01");
RAKEPLACE[2] = TRUE;
RakeTreasureSuccess(ItSe_GoldPocket100);
}
else if((Npc_GetDistToWP(hero,"NW_FARM3_GREGTREASURE_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[3] == FALSE))
{
// Wld_InsertItem(ItMi_GoldCup,"NW_FARM3_GREGTREASURE_01");
Wld_InsertItem(ItMi_GoldChalice,"NW_FARM3_GREGTREASURE_01");
RAKEPLACE[3] = TRUE;
// RakeTreasureSuccess(ItMi_GoldCup);
RakeTreasureSuccess(ItMi_GoldChalice);
}
else if((Npc_GetDistToWP(hero,"NW_FARM3_MOUNTAINLAKE_MONSTER_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[4] == FALSE))
{
// Wld_InsertItem(ItMi_SilverChalice,"NW_FARM3_MOUNTAINLAKE_MONSTER_01");
Wld_InsertItem(ItMi_GregsSilverPlate,"NW_FARM3_MOUNTAINLAKE_MONSTER_01");
RAKEPLACE[4] = TRUE;
// RakeTreasureSuccess(ItMi_SilverChalice);
RakeTreasureSuccess(ItMi_GregsSilverPlate);
}
else if((Npc_GetDistToWP(hero,"NW_BIGMILL_FARM3_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[5] == FALSE))
{
Wld_InsertItem(ItAm_Addon_Greg,"NW_BIGMILL_FARM3_01");
RAKEPLACE[5] = TRUE;
RakeTreasureSuccess(ItAm_Addon_Greg);
}
else if((Npc_GetDistToWP(hero,"ADW_ENTRANCE_RAKEPLACE_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[12] == FALSE))
{
Wld_InsertItem(ItWr_StonePlateCommon_Addon,"ADW_ENTRANCE_RAKEPLACE_01");
RAKEPLACE[12] = TRUE;
Wld_InsertItem(ItMi_SilverChalice,"ADW_ENTRANCE_RAKEPLACE_01");
RakeTreasureSuccess(ItMi_SilverChalice);
}
else if((Npc_GetDistToWP(hero,"ADW_ENTRANCE_RAKEPLACE_02") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[13] == FALSE))
{
Wld_InsertItem(ItWr_DexStonePlate1_Addon,"ADW_ENTRANCE_RAKEPLACE_02");
RAKEPLACE[13] = TRUE;
Wld_InsertItem(ItMi_GoldCup,"ADW_ENTRANCE_RAKEPLACE_02");
RakeTreasureSuccess(ItMi_GoldCup);
}
else if((Npc_GetDistToWP(hero,"ADW_ENTRANCE_RAKEPLACE_03") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[14] == FALSE))
{
Wld_InsertItem(ItPo_Perm_Health,"ADW_ENTRANCE_RAKEPLACE_03");
RAKEPLACE[14] = TRUE;
Wld_InsertItem(ItSe_GoldPocket100,"ADW_ENTRANCE_RAKEPLACE_03");
RakeTreasureSuccess(ItSe_GoldPocket100);
}
else if((Npc_GetDistToWP(hero,"ADW_ENTRANCE_RAKEPLACE_04") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[15] == FALSE))
{
Wld_InsertItem(ItMi_SilverRing,"ADW_ENTRANCE_RAKEPLACE_04");
RAKEPLACE[15] = TRUE;
Wld_InsertItem(ItMw_Schwert4,"ADW_ENTRANCE_RAKEPLACE_04");
RakeTreasureSuccess(ItMw_Schwert4);
}
else if((Npc_GetDistToWP(hero,"ADW_VALLEY_GREGTREASURE_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[16] == FALSE))
{
Wld_InsertItem(ItSe_GoldPocket100,"ADW_VALLEY_GREGTREASURE_01");
RAKEPLACE[16] = TRUE;
Wld_InsertItem(ItPo_Health_02,"ADW_VALLEY_GREGTREASURE_01");
Wld_InsertItem(ItPo_Mana_03,"ADW_VALLEY_GREGTREASURE_01");
RakeTreasureSuccess(ItPo_Mana_03);
}
else if((Npc_GetDistToWP(hero,"ADW_VALLEY_RAKEPLACE_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[17] == FALSE))
{
Wld_InsertItem(ItPo_Mana_Addon_04,"ADW_VALLEY_RAKEPLACE_01");
RAKEPLACE[17] = TRUE;
Wld_InsertItem(ItPo_Speed,"ADW_VALLEY_RAKEPLACE_01");
Wld_InsertItem(ItPo_Mana_02,"ADW_VALLEY_RAKEPLACE_01");
RakeTreasureSuccess(ItPo_Mana_02);
}
else if((Npc_GetDistToWP(hero,"ADW_VALLEY_RAKEPLACE_02") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[18] == FALSE))
{
Wld_InsertItem(ItPo_Health_Addon_04,"ADW_VALLEY_RAKEPLACE_02");
RAKEPLACE[18] = TRUE;
Wld_InsertItem(ItWr_StonePlateCommon_Addon,"ADW_VALLEY_RAKEPLACE_02");
Wld_InsertItem(ItSe_LockpickFisch,"ADW_VALLEY_RAKEPLACE_02");
RakeTreasureSuccess(ItSe_LockpickFisch);
}
else if((Npc_GetDistToWP(hero,"ADW_VALLEY_RAKEPLACE_03") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[19] == FALSE))
{
Wld_InsertItem(ItSc_Firerain,"ADW_VALLEY_RAKEPLACE_03");
RAKEPLACE[19] = TRUE;
Wld_InsertItem(ItSe_GoldPocket50,"ADW_VALLEY_RAKEPLACE_03");
Wld_InsertItem(ItWr_StonePlateCommon_Addon,"ADW_VALLEY_RAKEPLACE_03");
RakeTreasureSuccess(ItSe_GoldPocket50);
}
else if((Npc_GetDistToWP(hero,"ADW_BANDITSCAMP_RAKEPLACE_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[20] == FALSE))
{
Wld_InsertItem(ItMi_Honigtabak,"ADW_BANDITSCAMP_RAKEPLACE_01");
RAKEPLACE[20] = TRUE;
Wld_InsertItem(ItWr_StonePlateCommon_Addon,"ADW_BANDITSCAMP_RAKEPLACE_01");
Wld_InsertItem(ItAm_Addon_MANA,"ADW_BANDITSCAMP_RAKEPLACE_01");
RakeTreasureSuccess(ItAm_Addon_MANA);
}
else if((Npc_GetDistToWP(hero,"ADW_BANDITSCAMP_RAKEPLACE_02") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[21] == FALSE))
{
Wld_InsertItem(ItSc_SumGobSkel,"ADW_BANDITSCAMP_RAKEPLACE_02");
RAKEPLACE[21] = TRUE;
Wld_InsertItem(ItPo_Mana_03,"ADW_BANDITSCAMP_RAKEPLACE_02");
RakeTreasureSuccess(ItPo_Mana_03);
}
else if((Npc_GetDistToWP(hero,"ADW_BANDITSCAMP_RAKEPLACE_03") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[22] == FALSE))
{
Wld_InsertItem(ItSc_TrfShadowbeast,"ADW_BANDITSCAMP_RAKEPLACE_03");
RAKEPLACE[22] = TRUE;
Wld_InsertItem(ItSc_LightHeal,"ADW_BANDITSCAMP_RAKEPLACE_03");
RakeTreasureSuccess(ItSc_LightHeal);
}
else if((Npc_GetDistToWP(hero,"ADW_BANDITSCAMP_RAKEPLACE_04") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[23] == FALSE))
{
Wld_InsertItem(ItWr_StonePlateCommon_Addon,"ADW_BANDITSCAMP_RAKEPLACE_04");
RAKEPLACE[23] = TRUE;
Wld_InsertItem(ItRi_HP_01,"ADW_BANDITSCAMP_RAKEPLACE_04");
RakeTreasureSuccess(ItRi_HP_01);
}
else if((Npc_GetDistToWP(hero,"ADW_CANYON_MINE1_11") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[24] == FALSE))
{
Wld_InsertItem(ItSE_Addon_FrancisChest,"ADW_CANYON_MINE1_11");
RAKEPLACE[24] = TRUE;
RakeTreasureSuccess(ItSE_Addon_FrancisChest);
}
else if((Npc_GetDistToWP(hero,"ADW_CANYON_RAKEPLACE_01") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[25] == FALSE))
{
Wld_InsertItem(ItMi_RuneBlank,"ADW_CANYON_RAKEPLACE_01");
RAKEPLACE[25] = TRUE;
Wld_InsertItem(ItSe_GoldPocket25,"ADW_CANYON_RAKEPLACE_01");
RakeTreasureSuccess(ItSe_GoldPocket25);
}
else if((Npc_GetDistToWP(hero,"ADW_CANYON_RAKEPLACE_02") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[26] == FALSE))
{
Wld_InsertItem(ItMi_Nugget,"ADW_CANYON_RAKEPLACE_02");
RAKEPLACE[26] = TRUE;
Wld_InsertItem(ItSc_LightningFlash,"ADW_CANYON_RAKEPLACE_02");
Wld_InsertItem(ItSc_ChargeFireBall,"ADW_CANYON_RAKEPLACE_02");
RakeTreasureSuccess(ItSc_ChargeFireBall);
}
else if((Npc_GetDistToWP(hero,"ADW_CANYON_RAKEPLACE_03") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[27] == FALSE))
{
Wld_InsertItem(ItSe_GoldPocket25,"ADW_CANYON_RAKEPLACE_03");
RAKEPLACE[27] = TRUE;
Wld_InsertItem(ItWr_ManaStonePlate1_Addon,"ADW_CANYON_RAKEPLACE_03");
Wld_InsertItem(ItMi_Pitch,"ADW_CANYON_RAKEPLACE_03");
RakeTreasureSuccess(ItMi_Pitch);
}
else if((Npc_GetDistToWP(hero,"ADW_CANYON_RAKEPLACE_04") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[28] == FALSE))
{
Wld_InsertItem(ItMi_SilverRing,"ADW_CANYON_RAKEPLACE_04");
RAKEPLACE[28] = TRUE;
Wld_InsertItem(ItMi_Sulfur,"ADW_CANYON_RAKEPLACE_04");
Wld_InsertItem(ItWr_TwoHStonePlate1_Addon,"ADW_CANYON_RAKEPLACE_04");
RakeTreasureSuccess(ItWr_TwoHStonePlate1_Addon);
}
else if((Npc_GetDistToWP(hero,"ADW_CANYON_RAKEPLACE_05") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[29] == FALSE))
{
Wld_InsertItem(ItMi_GoldRing,"ADW_CANYON_RAKEPLACE_05");
RAKEPLACE[29] = TRUE;
Wld_InsertItem(ItAt_DragonBlood,"ADW_CANYON_RAKEPLACE_05");
RakeTreasureSuccess(ItAt_DragonBlood);
}
else if((Npc_GetDistToWP(hero,"ADW_PIRATECAMP_GREGTREASURE_KOMPASS") < RAKE_BUDDEL_DIST_MIN) && (RAKEPLACE[30] == FALSE))
{
Wld_InsertItem(ItMI_Addon_Kompass_Mis,"ADW_PIRATECAMP_GREGTREASURE_KOMPASS");
RAKEPLACE[30] = TRUE;
RakeTreasureSuccess(ItMI_Addon_Kompass_Mis);
};
};
};
| D |
/home/aitorzaldua/rust_bootcamp/collatz/target/rls/debug/deps/collatz-b73fa36eb89e8134.rmeta: src/main.rs
/home/aitorzaldua/rust_bootcamp/collatz/target/rls/debug/deps/collatz-b73fa36eb89e8134.d: src/main.rs
src/main.rs:
| D |
/Users/rossroberts/Exercism/rust/reverse-string/target/debug/deps/reverse_string-b15dc2b6eb4fb505: src/lib.rs
/Users/rossroberts/Exercism/rust/reverse-string/target/debug/deps/reverse_string-b15dc2b6eb4fb505.d: src/lib.rs
src/lib.rs:
| D |
# FIXED
driverlib/interrupt.obj: C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/interrupt.c
driverlib/interrupt.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.0.LTS/include/stdbool.h
driverlib/interrupt.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.0.LTS/include/stdint.h
driverlib/interrupt.obj: C:/ti/TivaWare_C_Series-2.1.4.178/inc/hw_ints.h
driverlib/interrupt.obj: C:/ti/TivaWare_C_Series-2.1.4.178/inc/hw_nvic.h
driverlib/interrupt.obj: C:/ti/TivaWare_C_Series-2.1.4.178/inc/hw_types.h
driverlib/interrupt.obj: C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/cpu.h
driverlib/interrupt.obj: C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/debug.h
driverlib/interrupt.obj: C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/interrupt.h
C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/interrupt.c:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.0.LTS/include/stdbool.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.0.LTS/include/stdint.h:
C:/ti/TivaWare_C_Series-2.1.4.178/inc/hw_ints.h:
C:/ti/TivaWare_C_Series-2.1.4.178/inc/hw_nvic.h:
C:/ti/TivaWare_C_Series-2.1.4.178/inc/hw_types.h:
C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/cpu.h:
C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/debug.h:
C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/interrupt.h:
| D |
/home/tyler/Documents/AdventOfCode/Rust/day_24_1/target/debug/deps/day_24_1-aa98cbd54740ebab: src/main.rs
/home/tyler/Documents/AdventOfCode/Rust/day_24_1/target/debug/deps/day_24_1-aa98cbd54740ebab.d: src/main.rs
src/main.rs:
| D |
module net.pms.configuration.WindowsDefaultPaths;
import net.pms.util.PropertiesUtil;
import org.apache.commons.lang.StringUtils : isNotBlank;
class WindowsDefaultPaths : ProgramPaths {
override
public String getEac3toPath() {
return getBinariesPath() ~ "win32/eac3to/eac3to.exe";
}
override
public String getFfmpegPath() {
return getBinariesPath() ~ "win32/ffmpeg.exe";
}
override
public String getFlacPath() {
return getBinariesPath() ~ "win32/flac.exe";
}
override
public String getMencoderPath() {
return getBinariesPath() ~ "win32/mencoder.exe";
}
override
public String getMplayerPath() {
return getBinariesPath() ~ "win32/mplayer.exe";
}
override
public String getTsmuxerPath() {
return getBinariesPath() ~ "win32/tsMuxeR.exe";
}
override
public String getVlcPath() {
return getBinariesPath() ~ "videolan/vlc.exe";
}
override
public String getDCRaw() {
return getBinariesPath() ~ "win32/dcrawMS.exe";
}
override
public String getIMConvertPath() {
return getBinariesPath() ~ "win32/convert.exe";
}
/**
* Returns the path where binaries can be found. This path differs between
* the build phase and the test phase. The path will end with a slash unless
* it is empty.
*
* @return The path for binaries.
*/
private String getBinariesPath() {
String path = PropertiesUtil.getProjectProperties().get("project.binaries.dir");
if (isNotBlank(path)) {
if (path.endsWith("/")) {
return path;
} else {
return path + "/";
}
} else {
return "";
}
}
}
| D |
module UnrealScript.TribesGame.TrFamilyInfoList;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Core.UObject;
extern(C++) interface TrFamilyInfoList : UObject
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrFamilyInfoList")); }
private static __gshared TrFamilyInfoList mDefaultProperties;
@property final static TrFamilyInfoList DefaultProperties() { mixin(MGDPC("TrFamilyInfoList", "TrFamilyInfoList TribesGame.Default__TrFamilyInfoList")); }
@property final auto ref ScriptArray!(ScriptString) ClassList() { mixin(MGPC("ScriptArray!(ScriptString)", 60)); }
}
| D |
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;
void main()
{
auto nt = readln.split.to!(int[]);
auto N = nt[0];
auto T = nt[1];
auto ts = new int[](T+1);
foreach (_; 0..N) {
auto A = readln.chomp.to!int;
auto a = A;
while (a <= T) {
ts[a] += 1;
a += A;
}
}
writeln(0.reduce!"a > b ? a : b"(ts));
} | D |
/Users/shawngong/Centa/.build/debug/Jay.build/ArrayParser.swift.o : /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ArrayParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/BooleanParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ByteReader.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/CommentParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Consts.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Error.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Extensions.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Formatter.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Jay.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NativeParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NativeTypeConversions.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NullParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NumberParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ObjectParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/OutputStream.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Parser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Reader.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/RootParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/StringParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Types.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ValueParser.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/shawngong/Centa/.build/debug/Jay.build/ArrayParser~partial.swiftmodule : /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ArrayParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/BooleanParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ByteReader.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/CommentParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Consts.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Error.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Extensions.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Formatter.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Jay.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NativeParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NativeTypeConversions.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NullParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NumberParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ObjectParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/OutputStream.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Parser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Reader.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/RootParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/StringParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Types.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ValueParser.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/shawngong/Centa/.build/debug/Jay.build/ArrayParser~partial.swiftdoc : /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ArrayParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/BooleanParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ByteReader.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/CommentParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Consts.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Error.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Extensions.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Formatter.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Jay.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NativeParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NativeTypeConversions.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NullParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/NumberParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ObjectParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/OutputStream.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Parser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Reader.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/RootParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/StringParser.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/Types.swift /Users/shawngong/Centa/Packages/Jay-1.0.1/Sources/Jay/ValueParser.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Users/shawngong/Centa/.build/debug/CLibreSSL.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
| D |
instance Mod_7040_RIT_Ritter_MT (Npc_Default)
{
// ------ NSC ------
name = NAME_RITTER;
guild = GIL_PAL;
id = 7040;
voice = 0;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 4); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_Schwert_03);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_P_Tough_Torrez, BodyTex_P, ITAR_PAL_M);
Mdl_SetModelFatness (self, 0);
Mdl_ApplyOverlayMds (self, "Humans_Militia.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 75); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ TA anmelden ------
daily_routine = Rtn_Start_7040;
};
FUNC VOID Rtn_Start_7040 ()
{
TA_Stand_Guarding (08,00,23,00, "OW_SAWHUT_MOLERAT_MOVEMENT6");
TA_Stand_Guarding (23,00,08,00, "OW_SAWHUT_MOLERAT_MOVEMENT6");
};
FUNC VOID Rtn_ToVM_7040 ()
{
TA_Follow_Player (08,00,21,00,"OW_PATH_1_16");
TA_Follow_Player (21,00,08,00,"OW_PATH_1_16");
};
FUNC VOID Rtn_ToAustausch_7040 ()
{
TA_Follow_Player (08,00,21,00,"WP_INTRO_FALL3");
TA_Follow_Player (21,00,08,00,"WP_INTRO_FALL3");
};
FUNC VOID Rtn_AtAustausch_7040 ()
{
TA_Stand_ArmsCrossed (08,00,21,00,"WP_INTRO_FALL3");
TA_Stand_ArmsCrossed (21,00,08,00,"WP_INTRO_FALL3");
};
| D |
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* Authors: Stewart Gordon
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC src/core/sys/windows/_wininet.d)
*/
module core.sys.windows.wininet;
version (Windows):
pragma(lib, "wininet");
// FIXME: check types and grouping of constants
import core.sys.windows.windows;
enum {
INTERNET_INVALID_PORT_NUMBER = 0,
INTERNET_DEFAULT_FTP_PORT = 21,
INTERNET_DEFAULT_GOPHER_PORT = 70,
INTERNET_DEFAULT_HTTP_PORT = 80,
INTERNET_DEFAULT_HTTPS_PORT = 443,
INTERNET_DEFAULT_SOCKS_PORT = 1080
}
const size_t
MAX_CACHE_ENTRY_INFO_SIZE = 4096,
INTERNET_MAX_HOST_NAME_LENGTH = 256,
INTERNET_MAX_USER_NAME_LENGTH = 128,
INTERNET_MAX_PASSWORD_LENGTH = 128,
INTERNET_MAX_PORT_NUMBER_LENGTH = 5,
INTERNET_MAX_PORT_NUMBER_VALUE = 65535,
INTERNET_MAX_PATH_LENGTH = 2048,
INTERNET_MAX_SCHEME_LENGTH = 32,
INTERNET_MAX_URL_LENGTH = INTERNET_MAX_SCHEME_LENGTH
+ "://".length
+ INTERNET_MAX_PATH_LENGTH;
enum : DWORD {
INTERNET_KEEP_ALIVE_UNKNOWN = DWORD.max,
INTERNET_KEEP_ALIVE_DISABLED = 0,
INTERNET_KEEP_ALIVE_ENABLED
}
enum {
INTERNET_REQFLAG_FROM_CACHE = 1,
INTERNET_REQFLAG_ASYNC = 2
}
const DWORD
INTERNET_FLAG_RELOAD = 0x80000000,
INTERNET_FLAG_RAW_DATA = 0x40000000,
INTERNET_FLAG_EXISTING_CONNECT = 0x20000000,
INTERNET_FLAG_ASYNC = 0x10000000,
INTERNET_FLAG_PASSIVE = 0x08000000,
INTERNET_FLAG_NO_CACHE_WRITE = 0x04000000,
INTERNET_FLAG_DONT_CACHE = INTERNET_FLAG_NO_CACHE_WRITE,
INTERNET_FLAG_MAKE_PERSISTENT = 0x02000000,
INTERNET_FLAG_OFFLINE = 0x01000000,
INTERNET_FLAG_SECURE = 0x00800000,
INTERNET_FLAG_KEEP_CONNECTION = 0x00400000,
INTERNET_FLAG_NO_AUTO_REDIRECT = 0x00200000,
INTERNET_FLAG_READ_PREFETCH = 0x00100000,
INTERNET_FLAG_NO_COOKIES = 0x00080000,
INTERNET_FLAG_NO_AUTH = 0x00040000,
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP = 0x00008000,
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS = 0x00004000,
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID = 0x00002000,
INTERNET_FLAG_IGNORE_CERT_CN_INVALID = 0x00001000,
INTERNET_FLAG_RESYNCHRONIZE = 0x00000800,
INTERNET_FLAG_HYPERLINK = 0x00000400,
INTERNET_FLAG_NO_UI = 0x00000200,
INTERNET_FLAG_PRAGMA_NOCACHE = 0x00000100,
INTERNET_FLAG_MUST_CACHE_REQUEST = 0x00000010,
INTERNET_FLAG_TRANSFER_ASCII = FTP_TRANSFER_TYPE_ASCII,
INTERNET_FLAG_TRANSFER_BINARY = FTP_TRANSFER_TYPE_BINARY,
SECURITY_INTERNET_MASK = 0x0000F000,
SECURITY_SET_MASK = SECURITY_INTERNET_MASK,
INTERNET_FLAGS_MASK = 0xFFFCFE13,
INTERNET_OPTIONS_MASK = ~INTERNET_FLAGS_MASK;
const INTERNET_NO_CALLBACK = 0;
const INTERNET_RFC1123_FORMAT = 0;
const size_t INTERNET_RFC1123_BUFSIZE = 30;
const DWORD
ICU_ESCAPE = 0x80000000,
ICU_USERNAME = 0x40000000,
ICU_NO_ENCODE = 0x20000000,
ICU_DECODE = 0x10000000,
ICU_NO_META = 0x08000000,
ICU_ENCODE_SPACES_ONLY = 0x04000000,
ICU_BROWSER_MODE = 0x02000000;
enum {
INTERNET_OPEN_TYPE_PRECONFIG = 0,
INTERNET_OPEN_TYPE_DIRECT = 1,
INTERNET_OPEN_TYPE_PROXY = 3,
PRE_CONFIG_INTERNET_ACCESS = INTERNET_OPEN_TYPE_PRECONFIG,
LOCAL_INTERNET_ACCESS = INTERNET_OPEN_TYPE_DIRECT,
GATEWAY_INTERNET_ACCESS = 2,
CERN_PROXY_INTERNET_ACCESS = INTERNET_OPEN_TYPE_PROXY,
}
const ISO_GLOBAL = 1;
const ISO_REGISTRY = 2;
const ISO_VALID_FLAGS = ISO_GLOBAL | ISO_REGISTRY;
enum {
INTERNET_OPTION_CALLBACK = 1,
INTERNET_OPTION_CONNECT_TIMEOUT,
INTERNET_OPTION_CONNECT_RETRIES,
INTERNET_OPTION_CONNECT_BACKOFF,
INTERNET_OPTION_SEND_TIMEOUT,
INTERNET_OPTION_CONTROL_SEND_TIMEOUT = INTERNET_OPTION_SEND_TIMEOUT,
INTERNET_OPTION_RECEIVE_TIMEOUT,
INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT = INTERNET_OPTION_RECEIVE_TIMEOUT,
INTERNET_OPTION_DATA_SEND_TIMEOUT,
INTERNET_OPTION_DATA_RECEIVE_TIMEOUT,
INTERNET_OPTION_HANDLE_TYPE,
INTERNET_OPTION_CONTEXT_VALUE,
INTERNET_OPTION_LISTEN_TIMEOUT,
INTERNET_OPTION_READ_BUFFER_SIZE,
INTERNET_OPTION_WRITE_BUFFER_SIZE, // = 13
INTERNET_OPTION_ASYNC_ID = 15,
INTERNET_OPTION_ASYNC_PRIORITY, // = 16
INTERNET_OPTION_PARENT_HANDLE = 21,
INTERNET_OPTION_KEEP_CONNECTION,
INTERNET_OPTION_REQUEST_FLAGS,
INTERNET_OPTION_EXTENDED_ERROR, // = 24
INTERNET_OPTION_OFFLINE_MODE = 26,
INTERNET_OPTION_CACHE_STREAM_HANDLE,
INTERNET_OPTION_USERNAME,
INTERNET_OPTION_PASSWORD,
INTERNET_OPTION_ASYNC,
INTERNET_OPTION_SECURITY_FLAGS,
INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT,
INTERNET_OPTION_DATAFILE_NAME,
INTERNET_OPTION_URL,
INTERNET_OPTION_SECURITY_CERTIFICATE,
INTERNET_OPTION_SECURITY_KEY_BITNESS,
INTERNET_OPTION_REFRESH,
INTERNET_OPTION_PROXY,
INTERNET_OPTION_SETTINGS_CHANGED,
INTERNET_OPTION_VERSION,
INTERNET_OPTION_USER_AGENT,
INTERNET_OPTION_END_BROWSER_SESSION,
INTERNET_OPTION_PROXY_USERNAME,
INTERNET_OPTION_PROXY_PASSWORD, // = 44
INTERNET_FIRST_OPTION = INTERNET_OPTION_CALLBACK,
// why?
INTERNET_LAST_OPTION = INTERNET_OPTION_USER_AGENT
}
const INTERNET_PRIORITY_FOREGROUND = 1000;
enum {
INTERNET_HANDLE_TYPE_INTERNET = 1,
INTERNET_HANDLE_TYPE_CONNECT_FTP,
INTERNET_HANDLE_TYPE_CONNECT_GOPHER,
INTERNET_HANDLE_TYPE_CONNECT_HTTP,
INTERNET_HANDLE_TYPE_FTP_FIND,
INTERNET_HANDLE_TYPE_FTP_FIND_HTML,
INTERNET_HANDLE_TYPE_FTP_FILE,
INTERNET_HANDLE_TYPE_FTP_FILE_HTML,
INTERNET_HANDLE_TYPE_GOPHER_FIND,
INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML,
INTERNET_HANDLE_TYPE_GOPHER_FILE,
INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML,
INTERNET_HANDLE_TYPE_HTTP_REQUEST
}
const DWORD
SECURITY_FLAG_SECURE = 0x00000001,
SECURITY_FLAG_SSL = 0x00000002,
SECURITY_FLAG_SSL3 = 0x00000004,
SECURITY_FLAG_PCT = 0x00000008,
SECURITY_FLAG_PCT4 = 0x00000010,
SECURITY_FLAG_IETFSSL4 = 0x00000020,
SECURITY_FLAG_IGNORE_REVOCATION = 0x00000080,
SECURITY_FLAG_IGNORE_UNKNOWN_CA = 0x00000100,
SECURITY_FLAG_IGNORE_WRONG_USAGE = 0x00000200,
SECURITY_FLAG_40BIT = 0x10000000,
SECURITY_FLAG_128BIT = 0x20000000,
SECURITY_FLAG_56BIT = 0x40000000,
SECURITY_FLAG_UNKNOWNBIT = 0x80000000,
SECURITY_FLAG_NORMALBITNESS = SECURITY_FLAG_40BIT,
SECURITY_FLAG_IGNORE_CERT_CN_INVALID = INTERNET_FLAG_IGNORE_CERT_CN_INVALID,
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID = INTERNET_FLAG_IGNORE_CERT_DATE_INVALID,
SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS,
SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
enum {
INTERNET_SERVICE_FTP = 1,
INTERNET_SERVICE_GOPHER,
INTERNET_SERVICE_HTTP
}
enum {
INTERNET_STATUS_RESOLVING_NAME = 10,
INTERNET_STATUS_NAME_RESOLVED = 11,
INTERNET_STATUS_CONNECTING_TO_SERVER = 20,
INTERNET_STATUS_CONNECTED_TO_SERVER = 21,
INTERNET_STATUS_SENDING_REQUEST = 30,
INTERNET_STATUS_REQUEST_SENT = 31,
INTERNET_STATUS_RECEIVING_RESPONSE = 40,
INTERNET_STATUS_RESPONSE_RECEIVED = 41,
INTERNET_STATUS_CTL_RESPONSE_RECEIVED = 42,
INTERNET_STATUS_PREFETCH = 43,
INTERNET_STATUS_CLOSING_CONNECTION = 50,
INTERNET_STATUS_CONNECTION_CLOSED = 51,
INTERNET_STATUS_HANDLE_CREATED = 60,
INTERNET_STATUS_HANDLE_CLOSING = 70,
INTERNET_STATUS_REQUEST_COMPLETE = 100,
INTERNET_STATUS_REDIRECT = 110
}
enum {
FTP_TRANSFER_TYPE_UNKNOWN = 0,
FTP_TRANSFER_TYPE_ASCII = 1,
FTP_TRANSFER_TYPE_BINARY = 2,
FTP_TRANSFER_TYPE_MASK = 3
}
const size_t
MAX_GOPHER_DISPLAY_TEXT = 128,
MAX_GOPHER_SELECTOR_TEXT = 256,
MAX_GOPHER_HOST_NAME = INTERNET_MAX_HOST_NAME_LENGTH,
MAX_GOPHER_LOCATOR_LENGTH
= 1 + MAX_GOPHER_DISPLAY_TEXT + 1 + MAX_GOPHER_SELECTOR_TEXT + 1
+ MAX_GOPHER_HOST_NAME + 1 + INTERNET_MAX_PORT_NUMBER_LENGTH + 4;
const DWORD
GOPHER_TYPE_TEXT_FILE = 0x00000001,
GOPHER_TYPE_DIRECTORY = 0x00000002,
GOPHER_TYPE_CSO = 0x00000004,
GOPHER_TYPE_ERROR = 0x00000008,
GOPHER_TYPE_MAC_BINHEX = 0x00000010,
GOPHER_TYPE_DOS_ARCHIVE = 0x00000020,
GOPHER_TYPE_UNIX_UUENCODED = 0x00000040,
GOPHER_TYPE_INDEX_SERVER = 0x00000080,
GOPHER_TYPE_TELNET = 0x00000100,
GOPHER_TYPE_BINARY = 0x00000200,
GOPHER_TYPE_REDUNDANT = 0x00000400,
GOPHER_TYPE_TN3270 = 0x00000800,
GOPHER_TYPE_GIF = 0x00001000,
GOPHER_TYPE_IMAGE = 0x00002000,
GOPHER_TYPE_BITMAP = 0x00004000,
GOPHER_TYPE_MOVIE = 0x00008000,
GOPHER_TYPE_SOUND = 0x00010000,
GOPHER_TYPE_HTML = 0x00020000,
GOPHER_TYPE_PDF = 0x00040000,
GOPHER_TYPE_CALENDAR = 0x00080000,
GOPHER_TYPE_INLINE = 0x00100000,
GOPHER_TYPE_UNKNOWN = 0x20000000,
GOPHER_TYPE_ASK = 0x40000000,
GOPHER_TYPE_GOPHER_PLUS = 0x80000000,
GOPHER_TYPE_FILE_MASK = 0x001FF271;
BOOL IS_GOPHER_FILE(DWORD t) {
return !!(t & GOPHER_TYPE_FILE_MASK);
}
BOOL IS_GOPHER_DIRECTORY(DWORD t) {
return !!(t & GOPHER_TYPE_DIRECTORY);
}
BOOL IS_GOPHER_PHONE_SERVER(DWORD t) {
return !!(t & GOPHER_TYPE_CSO);
}
BOOL IS_GOPHER_ERROR(DWORD t) {
return !!(t & GOPHER_TYPE_ERROR);
}
BOOL IS_GOPHER_INDEX_SERVER(DWORD t) {
return !!(t & GOPHER_TYPE_INDEX_SERVER);
}
BOOL IS_GOPHER_TELNET_SESSION(DWORD t) {
return !!(t & GOPHER_TYPE_TELNET);
}
BOOL IS_GOPHER_BACKUP_SERVER(DWORD t) {
return !!(t & GOPHER_TYPE_REDUNDANT);
}
BOOL IS_GOPHER_TN3270_SESSION(DWORD t) {
return !!(t & GOPHER_TYPE_TN3270);
}
BOOL IS_GOPHER_ASK(DWORD t) {
return !!(t & GOPHER_TYPE_ASK);
}
BOOL IS_GOPHER_PLUS(DWORD t) {
return !!(t & GOPHER_TYPE_GOPHER_PLUS);
}
BOOL IS_GOPHER_TYPE_KNOWN(DWORD t) {
return !(t & GOPHER_TYPE_UNKNOWN);
}
const size_t
MAX_GOPHER_CATEGORY_NAME = 128,
MAX_GOPHER_ATTRIBUTE_NAME = 128,
MIN_GOPHER_ATTRIBUTE_LENGTH = 256;
const TCHAR[]
GOPHER_INFO_CATEGORY = "+INFO",
GOPHER_ADMIN_CATEGORY = "+ADMIN",
GOPHER_VIEWS_CATEGORY = "+VIEWS",
GOPHER_ABSTRACT_CATEGORY = "+ABSTRACT",
GOPHER_VERONICA_CATEGORY = "+VERONICA",
GOPHER_ADMIN_ATTRIBUTE = "Admin",
GOPHER_MOD_DATE_ATTRIBUTE = "Mod-Date",
GOPHER_TTL_ATTRIBUTE = "TTL",
GOPHER_SCORE_ATTRIBUTE = "Score",
GOPHER_RANGE_ATTRIBUTE = "Score-range",
GOPHER_SITE_ATTRIBUTE = "Site",
GOPHER_ORG_ATTRIBUTE = "Org",
GOPHER_LOCATION_ATTRIBUTE = "Loc",
GOPHER_GEOG_ATTRIBUTE = "Geog",
GOPHER_TIMEZONE_ATTRIBUTE = "TZ",
GOPHER_PROVIDER_ATTRIBUTE = "Provider",
GOPHER_VERSION_ATTRIBUTE = "Version",
GOPHER_ABSTRACT_ATTRIBUTE = "Abstract",
GOPHER_VIEW_ATTRIBUTE = "View",
GOPHER_TREEWALK_ATTRIBUTE = "treewalk";
enum : DWORD {
GOPHER_ATTRIBUTE_ID_BASE = 0xABCCCC00,
GOPHER_CATEGORY_ID_ALL,
GOPHER_CATEGORY_ID_INFO,
GOPHER_CATEGORY_ID_ADMIN,
GOPHER_CATEGORY_ID_VIEWS,
GOPHER_CATEGORY_ID_ABSTRACT,
GOPHER_CATEGORY_ID_VERONICA,
GOPHER_CATEGORY_ID_ASK,
GOPHER_CATEGORY_ID_UNKNOWN,
GOPHER_ATTRIBUTE_ID_ALL,
GOPHER_ATTRIBUTE_ID_ADMIN,
GOPHER_ATTRIBUTE_ID_MOD_DATE,
GOPHER_ATTRIBUTE_ID_TTL,
GOPHER_ATTRIBUTE_ID_SCORE,
GOPHER_ATTRIBUTE_ID_RANGE,
GOPHER_ATTRIBUTE_ID_SITE,
GOPHER_ATTRIBUTE_ID_ORG,
GOPHER_ATTRIBUTE_ID_LOCATION,
GOPHER_ATTRIBUTE_ID_GEOG,
GOPHER_ATTRIBUTE_ID_TIMEZONE,
GOPHER_ATTRIBUTE_ID_PROVIDER,
GOPHER_ATTRIBUTE_ID_VERSION,
GOPHER_ATTRIBUTE_ID_ABSTRACT,
GOPHER_ATTRIBUTE_ID_VIEW,
GOPHER_ATTRIBUTE_ID_TREEWALK,
GOPHER_ATTRIBUTE_ID_UNKNOWN
}
const HTTP_MAJOR_VERSION = 1;
const HTTP_MINOR_VERSION = 0;
const TCHAR[] HTTP_VERSION = "HTTP/1.0";
enum : DWORD {
HTTP_QUERY_MIME_VERSION,
HTTP_QUERY_CONTENT_TYPE,
HTTP_QUERY_CONTENT_TRANSFER_ENCODING,
HTTP_QUERY_CONTENT_ID,
HTTP_QUERY_CONTENT_DESCRIPTION,
HTTP_QUERY_CONTENT_LENGTH,
HTTP_QUERY_CONTENT_LANGUAGE,
HTTP_QUERY_ALLOW,
HTTP_QUERY_PUBLIC,
HTTP_QUERY_DATE,
HTTP_QUERY_EXPIRES,
HTTP_QUERY_LAST_MODIFIED,
HTTP_QUERY_MESSAGE_ID,
HTTP_QUERY_URI,
HTTP_QUERY_DERIVED_FROM,
HTTP_QUERY_COST,
HTTP_QUERY_LINK,
HTTP_QUERY_PRAGMA,
HTTP_QUERY_VERSION,
HTTP_QUERY_STATUS_CODE,
HTTP_QUERY_STATUS_TEXT,
HTTP_QUERY_RAW_HEADERS,
HTTP_QUERY_RAW_HEADERS_CRLF,
HTTP_QUERY_CONNECTION,
HTTP_QUERY_ACCEPT,
HTTP_QUERY_ACCEPT_CHARSET,
HTTP_QUERY_ACCEPT_ENCODING,
HTTP_QUERY_ACCEPT_LANGUAGE,
HTTP_QUERY_AUTHORIZATION,
HTTP_QUERY_CONTENT_ENCODING,
HTTP_QUERY_FORWARDED,
HTTP_QUERY_FROM,
HTTP_QUERY_IF_MODIFIED_SINCE,
HTTP_QUERY_LOCATION,
HTTP_QUERY_ORIG_URI,
HTTP_QUERY_REFERER,
HTTP_QUERY_RETRY_AFTER,
HTTP_QUERY_SERVER,
HTTP_QUERY_TITLE,
HTTP_QUERY_USER_AGENT,
HTTP_QUERY_WWW_AUTHENTICATE,
HTTP_QUERY_PROXY_AUTHENTICATE,
HTTP_QUERY_ACCEPT_RANGES,
HTTP_QUERY_SET_COOKIE,
HTTP_QUERY_COOKIE,
HTTP_QUERY_REQUEST_METHOD,
HTTP_QUERY_MAX = 45,
HTTP_QUERY_CUSTOM = 65535
}
const DWORD
HTTP_QUERY_FLAG_REQUEST_HEADERS = 0x80000000,
HTTP_QUERY_FLAG_SYSTEMTIME = 0x40000000,
HTTP_QUERY_FLAG_NUMBER = 0x20000000,
HTTP_QUERY_FLAG_COALESCE = 0x10000000,
HTTP_QUERY_MODIFIER_FLAGS_MASK = 0xF0000000,
HTTP_QUERY_HEADER_MASK = ~HTTP_QUERY_MODIFIER_FLAGS_MASK;
enum {
HTTP_STATUS_OK = 200,
HTTP_STATUS_CREATED,
HTTP_STATUS_ACCEPTED,
HTTP_STATUS_PARTIAL,
HTTP_STATUS_NO_CONTENT, // = 204
HTTP_STATUS_AMBIGUOUS = 300,
HTTP_STATUS_MOVED,
HTTP_STATUS_REDIRECT,
HTTP_STATUS_REDIRECT_METHOD,
HTTP_STATUS_NOT_MODIFIED, // = 304
HTTP_STATUS_BAD_REQUEST = 400,
HTTP_STATUS_DENIED,
HTTP_STATUS_PAYMENT_REQ,
HTTP_STATUS_FORBIDDEN,
HTTP_STATUS_NOT_FOUND,
HTTP_STATUS_BAD_METHOD,
HTTP_STATUS_NONE_ACCEPTABLE,
HTTP_STATUS_PROXY_AUTH_REQ,
HTTP_STATUS_REQUEST_TIMEOUT,
HTTP_STATUS_CONFLICT,
HTTP_STATUS_GONE,
HTTP_STATUS_AUTH_REFUSED, // = 411
HTTP_STATUS_SERVER_ERROR = 500,
HTTP_STATUS_NOT_SUPPORTED,
HTTP_STATUS_BAD_GATEWAY,
HTTP_STATUS_SERVICE_UNAVAIL,
HTTP_STATUS_GATEWAY_TIMEOUT // = 504
}
enum {
INTERNET_PREFETCH_PROGRESS,
INTERNET_PREFETCH_COMPLETE,
INTERNET_PREFETCH_ABORTED
}
const FLAGS_ERROR_UI_FILTER_FOR_ERRORS = 0x01;
const FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS = 0x02;
const FLAGS_ERROR_UI_FLAGS_GENERATE_DATA = 0x04;
const FLAGS_ERROR_UI_FLAGS_NO_UI = 0x08;
const DWORD
HTTP_ADDREQ_INDEX_MASK = 0x0000FFFF,
HTTP_ADDREQ_FLAGS_MASK = 0xFFFF0000,
HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON = 0x01000000,
HTTP_ADDREQ_FLAG_ADD_IF_NEW = 0x10000000,
HTTP_ADDREQ_FLAG_ADD = 0x20000000,
HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA = 0x40000000,
HTTP_ADDREQ_FLAG_COALESCE = HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA,
HTTP_ADDREQ_FLAG_REPLACE = 0x80000000;
enum {
INTERNET_ERROR_BASE = 12000,
ERROR_INTERNET_OUT_OF_HANDLES,
ERROR_INTERNET_TIMEOUT,
ERROR_INTERNET_EXTENDED_ERROR,
ERROR_INTERNET_INTERNAL_ERROR,
ERROR_INTERNET_INVALID_URL,
ERROR_INTERNET_UNRECOGNIZED_SCHEME,
ERROR_INTERNET_NAME_NOT_RESOLVED,
ERROR_INTERNET_PROTOCOL_NOT_FOUND,
ERROR_INTERNET_INVALID_OPTION,
ERROR_INTERNET_BAD_OPTION_LENGTH,
ERROR_INTERNET_OPTION_NOT_SETTABLE,
ERROR_INTERNET_SHUTDOWN,
ERROR_INTERNET_INCORRECT_USER_NAME,
ERROR_INTERNET_INCORRECT_PASSWORD,
ERROR_INTERNET_LOGIN_FAILURE,
ERROR_INTERNET_INVALID_OPERATION,
ERROR_INTERNET_OPERATION_CANCELLED,
ERROR_INTERNET_INCORRECT_HANDLE_TYPE,
ERROR_INTERNET_INCORRECT_HANDLE_STATE,
ERROR_INTERNET_NOT_PROXY_REQUEST,
ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND,
ERROR_INTERNET_BAD_REGISTRY_PARAMETER,
ERROR_INTERNET_NO_DIRECT_ACCESS,
ERROR_INTERNET_NO_CONTEXT,
ERROR_INTERNET_NO_CALLBACK,
ERROR_INTERNET_REQUEST_PENDING,
ERROR_INTERNET_INCORRECT_FORMAT,
ERROR_INTERNET_ITEM_NOT_FOUND,
ERROR_INTERNET_CANNOT_CONNECT,
ERROR_INTERNET_CONNECTION_ABORTED,
ERROR_INTERNET_CONNECTION_RESET,
ERROR_INTERNET_FORCE_RETRY,
ERROR_INTERNET_INVALID_PROXY_REQUEST,
ERROR_INTERNET_NEED_UI, // = INTERNET_ERROR_BASE + 34
ERROR_INTERNET_HANDLE_EXISTS = INTERNET_ERROR_BASE + 36,
ERROR_INTERNET_SEC_CERT_DATE_INVALID,
ERROR_INTERNET_SEC_CERT_CN_INVALID,
ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR,
ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR,
ERROR_INTERNET_MIXED_SECURITY,
ERROR_INTERNET_CHG_POST_IS_NON_SECURE,
ERROR_INTERNET_POST_IS_NON_SECURE,
ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED,
ERROR_INTERNET_INVALID_CA,
ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP,
ERROR_INTERNET_ASYNC_THREAD_FAILED,
ERROR_INTERNET_REDIRECT_SCHEME_CHANGE, // = INTERNET_ERROR_BASE + 48
ERROR_FTP_TRANSFER_IN_PROGRESS = INTERNET_ERROR_BASE + 110,
ERROR_FTP_DROPPED, // = INTERNET_ERROR_BASE + 111
ERROR_GOPHER_PROTOCOL_ERROR = INTERNET_ERROR_BASE + 130,
ERROR_GOPHER_NOT_FILE,
ERROR_GOPHER_DATA_ERROR,
ERROR_GOPHER_END_OF_DATA,
ERROR_GOPHER_INVALID_LOCATOR,
ERROR_GOPHER_INCORRECT_LOCATOR_TYPE,
ERROR_GOPHER_NOT_GOPHER_PLUS,
ERROR_GOPHER_ATTRIBUTE_NOT_FOUND,
ERROR_GOPHER_UNKNOWN_LOCATOR, // = INTERNET_ERROR_BASE + 138,
ERROR_HTTP_HEADER_NOT_FOUND = INTERNET_ERROR_BASE + 150,
ERROR_HTTP_DOWNLEVEL_SERVER,
ERROR_HTTP_INVALID_SERVER_RESPONSE,
ERROR_HTTP_INVALID_HEADER,
ERROR_HTTP_INVALID_QUERY_REQUEST,
ERROR_HTTP_HEADER_ALREADY_EXISTS,
ERROR_HTTP_REDIRECT_FAILED,
ERROR_INTERNET_SECURITY_CHANNEL_ERROR,
ERROR_INTERNET_UNABLE_TO_CACHE_FILE,
ERROR_INTERNET_TCPIP_NOT_INSTALLED,
ERROR_HTTP_NOT_REDIRECTED, // = INTERNET_ERROR_BASE + 160
// why?
INTERNET_ERROR_LAST = ERROR_INTERNET_TCPIP_NOT_INSTALLED
}
const NORMAL_CACHE_ENTRY = 0x000001;
const STABLE_CACHE_ENTRY = 0x000002;
const STICKY_CACHE_ENTRY = 0x000004;
const SPARSE_CACHE_ENTRY = 0x010000;
const OCX_CACHE_ENTRY = 0x020000;
const COOKIE_CACHE_ENTRY = 0x100000;
const URLHISTORY_CACHE_ENTRY = 0x200000;
const CACHE_ENTRY_ATTRIBUTE_FC = 0x0004;
const CACHE_ENTRY_HITRATE_FC = 0x0010;
const CACHE_ENTRY_MODTIME_FC = 0x0040;
const CACHE_ENTRY_EXPTIME_FC = 0x0080;
const CACHE_ENTRY_ACCTIME_FC = 0x0100;
const CACHE_ENTRY_SYNCTIME_FC = 0x0200;
const CACHE_ENTRY_HEADERINFO_FC = 0x0400;
enum {
WININET_API_FLAG_ASYNC = 1,
WININET_API_FLAG_SYNC = 4,
WININET_API_FLAG_USE_CONTEXT = 8
}
// FIXME: how should these really be grouped?
enum {
IRF_ASYNC = WININET_API_FLAG_ASYNC,
IRF_SYNC = WININET_API_FLAG_SYNC,
IRF_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT,
}
const IRF_NO_WAIT = 8;
enum {
HSR_ASYNC = WININET_API_FLAG_ASYNC,
HSR_SYNC = WININET_API_FLAG_SYNC,
HSR_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT,
}
const HSR_INITIATE = 8;
const HSR_DOWNLOAD = 16;
const HSR_CHUNKED = 32;
const INTERNET_DIAL_UNATTENDED = 0x8000;
const INTERNET_DIALSTATE_DISCONNECTED = 1;
const INTERENT_GOONLINE_REFRESH = 1;
const INTERENT_GOONLINE_MASK = 1;
const INTERNET_AUTODIAL_FORCE_ONLINE = 1;
const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2;
const INTERNET_AUTODIAL_FAILIFSECURITYCHECK = 4;
const INTERNET_CONNECTION_MODEM = 0x01;
const INTERNET_CONNECTION_LAN = 0x02;
const INTERNET_CONNECTION_PROXY = 0x04;
const INTERNET_CONNECTION_MODEM_BUSY = 0x08;
const INTERNET_RAS_INSTALLED = 0x10;
const INTERNET_CONNECTION_OFFLINE = 0x20;
const INTERNET_CONNECTION_CONFIGURED = 0x40;
enum {
CACHEGROUP_SEARCH_ALL = 0,
CACHEGROUP_SEARCH_BYURL = 1
}
enum {
INTERNET_CACHE_GROUP_ADD = 0,
INTERNET_CACHE_GROUP_REMOVE = 1
}
mixin DECLARE_HANDLE!("HINTERNET"); // doesn't work - bug
/*struct HINTERNET {
HANDLE h;
alias h this;
}*/
alias HINTERNET* LPHINTERNET;
alias LONGLONG GROUPID;
alias WORD INTERNET_PORT;
alias WORD* LPINTERNET_PORT;
enum INTERNET_SCHEME {
INTERNET_SCHEME_PARTIAL = -2,
INTERNET_SCHEME_UNKNOWN,
INTERNET_SCHEME_DEFAULT,
INTERNET_SCHEME_FTP,
INTERNET_SCHEME_GOPHER,
INTERNET_SCHEME_HTTP,
INTERNET_SCHEME_HTTPS,
INTERNET_SCHEME_FILE,
INTERNET_SCHEME_NEWS,
INTERNET_SCHEME_MAILTO,
INTERNET_SCHEME_SOCKS,
INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP,
INTERNET_SCHEME_LAST = INTERNET_SCHEME_SOCKS
}
alias INTERNET_SCHEME* LPINTERNET_SCHEME;
struct INTERNET_ASYNC_RESULT {
DWORD dwResult;
DWORD dwError;
}
alias INTERNET_ASYNC_RESULT* LPINTERNET_ASYNC_RESULT;
struct INTERNET_PREFETCH_STATUS {
DWORD dwStatus;
DWORD dwSize;
}
alias INTERNET_PREFETCH_STATUS* LPINTERNET_PREFETCH_STATUS;
struct INTERNET_PROXY_INFO {
DWORD dwAccessType;
LPCTSTR lpszProxy;
LPCTSTR lpszProxyBypass;
}
alias INTERNET_PROXY_INFO* LPINTERNET_PROXY_INFO;
struct INTERNET_VERSION_INFO {
DWORD dwMajorVersion;
DWORD dwMinorVersion;
}
alias INTERNET_VERSION_INFO* LPINTERNET_VERSION_INFO;
struct URL_COMPONENTSA {
DWORD dwStructSize = URL_COMPONENTSA.sizeof;
LPSTR lpszScheme;
DWORD dwSchemeLength;
INTERNET_SCHEME nScheme;
LPSTR lpszHostName;
DWORD dwHostNameLength;
INTERNET_PORT nPort;
LPSTR lpszUserName;
DWORD dwUserNameLength;
LPSTR lpszPassword;
DWORD dwPasswordLength;
LPSTR lpszUrlPath;
DWORD dwUrlPathLength;
LPSTR lpszExtraInfo;
DWORD dwExtraInfoLength;
}
alias URL_COMPONENTSA* LPURL_COMPONENTSA;
struct URL_COMPONENTSW {
DWORD dwStructSize = URL_COMPONENTSW.sizeof;
LPWSTR lpszScheme;
DWORD dwSchemeLength;
INTERNET_SCHEME nScheme;
LPWSTR lpszHostName;
DWORD dwHostNameLength;
INTERNET_PORT nPort;
LPWSTR lpszUserName;
DWORD dwUserNameLength;
LPWSTR lpszPassword;
DWORD dwPasswordLength;
LPWSTR lpszUrlPath;
DWORD dwUrlPathLength;
LPWSTR lpszExtraInfo;
DWORD dwExtraInfoLength;
}
alias URL_COMPONENTSW* LPURL_COMPONENTSW;
struct INTERNET_CERTIFICATE_INFO {
FILETIME ftExpiry;
FILETIME ftStart;
LPTSTR lpszSubjectInfo;
LPTSTR lpszIssuerInfo;
LPTSTR lpszProtocolName;
LPTSTR lpszSignatureAlgName;
LPTSTR lpszEncryptionAlgName;
DWORD dwKeySize;
}
alias INTERNET_CERTIFICATE_INFO* LPINTERNET_CERTIFICATE_INFO;
extern (Windows) alias void function(HINTERNET, DWORD, DWORD, PVOID, DWORD)
INTERNET_STATUS_CALLBACK;
alias INTERNET_STATUS_CALLBACK* LPINTERNET_STATUS_CALLBACK;
const INTERNET_INVALID_STATUS_CALLBACK
= cast(INTERNET_STATUS_CALLBACK) -1;
struct GOPHER_FIND_DATAA {
CHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString;
DWORD GopherType;
DWORD SizeLow;
DWORD SizeHigh;
FILETIME LastModificationTime;
CHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator;
}
alias GOPHER_FIND_DATAA* LPGOPHER_FIND_DATAA;
struct GOPHER_FIND_DATAW {
WCHAR[MAX_GOPHER_DISPLAY_TEXT+1] DisplayString;
DWORD GopherType;
DWORD SizeLow;
DWORD SizeHigh;
FILETIME LastModificationTime;
WCHAR[MAX_GOPHER_LOCATOR_LENGTH+1] Locator;
}
alias GOPHER_FIND_DATAW* LPGOPHER_FIND_DATAW;
struct GOPHER_ADMIN_ATTRIBUTE_TYPE {
LPCTSTR Comment;
LPCTSTR EmailAddress;
}
alias GOPHER_ADMIN_ATTRIBUTE_TYPE* LPGOPHER_ADMIN_ATTRIBUTE_TYPE;
struct GOPHER_MOD_DATE_ATTRIBUTE_TYPE {
FILETIME DateAndTime;
}
alias GOPHER_MOD_DATE_ATTRIBUTE_TYPE* LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE;
struct GOPHER_TTL_ATTRIBUTE_TYPE {
DWORD Ttl;
}
alias GOPHER_TTL_ATTRIBUTE_TYPE* LPGOPHER_TTL_ATTRIBUTE_TYPE;
struct GOPHER_SCORE_ATTRIBUTE_TYPE {
INT Score;
}
alias GOPHER_SCORE_ATTRIBUTE_TYPE* LPGOPHER_SCORE_ATTRIBUTE_TYPE;
struct GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE {
INT LowerBound;
INT UpperBound;
}
alias GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE* LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
struct GOPHER_SITE_ATTRIBUTE_TYPE {
LPCTSTR Site;
}
alias GOPHER_SITE_ATTRIBUTE_TYPE* LPGOPHER_SITE_ATTRIBUTE_TYPE;
struct GOPHER_ORGANIZATION_ATTRIBUTE_TYPE {
LPCTSTR Organization;
}
alias GOPHER_ORGANIZATION_ATTRIBUTE_TYPE* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE;
struct GOPHER_LOCATION_ATTRIBUTE_TYPE {
LPCTSTR Location;
}
alias GOPHER_LOCATION_ATTRIBUTE_TYPE* LPGOPHER_LOCATION_ATTRIBUTE_TYPE;
struct GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE {
INT DegreesNorth;
INT MinutesNorth;
INT SecondsNorth;
INT DegreesEast;
INT MinutesEast;
INT SecondsEast;
}
alias GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE*
LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
struct GOPHER_TIMEZONE_ATTRIBUTE_TYPE {
INT Zone;
}
alias GOPHER_TIMEZONE_ATTRIBUTE_TYPE* LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE;
struct GOPHER_PROVIDER_ATTRIBUTE_TYPE {
LPCTSTR Provider;
}
alias GOPHER_PROVIDER_ATTRIBUTE_TYPE* LPGOPHER_PROVIDER_ATTRIBUTE_TYPE;
struct GOPHER_VERSION_ATTRIBUTE_TYPE {
LPCTSTR Version;
}
alias GOPHER_VERSION_ATTRIBUTE_TYPE* LPGOPHER_VERSION_ATTRIBUTE_TYPE;
struct GOPHER_ABSTRACT_ATTRIBUTE_TYPE {
LPCTSTR ShortAbstract;
LPCTSTR AbstractFile;
}
alias GOPHER_ABSTRACT_ATTRIBUTE_TYPE* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE;
struct GOPHER_VIEW_ATTRIBUTE_TYPE {
LPCTSTR ContentType;
LPCTSTR Language;
DWORD Size;
}
alias GOPHER_VIEW_ATTRIBUTE_TYPE* LPGOPHER_VIEW_ATTRIBUTE_TYPE;
struct GOPHER_VERONICA_ATTRIBUTE_TYPE {
BOOL TreeWalk;
}
alias GOPHER_VERONICA_ATTRIBUTE_TYPE* LPGOPHER_VERONICA_ATTRIBUTE_TYPE;
struct GOPHER_ASK_ATTRIBUTE_TYPE {
LPCTSTR QuestionType;
LPCTSTR QuestionText;
}
alias GOPHER_ASK_ATTRIBUTE_TYPE* LPGOPHER_ASK_ATTRIBUTE_TYPE;
struct GOPHER_UNKNOWN_ATTRIBUTE_TYPE {
LPCTSTR Text;
}
alias GOPHER_UNKNOWN_ATTRIBUTE_TYPE* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE;
struct GOPHER_ATTRIBUTE_TYPE {
DWORD CategoryId;
DWORD AttributeId;
union {
GOPHER_ADMIN_ATTRIBUTE_TYPE Admin;
GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate;
GOPHER_TTL_ATTRIBUTE_TYPE Ttl;
GOPHER_SCORE_ATTRIBUTE_TYPE Score;
GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange;
GOPHER_SITE_ATTRIBUTE_TYPE Site;
GOPHER_ORGANIZATION_ATTRIBUTE_TYPE Organization;
GOPHER_LOCATION_ATTRIBUTE_TYPE Location;
GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation;
GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone;
GOPHER_PROVIDER_ATTRIBUTE_TYPE Provider;
GOPHER_VERSION_ATTRIBUTE_TYPE Version;
GOPHER_ABSTRACT_ATTRIBUTE_TYPE Abstract;
GOPHER_VIEW_ATTRIBUTE_TYPE View;
GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica;
GOPHER_ASK_ATTRIBUTE_TYPE Ask;
GOPHER_UNKNOWN_ATTRIBUTE_TYPE Unknown;
} /+AttributeType;+/
}
alias GOPHER_ATTRIBUTE_TYPE* LPGOPHER_ATTRIBUTE_TYPE;
alias BOOL function(LPGOPHER_ATTRIBUTE_TYPE, DWORD)
GOPHER_ATTRIBUTE_ENUMERATOR;
struct INTERNET_CACHE_ENTRY_INFOA {
DWORD dwStructSize = INTERNET_CACHE_ENTRY_INFOA.sizeof;
LPSTR lpszSourceUrlName;
LPSTR lpszLocalFileName;
DWORD CacheEntryType;
DWORD dwUseCount;
DWORD dwHitRate;
DWORD dwSizeLow;
DWORD dwSizeHigh;
FILETIME LastModifiedTime;
FILETIME ExpireTime;
FILETIME LastAccessTime;
FILETIME LastSyncTime;
PBYTE lpHeaderInfo;
DWORD dwHeaderInfoSize;
LPSTR lpszFileExtension;
DWORD dwReserved;
}
alias INTERNET_CACHE_ENTRY_INFOA* LPINTERNET_CACHE_ENTRY_INFOA;
struct INTERNET_CACHE_ENTRY_INFOW {
DWORD dwStructSize = INTERNET_CACHE_ENTRY_INFOW.sizeof;
LPWSTR lpszSourceUrlName;
LPWSTR lpszLocalFileName;
DWORD CacheEntryType;
DWORD dwUseCount;
DWORD dwHitRate;
DWORD dwSizeLow;
DWORD dwSizeHigh;
FILETIME LastModifiedTime;
FILETIME ExpireTime;
FILETIME LastAccessTime;
FILETIME LastSyncTime;
PBYTE lpHeaderInfo;
DWORD dwHeaderInfoSize;
LPWSTR lpszFileExtension;
DWORD dwReserved;
}
alias INTERNET_CACHE_ENTRY_INFOW* LPINTERNET_CACHE_ENTRY_INFOW;
struct INTERNET_BUFFERSA {
DWORD dwStructSize = INTERNET_BUFFERSA.sizeof;
INTERNET_BUFFERSA* Next;
LPCSTR lpcszHeader;
DWORD dwHeadersLength;
DWORD dwHeadersTotal;
LPVOID lpvBuffer;
DWORD dwBufferLength;
DWORD dwBufferTotal;
DWORD dwOffsetLow;
DWORD dwOffsetHigh;
}
alias INTERNET_BUFFERSA* LPINTERNET_BUFFERSA;
struct INTERNET_BUFFERSW {
DWORD dwStructSize = INTERNET_BUFFERSW.sizeof;
INTERNET_BUFFERSW* Next;
LPCWSTR lpcszHeader;
DWORD dwHeadersLength;
DWORD dwHeadersTotal;
LPVOID lpvBuffer;
DWORD dwBufferLength;
DWORD dwBufferTotal;
DWORD dwOffsetLow;
DWORD dwOffsetHigh;
}
alias INTERNET_BUFFERSW* LPINTERNET_BUFFERSW;
const size_t
GROUP_OWNER_STORAGE_SIZE = 4,
GROUPNAME_MAX_LENGTH = 120;
struct INTERNET_CACHE_GROUP_INFOA {
DWORD dwGroupSize;
DWORD dwGroupFlags;
DWORD dwGroupType;
DWORD dwDiskUsage;
DWORD dwDiskQuota;
DWORD[GROUP_OWNER_STORAGE_SIZE] dwOwnerStorage;
CHAR[GROUPNAME_MAX_LENGTH] szGroupName;
}
alias INTERNET_CACHE_GROUP_INFOA* LPINTERNET_CACHE_GROUP_INFOA;
struct INTERNET_CACHE_GROUP_INFOW {
DWORD dwGroupSize;
DWORD dwGroupFlags;
DWORD dwGroupType;
DWORD dwDiskUsage;
DWORD dwDiskQuota;
DWORD[GROUP_OWNER_STORAGE_SIZE] dwOwnerStorage;
WCHAR[GROUPNAME_MAX_LENGTH] szGroupName;
}
alias INTERNET_CACHE_GROUP_INFOW* LPINTERNET_CACHE_GROUP_INFOW;
extern (Windows) {
BOOL InternetTimeFromSystemTime(SYSTEMTIME*, DWORD, LPSTR, DWORD);
BOOL InternetTimeToSystemTime(LPCSTR, SYSTEMTIME*, DWORD);
BOOL InternetDebugGetLocalTime(SYSTEMTIME*, PDWORD);
BOOL InternetCrackUrlA(LPCSTR, DWORD, DWORD, LPURL_COMPONENTSA);
BOOL InternetCrackUrlW(LPCWSTR, DWORD, DWORD, LPURL_COMPONENTSW);
BOOL InternetCreateUrlA(LPURL_COMPONENTSA, DWORD, LPSTR, PDWORD);
BOOL InternetCreateUrlW(LPURL_COMPONENTSW, DWORD, LPWSTR, PDWORD);
BOOL InternetCanonicalizeUrlA(LPCSTR, LPSTR, PDWORD, DWORD);
BOOL InternetCanonicalizeUrlW(LPCWSTR, LPWSTR, PDWORD, DWORD);
BOOL InternetCheckConnectionA(LPCSTR, DWORD, DWORD);
BOOL InternetCheckConnectionW(LPCWSTR, DWORD, DWORD);
BOOL InternetCombineUrlA(LPCSTR, LPCSTR, LPSTR, PDWORD, DWORD);
BOOL InternetCombineUrlW(LPCWSTR, LPCWSTR, LPWSTR, PDWORD, DWORD);
HINTERNET InternetOpenA(LPCSTR, DWORD, LPCSTR, LPCSTR, DWORD);
HINTERNET InternetOpenW(LPCWSTR, DWORD, LPCWSTR, LPCWSTR, DWORD);
BOOL InternetCloseHandle(HINTERNET);
HINTERNET InternetConnectA(HINTERNET, LPCSTR, INTERNET_PORT, LPCSTR,
LPCSTR, DWORD, DWORD, DWORD);
HINTERNET InternetConnectW(HINTERNET, LPCWSTR, INTERNET_PORT, LPCWSTR,
LPCWSTR, DWORD, DWORD, DWORD);
HINTERNET InternetOpenUrlA(HINTERNET, LPCSTR, LPCSTR, DWORD, DWORD,
DWORD);
HINTERNET InternetOpenUrlW(HINTERNET, LPCWSTR, LPCWSTR, DWORD, DWORD,
DWORD);
BOOL InternetReadFile(HINTERNET, PVOID, DWORD, PDWORD);
DWORD InternetSetFilePointer(HINTERNET, LONG, PVOID, DWORD, DWORD);
BOOL InternetWriteFile(HINTERNET, LPCVOID, DWORD, PDWORD);
BOOL InternetQueryDataAvailable(HINTERNET, PDWORD, DWORD, DWORD);
BOOL InternetFindNextFileA(HINTERNET, PVOID);
BOOL InternetFindNextFileW(HINTERNET, PVOID);
BOOL InternetQueryOptionA(HINTERNET, DWORD, PVOID, PDWORD);
BOOL InternetQueryOptionW(HINTERNET, DWORD, PVOID, PDWORD);
BOOL InternetSetOptionA(HINTERNET, DWORD, PVOID, DWORD);
BOOL InternetSetOptionW(HINTERNET, DWORD, PVOID, DWORD);
BOOL InternetSetOptionExA(HINTERNET, DWORD, PVOID, DWORD, DWORD);
BOOL InternetSetOptionExW(HINTERNET, DWORD, PVOID, DWORD, DWORD);
BOOL InternetGetLastResponseInfoA(PDWORD, LPSTR, PDWORD);
BOOL InternetGetLastResponseInfoW(PDWORD, LPWSTR, PDWORD);
INTERNET_STATUS_CALLBACK InternetSetStatusCallback(HINTERNET,
INTERNET_STATUS_CALLBACK);
DWORD FtpGetFileSize(HINTERNET, LPDWORD);
HINTERNET FtpFindFirstFileA(HINTERNET, LPCSTR, LPWIN32_FIND_DATA, DWORD,
DWORD);
HINTERNET FtpFindFirstFileW(HINTERNET, LPCWSTR, LPWIN32_FIND_DATA, DWORD,
DWORD);
BOOL FtpGetFileA(HINTERNET, LPCSTR, LPCSTR, BOOL, DWORD, DWORD, DWORD);
BOOL FtpGetFileW(HINTERNET, LPCWSTR, LPCWSTR, BOOL, DWORD, DWORD, DWORD);
BOOL FtpPutFileA(HINTERNET, LPCSTR, LPCSTR, DWORD, DWORD);
BOOL FtpPutFileW(HINTERNET, LPCWSTR, LPCWSTR, DWORD, DWORD);
BOOL FtpDeleteFileA(HINTERNET, LPCSTR);
BOOL FtpDeleteFileW(HINTERNET, LPCWSTR);
BOOL FtpRenameFileA(HINTERNET, LPCSTR, LPCSTR);
BOOL FtpRenameFileW(HINTERNET, LPCWSTR, LPCWSTR);
HINTERNET FtpOpenFileA(HINTERNET, LPCSTR, DWORD, DWORD, DWORD);
HINTERNET FtpOpenFileW(HINTERNET, LPCWSTR, DWORD, DWORD, DWORD);
BOOL FtpCreateDirectoryA(HINTERNET, LPCSTR);
BOOL FtpCreateDirectoryW(HINTERNET, LPCWSTR);
BOOL FtpRemoveDirectoryA(HINTERNET, LPCSTR);
BOOL FtpRemoveDirectoryW(HINTERNET, LPCWSTR);
BOOL FtpSetCurrentDirectoryA(HINTERNET, LPCSTR);
BOOL FtpSetCurrentDirectoryW(HINTERNET, LPCWSTR);
BOOL FtpGetCurrentDirectoryA(HINTERNET, LPSTR, PDWORD);
BOOL FtpGetCurrentDirectoryW(HINTERNET, LPWSTR, PDWORD);
BOOL FtpCommandA(HINTERNET, BOOL, DWORD, LPCSTR, DWORD_PTR, HINTERNET*);
BOOL FtpCommandW(HINTERNET, BOOL, DWORD, LPCWSTR, DWORD_PTR, HINTERNET*);
BOOL GopherCreateLocatorA(LPCSTR, INTERNET_PORT, LPCSTR, LPCSTR, DWORD,
LPSTR, PDWORD);
BOOL GopherCreateLocatorW(LPCWSTR, INTERNET_PORT, LPCWSTR, LPCWSTR, DWORD,
LPWSTR, PDWORD);
BOOL GopherGetLocatorTypeA(LPCSTR, PDWORD);
BOOL GopherGetLocatorTypeW(LPCWSTR, PDWORD);
HINTERNET GopherFindFirstFileA(HINTERNET, LPCSTR, LPCSTR,
LPGOPHER_FIND_DATAA, DWORD, DWORD);
HINTERNET GopherFindFirstFileW(HINTERNET, LPCWSTR, LPCWSTR,
LPGOPHER_FIND_DATAW, DWORD, DWORD);
HINTERNET GopherOpenFileA(HINTERNET, LPCSTR, LPCSTR, DWORD, DWORD);
HINTERNET GopherOpenFileW(HINTERNET, LPCWSTR, LPCWSTR, DWORD, DWORD);
BOOL GopherGetAttributeA(HINTERNET, LPCSTR, LPCSTR, LPBYTE, DWORD,
PDWORD, GOPHER_ATTRIBUTE_ENUMERATOR, DWORD);
BOOL GopherGetAttributeW(HINTERNET, LPCWSTR, LPCWSTR, LPBYTE, DWORD,
PDWORD, GOPHER_ATTRIBUTE_ENUMERATOR, DWORD);
HINTERNET HttpOpenRequestA(HINTERNET, LPCSTR, LPCSTR, LPCSTR, LPCSTR,
LPCSTR*, DWORD, DWORD);
HINTERNET HttpOpenRequestW(HINTERNET, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR,
LPCWSTR*, DWORD, DWORD);
BOOL HttpAddRequestHeadersA(HINTERNET, LPCSTR, DWORD, DWORD);
BOOL HttpAddRequestHeadersW(HINTERNET, LPCWSTR, DWORD, DWORD);
BOOL HttpSendRequestA(HINTERNET, LPCSTR, DWORD, PVOID, DWORD);
BOOL HttpSendRequestW(HINTERNET, LPCWSTR, DWORD, PVOID, DWORD);
BOOL HttpQueryInfoA(HINTERNET, DWORD, PVOID, PDWORD, PDWORD);
BOOL HttpQueryInfoW(HINTERNET, DWORD, PVOID, PDWORD, PDWORD);
BOOL InternetSetCookieA(LPCSTR, LPCSTR, LPCSTR);
BOOL InternetSetCookieW(LPCWSTR, LPCWSTR, LPCWSTR);
BOOL InternetGetCookieA(LPCSTR, LPCSTR, LPSTR, PDWORD);
BOOL InternetGetCookieW(LPCWSTR, LPCWSTR, LPWSTR, PDWORD);
DWORD InternetAttemptConnect(DWORD);
DWORD InternetErrorDlg(HWND, HINTERNET, DWORD, DWORD, PVOID*);
DWORD InternetConfirmZoneCrossing(HWND, LPSTR, LPSTR, BOOL);
BOOL CreateUrlCacheEntryA(LPCSTR, DWORD, LPCSTR, LPSTR, DWORD);
BOOL CreateUrlCacheEntryW(LPCWSTR, DWORD, LPCWSTR, LPWSTR, DWORD);
BOOL CommitUrlCacheEntryA(LPCSTR, LPCSTR, FILETIME, FILETIME, DWORD,
LPBYTE, DWORD, LPCSTR, DWORD);
BOOL CommitUrlCacheEntryW(LPCWSTR, LPCWSTR, FILETIME, FILETIME, DWORD,
LPBYTE, DWORD, LPCWSTR, DWORD);
BOOL RetrieveUrlCacheEntryFileA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA,
PDWORD, DWORD);
BOOL RetrieveUrlCacheEntryFileW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW,
PDWORD, DWORD);
BOOL UnlockUrlCacheEntryFile(LPCSTR, DWORD);
HANDLE RetrieveUrlCacheEntryStreamA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA,
PDWORD, BOOL, DWORD);
HANDLE RetrieveUrlCacheEntryStreamW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW,
PDWORD, BOOL, DWORD);
BOOL ReadUrlCacheEntryStream(HANDLE, DWORD, PVOID, PDWORD, DWORD);
BOOL UnlockUrlCacheEntryStream(HANDLE, DWORD);
BOOL GetUrlCacheEntryInfoA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA, PDWORD);
BOOL GetUrlCacheEntryInfoW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW, PDWORD);
BOOL SetUrlCacheEntryInfoA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA, DWORD);
BOOL SetUrlCacheEntryInfoW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW, DWORD);
HANDLE FindFirstUrlCacheEntryA(LPCSTR, LPINTERNET_CACHE_ENTRY_INFOA,
PDWORD);
HANDLE FindFirstUrlCacheEntryW(LPCWSTR, LPINTERNET_CACHE_ENTRY_INFOW,
PDWORD);
BOOL FindNextUrlCacheEntryA(HANDLE, LPINTERNET_CACHE_ENTRY_INFOA, PDWORD);
BOOL FindNextUrlCacheEntryW(HANDLE, LPINTERNET_CACHE_ENTRY_INFOW, PDWORD);
BOOL FindCloseUrlCache(HANDLE);
BOOL DeleteUrlCacheEntry(LPCSTR);
DWORD AuthenticateUser(PVOID*, LPSTR, LPSTR, DWORD, LPSTR, DWORD, LPSTR,
LPSTR);
BOOL HttpSendRequestExA(HINTERNET, LPINTERNET_BUFFERSA,
LPINTERNET_BUFFERSA, DWORD, DWORD);
BOOL HttpSendRequestExW(HINTERNET, LPINTERNET_BUFFERSW,
LPINTERNET_BUFFERSW, DWORD, DWORD);
BOOL HttpEndRequestA(HINTERNET, LPINTERNET_BUFFERSA, DWORD, DWORD);
BOOL HttpEndRequestW(HINTERNET, LPINTERNET_BUFFERSW, DWORD, DWORD);
DWORD InternetDial(HWND, LPTSTR, DWORD, LPDWORD, DWORD);
DWORD InternetHangUp(DWORD, DWORD);
BOOL InternetGoOnline(LPTSTR, HWND, DWORD);
BOOL InternetAutodial(DWORD, DWORD);
BOOL InternetAutodialHangup(DWORD);
BOOL InternetGetConnectedState(LPDWORD, DWORD);
BOOL InternetSetDialState(LPCTSTR, DWORD, DWORD);
BOOL InternetReadFileExA(HINTERNET, LPINTERNET_BUFFERSA, DWORD, DWORD_PTR);
BOOL InternetReadFileExW(HINTERNET, LPINTERNET_BUFFERSW, DWORD, DWORD_PTR);
GROUPID CreateUrlCacheGroup(DWORD, LPVOID);
BOOL DeleteUrlCacheGroup(GROUPID, DWORD, LPVOID);
HANDLE FindFirstUrlCacheGroup(DWORD, DWORD, LPVOID, DWORD, GROUPID*,
LPVOID);
BOOL FindNextUrlCacheGroup(HANDLE, GROUPID*, LPVOID);
BOOL GetUrlCacheGroupAttributeA(GROUPID, DWORD, DWORD,
LPINTERNET_CACHE_GROUP_INFOA, LPDWORD, LPVOID);
BOOL GetUrlCacheGroupAttributeW(GROUPID, DWORD, DWORD,
LPINTERNET_CACHE_GROUP_INFOW, LPDWORD, LPVOID);
BOOL SetUrlCacheGroupAttributeA(GROUPID, DWORD, DWORD,
LPINTERNET_CACHE_GROUP_INFOA, LPVOID);
BOOL SetUrlCacheGroupAttributeW(GROUPID, DWORD, DWORD,
LPINTERNET_CACHE_GROUP_INFOW, LPVOID);
}
version (Unicode) {
alias URL_COMPONENTSW URL_COMPONENTS;
alias LPURL_COMPONENTSW LPURL_COMPONENTS;
alias GOPHER_FIND_DATAW GOPHER_FIND_DATA;
alias LPGOPHER_FIND_DATAW LPGOPHER_FIND_DATA;
alias INTERNET_CACHE_ENTRY_INFOW INTERNET_CACHE_ENTRY_INFO;
alias LPINTERNET_CACHE_ENTRY_INFOW LPINTERNET_CACHE_ENTRY_INFO;
alias INTERNET_BUFFERSW INTERNET_BUFFERS;
alias INTERNET_CACHE_GROUP_INFOW INTERNET_CACHE_GROUP_INFO;
alias LPINTERNET_CACHE_GROUP_INFOW LPINTERNET_CACHE_GROUP_INFO;
alias InternetCrackUrlW InternetCrackUrl;
alias InternetCreateUrlW InternetCreateUrl;
alias InternetCanonicalizeUrlW InternetCanonicalizeUrl;
alias InternetCheckConnectionW InternetCheckConnection;
alias InternetCombineUrlW InternetCombineUrl;
alias InternetOpenW InternetOpen;
alias InternetConnectW InternetConnect;
alias InternetOpenUrlW InternetOpenUrl;
alias InternetFindNextFileW InternetFindNextFile;
alias InternetQueryOptionW InternetQueryOption;
alias InternetSetOptionW InternetSetOption;
alias InternetSetOptionExW InternetSetOptionEx;
alias InternetGetLastResponseInfoW InternetGetLastResponseInfo;
alias InternetReadFileExW InternetReadFileEx;
alias FtpFindFirstFileW FtpFindFirstFile;
alias FtpGetFileW FtpGetFile;
alias FtpPutFileW FtpPutFile;
alias FtpDeleteFileW FtpDeleteFile;
alias FtpRenameFileW FtpRenameFile;
alias FtpOpenFileW FtpOpenFile;
alias FtpCreateDirectoryW FtpCreateDirectory;
alias FtpRemoveDirectoryW FtpRemoveDirectory;
alias FtpSetCurrentDirectoryW FtpSetCurrentDirectory;
alias FtpGetCurrentDirectoryW FtpGetCurrentDirectory;
alias FtpCommandW FtpCommand;
alias GopherGetLocatorTypeW GopherGetLocatorType;
alias GopherCreateLocatorW GopherCreateLocator;
alias GopherFindFirstFileW GopherFindFirstFile;
alias GopherOpenFileW GopherOpenFile;
alias GopherGetAttributeW GopherGetAttribute;
alias HttpSendRequestW HttpSendRequest;
alias HttpOpenRequestW HttpOpenRequest;
alias HttpAddRequestHeadersW HttpAddRequestHeaders;
alias HttpQueryInfoW HttpQueryInfo;
alias InternetSetCookieW InternetSetCookie;
alias InternetGetCookieW InternetGetCookie;
alias CreateUrlCacheEntryW CreateUrlCacheEntry;
alias RetrieveUrlCacheEntryStreamW RetrieveUrlCacheEntryStream;
alias FindNextUrlCacheEntryW FindNextUrlCacheEntry;
alias CommitUrlCacheEntryW CommitUrlCacheEntry;
alias GetUrlCacheEntryInfoW GetUrlCacheEntryInfo;
alias SetUrlCacheEntryInfoW SetUrlCacheEntryInfo;
alias FindFirstUrlCacheEntryW FindFirstUrlCacheEntry;
alias RetrieveUrlCacheEntryFileW RetrieveUrlCacheEntryFile;
alias HttpSendRequestExW HttpSendRequestEx;
alias HttpEndRequestW HttpEndRequest;
alias GetUrlCacheGroupAttributeW GetUrlCacheGroupAttribute;
alias SetUrlCacheGroupAttributeW SetUrlCacheGroupAttribute;
} else {
alias URL_COMPONENTSA URL_COMPONENTS;
alias LPURL_COMPONENTSA LPURL_COMPONENTS;
alias GOPHER_FIND_DATAA GOPHER_FIND_DATA;
alias LPGOPHER_FIND_DATAA LPGOPHER_FIND_DATA;
alias INTERNET_CACHE_ENTRY_INFOA INTERNET_CACHE_ENTRY_INFO;
alias LPINTERNET_CACHE_ENTRY_INFOA LPINTERNET_CACHE_ENTRY_INFO;
alias INTERNET_BUFFERSA INTERNET_BUFFERS;
alias INTERNET_CACHE_GROUP_INFOA INTERNET_CACHE_GROUP_INFO;
alias LPINTERNET_CACHE_GROUP_INFOA LPINTERNET_CACHE_GROUP_INFO;
alias GopherGetAttributeA GopherGetAttribute;
alias InternetCrackUrlA InternetCrackUrl;
alias InternetCreateUrlA InternetCreateUrl;
alias InternetCanonicalizeUrlA InternetCanonicalizeUrl;
alias InternetCheckConnectionA InternetCheckConnection;
alias InternetCombineUrlA InternetCombineUrl;
alias InternetOpenA InternetOpen;
alias InternetConnectA InternetConnect;
alias InternetOpenUrlA InternetOpenUrl;
alias InternetFindNextFileA InternetFindNextFile;
alias InternetQueryOptionA InternetQueryOption;
alias InternetSetOptionA InternetSetOption;
alias InternetSetOptionExA InternetSetOptionEx;
alias InternetGetLastResponseInfoA InternetGetLastResponseInfo;
alias InternetReadFileExA InternetReadFileEx;
alias FtpFindFirstFileA FtpFindFirstFile;
alias FtpGetFileA FtpGetFile;
alias FtpPutFileA FtpPutFile;
alias FtpDeleteFileA FtpDeleteFile;
alias FtpRenameFileA FtpRenameFile;
alias FtpOpenFileA FtpOpenFile;
alias FtpCreateDirectoryA FtpCreateDirectory;
alias FtpRemoveDirectoryA FtpRemoveDirectory;
alias FtpSetCurrentDirectoryA FtpSetCurrentDirectory;
alias FtpGetCurrentDirectoryA FtpGetCurrentDirectory;
alias FtpCommandA FtpCommand;
alias GopherGetLocatorTypeA GopherGetLocatorType;
alias GopherCreateLocatorA GopherCreateLocator;
alias GopherFindFirstFileA GopherFindFirstFile;
alias GopherOpenFileA GopherOpenFile;
alias HttpSendRequestA HttpSendRequest;
alias HttpOpenRequestA HttpOpenRequest;
alias HttpAddRequestHeadersA HttpAddRequestHeaders;
alias HttpQueryInfoA HttpQueryInfo;
alias InternetSetCookieA InternetSetCookie;
alias InternetGetCookieA InternetGetCookie;
alias CreateUrlCacheEntryA CreateUrlCacheEntry;
alias RetrieveUrlCacheEntryStreamA RetrieveUrlCacheEntryStream;
alias FindNextUrlCacheEntryA FindNextUrlCacheEntry;
alias CommitUrlCacheEntryA CommitUrlCacheEntry;
alias GetUrlCacheEntryInfoA GetUrlCacheEntryInfo;
alias SetUrlCacheEntryInfoA SetUrlCacheEntryInfo;
alias FindFirstUrlCacheEntryA FindFirstUrlCacheEntry;
alias RetrieveUrlCacheEntryFileA RetrieveUrlCacheEntryFile;
alias HttpSendRequestExA HttpSendRequestEx;
alias HttpEndRequestA HttpEndRequest;
alias GetUrlCacheGroupAttributeA GetUrlCacheGroupAttribute;
alias SetUrlCacheGroupAttributeA SetUrlCacheGroupAttribute;
}
alias INTERNET_BUFFERS* LPINTERNET_BUFFERS;
| D |
/Users/smartex/Desktop/SMVideoCall/derived_data/Build/Intermediates.noindex/SMVideoCall.build/Debug-iphonesimulator/SMVideoCall.build/Objects-normal/x86_64/VideoCallViewController.o : /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallResultDelegate.swift /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallViewController.swift /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/dyld.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/objc/ObjectiveC.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/Darwin.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/smartex/Desktop/SMVideoCall/derived_data/Build/Intermediates.noindex/SMVideoCall.build/Debug-iphonesimulator/SMVideoCall.build/Objects-normal/x86_64/VideoCallViewController~partial.swiftmodule : /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallResultDelegate.swift /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallViewController.swift /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/dyld.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/objc/ObjectiveC.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/Darwin.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/smartex/Desktop/SMVideoCall/derived_data/Build/Intermediates.noindex/SMVideoCall.build/Debug-iphonesimulator/SMVideoCall.build/Objects-normal/x86_64/VideoCallViewController~partial.swiftdoc : /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallResultDelegate.swift /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallViewController.swift /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/dyld.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/objc/ObjectiveC.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/Darwin.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/smartex/Desktop/SMVideoCall/derived_data/Build/Intermediates.noindex/SMVideoCall.build/Debug-iphonesimulator/SMVideoCall.build/Objects-normal/x86_64/VideoCallViewController~partial.swiftsourceinfo : /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallResultDelegate.swift /Users/smartex/Desktop/SMVideoCall/SMVideoCall/VideoCallViewController.swift /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/WebKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/14.5/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/dyld.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/objc/ObjectiveC.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/Darwin.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/smartex/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
// Written in the D programming language
// License: http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0
import std.algorithm, std.range, std.array, std.conv;
import options, dexpr, expression, dutil;
struct Cond{
DExpr cond;
string error;
}
DExpr extractConditions(Cond[] conds){
DExpr r=one;
foreach(x;conds) r=r*x.cond;
return r;
}
enum distribNames=[__traits(allMembers,distrib)].filter!(x=>x.endsWith("PDF")).map!(x=>x[0..$-"PDF".length]).array;
import std.traits: ParameterIdentifierTuple;
enum paramNames(string name)=[ParameterIdentifierTuple!(mixin(name~"PDF"))[1..$]];
DExpr pdf(string name)(DVar var,DExpr[] args)in{assert(args.length==paramNames!name.length);}body{
return mixin(text(name,"PDF(var,",iota(paramNames!name.length).map!(i=>text("args[",i,"]")).join(","),")"));
}
Cond[] cond(string name)(DExpr[] args)in{assert(args.length==paramNames!name.length);}body{
return mixin(text(name,"Cond(",iota(paramNames!name.length).map!(i=>text("args[",i,"]")).join(","),")"));
}
DExpr gaussPDF(DVar var,DExpr μ,DExpr ν){
auto dist=one/(2*dΠ*ν)^^(one/2)*dE^^-((var-μ)^^2/(2*ν));
return dNeqZ(ν)*dist+dEqZ(ν)*dDelta(var-μ);
}
Cond[] gaussCond(DExpr μ,DExpr ν){
return [Cond(dGeZ(ν),"negative variance")];
}
DExpr chiSquaredPDF(DVar var,DExpr k){
return dNeqZ(k)*dGeZ(var)/(2^^(k/2)*dGamma(k/2))*var^^(k/2-1)*dE^^(-var/2)+
dEqZ(k)*dDelta(var);
}
Cond[] chiSquaredCond(DExpr k){
return [Cond(dIsℤ(k),"k must be an integer"),
Cond(dGeZ(k),"k must be non-negative")];
}
DExpr rayleighPDF(DVar var,DExpr ν){
auto dist=var/(ν)*dE^^-((var)^^2/(2*ν)) * dGeZ(var);
return dNeqZ(ν)*dist+dEqZ(ν)*dDelta(var);
}
Cond[] rayleighCond(DExpr ν){
return [Cond(dGeZ(ν),"negative scale")];
}
DExpr truncatedGaussPDF(DVar var,DExpr μ,DExpr ν,DExpr a,DExpr b){
auto gdist=one/(2*dΠ)^^(one/2)*dE^^-((var-μ)^^2/(2*ν));
auto dist = gdist/(ν)/(dGaussInt((b-μ)/ν^^(one/2))-dGaussInt((a-μ)/(ν)^^(one/2)));
return (dNeqZ(ν)*dist+dEqZ(ν)*dDelta(var-μ))*dBounded!"[]"(var,a,b);
}
Cond[] truncatedGaussCond(DExpr μ,DExpr ν,DExpr a,DExpr b){
return [Cond(dGeZ(ν),"negative variance"),
Cond(dLt(a,b),"empty range")];
}
DExpr paretoPDF(DVar var, DExpr a, DExpr b) {
auto dist = a * b^^a / var^^(a+one);
return dist * dLe(b,var);
}
Cond[] paretoCond(DExpr a, DExpr b){
return [Cond(dGeZ(a),"negative scale"),
Cond(dGeZ(b),"negative shape")];
}
DExpr uniformPDF(DVar var,DExpr a,DExpr b){
auto diff=b-a, dist=dBounded!"[]"(var,a,b)/diff;
return dNeqZ(diff)*dist+dEqZ(diff)*dDelta(var-a);
}
Cond[] uniformCond(DExpr a,DExpr b){
return [Cond(dLe(a,b),"empty range")];
}
DExpr flipPDF(DVar var,DExpr p){
return dDelta(var)*(1-p)+dDelta(1-var)*p;
}
Cond[] flipCond(DExpr p){
return [Cond(dBounded!"[]"(p,zero,one),"parameter ouside range [0..1]")];
}
DExpr uniformIntPDFNnorm(DVar var,DExpr a,DExpr b){
var=var.incDeBruijnVar(1,0);
a=a.incDeBruijnVar(1,0), b=b.incDeBruijnVar(1,0);
auto x=db1;
return dSumSmp(dBounded!"[]"(x,a,b)*dDelta(var-x),one);
}
DExpr uniformIntPDF(DVar var,DExpr a,DExpr b){
auto nnorm=uniformIntPDFNnorm(var,a,b);
return nnorm/dIntSmp(var,nnorm,one);
}
Cond[] uniformIntCond(DExpr a,DExpr b){
a=a.incDeBruijnVar(1,0), b=b.incDeBruijnVar(1,0);
auto x=db1; // TODO: get rid of this!
auto nnorm=uniformIntPDFNnorm(x,a,b);
auto norm=dIntSmp(nnorm,one);
return [Cond(dNeqZ(norm),"no integers in range")];
}
DExpr binomialPDF(DVar var,DExpr n,DExpr p){
n=n.incDeBruijnVar(1,0), p=p.incDeBruijnVar(1,0);
auto k=db1;
return dSumSmp(dNChooseK(n,k)*p^^k*(1-p)^^(n-k)*dDelta(k-var),one);
}
Cond[] binomialCond(DExpr n,DExpr p){
return [Cond(dIsℤ(n),"n must be an integer"),
Cond(dGeZ(n),"n must be non-negative"),
Cond(dBounded!"[]"(p,zero,one),"parameter p out of range [0..1]")];
}
DExpr negBinomialPDF(DVar var,DExpr r,DExpr p){
r=r.incDeBruijnVar(1,0), p=p.incDeBruijnVar(1,0);
auto k=db1;
return dSumSmp(dGeZ(k)*(dGamma(r+k)/(dGamma(r)*dGamma(k+1)))*p^^r*(1-p)^^k*dDelta(k-var),one);
}
Cond[] negBinomialCond(DExpr r,DExpr p){
return [Cond(dGtZ(r),"r must be positive"),
Cond(dBounded!"[]"(p,zero,one),"parameter ouside range [0..1]")];
}
DExpr geometricPDF(DVar var,DExpr p){
p=p.incDeBruijnVar(1,0);
auto i=db1;
return dSumSmp(dGeZ(i)*p*(1-p)^^i*dDelta(i-var),one);
}
Cond[] geometricCond(DExpr p){
return [Cond(dBounded!"[]"(p,zero,one),"parameter ouside range [0..1]")];
}
DExpr poissonPDF(DVar var,DExpr λ){
var=var.incDeBruijnVar(1,0), λ=λ.incDeBruijnVar(1,0);
auto x=db1;
return dE^^-λ*dSumSmp(dGeZ(x)*dDelta(var-x)*λ^^x/dGamma(x+1),one);
}
Cond[] poissonCond(DExpr λ){
return [Cond(dGeZ(λ),"λ must be non-negative")];
}
DExpr betaPDF(DVar var,DExpr α,DExpr β){
auto nnorm=dNeqZ(α)*dNeqZ(β)*
var^^(α-1)*(1-var)^^(β-1)*dBounded!"[]"(var,zero,one)+
dEqZ(α)*dDelta(var)+
dEqZ(β)*dDelta(1-var);
return nnorm/dIntSmp(var,nnorm,one);
}
Cond[] betaCond(DExpr α,DExpr β){
return [Cond(dGeZ(α),"α must be non-negative"),
Cond(dGeZ(β),"β must be non-negative")];
}
DExpr gammaPDF(DVar var,DExpr α,DExpr β){
auto nnorm=dNeqZ(α)*var^^(α-1)*dE^^(-β*var)*dGeZ(var)+dEqZ(α)*dDelta(var);
return nnorm/dIntSmp(var,nnorm,one);
}
Cond[] gammaCond(DExpr α,DExpr β){
return [Cond(dGeZ(α),"α must be non-negative"),
Cond(dGtZ(β),"β must be positive")];
}
DExpr laplacePDF(DVar var, DExpr μ, DExpr b){
return dNeqZ(b)*dE^^(-dAbs(var-μ)/b)/(2*b)+
dEqZ(b)*dDelta(μ-var);
}
Cond[] laplaceCond(DExpr μ,DExpr b){
return [Cond(dGeZ(b),"b must be non-negative")];
}
DExpr cauchyPDF(DVar var,DExpr x0,DExpr γ){
return dNeqZ(γ)/(dΠ*γ*(1+((var-x0)/γ)^^2))+
dEqZ(γ)*dDelta(x0-var);
}
Cond[] cauchyCond(DExpr x0,DExpr γ){
return [Cond(dGeZ(γ),"γ must be non-negative")];
}
DExpr exponentialPDF(DVar var,DExpr λ){
return λ*dE^^(-λ*var)*dGeZ(var);
}
Cond[] exponentialCond(DExpr λ){
return [Cond(dGtZ(λ),"λ must be positive")];
}
DExpr studentTPDF(DVar var,DExpr ν){ // this has a mean only if ν>1. how to treat this?
auto nnorm=(1+var^^2/ν)^^(-(ν+1)/2);
return dNeqZ(ν)*nnorm/dIntSmp(var,nnorm,one)+dEqZ(ν)*dDelta(var);
}
Cond[] studentTCond(DExpr ν){
return [Cond(dGeZ(ν),"ν must be non-negative")];
}
DExpr weibullPDF(DVar var,DExpr λ,DExpr k){
return dNeqZ(λ)*dNeqZ(k)*
dGeZ(var)*k/λ*(var/λ)^^(k-1)*dE^^(-(var/λ)^^k)+
dNeqZ(dEqZ(λ)+dEqZ(k))*dDelta(var);
}
Cond[] weibullCond(DExpr λ,DExpr k){
return [Cond(dGeZ(λ),"λ must be non-negative"),
Cond(dGeZ(k),"k must be non-negative")];
}
DExpr categoricalPDF(DVar var,DExpr p){
var=var.incDeBruijnVar(1,0), p=p.incDeBruijnVar(1,0);
auto dbv=db1;
auto nnorm=dSum(dBounded!"[)"(dbv,zero,dField(p,"length"))*p[dbv]*dDelta(var-dbv));
return nnorm;///dIntSmp(nnorm);
}
Cond[] categoricalCond(DExpr p){
p=p.incDeBruijnVar(1,0);
auto dbv=db1;
return [Cond(dEqZ(dSum(dBounded!"[)"(dbv,zero,dField(p,"length")*dLtZ(p[dbv])))),"probability of category should be non-negative"),
Cond(dEqZ(dSum(dBounded!"[)"(dbv,zero,dField(p,"length"))*p[dbv])-1),"probabilities should sum up to 1")];
}
DExpr diracPDF(DVar var,DExpr e){
import type;
return dDelta(e,var,varTy("a",typeTy));
}
Cond[] diracCond(DExpr e){
return [];
}
class Distribution{
int[string] vbl;
this(){ distribution=one; error=zero; vbl["__dummy"]=0; }
SetX!DNVar freeVars;
DExpr distribution;
DExpr error;
bool hasArgs=false;
DNVar[] args;
bool argsIsTuple=true;
DNVar context;
void addArgs(DNVar[] args,bool isTuple,DNVar ctx)in{
assert(!hasArgs);
assert(!context);
assert(isTuple||args.length==1);
foreach(v;args) assert(v in freeVars);
assert(!ctx||ctx in freeVars);
}body{
hasArgs=true;
this.args=args;
argsIsTuple=isTuple;
context=ctx;
foreach(v;args) freeVars.remove(v);
if(context) freeVars.remove(context);
}
void addArgs(size_t nargs,bool isTuple,DNVar ctx){
DNVar[] args=[];
foreach(i;0..nargs) args~=getVar("__a");
addArgs(args,isTuple,ctx);
}
bool hasArg(DNVar v){
// TODO: use more efficient search?
return args.canFind(v) || context&&v==context;
}
bool freeVarsOrdered=false;
DNVar[] orderedFreeVars;
bool isTuple=true;
void orderFreeVars(DNVar[] orderedFreeVars,bool isTuple)in{
assert(!freeVarsOrdered);
/+assert(orderedFreeVars.length==freeVars.length);
foreach(v;orderedFreeVars)
assert(v in freeVars);
// TODO: this does not check that variables occur at most once in orderedFreeVars
assert(isTuple||orderedFreeVars.length==1);+/
}body{
freeVarsOrdered=true;
this.orderedFreeVars=orderedFreeVars;
this.isTuple=isTuple;
}
SetX!DNVar tmpVars;
void marginalizeTemporaries(){
foreach(v;tmpVars.dup) marginalize(v);
}
void marginalizeLocals(Distribution enclosing,scope void delegate(DNVar) hook=null){
foreach(x;this.freeVars.dup){
if(x in enclosing.freeVars) continue;
if(hook) hook(x);
marginalize(x);
}
}
Distribution dup(){
auto r=new Distribution();
r.vbl=vbl.dup;
r.freeVars=freeVars.dup();
r.distribution=distribution;
r.error=error;
r.freeVarsOrdered=freeVarsOrdered;
r.hasArgs=hasArgs;
r.args=args.dup;
r.argsIsTuple=argsIsTuple;
r.context=context;
r.orderedFreeVars=orderedFreeVars.dup;
r.isTuple=isTuple;
return r;
}
Distribution dupNoErr(){
auto r=dup();
r.error=zero;
return r;
}
Distribution orderedJoin(Distribution b)in{assert(freeVarsOrdered && b.freeVarsOrdered);}body{
auto r=dup();
auto bdist = b.distribution.substituteAll(cast(DVar[])b.orderedFreeVars,cast(DExpr[])orderedFreeVars);
r.distribution=r.distribution+bdist;
r.error=r.error+b.error;
assert(r.args == b.args);
return r;
}
Distribution join(Distribution orig,Distribution b){
auto r=new Distribution();
auto d1=distribution;
auto d2=b.distribution;
// TODO: this should be unnecessary with dead variable analysis
foreach(x;this.freeVars) if(x !in orig.freeVars){ assert(d1 == zero || d1.hasFreeVar(x)); d1=dIntSmp(x,d1,one); }
foreach(x;b.freeVars) if(x !in orig.freeVars){ assert(d2 == zero || d2.hasFreeVar(x)); d2=dIntSmp(x,d2,one); }
//// /// // /
r.vbl=orig.vbl;
r.freeVars=orig.freeVars;
r.tmpVars=orig.tmpVars;
r.distribution=d1+d2;
r.error=orig.error;
r.hasArgs=orig.hasArgs;
r.args=orig.args;
r.argsIsTuple=orig.argsIsTuple;
r.context=orig.context;
r.orderedFreeVars=orig.orderedFreeVars;
r.isTuple=isTuple;
assert(hasArgs==b.hasArgs && args == b.args);
assert(!freeVarsOrdered && !b.freeVarsOrdered);
if(error != zero || b.error != zero)
r.error=orig.error+error+b.error;
return r;
}
DNVar declareVar(string name){
auto v=dVar(name);
if(v in freeVars) return null;
if(hasArg(v)) return null;
freeVars.insert(v);
return v;
}
DNVar getVar(string name){
DNVar v;
while(!v){ // TODO: fix more elegantly!
int suffix=++vbl[name];
string nn=name~suffix.lowNum;
v=declareVar(nn);
}
return v;
}
DNVar getPrimedVar(string name){
DNVar v;
for(string nn=name;!v;nn~="'")
v=declareVar(nn);
return v;
}
void freeVar(string name){
while(name in vbl&&vbl[name]!=0&&dVar(name~vbl[name].lowNum)!in freeVars)
--vbl[name];
}
DNVar getTmpVar(string name){
auto v=getVar(name);
tmpVars.insert(v);
return v;
}
DExpr computeProbability(DExpr cond){
auto tdist=distribution*cond.simplify(one);
foreach(v;freeVars) tdist=dIntSmp(v,tdist,one);
return tdist;
}
void assertTrue(DExpr cond,lazy string msg){
if(opt.noCheck) return;
error=(error+computeProbability(dEqZ(cond))).simplify(one);
distribution=distribution*cond;
}
void distribute(DExpr pdf){ distribution=distribution*pdf; }
void initialize(DNVar var,DExpr exp,Expression ty)in{
assert(var&&exp&&ty);
}body{
assert(!distribution.hasFreeVar(var));
distribute(dDelta(exp,var,ty));
}
void assign(DNVar var,DExpr exp,Expression ty){
if(distribution is zero) return;
// assert(distribution.hasFreeVar(var)); // ∫dx0
auto nvar=getVar(var.name);
distribution=distribution.substitute(var,nvar);
exp=exp.substitute(var,nvar);
distribute(dDelta(exp,var,ty));
marginalize(nvar);
}
void marginalize(DNVar var)in{assert(var in freeVars,text(var)); }body{
//assert(distribution.hasFreeVar(var),text(distribution," ",var));
//writeln("marginalizing: ",var,"\ndistribution: ",distribution,"\nmarginalized: ",dInt(var,distribution));
distribution=dIntSmp(var,distribution,one);
freeVars.remove(var);
tmpVars.remove(var);
assert(!distribution.hasFreeVar(var));
}
void observe(DExpr e){ // e's domain must be {0,1}
distribution=distribution*e;
}
void renormalize(){
auto factor=distribution;
foreach(v;freeVars) factor=dIntSmp(v,factor,one);
factor=factor+error;
distribution=distribution/factor;
if(!opt.noCheck) distribution=dNeqZ(factor)*distribution;
distribution=distribution.simplify(one);
if(!opt.noCheck) error=(dEqZ(factor)+dNeqZ(factor)*(error/factor)).simplify(one);
/+import type;
Distribution r=fromDExpr(dLambda(dNormalize(dApply(toDExpr().incDeBruijnVar(1,0),db1))),args.length,argsIsTuple,orderedFreeVars,isTuple,orderedFreeVars.map!(x=>cast(Expression)contextTy).array);
r.simplify();
distribution=r.distribution;
if(!opt.noCheck) error=r.error;+/
}
DExpr call(DExpr q,DExpr arg){
auto vars=freeVars.dup;
auto r=getTmpVar("__r");
if(!opt.noCheck){
auto ndist=dDistApply(dApply(q,arg),db1);
auto nerror=distribution*dInt(dMCase(db1,zero,one)*ndist);
distribution=distribution*dInt(dMCase(db1,dDiscDelta(db1,r),zero)*ndist);
foreach(v;vars) nerror=dInt(v,nerror);
error=error+nerror;
}else distribution=distribution*dDistApply(dApply(q,arg),r);
return r;
}
DExpr call(Distribution q,DExpr arg,Expression ty){
return call(q.toDExpr(),arg);
}
void simplify(){
distribution=distribution.simplify(one); // TODO: this shouldn't be necessary!
error=error.simplify(one);
}
private DExpr toDExprLambdaBody(bool stripContext=false)in{
assert(!stripContext||isTuple&&orderedFreeVars.length==2);
}body{
auto vars=orderedFreeVars;
assert(isTuple||vars.length==1);
auto values=(isTuple&&!stripContext?dTuple(cast(DExpr[])vars):vars[0]).incDeBruijnVar(1,0);
auto dist=distribution.incDeBruijnVar(2,0);
auto allVars=cast(DVar[])args;
DExpr[] allVals;
if(context){
allVars~=context;
allVals=iota(0,args.length).map!(i=>argsIsTuple?db2[0.dℚ][i.dℚ]:db2[0.dℚ]).array~db2[1.dℚ];
}else{
allVals=iota(0,args.length).map!(i=>argsIsTuple?db2[i.dℚ]:db2).array;
}
dist=dist.substituteAll(allVars,allVals);
if(!opt.noCheck){
auto r=dist*dDiscDelta(dVal(values),db1);
foreach(v;vars) r=dInt(v,r);
r=r+dDiscDelta(dErr,db1)*error.substituteAll(allVars,allVals);
return dDistLambda(r);
}else{
auto r=dist*dDiscDelta(values,db1);
foreach(v;vars) r=dInt(v,r);
return dDistLambda(r);
}
}
DExpr toDExpr()in{assert(freeVarsOrdered&&hasArgs);}body{
return dLambda(toDExprLambdaBody());
}
DExpr toDExprWithContext(DExpr context,bool stripContext=false)in{
assert(!!this.context);
assert(freeVarsOrdered&&hasArgs);
}body{
auto bdy=toDExprLambdaBody(stripContext);
context=context.incDeBruijnVar(1,0);
bdy=bdy.substitute(db1,dTuple([db1,context]));
return dLambda(bdy);
}
static Distribution fromDExpr(DExpr dexpr,size_t nargs,bool argsIsTuple,DNVar[] orderedFreeVars,bool isTuple,Expression[] types)in{
assert(argsIsTuple||nargs==1);
assert(isTuple||orderedFreeVars.length==1);
}body{
auto r=new Distribution();
dexpr=dexpr.incDeBruijnVar(1,0);
auto values=db1;
foreach(i,v;orderedFreeVars){
r.freeVars.insert(v);
auto value=isTuple?dIndex(values,dℚ(i)):values;
r.initialize(v,value,types[i]);
}
r.addArgs(nargs,argsIsTuple,null);
auto args=argsIsTuple?dTuple(cast(DExpr[])r.args):r.args[0];
auto ndist=dDistApply(dApply(dexpr,args),db1);
if(!opt.noCheck){
r.distribution=dInt(r.distribution*dInt(dMCase(db1,dDiscDelta(db1,db3),zero)*ndist));
r.error=dInt(dMCase(db1,zero,one)*ndist);
}else r.distribution=dInt(r.distribution*ndist);
r.orderFreeVars(orderedFreeVars,isTuple);
return r;
}
override string toString(){
return toString(Format.default_);
}
string argsToString(Format formatting){
if(formatting==Format.mathematica)
return args.length?(freeVars.length?", ":"")~args.map!(a=>a.toString(formatting)~"_").join(","):"";
return args.map!(a=>a.toString(formatting)).join(",");
}
string varsToString(Format formatting){
DNVar[] vars;
if(freeVarsOrdered) vars=orderedFreeVars;
else vars=freeVars.array;
string r;
foreach(v;vars) r~=(formatting==Format.mathematica?v.toString(formatting)~"_":v.toString(formatting))~",";
if(vars.length) r=r[0..$-1];
return r;
}
string toString(Format formatting){
string initial,middle,errstr;
auto astr=argsToString(formatting);
if(formatting==Format.mathematica){
initial="p[";
middle=text(astr,"] := ");
errstr=text("Pr_error[",astr.length?astr:"","] := ");
}else{
initial="p(";
middle=text(astr.length?"|":"",astr,") = ");
errstr=text("Pr[error",astr.length?"|":"",astr,"] = ");
}
string r=initial~varsToString(formatting);
r~=middle~distribution.toString(formatting);
if(error != zero) r~="\n"~errstr~error.toString(formatting);
return r;
}
}
| D |
module hunt.http.DownloadResponse;
import std.array;
import std.conv;
import std.datetime;
import std.json;
import std.path;
import std.file;
import std.stdio;
import collie.codec.http.headers.httpcommonheaders;
import collie.codec.http.server.responsehandler;
import collie.codec.http.server.responsebuilder;
import collie.codec.http.httpmessage;
import kiss.logger;
import hunt.init;
import hunt.application.config;
import hunt.http.cookie;
import hunt.utils.string;
import hunt.versions;
import hunt.http.response;
/**
* DownloadResponse represents an HTTP response delivering a file.
*/
class DownloadResponse : Response
{
private string fileName;
this(string fileName, string contentType = OctetStreamContentType)
{
super();
setHeader(HTTPHeaderCode.CONTENT_TYPE, contentType);
this.fileName = fileName;
}
DownloadResponse loadData()
{
string fullName = buildPath(APP_PATH, Config.app.download.path, fileName);
logDebug("downloading file: ", fullName);
if(exists(fullName) && !isDir(fullName))
{
// setData([0x11, 0x22]);
// FIXME: Needing refactor or cleanup -@zxp at 5/24/2018, 6:49:23 PM
// download a huge file.
// read file
auto f = std.stdio.File(fullName, "r");
scope(exit) f.close();
f.seek(0);
// logDebug("file size: ", f.size);
auto buf = f.rawRead(new ubyte[cast(uint)f.size]);
setData(buf);
}
else
throw new Exception("File does not exist: " ~ fileName);
return this;
}
DownloadResponse setData(in ubyte[] data)
{
setHeader(HTTPHeaderCode.CONTENT_DISPOSITION, "attachment; filename=" ~ baseName(fileName) ~ "; size=" ~ (to!string(data.length)));
setContent(data);
return this;
}
}
| D |
module denj.scene.scene;
import denj.utility;
import denj.utility.sharedreference;
import denj.scene.entity;
import std.algorithm;
// TODO: Probably allow synchronisation
class Scene {
Entity[] entityPool;
size_t lastEntityID = 0;
size_t numAliveEntities = 0;
this(){
entityPool.length = 8;
}
SharedReference!Entity NewEntity(){
auto e = FindUnusedEntity();
if(!e){
Log("No free entity");
entityPool.length = entityPool.capacity*2;
// So that entities don't point to old versions of themselves
foreach(ref ent; entityPool[0..numAliveEntities]){
ent.reference.SetReference(&ent);
}
e = FindUnusedEntity();
if(!e) "Scene unable to create new entities".Except;
}
e.Init();
e.id = ++lastEntityID;
e.owningScene = this;
numAliveEntities++;
e.reference = SharedReference!Entity(e);
return e.reference;
}
void DestroyEntity(SharedReference!Entity e){
// If reference is valid, notify the entity and
// shuffle it so that alive entities get queried
// and updated before dead ones
if(e) {
e.Destroy();
BubbleEntity(e.value);
}
e.InvalidateReference();
numAliveEntities--;
}
void UpdateEntities(){
foreach(ref e; entityPool[0..numAliveEntities]){
e.Update();
}
}
private:
Entity* FindUnusedEntity(){
Log("Finding unused entity...");
auto es = find!"!a.isAlive"(entityPool[numAliveEntities..$]);
if(es.length > 0) {
Log("Found ", &es[0]);
return &es[0];
}
return null;
}
// Swaps a dead entity with an alive entity at the end of the pool
// Calling this with each entity that dies will ensure that entities
// toward the beginning of the pool are always alive
void BubbleEntity(Entity* deadIt){
import std.algorithm : swap;
auto aliveIt = &entityPool[$-1];
// Search for an alive entity at the end of the pool
while(aliveIt != deadIt && !aliveIt.isAlive){
aliveIt--;
}
// If one was found, swap
if(aliveIt != deadIt){
// Log("Swap dead ", deadIt, " with alive ", aliveIt);
// Log("Swap dead ", deadIt.id, " with alive ", aliveIt.id);
// Log("Alive: ", aliveIt.reference.value());
// Log("Dead: ", deadIt.reference.value());
aliveIt.reference.SetReference(deadIt);
swap(*deadIt, *aliveIt);
// Dead reference doesn't need to be set as it's set
// upon entity creation
}
}
}
| D |
instance VLK_6134_VALERAN(Npc_Default)
{
name[0] = "Валеран";
guild = GIL_VLK;
id = 6134;
voice = 8;
flags = 0;
npcType = npctype_main;
B_SetAttributesToChapter(self,2);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1h_Vlk_Sword);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_N_Normal14,BodyTex_N,ITAR_Vlk_L);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Tired.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = rtn_start_6134;
};
func void rtn_start_6134()
{
TA_Read_Bookstand(8,0,20,0,"NW_CITY_REICH02_02");
TA_Sit_Bench(20,0,8,0,"NW_CITY_UPTOWN_PATH_08_B");
};
func void rtn_waitintavern_6134()
{
TA_Sit_Chair(8,0,20,0,"NW_LUTEROHELPER_03");
TA_Sit_Chair(20,0,8,0,"NW_LUTEROHELPER_03");
};
func void rtn_follow_6134()
{
TA_Follow_Player(8,0,22,0,"NW_CITY_LUTERO");
TA_Follow_Player(22,0,8,0,"NW_CITY_LUTERO");
};
func void rtn_workagain_6134()
{
TA_Read_Bookstand(8,0,20,0,"NW_VALERAN_01");
TA_Sit_Bench(20,0,8,0,"NW_VALERAN_02");
};
func void rtn_towerceo_6134()
{
TA_Stand_ArmsCrossed(6,0,10,0,"NW_CASTLEMINE_HUT_01");
TA_Repair_Hut(10,0,12,0,"NW_CASTLEMINE_TOWER_REP_HUT");
TA_Stand_Eating(12,0,14,0,"NW_CASTLEMINE_HUT_03_NIK");
TA_Read_Bookstand(14,0,20,0,"NW_CASTLEMINE_HUT_03_READBOOK");
TA_Stand_ArmsCrossed(20,0,23,0,"NW_CASTLEMINE_HUT_01");
TA_Sleep(23,0,6,0,"NW_CASTLEMINE_TOWER_08");
}; | D |
/* ssl/ssl23.h */
/* Copyright (C) 1995-1998 Eric Young ([email protected])
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young ([email protected]).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson ([email protected]).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young ([email protected])"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson ([email protected])"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
module deimos.openssl.ssl23;
import deimos.openssl._d_util;
import deimos.openssl.ssl;
extern (C):
nothrow:
/*client */
/* write to server */
enum SSL23_ST_CW_CLNT_HELLO_A = (0x210|SSL_ST_CONNECT);
enum SSL23_ST_CW_CLNT_HELLO_B = (0x211|SSL_ST_CONNECT);
/* read from server */
enum SSL23_ST_CR_SRVR_HELLO_A = (0x220|SSL_ST_CONNECT);
enum SSL23_ST_CR_SRVR_HELLO_B = (0x221|SSL_ST_CONNECT);
/* server */
/* read from client */
enum SSL23_ST_SR_CLNT_HELLO_A = (0x210|SSL_ST_ACCEPT);
enum SSL23_ST_SR_CLNT_HELLO_B = (0x211|SSL_ST_ACCEPT);
| D |
#!/usr/bin/env dub
/+ dub.json:
{
"name": "callback_query_bot",
"dependencies": {"telegram-d": {"path": ".."}},
}
+/
import telegram.api;
import std.stdio;
import std.conv;
///
// A simple bot that shows an inline keyboard with some buttons whenever someone talks to it
//
/**
* Create the inline keyboard
*/
auto createKeyboard() {
auto urlButton = InlineKeyboardButton();
urlButton.url = "https://telegram.me";
urlButton.text = "Telegram site";
auto cbButton = InlineKeyboardButton();
cbButton.text = "callback";
cbButton.callback_data = "some data";
auto switchButton = InlineKeyboardButton();
switchButton.text = "send to user..";
switchButton.switch_inline_query = "Hi, I'm sending this through a bot!";
auto ikm = InlineKeyboardMarkup();
ikm.inline_keyboard =
[ [urlButton],
[cbButton, switchButton]
];
return ikm;
}
void main(string[] args) {
//boring / not relevant
string apiToken = "";
if (args.length != 2) {
writeln("please pass your bot's API token as a command line argument");
return;
}
apiToken = args[1]; //assumption: token is correct
//set up the API in polling mode, using the default polling interval (5s)
auto api = new TelegramApi(apiToken);
while(true) {
//Listen for updates. This method is blocking.
auto updates = api.getUpdates();
foreach(u ;updates) {
//Not every Update provides a non-empty message field, so we have to check
//whether the message field contains text
if(u.message.text.length > 0) {
//Someone sent us a message!
writeln(u.message.from.username ~ ": " ~u.message.text);
//Let's reply by sending them an inline keyboard
auto chatId = u.message.chat.id;
auto reply = SendMessage!long(chatId);
reply.text = "Here's a keyboard for you:";
reply.reply_markup = createKeyboard();
api.send(reply);
} else if (u.callback_query.id.length > 0) {
//Someone pressed a callback query button.. let's send a reply
auto q = u.callback_query;
writeln(q.from.username ~ " pressed a button with data: " ~ q.data);
auto reply = SendMessage!long(q.message.chat.id);
reply.text = "You pressed the callback button!";
api.send(reply);
}
}
}
}
| D |
module sb.platform.platform_impl;
import sb.platform.platform_interface;
import sb.events;
import sb.input;
import sb.gl;
import derelict.glfw3.glfw3;
import derelict.opengl3.gl3;
import std.exception: enforce;
import gl3n.linalg;
import std.format;
import std.string: toStringz;
import core.stdc.string: strlen;
import std.algorithm;
import std.array;
extern(C) IPlatform sbCreatePlatformContext (IGraphicsLib graphicsLib, SbPlatformConfig config) {
enforce(config.backend != SbPlatform_Backend.NONE,
format("Invalid platform: %s", config.backend));
enforce(config.glVersion != SbPlatform_GLVersion.NONE,
format("Invalid gl version: %s", config.glVersion));
enforce(graphicsLib.glVersion == GraphicsLibVersion.GL_410,
format("Unsupported graphics backend: %s", graphicsLib.glVersion));
switch (config.backend) {
case SbPlatform_Backend.GLFW3:
return new SbPlatform( graphicsLib, config );
default:
throw new Exception(format("Unsupported platform backend: %s", config.backend));
}
}
struct SbTime {
immutable size_t NUM_SAMPLES = 128;
double[NUM_SAMPLES] mt_in_frame_samples;
double[NUM_SAMPLES] mt_frame_samples;
double ft_start, ft_end, ft_deltaTime = 0;
uint frameId = 0;
this (this) { ft_start = ft_end = glfwGetTime(); }
void beginFrame () {
auto now = glfwGetTime();
frameId = (frameId + 1) % NUM_SAMPLES;
ft_deltaTime = now - ft_start;
ft_start = now;
mt_frame_samples[ frameId ] = ft_deltaTime;
}
void endFrame () {
ft_end = glfwGetTime();
mt_in_frame_samples[ frameId ] = ft_end - ft_start;
}
@property auto frameTime () { return ft_start; }
@property auto currentTime () { return glfwGetTime(); }
@property auto dt () { return ft_deltaTime; }
@property auto frameIndex () { return frameId; }
@property auto timeSamples () {
import std.range: chain;
return chain( mt_frame_samples[ frameId+1 .. $ ], mt_frame_samples[ 0 .. frameId+1 ] );
}
}
class SbPlatform : IPlatform {
SbPlatformConfig m_config;
IGraphicsLib m_graphicsLib;
IGraphicsContext m_graphicsContext = null;
SbWindow[string] m_windows;
SbWindow m_mainWindow;
SbTime m_time;
SbInputState m_lastInput;
SbWindowState[] m_lastWindowState;
// Mouse + keyboard input device (fires events + maintains state)
auto m_mkDevice = new MKInputDevice();
// Active gamepads
immutable uint MAX_NUM_GAMEPADS = 16;
GamepadDevice[MAX_NUM_GAMEPADS] m_gamepads = null;
// Event list + state info
auto m_eventList = new SbEventList();
SbKBMState m_mkState;
final:
this (IGraphicsLib graphicsLib, SbPlatformConfig config) {
m_config = config;
m_graphicsLib = graphicsLib;
}
override void init () {
// preload gl + glfw
DerelictGLFW3.load();
m_graphicsLib.preInit();
enforce( glfwInit(), "failed to initialize glfw" );
}
override void initGL () {
m_graphicsLib.initOnThread();
if (m_mainWindow)
glfwMakeContextCurrent(m_mainWindow.handle);
m_graphicsContext = m_graphicsLib.getContext;
m_graphicsContext.beginFrame();
}
override void teardown () {
foreach (name, window; m_windows) {
window.release();
}
glfwTerminate();
m_graphicsLib.teardown();
}
override IGraphicsContext getGraphicsContext () {
assert(m_graphicsContext, "GL not initialized!");
return m_graphicsContext;
}
//override SbEventList events () { return m_eventList; }
override const(SbEventList) events () { return m_eventList; }
override const(SbInputState) input () { return m_lastInput; }
override const(SbWindowState[]) windows () { return m_lastWindowState; }
override IPlatformWindow createWindow (string id, SbWindowConfig config) {
import std.variant: visit;
enforce(id !in m_windows, format("Already registered window '%s'", id));
enforce(!m_mainWindow, format("Unimplemented: multi-window support"));
assert( m_graphicsLib.glVersion == GraphicsLibVersion.GL_410 );
m_graphicsLib.getVersionInfo.visit!(
(OpenglVersionInfo info) {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, info.VERSION_MAJOR);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, info.VERSION_MINOR);
glfwWindowHint(GLFW_OPENGL_PROFILE, info.IS_CORE_PROFILE ?
GLFW_OPENGL_CORE_PROFILE : GLFW_OPENGL_ANY_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, info.IS_FORWARD_COMPAT ?
GL_TRUE : GL_FALSE);
}
);
glfwWindowHint(GLFW_RESIZABLE, config.resizable ? GL_TRUE : GL_FALSE);
auto handle = glfwCreateWindow(
config.size_x, config.size_y,
config.title.toStringz,
null, null);
enforce(handle, format("Failed to create window '%s'", id));
auto window = new SbWindow( this, id, handle, config );
m_windows[ id ] = window;
if (!m_mainWindow) {
m_mainWindow = window;
glfwMakeContextCurrent( handle );
pollEvents();
}
return window;
}
override IPlatformWindow getWindow (string id) {
return id in m_windows ? m_windows[id] : null;
}
private void unregisterWindow (string id) {
if (id in m_windows) {
if (m_windows[id] == m_mainWindow)
m_mainWindow = null;
m_windows.remove(id);
}
}
override void swapFrame () {
if (m_mainWindow) {
m_graphicsContext.endFrame();
m_time.endFrame();
glfwSwapBuffers( m_mainWindow.handle );
m_time.beginFrame();
m_graphicsContext.beginFrame();
}
}
override void pollEvents () {
glfwPollEvents();
m_eventList.clear();
m_lastWindowState.length = 0;
foreach (_, window; m_windows) {
m_lastWindowState ~= window.getState();
window.collectEvents( m_eventList );
window.swapState();
}
m_mkDevice.fetchInputFrame( m_eventList, m_mkState );
pollGamepads( m_eventList );
m_lastInput = SbInputState(
m_time.dt, m_time.currentTime,
m_mkState,
m_gamepads[0..$].filter!"a !is null".map!"a.state".array
);
//m_eventList.dumpEvents();
}
private void pollGamepads (IEventProducer events) {
import std.stdio;
immutable uint MAX_NUM_GAMEPADS = 16;
foreach (i; 0 .. MAX_NUM_GAMEPADS) {
auto active = glfwJoystickPresent(i);
if (active) {
int naxes, nbuttons;
auto axes = glfwGetJoystickAxes(i, &naxes);
auto buttons = glfwGetJoystickButtons(i, &nbuttons);
if (!m_gamepads[i]) {
writefln("Joystick discovered! %s, %s, %s",
i, naxes, nbuttons);
m_gamepads[i] = new GamepadDevice(i, sbFindMatchingGamepadProfile( naxes, nbuttons ));
m_gamepads[i].setConnectionState(true, events);
}
m_gamepads[i].update(axes[0..naxes], buttons[0..nbuttons], events);
} else if (m_gamepads[i]) {
m_gamepads[i].setConnectionState(false, events);
m_gamepads[i] = null;
}
}
}
// Raw input callbacks (we force a bunch of stuff to "call home" from window obj => shared platform obj)
// We're gonna assume that said callbacks never get called from more than one thread (this is up to glfw),
// and the point of this is, if we ever support more than one window and actually _care_ about what order
// the events come in, we'll have enough info (more than enough) to determine what events happened when,
// in which proper sequence, and affecting which windows across any given frame.
//
// For the time being we don't really care, since > 1 window is out of the question, but when/if we do
// add multi-window / multi-monitor full-screen support, and decide to maybe use a more complex input
// / event model, then the infrastructure to do it already exists :)
private void pushRawInput ( SbWindow window, RawMouseBtnInput input ) nothrow @safe {
}
private void pushRawInput ( SbWindow window, RawKeyInput input ) nothrow @safe {
}
private void pushRawInput ( SbWindow window, RawCharInput input ) nothrow @safe {
}
// Unused, but possibly useful redundant callbacks. Focus + mouse motion events are already handled
// in SbWindow / SbWindowState, but these give us some extra context for the above events, if we
// need it or something...
private void notifyInputFocusChanged (SbWindow window, bool hasFocus) nothrow @safe {}
private void notifyCursorFocusChanged (SbWindow window, bool hasFocus) nothrow @safe {}
private void notifyCursorInput (SbWindow window, double x, double y) nothrow @safe {}
}
struct RawMouseBtnInput { int btn, action, mods; }
struct RawKeyInput { int key, scancode, action, mods; }
struct RawCharInput { dchar chr; }
alias RawInputEvent = Algebraic!(RawMouseBtnInput, RawKeyInput, RawCharInput);
struct SbInternalWindowState {
// Authoritative window state (mostly set by events)
vec2i windowSize, framebufferSize;
vec2 scaleFactor; // 1.0 + 0.5 for retina, and other scale factors for w/e (hacky way to scale ui)
float aspectRatio;
bool fullscreen = false;
void recalcScaleFacor () {
scaleFactor.x = cast(double)framebufferSize.x / cast(double)windowSize.x;
scaleFactor.y = cast(double)framebufferSize.y / cast(double)windowSize.y;
}
bool wantsRefresh = false;
bool hasInputFocus = true;
bool hasCursorFocus = true;
}
private void swapState (ref SbInternalWindowState a, ref SbInternalWindowState b) {
a = b;
b.wantsRefresh = false;
}
class SbWindow : IPlatformWindow {
SbPlatform platform;
string id;
GLFWwindow* handle;
SbWindowConfig config;
// current + next window state. Mutating operations change @nextState,
// preserving @state until swapState() is called.
SbInternalWindowState state, nextState;
// Screen scaling options (corresponds to SbScreenScale)
bool autodetectScreenScale = true;
vec2 forcedScaleFactor = 0.0; // used iff !autodetectScreenScale
// Internal event buffer.
// Populated by glfw event callbacks (ASSUMES single-threaded / synchronous);
// consumed by an IEventProducer via consumeEvents().
SbEvent[] windowEvents;
// D Callbacks
void delegate(IPlatformWindow) nothrow closeAction = null;
// Window fps, etc
bool showWindowFPS = false;
string windowFpsString = "";
string windowFpsFormat = DEFAULT_WINDOW_TITLE_FPS_FMT;
double lastWindowFps = 0;
this (
typeof(platform) platform, typeof(id) id,
typeof(handle) handle, typeof(config) config
) {
this.platform = platform;
this.id = id;
this.handle = handle;
this.config = config;
// Setup state: for simplicity, we call setScreenScale (calls onWindowSizeChanged)
// and swapState() to make state / nextState match starting window config parameters.
this.state.windowSize = vec2i(config.size_x, config.size_y);
if (config.screenScaleOption != SbScreenScale.CUSTOM_SCALE)
setScreenScale( config.screenScaleOption );
else
setScreenScale( config.customScale );
this.showWindowFPS = config.showFps;
swapState();
// set glfw callbacks (almost all callbacks are on a per-window basis)
glfwSetWindowUserPointer(handle, cast(void*)this);
glfwSetWindowSizeCallback(handle, &windowSizeCallback);
glfwSetFramebufferSizeCallback(handle, &windowFramebufferSizeCallback);
glfwSetWindowFocusCallback(handle, &windowFocusCallback);
glfwSetWindowRefreshCallback(handle, &windowRefreshCallback);
glfwSetKeyCallback(handle, &windowKeyInputCallback);
glfwSetCharCallback(handle, &windowCharInputCallback);
glfwSetCursorPosCallback(handle, &windowCursorInputCallback);
glfwSetCursorEnterCallback(handle, &windowCursorEnterCallback);
glfwSetMouseButtonCallback(handle, &windowMouseBtnInputCallback);
glfwSetScrollCallback(handle, &windowScrollInputCallback);
// turn off sticky keys!
glfwSetInputMode(handle, GLFW_STICKY_KEYS, false);
}
override void release () {
platform.unregisterWindow( id );
if (handle) {
glfwDestroyWindow( handle );
handle = null;
}
}
override string getName () { return id; }
SbWindowState getState () {
return SbWindowState( id,
nextState.windowSize, state.windowSize,
nextState.scaleFactor, state.scaleFactor,
state.hasCursorFocus,
state.hasInputFocus,
state.wantsRefresh
);
}
private void updateWindowTitle () {
glfwSetWindowTitle(handle, showWindowFPS ?
format("%s %s", config.title, windowFpsString).toStringz :
config.title.toStringz
);
}
override IPlatformWindow setTitle ( string title ) {
config.title = title;
return updateWindowTitle, this;
}
override IPlatformWindow setTitleFPSVisible (bool visible) {
showWindowFPS = visible;
return updateWindowTitle, this;
}
override IPlatformWindow setTitleFPS (double fps) {
windowFpsString = format( windowFpsFormat, lastWindowFps = fps );
return updateWindowTitle, this;
}
override IPlatformWindow setTitleFPSFormat (string fmt) {
windowFpsString = format( windowFpsFormat = fmt, lastWindowFps );
return this;
}
override bool shouldClose () { return glfwWindowShouldClose(handle) != 0; }
override IPlatformWindow setShouldClose (bool close = true) {
glfwSetWindowShouldClose(handle, close);
return this;
}
override IPlatformWindow onClosed (void delegate(IPlatformWindow) nothrow dg) {
closeAction = dg;
glfwSetWindowCloseCallback(handle, &windowCloseCallback);
return this;
}
// NOT SUPPORTED BY GLFW...
//IPlatformWindow setResizable (bool resizable) {
// if (resizable != config.resizable) {
// config.resizable = resizable;
// glfwSetWindowResizable(handle, resizable);
// }
//}
override IPlatformWindow setWindowSize ( vec2i size ) {
onWindowSizeChanged( size.x, size.y );
return this;
}
override vec2i windowSize () { return nextState.windowSize; }
private void collectEvents (IEventProducer eventList) {
foreach (event; windowEvents)
eventList.pushEvent(event);
windowEvents.length = 0;
if (state.scaleFactor != nextState.scaleFactor)
eventList.pushEvent(SbWindowRescaleEvent(id, state.scaleFactor, nextState.scaleFactor));
if (state.windowSize != nextState.windowSize)
eventList.pushEvent(SbWindowResizeEvent(id, state.windowSize, nextState.windowSize));
}
override IPlatformWindow setScreenScale ( SbScreenScale option ) {
autodetectScreenScale = option == SbScreenScale.AUTODETECT_RESOLUTION;
final switch (option) {
case SbScreenScale.FORCE_SCALE_1X: forcedScaleFactor = vec2(1, 1); break;
case SbScreenScale.FORCE_SCALE_2X: forcedScaleFactor = vec2(0.5, 0.5); break;
case SbScreenScale.FORCE_SCALE_4X: forcedScaleFactor = vec2(0.25, 0.25); break;
case SbScreenScale.CUSTOM_SCALE: autodetectScreenScale = true; break;
case SbScreenScale.AUTODETECT_RESOLUTION: break;
}
config.screenScaleOption = option;
onWindowSizeChanged( state.windowSize.x, state.windowSize.y );
return this;
}
override IPlatformWindow setScreenScale ( vec2 customScale ) {
autodetectScreenScale = false;
forcedScaleFactor = customScale;
config.screenScaleOption = SbScreenScale.CUSTOM_SCALE;
config.customScale = customScale;
onWindowSizeChanged( state.windowSize.x, state.windowSize.y );
return this;
}
void swapState () {
state.swapState(nextState);
}
// Window callbacks (onWindowSizeChanged is also called by internal state setting code)
private void onWindowSizeChanged ( int width, int height ) nothrow {
nextState.windowSize = vec2i(width, height);
nextState.aspectRatio = cast(double)width / cast(double)height;
if (autodetectScreenScale) {
nextState.scaleFactor = vec2(
cast(double)nextState.framebufferSize.x / cast(double)nextState.windowSize.x,
cast(double)nextState.framebufferSize.y / cast(double)nextState.windowSize.y
);
} else {
nextState.scaleFactor = forcedScaleFactor;
nextState.framebufferSize = vec2i(
cast(int)( nextState.windowSize.x * forcedScaleFactor.x ),
cast(int)( nextState.windowSize.y * forcedScaleFactor.y ),
);
}
}
private void onFrameBufferSizeChanged ( int width, int height ) nothrow {
if (autodetectScreenScale) {
nextState.framebufferSize = vec2i(width, height);
nextState.scaleFactor = vec2(
cast(double)nextState.framebufferSize.x / cast(double)nextState.windowSize.x,
cast(double)nextState.framebufferSize.y / cast(double)nextState.windowSize.y
);
}
}
// Called when window "damaged" and any persistent elements (eg. UI?) needs to be fully re-rendered
private void onWindowNeedsRefresh () nothrow {
nextState.wantsRefresh = true;
windowEvents ~= SbEvent(SbWindowNeedsRefreshEvent( id ));
}
// Called when window gains / loses input focus
private void onInputFocusChanged (bool hasFocus) nothrow {
nextState.hasInputFocus = hasFocus;
windowEvents ~= SbEvent(SbWindowFocusChangeEvent( id, hasFocus ));
platform.notifyInputFocusChanged( this, hasFocus );
}
// Called when cursor enters / exits window
private void onCursorFocusChanged (bool hasFocus) nothrow {
nextState.hasCursorFocus = hasFocus;
windowEvents ~= SbEvent(SbWindowMouseoverEvent( id, hasFocus ));
platform.notifyCursorFocusChanged( this, hasFocus );
}
// Input callback: mouse motion
private void onCursorInput ( double xpos, double ypos ) nothrow {
platform.m_mkDevice.registerMouseMotion( vec2(xpos, ypos) );
}
// Input callback: mouse wheel / trackpad scroll motion
private void onScrollInput ( double xoffs, double yoffs ) nothrow {
platform.m_mkDevice.registerMouseScrollDelta( vec2(xoffs, yoffs) );
}
// Input callback: mouse button press state changed
private void onMouseButtonInput ( int button, int action, int mods ) nothrow {
if (action == GLFW_PRESS || action == GLFW_RELEASE)
platform.m_mkDevice.registerMouseBtn( glfwGetTime(), button, action == GLFW_PRESS );
}
// Input callback: keyboard key press state changed
private void onKeyInput( int key, int scancode, int action, int mods ) nothrow {
if (action == GLFW_PRESS || action == GLFW_RELEASE)
platform.m_mkDevice.registerKeyAction( glfwKeyToHID(key), action == GLFW_PRESS );
}
// Input callback: text input (key pressed as unicode codepoint)
private void onCharInput ( dchar chr ) nothrow {
platform.m_mkDevice.registerCharInput( chr );
}
}
// GLFW Callbacks
private SbWindow getWindow (GLFWwindow* handle) nothrow @trusted {
return cast(SbWindow)glfwGetWindowUserPointer(handle);
}
//private auto doWindowCallback(string name)(GLFWwindow* handle) {
// auto window = handle.getWindow();
// mixin("if (window."~name~") window."~name~"(window);");
//}
extern(C) private void windowCloseCallback (GLFWwindow* handle) nothrow {
//handle.doWindowCallback!"closeAction";
auto window = handle.getWindow;
if (window.closeAction)
window.closeAction(window);
}
extern(C) private void windowSizeCallback (GLFWwindow* handle, int width, int height) nothrow {
handle.getWindow.onWindowSizeChanged( width, height );
}
extern(C) private void windowFramebufferSizeCallback (GLFWwindow* handle, int width, int height) nothrow {
handle.getWindow.onFrameBufferSizeChanged( width, height );
}
extern(C) private void windowFocusCallback (GLFWwindow* handle, int focused) nothrow {
handle.getWindow.onInputFocusChanged( focused != 0 );
}
extern(C) private void windowRefreshCallback (GLFWwindow* handle) nothrow {
handle.getWindow.onWindowNeedsRefresh();
}
extern(C) private void windowKeyInputCallback (GLFWwindow* handle, int key, int scancode, int action, int mods) nothrow {
handle.getWindow.onKeyInput(key, scancode, action, mods);
}
extern(C) private void windowCharInputCallback (GLFWwindow* handle, uint codepoint) nothrow {
handle.getWindow.onCharInput( cast(dchar)codepoint );
}
extern(C) private void windowCursorInputCallback (GLFWwindow* handle, double xpos, double ypos) nothrow {
handle.getWindow.onCursorInput( xpos, ypos );
}
extern(C) private void windowCursorEnterCallback (GLFWwindow* handle, int entered) nothrow {
handle.getWindow.onCursorFocusChanged( entered != 0 );
}
extern(C) private void windowMouseBtnInputCallback (GLFWwindow* handle, int button, int action, int mods) nothrow {
handle.getWindow.onMouseButtonInput( button, action, mods );
}
extern(C) private void windowScrollInputCallback (GLFWwindow* handle, double xoffs, double yoffs) nothrow {
handle.getWindow.onScrollInput( xoffs, yoffs );
}
| D |
/Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/calendarViewController.o : /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
/Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/calendarViewController~partial.swiftmodule : /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
/Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/calendarViewController~partial.swiftdoc : /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/09_PersistData/FoodTracker/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
| D |
module dnogc.Utils;
T nogcNew(T, Args...) (Args args) @trusted @nogc
{
import std.conv : emplace;
import core.stdc.stdlib : malloc;
auto size = __traits(classInstanceSize, T);
auto memory = malloc(size)[0..size];
if(!memory)
{
import core.exception : onOutOfMemoryError;
onOutOfMemoryError();
}
// call T's constructor and emplace instance on
// newly allocated memory
return emplace!(T, Args)(memory, args);
}
void nogcDel(T)(T obj) @trusted
{
import core.stdc.stdlib : free;
destroy(obj);
// free memory occupied by object
free(cast(void*)obj);
}
/**
* Thanks to http://forum.dlang.org/post/[email protected]
*/
void assumeNogc(alias Func, T...)(T xs) @nogc
{
import std.traits : isFunctionPointer, isDelegate, functionAttributes,
FunctionAttribute, SetFunctionAttributes, functionLinkage;
static auto assumeNogcPtr(T)(T f) if (isFunctionPointer!T || isDelegate!T)
{
enum attrs = functionAttributes!T | FunctionAttribute.nogc;
return cast(SetFunctionAttributes!(T, functionLinkage!T, attrs)) f;
}
assumeNogcPtr(&Func!T)(xs);
}
void dln(string file = __FILE__, uint line = __LINE__, string fun = __FUNCTION__, Args...)(Args args) pure nothrow @trusted
{
try
{
import std.stdio : writeln;
debug assumeNogc!writeln(file, ":", line, ":", " debug: ", args);
}
catch (Exception)
{
}
}
| D |
to a degree exceeding normal or proper limits
| D |
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QTEXTBROWSER_H
#define QTEXTBROWSER_H
public import qt.QtWidgets.qtextedit;
public import qt.QtCore.qurl;
QT_BEGIN_NAMESPACE
#ifndef QT_NO_TEXTBROWSER
class QTextBrowserPrivate;
class Q_WIDGETS_EXPORT QTextBrowser : public QTextEdit
{
mixin Q_OBJECT;
mixin Q_PROPERTY!(QUrl, "source", "READ", "source", "WRITE", "setSource");
Q_OVERRIDE(bool modified SCRIPTABLE false)
Q_OVERRIDE(bool readOnly DESIGNABLE false SCRIPTABLE false)
Q_OVERRIDE(bool undoRedoEnabled DESIGNABLE false SCRIPTABLE false)
mixin Q_PROPERTY!(QStringList, "searchPaths", "READ", "searchPaths", "WRITE", "setSearchPaths");
mixin Q_PROPERTY!(bool, "openExternalLinks", "READ", "openExternalLinks", "WRITE", "setOpenExternalLinks");
mixin Q_PROPERTY!(bool, "openLinks", "READ", "openLinks", "WRITE", "setOpenLinks");
public:
explicit QTextBrowser(QWidget* parent = 0);
/+virtual+/ ~QTextBrowser();
QUrl source() const;
QStringList searchPaths() const;
void setSearchPaths(ref const(QStringList) paths);
/+virtual+/ QVariant loadResource(int type, ref const(QUrl) name);
bool isBackwardAvailable() const;
bool isForwardAvailable() const;
void clearHistory();
QString historyTitle(int) const;
QUrl historyUrl(int) const;
int backwardHistoryCount() const;
int forwardHistoryCount() const;
bool openExternalLinks() const;
void setOpenExternalLinks(bool open);
bool openLinks() const;
void setOpenLinks(bool open);
public Q_SLOTS:
/+virtual+/ void setSource(ref const(QUrl) name);
/+virtual+/ void backward();
/+virtual+/ void forward();
/+virtual+/ void home();
/+virtual+/ void reload();
Q_SIGNALS:
void backwardAvailable(bool);
void forwardAvailable(bool);
void historyChanged();
void sourceChanged(ref const(QUrl) );
void highlighted(ref const(QUrl) );
void highlighted(ref const(QString) );
void anchorClicked(ref const(QUrl) );
protected:
bool event(QEvent *e);
/+virtual+/ void keyPressEvent(QKeyEvent *ev);
/+virtual+/ void mouseMoveEvent(QMouseEvent *ev);
/+virtual+/ void mousePressEvent(QMouseEvent *ev);
/+virtual+/ void mouseReleaseEvent(QMouseEvent *ev);
/+virtual+/ void focusOutEvent(QFocusEvent *ev);
/+virtual+/ bool focusNextPrevChild(bool next);
/+virtual+/ void paintEvent(QPaintEvent *e);
private:
mixin Q_DISABLE_COPY;
mixin Q_DECLARE_PRIVATE;
Q_PRIVATE_SLOT(d_func(), void _q_documentModified())
Q_PRIVATE_SLOT(d_func(), void _q_activateAnchor(ref const(QString) ))
Q_PRIVATE_SLOT(d_func(), void _q_highlightLink(ref const(QString) ))
};
#endif // QT_NO_TEXTBROWSER
QT_END_NAMESPACE
#endif // QTEXTBROWSER_H
| D |
/******************************************************
* Стековые Потоки (СтэкНити) - это сотрудничающие, легковесные
* потоки. СтэкНити очень эффективны, требуют
* меньше времени на переключение контекста, чем реальные потоки.
* Для них также нужно меньше ресурсов, чем для реальных потоков,
* что дает возможность одновременного существования большого числа
* СтэкНити. К тому же, СтэкНити не требуется явная синхронизация,
* так как они non-preemptive. Не требуется, чтобы код был для повторного входа.
*
* Данный модуль реализует систему стековых потоков на основе
* контекстного слоя.
*
* Версия: 0.3
* Дата: July 4, 2006
* Авторы:
* Mikola Lysenko, [email protected]
* Лицензия: Use/копируй/modify freely, just give credit.
* Авторское Право: Public domain.
*
* Bugs:
* Не потоко-безопасны. Могут изменяться в последующих версиях,
* однако для этого потребуется коренная переделка.
*
* История:
* v0.7 - Резолюция отсчета времени переключена на миллисекунды.
*
* v0.6 - Удалены функции отсчета времени из сн_жни/сн_бросайЖни
*
* v0.5 - Добавлены сн_бросайЖни и MAX/MIN_THREAD_PRIORITY
*
* v0.4 - Unittests готов для первоначального выпуска.
*
* v0.3 - Changed имя back to СтэкНить и added
* linux support. Context switching is now handled
* in the stackcontext module, и much simpler to
* port.
*
* v0.2 - Changed имя to QThread, fixed many issues.
*
* v0.1 - Initial стэк thread system. Very buggy.
*
******************************************************/
module st.stackthread;
//Module imports
private import st.stackcontext, stdrus;
/// The приоритет of a стэк thread determines its order in
/// the планировщик. Higher приоритет threads go первый.
alias цел т_приоритет;
/// The default приоритет for a стэк thread is 0.
const т_приоритет ДЕФ_ПРИОРИТЕТ_СТЭКНИТИ = 0;
/// Maximum thread приоритет
const т_приоритет МАКС_ПРИОРИТЕТ_СТЭКНИТИ = 0x7fffffff;
/// Minimum thread приоритет
const т_приоритет МИН_ПРИОРИТЕТ_СТЭКНИТИ = 0x80000000;
/// The состояние of a стэк thread
enum ПСостояниеНити
{
Готов, /// Нить is готов to пуск
Выполняется, /// Нить is currently выполняется
Завершён, /// Нить имеется terminated
Подвешен, /// Нить is suspended
}
/// The состояние of the планировщик
enum ПСостояниеПланировщика
{
Готов, /// Scheduler is готов to пуск a thread
Выполняется, /// Scheduler is выполняется a timeslice
}
//Timeslices
private ОчередьПриоритетовСН активный_срез;
private ОчередьПриоритетовСН следующий_срез;
//Scheduler состояние
private ПСостояниеПланировщика сост_планировщ;
//Start time of the time slice
private бдол sched_t0;
//Currently active стэк thread
private СтэкНить sched_st;
version(Win32)
{
private extern(Windows) цел QueryPerformanceFrequency(бдол *);
private бдол sched_perf_freq;
}
//Initialize the планировщик
static this()
{
активный_срез = new ОчередьПриоритетовСН();
следующий_срез = new ОчередьПриоритетовСН();
сост_планировщ = ПСостояниеПланировщика.Готов;
sched_t0 = -1;
sched_st = пусто;
version(Win32)
QueryPerformanceFrequency(&sched_perf_freq);
}
/******************************************************
* СтэкThreadExceptions are generated whenever the
* стэк threads are incorrectly invokeauxd. Trying to
* пуск a time slice while a time slice is in progress
* will result in a ИсклСтэкНити.
******************************************************/
class ИсклСтэкНити : Исключение
{
this(ткст сооб)
{
super(сооб);
}
this(СтэкНить st, ткст сооб)
{
super(фм("%s: %s", st.вТкст, сооб));
}
}
/******************************************************
* СтэкНити are much like regular threads except
* they are cooperatively scheduleauxd. A user may switch
* between СтэкНити using st_yielauxd.
******************************************************/
class СтэкНить
{
/**
* Creates a new стэк thread и adds it to the
* планировщик.
*
* Параметры:
* dg = The delegate we are invoking
* размер_стэка = The размер of the стэк for the стэк
* threaauxd.
* приоритет = The приоритет of the стэк threaauxd.
*/
public this
(
проц delegate() dg,
т_приоритет приоритет = ДЕФ_ПРИОРИТЕТ_СТЭКНИТИ,
т_мера размер_стэка = ДЕФ_РАЗМЕР_СТЕКА
)
{
this.m_delegate = dg;
this.контекст = new КонтекстСтэка(&m_proc, ДЕФ_РАЗМЕР_СТЕКА);
this.m_priority = приоритет;
//Schedule the thread
сн_запланируй(this);
debug (СтэкНить) скажифнс("Created thread, %s", вТкст);
}
/**
* Creates a new стэк thread и adds it to the
* планировщик, using a function pointer.
*
* Параметры:
* fn = The function pointer that the стэк thread
* invokes.
* размер_стэка = The размер of the стэк for the стэк
* threaauxd.
* приоритет = The приоритет of the стэк threaauxd.
*/
public this
(
проц function() fn,
т_приоритет приоритет = ДЕФ_ПРИОРИТЕТ_СТЭКНИТИ,
т_мера размер_стэка = ДЕФ_РАЗМЕР_СТЕКА
)
{
this.m_delegate = &delegator;
this.m_function = fn;
this.контекст = new КонтекстСтэка(&m_proc, ДЕФ_РАЗМЕР_СТЕКА);
this.m_priority = приоритет;
//Schedule the thread
сн_запланируй(this);
debug (СтэкНить) скажифнс("Created thread, %s", вТкст);
}
/**
* Converts the thread to a string.
*
* Возвращает: A string representing the стэк threaauxd.
*/
public ткст вТкст()
{
debug(PQueue)
{
return фм("ST[t:%8x,p:%8x,l:%8x,r:%8x]",
cast(ук)this,
cast(ук)parent,
cast(ук)left,
cast(ук)right);
}
else
{
static ткст[] названия_состояний =
[
"RDY",
"RUN",
"XXX",
"PAU",
];
//horrid hack for getting the address of a delegate
union hack
{
struct dele
{
ук frame;
ук fptr;
}
dele d;
проц delegate () dg;
}
hack h;
if(m_function !is пусто)
h.d.fptr = cast(ук) m_function;
else if(m_delegate !is пусто)
h.dg = m_delegate;
else
h.dg = &пуск;
return фм(
"Нить[pr=%d,st=%s,fn=%8x]",
приоритет,
названия_состояний[cast(бцел)состояние],
h.d.fptr);
}
}
invariant
{
assert(контекст);
switch(состояние)
{
case ПСостояниеНити.Готов:
assert(контекст.готов);
break;
case ПСостояниеНити.Выполняется:
assert(контекст.выполняется);
break;
case ПСостояниеНити.Завершён:
assert(!контекст.выполняется);
break;
case ПСостояниеНити.Подвешен:
assert(контекст.готов);
break;
default:
assert(false);
}
if(left !is пусто)
{
assert(left.parent is this);
}
if(right !is пусто)
{
assert(right.parent is this);
}
}
/**
* Removes this стэк thread from the планировщик. The
* thread will not be пуск until it is added back to
* the планировщик.
*/
public final проц пауза()
{
debug (СтэкНить) скажифнс("Pausing %s", вТкст);
switch(состояние)
{
case ПСостояниеНити.Готов:
сн_отмени(this);
состояние = ПСостояниеНити.Подвешен;
break;
case ПСостояниеНити.Выполняется:
transition(ПСостояниеНити.Подвешен);
break;
case ПСостояниеНити.Завершён:
throw new ИсклСтэкНити(this, "Cannot пауза a завершён thread");
case ПСостояниеНити.Подвешен:
throw new ИсклСтэкНити(this, "Cannot пауза a на_паузе thread");
default:
assert(false);
}
}
/**
* Adds the стэк thread back to the планировщик. It
* will возобнови выполняется with its приоритет & состояние
* intact.
*/
public final проц возобнови()
{
debug (СтэкНить) скажифнс("Возобновляется %s", вТкст);
//Can only возобнови на_паузе threads
if(состояние != ПСостояниеНити.Подвешен)
{
throw new ИсклСтэкНити(this, "Нить не заморожена!");
}
//Set состояние to готов и schedule
состояние = ПСостояниеНити.Готов;
сн_запланируй(this);
}
/**
* Kills this стэк thread in a violent manner. The
* thread does not дай a chance to end itself or clean
* anything up, it is descheduled и all GC references
* are releaseauxd.
*/
public final проц души()
{
debug (СтэкНить) скажифнс("Killing %s", вТкст);
switch(состояние)
{
case ПСостояниеНити.Готов:
//Kill thread и удали from планировщик
сн_отмени(this);
состояние = ПСостояниеНити.Завершён;
контекст.души();
break;
case ПСостояниеНити.Выполняется:
//Transition to завершён
transition(ПСостояниеНити.Завершён);
break;
case ПСостояниеНити.Завершён:
throw new ИсклСтэкНити(this, "Уже потушенную нить удушить нельзя");
case ПСостояниеНити.Подвешен:
//We need to души the стэк, no need to touch планировщик
состояние = ПСостояниеНити.Завершён;
контекст.души();
break;
default:
assert(false);
}
}
/**
* Waits to объедини with this thread. If the given amount
* of milliseconds expires before the thread is завершён,
* then we return automatically.
*
* Параметры:
* ms = The maximum amount of time the thread is
* allowed to wait. The special value -1 implies that
* the объедини will wait indefinitely.
*
* Возвращает:
* The amount of millieconds the thread was actually
* waiting.
*/
public final бдол объедини(бдол ms = -1)
{
debug (СтэкНить) скажифнс("Joining %s", вТкст);
//Make sure we are in a timeslice
if(сост_планировщ != ПСостояниеПланировщика.Выполняется)
{
throw new ИсклСтэкНити(this, "Cannot объедини unless a timeslice is currently in progress");
}
//And make sure we are joining with a действителен thread
switch(состояние)
{
case ПСостояниеНити.Готов:
break;
case ПСостояниеНити.Выполняется:
throw new ИсклСтэкНити(this, "A thread cannot объедини with itself!");
case ПСостояниеНити.Завершён:
throw new ИсклСтэкНити(this, "Cannot объедини with a завершён thread");
case ПСостояниеНити.Подвешен:
throw new ИсклСтэкНити(this, "Cannot объедини with a на_паузе thread");
default:
assert(false);
}
//Do busy waiting until the thread dies or the
//timer runs out.
бдол start_time = getSysMillis();
бдол timeout = (ms == -1) ? ms : start_time + ms;
while(
состояние != ПСостояниеНити.Завершён &&
timeout > getSysMillis())
{
КонтекстСтэка.жни();
}
return getSysMillis() - start_time;
}
/**
* Restarts the thread's execution from the very
* beginning. Suspended и завершён threads are not
* resumed, but upon resuming, they will перезапуск.
*/
public final проц перезапуск()
{
debug (СтэкНить) скажифнс("Restarting %s", вТкст);
//Each состояние needs to be handled carefully
switch(состояние)
{
case ПСостояниеНити.Готов:
//If we are готов,
контекст.перезапуск();
break;
case ПСостояниеНити.Выполняется:
//Reset the threaauxd.
transition(ПСостояниеНити.Готов);
break;
case ПСостояниеНити.Завершён:
//Dead threads become suspended
контекст.перезапуск();
состояние = ПСостояниеНити.Подвешен;
break;
case ПСостояниеНити.Подвешен:
//Suspended threads stay suspended
контекст.перезапуск();
break;
default:
assert(false);
}
}
/**
* Grabs the thread's приоритет. Intended for use
* as a property.
*
* Возвращает: The стэк thread's приоритет.
*/
public final т_приоритет приоритет()
{
return m_priority;
}
/**
* Sets the стэк thread's приоритет. Used to either
* reschedule or reset the threaauxd. Changes do not
* возьми effect until the next round of scheduling.
*
* Параметры:
* p = The new приоритет for the thread
*
* Возвращает:
* The new приоритет for the threaauxd.
*/
public final т_приоритет приоритет(т_приоритет p)
{
//Update приоритет
if(сост_планировщ == ПСостояниеПланировщика.Готов &&
состояние == ПСостояниеНити.Готов)
{
следующий_срез.удали(this);
m_priority = p;
следующий_срез.добавь(this);
}
return m_priority = p;
}
/**
* Возвращает: The состояние of this threaauxd.
*/
public final ПСостояниеНити дайСостояние()
{
return состояние;
}
/**
* Возвращает: True if the thread is готов to пуск.
*/
public final бул готов()
{
return состояние == ПСостояниеНити.Готов;
}
/**
* Возвращает: True if the thread is currently выполняется.
*/
public final бул выполняется()
{
return состояние == ПСостояниеНити.Выполняется;
}
/**
* Возвращает: True if the thread is deaauxd.
*/
public final бул завершён()
{
return состояние == ПСостояниеНити.Завершён;
}
/**
* Возвращает: True if the thread is not dead.
*/
public final бул жив()
{
return состояние != ПСостояниеНити.Завершён;
}
/**
* Возвращает: True if the thread is на_паузе.
*/
public final бул на_паузе()
{
return состояние == ПСостояниеНити.Подвешен;
}
/**
* Creates a стэк thread without a function pointer
* or delegate. Used when a user overrides the стэк
* thread class.
*/
protected this
(
т_приоритет приоритет = ДЕФ_ПРИОРИТЕТ_СТЭКНИТИ,
т_мера размер_стэка = ДЕФ_РАЗМЕР_СТЕКА
)
{
this.контекст = new КонтекстСтэка(&m_proc, размер_стэка);
this.m_priority = приоритет;
//Schedule the thread
сн_запланируй(this);
debug (СтэкНить) скажифнс("Created thread, %s", вТкст);
}
/**
* Run the стэк threaauxd. This method may be overloaded
* by classes which inherit from стэк thread, as an
* alternative to passing delegates.
*
* Выводит исключение: Anything.
*/
protected проц пуск()
{
m_delegate();
}
// Heap information
private СтэкНить parent = пусто;
private СтэкНить left = пусто;
private СтэкНить right = пусто;
// The thread's приоритет
private т_приоритет m_priority;
// The состояние of the thread
private ПСостояниеНити состояние;
// The thread's контекст
private КонтекстСтэка контекст;
//Delegate handler
private проц function() m_function;
private проц delegate() m_delegate;
private проц delegator()
{
m_function();
}
//My procedure
private final проц m_proc()
{
try
{
debug (СтэкНить) скажифнс("Starting %s", вТкст);
пуск;
}
catch(Объект o)
{
debug (СтэкНить) скажифнс("Got a %s exception from %s", o.вТкст, вТкст);
throw o;
}
finally
{
debug (СтэкНить) скажифнс("Finished %s", вТкст);
состояние = ПСостояниеНити.Завершён;
}
}
/**
* Used to change the состояние of a выполняется thread
* gracefully
*/
private final проц transition(ПСостояниеНити next_state)
{
состояние = next_state;
КонтекстСтэка.жни();
}
}
/******************************************************
* The ОчередьПриоритетовСН is использован by the планировщик to
* order the objects in the стэк threads. For the
* moment, the implementation is binary heap, but future
* versions might use a binomial heap for performance
* improvements.
******************************************************/
private class ОчередьПриоритетовСН
{
public:
/**
* Add a стэк thread to the queue.
*
* Параметры:
* st = The thread we are adding.
*/
проц добавь(СтэкНить st)
in
{
assert(st !is пусто);
assert(st);
assert(st.parent is пусто);
assert(st.left is пусто);
assert(st.right is пусто);
}
body
{
размер++;
//Handle trivial case
if(head is пусто)
{
head = st;
return;
}
//First, insert st
СтэкНить tmp = head;
цел pos;
for(pos = размер; pos>3; pos>>>=1)
{
assert(tmp);
tmp = (pos & 1) ? tmp.right : tmp.left;
}
assert(tmp !is пусто);
assert(tmp);
if(pos&1)
{
assert(tmp.left !is пусто);
assert(tmp.right is пусто);
tmp.right = st;
}
else
{
assert(tmp.left is пусто);
assert(tmp.right is пусто);
tmp.left = st;
}
st.parent = tmp;
assert(tmp);
assert(st);
//Fixup the стэк и we're gooauxd.
вспень(st);
}
/**
* Remove a стэк threaauxd.
*
* Параметры:
* st = The стэк thread we are removing.
*/
проц удали(СтэкНить st)
in
{
assert(st);
assert(естьНить(st));
}
out
{
assert(st);
assert(st.left is пусто);
assert(st.right is пусто);
assert(st.parent is пусто);
}
body
{
//Handle trivial case
if(размер == 1)
{
assert(st is head);
--размер;
st.parent =
st.left =
st.right =
head = пусто;
return;
}
//Cycle to the bottom of the heap
СтэкНить tmp = head;
цел pos;
for(pos = размер; pos>3; pos>>>=1)
{
assert(tmp);
tmp = (pos & 1) ? tmp.right : tmp.left;
}
tmp = (pos & 1) ? tmp.right : tmp.left;
assert(tmp !is пусто);
assert(tmp.left is пусто);
assert(tmp.right is пусто);
//Remove tmp
if(tmp.parent.left is tmp)
{
tmp.parent.left = пусто;
}
else
{
assert(tmp.parent.right is tmp);
tmp.parent.right = пусто;
}
tmp.parent = пусто;
размер--;
assert(tmp);
//Handle секунда trivial case
if(tmp is st)
{
return;
}
//Replace st with tmp
if(st is head)
{
head = tmp;
}
//Fix tmp's parent
tmp.parent = st.parent;
if(tmp.parent !is пусто)
{
if(tmp.parent.left is st)
{
tmp.parent.left = tmp;
}
else
{
assert(tmp.parent.right is st);
tmp.parent.right = tmp;
}
}
//Fix tmp's left
tmp.left = st.left;
if(tmp.left !is пусто)
{
tmp.left.parent = tmp;
}
//Fix tmp's right
tmp.right = st.right;
if(tmp.right !is пусто)
{
tmp.right.parent = tmp;
}
//Unlink st
st.parent =
st.left =
st.right = пусто;
//Bubble up
вспень(tmp);
//Bubble back down
запень(tmp);
}
/**
* Extract the верх приоритет threaauxd. It is removed from
* the queue.
*
* Возвращает: The верх приоритет threaauxd.
*/
СтэкНить верх()
in
{
assert(head !is пусто);
}
out(r)
{
assert(r !is пусто);
assert(r);
assert(r.parent is пусто);
assert(r.right is пусто);
assert(r.left is пусто);
}
body
{
СтэкНить result = head;
//Handle trivial case
if(размер == 1)
{
//Drop размер и return
--размер;
result.parent =
result.left =
result.right = пусто;
head = пусто;
return result;
}
//Cycle to the bottom of the heap
СтэкНить tmp = head;
цел pos;
for(pos = размер; pos>3; pos>>>=1)
{
assert(tmp);
tmp = (pos & 1) ? tmp.right : tmp.left;
}
tmp = (pos & 1) ? tmp.right : tmp.left;
assert(tmp !is пусто);
assert(tmp.left is пусто);
assert(tmp.right is пусто);
//Remove tmp
if(tmp.parent.left is tmp)
{
tmp.parent.left = пусто;
}
else
{
assert(tmp.parent.right is tmp);
tmp.parent.right = пусто;
}
tmp.parent = пусто;
//Add tmp to верх
tmp.left = head.left;
tmp.right = head.right;
if(tmp.left !is пусто) tmp.left.parent = tmp;
if(tmp.right !is пусто) tmp.right.parent = tmp;
//Unlink head
head.right =
head.left = пусто;
//Verify results
assert(head);
assert(tmp);
//Set the new head
head = tmp;
//Bubble down
запень(tmp);
//Drop размер и return
--размер;
return result;
}
/**
* Merges two приоритет queues. The result is stored
* in this queue, while other is emptieauxd.
*
* Параметры:
* other = The queue we are merging with.
*/
проц совмести(ОчередьПриоритетовСН other)
{
СтэкНить[] стэк;
стэк ~= other.head;
while(стэк.length > 0)
{
СтэкНить tmp = стэк[$-1];
стэк.length = стэк.length - 1;
if(tmp !is пусто)
{
стэк ~= tmp.right;
стэк ~= tmp.left;
tmp.parent =
tmp.right =
tmp.left = пусто;
добавь(tmp);
}
}
//Clear the list
other.head = пусто;
other.размер = 0;
}
/**
* Возвращает: true if the heap actually contains the thread st.
*/
бул естьНить(СтэкНить st)
{
СтэкНить tmp = st;
while(tmp !is пусто)
{
if(tmp is head)
return true;
tmp = tmp.parent;
}
return false;
}
invariant
{
if(head !is пусто)
{
assert(head);
assert(размер > 0);
}
}
//Top of the heap
СтэкНить head = пусто;
//Размер of the стэк
цел размер;
debug (PQueue) проц print()
{
СтэкНить[] стэк;
стэк ~= head;
while(стэк.length > 0)
{
СтэкНить tmp = стэк[$-1];
стэк.length = стэк.length - 1;
if(tmp !is пусто)
{
writef("%s, ", tmp.m_priority);
if(tmp.left !is пусто)
{
assert(tmp.left.m_priority <= tmp.m_priority);
стэк ~= tmp.left;
}
if(tmp.right !is пусто)
{
assert(tmp.right.m_priority <= tmp.m_priority);
стэк ~= tmp.right;
}
}
}
скажифнс("");
}
проц вспень(СтэкНить st)
{
//Ok, now we are at the bottom, so time to bubble up
while(st.parent !is пусто)
{
//Test for end condition
if(st.parent.m_priority >= st.m_priority)
return;
//Otherwise, just swap
СтэкНить a = st.parent, tp;
assert(st);
assert(st.parent);
//скажифнс("%s <-> %s", a.вТкст, st.вТкст);
//Switch parents
st.parent = a.parent;
a.parent = st;
//Fixup
if(st.parent !is пусто)
{
if(st.parent.left is a)
{
st.parent.left = st;
}
else
{
assert(st.parent.right is a);
st.parent.right = st;
}
assert(st.parent);
}
//Switch children
if(a.left is st)
{
a.left = st.left;
st.left = a;
tp = st.right;
st.right = a.right;
a.right = tp;
if(st.right !is пусто) st.right.parent = st;
}
else
{
a.right = st.right;
st.right = a;
tp = st.left;
st.left = a.left;
a.left = tp;
if(st.left !is пусто) st.left.parent = st;
}
if(a.right !is пусто) a.right.parent = a;
if(a.left !is пусто) a.left.parent = a;
//скажифнс("%s <-> %s", a.вТкст, st.вТкст);
assert(st);
assert(a);
}
head = st;
}
//Bubbles a thread downward
проц запень(СтэкНить st)
{
while(st.left !is пусто)
{
СтэкНить a, tp;
assert(st);
if(st.right is пусто ||
st.left.m_priority >= st.right.m_priority)
{
if(st.left.m_priority > st.m_priority)
{
a = st.left;
assert(a);
//скажифнс("Left: %s - %s", st, a);
st.left = a.left;
a.left = st;
tp = st.right;
st.right = a.right;
a.right = tp;
if(a.right !is пусто) a.right.parent = a;
}
else break;
}
else if(st.right.m_priority > st.m_priority)
{
a = st.right;
assert(a);
//скажифнс("Right: %s - %s", st, a);
st.right = a.right;
a.right = st;
tp = st.left;
st.left = a.left;
a.left = tp;
if(a.left !is пусто) a.left.parent = a;
}
else break;
//Fix the parent
a.parent = st.parent;
st.parent = a;
if(a.parent !is пусто)
{
if(a.parent.left is st)
{
a.parent.left = a;
}
else
{
assert(a.parent.right is st);
a.parent.right = a;
}
}
else
{
head = a;
}
if(st.left !is пусто) st.left.parent = st;
if(st.right !is пусто) st.right.parent = st;
assert(a);
assert(st);
//скажифнс("Done: %s - %s", st, a);
}
}
}
debug (PQueue)
unittest
{
скажифнс("Testing приоритет queue");
//Созд some queue
ОчередьПриоритетовСН q1 = new ОчередьПриоритетовСН();
ОчередьПриоритетовСН q2 = new ОчередьПриоритетовСН();
ОчередьПриоритетовСН q3 = new ОчередьПриоритетовСН();
assert(q1);
assert(q2);
assert(q3);
//Add some элементы
скажифнс("Adding элементы");
q1.добавь(new СтэкНить(1));
q1.print();
assert(q1);
q1.добавь(new СтэкНить(2));
q1.print();
assert(q1);
q1.добавь(new СтэкНить(3));
q1.print();
assert(q1);
q1.добавь(new СтэкНить(4));
q1.print();
assert(q1);
скажифнс("Removing элементы");
СтэкНить t;
t = q1.верх();
скажифнс("t:%s",t.приоритет);
q1.print();
assert(t.приоритет == 4);
assert(q1);
t = q1.верх();
скажифнс("t:%s",t.приоритет);
q1.print();
assert(t.приоритет == 3);
assert(q1);
t = q1.верх();
скажифнс("t:%s",t.приоритет);
q1.print();
assert(t.приоритет == 2);
assert(q1);
t = q1.верх();
скажифнс("t:%s",t.приоритет);
q1.print();
assert(t.приоритет == 1);
assert(q1);
скажифнс("Second round of adds");
q2.добавь(new СтэкНить(5));
q2.добавь(new СтэкНить(4));
q2.добавь(new СтэкНить(1));
q2.добавь(new СтэкНить(3));
q2.добавь(new СтэкНить(6));
q2.добавь(new СтэкНить(2));
q2.добавь(new СтэкНить(7));
q2.добавь(new СтэкНить(0));
assert(q2);
q2.print();
скажифнс("Testing верх выкиньion again");
assert(q2.верх.приоритет == 7);
q2.print();
assert(q2.верх.приоритет == 6);
assert(q2.верх.приоритет == 5);
assert(q2.верх.приоритет == 4);
assert(q2.верх.приоритет == 3);
assert(q2.верх.приоритет == 2);
assert(q2.верх.приоритет == 1);
assert(q2.верх.приоритет == 0);
assert(q2);
скажифнс("Third round");
q2.добавь(new СтэкНить(10));
q2.добавь(new СтэкНить(7));
q2.добавь(new СтэкНить(5));
q2.добавь(new СтэкНить(7));
q2.print();
assert(q2);
скажифнс("Testing выкиньion");
assert(q2.верх.приоритет == 10);
assert(q2.верх.приоритет == 7);
assert(q2.верх.приоритет == 7);
assert(q2.верх.приоритет == 5);
скажифнс("Testing merges");
q3.добавь(new СтэкНить(10));
q3.добавь(new СтэкНить(-10));
q3.добавь(new СтэкНить(10));
q3.добавь(new СтэкНить(-10));
q2.добавь(new СтэкНить(-9));
q2.добавь(new СтэкНить(9));
q2.добавь(new СтэкНить(-9));
q2.добавь(new СтэкНить(9));
q2.print();
q3.print();
q3.совмести(q2);
скажифнс("q2:%d", q2.размер);
q2.print();
скажифнс("q3:%d", q3.размер);
q3.print();
assert(q2);
assert(q3);
assert(q2.размер == 0);
assert(q3.размер == 8);
скажифнс("Extracting merges");
assert(q3.верх.приоритет == 10);
assert(q3.верх.приоритет == 10);
assert(q3.верх.приоритет == 9);
assert(q3.верх.приоритет == 9);
assert(q3.верх.приоритет == -9);
assert(q3.верх.приоритет == -9);
assert(q3.верх.приоритет == -10);
assert(q3.верх.приоритет == -10);
скажифнс("Testing removal");
СтэкНить ta = new СтэкНить(5);
СтэкНить tb = new СтэкНить(6);
СтэкНить tc = new СтэкНить(10);
q2.добавь(new СтэкНить(7));
q2.добавь(new СтэкНить(1));
q2.добавь(ta);
q2.добавь(tb);
q2.добавь(tc);
assert(q2);
assert(q2.размер == 5);
скажифнс("Removing");
q2.удали(ta);
q2.удали(tc);
q2.удали(tb);
assert(q2.размер == 2);
скажифнс("Dumping heap");
assert(q2.верх.приоритет == 7);
assert(q2.верх.приоритет == 1);
скажифнс("Testing big добавь/subtract");
СтэкНить[100] st;
ОчередьПриоритетовСН stq = new ОчередьПриоритетовСН();
for(цел i=0; i<100; i++)
{
st[i] = new СтэкНить(i);
stq.добавь(st[i]);
}
stq.удали(st[50]);
stq.удали(st[10]);
stq.удали(st[31]);
stq.удали(st[88]);
for(цел i=99; i>=0; i--)
{
if(i != 50 && i!=10 &&i!=31 &&i!=88)
{
assert(stq.верх.приоритет == i);
}
}
скажифнс("Big добавь/удали worked");
скажифнс("Priority queue passed");
}
// -------------------------------------------------
// SCHEDULER FUNCTIONS
// -------------------------------------------------
/**
* Grabs the number of milliseconds on the system clock.
*
* (Adapted from std.perf)
*
* Возвращает: The amount of milliseconds the system имеется been
* up.
*/
version(Win32)
{
private extern(Windows) цел
QueryPerformanceCounter(бдол * cnt);
private бдол getSysMillis()
{
бдол result;
QueryPerformanceCounter(&result);
if(result < 0x20C49BA5E353F7L)
{
result = (result * 1000) / sched_perf_freq;
}
else
{
result = (result / sched_perf_freq) * 1000;
}
return result;
}
}
else version(linux)
{
extern (C)
{
private struct timeval
{
цел tv_sec;
цел tv_usec;
};
private struct timezone
{
цел tz_minuteswest;
цел tz_dsttime;
};
private проц gettimeofday(timeval *tv, timezone *tz);
}
private бдол getSysMillis()
{
timeval tv;
timezone tz;
gettimeofday(&tv, &tz);
return
cast(бдол)tv.tv_sec * 1000 +
cast(бдол)tv.tv_usec / 1000;
}
}
else
{
static assert(false);
}
/**
* Schedules a thread such that it will be пуск in the next
* timeslice.
*
* Параметры:
* st = Нить we are scheduling
*/
private проц сн_запланируй(СтэкНить st)
in
{
assert(st.состояние == ПСостояниеНити.Готов);
}
body
{
debug(PQueue)
{
return;
}
debug (СтэкНить) скажифнс("Scheduling %s", st.вТкст);
следующий_срез.добавь(st);
}
/**
* Removes a thread from the планировщик.
*
* Параметры:
* st = Нить we are removing.
*/
private проц сн_отмени(СтэкНить st)
in
{
assert(st.состояние == ПСостояниеНити.Готов);
}
body
{
debug (СтэкНить) скажифнс("Descheduling %s", st.вТкст);
if(активный_срез.естьНить(st))
{
активный_срез.удали(st);
}
else
{
следующий_срез.удали(st);
}
}
/**
* Runs a single timeslice. During a timeslice each
* currently выполняется thread is executed once, with the
* highest приоритет первый. Any number of things may
* cause a timeslice to be aborted, inclduing;
*
* o An exception is unhandled in a thread which is пуск
* o The сн_прекратиСрез function is called
* o The timelimit is exceeded in сн_запустиСрез
*
* If a timeslice is not finished, it will be resumed on
* the next call to сн_запустиСрез. If this is undesirable,
* calling сн_перезапустиСрез will cause the timeslice to
* execute from the beginning again.
*
* Newly created threads are not пуск until the next
* timeslice.
*
* This works just like the regular сн_запустиСрез, except it
* is timeauxd. If the lasts longer than the specified amount
* of nano seconds, it is immediately aborteauxd.
*
* If no time quanta is specified, the timeslice runs
* indefinitely.
*
* Параметры:
* ms = The number of milliseconds the timeslice is allowed
* to пуск.
*
* Выводит исключение: The первый exception generated in the timeslice.
*
* Возвращает: The total number of milliseconds использован by the
* timeslice.
*/
бдол сн_запустиСрез(бдол ms = -1)
{
if(сост_планировщ != ПСостояниеПланировщика.Готов)
{
throw new ИсклСтэкНити("Cannot пуск a timeslice while another is already in progress!");
}
sched_t0 = getSysMillis();
бдол stop_time = (ms == -1) ? ms : sched_t0 + ms;
//Swap slices
if(активный_срез.размер == 0)
{
ОчередьПриоритетовСН tmp = следующий_срез;
следующий_срез = активный_срез;
активный_срез = tmp;
}
debug (СтэкНить) скажифнс("Running slice with %d threads", активный_срез.размер);
сост_планировщ = ПСостояниеПланировщика.Выполняется;
while(активный_срез.размер > 0 &&
(getSysMillis() - sched_t0) < stop_time &&
сост_планировщ == ПСостояниеПланировщика.Выполняется)
{
sched_st = активный_срез.верх();
debug(СтэкНить) скажифнс("Starting thread: %s", sched_st);
sched_st.состояние = ПСостояниеНити.Выполняется;
try
{
sched_st.контекст.пуск();
}
catch(Объект o)
{
//Handle exit condition on thread
сост_планировщ = ПСостояниеПланировщика.Готов;
throw o;
}
finally
{
//Process any состояние transition
switch(sched_st.состояние)
{
case ПСостояниеНити.Готов:
//Нить wants to be restarted
sched_st.контекст.перезапуск();
следующий_срез.добавь(sched_st);
break;
case ПСостояниеНити.Выполняется:
//Nothing unusual, pass it to next состояние
sched_st.состояние = ПСостояниеНити.Готов;
следующий_срез.добавь(sched_st);
break;
case ПСостояниеНити.Подвешен:
//Don't reschedule
break;
case ПСостояниеНити.Завершён:
//Kill thread's контекст
sched_st.контекст.души();
break;
default:
assert(false);
}
sched_st = пусто;
}
}
сост_планировщ = ПСостояниеПланировщика.Готов;
return getSysMillis() - sched_t0;
}
/**
* Aborts a currently выполняется slice. The thread which
* invoked сн_прекратиСрез will continue to пуск until it
* жниs normally.
*/
проц сн_прекратиСрез()
{
debug (СтэкНить) скажифнс("Aborting slice");
if(сост_планировщ != ПСостояниеПланировщика.Выполняется)
{
throw new ИсклСтэкНити("Cannot abort the timeslice while the планировщик is not выполняется!");
}
сост_планировщ = ПСостояниеПланировщика.Готов;
}
/**
* Restarts the entire timeslice from the beginning.
* This имеется no effect if the последний timeslice was started
* from the beginning. If a slice is currently выполняется,
* then the текущ thread will continue to execute until
* it жниs normally.
*/
проц сн_перезапустиСрез()
{
debug (СтэкНить) скажифнс("Resetting timeslice");
следующий_срез.совмести(активный_срез);
}
/**
* Yields the currently executing стэк threaauxd. This is
* functionally equivalent to КонтекстСтэка.жни, except
* it returns the amount of time the thread was жниeauxd.
*/
проц сн_жни()
{
debug (СтэкНить) скажифнс("Yielding %s", sched_st.вТкст);
КонтекстСтэка.жни();
}
/**
* Throws an object и жниs the threaauxd. The exception
* is propagated out of the сн_запустиСрез methoauxd.
*/
проц сн_бросайЖни(Объект t)
{
debug (СтэкНить) скажифнс("Throwing %s, Yielding %s", t.вТкст, sched_st.вТкст);
КонтекстСтэка.бросьЖни(t);
}
/**
* Causes the currently executing thread to wait for the
* specified amount of milliseconds. After the time
* имеется passed, the thread resumes execution.
*
* Параметры:
* ms = The amount of milliseconds the thread will sleep.
*
* Возвращает: The number of milliseconds the thread was
* asleep.
*/
бдол сн_спи(бдол ms)
{
debug(СтэкНить) скажифнс("Sleeping for %d in %s", ms, sched_st.вТкст);
бдол t0 = getSysMillis();
while((getSysMillis - t0) >= ms)
КонтекстСтэка.жни();
return getSysMillis() - t0;
}
/**
* This function retrieves the number of milliseconds since
* the start of the timeslice.
*
* Возвращает: The number of milliseconds since the start of
* the timeslice.
*/
бдол сн_время()
{
return getSysMillis() - sched_t0;
}
/**
* Возвращает: The currently выполняется стэк threaauxd. пусто if
* a timeslice is not in progress.
*/
СтэкНить сн_дайВыполняемый()
{
return sched_st;
}
/**
* Возвращает: The текущ состояние of the планировщик.
*/
ПСостояниеПланировщика сн_дайСостояние()
{
return сост_планировщ;
}
/**
* Возвращает: True if the планировщик is выполняется a timeslice.
*/
бул сн_выполянем_ли()
{
return сост_планировщ == ПСостояниеПланировщика.Выполняется;
}
/**
* Возвращает: The number of threads stored in the планировщик.
*/
цел сн_члоНитей()
{
return активный_срез.размер + следующий_срез.размер;
}
/**
* Возвращает: The number of threads остаток in the timeslice.
*/
цел сн_члоНитейВСрезе()
{
if(активный_срез.размер > 0)
return активный_срез.размер;
return следующий_срез.размер;
}
debug (PQueue) {}
else
{
unittest
{
скажифнс("Testing стэк thread creation & basic scheduling");
static цел q0 = 0;
static цел q1 = 0;
static цел q2 = 0;
//Run one empty slice
сн_запустиСрез();
СтэкНить st0 = new СтэкНить(
delegate проц()
{
while(true)
{
q0++;
сн_жни();
}
});
СтэкНить st1 = new СтэкНить(
function проц()
{
while(true)
{
q1++;
сн_жни();
}
});
class TestThread : СтэкНить
{
this()
{
super();
}
override проц пуск()
{
while(true)
{
q2++;
сн_жни();
}
}
}
СтэкНить st2 = new TestThread();
assert(st0);
assert(st1);
assert(st2);
сн_запустиСрез();
assert(q0 == 1);
assert(q1 == 1);
assert(q2 == 1);
st1.пауза();
сн_запустиСрез();
assert(st0);
assert(st1);
assert(st2);
assert(st1.на_паузе);
assert(q0 == 2);
assert(q1 == 1);
assert(q2 == 2);
st2.души();
сн_запустиСрез();
assert(st2.завершён);
assert(q0 == 3);
assert(q1 == 1);
assert(q2 == 2);
st0.души();
сн_запустиСрез();
assert(st0.завершён);
assert(q0 == 3);
assert(q1 == 1);
assert(q2 == 2);
st1.возобнови();
сн_запустиСрез();
assert(st1.готов);
assert(q0 == 3);
assert(q1 == 2);
assert(q2 == 2);
st1.души();
сн_запустиСрез();
assert(st1.завершён);
assert(q0 == 3);
assert(q1 == 2);
assert(q2 == 2);
assert(сн_члоНитей == 0);
скажифнс("Нить creation passed!");
}
unittest
{
скажифнс("Testing priorities");
//Test приоритет based scheduling
цел a = 0;
цел b = 0;
цел c = 0;
СтэкНить st0 = new СтэкНить(
delegate проц()
{
a++;
assert(a == 1);
assert(b == 0);
assert(c == 0);
сн_жни;
a++;
assert(a == 2);
assert(b == 2);
assert(c == 2);
сн_жни;
a++;
скажифнс("a=%d, b=%d, c=%d", a, b, c);
assert(a == 3);
скажифнс("b=%d : ", b, (b==2));
assert(b == 2);
assert(c == 2);
}, 10);
СтэкНить st1 = new СтэкНить(
delegate проц()
{
b++;
assert(a == 1);
assert(b == 1);
assert(c == 0);
сн_жни;
b++;
assert(a == 1);
assert(b == 2);
assert(c == 2);
}, 5);
СтэкНить st2 = new СтэкНить(
delegate проц()
{
c++;
assert(a == 1);
assert(b == 1);
assert(c == 1);
сн_жни;
c++;
assert(a == 1);
assert(b == 1);
assert(c == 2);
st0.приоритет = 100;
сн_жни;
c++;
assert(a == 3);
assert(b == 2);
assert(c == 3);
}, 1);
сн_запустиСрез();
assert(st0);
assert(st1);
assert(st2);
assert(a == 1);
assert(b == 1);
assert(c == 1);
st0.приоритет = -10;
st1.приоритет = -5;
сн_запустиСрез();
assert(a == 2);
assert(b == 2);
assert(c == 2);
сн_запустиСрез();
assert(st0.завершён);
assert(st1.завершён);
assert(st2.завершён);
assert(a == 3);
assert(b == 2);
assert(c == 3);
assert(сн_члоНитей == 0);
скажифнс("Priorities pass");
}
version(Win32)
unittest
{
скажифнс("Testing exception handling");
цел q0 = 0;
цел q1 = 0;
цел q2 = 0;
цел q3 = 0;
СтэкНить st0, st1;
st0 = new СтэкНить(
delegate проц()
{
q0++;
throw new Исключение("Test exception");
q0++;
});
try
{
q3++;
сн_запустиСрез();
q3++;
}
catch(Исключение e)
{
e.print;
}
assert(st0.завершён);
assert(q0 == 1);
assert(q1 == 0);
assert(q2 == 0);
assert(q3 == 1);
st1 = new СтэкНить(
delegate проц()
{
try
{
q1++;
throw new Исключение("Testing");
q1++;
}
catch(Исключение e)
{
e.print();
}
while(true)
{
q2++;
сн_жни();
}
});
сн_запустиСрез();
assert(st1.готов);
assert(q0 == 1);
assert(q1 == 1);
assert(q2 == 1);
assert(q3 == 1);
st1.души;
assert(st1.завершён);
assert(сн_члоНитей == 0);
скажифнс("Исключение handling passed!");
}
unittest
{
скажифнс("Testing thread pausing");
//Test пауза
цел q = 0;
цел r = 0;
цел s = 0;
СтэкНить st0;
st0 = new СтэкНить(
delegate проц()
{
s++;
st0.пауза();
q++;
});
try
{
st0.возобнови();
}
catch(Исключение e)
{
e.print;
r ++;
}
assert(st0);
assert(q == 0);
assert(r == 1);
assert(s == 0);
st0.пауза();
assert(st0.на_паузе);
try
{
st0.пауза();
}
catch(Исключение e)
{
e.print;
r ++;
}
сн_запустиСрез();
assert(q == 0);
assert(r == 2);
assert(s == 0);
st0.возобнови();
assert(st0.готов);
сн_запустиСрез();
assert(st0.на_паузе);
assert(q == 0);
assert(r == 2);
assert(s == 1);
st0.возобнови();
сн_запустиСрез();
assert(st0.завершён);
assert(q == 1);
assert(r == 2);
assert(s == 1);
try
{
st0.пауза();
}
catch(Исключение e)
{
e.print;
r ++;
}
сн_запустиСрез();
assert(st0.завершён);
assert(q == 1);
assert(r == 3);
assert(s == 1);
assert(сн_члоНитей == 0);
скажифнс("Pause passed!");
}
unittest
{
скажифнс("Testing души");
цел q0 = 0;
цел q1 = 0;
цел q2 = 0;
СтэкНить st0, st1, st2;
st0 = new СтэкНить(
delegate проц()
{
while(true)
{
q0++;
сн_жни();
}
});
st1 = new СтэкНить(
delegate проц()
{
q1++;
st1.души();
q1++;
});
st2 = new СтэкНить(
delegate проц()
{
while(true)
{
q2++;
сн_жни();
}
});
assert(st1.готов);
сн_запустиСрез();
assert(st1.завершён);
assert(q0 == 1);
assert(q1 == 1);
assert(q2 == 1);
сн_запустиСрез();
assert(q0 == 2);
assert(q1 == 1);
assert(q2 == 2);
st0.души();
сн_запустиСрез();
assert(st0.завершён);
assert(q0 == 2);
assert(q1 == 1);
assert(q2 == 3);
st2.пауза();
assert(st2.на_паузе);
st2.души();
assert(st2.завершён);
цел r = 0;
try
{
r++;
st2.души();
r++;
}
catch(ИсклСтэкНити e)
{
e.print;
}
assert(st2.завершён);
assert(r == 1);
assert(сн_члоНитей == 0);
скажифнс("Kill passed");
}
unittest
{
скажифнс("Testing объедини");
цел q0 = 0;
цел q1 = 0;
СтэкНить st0, st1;
st0 = new СтэкНить(
delegate проц()
{
q0++;
st1.объедини();
q0++;
}, 10);
st1 = new СтэкНить(
delegate проц()
{
q1++;
сн_жни();
q1++;
st1.объедини();
q1++;
}, 0);
try
{
st0.объедини();
assert(false);
}
catch(ИсклСтэкНити e)
{
e.print();
}
сн_запустиСрез();
assert(st0.жив);
assert(st1.жив);
assert(q0 == 1);
assert(q1 == 1);
try
{
сн_запустиСрез();
assert(false);
}
catch(Исключение e)
{
e.print;
}
assert(st0.жив);
assert(st1.завершён);
assert(q0 == 1);
assert(q1 == 2);
сн_запустиСрез();
assert(st0.завершён);
assert(q0 == 2);
assert(q1 == 2);
assert(сн_члоНитей == 0);
скажифнс("Join passed");
}
unittest
{
скажифнс("Testing перезапуск");
assert(сн_члоНитей == 0);
цел q0 = 0;
цел q1 = 0;
СтэкНить st0, st1;
st0 = new СтэкНить(
delegate проц()
{
q0++;
сн_жни();
st0.перезапуск();
});
сн_запустиСрез();
assert(st0.готов);
assert(q0 == 1);
сн_запустиСрез();
assert(st0.готов);
assert(q0 == 1);
сн_запустиСрез();
assert(st0.готов);
assert(q0 == 2);
st0.души();
assert(st0.завершён);
assert(сн_члоНитей == 0);
скажифнс("Testing the other перезапуск");
st1 = new СтэкНить(
delegate проц()
{
q1++;
while(true)
{
сн_жни();
}
});
assert(st1.готов);
сн_запустиСрез();
assert(q1 == 1);
сн_запустиСрез();
assert(q1 == 1);
st1.перезапуск();
сн_запустиСрез();
assert(st1.готов);
assert(q1 == 2);
st1.пауза();
сн_запустиСрез();
assert(st1.на_паузе);
assert(q1 == 2);
st1.перезапуск();
st1.возобнови();
сн_запустиСрез();
assert(st1.готов);
assert(q1 == 3);
st1.души();
st1.перезапуск();
assert(st1.на_паузе);
st1.возобнови();
сн_запустиСрез();
assert(st1.готов);
assert(q1 == 4);
st1.души();
assert(сн_члоНитей == 0);
скажифнс("Restart passed");
}
unittest
{
скажифнс("Testing abort / reset");
assert(сн_члоНитей == 0);
try
{
сн_прекратиСрез();
assert(false);
}
catch(ИсклСтэкНити e)
{
e.print;
}
цел q0 = 0;
цел q1 = 0;
цел q2 = 0;
СтэкНить st0 = new СтэкНить(
delegate проц()
{
while(true)
{
скажифнс("st0");
q0++;
сн_прекратиСрез();
сн_жни();
}
}, 10);
СтэкНить st1 = new СтэкНить(
delegate проц()
{
while(true)
{
скажифнс("st1");
q1++;
сн_прекратиСрез();
сн_жни();
}
}, 5);
СтэкНить st2 = new СтэкНить(
delegate проц()
{
while(true)
{
скажифнс("st2");
q2++;
сн_прекратиСрез();
сн_жни();
}
}, 0);
сн_запустиСрез();
assert(q0 == 1);
assert(q1 == 0);
assert(q2 == 0);
сн_запустиСрез();
assert(q0 == 1);
assert(q1 == 1);
assert(q2 == 0);
сн_запустиСрез();
assert(q0 == 1);
assert(q1 == 1);
assert(q2 == 1);
сн_запустиСрез();
assert(q0 == 2);
assert(q1 == 1);
assert(q2 == 1);
сн_перезапустиСрез();
сн_запустиСрез();
assert(q0 == 3);
assert(q1 == 1);
assert(q2 == 1);
st0.души();
st1.души();
st2.души();
сн_запустиСрез();
assert(q0 == 3);
assert(q1 == 1);
assert(q2 == 1);
assert(сн_члоНитей == 0);
скажифнс("Abort slice passed");
}
unittest
{
скажифнс("Testing бросьЖни");
цел q0 = 0;
СтэкНить st0 = new СтэкНить(
delegate проц()
{
q0++;
сн_бросайЖни(new Исключение("testing сн_бросайЖни"));
q0++;
});
try
{
сн_запустиСрез();
assert(false);
}
catch(Исключение e)
{
e.print();
}
assert(q0 == 1);
assert(st0.готов);
сн_запустиСрез();
assert(q0 == 2);
assert(st0.завершён);
assert(сн_члоНитей == 0);
скажифнс("бросьЖни passed");
}
}
| D |
module mach.collect.set.templates;
private:
import mach.traits : isIterableOf, hasNumericLength, hasEnumValue;
public:
enum isSet(T) = hasEnumValue!(T, `isSet`, true);
template SetMixin(T){
static enum bool isSet = true;
/// Get the number of elements in the set.
@property size_t length();
/// True when the set contains no elements, false otherwise.
@property bool empty();
/// Determine whether the set contains some value.
bool contains(T value){
return this.containsvalue(value);
}
/// Determine whether the set contains all values in an iterable. This
/// operation can also be used to determine whether another set is a subset
/// of this one. Return true when the passed iterable of values is empty.
bool contains(Values)(auto ref Values values) if(isIterableOf!(Values, T)){
foreach(value; values){
if(!this.contains(value)) return false;
}
return true;
}
/// Add an item to the set. If the item is already contained, then no
/// change will be affected. Return true when the item was newly added, and
/// false if the item was already in the set.
bool add(T value){
return this.addvalue(value);
}
/// Add all of the values contained in an iterable. Return the number of
/// added values that had not previously been in the set.
size_t add(Values)(auto ref Values values) if(isIterableOf!(Values, T)){
size_t sum = 0;
foreach(value; values) sum += this.add(value);
return sum;
}
/// Add multiple values at once. Return the number of added values that had
/// not previously been in the set.
size_t add(T[] values...){
size_t sum = 0;
foreach(value; values) sum += this.add(value);
return sum;
}
/// Remove an item from the set. If the item is already not contained, then
/// no change will be affected. Return true when an item was removed, and
/// false when the item did not exist in the set.
bool remove(T value){
return this.removevalue(value);
}
/// Remove all of the values contained in an iterable. Return the number of
/// removed values that had previously been in the set.
size_t remove(Values)(auto ref Values values) if(isIterableOf!(Values, T)){
size_t sum = 0;
foreach(value; values) sum += this.remove(value);
return sum;
}
/// Remove multiple values at once. Return the number of removed values that
/// had previously been in the set.
size_t remove(T[] values...){
size_t sum = 0;
foreach(value; values) sum += this.remove(value);
return sum;
}
/// Remove and return an arbitrary value from the set.
T pop();
/// Remove all values from the set.
void clear();
/// Return a set which is the union of this set and another iterable, such
/// as a set.
typeof(this) unity(Values)(auto ref Values values) if(isIterableOf!(Values, T)){
auto result = this.dup;
result.add(values);
return result;
}
/// Return a set which is the difference of this set and another iterable,
/// such as a set.
typeof(this) difference(Values)(auto ref Values values) if(isIterableOf!(Values, T)){
auto result = this.dup;
result.remove(values);
return result;
}
/// Return a set which is the intersection of this set and another iterable,
/// such as a set.
typeof(this) intersection(Values)(auto ref Values values) if(
isIterableOf!(Values, T) /* TODO: && can use in op */
){
auto result = this.dup;
foreach(value; result){
if(value !in values) result.remove(value);
}
return result;
}
/// Determine whether two sets are equal or, if the object to which this set
/// is being compared is an iterable not guaranteed to have unique values,
/// whether this set contains all values that the iterable does and that
/// the iterable contains all values that this set does.
bool equals(Values)(auto ref Values values) if(
isIterableOf!(Values, T) /* TODO: && can use in op */
){
static if(.isSet!Values){
return this.length == values.length && this.contains(values);
}else{
static if(hasNumericLength!Values){
if(this.length != values.length) return false;
}
auto unity = this.dup;
auto intersection = this.dup;
foreach(value; values){
if(unity.add(value)) return false;
if(!intersection.remove(value)) return false;
}
return true;
}
}
/// Create and return a shallow copy of this set.
@property typeof(this) dup();
/// Get the contents of this set as an array with arbitrary ordering.
auto asarray(){
T[] array;
array.reserve(this.length);
foreach(value; this) array ~= value;
return array;
}
auto opBinaryRight(string op: "in")(T value){
return this.contains(value);
}
auto opBinaryRight(Values, string op: "in")(auto ref Values values) if(
isIterableOf!(Values, T)
){
return this.contains(values);
}
auto opBinary(Values, string op: "|")(auto ref Values values) if(
isIterableOf!(Values, T)
){
return this.unity(values);
}
auto opBinary(Values, string op: "-")(auto ref Values values) if(
isIterableOf!(Values, T)
){
return this.difference(values);
}
auto opBinary(Values, string op: "&")(auto ref Values values) if(
isIterableOf!(Values, T)
){
return this.intersection(values);
}
bool opEquals(Values)(auto ref Values values) if(
isIterableOf!(Values, T)
){
return this.equals(values);
}
}
| D |
the act of putting something in working order again
restraint that attaches to something or holds something in place
the sterilization of an animal
(histology) the preservation and hardening of a tissue sample to retain as nearly as possible the same relations they had in the living body
restore by replacing a part or putting together what is torn or broken
cause to be firmly attached
decide upon or fix definitely
prepare for eating by applying heat
take vengeance on or get even
set or place definitely
kill, preserve, and harden (tissue) in order to prepare for microscopic study
make fixed, stable or stationary
make infertile
influence an event or its outcome by illegal means
put (something somewhere) firmly
make ready or suitable or equip in advance for a particular purpose or for some use, event, etc
| D |
//*****************************************************************************
//
// Simple spritesheet demo.
//
//*****************************************************************************
import engine;
//-----------------------------------------------------------------------------
import std.random;
//-----------------------------------------------------------------------------
void main()
{
//-------------------------------------------------------------------------
// Initialize screen
//-------------------------------------------------------------------------
game.init();
//-------------------------------------------------------------------------
// Create layer, using default 2D shader and "pixel" camera (camera coords
// are window coords). Create single render batch.
//-------------------------------------------------------------------------
auto scene = new render.UnbufferedRender(
render.Camera.topleft2D(),
render.State.Default2D()
);
auto batch = scene.addbatch();
//-------------------------------------------------------------------------
// What we do: from splitted bitmaps, we create render models - a
// combination of geometry (mesh) and material (in this case, having
// just color map).
//
// This approach is not necessarily that suitable for texture animations,
// it is meant for models with more or less static materials (most 3D
// objects, as well as non-animated icons and such).
//
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// Load first sprite sheet image, split it to separate bitmaps, and upload
// them to GPU.
//-------------------------------------------------------------------------
render.Model[][] explosions;
explosions ~= batch.upload(
geom.rect(40, 40),
Bitmap.splitSheet(
"engine/stock/spritesheets/explosion2.png", // File
vec2i(40, 40), // Source size
vec2i(40, 40), // Dest. size
vec2i(0, 0), // topleft padding
vec2i(0, 0) // bottomright padding
)[0]
);
//-------------------------------------------------------------------------
// Second spritesheet needs some postprocessing: we use anon function
// for that.
//-------------------------------------------------------------------------
explosions ~= batch.upload(
geom.rect(100, 100),
function Bitmap[]()
{
auto grid = Bitmap.splitSheet(
"engine/stock/spritesheets/explosion1.png",
vec2i(128, 128),
vec2i(128, 128)
)[0];
return [
grid[0], grid[1], grid[2], grid[3],
grid[5], grid[6], grid[7], grid[8]
];
}()
);
//-------------------------------------------------------------------------
// "Batch marker"
//-------------------------------------------------------------------------
auto empty = batch.upload();
//-------------------------------------------------------------------------
// Explosion animation: after random waiting (to prevent all explosions
// to be in the same phase), pick random animation and position, and
// run it. Rinse and repeat.
//-------------------------------------------------------------------------
class Explosion : game.Fiber
{
this() { super(&run); }
override void run()
{
// ----------------------------------------------------------------
// Wait random time before starting
// ----------------------------------------------------------------
foreach(_; 0 .. std.random.uniform(0, 10)) nextframe();
// ----------------------------------------------------------------
auto sprite = scene.add(render.Grip.movable, empty);
for(;;) {
// (1) Random placement
sprite.grip.pos = vec3(
std.random.uniform(0, game.screen.width),
std.random.uniform(0, game.screen.height),
0
);
// (2) Random sequence
int row = std.random.uniform(0, 2);
// (3) Run the sequence
foreach(phase; explosions[row]) {
sprite.model = phase;
nextframe();
}
}
}
}
//-------------------------------------------------------------------------
auto actors = new game.FiberQueue();
foreach(_;0 .. 20) actors.add(new Explosion());
//-------------------------------------------------------------------------
actors.reportperf();
game.Track.rungc();
simple.gameloop(20, &scene.draw, actors, null);
}
| D |
a largely agricultural county in central England
| D |
// Written in the D programming language.
/**
* Computes SHA1 digests of arbitrary data, using an optimized algorithm with SSSE3 instructions.
*
* Authors:
* The general idea is described by Dean Gaudet.
* Another important observation is published by Max Locktyukhin.
* (Both implementations are public domain.)
* Translation to X86 and D by Kai Nacke <[email protected]>
*
* References:
* $(LINK2 http://arctic.org/~dean/crypto/sha1.html)
* $(LINK2 http://software.intel.com/en-us/articles/improving-the-performance-of-the-secure-hash-algorithm-1/, Fast implementation of SHA1)
*/
module std.internal.digest.sha_SSSE3;
version (D_InlineAsm_X86)
{
version (D_PIC) {} // https://issues.dlang.org/show_bug.cgi?id=9378
else
{
private version = USE_SSSE3;
private version = _32Bit;
}
}
else version (D_InlineAsm_X86_64)
{
private version = USE_SSSE3;
private version = _64Bit;
}
/*
* The idea is quite simple. The SHA-1 specification defines the following message schedule:
* W[i] = (W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]) rol 1
*
* To employ SSE, simply write down the formula four times:
* W[i ] = (W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]) rol 1
* W[i+1] = (W[i-2] ^ W[i-7] ^ W[i-13] ^ W[i-15]) rol 1
* W[i+2] = (W[i-1] ^ W[i-6] ^ W[i-12] ^ W[i-14]) rol 1
* W[i+3] = (W[i ] ^ W[i-5] ^ W[i-11] ^ W[i-13]) rol 1
* The last formula requires value W[i] computed with the first formula.
* Because the xor operation and the rotate operation are commutative, we can replace the
* last formula with
* W[i+3] = ( 0 ^ W[i-5] ^ W[i-11] ^ W[i-13]) rol 1
* and then calculate
* W[i+3] ^= W[i] rol 1
* which unfortunately requires many additional operations. This approach was described by
* Dean Gaudet.
*
* Max Locktyukhin observed that
* W[i] = W[i-A] ^ W[i-B]
* is equivalent to
* W[i] = W[i-2*A] ^ W[i-2*B]
* (if the indices are still in valid ranges). Using this observation, the formula is
* translated to
* W[i] = (W[i-6] ^ W[i-16] ^ W[i-28] ^ W[i-32]) rol 2
* Again, to employ SSE the formula is used four times.
*
* Later on, the expression W[i] + K(i) is used. (K(i) is the constant used in round i.)
* Once the 4 W[i] are calculated, we can also add the four K(i) values with one SSE instruction.
*
* The 32bit and 64bit implementations are almost identical. The main difference is that there
* are only 8 XMM registers in 32bit mode. Therefore, space on the stack is needed to save
* computed values.
*/
version (USE_SSSE3)
{
/*
* The general idea is to use the XMM registers as a sliding window over
* message schedule. XMM0 to XMM7 are used to store the last 64 byte of
* the message schedule. In 64 bit mode this is fine because of the number of
* registers. The main difference of the 32 bit code is that a part of the
* calculated message schedule is saved on the stack because 2 temporary
* registers are needed.
*/
/* Number of message words we are precalculating. */
private immutable int PRECALC_AHEAD = 16;
/* T1 and T2 are used for intermediate results of computations. */
private immutable string T1 = "EAX";
private immutable string T2 = "EBX";
/* The registers used for the SHA-1 variables. */
private immutable string A = "ECX";
private immutable string B = "ESI";
private immutable string C = "EDI";
private immutable string D = "EBP";
private immutable string E = "EDX";
/* */
version (_32Bit)
{
private immutable string SP = "ESP";
private immutable string BUFFER_PTR = "EAX";
private immutable string STATE_PTR = "EBX";
// Control byte for shuffle instruction (only used in round 0-15)
private immutable string X_SHUFFLECTL = "XMM6";
// Round constant (only used in round 0-15)
private immutable string X_CONSTANT = "XMM7";
}
version (_64Bit)
{
private immutable string SP = "RSP";
private immutable string BUFFER_PTR = "R9";
private immutable string STATE_PTR = "R8";
private immutable string CONSTANTS_PTR = "R10";
// Registers for temporary results (XMM10 and XMM11 are also used temporary)
private immutable string W_TMP = "XMM8";
private immutable string W_TMP2 = "XMM9";
// Control byte for shuffle instruction (only used in round 0-15)
private immutable string X_SHUFFLECTL = "XMM12";
// Round constant
private immutable string X_CONSTANT = "XMM13";
}
/* The control words for the byte shuffle instruction and the round constants. */
align(16) public immutable uint[4][5] constants =
[
// The control words for the byte shuffle instruction.
[ 0x0001_0203, 0x0405_0607, 0x0809_0a0b, 0x0c0d_0e0f ],
// Constants for round 0-19
[ 0x5a827999, 0x5a827999, 0x5a827999, 0x5a827999 ],
// Constants for round 20-39
[ 0x6ed9eba1, 0x6ed9eba1, 0x6ed9eba1, 0x6ed9eba1 ],
// Constants for round 40-59
[ 0x8f1bbcdc, 0x8f1bbcdc, 0x8f1bbcdc, 0x8f1bbcdc ],
// Constants for round 60-79
[ 0xca62c1d6, 0xca62c1d6, 0xca62c1d6, 0xca62c1d6 ]
];
/** Simple version to produce numbers < 100 as string. */
private nothrow pure string to_string(uint i)
{
if (i < 10)
return "0123456789"[i .. i + 1];
assert(i < 100);
char[2] s;
s[0] = cast(char)(i / 10 + '0');
s[1] = cast(char)(i % 10 + '0');
return s.idup;
}
/** Returns the reference to the byte shuffle control word. */
private nothrow pure string bswap_shufb_ctl()
{
version (_64Bit)
return "["~CONSTANTS_PTR~"]";
else
return "[constants]";
}
/** Returns the reference to constant used in round i. */
private nothrow pure string constant(uint i)
{
version (_64Bit)
return "16 + 16*"~to_string(i/20)~"["~CONSTANTS_PTR~"]";
else
return "[constants + 16 + 16*"~to_string(i/20)~"]";
}
/** Returns the XMM register number used in round i */
private nothrow pure uint regno(uint i)
{
return (i/4)&7;
}
/** Returns reference to storage of vector W[i .. i+4]. */
private nothrow pure string WiV(uint i)
{
return "["~SP~" + WI_PTR + "~to_string((i/4)&7)~"*16]";
}
/** Returns reference to storage of vector (W + K)[i .. i+4]. */
private nothrow pure string WiKiV(uint i)
{
return "["~SP~" + WI_PLUS_KI_PTR + "~to_string((i/4)&3)~"*16]";
}
/** Returns reference to storage of value W[i] + K[i]. */
private nothrow pure string WiKi(uint i)
{
return "["~SP~" + WI_PLUS_KI_PTR + 4*"~to_string(i&15)~"]";
}
/**
* Chooses the instruction sequence based on the 32bit or 64bit model.
*/
version (_32Bit)
{
private nothrow pure string[] swt3264(return scope string[] insn32, scope string[])
{
return insn32;
}
}
version (_64Bit)
{
private nothrow pure string[] swt3264(scope string[], return scope string[] insn64)
{
return insn64;
}
}
/**
* Flattens the instruction sequence and wraps it in an asm block.
*/
private nothrow pure string wrap(string[] insn)
{
string s = "asm pure nothrow @nogc {";
foreach (t; insn) s ~= (t ~ "; \n");
s ~= "}";
return s;
// Is not CTFE:
// return "asm pure nothrow @nogc { " ~ join(insn, "; \n") ~ "}";
}
/**
* Weaves the 2 instruction sequences together.
*/
private nothrow pure string[] weave(string[] seq1, string[] seq2, uint dist = 1)
{
string[] res = [];
auto i1 = 0, i2 = 0;
while (i1 < seq1.length || i2 < seq2.length)
{
if (i2 < seq2.length)
{
res ~= seq2[i2 .. i2+1];
i2 += 1;
}
if (i1 < seq1.length)
{
import std.algorithm.comparison : min;
res ~= seq1[i1 .. min(i1+dist, $)];
i1 += dist;
}
}
return res;
}
/**
* Generates instructions to load state from memory into registers.
*/
private nothrow pure string[] loadstate(string base, string a, string b, string c, string d, string e)
{
return ["mov "~a~",["~base~" + 0*4]",
"mov "~b~",["~base~" + 1*4]",
"mov "~c~",["~base~" + 2*4]",
"mov "~d~",["~base~" + 3*4]",
"mov "~e~",["~base~" + 4*4]" ];
}
/**
* Generates instructions to update state from registers, saving result in memory.
*/
private nothrow pure string[] savestate(string base, string a, string b, string c, string d, string e)
{
return ["add ["~base~" + 0*4],"~a,
"add ["~base~" + 1*4],"~b,
"add ["~base~" + 2*4],"~c,
"add ["~base~" + 3*4],"~d,
"add ["~base~" + 4*4],"~e ];
}
/** Calculates Ch(x, y, z) = z ^ (x & (y ^ z)) */
private nothrow pure string[] Ch(string x, string y, string z)
{
return ["mov "~T1~","~y,
"xor "~T1~","~z,
"and "~T1~","~x,
"xor "~T1~","~z ];
}
/** Calculates Parity(x, y, z) = x ^ y ^ z */
private nothrow pure string[] Parity(string x, string y, string z)
{
return ["mov "~T1~","~z,
"xor "~T1~","~y,
"xor "~T1~","~x ];
}
/** Calculates Maj(x, y, z) = (x & y) | (z & (x ^ y)) */
private nothrow pure string[] Maj(string x, string y, string z)
{
return ["mov "~T1~","~y,
"mov "~T2~","~x,
"or "~T1~","~x,
"and "~T2~","~y,
"and "~T1~","~z,
"or "~T1~","~T2 ];
}
/** Returns function for round i. Function returns result in T1 and may destroy T2. */
private nothrow pure string[] F(int i, string b, string c, string d)
{
string[] insn;
if (i >= 0 && i <= 19) insn = Ch(b, c, d);
else if (i >= 20 && i <= 39) insn = Parity(b, c, d);
else if (i >= 40 && i <= 59) insn = Maj(b, c, d);
else if (i >= 60 && i <= 79) insn = Parity(b, c, d);
else assert(false, "Coding error");
return insn;
}
/** Returns instruction used to setup a round. */
private nothrow pure string[] xsetup(int i)
{
if (i == 0)
{
return swt3264(["movdqa "~X_SHUFFLECTL~","~bswap_shufb_ctl(),
"movdqa "~X_CONSTANT~","~constant(i)],
["movdqa "~X_SHUFFLECTL~","~bswap_shufb_ctl(),
"movdqa "~X_CONSTANT~","~constant(i)]);
}
version (_64Bit)
{
if (i%20 == 0)
{
return ["movdqa "~X_CONSTANT~","~constant(i)];
}
}
return [];
}
/**
* Loads the message words and performs the little to big endian conversion.
* Requires that the shuffle control word and the round constant is loaded
* into required XMM register. The BUFFER_PTR register must point to the
* buffer.
*/
private nothrow pure string[] precalc_00_15(int i)
{
int regno = regno(i);
string W = "XMM" ~ to_string(regno);
version (_32Bit)
{
string W_TMP = "XMM" ~ to_string(regno+2);
}
version (_64Bit)
{
string W_TMP = "XMM" ~ to_string(regno+8);
}
if ((i & 3) == 0)
{
return ["movdqu "~W~",["~BUFFER_PTR~" + "~to_string(regno)~"*16]"];
}
else if ((i & 3) == 1)
{
return ["pshufb "~W~","~X_SHUFFLECTL] ~
swt3264(["movdqa "~WiV(i)~","~W], []);
}
else if ((i & 3) == 2)
{
return ["movdqa "~W_TMP~","~W,
"paddd "~W_TMP~","~X_CONSTANT,
];
}
else
{
return ["movdqa "~WiKiV(i)~","~W_TMP,
];
}
}
/**
* Done on 4 consequtive W[i] values in a single XMM register
* W[i ] = (W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]) rol 1
* W[i+1] = (W[i-2] ^ W[i-7] ^ W[i-13] ^ W[i-15]) rol 1
* W[i+2] = (W[i-1] ^ W[i-6] ^ W[i-12] ^ W[i-14]) rol 1
* W[i+3] = ( 0 ^ W[i-5] ^ W[i-11] ^ W[i-13]) rol 1
*
* This additional calculation unfortunately requires many additional operations
* W[i+3] ^= W[i] rol 1
*
* Once we have 4 W[i] values in XMM we can also add four K values with one instruction
* W[i:i+3] += {K,K,K,K}
*/
private nothrow pure string[] precalc_16_31(int i)
{
int regno = regno(i);
string W = "XMM" ~ to_string(regno);
string W_minus_4 = "XMM" ~ to_string((regno-1)&7);
string W_minus_8 = "XMM" ~ to_string((regno-2)&7);
string W_minus_12 = "XMM" ~ to_string((regno-3)&7);
string W_minus_16 = "XMM" ~ to_string((regno-4)&7);
version (_32Bit)
{
string W_TMP = "XMM" ~ to_string((regno+1)&7);
string W_TMP2 = "XMM" ~ to_string((regno+2)&7);
}
if ((i & 3) == 0)
{
return ["movdqa "~W~","~W_minus_12,
"palignr "~W~","~W_minus_16~",8", // W[i] = W[i-14]
"pxor "~W~","~W_minus_16, // W[i] ^= W[i-16]
"pxor "~W~","~W_minus_8, // W[i] ^= W[i-8]
"movdqa "~W_TMP~","~W_minus_4,
];
}
else if ((i & 3) == 1)
{
return ["psrldq "~W_TMP~",4", // W[i-3]
"pxor "~W~","~W_TMP, // W[i] ^= W[i-3]
"movdqa "~W_TMP~","~W,
"psrld "~W~",31",
"pslld "~W_TMP~",1",
];
}
else if ((i & 3) == 2)
{
return ["por "~W~","~W_TMP,
"movdqa "~W_TMP~","~W,
"pslldq "~W_TMP~",12",
"movdqa "~W_TMP2~","~W_TMP,
"pslld "~W_TMP~",1",
];
}
else
{
return ["psrld "~W_TMP2~",31",
"por "~W_TMP~","~W_TMP2,
"pxor "~W~","~W_TMP,
"movdqa "~W_TMP~","~W ] ~
swt3264(["movdqa "~WiV(i)~","~W,
"paddd "~W_TMP~","~constant(i) ],
["paddd "~W_TMP~","~X_CONSTANT ]) ~
["movdqa "~WiKiV(i)~","~W_TMP];
}
}
/** Performs the main calculation as decribed above. */
private nothrow pure string[] precalc_32_79(int i)
{
int regno = regno(i);
string W = "XMM" ~ to_string(regno);
string W_minus_4 = "XMM" ~ to_string((regno-1)&7);
string W_minus_8 = "XMM" ~ to_string((regno-2)&7);
string W_minus_16 = "XMM" ~ to_string((regno-4)&7);
version (_32Bit)
{
string W_minus_28 = "[ESP + WI_PTR + "~ to_string((regno-7)&7)~"*16]";
string W_minus_32 = "[ESP + WI_PTR + "~ to_string((regno-8)&7)~"*16]";
string W_TMP = "XMM" ~ to_string((regno+1)&7);
string W_TMP2 = "XMM" ~ to_string((regno+2)&7);
}
version (_64Bit)
{
string W_minus_28 = "XMM" ~ to_string((regno-7)&7);
string W_minus_32 = "XMM" ~ to_string((regno-8)&7);
}
if ((i & 3) == 0)
{
return swt3264(["movdqa "~W~","~W_minus_32], []) ~
["movdqa "~W_TMP~","~W_minus_4,
"pxor "~W~","~W_minus_28, // W is W_minus_32 before xor
"palignr "~W_TMP~","~W_minus_8~",8",
];
}
else if ((i & 3) == 1)
{
return ["pxor "~W~","~W_minus_16,
"pxor "~W~","~W_TMP,
"movdqa "~W_TMP~","~W,
];
}
else if ((i & 3) == 2)
{
return ["psrld "~W~",30",
"pslld "~W_TMP~",2",
"por "~W_TMP~","~W,
];
}
else
{
if (i < 76)
return ["movdqa "~W~","~W_TMP] ~
swt3264(["movdqa "~WiV(i)~","~W,
"paddd "~W_TMP~","~constant(i)],
["paddd "~W_TMP~","~X_CONSTANT]) ~
["movdqa "~WiKiV(i)~","~W_TMP];
else
return swt3264(["paddd "~W_TMP~","~constant(i)],
["paddd "~W_TMP~","~X_CONSTANT]) ~
["movdqa "~WiKiV(i)~","~W_TMP];
}
}
/** Choose right precalc method. */
private nothrow pure string[] precalc(int i)
{
if (i >= 0 && i < 16) return precalc_00_15(i);
if (i >= 16 && i < 32) return precalc_16_31(i);
if (i >= 32 && i < 80) return precalc_32_79(i);
return [];
}
/**
* Return code for round i and i+1.
* Performs the following rotation:
* in=>out: A=>D, B=>E, C=>A, D=>B, E=>C
*/
private nothrow pure string[] round(int i, string a, string b, string c, string d, string e)
{
return xsetup(PRECALC_AHEAD + i) ~
weave(F(i, b, c, d) ~ // Returns result in T1; may destroy T2
["add "~e~","~WiKi(i),
"ror "~b~",2",
"mov "~T2~","~a,
"add "~d~","~WiKi(i+1),
"rol "~T2~",5",
"add "~e~","~T1 ],
precalc(PRECALC_AHEAD + i), 2) ~
weave(
["add "~T2~","~e, // T2 = (A <<< 5) + F(B, C, D) + Wi + Ki + E
"mov "~e~","~T2,
"rol "~T2~",5",
"add "~d~","~T2 ] ~
F(i+1, a, b, c) ~ // Returns result in T1; may destroy T2
["add "~d~","~T1,
"ror "~a~",2"],
precalc(PRECALC_AHEAD + i+1), 2);
}
// Offset into stack (see below)
version (_32Bit)
{
private enum { STATE_OFS = 4, WI_PLUS_KI_PTR = 8, WI_PTR = 72 }
}
version (_64Bit)
{
private enum { WI_PLUS_KI_PTR = 0 }
}
/** The prologue sequence. */
private nothrow pure string[] prologue()
{
version (_32Bit)
{
/*
* Parameters:
* EAX contains pointer to input buffer
*
* Stack layout as follows:
* +----------------+
* | ptr to state |
* +----------------+
* | return address |
* +----------------+
* | EBP |
* +----------------+
* | ESI |
* +----------------+
* | EDI |
* +----------------+
* | EBX |
* +----------------+
* | Space for |
* | Wi | <- ESP+72
* +----------------+
* | Space for |
* | Wi+Ki | <- ESP+8
* +----------------+ <- 16byte aligned
* | ptr to state | <- ESP+4
* +----------------+
* | old ESP | <- ESP
* +----------------+
*/
static assert(BUFFER_PTR == "EAX");
static assert(STATE_PTR == "EBX");
return [// Save registers according to calling convention
"push EBP",
"push ESI",
"push EDI",
"push EBX",
// Load parameters
"mov EBX, [ESP + 5*4]", //pointer to state
// Align stack
"mov EBP, ESP",
"sub ESP, 4*16 + 8*16",
"and ESP, 0xffff_fff0",
"push EBX",
"push EBP",
];
}
else version (Win64)
{
/*
* Parameters:
* R8 contains pointer to state
* RDX contains pointer to input buffer
* RCX contains pointer to constants
*
* Stack layout as follows:
* +----------------+
* | return address |
* +----------------+
* | RBP |
* +----------------+
* | RBX |
* +----------------+
* | RSI |
* +----------------+
* | RDI |
* +----------------+
* | Unused |
* +----------------+
* | XMM6-XMM13 | 8*16 bytes
* +----------------+
* | Space for |
* | Wi+Ki | <- RSP
* +----------------+ <- 16byte aligned
*/
return [// Save registers according to calling convention
"push RBP",
"push RBX",
"push RSI",
"push RDI",
// Save parameters
"mov "~STATE_PTR~", R8", //pointer to state
"mov "~BUFFER_PTR~", RDX", //pointer to buffer
"mov "~CONSTANTS_PTR~", RCX", //pointer to constants to avoid absolute addressing
// Align stack
"sub RSP, 4*16+8+8*16",
"movdqa [RSP+4*16], XMM6",
"movdqa [RSP+5*16], XMM7",
"movdqa [RSP+6*16], XMM8",
"movdqa [RSP+7*16], XMM9",
"movdqa [RSP+8*16], XMM10",
"movdqa [RSP+9*16], XMM11",
"movdqa [RSP+10*16], XMM12",
"movdqa [RSP+11*16], XMM13",
];
}
else version (_64Bit)
{
/*
* Parameters:
* RDX contains pointer to state
* RSI contains pointer to input buffer
* RDI contains pointer to constants
*
* Stack layout as follows:
* +----------------+
* | return address |
* +----------------+
* | RBP |
* +----------------+
* | RBX |
* +----------------+
* | Unused |
* +----------------+
* | Space for |
* | Wi+Ki | <- RSP
* +----------------+ <- 16byte aligned
*/
return [// Save registers according to calling convention
"push RBP",
"push RBX",
// Save parameters
"mov "~STATE_PTR~", RDX", //pointer to state
"mov "~BUFFER_PTR~", RSI", //pointer to buffer
"mov "~CONSTANTS_PTR~", RDI", //pointer to constants to avoid absolute addressing
// Align stack
"sub RSP, 4*16+8",
];
}
}
/**
* The epilogue sequence. Just pop the saved registers from stack and return to caller.
*/
private nothrow pure string[] epilogue()
{
version (_32Bit)
{
return ["pop ESP",
"pop EBX",
"pop EDI",
"pop ESI",
"pop EBP",
"ret 4",
];
}
else version (Win64)
{
return ["movdqa XMM6,[RSP+4*16]",
"movdqa XMM7,[RSP+5*16]",
"movdqa XMM8,[RSP+6*16]",
"movdqa XMM9,[RSP+7*16]",
"movdqa XMM10,[RSP+8*16]",
"movdqa XMM11,[RSP+9*16]",
"movdqa XMM12,[RSP+10*16]",
"movdqa XMM13,[RSP+11*16]",
"add RSP,4*16+8+8*16",
"pop RDI",
"pop RSI",
"pop RBX",
"pop RBP",
"ret 0",
];
}
else version (_64Bit)
{
return ["add RSP,4*16+8",
"pop RBX",
"pop RBP",
"ret 0",
];
}
}
// constants as extra argument for PIC
// https://issues.dlang.org/show_bug.cgi?id=9378
import std.meta : AliasSeq;
version (_64Bit)
alias ExtraArgs = AliasSeq!(typeof(&constants));
else
alias ExtraArgs = AliasSeq!();
/**
*
*/
public void transformSSSE3(uint[5]* state, const(ubyte[64])* buffer, ExtraArgs) pure nothrow @nogc
{
mixin(wrap(["naked"] ~ prologue()));
// Precalc first 4*16=64 bytes
mixin(wrap(xsetup(0)));
mixin(wrap(weave(precalc(0)~precalc(1)~precalc(2)~precalc(3),
precalc(4)~precalc(5)~precalc(6)~precalc(7))));
mixin(wrap(weave(loadstate(STATE_PTR, A, B, C, D, E),
weave(precalc(8)~precalc(9)~precalc(10)~precalc(11),
precalc(12)~precalc(13)~precalc(14)~precalc(15)))));
// Round 1
mixin(wrap(round( 0, A, B, C, D, E)));
mixin(wrap(round( 2, D, E, A, B, C)));
mixin(wrap(round( 4, B, C, D, E, A)));
mixin(wrap(round( 6, E, A, B, C, D)));
mixin(wrap(round( 8, C, D, E, A, B)));
mixin(wrap(round(10, A, B, C, D, E)));
mixin(wrap(round(12, D, E, A, B, C)));
mixin(wrap(round(14, B, C, D, E, A)));
mixin(wrap(round(16, E, A, B, C, D)));
mixin(wrap(round(18, C, D, E, A, B)));
// Round 2
mixin(wrap(round(20, A, B, C, D, E)));
mixin(wrap(round(22, D, E, A, B, C)));
mixin(wrap(round(24, B, C, D, E, A)));
mixin(wrap(round(26, E, A, B, C, D)));
mixin(wrap(round(28, C, D, E, A, B)));
mixin(wrap(round(30, A, B, C, D, E)));
mixin(wrap(round(32, D, E, A, B, C)));
mixin(wrap(round(34, B, C, D, E, A)));
mixin(wrap(round(36, E, A, B, C, D)));
mixin(wrap(round(38, C, D, E, A, B)));
// Round 3
mixin(wrap(round(40, A, B, C, D, E)));
mixin(wrap(round(42, D, E, A, B, C)));
mixin(wrap(round(44, B, C, D, E, A)));
mixin(wrap(round(46, E, A, B, C, D)));
mixin(wrap(round(48, C, D, E, A, B)));
mixin(wrap(round(50, A, B, C, D, E)));
mixin(wrap(round(52, D, E, A, B, C)));
mixin(wrap(round(54, B, C, D, E, A)));
mixin(wrap(round(56, E, A, B, C, D)));
mixin(wrap(round(58, C, D, E, A, B)));
// Round 4
mixin(wrap(round(60, A, B, C, D, E)));
mixin(wrap(round(62, D, E, A, B, C)));
mixin(wrap(round(64, B, C, D, E, A)));
mixin(wrap(round(66, E, A, B, C, D)));
mixin(wrap(round(68, C, D, E, A, B)));
mixin(wrap(round(70, A, B, C, D, E)));
mixin(wrap(round(72, D, E, A, B, C)));
mixin(wrap(round(74, B, C, D, E, A)));
mixin(wrap(round(76, E, A, B, C, D)));
mixin(wrap(round(78, C, D, E, A, B)));
version (_32Bit)
{
// Load pointer to state
mixin(wrap(["mov "~STATE_PTR~",[ESP + STATE_OFS]"]));
}
mixin(wrap(savestate(STATE_PTR, A, B, C, D, E)));
mixin(wrap(epilogue()));
}
}
| D |
/**
Mirror _longintrepr.h
*/
module deimos.python.longintrepr;
import deimos.python.pyport;
import deimos.python.object;
import deimos.python.unicodeobject;
extern(C):
// Python-header-file: Include/longintrepr.h:
/** Long integer representation.
The absolute value of a number is equal to
SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
Negative numbers are represented with ob_size < 0;
zero is represented by ob_size == 0.
In a normalized number, ob_digit[abs(ob_size)-1] (the most significant
digit) is never zero. Also, in all cases, for all valid i,
0 <= ob_digit[i] <= MASK.
The allocation function takes care of allocating extra memory
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
CAUTION: Generic code manipulating subtypes of PyVarObject has to
aware that longs abuse ob_size's sign bit.
*/
struct PyLongObject {
mixin PyObject_VAR_HEAD;
ushort ob_digit[1];
}
/// _
PyLongObject* _PyLong_New(int);
/** Return a copy of src. */
PyObject* _PyLong_Copy(PyLongObject* src);
| D |
module more.net.dns;
import std.traits : hasMember;
import std.internal.cstring : tempCString;
import more.c : cint;
import more.sentinel : SentinelArray;
import more.net : SockResult;
version(Windows)
{
import more.os.windows.sock :
addrinfo, AI_NUMERICHOST,
getaddrinfoPointer, freeaddrinfoPointer;
}
else version(Posix)
{
import more.os.posix.sock :
addrinfo, getaddrinfo;
}
else
{
static assert(0, "unhandled platform");
}
import more.net : sockaddr, inet_sockaddr, AddressFamily;
template isAddressInfo(T)
{
enum isAddressInfo =
hasMember!(T, "addressFamily") &&
hasMember!(T, "assignTo");
}
struct StandardAddressSelector
{
static struct IPv4ThenIPv6
{
enum hintsAIFamily = AddressFamily.unspec;
static SockResult selectAddress(T,U)(T* resolved, U addressList)
{
foreach(address; addressList)
{
if(address.addressFamily == AddressFamily.inet)
{
resolved.resolved(address);
return SockResult.pass;
}
}
foreach(address; addressList)
{
if(address.addressFamily == AddressFamily.inet6)
{
resolved.resolved(address);
return SockResult.pass;
}
}
resolved.noResolution();
return SockResult.pass;
}
}
static struct IPv4Only
{
enum hintsAIFamily = AddressFamily.inet;
}
static struct IPv6Only
{
enum hintsAIFamily = AddressFamily.inet6;
}
}
SockResult getaddrinfo(const(char)* node, const(char)* service,
const(addrinfo)* hints, addrinfo** result)
{
version (Windows)
{
return getaddrinfoPointer(node, service, hints, result);
}
else static assert(0, "OS not supported");
}
void freeaddrinfo(addrinfo* result)
{
version (Windows)
{
freeaddrinfoPointer(result);
}
else static assert(0, "OS not supported");
}
// Returns: error code on failure
SockResult resolve(alias AddressSelector = StandardAddressSelector.IPv4ThenIPv6, T)
(T* resolved, SentinelArray!(const(char)) host)
{
addrinfo hints;
hints.ai_flags = AI_NUMERICHOST;
hints.ai_family = AddressSelector.hintsAIFamily;
addrinfo* addrList;
{
auto result = getaddrinfo(host.ptr, null, &hints, &addrList);
if(result.failed)
return result;
}
scope(exit) freeaddrinfo(addrList);
static struct AddressInfo
{
addrinfo* ptr;
alias ptr this;
@property auto addressFamily() const { return ai_family; }
void assignTo(sockaddr* dst) const
{
(cast(ubyte*)dst)[0..ptr.ai_addrlen] = (cast(ubyte*)ptr.ai_addr)[0..ptr.ai_addrlen];
}
}
static struct AddressRange
{
AddressInfo next;
@property bool empty() { return next.ptr is null; }
@property auto front() { return next; }
void popFront()
{
next.ptr = next.ptr.ai_next;
}
}
return AddressSelector.selectAddress(resolved, AddressRange(AddressInfo(addrList)));
}
private void noResolution(inet_sockaddr* addr)
{
addr.family = AddressFamily.unspec;
}
private void resolved(T)(inet_sockaddr* addr, T addressInfo) if(isAddressInfo!T)
{
assert(addressInfo.addressFamily == AddressFamily.inet ||
addressInfo.addressFamily == AddressFamily.inet6);
addressInfo.assignTo(&addr.sa);
} | D |
/**
* Module to handle results.
*
* License:
* MIT. See LICENSE for full details.
*/
module dunit.result;
/**
* Imports.
*/
import core.exception;
import core.runtime;
import dunit.error;
import dunit.output.console;
/**
* A class to collate unit test information and present a report.
*/
class ResultCollator
{
/**
* Collection of results.
*
* Null elements are successfully run tests.
*/
private DUnitAssertError[string] _results;
/**
* Bool representing if all tests passed successfully.
*/
private bool _resultsSuccessful = true;
/**
* Return a boolean representing if the unit tests ran successfully.
*
* Returns:
* true if the tests ran successfully, false if not.
*/
public @property bool resultsSuccessful()
{
return this._resultsSuccessful;
}
/**
* Add a result to the collator.
*
* Params:
* moduleName = The module where the error occurred.
* error = The error raised from the toolkit.
*/
public void addResult(string moduleName, DUnitAssertError error = null)
{
this._resultsSuccessful = this._resultsSuccessful && (error is null);
this._results[moduleName] = error;
}
/**
* Get the results.
*
* Returns:
* An array containing the results.
*/
public DUnitAssertError[string] getResults()
{
return this._results;
}
}
unittest
{
import dunit.toolkit;
auto collator = new ResultCollator();
collator.getResults().assertEmpty();
collator.addResult("Module1");
collator.resultsSuccessful.assertTrue();
collator.addResult("Module2", new DUnitAssertError("Message", "file.d", 1));
collator.resultsSuccessful.assertFalse();
collator.getResults().assertCount(2);
collator.getResults()["Module1"].assertNull();
collator.getResults()["Module2"].assertType!(DUnitAssertError);
}
/**
* Replace the standard unit test handler.
*/
shared static this()
{
Runtime.moduleUnitTester = function()
{
auto collator = new ResultCollator();
auto console = new Console();
console.writeHeader();
foreach (module_; ModuleInfo)
{
if (module_)
{
auto unitTest = module_.unitTest;
if (unitTest)
{
try
{
unitTest();
}
catch (DUnitAssertError ex)
{
collator.addResult(module_.name, ex);
continue;
}
catch (AssertError ex)
{
collator.addResult(module_.name, new DUnitAssertError(ex.msg, ex.file, ex.line));
continue;
}
collator.addResult(module_.name);
}
}
}
if (collator.resultsSuccessful)
{
console.writeSuccessMessage();
}
else
{
console.writeFailMessage();
console.writeDetailedResults(collator.getResults());
}
return collator.resultsSuccessful;
};
}
| D |
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/CachedResponseHandler.o : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.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/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/CachedResponseHandler~partial.swiftmodule : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.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/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/CachedResponseHandler~partial.swiftdoc : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.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/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/CachedResponseHandler~partial.swiftsourceinfo : /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartFormData.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/MultipartUpload.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AlamofireExtended.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Protected.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPMethod.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Combine.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Result+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Alamofire.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Response.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/SessionDelegate.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoding.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Session.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Validation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ResponseSerialization.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestTaskMap.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/ParameterEncoder.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RedirectHandler.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AFError.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/EventMonitor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RequestInterceptor.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Notifications.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/HTTPHeaders.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/Request.swift /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Alamofire/Source/RetryPolicy.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/rafaelcunhadeoliveira/Documents/Forecast_Test/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/rafaelcunhadeoliveira/Documents/Forecast_Test/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
import std.stdio;
void main() {
int[] a = [4, 7, 2, 7, 5, 9, 2, 5, 10, 14, 3, 18];
writeln(quicksort(a));
}
T[] quicksort(T)(T[] array) {
if (array.length <= 1) return array; // already sorted
T[] less, more;
foreach (x; array[1 .. $]) {
(x < array[0] ? less : more) ~= x;
}
return quicksort(less) ~ array[0] ~ quicksort(more);
}
| D |
module timer;
import derelict.sdl2.sdl;
import std.conv;
immutable sampleSize = 1 << 5;
public class Timer {
ulong perfreq;
ulong actualDelay = 0;
ulong delayTemp = 0;
int targetFps = 50;
int delay;
float actualDelaySec = 0;
int delta;
int lastDelta;
int startTicks;
int frameFps;
float dt;
ulong frameCount = 0;
float[sampleSize] fpsArr;
this(uint targetFps) {
for (int i = 0; i < sampleSize; ++i) fpsArr[i] = 0.0;
this.targetFps = targetFps;
perfreq = SDL_GetPerformanceFrequency();
delay = 1000 / targetFps;
delta = delay;
lastDelta = delay;
dt = cast(float)(delta) / 1000.0;
}
void startFrame() {
++frameCount;
delta = lastDelta;
startTicks = SDL_GetTicks();
dt = cast(float)(delta) / 1000.0;
}
void endFrame() {
lastDelta = SDL_GetTicks() - startTicks;
frameFps = 1000 / lastDelta;
fpsArr[frameCount % sampleSize] = frameFps;
}
void startMeasureDelay() {
delayTemp = SDL_GetPerformanceCounter();
}
void stopMeasureDelay() {
actualDelay = SDL_GetPerformanceCounter() - delayTemp;
actualDelaySec = cast(float)(actualDelay) / perfreq;
}
uint getDelay() {
return this.delay;
}
uint averageFps() {
auto sum = 0;
for (int i = 0; i < sampleSize; ++i) sum += roundTo!int(fpsArr[i]);
return sum / sampleSize;
}
}
| D |
module wx.Region;
public import wx.common;
public import wx.GDIObject;
public import wx.Bitmap;
public import wx.Colour;
public enum RegionContain {
wxOutRegion = 0,
wxPartRegion,
wxInRegion
}
//! \cond EXTERN
static extern (C) IntPtr wxRegion_ctor();
static extern (C) IntPtr wxRegion_ctorByCoords(int x, int y, int w, int h);
static extern (C) IntPtr wxRegion_ctorByCorners(inout Point topLeft, inout Point bottomRight);
static extern (C) IntPtr wxRegion_ctorByRect(inout Rectangle rect);
static extern (C) IntPtr wxRegion_ctorByPoly(int n, inout Point[] points, int fillStyle);
static extern (C) IntPtr wxRegion_ctorByBitmap(IntPtr bmp, IntPtr transColour, int tolerance);
static extern (C) IntPtr wxRegion_ctorByRegion(IntPtr region);
static extern (C) void wxRegion_dtor(IntPtr self);
static extern (C) void wxRegion_Clear(IntPtr self);
static extern (C) bool wxRegion_Offset(IntPtr self, int x, int y);
static extern (C) bool wxRegion_Union(IntPtr self, int x, int y, int width, int height);
static extern (C) bool wxRegion_UnionRect(IntPtr self, inout Rectangle rect);
static extern (C) bool wxRegion_UnionRegion(IntPtr self, IntPtr region);
static extern (C) bool wxRegion_UnionBitmap(IntPtr self, IntPtr bmp, IntPtr transColour, int tolerance);
static extern (C) bool wxRegion_Intersect(IntPtr self, int x, int y, int width, int height);
static extern (C) bool wxRegion_IntersectRect(IntPtr self, inout Rectangle rect);
static extern (C) bool wxRegion_IntersectRegion(IntPtr self, IntPtr region);
static extern (C) bool wxRegion_Subtract(IntPtr self, int x, int y, int width, int height);
static extern (C) bool wxRegion_SubtractRect(IntPtr self, inout Rectangle rect);
static extern (C) bool wxRegion_SubtractRegion(IntPtr self, IntPtr region);
static extern (C) bool wxRegion_Xor(IntPtr self, int x, int y, int width, int height);
static extern (C) bool wxRegion_XorRect(IntPtr self, inout Rectangle rect);
static extern (C) bool wxRegion_XorRegion(IntPtr self, IntPtr region);
static extern (C) RegionContain wxRegion_ContainsCoords(IntPtr self, int x, int y);
static extern (C) RegionContain wxRegion_ContainsPoint(IntPtr self, inout Point pt);
static extern (C) RegionContain wxRegion_ContainsRectCoords(IntPtr self, int x, int y, int width, int height);
static extern (C) RegionContain wxRegion_ContainsRect(IntPtr self, inout Rectangle rect);
static extern (C) void wxRegion_GetBox(IntPtr self, inout Rectangle rect);
static extern (C) bool wxRegion_IsEmpty(IntPtr self);
static extern (C) IntPtr wxRegion_ConvertToBitmap(IntPtr self);
//! \endcond
//---------------------------------------------------------------------
alias Region wxRegion;
public class Region : GDIObject
{
public this(IntPtr wxobj);
public this();
public this(int x, int y, int w, int h);
public this(Point topLeft, Point bottomRight);
public this(Rectangle rect);
version(__WXMAC__) {} else
public this(Point[] points, int fillStyle);
public this(Bitmap bmp, Colour transColour, int tolerance);
public this(Region reg);
public void Clear();
version(__WXMAC__) {} else
public bool Offset(int x, int y);
public bool Union(int x, int y, int width, int height) ;
public bool Union(Rectangle rect);
public bool Union(Region reg);
public bool Union(Bitmap bmp, Colour transColour, int tolerance);
public bool Intersect(int x, int y, int width, int height);
public bool Intersect(Rectangle rect);
public bool Intersect(Region region);
public bool Subtract(int x, int y, int width, int height);
public bool Subtract(Rectangle rect);
public bool Subtract(Region region);
public bool Xor(int x, int y, int width, int height);
public bool Xor(Rectangle rect);
public bool Xor(Region region);
public RegionContain Contains(int x, int y);
public RegionContain Contains(Point pt);
public RegionContain Contains(int x, int y, int width, int height);
public RegionContain Contains(Rectangle rect);
public Rectangle GetBox();
public bool IsEmpty() ;
public Bitmap ConvertToBitmap();
}
//! \cond EXTERN
static extern (C) IntPtr wxRegionIterator_ctor();
static extern (C) IntPtr wxRegionIterator_ctorByRegion(IntPtr region);
static extern (C) void wxRegionIterator_Reset(IntPtr self);
static extern (C) void wxRegionIterator_ResetToRegion(IntPtr self, IntPtr region);
static extern (C) bool wxRegionIterator_HaveRects(IntPtr self);
static extern (C) int wxRegionIterator_GetX(IntPtr self);
static extern (C) int wxRegionIterator_GetY(IntPtr self);
static extern (C) int wxRegionIterator_GetW(IntPtr self);
static extern (C) int wxRegionIterator_GetWidth(IntPtr self);
static extern (C) int wxRegionIterator_GetH(IntPtr self);
static extern (C) int wxRegionIterator_GetHeight(IntPtr self);
static extern (C) void wxRegionIterator_GetRect(IntPtr self, inout Rectangle rect);
//! \endcond
//---------------------------------------------------------------------
alias RegionIterator wxRegionIterator;
public class RegionIterator : wxObject
{
public this(IntPtr wxobj) ;
public this();
public this(Region reg);
public void Reset();
public void ResetToRegion(Region region);
public bool HaveRects();
public int X() ;
public int Y() ;
public int Width();
public int Height() ;
public Rectangle Rect() ;
}
| D |
a person with dark skin who comes from Africa (or whose ancestors came from Africa)
| D |
/+
Copyright (c) 2005 Eric Anderton
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
+/
module ddl.FileBuffer;
private import tango.io.FilePath;
private import tango.io.device.File;
struct FileBuffer{
FilePath path;
ubyte[] data;
static FileBuffer opCall(char[] path){
FileBuffer _this;
_this.path = new FilePath(path);
_this.data = cast(ubyte[])File.get(_this.path.toString);
return _this;
}
static FileBuffer opCall(FilePath path){
FileBuffer _this;
_this.path = new FilePath(path.toString);
_this.data = cast(ubyte[])File.get(_this.path.toString);
return _this;
}
static FileBuffer opCall(char[] path,ubyte[] data){
FileBuffer _this;
_this.path = FilePath(path);
_this.data = data;
return _this;
}
static FileBuffer opCall(FilePath path,ubyte[] data){
FileBuffer _this;
_this.path = FilePath(path.toString);
_this.data = data;
return _this;
}
FilePath getPath(){
return path;
}
void save(){
File.set(this.path.toString, this.data);
}
void deleteData() {
delete this.data;
}
}
| D |
# FIXED
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/rom/r1/rom_init.c
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/bcomdef.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/comdef.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/cc26xx/_hal_types.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdint.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_defs.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_types.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdbool.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/yvals.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdarg.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/linkage.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/_lock.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_chip_def.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/rom/rom_jt.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/rom/map_direct.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/common/cc26xx/onboard.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_mcu.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_nvic.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_ints.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_gpio.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_memmap.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/systick.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/debug.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/interrupt.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/cpu.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_cpu_scs.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/rom.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/uart.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_uart.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/gpio.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/flash.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_flash.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_aon_sysctl.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_fcfg1.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/ioc.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_ioc.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/icall/src/inc/ICall.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdlib.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_assert.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_sleep.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal.h
Startup/rom_init.obj: C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/limits.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Memory.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Timers.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal_pwrmgr.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal_bufmgr.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/vims.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_vims.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_tl.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_data.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_event.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_tl.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_trng_wrapper.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/trng.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_trng.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/cc26xx/mb.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_rfc_dbell.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/cc26xx/rf_hal.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_config.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_user_config.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/icall/inc/ble_user_config.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/icall/inc/ble_dispatch.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_sysctl.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_sleep.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_scheduler.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/ecc_rom.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_common.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_enc.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_wl.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_timer_drift.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ble.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_rat.h
Startup/rom_init.obj: C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_rfc_rat.h
Startup/rom_init.obj: C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_privacy.h
C:/ti/simplelink/ble_sdk_2_02_01_18/src/rom/r1/rom_init.c:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/bcomdef.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/comdef.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/cc26xx/_hal_types.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdint.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_defs.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_types.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdbool.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/yvals.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdarg.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/linkage.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/_lock.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_chip_def.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/rom/rom_jt.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/rom/map_direct.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/common/cc26xx/onboard.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_mcu.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_nvic.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_ints.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_gpio.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_memmap.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/systick.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/debug.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/interrupt.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/cpu.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_cpu_scs.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/rom.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/uart.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_uart.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/gpio.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/flash.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_flash.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_aon_sysctl.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_fcfg1.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/ioc.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_ioc.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/icall/src/inc/ICall.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/stdlib.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_assert.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/inc/hal_sleep.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal.h:
C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_5.2.6/include/limits.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Memory.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/OSAL_Timers.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal_pwrmgr.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/osal/src/inc/osal_bufmgr.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/vims.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_vims.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_tl.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_data.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_event.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/hci_tl.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_trng_wrapper.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/trng.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_trng.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/cc26xx/mb.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_rfc_dbell.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/cc26xx/rf_hal.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_config.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_user_config.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/icall/inc/ble_user_config.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/icall/inc/ble_dispatch.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_sysctl.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_sleep.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_scheduler.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/inc/ecc_rom.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_common.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_enc.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_wl.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_timer_drift.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ble.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_rat.h:
C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/inc/hw_rfc_rat.h:
C:/ti/simplelink/ble_sdk_2_02_01_18/src/controller/cc26xx/inc/ll_privacy.h:
| D |
// @file memory.d
import std.stdio;
void main(){
int[] DynamicallyAllocatedArray = new int[10];
foreach(i ; DynamicallyAllocatedArray){
writeln(i);
}
}
| D |
/home/alansky/Dev/Parity/substrate-node-template/target/debug/wbuild/target/release/deps/libpaste_impl-56bc8c4045b5fa45.so: /home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/lib.rs /home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/enum_hack.rs /home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/error.rs
/home/alansky/Dev/Parity/substrate-node-template/target/debug/wbuild/target/release/deps/paste_impl-56bc8c4045b5fa45.d: /home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/lib.rs /home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/enum_hack.rs /home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/error.rs
/home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/lib.rs:
/home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/enum_hack.rs:
/home/alansky/.cargo/registry/src/github.com-1ecc6299db9ec823/paste-impl-0.1.18/src/error.rs:
| D |
deprecated("Use deimos.python instead. mir.pybind.pyapi will be removed in the next release.")
module mir.pybind.pyapi;
import core.stdc.config : c_long, c_ulong;
// pragma(mangle, __traits(identifier, PyObject));
extern (C) {
struct PyTypeObject;
alias Py_ssize_t = ptrdiff_t;
struct PyObject
{
version (Py_DEBUG) {
PyObject*_ob_next;
PyObject*_ob_prev;
}
Py_ssize_t ob_refcnt;
PyTypeObject *ob_type;
}
}
version (unittest) {} else {
extern (C) {
alias PyCFunction = PyObject* function(PyObject*, PyObject*);
struct PyMethodDef {
const char *ml_name; /* The name of the built-in function/method */
PyCFunction ml_meth; /* The C function that implements it */
int ml_flags; /* Combination of METH_xxx flags, which mostly
describe the args expected by the C func */
const char *ml_doc; /* The __doc__ attribute, or NULL */
};
// https://docs.python.org/3/c-api/module.html#c.PyModuleDef
alias inquiry = int function(PyObject*);
alias visitproc = int function(PyObject*, void*);
alias traverseproc = int function(PyObject*, visitproc, void*);
alias freefunc = void function(void*);
struct PyModuleDef_Base {
// PyObject_HEAD
PyObject ob_base;
PyObject* function() m_init;
Py_ssize_t m_index;
PyObject* m_copy;
}
struct PyModuleDef_Slot{
int slot;
void *value;
}
struct PyModuleDef{
PyModuleDef_Base m_base;
const char* m_name;
const char* m_doc;
Py_ssize_t m_size;
PyMethodDef *m_methods;
PyModuleDef_Slot* m_slots;
traverseproc m_traverse;
inquiry m_clear;
freefunc m_free;
}
/* The PYTHON_ABI_VERSION is introduced in PEP 384. For the lifetime of
Python 3, it will stay at the value of 3; changes to the limited API
must be performed in a strictly backwards-compatible manner. */
enum PYTHON_ABI_VERSION = 3;
PyObject* PyModule_Create2(PyModuleDef* def, int apiver);
PyObject* PyModule_Create(PyModuleDef* def) {
return PyModule_Create2(def, PYTHON_ABI_VERSION);
}
/// for format string, see https://docs.python.org/3/c-api/arg.html#strings-and-buffers
int PyArg_ParseTuple(PyObject *args, const char *format, ...);
enum PyModuleDef_Base PyModuleDef_HEAD_INIT = {{1, null}, null, 0, null};
enum PyMethodDef PyMethodDef_SENTINEL = {null, null, 0, null};
/* Flag passed to newmethodobject */
enum : int {
/* #define METH_OLDARGS 0x0000 -- unsupported now */
METH_VARARGS = 0x0001,
METH_KEYWORDS = 0x0002,
/* METH_NOARGS and METH_O must not be combined with the flags above. */
METH_NOARGS = 0x0004,
METH_O = 0x0008,
/* METH_CLASS and METH_STATIC are a little different; these control
the construction of methods for a class. These cannot be used for
functions in modules. */
METH_CLASS = 0x0010,
METH_STATIC = 0x0020
}
int Py_AtExit(void function());
void rtAtExit() {
import core.runtime : rt_term;
rt_term();
}
/**
Basic types
*/
double PyFloat_AsDouble(PyObject* pyfloat);
c_long PyLong_AsLong(PyObject *obj);
long PyLong_AsLongLong(PyObject *obj);
c_ulong PyLong_AsUnsignedLong(PyObject *pylong);
ulong PyLong_AsUnsignedLongLong(PyObject *pylong);
Py_ssize_t PyLong_AsSsize_t(PyObject *pylong);
size_t PyLong_AsSize_t(PyObject *pylong);
int PyObject_IsTrue(PyObject *o);
const(char*) PyUnicode_AsUTF8(PyObject *unicode);
extern __gshared PyObject* Py_True;
extern __gshared PyObject* Py_False;
PyObject* PyFloat_FromDouble(double);
PyObject* PyLong_FromLongLong(long);
PyObject* PyLong_FromUnsignedLongLong(ulong);
PyObject* PyLong_FromSize_t(size_t);
PyObject* PyLong_FromSsize_t(ptrdiff_t);
PyObject* PyBool_FromLong(long v);
PyObject* PyUnicode_FromStringAndSize(const(char*) u, Py_ssize_t len);
PyObject* PyTuple_New(Py_ssize_t);
int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o);
/**
Error handling
*/
void PyErr_Print();
PyObject* PyErr_Occurred();
void PyErr_SetString(PyObject* type, const char* message);
// NOTE: c globals need __gshared https://dlang.org/spec/interfaceToC.html#c-globals
extern __gshared PyObject* PyExc_TypeError;
extern __gshared PyObject* PyExc_RuntimeError;
extern __gshared PyObject* PyExc_ImportError;
extern __gshared PyObject* PyExc_AttributeError;
extern __gshared PyObject* PyExc_ValueError;
/**
Buffer Protocol
*/
import mir.ndslice.connect.cpython : Py_buffer;
int PyObject_GetBuffer(PyObject *exporter, Py_buffer *view, int flags);
int PyObject_CheckReadBuffer(PyObject *obj);
void PyBuffer_Release(Py_buffer *view);
PyObject* PyMemoryView_FromBuffer(Py_buffer *view);
/**
numpy API
*/
static __gshared void** PyArray_API;
PyObject* PyImport_ImportModule(const(char*));
PyObject* PyObject_GetAttrString(PyObject*, const(char*));
void* PyCapsule_GetPointer(PyObject *capsule, const(char*) name);
// from __multiarray_api.h
static int _import_array()
{
int st;
PyObject *numpy = PyImport_ImportModule("numpy.core.multiarray");
PyObject *c_api;
if (numpy == null) {
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
return -1;
}
c_api = PyObject_GetAttrString(numpy, "_ARRAY_API");
Py_DecRef(numpy);
if (c_api == null) {
PyErr_SetString(PyExc_AttributeError, "_ARRAY_API not found");
return -1;
}
// if (!PyCapsule_CheckExact(c_api)) {
// PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is not PyCapsule object");
// Py_DecRef(c_api);
// return -1;
// }
PyArray_API = cast(void**) PyCapsule_GetPointer(c_api, null);
Py_DecRef(c_api);
if (PyArray_API == null) {
PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is NULL pointer");
return -1;
}
return 0;
}
//// This function must be called in the initialization section of a module that will make use of the C-API
void import_array() {
if (_import_array() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
// return NUMPY_IMPORT_ARRAY_RETVAL;
}
}
alias npy_intp = ptrdiff_t;
PyObject* PyArray_SimpleNew(int nd, npy_intp* dims, int typenum);
/// https://github.com/numpy/numpy/blob/v1.15.4/numpy/core/include/numpy/ndarraytypes.h#L65-L89
/// misc
extern __gshared PyObject _Py_NoneStruct;
void Py_IncRef(PyObject*);
void Py_DecRef(PyObject*);
PyObject* newNone() {
Py_IncRef(&_Py_NoneStruct);
return &_Py_NoneStruct;
}
}
}
| D |
CUNMHR (F08NUE) Example Program Data
4 :Value of N
(-3.97,-5.04) (-4.11, 3.70) (-0.34, 1.01) ( 1.29,-0.86)
( 0.34,-1.50) ( 1.52,-0.43) ( 1.88,-5.38) ( 3.36, 0.65)
( 3.31,-3.85) ( 2.50, 3.45) ( 0.88,-1.08) ( 0.64,-1.48)
(-1.10, 0.82) ( 1.81,-1.59) ( 3.25, 1.33) ( 1.57,-3.44) :End of matrix A
0.0 :Value of THRESH
| D |
/home/javed/Documents/Projects/RustRepo/ultimate_rust_crash_course/exercise/h_closures_threads/target/rls/debug/deps/h_closures_threads-91b434a7a70c3372.rmeta: src/main.rs
/home/javed/Documents/Projects/RustRepo/ultimate_rust_crash_course/exercise/h_closures_threads/target/rls/debug/deps/h_closures_threads-91b434a7a70c3372.d: src/main.rs
src/main.rs:
| D |
module dacc.aatree;
import std.algorithm: min;
unittest {
import std.stdio: writeln;
import std.algorithm.comparison: equal;
writeln("## AATree.d unittest1");
// CTFE check
static const aatree = new AATree!int(3, 9, 4);
aatree.test();
static assert ( equal(aatree.keys, [3, 4, 9]) );
static assert ( aatree.hasKey(9) );
static assert ( aatree.cardinal == 3 );
// run time check
auto aatree2 = new AATree!(int, (a,b) => a>b, int)();
aatree2[-9] = -9; aatree2[9] = 9;
aatree2[-8] = -8; aatree2[8] = 8;
aatree2[-7] = -7; aatree2[7] = 7;
aatree2[-6] = -6; aatree2[6] = 6;
aatree2[-5] = -5; aatree2[5] = 5;
aatree2[-4] = -4; aatree2[4] = 4;
aatree2[-3] = -3; aatree2[3] = 3;
aatree2[-2] = -2; aatree2[2] = 2;
aatree2[-1] = -1; aatree2[1] = 1;
aatree2[0] = 0;
//foreach (key, value; aatree2) {
// writeln(key, " ", value);
//}
//writeln();
aatree2.remove(-5, 5, 9, 1, 7, -3, -8, 5, 1);
assert (equal(aatree2.keys, [8, 6, 4, 3, 2, 0, -1, -2, -4, -6, -7, -9]));
//foreach (key, value; aatree2) {
// writeln(key, " ", value, " ", aatree2[key]);
//}
//writeln();
}
// K is key, V is value
class AATree(K, alias less = (a,b) => a < b, V = bool)
if ( is(typeof(less(K.init, K.init))) )
{
// if left and right are null (i.e., the node is a leaf), level = 1
// left.level = this.level - 1
// right.level = this.level or this.level - 1
// right.right, right.left < this.level
// if level > 1, then left !is null and right !is null
private struct Node {
K key;
Node* left, right;
size_t level;
V value;
}
private Node* root;
pure this(K[] args...) {
insert(args);
}
// returns the keys of the elements in the ascending order
public pure inout(K)[] keys() @property inout const {
return array_(cast(inout(Node*)) root);
}
deprecated("Use keys() instead.") public inout(K)[] array() @property inout const {
return array_(cast(inout(Node*)) root);
}
private pure inout(K)[] array_(inout(Node*) node) inout const {
if (node == null) return [];
return array_(node.left) ~ [node.key] ~ array_(node.right);
}
// array.length
private size_t cardinal_;
public pure @nogc @safe size_t cardinal() @property inout const {
return cardinal_;
}
public pure @nogc @safe bool empty() @property inout const {
return root == null;
}
// return the minimal key
public pure @nogc K front() @property inout const {
auto node = cast(Node*) root;
while (node) {
if (!node.left) return node.key;
else node = node.left;
}
assert(0, "Tried to get the front key of an empty AATree.");
}
// foreach loop by key and value in the ascending order of the key
public int opApply(int delegate(K, V) dg) {
const(Node*)[] node_stacks = [root];
bool[] visited_stacks = [false];
while (node_stacks.length > 0) {
auto top_node = node_stacks[$-1];
// null
if (top_node == null) { node_stacks.length -= 1, visited_stacks.length -= 1; continue; }
// push and mark the top node as visited
if (!visited_stacks[$-1]) node_stacks ~= top_node.left, visited_stacks[$-1] = true, visited_stacks ~= false;
// already visited
else {
if (dg(cast(K) top_node.key, cast(V) top_node.value)) return 1; // do the loop-body
node_stacks.length -= 1, visited_stacks.length -= 1; // get rid of the current node
node_stacks ~= top_node.right, visited_stacks ~= false; // push the right
}
}
return 1; // stop
}
public pure bool hasKey(inout K key) inout {
return hasKey(key, cast(Node*) root) != null;
}
private pure Node* hasKey(inout K key, Node* node) inout {
while (true) {
// not found
if (node == null) return null;
// go left
if (less(key, node.key)) node = node.left;
// go right
else if (less(node.key, key)) node = node.right;
// found
else return node;
}
}
public pure ref V getValue(inout K key) inout const {
return hasKey(key, cast(Node*) root).value;
}
// [] overload
public pure ref V opIndex(K index) inout const {
return getValue(index);
}
// aatree[index] = s
public pure V opIndexAssign(V s, K index) {
root = insert(index, root, s);
return s;
}
// v v
// left <- node - left -> node
// | | | => | | |
// v v v v v v
// a b right a b right
private pure Node* skew(Node* node) inout {
if (node == null) return null;
else if (node.left == null) return node;
else if (node.left.level == node.level) {
auto L = node.left;
node.left = L.right;
L.right = node;
return L;
}
else return node;
}
// v
// - r -
// => | |
// v v v
// node -> r -> x node x
// | | | |
// v v v v
// a b a b
private pure Node* split(Node* node) inout {
if (node == null) return null;
else if (node.right == null || node.right.right == null) return node;
else if (node.level == node.right.right.level) {
auto R = node.right;
node.right = R.left;
R.left = node;
++R.level;
return R;
}
else return node;
}
/////////////
// insert
public pure void insert(K[] keys...) {
foreach (key; keys)
root = insert(key, root);
}
private pure Node* insert(K key, Node* node, V value = V.init) {
if (node == null) {
auto new_node = new Node();
new_node.key = key, new_node.level = 1, new_node.value = value;
++cardinal_;
return new_node;
}
else if (less(key, node.key)) {
node.left = insert(key, node.left, value);
}
else if (less(node.key, key)) {
node.right = insert(key, node.right, value);
}
else {
node.value = value;
}
node = skew (node);
node = split(node);
return node;
}
/////////////
// remove
public pure void remove(K[] keys...) {
foreach (key; keys)
root = remove(key, root);
}
private pure Node* remove(K key, Node* node) {
if (node == null)
return null;
else if (less(node.key, key))
node.right = remove(key, node.right);
else if (less(key, node.key))
node.left = remove(key, node.left);
else {
// leaf
if (node.left == null && node.right == null) {
--cardinal_;
return null;
}
else if (node.left == null) {
auto R = successor(node);
node.right = remove(R.key, node.right);
node.key = R.key;
node.value = R.value;
}
else {
auto L = predecessor(node);
node.left = remove(L.key, node.left);
node.key = L.key;
node.value = L.value;
}
}
//
node = decrease_level(node);
node = skew(node);
node.right = skew(node.right);
if (node.right != null) node.right.right = skew(node.right.right);
node = split(node);
node.right = split(node.right);
return node;
}
private pure Node* decrease_level(Node* node) {
if (node == null) return null;
auto normalize
= min(
node.left ? node.left.level : 0,
node.right ? node.right.level : 0
)
+ 1;
if (normalize < node.level) {
node.level = normalize;
if (node.right && normalize < node.right.level)
node.right.level = normalize;
}
return node;
}
private pure Node* predecessor(Node* node) {
node = node.left;
while (node.right)
node = node.right;
return node;
}
private pure Node* successor(Node* node) {
node = node.right;
while (node.left)
node = node.left;
return node;
}
version (unittest) {
public void test() inout {
{
// l <---- n m = l ----> n
// | | | => | | |
// v v v v v v
// a b r a b r
Node n, l, r, a, b;
//n.key = 0, l.key = 1, r.key = 2, a.key = 3, b.key = 4;
n.left = &l, n.right = &r, l.left = &a, l.right = &b;
a.level = 1, b.level = 1, r.level = 1, l.level = 2, n.level = 2;
auto m = skew(&n);
static assert ( is(typeof(*m.left) == Node) );
static assert ( is(typeof(m.left) == Node*) );
static assert ( is(typeof(m.left.left) == Node*) );
static assert ( is(typeof(*m.left.left) == Node) );
static assert ( is(typeof((*m.left).left) == Node*) );
assert ( m == &l && m.left == &a && m.right == &n && m.right.left == &b && m.right.right == &r );
}
{
// n -> r -> x -r=m-
// | | => | |
// v v v v
// a b - n - x
// | |
// v v
// a b
Node n, x, r, a, b;
//n.key = 0, x.key = 1, r.key = 2, a.key = 3, b.key = 4;
n.left = &a, n.right = &r, r.left = &b, r.right = &x;
a.level = 1, b.level = 1, n.level = 2, r.level = 2, x.level = 2;
auto m = split(&n);
assert ( m == &r && m.left == &n && m.right == &x && m.left.left == &a && m.left.right == &b );
}
}
}
}
| D |
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtTest module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QTESTSYSTEM_H
#define QTESTSYSTEM_H
public import qt.QtTest.qtestcase;
public import qt.QtCore.qcoreapplication;
public import qt.QtCore.qelapsedtimer;
#ifdef QT_GUI_LIB
public import qt.QtGui.QWindow;
#endif
#ifdef QT_WIDGETS_LIB
public import qt.QtWidgets.QWidget;
#endif
QT_BEGIN_NAMESPACE
namespace QTest
{
Q_DECL_UNUSED /+inline+/ static void qWait(int ms)
{
Q_ASSERT(QCoreApplication::instance());
QElapsedTimer timer;
timer.start();
do {
QCoreApplication::processEvents(QEventLoop::AllEvents, ms);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QTest::qSleep(10);
} while (timer.elapsed() < ms);
}
#ifdef QT_GUI_LIB
/+inline+/ static bool qWaitForWindowActive(QWindow *window, int timeout = 5000)
{
QElapsedTimer timer;
timer.start();
while (!window->isActive()) {
int remaining = timeout - int(timer.elapsed());
if (remaining <= 0)
break;
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QTest::qSleep(10);
}
// Try ensuring the platform window receives the real position.
// (i.e. that window->pos() reflects reality)
// isActive() ( == FocusIn in case of X) does not guarantee this. It seems some WMs randomly
// send the final ConfigureNotify (the one with the non-bogus 0,0 position) after the FocusIn.
// If we just let things go, every mapTo/FromGlobal call the tests perform directly after
// qWaitForWindowShown() will generate bogus results.
if (window->isActive()) {
int waitNo = 0; // 0, 0 might be a valid position after all, so do not wait for ever
while (window->position().isNull()) {
if (waitNo++ > timeout / 10)
break;
qWait(10);
}
}
return window->isActive();
}
/+inline+/ static bool qWaitForWindowExposed(QWindow *window, int timeout = 5000)
{
QElapsedTimer timer;
timer.start();
while (!window->isExposed()) {
int remaining = timeout - int(timer.elapsed());
if (remaining <= 0)
break;
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QTest::qSleep(10);
}
return window->isExposed();
}
#endif
#ifdef QT_WIDGETS_LIB
/+inline+/ static bool qWaitForWindowActive(QWidget *widget, int timeout = 1000)
{
if (QWindow *window = widget->windowHandle())
return qWaitForWindowActive(window, timeout);
return false;
}
/+inline+/ static bool qWaitForWindowExposed(QWidget *widget, int timeout = 1000)
{
if (QWindow *window = widget->windowHandle())
return qWaitForWindowExposed(window, timeout);
return false;
}
#endif
#if QT_DEPRECATED_SINCE(5, 0)
# ifdef QT_WIDGETS_LIB
QT_DEPRECATED /+inline+/ static bool qWaitForWindowShown(QWidget *widget, int timeout = 1000)
{
return qWaitForWindowExposed(widget, timeout);
}
# endif // QT_WIDGETS_LIB
#endif // QT_DEPRECATED_SINCE(5, 0)
}
QT_END_NAMESPACE
#endif
| D |
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.build/Selector.swift.o : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/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/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.build/Selector~partial.swiftmodule : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/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/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.build/Selector~partial.swiftdoc : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/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/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/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/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes
| D |
instance DIA_SERGIO_EXIT(C_INFO)
{
npc = pal_299_sergio;
nr = 999;
condition = dia_sergio_exit_condition;
information = dia_sergio_exit_info;
permanent = TRUE;
description = DIALOG_ENDE;
};
func int dia_sergio_exit_condition()
{
return TRUE;
};
func void dia_sergio_exit_info()
{
if(Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500)
{
AI_Output(self,other,"DIA_Sergio_EXIT_04_00"); //Да осветит Иннос твой путь.
};
AI_StopProcessInfos(self);
};
instance DIA_SERGIO_WELCOME(C_INFO)
{
npc = pal_299_sergio;
nr = 5;
condition = dia_sergio_welcome_condition;
information = dia_sergio_welcome_info;
important = TRUE;
};
func int dia_sergio_welcome_condition()
{
if(Npc_IsInState(self,zs_talk) && (Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500) && (other.guild == GIL_NOV) && (Npc_KnowsInfo(other,dia_sergio_isgaroth) == FALSE))
{
return TRUE;
};
};
func void dia_sergio_welcome_info()
{
AI_Output(self,other,"DIA_Sergio_WELCOME_04_00"); //Да пребудет с тобой Иннос, чем я могу помочь тебе?
};
instance DIA_SERGIO_ISGAROTH(C_INFO)
{
npc = pal_299_sergio;
nr = 2;
condition = dia_sergio_isgaroth_condition;
information = dia_sergio_isgaroth_info;
permanent = FALSE;
important = TRUE;
};
func int dia_sergio_isgaroth_condition()
{
if(Npc_KnowsInfo(hero,pc_prayshrine_paladine) && (Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500) && (KAPITEL == 1))
{
return TRUE;
};
};
func void dia_sergio_isgaroth_info()
{
AI_Output(self,other,"DIA_Sergio_Isgaroth_04_00"); //Ты молился за моих товарищей. Я благодарен тебе за это. Скажи мне, что я могу сделать для тебя.
Info_ClearChoices(dia_sergio_isgaroth);
Info_AddChoice(dia_sergio_isgaroth,"Как насчет небольшого пожертвования?",dia_sergio_isgaroth_spende);
Info_AddChoice(dia_sergio_isgaroth,"Ты не мог бы поделиться своим боевым опытом?",dia_sergio_isgaroth_xp);
};
func void dia_sergio_isgaroth_spende()
{
AI_Output(other,self,"DIA_Sergio_Isgaroth_Spende_15_00"); //Как насчет небольшого пожертвования?
AI_Output(self,other,"DIA_Sergio_Isgaroth_Spende_04_01"); //Пусть это золото сослужит тебе добрую службу.
b_giveinvitems(self,other,itmi_gold,100);
Info_ClearChoices(dia_sergio_isgaroth);
};
func void dia_sergio_isgaroth_xp()
{
AI_Output(other,self,"DIA_Sergio_Isgaroth_XP_15_00"); //Ты не мог бы поделиться своим боевым опытом?
AI_Output(self,other,"DIA_Sergio_Isgaroth_XP_04_01"); //Когда ты сражаешься, постарайся, чтобы никто не мог атаковать тебя сзади.
b_addfightskill(other,NPC_TALENT_2H,2);
PrintScreen(PRINT_LEARN2H,-1,-1,FONT_SCREENSMALL,2);
Info_ClearChoices(dia_sergio_isgaroth);
};
instance DIA_SERGIO_AUFGABE(C_INFO)
{
npc = pal_299_sergio;
nr = 3;
condition = dia_sergio_aufgabe_condition;
information = dia_sergio_aufgabe_info;
description = "Мне нужен доступ в библиотеку.";
};
func int dia_sergio_aufgabe_condition()
{
if((Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500) && (other.guild == GIL_NOV) && Npc_KnowsInfo(other,dia_sergio_isgaroth))
{
return TRUE;
};
};
func void dia_sergio_aufgabe_info()
{
AI_Output(other,self,"DIA_Sergio_Aufgabe_15_00"); //Мне нужен доступ в библиотеку.
AI_Output(self,other,"DIA_Sergio_Aufgabe_04_01"); //Ну, я не могу обеспечить тебе доступ. Для этого ты должен сначала выполнить свои задания.
AI_Output(self,other,"DIA_Sergio_Aufgabe_04_02"); //Но я могу помочь тебе. Иди к Мастеру Исгароту и поговори с ним. Я слышал, ему нужна помощь и собирался сам помочь ему, но я поручаю эту задачу тебе.
SERGIO_SENDS = TRUE;
Wld_InsertNpc(blackwolf,"NW_PATH_TO_MONASTER_AREA_01");
Log_CreateTopic(TOPIC_ISGAROTHWOLF,LOG_MISSION);
Log_SetTopicStatus(TOPIC_ISGAROTHWOLF,LOG_RUNNING);
b_logentry(TOPIC_ISGAROTHWOLF,"Мастеру Исгароту необходима помощь в часовне. Я должен найти его.");
};
instance DIA_SERGIO_WHAT(C_INFO)
{
npc = pal_299_sergio;
nr = 3;
condition = dia_sergio_what_condition;
information = dia_sergio_what_info;
description = "Что ты делаешь здесь?";
};
func int dia_sergio_what_condition()
{
if((Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500) && (other.guild == GIL_NOV))
{
return TRUE;
};
};
func void dia_sergio_what_info()
{
AI_Output(other,self,"DIA_Sergio_WHAT_15_00"); //Что ты делаешь здесь?
AI_Output(self,other,"DIA_Sergio_WHAT_04_01"); //Я молюсь Инносу, чтобы он укрепил мою руку и мою волю.
AI_Output(self,other,"DIA_Sergio_WHAT_04_02"); //Тогда я буду готов к любым опасностям и уничтожу всех его врагов с его именем на устах.
AI_Output(other,self,"DIA_Sergio_WHAT_15_03"); //Каких врагов?
AI_Output(self,other,"DIA_Sergio_WHAT_04_04"); //Всех тех, кто противится воле Инноса. Не важно, человек это или вызванное существо.
};
instance DIA_SERGIO_BABO(C_INFO)
{
npc = pal_299_sergio;
nr = 3;
condition = dia_sergio_babo_condition;
information = dia_sergio_babo_info;
description = "Не мог бы ты немного потренировать Бабо?";
};
func int dia_sergio_babo_condition()
{
if((Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500) && (other.guild == GIL_NOV) && Npc_KnowsInfo(other,dia_babo_anliegen))
{
return TRUE;
};
};
func void dia_sergio_babo_info()
{
AI_Output(other,self,"DIA_Sergio_Babo_15_00"); //Не мог бы ты немного потренировать Бабо?
AI_Output(self,other,"DIA_Sergio_Babo_04_01"); //А почему он не попросит сам?
AI_Output(other,self,"DIA_Sergio_Babo_15_02"); //Я думаю, он робеет.
AI_Output(self,other,"DIA_Sergio_Babo_04_03"); //Понимаю. Хорошо, если это так много значит для него, я буду тренировать его каждое утро в течение двух часов. Мы будем начинать в 5 утра. Можешь передать ему это.
Npc_ExchangeRoutine(self,"TRAIN");
b_startotherroutine(babo,"TRAIN");
b_logentry(TOPIC_BABOTRAIN,"Сержио согласился тренироваться с Бабо по два часа каждое утро.");
};
instance DIA_SERGIO_WHY(C_INFO)
{
npc = pal_299_sergio;
nr = 4;
condition = dia_sergio_why_condition;
information = dia_sergio_why_info;
description = "Почему ты не с другими паладинами?";
};
func int dia_sergio_why_condition()
{
if(Npc_KnowsInfo(hero,dia_sergio_welcome) && (Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500))
{
return TRUE;
};
};
func void dia_sergio_why_info()
{
AI_Output(other,self,"DIA_Sergio_WHY_15_00"); //Почему ты не с другими паладинами?
AI_Output(self,other,"DIA_Sergio_WHY_04_01"); //Может показаться немного странным, что я здесь, однако не надо забывать, что мы, паладины, также служим магам, так как они проповедуют волю Инноса.
AI_Output(self,other,"DIA_Sergio_WHY_04_02"); //Мы, паладины, - воины Инноса. Его воля - закон для нас. В настоящий момент я жду новых приказов от магов.
};
instance DIA_SERGIO_ORDERS(C_INFO)
{
npc = pal_299_sergio;
nr = 10;
condition = dia_sergio_orders_condition;
information = dia_sergio_orders_info;
permanent = TRUE;
description = "Ты уже получил новые приказы?";
};
func int dia_sergio_orders_condition()
{
if(Npc_KnowsInfo(hero,dia_sergio_why) && (self.aivar[AIV_PARTYMEMBER] == FALSE) && (Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500))
{
return TRUE;
};
};
func void dia_sergio_orders_info()
{
AI_Output(other,self,"DIA_Sergio_ORDERS_15_00"); //Ты уже получил новые приказы?
AI_Output(self,other,"DIA_Sergio_ORDERS_04_01"); //Пока нет, и у меня есть время найти силу в молитвах.
};
instance DIA_SERGIO_START(C_INFO)
{
npc = pal_299_sergio;
nr = 10;
condition = dia_sergio_start_condition;
information = dia_sergio_start_info;
permanent = FALSE;
description = "Ты должен сопровождать меня к Проходу.";
};
func int dia_sergio_start_condition()
{
if((Npc_GetDistToWP(self,"NW_MONASTERY_CHAPELL_02") <= 1500) && (SERGIO_FOLLOW == TRUE) && (other.guild == GIL_KDF))
{
return TRUE;
};
};
func void dia_sergio_start_info()
{
AI_Output(other,self,"DIA_Sergio_Start_15_00"); //Ты должен сопровождать меня к Проходу.
AI_Output(self,other,"DIA_Sergio_Start_04_01"); //Хорошо, я сделаю это. Я знаю дорогу, иди за мной.
AI_StopProcessInfos(self);
self.aivar[AIV_PARTYMEMBER] = TRUE;
self.npctype = NPCTYPE_FRIEND;
Npc_ExchangeRoutine(self,"GUIDE");
};
instance DIA_SERGIO_GUIDE(C_INFO)
{
npc = pal_299_sergio;
nr = 10;
condition = dia_sergio_guide_condition;
information = dia_sergio_guide_info;
permanent = TRUE;
description = "Мы пойдем?";
};
func int dia_sergio_guide_condition()
{
if((self.aivar[AIV_PARTYMEMBER] == TRUE) && (Npc_GetDistToWP(self,"NW_TO_PASS_01") > 1000))
{
return TRUE;
};
};
func void dia_sergio_guide_info()
{
AI_Output(other,self,"DIA_Sergio_Guide_15_00"); //Как дела?
AI_Output(self,other,"DIA_Sergio_Guide_04_01"); //Я должен сопроводить тебя к Проходу. Но самая опасная часть путешествия только начинается там.
AI_Output(self,other,"DIA_Sergio_Guide_04_02"); //Но не будем терять времени.
AI_StopProcessInfos(self);
};
instance DIA_SERGIO_ENDE(C_INFO)
{
npc = pal_299_sergio;
nr = 2;
condition = dia_sergio_ende_condition;
information = dia_sergio_ende_info;
permanent = FALSE;
important = TRUE;
};
func int dia_sergio_ende_condition()
{
if((self.aivar[AIV_PARTYMEMBER] == TRUE) && (Npc_GetDistToWP(self,"NW_TO_PASS_01") <= 1000))
{
return TRUE;
};
};
func void dia_sergio_ende_info()
{
AI_Output(self,other,"DIA_Sergio_Ende_04_00"); //Мы пришли. Что бы ни ждало тебя в Долине Рудников, я надеюсь, что ты найдешь дорогу назад.
AI_Output(other,self,"DIA_Sergio_Ende_15_01"); //Не бойся - я вернусь.
AI_Output(self,other,"DIA_Sergio_Ende_04_02"); //Иди с Инносом. Да не оставит он тебя без защиты.
self.aivar[AIV_PARTYMEMBER] = FALSE;
AI_StopProcessInfos(self);
Npc_ExchangeRoutine(self,"START");
};
instance DIA_SERGIO_PERM(C_INFO)
{
npc = pal_299_sergio;
nr = 2;
condition = dia_sergio_perm_condition;
information = dia_sergio_perm_info;
permanent = FALSE;
important = TRUE;
};
func int dia_sergio_perm_condition()
{
if((KAPITEL >= 3) && (other.guild != GIL_KDF))
{
return TRUE;
};
};
func void dia_sergio_perm_info()
{
if(other.guild == GIL_PAL)
{
AI_Output(self,other,"DIA_Sergio_Perm_04_00"); //Хвала Инносу, брат. Если ты пришел узнать что-нибудь об Освящении Меча, поговори с Мардуком.
}
else
{
AI_Output(self,other,"DIA_Sergio_Perm_04_01"); //Я слышал о тебе. Ты парень с фермы, который был в Долине Рудников. Мое почтение.
};
AI_StopProcessInfos(self);
};
instance DIA_SERGIO_PICKPOCKET(C_INFO)
{
npc = pal_299_sergio;
nr = 900;
condition = dia_sergio_pickpocket_condition;
information = dia_sergio_pickpocket_info;
permanent = TRUE;
description = PICKPOCKET_80;
};
func int dia_sergio_pickpocket_condition()
{
return c_beklauen(78,85);
};
func void dia_sergio_pickpocket_info()
{
Info_ClearChoices(dia_sergio_pickpocket);
Info_AddChoice(dia_sergio_pickpocket,DIALOG_BACK,dia_sergio_pickpocket_back);
Info_AddChoice(dia_sergio_pickpocket,DIALOG_PICKPOCKET,dia_sergio_pickpocket_doit);
};
func void dia_sergio_pickpocket_doit()
{
b_beklauen();
Info_ClearChoices(dia_sergio_pickpocket);
};
func void dia_sergio_pickpocket_back()
{
Info_ClearChoices(dia_sergio_pickpocket);
};
| D |
module armos.utils.gui.style;
import armos.graphics.bitmapfont;
import armos.types.color;
///
class Style {
public{
this(){}
int width = 256;
BitmapFont font;
Color[string] colors;
}//public
private{
}//private
}//class Style
| D |
module cache;
import vibe.core.log;
import vibe.db.mongo.mongo;
import vibe.http.client;
import vibe.stream.memory;
import std.exception;
class UrlCache {
private {
MongoClient m_db;
MongoCollection m_entries;
}
this()
{
m_db = connectMongoDB("127.0.0.1");
m_entries = m_db.getCollection("urlcache.entries");
}
void get(Url url, scope void delegate(scope InputStream str) callback)
{
auto be = m_entries.findOne(["url": url.toString()]);
CacheEntry entry;
if( !be.isNull() ) deserializeBson(entry, be);
else {
entry._id = BsonObjectID.generate();
entry.url = url.toString();
}
auto res = requestHttp(url, (req){
if( entry.etag.length ) req.headers["If-None-Match"] = entry.etag;
});
scope(exit) res.dropBody();
if( res.statusCode == HttpStatus.NotModified ){
res.dropBody();
auto data = be["data"].get!BsonBinData().rawData();
callback(new MemoryStream(cast(ubyte[])data, false));
return;
}
enforce(res.statusCode == HttpStatus.OK, "Unexpeted reply for '"~url.toString()~"': "~httpStatusText(res.statusCode));
if( auto pet = "ETag" in res.headers ){
auto dst = new MemoryOutputStream;
dst.write(res.bodyReader);
auto rawdata = dst.data;
entry.etag = *pet;
entry.data = BsonBinData(BsonBinData.Type.Generic, cast(immutable)rawdata);
m_entries.update(["_id": entry._id], entry, UpdateFlags.Upsert);
callback(new MemoryStream(rawdata, false));
return;
}
logDebug("Response without etag.. not caching: "~url.toString());
callback(res.bodyReader);
}
}
private struct CacheEntry {
BsonObjectID _id;
string url;
string etag;
BsonBinData data;
}
private UrlCache s_cache;
void downloadCached(Url url, scope void delegate(scope InputStream str) callback)
{
if( !s_cache ) s_cache = new UrlCache;
s_cache.get(url, callback);
}
void downloadCached(string url, scope void delegate(scope InputStream str) callback)
{
return downloadCached(Url.parse(url), callback);
} | D |
/Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/build/Pods.build/Debug/Alamofire.build/Objects-normal/x86_64/DispatchQueue+Alamofire.o : /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/AFError.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Alamofire.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/MultipartFormData.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Notifications.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Request.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Response.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Result.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/SessionDelegate.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/SessionManager.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/TaskDelegate.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Timeline.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/build/Pods.build/Debug/Alamofire.build/unextended-module.modulemap /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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /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/CoreData.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/XPC.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/SwiftOnoneSupport.swiftmodule
/Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/build/Pods.build/Debug/Alamofire.build/Objects-normal/x86_64/DispatchQueue+Alamofire~partial.swiftmodule : /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/AFError.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Alamofire.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/MultipartFormData.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Notifications.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Request.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Response.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Result.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/SessionDelegate.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/SessionManager.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/TaskDelegate.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Timeline.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/build/Pods.build/Debug/Alamofire.build/unextended-module.modulemap /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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /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/CoreData.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/XPC.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/SwiftOnoneSupport.swiftmodule
/Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/build/Pods.build/Debug/Alamofire.build/Objects-normal/x86_64/DispatchQueue+Alamofire~partial.swiftdoc : /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/AFError.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Alamofire.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/MultipartFormData.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Notifications.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Request.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Response.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Result.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/SessionDelegate.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/SessionManager.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/TaskDelegate.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Timeline.swift /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Neil/Dropbox/GitHub/panda/Panda_Thurs/Panda/Panda/build/Pods.build/Debug/Alamofire.build/unextended-module.modulemap /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/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /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/CoreData.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/XPC.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/SwiftOnoneSupport.swiftmodule
| D |
import std.algorithm, std.conv, std.range, std.stdio, std.string;
version(unittest) {} else
void main()
{
auto memo = new int[](51);
foreach (i; 0..10)
foreach (j; 0..10)
++memo[i + j];
string line;
while ((line = readln) !is null) {
auto n = line.chomp.to!int;
auto r = 0;
foreach (i; 0..n+1)
r += memo[i] * memo[n - i];
writeln(r);
}
}
| D |
instance GUR_1201_CorKalom_FIRST(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 1;
condition = GUR_1201_CorKalom_FIRST_Condition;
information = GUR_1201_CorKalom_FIRST_Info;
permanent = 1;
important = 1;
};
func int GUR_1201_CorKalom_FIRST_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && ((Npc_GetTrueGuild(hero) != GIL_NOV) || (Npc_GetTrueGuild(hero) != GIL_GUR) || (Npc_GetTrueGuild(hero) != GIL_TPL)))
{
return 1;
};
};
func void GUR_1201_CorKalom_FIRST_Info()
{
AI_Output(self,other,"GUR_1201_CorKalom_FIRST_10_00"); //Co chceš?
Kalom_TalkedTo = TRUE;
};
instance GUR_1201_CorKalom_WannaJoin(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 1;
condition = GUR_1201_CorKalom_WannaJoin_Condition;
information = GUR_1201_CorKalom_WannaJoin_Info;
permanent = 0;
description = "Chci se přidat k Bratrstvu.";
};
func int GUR_1201_CorKalom_WannaJoin_Condition()
{
if(Npc_GetTrueGuild(hero) == GIL_None)
{
return 1;
};
};
func void GUR_1201_CorKalom_WannaJoin_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_WannaJoin_15_00"); //Chci se přidat k Bratrstvu.
AI_Output(other,self,"GUR_1201_CorKalom_WannaJoin_15_01"); //Slyšel jsem, že jsi vedoucí noviců a že rozhoduješ o tom, kdo se může přidat.
AI_Output(self,other,"GUR_1201_CorKalom_WannaJoin_10_02"); //Nemám čas! Mé experimenty jsou příliš důležité, než abych ztrácel čas s novými novici.
AI_Output(self,other,"GUR_1201_CorKalom_WannaJoin_10_03"); //Budu spoléhat na názor Baalů. Až řeknou, že jsi hoden nosit roucho novice, přijď znovu.
AI_StopProcessInfos(self);
Log_CreateTopic(CH1_JoinPsi,LOG_MISSION);
Log_SetTopicStatus(CH1_JoinPsi,LOG_RUNNING);
B_LogEntry(CH1_JoinPsi,"Cor Kalom mě nechá přidat se k Bratrstvu, pokud se mi podaří přesvědčit čtyři z Baalů, aby se za mě přimluvili.");
};
instance GUR_1201_CorKalom_Recipe(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 20;
condition = GUR_1201_CorKalom_Recipe_Condition;
information = GUR_1201_CorKalom_Recipe_Info;
permanent = 0;
description = "Jeden z obchodníků ze Starého tábora by chtěl recept na hojivý lektvar.";
};
func int GUR_1201_CorKalom_Recipe_Condition()
{
if(Dexter_GetKalomsRecipe == LOG_RUNNING)
{
return 1;
};
};
func void GUR_1201_CorKalom_Recipe_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_Recipe_15_00"); //Jeden z obchodníků ze Starého tábora by chtěl recept na hojivý lektvar.
AI_Output(self,other,"GUR_1201_CorKalom_Recipe_10_01"); //Mé recepty nejsou na prodej!
B_LogEntry(CH1_KalomsRecipe,"Cor Kalom mi nedá ten recept. V jeho dílně jsou však truhlice... a vypadá, že bude mít docela rušno...");
};
instance GUR_1201_CorKalom_Experimente(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 2;
condition = GUR_1201_CorKalom_Experimente_Condition;
information = GUR_1201_CorKalom_Experimente_Info;
permanent = 1;
description = "Jaký druh experimentů provádíš?";
};
func int GUR_1201_CorKalom_Experimente_Condition()
{
if(Kapitel <= 2)
{
return 1;
};
};
func void GUR_1201_CorKalom_Experimente_Info()
{
if((Npc_GetTrueGuild(hero) != GIL_GUR) || (Npc_GetTrueGuild(hero) != GIL_TPL))
{
AI_Output(other,self,"GUR_1201_CorKalom_Experimente_15_00"); //Jaký druh experimentů provádíš?
AI_Output(self,other,"GUR_1201_CorKalom_Experimente_10_01"); //Mé výzkumy jsou na takové úrovni, že bys jim sotva porozuměl, chlapče. Tak mě přestaň zdržovat!
}
else
{
AI_Output(self,other,"GUR_1201_CorKalom_Experimente_10_01"); //Mé výzkumy jsou na takové úrovni, že bys jim sotva porozuměl, chlapče. Tak mě přestaň zdržovat!
AI_Output(self,other,"GUR_1201_CorKalom_Experimente_10_02"); //Také zkoumám všechny účinky Trávy smíchané s různými přísadami.
};
};
instance GUR_1201_CorKalom_BRINGWEED(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 2;
condition = GUR_1201_CorKalom_BRINGWEED_Condition;
information = GUR_1201_CorKalom_BRINGWEED_Info;
permanent = 1;
description = "Nesu denní sklizeň drogy z bažin!";
};
func int GUR_1201_CorKalom_BRINGWEED_Condition()
{
if(BaalOrun_FetchWeed == LOG_RUNNING)
{
return TRUE;
};
};
func void GUR_1201_CorKalom_BRINGWEED_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_BRINGWEED_15_00"); //Nesu denní sklizeň drogy z bažin!
if(Npc_HasItems(hero,ItMi_Plants_Swampherb_01) < 100)
{
AI_Output(self,other,"GUR_1201_CorKalom_BRINGWEED_10_01"); //A TOMUHLE ty říkáš nějaké množství??? Očekávám CELOU sklizeň, což znamená aspoň 100 lodyh!!!
AI_StopProcessInfos(self);
}
else
{
AI_Output(self,other,"GUR_1201_CorKalom_BRINGWEED_10_02"); //Ach jo, dej mi to. A teď se mi ztrať z očí!
B_GiveInvItems(hero,self,ItMi_Plants_Swampherb_01,100);
Npc_RemoveInvItems(self,ItMi_Plants_Swampherb_01,100);
BaalOrun_FetchWeed = LOG_SUCCESS;
B_LogEntry(CH1_DeliverWeed,"Cor Kalom byl jako obvykle nesnesitelný, když jsem mu předával sklizeň drogy z bažin.");
Log_SetTopicStatus(CH1_DeliverWeed,LOG_SUCCESS);
B_GiveXP(XP_DeliveredWeedHarvest);
BaalOrun_FetchWeed = LOG_SUCCESS;
AI_StopProcessInfos(self);
};
};
instance GUR_1201_CorKalom_Crawlerzangen(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 800;
condition = GUR_1201_CorKalom_Crawlerzangen_Condition;
information = GUR_1201_CorKalom_Crawlerzangen_Info;
permanent = 1;
description = "Mám pro tebe čelisti červů...";
};
func int GUR_1201_CorKalom_Crawlerzangen_Condition()
{
if(Npc_HasItems(other,ItAt_Crawler_01) > 0)
{
return 1;
};
};
func void GUR_1201_CorKalom_Crawlerzangen_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_Crawlerzangen_15_00"); //Mám pro tebe čelisti červů...
if(Npc_HasItems(other,ItAt_Crawler_01) > 9)
{
AI_Output(self,other,"GUR_1201_CorKalom_Crawlerzangen_10_01"); //Výborně. Dám ti za ně pár svých nejlepších lektvarů.
CreateInvItems(self,ItFo_Potion_Mana_03,3);
B_GiveInvItems(self,hero,ItFo_Potion_Mana_03,3);
}
else if(Npc_HasItems(other,ItAt_Crawler_01) > 2)
{
AI_Output(self,other,"GUR_1201_CorKalom_Crawlerzangen_10_02"); //Dobře. Dám ti za to pár lektvarů.
CreateInvItems(self,ItFo_Potion_Mana_02,2);
B_GiveInvItems(self,hero,ItFo_Potion_Mana_02,2);
}
else
{
AI_Output(self,other,"GUR_1201_CorKalom_Crawlerzangen_10_03"); //Hmm. To je všechno? Tady je lektvar many a zmiz.
CreateInvItems(self,ItFo_Potion_Mana_01,1);
B_GiveInvItems(self,hero,ItFo_Potion_Mana_01,1);
AI_StopProcessInfos(self);
};
B_GiveInvItems(other,self,ItAt_Crawler_01,Npc_HasItems(other,ItAt_Crawler_01));
};
instance GUR_1201_CorKalom_JoinPSI(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 1;
condition = GUR_1201_CorKalom_JoinPSI_Condition;
information = GUR_1201_CorKalom_JoinPSI_Info;
permanent = 1;
description = "Myslím, že jsem přesvědčil Baaly!";
};
func int GUR_1201_CorKalom_JoinPSI_Condition()
{
if((Npc_GetTrueGuild(hero) == GIL_None) && Npc_KnowsInfo(hero,GUR_1201_CorKalom_WannaJoin))
{
return 1;
};
};
func void GUR_1201_CorKalom_JoinPSI_Info()
{
var int counter;
counter = 0;
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_00"); //Myslím, že jsem přesvědčil Baaly!
if(Npc_KnowsInfo(hero,DIA_BaalOrun_GotWeed))
{
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_01"); //Baal Orun říká, že jsem uspěl jako dobrý služebník Spáče.
counter = counter + 1;
};
if(Npc_KnowsInfo(hero,DIA_BaalCadar_SleepSpell))
{
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_02"); //Pokračuj...
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_03"); //Baal Cadar mě považuje za vnímavého žáka.
counter = counter + 1;
};
if(Npc_KnowsInfo(hero,DIA_BaalNamib_FirstTalk))
{
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_04"); //Baal Namib mě považuje za pravověrce.
counter = counter + 1;
};
if(Npc_KnowsInfo(hero,dia_baallukor_hypnoticteacher))
{
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_16_04"); //Baal Lukor chce, abych byl přijat mezi Spáčovi služebníky.
counter = counter + 1;
};
if(Npc_KnowsInfo(hero,DIA_BaalTyon_Vision))
{
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_05"); //Díky mně měl Baal Tyon vidinu.
counter = counter + 1;
};
if(Npc_KnowsInfo(hero,DIA_BaalTondral_SendToKalom))
{
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_06"); //No a?
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_07"); //Baal Tondral říká, že bych měl obdržet roucho. Přivedl jsem mu nového žáka.
counter = counter + 1;
};
if(hero.level >= 5)
{
if(counter >= 4)
{
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_08"); //Dobře. Jestli máš podporu Baalů, tak mi to stačí.
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_09"); //Tady, vem si to. A teď běž a snaž se být užitečný.
Mdl_ApplyOverlayMds(hero,"Humans_Mage.mds");
CreateInvItem(self,nov_armor_l);
B_GiveInvItems(self,hero,nov_armor_l,1);
AI_EquipBestArmor(other);
Npc_SetTrueGuild(hero,GIL_NOV);
hero.guild = GIL_NOV;
B_LogEntry(CH1_JoinPsi,"Dnes mě Cor Kalom přijal jako novice. Byl jako obvykle nesnesitelný, ale konečně patřím mezi Bratrstvo Spáče z Tábora v bažinách.");
B_LogEntry(GE_TraderPSI,"Dostanu od Baala Namiba lepší NOVICKOU ZBROJ.");
Log_SetTopicStatus(CH1_JoinPsi,LOG_SUCCESS);
B_GiveXP(XP_BecomeNovice);
Wld_AssignRoomToGuild("hütte26",GIL_VLK);
Wld_AssignRoomToGuild("NLHU25",GIL_SLD);
GUR_1201_CorKalom_FIRST.permanent = 0;
Log_CreateTopic(CH1_JoinOC,LOG_MISSION);
Log_SetTopicStatus(CH1_JoinOC,LOG_FAILED);
B_LogEntry(CH1_JoinOC,"Teď když jsem se rozhodl přidat k Spáčovu Bratrstvu v táboře v bažinách, tak už se nemůžu přidat ke Gomezovým Stínům.");
Log_CreateTopic(CH1_JoinNC,LOG_MISSION);
Log_SetTopicStatus(CH1_JoinNC,LOG_FAILED);
B_LogEntry(CH1_JoinNC,"Nemohu se už přidat k tlupě Nového tábora, protože moje nové místo je teď v Bratrstvu Spáče.");
}
else
{
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_NOT_10_00"); //No a?
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_NOT_15_01"); //To bylo všechno.
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_NOT_10_02"); //Okrádáš mě o drahocenný čas! Vrať se, až čtyři z Baalů rozhodnou, že jsi způsobilý.
};
}
else
{
B_PrintGuildCondition(5);
};
};
instance GUR_1201_CorKalom_JoinPSI2(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 1;
condition = GUR_1201_CorKalom_JoinPSI2_Condition;
information = GUR_1201_CorKalom_JoinPSI2_Info;
permanent = 0;
description = "To bylo všechno? Žádné přivítání, nic?";
};
func int GUR_1201_CorKalom_JoinPSI2_Condition()
{
if(Npc_GetTrueGuild(hero) == GIL_NOV)
{
return 1;
};
};
func void GUR_1201_CorKalom_JoinPSI2_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_10"); //To bylo všechno? Žádné přivítání, nic?
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_11"); //Vítej.
AI_Output(other,self,"GUR_1201_CorKalom_JoinPSI_15_12"); //To zní líp.
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_13"); //Nemotej se tady! Dělej něco! Vezmi tuhle drogu a dones ji Gomezovi do Starého tábora.
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_14"); //Když tě jeho posluhovači nebudou chtít pustit, řekni, že tě posílá Cor Kalom.
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_11_15"); //Vem si tento amulet. Když ho budeš mít u sebe, Gomezovi poskoci spoznají, že jsi jeden z nás.
CreateInvItems(self,ItMiJoint_3,30);
B_GiveInvItems(self,hero,ItMiJoint_3,30);
CreateInvItems(self,ItMi_Amulet_Psi_01,1);
B_GiveInvItems(self,hero,ItMi_Amulet_Psi_01,1);
Kalom_Krautbote = LOG_RUNNING;
Log_CreateTopic(CH1_KrautBote,LOG_MISSION);
Log_SetTopicStatus(CH1_KrautBote,LOG_RUNNING);
B_LogEntry(CH1_KrautBote,"Cor Kalom mě vyslal s dodávkou drogy z bažin za Gomezem do Starého tábora.");
AI_Output(self,other,"GUR_1201_CorKalom_JoinPSI_10_15"); //Cože, ty jsi ještě tady?
AI_StopProcessInfos(self);
};
instance Info_Kalom_DrugMonopol(C_Info)
{
npc = GUR_1201_CorKalom;
condition = Info_Kalom_DrugMonopol_Condition;
information = Info_Kalom_DrugMonopol_Info;
permanent = 0;
description = "Máš pro mě ještě jiný úkol?";
};
func int Info_Kalom_DrugMonopol_Condition()
{
if(Npc_GetTrueGuild(other) == GIL_NOV)
{
return 1;
};
};
func void Info_Kalom_DrugMonopol_Info()
{
var C_Npc Renyu;
var C_Npc Killian;
AI_Output(other,self,"Mis_1_Psi_Kalom_DrugMonopol_15_00"); //Máš pro mě ještě jiný úkol?
AI_Output(self,other,"Mis_1_Psi_Kalom_DrugMonopol_10_01"); //V Novém táboře je malá skupinka lidí, kteří začali vyrábět svoji vlastní drogu z bažin.
AI_Output(self,other,"Mis_1_Psi_Kalom_DrugMonopol_10_02"); //Chtějí nám odlákat naše zákazníky, to nedovolíme.
AI_Output(self,other,"Mis_1_Psi_Kalom_DrugMonopol_10_03"); //Dohlédni na to, aby tu produkci ukončili.
AI_Output(other,self,"Mis_1_Psi_Kalom_DrugMonopol_15_04"); //Jak...
AI_Output(self,other,"Mis_1_Psi_Kalom_DrugMonopol_10_05"); //Neobtěžuj mě s podrobnostmi!
AI_Output(self,other,"Mis_1_Psi_Kalom_DrugMonopol_10_06"); //Tábor míchačů drogy musí být někde mimo Nový tábor. Víš, co máš dělat.
Kalom_DrugMonopol = LOG_RUNNING;
Log_CreateTopic(CH1_DrugMonopol,LOG_MISSION);
Log_SetTopicStatus(CH1_DrugMonopol,LOG_RUNNING);
B_LogEntry(CH1_DrugMonopol,"Cor Kalom chce, abych zastavil konkurenční produkci drogy v Novém táboře. Nevím přesně kde mám hledat, ale snad bych mohl začít PŘED Novým táborem.");
Renyu = Hlp_GetNpc(Org_860_Renyu);
Renyu.aivar[AIV_WASDEFEATEDBYSC] = FALSE;
Killian = Hlp_GetNpc(Org_861_Killian);
Killian.aivar[AIV_WASDEFEATEDBYSC] = FALSE;
};
instance Info_Kalom_Success(C_Info)
{
npc = GUR_1201_CorKalom;
condition = Info_Kalom_Success_Condition;
information = Info_Kalom_Success_Info;
permanent = 1;
description = "Co se týká produkce drogy v Novém táboře...";
};
func int Info_Kalom_Success_Condition()
{
if(Kalom_DrugMonopol == LOG_RUNNING)
{
return 1;
};
};
func void Info_Kalom_Success_Info()
{
var C_Npc Killian;
var C_Npc Renyu;
var C_Npc Jacko;
Killian = Hlp_GetNpc(Org_861_Killian);
Renyu = Hlp_GetNpc(Org_860_Renyu);
Jacko = Hlp_GetNpc(Org_862_Jacko);
AI_Output(other,self,"Mis_1_Psi_Kalom_Success_15_00"); //Co se týká produkce drogy v Novém táboře...
AI_Output(self,other,"Mis_1_Psi_Kalom_Success_10_01"); //Ano?
if(Stooges_Fled != TRUE)
{
AI_Output(other,self,"Mis_1_Psi_Kalom_Success_15_02"); //Nemůžu ty muže najít.
AI_Output(self,other,"Mis_1_Psi_Kalom_Success_10_03"); //Nic jiného jsem od tebe neočekával.
}
else if((Stooges_Fled == TRUE) || (Npc_IsDead(Jacko) && Npc_IsDead(Renyu) && Npc_IsDead(Killian)))
{
AI_Output(other,self,"Mis_1_Psi_Kalom_Success_15_04"); //Jsou pryč.
AI_Output(self,other,"Mis_1_Psi_Kalom_Success_10_05"); //Překvapuješ mě. Podcenil jsem tvoje kvality. Možná bys přece jen mohl být užitečný.
AI_Output(self,other,"Mis_1_Psi_Kalom_Success_10_06"); //Promluv si s Baaly.
Kalom_DrugMonopol = LOG_SUCCESS;
B_LogEntry(CH1_DrugMonopol,"Informoval jsem Cora Kaloma, že konkurenční produkce drogy v Novém táboře je zastavena. Jeho odezva byla 'přátelská' jako vždy.");
Log_SetTopicStatus(CH1_DrugMonopol,LOG_SUCCESS);
B_GiveXP(XP_DrugMonopol);
};
};
instance Info_Kalom_KrautboteBACK(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 1;
condition = Info_Kalom_KrautboteBACK_Condition;
information = Info_Kalom_KrautboteBACK_Info;
permanent = 1;
description = "Doručil jsem tu drogu.";
};
func int Info_Kalom_KrautboteBACK_Condition()
{
if((Kalom_Krautbote == LOG_RUNNING) && (Kalom_DeliveredWeed == TRUE))
{
return TRUE;
};
};
func void Info_Kalom_KrautboteBACK_Info()
{
AI_Output(other,self,"Mis_1_Psi_Kalom_KrautboteBACK_15_00"); //Doručil jsem tu drogu.
if(Npc_HasItems(hero,ItMiNugget) >= 500)
{
AI_Output(self,other,"Mis_1_Psi_Kalom_KrautboteBACK_10_01"); //Dobře. Dostaneš další úkol někde jinde.
Kalom_Krautbote = LOG_SUCCESS;
B_LogEntry(CH1_KrautBote,"Cor Kalom přijal peníze za dodávku drogy Rudobaronům.");
Log_SetTopicStatus(CH1_KrautBote,LOG_SUCCESS);
B_GiveInvItems(hero,self,ItMiNugget,500);
B_GiveXP(XP_WeedShipmentReported);
Info_Kalom_KrautboteBACK.permanent = 0;
}
else
{
AI_Output(self,other,"Mis_1_Psi_Kalom_KrautboteBACK_10_02"); //Kde je těch 500 nugetů, chlapče? Zajisti, abych je hodně rychle dostal!
};
};
instance Info_CorKalom_BringFocus(C_Info)
{
npc = GUR_1201_CorKalom;
condition = Info_CorKalom_BringFocus_Condition;
information = Info_CorKalom_BringFocus_Info;
permanent = 0;
important = 0;
description = "Poslal mě Y´Berion. Mám to ohnisko.";
};
func int Info_CorKalom_BringFocus_Condition()
{
if((YBerion_BringFocus == LOG_SUCCESS) && Npc_HasItems(hero,Focus_1))
{
return 1;
};
};
func void Info_CorKalom_BringFocus_Info()
{
AI_Output(other,self,"Sit_2_PSI_Yberion_BringFocus_Info3_15_01"); //Poslal mě Y´Berion. Mám to ohnisko.
AI_Output(self,other,"Sit_2_PSI_Yberion_BringFocus_Info3_10_02"); //Aaahh - to ohnisko... Konečně. Teď můžu studovat kouzlo těchto artefaktů.
AI_Output(self,other,"Sit_2_PSI_Yberion_BringFocus_Info3_10_03"); //Kdybych jen měl dostatek výměšku... sakra!
B_LogEntry(CH2_Focus,"Nechal jsem u Cora Kaloma zlověstné ohnisko!");
Log_SetTopicStatus(CH2_Focus,LOG_SUCCESS);
B_GiveInvItems(hero,self,Focus_1,1);
Npc_RemoveInvItem(self,Focus_1);
B_GiveXP(XP_BringFocusToCorKalom);
};
instance Info_CorKalom_BLUFF(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 10;
condition = Info_CorKalom_BLUFF_Condition;
information = Info_CorKalom_BLUFF_Info;
permanent = 0;
description = "Y´Berion řekl, že mi máš zaplatit, až ti to ohnisko donesu!";
};
func int Info_CorKalom_BLUFF_Condition()
{
if(Npc_KnowsInfo(hero,Info_CorKalom_BringFocus) && (CorKalom_BringMCQBalls != LOG_SUCCESS))
{
return 1;
};
};
func void Info_CorKalom_BLUFF_Info()
{
AI_Output(other,self,"Sit_2_PSI_Yberion_BLUFF_Info3_15_01"); //Y´Berion řekl, že mi máš zaplatit, až ti to ohnisko donesu!
AI_Output(self,other,"Sit_2_PSI_Yberion_BLUFF_Info3_10_02"); //Opravdu? To, že řekl? Dobrá tedy. Předpokládám, že 50 nugetů by mělo stačit!
CreateInvItems(self,ItMiNugget,50);
B_GiveInvItems(self,other,ItMiNugget,50);
};
instance GUR_1201_CorKalom_SACHE(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_SACHE_Condition;
information = GUR_1201_CorKalom_SACHE_Info;
important = 0;
permanent = 0;
description = "Výměšek?";
};
func int GUR_1201_CorKalom_SACHE_Condition()
{
if(Npc_KnowsInfo(hero,Info_CorKalom_BringFocus))
{
return 1;
};
};
func void GUR_1201_CorKalom_SACHE_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_SACHE_Info_15_01"); //Výměšek?
AI_Output(self,other,"GUR_1201_CorKalom_SACHE_Info_10_02"); //Ano... Jak jistě víš, vyrábím magický lektvar pro vzývání Spáče. Pro tento účel potřebuji výměšek z čelistí důlních červů.
AI_Output(self,other,"GUR_1201_CorKalom_SACHE_Info_10_03"); //Víš přece, co jsou důlní červi, ne?
Info_ClearChoices(GUR_1201_CorKalom_SACHE);
Info_AddChoice(GUR_1201_CorKalom_SACHE,"Ne.",GUR_1201_CorKalom_SACHE_NEIN);
Info_AddChoice(GUR_1201_CorKalom_SACHE,"Ano.",GUR_1201_CorKalom_SACHE_JA);
};
func void GUR_1201_CorKalom_SACHE_NEIN()
{
AI_Output(other,self,"GUR_1201_CorKalom_SACHE_NEIN_15_01"); //Ne.
AI_Output(self,other,"GUR_1201_CorKalom_SACHE_NEIN_10_02"); //Jsou to nebezpečné bestie, které se plíží temnými doly a sežerou všechno lidské maso, na které přijdou.
AI_Output(self,other,"GUR_1201_CorKalom_SACHE_NEIN_10_03"); //Jejich čelisti obsahují zvláštní výměšek.
AI_Output(self,other,"GUR_1201_CorKalom_SACHE_NEIN_10_04"); //Používám ho k výrobě lektvaru, který provádí po duchovní cestě ke Spáčovi.
Info_ClearChoices(GUR_1201_CorKalom_SACHE);
};
func void GUR_1201_CorKalom_SACHE_JA()
{
AI_Output(other,self,"GUR_1201_CorKalom_SACHE_JA_15_01"); //Ano.
AI_Output(self,other,"GUR_1201_CorKalom_SACHE_JA_10_02"); //Výborně!
Info_ClearChoices(GUR_1201_CorKalom_SACHE);
};
instance GUR_1201_CorKalom_VISION(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_VISION_Condition;
information = GUR_1201_CorKalom_VISION_Info;
important = 0;
permanent = 0;
description = "Mluv!";
};
func int GUR_1201_CorKalom_VISION_Condition()
{
if(Npc_KnowsInfo(hero,GUR_1201_CorKalom_SACHE))
{
return 1;
};
};
func void GUR_1201_CorKalom_VISION_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_VISION_Info_15_01"); //Mluv dál!
AI_Output(self,other,"GUR_1201_CorKalom_VISION_Info_10_02"); //Dobrá, před nedávnem jsem měl sám vidinu Spáče. Dal mi znamení.
AI_Output(self,other,"GUR_1201_CorKalom_VISION_Info_10_03"); //Sdělil mi, že existuje ještě jiný prostředek, než ten výměšek z čelistí.
AI_Output(self,other,"GUR_1201_CorKalom_VISION_Info_10_04"); //A vybral mě, abych předal toto poselství. Toto poselství není ode mě. Toto poselství je od Spáče!
AI_Output(other,self,"GUR_1201_CorKalom_VISION_Info_15_05"); //To není možné!
AI_Output(self,other,"GUR_1201_CorKalom_VISION_Info_10_06"); //Ticho, hlupáku!
AI_Output(self,other,"GUR_1201_CorKalom_VISION_Info_10_07"); //Srozuměl mě, že cesta, na kterou jsem se dal, je ta pravá, ale ten prostředek v lektvaru není dostatečně silný.
AI_Output(self,other,"GUR_1201_CorKalom_VISION_Info_10_08"); //Správný prostředek můžeme najít v červech, ale čelisti na to nestačí.
AI_Output(self,other,"GUR_1201_CorKalom_VISION_Info_10_09"); //Musí tu být ještě něco jiného.
};
instance GUR_1201_CorKalom_NEST(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_NEST_Condition;
information = GUR_1201_CorKalom_NEST_Info;
important = 0;
permanent = 0;
description = "Vy jste důlní červy nikdy nezkoumali?";
};
func int GUR_1201_CorKalom_NEST_Condition()
{
if(Npc_KnowsInfo(hero,GUR_1201_CorKalom_VISION))
{
return 1;
};
};
func void GUR_1201_CorKalom_NEST_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_NEST_Info_15_01"); //Vy jste důlní červy nikdy nezkoumali? Myslím, že ještě nějaká jiná část jejich těla obsahuje více toho výměšku.
AI_Output(self,other,"GUR_1201_CorKalom_NEST_Info_10_02"); //Samozřejmě jsme několik důlních červů pitvali, ale zdá se, že jedině čelisti obsahují ten výměšek.
AI_Output(self,other,"GUR_1201_CorKalom_NEST_Info_10_03"); //Musí tu být ještě něco jiného. Najdi jejich hnízdo a tam najdeš odpověď!
CorKalom_BringMCQBalls = LOG_RUNNING;
};
func void GUR_1201_CorKalom_WEG_ACCEPT()
{
Log_CreateTopic(CH2_MCEggs,LOG_MISSION);
Log_SetTopicStatus(CH2_MCEggs,LOG_RUNNING);
B_LogEntry(CH2_MCEggs,"Guru Cor Kalom mě požádal, abych nalezl zdroj výměšku důlních červů ve Starém dole. Doposud se používaly čelisti těch oblud a já mám objevit jiný zdroj, který obsahuje silnější výměšek.");
if(PresseTourJanuar2001)
{
CreateInvItems(hero,ItAt_Crawlerqueen,3);
};
};
instance GUR_1201_CorKalom_WEG(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_WEG_Condition;
information = GUR_1201_CorKalom_WEG_Info;
nr = 21;
important = 0;
permanent = 0;
description = "To vypadá na temné a zlověstné pátrání!";
};
func int GUR_1201_CorKalom_WEG_Condition()
{
if(Npc_KnowsInfo(hero,GUR_1201_CorKalom_NEST) && !Npc_KnowsInfo(hero,GUR_1201_CorKalom_RAT))
{
return 1;
};
};
func void GUR_1201_CorKalom_WEG_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_WEG_Info_15_01"); //To vypadá na temné a zlověstné pátrání!
AI_Output(self,other,"GUR_1201_CorKalom_WEG_Info_10_02"); //Vezmi si tyhle kouzelné světelné svitky - v temných šachtách ti můžou být velmi užitečné.
AI_Output(self,other,"GUR_1201_CorKalom_WEG_Info_10_03"); //Templáři v dolech ti pomůžou.
AI_Output(self,other,"GUR_1201_CorKalom_WEG_Info_10_04"); //Ať ti Spáč dodá sílu, ať ti svítí na cestu a osvítí ducha a nechť posílí tvoji mysl!
CreateInvItems(self,ItArScrollLight,5);
B_GiveInvItems(self,other,ItArScrollLight,5);
GUR_1201_CorKalom_WEG_ACCEPT();
};
instance GUR_1201_CorKalom_RAT(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_RAT_Condition;
information = GUR_1201_CorKalom_RAT_Info;
nr = 20;
important = 0;
permanent = 0;
description = "Uvědom si, že by to mohlo být docela krvavé dobrodružství!";
};
func int GUR_1201_CorKalom_RAT_Condition()
{
if(Npc_KnowsInfo(hero,GUR_1201_CorKalom_NEST) && !Npc_KnowsInfo(hero,GUR_1201_CorKalom_WEG))
{
return 1;
};
};
func void GUR_1201_CorKalom_RAT_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_RAT_Info_15_01"); //Uvědom si, že by to mohlo být docela krvavé dobrodružství!
AI_Output(self,other,"GUR_1201_CorKalom_RAT_Info_10_02"); //Vezmi si sebou tyhle lektvary.
AI_Output(self,other,"GUR_1201_CorKalom_RAT_Info_10_03"); //Nedávám ti je, protože bych chtěl, abys zůstal naživu, ale protože se tento úkol musí splnit.
CreateInvItems(self,ItFo_Potion_Health_02,5);
B_GiveInvItems(self,other,ItFo_Potion_Health_02,5);
GUR_1201_CorKalom_WEG_ACCEPT();
};
instance GUR_1201_CorKalom_RUN(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_RUN_Condition;
information = GUR_1201_CorKalom_RUN_Info;
important = 0;
permanent = 0;
description = "Kde najdu důlní červy?";
};
func int GUR_1201_CorKalom_RUN_Condition()
{
if((CorKalom_BringMCQBalls == LOG_RUNNING) && (Npc_HasItems(hero,ItAt_Crawlerqueen) < 1))
{
return 1;
};
};
func void GUR_1201_CorKalom_RUN_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_RUN_Info_15_01"); //Kde najdu důlní červy?
AI_Output(self,other,"GUR_1201_CorKalom_RUN_Info_10_02"); //Ve Starém dole.
if(!EnteredOldMine)
{
AI_Output(other,self,"GUR_1201_CorKalom_RUN_Info_15_03"); //Kde je Starý důl?
AI_Output(self,other,"GUR_1201_CorKalom_RUN_Info_10_04"); //Vem si tuhle mapu! Jsou na ní vyznačena všechna důležitá místa uvnitř Bariéry.
CreateInvItem(self,ItWrWorldmap);
B_GiveInvItems(self,other,ItWrWorldmap,1);
};
};
instance GUR_1201_CorKalom_CRAWLER(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_CRAWLER_Condition;
information = GUR_1201_CorKalom_CRAWLER_Info;
important = 0;
permanent = 0;
description = "Jaký je nejlepší způsob boje s důlními červy?";
};
func int GUR_1201_CorKalom_CRAWLER_Condition()
{
if(Npc_KnowsInfo(hero,GUR_1201_CorKalom_RUN) && (CorKalom_BringMCQBalls != LOG_SUCCESS))
{
return 1;
};
};
func void GUR_1201_CorKalom_CRAWLER_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_CRAWLER_Info_15_01"); //Jaký je nejlepší způsob boje s důlními červy?
AI_Output(self,other,"GUR_1201_CorKalom_CRAWLER_Info_10_02"); //V dole jsou templáři. Loví červy kvůli čelistem. Zeptej se Gora Na Vida. Pomůže ti.
};
instance GUR_1201_CorKalom_FIND(C_Info)
{
npc = GUR_1201_CorKalom;
condition = GUR_1201_CorKalom_FIND_Condition;
information = GUR_1201_CorKalom_FIND_Info;
important = 0;
permanent = 0;
description = "Jak najdu v dole hnízdo?";
};
func int GUR_1201_CorKalom_FIND_Condition()
{
if(Npc_KnowsInfo(hero,GUR_1201_CorKalom_CRAWLER))
{
return 1;
};
};
func void GUR_1201_CorKalom_FIND_Info()
{
AI_Output(other,self,"GUR_1201_CorKalom_FIND_Info_15_01"); //Jak najdu v dole hnízdo?
AI_Output(self,other,"GUR_1201_CorKalom_FIND_Info_10_02"); //To je nejobtížnější bod tvého poslání. Neřeknu ti, kde je hledat, ani co v nich hledat. Spáč však bude při tobě.
AI_Output(other,self,"GUR_1201_CorKalom_FIND_Info_15_03"); //Dobrá, to je útěcha.
};
instance Info_CorKalom_BringMCQBalls_Success(C_Info)
{
npc = GUR_1201_CorKalom;
condition = Info_CorKalom_BringMCQBalls_Success_Condition;
information = Info_CorKalom_BringMCQBalls_Success_Info;
permanent = 0;
description = "Našel jsem vajíčka červí královny.";
};
func int Info_CorKalom_BringMCQBalls_Success_Condition()
{
if(Npc_HasItems(hero,ItAt_Crawlerqueen) >= 3)
{
return 1;
};
};
func void Info_CorKalom_BringMCQBalls_Success_Info()
{
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_01"); //Našel jsem vajíčka červí královny.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_02"); //Znám je. Má vidina byla znamení. Královnina vajíčka musí obsahovat ten výměšek.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_03"); //Výborně, s tím vytvořím ten lektvar pro spojení se Spáčem.
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_04"); //A co má odměna?
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_05"); //Správně... Děkuju ti.
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_15_06"); //Myslel jsem HMATATELNOU odměnu.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_10_07"); //Dobře, dobře. Co bys chtěl?
CorKalom_BringMCQBalls = LOG_SUCCESS;
B_GiveInvItems(hero,self,ItAt_Crawlerqueen,3);
Npc_RemoveInvItems(self,ItAt_Crawlerqueen,3);
B_GiveXP(XP_BringMCEggs);
B_LogEntry(CH2_MCEggs,"Dal jsem Cor Kalomovi tři vajíčka důlních červů. Tvářil se velmi nepřátelsky a já ho musel požádat o svoji hubenou odměnu.");
Log_SetTopicStatus(CH2_MCEggs,LOG_SUCCESS);
B_LogEntry(CH1_GotoPsiCamp,"Myslím, že toho o záměrech sekty vím již dost, a tak o tom můžu podat zprávu Mordragovi. ");
B_LogEntry(CH1_GoToPsi,"Myslím, že o záležitostech sekty toho už vím dost. Jakmile se vrátím do Starého tábora, měl bych o tom všem říct Ravenovi.");
Info_ClearChoices(Info_CorKalom_BringMCQBalls_Success);
Info_AddChoice(Info_CorKalom_BringMCQBalls_Success,"Runu.",Info_CorKalom_BringMCQBalls_Success_RUNE);
Info_AddChoice(Info_CorKalom_BringMCQBalls_Success,"Nějakou zbraň.",Info_CorKalom_BringMCQBalls_Success_WAFFE);
Info_AddChoice(Info_CorKalom_BringMCQBalls_Success,"Hojivý lektvar.",Info_CorKalom_BringMCQBalls_Success_HEAL);
Info_AddChoice(Info_CorKalom_BringMCQBalls_Success,"Rudu.",Info_CorKalom_BringMCQBalls_Success_ORE);
Info_AddChoice(Info_CorKalom_BringMCQBalls_Success,"Manu.",Info_CorKalom_BringMCQBalls_Success_MANA);
};
func void Info_CorKalom_BringMCQBalls_Success_RUNE()
{
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_RUNE_15_01"); //Runu.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_RUNE_10_02"); //Ať ti tato runa osvítí cestu!
CreateInvItem(self,ItArRuneLight);
B_GiveInvItems(self,hero,ItArRuneLight,1);
Info_ClearChoices(Info_CorKalom_BringMCQBalls_Success);
};
func void Info_CorKalom_BringMCQBalls_Success_WAFFE()
{
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_WAFFE_15_01"); //Nějakou zbraň.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_WAFFE_10_02"); //Kéž tato zbraň zničí tvé nepřátele!
CreateInvItem(self,ItMw_1H_Mace_War_02);
B_GiveInvItems(self,hero,ItMw_1H_Mace_War_02,1);
Info_ClearChoices(Info_CorKalom_BringMCQBalls_Success);
};
func void Info_CorKalom_BringMCQBalls_Success_HEAL()
{
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_HEAL_15_01"); //Hojivý lektvar.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_HEAL_10_02"); //Kéž ti tento lektvar prodlouží život!
CreateInvItem(self,ItFo_Potion_Health_Perma_01);
B_GiveInvItems(self,hero,ItFo_Potion_Health_Perma_01,1);
Info_ClearChoices(Info_CorKalom_BringMCQBalls_Success);
};
func void Info_CorKalom_BringMCQBalls_Success_ORE()
{
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_ORE_15_01"); //Ruda.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_ORE_10_02"); //Vem si tuhle rudu jako znamení vděčnosti celého Bratrstva!
CreateInvItems(self,ItMiNugget,100);
B_GiveInvItems(self,hero,ItMiNugget,100);
Info_ClearChoices(Info_CorKalom_BringMCQBalls_Success);
};
func void Info_CorKalom_BringMCQBalls_Success_MANA()
{
AI_Output(other,self,"Mis_2_PSI_Kalom_BringMCQEggs_Success_MANA_15_01"); //Manu.
AI_Output(self,other,"Mis_2_PSI_Kalom_BringMCQEggs_Success_MANA_10_02"); //Kéž tento lektvar probudí kouzlo, které v tobě dřímá!
CreateInvItem(self,ItFo_Potion_Mana_Perma_01);
B_GiveInvItems(self,hero,ItFo_Potion_Mana_Perma_01,1);
Info_ClearChoices(Info_CorKalom_BringMCQBalls_Success);
};
instance Info_CorKalom_BringBook(C_Info)
{
npc = GUR_1201_CorKalom;
condition = Info_CorKalom_BringBook_Condition;
information = Info_CorKalom_BringBook_Info;
permanent = 0;
description = "Můžeme začít vzývat Spáče?";
};
func int Info_CorKalom_BringBook_Condition()
{
if(CorKalom_BringMCQBalls == LOG_SUCCESS)
{
return 1;
};
};
func void Info_CorKalom_BringBook_Info()
{
AI_Output(other,self,"Info_CorKalom_BringBook_Info_15_01"); //Můžeme začít vzývat Spáče?
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_02"); //Ne! Nenašel jsem ještě způsob, jak používat to ohnisko.
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_03"); //Pozbyli jsme prastaré znalosti o těchto artefaktech.
AI_Output(other,self,"Info_CorKalom_BringBook_Info_15_04"); //Chceš říci, že jsem sbíral ta vajíčka nadarmo?
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_05"); //Ne, poslouchej mě. Existuje jeden almanach, ve kterém je vše, co potřebujeme vědět.
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_06"); //Koupili jsme tu knihu od mága Corrista ze Starého tábora.
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_07"); //Byla však ukradena, když se jí sem pokoušeli ze Starého tábor přinést.
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_08"); //Pověřil jsem novice Talase, aby ji pro mě vyzvedl, ale on byl přepaden.
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_09"); //Zklamal mě, ale já mu dal ještě jednu šanci. Musí přinést ukradený almanach zpátky.
AI_Output(self,other,"Info_CorKalom_BringBook_Info_10_10"); //Promluv si s ním. Bude potřebovat každou pomocnou ruku.
CorKalom_BringBook = LOG_RUNNING;
Log_CreateTopic(CH2_Book,LOG_MISSION);
Log_SetTopicStatus(CH2_Book,LOG_RUNNING);
B_LogEntry(CH2_Book,"Cor Kalom potřebuje pro vzývání Spáče poslední předmět. Je to kniha o použití ohniskových kamenů. Novic Talas byl tak neopatrný, že si ten rukopis nechal ukrást gobliny. Nyní hledá v chrámovém dvoře někoho, kdo by mu pomohl získat knihu zpět.");
Info_ClearChoices(Info_CorKalom_BringBook);
Info_AddChoice(Info_CorKalom_BringBook,DIALOG_BACK,Info_CorKalom_BringBook_BACK);
Info_AddChoice(Info_CorKalom_BringBook,"Co za to dostanu?",Info_CorKalom_BringBook_EARN);
Info_AddChoice(Info_CorKalom_BringBook,"Kdo ukradl ten almanach?",Info_CorKalom_BringBook_WHO);
Info_AddChoice(Info_CorKalom_BringBook,"Kde najdu Talase?",Info_CorKalom_BringBook_WHERE);
};
func void Info_CorKalom_BringBook_BACK()
{
Info_ClearChoices(Info_CorKalom_BringBook);
};
func void Info_CorKalom_BringBook_WHERE()
{
AI_Output(other,self,"Info_CorKalom_BringBook_Where_15_01"); //Kde najdu Talase?
AI_Output(self,other,"Info_CorKalom_BringBook_Where_10_02"); //Je na nádvoří u chrámového vršku, kde se snaží získat lidi, aby mu pomohli.
};
func void Info_CorKalom_BringBook_WHO()
{
AI_Output(other,self,"Info_CorKalom_BringBook_Who_15_01"); //Kdo ukradl ten almanach?
AI_Output(self,other,"Info_CorKalom_BringBook_Who_10_02"); //Talas říkal, že mu ho ukradl černý goblin. Zní to podivně, ale není to nemožné.
};
func void Info_CorKalom_BringBook_EARN()
{
AI_Output(other,self,"Info_CorKalom_BringBook_Earn_15_01"); //Co za to dostanu?
AI_Output(self,other,"Info_CorKalom_BringBook_Earn_10_02"); //To jsem ti ještě neprokázal dost velkomyslnosti? Dostaneš odměnu.
};
instance Info_CorKalom_BringBook_Success(C_Info)
{
npc = GUR_1201_CorKalom;
condition = Info_CorKalom_BringBook_Success_Condition;
information = Info_CorKalom_BringBook_Success_Info;
permanent = 0;
description = "Našel jsem tu knihu.";
};
func int Info_CorKalom_BringBook_Success_Condition()
{
if(Npc_HasItems(hero,ItWrFokusbuch) && (CorKalom_BringBook == LOG_RUNNING))
{
return 1;
};
};
func void Info_CorKalom_BringBook_Success_Info()
{
AI_Output(other,self,"Info_CorKalom_BringBook_Success_15_01"); //Našel jsem tu knihu.
AI_Output(self,other,"Info_CorKalom_BringBook_Success_10_02"); //Výborná práce. Máme vše, co potřebujeme.
AI_Output(self,other,"Info_CorKalom_BringBook_Success_10_03"); //Teď dokončím přípravy.
AI_Output(other,self,"Info_CorKalom_BringBook_Success_15_04"); //Kdy bude probíhat vzývání?
AI_Output(self,other,"Info_CorKalom_BringBook_Success_10_05"); //Přijď v noci na chrámové nádvoří. Budeme se soustředit na vyvolání všemohoucího Spáče.
B_GiveInvItems(hero,self,ItWrFokusbuch,1);
Npc_RemoveInvItem(self,ItWrFokusbuch);
B_GiveXP(XP_BringBook);
CorKalom_BringBook = LOG_SUCCESS;
B_LogEntry(CH2_Book,"Předal jsem rukopis Coru Kalomovi, který teď Bratrstvo připravuje na velké vzývání Spáče. To se bude se odehrávat na nádvoří chrámu.");
Log_SetTopicStatus(CH2_Book,LOG_SUCCESS);
AI_StopProcessInfos(self);
B_Story_PrepareRitual();
};
instance Info_CorKalom_Belohnung(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 1;
condition = Info_CorKalom_Belohnung_Condition;
information = Info_CorKalom_Belohnung_Info;
permanent = 0;
description = "A co moje odměna?";
};
func int Info_CorKalom_Belohnung_Condition()
{
if(Npc_KnowsInfo(hero,Info_CorKalom_BringBook_Success))
{
return 1;
};
};
func void Info_CorKalom_Belohnung_Info()
{
AI_Output(other,self,"Info_CorKalom_Belohnung_15_00"); //A co moje odměna?
AI_Output(self,other,"Info_CorKalom_Belohnung_10_01"); //Co bys chtěl?
Info_ClearChoices(Info_CorKalom_Belohnung);
Info_AddChoice(Info_CorKalom_Belohnung,"Kouzelný svitek.",Info_CorKalom_Belohnung_SCROLL);
Info_AddChoice(Info_CorKalom_Belohnung,"Ruda.",Info_CorKalom_Belohnung_ORE);
Info_AddChoice(Info_CorKalom_Belohnung,"Lektvar many.",Info_CorKalom_Belohnung_MANA);
};
func void Info_CorKalom_Belohnung_SCROLL()
{
AI_Output(other,self,"Info_CorKalom_Belohnung_SCROLL_15_00"); //Dej mi tyhle čarovné svitky.
AI_Output(self,other,"Info_CorKalom_Belohnung_SCROLL_10_01"); //Užívej tyto svitky moudře.
CreateInvItems(self,ItArScrollSleep,1);
B_GiveInvItems(self,hero,ItArScrollSleep,1);
CreateInvItems(self,ItArScrollTelekinesis,1);
B_GiveInvItems(self,hero,ItArScrollTelekinesis,1);
CreateInvItems(self,ItArScrollBerzerk,1);
B_GiveInvItems(self,hero,ItArScrollBerzerk,1);
Info_ClearChoices(Info_CorKalom_Belohnung);
};
func void Info_CorKalom_Belohnung_ORE()
{
AI_Output(other,self,"Info_CorKalom_Belohnung_ORE_15_00"); //Dej mi rudu.
AI_Output(self,other,"Info_CorKalom_Belohnung_ORE_10_01"); //To by mělo nasytit tvůj hlad po rudě.
CreateInvItems(self,ItMiNugget,300);
B_GiveInvItems(self,hero,ItMiNugget,300);
Info_ClearChoices(Info_CorKalom_Belohnung);
};
func void Info_CorKalom_Belohnung_MANA()
{
AI_Output(other,self,"Info_CorKalom_Belohnung_MANA_15_00"); //Lektvar many.
AI_Output(self,other,"Info_CorKalom_Belohnung_MANA_10_01"); //Kéž ti tento lektvar dá sílu!
CreateInvItems(self,ItFo_Potion_Mana_02,5);
B_GiveInvItems(self,hero,ItFo_Potion_Mana_02,5);
Info_ClearChoices(Info_CorKalom_Belohnung);
};
instance GUR_1201_CorKalom_Exit(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 999;
condition = GUR_1201_CorKalom_Exit_Condition;
information = GUR_1201_CorKalom_Exit_Info;
important = 0;
permanent = 1;
description = DIALOG_ENDE;
};
func int GUR_1201_CorKalom_Exit_Condition()
{
return 1;
};
func void GUR_1201_CorKalom_Exit_Info()
{
if(Npc_GetTrueGuild(other) == GIL_GUR)
{
AI_Output(other,self,"DIA_BaalTyon_NoTalk_Sleeper_15_00"); //Spáč buď s tebou!
AI_Output(self,other,"GUR_1201_CorKalom_Exit_10_02"); //Kéž tě Spáč osvítí.
AI_StopProcessInfos(self);
}
else
{
AI_Output(other,self,"GUR_1201_CorKalom_Exit_15_01"); //Ještě se uvidíme.
AI_Output(self,other,"GUR_1201_CorKalom_Exit_10_02"); //Kéž tě Spáč osvítí.
AI_StopProcessInfos(self);
};
};
instance GUR_1201_CORKALOM_TATTOOS(C_Info)
{
npc = GUR_1201_CorKalom;
nr = 2;
condition = gur_1201_corkalom_tattoos_condition;
information = gur_1201_corkalom_tattoos_info;
permanent = 0;
important = 1;
};
func int gur_1201_corkalom_tattoos_condition()
{
if(Npc_GetTrueGuild(hero) == GIL_NOV)
{
return 1;
};
};
func void gur_1201_corkalom_tattoos_info()
{
AI_Output(self,other,"GUR_1201_CorKalom_Tattoos_10_01"); //Předtím než zapomenu, Baal Namib na tebe čeká v bažině.
AI_Output(other,self,"GUR_1201_CorKalom_Tattoos_10_02"); //Co chce?
AI_Output(self,other,"GUR_1201_CorKalom_Tattoos_10_03"); //Řekne ti to sám. Jdi chlapče, ztrácíš můj drahocenný čas!
NAMIB_RITUAL = LOG_RUNNING;
Log_CreateTopic(CH1_RITUAL,LOG_MISSION);
Log_SetTopicStatus(CH1_RITUAL,LOG_RUNNING);
B_LogEntry(CH1_RITUAL,"Cor Kalom zmínil, že na mě v bažinách čeká Baal Namib. Jako vždy neměl zájem se mnou moc mluvit, a nevím proč se mnou chce Baal Namib mluvit.");
AI_Teleport(GUR_1204_BaalNamib,"WP_PSI_RITUAL_SWAMP_02");
Npc_ExchangeRoutine(GUR_1204_BaalNamib,"TATTOORITUAL");
AI_ContinueRoutine(GUR_1204_BaalNamib);
AI_Teleport(tpl_5051_templer,"WP_PSI_RITUAL_SWAMP_01");
Npc_ExchangeRoutine(tpl_5051_templer,"TATTOORITUAL");
AI_ContinueRoutine(tpl_5051_templer);
AI_Teleport(tpl_5052_templer,"WP_PSI_RITUAL_SWAMP_03");
Npc_ExchangeRoutine(tpl_5052_templer,"TATTOORITUAL");
AI_ContinueRoutine(tpl_5052_templer);
AI_StopProcessInfos(self);
};
| D |
/*
* This file has been automatically generated by Soupply and released under the MIT license.
* Generated from data/java210.xml
*/
module soupply.java210.protocol.serverbound;
static import std.conv;
import std.typetuple : TypeTuple;
import xpacket;
import soupply.util;
import soupply.java210.metadata : Metadata;
import soupply.java210.packet : Java210Packet;
static import soupply.java210.types;
alias Packets = TypeTuple!(TeleportConfirm, TabComplete, ChatMessage, ClientStatus, ClientSettings, ConfirmTransaction, EnchantItem, ClickWindow, CloseWindow, PluginMessage, UseEntity, KeepAlive, PlayerPosition, PlayerPositionAndLook, PlayerLook, Player, VehicleMove, SteerBoat, PlayerAbilities, PlayerDigging, EntityAction, SteerVehicle, ResourcePackStatus, HeldItemChange, CreativeInventoryAction, UpdateSign, Animation, Spectate, PlayerBlockPlacement, UseItem);
class TeleportConfirm : Java210Packet
{
enum uint ID = 0;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["teleportId"];
@Var uint teleportId;
this() pure nothrow @safe @nogc {}
this(uint teleportId) pure nothrow @safe @nogc
{
this.teleportId = teleportId;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
TeleportConfirm ret = new TeleportConfirm();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "TeleportConfirm(teleportId: " ~ std.conv.to!string(this.teleportId) ~ ")";
}
}
class TabComplete : Java210Packet
{
enum uint ID = 1;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["text", "command", "hasPosition", "block"];
string text;
bool command;
bool hasPosition;
@Condition("hasPosition==true") ulong block;
this() pure nothrow @safe @nogc {}
this(string text, bool command=bool.init, bool hasPosition=bool.init, ulong block=ulong.init) pure nothrow @safe @nogc
{
this.text = text;
this.command = command;
this.hasPosition = hasPosition;
this.block = block;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
TabComplete ret = new TabComplete();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "TabComplete(text: " ~ std.conv.to!string(this.text) ~ ", command: " ~ std.conv.to!string(this.command) ~ ", hasPosition: " ~ std.conv.to!string(this.hasPosition) ~ ", block: " ~ std.conv.to!string(this.block) ~ ")";
}
}
class ChatMessage : Java210Packet
{
enum uint ID = 2;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["text"];
string text;
this() pure nothrow @safe @nogc {}
this(string text) pure nothrow @safe @nogc
{
this.text = text;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
ChatMessage ret = new ChatMessage();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "ChatMessage(text: " ~ std.conv.to!string(this.text) ~ ")";
}
}
class ClientStatus : Java210Packet
{
enum uint ID = 3;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// action
enum uint RESPAWN = 0;
enum uint REQUEST_STATS = 1;
enum uint OPEN_INVENTORY = 2;
enum string[] __fields = ["action"];
@Var uint action;
this() pure nothrow @safe @nogc {}
this(uint action) pure nothrow @safe @nogc
{
this.action = action;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
ClientStatus ret = new ClientStatus();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "ClientStatus(action: " ~ std.conv.to!string(this.action) ~ ")";
}
}
class ClientSettings : Java210Packet
{
enum uint ID = 4;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// chat mode
enum uint ENABLED = 0;
enum uint COMMANDS_ONLY = 1;
enum uint DISABLED = 2;
// displayed skin parts
enum ubyte CAPE = 1;
enum ubyte JACKET = 2;
enum ubyte LEFT_SLEEVE = 4;
enum ubyte RIGHT_SLEEVE = 8;
enum ubyte LEFT_PANTS = 16;
enum ubyte RIGHT_PANTS = 32;
enum ubyte HAT = 64;
// main hand
enum ubyte RIGHT = 0;
enum ubyte LEFT = 1;
enum string[] __fields = ["language", "viewDistance", "chatMode", "chatColors", "displayedSkinParts", "mainHand"];
string language;
ubyte viewDistance;
@Var uint chatMode;
bool chatColors;
ubyte displayedSkinParts;
ubyte mainHand;
this() pure nothrow @safe @nogc {}
this(string language, ubyte viewDistance=ubyte.init, uint chatMode=uint.init, bool chatColors=bool.init, ubyte displayedSkinParts=ubyte.init, ubyte mainHand=ubyte.init) pure nothrow @safe @nogc
{
this.language = language;
this.viewDistance = viewDistance;
this.chatMode = chatMode;
this.chatColors = chatColors;
this.displayedSkinParts = displayedSkinParts;
this.mainHand = mainHand;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
ClientSettings ret = new ClientSettings();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "ClientSettings(language: " ~ std.conv.to!string(this.language) ~ ", viewDistance: " ~ std.conv.to!string(this.viewDistance) ~ ", chatMode: " ~ std.conv.to!string(this.chatMode) ~ ", chatColors: " ~ std.conv.to!string(this.chatColors) ~ ", displayedSkinParts: " ~ std.conv.to!string(this.displayedSkinParts) ~ ", mainHand: " ~ std.conv.to!string(this.mainHand) ~ ")";
}
}
class ConfirmTransaction : Java210Packet
{
enum uint ID = 5;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["window", "action", "accepted"];
ubyte window;
ushort action;
bool accepted;
this() pure nothrow @safe @nogc {}
this(ubyte window, ushort action=ushort.init, bool accepted=bool.init) pure nothrow @safe @nogc
{
this.window = window;
this.action = action;
this.accepted = accepted;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
ConfirmTransaction ret = new ConfirmTransaction();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "ConfirmTransaction(window: " ~ std.conv.to!string(this.window) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", accepted: " ~ std.conv.to!string(this.accepted) ~ ")";
}
}
class EnchantItem : Java210Packet
{
enum uint ID = 6;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["window", "enchantment"];
ubyte window;
ubyte enchantment;
this() pure nothrow @safe @nogc {}
this(ubyte window, ubyte enchantment=ubyte.init) pure nothrow @safe @nogc
{
this.window = window;
this.enchantment = enchantment;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
EnchantItem ret = new EnchantItem();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "EnchantItem(window: " ~ std.conv.to!string(this.window) ~ ", enchantment: " ~ std.conv.to!string(this.enchantment) ~ ")";
}
}
class ClickWindow : Java210Packet
{
enum uint ID = 7;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["window", "slot", "button", "action", "mode", "clickedItem"];
ubyte window;
ushort slot;
ubyte button;
ushort action;
@Var uint mode;
soupply.java210.types.Slot clickedItem;
this() pure nothrow @safe @nogc {}
this(ubyte window, ushort slot=ushort.init, ubyte button=ubyte.init, ushort action=ushort.init, uint mode=uint.init, soupply.java210.types.Slot clickedItem=soupply.java210.types.Slot.init) pure nothrow @safe @nogc
{
this.window = window;
this.slot = slot;
this.button = button;
this.action = action;
this.mode = mode;
this.clickedItem = clickedItem;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
ClickWindow ret = new ClickWindow();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "ClickWindow(window: " ~ std.conv.to!string(this.window) ~ ", slot: " ~ std.conv.to!string(this.slot) ~ ", button: " ~ std.conv.to!string(this.button) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", mode: " ~ std.conv.to!string(this.mode) ~ ", clickedItem: " ~ std.conv.to!string(this.clickedItem) ~ ")";
}
}
class CloseWindow : Java210Packet
{
enum uint ID = 8;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["window"];
ubyte window;
this() pure nothrow @safe @nogc {}
this(ubyte window) pure nothrow @safe @nogc
{
this.window = window;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
CloseWindow ret = new CloseWindow();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "CloseWindow(window: " ~ std.conv.to!string(this.window) ~ ")";
}
}
class PluginMessage : Java210Packet
{
enum uint ID = 9;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["channel", "data"];
string channel;
@NoLength ubyte[] data;
this() pure nothrow @safe @nogc {}
this(string channel, ubyte[] data=(ubyte[]).init) pure nothrow @safe @nogc
{
this.channel = channel;
this.data = data;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
PluginMessage ret = new PluginMessage();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "PluginMessage(channel: " ~ std.conv.to!string(this.channel) ~ ", data: " ~ std.conv.to!string(this.data) ~ ")";
}
}
class UseEntity : Java210Packet
{
enum uint ID = 10;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// type
enum uint INTERACT = 0;
enum uint ATTACK = 1;
enum uint INTERACT_AT = 2;
// hand
enum uint MAIN_HAND = 0;
enum uint OFF_HAND = 1;
enum string[] __fields = ["target", "type", "targetPosition", "hand"];
@Var uint target;
@Var uint type;
@Condition("type==2") Vector!(float, "xyz") targetPosition;
@Condition("type==0||type==2") @Var uint hand;
this() pure nothrow @safe @nogc {}
this(uint target, uint type=uint.init, Vector!(float, "xyz") targetPosition=Vector!(float, "xyz").init, uint hand=uint.init) pure nothrow @safe @nogc
{
this.target = target;
this.type = type;
this.targetPosition = targetPosition;
this.hand = hand;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
UseEntity ret = new UseEntity();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "UseEntity(target: " ~ std.conv.to!string(this.target) ~ ", type: " ~ std.conv.to!string(this.type) ~ ", targetPosition: " ~ std.conv.to!string(this.targetPosition) ~ ", hand: " ~ std.conv.to!string(this.hand) ~ ")";
}
}
class KeepAlive : Java210Packet
{
enum uint ID = 11;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["id"];
@Var uint id;
this() pure nothrow @safe @nogc {}
this(uint id) pure nothrow @safe @nogc
{
this.id = id;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
KeepAlive ret = new KeepAlive();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "KeepAlive(id: " ~ std.conv.to!string(this.id) ~ ")";
}
}
class PlayerPosition : Java210Packet
{
enum uint ID = 12;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["position", "onGround"];
Vector!(double, "xyz") position;
bool onGround;
this() pure nothrow @safe @nogc {}
this(Vector!(double, "xyz") position, bool onGround=bool.init) pure nothrow @safe @nogc
{
this.position = position;
this.onGround = onGround;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
PlayerPosition ret = new PlayerPosition();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "PlayerPosition(position: " ~ std.conv.to!string(this.position) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")";
}
}
class PlayerPositionAndLook : Java210Packet
{
enum uint ID = 13;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["position", "yaw", "pitch", "onGround"];
Vector!(double, "xyz") position;
float yaw;
float pitch;
bool onGround;
this() pure nothrow @safe @nogc {}
this(Vector!(double, "xyz") position, float yaw=float.init, float pitch=float.init, bool onGround=bool.init) pure nothrow @safe @nogc
{
this.position = position;
this.yaw = yaw;
this.pitch = pitch;
this.onGround = onGround;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
PlayerPositionAndLook ret = new PlayerPositionAndLook();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "PlayerPositionAndLook(position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")";
}
}
class PlayerLook : Java210Packet
{
enum uint ID = 14;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["yaw", "pitch", "onGround"];
float yaw;
float pitch;
bool onGround;
this() pure nothrow @safe @nogc {}
this(float yaw, float pitch=float.init, bool onGround=bool.init) pure nothrow @safe @nogc
{
this.yaw = yaw;
this.pitch = pitch;
this.onGround = onGround;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
PlayerLook ret = new PlayerLook();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "PlayerLook(yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ", onGround: " ~ std.conv.to!string(this.onGround) ~ ")";
}
}
class Player : Java210Packet
{
enum uint ID = 15;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["onGround"];
bool onGround;
this() pure nothrow @safe @nogc {}
this(bool onGround) pure nothrow @safe @nogc
{
this.onGround = onGround;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
Player ret = new Player();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "Player(onGround: " ~ std.conv.to!string(this.onGround) ~ ")";
}
}
class VehicleMove : Java210Packet
{
enum uint ID = 16;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["position", "yaw", "pitch"];
Vector!(double, "xyz") position;
float yaw;
float pitch;
this() pure nothrow @safe @nogc {}
this(Vector!(double, "xyz") position, float yaw=float.init, float pitch=float.init) pure nothrow @safe @nogc
{
this.position = position;
this.yaw = yaw;
this.pitch = pitch;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
VehicleMove ret = new VehicleMove();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "VehicleMove(position: " ~ std.conv.to!string(this.position) ~ ", yaw: " ~ std.conv.to!string(this.yaw) ~ ", pitch: " ~ std.conv.to!string(this.pitch) ~ ")";
}
}
class SteerBoat : Java210Packet
{
enum uint ID = 17;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["rightPaddleTurning", "leftPaddleTurning"];
bool rightPaddleTurning;
bool leftPaddleTurning;
this() pure nothrow @safe @nogc {}
this(bool rightPaddleTurning, bool leftPaddleTurning=bool.init) pure nothrow @safe @nogc
{
this.rightPaddleTurning = rightPaddleTurning;
this.leftPaddleTurning = leftPaddleTurning;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
SteerBoat ret = new SteerBoat();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "SteerBoat(rightPaddleTurning: " ~ std.conv.to!string(this.rightPaddleTurning) ~ ", leftPaddleTurning: " ~ std.conv.to!string(this.leftPaddleTurning) ~ ")";
}
}
class PlayerAbilities : Java210Packet
{
enum uint ID = 18;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// flags
enum ubyte CREATIVE_MODE = 1;
enum ubyte FLYING = 2;
enum ubyte ALLOW_FLYING = 4;
enum ubyte INVINCIBLE = 8;
enum string[] __fields = ["flags", "flyingSpeed", "walkingSpeed"];
ubyte flags;
float flyingSpeed;
float walkingSpeed;
this() pure nothrow @safe @nogc {}
this(ubyte flags, float flyingSpeed=float.init, float walkingSpeed=float.init) pure nothrow @safe @nogc
{
this.flags = flags;
this.flyingSpeed = flyingSpeed;
this.walkingSpeed = walkingSpeed;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
PlayerAbilities ret = new PlayerAbilities();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "PlayerAbilities(flags: " ~ std.conv.to!string(this.flags) ~ ", flyingSpeed: " ~ std.conv.to!string(this.flyingSpeed) ~ ", walkingSpeed: " ~ std.conv.to!string(this.walkingSpeed) ~ ")";
}
}
class PlayerDigging : Java210Packet
{
enum uint ID = 19;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// status
enum uint START_DIGGING = 0;
enum uint CANCEL_DIGGING = 1;
enum uint FINISH_DIGGING = 2;
enum uint DROP_ITEM_STACK = 3;
enum uint DROP_ITEM = 4;
enum uint SHOOT_ARROW = 5;
enum uint FINISH_EATING = 5;
enum uint SWAP_ITEM_IN_HAND = 6;
enum string[] __fields = ["status", "position", "face"];
@Var uint status;
ulong position;
ubyte face;
this() pure nothrow @safe @nogc {}
this(uint status, ulong position=ulong.init, ubyte face=ubyte.init) pure nothrow @safe @nogc
{
this.status = status;
this.position = position;
this.face = face;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
PlayerDigging ret = new PlayerDigging();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "PlayerDigging(status: " ~ std.conv.to!string(this.status) ~ ", position: " ~ std.conv.to!string(this.position) ~ ", face: " ~ std.conv.to!string(this.face) ~ ")";
}
}
class EntityAction : Java210Packet
{
enum uint ID = 20;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// action
enum uint START_SNEAKING = 0;
enum uint STOP_SNEAKING = 1;
enum uint LEAVE_BED = 2;
enum uint START_SPRINTING = 3;
enum uint STOP_SPRINTING = 4;
enum uint START_HORSE_JUMP = 5;
enum uint STOP_HORSE_JUMP = 6;
enum uint OPEN_HORSE_INVENTORY = 7;
enum uint START_ELYTRA_FLYING = 8;
enum string[] __fields = ["entityId", "action", "jumpBoost"];
@Var uint entityId;
@Var uint action;
@Var uint jumpBoost;
this() pure nothrow @safe @nogc {}
this(uint entityId, uint action=uint.init, uint jumpBoost=uint.init) pure nothrow @safe @nogc
{
this.entityId = entityId;
this.action = action;
this.jumpBoost = jumpBoost;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
EntityAction ret = new EntityAction();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "EntityAction(entityId: " ~ std.conv.to!string(this.entityId) ~ ", action: " ~ std.conv.to!string(this.action) ~ ", jumpBoost: " ~ std.conv.to!string(this.jumpBoost) ~ ")";
}
}
class SteerVehicle : Java210Packet
{
enum uint ID = 21;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// flags
enum ubyte JUMP = 1;
enum ubyte UNMOUNT = 2;
enum string[] __fields = ["sideways", "forward", "flags"];
float sideways;
float forward;
ubyte flags;
this() pure nothrow @safe @nogc {}
this(float sideways, float forward=float.init, ubyte flags=ubyte.init) pure nothrow @safe @nogc
{
this.sideways = sideways;
this.forward = forward;
this.flags = flags;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
SteerVehicle ret = new SteerVehicle();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "SteerVehicle(sideways: " ~ std.conv.to!string(this.sideways) ~ ", forward: " ~ std.conv.to!string(this.forward) ~ ", flags: " ~ std.conv.to!string(this.flags) ~ ")";
}
}
class ResourcePackStatus : Java210Packet
{
enum uint ID = 22;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// result
enum uint LOADED = 0;
enum uint DECLINED = 1;
enum uint FAILED = 2;
enum uint ACCEPTED = 3;
enum string[] __fields = ["result"];
@Var uint result;
this() pure nothrow @safe @nogc {}
this(uint result) pure nothrow @safe @nogc
{
this.result = result;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
ResourcePackStatus ret = new ResourcePackStatus();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "ResourcePackStatus(result: " ~ std.conv.to!string(this.result) ~ ")";
}
}
class HeldItemChange : Java210Packet
{
enum uint ID = 23;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["slot"];
ushort slot;
this() pure nothrow @safe @nogc {}
this(ushort slot) pure nothrow @safe @nogc
{
this.slot = slot;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
HeldItemChange ret = new HeldItemChange();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "HeldItemChange(slot: " ~ std.conv.to!string(this.slot) ~ ")";
}
}
class CreativeInventoryAction : Java210Packet
{
enum uint ID = 24;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["slot", "clickedItem"];
ushort slot;
soupply.java210.types.Slot clickedItem;
this() pure nothrow @safe @nogc {}
this(ushort slot, soupply.java210.types.Slot clickedItem=soupply.java210.types.Slot.init) pure nothrow @safe @nogc
{
this.slot = slot;
this.clickedItem = clickedItem;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
CreativeInventoryAction ret = new CreativeInventoryAction();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "CreativeInventoryAction(slot: " ~ std.conv.to!string(this.slot) ~ ", clickedItem: " ~ std.conv.to!string(this.clickedItem) ~ ")";
}
}
class UpdateSign : Java210Packet
{
enum uint ID = 25;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["position", "lines"];
ulong position;
string[4] lines;
this() pure nothrow @safe @nogc {}
this(ulong position, string[4] lines=(string[4]).init) pure nothrow @safe @nogc
{
this.position = position;
this.lines = lines;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
UpdateSign ret = new UpdateSign();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "UpdateSign(position: " ~ std.conv.to!string(this.position) ~ ", lines: " ~ std.conv.to!string(this.lines) ~ ")";
}
}
class Animation : Java210Packet
{
enum uint ID = 26;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// hand
enum uint MAIN_HAND = 0;
enum uint OFF_HAND = 1;
enum string[] __fields = ["hand"];
@Var uint hand;
this() pure nothrow @safe @nogc {}
this(uint hand) pure nothrow @safe @nogc
{
this.hand = hand;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
Animation ret = new Animation();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "Animation(hand: " ~ std.conv.to!string(this.hand) ~ ")";
}
}
class Spectate : Java210Packet
{
enum uint ID = 27;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
enum string[] __fields = ["player"];
UUID player;
this() pure nothrow @safe @nogc {}
this(UUID player) pure nothrow @safe @nogc
{
this.player = player;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
Spectate ret = new Spectate();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "Spectate(player: " ~ std.conv.to!string(this.player) ~ ")";
}
}
class PlayerBlockPlacement : Java210Packet
{
enum uint ID = 28;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// hand
enum uint MAIN_HAND = 0;
enum uint OFF_HAND = 1;
enum string[] __fields = ["position", "face", "hand", "cursorPosition"];
ulong position;
@Var uint face;
@Var uint hand;
Vector!(ubyte, "xyz") cursorPosition;
this() pure nothrow @safe @nogc {}
this(ulong position, uint face=uint.init, uint hand=uint.init, Vector!(ubyte, "xyz") cursorPosition=Vector!(ubyte, "xyz").init) pure nothrow @safe @nogc
{
this.position = position;
this.face = face;
this.hand = hand;
this.cursorPosition = cursorPosition;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
PlayerBlockPlacement ret = new PlayerBlockPlacement();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "PlayerBlockPlacement(position: " ~ std.conv.to!string(this.position) ~ ", face: " ~ std.conv.to!string(this.face) ~ ", hand: " ~ std.conv.to!string(this.hand) ~ ", cursorPosition: " ~ std.conv.to!string(this.cursorPosition) ~ ")";
}
}
class UseItem : Java210Packet
{
enum uint ID = 29;
enum bool CLIENTBOUND = false;
enum bool SERVERBOUND = true;
// hand
enum uint MAIN_HAND = 0;
enum uint OFF_HAND = 1;
enum string[] __fields = ["hand"];
@Var uint hand;
this() pure nothrow @safe @nogc {}
this(uint hand) pure nothrow @safe @nogc
{
this.hand = hand;
}
mixin Make;
public static typeof(this) fromBuffer(ubyte[] buffer)
{
UseItem ret = new UseItem();
ret.decode(buffer);
return ret;
}
override string toString()
{
return "UseItem(hand: " ~ std.conv.to!string(this.hand) ~ ")";
}
}
| D |
// Written in the D programming language.
/**
This module implements a variety of type constructors, i.e., templates
that allow construction of new, useful general-purpose types.
Source: $(PHOBOSSRC std/_typecons.d)
Macros:
WIKI = Phobos/StdVariant
Synopsis:
----
// value tuples
alias Tuple!(float, "x", float, "y", float, "z") Coord;
Coord c;
c[1] = 1; // access by index
c.z = 1; // access by given name
alias Tuple!(string, string) DicEntry; // names can be omitted
// Rebindable references to const and immutable objects
void bar()
{
const w1 = new Widget, w2 = new Widget;
w1.foo();
// w1 = w2 would not work; can't rebind const object
auto r = Rebindable!(const Widget)(w1);
// invoke method as if r were a Widget object
r.foo();
// rebind r to refer to another object
r = w2;
}
----
Copyright: Copyright the respective authors, 2008-
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB erdani.org, Andrei Alexandrescu),
$(WEB bartoszmilewski.wordpress.com, Bartosz Milewski),
Don Clugston,
Shin Fujishiro,
Kenji Hara
*/
module std.typecons;
import core.memory, core.stdc.stdlib;
import std.algorithm, std.array, std.conv, std.exception, std.format,
std.metastrings, std.traits, std.typetuple, std.range;
debug(Unique) import std.stdio;
/**
Encapsulates unique ownership of a resource. Resource of type T is
deleted at the end of the scope, unless it is transferred. The
transfer can be explicit, by calling $(D release), or implicit, when
returning Unique from a function. The resource can be a polymorphic
class object, in which case Unique behaves polymorphically too.
Example:
*/
struct Unique(T)
{
static if (is(T:Object))
alias T RefT;
else
alias T * RefT;
public:
/+ Doesn't work yet
/**
The safe constructor. It creates the resource and
guarantees unique ownership of it (unless the constructor
of $(D T) publishes aliases of $(D this)),
*/
this(A...)(A args)
{
_p = new T(args);
}
+/
/**
Constructor that takes an rvalue.
It will ensure uniqueness, as long as the rvalue
isn't just a view on an lvalue (e.g., a cast)
Typical usage:
----
Unique!(Foo) f = new Foo;
----
*/
this(RefT p)
{
debug(Unique) writeln("Unique constructor with rvalue");
_p = p;
}
/**
Constructor that takes an lvalue. It nulls its source.
The nulling will ensure uniqueness as long as there
are no previous aliases to the source.
*/
this(ref RefT p)
{
_p = p;
debug(Unique) writeln("Unique constructor nulling source");
p = null;
assert(p is null);
}
/+ Doesn't work yet
/**
Constructor that takes a Unique of a type that is convertible to our type:
Disallow construction from lvalue (force the use of release on the source Unique)
If the source is an rvalue, null its content, so the destrutctor doesn't delete it
Typically used by the compiler to return $(D Unique) of derived type as $(D Unique)
of base type.
Example:
----
Unique!(Base) create()
{
Unique!(Derived) d = new Derived;
return d; // Implicit Derived->Base conversion
}
----
*/
this(U)(ref Unique!(U) u) = null;
this(U)(Unique!(U) u)
{
_p = u._p;
u._p = null;
}
+/
~this()
{
debug(Unique) writeln("Unique destructor of ", (_p is null)? null: _p);
delete _p;
_p = null;
}
bool isEmpty() const
{
return _p is null;
}
/** Returns a unique rvalue. Nullifies the current contents */
Unique release()
{
debug(Unique) writeln("Release");
auto u = Unique(_p);
assert(_p is null);
debug(Unique) writeln("return from Release");
return u;
}
/** Forwards member access to contents */
RefT opDot() { return _p; }
/+ doesn't work yet!
/**
Postblit operator is undefined to prevent the cloning of $(D Unique) objects
*/
this(this) = null;
+/
private:
RefT _p;
}
/+ doesn't work yet
unittest
{
writeln("Unique class");
class Bar
{
~this() { writefln(" Bar destructor"); }
int val() const { return 4; }
}
alias Unique!(Bar) UBar;
UBar g(UBar u)
{
return u;
}
auto ub = UBar(new Bar);
assert(!ub.isEmpty);
assert(ub.val == 4);
// should not compile
// auto ub3 = g(ub);
writeln("Calling g");
auto ub2 = g(ub.release);
assert(ub.isEmpty);
assert(!ub2.isEmpty);
}
unittest
{
writeln("Unique struct");
struct Foo
{
~this() { writefln(" Bar destructor"); }
int val() const { return 3; }
}
alias Unique!(Foo) UFoo;
UFoo f(UFoo u)
{
writeln("inside f");
return u;
}
auto uf = UFoo(new Foo);
assert(!uf.isEmpty);
assert(uf.val == 3);
// should not compile
// auto uf3 = f(uf);
writeln("Unique struct: calling f");
auto uf2 = f(uf.release);
assert(uf.isEmpty);
assert(!uf2.isEmpty);
}
+/
/**
Tuple of values, for example $(D Tuple!(int, string)) is a record that
stores an $(D int) and a $(D string). $(D Tuple) can be used to bundle
values together, notably when returning multiple values from a
function. If $(D obj) is a tuple, the individual members are
accessible with the syntax $(D obj[0]) for the first field, $(D obj[1])
for the second, and so on.
The choice of zero-based indexing instead of one-base indexing was
motivated by the ability to use value tuples with various compile-time
loop constructs (e.g. type tuple iteration), all of which use
zero-based indexing.
Example:
----
Tuple!(int, int) point;
// assign coordinates
point[0] = 5;
point[1] = 6;
// read coordinates
auto x = point[0];
auto y = point[1];
----
Tuple members can be named. It is legal to mix named and unnamed
members. The method above is still applicable to all fields.
Example:
----
alias Tuple!(int, "index", string, "value") Entry;
Entry e;
e.index = 4;
e.value = "Hello";
assert(e[1] == "Hello");
assert(e[0] == 4);
----
Tuples with named fields are distinct types from tuples with unnamed
fields, i.e. each naming imparts a separate type for the tuple. Two
tuple differing in naming only are still distinct, even though they
might have the same structure.
Example:
----
Tuple!(int, "x", int, "y") point1;
Tuple!(int, int) point2;
assert(!is(typeof(point1) == typeof(point2))); // passes
----
*/
struct Tuple(Specs...)
{
private:
// Parse (type,name) pairs (FieldSpecs) out of the specified
// arguments. Some fields would have name, others not.
template parseSpecs(Specs...)
{
static if (Specs.length == 0)
{
alias TypeTuple!() parseSpecs;
}
else static if (is(Specs[0]))
{
static if (is(typeof(Specs[1]) : string))
{
alias TypeTuple!(FieldSpec!(Specs[0 .. 2]),
parseSpecs!(Specs[2 .. $])) parseSpecs;
}
else
{
alias TypeTuple!(FieldSpec!(Specs[0]),
parseSpecs!(Specs[1 .. $])) parseSpecs;
}
}
else
{
static assert(0, "Attempted to instantiate Tuple with an "
~"invalid argument: "~ Specs[0].stringof);
}
}
template FieldSpec(T, string s = "")
{
alias T Type;
alias s name;
}
alias parseSpecs!Specs fieldSpecs;
// Used with staticMap.
template extractType(alias spec) { alias spec.Type extractType; }
template extractName(alias spec) { alias spec.name extractName; }
// Generates named fields as follows:
// alias Identity!(field[0]) name_0;
// alias Identity!(field[1]) name_1;
// :
// NOTE: field[k] is an expression (which yields a symbol of a
// variable) and can't be aliased directly.
static string injectNamedFields()
{
string decl = "";
foreach (i, name; staticMap!(extractName, fieldSpecs))
{
enum numbered = toStringNow!(i);
decl ~= "alias Identity!(field[" ~ numbered ~ "]) _" ~ numbered ~ ";";
if (name.length != 0)
{
decl ~= "alias _" ~ numbered ~ " " ~ name ~ ";";
}
}
return decl;
}
// Returns Specs for a subtuple this[from .. to] preserving field
// names if any.
template sliceSpecs(size_t from, size_t to)
{
alias staticMap!(expandSpec,
fieldSpecs[from .. to]) sliceSpecs;
}
template expandSpec(alias spec)
{
static if (spec.name.length == 0)
{
alias TypeTuple!(spec.Type) expandSpec;
}
else
{
alias TypeTuple!(spec.Type, spec.name) expandSpec;
}
}
template defaultInit(T)
{
static if (!is(typeof({ T v = void; }))) // inout(U) and others
@property T defaultInit(T v = T.init);
else
@property T defaultInit();
}
template isCompatibleTuples(Tup1, Tup2, string op)
{
enum isCompatibleTuples = is(typeof(
{
Tup1 tup1 = void;
Tup2 tup2 = void;
static assert(tup1.field.length == tup2.field.length);
foreach (i, _; Tup1.Types)
{
// this doesn't work if typeof(tup1.field[i]) == const(int)
//typeof(tup1.field[i]) lhs = void;
//typeof(tup2.field[i]) rhs = void;
auto lhs = defaultInit!(typeof(tup1.field[i])); // workaround
auto rhs = defaultInit!(typeof(tup2.field[i]));
auto result = mixin("lhs "~op~" rhs");
}
}));
}
public:
/**
The type of the tuple's components.
*/
alias staticMap!(extractType, fieldSpecs) Types;
Types field;
mixin(injectNamedFields());
alias field expand;
alias field this;
// This mitigates breakage of old code now that std.range.Zip uses
// Tuple instead of the old Proxy. It's intentionally lacking ddoc
// because it was intended for deprecation.
// Now that it has been deprecated, it will be removed in January 2013.
deprecated auto at(size_t index)() {
return field[index];
}
/**
Constructor taking one value for each field. Each argument must be
implicitly assignable to the respective element of the target.
*/
this(U...)(U values) if (U.length == Types.length)
{
foreach (i, Unused; Types)
{
field[i] = values[i];
}
}
/**
Constructor taking a compatible tuple. Each element of the source
must be implicitly assignable to the respective element of the
target.
*/
this(U)(U another)
if (isTuple!U && isCompatibleTuples!(typeof(this), U, "="))
{
foreach (i, T; Types)
{
field[i] = another.field[i];
}
}
/**
Comparison for equality.
*/
bool opEquals(R)(R rhs)
if (isTuple!R && isCompatibleTuples!(typeof(this), R, "=="))
{
foreach (i, Unused; Types)
{
if (field[i] != rhs.field[i]) return false;
}
return true;
}
/// ditto
bool opEquals(R)(R rhs) const
if (isTuple!R && isCompatibleTuples!(typeof(this), R, "=="))
{
foreach (i, Unused; Types)
{
if (field[i] != rhs.field[i]) return false;
}
return true;
}
/**
Comparison for ordering.
*/
int opCmp(R)(R rhs)
if (isTuple!R && isCompatibleTuples!(typeof(this), R, "<"))
{
foreach (i, Unused; Types)
{
if (field[i] != rhs.field[i])
{
return field[i] < rhs.field[i] ? -1 : 1;
}
}
return 0;
}
/// ditto
int opCmp(R)(R rhs) const
if (isTuple!R && isCompatibleTuples!(typeof(this), R, "<"))
{
foreach (i, Unused; Types)
{
if (field[i] != rhs.field[i])
{
return field[i] < rhs.field[i] ? -1 : 1;
}
}
return 0;
}
/**
Assignment from another tuple. Each element of the source must be
implicitly assignable to the respective element of the target.
*/
void opAssign(R)(R rhs)
if (isTuple!R && allSatisfy!(isAssignable, Types))
{
static assert(field.length == rhs.field.length,
"Length mismatch in attempting to assign a "
~ R.stringof ~" to a "~ typeof(this).stringof);
// Do not swap; opAssign should be called on the fields.
foreach (i, Unused; Types)
{
field[i] = rhs.field[i];
}
}
// @@@BUG4424@@@ workaround
private mixin template _workaround4424()
{
@disable void opAssign(typeof(this) );
}
mixin _workaround4424;
/**
Takes a slice of the tuple.
Example:
----
Tuple!(int, string, float, double) a;
a[1] = "abc";
a[2] = 4.5;
auto s = a.slice!(1, 3);
static assert(is(typeof(s) == Tuple!(string, float)));
assert(s[0] == "abc" && s[1] == 4.5);
----
*/
@property
ref Tuple!(sliceSpecs!(from, to)) slice(uint from, uint to)()
{
return *cast(typeof(return) *) &(field[from]);
}
/**
The length of the tuple.
*/
enum length = field.length;
/**
Converts to string.
*/
string toString()
{
enum header = typeof(this).stringof ~ "(",
footer = ")",
separator = ", ";
Appender!string app;
app.put(header);
foreach (i, Unused; Types)
{
static if (i > 0)
{
app.put(separator);
}
// TODO: Change this once toString() works for shared objects.
static if (is(Unused == class) && is(Unused == shared))
formattedWrite(app, "%s", field[i].stringof);
else
{
FormatSpec!char f; // "%s"
formatElement(app, field[i], f);
}
}
app.put(footer);
return app.data;
}
}
private template Identity(alias T)
{
alias T Identity;
}
unittest
{
{
Tuple!(int, "a", int, "b") nosh;
static assert(nosh.length == 2);
nosh.a = 5;
nosh.b = 6;
assert(nosh.a == 5);
assert(nosh.b == 6);
}
{
Tuple!(short, double) b;
static assert(b.length == 2);
b[1] = 5;
auto a = Tuple!(int, real)(b);
assert(a[0] == 0 && a[1] == 5);
a = Tuple!(int, real)(1, 2);
assert(a[0] == 1 && a[1] == 2);
auto c = Tuple!(int, "a", double, "b")(a);
assert(c[0] == 1 && c[1] == 2);
}
{
Tuple!(int, real) nosh;
nosh[0] = 5;
nosh[1] = 0;
assert(nosh[0] == 5 && nosh[1] == 0);
assert(nosh.toString() == "Tuple!(int, real)(5, 0)", nosh.toString());
Tuple!(int, int) yessh;
nosh = yessh;
}
{
Tuple!(int, string) t;
t[0] = 10;
t[1] = "str";
assert(t[0] == 10 && t[1] == "str");
assert(t.toString() == `Tuple!(int, string)(10, "str")`, t.toString());
}
{
Tuple!(int, "a", double, "b") x;
static assert(x.a.offsetof == x[0].offsetof);
static assert(x.b.offsetof == x[1].offsetof);
x.b = 4.5;
x.a = 5;
assert(x[0] == 5 && x[1] == 4.5);
assert(x.a == 5 && x.b == 4.5);
}
// indexing
{
Tuple!(int, real) t;
static assert(is(typeof(t[0]) == int));
static assert(is(typeof(t[1]) == real));
int* p0 = &t[0];
real* p1 = &t[1];
t[0] = 10;
t[1] = -200.0L;
assert(*p0 == t[0]);
assert(*p1 == t[1]);
}
// slicing
{
Tuple!(int, "x", real, "y", double, "z", string) t;
t[0] = 10;
t[1] = 11;
t[2] = 12;
t[3] = "abc";
auto a = t.slice!(0, 3);
assert(a.length == 3);
assert(a.x == t.x);
assert(a.y == t.y);
assert(a.z == t.z);
auto b = t.slice!(2, 4);
assert(b.length == 2);
assert(b.z == t.z);
assert(b[1] == t[3]);
}
// nesting
{
Tuple!(Tuple!(int, real), Tuple!(string, "s")) t;
static assert(is(typeof(t[0]) == Tuple!(int, real)));
static assert(is(typeof(t[1]) == Tuple!(string, "s")));
static assert(is(typeof(t[0][0]) == int));
static assert(is(typeof(t[0][1]) == real));
static assert(is(typeof(t[1].s) == string));
t[0] = tuple(10, 20.0L);
t[1].s = "abc";
assert(t[0][0] == 10);
assert(t[0][1] == 20.0L);
assert(t[1].s == "abc");
}
// non-POD
{
static struct S
{
int count;
this(this) { ++count; }
~this() { --count; }
void opAssign(S rhs) { count = rhs.count; }
}
Tuple!(S, S) ss;
Tuple!(S, S) ssCopy = ss;
assert(ssCopy[0].count == 1);
assert(ssCopy[1].count == 1);
ssCopy[1] = ssCopy[0];
assert(ssCopy[1].count == 2);
}
// bug 2800
{
static struct R
{
Tuple!(int, int) _front;
@property ref Tuple!(int, int) front() { return _front; }
@property bool empty() { return _front[0] >= 10; }
void popFront() { ++_front[0]; }
}
foreach (a; R())
{
static assert(is(typeof(a) == Tuple!(int, int)));
assert(0 <= a[0] && a[0] < 10);
assert(a[1] == 0);
}
}
// Construction with compatible elements
{
auto t1 = Tuple!(int, double)(1, 1);
// 8702
auto t8702a = tuple(tuple(1));
auto t8702b = Tuple!(Tuple!(int))(Tuple!(int)(1));
}
// Construction with compatible tuple
{
Tuple!(int, int) x;
x[0] = 10;
x[1] = 20;
Tuple!(int, "a", double, "b") y = x;
assert(y.a == 10);
assert(y.b == 20);
// incompatible
static assert(!__traits(compiles, Tuple!(int, int)(y)));
}
// 6275
{
const int x = 1;
auto t1 = tuple(x);
alias Tuple!(const(int)) T;
auto t2 = T(1);
}
}
unittest
{
// opEquals
{
struct Equ1 { bool opEquals(Equ1) { return true; } }
auto tm1 = tuple(Equ1.init);
const tc1 = tuple(Equ1.init);
static assert( is(typeof(tm1 == tm1)));
static assert(!is(typeof(tm1 == tc1)));
static assert(!is(typeof(tc1 == tm1)));
static assert(!is(typeof(tc1 == tc1)));
struct Equ2 { bool opEquals(const Equ2) const { return true; } }
auto tm2 = tuple(Equ2.init);
const tc2 = tuple(Equ2.init);
static assert( is(typeof(tm2 == tm2)));
static assert( is(typeof(tm2 == tc2)));
static assert( is(typeof(tc2 == tm2)));
static assert( is(typeof(tc2 == tc2)));
struct Equ3 { bool opEquals(T)(T) { return true; } }
auto tm3 = tuple(Equ3.init); // bugzilla 8686
const tc3 = tuple(Equ3.init);
static assert( is(typeof(tm3 == tm3)));
static assert( is(typeof(tm3 == tc3)));
static assert(!is(typeof(tc3 == tm3)));
static assert(!is(typeof(tc3 == tc3)));
struct Equ4 { bool opEquals(T)(T) const { return true; } }
auto tm4 = tuple(Equ4.init);
const tc4 = tuple(Equ4.init);
static assert( is(typeof(tm4 == tm4)));
static assert( is(typeof(tm4 == tc4)));
static assert( is(typeof(tc4 == tm4)));
static assert( is(typeof(tc4 == tc4)));
}
// opCmp
{
struct Cmp1 { int opCmp(Cmp1) { return 0; } }
auto tm1 = tuple(Cmp1.init);
const tc1 = tuple(Cmp1.init);
static assert( is(typeof(tm1 < tm1)));
static assert(!is(typeof(tm1 < tc1)));
static assert(!is(typeof(tc1 < tm1)));
static assert(!is(typeof(tc1 < tc1)));
struct Cmp2 { int opCmp(const Cmp2) const { return 0; } }
auto tm2 = tuple(Cmp2.init);
const tc2 = tuple(Cmp2.init);
static assert( is(typeof(tm2 < tm2)));
static assert( is(typeof(tm2 < tc2)));
static assert( is(typeof(tc2 < tm2)));
static assert( is(typeof(tc2 < tc2)));
struct Cmp3 { int opCmp(T)(T) { return 0; } }
auto tm3 = tuple(Cmp3.init);
const tc3 = tuple(Cmp3.init);
static assert( is(typeof(tm3 < tm3)));
static assert( is(typeof(tm3 < tc3)));
static assert(!is(typeof(tc3 < tm3)));
static assert(!is(typeof(tc3 < tc3)));
struct Cmp4 { int opCmp(T)(T) const { return 0; } }
auto tm4 = tuple(Cmp4.init);
const tc4 = tuple(Cmp4.init);
static assert( is(typeof(tm4 < tm4)));
static assert( is(typeof(tm4 < tc4)));
static assert( is(typeof(tc4 < tm4)));
static assert( is(typeof(tc4 < tc4)));
}
}
/**
Returns a $(D Tuple) object instantiated and initialized according to
the arguments.
Example:
----
auto value = tuple(5, 6.7, "hello");
assert(value[0] == 5);
assert(value[1] == 6.7);
assert(value[2] == "hello");
----
*/
Tuple!T tuple(T...)(T args)
{
return typeof(return)(args);
}
/**
Returns $(D true) if and only if $(D T) is an instance of the
$(D Tuple) struct template.
*/
template isTuple(T)
{
static if (is(Unqual!T Unused : Tuple!Specs, Specs...))
{
enum isTuple = true;
}
else
{
enum isTuple = false;
}
}
unittest
{
static assert(isTuple!(Tuple!()));
static assert(isTuple!(Tuple!(int)));
static assert(isTuple!(Tuple!(int, real, string)));
static assert(isTuple!(Tuple!(int, "x", real, "y")));
static assert(isTuple!(Tuple!(int, Tuple!(real), string)));
static assert(isTuple!(const Tuple!(int)));
static assert(isTuple!(immutable Tuple!(int)));
static assert(!isTuple!(int));
static assert(!isTuple!(const int));
struct S {}
static assert(!isTuple!(S));
}
/**
$(D Rebindable!(T)) is a simple, efficient wrapper that behaves just
like an object of type $(D T), except that you can reassign it to
refer to another object. For completeness, $(D Rebindable!(T)) aliases
itself away to $(D T) if $(D T) is a non-const object type. However,
$(D Rebindable!(T)) does not compile if $(D T) is a non-class type.
Regular $(D const) object references cannot be reassigned:
----
class Widget { int x; int y() const { return a; } }
const a = new Widget;
a.y(); // fine
a.x = 5; // error! can't modify const a
a = new Widget; // error! can't modify const a
----
However, $(D Rebindable!(Widget)) does allow reassignment, while
otherwise behaving exactly like a $(D const Widget):
----
auto a = Rebindable!(const Widget)(new Widget);
a.y(); // fine
a.x = 5; // error! can't modify const a
a = new Widget; // fine
----
You may want to use $(D Rebindable) when you want to have mutable
storage referring to $(D const) objects, for example an array of
references that must be sorted in place. $(D Rebindable) does not
break the soundness of D's type system and does not incur any of the
risks usually associated with $(D cast).
*/
template Rebindable(T) if (is(T == class) || is(T == interface) || isArray!T)
{
static if (!is(T X == const U, U) && !is(T X == immutable U, U))
{
alias T Rebindable;
}
else static if (isArray!T)
{
alias const(ElementType!T)[] Rebindable;
}
else
{
struct Rebindable
{
private union
{
T original;
U stripped;
}
void opAssign(T another) pure nothrow
{
stripped = cast(U) another;
}
void opAssign(Rebindable another) pure nothrow
{
stripped = another.stripped;
}
static if (is(T == const U))
{
// safely assign immutable to const
void opAssign(Rebindable!(immutable U) another) pure nothrow
{
stripped = another.stripped;
}
}
this(T initializer) pure nothrow
{
opAssign(initializer);
}
@property ref inout(T) get() inout pure nothrow
{
return original;
}
alias get this;
}
}
}
/**
Convenience function for creating a $(D Rebindable) using automatic type
inference.
*/
Rebindable!T rebindable(T)(T obj)
if (is(T == class) || is(T == interface) || isArray!T)
{
typeof(return) ret;
ret = obj;
return ret;
}
/**
This function simply returns the $(D Rebindable) object passed in. It's useful
in generic programming cases when a given object may be either a regular
$(D class) or a $(D Rebindable).
*/
Rebindable!T rebindable(T)(Rebindable!T obj)
{
return obj;
}
unittest
{
interface CI { const int foo(); }
class C : CI {
int foo() const { return 42; }
@property int bar() const { return 23; }
}
Rebindable!(C) obj0;
static assert(is(typeof(obj0) == C));
Rebindable!(const(C)) obj1;
static assert(is(typeof(obj1.get) == const(C)), typeof(obj1.get).stringof);
static assert(is(typeof(obj1.stripped) == C));
obj1 = new C;
assert(obj1.get !is null);
obj1 = new const(C);
assert(obj1.get !is null);
Rebindable!(immutable(C)) obj2;
static assert(is(typeof(obj2.get) == immutable(C)));
static assert(is(typeof(obj2.stripped) == C));
obj2 = new immutable(C);
assert(obj1.get !is null);
// test opDot
assert(obj2.foo() == 42);
assert(obj2.bar == 23);
interface I { final int foo() const { return 42; } }
Rebindable!(I) obj3;
static assert(is(typeof(obj3) == I));
Rebindable!(const I) obj4;
static assert(is(typeof(obj4.get) == const I));
static assert(is(typeof(obj4.stripped) == I));
static assert(is(typeof(obj4.foo()) == int));
obj4 = new class I {};
Rebindable!(immutable C) obj5i;
Rebindable!(const C) obj5c;
obj5c = obj5c;
obj5c = obj5i;
obj5i = obj5i;
static assert(!__traits(compiles, obj5i = obj5c));
// Test the convenience functions.
auto obj5convenience = rebindable(obj5i);
assert(obj5convenience is obj5i);
auto obj6 = rebindable(new immutable(C));
static assert(is(typeof(obj6) == Rebindable!(immutable C)));
assert(obj6.foo() == 42);
auto obj7 = rebindable(new C);
CI interface1 = obj7;
auto interfaceRebind1 = rebindable(interface1);
assert(interfaceRebind1.foo() == 42);
const interface2 = interface1;
auto interfaceRebind2 = rebindable(interface2);
assert(interfaceRebind2.foo() == 42);
auto arr = [1,2,3,4,5];
const arrConst = arr;
assert(rebindable(arr) == arr);
assert(rebindable(arrConst) == arr);
}
/**
Order the provided members to minimize size while preserving alignment.
Returns a declaration to be mixed in.
Example:
---
struct Banner {
mixin(alignForSize!(byte[6], double)(["name", "height"]));
}
---
Alignment is not always optimal for 80-bit reals, nor for structs declared
as align(1).
*/
string alignForSize(E...)(string[] names...)
{
// Sort all of the members by .alignof.
// BUG: Alignment is not always optimal for align(1) structs
// or 80-bit reals or 64-bit primitives on x86.
// TRICK: Use the fact that .alignof is always a power of 2,
// and maximum 16 on extant systems. Thus, we can perform
// a very limited radix sort.
// Contains the members with .alignof = 64,32,16,8,4,2,1
assert(E.length == names.length,
"alignForSize: There should be as many member names as the types");
string[7] declaration = ["", "", "", "", "", "", ""];
foreach (i, T; E) {
auto a = T.alignof;
auto k = a>=64? 0 : a>=32? 1 : a>=16? 2 : a>=8? 3 : a>=4? 4 : a>=2? 5 : 6;
declaration[k] ~= T.stringof ~ " " ~ names[i] ~ ";\n";
}
auto s = "";
foreach (decl; declaration)
s ~= decl;
return s;
}
unittest {
enum x = alignForSize!(int[], char[3], short, double[5])("x", "y","z", "w");
struct Foo{ int x; }
enum y = alignForSize!(ubyte, Foo, cdouble)("x", "y","z");
static if(size_t.sizeof == uint.sizeof)
{
enum passNormalX = x == "double[5u] w;\nint[] x;\nshort z;\nchar[3u] y;\n";
enum passNormalY = y == "cdouble z;\nFoo y;\nubyte x;\n";
enum passAbnormalX = x == "int[] x;\ndouble[5u] w;\nshort z;\nchar[3u] y;\n";
enum passAbnormalY = y == "Foo y;\ncdouble z;\nubyte x;\n";
// ^ blame http://d.puremagic.com/issues/show_bug.cgi?id=231
static assert(passNormalX || double.alignof <= (int[]).alignof && passAbnormalX);
static assert(passNormalY || double.alignof <= int.alignof && passAbnormalY);
}
else
{
static assert(x == "int[] x;\ndouble[5LU] w;\nshort z;\nchar[3LU] y;\n");
static assert(y == "cdouble z;\nFoo y;\nubyte x;\n");
}
}
/*--*
First-class reference type
*/
struct Ref(T)
{
private T * _p;
this(ref T value) { _p = &value; }
ref T opDot() { return *_p; }
/*ref*/ T opImplicitCastTo() { return *_p; }
@property ref T value() { return *_p; }
void opAssign(T value)
{
*_p = value;
}
void opAssign(T * value)
{
_p = value;
}
}
unittest
{
Ref!(int) x;
int y = 42;
x = &y;
assert(x.value == 42);
x = 5;
assert(x.value == 5);
assert(y == 5);
}
/**
Defines a value paired with a distinctive "null" state that denotes
the absence of a value. If default constructed, a $(D
Nullable!T) object starts in the null state. Assigning it renders it
non-null. Calling $(D nullify) can nullify it again.
Example:
----
Nullable!int a;
assert(a.isNull);
a = 5;
assert(!a.isNull);
assert(a == 5);
----
Practically $(D Nullable!T) stores a $(D T) and a $(D bool).
*/
struct Nullable(T)
{
private T _value;
private bool _isNull = true;
/**
Constructor initializing $(D this) with $(D value).
*/
this()(T value)
{
_value = value;
_isNull = false;
}
/**
Returns $(D true) if and only if $(D this) is in the null state.
*/
@property bool isNull() const pure nothrow @safe
{
return _isNull;
}
/**
Forces $(D this) to the null state.
*/
void nullify()()
{
.destroy(_value);
_isNull = true;
}
//@@@BUG4424@@@
private mixin template _workaround4424()
{
@disable void opAssign(ref const Nullable);
}
mixin _workaround4424;
/**
Assigns $(D value) to the internally-held state. If the assignment
succeeds, $(D this) becomes non-null.
*/
void opAssign()(T value)
{
_value = value;
_isNull = false;
}
/**
Gets the value. Throws an exception if $(D this) is in the null
state. This function is also called for the implicit conversion to $(D
T).
*/
@property ref inout(T) get() inout pure @safe
{
enforce(!isNull);
return _value;
}
/**
Implicitly converts to $(D T). Throws an exception if $(D this) is in
the null state.
*/
alias get this;
}
unittest
{
Nullable!int a;
assert(a.isNull);
assertThrown(a.get);
a = 5;
assert(!a.isNull);
assert(a == 5);
assert(a != 3);
assert(a.get != 3);
a.nullify();
assert(a.isNull);
a = 3;
assert(a == 3);
a *= 6;
assert(a == 18);
a = a;
assert(a == 18);
a.nullify();
assertThrown(a += 2);
}
unittest
{
auto k = Nullable!int(74);
assert(k == 74);
k.nullify();
assert(k.isNull);
}
unittest
{
static int f(in Nullable!int x) {
return x.isNull ? 42 : x.get;
}
Nullable!int a;
assert(f(a) == 42);
a = 8;
assert(f(a) == 8);
a.nullify();
assert(f(a) == 42);
}
unittest
{
static struct S { int x; }
Nullable!S s;
assert(s.isNull);
s = S(6);
assert(s == S(6));
assert(s != S(0));
assert(s.get != S(0));
s.x = 9190;
assert(s.x == 9190);
s.nullify();
assertThrown(s.x = 9441);
}
unittest
{
// Ensure Nullable can be used in pure/nothrow/@safe environment.
function() pure nothrow @safe
{
Nullable!int n;
assert(n.isNull);
n = 4;
assert(!n.isNull);
try { assert(n == 4); } catch (Exception) { assert(false); }
n.nullify();
assert(n.isNull);
}();
}
unittest
{
// Ensure Nullable can be used when the value is not pure/nothrow/@safe
static struct S
{
int x;
this(this) @system {}
}
Nullable!S s;
assert(s.isNull);
s = S(5);
assert(!s.isNull);
assert(s.x == 5);
s.nullify();
assert(s.isNull);
}
/**
Just like $(D Nullable!T), except that the null state is defined as a
particular value. For example, $(D Nullable!(uint, uint.max)) is an
$(D uint) that sets aside the value $(D uint.max) to denote a null
state. $(D Nullable!(T, nullValue)) is more storage-efficient than $(D
Nullable!T) because it does not need to store an extra $(D bool).
*/
struct Nullable(T, T nullValue)
{
private T _value = nullValue;
/**
Constructor initializing $(D this) with $(D value).
*/
this()(T value)
{
_value = value;
}
/**
Returns $(D true) if and only if $(D this) is in the null state.
*/
@property bool isNull()() const
{
return _value == nullValue;
}
/**
Forces $(D this) to the null state.
*/
void nullify()()
{
_value = nullValue;
}
/**
Assigns $(D value) to the internally-held state. No null checks are
made.
*/
void opAssign()(T value)
{
_value = value;
}
/**
Gets the value. Throws an exception if $(D this) is in the null
state. This function is also called for the implicit conversion to $(D
T).
*/
@property ref inout(T) get()() inout
{
enforce(!isNull);
return _value;
}
/**
Implicitly converts to $(D T). Throws an exception if $(D this) is in
the null state.
*/
alias get this;
}
unittest
{
Nullable!(int, int.min) a;
assert(a.isNull);
assertThrown(a.get);
a = 5;
assert(!a.isNull);
assert(a == 5);
static assert(a.sizeof == int.sizeof);
}
unittest
{
auto a = Nullable!(int, int.min)(8);
assert(a == 8);
a.nullify();
assert(a.isNull);
}
unittest
{
static int f(in Nullable!(int, int.min) x) {
return x.isNull ? 42 : x.get;
}
Nullable!(int, int.min) a;
assert(f(a) == 42);
a = 8;
assert(f(a) == 8);
a.nullify();
assert(f(a) == 42);
}
unittest
{
// Ensure Nullable can be used in pure/nothrow/@safe environment.
function() pure nothrow @safe
{
Nullable!(int, int.min) n;
pragma(msg, typeof(&n.get!()));
assert(n.isNull);
n = 4;
assert(!n.isNull);
try { assert(n == 4); } catch (Exception) { assert(false); }
n.nullify();
assert(n.isNull);
}();
}
unittest
{
// Ensure Nullable can be used when the value is not pure/nothrow/@safe
static struct S
{
int x;
bool opEquals(const S s) const @system { return s.x == x; }
}
Nullable!(S, S(711)) s;
assert(s.isNull);
s = S(5);
assert(!s.isNull);
assert(s.x == 5);
s.nullify();
assert(s.isNull);
}
/**
Just like $(D Nullable!T), except that the object refers to a value
sitting elsewhere in memory. This makes assignments overwrite the
initially assigned value. Internally $(D NullableRef!T) only stores a
pointer to $(D T) (i.e., $(D Nullable!T.sizeof == (T*).sizeof)).
*/
struct NullableRef(T)
{
private T* _value;
/**
Constructor binding $(D this) with $(D value).
*/
this(T * value) pure nothrow @safe
{
_value = value;
}
/**
Binds the internal state to $(D value).
*/
void bind(T * value) pure nothrow @safe
{
_value = value;
}
/**
Returns $(D true) if and only if $(D this) is in the null state.
*/
@property bool isNull() const pure nothrow @safe
{
return _value is null;
}
/**
Forces $(D this) to the null state.
*/
void nullify() pure nothrow @safe
{
_value = null;
}
/**
Assigns $(D value) to the internally-held state.
*/
void opAssign()(T value)
{
enforce(_value);
*_value = value;
}
/**
Gets the value. Throws an exception if $(D this) is in the null
state. This function is also called for the implicit conversion to $(D
T).
*/
@property ref inout(T) get()() inout
{
enforce(!isNull);
return *_value;
}
/**
Implicitly converts to $(D T). Throws an exception if $(D this) is in
the null state.
*/
alias get this;
}
unittest
{
int x = 5, y = 7;
auto a = NullableRef!(int)(&x);
assert(!a.isNull);
assert(a == 5);
assert(x == 5);
a = 42;
assert(x == 42);
assert(!a.isNull);
assert(a == 42);
a.nullify();
assert(x == 42);
assert(a.isNull);
assertThrown(a.get);
assertThrown(a = 71);
a.bind(&y);
assert(a == 7);
y = 135;
assert(a == 135);
}
unittest
{
static int f(in NullableRef!int x) {
return x.isNull ? 42 : x.get;
}
int x = 5;
auto a = NullableRef!int(&x);
assert(f(a) == 5);
a.nullify();
assert(f(a) == 42);
}
unittest
{
// Ensure NullableRef can be used in pure/nothrow/@safe environment.
function() pure nothrow @safe
{
auto storage = new int;
*storage = 19902;
NullableRef!int n;
assert(n.isNull);
n.bind(storage);
assert(!n.isNull);
try
{
assert(n == 19902);
n = 2294;
assert(n == 2294);
}
catch (Exception)
{
assert(false);
}
assert(*storage == 2294);
n.nullify();
assert(n.isNull);
}();
}
unittest
{
// Ensure NullableRef can be used when the value is not pure/nothrow/@safe
static struct S
{
int x;
this(this) @system {}
bool opEquals(const S s) const @system { return s.x == x; }
}
auto storage = S(5);
NullableRef!S s;
assert(s.isNull);
s.bind(&storage);
assert(!s.isNull);
assert(s.x == 5);
s.nullify();
assert(s.isNull);
}
/**
$(D BlackHole!Base) is a subclass of $(D Base) which automatically implements
all abstract member functions in $(D Base) as do-nothing functions. Each
auto-implemented function just returns the default value of the return type
without doing anything.
The name came from
$(WEB search.cpan.org/~sburke/Class-_BlackHole-0.04/lib/Class/_BlackHole.pm, Class::_BlackHole)
Perl module by Sean M. Burke.
Example:
--------------------
abstract class C
{
int m_value;
this(int v) { m_value = v; }
int value() @property { return m_value; }
abstract real realValue() @property;
abstract void doSomething();
}
void main()
{
auto c = new BlackHole!C(42);
writeln(c.value); // prints "42"
// Abstract functions are implemented as do-nothing:
writeln(c.realValue); // prints "NaN"
c.doSomething(); // does nothing
}
--------------------
See_Also:
AutoImplement, generateEmptyFunction
*/
template BlackHole(Base)
{
alias AutoImplement!(Base, generateEmptyFunction, isAbstractFunction)
BlackHole;
}
unittest
{
// return default
{
interface I_1 { real test(); }
auto o = new BlackHole!I_1;
assert(o.test() !<>= 0); // NaN
}
// doc example
{
static class C
{
int m_value;
this(int v) { m_value = v; }
int value() @property { return m_value; }
abstract real realValue() @property;
abstract void doSomething();
}
auto c = new BlackHole!C(42);
assert(c.value == 42);
assert(c.realValue !<>= 0); // NaN
c.doSomething();
}
}
/**
$(D WhiteHole!Base) is a subclass of $(D Base) which automatically implements
all abstract member functions as throw-always functions. Each auto-implemented
function fails with throwing an $(D Error) and does never return. Useful for
trapping use of not-yet-implemented functions.
The name came from
$(WEB search.cpan.org/~mschwern/Class-_WhiteHole-0.04/lib/Class/_WhiteHole.pm, Class::_WhiteHole)
Perl module by Michael G Schwern.
Example:
--------------------
class C
{
abstract void notYetImplemented();
}
void main()
{
auto c = new WhiteHole!C;
c.notYetImplemented(); // throws an Error
}
--------------------
BUGS:
Nothrow functions cause program to abort in release mode because the trap is
implemented with $(D assert(0)) for nothrow functions.
See_Also:
AutoImplement, generateAssertTrap
*/
template WhiteHole(Base)
{
alias AutoImplement!(Base, generateAssertTrap, isAbstractFunction)
WhiteHole;
}
// / ditto
class NotImplementedError : Error
{
this(string method)
{
super(method ~ " is not implemented");
}
}
unittest
{
// nothrow
debug // see the BUGS above
{
interface I_1
{
void foo();
void bar() nothrow;
}
auto o = new WhiteHole!I_1;
uint trap;
try { o.foo(); } catch (Error e) { ++trap; }
assert(trap == 1);
try { o.bar(); } catch (Error e) { ++trap; }
assert(trap == 2);
}
// doc example
{
static class C
{
abstract void notYetImplemented();
}
auto c = new WhiteHole!C;
try
{
c.notYetImplemented();
assert(0);
}
catch (Error e) {}
}
}
/**
$(D AutoImplement) automatically implements (by default) all abstract member
functions in the class or interface $(D Base) in specified way.
Params:
how = template which specifies _how functions will be implemented/overridden.
Two arguments are passed to $(D how): the type $(D Base) and an alias
to an implemented function. Then $(D how) must return an implemented
function body as a string.
The generated function body can use these keywords:
$(UL
$(LI $(D a0), $(D a1), …: arguments passed to the function;)
$(LI $(D args): a tuple of the arguments;)
$(LI $(D self): an alias to the function itself;)
$(LI $(D parent): an alias to the overridden function (if any).)
)
You may want to use templated property functions (instead of Implicit
Template Properties) to generate complex functions:
--------------------
// Prints log messages for each call to overridden functions.
string generateLogger(C, alias fun)() @property
{
enum qname = C.stringof ~ "." ~ __traits(identifier, fun);
string stmt;
stmt ~= q{ struct Importer { import std.stdio; } };
stmt ~= `Importer.writeln$(LPAREN)"Log: ` ~ qname ~ `(", args, ")"$(RPAREN);`;
static if (!__traits(isAbstractFunction, fun))
{
static if (is(typeof(return) == void))
stmt ~= q{ parent(args); };
else
stmt ~= q{
auto r = parent(args);
Importer.writeln("--> ", r);
return r;
};
}
return stmt;
}
--------------------
what = template which determines _what functions should be
implemented/overridden.
An argument is passed to $(D what): an alias to a non-final member
function in $(D Base). Then $(D what) must return a boolean value.
Return $(D true) to indicate that the passed function should be
implemented/overridden.
--------------------
// Sees if fun returns something.
template hasValue(alias fun)
{
enum bool hasValue = !is(ReturnType!(fun) == void);
}
--------------------
Note:
Generated code is inserted in the scope of $(D std.typecons) module. Thus,
any useful functions outside $(D std.typecons) cannot be used in the generated
code. To workaround this problem, you may $(D import) necessary things in a
local struct, as done in the $(D generateLogger()) template in the above
example.
BUGS:
$(UL
$(LI Variadic arguments to constructors are not forwarded to super.)
$(LI Deep interface inheritance causes compile error with messages like
"Error: function std.typecons._AutoImplement!(Foo)._AutoImplement.bar
does not override any function". [$(BUGZILLA 2525), $(BUGZILLA 3525)] )
$(LI The $(D parent) keyword is actually a delegate to the super class'
corresponding member function. [$(BUGZILLA 2540)] )
$(LI Using alias template parameter in $(D how) and/or $(D what) may cause
strange compile error. Use template tuple parameter instead to workaround
this problem. [$(BUGZILLA 4217)] )
)
*/
class AutoImplement(Base, alias how, alias what = isAbstractFunction) : Base
{
private alias AutoImplement_Helper!(
"autoImplement_helper_", "Base", Base, how, what )
autoImplement_helper_;
mixin(autoImplement_helper_.code);
}
/*
* Code-generating stuffs are encupsulated in this helper template so that
* namespace pollusion, which can cause name confliction with Base's public
* members, should be minimized.
*/
private template AutoImplement_Helper(string myName, string baseName,
Base, alias generateMethodBody, alias cherrypickMethod)
{
private static:
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Internal stuffs
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// this would be deprecated by std.typelist.Filter
template staticFilter(alias pred, lst...)
{
static if (lst.length > 0)
{
alias staticFilter!(pred, lst[1 .. $]) tail;
//
static if (pred!(lst[0]))
alias TypeTuple!(lst[0], tail) staticFilter;
else
alias tail staticFilter;
}
else
alias TypeTuple!() staticFilter;
}
// Returns function overload sets in the class C, filtered with pred.
template enumerateOverloads(C, alias pred)
{
template Impl(names...)
{
static if (names.length > 0)
{
alias staticFilter!(pred, MemberFunctionsTuple!(C, names[0])) methods;
alias Impl!(names[1 .. $]) next;
static if (methods.length > 0)
alias TypeTuple!(OverloadSet!(names[0], methods), next) Impl;
else
alias next Impl;
}
else
alias TypeTuple!() Impl;
}
alias Impl!(__traits(allMembers, C)) enumerateOverloads;
}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Target functions
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Add a non-final check to the cherrypickMethod.
template canonicalPicker(fun.../+[BUG 4217]+/)
{
enum bool canonicalPicker = !__traits(isFinalFunction, fun[0]) &&
cherrypickMethod!(fun);
}
/*
* A tuple of overload sets, each item of which consists of functions to be
* implemented by the generated code.
*/
alias enumerateOverloads!(Base, canonicalPicker) targetOverloadSets;
/*
* A tuple of the super class' constructors. Used for forwarding
* constructor calls.
*/
static if (__traits(hasMember, Base, "__ctor"))
alias OverloadSet!("__ctor", __traits(getOverloads, Base, "__ctor"))
ctorOverloadSet;
else
alias OverloadSet!("__ctor") ctorOverloadSet; // empty
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Type information
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/*
* The generated code will be mixed into AutoImplement, which will be
* instantiated in this module's scope. Thus, any user-defined types are
* out of scope and cannot be used directly (i.e. by their names).
*
* We will use FuncInfo instances for accessing return types and parameter
* types of the implemented functions. The instances will be populated to
* the AutoImplement's scope in a certain way; see the populate() below.
*/
// Returns the preferred identifier for the FuncInfo instance for the i-th
// overloaded function with the name.
template INTERNAL_FUNCINFO_ID(string name, size_t i)
{
enum string INTERNAL_FUNCINFO_ID = "F_" ~ name ~ "_" ~ toStringNow!(i);
}
/*
* Insert FuncInfo instances about all the target functions here. This
* enables the generated code to access type information via, for example,
* "autoImplement_helper_.F_foo_1".
*/
template populate(overloads...)
{
static if (overloads.length > 0)
{
mixin populate!(overloads[0].name, overloads[0].contents);
mixin populate!(overloads[1 .. $]);
}
}
template populate(string name, methods...)
{
static if (methods.length > 0)
{
mixin populate!(name, methods[0 .. $ - 1]);
//
alias methods[$ - 1] target;
enum ith = methods.length - 1;
mixin( "alias FuncInfo!(target) " ~
INTERNAL_FUNCINFO_ID!(name, ith) ~ ";" );
}
}
public mixin populate!(targetOverloadSets);
public mixin populate!( ctorOverloadSet );
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Code-generating policies
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/* Common policy configurations for generating constructors and methods. */
template CommonGeneratingPolicy()
{
// base class identifier which generated code should use
enum string BASE_CLASS_ID = baseName;
// FuncInfo instance identifier which generated code should use
template FUNCINFO_ID(string name, size_t i)
{
enum string FUNCINFO_ID =
myName ~ "." ~ INTERNAL_FUNCINFO_ID!(name, i);
}
}
/* Policy configurations for generating constructors. */
template ConstructorGeneratingPolicy()
{
mixin CommonGeneratingPolicy;
/* Generates constructor body. Just forward to the base class' one. */
string generateFunctionBody(ctor.../+[BUG 4217]+/)() @property
{
enum varstyle = variadicFunctionStyle!(typeof(&ctor[0]));
static if (varstyle & (Variadic.c | Variadic.d))
{
// the argptr-forwarding problem
pragma(msg, "Warning: AutoImplement!(", Base, ") ",
"ignored variadic arguments to the constructor ",
FunctionTypeOf!(typeof(&ctor[0])) );
}
return "super(args);";
}
}
/* Policy configurations for genearting target methods. */
template MethodGeneratingPolicy()
{
mixin CommonGeneratingPolicy;
/* Geneartes method body. */
string generateFunctionBody(func.../+[BUG 4217]+/)() @property
{
return generateMethodBody!(Base, func); // given
}
}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Generated code
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
alias MemberFunctionGenerator!( ConstructorGeneratingPolicy!() )
ConstructorGenerator;
alias MemberFunctionGenerator!( MethodGeneratingPolicy!() )
MethodGenerator;
public enum string code =
ConstructorGenerator.generateCode!( ctorOverloadSet ) ~ "\n" ~
MethodGenerator.generateCode!(targetOverloadSets);
debug (SHOW_GENERATED_CODE)
{
pragma(msg, "-------------------- < ", Base, " >");
pragma(msg, code);
pragma(msg, "--------------------");
}
}
//debug = SHOW_GENERATED_CODE;
version(unittest) import core.vararg;
unittest
{
// no function to implement
{
interface I_1 {}
auto o = new BlackHole!I_1;
}
// parameters
{
interface I_3 { void test(int, in int, out int, ref int, lazy int); }
auto o = new BlackHole!I_3;
}
// use of user-defined type
{
struct S {}
interface I_4 { S test(); }
auto o = new BlackHole!I_4;
}
// overloads
{
interface I_5
{
void test(string);
real test(real);
int test();
int test() @property; // ?
}
auto o = new BlackHole!I_5;
}
// constructor forwarding
{
static class C_6
{
this(int n) { assert(n == 42); }
this(string s) { assert(s == "Deeee"); }
this(...) {}
}
auto o1 = new BlackHole!C_6(42);
auto o2 = new BlackHole!C_6("Deeee");
auto o3 = new BlackHole!C_6(1, 2, 3, 4);
}
// attributes
{
interface I_7
{
ref int test_ref();
int test_pure() pure;
int test_nothrow() nothrow;
int test_property() @property;
int test_safe() @safe;
int test_trusted() @trusted;
int test_system() @system;
int test_pure_nothrow() pure nothrow;
}
auto o = new BlackHole!I_7;
}
// storage classes
{
interface I_8
{
void test_const() const;
void test_immutable() immutable;
void test_shared() shared;
void test_shared_const() shared const;
}
auto o = new BlackHole!I_8;
}
/+ // deep inheritance
{
// XXX [BUG 2525,3525]
// NOTE: [r494] func.c(504-571) FuncDeclaration::semantic()
interface I { void foo(); }
interface J : I {}
interface K : J {}
static abstract class C_9 : K {}
auto o = new BlackHole!C_9;
}+/
}
/*
Used by MemberFunctionGenerator.
*/
package template OverloadSet(string nam, T...)
{
enum string name = nam;
alias T contents;
}
/*
Used by MemberFunctionGenerator.
*/
package template FuncInfo(alias func, /+[BUG 4217 ?]+/ T = typeof(&func))
{
alias ReturnType!(T) RT;
alias ParameterTypeTuple!(T) PT;
}
package template FuncInfo(Func)
{
alias ReturnType!(Func) RT;
alias ParameterTypeTuple!(Func) PT;
}
/*
General-purpose member function generator.
--------------------
template GeneratingPolicy()
{
// [optional] the name of the class where functions are derived
enum string BASE_CLASS_ID;
// [optional] define this if you have only function types
enum bool WITHOUT_SYMBOL;
// [optional] Returns preferred identifier for i-th parameter.
template PARAMETER_VARIABLE_ID(size_t i);
// Returns the identifier of the FuncInfo instance for the i-th overload
// of the specified name. The identifier must be accessible in the scope
// where generated code is mixed.
template FUNCINFO_ID(string name, size_t i);
// Returns implemented function body as a string. When WITHOUT_SYMBOL is
// defined, the latter is used.
template generateFunctionBody(alias func);
template generateFunctionBody(string name, FuncType);
}
--------------------
*/
package template MemberFunctionGenerator(alias Policy)
{
private static:
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Internal stuffs
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
enum CONSTRUCTOR_NAME = "__ctor";
// true if functions are derived from a base class
enum WITH_BASE_CLASS = __traits(hasMember, Policy, "BASE_CLASS_ID");
// true if functions are specified as types, not symbols
enum WITHOUT_SYMBOL = __traits(hasMember, Policy, "WITHOUT_SYMBOL");
// preferred identifier for i-th parameter variable
static if (__traits(hasMember, Policy, "PARAMETER_VARIABLE_ID"))
{
alias Policy.PARAMETER_VARIABLE_ID PARAMETER_VARIABLE_ID;
}
else
{
template PARAMETER_VARIABLE_ID(size_t i)
{
enum string PARAMETER_VARIABLE_ID = "a" ~ toStringNow!(i);
// default: a0, a1, ...
}
}
// Returns a tuple consisting of 0,1,2,...,n-1. For static foreach.
template CountUp(size_t n)
{
static if (n > 0)
alias TypeTuple!(CountUp!(n - 1), n - 1) CountUp;
else
alias TypeTuple!() CountUp;
}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
// Code generator
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/*
* Runs through all the target overload sets and generates D code which
* implements all the functions in the overload sets.
*/
public string generateCode(overloads...)() @property
{
string code = "";
// run through all the overload sets
foreach (i_; CountUp!(0 + overloads.length)) // workaround
{
enum i = 0 + i_; // workaround
alias overloads[i] oset;
code ~= generateCodeForOverloadSet!(oset);
static if (WITH_BASE_CLASS && oset.name != CONSTRUCTOR_NAME)
{
// The generated function declarations may hide existing ones
// in the base class (cf. HiddenFuncError), so we put an alias
// declaration here to reveal possible hidden functions.
code ~= Format!("alias %s.%s %s;\n",
Policy.BASE_CLASS_ID, // [BUG 2540] super.
oset.name, oset.name );
}
}
return code;
}
// handle each overload set
private string generateCodeForOverloadSet(alias oset)() @property
{
string code = "";
foreach (i_; CountUp!(0 + oset.contents.length)) // workaround
{
enum i = 0 + i_; // workaround
code ~= generateFunction!(
Policy.FUNCINFO_ID!(oset.name, i), oset.name,
oset.contents[i]) ~ "\n";
}
return code;
}
/*
* Returns D code which implements the function func. This function
* actually generates only the declarator part; the function body part is
* generated by the functionGenerator() policy.
*/
public string generateFunction(
string myFuncInfo, string name, func... )() @property
{
enum isCtor = (name == CONSTRUCTOR_NAME);
string code; // the result
/*** Function Declarator ***/
{
alias FunctionTypeOf!(func) Func;
alias FunctionAttribute FA;
enum atts = functionAttributes!(func);
enum realName = isCtor ? "this" : name;
/* Made them CTFE funcs just for the sake of Format!(...) */
// return type with optional "ref"
static string make_returnType()
{
string rtype = "";
if (!isCtor)
{
if (atts & FA.ref_) rtype ~= "ref ";
rtype ~= myFuncInfo ~ ".RT";
}
return rtype;
}
enum returnType = make_returnType();
// function attributes attached after declaration
static string make_postAtts()
{
string poatts = "";
if (atts & FA.pure_ ) poatts ~= " pure";
if (atts & FA.nothrow_) poatts ~= " nothrow";
if (atts & FA.property) poatts ~= " @property";
if (atts & FA.safe ) poatts ~= " @safe";
if (atts & FA.trusted ) poatts ~= " @trusted";
return poatts;
}
enum postAtts = make_postAtts();
// function storage class
static string make_storageClass()
{
string postc = "";
if (is(Func == shared)) postc ~= " shared";
if (is(Func == const)) postc ~= " const";
if (is(Func == immutable)) postc ~= " immutable";
return postc;
}
enum storageClass = make_storageClass();
//
if (isAbstractFunction!func)
code ~= "override ";
code ~= Format!("extern(%s) %s %s(%s) %s %s\n",
functionLinkage!(func),
returnType,
realName,
generateParameters!(myFuncInfo, func)(),
postAtts, storageClass );
}
/*** Function Body ***/
code ~= "{\n";
{
enum nparams = ParameterTypeTuple!(func).length;
/* Declare keywords: args, self and parent. */
string preamble;
preamble ~= "alias TypeTuple!(" ~ enumerateParameters!(nparams) ~ ") args;\n";
if (!isCtor)
{
preamble ~= "alias " ~ name ~ " self;\n";
if (WITH_BASE_CLASS && !__traits(isAbstractFunction, func))
//preamble ~= "alias super." ~ name ~ " parent;\n"; // [BUG 2540]
preamble ~= "auto parent = &super." ~ name ~ ";\n";
}
// Function body
static if (WITHOUT_SYMBOL)
enum fbody = Policy.generateFunctionBody!(name, func);
else
enum fbody = Policy.generateFunctionBody!(func);
code ~= preamble;
code ~= fbody;
}
code ~= "}";
return code;
}
/*
* Returns D code which declares function parameters.
* "ref int a0, real a1, ..."
*/
private string generateParameters(string myFuncInfo, func...)()
{
alias ParameterStorageClass STC;
alias ParameterStorageClassTuple!(func) stcs;
enum nparams = stcs.length;
string params = ""; // the result
foreach (i, stc; stcs)
{
if (i > 0) params ~= ", ";
// Parameter storage classes.
if (stc & STC.scope_) params ~= "scope ";
if (stc & STC.out_ ) params ~= "out ";
if (stc & STC.ref_ ) params ~= "ref ";
if (stc & STC.lazy_ ) params ~= "lazy ";
// Take parameter type from the FuncInfo.
params ~= myFuncInfo ~ ".PT[" ~ toStringNow!(i) ~ "]";
// Declare a parameter variable.
params ~= " " ~ PARAMETER_VARIABLE_ID!(i);
}
// Add some ellipsis part if needed.
final switch (variadicFunctionStyle!(func))
{
case Variadic.no:
break;
case Variadic.c, Variadic.d:
// (...) or (a, b, ...)
params ~= (nparams == 0) ? "..." : ", ...";
break;
case Variadic.typesafe:
params ~= " ...";
break;
}
return params;
}
// Returns D code which enumerates n parameter variables using comma as the
// separator. "a0, a1, a2, a3"
private string enumerateParameters(size_t n)() @property
{
string params = "";
foreach (i_; CountUp!(n))
{
enum i = 0 + i_; // workaround
if (i > 0) params ~= ", ";
params ~= PARAMETER_VARIABLE_ID!(i);
}
return params;
}
}
/**
Predefined how-policies for $(D AutoImplement). These templates are used by
$(D BlackHole) and $(D WhiteHole), respectively.
*/
template generateEmptyFunction(C, func.../+[BUG 4217]+/)
{
static if (is(ReturnType!(func) == void))
enum string generateEmptyFunction = q{
};
else static if (functionAttributes!(func) & FunctionAttribute.ref_)
enum string generateEmptyFunction = q{
static typeof(return) dummy;
return dummy;
};
else
enum string generateEmptyFunction = q{
return typeof(return).init;
};
}
/// ditto
template generateAssertTrap(C, func.../+[BUG 4217]+/)
{
static if (functionAttributes!(func) & FunctionAttribute.nothrow_) //XXX
{
pragma(msg, "Warning: WhiteHole!(", C, ") used assert(0) instead "
"of Error for the auto-implemented nothrow function ",
C, ".", __traits(identifier, func));
enum string generateAssertTrap =
`assert(0, "` ~ C.stringof ~ "." ~ __traits(identifier, func)
~ ` is not implemented");`;
}
else
enum string generateAssertTrap =
`throw new NotImplementedError("` ~ C.stringof ~ "."
~ __traits(identifier, func) ~ `");`;
}
/**
Options regarding auto-initialization of a $(D RefCounted) object (see
the definition of $(D RefCounted) below).
*/
enum RefCountedAutoInitialize
{
/// Do not auto-initialize the object
no,
/// Auto-initialize the object
yes,
}
/**
Defines a reference-counted object containing a $(D T) value as
payload. $(D RefCounted) keeps track of all references of an object,
and when the reference count goes down to zero, frees the underlying
store. $(D RefCounted) uses $(D malloc) and $(D free) for operation.
$(D RefCounted) is unsafe and should be used with care. No references
to the payload should be escaped outside the $(D RefCounted) object.
The $(D autoInit) option makes the object ensure the store is
automatically initialized. Leaving $(D autoInit ==
RefCountedAutoInitialize.yes) (the default option) is convenient but
has the cost of a test whenever the payload is accessed. If $(D
autoInit == RefCountedAutoInitialize.no), user code must call either
$(D refCountedIsInitialized) or $(D refCountedEnsureInitialized)
before attempting to access the payload. Not doing so results in null
pointer dereference.
Example:
----
// A pair of an $(D int) and a $(D size_t) - the latter being the
// reference count - will be dynamically allocated
auto rc1 = RefCounted!int(5);
assert(rc1 == 5);
// No more allocation, add just one extra reference count
auto rc2 = rc1;
// Reference semantics
rc2 = 42;
assert(rc1 == 42);
// the pair will be freed when rc1 and rc2 go out of scope
----
*/
struct RefCounted(T, RefCountedAutoInitialize autoInit =
RefCountedAutoInitialize.yes)
if (!is(T == class))
{
/// $(D RefCounted) storage implementation.
struct RefCountedStore
{
private struct Impl
{
T _payload;
size_t _count;
}
private Impl* _store;
private void initialize(A...)(auto ref A args)
{
_store = cast(Impl*) enforce(malloc(Impl.sizeof));
static if (hasIndirections!T)
GC.addRange(&_store._payload, T.sizeof);
emplace(&_store._payload, args);
_store._count = 1;
}
/**
Returns $(D true) if and only if the underlying store has been
allocated and initialized.
*/
@property nothrow @safe
bool isInitialized() const
{
return _store !is null;
}
/**
Returns underlying reference count if it is allocated and initialized
(a positive integer), and $(D 0) otherwise.
*/
@property nothrow @safe
size_t refCount() const
{
return isInitialized ? _store._count : 0;
}
/**
Makes sure the payload was properly initialized. Such a
call is typically inserted before using the payload.
*/
void ensureInitialized()
{
if (!isInitialized) initialize();
}
}
RefCountedStore _refCounted;
/// Returns storage implementation struct.
@property nothrow @safe
ref inout(RefCountedStore) refCountedStore() inout
{
return _refCounted;
}
/**
Constructor that initializes the payload.
Postcondition: $(D refCountedIsInitialized)
*/
this(A...)(auto ref A args) if (A.length > 0)
{
_refCounted.initialize(args);
}
/**
Constructor that tracks the reference count appropriately. If $(D
!refCountedIsInitialized), does nothing.
*/
this(this)
{
if (!_refCounted.isInitialized) return;
++_refCounted._store._count;
}
/**
Destructor that tracks the reference count appropriately. If $(D
!refCountedIsInitialized), does nothing. When the reference count goes
down to zero, calls $(D destroy) agaist the payload and calls $(D free)
to deallocate the corresponding resource.
*/
~this()
{
if (!_refCounted.isInitialized) return;
assert(_refCounted._store._count > 0);
if (--_refCounted._store._count)
return;
// Done, deallocate
.destroy(_refCounted._store._payload);
static if (hasIndirections!T)
GC.removeRange(&_refCounted._store._payload);
free(_refCounted._store);
_refCounted._store = null;
}
/**
Assignment operators
*/
void opAssign(typeof(this) rhs)
{
swap(_refCounted._store, rhs._refCounted._store);
}
/// Ditto
void opAssign(T rhs)
{
static if (autoInit == RefCountedAutoInitialize.yes)
{
_refCounted.ensureInitialized();
}
else
{
assert(_refCounted.isInitialized);
}
move(rhs, _refCounted._store._payload);
}
//version to have a single properly ddoc'ed function (w/ correct sig)
version(StdDdoc)
{
/**
Returns a reference to the payload. If (autoInit ==
RefCountedAutoInitialize.yes), calls $(D
refCountedEnsureInitialized). Otherwise, just issues $(D
assert(refCountedIsInitialized)). Used with $(D alias
refCountedPayload this;), so callers can just use the $(D RefCounted)
object as a $(D T).
$(BLUE The first overload exists only if $(D autoInit == RefCountedAutoInitialize.yes).)
So if $(D autoInit == RefCountedAutoInitialize.no)
or called for a constant or immutable object, then
$(D refCountedPayload) will also be qualified as safe and nothrow
(but will still assert if not initialized).
*/
@property
ref T refCountedPayload();
/// ditto
@property nothrow @safe
ref inout(T) refCountedPayload() inout;
}
else
{
static if (autoInit == RefCountedAutoInitialize.yes)
{
//Can't use inout here because of potential mutation
@property
ref T refCountedPayload()
{
_refCounted.ensureInitialized();
return _refCounted._store._payload;
}
}
@property nothrow @safe
ref inout(T) refCountedPayload() inout
{
assert(_refCounted.isInitialized);
return _refCounted._store._payload;
}
}
/**
Returns a reference to the payload. If (autoInit ==
RefCountedAutoInitialize.yes), calls $(D
refCountedEnsureInitialized). Otherwise, just issues $(D
assert(refCountedIsInitialized)).
*/
alias refCountedPayload this;
}
unittest
{
RefCounted!int* p;
{
auto rc1 = RefCounted!int(5);
p = &rc1;
assert(rc1 == 5);
assert(rc1._refCounted._store._count == 1);
auto rc2 = rc1;
assert(rc1._refCounted._store._count == 2);
// Reference semantics
rc2 = 42;
assert(rc1 == 42);
rc2 = rc2;
assert(rc2._refCounted._store._count == 2);
rc1 = rc2;
assert(rc1._refCounted._store._count == 2);
}
assert(p._refCounted._store == null);
// RefCounted as a member
struct A
{
RefCounted!int x;
this(int y)
{
x._refCounted.initialize(y);
}
A copy()
{
auto another = this;
return another;
}
}
auto a = A(4);
auto b = a.copy();
assert(a.x._refCounted._store._count == 2, "BUG 4356 still unfixed");
}
unittest
{
RefCounted!int p1, p2;
swap(p1, p2);
}
// 6606
unittest
{
union U {
size_t i;
void* p;
}
struct S {
U u;
}
alias RefCounted!S SRC;
}
// 6436
unittest
{
struct S { this(ref int val) { assert(val == 3); ++val; } }
int val = 3;
auto s = RefCounted!S(val);
assert(val == 4);
}
unittest
{
RefCounted!int a;
a = 5; //This should not assert
assert(a == 5);
RefCounted!int b;
b = a; //This should not assert either
assert(b == 5);
}
/**
Make proxy for $(D a).
Example:
----
struct MyInt
{
private int value;
mixin Proxy!value;
this(int n){ value = n; }
}
MyInt n = 10;
// Enable operations that original type has.
++n;
assert(n == 11);
assert(n * 2 == 22);
void func(int n) { }
// Disable implicit conversions to original type.
//int x = n;
//func(n);
----
*/
mixin template Proxy(alias a)
{
auto ref opEquals(this X)(auto ref typeof(this) b)
{
import std.algorithm;
static assert(startsWith(a.stringof, "this."));
return a == mixin("b."~a.stringof[5..$]); // remove "this."
}
auto ref opEquals(this X, B)(auto ref B b) if (!is(B == typeof(this)))
{
return a == b;
}
auto ref opCmp(this X, B)(auto ref B b)
if (!is(typeof(a.opCmp(b))) || !is(typeof(b.opCmp(a))))
{
static if (is(typeof(a.opCmp(b))))
return a.opCmp(b);
else static if (is(typeof(b.opCmp(a))))
return -b.opCmp(a);
else
return a < b ? -1 : a > b ? +1 : 0;
}
auto ref opCall(this X, Args...)(auto ref Args args) { return a(args); }
auto ref opCast(T, this X)() { return cast(T)a; }
auto ref opIndex(this X, D...)(auto ref D i) { return a[i]; }
auto ref opSlice(this X )() { return a[]; }
auto ref opSlice(this X, B, E)(auto ref B b, auto ref E e) { return a[b..e]; }
auto ref opUnary (string op, this X )() { return mixin(op~"a"); }
auto ref opIndexUnary(string op, this X, D...)(auto ref D i) { return mixin(op~"a[i]"); }
auto ref opSliceUnary(string op, this X )() { return mixin(op~"a[]"); }
auto ref opSliceUnary(string op, this X, B, E)(auto ref B b, auto ref E e) { return mixin(op~"a[b..e]"); }
auto ref opBinary (string op, this X, B)(auto ref B b) { return mixin("a "~op~" b"); }
auto ref opBinaryRight(string op, this X, B)(auto ref B b) { return mixin("b "~op~" a"); }
static if (!is(typeof(this) == class))
{
private import std.traits;
static if (isAssignable!(typeof(a), typeof(a)))
{
auto ref opAssign(this X)(auto ref typeof(this) v)
{
a = mixin("v."~a.stringof[5..$]); // remove "this."
return this;
}
}
else
{
@disable void opAssign(this X)(auto ref typeof(this) v);
}
}
auto ref opAssign (this X, V )(auto ref V v) if (!is(V == typeof(this))) { return a = v; }
auto ref opIndexAssign(this X, V, D...)(auto ref V v, auto ref D i) { return a[i] = v; }
auto ref opSliceAssign(this X, V )(auto ref V v) { return a[] = v; }
auto ref opSliceAssign(this X, V, B, E)(auto ref V v, auto ref B b, auto ref E e) { return a[b..e] = v; }
auto ref opOpAssign (string op, this X, V )(auto ref V v) { return mixin("a " ~op~"= v"); }
auto ref opIndexOpAssign(string op, this X, V, D...)(auto ref V v, auto ref D i) { return mixin("a[i] " ~op~"= v"); }
auto ref opSliceOpAssign(string op, this X, V )(auto ref V v) { return mixin("a[] " ~op~"= v"); }
auto ref opSliceOpAssign(string op, this X, V, B, E)(auto ref V v, auto ref B b, auto ref E e) { return mixin("a[b..e] "~op~"= v"); }
template opDispatch(string name)
{
static if (is(typeof(__traits(getMember, a, name)) == function))
{
// non template function
auto ref opDispatch(this X, Args...)(auto ref Args args) { return mixin("a."~name~"(args)"); }
}
else static if (is(typeof(mixin("a."~name))) || __traits(getOverloads, a, name).length != 0)
{
// field or property function
@property auto ref opDispatch(this X)() { return mixin("a."~name); }
@property auto ref opDispatch(this X, V)(auto ref V v) { return mixin("a."~name~" = v"); }
}
else
{
// member template
template opDispatch(T...)
{
auto ref opDispatch(this X, Args...)(auto ref Args args){ return mixin("a."~name~"!T(args)"); }
}
}
}
}
unittest
{
static struct MyInt
{
private int value;
mixin Proxy!value;
this(int n){ value = n; }
}
MyInt m = 10;
static assert(!__traits(compiles, { int x = m; }));
static assert(!__traits(compiles, { void func(int n){} func(m); }));
assert(m == 10);
assert(m != 20);
assert(m < 20);
assert(+m == 10);
assert(-m == -10);
assert(++m == 11);
assert(m++ == 11); assert(m == 12);
assert(--m == 11);
assert(m-- == 11); assert(m == 10);
assert(cast(double)m == 10.0);
assert(m + 10 == 20);
assert(m - 5 == 5);
assert(m * 20 == 200);
assert(m / 2 == 5);
assert(10 + m == 20);
assert(15 - m == 5);
assert(20 * m == 200);
assert(50 / m == 5);
m = m;
m = 20; assert(m == 20);
}
unittest
{
static struct MyArray
{
private int[] value;
mixin Proxy!value;
this(int[] arr){ value = arr; }
}
MyArray a = [1,2,3,4];
assert(a == [1,2,3,4]);
assert(a != [5,6,7,8]);
assert(+a[0] == 1);
version (LittleEndian)
assert(cast(ulong[])a == [0x0000_0002_0000_0001, 0x0000_0004_0000_0003]);
else
assert(cast(ulong[])a == [0x0000_0001_0000_0002, 0x0000_0003_0000_0004]);
assert(a ~ [10,11] == [1,2,3,4,10,11]);
assert(a[0] == 1);
//assert(a[] == [1,2,3,4]); // blocked by bug 2486
//assert(a[2..4] == [3,4]); // blocked by bug 2486
a = a;
a = [5,6,7,8]; assert(a == [5,6,7,8]);
a[0] = 0; assert(a == [0,6,7,8]);
a[] = 1; assert(a == [1,1,1,1]);
a[0..3] = 2; assert(a == [2,2,2,1]);
a[0] += 2; assert(a == [4,2,2,1]);
a[] *= 2; assert(a == [8,4,4,2]);
a[0..2] /= 2; assert(a == [4,2,4,2]);
}
unittest
{
class Foo
{
int field;
@property const int val1(){ return field; }
@property void val1(int n){ field = n; }
@property ref int val2(){ return field; }
const int func(int x, int y){ return x; }
void func1(ref int a){ a = 9; }
T opCast(T)(){ return T.init; }
T tempfunc(T)() { return T.init; }
}
class Hoge
{
Foo foo;
mixin Proxy!foo;
this(Foo f) { foo = f; }
}
auto h = new Hoge(new Foo());
int n;
// blocked by bug 7641
//static assert(!__traits(compiles, { Foo f = h; }));
// field
h.field = 1; // lhs of assign
n = h.field; // rhs of assign
assert(h.field == 1); // lhs of BinExp
assert(1 == h.field); // rhs of BinExp
assert(n == 1);
// getter/setter property function
h.val1 = 4;
n = h.val1;
assert(h.val1 == 4);
assert(4 == h.val1);
assert(n == 4);
// ref getter property function
h.val2 = 8;
n = h.val2;
assert(h.val2 == 8);
assert(8 == h.val2);
assert(n == 8);
// member function
assert(h.func(2,4) == 2);
h.func1(n);
assert(n == 9);
// bug5896 test
assert(h.opCast!int() == 0);
assert(cast(int)h == 0);
immutable(Hoge) ih = new immutable(Hoge)(new Foo());
static assert(!__traits(compiles, ih.opCast!int()));
static assert(!__traits(compiles, cast(int)ih));
// template member function
assert(h.tempfunc!int() == 0);
}
unittest
{
struct MyInt
{
int payload;
mixin Proxy!payload;
}
MyInt v;
v = v;
struct Foo
{
@disable void opAssign(typeof(this));
}
struct MyFoo
{
Foo payload;
mixin Proxy!payload;
}
MyFoo f;
static assert(!__traits(compiles, f = f));
struct MyFoo2
{
Foo payload;
mixin Proxy!payload;
// override default Proxy behavior
void opAssign(typeof(this) rhs){}
}
MyFoo2 f2;
f2 = f2;
}
/**
Library typedef.
*/
template Typedef(T)
{
alias .Typedef!(T, T.init) Typedef;
}
/// ditto
struct Typedef(T, T init, string cookie=null)
{
private T Typedef_payload = init;
this(T init)
{
Typedef_payload = init;
}
mixin Proxy!Typedef_payload;
}
unittest
{
Typedef!int x = 10;
static assert(!__traits(compiles, { int y = x; }));
static assert(!__traits(compiles, { long z = x; }));
Typedef!int y = 10;
assert(x == y);
Typedef!(float, 1.0) z; // specifies the init
assert(z == 1.0);
alias Typedef!(int, 0, "dollar") Dollar;
alias Typedef!(int, 0, "yen") Yen;
static assert(!is(Dollar == Yen));
}
/**
Allocates a $(D class) object right inside the current scope,
therefore avoiding the overhead of $(D new). This facility is unsafe;
it is the responsibility of the user to not escape a reference to the
object outside the scope.
Note: it's illegal to move a class reference even if you are sure there
is no pointers to it.
Example:
----
unittest
{
class A { int x; }
auto a1 = scoped!A();
auto a2 = scoped!A();
a1.x = 42;
a2.x = 53;
assert(a1.x == 42);
auto a3 = a2; // illegal, fails to compile
assert([a2][0].x == 42); // illegal, unexpected behaviour
}
----
*/
@system auto scoped(T, Args...)(auto ref Args args) if (is(T == class))
{
// _d_newclass now use default GC alignment (looks like (void*).sizeof * 2 for
// small objects). We will just use the maximum of filed alignments.
alias classInstanceAlignment!T alignment;
alias _alignUp!alignment aligned;
static struct Scoped(T)
{
// Addition of `alignment` is required as `Scoped_store` can be misaligned in memory.
private void[aligned(__traits(classInstanceSize, T) + size_t.sizeof) + alignment] Scoped_store = void;
@property inout(T) Scoped_payload() inout
{
void* alignedStore = cast(void*) aligned(cast(size_t) Scoped_store.ptr);
// As `Scoped` can be unaligned moved in memory class instance should be moved accordingly.
immutable size_t d = alignedStore - Scoped_store.ptr;
size_t* currD = cast(size_t*) &Scoped_store[$ - size_t.sizeof];
if(d != *currD)
{
import core.stdc.string;
memmove(alignedStore, Scoped_store.ptr + *currD, __traits(classInstanceSize, T));
*currD = d;
}
return cast(inout(T)) alignedStore;
}
alias Scoped_payload this;
@disable this(this)
{
assert(false, "Illegal call to Scoped this(this)");
}
~this()
{
// `destroy` will also write .init but we have no functions in druntime
// for deterministic finalization and memory releasing for now.
.destroy(Scoped_payload);
}
}
Scoped!T result;
immutable size_t d = cast(void*) result.Scoped_payload - result.Scoped_store.ptr;
*cast(size_t*) &result.Scoped_store[$ - size_t.sizeof] = d;
emplace!(Unqual!T)(result.Scoped_store[d .. $ - size_t.sizeof], args);
return result;
}
private size_t _alignUp(size_t alignment)(size_t n)
if(alignment > 0 && !((alignment - 1) & alignment))
{
enum badEnd = alignment - 1; // 0b11, 0b111, ...
return (n + badEnd) & ~badEnd;
}
unittest // Issue 6580 testcase
{
enum alignment = (void*).alignof;
static class C0 { }
static class C1 { byte b; }
static class C2 { byte[2] b; }
static class C3 { byte[3] b; }
static class C7 { byte[7] b; }
static assert(scoped!C0().sizeof % alignment == 0);
static assert(scoped!C1().sizeof % alignment == 0);
static assert(scoped!C2().sizeof % alignment == 0);
static assert(scoped!C3().sizeof % alignment == 0);
static assert(scoped!C7().sizeof % alignment == 0);
enum longAlignment = long.alignof;
static class C1long
{
long long_; byte byte_ = 4;
this() { }
this(long _long, ref int i) { long_ = _long; ++i; }
}
static class C2long { byte[2] byte_ = [5, 6]; long long_ = 7; }
static assert(scoped!C1long().sizeof % longAlignment == 0);
static assert(scoped!C2long().sizeof % longAlignment == 0);
void alignmentTest()
{
int var = 5;
auto c1long = scoped!C1long(3, var);
assert(var == 6);
auto c2long = scoped!C2long();
assert(cast(size_t)&c1long.long_ % longAlignment == 0);
assert(cast(size_t)&c2long.long_ % longAlignment == 0);
assert(c1long.long_ == 3 && c1long.byte_ == 4);
assert(c2long.byte_ == [5, 6] && c2long.long_ == 7);
}
alignmentTest();
version(DigitalMars)
{
void test(size_t size)
{
import core.stdc.stdlib;
alloca(size);
alignmentTest();
}
foreach(i; 0 .. 10)
test(i);
}
else
{
void test(size_t size)()
{
byte[size] arr;
alignmentTest();
}
foreach(i; TypeTuple!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
test!i();
}
}
unittest // Original Issue 6580 testcase
{
class C { int i; byte b; }
auto sa = [scoped!C(), scoped!C()];
assert(cast(size_t)&sa[0].i % int.alignof == 0);
assert(cast(size_t)&sa[1].i % int.alignof == 0); // fails
}
unittest
{
class A { int x = 1; }
auto a1 = scoped!A();
assert(a1.x == 1);
auto a2 = scoped!A();
a1.x = 42;
a2.x = 53;
assert(a1.x == 42);
}
unittest
{
class A { int x = 1; this() { x = 2; } }
auto a1 = scoped!A();
assert(a1.x == 2);
auto a2 = scoped!A();
a1.x = 42;
a2.x = 53;
assert(a1.x == 42);
}
unittest
{
class A { int x = 1; this(int y) { x = y; } ~this() {} }
auto a1 = scoped!A(5);
assert(a1.x == 5);
auto a2 = scoped!A(42);
a1.x = 42;
a2.x = 53;
assert(a1.x == 42);
}
unittest
{
class A { static bool dead; ~this() { dead = true; } }
class B : A { static bool dead; ~this() { dead = true; } }
{
auto b = scoped!B();
}
assert(B.dead, "asdasd");
assert(A.dead, "asdasd");
}
unittest // Issue 8039 testcase
{
static int dels;
static struct S { ~this(){ ++dels; } }
static class A { S s; }
dels = 0; { scoped!A(); }
assert(dels == 1);
static class B { S[2] s; }
dels = 0; { scoped!B(); }
assert(dels == 2);
static struct S2 { S[3] s; }
static class C { S2[2] s; }
dels = 0; { scoped!C(); }
assert(dels == 6);
static class D: A { S2[2] s; }
dels = 0; { scoped!D(); }
assert(dels == 1+6);
}
unittest
{
// bug4500
class A
{
this() { a = this; }
this(int i) { a = this; }
A a;
bool check() { return this is a; }
}
auto a1 = scoped!A();
assert(a1.check());
auto a2 = scoped!A(1);
assert(a2.check());
a1.a = a1;
assert(a1.check());
}
unittest
{
static class A
{
static int sdtor;
this() { ++sdtor; assert(sdtor == 1); }
~this() { assert(sdtor == 1); --sdtor; }
}
interface Bob {}
static class ABob : A, Bob
{
this() { ++sdtor; assert(sdtor == 2); }
~this() { assert(sdtor == 2); --sdtor; }
}
A.sdtor = 0;
scope(exit) assert(A.sdtor == 0);
auto abob = scoped!ABob();
}
unittest
{
static class A { this(int) {} }
static assert(!__traits(compiles, scoped!A()));
}
unittest
{
static class A { @property inout(int) foo() inout { return 1; } }
auto a1 = scoped!A();
assert(a1.foo == 1);
static assert(is(typeof(a1.foo) == int));
auto a2 = scoped!(const(A))();
assert(a2.foo == 1);
static assert(is(typeof(a2.foo) == const(int)));
auto a3 = scoped!(immutable(A))();
assert(a3.foo == 1);
static assert(is(typeof(a3.foo) == immutable(int)));
const c1 = scoped!A();
assert(c1.foo == 1);
static assert(is(typeof(c1.foo) == const(int)));
const c2 = scoped!(const(A))();
assert(c2.foo == 1);
static assert(is(typeof(c2.foo) == const(int)));
const c3 = scoped!(immutable(A))();
assert(c3.foo == 1);
static assert(is(typeof(c3.foo) == immutable(int)));
}
unittest
{
class C { this(ref int val) { assert(val == 3); ++val; } }
int val = 3;
auto s = scoped!C(val);
assert(val == 4);
}
/**
Defines a simple, self-documenting yes/no flag. This makes it easy for
APIs to define functions accepting flags without resorting to $(D
bool), which is opaque in calls, and without needing to define an
enumerated type separately. Using $(D Flag!"Name") instead of $(D
bool) makes the flag's meaning visible in calls. Each yes/no flag has
its own type, which makes confusions and mix-ups impossible.
Example:
----
// Before
string getLine(bool keepTerminator)
{
...
if (keepTerminator) ...
...
}
...
// Code calling getLine (usually far away from its definition) can't
// be understood without looking at the documentation, even by users
// familiar with the API. Assuming the reverse meaning
// (i.e. "ignoreTerminator") and inserting the wrong code compiles and
// runs with erroneous results.
auto line = getLine(false);
// After
string getLine(Flag!"KeepTerminator" keepTerminator)
{
...
if (keepTerminator) ...
...
}
...
// Code calling getLine can be easily read and understood even by
// people not fluent with the API.
auto line = getLine(Flag!"KeepTerminator".yes);
----
Passing categorical data by means of unstructured $(D bool)
parameters is classified under "simple-data coupling" by Steve
McConnell in the $(LUCKY Code Complete) book, along with three other
kinds of coupling. The author argues citing several studies that
coupling has a negative effect on code quality. $(D Flag) offers a
simple structuring method for passing yes/no flags to APIs.
As a perk, the flag's name may be any string and as such can include
characters not normally allowed in identifiers, such as
spaces and dashes.
*/
template Flag(string name) {
///
enum Flag : bool
{
/**
When creating a value of type $(D Flag!"Name"), use $(D
Flag!"Name".no) for the negative option. When using a value
of type $(D Flag!"Name"), compare it against $(D
Flag!"Name".no) or just $(D false) or $(D 0). */
no = false,
/** When creating a value of type $(D Flag!"Name"), use $(D
Flag!"Name".yes) for the affirmative option. When using a
value of type $(D Flag!"Name"), compare it against $(D
Flag!"Name".yes).
*/
yes = true
}
}
/**
Convenience names that allow using e.g. $(D Yes.encryption) instead of
$(D Flag!"encryption".yes) and $(D No.encryption) instead of $(D
Flag!"encryption".no).
*/
struct Yes
{
template opDispatch(string name)
{
enum opDispatch = Flag!name.yes;
}
}
//template yes(string name) { enum Flag!name yes = Flag!name.yes; }
/// Ditto
struct No
{
template opDispatch(string name)
{
enum opDispatch = Flag!name.no;
}
}
//template no(string name) { enum Flag!name no = Flag!name.no; }
unittest
{
Flag!"abc" flag1;
assert(flag1 == Flag!"abc".no);
assert(flag1 == No.abc);
assert(!flag1);
if (flag1) assert(false);
flag1 = Yes.abc;
assert(flag1);
if (!flag1) assert(false);
if (flag1) {} else assert(false);
assert(flag1 == Yes.abc);
}
| D |
/**
Mutexes, semaphores and condition variables.
Copyright: Sean Kelly 2005 - 2009.
Copyright: Guillaume Piolat 2016 - 2018.
License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
*/
// This contains part of druntime's core.sys.mutex, core.sys.semaphore core.sys.condition and
// Modified to make it @nogc nothrow
module dplug.core.sync;
import core.time;
import dplug.core.vec;
import dplug.core.nogc;
import core.stdc.stdio;
import core.stdc.stdlib: malloc, free;
// emulate conditions variable on Windows
// (this was originally in Phobos for XP compatibility)
version = emulateCondVarWin32;
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
version( Windows )
{
import core.sys.windows.windows;
struct RTL_CONDITION_VARIABLE
{
PVOID Ptr;
}
alias CONDITION_VARIABLE = RTL_CONDITION_VARIABLE;
alias PCONDITION_VARIABLE = RTL_CONDITION_VARIABLE*;
extern (Windows) export nothrow @nogc
{
void InitializeCriticalSectionAndSpinCount(CRITICAL_SECTION * lpCriticalSection, DWORD dwSpinCount);
VOID InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable);
VOID WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable);
VOID WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable);
BOOL SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds);
}
}
else version( Darwin )
{
import core.sys.posix.pthread;
import core.sync.config;
import core.stdc.errno;
import core.sys.posix.time;
static if (__VERSION__ < 2084)
import core.sys.osx.mach.semaphore; // was removed with DMDFE 2.084
else
import core.sys.darwin.mach.semaphore;
}
else version( Posix )
{
import core.sync.config;
import core.stdc.errno;
import core.sys.posix.pthread;
import core.sys.posix.semaphore;
import core.sys.posix.time;
}
else
{
static assert(false, "Platform not supported");
}
//
// MUTEX
//
/// Returns: A newly created `UnchekedMutex`.
UncheckedMutex makeMutex() nothrow @nogc
{
return UncheckedMutex(42);
}
private enum PosixMutexAlignment = 64; // Wild guess, no measurements done
struct UncheckedMutex
{
private this(int dummyArg) nothrow @nogc
{
assert(!_created);
version( Windows )
{
m_hndl = cast(CRITICAL_SECTION*) malloc(CRITICAL_SECTION.sizeof);
// Cargo-culting the spin-count in WTF::Lock
// See: https://webkit.org/blog/6161/locking-in-webkit/
InitializeCriticalSectionAndSpinCount( m_hndl, 40 );
}
else version( Posix )
{
_handle = cast(pthread_mutex_t*)( alignedMalloc(pthread_mutex_t.sizeof, PosixMutexAlignment) );
assumeNothrowNoGC(
(pthread_mutex_t* handle)
{
pthread_mutexattr_t attr = void;
pthread_mutexattr_init( &attr );
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
version (Darwin)
{
// Note: disabled since this breaks thread pool.
/+
// OSX mutexes are fair by default, but this has a cost for contended locks
// Disable fairness.
// https://blog.mozilla.org/nfroyd/2017/03/29/on-mutex-performance-part-1/
enum _PTHREAD_MUTEX_POLICY_FIRSTFIT = 2;
pthread_mutexattr_setpolicy_np(& attr, _PTHREAD_MUTEX_POLICY_FIRSTFIT);
+/
}
pthread_mutex_init( handle, &attr );
})(handleAddr());
}
_created = 1;
}
~this() nothrow @nogc
{
if (_created)
{
version( Windows )
{
DeleteCriticalSection( m_hndl );
free(m_hndl);
}
else version( Posix )
{
assumeNothrowNoGC(
(pthread_mutex_t* handle)
{
pthread_mutex_destroy(handle);
})(handleAddr);
alignedFree(_handle, PosixMutexAlignment);
}
_created = 0;
}
}
@disable this(this);
/// Lock mutex
final void lock() nothrow @nogc
{
version( Windows )
{
EnterCriticalSection( m_hndl );
}
else version( Posix )
{
assumeNothrowNoGC(
(pthread_mutex_t* handle)
{
int res = pthread_mutex_lock(handle);
if (res != 0)
assert(false);
})(handleAddr());
}
}
// undocumented function for internal use
final void unlock() nothrow @nogc
{
version( Windows )
{
LeaveCriticalSection( m_hndl );
}
else version( Posix )
{
assumeNothrowNoGC(
(pthread_mutex_t* handle)
{
int res = pthread_mutex_unlock(handle);
if (res != 0)
assert(false);
})(handleAddr());
}
}
bool tryLock() nothrow @nogc
{
version( Windows )
{
return TryEnterCriticalSection( m_hndl ) != 0;
}
else version( Posix )
{
int result = assumeNothrowNoGC(
(pthread_mutex_t* handle)
{
return pthread_mutex_trylock(handle);
})(handleAddr());
return result == 0;
}
}
// For debugging purpose
void dumpState() nothrow @nogc
{
version( Posix )
{
ubyte* pstate = cast(ubyte*)(handleAddr());
for (size_t i = 0; i < pthread_mutex_t.sizeof; ++i)
{
printf("%02x", pstate[i]);
}
printf("\n");
}
}
private:
version( Windows )
{
CRITICAL_SECTION* m_hndl;
}
else version( Posix )
{
pthread_mutex_t* _handle = null;
}
// Work-around for Issue 16636
// https://issues.dlang.org/show_bug.cgi?id=16636
// Still crash with LDC somehow
long _created = 0;
package:
version( Posix )
{
pthread_mutex_t* handleAddr() nothrow @nogc
{
return _handle;
}
}
}
unittest
{
UncheckedMutex mutex = makeMutex();
foreach(i; 0..100)
{
mutex.lock();
mutex.unlock();
if (mutex.tryLock)
mutex.unlock();
}
mutex.destroy();
}
//
// SEMAPHORE
//
/// Returns: A newly created `UncheckedSemaphore`
UncheckedSemaphore makeSemaphore(uint count) nothrow @nogc
{
return UncheckedSemaphore(count);
}
struct UncheckedSemaphore
{
private this( uint count ) nothrow @nogc
{
version( Windows )
{
m_hndl = CreateSemaphoreA( null, count, int.max, null );
if( m_hndl == m_hndl.init )
assert(false);
}
else version( Darwin )
{
mach_port_t task = assumeNothrowNoGC(
()
{
return mach_task_self();
})();
kern_return_t rc = assumeNothrowNoGC(
(mach_port_t t, semaphore_t* handle, uint count)
{
return semaphore_create(t, handle, SYNC_POLICY_FIFO, count );
})(task, &m_hndl, count);
if( rc )
assert(false);
}
else version( Posix )
{
int rc = sem_init( &m_hndl, 0, count );
if( rc )
assert(false);
}
_created = 1;
}
~this() nothrow @nogc
{
if (_created)
{
version( Windows )
{
BOOL rc = CloseHandle( m_hndl );
assert( rc, "Unable to destroy semaphore" );
}
else version( Darwin )
{
mach_port_t task = assumeNothrowNoGC(
()
{
return mach_task_self();
})();
kern_return_t rc = assumeNothrowNoGC(
(mach_port_t t, semaphore_t handle)
{
return semaphore_destroy( t, handle );
})(task, m_hndl);
assert( !rc, "Unable to destroy semaphore" );
}
else version( Posix )
{
int rc = sem_destroy( &m_hndl );
assert( !rc, "Unable to destroy semaphore" );
}
_created = 0;
}
}
@disable this(this);
void wait() nothrow @nogc
{
version( Windows )
{
DWORD rc = WaitForSingleObject( m_hndl, INFINITE );
assert( rc == WAIT_OBJECT_0 );
}
else version( Darwin )
{
while( true )
{
auto rc = assumeNothrowNoGC(
(semaphore_t handle)
{
return semaphore_wait(handle);
})(m_hndl);
if( !rc )
return;
if( rc == KERN_ABORTED && errno == EINTR )
continue;
assert(false);
}
}
else version( Posix )
{
while( true )
{
if (!assumeNothrowNoGC(
(sem_t* handle)
{
return sem_wait(handle);
})(&m_hndl))
return;
if( errno != EINTR )
assert(false);
}
}
}
bool wait( Duration period ) nothrow @nogc
{
assert( !period.isNegative );
version( Windows )
{
auto maxWaitMillis = dur!("msecs")( uint.max - 1 );
while( period > maxWaitMillis )
{
auto rc = WaitForSingleObject( m_hndl, cast(uint)
maxWaitMillis.total!"msecs" );
switch( rc )
{
case WAIT_OBJECT_0:
return true;
case WAIT_TIMEOUT:
period -= maxWaitMillis;
continue;
default:
assert(false);
}
}
switch( WaitForSingleObject( m_hndl, cast(uint) period.total!"msecs" ) )
{
case WAIT_OBJECT_0:
return true;
case WAIT_TIMEOUT:
return false;
default:
assert(false);
}
}
else version( Darwin )
{
mach_timespec_t t = void;
(cast(byte*) &t)[0 .. t.sizeof] = 0;
if( period.total!"seconds" > t.tv_sec.max )
{
t.tv_sec = t.tv_sec.max;
t.tv_nsec = cast(typeof(t.tv_nsec)) period.split!("seconds", "nsecs")().nsecs;
}
else
period.split!("seconds", "nsecs")(t.tv_sec, t.tv_nsec);
while( true )
{
auto rc = assumeNothrowNoGC(
(semaphore_t handle, mach_timespec_t t)
{
return semaphore_timedwait(handle, t);
})(m_hndl, t);
if( !rc )
return true;
if( rc == KERN_OPERATION_TIMED_OUT )
return false;
if( rc != KERN_ABORTED || errno != EINTR )
assert(false);
}
}
else version( Posix )
{
timespec t;
assumeNothrowNoGC(
(ref timespec t, Duration period)
{
mktspec( t, period );
})(t, period);
while( true )
{
if (! ((sem_t* handle, timespec* t)
{
return sem_timedwait(handle, t);
})(&m_hndl, &t))
return true;
if( errno == ETIMEDOUT )
return false;
if( errno != EINTR )
assert(false);
}
}
}
void notify() nothrow @nogc
{
version( Windows )
{
if( !ReleaseSemaphore( m_hndl, 1, null ) )
assert(false);
}
else version( Darwin )
{
auto rc = assumeNothrowNoGC(
(semaphore_t handle)
{
return semaphore_signal(handle);
})(m_hndl);
if( rc )
assert(false);
}
else version( Posix )
{
int rc = sem_post( &m_hndl );
if( rc )
assert(false);
}
}
bool tryWait() nothrow @nogc
{
version( Windows )
{
switch( WaitForSingleObject( m_hndl, 0 ) )
{
case WAIT_OBJECT_0:
return true;
case WAIT_TIMEOUT:
return false;
default:
assert(false);
}
}
else version( Darwin )
{
return wait( dur!"hnsecs"(0) );
}
else version( Posix )
{
while( true )
{
if( !sem_trywait( &m_hndl ) )
return true;
if( errno == EAGAIN )
return false;
if( errno != EINTR )
assert(false);
}
}
}
private:
version( Windows )
{
HANDLE m_hndl;
}
else version( Darwin )
{
semaphore_t m_hndl;
}
else version( Posix )
{
sem_t m_hndl;
}
ulong _created = 0;
}
unittest
{
foreach(j; 0..4)
{
UncheckedSemaphore semaphore = makeSemaphore(1);
foreach(i; 0..100)
{
semaphore.wait();
semaphore.notify();
if (semaphore.tryWait())
semaphore.notify();
}
}
}
//
// CONDITION VARIABLE
//
ConditionVariable makeConditionVariable() nothrow @nogc
{
return ConditionVariable(42);
}
/**
* This struct represents a condition variable as conceived by C.A.R. Hoare. As
* per Mesa type monitors however, "signal" has been replaced with "notify" to
* indicate that control is not transferred to the waiter when a notification
* is sent.
*/
struct ConditionVariable
{
public:
nothrow:
@nogc:
/// Initializes a condition variable.
this(int dummy)
{
version( Windows )
{
version(emulateCondVarWin32)
{
m_blockLock = CreateSemaphoreA( null, 1, 1, null );
if( m_blockLock == m_blockLock.init )
assert(false);
m_blockQueue = CreateSemaphoreA( null, 0, int.max, null );
if( m_blockQueue == m_blockQueue.init )
assert(false);
m_unblockLock = cast(CRITICAL_SECTION*) malloc(CRITICAL_SECTION.sizeof);
InitializeCriticalSection( m_unblockLock );
}
else
InitializeConditionVariable(&_handle);
}
else version( Posix )
{
_handle = cast(pthread_cond_t*)( alignedMalloc(pthread_cond_t.sizeof, PosixMutexAlignment) );
int rc = pthread_cond_init( handleAddr(), null );
if( rc )
assert(false);
}
}
~this()
{
version( Windows )
{
version(emulateCondVarWin32)
{
CloseHandle( m_blockLock );
CloseHandle( m_blockQueue );
if (m_unblockLock !is null)
{
DeleteCriticalSection( m_unblockLock );
free(m_unblockLock);
m_unblockLock = null;
}
}
}
else version( Posix )
{
if (_handle !is null)
{
int rc = pthread_cond_destroy( handleAddr() );
assert( !rc, "Unable to destroy condition" );
alignedFree(_handle, PosixMutexAlignment);
_handle = null;
}
}
}
/// Wait until notified.
/// The associated mutex should always be the same for this condition variable.
void wait(UncheckedMutex* assocMutex)
{
version( Windows )
{
version(emulateCondVarWin32)
{
timedWait( INFINITE, assocMutex );
}
else
{
BOOL res = SleepConditionVariableCS(&_handle, assocMutex.m_hndl, INFINITE);
if (res == 0)
assert(false); // timeout or failure
}
}
else version( Posix )
{
int rc = pthread_cond_wait( handleAddr(), assocMutex.handleAddr() );
if( rc )
assert(false);
}
}
/// Notifies one waiter.
void notifyOne()
{
version( Windows )
{
version(emulateCondVarWin32)
{
notifyImpl( false );
}
else
{
WakeConditionVariable(&_handle);
}
}
else version( Posix )
{
int rc = pthread_cond_signal( handleAddr() );
if( rc )
assert(false);
}
}
/// Notifies all waiters.
void notifyAll()
{
version( Windows )
{
version(emulateCondVarWin32)
{
notifyImpl( true );
}
else
{
WakeAllConditionVariable(&_handle);
}
}
else version( Posix )
{
int rc = pthread_cond_broadcast( handleAddr() );
if( rc )
assert(false);
}
}
version(Posix)
{
pthread_cond_t* handleAddr() nothrow @nogc
{
return _handle;
}
}
private:
version( Windows )
{
version(emulateCondVarWin32)
{
bool timedWait( DWORD timeout, UncheckedMutex* assocMutex )
{
int numSignalsLeft;
int numWaitersGone;
DWORD rc;
rc = WaitForSingleObject( m_blockLock, INFINITE );
assert( rc == WAIT_OBJECT_0 );
m_numWaitersBlocked++;
rc = ReleaseSemaphore( m_blockLock, 1, null );
assert( rc );
assocMutex.unlock();
rc = WaitForSingleObject( m_blockQueue, timeout );
assert( rc == WAIT_OBJECT_0 || rc == WAIT_TIMEOUT );
bool timedOut = (rc == WAIT_TIMEOUT);
EnterCriticalSection( m_unblockLock );
if( (numSignalsLeft = m_numWaitersToUnblock) != 0 )
{
if ( timedOut )
{
// timeout (or canceled)
if( m_numWaitersBlocked != 0 )
{
m_numWaitersBlocked--;
// do not unblock next waiter below (already unblocked)
numSignalsLeft = 0;
}
else
{
// spurious wakeup pending!!
m_numWaitersGone = 1;
}
}
if( --m_numWaitersToUnblock == 0 )
{
if( m_numWaitersBlocked != 0 )
{
// open the gate
rc = ReleaseSemaphore( m_blockLock, 1, null );
assert( rc );
// do not open the gate below again
numSignalsLeft = 0;
}
else if( (numWaitersGone = m_numWaitersGone) != 0 )
{
m_numWaitersGone = 0;
}
}
}
else if( ++m_numWaitersGone == int.max / 2 )
{
// timeout/canceled or spurious event :-)
rc = WaitForSingleObject( m_blockLock, INFINITE );
assert( rc == WAIT_OBJECT_0 );
// something is going on here - test of timeouts?
m_numWaitersBlocked -= m_numWaitersGone;
rc = ReleaseSemaphore( m_blockLock, 1, null );
assert( rc == WAIT_OBJECT_0 );
m_numWaitersGone = 0;
}
LeaveCriticalSection( m_unblockLock );
if( numSignalsLeft == 1 )
{
// better now than spurious later (same as ResetEvent)
for( ; numWaitersGone > 0; --numWaitersGone )
{
rc = WaitForSingleObject( m_blockQueue, INFINITE );
assert( rc == WAIT_OBJECT_0 );
}
// open the gate
rc = ReleaseSemaphore( m_blockLock, 1, null );
assert( rc );
}
else if( numSignalsLeft != 0 )
{
// unblock next waiter
rc = ReleaseSemaphore( m_blockQueue, 1, null );
assert( rc );
}
assocMutex.lock();
return !timedOut;
}
void notifyImpl( bool all )
{
DWORD rc;
EnterCriticalSection( m_unblockLock );
if( m_numWaitersToUnblock != 0 )
{
if( m_numWaitersBlocked == 0 )
{
LeaveCriticalSection( m_unblockLock );
return;
}
if( all )
{
m_numWaitersToUnblock += m_numWaitersBlocked;
m_numWaitersBlocked = 0;
}
else
{
m_numWaitersToUnblock++;
m_numWaitersBlocked--;
}
LeaveCriticalSection( m_unblockLock );
}
else if( m_numWaitersBlocked > m_numWaitersGone )
{
rc = WaitForSingleObject( m_blockLock, INFINITE );
assert( rc == WAIT_OBJECT_0 );
if( 0 != m_numWaitersGone )
{
m_numWaitersBlocked -= m_numWaitersGone;
m_numWaitersGone = 0;
}
if( all )
{
m_numWaitersToUnblock = m_numWaitersBlocked;
m_numWaitersBlocked = 0;
}
else
{
m_numWaitersToUnblock = 1;
m_numWaitersBlocked--;
}
LeaveCriticalSection( m_unblockLock );
rc = ReleaseSemaphore( m_blockQueue, 1, null );
assert( rc );
}
else
{
LeaveCriticalSection( m_unblockLock );
}
}
// NOTE: This implementation uses Algorithm 8c as described here:
// http://groups.google.com/group/comp.programming.threads/
// browse_frm/thread/1692bdec8040ba40/e7a5f9d40e86503a
HANDLE m_blockLock; // auto-reset event (now semaphore)
HANDLE m_blockQueue; // auto-reset event (now semaphore)
CRITICAL_SECTION* m_unblockLock = null; // internal mutex/CS
int m_numWaitersGone = 0;
int m_numWaitersBlocked = 0;
int m_numWaitersToUnblock = 0;
}
else
{
CONDITION_VARIABLE _handle;
}
}
else version( Posix )
{
pthread_cond_t* _handle;
}
}
unittest
{
import dplug.core.thread;
auto mutex = makeMutex();
auto condvar = makeConditionVariable();
bool finished = false;
// Launch a thread that wait on this condition
Thread t = launchInAThread(
() {
mutex.lock();
while(!finished)
condvar.wait(&mutex);
mutex.unlock();
});
// Notify termination
mutex.lock();
finished = true;
mutex.unlock();
condvar.notifyOne();
t.join();
}
| D |
import std.algorithm, std.conv, std.range, std.stdio, std.string;
version(unittest) {} else
void main()
{
auto rd = readln.split.to!(size_t[]), n = rd[0], k = rd[1];
auto wi = n.iota.map!(_ => readln.chomp.to!int).array;
bool canCarry(int _, int p)
{
auto r = 1, c = 0;
foreach (w; wi) {
if (p < w) return false;
if (p - c < w) {
++r; c = w;
} else {
c += w;
}
}
return r <= k;
}
auto r = iota(1, wi.sum + 1).assumeSorted!(canCarry).upperBound(0);
writeln(r.front);
}
| D |
module LD.MenuScene;
import D2D;
import std.algorithm;
import LD.IScene;
import LD.TextureManager;
import LD.Rect;
import LD.Enemy;
import LD.Player;
import LD.IScene;
import LD.Button;
import LD.Font;
import LD.GameScene;
immutable char Kappa = 12;
class BuyBar : Transformable, IDrawable
{
private:
RepeatedRectangle bg, fg;
public:
this(Texture bg, Texture fg, int steps)
{
this.bg = Rect.createRepeat(bg, vec2(0, 0), vec2(steps * 24, 32), vec2(steps, 1));
this.fg = Rect.createRepeat(fg, vec2(0, 0), vec2(steps * 24, 32), vec2(steps, 1));
}
void set(int i)
{
fg.setSize(vec2(i * 24, 32));
fg.setRepeat(vec2(i, 1));
fg.create();
}
void draw(IRenderTarget target, ShaderProgram shader = null)
{
bg.position = position;
bg.origin = origin;
bg.scaling = scaling;
bg.rotation = rotation;
fg.position = position;
fg.origin = origin;
fg.scaling = scaling;
fg.rotation = rotation;
bg.draw(target, shader);
fg.draw(target, shader);
}
}
class MenuScene : IScene
{
private:
IScene _next = null;
TextureManager _texture;
IDrawable[] ui;
Text money;
Button moneyAdd;
Button healthBtn;
Button dmgBtn;
Button speedBtn;
Button jumpBtn;
Button specialBtn;
Button moneyBtn;
BuyBar healthBar;
BuyBar dmgBar;
BuyBar speedBar;
BuyBar jumpBar;
BuyBar specialBar;
BuyBar moneyBar;
public:
this(TextureManager tex)
{
_texture = tex;
string text = "PLAY";
if (std.random.uniform(0, 10000) == 0)
text ~= Kappa;
addButton(text, 0.6f, vec2(40, 400), vec2(720, 60), &replay);
money = addText("$: " ~ to!string(GameScene.money), 0.5f, vec2(40, 20), vec4(0, 0, 0, 1));
moneyAdd = addButton("+", 0.5f, vec2(50 + money.textWidth, 25), vec2(32, 32), &replay);
addText("Health", 0.5f, vec2(40, 80), vec4(0, 0, 0, 1));
addText("Damage", 0.5f, vec2(40, 120), vec4(0, 0, 0, 1));
addText("Speed", 0.5f, vec2(40, 160), vec4(0, 0, 0, 1));
addText("Jump", 0.5f, vec2(40, 200), vec4(0, 0, 0, 1));
addText("Special", 0.5f, vec2(40, 240), vec4(0, 0, 0, 1));
addText("Money", 0.5f, vec2(40, 280), vec4(0, 0, 0, 1));
healthBar = addBuy(GameScene.maxHealth, 5, vec2(300, 84));
dmgBar = addBuy(GameScene.damage, 7, vec2(300, 124));
speedBar = addBuy(GameScene.speedMod, 4, vec2(300, 164));
jumpBar = addBuy(GameScene.jumpMod, 4, vec2(300, 204));
specialBar = addBuy(GameScene.special, 2, vec2(300, 244));
moneyBar = addBuy(GameScene.moneyMod, 8, vec2(300, 284));
healthBtn = addButton(to!string(round(100 * pow(1.5f, GameScene.maxHealth))) ~ "$", 0.4f, vec2(500, 84), vec2(100, 32), &buyHealth);
dmgBtn = addButton(to!string(round(80 * pow(1.35f, GameScene.damage))) ~ "$", 0.4f, vec2(500, 124), vec2(100, 32), &buyDamage);
speedBtn = addButton(to!string(round(70 * pow(1.3f, GameScene.speedMod))) ~ "$", 0.4f, vec2(500, 164), vec2(100, 32), &buySpeed);
jumpBtn = addButton(to!string(round(80 * pow(1.41f, GameScene.jumpMod))) ~ "$", 0.4f, vec2(500, 204), vec2(100, 32), &buyJump);
specialBtn = addButton(to!string(round(500 * pow(1.8f, GameScene.special))) ~ "$", 0.4f, vec2(500, 244), vec2(100, 32), &buySpecial);
moneyBtn = addButton(to!string(round(60 * pow(1.2f, GameScene.moneyMod))) ~ "$", 0.4f, vec2(500, 284), vec2(100, 32), &buyMoney);
}
void buyHealth()
{
if (GameScene.money >= round(100 * pow(1.5f, GameScene.maxHealth)) && GameScene.maxHealth < 5)
{
GameScene.money -= round(100 * pow(1.5f, GameScene.maxHealth));
GameScene.maxHealth++;
healthBar.set(GameScene.maxHealth);
healthBtn.setText(to!string(round(100 * pow(1.5f, GameScene.maxHealth))) ~ "$", 0.4f);
updateMoney();
}
}
void buyDamage()
{
if (GameScene.money >= round(80 * pow(1.35f, GameScene.damage)) && GameScene.damage < 7)
{
GameScene.money -= round(80 * pow(1.35f, GameScene.damage));
GameScene.damage++;
dmgBar.set(GameScene.damage);
dmgBtn.setText(to!string(round(80 * pow(1.35f, GameScene.damage))) ~ "$", 0.4f);
updateMoney();
}
}
void buySpeed()
{
if (GameScene.money >= round(70 * pow(1.3f, GameScene.speedMod)) && GameScene.speedMod < 4)
{
GameScene.money -= round(70 * pow(1.3f, GameScene.speedMod));
GameScene.speedMod++;
speedBar.set(GameScene.speedMod);
speedBtn.setText(to!string(round(70 * pow(1.3f, GameScene.speedMod))) ~ "$", 0.4f);
updateMoney();
}
}
void buyJump()
{
if (GameScene.money >= round(80 * pow(1.41f, GameScene.jumpMod)) && GameScene.jumpMod < 4)
{
GameScene.money -= round(80 * pow(1.41f, GameScene.jumpMod));
GameScene.jumpMod++;
jumpBar.set(GameScene.jumpMod);
jumpBtn.setText(to!string(round(80 * pow(1.41f, GameScene.jumpMod))) ~ "$", 0.4f);
updateMoney();
}
}
void buySpecial()
{
if (GameScene.money >= round(500 * pow(1.8f, GameScene.special)) && GameScene.special < 2)
{
GameScene.money -= round(500 * pow(1.8f, GameScene.special));
GameScene.special++;
specialBar.set(GameScene.special);
specialBtn.setText(to!string(round(500 * pow(1.8f, GameScene.special))) ~ "$", 0.4f);
updateMoney();
}
}
void buyMoney()
{
if (GameScene.money >= round(60 * pow(1.2f, GameScene.moneyMod)) && GameScene.moneyMod < 8)
{
GameScene.money -= round(60 * pow(1.2f, GameScene.moneyMod));
GameScene.moneyMod++;
moneyBar.set(GameScene.moneyMod);
moneyBtn.setText(to!string(round(60 * pow(1.2f, GameScene.moneyMod))) ~ "$", 0.4f);
updateMoney();
}
}
void updateMoney()
{
money.set("$: " ~ to!string(GameScene.money), 0.5f);
moneyAdd.position = vec2(50 + money.textWidth, 25);
}
Button addButton(string text, float textScale, vec2 pos, vec2 size, void delegate() click)
{
Button button = new Button(text, textScale);
button.position = pos;
button.setSize(size);
button.connect(click);
ui ~= button;
return button;
}
Text addText(string text, float textScale, vec2 pos, vec4 color)
{
Text txt = new Text(text, textScale);
txt.position = pos;
txt.color = color;
ui ~= txt;
return txt;
}
BuyBar addBuy(int init, int max, vec2 pos)
{
BuyBar bar = new BuyBar(_texture.buyBarBack, _texture.buyBar, max);
bar.set(init);
bar.position = pos;
ui ~= bar;
return bar;
}
void replay()
{
_next = new GameScene(_texture);
}
@property TextureManager texture()
{
return _texture;
}
void onEvent(Event event)
{
foreach (elem; ui)
{
if (cast(Button) elem)
(cast(Button) elem).onEvent(event);
}
if (event.type == Event.Type.KeyReleased)
{
if (event.key == SDLK_RETURN)
{
replay();
}
}
}
void update(float delta)
{
}
void draw(IRenderTarget target)
{
target.clear(0.9803f, 0.9803f, 0.9803f);
foreach (elem; ui)
target.draw(elem);
}
IScene getNext()
{
return _next;
}
}
| D |
instance DIA_Addon_BanditGuard_EXIT(C_Info)
{
npc = BDT_1064_Bandit_L;
nr = 999;
condition = DIA_BanditGuard_EXIT_Condition;
information = DIA_BanditGuard_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_BanditGuard_EXIT_Condition()
{
return TRUE;
};
func void DIA_BanditGuard_EXIT_Info()
{
AI_StopProcessInfos(self);
};
const string Bdt_1064_Checkpoint = "NW_CASTLEMINE_TOWER_05";
instance DIA_Bdt_1064_BanditGuard_FirstWarn(C_Info)
{
npc = BDT_1064_Bandit_L;
nr = 1;
condition = DIA_Bdt_1064_BanditGuard_FirstWarn_Condition;
information = DIA_Bdt_1064_BanditGuard_FirstWarn_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_Bdt_1064_BanditGuard_FirstWarn_Condition()
{
if(Npc_GetDistToWP(other,Bdt_1064_Checkpoint) <= 800)
{
Npc_SetRefuseTalk(self,5);
return FALSE;
};
if((self.aivar[AIV_Guardpassage_Status] == GP_NONE) && (self.aivar[AIV_PASSGATE] == FALSE) && (Hlp_StrCmp(Npc_GetNearestWP(self),self.wp) == TRUE) && (Npc_RefuseTalk(self) == FALSE))
{
return TRUE;
};
return FALSE;
};
func void DIA_Bdt_1064_BanditGuard_FirstWarn_Info()
{
AI_Output(self,other,"DIA_Addon_Dexwache_Add_04_00"); //Do našeho tábora se dostaneš živý jenom jedinou cestou, a to je přes most.
other.aivar[AIV_LastDistToWP] = Npc_GetDistToWP(other,Bdt_1064_Checkpoint);
self.aivar[AIV_Guardpassage_Status] = GP_FirstWarnGiven;
AI_StopProcessInfos(self);
};
instance DIA_Bdt_1064_BanditGuard_SecondWarn(C_Info)
{
npc = BDT_1064_Bandit_L;
nr = 2;
condition = DIA_Bdt_1064_BanditGuard_SecondWarn_Condition;
information = DIA_Bdt_1064_BanditGuard_SecondWarn_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_Bdt_1064_BanditGuard_SecondWarn_Condition()
{
if((self.aivar[AIV_Guardpassage_Status] == GP_FirstWarnGiven) && (self.aivar[AIV_PASSGATE] == FALSE) && (Hlp_StrCmp(Npc_GetNearestWP(self),self.wp) == TRUE) && (Npc_GetDistToWP(other,Bdt_1064_Checkpoint) < (other.aivar[AIV_LastDistToWP] - 75)))
{
return TRUE;
};
return FALSE;
};
func void DIA_Bdt_1064_BanditGuard_SecondWarn_Info()
{
AI_Output(self,other,"DIA_Addon_Dexwache_Add_04_01"); //Mám ti to vtlouct do hlavy? Ještě JEDEN krok a shodím tě z útesu!
other.aivar[AIV_LastDistToWP] = Npc_GetDistToWP(other,Bdt_1064_Checkpoint);
self.aivar[AIV_Guardpassage_Status] = GP_SecondWarnGiven;
AI_StopProcessInfos(self);
};
instance DIA_Bdt_1064_BanditGuard_Attack(C_Info)
{
npc = BDT_1064_Bandit_L;
nr = 3;
condition = DIA_Bdt_1064_BanditGuard_Attack_Condition;
information = DIA_Bdt_1064_BanditGuard_Attack_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_Bdt_1064_BanditGuard_Attack_Condition()
{
if((self.aivar[AIV_Guardpassage_Status] == GP_SecondWarnGiven) && (self.aivar[AIV_PASSGATE] == FALSE) && (Hlp_StrCmp(Npc_GetNearestWP(self),self.wp) == TRUE) && (Npc_GetDistToWP(other,Bdt_1064_Checkpoint) < (other.aivar[AIV_LastDistToWP] - 75)))
{
return TRUE;
};
return FALSE;
};
func void DIA_Bdt_1064_BanditGuard_Attack_Info()
{
other.aivar[AIV_LastDistToWP] = 0;
self.aivar[AIV_Guardpassage_Status] = GP_NONE;
AI_Output(self,other,"DIA_Addon_Dexwache_Add_04_02"); //Pokud to tak chceš...
AI_StopProcessInfos(self);
B_Attack(self,other,AR_GuardStopsIntruder,1);
};
instance DIA_Addon_BanditGuard_PERM(C_Info)
{
npc = BDT_1064_Bandit_L;
nr = 99;
condition = DIA_BanditGuard_PERM_Condition;
information = DIA_BanditGuard_PERM_Info;
permanent = TRUE;
important = TRUE;
};
func int DIA_BanditGuard_PERM_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (self.aivar[AIV_TalkedToPlayer] == TRUE))
{
return TRUE;
};
return FALSE;
};
func void DIA_BanditGuard_PERM_Info()
{
AI_Output(self,other,"DIA_Addon_Dexwache_Add_04_03"); //Nevotravuj mě!
AI_StopProcessInfos(self);
};
| D |
/Users/mac/Documents/StreamsApp/DerivedData/StreamsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DateToolsSwift.build/Objects-normal/x86_64/TimePeriodCollection.o : /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriod.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Bundle.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimeChunk.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodChain.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodCollection.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+TimeAgo.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodGroup.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Integer+DateTools.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Enums.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Manipulations.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Comparators.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Inits.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Constants.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Components.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Format.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/mac/Documents/StreamsApp/Pods/Target\ Support\ Files/DateToolsSwift/DateToolsSwift-umbrella.h /Users/mac/Documents/StreamsApp/DerivedData/StreamsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DateToolsSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/StreamsApp/DerivedData/StreamsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DateToolsSwift.build/Objects-normal/x86_64/TimePeriodCollection~partial.swiftmodule : /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriod.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Bundle.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimeChunk.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodChain.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodCollection.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+TimeAgo.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodGroup.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Integer+DateTools.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Enums.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Manipulations.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Comparators.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Inits.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Constants.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Components.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Format.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/mac/Documents/StreamsApp/Pods/Target\ Support\ Files/DateToolsSwift/DateToolsSwift-umbrella.h /Users/mac/Documents/StreamsApp/DerivedData/StreamsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DateToolsSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/StreamsApp/DerivedData/StreamsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DateToolsSwift.build/Objects-normal/x86_64/TimePeriodCollection~partial.swiftdoc : /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriod.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Bundle.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimeChunk.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodChain.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodCollection.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+TimeAgo.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/TimePeriodGroup.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Integer+DateTools.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Enums.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Manipulations.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Comparators.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Inits.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Constants.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Components.swift /Users/mac/Documents/StreamsApp/Pods/DateToolsSwift/DateToolsSwift/DateTools/Date+Format.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/mac/Documents/StreamsApp/Pods/Target\ Support\ Files/DateToolsSwift/DateToolsSwift-umbrella.h /Users/mac/Documents/StreamsApp/DerivedData/StreamsApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DateToolsSwift.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
module d.context.location;
import d.context.context;
// XXX: https://issues.dlang.org/show_bug.cgi?id=14666
import d.context.sourcemanager;
/**
* Struct representing a location in a source file.
* Effectively a pair of Position within the source file.
*/
struct Location {
package:
Position start;
Position stop;
public:
this(Position start, Position stop) in {
assert(start.isMixin() == stop.isMixin());
assert(start.offset <= stop.offset);
} body {
this.start = start;
this.stop = stop;
}
@property
uint length() const {
return stop.offset - start.offset;
}
@property
bool isFile() const {
return start.isFile();
}
@property
bool isMixin() const {
return start.isMixin();
}
void spanTo(ref const Location end) in {
import std.conv;
assert(
stop.offset <= end.stop.offset,
to!string(stop.offset) ~ " > " ~ to!string(end.stop.offset)
);
} body {
spanTo(end.stop);
}
void spanTo(ref const Position end) in {
import std.conv;
assert(
stop.offset <= end.offset,
to!string(stop.offset) ~ " > " ~ to!string(end.offset)
);
} body {
stop = end;
}
// XXX: lack of alias this :(
// XXX: https://issues.dlang.org/show_bug.cgi?id=14666
// import d.context.context;
FullLocation getFullLocation(Context c) const {
return getFullLocation(c.sourceManager);
}
FullLocation getFullLocation(ref SourceManager sm) const {
return FullLocation(this, &sm);
}
}
/**
* Struct representing a position in a source file.
*/
struct Position {
private:
import std.bitmanip;
mixin(bitfields!(
uint, "_offset", uint.sizeof * 8 - 1,
bool, "_mixin", 1,
));
package:
@property
uint offset() const {
return _offset;
}
@property
uint raw() const {
return *(cast(uint*) &this);
}
bool isFile() const {
return !_mixin;
}
bool isMixin() const {
return _mixin;
}
public:
Position getWithOffset(uint offset) const out(result) {
assert(result.isMixin() == isMixin(), "Position overflow");
} body {
return Position(raw + offset);
}
// XXX: lack of alias this :(
// XXX: https://issues.dlang.org/show_bug.cgi?id=14666
// import d.context.context;
FullPosition getFullPosition(Context c) const {
return getFullPosition(c.sourceManager);
}
FullPosition getFullPosition(ref SourceManager sm) const {
return FullPosition(this, &sm);
}
}
| D |
instance NON_5043_WEGELAGERER(Npc_Default)
{
name[0] = "Povaleč";
npcType = Npctype_ROGUE;
guild = GIL_None;
level = 9;
voice = 3;
id = 5043;
attribute[ATR_STRENGTH] = 65;
attribute[ATR_DEXTERITY] = 55;
attribute[ATR_MANA_MAX] = 0;
attribute[ATR_MANA] = 0;
attribute[ATR_HITPOINTS_MAX] = 205;
attribute[ATR_HITPOINTS] = 205;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_SetVisualBody(self,"hum_body_Naked0",3,1,"Hum_Head_Pony",71,3,-1);
B_Scale(self);
Mdl_SetModelFatness(self,0);
fight_tactic = FAI_HUMAN_Strong;
Npc_SetTalentSkill(self,NPC_TALENT_1H,1);
EquipItem(self,ItMw_1H_Poker_01);
CreateInvItems(self,ItMiNugget,6);
CreateInvItem(self,ItMiJoint_1);
CreateInvItem(self,ItMi_Stuff_Barbknife_01);
CreateInvItem(self,ItMiLute);
daily_routine = rtn_start_5043;
};
func void rtn_start_5043()
{
Npc_SetPermAttitude(self,ATT_HOSTILE);
TA_SitAround(22,0,6,0,"OW_PATH_PLATEU_BDT_05");
TA_SitAround(6,0,22,0,"OW_PATH_PLATEU_BDT_05");
};
| D |
/*
* hunt-proton: AMQP Protocol library for D programming language.
*
* Copyright (C) 2018-2019 HuntLabs
*
* Website: https://www.huntlabs.net/
*
* Licensed under the Apache-2.0 License.
*
*/
module hunt.proton.codec.CharacterType;
import hunt.collection.Collection;
import hunt.collection.Collections;
import hunt.proton.codec.TypeEncoding;
import hunt.proton.codec.EncodingCodes;
import hunt.proton.codec.FixedSizePrimitiveTypeEncoding;
import hunt.proton.codec.AbstractPrimitiveType;
import hunt.proton.codec.EncoderImpl;
import hunt.proton.codec.DecoderImpl;
import hunt.Char;
import hunt.proton.codec.PrimitiveTypeEncoding;
class CharacterType : AbstractPrimitiveType!(Char)
{
private CharacterEncoding _characterEncoding;
this(EncoderImpl encoder, DecoderImpl decoder)
{
_characterEncoding = new CharacterEncoding(encoder, decoder);
encoder.register(typeid(Char), this);
decoder.register(this);
}
public TypeInfo getTypeClass()
{
return typeid(Char);
}
public ITypeEncoding getEncoding(Object val)
{
return _characterEncoding;
}
public CharacterEncoding getCanonicalEncoding()
{
return _characterEncoding;
}
public Collection!(TypeEncoding!(Char)) getAllEncodings()
{
return Collections.singleton!(TypeEncoding!(Char))(_characterEncoding);
}
//public Collection!(PrimitiveTypeEncoding!(Char)) getAllEncodings()
// {
// return super.getAllEncodings();
// }
public void write(char c)
{
_characterEncoding.write(c);
}
class CharacterEncoding : FixedSizePrimitiveTypeEncoding!(Char)
{
this(EncoderImpl encoder, DecoderImpl decoder)
{
super(encoder, decoder);
}
override
protected int getFixedSize()
{
return 4;
}
override
public byte getEncodingCode()
{
return EncodingCodes.CHAR;
}
public CharacterType getType()
{
return this.outer;
}
public void writeValue(Object val)
{
getEncoder().writeRaw(cast(int)(cast(Char)val).charValue() & 0xffff);
}
public void writeValue(char val)
{
getEncoder().writeRaw(cast(int)val & 0xffff);
}
public void write(char c)
{
writeConstructor();
getEncoder().writeRaw(cast(int)c & 0xffff);
}
public bool encodesSuperset(TypeEncoding!(Char) encoding)
{
return (getType() == encoding.getType());
}
public Char readValue()
{
return readPrimitiveValue();
}
public Char readPrimitiveValue()
{
return new Char(cast(char) (getDecoder().readRawInt() & 0xffff));
}
override
public bool encodesJavaPrimitive()
{
return true;
}
}
}
| D |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.