code stringlengths 3 10M | language stringclasses 31 values |
|---|---|
/*
D listener written by Christopher E. Miller
This code is public domain.
You may use it for any purpose.
This code has no warranties and is provided 'as-is'.
*/
import std.conv, std.socket, std.stdio;
int main(char[][] args)
{
ushort port;
if (args.length >= 2)
port = to!ushort(args[1]);
else
port = 4444;
Socket listener = new TcpSocket;
assert(listener.isAlive);
listener.blocking = false;
listener.bind(new InternetAddress(port));
listener.listen(10);
writefln("Listening on port %d.", port);
const int MAX_CONNECTIONS = 60;
SocketSet sset = new SocketSet(MAX_CONNECTIONS + 1); // Room for listener.
Socket[] reads;
for (;; sset.reset())
{
sset.add(listener);
foreach (Socket each; reads)
{
sset.add(each);
}
Socket.select(sset, null, null);
int i;
for (i = 0;; i++)
{
next:
if (i == reads.length)
break;
if (sset.isSet(reads[i]))
{
char[1024] buf;
int read = reads[i].receive(buf);
if (Socket.ERROR == read)
{
writeln("Connection error.");
goto sock_down;
}
else if (0 == read)
{
try
{
// if the connection closed due to an error, remoteAddress() could fail
writefln("Connection from %s closed.", reads[i].remoteAddress().toString());
}
catch (SocketException)
{
writeln("Connection closed.");
}
sock_down:
reads[i].close(); // release socket resources now
// remove from -reads-
if (i != reads.length - 1)
reads[i] = reads[reads.length - 1];
reads = reads[0 .. reads.length - 1];
writefln("\tTotal connections: %d", reads.length);
goto next; // -i- is still the next index
}
else
{
writefln("Received %d bytes from %s: \"%s\"", read, reads[i].remoteAddress().toString(), buf[0 .. read]);
}
}
}
if (sset.isSet(listener)) // connection request
{
Socket sn;
try
{
if (reads.length < MAX_CONNECTIONS)
{
sn = listener.accept();
writefln("Connection from %s established.", sn.remoteAddress().toString());
assert(sn.isAlive);
assert(listener.isAlive);
reads ~= sn;
writefln("\tTotal connections: %d", reads.length);
}
else
{
sn = listener.accept();
writefln("Rejected connection from %s; too many connections.", sn.remoteAddress().toString());
assert(sn.isAlive);
sn.close();
assert(!sn.isAlive);
assert(listener.isAlive);
}
}
catch (Exception e)
{
writefln("Error accepting: %s", e.toString());
if (sn)
sn.close();
}
}
}
return 0;
}
| D |
an empire in southern Asia created by Cyrus the Great in the 6th century BC and destroyed by Alexander the Great in the 4th century BC
a theocratic Islamic republic in the Middle East in western Asia
| D |
/**
* Copyright: © 2012-2014 Anton Gushcha
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>,
* LeMarwin <lemarwin42@gmail.com>,
* Nazgull09 <nazgull90@gmail.com>
*/
module devol.std.typevoid;
import devol.type;
import devol.std.argscope;
import devol.std.line;
import std.stream;
import dyaml.all;
public
{
import devol.std.argvoid;
}
class TypeVoid : Type
{
this()
{
super("TypeVoid");
}
override Argument getNewArg()
{
return new ArgVoid;
}
override Argument getNewArg(string min, string max, string[] exVal)
{
return new ArgVoid;
}
override Argument loadArgument(InputStream stream)
{
char[] cont;
stream.read(cont);
if(cont == "line")
{
return Line.loadBinary(stream);
}
else if(cont == "scope")
{
return ArgScope.loadBinary(stream);
}
else if(cont == "plain")
{
return new ArgVoid;
}
throw new Exception("Unknown void container!");
}
override Argument loadArgument(Node node)
{
switch(node["class"].as!string)
{
case("line"):
{
return Line.loadYaml(node);
}
case("scope"):
{
return ArgScope.loadYaml(node);
}
case("plain"):
{
return new ArgVoid;
}
default:
{
throw new Exception("Unknown void container!");
}
}
}
}
| D |
/Users/benormos/Desktop/MyFutureBox/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/Objects-normal/x86_64/UIView+CollectionKit.o : /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionReloadable.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/Util.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/ClosureDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/CollectionDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/ArrayDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionSizeProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/CollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/SpaceCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/BaseCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/EmptyStateCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/LabelCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/ViewCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/CollectionViewCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/AnyCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/ViewProvider/ClosureViewProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/ViewProvider/CollectionViewProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionReuseViewManager.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/LayoutHelper.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/CollectionComposer.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Presenter/ZoomPresenter.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Presenter/CollectionPresenter.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/UIView+CollectionKit.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/UIScrollView+CollectionKit.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/SimpleLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/ClosureLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/TransposeLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/WaterfallLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/CollectionLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/WrapperLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/FloatLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/InsetLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/VisibleFrameInsetLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/RowLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/FlowLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/OverlayLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/CollectionView.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/benormos/Desktop/MyFutureBox/Pods/Target\ Support\ Files/CollectionKit/CollectionKit-umbrella.h /Users/benormos/Desktop/MyFutureBox/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/unextended-module.modulemap
/Users/benormos/Desktop/MyFutureBox/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/Objects-normal/x86_64/UIView+CollectionKit~partial.swiftmodule : /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionReloadable.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/Util.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/ClosureDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/CollectionDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/ArrayDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionSizeProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/CollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/SpaceCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/BaseCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/EmptyStateCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/LabelCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/ViewCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/CollectionViewCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/AnyCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/ViewProvider/ClosureViewProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/ViewProvider/CollectionViewProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionReuseViewManager.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/LayoutHelper.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/CollectionComposer.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Presenter/ZoomPresenter.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Presenter/CollectionPresenter.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/UIView+CollectionKit.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/UIScrollView+CollectionKit.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/SimpleLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/ClosureLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/TransposeLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/WaterfallLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/CollectionLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/WrapperLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/FloatLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/InsetLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/VisibleFrameInsetLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/RowLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/FlowLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/OverlayLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/CollectionView.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/benormos/Desktop/MyFutureBox/Pods/Target\ Support\ Files/CollectionKit/CollectionKit-umbrella.h /Users/benormos/Desktop/MyFutureBox/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/unextended-module.modulemap
/Users/benormos/Desktop/MyFutureBox/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/Objects-normal/x86_64/UIView+CollectionKit~partial.swiftdoc : /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionReloadable.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/Util.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/ClosureDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/CollectionDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/DataProvider/ArrayDataProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionSizeProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/CollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/SpaceCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/BaseCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/EmptyStateCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/LabelCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/ViewCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Addon/CollectionViewCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/AnyCollectionProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/ViewProvider/ClosureViewProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/ViewProvider/CollectionViewProvider.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/CollectionReuseViewManager.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Other/LayoutHelper.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Provider/CollectionComposer.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Presenter/ZoomPresenter.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Presenter/CollectionPresenter.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/UIView+CollectionKit.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Extensions/UIScrollView+CollectionKit.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/SimpleLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/ClosureLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/TransposeLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/WaterfallLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/CollectionLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/WrapperLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/FloatLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/InsetLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/VisibleFrameInsetLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/RowLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/FlowLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/Layout/OverlayLayout.swift /Users/benormos/Desktop/MyFutureBox/Pods/CollectionKit/Sources/CollectionView.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/benormos/Desktop/MyFutureBox/Pods/Target\ Support\ Files/CollectionKit/CollectionKit-umbrella.h /Users/benormos/Desktop/MyFutureBox/build/Pods.build/Debug-iphonesimulator/CollectionKit.build/unextended-module.modulemap
| D |
module vibe.core.stream;
enum isInputStream(T) = __traits(compiles, {
T s;
ubyte[] buf;
if (!s.empty)
s.read(buf);
if (s.leastSize > 0)
s.read(buf);
});
enum isOutputStream(T) = __traits(compiles, {
T s;
const(ubyte)[] buf;
s.write(buf);
});
| D |
/Users/sharmpi/Downloads/WeatherClient/Build/Intermediates/WeatherClient.build/Debug-iphoneos/WeatherClient.build/Objects-normal/armv7/WeatherView.o : /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Utils/WeatherConstants.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/View/WeatherView.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/HttpClient.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Model/Weather.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/WeatherAPI.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Controller/WeatherViewController.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/Libraries/SwiftyJSON.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/AppDelegate.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/DataManager.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule
/Users/sharmpi/Downloads/WeatherClient/Build/Intermediates/WeatherClient.build/Debug-iphoneos/WeatherClient.build/Objects-normal/armv7/WeatherView~partial.swiftmodule : /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Utils/WeatherConstants.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/View/WeatherView.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/HttpClient.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Model/Weather.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/WeatherAPI.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Controller/WeatherViewController.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/Libraries/SwiftyJSON.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/AppDelegate.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/DataManager.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule
/Users/sharmpi/Downloads/WeatherClient/Build/Intermediates/WeatherClient.build/Debug-iphoneos/WeatherClient.build/Objects-normal/armv7/WeatherView~partial.swiftdoc : /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Utils/WeatherConstants.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/View/WeatherView.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/HttpClient.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Model/Weather.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/WeatherAPI.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/Controller/WeatherViewController.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/Libraries/SwiftyJSON.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/AppDelegate.swift /Users/sharmpi/Downloads/WeatherClient/WeatherClient/API/DataManager.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule
| D |
/Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker.o : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintConfig.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Debugging.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintRelation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintDescription.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMaker.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Typealiases.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintInsets.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Constraint.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/LayoutConstraint.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintView.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintPriority.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/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker~partial.swiftmodule : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintConfig.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Debugging.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintRelation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintDescription.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMaker.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Typealiases.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintInsets.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Constraint.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/LayoutConstraint.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintView.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintPriority.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/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker~partial.swiftdoc : /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintConfig.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Debugging.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintRelation.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintDescription.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMaker.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Typealiases.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintInsets.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/Constraint.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/LayoutConstraint.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintView.swift /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/SnapKit/Source/ConstraintPriority.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/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/babaiholdings/Documents/AlchemintWalletiOS/AlchemintProject/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwt.internal.image.JPEGEndOfImage;
import dwt.internal.image.JPEGFixedSizeSegment;
import dwt.internal.image.JPEGFileFormat;
import dwt.internal.image.LEDataInputStream;
final class JPEGEndOfImage : JPEGFixedSizeSegment {
public this() {
super();
}
public this(byte[] reference) {
super(reference);
}
public override int signature() {
return JPEGFileFormat.EOI;
}
public override int fixedSize() {
return 2;
}
}
| D |
import vibe.appmain;
import vibe.core.file;
import vibe.core.log;
import vibe.core.path;
import vibe.db.mongo.mongo;
import vibe.http.fileserver;
import vibe.http.router;
import vibe.http.server;
import std.exception;
import std.algorithm.iteration : sum;
import std.array;
import std.conv : to;
import std.digest.sha;
import std.range;
enum baseUrl = "http://127.0.0.1";
enum uploadsDir = "./uploads";
MongoDatabase db;
MongoCollection uploadsColl;
string randomHash()
{
import std.base64 : Base64URL;
import std.random : rndGen, uniform;
immutable int length = 5;
while (true)
{
immutable int number = uniform(int.min, int.max, rndGen());
auto result = Base64URL.encode(sha512Of((cast(ubyte*)&number)[0 .. 8]));
while (result.length < length)
result ~= result;
// Check if id already exists
string[string] query = ["directory" : (cast(string) result[0 .. length].idup)];
if (uploadsColl.findOne(query) == Bson(null))
return cast(string) result[0 .. length].idup;
}
}
void uploadFile(scope HTTPServerRequest req, scope HTTPServerResponse res)
{
auto pf = "file" in req.files;
enforce(pf !is null, "No file uploaded!");
// Generate unique id
immutable string newDirName = randomHash();
immutable string urlPath = newDirName ~ "/" ~ to!string(pf.filename);
immutable NativePath newDirPath = NativePath(uploadsDir) ~ newDirName;
immutable NativePath newPath = newDirPath ~ pf.filename;
logInfo("Path: %s", newPath);
try createDirectory(newDirPath);
catch (Exception e) {
logWarn("Directory already exists", newPath);
}
try moveFile(pf.tempPath, newPath);
catch (Exception e) {
copyFile(pf.tempPath, newPath);
}
uploadsColl.insert(["name": to!string(pf.filename), "directory": newDirName]);
res.writeBody("{\"url\": \"" ~ baseUrl ~ "/" ~ urlPath ~ "\"}", "text/json");
}
shared static this()
{
// Setup db
db = connectMongoDB("localhost").getDatabase("uploader");
uploadsColl = db["uploads"];
// Setup FS
if (!existsFile(NativePath(uploadsDir)))
createDirectory(NativePath(uploadsDir));
auto router = new URLRouter;
router.get("/", staticTemplate!"upload_form.dt");
router.post("/upload", &uploadFile);
router.get("*", serveStaticFiles(uploadsDir));
auto settings = new HTTPServerSettings;
settings.maxRequestSize = ulong.max;
settings.port = 9021;
settings.bindAddresses = ["0.0.0.0"];
listenHTTP(settings, router);
}
| D |
# FIXED
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/common/osal.c
OSAL/osal.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/string.h
OSAL/osal.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/linkage.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/comdef.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/../_common/cc26xx/_hal_types.h
OSAL/osal.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdint.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_defs.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_board.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_board_cfg.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_mcu.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_nvic.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_ints.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_types.h
OSAL/osal.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdbool.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_chip_def.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_gpio.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_memmap.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/systick.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/debug.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/interrupt.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/cpu.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_cpu_scs.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/rom.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/uart.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_uart.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/gpio.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/flash.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_flash.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_aon_sysctl.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_fcfg1.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/ioc.h
OSAL/osal.obj: C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_ioc.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/icall/src/inc/ICall.h
OSAL/osal.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdlib.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_assert.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal.h
OSAL/osal.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/limits.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/OSAL_Memory.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/OSAL_Timers.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal_tasks.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal_pwrmgr.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal_clock.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/common/cc26xx/onboard.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_sleep.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_drivers.h
OSAL/osal.obj: C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/common/osal.c:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/string.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/linkage.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/comdef.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/../_common/cc26xx/_hal_types.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdint.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_defs.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_board.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_board_cfg.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_mcu.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_nvic.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_ints.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_types.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdbool.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_chip_def.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_gpio.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_memmap.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/systick.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/debug.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/interrupt.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/cpu.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_cpu_scs.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/rom.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/uart.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_uart.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/gpio.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/flash.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_flash.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_aon_sysctl.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_fcfg1.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/driverlib/ioc.h:
C:/ti/tirtos_cc13xx_cc26xx_2_18_00_03/products/cc26xxware_2_23_03_17162/inc/hw_ioc.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/icall/src/inc/ICall.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdlib.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_assert.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/limits.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/OSAL_Memory.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/OSAL_Timers.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal_tasks.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal_pwrmgr.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/osal/src/inc/osal_clock.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/common/cc26xx/onboard.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_sleep.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/inc/hal_drivers.h:
C:/ti/simplelink/ble_sdk_2_02_00_31/src/components/hal/src/target/_common/hal_types.h:
| D |
instance Mod_7354_VMG_Dever_TUG (Npc_Default)
{
// ------ NSC ------
name = "Dever";
guild = GIL_out;
id = 7354;
voice = 11;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 5); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ 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, 65); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------
// ------ 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", 237, BodyTex_P, itar_naturmagier2);
Mdl_SetModelFatness (self, 1);
Mdl_ApplyOverlayMds (self, "Humans_Mage.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ TA anmelden ------
daily_routine = Rtn_Start_7354;
};
FUNC VOID Rtn_Start_7354 ()
{
TA_Smalltalk (08,00,10,00,"TUG_51");
TA_Roast_Scavenger (10,00,12,00,"TUG_39");
TA_Smalltalk (12,00,20,00,"TUG_51");
TA_Sleep (20,00,08,00,"TUG_36");
}; | D |
characterized by the interdependence of living organisms in an environment
of or relating to the science of ecology
| D |
/Users/TK/projects/Swift/NetworkViewer/Build/Intermediates/NetworkViewer.build/Debug-iphonesimulator/NetworkViewer.build/Objects-normal/x86_64/AppDelegate.o : /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/AppDelegate.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/ApiPath.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Model/UserModel.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/ViewController.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/JsonParser.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/NetworkLayer.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVRadialGradientLayer.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVIndefiniteAnimatedView.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressAnimatedView.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Modules/module.modulemap /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap
/Users/TK/projects/Swift/NetworkViewer/Build/Intermediates/NetworkViewer.build/Debug-iphonesimulator/NetworkViewer.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/AppDelegate.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/ApiPath.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Model/UserModel.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/ViewController.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/JsonParser.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/NetworkLayer.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVRadialGradientLayer.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVIndefiniteAnimatedView.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressAnimatedView.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Modules/module.modulemap /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap
/Users/TK/projects/Swift/NetworkViewer/Build/Intermediates/NetworkViewer.build/Debug-iphonesimulator/NetworkViewer.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/AppDelegate.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/ApiPath.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Model/UserModel.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/ViewController.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/JsonParser.swift /Users/TK/projects/Swift/NetworkViewer/NetworkViewer/Network/NetworkLayer.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/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/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVRadialGradientLayer.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVIndefiniteAnimatedView.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressAnimatedView.h /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Modules/module.modulemap /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/TK/projects/Swift/NetworkViewer/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap
| D |
module shinoa.lang.Shinoa;
public class Shinoa {
private this() {}
public static string getVersion() {
return "0.1.7";
}
} | D |
// URL: https://atcoder.jp/contests/language-test-202001/tasks/abc085_c
import std.algorithm, std.array, std.container, std.math, std.range, std.typecons, std.string;
version(unittest) {} else
void main()
{
int N, Y; io.getV(N, Y);
Y /= 1000;
foreach (i10; 0..N+1)
foreach (i5; 0..N+1) {
auto i1 = N-i10-i5;
if (i1 >= 0 && i10*10+i5*5+i1 == Y) io.put!"{exit: true}"(i10, i5, i1);
}
io.put(-1, -1, -1);
}
auto io = IO!()();
import lib.io;
| D |
/*
* Copyright 2010 Your Name <your@email.address>
* All rights reserved. Distributed under the terms of the MIT license.
*/
import Be.Interface.Rect;
import Be.Interface.Point;
import tango.io.Stdout;
int main()
{
BRect rect = new BRect(100, 100, 200, 200);
rect.PrintToStream();
rect.InsetBy(new BPoint(50, 50));
rect.PrintToStream();
rect.top = 50;
rect.bottom = 100;
rect.left = 99;
rect.right = 742;
rect.PrintToStream();
BRect r2 = rect.InsetByCopy(new BPoint(200, 200));
r2.PrintToStream();
rect.PrintToStream();
return 0;
}
| D |
// Written in the D programming language.
/**
Functions for starting and interacting with other processes, and for
working with the current _process' execution environment.
Process_handling:
$(UL $(LI
$(LREF spawnProcess) spawns a new _process, optionally assigning it an
arbitrary set of standard input, output, and error streams.
The function returns immediately, leaving the child _process to execute
in parallel with its parent. All other functions in this module that
spawn processes are built around $(D spawnProcess).)
$(LI
$(LREF wait) makes the parent _process wait for a child _process to
terminate. In general one should always do this, to avoid
child processes becoming "zombies" when the parent _process exits.
Scope guards are perfect for this – see the $(LREF spawnProcess)
documentation for examples. $(LREF tryWait) is similar to $(D wait),
but does not block if the _process has not yet terminated.)
$(LI
$(LREF pipeProcess) also spawns a child _process which runs
in parallel with its parent. However, instead of taking
arbitrary streams, it automatically creates a set of
pipes that allow the parent to communicate with the child
through the child's standard input, output, and/or error streams.
This function corresponds roughly to C's $(D popen) function.)
$(LI
$(LREF execute) starts a new _process and waits for it
to complete before returning. Additionally, it captures
the _process' standard output and error streams and returns
the output of these as a string.)
$(LI
$(LREF spawnShell), $(LREF pipeShell) and $(LREF executeShell) work like
$(D spawnProcess), $(D pipeProcess) and $(D execute), respectively,
except that they take a single command string and run it through
the current user's default command interpreter.
$(D executeShell) corresponds roughly to C's $(D system) function.)
$(LI
$(LREF kill) attempts to terminate a running _process.)
)
The following table compactly summarises the different _process creation
functions and how they relate to each other:
$(BOOKTABLE,
$(TR $(TH )
$(TH Runs program directly)
$(TH Runs shell command))
$(TR $(TD Low-level _process creation)
$(TD $(LREF spawnProcess))
$(TD $(LREF spawnShell)))
$(TR $(TD Automatic input/output redirection using pipes)
$(TD $(LREF pipeProcess))
$(TD $(LREF pipeShell)))
$(TR $(TD Execute and wait for completion, collect output)
$(TD $(LREF execute))
$(TD $(LREF executeShell)))
)
Other_functionality:
$(UL
$(LI
$(LREF pipe) is used to create unidirectional pipes.)
$(LI
$(LREF environment) is an interface through which the current _process'
environment variables can be read and manipulated.)
$(LI
$(LREF escapeShellCommand) and $(LREF escapeShellFileName) are useful
for constructing shell command lines in a portable way.)
)
Authors:
$(LINK2 https://github.com/kyllingstad, Lars Tandle Kyllingstad),
$(LINK2 https://github.com/schveiguy, Steven Schveighoffer),
$(WEB thecybershadow.net, Vladimir Panteleev)
Copyright:
Copyright (c) 2013, the authors. All rights reserved.
Source:
$(PHOBOSSRC std/_process.d)
Macros:
WIKI=Phobos/StdProcess
OBJECTREF=$(D $(LINK2 object.html#$0,$0))
LREF=$(D $(LINK2 #.$0,$0))
*/
module std.process;
version (Posix)
{
import core.stdc.errno;
import core.stdc.string;
import core.sys.posix.stdio;
import core.sys.posix.unistd;
import core.sys.posix.sys.wait;
}
version (Windows)
{
import core.stdc.stdio;
import core.sys.windows.windows;
import std.utf;
import std.windows.syserror;
}
import std.algorithm;
import std.array;
import std.conv;
import std.exception;
import std.path;
import std.stdio;
import std.string;
import std.internal.processinit;
// When the DMC runtime is used, we have to use some custom functions
// to convert between Windows file handles and FILE*s.
version (Win32) version (DigitalMars) version = DMC_RUNTIME;
// Some of the following should be moved to druntime.
private
{
// Microsoft Visual C Runtime (MSVCRT) declarations.
version (Windows)
{
version (DMC_RUNTIME) { } else
{
import core.stdc.stdint;
extern(C)
{
int _fileno(FILE* stream);
HANDLE _get_osfhandle(int fd);
int _open_osfhandle(HANDLE osfhandle, int flags);
FILE* _fdopen(int fd, const (char)* mode);
int _close(int fd);
}
enum
{
STDIN_FILENO = 0,
STDOUT_FILENO = 1,
STDERR_FILENO = 2,
}
enum
{
_O_RDONLY = 0x0000,
_O_APPEND = 0x0004,
_O_TEXT = 0x4000,
}
}
}
// POSIX API declarations.
version (Posix)
{
version (OSX)
{
extern(C) char*** _NSGetEnviron() nothrow;
private const(char**)* environPtr;
extern(C) void std_process_static_this() { environPtr = _NSGetEnviron(); }
const(char**) environ() @property @trusted nothrow { return *environPtr; }
}
else
{
// Made available by the C runtime:
extern(C) extern __gshared const char** environ;
}
}
} // private
// =============================================================================
// Functions and classes for process management.
// =============================================================================
/**
Spawns a new _process, optionally assigning it an arbitrary set of standard
input, output, and error streams.
The function returns immediately, leaving the child _process to execute
in parallel with its parent. It is recommended to always call $(LREF wait)
on the returned $(LREF Pid), as detailed in the documentation for $(D wait).
Command_line:
There are four overloads of this function. The first two take an array
of strings, $(D args), which should contain the program name as the
zeroth element and any command-line arguments in subsequent elements.
The third and fourth versions are included for convenience, and may be
used when there are no command-line arguments. They take a single string,
$(D program), which specifies the program name.
Unless a directory is specified in $(D args[0]) or $(D program),
$(D spawnProcess) will search for the program in a platform-dependent
manner. On POSIX systems, it will look for the executable in the
directories listed in the PATH environment variable, in the order
they are listed. On Windows, it will search for the executable in
the following sequence:
$(OL
$(LI The directory from which the application loaded.)
$(LI The current directory for the parent process.)
$(LI The 32-bit Windows system directory.)
$(LI The 16-bit Windows system directory.)
$(LI The Windows directory.)
$(LI The directories listed in the PATH environment variable.)
)
---
// Run an executable called "prog" located in the current working
// directory:
auto pid = spawnProcess("./prog");
scope(exit) wait(pid);
// We can do something else while the program runs. The scope guard
// ensures that the process is waited for at the end of the scope.
...
// Run DMD on the file "myprog.d", specifying a few compiler switches:
auto dmdPid = spawnProcess(["dmd", "-O", "-release", "-inline", "myprog.d" ]);
if (wait(dmdPid) != 0)
writeln("Compilation failed!");
---
Environment_variables:
By default, the child process inherits the environment of the parent
process, along with any additional variables specified in the $(D env)
parameter. If the same variable exists in both the parent's environment
and in $(D env), the latter takes precedence.
If the $(LREF Config.newEnv) flag is set in $(D config), the child
process will $(I not) inherit the parent's environment. Its entire
environment will then be determined by $(D env).
---
wait(spawnProcess("myapp", ["foo" : "bar"], Config.newEnv));
---
Standard_streams:
The optional arguments $(D stdin), $(D stdout) and $(D stderr) may
be used to assign arbitrary $(XREF stdio,File) objects as the standard
input, output and error streams, respectively, of the child process. The
former must be opened for reading, while the latter two must be opened for
writing. The default is for the child process to inherit the standard
streams of its parent.
---
// Run DMD on the file myprog.d, logging any error messages to a
// file named errors.log.
auto logFile = File("errors.log", "w");
auto pid = spawnProcess(["dmd", "myprog.d"],
std.stdio.stdin,
std.stdio.stdout,
logFile);
if (wait(pid) != 0)
writeln("Compilation failed. See errors.log for details.");
---
Note that if you pass a $(D File) object that is $(I not)
one of the standard input/output/error streams of the parent process,
that stream will by default be $(I closed) in the parent process when
this function returns. See the $(LREF Config) documentation below for
information about how to disable this behaviour.
Beware of buffering issues when passing $(D File) objects to
$(D spawnProcess). The child process will inherit the low-level raw
read/write offset associated with the underlying file descriptor, but
it will not be aware of any buffered data. In cases where this matters
(e.g. when a file should be aligned before being passed on to the
child process), it may be a good idea to use unbuffered streams, or at
least ensure all relevant buffers are flushed.
Params:
args = An array which contains the program name as the zeroth element
and any command-line arguments in the following elements.
stdin = The standard input stream of the child process.
This can be any $(XREF stdio,File) that is opened for reading.
By default the child process inherits the parent's input
stream.
stdout = The standard output stream of the child process.
This can be any $(XREF stdio,File) that is opened for writing.
By default the child process inherits the parent's output stream.
stderr = The standard error stream of the child process.
This can be any $(XREF stdio,File) that is opened for writing.
By default the child process inherits the parent's error stream.
env = Additional environment variables for the child process.
config = Flags that control process creation. See $(LREF Config)
for an overview of available flags.
Returns:
A $(LREF Pid) object that corresponds to the spawned process.
Throws:
$(LREF ProcessException) on failure to start the process.$(BR)
$(XREF stdio,StdioException) on failure to pass one of the streams
to the child process (Windows only).$(BR)
$(CXREF exception,RangeError) if $(D args) is empty.
*/
Pid spawnProcess(in char[][] args,
File stdin = std.stdio.stdin,
File stdout = std.stdio.stdout,
File stderr = std.stdio.stderr,
const string[string] env = null,
Config config = Config.none)
@trusted // TODO: Should be @safe
{
version (Windows) auto args2 = escapeShellArguments(args);
else version (Posix) alias args2 = args;
return spawnProcessImpl(args2, stdin, stdout, stderr, env, config);
}
/// ditto
Pid spawnProcess(in char[][] args,
const string[string] env,
Config config = Config.none)
@trusted // TODO: Should be @safe
{
return spawnProcess(args,
std.stdio.stdin,
std.stdio.stdout,
std.stdio.stderr,
env,
config);
}
/// ditto
Pid spawnProcess(in char[] program,
File stdin = std.stdio.stdin,
File stdout = std.stdio.stdout,
File stderr = std.stdio.stderr,
const string[string] env = null,
Config config = Config.none)
@trusted
{
return spawnProcess((&program)[0 .. 1],
stdin, stdout, stderr, env, config);
}
/// ditto
Pid spawnProcess(in char[] program,
const string[string] env,
Config config = Config.none)
@trusted
{
return spawnProcess((&program)[0 .. 1], env, config);
}
/*
Implementation of spawnProcess() for POSIX.
envz should be a zero-terminated array of zero-terminated strings
on the form "var=value".
*/
version (Posix)
private Pid spawnProcessImpl(in char[][] args,
File stdin,
File stdout,
File stderr,
const string[string] env,
Config config)
@trusted // TODO: Should be @safe
{
import core.exception: RangeError;
if (args.empty) throw new RangeError();
const(char)[] name = args[0];
if (any!isDirSeparator(name))
{
if (!isExecutable(name))
throw new ProcessException(text("Not an executable file: ", name));
}
else
{
name = searchPathFor(name);
if (name is null)
throw new ProcessException(text("Executable file not found: ", name));
}
// Convert program name and arguments to C-style strings.
auto argz = new const(char)*[args.length+1];
argz[0] = toStringz(name);
foreach (i; 1 .. args.length) argz[i] = toStringz(args[i]);
argz[$-1] = null;
// Prepare environment.
auto envz = createEnv(env, !(config & Config.newEnv));
// Get the file descriptors of the streams.
// These could potentially be invalid, but that is OK. If so, later calls
// to dup2() and close() will just silently fail without causing any harm.
auto stdinFD = core.stdc.stdio.fileno(stdin.getFP());
auto stdoutFD = core.stdc.stdio.fileno(stdout.getFP());
auto stderrFD = core.stdc.stdio.fileno(stderr.getFP());
auto id = fork();
if (id < 0)
throw ProcessException.newFromErrno("Failed to spawn new process");
if (id == 0)
{
// Child process
// Redirect streams and close the old file descriptors.
// In the case that stderr is redirected to stdout, we need
// to backup the file descriptor since stdout may be redirected
// as well.
if (stderrFD == STDOUT_FILENO) stderrFD = dup(stderrFD);
dup2(stdinFD, STDIN_FILENO);
dup2(stdoutFD, STDOUT_FILENO);
dup2(stderrFD, STDERR_FILENO);
// Ensure that the standard streams aren't closed on execute, and
// optionally close all other file descriptors.
setCLOEXEC(STDIN_FILENO, false);
setCLOEXEC(STDOUT_FILENO, false);
setCLOEXEC(STDERR_FILENO, false);
if (!(config & Config.inheritFDs))
{
import core.sys.posix.sys.resource;
rlimit r;
getrlimit(RLIMIT_NOFILE, &r);
foreach (i; 3 .. cast(int) r.rlim_cur) close(i);
}
// Close the old file descriptors, unless they are
// either of the standard streams.
if (stdinFD > STDERR_FILENO) close(stdinFD);
if (stdoutFD > STDERR_FILENO) close(stdoutFD);
if (stderrFD > STDERR_FILENO) close(stderrFD);
// Execute program.
core.sys.posix.unistd.execve(argz[0], argz.ptr, envz);
// If execution fails, exit as quickly as possible.
core.sys.posix.stdio.perror("spawnProcess(): Failed to execute program");
core.sys.posix.unistd._exit(1);
assert (0);
}
else
{
// Parent process: Close streams and return.
if (stdinFD > STDERR_FILENO && !(config & Config.retainStdin))
stdin.close();
if (stdoutFD > STDERR_FILENO && !(config & Config.retainStdout))
stdout.close();
if (stderrFD > STDERR_FILENO && !(config & Config.retainStderr))
stderr.close();
return new Pid(id);
}
}
/*
Implementation of spawnProcess() for Windows.
commandLine must contain the entire command line, properly
quoted/escaped as required by CreateProcessW().
envz must be a pointer to a block of UTF-16 characters on the form
"var1=value1\0var2=value2\0...varN=valueN\0\0".
*/
version (Windows)
private Pid spawnProcessImpl(in char[] commandLine,
File stdin,
File stdout,
File stderr,
const string[string] env,
Config config)
@trusted
{
import core.exception: RangeError;
if (commandLine.empty) throw new RangeError("Command line is empty");
auto commandz = toUTFz!(wchar*)(commandLine);
// Prepare environment.
auto envz = createEnv(env, !(config & Config.newEnv));
// Startup info for CreateProcessW().
STARTUPINFO_W startinfo;
startinfo.cb = startinfo.sizeof;
startinfo.dwFlags = STARTF_USESTDHANDLES;
// Extract file descriptors and HANDLEs from the streams and make the
// handles inheritable.
static void prepareStream(ref File file, DWORD stdHandle, string which,
out int fileDescriptor, out HANDLE handle)
{
fileDescriptor = _fileno(file.getFP());
if (fileDescriptor < 0) handle = GetStdHandle(stdHandle);
else
{
version (DMC_RUNTIME) handle = _fdToHandle(fileDescriptor);
else /* MSVCRT */ handle = _get_osfhandle(fileDescriptor);
}
DWORD dwFlags;
if (GetHandleInformation(handle, &dwFlags))
{
if (!(dwFlags & HANDLE_FLAG_INHERIT))
{
if (!SetHandleInformation(handle,
HANDLE_FLAG_INHERIT,
HANDLE_FLAG_INHERIT))
{
throw new StdioException(
"Failed to make "~which~" stream inheritable by child process ("
~sysErrorString(GetLastError()) ~ ')',
0);
}
}
}
}
int stdinFD = -1, stdoutFD = -1, stderrFD = -1;
prepareStream(stdin, STD_INPUT_HANDLE, "stdin" , stdinFD, startinfo.hStdInput );
prepareStream(stdout, STD_OUTPUT_HANDLE, "stdout", stdoutFD, startinfo.hStdOutput);
prepareStream(stderr, STD_ERROR_HANDLE, "stderr", stderrFD, startinfo.hStdError );
// Create process.
PROCESS_INFORMATION pi;
DWORD dwCreationFlags =
CREATE_UNICODE_ENVIRONMENT |
((config & Config.suppressConsole) ? CREATE_NO_WINDOW : 0);
if (!CreateProcessW(null, commandz, null, null, true, dwCreationFlags,
envz, null, &startinfo, &pi))
throw ProcessException.newFromLastError("Failed to spawn new process");
// figure out if we should close any of the streams
if (stdinFD > STDERR_FILENO && !(config & Config.retainStdin))
stdin.close();
if (stdoutFD > STDERR_FILENO && !(config & Config.retainStdout))
stdout.close();
if (stderrFD > STDERR_FILENO && !(config & Config.retainStderr))
stderr.close();
// close the thread handle in the process info structure
CloseHandle(pi.hThread);
return new Pid(pi.dwProcessId, pi.hProcess);
}
// Converts childEnv to a zero-terminated array of zero-terminated strings
// on the form "name=value", optionally adding those of the current process'
// environment strings that are not present in childEnv. If the parent's
// environment should be inherited without modification, this function
// returns environ directly.
version (Posix)
private const(char*)* createEnv(const string[string] childEnv,
bool mergeWithParentEnv)
{
// Determine the number of strings in the parent's environment.
int parentEnvLength = 0;
if (mergeWithParentEnv)
{
if (childEnv.length == 0) return environ;
while (environ[parentEnvLength] != null) ++parentEnvLength;
}
// Convert the "new" variables to C-style strings.
auto envz = new const(char)*[parentEnvLength + childEnv.length + 1];
int pos = 0;
foreach (var, val; childEnv)
envz[pos++] = (var~'='~val~'\0').ptr;
// Add the parent's environment.
foreach (environStr; environ[0 .. parentEnvLength])
{
int eqPos = 0;
while (environStr[eqPos] != '=' && environStr[eqPos] != '\0') ++eqPos;
if (environStr[eqPos] != '=') continue;
auto var = environStr[0 .. eqPos];
if (var in childEnv) continue;
envz[pos++] = environStr;
}
envz[pos] = null;
return envz.ptr;
}
version (Posix) unittest
{
auto e1 = createEnv(null, false);
assert (e1 != null && *e1 == null);
auto e2 = createEnv(null, true);
assert (e2 != null);
int i = 0;
for (; environ[i] != null; ++i)
{
assert (e2[i] != null);
import core.stdc.string;
assert (strcmp(e2[i], environ[i]) == 0);
}
assert (e2[i] == null);
auto e3 = createEnv(["foo" : "bar", "hello" : "world"], false);
assert (e3 != null && e3[0] != null && e3[1] != null && e3[2] == null);
assert ((e3[0][0 .. 8] == "foo=bar\0" && e3[1][0 .. 12] == "hello=world\0")
|| (e3[0][0 .. 12] == "hello=world\0" && e3[1][0 .. 8] == "foo=bar\0"));
}
// Converts childEnv to a Windows environment block, which is on the form
// "name1=value1\0name2=value2\0...nameN=valueN\0\0", optionally adding
// those of the current process' environment strings that are not present
// in childEnv. Returns null if the parent's environment should be
// inherited without modification, as this is what is expected by
// CreateProcess().
version (Windows)
private LPVOID createEnv(const string[string] childEnv,
bool mergeWithParentEnv)
{
if (mergeWithParentEnv && childEnv.length == 0) return null;
auto envz = appender!(wchar[])();
void put(string var, string val)
{
envz.put(var);
envz.put('=');
envz.put(val);
envz.put(cast(wchar) '\0');
}
// Add the variables in childEnv, removing them from parentEnv
// if they exist there too.
auto parentEnv = mergeWithParentEnv ? environment.toAA() : null;
foreach (k, v; childEnv)
{
auto uk = toUpper(k);
put(uk, v);
if (uk in parentEnv) parentEnv.remove(uk);
}
// Add remaining parent environment variables.
foreach (k, v; parentEnv) put(k, v);
// Two final zeros are needed in case there aren't any environment vars,
// and the last one does no harm when there are.
envz.put("\0\0"w);
return envz.data.ptr;
}
version (Windows) unittest
{
assert (createEnv(null, true) == null);
assert ((cast(wchar*) createEnv(null, false))[0 .. 2] == "\0\0"w);
auto e1 = (cast(wchar*) createEnv(["foo":"bar", "ab":"c"], false))[0 .. 14];
assert (e1 == "FOO=bar\0AB=c\0\0"w || e1 == "AB=c\0FOO=bar\0\0"w);
}
// Searches the PATH variable for the given executable file,
// (checking that it is in fact executable).
version (Posix)
private string searchPathFor(in char[] executable)
@trusted //TODO: @safe nothrow
{
auto pathz = core.stdc.stdlib.getenv("PATH");
if (pathz == null) return null;
foreach (dir; splitter(to!string(pathz), ':'))
{
auto execPath = buildPath(dir, executable);
if (isExecutable(execPath)) return execPath;
}
return null;
}
// Checks whether the file exists and can be executed by the
// current user.
version (Posix)
private bool isExecutable(in char[] path) @trusted //TODO: @safe nothrow
{
return (access(toStringz(path), X_OK) == 0);
}
version (Posix) unittest
{
auto unamePath = searchPathFor("uname");
assert (!unamePath.empty);
assert (unamePath[0] == '/');
assert (unamePath.endsWith("uname"));
auto unlikely = searchPathFor("lkmqwpoialhggyaofijadsohufoiqezm");
assert (unlikely is null, "Are you kidding me?");
}
// Sets or unsets the FD_CLOEXEC flag on the given file descriptor.
version (Posix)
private void setCLOEXEC(int fd, bool on)
{
import core.sys.posix.fcntl;
auto flags = fcntl(fd, F_GETFD);
if (flags >= 0)
{
if (on) flags |= FD_CLOEXEC;
else flags &= ~(cast(typeof(flags)) FD_CLOEXEC);
flags = fcntl(fd, F_SETFD, flags);
}
if (flags == -1)
{
throw new StdioException("Failed to "~(on ? "" : "un")
~"set close-on-exec flag on file descriptor");
}
}
unittest // Command line arguments in spawnProcess().
{
version (Windows) TestScript prog =
"if not [%~1]==[foo] ( exit 1 )
if not [%~2]==[bar] ( exit 2 )
exit 0";
else version (Posix) TestScript prog =
`if test "$1" != "foo"; then exit 1; fi
if test "$2" != "bar"; then exit 2; fi
exit 0`;
assert (wait(spawnProcess(prog.path)) == 1);
assert (wait(spawnProcess([prog.path])) == 1);
assert (wait(spawnProcess([prog.path, "foo"])) == 2);
assert (wait(spawnProcess([prog.path, "foo", "baz"])) == 2);
assert (wait(spawnProcess([prog.path, "foo", "bar"])) == 0);
}
unittest // Environment variables in spawnProcess().
{
// We really should use set /a on Windows, but Wine doesn't support it.
version (Windows) TestScript envProg =
`if [%STD_PROCESS_UNITTEST1%] == [1] (
if [%STD_PROCESS_UNITTEST2%] == [2] (exit 3)
exit 1
)
if [%STD_PROCESS_UNITTEST1%] == [4] (
if [%STD_PROCESS_UNITTEST2%] == [2] (exit 6)
exit 4
)
if [%STD_PROCESS_UNITTEST2%] == [2] (exit 2)
exit 0`;
version (Posix) TestScript envProg =
`if test "$std_process_unittest1" = ""; then
std_process_unittest1=0
fi
if test "$std_process_unittest2" = ""; then
std_process_unittest2=0
fi
exit $(($std_process_unittest1+$std_process_unittest2))`;
environment.remove("std_process_unittest1"); // Just in case.
environment.remove("std_process_unittest2");
assert (wait(spawnProcess(envProg.path)) == 0);
assert (wait(spawnProcess(envProg.path, null, Config.newEnv)) == 0);
environment["std_process_unittest1"] = "1";
assert (wait(spawnProcess(envProg.path)) == 1);
assert (wait(spawnProcess(envProg.path, null, Config.newEnv)) == 0);
auto env = ["std_process_unittest2" : "2"];
assert (wait(spawnProcess(envProg.path, env)) == 3);
assert (wait(spawnProcess(envProg.path, env, Config.newEnv)) == 2);
env["std_process_unittest1"] = "4";
assert (wait(spawnProcess(envProg.path, env)) == 6);
assert (wait(spawnProcess(envProg.path, env, Config.newEnv)) == 6);
environment.remove("std_process_unittest1");
assert (wait(spawnProcess(envProg.path, env)) == 6);
assert (wait(spawnProcess(envProg.path, env, Config.newEnv)) == 6);
}
unittest // Stream redirection in spawnProcess().
{
version (Windows) TestScript prog =
"set /p INPUT=
echo %INPUT% output %~1
echo %INPUT% error %~2 1>&2";
else version (Posix) TestScript prog =
"read INPUT
echo $INPUT output $1
echo $INPUT error $2 >&2";
// Pipes
auto pipei = pipe();
auto pipeo = pipe();
auto pipee = pipe();
auto pid = spawnProcess([prog.path, "foo", "bar"],
pipei.readEnd, pipeo.writeEnd, pipee.writeEnd);
pipei.writeEnd.writeln("input");
pipei.writeEnd.flush();
assert (pipeo.readEnd.readln().chomp() == "input output foo");
assert (pipee.readEnd.readln().chomp().stripRight() == "input error bar");
wait(pid);
// Files
import std.ascii, std.file, std.uuid;
auto pathi = buildPath(tempDir(), randomUUID().toString());
auto patho = buildPath(tempDir(), randomUUID().toString());
auto pathe = buildPath(tempDir(), randomUUID().toString());
std.file.write(pathi, "INPUT"~std.ascii.newline);
auto filei = File(pathi, "r");
auto fileo = File(patho, "w");
auto filee = File(pathe, "w");
pid = spawnProcess([prog.path, "bar", "baz" ], filei, fileo, filee);
wait(pid);
assert (readText(patho).chomp() == "INPUT output bar");
assert (readText(pathe).chomp().stripRight() == "INPUT error baz");
remove(pathi);
remove(patho);
remove(pathe);
}
unittest // Error handling in spawnProcess()
{
assertThrown!ProcessException(spawnProcess("ewrgiuhrifuheiohnmnvqweoijwf"));
assertThrown!ProcessException(spawnProcess("./rgiuhrifuheiohnmnvqweoijwf"));
}
/**
A variation on $(LREF spawnProcess) that runs the given _command through
the current user's preferred _command interpreter (aka. shell).
The string $(D command) is passed verbatim to the shell, and is therefore
subject to its rules about _command structure, argument/filename quoting
and escaping of special characters.
The path to the shell executable is determined by the $(LREF userShell)
function.
In all other respects this function works just like $(D spawnProcess).
Please refer to the $(LREF spawnProcess) documentation for descriptions
of the other function parameters, the return value and any exceptions
that may be thrown.
---
// Run the command/program "foo" on the file named "my file.txt", and
// redirect its output into foo.log.
auto pid = spawnShell(`foo "my file.txt" > foo.log`);
wait(pid);
---
See_also:
$(LREF escapeShellCommand), which may be helpful in constructing a
properly quoted and escaped shell _command line for the current platform.
*/
Pid spawnShell(in char[] command,
File stdin = std.stdio.stdin,
File stdout = std.stdio.stdout,
File stderr = std.stdio.stderr,
const string[string] env = null,
Config config = Config.none)
@trusted // TODO: Should be @safe
{
version (Windows)
{
auto args = escapeShellArguments(userShell, shellSwitch)
~ " " ~ command;
}
else version (Posix)
{
const(char)[][3] args;
args[0] = userShell;
args[1] = shellSwitch;
args[2] = command;
}
return spawnProcessImpl(args, stdin, stdout, stderr, env, config);
}
/// ditto
Pid spawnShell(in char[] command,
const string[string] env,
Config config = Config.none)
@trusted // TODO: Should be @safe
{
return spawnShell(command,
std.stdio.stdin,
std.stdio.stdout,
std.stdio.stderr,
env,
config);
}
unittest
{
version (Windows)
auto cmd = "echo %FOO%";
else version (Posix)
auto cmd = "echo $foo";
import std.file;
auto tmpFile = uniqueTempPath();
scope(exit) if (exists(tmpFile)) remove(tmpFile);
auto redir = "> \""~tmpFile~'"';
auto env = ["foo" : "bar"];
assert (wait(spawnShell(cmd~redir, env)) == 0);
auto f = File(tmpFile, "a");
assert (wait(spawnShell(cmd, std.stdio.stdin, f, std.stdio.stderr, env)) == 0);
f.close();
auto output = std.file.readText(tmpFile);
assert (output == "bar\nbar\n" || output == "bar\r\nbar\r\n");
}
/**
Flags that control the behaviour of $(LREF spawnProcess) and
$(LREF spawnShell).
Use bitwise OR to combine flags.
Example:
---
auto logFile = File("myapp_error.log", "w");
// Start program, suppressing the console window (Windows only),
// redirect its error stream to logFile, and leave logFile open
// in the parent process as well.
auto pid = spawnProcess("myapp", stdin, stdout, logFile,
Config.retainStderr | Config.suppressConsole);
scope(exit)
{
auto exitCode = wait(pid);
logFile.writeln("myapp exited with code ", exitCode);
logFile.close();
}
---
*/
enum Config
{
none = 0,
/**
By default, the child process inherits the parent's environment,
and any environment variables passed to $(LREF spawnProcess) will
be added to it. If this flag is set, the only variables in the
child process' environment will be those given to spawnProcess.
*/
newEnv = 1,
/**
Unless the child process inherits the standard input/output/error
streams of its parent, one almost always wants the streams closed
in the parent when $(LREF spawnProcess) returns. Therefore, by
default, this is done. If this is not desirable, pass any of these
options to spawnProcess.
*/
retainStdin = 2,
retainStdout = 4, /// ditto
retainStderr = 8, /// ditto
/**
On Windows, if the child process is a console application, this
flag will prevent the creation of a console window. Otherwise,
it will be ignored. On POSIX, $(D suppressConsole) has no effect.
*/
suppressConsole = 16,
/**
On POSIX, open $(LINK2 http://en.wikipedia.org/wiki/File_descriptor,file descriptors)
are by default inherited by the child process. As this may lead
to subtle bugs when pipes or multiple threads are involved,
$(LREF spawnProcess) ensures that all file descriptors except the
ones that correspond to standard input/output/error are closed
in the child process when it starts. Use $(D inheritFDs) to prevent
this.
On Windows, this option has no effect, and any handles which have been
explicitly marked as inheritable will always be inherited by the child
process.
*/
inheritFDs = 32,
}
/// A handle that corresponds to a spawned process.
final class Pid
{
/**
The process ID number.
This is a number that uniquely identifies the process on the operating
system, for at least as long as the process is running. Once $(LREF wait)
has been called on the $(LREF Pid), this method will return an
invalid process ID.
*/
@property int processID() const @safe pure nothrow
{
return _processID;
}
/**
An operating system handle to the process.
This handle is used to specify the process in OS-specific APIs.
On POSIX, this function returns a $(D core.sys.posix.sys.types.pid_t)
with the same value as $(LREF Pid.processID), while on Windows it returns
a $(D core.sys.windows.windows.HANDLE).
Once $(LREF wait) has been called on the $(LREF Pid), this method
will return an invalid handle.
*/
// Note: Since HANDLE is a reference, this function cannot be const.
version (Windows)
@property HANDLE osHandle() @safe pure nothrow
{
return _handle;
}
else version (Posix)
@property pid_t osHandle() @safe pure nothrow
{
return _processID;
}
private:
/*
Pid.performWait() does the dirty work for wait() and nonBlockingWait().
If block == true, this function blocks until the process terminates,
sets _processID to terminated, and returns the exit code or terminating
signal as described in the wait() documentation.
If block == false, this function returns immediately, regardless
of the status of the process. If the process has terminated, the
function has the exact same effect as the blocking version. If not,
it returns 0 and does not modify _processID.
*/
version (Posix)
int performWait(bool block) @trusted
{
if (_processID == terminated) return _exitCode;
int exitCode;
while(true)
{
int status;
auto check = waitpid(_processID, &status, block ? 0 : WNOHANG);
if (check == -1)
{
if (errno == ECHILD)
{
throw new ProcessException(
"Process does not exist or is not a child process.");
}
else
{
// waitpid() was interrupted by a signal. We simply
// restart it.
assert (errno == EINTR);
continue;
}
}
if (!block && check == 0) return 0;
if (WIFEXITED(status))
{
exitCode = WEXITSTATUS(status);
break;
}
else if (WIFSIGNALED(status))
{
exitCode = -WTERMSIG(status);
break;
}
// We check again whether the call should be blocking,
// since we don't care about other status changes besides
// "exited" and "terminated by signal".
if (!block) return 0;
// Process has stopped, but not terminated, so we continue waiting.
}
// Mark Pid as terminated, and cache and return exit code.
_processID = terminated;
_exitCode = exitCode;
return exitCode;
}
else version (Windows)
{
int performWait(bool block) @trusted
{
if (_processID == terminated) return _exitCode;
assert (_handle != INVALID_HANDLE_VALUE);
if (block)
{
auto result = WaitForSingleObject(_handle, INFINITE);
if (result != WAIT_OBJECT_0)
throw ProcessException.newFromLastError("Wait failed.");
}
if (!GetExitCodeProcess(_handle, cast(LPDWORD)&_exitCode))
throw ProcessException.newFromLastError();
if (!block && _exitCode == STILL_ACTIVE) return 0;
CloseHandle(_handle);
_handle = INVALID_HANDLE_VALUE;
_processID = terminated;
return _exitCode;
}
~this()
{
if(_handle != INVALID_HANDLE_VALUE)
{
CloseHandle(_handle);
_handle = INVALID_HANDLE_VALUE;
}
}
}
// Special values for _processID.
enum invalid = -1, terminated = -2;
// OS process ID number. Only nonnegative IDs correspond to
// running processes.
int _processID = invalid;
// Exit code cached by wait(). This is only expected to hold a
// sensible value if _processID == terminated.
int _exitCode;
// Pids are only meant to be constructed inside this module, so
// we make the constructor private.
version (Windows)
{
HANDLE _handle = INVALID_HANDLE_VALUE;
this(int pid, HANDLE handle) @safe pure nothrow
{
_processID = pid;
_handle = handle;
}
}
else
{
this(int id) @safe pure nothrow
{
_processID = id;
}
}
}
/**
Waits for the process associated with $(D pid) to terminate, and returns
its exit status.
In general one should always _wait for child processes to terminate
before exiting the parent process. Otherwise, they may become
"$(WEB en.wikipedia.org/wiki/Zombie_process,zombies)" – processes
that are defunct, yet still occupy a slot in the OS process table.
If the process has already terminated, this function returns directly.
The exit code is cached, so that if wait() is called multiple times on
the same $(LREF Pid) it will always return the same value.
POSIX_specific:
If the process is terminated by a signal, this function returns a
negative number whose absolute value is the signal number.
Since POSIX restricts normal exit codes to the range 0-255, a
negative return value will always indicate termination by signal.
Signal codes are defined in the $(D core.sys.posix.signal) module
(which corresponds to the $(D signal.h) POSIX header).
Throws:
$(LREF ProcessException) on failure.
Examples:
See the $(LREF spawnProcess) documentation.
See_also:
$(LREF tryWait), for a non-blocking function.
*/
int wait(Pid pid) @safe
{
assert(pid !is null, "Called wait on a null Pid.");
return pid.performWait(true);
}
unittest // Pid and wait()
{
version (Windows) TestScript prog = "exit %~1";
else version (Posix) TestScript prog = "exit $1";
assert (wait(spawnProcess([prog.path, "0"])) == 0);
assert (wait(spawnProcess([prog.path, "123"])) == 123);
auto pid = spawnProcess([prog.path, "10"]);
assert (pid.processID > 0);
version (Windows) assert (pid.osHandle != INVALID_HANDLE_VALUE);
else version (Posix) assert (pid.osHandle == pid.processID);
assert (wait(pid) == 10);
assert (wait(pid) == 10); // cached exit code
assert (pid.processID < 0);
version (Windows) assert (pid.osHandle == INVALID_HANDLE_VALUE);
else version (Posix) assert (pid.osHandle < 0);
}
/**
A non-blocking version of $(LREF wait).
If the process associated with $(D pid) has already terminated,
$(D tryWait) has the exact same effect as $(D wait).
In this case, it returns a struct where the $(D terminated) field
is set to $(D true) and the $(D status) field has the same
interpretation as the return value of $(D wait).
If the process has $(I not) yet terminated, this function differs
from $(D wait) in that does not wait for this to happen, but instead
returns immediately. The $(D terminated) field of the returned
tuple will then be set to $(D false), while the $(D status) field
will always be 0 (zero). $(D wait) or $(D tryWait) should then be
called again on the same $(D Pid) at some later time; not only to
get the exit code, but also to avoid the process becoming a "zombie"
when it finally terminates. (See $(LREF wait) for details).
Returns:
A $(D struct) which contains the fields $(D bool terminated)
and $(D int status). (This will most likely change to become a
$(D std.typecons.Tuple!(bool,"terminated",int,"status")) in the future,
but a compiler bug currently prevents this.)
Throws:
$(LREF ProcessException) on failure.
Example:
---
auto pid = spawnProcess("dmd myapp.d");
scope(exit) wait(pid);
...
auto dmd = tryWait(pid);
if (dmd.terminated)
{
if (dmd.status == 0) writeln("Compilation succeeded!");
else writeln("Compilation failed");
}
else writeln("Still compiling...");
...
---
Note that in this example, the first $(D wait) call will have no
effect if the process has already terminated by the time $(D tryWait)
is called. In the opposite case, however, the $(D scope) statement
ensures that we always wait for the process if it hasn't terminated
by the time we reach the end of the scope.
*/
auto tryWait(Pid pid) @safe
{
struct TryWaitResult
{
bool terminated;
int status;
}
assert(pid !is null, "Called tryWait on a null Pid.");
auto code = pid.performWait(false);
return TryWaitResult(pid._processID == Pid.terminated, code);
}
// unittest: This function is tested together with kill() below.
/**
Attempts to terminate the process associated with $(D pid).
The effect of this function, as well as the meaning of $(D codeOrSignal),
is highly platform dependent. Details are given below. Common to all
platforms is that this function only $(I initiates) termination of the process,
and returns immediately. It does not wait for the process to end,
nor does it guarantee that the process does in fact get terminated.
Always call $(LREF wait) to wait for a process to complete, even if $(D kill)
has been called on it.
Windows_specific:
The process will be
$(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/ms686714%28v=vs.100%29.aspx,
forcefully and abruptly terminated). If $(D codeOrSignal) is specified, it
must be a nonnegative number which will be used as the exit code of the process.
If not, the process wil exit with code 1. Do not use $(D codeOrSignal = 259),
as this is a special value (aka. $(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/ms683189.aspx,STILL_ACTIVE))
used by Windows to signal that a process has in fact $(I not) terminated yet.
---
auto pid = spawnProcess("some_app");
kill(pid, 10);
assert (wait(pid) == 10);
---
POSIX_specific:
A $(LINK2 http://en.wikipedia.org/wiki/Unix_signal,signal) will be sent to
the process, whose value is given by $(D codeOrSignal). Depending on the
signal sent, this may or may not terminate the process. Symbolic constants
for various $(LINK2 http://en.wikipedia.org/wiki/Unix_signal#POSIX_signals,
POSIX signals) are defined in $(D core.sys.posix.signal), which corresponds to the
$(LINK2 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html,
$(D signal.h) POSIX header). If $(D codeOrSignal) is omitted, the
$(D SIGTERM) signal will be sent. (This matches the behaviour of the
$(LINK2 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/kill.html,
$(D _kill)) shell command.)
---
import core.sys.posix.signal: SIGKILL;
auto pid = spawnProcess("some_app");
kill(pid, SIGKILL);
assert (wait(pid) == -SIGKILL); // Negative return value on POSIX!
---
Throws:
$(LREF ProcessException) on error (e.g. if codeOrSignal is invalid).
Note that failure to terminate the process is considered a "normal"
outcome, not an error.$(BR)
*/
void kill(Pid pid)
{
version (Windows) kill(pid, 1);
else version (Posix)
{
import core.sys.posix.signal: SIGTERM;
kill(pid, SIGTERM);
}
}
/// ditto
void kill(Pid pid, int codeOrSignal)
{
version (Windows)
{
if (codeOrSignal < 0) throw new ProcessException("Invalid exit code");
version (Win32)
{
// On Windows XP, TerminateProcess() appears to terminate the
// *current* process if it is passed an invalid handle...
if (pid.osHandle == INVALID_HANDLE_VALUE)
throw new ProcessException("Invalid process handle");
}
if (!TerminateProcess(pid.osHandle, codeOrSignal))
throw ProcessException.newFromLastError();
}
else version (Posix)
{
import core.sys.posix.signal;
if (kill(pid.osHandle, codeOrSignal) == -1)
throw ProcessException.newFromErrno();
}
}
unittest // tryWait() and kill()
{
import core.thread;
// The test script goes into an infinite loop.
version (Windows)
{
TestScript prog = ":loop
goto loop";
}
else version (Posix)
{
import core.sys.posix.signal: SIGTERM, SIGKILL;
TestScript prog = "while true; do sleep 1; done";
}
auto pid = spawnProcess(prog.path);
Thread.sleep(dur!"seconds"(1));
kill(pid);
version (Windows) assert (wait(pid) == 1);
else version (Posix) assert (wait(pid) == -SIGTERM);
pid = spawnProcess(prog.path);
Thread.sleep(dur!"seconds"(1));
auto s = tryWait(pid);
assert (!s.terminated && s.status == 0);
assertThrown!ProcessException(kill(pid, -123)); // Negative code not allowed.
version (Windows) kill(pid, 123);
else version (Posix) kill(pid, SIGKILL);
do { s = tryWait(pid); } while (!s.terminated);
version (Windows) assert (s.status == 123);
else version (Posix) assert (s.status == -SIGKILL);
assertThrown!ProcessException(kill(pid));
}
/**
Creates a unidirectional _pipe.
Data is written to one end of the _pipe and read from the other.
---
auto p = pipe();
p.writeEnd.writeln("Hello World");
assert (p.readEnd.readln().chomp() == "Hello World");
---
Pipes can, for example, be used for interprocess communication
by spawning a new process and passing one end of the _pipe to
the child, while the parent uses the other end.
(See also $(LREF pipeProcess) and $(LREF pipeShell) for an easier
way of doing this.)
---
// Use cURL to download the dlang.org front page, pipe its
// output to grep to extract a list of links to ZIP files,
// and write the list to the file "D downloads.txt":
auto p = pipe();
auto outFile = File("D downloads.txt", "w");
auto cpid = spawnProcess(["curl", "http://dlang.org/download.html"],
std.stdio.stdin, p.writeEnd);
scope(exit) wait(cpid);
auto gpid = spawnProcess(["grep", "-o", `http://\S*\.zip`],
p.readEnd, outFile);
scope(exit) wait(gpid);
---
Returns:
A $(LREF Pipe) object that corresponds to the created _pipe.
Throws:
$(XREF stdio,StdioException) on failure.
*/
version (Posix)
Pipe pipe() @trusted //TODO: @safe
{
int[2] fds;
if (core.sys.posix.unistd.pipe(fds) != 0)
throw new StdioException("Unable to create pipe");
Pipe p;
auto readFP = fdopen(fds[0], "r");
if (readFP == null)
throw new StdioException("Cannot open read end of pipe");
p._read = File(readFP, null);
auto writeFP = fdopen(fds[1], "w");
if (writeFP == null)
throw new StdioException("Cannot open write end of pipe");
p._write = File(writeFP, null);
return p;
}
else version (Windows)
Pipe pipe() @trusted //TODO: @safe
{
// use CreatePipe to create an anonymous pipe
HANDLE readHandle;
HANDLE writeHandle;
if (!CreatePipe(&readHandle, &writeHandle, null, 0))
{
throw new StdioException(
"Error creating pipe (" ~ sysErrorString(GetLastError()) ~ ')',
0);
}
// Create file descriptors from the handles
version (DMC_RUNTIME)
{
auto readFD = _handleToFD(readHandle, FHND_DEVICE);
auto writeFD = _handleToFD(writeHandle, FHND_DEVICE);
}
else // MSVCRT
{
auto readFD = _open_osfhandle(readHandle, _O_RDONLY);
auto writeFD = _open_osfhandle(writeHandle, _O_APPEND);
}
version (DMC_RUNTIME) alias .close _close;
if (readFD == -1 || writeFD == -1)
{
// Close file descriptors, then throw.
if (readFD >= 0) _close(readFD);
else CloseHandle(readHandle);
if (writeFD >= 0) _close(writeFD);
else CloseHandle(writeHandle);
throw new StdioException("Error creating pipe");
}
// Create FILE pointers from the file descriptors
Pipe p;
version (DMC_RUNTIME)
{
// This is a re-implementation of DMC's fdopen, but without the
// mucking with the file descriptor. POSIX standard requires the
// new fdopen'd file to retain the given file descriptor's
// position.
FILE * local_fdopen(int fd, const(char)* mode)
{
auto fp = core.stdc.stdio.fopen("NUL", mode);
if(!fp) return null;
FLOCK(fp);
auto iob = cast(_iobuf*)fp;
.close(iob._file);
iob._file = fd;
iob._flag &= ~_IOTRAN;
FUNLOCK(fp);
return fp;
}
auto readFP = local_fdopen(readFD, "r");
auto writeFP = local_fdopen(writeFD, "a");
}
else // MSVCRT
{
auto readFP = _fdopen(readFD, "r");
auto writeFP = _fdopen(writeFD, "a");
}
if (readFP == null || writeFP == null)
{
// Close streams, then throw.
if (readFP != null) fclose(readFP);
else _close(readFD);
if (writeFP != null) fclose(writeFP);
else _close(writeFD);
throw new StdioException("Cannot open pipe");
}
p._read = File(readFP, null);
p._write = File(writeFP, null);
return p;
}
/// An interface to a pipe created by the $(LREF pipe) function.
struct Pipe
{
/// The read end of the pipe.
@property File readEnd() @trusted /*TODO: @safe nothrow*/ { return _read; }
/// The write end of the pipe.
@property File writeEnd() @trusted /*TODO: @safe nothrow*/ { return _write; }
/**
Closes both ends of the pipe.
Normally it is not necessary to do this manually, as $(XREF stdio,File)
objects are automatically closed when there are no more references
to them.
Note that if either end of the pipe has been passed to a child process,
it will only be closed in the parent process. (What happens in the
child process is platform dependent.)
*/
void close() @trusted //TODO: @safe nothrow
{
_read.close();
_write.close();
}
private:
File _read, _write;
}
unittest
{
auto p = pipe();
p.writeEnd.writeln("Hello World");
p.writeEnd.flush();
assert (p.readEnd.readln().chomp() == "Hello World");
p.close();
assert (!p.readEnd.isOpen);
assert (!p.writeEnd.isOpen);
}
/**
Starts a new process, creating pipes to redirect its standard
input, output and/or error streams.
$(D pipeProcess) and $(D pipeShell) are convenient wrappers around
$(LREF spawnProcess) and $(LREF spawnShell), respectively, and
automate the task of redirecting one or more of the child process'
standard streams through pipes. Like the functions they wrap,
these functions return immediately, leaving the child process to
execute in parallel with the invoking process. It is recommended
to always call $(LREF wait) on the returned $(LREF ProcessPipes.pid),
as detailed in the documentation for $(D wait).
The $(D args)/$(D program)/$(D command), $(D env) and $(D config)
parameters are forwarded straight to the underlying spawn functions,
and we refer to their documentation for details.
Params:
args = An array which contains the program name as the zeroth element
and any command-line arguments in the following elements.
(See $(LREF spawnProcess) for details.)
program = The program name, $(I without) command-line arguments.
(See $(LREF spawnProcess) for details.)
command = A shell command which is passed verbatim to the command
interpreter. (See $(LREF spawnShell) for details.)
redirect = Flags that determine which streams are redirected, and
how. See $(LREF Redirect) for an overview of available
flags.
env = Additional environment variables for the child process.
(See $(LREF spawnProcess) for details.)
config = Flags that control process creation. See $(LREF Config)
for an overview of available flags, and note that the
$(D retainStd...) flags have no effect in this function.
Returns:
A $(LREF ProcessPipes) object which contains $(XREF stdio,File)
handles that communicate with the redirected streams of the child
process, along with a $(LREF Pid) object that corresponds to the
spawned process.
Throws:
$(LREF ProcessException) on failure to start the process.$(BR)
$(XREF stdio,StdioException) on failure to redirect any of the streams.$(BR)
Example:
---
auto pipes = pipeProcess("my_application", Redirect.stdout | Redirect.stderr);
scope(exit) wait(pipes.pid);
// Store lines of output.
string[] output;
foreach (line; pipes.stdout.byLine) output ~= line.idup;
// Store lines of errors.
string[] errors;
foreach (line; pipes.stderr.byLine) errors ~= line.idup;
---
*/
ProcessPipes pipeProcess(in char[][] args,
Redirect redirect = Redirect.all,
const string[string] env = null,
Config config = Config.none)
@trusted //TODO: @safe
{
return pipeProcessImpl!spawnProcess(args, redirect, env, config);
}
/// ditto
ProcessPipes pipeProcess(in char[] program,
Redirect redirect = Redirect.all,
const string[string] env = null,
Config config = Config.none)
@trusted
{
return pipeProcessImpl!spawnProcess(program, redirect, env, config);
}
/// ditto
ProcessPipes pipeShell(in char[] command,
Redirect redirect = Redirect.all,
const string[string] env = null,
Config config = Config.none)
@safe
{
return pipeProcessImpl!spawnShell(command, redirect, env, config);
}
// Implementation of the pipeProcess() family of functions.
private ProcessPipes pipeProcessImpl(alias spawnFunc, Cmd)
(Cmd command,
Redirect redirectFlags,
const string[string] env = null,
Config config = Config.none)
@trusted //TODO: @safe
{
File childStdin, childStdout, childStderr;
ProcessPipes pipes;
pipes._redirectFlags = redirectFlags;
if (redirectFlags & Redirect.stdin)
{
auto p = pipe();
childStdin = p.readEnd;
pipes._stdin = p.writeEnd;
}
else
{
childStdin = std.stdio.stdin;
}
if (redirectFlags & Redirect.stdout)
{
if ((redirectFlags & Redirect.stdoutToStderr) != 0)
throw new StdioException("Cannot create pipe for stdout AND "
~"redirect it to stderr", 0);
auto p = pipe();
childStdout = p.writeEnd;
pipes._stdout = p.readEnd;
}
else
{
childStdout = std.stdio.stdout;
}
if (redirectFlags & Redirect.stderr)
{
if ((redirectFlags & Redirect.stderrToStdout) != 0)
throw new StdioException("Cannot create pipe for stderr AND "
~"redirect it to stdout", 0);
auto p = pipe();
childStderr = p.writeEnd;
pipes._stderr = p.readEnd;
}
else
{
childStderr = std.stdio.stderr;
}
if (redirectFlags & Redirect.stdoutToStderr)
{
if (redirectFlags & Redirect.stderrToStdout)
{
// We know that neither of the other options have been
// set, so we assign the std.stdio.std* streams directly.
childStdout = std.stdio.stderr;
childStderr = std.stdio.stdout;
}
else
{
childStdout = childStderr;
}
}
else if (redirectFlags & Redirect.stderrToStdout)
{
childStderr = childStdout;
}
config &= ~(Config.retainStdin | Config.retainStdout | Config.retainStderr);
pipes._pid = spawnFunc(command, childStdin, childStdout, childStderr,
env, config);
return pipes;
}
/**
Flags that can be passed to $(LREF pipeProcess) and $(LREF pipeShell)
to specify which of the child process' standard streams are redirected.
Use bitwise OR to combine flags.
*/
enum Redirect
{
/// Redirect the standard input, output or error streams, respectively.
stdin = 1,
stdout = 2, /// ditto
stderr = 4, /// ditto
/**
Redirect _all three streams. This is equivalent to
$(D Redirect.stdin | Redirect.stdout | Redirect.stderr).
*/
all = stdin | stdout | stderr,
/**
Redirect the standard error stream into the standard output stream.
This can not be combined with $(D Redirect.stderr).
*/
stderrToStdout = 8,
/**
Redirect the standard output stream into the standard error stream.
This can not be combined with $(D Redirect.stdout).
*/
stdoutToStderr = 16,
}
unittest
{
version (Windows) TestScript prog =
"call :sub %~1 %~2 0
call :sub %~1 %~2 1
call :sub %~1 %~2 2
call :sub %~1 %~2 3
exit 3
:sub
set /p INPUT=
if -%INPUT%-==-stop- ( exit %~3 )
echo %INPUT% %~1
echo %INPUT% %~2 1>&2";
else version (Posix) TestScript prog =
`for EXITCODE in 0 1 2 3; do
read INPUT
if test "$INPUT" = stop; then break; fi
echo "$INPUT $1"
echo "$INPUT $2" >&2
done
exit $EXITCODE`;
auto pp = pipeProcess([prog.path, "bar", "baz"]);
pp.stdin.writeln("foo");
pp.stdin.flush();
assert (pp.stdout.readln().chomp() == "foo bar");
assert (pp.stderr.readln().chomp().stripRight() == "foo baz");
pp.stdin.writeln("1234567890");
pp.stdin.flush();
assert (pp.stdout.readln().chomp() == "1234567890 bar");
assert (pp.stderr.readln().chomp().stripRight() == "1234567890 baz");
pp.stdin.writeln("stop");
pp.stdin.flush();
assert (wait(pp.pid) == 2);
pp = pipeProcess([prog.path, "12345", "67890"],
Redirect.stdin | Redirect.stdout | Redirect.stderrToStdout);
pp.stdin.writeln("xyz");
pp.stdin.flush();
assert (pp.stdout.readln().chomp() == "xyz 12345");
assert (pp.stdout.readln().chomp().stripRight() == "xyz 67890");
pp.stdin.writeln("stop");
pp.stdin.flush();
assert (wait(pp.pid) == 1);
pp = pipeShell(prog.path~" AAAAA BBB",
Redirect.stdin | Redirect.stdoutToStderr | Redirect.stderr);
pp.stdin.writeln("ab");
pp.stdin.flush();
assert (pp.stderr.readln().chomp() == "ab AAAAA");
assert (pp.stderr.readln().chomp().stripRight() == "ab BBB");
pp.stdin.writeln("stop");
pp.stdin.flush();
assert (wait(pp.pid) == 1);
}
unittest
{
TestScript prog = "exit 0";
assertThrown!StdioException(pipeProcess(
prog.path,
Redirect.stdout | Redirect.stdoutToStderr));
assertThrown!StdioException(pipeProcess(
prog.path,
Redirect.stderr | Redirect.stderrToStdout));
auto p = pipeProcess(prog.path, Redirect.stdin);
assertThrown!Error(p.stdout);
assertThrown!Error(p.stderr);
wait(p.pid);
p = pipeProcess(prog.path, Redirect.stderr);
assertThrown!Error(p.stdin);
assertThrown!Error(p.stdout);
wait(p.pid);
}
/**
Object which contains $(XREF stdio,File) handles that allow communication
with a child process through its standard streams.
*/
struct ProcessPipes
{
/// The $(LREF Pid) of the child process.
@property Pid pid() @safe nothrow
{
assert(_pid !is null);
return _pid;
}
/**
An $(XREF stdio,File) that allows writing to the child process'
standard input stream.
Throws:
$(OBJECTREF Error) if the child process' standard input stream hasn't
been redirected.
*/
@property File stdin() @trusted //TODO: @safe nothrow
{
if ((_redirectFlags & Redirect.stdin) == 0)
throw new Error("Child process' standard input stream hasn't "
~"been redirected.");
return _stdin;
}
/**
An $(XREF stdio,File) that allows reading from the child process'
standard output stream.
Throws:
$(OBJECTREF Error) if the child process' standard output stream hasn't
been redirected.
*/
@property File stdout() @trusted //TODO: @safe nothrow
{
if ((_redirectFlags & Redirect.stdout) == 0)
throw new Error("Child process' standard output stream hasn't "
~"been redirected.");
return _stdout;
}
/**
An $(XREF stdio,File) that allows reading from the child process'
standard error stream.
Throws:
$(OBJECTREF Error) if the child process' standard error stream hasn't
been redirected.
*/
@property File stderr() @trusted //TODO: @safe nothrow
{
if ((_redirectFlags & Redirect.stderr) == 0)
throw new Error("Child process' standard error stream hasn't "
~"been redirected.");
return _stderr;
}
private:
Redirect _redirectFlags;
Pid _pid;
File _stdin, _stdout, _stderr;
}
/**
Executes the given program or shell command and returns its exit
code and output.
$(D execute) and $(D executeShell) start a new process using
$(LREF spawnProcess) and $(LREF spawnShell), respectively, and wait
for the process to complete before returning. The functions capture
what the child process prints to both its standard output and
standard error streams, and return this together with its exit code.
---
auto dmd = execute(["dmd", "myapp.d"]);
if (dmd.status != 0) writeln("Compilation failed:\n", dmd.output);
auto ls = executeShell("ls -l");
if (ls.status == 0) writeln("Failed to retrieve file listing");
else writeln(ls.output);
---
The $(D args)/$(D program)/$(D command), $(D env) and $(D config)
parameters are forwarded straight to the underlying spawn functions,
and we refer to their documentation for details.
Params:
args = An array which contains the program name as the zeroth element
and any command-line arguments in the following elements.
(See $(LREF spawnProcess) for details.)
program = The program name, $(I without) command-line arguments.
(See $(LREF spawnProcess) for details.)
command = A shell command which is passed verbatim to the command
interpreter. (See $(LREF spawnShell) for details.)
env = Additional environment variables for the child process.
(See $(LREF spawnProcess) for details.)
config = Flags that control process creation. See $(LREF Config)
for an overview of available flags, and note that the
$(D retainStd...) flags have no effect in this function.
maxOutput = The maximum number of bytes of output that should be
captured.
Returns:
A $(D struct) which contains the fields $(D int status) and
$(D string output). (This will most likely change to become a
$(D std.typecons.Tuple!(int,"status",string,"output")) in the future,
but a compiler bug currently prevents this.)
POSIX_specific:
If the process is terminated by a signal, the $(D status) field of
the return value will contain a negative number whose absolute
value is the signal number. (See $(LREF wait) for details.)
Throws:
$(LREF ProcessException) on failure to start the process.$(BR)
$(XREF stdio,StdioException) on failure to capture output.
*/
auto execute(in char[][] args,
const string[string] env = null,
Config config = Config.none,
size_t maxOutput = size_t.max)
@trusted //TODO: @safe
{
return executeImpl!pipeProcess(args, env, config, maxOutput);
}
/// ditto
auto execute(in char[] program,
const string[string] env = null,
Config config = Config.none,
size_t maxOutput = size_t.max)
@trusted //TODO: @safe
{
return executeImpl!pipeProcess(program, env, config, maxOutput);
}
/// ditto
auto executeShell(in char[] command,
const string[string] env = null,
Config config = Config.none,
size_t maxOutput = size_t.max)
@trusted //TODO: @safe
{
return executeImpl!pipeShell(command, env, config, maxOutput);
}
// Does the actual work for execute() and executeShell().
private auto executeImpl(alias pipeFunc, Cmd)(
Cmd commandLine,
const string[string] env = null,
Config config = Config.none,
size_t maxOutput = size_t.max)
{
auto p = pipeFunc(commandLine, Redirect.stdout | Redirect.stderrToStdout,
env, config);
auto a = appender!(ubyte[])();
enum size_t defaultChunkSize = 4096;
immutable chunkSize = min(maxOutput, defaultChunkSize);
// Store up to maxOutput bytes in a.
foreach (ubyte[] chunk; p.stdout.byChunk(chunkSize))
{
immutable size_t remain = maxOutput - a.data.length;
if (chunk.length < remain) a.put(chunk);
else
{
a.put(chunk[0 .. remain]);
break;
}
}
// Exhaust the stream, if necessary.
foreach (ubyte[] chunk; p.stdout.byChunk(defaultChunkSize)) { }
struct ProcessOutput { int status; string output; }
return ProcessOutput(wait(p.pid), cast(string) a.data);
}
unittest
{
// To avoid printing the newline characters, we use the echo|set trick on
// Windows, and printf on POSIX (neither echo -n nor echo \c are portable).
version (Windows) TestScript prog =
"echo|set /p=%~1
echo|set /p=%~2 1>&2
exit 123";
else version (Posix) TestScript prog =
`printf '%s' $1
printf '%s' $2 >&2
exit 123`;
auto r = execute([prog.path, "foo", "bar"]);
assert (r.status == 123);
assert (r.output.stripRight() == "foobar");
auto s = execute([prog.path, "Hello", "World"]);
assert (s.status == 123);
assert (s.output.stripRight() == "HelloWorld");
}
unittest
{
auto r1 = executeShell("echo foo");
assert (r1.status == 0);
assert (r1.output.chomp() == "foo");
auto r2 = executeShell("echo bar 1>&2");
assert (r2.status == 0);
assert (r2.output.chomp().stripRight() == "bar");
auto r3 = executeShell("exit 123");
assert (r3.status == 123);
assert (r3.output.empty);
}
/// An exception that signals a problem with starting or waiting for a process.
class ProcessException : Exception
{
// Standard constructor.
this(string msg, string file = __FILE__, size_t line = __LINE__)
{
super(msg, file, line);
}
// Creates a new ProcessException based on errno.
static ProcessException newFromErrno(string customMsg = null,
string file = __FILE__,
size_t line = __LINE__)
{
import core.stdc.errno;
import std.c.string;
version (linux)
{
char[1024] buf;
auto errnoMsg = to!string(
std.c.string.strerror_r(errno, buf.ptr, buf.length));
}
else
{
auto errnoMsg = to!string(std.c.string.strerror(errno));
}
auto msg = customMsg.empty ? errnoMsg
: customMsg ~ " (" ~ errnoMsg ~ ')';
return new ProcessException(msg, file, line);
}
// Creates a new ProcessException based on GetLastError() (Windows only).
version (Windows)
static ProcessException newFromLastError(string customMsg = null,
string file = __FILE__,
size_t line = __LINE__)
{
auto lastMsg = sysErrorString(GetLastError());
auto msg = customMsg.empty ? lastMsg
: customMsg ~ " (" ~ lastMsg ~ ')';
return new ProcessException(msg, file, line);
}
}
/**
Determines the path to the current user's default command interpreter.
On Windows, this function returns the contents of the COMSPEC environment
variable, if it exists. Otherwise, it returns the string $(D "cmd.exe").
On POSIX, $(D userShell) returns the contents of the SHELL environment
variable, if it exists and is non-empty. Otherwise, it returns
$(D "/bin/sh").
*/
@property string userShell() @safe //TODO: nothrow
{
version (Windows) return environment.get("COMSPEC", "cmd.exe");
else version (Posix) return environment.get("SHELL", "/bin/sh");
}
// A command-line switch that indicates to the shell that it should
// interpret the following argument as a command to be executed.
version (Posix) private immutable string shellSwitch = "-c";
version (Windows) private immutable string shellSwitch = "/C";
/// Returns the process ID number of the current process.
@property int thisProcessID() @trusted //TODO: @safe nothrow
{
version (Windows) return GetCurrentProcessId();
else version (Posix) return getpid();
}
// Unittest support code: TestScript takes a string that contains a
// shell script for the current platform, and writes it to a temporary
// file. On Windows the file name gets a .cmd extension, while on
// POSIX its executable permission bit is set. The file is
// automatically deleted when the object goes out of scope.
version (unittest)
private struct TestScript
{
this(string code)
{
import std.ascii, std.file;
version (Windows)
{
auto ext = ".cmd";
auto firstLine = "@echo off";
}
else version (Posix)
{
auto ext = "";
auto firstLine = "#!/bin/sh";
}
path = uniqueTempPath()~ext;
std.file.write(path, firstLine~std.ascii.newline~code~std.ascii.newline);
version (Posix)
{
import core.sys.posix.sys.stat;
chmod(toStringz(path), octal!777);
}
}
~this()
{
import std.file;
if (!path.empty && exists(path))
{
try { remove(path); }
catch (Exception e)
{
debug std.stdio.stderr.writeln(e.msg);
}
}
}
string path;
}
version (unittest)
private string uniqueTempPath()
{
import std.file, std.uuid;
return buildPath(tempDir(), randomUUID().toString());
}
// =============================================================================
// Functions for shell command quoting/escaping.
// =============================================================================
/*
Command line arguments exist in three forms:
1) string or char* array, as received by main.
Also used internally on POSIX systems.
2) Command line string, as used in Windows'
CreateProcess and CommandLineToArgvW functions.
A specific quoting and escaping algorithm is used
to distinguish individual arguments.
3) Shell command string, as written at a shell prompt
or passed to cmd /C - this one may contain shell
control characters, e.g. > or | for redirection /
piping - thus, yet another layer of escaping is
used to distinguish them from program arguments.
Except for escapeWindowsArgument, the intermediary
format (2) is hidden away from the user in this module.
*/
/**
Escapes an argv-style argument array to be used with $(LREF spawnShell),
$(LREF pipeShell) or $(LREF executeShell).
---
string url = "http://dlang.org/";
executeShell(escapeShellCommand("wget", url, "-O", "dlang-index.html"));
---
Concatenate multiple $(D escapeShellCommand) and
$(LREF escapeShellFileName) results to use shell redirection or
piping operators.
---
executeShell(
escapeShellCommand("curl", "http://dlang.org/download.html") ~
"|" ~
escapeShellCommand("grep", "-o", `http://\S*\.zip`) ~
">" ~
escapeShellFileName("D download links.txt"));
---
Throws:
$(OBJECTREF Exception) if any part of the command line contains unescapable
characters (NUL on all platforms, as well as CR and LF on Windows).
*/
string escapeShellCommand(in char[][] args...)
//TODO: @safe pure nothrow
{
return escapeShellCommandString(escapeShellArguments(args));
}
unittest
{
// This is a simple unit test without any special requirements,
// in addition to the unittest_burnin one below which requires
// special preparation.
struct TestVector { string[] args; string windows, posix; }
TestVector[] tests =
[
{
args : ["foo"],
windows : `^"foo^"`,
posix : `'foo'`
},
{
args : ["foo", "hello"],
windows : `^"foo^" ^"hello^"`,
posix : `'foo' 'hello'`
},
{
args : ["foo", "hello world"],
windows : `^"foo^" ^"hello world^"`,
posix : `'foo' 'hello world'`
},
{
args : ["foo", "hello", "world"],
windows : `^"foo^" ^"hello^" ^"world^"`,
posix : `'foo' 'hello' 'world'`
},
{
args : ["foo", `'"^\`],
windows : `^"foo^" ^"'\^"^^\\^"`,
posix : `'foo' ''\''"^\'`
},
];
foreach (test; tests)
version (Windows)
assert(escapeShellCommand(test.args) == test.windows);
else
assert(escapeShellCommand(test.args) == test.posix );
}
private string escapeShellCommandString(string command)
//TODO: @safe pure nothrow
{
version (Windows)
return escapeWindowsShellCommand(command);
else
return command;
}
private string escapeWindowsShellCommand(in char[] command)
//TODO: @safe pure nothrow (prevented by Appender)
{
auto result = appender!string();
result.reserve(command.length);
foreach (c; command)
switch (c)
{
case '\0':
throw new Exception("Cannot put NUL in command line");
case '\r':
case '\n':
throw new Exception("CR/LF are not escapable");
case '\x01': .. case '\x09':
case '\x0B': .. case '\x0C':
case '\x0E': .. case '\x1F':
case '"':
case '^':
case '&':
case '<':
case '>':
case '|':
result.put('^');
goto default;
default:
result.put(c);
}
return result.data;
}
private string escapeShellArguments(in char[][] args...)
@trusted pure nothrow
{
char[] buf;
@safe nothrow
char[] allocator(size_t size)
{
if (buf.length == 0)
return buf = new char[size];
else
{
auto p = buf.length;
buf.length = buf.length + 1 + size;
buf[p++] = ' ';
return buf[p..p+size];
}
}
foreach (arg; args)
escapeShellArgument!allocator(arg);
return assumeUnique(buf);
}
private auto escapeShellArgument(alias allocator)(in char[] arg) @safe nothrow
{
// The unittest for this function requires special
// preparation - see below.
version (Windows)
return escapeWindowsArgumentImpl!allocator(arg);
else
return escapePosixArgumentImpl!allocator(arg);
}
/**
Quotes a command-line argument in a manner conforming to the behavior of
$(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx,
CommandLineToArgvW).
*/
string escapeWindowsArgument(in char[] arg) @trusted pure nothrow
{
// Rationale for leaving this function as public:
// this algorithm of escaping paths is also used in other software,
// e.g. DMD's response files.
auto buf = escapeWindowsArgumentImpl!charAllocator(arg);
return assumeUnique(buf);
}
private char[] charAllocator(size_t size) @safe pure nothrow
{
return new char[size];
}
private char[] escapeWindowsArgumentImpl(alias allocator)(in char[] arg)
@safe nothrow
if (is(typeof(allocator(size_t.init)[0] = char.init)))
{
// References:
// * http://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
// * http://blogs.msdn.com/b/oldnewthing/archive/2010/09/17/10063629.aspx
// Calculate the total string size.
// Trailing backslashes must be escaped
bool escaping = true;
// Result size = input size + 2 for surrounding quotes + 1 for the
// backslash for each escaped character.
size_t size = 1 + arg.length + 1;
foreach_reverse (c; arg)
{
if (c == '"')
{
escaping = true;
size++;
}
else
if (c == '\\')
{
if (escaping)
size++;
}
else
escaping = false;
}
// Construct result string.
auto buf = allocator(size);
size_t p = size;
buf[--p] = '"';
escaping = true;
foreach_reverse (c; arg)
{
if (c == '"')
escaping = true;
else
if (c != '\\')
escaping = false;
buf[--p] = c;
if (escaping)
buf[--p] = '\\';
}
buf[--p] = '"';
assert(p == 0);
return buf;
}
version(Windows) version(unittest)
{
import core.sys.windows.windows;
import core.stdc.stddef;
extern (Windows) wchar_t** CommandLineToArgvW(wchar_t*, int*);
extern (C) size_t wcslen(in wchar *);
unittest
{
string[] testStrings = [
`Hello`,
`Hello, world`,
`Hello, "world"`,
`C:\`,
`C:\dmd`,
`C:\Program Files\`,
];
enum CHARS = `_x\" *&^`; // _ is placeholder for nothing
foreach (c1; CHARS)
foreach (c2; CHARS)
foreach (c3; CHARS)
foreach (c4; CHARS)
testStrings ~= [c1, c2, c3, c4].replace("_", "");
foreach (s; testStrings)
{
auto q = escapeWindowsArgument(s);
LPWSTR lpCommandLine = (to!(wchar[])("Dummy.exe " ~ q) ~ "\0"w).ptr;
int numArgs;
LPWSTR* args = CommandLineToArgvW(lpCommandLine, &numArgs);
scope(exit) LocalFree(args);
assert(numArgs==2, s ~ " => " ~ q ~ " #" ~ text(numArgs-1));
auto arg = to!string(args[1][0..wcslen(args[1])]);
assert(arg == s, s ~ " => " ~ q ~ " => " ~ arg);
}
}
}
private string escapePosixArgument(in char[] arg) @trusted pure nothrow
{
auto buf = escapePosixArgumentImpl!charAllocator(arg);
return assumeUnique(buf);
}
private char[] escapePosixArgumentImpl(alias allocator)(in char[] arg)
@safe nothrow
if (is(typeof(allocator(size_t.init)[0] = char.init)))
{
// '\'' means: close quoted part of argument, append an escaped
// single quote, and reopen quotes
// Below code is equivalent to:
// return `'` ~ std.array.replace(arg, `'`, `'\''`) ~ `'`;
size_t size = 1 + arg.length + 1;
foreach (c; arg)
if (c == '\'')
size += 3;
auto buf = allocator(size);
size_t p = 0;
buf[p++] = '\'';
foreach (c; arg)
if (c == '\'')
{
buf[p..p+4] = `'\''`;
p += 4;
}
else
buf[p++] = c;
buf[p++] = '\'';
assert(p == size);
return buf;
}
/**
Escapes a filename to be used for shell redirection with $(LREF spawnShell),
$(LREF pipeShell) or $(LREF executeShell).
*/
string escapeShellFileName(in char[] fileName) @trusted pure nothrow
{
// The unittest for this function requires special
// preparation - see below.
version (Windows)
return cast(string)('"' ~ fileName ~ '"');
else
return escapePosixArgument(fileName);
}
// Loop generating strings with random characters
//version = unittest_burnin;
version(unittest_burnin)
unittest
{
// There are no readily-available commands on all platforms suitable
// for properly testing command escaping. The behavior of CMD's "echo"
// built-in differs from the POSIX program, and Windows ports of POSIX
// environments (Cygwin, msys, gnuwin32) may interfere with their own
// "echo" ports.
// To run this unit test, create std_process_unittest_helper.d with the
// following content and compile it:
// import std.stdio, std.array; void main(string[] args) { write(args.join("\0")); }
// Then, test this module with:
// rdmd --main -unittest -version=unittest_burnin process.d
auto helper = absolutePath("std_process_unittest_helper");
assert(shell(helper ~ " hello").split("\0")[1..$] == ["hello"], "Helper malfunction");
void test(string[] s, string fn)
{
string e;
string[] g;
e = escapeShellCommand(helper ~ s);
{
scope(failure) writefln("shell() failed.\nExpected:\t%s\nEncoded:\t%s", s, [e]);
g = shell(e).split("\0")[1..$];
}
assert(s == g, format("shell() test failed.\nExpected:\t%s\nGot:\t\t%s\nEncoded:\t%s", s, g, [e]));
e = escapeShellCommand(helper ~ s) ~ ">" ~ escapeShellFileName(fn);
{
scope(failure) writefln("system() failed.\nExpected:\t%s\nFilename:\t%s\nEncoded:\t%s", s, [fn], [e]);
system(e);
g = readText(fn).split("\0")[1..$];
}
remove(fn);
assert(s == g, format("system() test failed.\nExpected:\t%s\nGot:\t\t%s\nEncoded:\t%s", s, g, [e]));
}
while (true)
{
string[] args;
foreach (n; 0..uniform(1, 4))
{
string arg;
foreach (l; 0..uniform(0, 10))
{
dchar c;
while (true)
{
version (Windows)
{
// As long as DMD's system() uses CreateProcessA,
// we can't reliably pass Unicode
c = uniform(0, 128);
}
else
c = uniform!ubyte();
if (c == 0)
continue; // argv-strings are zero-terminated
version (Windows)
if (c == '\r' || c == '\n')
continue; // newlines are unescapable on Windows
break;
}
arg ~= c;
}
args ~= arg;
}
// generate filename
string fn = "test_";
foreach (l; 0..uniform(1, 10))
{
dchar c;
while (true)
{
version (Windows)
c = uniform(0, 128); // as above
else
c = uniform!ubyte();
if (c == 0 || c == '/')
continue; // NUL and / are the only characters
// forbidden in POSIX filenames
version (Windows)
if (c < '\x20' || c == '<' || c == '>' || c == ':' ||
c == '"' || c == '\\' || c == '|' || c == '?' || c == '*')
continue; // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx
break;
}
fn ~= c;
}
test(args, fn);
}
}
// =============================================================================
// Environment variable manipulation.
// =============================================================================
/**
Manipulates _environment variables using an associative-array-like
interface.
This class contains only static methods, and cannot be instantiated.
See below for examples of use.
*/
abstract final class environment
{
static:
/**
Retrieves the value of the environment variable with the given $(D name).
---
auto path = environment["PATH"];
---
Throws:
$(OBJECTREF Exception) if the environment variable does not exist.
See_also:
$(LREF environment.get), which doesn't throw on failure.
*/
string opIndex(in char[] name) @safe
{
string value;
enforce(getImpl(name, value), "Environment variable not found: "~name);
return value;
}
/**
Retrieves the value of the environment variable with the given $(D name),
or a default value if the variable doesn't exist.
Unlike $(LREF environment.opIndex), this function never throws.
---
auto sh = environment.get("SHELL", "/bin/sh");
---
This function is also useful in checking for the existence of an
environment variable.
---
auto myVar = environment.get("MYVAR");
if (myVar is null)
{
// Environment variable doesn't exist.
// Note that we have to use 'is' for the comparison, since
// myVar == null is also true if the variable exists but is
// empty.
}
---
*/
string get(in char[] name, string defaultValue = null) @safe //TODO: nothrow
{
string value;
auto found = getImpl(name, value);
return found ? value : defaultValue;
}
/**
Assigns the given $(D value) to the environment variable with the given
$(D name).
If the variable does not exist, it will be created. If it already exists,
it will be overwritten.
---
environment["foo"] = "bar";
---
Throws:
$(OBJECTREF Exception) if the environment variable could not be added
(e.g. if the name is invalid).
*/
inout(char)[] opIndexAssign(inout char[] value, in char[] name) @trusted
{
version (Posix)
{
if (core.sys.posix.stdlib.setenv(toStringz(name), toStringz(value), 1) != -1)
{
return value;
}
// The default errno error message is very uninformative
// in the most common case, so we handle it manually.
enforce(errno != EINVAL,
"Invalid environment variable name: '"~name~"'");
errnoEnforce(false,
"Failed to add environment variable");
assert(0);
}
else version (Windows)
{
enforce(
SetEnvironmentVariableW(toUTF16z(name), toUTF16z(value)),
sysErrorString(GetLastError())
);
return value;
}
else static assert(0);
}
/**
Removes the environment variable with the given $(D name).
If the variable isn't in the environment, this function returns
successfully without doing anything.
*/
void remove(in char[] name) @trusted // TODO: @safe nothrow
{
version (Windows) SetEnvironmentVariableW(toUTF16z(name), null);
else version (Posix) core.sys.posix.stdlib.unsetenv(toStringz(name));
else static assert(0);
}
/**
Copies all environment variables into an associative array.
Windows_specific:
While Windows environment variable names are case insensitive, D's
built-in associative arrays are not. This function will store all
variable names in uppercase (e.g. $(D PATH)).
Throws:
$(OBJECTREF Exception) if the environment variables could not
be retrieved (Windows only).
*/
string[string] toAA() @trusted
{
string[string] aa;
version (Posix)
{
for (int i=0; environ[i] != null; ++i)
{
immutable varDef = to!string(environ[i]);
immutable eq = std.string.indexOf(varDef, '=');
assert (eq >= 0);
immutable name = varDef[0 .. eq];
immutable value = varDef[eq+1 .. $];
// In POSIX, environment variables may be defined more
// than once. This is a security issue, which we avoid
// by checking whether the key already exists in the array.
// For more info:
// http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/environment-variables.html
if (name !in aa) aa[name] = value;
}
}
else version (Windows)
{
auto envBlock = GetEnvironmentStringsW();
enforce(envBlock, "Failed to retrieve environment variables.");
scope(exit) FreeEnvironmentStringsW(envBlock);
for (int i=0; envBlock[i] != '\0'; ++i)
{
auto start = i;
while (envBlock[i] != '=') ++i;
immutable name = toUTF8(toUpper(envBlock[start .. i]));
start = i+1;
while (envBlock[i] != '\0') ++i;
// Just like in POSIX systems, environment variables may be
// defined more than once in an environment block on Windows,
// and it is just as much of a security issue there. Moreso,
// in fact, due to the case insensensitivity of variable names,
// which is not handled correctly by all programs.
if (name !in aa) aa[name] = toUTF8(envBlock[start .. i]);
}
}
else static assert(0);
return aa;
}
private:
// Returns the length of an environment variable (in number of
// wchars, including the null terminator), or 0 if it doesn't exist.
version (Windows)
int varLength(LPCWSTR namez) @trusted nothrow
{
return GetEnvironmentVariableW(namez, null, 0);
}
// Retrieves the environment variable, returns false on failure.
bool getImpl(in char[] name, out string value) @trusted //TODO: nothrow
{
version (Windows)
{
const namez = toUTF16z(name);
immutable len = varLength(namez);
if (len == 0) return false;
if (len == 1)
{
value = "";
return true;
}
auto buf = new WCHAR[len];
GetEnvironmentVariableW(namez, buf.ptr, to!DWORD(buf.length));
value = toUTF8(buf[0 .. $-1]);
return true;
}
else version (Posix)
{
const vz = core.sys.posix.stdlib.getenv(toStringz(name));
if (vz == null) return false;
auto v = vz[0 .. strlen(vz)];
// Cache the last call's result.
static string lastResult;
if (v != lastResult) lastResult = v.idup;
value = lastResult;
return true;
}
else static assert(0);
}
}
unittest
{
// New variable
environment["std_process"] = "foo";
assert (environment["std_process"] == "foo");
// Set variable again
environment["std_process"] = "bar";
assert (environment["std_process"] == "bar");
// Remove variable
environment.remove("std_process");
// Remove again, should succeed
environment.remove("std_process");
// Throw on not found.
assertThrown(environment["std_process"]);
// get() without default value
assert (environment.get("std_process") == null);
// get() with default value
assert (environment.get("std_process", "baz") == "baz");
// Convert to associative array
auto aa = environment.toAA();
assert (aa.length > 0);
foreach (n, v; aa)
{
// Wine has some bugs related to environment variables:
// - Wine allows the existence of an env. variable with the name
// "\0", but GetEnvironmentVariable refuses to retrieve it.
// - If an env. variable has zero length, i.e. is "\0",
// GetEnvironmentVariable should return 1. Instead it returns
// 0, indicating the variable doesn't exist.
version (Windows) if (n.length == 0 || v.length == 0) continue;
assert (v == environment[n]);
}
}
// =============================================================================
// Everything below this line was part of the old std.process, and most of
// it will be deprecated and removed.
// =============================================================================
/*
Macros:
WIKI=Phobos/StdProcess
Copyright: Copyright Digital Mars 2007 - 2009.
License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
Authors: $(WEB digitalmars.com, Walter Bright),
$(WEB erdani.org, Andrei Alexandrescu),
$(WEB thecybershadow.net, Vladimir Panteleev)
Source: $(PHOBOSSRC std/_process.d)
*/
/*
Copyright Digital Mars 2007 - 2009.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
import core.stdc.stdlib;
import std.c.stdlib;
import core.stdc.errno;
import core.thread;
import std.c.process;
import std.c.string;
version (Windows)
{
import std.format, std.random, std.file;
}
version (Posix)
{
import core.sys.posix.stdlib;
}
version (unittest)
{
import std.file, std.conv, std.random;
}
/**
Execute $(D command) in a _command shell.
$(RED This function is scheduled for deprecation. Please use
$(LREF spawnShell) or $(LREF executeShell) instead.)
Returns: If $(D command) is null, returns nonzero if the _command
interpreter is found, and zero otherwise. If $(D command) is not
null, returns -1 on error, or the exit status of command (which may
in turn signal an error in command's execution).
Note: On Unix systems, the homonym C function (which is accessible
to D programs as $(LINK2 std_c_process.html, std.c._system))
returns a code in the same format as $(LUCKY waitpid, waitpid),
meaning that C programs must use the $(D WEXITSTATUS) macro to
extract the actual exit code from the $(D system) call. D's $(D
system) automatically extracts the exit status.
*/
int system(string command)
{
if (!command) return std.c.process.system(null);
const commandz = toStringz(command);
immutable status = std.c.process.system(commandz);
if (status == -1) return status;
version (Posix)
{
if (exited(status))
return exitstatus(status);
// Abnormal termination, return -1.
return -1;
}
else version (Windows)
return status;
else
static assert(0, "system not implemented for this OS.");
}
private void toAStringz(in string[] a, const(char)**az)
{
foreach(string s; a)
{
*az++ = toStringz(s);
}
*az = null;
}
/* ========================================================== */
//version (Windows)
//{
// int spawnvp(int mode, string pathname, string[] argv)
// {
// char** argv_ = cast(char**)alloca((char*).sizeof * (1 + argv.length));
//
// toAStringz(argv, argv_);
//
// return std.c.process.spawnvp(mode, toStringz(pathname), argv_);
// }
//}
// Incorporating idea (for spawnvp() on Posix) from Dave Fladebo
alias std.c.process._P_WAIT P_WAIT;
alias std.c.process._P_NOWAIT P_NOWAIT;
int spawnvp(int mode, string pathname, string[] argv)
{
auto argv_ = cast(const(char)**)alloca((char*).sizeof * (1 + argv.length));
toAStringz(argv, argv_);
version (Posix)
{
return _spawnvp(mode, toStringz(pathname), argv_);
}
else version (Windows)
{
return std.c.process.spawnvp(mode, toStringz(pathname), argv_);
}
else
static assert(0, "spawnvp not implemented for this OS.");
}
version (Posix)
{
private import core.sys.posix.unistd;
private import core.sys.posix.sys.wait;
int _spawnvp(int mode, in char *pathname, in char **argv)
{
int retval = 0;
pid_t pid = fork();
if(!pid)
{ // child
std.c.process.execvp(pathname, argv);
goto Lerror;
}
else if(pid > 0)
{ // parent
if(mode == _P_NOWAIT)
{
retval = pid; // caller waits
}
else
{
while(1)
{
int status;
pid_t wpid = waitpid(pid, &status, 0);
if(exited(status))
{
retval = exitstatus(status);
break;
}
else if(signaled(status))
{
retval = -termsig(status);
break;
}
else if(stopped(status)) // ptrace support
continue;
else
goto Lerror;
}
}
return retval;
}
Lerror:
retval = errno;
char[80] buf = void;
throw new Exception(
"Cannot spawn " ~ to!string(pathname) ~ "; "
~ to!string(strerror_r(retval, buf.ptr, buf.length))
~ " [errno " ~ to!string(retval) ~ "]");
} // _spawnvp
private
{
alias WIFSTOPPED stopped;
alias WIFSIGNALED signaled;
alias WTERMSIG termsig;
alias WIFEXITED exited;
alias WEXITSTATUS exitstatus;
} // private
} // version (Posix)
/* ========================================================== */
/**
* Replace the current process by executing a command, $(D pathname), with
* the arguments in $(D argv).
*
* $(RED These functions are scheduled for deprecation. Please use
* $(LREF spawnShell) instead (or, alternatively, the homonymous C
* functions declared in $(D std.c.process).))
*
* Typically, the first element of $(D argv) is
* the command being executed, i.e. $(D argv[0] == pathname). The 'p'
* versions of $(D exec) search the PATH environment variable for $(D
* pathname). The 'e' versions additionally take the new process'
* environment variables as an array of strings of the form key=value.
*
* Does not return on success (the current process will have been
* replaced). Returns -1 on failure with no indication of the
* underlying error.
*/
int execv(in string pathname, in string[] argv)
{
auto argv_ = cast(const(char)**)alloca((char*).sizeof * (1 + argv.length));
toAStringz(argv, argv_);
return std.c.process.execv(toStringz(pathname), argv_);
}
/** ditto */
int execve(in string pathname, in string[] argv, in string[] envp)
{
auto argv_ = cast(const(char)**)alloca((char*).sizeof * (1 + argv.length));
auto envp_ = cast(const(char)**)alloca((char*).sizeof * (1 + envp.length));
toAStringz(argv, argv_);
toAStringz(envp, envp_);
return std.c.process.execve(toStringz(pathname), argv_, envp_);
}
/** ditto */
int execvp(in string pathname, in string[] argv)
{
auto argv_ = cast(const(char)**)alloca((char*).sizeof * (1 + argv.length));
toAStringz(argv, argv_);
return std.c.process.execvp(toStringz(pathname), argv_);
}
/** ditto */
int execvpe(in string pathname, in string[] argv, in string[] envp)
{
version(Posix)
{
// Is pathname rooted?
if(pathname[0] == '/')
{
// Yes, so just call execve()
return execve(pathname, argv, envp);
}
else
{
// No, so must traverse PATHs, looking for first match
string[] envPaths = std.array.split(
to!string(core.stdc.stdlib.getenv("PATH")), ":");
int iRet = 0;
// Note: if any call to execve() succeeds, this process will cease
// execution, so there's no need to check the execve() result through
// the loop.
foreach(string pathDir; envPaths)
{
string composite = cast(string) (pathDir ~ "/" ~ pathname);
iRet = execve(composite, argv, envp);
}
if(0 != iRet)
{
iRet = execve(pathname, argv, envp);
}
return iRet;
}
}
else version(Windows)
{
auto argv_ = cast(const(char)**)alloca((char*).sizeof * (1 + argv.length));
auto envp_ = cast(const(char)**)alloca((char*).sizeof * (1 + envp.length));
toAStringz(argv, argv_);
toAStringz(envp, envp_);
return std.c.process.execvpe(toStringz(pathname), argv_, envp_);
}
else
{
static assert(0);
} // version
}
/**
* Returns the process ID of the calling process, which is guaranteed to be
* unique on the system. This call is always successful.
*
* $(RED This function is scheduled for deprecation. Please use
* $(LREF thisProcessID) instead.)
*
* Example:
* ---
* writefln("Current process id: %s", getpid());
* ---
*/
alias core.thread.getpid getpid;
/**
Runs $(D_PARAM cmd) in a shell and returns its standard output. If
the process could not be started or exits with an error code,
throws ErrnoException.
$(RED This function is scheduled for deprecation. Please use
$(LREF executeShell) instead.)
Example:
----
auto tempFilename = chomp(shell("mcookie"));
auto f = enforce(fopen(tempFilename), "w");
scope(exit)
{
fclose(f) == 0 || assert(false);
system(escapeShellCommand("rm", tempFilename));
}
... use f ...
----
*/
string shell(string cmd)
{
version(Windows)
{
// Generate a random filename
auto a = appender!string();
foreach (ref e; 0 .. 8)
{
formattedWrite(a, "%x", rndGen.front);
rndGen.popFront();
}
auto filename = a.data;
scope(exit) if (exists(filename)) remove(filename);
// We can't use escapeShellCommands here because we don't know
// if cmd is escaped (wrapped in quotes) or not, without relying
// on shady heuristics. The current code shouldn't cause much
// trouble unless filename contained spaces (it won't).
errnoEnforce(system(cmd ~ "> " ~ filename) == 0);
return readText(filename);
}
else version(Posix)
{
File f;
f.popen(cmd, "r");
char[] line;
string result;
while (f.readln(line))
{
result ~= line;
}
f.close();
return result;
}
else
static assert(0, "shell not implemented for this OS.");
}
unittest
{
auto x = shell("echo wyda");
// @@@ This fails on wine
//assert(x == "wyda" ~ newline, text(x.length));
import std.exception; // Issue 9444
assertThrown!ErrnoException(shell("qwertyuiop09813478"));
}
/**
Gets the value of environment variable $(D name) as a string. Calls
$(LINK2 std_c_stdlib.html#_getenv, std.c.stdlib._getenv)
internally.
$(RED This function is scheduled for deprecation. Please use
$(LREF environment.get) instead.)
*/
string getenv(in char[] name)
{
// Cache the last call's result
static string lastResult;
auto p = core.stdc.stdlib.getenv(toStringz(name));
if (!p) return null;
auto value = p[0 .. strlen(p)];
if (value == lastResult) return lastResult;
return lastResult = value.idup;
}
/**
Sets the value of environment variable $(D name) to $(D value). If the
value was written, or the variable was already present and $(D
overwrite) is false, returns normally. Otherwise, it throws an
exception. Calls $(LINK2 std_c_stdlib.html#_setenv,
std.c.stdlib._setenv) internally.
$(RED This function is scheduled for deprecation. Please use
$(LREF environment.opIndexAssign) instead.)
*/
version(StdDdoc) void setenv(in char[] name, in char[] value, bool overwrite);
else version(Posix) void setenv(in char[] name, in char[] value, bool overwrite)
{
errnoEnforce(
std.c.stdlib.setenv(toStringz(name), toStringz(value), overwrite) == 0);
}
/**
Removes variable $(D name) from the environment. Calls $(LINK2
std_c_stdlib.html#_unsetenv, std.c.stdlib._unsetenv) internally.
$(RED This function is scheduled for deprecation. Please use
$(LREF environment.remove) instead.)
*/
version(StdDdoc) void unsetenv(in char[] name);
else version(Posix) void unsetenv(in char[] name)
{
errnoEnforce(std.c.stdlib.unsetenv(toStringz(name)) == 0);
}
version (Posix) unittest
{
setenv("wyda", "geeba", true);
assert(getenv("wyda") == "geeba");
// Get again to make sure caching works
assert(getenv("wyda") == "geeba");
unsetenv("wyda");
assert(getenv("wyda") is null);
}
/* ////////////////////////////////////////////////////////////////////////// */
version(MainTest)
{
int main(string[] args)
{
if(args.length < 2)
{
printf("Must supply executable (and optional arguments)\n");
return 1;
}
else
{
string[] dummy_env;
dummy_env ~= "VAL0=value";
dummy_env ~= "VAL1=value";
/+
foreach(string arg; args)
{
printf("%.*s\n", arg);
}
+/
// int i = execv(args[1], args[1 .. args.length]);
// int i = execvp(args[1], args[1 .. args.length]);
int i = execvpe(args[1], args[1 .. args.length], dummy_env);
printf("exec??() has returned! Error code: %d; errno: %d\n", i, /* errno */-1);
return 0;
}
}
}
/* ////////////////////////////////////////////////////////////////////////// */
version(StdDdoc)
{
/****************************************
* Start up the browser and set it to viewing the page at url.
*/
void browse(string url);
}
else
version (Windows)
{
import core.sys.windows.windows;
extern (Windows)
HINSTANCE ShellExecuteA(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);
pragma(lib,"shell32.lib");
void browse(string url)
{
ShellExecuteA(null, "open", toStringz(url), null, null, SW_SHOWNORMAL);
}
}
else version (OSX)
{
import core.stdc.stdio;
import core.stdc.string;
import core.sys.posix.unistd;
void browse(string url)
{
const(char)*[5] args;
const(char)* browser = core.stdc.stdlib.getenv("BROWSER");
if (browser)
{ browser = strdup(browser);
args[0] = browser;
args[1] = toStringz(url);
args[2] = null;
}
else
{
args[0] = "open".ptr;
args[1] = toStringz(url);
args[2] = null;
}
auto childpid = fork();
if (childpid == 0)
{
core.sys.posix.unistd.execvp(args[0], cast(char**)args.ptr);
perror(args[0]); // failed to execute
return;
}
if (browser)
free(cast(void*)browser);
}
}
else version (Posix)
{
import core.stdc.stdio;
import core.stdc.string;
import core.sys.posix.unistd;
void browse(string url)
{
const(char)*[3] args;
const(char)* browser = core.stdc.stdlib.getenv("BROWSER");
if (browser)
{ browser = strdup(browser);
args[0] = browser;
}
else
//args[0] = "x-www-browser".ptr; // doesn't work on some systems
args[0] = "xdg-open".ptr;
args[1] = toStringz(url);
args[2] = null;
auto childpid = fork();
if (childpid == 0)
{
core.sys.posix.unistd.execvp(args[0], cast(char**)args.ptr);
perror(args[0]); // failed to execute
return;
}
if (browser)
free(cast(void*)browser);
}
}
else
static assert(0, "os not supported");
| D |
# FIXED
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/hal_trng_wrapper.c
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/inc/hw_types.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/stdint.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/_stdint40.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/stdint.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/cdefs.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/_types.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/machine/_types.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/machine/_stdint.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/_stdint.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/stdbool.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/inc/../inc/hw_chip_def.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/inc/hw_sysctl.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/hal_trng_wrapper.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/trng.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_trng.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_memmap.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_ints.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/debug.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/interrupt.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_nvic.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/cpu.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_cpu_scs.h
HAL/Target/CC2650/Drivers/hal_trng_wrapper.obj: C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../driverlib/rom.h
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/hal_trng_wrapper.c:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/inc/hw_types.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/stdint.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/_stdint40.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/stdint.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/cdefs.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/_types.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/machine/_types.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/machine/_stdint.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/sys/_stdint.h:
C:/ti/ccs910/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include/stdbool.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/inc/../inc/hw_chip_def.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/inc/hw_sysctl.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/hal_trng_wrapper.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/hal_types.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/blestack/hal/src/target/_common/../_common/cc26xx/_hal_types.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/trng.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_trng.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_memmap.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_ints.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/debug.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/interrupt.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_nvic.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/cpu.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../inc/hw_cpu_scs.h:
C:/ti2/simplelink_cc2640r2_sdk_3_20_00_21/source/ti/devices/cc26x0r2/driverlib/../driverlib/rom.h:
| D |
import core.memory;
void main()
{
auto collections = GC.profileStats().numCollections;
// loop until we trigger a collection
for (;;)
{
cast(void)GC.malloc(100_000, GC.BlkAttr.NO_SCAN);
if (GC.profileStats().numCollections == collections+1)
break;
}
}
| 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_9_BeT-7884244323.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_9_BeT-7884244323.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
/**
A simple HTTP/1.1 client implementation.
Copyright: © 2012-2014 RejectedSoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig, Jan Krüger
*/
module vibe.http.client;
public import vibe.core.net;
public import vibe.http.common;
public import vibe.inet.url;
import vibe.core.connectionpool;
import vibe.core.core;
import vibe.core.log;
import vibe.data.json;
import vibe.inet.message;
import vibe.inet.url;
import vibe.stream.counting;
import vibe.stream.ssl;
import vibe.stream.operations;
import vibe.stream.zlib;
import vibe.utils.array;
import vibe.utils.memory;
import core.exception : AssertError;
import std.algorithm : splitter;
import std.array;
import std.conv;
import std.encoding : sanitize;
import std.exception;
import std.format;
import std.string;
import std.typecons;
import std.datetime;
/**************************************************************************************************/
/* Public functions */
/**************************************************************************************************/
/**
Performs a HTTP request on the specified URL.
The requester parameter allows to customize the request and to specify the request body for
non-GET requests before it is sent. A response object is then returned or passed to the
responder callback synchronously.
Note that it is highly recommended to use one of the overloads that take a responder callback,
as they can avoid some memory allocations and are safe against accidentially leaving stale
response objects (objects whose response body wasn't fully read). For the returning overloads
of the function it is recommended to put a $(D scope(exit)) right after the call in which
HTTPClientResponse.dropBody is called to avoid this.
*/
HTTPClientResponse requestHTTP(string url, scope void delegate(scope HTTPClientRequest req) requester = null, HTTPClientSettings settings = defaultSettings)
{
return requestHTTP(URL.parse(url), requester, settings);
}
/// ditto
HTTPClientResponse requestHTTP(URL url, scope void delegate(scope HTTPClientRequest req) requester = null, HTTPClientSettings settings = defaultSettings)
{
enforce(url.schema == "http" || url.schema == "https", "URL schema must be http(s).");
enforce(url.host.length > 0, "URL must contain a host name.");
bool ssl;
if (settings.proxyURL.schema !is null)
ssl = settings.proxyURL.schema == "https";
else
ssl = url.schema == "https";
auto cli = connectHTTP(url.host, url.port, ssl, settings);
auto res = cli.request((req){
if (url.localURI.length)
req.requestURL = url.localURI;
if (settings.proxyURL.schema !is null)
{
req.requestURL = url.toString(); // proxy exception to the URL representation
}
req.headers["Host"] = url.host;
if ("authorization" !in req.headers && url.username != "") {
import std.base64;
string pwstr = url.username ~ ":" ~ url.password;
req.headers["Authorization"] = "Basic " ~
cast(string)Base64.encode(cast(ubyte[])pwstr);
}
if( requester ) requester(req);
});
// make sure the connection stays locked if the body still needs to be read
if( res.m_client ) res.lockedConnection = cli;
logTrace("Returning HTTPClientResponse for conn %s", cast(void*)res.lockedConnection.__conn);
return res;
}
/// ditto
void requestHTTP(string url, scope void delegate(scope HTTPClientRequest req) requester, scope void delegate(scope HTTPClientResponse req) responder, HTTPClientSettings settings = defaultSettings)
{
requestHTTP(URL(url), requester, responder, settings);
}
/// ditto
void requestHTTP(URL url, scope void delegate(scope HTTPClientRequest req) requester, scope void delegate(scope HTTPClientResponse req) responder, HTTPClientSettings settings = defaultSettings)
{
enforce(url.schema == "http" || url.schema == "https", "URL schema must be http(s).");
enforce(url.host.length > 0, "URL must contain a host name.");
bool ssl;
if (settings.proxyURL.schema !is null)
ssl = settings.proxyURL.schema == "https";
else
ssl = url.schema == "https";
auto cli = connectHTTP(url.host, url.port, ssl, settings);
cli.request((scope req){
if (url.localURI.length)
req.requestURL = url.localURI;
if (settings.proxyURL.schema !is null)
{
req.requestURL = url.toString(); // proxy exception to the URL representation
}
req.headers["Host"] = url.host;
if ("authorization" !in req.headers && url.username != "") {
import std.base64;
string pwstr = url.username ~ ":" ~ url.password;
req.headers["Authorization"] = "Basic " ~
cast(string)Base64.encode(cast(ubyte[])pwstr);
}
if( requester ) requester(req);
}, responder);
assert(!cli.m_requesting, "HTTP client still requesting after return!?");
assert(!cli.m_responding, "HTTP client still responding after return!?");
}
/** Posts a simple JSON request. Note that the server www.example.org does not
exists, so there will be no meaningful result.
*/
unittest {
import vibe.core.log;
import vibe.http.client;
import vibe.stream.operations;
void test()
{
requestHTTP("http://www.example.org/",
(scope req) {
req.method = HTTPMethod.POST;
//req.writeJsonBody(["name": "My Name"]);
},
(scope res) {
logInfo("Response: %s", res.bodyReader.readAllUTF8());
}
);
}
}
/**
Returns a HTTPClient proxy object that is connected to the specified host.
Internally, a connection pool is used to reuse already existing connections. Note that
usually requestHTTP should be used for making requests instead of manually using a
HTTPClient to do so.
*/
auto connectHTTP(string host, ushort port = 0, bool ssl = false, HTTPClientSettings settings = defaultSettings)
{
static struct ConnInfo { string host; ushort port; bool ssl; string proxyIP; ushort proxyPort; }
static FixedRingBuffer!(Tuple!(ConnInfo, ConnectionPool!HTTPClient), 16) s_connections;
if( port == 0 ) port = ssl ? 443 : 80;
auto ckey = ConnInfo(host, port, ssl, settings?settings.proxyURL.host:null, settings?settings.proxyURL.port:0);
ConnectionPool!HTTPClient pool;
foreach (c; s_connections)
if (c[0].host == host && c[0].port == port && c[0].ssl == ssl && ((c[0].proxyIP == settings.proxyURL.host && c[0].proxyPort == settings.proxyURL.port) || settings is null))
pool = c[1];
if (!pool) {
logDebug("Create HTTP client pool %s:%s %s proxy %s:%d", host, port, ssl, ( settings ) ? settings.proxyURL.host : string.init, ( settings ) ? settings.proxyURL.port : 0);
pool = new ConnectionPool!HTTPClient({
auto ret = new HTTPClient;
ret.connect(host, port, ssl, settings);
return ret;
});
if (s_connections.full) s_connections.popFront();
s_connections.put(tuple(ckey, pool));
}
return pool.lockConnection();
}
/**************************************************************************************************/
/* Public types */
/**************************************************************************************************/
/**
Defines an HTTP/HTTPS proxy request or a connection timeout for an HTTPClient.
*/
class HTTPClientSettings {
URL proxyURL;
Duration defaultKeepAliveTimeout = 10.seconds;
}
///
unittest {
void test() {
HTTPClientSettings settings = new HTTPClientSettings;
settings.proxyURL = URL.parse("http://proxyuser:proxypass@192.168.2.50:3128");
settings.defaultKeepAliveTimeout = 0.seconds; // closes connection immediately after receiving the data.
requestHTTP("http://www.example.org",
(scope req){
req.method = HTTPMethod.GET;
},
(scope res){
logInfo("Headers:");
foreach(key, ref value; res.headers) {
logInfo("%s: %s", key, value);
}
logInfo("Response: %s", res.bodyReader.readAllUTF8());
}, settings);
}
}
/**
Implementation of a HTTP 1.0/1.1 client with keep-alive support.
Note that it is usually recommended to use requestHTTP for making requests as that will use a
pool of HTTPClient instances to keep the number of connection establishments low while not
blocking requests from different tasks.
*/
final class HTTPClient {
enum maxHeaderLineLength = 4096;
private {
HTTPClientSettings m_settings;
string m_server;
ushort m_port;
TCPConnection m_conn;
Stream m_stream;
SSLContext m_ssl;
static __gshared m_userAgent = "vibe.d/"~vibeVersionString~" (HTTPClient, +http://vibed.org/)";
static __gshared void function(SSLContext) ms_sslSetup;
bool m_requesting = false, m_responding = false;
SysTime m_keepAliveLimit;
Duration m_keepAliveTimeout;
}
/** Get the current settings for the HTTP client. **/
@property const(HTTPClientSettings) settings() const {
return m_settings;
}
/**
Sets the default user agent string for new HTTP requests.
*/
static void setUserAgentString(string str) { m_userAgent = str; }
/**
Sets a callback that will be called for every SSL context that is created.
Setting such a callback is useful for adjusting the validation parameters
of the SSL context.
*/
static void setSSLSetupCallback(void function(SSLContext) func) { ms_sslSetup = func; }
/**
Connects to a specific server.
This method may only be called if any previous connection has been closed.
*/
void connect(string server, ushort port = 80, bool ssl = false, HTTPClientSettings settings = defaultSettings)
{
assert(m_conn is null);
assert(port != 0);
disconnect();
m_conn = null;
m_settings = settings;
m_keepAliveTimeout = settings.defaultKeepAliveTimeout;
m_keepAliveLimit = Clock.currTime(UTC()) + m_keepAliveTimeout;
m_server = server;
m_port = port;
if (ssl) {
m_ssl = createSSLContext(SSLContextKind.client);
// this will be changed to trustedCert once a proper root CA store is available by default
m_ssl.peerValidationMode = SSLPeerValidationMode.none;
if (ms_sslSetup) ms_sslSetup(m_ssl);
}
}
/**
Forcefully closes the TCP connection.
Before calling this method, be sure that no request is currently being processed.
*/
void disconnect()
{
if (m_conn) {
if (m_conn.connected) {
try m_stream.finalize();
catch (Exception e) logDebug("Failed to finalize connection stream when closing HTTP client connection: %s", e.msg);
m_conn.close();
}
if (m_stream !is m_conn) {
destroy(m_stream);
m_stream = null;
}
destroy(m_conn);
m_conn = null;
}
}
private void doProxyRequest(T, U)(T* res, U requester, ref bool close_conn, ref bool has_body)
{
version (VibeManualMemoryManagement) {
scope request_allocator = new PoolAllocator(1024, defaultAllocator());
scope(exit) request_allocator.reset();
} else auto request_allocator = defaultAllocator();
import std.conv : to;
res.dropBody();
scope(failure)
res.disconnect();
if (res.statusCode != 407) {
throw new HTTPStatusException(HTTPStatus.internalServerError, "Proxy returned Proxy-Authenticate without a 407 status code.");
}
// send the request again with the proxy authentication information if available
if (m_settings.proxyURL.username is null) {
throw new HTTPStatusException(HTTPStatus.proxyAuthenticationRequired, "Proxy Authentication Required.");
}
m_responding = false;
close_conn = false;
bool found_proxy_auth;
foreach (string proxyAuth; res.headers.getAll("Proxy-Authenticate"))
{
if (proxyAuth.length >= "Basic".length && proxyAuth[0.."Basic".length] == "Basic")
{
found_proxy_auth = true;
break;
}
}
if (!found_proxy_auth)
{
throw new HTTPStatusException(HTTPStatus.notAcceptable, "The Proxy Server didn't allow Basic Authentication");
}
SysTime connected_time = Clock.currTime(UTC());
has_body = doRequest(requester, &close_conn, true, connected_time);
m_responding = true;
static if (is (T == HTTPClientResponse*))
*res = new HTTPClientResponse(this, has_body, close_conn, request_allocator, connected_time);
else
*res = scoped!HTTPClientResponse(this, has_body, close_conn, request_allocator, connected_time);
if (res.headers.get("Proxy-Authenticate", null) !is null){
res.dropBody();
throw new HTTPStatusException(HTTPStatus.ProxyAuthenticationRequired, "Proxy Authentication Failed.");
}
}
/**
Performs a HTTP request.
requester is called first to populate the request with headers and the desired
HTTP method and version. After a response has been received it is then passed
to the caller which can in turn read the reponse body. Any part of the body
that has not been processed will automatically be consumed and dropped.
Note that the second form of this method (returning a HTTPClientResponse) is
not recommended to use as it may accidentially block a HTTP connection when
only part of the response body was read and also requires a heap allocation
for the response object. The callback based version on the other hand uses
a stack allocation and guarantees that the request has been fully processed
once it has returned.
*/
void request(scope void delegate(scope HTTPClientRequest req) requester, scope void delegate(scope HTTPClientResponse) responder)
{
version (VibeManualMemoryManagement) {
scope request_allocator = new PoolAllocator(1024, defaultAllocator());
scope(exit) request_allocator.reset();
} else auto request_allocator = defaultAllocator();
SysTime connected_time = Clock.currTime(UTC());
bool close_conn = false;
bool has_body = doRequest(requester, &close_conn, false, connected_time);
m_responding = true;
auto res = scoped!HTTPClientResponse(this, has_body, close_conn, request_allocator, connected_time);
// proxy implementation
if (res.headers.get("Proxy-Authenticate", null) !is null) {
doProxyRequest(&res, requester, close_conn, has_body);
}
Exception user_exception;
{
scope (failure) {
m_responding = false;
disconnect();
}
try responder(res);
catch (Exception e) {
logDebug("Error while handling response: %s", e.toString().sanitize());
user_exception = e;
}
if (user_exception || m_responding) {
logDebug("Failed to handle the complete response of the server - disconnecting.");
res.disconnect();
}
assert(!m_responding, "Still in responding state after finalizing the response!?");
if (user_exception || res.headers.get("Connection") == "close")
disconnect();
}
if (user_exception) throw user_exception;
}
/// ditto
HTTPClientResponse request(scope void delegate(HTTPClientRequest) requester)
{
bool close_conn = false;
auto connected_time = Clock.currTime(UTC());
bool has_body = doRequest(requester, &close_conn, false, connected_time);
m_responding = true;
auto res = new HTTPClientResponse(this, has_body, close_conn, defaultAllocator(), connected_time);
// proxy implementation
if (res.headers.get("Proxy-Authenticate", null) !is null) {
doProxyRequest(&res, requester, close_conn, has_body);
}
return res;
}
private bool doRequest(scope void delegate(HTTPClientRequest req) requester, bool* close_conn, bool confirmed_proxy_auth = false /* basic only */, SysTime connected_time = Clock.currTime(UTC()))
{
assert(!m_requesting, "Interleaved HTTP client requests detected!");
assert(!m_responding, "Interleaved HTTP client request/response detected!");
m_requesting = true;
scope(exit) m_requesting = false;
if (m_conn && m_conn.connected && connected_time > m_keepAliveLimit){
logDebug("Disconnected to avoid timeout");
disconnect();
}
if (!m_conn || !m_conn.connected) {
if (m_conn) m_conn.close(); // make sure all resources are freed
if (m_settings.proxyURL.host !is null){
enum AddressType {
IPv4,
IPv6,
Host
}
static AddressType getAddressType(string host){
import std.regex : regex, Captures, Regex, matchFirst;
__gshared auto IPv4Regex = regex(`^\s*((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\s*$`, ``);
__gshared auto IPv6Regex = regex(`^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$`, ``);
if (!matchFirst(host, IPv4Regex).empty)
{
return AddressType.IPv4;
}
else if (!matchFirst(host, IPv6Regex).empty)
{
return AddressType.IPv6;
}
else
{
return AddressType.Host;
}
}
import std.functional : memoize;
alias memoize!getAddressType findAddressType;
bool use_dns;
if (findAddressType(m_settings.proxyURL.host) == AddressType.Host)
{
use_dns = true;
}
NetworkAddress proxyAddr = resolveHost(m_settings.proxyURL.host, 0, use_dns);
proxyAddr.port = m_settings.proxyURL.port;
m_conn = connectTCP(proxyAddr);
}
else
m_conn = connectTCP(m_server, m_port);
m_stream = m_conn;
if (m_ssl) m_stream = createSSLStream(m_conn, m_ssl, SSLStreamState.connecting, m_server, m_conn.remoteAddress);
}
auto req = scoped!HTTPClientRequest(m_stream, m_conn.localAddress);
req.headers["User-Agent"] = m_userAgent;
if (m_settings.proxyURL.host !is null){
req.headers["Proxy-Connection"] = "keep-alive";
*close_conn = false; // req.headers.get("Proxy-Connection", "keep-alive") != "keep-alive";
if (confirmed_proxy_auth)
{
import std.base64;
ubyte[] user_pass = cast(ubyte[])(m_settings.proxyURL.username ~ ":" ~ m_settings.proxyURL.password);
req.headers["Proxy-Authorization"] = "Basic " ~ cast(string) Base64.encode(user_pass);
}
}
else {
req.headers["Connection"] = "keep-alive";
*close_conn = false; // req.headers.get("Connection", "keep-alive") != "keep-alive";
}
req.headers["Accept-Encoding"] = "gzip, deflate";
req.headers["Host"] = m_server;
requester(req);
req.finalize();
return req.method != HTTPMethod.HEAD;
}
}
/**
Represents a HTTP client request (as sent to the server).
*/
final class HTTPClientRequest : HTTPRequest {
private {
OutputStream m_bodyWriter;
bool m_headerWritten = false;
FixedAppender!(string, 22) m_contentLengthBuffer;
NetworkAddress m_localAddress;
}
/// private
this(Stream conn, NetworkAddress local_addr)
{
super(conn);
m_localAddress = local_addr;
}
@property NetworkAddress localAddress() const { return m_localAddress; }
/**
Accesses the Content-Length header of the request.
Negative values correspond to an unset Content-Length header.
*/
@property long contentLength() const { return headers.get("Content-Length", "-1").to!long(); }
/// ditto
@property void contentLength(long value)
{
if (value >= 0) headers["Content-Length"] = clengthString(value);
else if ("Content-Length" in headers) headers.remove("Content-Length");
}
/**
Writes the whole response body at once using raw bytes.
*/
void writeBody(RandomAccessStream data)
{
writeBody(data, data.size - data.tell());
}
/// ditto
void writeBody(InputStream data)
{
headers["Transfer-Encoding"] = "chunked";
bodyWriter.write(data);
finalize();
}
/// ditto
void writeBody(InputStream data, ulong length)
{
headers["Content-Length"] = clengthString(length);
bodyWriter.write(data, length);
finalize();
}
/// ditto
void writeBody(ubyte[] data, string content_type = null)
{
if( content_type ) headers["Content-Type"] = content_type;
headers["Content-Length"] = clengthString(data.length);
bodyWriter.write(data);
finalize();
}
/**
Writes the response body as JSON data.
*/
void writeJsonBody(T)(T data)
{
import vibe.stream.wrapper;
headers["Transfer-Encoding"] = "chunked";
headers["Content-Type"] = "application/json";
auto rng = StreamOutputRange(bodyWriter);
serializeToJson(&rng, data);
}
void writePart(MultiPart part)
{
assert(false, "TODO");
}
/**
An output stream suitable for writing the request body.
The first retrieval will cause the request header to be written, make sure
that all headers are set up in advance.s
*/
@property OutputStream bodyWriter()
{
if( m_bodyWriter ) return m_bodyWriter;
assert(!m_headerWritten, "Trying to write request body after body was already written.");
writeHeader();
m_bodyWriter = m_conn;
if( headers.get("Transfer-Encoding", null) == "chunked" )
m_bodyWriter = new ChunkedOutputStream(m_bodyWriter);
return m_bodyWriter;
}
private void writeHeader()
{
import vibe.stream.wrapper;
assert(!m_headerWritten, "HTTPClient tried to write headers twice.");
m_headerWritten = true;
auto output = StreamOutputRange(m_conn);
formattedWrite(&output, "%s %s %s\r\n", httpMethodString(method), requestURL, getHTTPVersionString(httpVersion));
logTrace("--------------------");
logTrace("HTTP client request:");
logTrace("--------------------");
logTrace("%s", this);
foreach( k, v; headers ){
formattedWrite(&output, "%s: %s\r\n", k, v);
logTrace("%s: %s", k, v);
}
output.put("\r\n");
logTrace("--------------------");
}
private void finalize()
{
// test if already finalized
if( m_headerWritten && !m_bodyWriter )
return;
// force the request to be sent
if( !m_headerWritten ) bodyWriter();
m_bodyWriter.flush();
if (m_bodyWriter !is m_conn) {
m_bodyWriter.finalize();
m_conn.flush();
}
m_bodyWriter = null;
}
private string clengthString(ulong len)
{
m_contentLengthBuffer.clear();
formattedWrite(&m_contentLengthBuffer, "%s", len);
return m_contentLengthBuffer.data;
}
}
/**
Represents a HTTP client response (as received from the server).
*/
final class HTTPClientResponse : HTTPResponse {
private {
HTTPClient m_client;
LockedConnection!HTTPClient lockedConnection;
FreeListRef!LimitedInputStream m_limitedInputStream;
FreeListRef!ChunkedInputStream m_chunkedInputStream;
FreeListRef!GzipInputStream m_gzipInputStream;
FreeListRef!DeflateInputStream m_deflateInputStream;
FreeListRef!EndCallbackInputStream m_endCallback;
InputStream m_bodyReader;
bool m_closeConn;
int m_maxRequests;
}
/// Contains the keep-alive 'max' parameter, indicates how many requests a client can
/// make before the server closes the connection.
@property int maxRequests() const {
return m_maxRequests;
}
/// private
this(HTTPClient client, bool has_body, bool close_conn, Allocator alloc = defaultAllocator(), SysTime connected_time = Clock.currTime(UTC()))
{
m_client = client;
m_closeConn = close_conn;
scope(failure) finalize(true);
// read and parse status line ("HTTP/#.# #[ $]\r\n")
logTrace("HTTP client reading status line");
string stln = cast(string)client.m_stream.readLine(HTTPClient.maxHeaderLineLength, "\r\n", alloc);
logTrace("stln: %s", stln);
this.httpVersion = parseHTTPVersion(stln);
enforce(stln.startsWith(" "));
stln = stln[1 .. $];
this.statusCode = parse!int(stln);
if( stln.length > 0 ){
enforce(stln.startsWith(" "));
stln = stln[1 .. $];
this.statusPhrase = stln;
}
// read headers until an empty line is hit
parseRFC5322Header(client.m_stream, this.headers, HTTPClient.maxHeaderLineLength, alloc, false);
logTrace("---------------------");
logTrace("HTTP client response:");
logTrace("---------------------");
logTrace("%s", this);
foreach (k, v; this.headers)
logTrace("%s: %s", k, v);
logTrace("---------------------");
Duration server_timeout;
bool has_server_timeout;
if (auto pka = "Keep-Alive" in this.headers) {
foreach(s; splitter(*pka, ',')){
auto pair = s.splitter('=');
auto name = pair.front.strip();
pair.popFront();
if (icmp(name, "timeout") == 0) {
has_server_timeout = true;
server_timeout = pair.front.to!int().seconds;
} else if (icmp(name, "max") == 0) {
m_maxRequests = pair.front.to!int();
}
}
}
Duration elapsed = Clock.currTime(UTC()) - connected_time;
if (this.headers.get("Connection") == "close") {
// this header will trigger m_client.disconnect() in m_client.doRequest() when it goes out of scope
} else if (has_server_timeout && m_client.m_keepAliveTimeout > server_timeout) {
m_client.m_keepAliveLimit = Clock.currTime(UTC()) + server_timeout - elapsed;
} else if (this.httpVersion == HTTPVersion.HTTP_1_1) {
m_client.m_keepAliveLimit = Clock.currTime(UTC()) + m_client.m_keepAliveTimeout;
}
if (!has_body) finalize();
}
~this()
{
debug if (m_client) assert(false);
}
/**
An input stream suitable for reading the response body.
*/
@property InputStream bodyReader()
{
if( m_bodyReader ) return m_bodyReader;
assert (m_client, "Response was already read or no response body, may not use bodyReader.");
// prepare body the reader
if( auto pte = "Transfer-Encoding" in this.headers ){
enforce(*pte == "chunked");
m_chunkedInputStream = FreeListRef!ChunkedInputStream(m_client.m_stream);
m_bodyReader = this.m_chunkedInputStream;
} else if( auto pcl = "Content-Length" in this.headers ){
m_limitedInputStream = FreeListRef!LimitedInputStream(m_client.m_stream, to!ulong(*pcl));
m_bodyReader = m_limitedInputStream;
} else {
m_limitedInputStream = FreeListRef!LimitedInputStream(m_client.m_stream, 0);
m_bodyReader = m_limitedInputStream;
}
if( auto pce = "Content-Encoding" in this.headers ){
if( *pce == "deflate" ){
m_deflateInputStream = FreeListRef!DeflateInputStream(m_bodyReader);
m_bodyReader = m_deflateInputStream;
} else if( *pce == "gzip" ){
m_gzipInputStream = FreeListRef!GzipInputStream(m_bodyReader);
m_bodyReader = m_gzipInputStream;
}
else enforce(*pce == "identity", "Unsuported content encoding: "~*pce);
}
// be sure to free resouces as soon as the response has been read
m_endCallback = FreeListRef!EndCallbackInputStream(m_bodyReader, &this.finalize);
m_bodyReader = m_endCallback;
return m_bodyReader;
}
/**
Provides unsafe means to read raw data from the connection.
No transfer decoding and no content decoding is done on the data.
Not that the provided delegate must read the whole stream,
as the state of the response is unknown after raw bytes have been
taken. Failure to read the right amount of data will lead to
protocol corruption in later requests.
*/
void readRawBody(scope void delegate(scope InputStream stream) del)
{
assert(!m_bodyReader, "May not mix use of readRawBody and bodyReader.");
del(m_client.m_stream);
finalize();
}
/**
Reads the whole response body and tries to parse it as JSON.
*/
Json readJson(){
auto bdy = bodyReader.readAllUTF8();
return parseJson(bdy);
}
/**
Reads and discards the response body.
*/
void dropBody()
{
if( m_client ){
if( bodyReader.empty ){
finalize();
} else {
s_sink.write(bodyReader);
assert(!lockedConnection.__conn);
}
}
}
/**
Forcefully terminates the connection regardless of the current state.
Note that this will only actually disconnect if the request has not yet
been fully processed. If the whole body was already read, the
connection is not owned by the current request operation anymore and
cannot be accessed. Use a "Connection: close" header instead in this
case to let the server close the connection.
*/
void disconnect()
{
finalize(true);
}
private void finalize()
{
finalize(m_closeConn);
}
private void finalize(bool disconnect)
{
// ignore duplicate and too early calls to finalize
// (too early happesn for empty response bodies)
if (!m_client) return;
auto cli = m_client;
m_client = null;
cli.m_responding = false;
destroy(m_deflateInputStream);
destroy(m_gzipInputStream);
destroy(m_chunkedInputStream);
destroy(m_limitedInputStream);
if (disconnect) cli.disconnect();
destroy(lockedConnection);
}
}
private __gshared NullOutputStream s_sink;
// This object is a placeholder and should to never be modified.
private __gshared HTTPClientSettings defaultSettings = new HTTPClientSettings;
shared static this()
{
s_sink = new NullOutputStream;
}
| D |
module lexer.location_offset;
import dmd.lexer : Lexer;
import dmd.tokens : TOK;
import dmd.errorsink;
import support : afterEach;
@afterEach deinitializeFrontend()
{
import dmd.frontend : deinitializeDMD;
deinitializeDMD();
}
@("first token in the source code")
unittest
{
enum code = "token";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 0, code);
}
@("first token when begoffset is not 0")
unittest
{
enum code = "ignored_token token";
scope lexer = new Lexer("test.d", code.ptr, 13, code.length - 14, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 14, code);
}
@("last token in the source code")
unittest
{
enum code = "token1 token2 3";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 14, code);
}
@("end of code")
unittest
{
enum code = "token";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 5, code);
}
@("block comment")
unittest
{
enum code = "/* comment */";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, true, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.value == TOK.comment, code);
assert(lexer.token.loc.fileOffset == 2, code);
}
@("line comment")
unittest
{
enum code = "// comment";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, true, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.value == TOK.comment, code);
assert(lexer.token.loc.fileOffset == 1, code);
}
@("nesting block comment")
unittest
{
enum code = "/+ comment +/";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, true, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.value == TOK.comment, code);
assert(lexer.token.loc.fileOffset == 1, code);
}
@("identifier after block comment")
unittest
{
enum code = "/* comment */ token";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 14, code);
}
@("identifier after line comment")
unittest
{
enum code = "// comment\ntoken";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 11, code);
}
@("identifier after nesting block comment")
unittest
{
enum code = "/+ comment +/ token";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 14, code);
}
@("token after Unix line ending")
unittest
{
enum code = "line\ntoken";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 5, code);
}
@("token after Windows line ending")
unittest
{
enum code = "line\r\ntoken";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 6, code);
}
@("token after Mac line ending")
unittest
{
enum code = "line\rtoken";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 5, code);
}
@("multibyte character token")
unittest
{
enum code = "'🍺'";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 0, code);
}
@("multibyte character string token")
unittest
{
enum code = `"🍺🍺"`;
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 0, code);
}
@("token after multibyte character token")
unittest
{
enum code = "'🍺' token";
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 7, code);
}
@("token after multibyte character string token")
unittest
{
enum code = `"🍺🍺" token`;
scope lexer = new Lexer("test.d", code.ptr, 0, code.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.loc.fileOffset == 11, code);
}
immutable struct Test
{
/*
* The description of the unit test.
*
* This will go into the UDA attached to the `unittest` block.
*/
string description_;
/*
* The code to lex.
*
* Optional. If the code is not provided the description will be used.
* Useful when the description and the code is exactly the same, i.e. for
* keywords.
*/
string code_ = null;
string code()
{
return code_ ? code_ : description_;
}
string description()
{
return description_;
}
}
enum Test[string] tests = [
"leftParenthesis" : Test("left parenthesis", "("),
"rightParenthesis" : Test("right parenthesis", ")"),
"leftBracket" : Test("left square bracket", "["),
"rightBracket" : Test("right square bracket", "]"),
"leftCurly" : Test("left curly brace", "{"),
"rightCurly" : Test("right curly brace", "}"),
"colon" : Test("colon", ":"),
"semicolon" : Test("semicolon", ";"),
"dotDotDot" : Test("triple dot", "..."),
"endOfFile" : Test("end of file", "\u001A"),
"cast_" : Test("cast"),
"null_" : Test("null"),
"assert_" : Test("assert"),
"true_" : Test("true"),
"false_" : Test("false"),
"throw_" : Test("throw"),
"new_" : Test("new"),
"delete_" : Test("delete"),
"slice" : Test("slice", ".."),
"version_" : Test("version"),
"module_" : Test("module"),
"dollar" : Test("dollar", "$"),
"template_" : Test("template"),
"typeof_" : Test("typeof"),
"pragma_" : Test("pragma"),
"typeid_" : Test("typeid"),
"lessThan" : Test("less than", "<"),
"greaterThan" : Test("greater then", ">"),
"lessOrEqual" : Test("less then or equal", "<="),
"greaterOrEqual" : Test("greater then or equal", ">="),
"equal" : Test("equal", "=="),
"notEqual" : Test("not equal", "!="),
"is_" : Test("is"),
"leftShift" : Test("left shift", "<<"),
"rightShift" : Test("right shift", ">>"),
"leftShiftAssign" : Test("left shift assign", "<<="),
"rightShiftAssign" : Test("right shift assign", ">>="),
"unsignedRightShift" : Test("unsigned right shift", ">>>"),
"unsignedRightShiftAssign" : Test("unsigned right shift assign", ">>>="),
"concatenateAssign" : Test("concatenate assign", "~="),
"add" : Test("plus", "+"),
"min" : Test("minus", "-"),
"addAssign" : Test("plus assign", "+="),
"minAssign" : Test("minus assign", "-="),
"mul" : Test("multiply", "*"),
"div" : Test("divide", "/"),
"mod" : Test("modulo", "%"),
"mulAssign" : Test("multiply assign", "*="),
"divAssign" : Test("divide assign", "/="),
"modAssign" : Test("modulo assign", "%="),
"and" : Test("and", "&"),
"or" : Test("or", "|"),
"xor" : Test("xor", "^"),
"andAssign" : Test("and assign", "&="),
"orAssign" : Test("or assign", "|="),
"xorAssign" : Test("xor assign", "^="),
"assign" : Test("assign", "="),
"not" : Test("not", "!"),
"tilde" : Test("tilde", "~"),
"plusPlus" : Test("plus plus", "++"),
"minusMinus" : Test("minus minus", "--"),
"dot" : Test("dot", "."),
"comma" : Test("comma", ","),
"question" : Test("question mark", "?"),
"andAnd" : Test("and and", "&&"),
"orOr" : Test("or or", "||"),
"int32Literal" : Test("32 bit integer literal", "0"),
"uns32Literal" : Test("32 bit unsigned integer literal", "0U"),
"int64Literal" : Test("64 bit integer literal", "0L"),
"uns64Literal" : Test("64 bit unsigned integer literal", "0UL"),
"float32Literal" : Test("32 bit floating point literal", "0.0f"),
"float64Literal" : Test("64 bit floating point literal", "0.0"),
"float80Literal" : Test("80 bit floating point literal", "0.0L"),
"imaginary32Literal" : Test("32 bit imaginary floating point literal", "0.0fi"),
"imaginary64Literal" : Test("64 bit imaginary floating point literal", "0.0i"),
"imaginary80Literal" : Test("80 bit imaginary floating point literal", "0.0Li"),
"charLiteral" : Test("character literal", "'a'"),
"wcharLiteral" : Test("wide character literal", "'ö'"),
"dcharLiteral" : Test("double wide character literal", "'🍺'"),
"identifier" : Test("identifier", "foo"),
"string_" : Test("string literal", `"foo"`),
"this_" : Test("this"),
"super_" : Test("super"),
"void_" : Test("void"),
"int8" : Test("byte"),
"uns8" : Test("ubyte"),
"int16" : Test("short"),
"uns16" : Test("ushort"),
"int32" : Test("int"),
"uns32" : Test("uint"),
"int64" : Test("long"),
"uns64" : Test("ulong"),
"float32" : Test("float"),
"float64" : Test("double"),
"float80" : Test("real"),
"imaginary32" : Test("ifloat"),
"imaginary64" : Test("idouble"),
"imaginary80" : Test("ireal"),
"complex32" : Test("cfloat"),
"complex64" : Test("cdouble"),
"complex80" : Test("creal"),
"char_" : Test("char"),
"wchar_" : Test("wchar"),
"dchar_" : Test("dchar"),
"bool_" : Test("bool"),
"struct_" : Test("struct"),
"class_" : Test("class"),
"interface_" : Test("interface"),
"union_" : Test("union"),
"enum_" : Test("enum"),
"import_" : Test("import"),
"alias_" : Test("alias"),
"override_" : Test("override"),
"delegate_" : Test("delegate"),
"function_" : Test("function"),
"mixin_" : Test("mixin"),
"align_" : Test("align"),
"extern_" : Test("extern"),
"private_" : Test("private"),
"protected_" : Test("protected"),
"public_" : Test("public"),
"export_" : Test("export"),
"static_" : Test("static"),
"final_" : Test("final"),
"const_" : Test("const"),
"abstract_" : Test("abstract"),
"debug_" : Test("debug"),
"deprecated_" : Test("deprecated"),
"in_" : Test("in"),
"out_" : Test("out"),
"inout_" : Test("inout"),
"lazy_" : Test("lazy"),
"auto_" : Test("auto"),
"package_" : Test("package"),
"immutable_" : Test("immutable"),
"if_" : Test("if"),
"else_" : Test("else"),
"while_" : Test("while"),
"for_" : Test("for"),
"do_" : Test("do"),
"switch_" : Test("switch"),
"case_" : Test("case"),
"default_" : Test("default"),
"break_" : Test("break"),
"continue_" : Test("continue"),
"with_" : Test("with"),
"synchronized_" : Test("synchronized"),
"return_" : Test("return"),
"goto_" : Test("goto"),
"try_" : Test("try"),
"catch_" : Test("catch"),
"finally_" : Test("finally"),
"asm_" : Test("asm"),
"foreach_" : Test("foreach"),
"foreach_reverse_" : Test("foreach_reverse"),
"scope_" : Test("scope"),
"invariant_" : Test("invariant"),
"unittest_" : Test("unittest"),
"argumentTypes" : Test("__argTypes"),
"ref_" : Test("ref"),
"macro_" : Test("macro"),
"parameters" : Test("__parameters"),
"traits" : Test("__traits"),
"overloadSet" : Test("__overloadset"),
"pure_" : Test("pure"),
"nothrow_" : Test("nothrow"),
"gshared" : Test("__gshared"),
"line" : Test("__LINE__"),
"file" : Test("__FILE__"),
"fileFullPath" : Test("__FILE_FULL_PATH__"),
"moduleString" : Test("__MODULE__"),
"functionString" : Test("__FUNCTION__"),
"prettyFunction" : Test("__PRETTY_FUNCTION__"),
"shared_" : Test("shared"),
"at" : Test("at sign", "@"),
"pow" : Test("power", "^^"),
"powAssign" : Test("power assign", "^^="),
"goesTo" : Test("fat arrow", "=>"),
"vector" : Test("__vector"),
"pound" : Test("pound", "#"),
"arrow" : Test("arrow", "->"),
"colonColon" : Test("colonColon", "::"),
];
// Ignore tokens not produced by the lexer or tested above
enum ignoreTokens
{
reserved,
negate,
array,
call,
address,
star,
type,
dotVariable,
dotIdentifier,
dotTemplateInstance,
dotType,
symbolOffset,
variable,
arrayLength,
dotTemplateDeclaration,
declaration,
dSymbol,
uadd,
remove,
newAnonymousClass,
comment,
arrayLiteral,
assocArrayLiteral,
structLiteral,
compoundLiteral,
classReference,
thrownException,
delegatePointer,
delegateFunctionPointer,
identity,
notIdentity,
index,
concatenate,
concatenateElemAssign,
concatenateDcharAssign,
construct,
blit,
arrow,
prePlusPlus,
preMinusMinus,
int128Literal,
uns128Literal,
halt,
tuple,
error,
int128,
uns128,
onScopeExit,
onScopeFailure,
onScopeSuccess,
interval,
voidExpression,
cantExpression,
showCtfeContext,
objcClassReference,
vectorArray,
wchar_tLiteral,
endOfLine,
whitespace,
inline,
register,
restrict,
signed,
sizeof_,
typedef_,
unsigned,
volatile,
_Alignas,
_Alignof,
_Atomic,
_Bool,
_Complex,
_Generic,
_Imaginary,
_Noreturn,
_Static_assert,
_Thread_local,
_assert,
_import,
__cdecl,
__declspec,
__stdcall,
__thread,
__pragma,
__int128,
__attribute__,
max_,
};
static foreach (tok; __traits(allMembers, TOK))
{
static if (!__traits(hasMember, ignoreTokens, tok))
{
@(tests[tok].description)
unittest
{
const newCode = "first_token " ~ tests[tok].code ~ '\0';
scope lexer = new Lexer("test.d", newCode.ptr, 0, newCode.length, 0, 0, new ErrorSinkStderr, null);
lexer.nextToken;
lexer.nextToken;
assert(lexer.token.value == __traits(getMember, TOK, tok), newCode);
assert(lexer.token.loc.fileOffset == 12, newCode);
}
}
}
| D |
module it.cpp.templates;
import it;
@("simple")
@safe unittest {
shouldCompile(
Cpp(
q{
template<typename T>
struct vector {
public:
T value;
void push_back();
};
template<typename U, int length>
struct array {
public:
U elements[length];
};
}
),
D(
q{
auto vi = vector!int(42);
static assert(is(typeof(vi.value) == int));
vi.value = 33;
auto vf = vector!float(33.3);
static assert(is(typeof(vf.value) == float));
vf.value = 22.2;
auto vs = vector!string("foo");
static assert(is(typeof(vs.value) == string));
vs.value = "bar";
auto ai = array!(int, 3)();
static assert(ai.elements.length == 3);
static assert(is(typeof(ai.elements[0]) == int));
}
),
);
}
@("template nameless type")
@safe unittest {
shouldCompile(
Cpp(
q{
// none of the template parameters have names, which is allowed
// in C++ but not in D
template<bool, bool, typename>
struct Foo {
};
}
),
D(
q{
auto f = Foo!(true, false, int)();
}
),
);
}
@("struct full specialisation")
@safe unittest {
shouldCompile(
Cpp(
q{
// this is a ClassTemplate
template<bool, bool, typename>
struct __copy_move {
enum { value = 42 };
};
// This is a StructDecl
template<>
struct __copy_move<false, true, double> {
enum { value = 33 };
};
}
),
D(
q{
import std.conv: text;
// FIXME: libclang bug - templates don't have proper
// EnumConstantDecl values for some reason
// auto c1 = __copy_move!(true, true, int)();
// static assert(c1.value == 42, text(cast(int) c1.value));
auto c2 = __copy_move!(false, true, double)();
static assert(c2.value == 33, text(cast(int) c2.value));
}
),
);
}
// struct/class keyword could end up in different code paths
@("class full specialisation")
@safe unittest {
shouldCompile(
Cpp(
q{
// this is a ClassTemplate
template<bool, bool, typename>
class __copy_move {
public:
enum { value = 42 };
};
// This is a ClassDecl
template<>
class __copy_move<false, true, double> {
public:
enum { value = 33 };
};
}
),
D(
q{
import std.conv: text;
// FIXME: libclang bug - templates don't have proper
// EnumConstantDecl values for some reason
// auto c1 = __copy_move!(true, true, int)();
// static assert(c1.value == 42, text(cast(int) c1.value));
auto c2 = __copy_move!(false, true, double)();
static assert(c2.value == 33, text(cast(int) c2.value));
}
),
);
}
@("struct partial specialisation")
@safe unittest {
shouldCompile(
Cpp(
q{
// just structs to use as template type parameters
struct Foo; struct Bar; struct Baz; struct Quux;
// this is a ClassTemplate
template<typename, typename, bool, typename, int, typename>
struct Template { using Type = bool; };
// this is a ClassTemplatePartialSpecialization
template<typename T, bool V0, typename T3, typename T4>
struct Template<Quux, T, V0, T3, 42, T4> { using Type = short; };
// this is a ClassTemplatePartialSpecialization
template<typename T, bool V0, typename T3, typename T4>
struct Template<T, Quux, V0, T3, 42, T4> { using Type = double; };
}
),
D(
q{
import std.conv: text;
auto t1 = Template!(Foo, Bar, false, Baz, 0, Quux)(); // full template
auto t2 = Template!(Quux, Bar, false, Baz, 42, Quux)(); // partial1
auto t3 = Template!(Foo, Quux, false, Baz, 42, Quux)(); // partial2
static assert(is(t1.Type == bool), t2.Type.stringof);
static assert(is(t2.Type == short), t2.Type.stringof);
static assert(is(t3.Type == double), t3.Type.stringof);
}
),
);
}
// as seen in stl_algobase.h
@("__copy_move")
@safe unittest {
shouldCompile(
Cpp(
q{
struct random_access_iterator_tag;
template<bool, bool, typename>
struct __copy_move {};
template<typename _Category>
struct __copy_move<true, false, _Category> {};
template<>
struct __copy_move<false, false, random_access_iterator_tag> {};
template<>
struct __copy_move<true, false, random_access_iterator_tag> {};
template<bool _IsMove>
struct __copy_move<_IsMove, true, random_access_iterator_tag> {};
}
),
D(
q{
struct RandomStruct {}
auto c1 = __copy_move!(false, true, int)();
auto c2 = __copy_move!(true, false, RandomStruct)();
auto c3 = __copy_move!(false, false, random_access_iterator_tag)();
auto c4 = __copy_move!(true, false, random_access_iterator_tag)();
auto c5 = __copy_move!(false, true, random_access_iterator_tag)();
auto c6 = __copy_move!(true, true, random_access_iterator_tag)();
}
),
);
}
| D |
module engine.thirdparty.mruby.variable;
import engine.thirdparty.mruby;
import engine.thirdparty.mruby.value;
import engine.thirdparty.mruby.object;
import engine.thirdparty.mruby.mrb_class;
extern (C):
struct global_variable
{
int counter;
mrb_value* data;
mrb_value function () getter;
void function () setter;
}
struct global_entry
{
global_variable* var;
mrb_sym id;
}
static const int MRB_SEGMENT_SIZE = 4;
struct segment {
mrb_sym[MRB_SEGMENT_SIZE] key;
mrb_value[MRB_SEGMENT_SIZE] val;
segment *next;
}
struct iv_tbl
{
segment* rootseg;
size_t size;
size_t last_len;
}
extern @nogc:
mrb_value mrb_vm_special_get (mrb_state*, mrb_sym);
void mrb_vm_special_set (mrb_state*, mrb_sym, mrb_value);
mrb_value mrb_vm_iv_get (mrb_state*, mrb_sym);
void mrb_vm_iv_set (mrb_state*, mrb_sym, mrb_value);
mrb_value mrb_vm_cv_get (mrb_state*, mrb_sym);
void mrb_vm_cv_set (mrb_state*, mrb_sym, mrb_value);
mrb_value mrb_vm_const_get (mrb_state*, mrb_sym);
void mrb_vm_const_set (mrb_state*, mrb_sym, mrb_value);
mrb_value mrb_const_get (mrb_state*, mrb_value, mrb_sym);
void mrb_const_set (mrb_state*, mrb_value, mrb_sym, mrb_value);
mrb_bool mrb_const_defined (mrb_state*, mrb_value, mrb_sym);
void mrb_const_remove (mrb_state*, mrb_value, mrb_sym);
mrb_bool mrb_iv_p (mrb_state* mrb, mrb_sym sym);
void mrb_iv_check (mrb_state* mrb, mrb_sym sym);
mrb_value mrb_obj_iv_get (mrb_state* mrb, RObject* obj, mrb_sym sym);
void mrb_obj_iv_set (mrb_state* mrb, RObject* obj, mrb_sym sym, mrb_value v);
mrb_bool mrb_obj_iv_defined (mrb_state* mrb, RObject* obj, mrb_sym sym);
void mrb_obj_iv_ifnone (mrb_state* mrb, RObject* obj, mrb_sym sym, mrb_value v);
mrb_value mrb_iv_get (mrb_state* mrb, mrb_value obj, mrb_sym sym);
void mrb_iv_set (mrb_state* mrb, mrb_value obj, mrb_sym sym, mrb_value v);
mrb_bool mrb_iv_defined (mrb_state*, mrb_value, mrb_sym);
mrb_value mrb_iv_remove (mrb_state* mrb, mrb_value obj, mrb_sym sym);
void mrb_iv_copy (mrb_state* mrb, mrb_value dst, mrb_value src);
mrb_bool mrb_const_defined_at (mrb_state* mrb, mrb_value mod, mrb_sym id);
mrb_value mrb_gv_get (mrb_state* mrb, mrb_sym sym);
void mrb_gv_set (mrb_state* mrb, mrb_sym sym, mrb_value val);
void mrb_gv_remove (mrb_state* mrb, mrb_sym sym);
mrb_value mrb_cv_get (mrb_state* mrb, mrb_value mod, mrb_sym sym);
void mrb_mod_cv_set (mrb_state* mrb, RClass* c, mrb_sym sym, mrb_value v);
void mrb_cv_set (mrb_state* mrb, mrb_value mod, mrb_sym sym, mrb_value v);
mrb_bool mrb_cv_defined (mrb_state* mrb, mrb_value mod, mrb_sym sym);
mrb_value mrb_obj_iv_inspect (mrb_state*, RObject*);
mrb_value mrb_mod_constants (mrb_state* mrb, mrb_value mod);
mrb_value mrb_f_global_variables (mrb_state* mrb, mrb_value self);
mrb_value mrb_obj_instance_variables (mrb_state*, mrb_value);
mrb_value mrb_mod_class_variables (mrb_state*, mrb_value);
mrb_value mrb_mod_cv_get (mrb_state* mrb, RClass* c, mrb_sym sym);
mrb_bool mrb_mod_cv_defined (mrb_state* mrb, RClass* c, mrb_sym sym);
mrb_sym mrb_class_sym (mrb_state* mrb, RClass* c, RClass* outer);
void mrb_gc_mark_gv (mrb_state*);
void mrb_gc_free_gv (mrb_state*);
void mrb_gc_mark_iv (mrb_state*, RObject*);
size_t mrb_gc_mark_iv_size (mrb_state*, RObject*);
void mrb_gc_free_iv (mrb_state*, RObject*);
| D |
module mci.core.sync;
import core.sync.condition,
core.sync.mutex;
/**
* A $(D final) version of $(D core.sync.mutex.Mutex). Its only purpose is
* to devirtualize all calls for performance.
*/
public final class Mutex : core.sync.mutex.Mutex
{
}
/**
* A $(D final) version of $(D core.sync.condition.Condition). Its only
* purpose is to devirtualize all calls for performance.
*/
public final class Condition : core.sync.condition.Condition
{
/**
* Constructs a new condition variable.
*
* Params:
* mutex = The mutex to use for synchronization.
*/
public this(Mutex mutex)
in
{
assert(mutex);
}
body
{
super(mutex);
}
}
| D |
/Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/DispatchQueue+Alamofire.o : /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/MultipartFormData.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Timeline.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Alamofire.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Response.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/TaskDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/SessionDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ParameterEncoding.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Validation.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ResponseSerialization.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/SessionManager.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/AFError.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Notifications.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Result.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Request.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap
/Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/DispatchQueue+Alamofire~partial.swiftmodule : /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/MultipartFormData.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Timeline.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Alamofire.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Response.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/TaskDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/SessionDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ParameterEncoding.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Validation.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ResponseSerialization.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/SessionManager.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/AFError.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Notifications.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Result.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Request.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap
/Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/DispatchQueue+Alamofire~partial.swiftdoc : /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/MultipartFormData.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Timeline.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Alamofire.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Response.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/TaskDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/SessionDelegate.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ParameterEncoding.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Validation.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ResponseSerialization.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/SessionManager.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/AFError.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Notifications.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Result.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/Request.swift /Users/william/Projects/studySocial/studySocial/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/william/Projects/studySocial/studySocial/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/william/Projects/studySocial/studySocial/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap
| D |
// Copyright Brian Schott 2015.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
module dfmt.wrapping;
import dparse.lexer;
import dfmt.tokens;
import dfmt.config;
struct State
{
this(uint breaks, const Token[] tokens, immutable short[] depths,
const Config* config, int currentLineLength, int indentLevel) pure @safe
{
import std.math : abs;
import core.bitop : popcnt, bsf;
import std.algorithm : min, map, sum;
immutable int remainingCharsMultiplier = config.max_line_length - config.dfmt_soft_max_line_length;
immutable int newlinePenalty = remainingCharsMultiplier * 20;
this.breaks = breaks;
this._cost = 0;
this._solved = true;
int ll = currentLineLength;
if (breaks == 0)
{
immutable int l = currentLineLength + tokens.map!(a => tokenLength(a)).sum();
if (l > config.dfmt_soft_max_line_length)
{
immutable int longPenalty = (l - config.dfmt_soft_max_line_length) * remainingCharsMultiplier;
this._cost += longPenalty;
this._solved = longPenalty < newlinePenalty;
}
else
this._solved = true;
}
else
{
for (size_t i = 0; i != uint.sizeof * 8; ++i)
{
if (((1 << i) & breaks) == 0)
continue;
immutable b = tokens[i].type;
immutable p = abs(depths[i]);
immutable bc = breakCost(b) * (p == 0 ? 1 : p * 2);
this._cost += bc;
}
size_t i = 0;
foreach (_; 0 .. uint.sizeof * 8)
{
immutable uint k = breaks >>> i;
immutable bool b = k == 0;
immutable uint bits = b ? 0 : bsf(k);
immutable size_t j = min(i + bits + 1, tokens.length);
ll += tokens[i .. j].map!(a => tokenLength(a)).sum();
if (ll > config.dfmt_soft_max_line_length)
{
immutable int longPenalty = (ll - config.dfmt_soft_max_line_length) * remainingCharsMultiplier;
this._cost += longPenalty;
}
if (ll > config.max_line_length)
{
this._solved = false;
break;
}
i = j;
ll = indentLevel * config.indent_size;
if (b)
break;
}
}
this._cost += popcnt(breaks) * newlinePenalty;
}
int cost() const pure nothrow @safe @property
{
return _cost;
}
int solved() const pure nothrow @safe @property
{
return _solved;
}
int opCmp(ref const State other) const pure nothrow @safe
{
import core.bitop : bsf, popcnt;
if (_cost < other._cost || (_cost == other._cost && ((breaks != 0
&& other.breaks != 0 && bsf(breaks) > bsf(other.breaks))
|| (_solved && !other.solved))))
{
return -1;
}
return other._cost > _cost;
}
bool opEquals(ref const State other) const pure nothrow @safe
{
return other.breaks == breaks;
}
size_t toHash() const pure nothrow @safe
{
return breaks;
}
uint breaks;
private:
int _cost;
bool _solved;
}
size_t[] chooseLineBreakTokens(size_t index, const Token[] tokens,
immutable short[] depths, const Config* config, int currentLineLength, int indentLevel)
{
import std.container.rbtree : RedBlackTree;
import std.algorithm : filter, min;
import core.bitop : popcnt;
static size_t[] genRetVal(uint breaks, size_t index) pure nothrow @safe
{
auto retVal = new size_t[](popcnt(breaks));
size_t j = 0;
foreach (uint i; 0 .. uint.sizeof * 8)
if ((1 << i) & breaks)
retVal[j++] = index + i;
return retVal;
}
enum ALGORITHMIC_COMPLEXITY_SUCKS = uint.sizeof * 8;
immutable size_t tokensEnd = min(tokens.length, ALGORITHMIC_COMPLEXITY_SUCKS);
auto open = new RedBlackTree!State;
open.insert(State(0, tokens[0 .. tokensEnd], depths[0 .. tokensEnd], config,
currentLineLength, indentLevel));
State lowest;
while (!open.empty)
{
State current = open.front();
if (current.cost < lowest.cost)
lowest = current;
open.removeFront();
if (current.solved)
{
return genRetVal(current.breaks, index);
}
validMoves!(typeof(open))(open, tokens[0 .. tokensEnd],
depths[0 .. tokensEnd], current.breaks, config, currentLineLength, indentLevel);
}
if (open.empty)
return genRetVal(lowest.breaks, index);
foreach (r; open[].filter!(a => a.solved))
return genRetVal(r.breaks, index);
assert(false);
}
void validMoves(OR)(auto ref OR output, const Token[] tokens,
immutable short[] depths, uint current, const Config* config,
int currentLineLength, int indentLevel)
{
import std.algorithm : sort, canFind;
import std.array : insertInPlace;
foreach (i, token; tokens)
{
if (!isBreakToken(token.type) || (((1 << i) & current) != 0))
continue;
immutable uint breaks = current | (1 << i);
output.insert(State(breaks, tokens, depths, config, currentLineLength, indentLevel));
}
}
| D |
/Users/zachspalding/Documents/Advent_of_Code/2017/AdventofCode2017/2017/day3/target/debug/deps/day3-64d5b1e5c86b9c3b: src/main.rs
/Users/zachspalding/Documents/Advent_of_Code/2017/AdventofCode2017/2017/day3/target/debug/deps/day3-64d5b1e5c86b9c3b.d: src/main.rs
src/main.rs:
| D |
(meteorology) rapid inward circulation of air masses about a low pressure center
a violent rotating windstorm
| D |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module flow.engine.history.HistoricActivityInstance;
import hunt.time.LocalDateTime;
import flow.common.api.history.HistoricData;
alias Date = LocalDateTime;
/**
* Represents one execution of an activity and it's stored permanent for statistics, audit and other business intelligence purposes.
*
* @author Christian Stettler
* @author Joram Barrez
*/
interface HistoricActivityInstance : HistoricData {
/** The unique identifier of this historic activity instance. */
string getId();
/** The unique identifier of the activity in the process */
string getActivityId();
/** The display name for the activity */
string getActivityName();
/** The XML tag of the activity as in the process file */
string getActivityType();
/** Process definition reference */
string getProcessDefinitionId();
/** Process instance reference */
string getProcessInstanceId();
/** Execution reference */
string getExecutionId();
/** The corresponding task in case of task activity */
string getTaskId();
/** The called process instance in case of call activity */
string getCalledProcessInstanceId();
/** Assignee in case of user task activity */
string getAssignee();
/** Time when the activity instance started */
Date getStartTime();
/** Time when the activity instance ended */
Date getEndTime();
/** Difference between {@link #getEndTime()} and {@link #getStartTime()}. */
long getDurationInMillis();
/** Returns the delete reason for this activity, if any was set (if completed normally, no delete reason is set) */
string getDeleteReason();
/** Returns the tenant identifier for the historic activity */
string getTenantId();
}
| D |
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/FluentProvider.build/Filterable/FilterableKey+String.swift.o : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Node+Row+JSON.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Storage.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Cache.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Request+Updateable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Updateable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Query+Filterable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Filterable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Prepare.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Prepare.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/SQLite+Config.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey+String.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Model.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Pagination.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Preparation.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Provider.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Driver.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Exports.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/UpdateableKey.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/SMTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/FormData.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Cache.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/SQLite.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Random.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 /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Branches.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Cookies.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Configs.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sessions.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/WebSockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/BCrypt.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/FluentProvider.build/FilterableKey+String~partial.swiftmodule : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Node+Row+JSON.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Storage.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Cache.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Request+Updateable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Updateable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Query+Filterable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Filterable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Prepare.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Prepare.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/SQLite+Config.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey+String.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Model.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Pagination.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Preparation.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Provider.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Driver.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Exports.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/UpdateableKey.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/SMTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/FormData.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Cache.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/SQLite.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Random.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 /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Branches.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Cookies.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Configs.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sessions.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/WebSockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/BCrypt.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/FluentProvider.build/FilterableKey+String~partial.swiftdoc : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Node+Row+JSON.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Storage.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Cache.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Request+Updateable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/Updateable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Query+Filterable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/Filterable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Droplet+Prepare.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Prepare.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/SQLite+Config.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey+String.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Model.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Pagination.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Preparation.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Provider.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Droplet/Config+Driver.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Exports.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Updateable/UpdateableKey.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/fluent-provider.git-1502561075136423204/Sources/FluentProvider/Filterable/FilterableKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/URI.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/JSON.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/SMTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/TLS.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/FormData.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Node.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Cache.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/PathIndexable.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/SQLite.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Random.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 /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Vapor.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Branches.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Cookies.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Configs.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sessions.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Sockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/WebSockets.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Fluent.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/BCrypt.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Transport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include/sqlite3.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include/http_parser.h /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/ctls.git-9210868160426949823/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes
| D |
/Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/Runtime.o : /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Image.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Filter.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Result.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Kingfisher.h /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/Runtime~partial.swiftmodule : /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Image.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Filter.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Result.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Kingfisher.h /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/Runtime~partial.swiftdoc : /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Image.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/Filter.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Result.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/macbook/Desktop/BookFarm/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/macbook/Desktop/BookFarm/Pods/Kingfisher/Sources/Kingfisher.h /Users/macbook/Desktop/BookFarm/build/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/orange_pro/swift_dev/Fanplan/.build/debug/PerfectLib.build/MimeReader.swift.o : /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Utilities.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/FastCGIServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HTTPServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HPACK.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebResponse.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/File.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/DynamicLoader.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/StaticFileHandler.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/MimeType.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/JSONConvertible.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebRequest.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/LogManager.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Dir.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebConnection.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Mustache.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/FastCGI.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebSocketHandler.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Bytes.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/PerfectServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/MimeReader.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/PerfectError.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/NotificationPusher.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/SysProcess.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/SwiftCompatibility.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HTTP2.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Routing.swift /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Swift.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/shims/Visibility.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/SwiftStdint.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/UnicodeShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/SwiftStddef.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/LibcShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RuntimeStubs.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RuntimeShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RefCount.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/HeapObject.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/GlobalObjects.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/FoundationShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/CoreFoundationShims.h /orange_pro/swift_dev/Fanplan/Packages/LinuxBridge-0.4.0/module.modulemap /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/glibc.modulemap /orange_pro/swift_dev/swift/usr/lib/swift/shims/module.map /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /orange_pro/swift_dev/Fanplan/.build/debug/PerfectNet.swiftmodule /orange_pro/swift_dev/Fanplan/Packages/LinuxBridge-0.4.0/LinuxBridge.h /orange_pro/swift_dev/Fanplan/Packages/OpenSSL-0.3.0/module.modulemap /orange_pro/swift_dev/Fanplan/Packages/OpenSSL-0.3.0/openssl.h /orange_pro/swift_dev/Fanplan/.build/debug/PerfectThread.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Foundation.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Glibc.swiftmodule
/orange_pro/swift_dev/Fanplan/.build/debug/PerfectLib.build/MimeReader~partial.swiftmodule : /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Utilities.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/FastCGIServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HTTPServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HPACK.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebResponse.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/File.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/DynamicLoader.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/StaticFileHandler.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/MimeType.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/JSONConvertible.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebRequest.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/LogManager.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Dir.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebConnection.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Mustache.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/FastCGI.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebSocketHandler.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Bytes.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/PerfectServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/MimeReader.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/PerfectError.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/NotificationPusher.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/SysProcess.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/SwiftCompatibility.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HTTP2.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Routing.swift /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Swift.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/shims/Visibility.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/SwiftStdint.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/UnicodeShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/SwiftStddef.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/LibcShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RuntimeStubs.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RuntimeShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RefCount.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/HeapObject.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/GlobalObjects.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/FoundationShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/CoreFoundationShims.h /orange_pro/swift_dev/Fanplan/Packages/LinuxBridge-0.4.0/module.modulemap /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/glibc.modulemap /orange_pro/swift_dev/swift/usr/lib/swift/shims/module.map /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /orange_pro/swift_dev/Fanplan/.build/debug/PerfectNet.swiftmodule /orange_pro/swift_dev/Fanplan/Packages/LinuxBridge-0.4.0/LinuxBridge.h /orange_pro/swift_dev/Fanplan/Packages/OpenSSL-0.3.0/module.modulemap /orange_pro/swift_dev/Fanplan/Packages/OpenSSL-0.3.0/openssl.h /orange_pro/swift_dev/Fanplan/.build/debug/PerfectThread.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Foundation.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Glibc.swiftmodule
/orange_pro/swift_dev/Fanplan/.build/debug/PerfectLib.build/MimeReader~partial.swiftdoc : /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Utilities.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/FastCGIServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HTTPServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HPACK.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebResponse.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/File.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/DynamicLoader.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/StaticFileHandler.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/MimeType.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/JSONConvertible.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebRequest.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/LogManager.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Dir.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebConnection.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Mustache.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/FastCGI.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/WebSocketHandler.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Bytes.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/PerfectServer.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/MimeReader.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/PerfectError.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/NotificationPusher.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/SysProcess.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/SwiftCompatibility.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/HTTP2.swift /orange_pro/swift_dev/Fanplan/Packages/PerfectLib-0.32.0/Sources/PerfectLib/Routing.swift /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Swift.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/shims/Visibility.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/SwiftStdint.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/UnicodeShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/SwiftStddef.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/LibcShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RuntimeStubs.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RuntimeShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/RefCount.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/HeapObject.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/GlobalObjects.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/FoundationShims.h /orange_pro/swift_dev/swift/usr/lib/swift/shims/CoreFoundationShims.h /orange_pro/swift_dev/Fanplan/Packages/LinuxBridge-0.4.0/module.modulemap /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/glibc.modulemap /orange_pro/swift_dev/swift/usr/lib/swift/shims/module.map /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /orange_pro/swift_dev/Fanplan/.build/debug/PerfectNet.swiftmodule /orange_pro/swift_dev/Fanplan/Packages/LinuxBridge-0.4.0/LinuxBridge.h /orange_pro/swift_dev/Fanplan/Packages/OpenSSL-0.3.0/module.modulemap /orange_pro/swift_dev/Fanplan/Packages/OpenSSL-0.3.0/openssl.h /orange_pro/swift_dev/Fanplan/.build/debug/PerfectThread.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Foundation.swiftmodule /orange_pro/swift_dev/swift/usr/lib/swift/linux/x86_64/Glibc.swiftmodule
| D |
/// This module defines one texture type for each sort of OpenGL texture.
module gfmod.opengl.texture;
import std.string;
import derelict.opengl3.gl3;
import /*gfmod.core.log,*/
gfmod.opengl.opengl,
gfmod.opengl.textureunit;
/// OpenGL Texture wrapper.
///
/// TODO:
/// $(UL
/// $(LI Support partial updates.)
/// $(LI Support glStorage through pseudo-code given in OpenGL specification.)
/// )
class GLTexture
{
public
{
/// Creates a texture. You should create a child class instead of calling
/// this constructor directly.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl, GLuint target)
{
_gl = gl;
_target = target;
glGenTextures(1, &_handle);
_gl.runtimeCheck();
_initialized = true;
_textureUnit = -1;
}
~this()
{
close();
}
/// Releases the OpenGL texture resource.
final void close()
{
if (_initialized)
{
glDeleteTextures(1, &_handle);
_initialized = false;
}
}
/// Use this texture, binding it to a texture unit.
/// Params:
/// textureUnit = Index of the texture unit to use.
final void use(int textureUnit = 0)
{
_gl.textureUnits().setActiveTexture(textureUnit);
bind();
}
/// Unuse this texture.
final void unuse()
{
// do nothing: texture unit binding is as needed
}
/// Returns: Requested texture parameter.
/// Throws: $(D OpenGLException) on error.
/// Warning: Calling $(D glGetTexParameteriv) is generally not recommended
/// since it could stall the OpenGL pipeline.
final int getParam(GLenum paramName)
{
int res;
bind();
glGetTexParameteriv(_target, paramName, &res);
_gl.runtimeCheck();
return res;
}
/// Returns: Requested texture level parameter.
/// Throws: $(D OpenGLException) on error.
/// Warning: Calling $(D glGetTexLevelParameteriv) is generally not recommended
/// since it could stall the OpenGL pipeline.
final int getLevelParam(GLenum paramName, int level)
{
int res;
bind();
glGetTexLevelParameteriv(_target, level, paramName, &res);
_gl.runtimeCheck();
return res;
}
/// Sets the texture base level.
/// Throws: $(D OpenGLException) on error.
final void setBaseLevel(int level)
{
bind();
glTexParameteri(_target, GL_TEXTURE_BASE_LEVEL, level);
_gl.runtimeCheck();
}
/// Sets the texture maximum level.
/// Throws: $(D OpenGLException) on error.
final void setMaxLevel(int level)
{
bind();
glTexParameteri(_target, GL_TEXTURE_MAX_LEVEL, level);
_gl.runtimeCheck();
}
// Texture "sampler" parameters which are now in Sampler Objects too
// but are also here for legacy cards.
/// Sets the texture minimum LOD.
/// Throws: $(D OpenGLException) on error.
final void setMinLOD(float lod)
{
bind();
glTexParameterf(_target, GL_TEXTURE_MIN_LOD, lod);
_gl.runtimeCheck();
}
/// Sets the texture maximum LOD.
/// Throws: $(D OpenGLException) on error.
final void setMaxLOD(float lod)
{
bind();
glTexParameterf(_target, GL_TEXTURE_MAX_LOD, lod);
_gl.runtimeCheck();
}
/// Sets the texture LOD bias.
/// Throws: $(D OpenGLException) on error.
final void setLODBias(float lodBias)
{
bind();
glTexParameterf(_target, GL_TEXTURE_LOD_BIAS, lodBias);
_gl.runtimeCheck();
}
/// Sets the wrap mode for 1st texture coordinate.
/// Throws: $(D OpenGLException) on error.
final void setWrapS(GLenum wrapS)
{
bind();
glTexParameteri(_target, GL_TEXTURE_WRAP_S, wrapS);
_gl.runtimeCheck();
}
/// Sets the wrap mode for 2nd texture coordinate.
/// Throws: $(D OpenGLException) on error.
final void setWrapT(GLenum wrapT)
{
bind();
glTexParameteri(_target, GL_TEXTURE_WRAP_T, wrapT);
_gl.runtimeCheck();
}
/// Sets the wrap mode for 3rd texture coordinate.
/// Throws: $(D OpenGLException) on error.
final void setWrapR(GLenum wrapR)
{
bind();
glTexParameteri(_target, GL_TEXTURE_WRAP_R, wrapR);
_gl.runtimeCheck();
}
/// Sets the texture minification filter mode.
/// Throws: $(D OpenGLException) on error.
final void setMinFilter(GLenum minFilter)
{
bind();
glTexParameteri(_target, GL_TEXTURE_MIN_FILTER, minFilter);
_gl.runtimeCheck();
}
/// Sets the texture magnification filter mode.
/// Throws: $(D OpenGLException) on error.
final void setMagFilter(GLenum magFilter)
{
bind();
glTexParameteri(_target, GL_TEXTURE_MAG_FILTER, magFilter);
_gl.runtimeCheck();
}
/// Sets the texture anisotropic filter level.
/// If texture anisotropy isn't supported, fail silently.
/// Throws: $(D OpenGLException) on error.
final void setMaxAnisotropy(float f)
{
assert(f >= 1.0f);
if (!EXT_texture_filter_anisotropic())
return;
auto maxAniso = _gl.maxTextureMaxAnisotropy();
if (f >= maxAniso)
f = maxAniso;
glTexParameterf(_target, GL_TEXTURE_MAX_ANISOTROPY_EXT, f);
_gl.runtimeCheck();
}
/// Gets the texture data.
/// Throws: $(D OpenGLException) on error.
final void getTexImage(int level, GLenum format, GLenum type, void* data)
{
bind();
glGetTexImage(_target, level, format, type, data);
_gl.runtimeCheck();
}
/// Returns: Wrapped OpenGL resource handle.
GLuint handle() pure const nothrow
{
return _handle;
}
GLuint target() pure const nothrow
{
return _target;
}
/// Regenerates the mipmapped levels.
/// Throws: $(D OpenGLException) on error.
void generateMipmap()
{
bind();
glGenerateMipmap(_target);
_gl.runtimeCheck();
}
}
package
{
GLuint _target;
}
private
{
OpenGL _gl;
GLuint _handle;
bool _initialized;
int _textureUnit;
void bind()
{
// Bind on whatever the current texture unit is!
glBindTexture(target, _handle);
_gl.runtimeCheck();
}
}
}
/// Wrapper for 1D texture.
final class GLTexture1D : GLTexture
{
public
{
/// Creates a 1D texture.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_1D);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, GLint internalFormat, int width, int border, GLenum format, GLenum type, void* data)
{
glTexImage1D(_target, level, internalFormat, width, border, format, type, data);
_gl.runtimeCheck();
}
}
}
/// Wrapper for 2D texture.
final class GLTexture2D : GLTexture
{
public
{
/// Creates a 2D texture.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_2D);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, GLint internalFormat, int width, int height, int border, GLenum format, GLenum type, void* data)
{
glTexImage2D(_target, level, internalFormat, width, height, border, format, type, data);
_gl.runtimeCheck();
}
}
}
/// Wrapper for 3D texture.
final class GLTexture3D : GLTexture
{
public
{
/// Creates a 3D texture.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_3D);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, GLint internalFormat, int width, int height, int depth, int border, GLenum format, GLenum type, void* data)
{
glTexImage3D(_target, level, internalFormat, width, height, depth, border, format, type, data);
_gl.runtimeCheck();
}
}
}
/// Wrapper for 1D texture array.
final class GLTexture1DArray : GLTexture
{
public
{
/// Creates a 1D texture array.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_1D_ARRAY);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, GLint internalFormat, int width, int height, int border, GLenum format, GLenum type, void* data)
{
glTexImage2D(_target, level, internalFormat, width, height, border, format, type, null);
_gl.runtimeCheck();
}
}
}
/// Wrapper for 2D texture array.
final class GLTexture2DArray : GLTexture
{
public
{
/// Creates a 2D texture array.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_2D_ARRAY);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, GLint internalFormat, int width, int height, int depth, int border, GLenum format, GLenum type, void* data)
{
glTexImage3D(_target, level, internalFormat, width, height, depth, border, format, type, data);
_gl.runtimeCheck();
}
/// Sets partial texture content.
/// Throws: $(D OpenGLException) on error.
void setSubImage(int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, GLenum format, GLenum type, void* data)
{
glTexSubImage3D(_target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
_gl.runtimeCheck();
}
}
}
/// Wrapper for texture rectangle.
final class GLTextureRectangle : GLTexture
{
public
{
/// Creates a texture rectangle.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_RECTANGLE);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, GLint internalFormat, int width, int height, int border, GLenum format, GLenum type, void* data)
{
glTexImage2D(_target, level, internalFormat, width, height, border, format, type, null);
_gl.runtimeCheck();
}
}
}
/// Wrapper for 2D multisampled texture.
final class GLTexture2DMultisample : GLTexture
{
public
{
/// Creates a 2D multisampled texture.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_2D_MULTISAMPLE);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, int samples, GLint internalFormat, int width, int height, bool fixedsamplelocations)
{
glTexImage2DMultisample(_target, samples, internalFormat, width, height, fixedsamplelocations ? GL_TRUE : GL_FALSE);
_gl.runtimeCheck();
}
}
}
/// Wrapper for 2D multisampled texture array.
final class GLTexture2DMultisampleArray : GLTexture
{
public
{
/// Creates a 2D multisampled texture array.
/// Throws: $(D OpenGLException) on error.
this(OpenGL gl)
{
super(gl, GL_TEXTURE_2D_MULTISAMPLE_ARRAY);
}
/// Sets texture content.
/// Throws: $(D OpenGLException) on error.
void setImage(int level, int samples, GLint internalFormat, int width, int height, int depth, bool fixedsamplelocations)
{
glTexImage3DMultisample(_target, samples, internalFormat, width, height, depth, fixedsamplelocations ? GL_TRUE : GL_FALSE);
_gl.runtimeCheck();
}
}
}
| 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.amqp.messaging.Target;
import hunt.proton.amqp.messaging.Terminus;
import hunt.proton.amqp.transport.Target;
import hunt.Object;
import hunt.String;
class Target : Terminus ,hunt.proton.amqp.transport.Target.Target
{
this (Target other) {
super(other);
}
this() {
}
// override string toString()
// {
// return super.toString;
// }
override string toString()
{
String address = getAddress();
IObject nodeProperties = getDynamicNodeProperties();
return "Target{" ~
"address='" ~ (address is null ? "null" : address.toString()) ~ '\'' ~
", durable=" ~ getDurable().toString() ~
", expiryPolicy=" ~ getExpiryPolicy().toString() ~
", timeout=" ~ getTimeout().toString() ~
", dynamic=" ~ getDynamic().toString() ~
", dynamicNodeProperties=" ~ (nodeProperties is null ? "null" : nodeProperties.toString()) ~
", capabilities=" ~ (getCapabilities() is null ? "null" : getCapabilities().toString()) ~
'}';
}
override
public hunt.proton.amqp.transport.Target.Target copy() {
return new Target(this);
}
override
String getAddress()
{
return super.getAddress();
}
}
| D |
/Users/victornascimento/Documents/Projects/Rust/pong_with_rust/pong_with_rust/target/debug/deps/semver-16b9e5b7aa8e5fd6.rmeta: /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/lib.rs /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version.rs /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version_req.rs
/Users/victornascimento/Documents/Projects/Rust/pong_with_rust/pong_with_rust/target/debug/deps/libsemver-16b9e5b7aa8e5fd6.rlib: /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/lib.rs /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version.rs /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version_req.rs
/Users/victornascimento/Documents/Projects/Rust/pong_with_rust/pong_with_rust/target/debug/deps/semver-16b9e5b7aa8e5fd6.d: /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/lib.rs /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version.rs /Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version_req.rs
/Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/lib.rs:
/Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version.rs:
/Users/victornascimento/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/version_req.rs:
| D |
/**
* ASSIMP関連のユーティリティモジュール
*/
module ddoom.assimp;
import std.algorithm : map;
import std.array : array, Appender;
import std.stdio : writefln;
import std.string : fromStringz, toStringz;
import std.format : format;
import derelict.assimp3.assimp;
import gl3n.linalg;
import ddoom.asset;
/// ASSIMP関連例外
class AssetException : Exception {
@nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) {
super(msg, file, line, next);
}
@nogc @safe pure nothrow this(string msg, Throwable next, string file = __FILE__, size_t line = __LINE__) {
super(msg, file, line, next);
}
}
/// ASSIMPエラーチェック
T enforceAsset(T)(
T value,
lazy const(char)[] msg = null,
string file = __FILE__,
size_t line = __LINE__)
if (is(typeof((){if(!value){}}))) {
if(!value) {
auto errorMessage = format("%s : %s", fromStringz(aiGetErrorString()), msg);
throw new AssetException(errorMessage, file, line);
}
return value;
}
/// シーンのアセット
class SceneAsset {
/// 指定パスのシーンファイルを開く
this(string path) {
scene_ = enforceAsset(aiImportFile(
toStringz(path),
aiProcess_CalcTangentSpace
| aiProcess_Triangulate
| aiProcess_JoinIdenticalVertices
| aiProcess_SortByPType));
}
/// シーンの破棄
~this() nothrow {
release();
}
/// シーンを生成する
Scene createScene() const
in {
assert(scene_ !is null);
} body {
if(scene_.mRootNode is null) {
return new Scene(null, null);
}
// マテリアル情報
auto materials
= scene_.mMaterials[0 .. scene_.mNumMaterials]
.map!(m => createMaterial(m))
.array;
// メッシュ配列
auto meshes
= scene_.mMeshes[0 .. scene_.mNumMeshes]
.map!(m => createMesh(m, materials))
.array;
// ルートノード
auto root = createNode(scene_.mRootNode, meshes);
// アニメーション
auto animations
= scene_.mAnimations[0 .. scene_.mNumAnimations]
.map!(a => createAnimation(a))
.array;
return new Scene(root, animations);
}
/// シーンの解放
void release() nothrow {
aiReleaseImport(scene_);
scene_ = null;
}
private:
/// 文字列変換
static string fromAiString(const(aiString) s) @safe pure {
return s.data[0 .. s.length].idup;
}
/// 色情報の変換
static Material.Color fromAiColor(ref const(aiColor4D) c) @safe nothrow pure @nogc {
return Material.Color(c.r, c.g, c.b, c.a);
}
/// 行列変換
static mat4 fromAiMatrix4x4(ref const aiMatrix4x4 m) @safe pure nothrow @nogc {
return mat4(
m.a1, m.a2, m.a3, m.a4,
m.b1, m.b2, m.b3, m.b4,
m.c1, m.c2, m.c3, m.c4,
m.d1, m.d2, m.d3, m.d4);
}
/// ベクトルの変換
static vec3 fromAiVector(ref const aiVector3D v) @safe pure nothrow @nogc {
return vec3(v.x, v.y, v.z);
}
/// 四元数の変換
static quat fromAiQuaternion(ref const aiQuaternion q) @safe pure nothrow @nogc {
return quat(q.w, q.x, q.y, q.z);
}
/// アニメーションの生成
Animation createAnimation(const(aiAnimation)* animation) const {
// ノード名
auto name = fromAiString(animation.mName);
// 長さ
auto duration = animation.mDuration;
// 秒間フレーム数
auto ticksPerSecond = animation.mTicksPerSecond;
// 各チャンネルのアニメーション
auto channels
= animation.mChannels[0 .. animation.mNumChannels]
.map!(c => createNodeAnimation(c))
.array;
return new Animation(name, duration, ticksPerSecond, channels);
}
/// ノードのアニメーションの生成
NodeAnimation createNodeAnimation(const(aiNodeAnim)* channel) const {
// ノード名
auto nodeName = fromAiString(channel.mNodeName);
// ベクトルキーの変換
static NodeAnimation.VectorKey fromAiVectorKey(
ref const aiVectorKey key) {
return NodeAnimation.VectorKey(
key.mTime, fromAiVector(key.mValue));
}
// 四元数キーの変換
static NodeAnimation.QuaternionKey fromAiQuatKey(
ref const aiQuatKey key) {
return NodeAnimation.QuaternionKey(
key.mTime, fromAiQuaternion(key.mValue));
}
// 位置のキーフレーム
auto positionKeys
= channel.mPositionKeys[0 .. channel.mNumPositionKeys]
.map!(p => fromAiVectorKey(p))
.array;
// 回転のキーフレーム
auto rotationKeys
= channel.mRotationKeys[0 .. channel.mNumRotationKeys]
.map!(r => fromAiQuatKey(r))
.array;
// スケールのキーフレーム
auto scalingKeys
= channel.mScalingKeys[0 .. channel.mNumScalingKeys]
.map!(s => fromAiVectorKey(s))
.array;
return new NodeAnimation(
nodeName, positionKeys, rotationKeys, scalingKeys);
}
/// ノードの生成
Node createNode(const(aiNode)* node, const(Mesh)[] meshes) const {
// ノード名
auto name = fromAiString(node.mName);
// 子ノード配列
auto children
= node.mChildren[0 .. node.mNumChildren]
.map!(c => createNode(c, meshes))
.array;
// 変換行列
auto trans = fromAiMatrix4x4(node.mTransformation);
return new Node(name, meshes, children, trans);
}
/// マテリアルの生成
Material createMaterial(const(aiMaterial)* material) const {
// マテリアル名
aiString aiName;
aiGetMaterialString(material, AI_MATKEY_NAME, 0, 0, &aiName);
auto name = fromAiString(aiName);
aiColor4D color;
// 表面色
aiGetMaterialColor(material, AI_MATKEY_COLOR_DIFFUSE, 0, 0, &color);
auto diffuse = fromAiColor(color);
aiGetMaterialColor(material, AI_MATKEY_COLOR_SPECULAR, 0, 0, &color);
// ハイライト色
auto speculer = fromAiColor(color);
aiGetMaterialColor(material, AI_MATKEY_COLOR_AMBIENT, 0, 0, &color);
// 環境色
auto ambient = fromAiColor(color);
return new Material(name, diffuse, speculer, ambient);
}
/// ボーンの生成
Bone createBone(const(aiBone)* bone) const {
// ボーン名
auto name = fromAiString(bone.mName);
// オフセット
auto offset = fromAiMatrix4x4(bone.mOffsetMatrix);
// 重み付け
auto weights = bone.mWeights[0 .. bone.mNumWeights]
.map!(b => Bone.Weight(b.mVertexId, b.mWeight))
.array;
return new Bone(name, offset, weights);
}
/// メッシュの生成
Mesh createMesh(const(aiMesh)* mesh, const(Material)[] materials) const {
// メッシュ名
auto name = fromAiString(mesh.mName);
// 頂点配列
auto vertices
= mesh.mVertices[0 .. mesh.mNumVertices]
.map!(v => fromAiVector(v))
.array;
// 法線配列
const(vec3)[] normals;
if(mesh.mNormals !is null) {
normals = mesh.mNormals[0 .. mesh.mNumVertices]
.map!(n => fromAiVector(n))
.array;
}
// ボーン配列
const(Bone)[] bones;
if(mesh.mBones !is null) {
bones = mesh.mBones[0 .. mesh.mNumBones]
.map!(b => createBone(b))
.array;
}
// 面配列。頂点数別にまとめる
Appender!(uint[])[uint] faces;
foreach(f; mesh.mFaces[0 .. mesh.mNumFaces]) {
immutable n = f.mNumIndices;
auto app = n in faces;
if(app is null) {
app = &(faces[n] = Appender!(uint[])());
}
app.put(f.mIndices[0 .. n]);
}
uint[][uint] facesArray;
foreach(e; faces.byKeyValue) {
facesArray[e.key] = e.value.data;
}
facesArray.rehash;
// マテリアルの取得
immutable mi = mesh.mMaterialIndex;
auto material = (mi < materials.length) ? materials[mi] : null;
return new Mesh(
name, vertices, normals, bones, facesArray, material);
}
/// シーンへのポインタ
const(aiScene)* scene_;
}
| 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_5_MobileMedia-4185118997.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_5_MobileMedia-4185118997.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* Authors: Stewart Gordon
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC src/core/sys/windows/_iptypes.d)
*/
module core.sys.windows.iptypes;
version (Windows):
@system:
import core.sys.windows.windef;
import core.stdc.time;
//#include <sys/types.h>
enum size_t
DEFAULT_MINIMUM_ENTITIES = 32,
MAX_ADAPTER_ADDRESS_LENGTH = 8,
MAX_ADAPTER_DESCRIPTION_LENGTH = 128,
MAX_ADAPTER_NAME_LENGTH = 256,
MAX_DOMAIN_NAME_LEN = 128,
MAX_HOSTNAME_LEN = 128,
MAX_SCOPE_ID_LEN = 256;
enum UINT
BROADCAST_NODETYPE = 1,
PEER_TO_PEER_NODETYPE = 2,
MIXED_NODETYPE = 4,
HYBRID_NODETYPE = 8;
enum : UINT {
IF_OTHER_ADAPTERTYPE,
IF_ETHERNET_ADAPTERTYPE,
IF_TOKEN_RING_ADAPTERTYPE,
IF_FDDI_ADAPTERTYPE,
IF_PPP_ADAPTERTYPE,
IF_LOOPBACK_ADAPTERTYPE // = 5
}
struct IP_ADDRESS_STRING {
char[16] String = 0;
}
alias IP_ADDRESS_STRING IP_MASK_STRING;
alias IP_ADDRESS_STRING* PIP_ADDRESS_STRING, PIP_MASK_STRING;
struct IP_ADDR_STRING {
IP_ADDR_STRING* Next;
IP_ADDRESS_STRING IpAddress;
IP_MASK_STRING IpMask;
DWORD Context;
}
alias IP_ADDR_STRING* PIP_ADDR_STRING;
struct IP_ADAPTER_INFO {
IP_ADAPTER_INFO* Next;
DWORD ComboIndex;
char[MAX_ADAPTER_NAME_LENGTH+4] AdapterName = 0;
char[MAX_ADAPTER_DESCRIPTION_LENGTH+4] Description = 0;
UINT AddressLength;
BYTE[MAX_ADAPTER_ADDRESS_LENGTH] Address = 0;
DWORD Index;
UINT Type;
UINT DhcpEnabled;
PIP_ADDR_STRING CurrentIpAddress;
IP_ADDR_STRING IpAddressList;
IP_ADDR_STRING GatewayList;
IP_ADDR_STRING DhcpServer;
BOOL HaveWins;
IP_ADDR_STRING PrimaryWinsServer;
IP_ADDR_STRING SecondaryWinsServer;
time_t LeaseObtained;
time_t LeaseExpires;
}
alias IP_ADAPTER_INFO* PIP_ADAPTER_INFO;
struct IP_PER_ADAPTER_INFO {
UINT AutoconfigEnabled;
UINT AutoconfigActive;
PIP_ADDR_STRING CurrentDnsServer;
IP_ADDR_STRING DnsServerList;
}
alias IP_PER_ADAPTER_INFO* PIP_PER_ADAPTER_INFO;
struct FIXED_INFO {
char[MAX_HOSTNAME_LEN+4] HostName = 0;
char[MAX_DOMAIN_NAME_LEN+4] DomainName = 0;
PIP_ADDR_STRING CurrentDnsServer;
IP_ADDR_STRING DnsServerList;
UINT NodeType;
char[MAX_SCOPE_ID_LEN+4] ScopeId = 0;
UINT EnableRouting;
UINT EnableProxy;
UINT EnableDns;
}
alias FIXED_INFO* PFIXED_INFO;
| D |
#include <sac.h>
#include "ldev_tst.h"
#include "lcode_tst.h"
#include "eyeCal.h"
#define WIND0 0
int wndsiz = 50;
int range = 2;
int density = 1;
int lateral = 1;
int twoEyes = 0;
int blockTot = 5;
int numTarg = 40;
int nTrials = -1;
int nBlocks = -1;
calLoc_t *thsGrid = bi16grid;
int dax = 0;
int day = 1;
int fpx = 0;
int fpy = 0;
int posx_code = 0;
int posy_code = 0;
int trlcntr = -1;
int curstm = 0; /* index into the table of experimental conditions for this trial */
int stmerr = 0; /* number of errors in this block */
int fixerr = 0;
int errlst[MAX_POS * 2] = { 0 };
int ptrlst[MAX_POS * 2] = { 0 }; /* list of indices into table of experimental conditions */
calPos_t posArray[400];
int numPos;
int
checkBlock()
{
if(nBlocks >= blockTot) return(1);
return(0);
}
int sayDone()
{
dprintf("\007");
rxerr("Calibration completed");
i_b->i_flags |= I_PSTOP;
softswitch |= PSTOP;
return(0);
}
/*
* Subroutine that determines the position of the
* fixation target
*/
int
pick_targ_location()
{
static int rs_shift = 10;
int ecode = 0;
int i;
int j;
if(--trlcntr <= 0) {
/* if there were more than 10 errors in a block,
* present the error trials by themselves
*/
if(stmerr > 10 ) {
trlcntr = stmerr;
for (j = 0; j < trlcntr; j++) ptrlst[j] = errlst[j];
fixerr++;
}
/* If there were 10 or less errors, shuffle the error
* add the error trials into the next block of trials.
*/
else {
trlcntr = numTarg + stmerr;
/* initial the ptrlst array to hold a sequence of numbers from 0 to numTarg - 1 */
for (i = 0; i < numTarg; i++ ) ptrlst[i] = i;
/* add the indices of the conditions with errors to the ptrlist array */
for (j = 0; j < stmerr; j++) ptrlst[i + j] = errlst[j];
fixerr = 0;
}
/* at this point the ptrlst array holds a list of indices into the
* table that holds the description of the experimental conditions
*/
/* reset the error counter after moving error conditions */
/* into the trial block */
stmerr = 0;
/* randomize the ptrlst array so that experimental conditions will be
* presented in a random order
*/
shuffle(trlcntr, rs_shift, ptrlst);
/* make sure that the same location doesn't occur
* on consequetive trials
*/
for(i = 0; i < trlcntr - 2; ++i) {
if((thsGrid[ptrlst[i]].x == thsGrid[ptrlst[i + 1]].x) &&
(thsGrid[ptrlst[i]].y == thsGrid[ptrlst[i + 1]].y)) {
j = ptrlst[i + 1];
ptrlst[i + 1] = ptrlst[i + 2];
ptrlst[i + 2] = j;
}
}
/* if the fixerr flag is 0, increment the counter that */
/* keeps track of the number of blocks of trials completed */
if(!fixerr) {
nBlocks++;
}
}
/* pick an index from the list of indices, working from back to front */
curstm = ptrlst[trlcntr-1];
nTrials++;
/* get the location of the fixation point for this trial */
fpx = thsGrid[curstm].x * range;
fpy = thsGrid[curstm].y * range;
/* compute the ecode */
ecode = 2000 + (range * 1000) + thsGrid[curstm].c;
return(ecode);
}
/*
* Subroutine that controls window size and counts total trials
*/
long wndxsiz = 0;
long wndysiz = 0;
int
set_wnd()
{
static long wndxctr = 0;
static long wndyctr = 0;
static long z;
wndxctr = (long) fpx;
wndyctr = (long) fpy;
/* increase the window size for more eccentric saccades */
z = fpx / 100;
wndxsiz = wndsiz * (1 + (z * z));
z = fpy / 100;
wndysiz = wndsiz * (1 + (z * z));
wd_pos(WIND0, wndxctr, wndyctr);
wd_siz(WIND0, wndsiz, wndsiz);
return (0);
}
int
saveEye()
{
posArray[numPos].fpx = fpx;
posArray[numPos].fpy = fpy;
posArray[numPos].ex = eyeh;
posArray[numPos].ey = eyev;
if(twoEyes) {
posArray[numPos].oex = oeyeh;
posArray[numPos].oey = oeyev;
}
else {
posArray[numPos].oex = 0;
posArray[numPos].oey = 0;
}
numPos++;
if(numPos > 400) {
nBlocks = blockTot;
}
return(0);
}
int
mistake()
{
if(stmerr < MAX_POS) errlst[stmerr++] = curstm;
return(0);
}
void
rinitf(void)
{
wd_pos(WIND0, 0, 0);
wd_siz(WIND0, wndxsiz, wndysiz);
wd_src_pos(WIND0, WD_DIRPOS, 0, WD_DIRPOS, 0);
wd_src_check(WIND0, WD_SIGNAL, 0, WD_SIGNAL, 1);
wd_cntrl(WIND0, WD_ON);
}
int
setLateral(int flag, MENU *mp, char *astr, VLIST *vlp, int *tvadd)
{
switch(lateral) {
case 1:
thsGrid = bi16grid;
numTarg = 40;
break;
case 2:
thsGrid = lf16grid;
numTarg = 20;
break;
case 3:
thsGrid = rt16grid;
numTarg = 20;
break;
}
trlcntr = -1;
stmerr = 0;
nTrials = -1;
nBlocks = -1;
return(0);
}
int
resetBlocks(int flag, MENU *mp, char *astr, VLIST *vlp, int *tvadd)
{
trlcntr = -1;
stmerr = 0;
nTrials = -1;
nBlocks = -1;
return(0);
}
/*
* statelist menu
*/
VLIST state_vl[] = {
"win_siz", &wndsiz, NP, NP, 0, ME_DEC,
"range", &range, NP, resetBlocks, ME_AFT, ME_DEC,
"laterality", &lateral, NP, setLateral, ME_AFT, ME_DEC,
"use_2_eyes", &twoEyes, NP, resetBlocks, ME_AFT, ME_DEC,
"num_blocks", &blockTot, NP, resetBlocks, ME_AFT, ME_DEC,
NS,
};
char hm_sv_vl[]= "
win_siz: target window size in rex units [50]
range: 1 = 5 deg, 2 = 10 deg 3 = 15 deg 4 = 20 deg [2]
laterality: 1 is bilateral, 2 is left only, 3 is right only [1]
use_2_eyes: 0 is calibrate eye only, 1 is calibrate eye and o-eye
num_blocks: number of times each set of targets is presented [5]
";
RTVAR rtvars[] = {
{"number of trials", &nTrials},
{"blocks completed", &nBlocks},
{"block trials to go", &trlcntr},
{"block errors", &stmerr},
{"", 0},
};
/* tests for eye position have been commented out
* so I can test the code with out using a subject
* To use this code with subjects, uncomment the lines
* the test eyeflag and comment out or remove the
* "to eye1in" and "to oeye1n" lines
*/
%%
id 100
restart rinitf
main_set {
status ON
begin first:
to chkblk
chkblk:
to done on 1 % checkBlock
to disabl on 0 % checkBlock
done:
do sayDone()
to disabl
disabl:
to enable on -PSTOP & softswitch
enable:
code ENABLECD
do pre_post(0, 0)
to pckfix
pckfix:
do pick_targ_location()
to winset
winset:
do set_wnd()
to sdOn
sdOn:
do sd_set(1)
to setfpPos
setfpPos:
do Pda_set_2(&dax, &fpx, &day, &fpy)
to awnopn
awnopn:
do awind(OPEN_W)
to fpon
fpon:
code FPONCD
rl 10
do dio_on(LED1)
to chkeye
/*
time 1000
to chkeye on +SF_ONSET & sacflags
to error
*/
chkeye:
time 100
rl 20
to eyein
/*
to eyein on +SF_GOOD & sacflags
*/
eyein:
do sd_set(0)
rl 30
time 200
to blinkOn
blinkOn:
do dio_off(LED1)
time 200
to error on +WD0_XY & eyeflag
to blinkOff
blinkOff:
do dio_on(LED1)
time 200
to error on +WD0_XY & eyeflag
to sveye
sveye:
do saveEye()
to closew
closew:
do awind(CLOSE_W)
to rewon
rewon:
code REWCD
dio_on(REW)
rl 15
time 20
to rewoff
rewoff:
dio_off(REW)
rl 5
time 200
to correct
correct:
do score(YES)
to fpoff
fpoff:
code FPOFFCD /* drop the fixoff code */
do dio_off(LED1)
rl 0
time 100
to first
error:
code ERR1CD
do awind(CANCEL_W)
to cancel
cancel:
do dio_off(LED1)
rl 0
to coderr
coderr:
do mistake()
to wrong
wrong:
do score(NO)
time 5000
to first
}
| D |
import std.stdio;
import std.math;
import std.format;
import imageformats;
enum ErrorNoArgs = "No arguments provided";
enum InfoText = "rendercmp (options) <ground truth image> <images to compare...>
Similarity is dervived through the similarity between the noise and the ground truth on the RGB channels, as well an CIE algorithm generated grayscale luminance channel.
Check the source to see the formular used.
The score is based on the average similarity across all the tests.
Notes:
It's recommended to compare bitmap (BMP) or Targa (TGA) images, as they have little to no compression artifacts.
Only 8-bit-per-channel image files are supported.
Options:
--help | Displays this help page
Supported image formats:
BMP
TGA
PNG
JPEG
";
enum ResultsText = "=====Results=====
Similarity R: %s %%
Similarity G: %s %%
Similarity B: %s %%
Similarity Grayscale: %s %%
Average: %s %%
Score (0-100): %d";
/**
The final score
*/
struct Score {
double percRed = 0;
double percGreen = 0;
double percBlue = 0;
double percGrayscale = 0;
double avgPerc = 0;
int score;
void genScore() {
percRed = 1-(percRed/255);
percGreen = 1-(percGreen/255);
percBlue = 1-(percBlue/255);
percGrayscale = 1-(percGrayscale/255);
avgPerc = ((percRed+percGreen+percBlue+percGrayscale)/4.0);
score = cast(int)(cast(double)avgPerc*100.0);
}
string toString() {
return ResultsText.format(
(percRed*100.0),
(percGreen*100.0),
(percBlue*100.0),
(percGrayscale*100.0),
(avgPerc*100.0),
score);
}
}
struct Pixel {
ubyte red;
ubyte green;
ubyte blue;
/**
Returns the CIE luminance function output for this pixel's reg, green and blue channel
*/
ubyte grayscale() {
return cast(ubyte)(
0.2126 * red +
0.7152 * green +
0.0722 * blue + 0.5
);
}
/**
Returns an array of the difference in noise values
*/
ubyte[4] diff(Pixel other) {
return [
noiseDiff(red, other.red),
noiseDiff(green, other.green),
noiseDiff(blue, other.blue),
noiseDiff(grayscale, other.grayscale)
];
}
}
void main(string[] args_v)
{
string[] args = args_v[1..$];
if (args.length == 0) {
writeln(ErrorNoArgs);
writeln(InfoText);
return;
}
string[] files;
foreach(arg; args) {
switch(arg) {
case "--help":
writeln(InfoText);
return;
default:
files ~= arg;
break;
}
}
IFImage truth = read_image(files[0]);
foreach(i; 1..files.length) {
IFImage data = read_image(files[i]);
Score scoreImage = scoreImage(truth, data);
writeln("\nfile=%s\n".format(files[i]), scoreImage.toString());
}
}
/**
Compare ground truth against data
*/
Score scoreImage(IFImage truth, IFImage data) {
if (truth.w != data.w) throw new Exception("Width and/or height does not match!");
if (truth.h != data.h) throw new Exception("Width and/or height does not match!");
if (truth.c != data.c) throw new Exception("Color format does not match!");
if (truth.c < 3) throw new Exception("Color format not RGB or RGBA");
Score score;
Pixel[] truthImage = buildPixelMap(truth.pixels, cast(size_t)truth.c);
Pixel[] dataImage = buildPixelMap(data.pixels, cast(size_t)data.c);
ubyte[] noiseMap = buildNoiseMap(truthImage, dataImage);
foreach(i; 0..noiseMap.length/4) {
size_t ix = i*4;
score.percRed += noiseMap[ix];
score.avgPerc += noiseMap[ix++];
score.percGreen += noiseMap[ix];
score.avgPerc += noiseMap[ix++];
score.percBlue += noiseMap[ix];
score.avgPerc += noiseMap[ix++];
score.percGrayscale += noiseMap[ix];
score.avgPerc += noiseMap[ix++];
}
score.percRed /= truthImage.length;
score.percGreen /= truthImage.length;
score.percBlue /= truthImage.length;
score.percGrayscale /= truthImage.length;
score.genScore();
return score;
}
Pixel[] buildPixelMap(ubyte[] data, size_t colors) {
size_t len = colors == 4 ? data.length-(data.length/4) : 0;
Pixel[] pixdata = new Pixel[len];
size_t i = 0;
do {
pixdata[i/colors] = Pixel(data[i++], data[i++], data[i++]);
if (colors == 4) i++;
} while(i < data.length);
return pixdata;
}
ubyte[] buildNoiseMap(Pixel[] truth, Pixel[] data) {
ubyte[] noiseMap = new ubyte[truth.length*4];
foreach(i, pixel; truth) {
noiseMap[i*4..(i*4)+4] = pixel.diff(data[i]);
}
return noiseMap;
}
/**
Gets the noise difference between the ground truth and the test data
*/
ubyte noiseDiff(ubyte truth, ubyte data) {
return cast(ubyte)(data-truth);
} | D |
module templates_more_9;
// The general definition
int sum(int last)() {
return last + sum!(last - 1)();
}
// The special definition for zero
int sum(int last : 0)() {
return 0;
}
import std.stdio;
void main() {
writeln(sum!4());
}
| D |
instance BAU_982_Grimbald(Npc_Default)
{
name[0] = "Grimbald";
guild = GIL_NONE;
id = 982;
voice = 7;
flags = 0;
npcType = npctype_main;
aivar[AIV_ToughGuy] = TRUE;
B_SetAttributesToChapter(self,5);
level = 1;
fight_tactic = FAI_HUMAN_MASTER;
EquipItem(self,ItMw_1H_Sword_L_03);
EquipItem(self,ItRw_Sld_Bow);
CreateInvItems(self,ItRw_Arrow,10);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Psionic",Face_B_Normal_Kirgo,BodyTex_B,ItAr_HuntArmor_H_NPC);
Mdl_SetModelFatness(self,2);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,70);
daily_routine = Rtn_Start_982;
};
func void Rtn_Start_982()
{
TA_Stand_Guarding(8,0,23,0,"NW_TROLLAREA_PATH_79");
TA_Stand_Guarding(23,0,8,0,"NW_TROLLAREA_PATH_79");
};
func void Rtn_Jagd_982()
{
TA_RunToWP(8,0,23,0,"NW_TROLLAREA_PATH_80");
TA_RunToWP(23,0,8,0,"NW_TROLLAREA_PATH_80");
};
func void Rtn_JagdOver_982()
{
TA_Stand_Guarding(8,0,23,0,"NW_TROLLAREA_PATH_79");
TA_Stand_Guarding(23,0,8,0,"NW_TROLLAREA_PATH_79");
};
func void rtn_orcatcbegan_982()
{
TA_Stand_Guarding(6,55,20,30,"NW_HUNTERCAMP_GRIMBALD");
TA_Stand_Guarding(20,30,6,55,"NW_HUNTERCAMP_GRIMBALD");
};
func void rtn_campon_982()
{
TA_Smalltalk(9,0,23,0,"NW_BIGFARM_CAMPON_HUN_07");
TA_Smalltalk(23,0,9,0,"NW_BIGFARM_CAMPON_HUN_07");
};
func void rtn_inbattle_982()
{
ta_bigfight(8,0,22,0,"NW_BIGFIGHT_8767");
ta_bigfight(22,0,8,0,"NW_BIGFIGHT_8767");
};
| D |
/Users/luoguochun/privt/proj/coding-blog/.demo/rust-lib/mini-redis/target/debug/build/serde_json-7b2af4aeae71571e/build_script_build-7b2af4aeae71571e: /Users/luoguochun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.60/build.rs
/Users/luoguochun/privt/proj/coding-blog/.demo/rust-lib/mini-redis/target/debug/build/serde_json-7b2af4aeae71571e/build_script_build-7b2af4aeae71571e.d: /Users/luoguochun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.60/build.rs
/Users/luoguochun/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/serde_json-1.0.60/build.rs:
| D |
/Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker.o : /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/Constraint.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintDescription.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintItem.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintMaker.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintRelation.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/Debugging.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/EdgeInsets.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/LayoutConstraint.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/SnapKit.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/View+SnapKit.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ViewController+SnapKit.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker~partial.swiftmodule : /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/Constraint.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintDescription.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintItem.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintMaker.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintRelation.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/Debugging.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/EdgeInsets.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/LayoutConstraint.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/SnapKit.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/View+SnapKit.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ViewController+SnapKit.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMaker~partial.swiftdoc : /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/Constraint.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintDescription.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintItem.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintMaker.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ConstraintRelation.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/Debugging.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/EdgeInsets.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/LayoutConstraint.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/SnapKit.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/View+SnapKit.swift /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/SnapKit/Source/ViewController+SnapKit.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/atyun-monitor/Desktop/Swift/DanTangFromQuanzai/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
| D |
/*
* Finds Pythagorean triplets with a user defined sum
* Edited for euler 39
* Copyright 2012 James Otten <james_otten@lavabit.com>
*/
import std.stdio;
int numberPythagoreanTriplets(int p) {
int ret;
for(int i = 1; i < p - 2; i++) //Each side must be at least 1
for(int j = i; j < p - 2; j++)
if(i^^2 + j^^2 == (p - i - j)^^2)
ret++;
return ret;
}
//This is what this program used to do
void printPythagoreanTriplets(int input) {
for(int i = 1; i < input - 2; i++) //Each side must be at least 1
for(int j = i; j < input - 2; j++)
if(i^^2 + j^^2 == (input - i - j)^^2)
writefln("a=%d, b=%d, c=%d", i, j, input - i - j);
}
unittest {
assert(numberPythagoreanTriplets(120) == 3, "numberPythagoreanTriplets() failed euler example");
}
void main() {
int max = 3, maxIndex = 3, temp;
for(int i = maxIndex; i <= 1000; i++)
if((temp = numberPythagoreanTriplets(i)) > max) {
max = temp;
maxIndex = i;
}
writeln("39: ", maxIndex);
}
| D |
INSTANCE Info_Mod_Aaron_Fake_DoorIn (C_INFO)
{
npc = Mod_1858_KDF_Aaron_PAT;
nr = 1;
condition = Info_Mod_Aaron_Fake_DoorIn_Condition;
information = Info_Mod_Aaron_Fake_DoorIn_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Mod_Aaron_Fake_DoorIn_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Aaron_Fake_DoorIn_Info()
{
AI_Output(self, hero, "Info_Mod_Aaron_Fake_DoorIn_11_00"); //Los, treten wir der Hexenkönigin in den Hintern!
AI_StopProcessInfos (self);
B_StartOtherRoutine (self, "FOLLOW");
};
INSTANCE Info_Mod_Aaron_Fake_EXIT (C_INFO)
{
npc = Mod_1858_KDF_Aaron_PAT;
nr = 1;
condition = Info_Mod_Aaron_Fake_EXIT_Condition;
information = Info_Mod_Aaron_Fake_EXIT_Info;
permanent = 1;
important = 0;
description = DIALOG_ENDE;
};
FUNC INT Info_Mod_Aaron_Fake_EXIT_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Aaron_Fake_EXIT_Info()
{
AI_StopProcessInfos (self);
}; | D |
module util.log;
import std.stdio;
import std.file;
import std.string;
import std.datetime;
import std.format;
private {
__gshared File log;
__gshared bool isLogging = true;
}
public:
enum Level {
success = "success",
event = "event",
warning = "warning",
error = "error",
update = "update",
user = "user",
}
static this() {
log.open("log/log.html", "w");
WriteHtmlHeader();
}
static ~this() {
WriteHtmlFooter;
Flush();
log.close();
}
void SetLogFilename(string filename) {
log.close();
log.open(filename, "w");
WriteHtmlHeader();
}
string GetFilename() {
return log.name;
}
void Log()() {
writeln();
if(isLogging) log.writeln();
}
void Log(Level, T...)(Level level, T t) {
writeln(t);
if(isLogging) log.writeln("<p class=", level, ">", CurrentTime(),t,"</p>");
}
void LogTag(Level, Fmt, T...)(Level level, Fmt fmt, T t){
writeln(t);
if(isLogging) log.writeln("<",fmt," class=", level, ">",t,"</",fmt,">");
}
void EnableLogging(bool logging) {
isLogging = logging;
}
bool IsLogging() {
return isLogging;
}
void Flush() {
std.stdio.stdout.flush();
log.flush();
}
void WriteHtmlHeader(){
log.writeln("<!DOCTYPE html>");
log.writeln("<html>");
log.writeln("<head>");
log.writeln("<title>Log</title>");
log.writeln("<style>");
log.writeln("body{background-color: black;} p{margin-top: 5px; margin-bottom: 5px;} .success {color: lime;} .warning {color: orange;} .error {color: red;} .event {color: yellow;} .user{color: aqua;} .update {color: white;}");
log.writeln("</style>");
log.writeln("</head>");
log.writeln("<body>");
}
void WriteHtmlFooter() {
log.writeln("</body>");
log.writeln("</html>");
}
string CurrentTime() {
auto time = Clock.currTime;
return format("(%s/%s/%s %s:%s:%s) - ", time.day, cast(int)time.month, time.year, time.hour, time.minute, time.second);
} | D |
/Users/Mandy_Cho/Documents/GetSwifty/Memorari/DerivedData/Memorari/Build/Intermediates/Memorari.build/Debug-iphonesimulator/Memorari.build/Objects-normal/x86_64/Person.o : /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/PersonCell.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/ViewController.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/Person.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/Mandy_Cho/Documents/GetSwifty/Memorari/DerivedData/Memorari/Build/Intermediates/Memorari.build/Debug-iphonesimulator/Memorari.build/Objects-normal/x86_64/Person~partial.swiftmodule : /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/PersonCell.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/ViewController.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/Person.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/Mandy_Cho/Documents/GetSwifty/Memorari/DerivedData/Memorari/Build/Intermediates/Memorari.build/Debug-iphonesimulator/Memorari.build/Objects-normal/x86_64/Person~partial.swiftdoc : /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/PersonCell.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/ViewController.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/Person.swift /Users/Mandy_Cho/Documents/GetSwifty/Memorari/Memorari/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
| D |
module engine.camera_control;
import core.camera;
import core.types;
import core.aabb;
import core.dbg;
import engine.scene_object;
import engine.imgui;
import math.funcs;
import std.math;
immutable CamFront = vec3(0.0f, 0.0f, 1.0f);
immutable CamRight = vec3(1.0f, 0.0f, 0.0f);
immutable CamUp = vec3(0.0f, 1.0f, 0.0f);
auto length2(T)(T a)
{
return dot(a,a);
}
// Shamelessly copied from GLM <glm/gtx/quaternion.inl>
quat rotation(ref const(vec3) orig, ref const(vec3) dest)
{
alias T = float;
T cosTheta = dot(orig, dest);
tvec3!(T) rotationAxis;
if(cosTheta >= cast(T)1 - T.epsilon)
return quat();
if(cosTheta < cast(T) -1 + T.epsilon)
{
// special case when vectors in opposite directions :
// there is no "ideal" rotation axis
// So guess one; any will do as long as it's perpendicular to start
// This implementation favors a rotation around the Up axis (Y),
// since it's often what you want to do.
rotationAxis = cross(tvec3!(T)(0, 0, 1), orig);
if(length2(rotationAxis) < T.epsilon) // bad luck, they were parallel, try again!
rotationAxis = cross(tvec3!(T)(1, 0, 0), orig);
rotationAxis = rotationAxis.normalized;
return quat.fromAxis(rotationAxis, cast(T)PI);
}
// Implementation from Stan Melax's Game Programming Gems 1 article
rotationAxis = cross(orig, dest);
T s = sqrt((cast(T)1 + cosTheta) * cast(T)2);
T invs = cast(T)1 / s;
return quat(
s * cast(T)0.5,
rotationAxis.x * invs,
rotationAxis.y * invs,
rotationAxis.z * invs);
}
class CameraController
{
public:
void zoomIn(float dzoom) { zoomLevel_ += dzoom; }
void setZoom(float zoom) { zoomLevel_ = zoom; }
//
void rotate(float dTheta, float dPhi) {
theta_ += dTheta;
phi_ += dPhi;
}
// dx, dy in clip space
void pan(float dx, float dy, float dz)
{
// dx, dy to camera space
float panFactor = radius_;
const vec3 look = toCartesian().normalized();
const vec3 worldUp = vec3(0.0f, 1.0f, 0.0f);
const vec3 right = cross(look, worldUp);
const vec3 up = cross(look, right);
target_ = target_ + (right * dx * panFactor) + (up * dy * panFactor);
radius_ -= dz*radius_;
}
//
void lookAt(vec3 lookAt) { target_ = lookAt; }
void lookAt(float x, float y, float z) { target_ = vec3(x, y, z); }
void lookDistance(float lookDist) { radius_ = lookDist; }
void setAspectRatio(float aspect_ratio) { aspectRatio_ = aspect_ratio; }
void setFieldOfView(float fov) { fov_ = fov; }
void setNearFarPlanes(float nearPlane, float farPlane) {
nearPlane_ = nearPlane;
farPlane_ = farPlane;
}
//
Camera getCamera() const {
Camera cam;
cam.viewMatrix = getLookAt();
cam.invViewMatrix = cam.viewMatrix.inverse;
cam.projMatrix = mat4.scaling(vec3(zoomLevel_, zoomLevel_, 1.0f)) *
mat4.perspective(radians(fov_), aspectRatio_, nearPlane_,
farPlane_);
cam.wEye = (cam.invViewMatrix * vec4(0.0f, 0.0f, 0.0f, 1.0f)).xyz;
return cam;
}
mat4 getLookAt() const {
debugMessage("toCartesian=%s", toCartesian());
debugMessage("arcballRotation=%s, tmpArcballRotation=%s", arcballRotation, tmpArcballRotation);
return mat4.lookAt(target_ + toCartesian(), target_, CamUp) *
cast(mat4)(arcballRotation * tmpArcballRotation);
}
vec3 toCartesian() const pure nothrow @nogc {
float x = radius_ * sin(phi_) * sin(theta_);
float y = radius_ * cos(phi_);
float z = radius_ * sin(phi_) * cos(theta_);
return vec3(x, y, z);
}
void centerOnObject(ref const(AABB) objectBounds)
{
debugMessage("centerOnObject %s", objectBounds);
import std.algorithm.comparison : max;
auto size = max(objectBounds.width, objectBounds.height, objectBounds.depth);
auto cx = (objectBounds.xmax + objectBounds.xmin) / 2.0f;
auto cy = (objectBounds.ymax + objectBounds.ymin) / 2.0f;
auto cz = (objectBounds.zmax + objectBounds.zmin) / 2.0f;
const float fov = 45.0f;
float camDist = (0.5f * size) / tan(0.5f * radians(fov));
lookAt(cx, cy, cz);
lookDistance(camDist);
setNearFarPlanes(0.1f * camDist, 10.0f * camDist);
setFieldOfView(fov);
arcballRotation = quat.identity;
debugMessage("near %s far %s", 0.5f * camDist, 2.0f * camDist);
}
void rotateArcball(ref const(mat4) objectToWorld, int screenWidth,
int screenHeight, int mouseX, int mouseY)
{
auto viewMat = getLookAt();
if (mouseX != mouseDownX || mouseY != mouseDownY) {
vec3 va =
getArcballVector(screenWidth, screenHeight, mouseDownX, mouseDownY);
vec3 vb =
getArcballVector(screenWidth, screenHeight, mouseX, mouseY);
/*float angle = std::acos(glm::min(1.0f, glm::dot(va, vb)));
vec3 axis_in_camera_coord = glm::cross(va, vb);
mat3 camera2world =
glm::inverse(mat3(viewMat));
vec3 axis_in_object_coord = camera2object * axis_in_camera_coord;*/
tmpArcballRotation = rotation(va, vb); // rotation between va and vb
}
else {
// Commit rotation
arcballRotation *= tmpArcballRotation;
tmpArcballRotation = quat.identity;
}
}
vec3 getArcballVector(int sw, int sh, int x, int y) const {
vec3 P =
vec3(1.0 * x / cast(float)sw * 2 - 1.0, 1.0 * y / cast(float)sh * 2 - 1.0, 0);
P.y = -P.y;
float OP_squared = P.x * P.x + P.y * P.y;
if (OP_squared <= 1)
P.z = sqrt(1 - OP_squared);
else
P = P.normalized();
return P;
}
enum CameraMode { Idle, Panning, Rotating }
bool onCameraGUI(int mouseX, int mouseY, int screenW, int screenH,
ref Camera inOutCam)
{
bool handled = false;
// CTRL and SHIFT
/*bool ctrl_down = igIsKeyDown(KEY_LEFT_CONTROL) ||
igIsKeyDown(KEY_RIGHT_CONTROL);
bool shift_down = igIsKeyDown(KEY_LEFT_SHIFT) ||
igIsKeyDown(KEY_RIGHT_SHIFT);*/
bool ctrl_down = false;
bool shift_down = false;
setAspectRatio(cast(float)screenW / cast(float)screenH);
/*auto sceneObjectComponents =
scene.getComponentManager!SceneObjectComponents();
auto selectedObj = sceneObjectComponents.get(selectedObject);
// Camera focus on object
if (!ctrl_down && igIsKeyDown(KEY_Z)) {
AG_DEBUG("Camera focus on {}", selectedObject);
if (selectedObj)
focusOnObject(scene, *selectedObj);
handled = true;
}
// Must hold CTRL for camera
else*/
if (!ctrl_down) {
handled = false;
} else {
// Camera state machine
if (igIsMouseDown(0) && mode != CameraMode.Rotating) {
lastMouseX = mouseDownX = mouseX;
lastMouseY = mouseDownY = mouseY;
mode = CameraMode.Rotating;
} else if (igIsMouseDown(2) && mode != CameraMode.Panning) {
lastMouseX = mouseDownX = mouseX;
lastMouseY = mouseDownY = mouseY;
mode = CameraMode.Panning;
} else if (!igIsMouseDown(0) && !igIsMouseDown(2)) {
mode = CameraMode.Idle;
}
// Delta w.r.t. last frame
auto mouseDeltaX = cast(float)(mouseX - lastMouseX);
auto mouseDeltaY = cast(float)(mouseY - lastMouseY);
// Delta w.r.t. last click
auto mouseDragVecX = cast(float)(mouseX - mouseDownX);
auto mouseDragVecY = cast(float)(mouseY - mouseDownY);
const auto panFactor = 1.0f / screenW;
const auto zoomFactor = 0.01f;
const auto rotateFactor = 0.001f;
// Rotating & panning
if (mode == CameraMode.Rotating) {
if (shift_down) {
// Shift down => arcball rotation around currently selected object
/*if (selectedObj)
{
debugMessage("Camera rotating %s,%s (arcball around object)", mouseDeltaX,
mouseDeltaY);
rotateArcball(selectedObj.worldTransform, screenW, screenH, mouseX, mouseY);
}*/
} else {
debugMessage("Camera rotating %s,%s (camera orientation)", mouseDeltaX,
mouseDeltaY);
rotate(-mouseDeltaX * rotateFactor, -mouseDeltaY * rotateFactor );
}
} else if (mode == CameraMode.Panning) {
debugMessage("Camera panning %s,%s", mouseDeltaX, mouseDeltaY);
pan(mouseDeltaX * panFactor, -mouseDeltaY * panFactor * aspectRatio_, 0.0f);
}
// Scrolling
float scroll = igGetIO().MouseWheel;
if (scroll != 0.0f) {
debugMessage("Camera scrolling %s", scroll);
pan(0.0f, 0.0f, scroll * zoomFactor);
}
igResetMouseDragDelta(0);
igResetMouseDragDelta(2);
lastMouseX = mouseX;
lastMouseY = mouseY;
handled = true;
}
inOutCam = getCamera();
return handled;
}
void focusOnObject(ref SceneObject sceneObject)
{
debugMessage("focusOnObject: %s", sceneObject);
centerOnObject(sceneObject.worldBounds);
}
private:
float fov_ = 45.0f;
float aspectRatio_ = 1.0f; // should be screenWidth / screenHeight
float nearPlane_ = 0.001f;
float farPlane_ = 10.0f;
float zoomLevel_ = 1.0f;
float radius_ = 1.0f;
float theta_ = 0.0f;
float phi_ = PI_2;
vec3 target_ = vec3(0.0f, 0.0f, 0.0f);
quat tmpArcballRotation = quat.identity;
quat arcballRotation = quat.identity;
int mouseDownX = 0;
int mouseDownY = 0;
int lastMouseX = 0;
int lastMouseY = 0;
CameraMode mode;
}
| D |
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintPriorityTarget.o : /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintConfig.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Debugging.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintItem.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintRelation.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintDescription.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMaker.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Typealiases.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintInsets.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Constraint.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/LayoutConstraint.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintView.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintPriority.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/Zhongli/Desktop/NewsDemo/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintPriorityTarget~partial.swiftmodule : /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintConfig.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Debugging.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintItem.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintRelation.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintDescription.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMaker.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Typealiases.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintInsets.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Constraint.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/LayoutConstraint.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintView.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintPriority.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/Zhongli/Desktop/NewsDemo/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintPriorityTarget~partial.swiftdoc : /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintConfig.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Debugging.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintItem.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintRelation.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintDescription.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMaker.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Typealiases.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintInsets.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/Constraint.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/LayoutConstraint.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintView.swift /Users/Zhongli/Desktop/NewsDemo/Pods/SnapKit/Source/ConstraintPriority.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/Zhongli/Desktop/NewsDemo/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap
| D |
/** Arbitrary-precision ('bignum') arithmetic
*
* Performance is optimized for numbers below ~1000 decimal digits.
* For X86 machines, highly optimised assembly routines are used.
*
* The following algorithms are currently implemented:
* $(UL
* $(LI Karatsuba multiplication)
* $(LI Squaring is optimized independently of multiplication)
* $(LI Divide-and-conquer division)
* $(LI Binary exponentiation)
* )
*
* For very large numbers, consider using the $(WEB gmplib.org, GMP library) instead.
*
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Don Clugston
* Source: $(PHOBOSSRC std/_bigint.d)
*/
/* Copyright Don Clugston 2008 - 2010.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module std.bigint;
private import std.internal.math.biguintcore;
private import std.format : FormatSpec, FormatException;
private import std.traits;
/** A struct representing an arbitrary precision integer
*
* All arithmetic operations are supported, except
* unsigned shift right (>>>). Logical operations are not currently supported.
*
* BigInt implements value semantics using copy-on-write. This means that
* assignment is cheap, but operations such as x++ will cause heap
* allocation. (But note that for most bigint operations, heap allocation is
* inevitable anyway).
Example:
----------------------------------------------------
BigInt a = "9588669891916142";
BigInt b = "7452469135154800";
auto c = a * b;
assert(c == BigInt("71459266416693160362545788781600"));
auto d = b * a;
assert(d == BigInt("71459266416693160362545788781600"));
assert(d == c);
d = c * BigInt("794628672112");
assert(d == BigInt("56783581982794522489042432639320434378739200"));
auto e = c + d;
assert(e == BigInt("56783581982865981755459125799682980167520800"));
auto f = d + c;
assert(f == e);
auto g = f - c;
assert(g == d);
g = f - d;
assert(g == c);
e = 12345678;
g = c + e;
auto h = g / b;
auto i = g % b;
assert(h == a);
assert(i == e);
BigInt j = "-0x9A56_57f4_7B83_AB78";
j ^^= 11;
----------------------------------------------------
*
*/
struct BigInt
{
private:
BigUint data; // BigInt adds signed arithmetic to BigUint.
bool sign = false;
public:
/// Construct a BigInt from a decimal or hexadecimal string.
/// The number must be in the form of a D decimal or hex literal:
/// It may have a leading + or - sign; followed by "0x" if hexadecimal.
/// Underscores are permitted.
/// BUG: Should throw a IllegalArgumentException/ConvError if invalid character found
this(T : const(char)[] )(T s) pure
{
bool neg = false;
if (s[0] == '-') {
neg = true;
s = s[1..$];
} else if (s[0] == '+') {
s = s[1..$];
}
data = 0UL;
auto q = 0X3;
bool ok;
assert(isZero());
if (s.length > 2 && (s[0..2] == "0x" || s[0..2] == "0X"))
{
ok = data.fromHexString(s[2..$]);
} else {
ok = data.fromDecimalString(s);
}
assert(ok);
if (isZero())
neg = false;
sign = neg;
}
///
this(T)(T x) pure if (isIntegral!T)
{
data = data.init; // @@@: Workaround for compiler bug
opAssign(x);
}
///
BigInt opAssign(T)(T x) pure if (isIntegral!T)
{
data = cast(ulong)absUnsign(x);
sign = (x < 0);
return this;
}
///
BigInt opAssign(T:BigInt)(T x) pure
{
data = x.data;
sign = x.sign;
return this;
}
// BigInt op= integer
BigInt opOpAssign(string op, T)(T y) pure
if ((op=="+" || op=="-" || op=="*" || op=="/" || op=="%"
|| op==">>" || op=="<<" || op=="^^") && isIntegral!T)
{
ulong u = absUnsign(y);
static if (op=="+")
{
data = BigUint.addOrSubInt(data, u, sign != (y<0), sign);
}
else static if (op=="-")
{
data = BigUint.addOrSubInt(data, u, sign == (y<0), sign);
}
else static if (op=="*")
{
if (y == 0) {
sign = false;
data = 0UL;
} else {
sign = ( sign != (y<0) );
data = BigUint.mulInt(data, u);
}
}
else static if (op=="/")
{
assert(y!=0, "Division by zero");
static assert(!is(T == long) && !is(T == ulong));
data = BigUint.divInt(data, cast(uint)u);
sign = data.isZero() ? false : sign ^ (y < 0);
}
else static if (op=="%")
{
assert(y!=0, "Division by zero");
static if (is(immutable(T) == immutable(long)) || is( immutable(T) == immutable(ulong) ))
{
this %= BigInt(y);
}
else
{
data = cast(ulong)BigUint.modInt(data, cast(uint)u);
}
// x%y always has the same sign as x.
// This is not the same as mathematical mod.
}
else static if (op==">>" || op=="<<")
{
// Do a left shift if y>0 and <<, or
// if y<0 and >>; else do a right shift.
if (y == 0)
return this;
else if ((y > 0) == (op=="<<"))
{
// Sign never changes during left shift
data = data.opShl(u);
} else
{
data = data.opShr(u);
if (data.isZero())
sign = false;
}
}
else static if (op=="^^")
{
sign = (y & 1) ? sign : false;
data = BigUint.pow(data, u);
}
else static assert(0, "BigInt " ~ op[0..$-1] ~ "= " ~ T.stringof ~ " is not supported");
return this;
}
// BigInt op= BigInt
BigInt opOpAssign(string op, T)(T y) pure
if ((op=="+" || op== "-" || op=="*" || op=="/" || op=="%")
&& is (T: BigInt))
{
static if (op == "+")
{
data = BigUint.addOrSub(data, y.data, sign != y.sign, &sign);
}
else static if (op == "-")
{
data = BigUint.addOrSub(data, y.data, sign == y.sign, &sign);
}
else static if (op == "*")
{
data = BigUint.mul(data, y.data);
sign = isZero() ? false : sign ^ y.sign;
}
else static if (op == "/")
{
y.checkDivByZero();
if (!isZero())
{
data = BigUint.div(data, y.data);
sign = isZero() ? false : sign ^ y.sign;
}
}
else static if (op == "%")
{
y.checkDivByZero();
if (!isZero())
{
data = BigUint.mod(data, y.data);
// x%y always has the same sign as x.
if (isZero())
sign = false;
}
}
else static assert(0, "BigInt " ~ op[0..$-1] ~ "= " ~ T.stringof ~ " is not supported");
return this;
}
// BigInt op BigInt
BigInt opBinary(string op, T)(T y) pure const
if ((op=="+" || op == "*" || op=="-" || op=="/" || op=="%")
&& is (T: BigInt))
{
BigInt r = this;
return r.opOpAssign!(op)(y);
}
// BigInt op integer
BigInt opBinary(string op, T)(T y) pure const
if ((op=="+" || op == "*" || op=="-" || op=="/"
|| op==">>" || op=="<<" || op=="^^") && isIntegral!T)
{
BigInt r = this;
return r.opOpAssign!(op)(y);
}
//
int opBinary(string op, T : int)(T y) pure const
if (op == "%" && isIntegral!T)
{
assert(y!=0);
uint u = absUnsign(y);
int rem = BigUint.modInt(data, u);
// x%y always has the same sign as x.
// This is not the same as mathematical mod.
return sign ? -rem : rem;
}
// Commutative operators
BigInt opBinaryRight(string op, T)(T y) pure const
if ((op=="+" || op=="*") && isIntegral!T)
{
return opBinary!(op)(y);
}
// BigInt = integer op BigInt
BigInt opBinaryRight(string op, T)(T y) pure const
if (op == "-" && isIntegral!T)
{
ulong u = absUnsign(y);
BigInt r;
static if (op == "-")
{
r.sign = sign;
r.data = BigUint.addOrSubInt(data, u, sign == (y<0), r.sign);
r.negate();
}
return r;
}
// integer = integer op BigInt
T opBinaryRight(string op, T)(T x) pure const
if ((op=="%" || op=="/") && isIntegral!T)
{
static if (op == "%")
{
checkDivByZero();
// x%y always has the same sign as x.
if (data.ulongLength() > 1)
return x;
ulong u = absUnsign(x);
ulong rem = u % data.peekUlong(0);
// x%y always has the same sign as x.
return cast(T)((x<0) ? -rem : rem);
}
else static if (op == "/")
{
checkDivByZero();
if (data.ulongLength() > 1)
return 0;
return cast(T)(x / data.peekUlong(0));
}
}
// const unary operations
BigInt opUnary(string op)() pure const if (op=="+" || op=="-")
{
static if (op=="-")
{
BigInt r = this;
r.negate();
return r;
}
else static if (op=="+")
return this;
}
// non-const unary operations
BigInt opUnary(string op)() pure if (op=="++" || op=="--")
{
static if (op=="++")
{
data = BigUint.addOrSubInt(data, 1UL, sign, sign);
return this;
}
else static if (op=="--")
{
data = BigUint.addOrSubInt(data, 1UL, !sign, sign);
return this;
}
}
///
bool opEquals()(auto ref const BigInt y) const pure
{
return sign == y.sign && y.data == data;
}
///
bool opEquals(T)(T y) const pure if (isIntegral!T)
{
if (sign != (y<0))
return 0;
return data.opEquals(cast(ulong)absUnsign(y));
}
///
T opCast(T:bool)() pure const
{
return !isZero();
}
///
T opCast(T)() pure const if (is(Unqual!T == BigInt)) {
return this;
}
// Hack to make BigInt's typeinfo.compare work properly.
// Note that this must appear before the other opCmp overloads, otherwise
// DMD won't find it.
int opCmp(ref const BigInt y) const
{
// Simply redirect to the "real" opCmp implementation.
return this.opCmp!BigInt(y);
}
///
int opCmp(T)(T y) pure const if (isIntegral!T)
{
if (sign != (y<0) )
return sign ? -1 : 1;
int cmp = data.opCmp(cast(ulong)absUnsign(y));
return sign? -cmp: cmp;
}
///
int opCmp(T:BigInt)(const T y) pure const
{
if (sign!=y.sign)
return sign ? -1 : 1;
int cmp = data.opCmp(y.data);
return sign? -cmp: cmp;
}
/// Returns the value of this BigInt as a long,
/// or +- long.max if outside the representable range.
long toLong() pure const
{
return (sign ? -1 : 1) *
(data.ulongLength() == 1 && (data.peekUlong(0) <= sign+cast(ulong)(long.max)) // 1+long.max = |long.min|
? cast(long)(data.peekUlong(0))
: long.max);
}
/// Returns the value of this BigInt as an int,
/// or +- int.max if outside the representable range.
int toInt() pure const
{
return (sign ? -1 : 1) *
(data.uintLength() == 1 && (data.peekUint(0) <= sign+cast(uint)(int.max)) // 1+int.max = |int.min|
? cast(int)(data.peekUint(0))
: int.max);
}
/// Number of significant uints which are used in storing this number.
/// The absolute value of this BigInt is always < 2^^(32*uintLength)
@property size_t uintLength() pure const
{
return data.uintLength();
}
/// Number of significant ulongs which are used in storing this number.
/// The absolute value of this BigInt is always < 2^^(64*ulongLength)
@property size_t ulongLength() pure const
{
return data.ulongLength();
}
/** Convert the BigInt to string, passing it to 'sink'.
*
* $(TABLE The output format is controlled via formatString:
* $(TR $(TD "d") $(TD Decimal))
* $(TR $(TD "x") $(TD Hexadecimal, lower case))
* $(TR $(TD "X") $(TD Hexadecimal, upper case))
* $(TR $(TD "s") $(TD Default formatting (same as "d") ))
* $(TR $(TD null) $(TD Default formatting (same as "d") ))
* )
*/
void toString(scope void delegate(const (char)[]) sink, string formatString) const
{
auto f = FormatSpec!char(formatString);
f.writeUpToNextSpec(sink);
toString(sink, f);
}
void toString(scope void delegate(const(char)[]) sink, ref FormatSpec!char f) const
{
auto hex = (f.spec == 'x' || f.spec == 'X');
if (!(f.spec == 's' || f.spec == 'd' || hex))
throw new FormatException("Format specifier not understood: %" ~ f.spec);
char[] buff =
hex ? data.toHexString(0, '_', 0, f.flZero ? '0' : ' ')
: data.toDecimalString(0);
assert(buff.length > 0);
char signChar = isNegative() ? '-' : 0;
auto minw = buff.length + (signChar ? 1 : 0);
if (!hex && !signChar && (f.width == 0 || minw < f.width))
{
if (f.flPlus)
signChar = '+', ++minw;
else if (f.flSpace)
signChar = ' ', ++minw;
}
auto maxw = minw < f.width ? f.width : minw;
auto difw = maxw - minw;
if (!f.flDash && !f.flZero)
foreach (i; 0 .. difw)
sink(" ");
if (signChar)
sink((&signChar)[0..1]);
if (!f.flDash && f.flZero)
foreach (i; 0 .. difw)
sink("0");
sink(buff);
if (f.flDash)
foreach (i; 0 .. difw)
sink(" ");
}
/+
private:
/// Convert to a hexadecimal string, with an underscore every
/// 8 characters.
string toHex()
{
string buff = data.toHexString(1, '_');
if (isNegative())
buff[0] = '-';
else
buff = buff[1..$];
return buff;
}
+/
private:
void negate() pure nothrow @safe
{
if (!data.isZero())
sign = !sign;
}
bool isZero() pure const nothrow @safe
{
return data.isZero();
}
bool isNegative() pure const nothrow @safe
{
return sign;
}
// Generate a runtime error if division by zero occurs
void checkDivByZero() pure const @safe
{
if (isZero())
throw new Error("BigInt division by zero");
}
// Implement toHash so that BigInt works properly as an AA key.
size_t toHash() const @trusted nothrow
{
return data.toHash() + sign;
}
}
string toDecimalString(const(BigInt) x)
{
string outbuff="";
void sink(const(char)[] s) { outbuff ~= s; }
x.toString(&sink, "%d");
return outbuff;
}
string toHex(const(BigInt) x)
{
string outbuff="";
void sink(const(char)[] s) { outbuff ~= s; }
x.toString(&sink, "%x");
return outbuff;
}
// Returns the absolute value of x converted to the corresponding unsigned type
Unsigned!T absUnsign(T)(T x) if (isIntegral!T)
{
static if (isSigned!T)
{
import std.conv;
/* This returns the correct result even when x = T.min
* on two's complement machines because unsigned(T.min) = |T.min|
* even though -T.min = T.min.
*/
return unsigned((x < 0) ? -x : x);
}
else
{
return x;
}
}
unittest {
// Radix conversion
assert( toDecimalString(BigInt("-1_234_567_890_123_456_789"))
== "-1234567890123456789");
assert( toHex(BigInt("0x1234567890123456789")) == "123_45678901_23456789");
assert( toHex(BigInt("0x00000000000000000000000000000000000A234567890123456789"))
== "A23_45678901_23456789");
assert( toHex(BigInt("0x000_00_000000_000_000_000000000000_000000_")) == "0");
assert(BigInt(-0x12345678).toInt() == -0x12345678);
assert(BigInt(-0x12345678).toLong() == -0x12345678);
assert(BigInt(0x1234_5678_9ABC_5A5AL).ulongLength == 1);
assert(BigInt(0x1234_5678_9ABC_5A5AL).toLong() == 0x1234_5678_9ABC_5A5AL);
assert(BigInt(-0x1234_5678_9ABC_5A5AL).toLong() == -0x1234_5678_9ABC_5A5AL);
assert(BigInt(0xF234_5678_9ABC_5A5AL).toLong() == long.max);
assert(BigInt(-0x123456789ABCL).toInt() == -int.max);
char[] s1 = "123".dup; // bug 8164
assert(BigInt(s1) == 123);
char[] s2 = "0xABC".dup;
assert(BigInt(s2) == 2748);
assert((BigInt(-2) + BigInt(1)) == BigInt(-1));
BigInt a = ulong.max - 5;
auto b = -long.max % a;
assert( b == -long.max % (ulong.max - 5));
b = long.max / a;
assert( b == long.max /(ulong.max - 5));
assert(BigInt(1) - 1 == 0);
assert((-4) % BigInt(5) == -4); // bug 5928
assert(BigInt(-4) % BigInt(5) == -4);
assert(BigInt(2)/BigInt(-3) == BigInt(0)); // bug 8022
assert(BigInt("-1") > long.min); // bug 9548
}
unittest // Minimum signed value bug tests.
{
assert(BigInt("-0x8000000000000000") == BigInt(long.min));
assert(BigInt("-0x8000000000000000")+1 > BigInt(long.min));
assert(BigInt("-0x80000000") == BigInt(int.min));
assert(BigInt("-0x80000000")+1 > BigInt(int.min));
assert(BigInt(long.min).toLong() == long.min); // lossy toLong bug for long.min
assert(BigInt(int.min).toInt() == int.min); // lossy toInt bug for int.min
assert(BigInt(long.min).ulongLength == 1);
assert(BigInt(int.min).uintLength == 1); // cast/sign extend bug in opAssign
BigInt a;
a += int.min;
assert(a == BigInt(int.min));
a = int.min - BigInt(int.min);
assert(a == 0);
a = int.min;
assert(a == BigInt(int.min));
assert(int.min % (BigInt(int.min)-1) == int.min);
assert((BigInt(int.min)-1)%int.min == -1);
}
unittest // Recursive division, bug 5568
{
enum Z = 4843;
BigInt m = (BigInt(1) << (Z*8) ) - 1;
m -= (BigInt(1) << (Z*6)) - 1;
BigInt oldm = m;
BigInt a = (BigInt(1) << (Z*4) )-1;
BigInt b = m % a;
m /= a;
m *= a;
assert( m + b == oldm);
m = (BigInt(1) << (4846 + 4843) ) - 1;
a = (BigInt(1) << 4846 ) - 1;
b = (BigInt(1) << (4846*2 + 4843)) - 1;
BigInt c = (BigInt(1) << (4846*2 + 4843*2)) - 1;
BigInt w = c - b + a;
assert(w % m == 0);
// Bug 6819. ^^
BigInt z1 = BigInt(10)^^64;
BigInt w1 = BigInt(10)^^128;
assert(z1^^2 == w1);
BigInt z2 = BigInt(1)<<64;
BigInt w2 = BigInt(1)<<128;
assert(z2^^2 == w2);
// Bug 7993
BigInt n7793 = 10;
assert( n7793 / 1 == 10);
// Bug 7973
auto a7973 = 10_000_000_000_000_000;
const c7973 = 10_000_000_000_000_000;
immutable i7973 = 10_000_000_000_000_000;
BigInt v7973 = 2551700137;
v7973 %= a7973;
assert(v7973 == 2551700137);
v7973 %= c7973;
assert(v7973 == 2551700137);
v7973 %= i7973;
assert(v7973 == 2551700137);
// 8165
BigInt[2] a8165;
a8165[0] = a8165[1] = 1;
}
unittest
{
import std.array;
import std.format;
immutable string[][] table = [
/* fmt, +10 -10 */
["%d", "10", "-10"],
["%+d", "+10", "-10"],
["%-d", "10", "-10"],
["%+-d", "+10", "-10"],
["%4d", " 10", " -10"],
["%+4d", " +10", " -10"],
["%-4d", "10 ", "-10 "],
["%+-4d", "+10 ", "-10 "],
["%04d", "0010", "-010"],
["%+04d", "+010", "-010"],
["%-04d", "10 ", "-10 "],
["%+-04d", "+10 ", "-10 "],
["% 04d", " 010", "-010"],
["%+ 04d", "+010", "-010"],
["%- 04d", " 10 ", "-10 "],
["%+- 04d", "+10 ", "-10 "],
];
auto w1 = appender!(char[])();
auto w2 = appender!(char[])();
foreach (entry; table)
{
immutable fmt = entry[0];
formattedWrite(w1, fmt, BigInt(10));
formattedWrite(w2, fmt, 10);
assert(w1.data == w2.data);
assert(w1.data == entry[1]);
w1.clear();
w2.clear();
formattedWrite(w1, fmt, BigInt(-10));
formattedWrite(w2, fmt, -10);
assert(w1.data == w2.data);
assert(w1.data == entry[2]);
w1.clear();
w2.clear();
}
}
unittest
{
import std.array;
import std.format;
immutable string[][] table = [
/* fmt, +10 -10 */
["%X", "A", "-A"],
["%+X", "A", "-A"],
["%-X", "A", "-A"],
["%+-X", "A", "-A"],
["%4X", " A", " -A"],
["%+4X", " A", " -A"],
["%-4X", "A ", "-A "],
["%+-4X", "A ", "-A "],
["%04X", "000A", "-00A"],
["%+04X", "000A", "-00A"],
["%-04X", "A ", "-A "],
["%+-04X", "A ", "-A "],
["% 04X", "000A", "-00A"],
["%+ 04X", "000A", "-00A"],
["%- 04X", "A ", "-A "],
["%+- 04X", "A ", "-A "],
];
auto w1 = appender!(char[])();
auto w2 = appender!(char[])();
foreach (entry; table)
{
immutable fmt = entry[0];
formattedWrite(w1, fmt, BigInt(10));
formattedWrite(w2, fmt, 10);
assert(w1.data == w2.data); // Equal only positive BigInt
assert(w1.data == entry[1]);
w1.clear();
w2.clear();
formattedWrite(w1, fmt, BigInt(-10));
//formattedWrite(w2, fmt, -10);
//assert(w1.data == w2.data);
assert(w1.data == entry[2]);
w1.clear();
//w2.clear();
}
}
// 6448
unittest
{
import std.array;
import std.format;
auto w1 = appender!string();
auto w2 = appender!string();
int x = 100;
formattedWrite(w1, "%010d", x);
BigInt bx = x;
formattedWrite(w2, "%010d", bx);
assert(w1.data == w2.data);
//8011
BigInt y = -3;
++y;
assert(y.toLong() == -2);
y = 1;
--y;
assert(y.toLong() == 0);
--y;
assert(y.toLong() == -1);
--y;
assert(y.toLong() == -2);
}
unittest
{
import std.math:abs;
auto r = abs(BigInt(-1000)); // 6486
assert(r == 1000);
auto r2 = abs(const(BigInt)(-500)); // 11188
assert(r2 == 500);
auto r3 = abs(immutable(BigInt)(-733)); // 11188
assert(r3 == 733);
// opCast!bool
BigInt one = 1, zero;
assert(one && !zero);
}
unittest // 6850
{
pure long pureTest() {
BigInt a = 1;
BigInt b = 1336;
a += b;
return a.toLong();
}
assert(pureTest() == 1337);
}
unittest // 8435 & 10118
{
auto i = BigInt(100);
auto j = BigInt(100);
// Two separate BigInt instances representing same value should have same
// hash.
assert(typeid(i).getHash(&i) == typeid(j).getHash(&j));
assert(typeid(i).compare(&i, &j) == 0);
// BigInt AA keys should behave consistently.
int[BigInt] aa;
aa[BigInt(123)] = 123;
assert(BigInt(123) in aa);
aa[BigInt(123)] = 321;
assert(aa[BigInt(123)] == 321);
auto keys = aa.byKey;
assert(keys.front == BigInt(123));
keys.popFront();
assert(keys.empty);
}
unittest // 11148
{
void foo(BigInt) {}
const BigInt cbi = 3;
immutable BigInt ibi = 3;
assert(__traits(compiles, foo(cbi)));
assert(__traits(compiles, foo(ibi)));
import std.typetuple : TypeTuple;
import std.conv : to;
foreach (T1; TypeTuple!(BigInt, const(BigInt), immutable(BigInt)))
{
foreach (T2; TypeTuple!(BigInt, const(BigInt), immutable(BigInt)))
{
T1 t1 = 2;
T2 t2 = t1;
T2 t2_1 = to!T2(t1);
T2 t2_2 = cast(T2)t1;
assert(t2 == t1);
assert(t2 == 2);
assert(t2_1 == t1);
assert(t2_1 == 2);
assert(t2_2 == t1);
assert(t2_2 == 2);
}
}
BigInt n = 2;
n *= 2;
}
| D |
module dido.buffer.analysis;
import std.d.lexer;
class Analysis
{
this(string filename, string source)
{
_filename = filename;
_stringCache = StringCache(StringCache.defaultBucketCount);
}
void parse(string filemane, string source)
{
_tokens = getTokensForParser( cast(ubyte[]) source, LexerConfig(filemane, StringBehavior.source), &_stringCache);
}
private:
string _filename;
StringCache _stringCache;
const(Token)[] _tokens;
} | D |
/Users/nabil/Desktop/Vinci/PFE/MazaB4E/Build/Intermediates/Pods.build/Debug-iphonesimulator/Presentr.build/Objects-normal/x86_64/PresentrShadow.o : /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/Presentr+Equatable.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentationType.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/TransitionType.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/ModalSize.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/KeyboardTranslation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CrossDissolveAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverVerticalAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverHorizontalAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverVerticalFromTopAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/ModalCenterPosition.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrController.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/AlertViewController.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/Presentr.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/BackgroundView.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrShadow.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Target\ Support\ Files/Presentr/Presentr-umbrella.h /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Build/Intermediates/Pods.build/Debug-iphonesimulator/Presentr.build/unextended-module.modulemap
/Users/nabil/Desktop/Vinci/PFE/MazaB4E/Build/Intermediates/Pods.build/Debug-iphonesimulator/Presentr.build/Objects-normal/x86_64/PresentrShadow~partial.swiftmodule : /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/Presentr+Equatable.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentationType.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/TransitionType.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/ModalSize.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/KeyboardTranslation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CrossDissolveAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverVerticalAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverHorizontalAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverVerticalFromTopAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/ModalCenterPosition.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrController.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/AlertViewController.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/Presentr.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/BackgroundView.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrShadow.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Target\ Support\ Files/Presentr/Presentr-umbrella.h /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Build/Intermediates/Pods.build/Debug-iphonesimulator/Presentr.build/unextended-module.modulemap
/Users/nabil/Desktop/Vinci/PFE/MazaB4E/Build/Intermediates/Pods.build/Debug-iphonesimulator/Presentr.build/Objects-normal/x86_64/PresentrShadow~partial.swiftdoc : /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/Presentr+Equatable.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentationType.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/TransitionType.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/ModalSize.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/KeyboardTranslation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CrossDissolveAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverVerticalAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverHorizontalAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/CoverVerticalFromTopAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrAnimation.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/ModalCenterPosition.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrController.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/AlertViewController.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/Presentr.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/BackgroundView.swift /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Presentr/Presentr/PresentrShadow.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Pods/Target\ Support\ Files/Presentr/Presentr-umbrella.h /Users/nabil/Desktop/Vinci/PFE/MazaB4E/Build/Intermediates/Pods.build/Debug-iphonesimulator/Presentr.build/unextended-module.modulemap
| D |
/Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/DerivedData/Pick'n'Pay/Build/Intermediates.noindex/Pick'n'Pay.build/Debug-iphonesimulator/Pick'n'Pay.build/Objects-normal/x86_64/AppDelegate.o : /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/Data.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/AppDelegate.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/ProductsViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/ShoppingCartViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/CheckoutViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Item.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/DataController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/Payment2ViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/LoginPageViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/WelcomViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ConfirmationViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ProductInfoViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/RegisterViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/CategoriesViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/AddressViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ProductsViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/PaymentViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ShoppingCartViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/CheckoutViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Item+CoreDataProperties.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Product.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/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/DerivedData/Pick'n'Pay/Build/Intermediates.noindex/Pick'n'Pay.build/Debug-iphonesimulator/Pick'n'Pay.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/Data.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/AppDelegate.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/ProductsViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/ShoppingCartViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/CheckoutViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Item.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/DataController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/Payment2ViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/LoginPageViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/WelcomViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ConfirmationViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ProductInfoViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/RegisterViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/CategoriesViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/AddressViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ProductsViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/PaymentViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ShoppingCartViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/CheckoutViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Item+CoreDataProperties.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Product.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/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/DerivedData/Pick'n'Pay/Build/Intermediates.noindex/Pick'n'Pay.build/Debug-iphonesimulator/Pick'n'Pay.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/Data.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/AppDelegate.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/ProductsViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/ShoppingCartViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/CheckoutViewCell.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Item.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/DataController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/Payment2ViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/LoginPageViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/WelcomViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ConfirmationViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ProductInfoViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/RegisterViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/CategoriesViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/AddressViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ProductsViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/PaymentViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/ShoppingCartViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/TableViewImages/CheckoutViewController.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Item+CoreDataProperties.swift /Users/rss/Desktop/iOS-Shopping-App-master/Pick'n'Pay-swift3/Product.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/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
import std.stdio;
import std.c.stdio;
/******************************************/
struct S
{
int opStar() { return 7; }
}
void test1()
{
S s;
printf("%d\n", *s);
assert(*s == 7);
}
/******************************************/
void test2()
{
double[1][2] bar;
bar[0][0] = 1.0;
bar[1][0] = 2.0;
foo2(bar);
}
void foo2(T...)(T args)
{
foreach (arg; args[0 .. $])
{
//writeln(arg);
bar2!(typeof(arg))(&arg);
}
}
void bar2(D)(const(void)* arg)
{
D obj = *cast(D*) arg;
}
/***************************************************/
void test3()
{
version (unittest)
{
printf("unittest!\n");
}
else
{
printf("no unittest!\n");
}
version (assert)
{
printf("assert!\n");
}
else
{
printf("no assert!\n");
}
}
/***************************************************/
void test4()
{
immutable int maxi = 8;
int[][maxi] neighbors = [ cast(int[])[ ], [ 0 ], [ 0, 1], [ 0, 2], [1, 2], [1, 2, 3, 4],
[ 2, 3, 5], [ 4, 5, 6 ] ];
int[maxi] grid;
// neighbors[0].length = 0;
void place(int k, uint mask)
{ if(k<maxi) {
for(uint m = 1, d = 1; d <= maxi; d++, m<<=1)
if(!(mask & m)) {
bool ok = true;
int dif;
foreach(nb; neighbors[k])
if((dif=grid[nb]-d)==1 || dif==-1) {
ok = false; break;
}
if(ok) {
grid[k] = d;
place(k+1, mask | m);
}
}
} else {
printf(" %d\n%d %d %d\n%d %d %d\n %d\n\n",
grid[0], grid[1], grid[2], grid[3], grid[4], grid[5], grid[6], grid[7]);
}
}
place(0, 0);
}
/***************************************************/
struct S5
{
enum S5 some_constant = {2};
int member;
}
void test5()
{
}
/***************************************************/
struct S6
{
int a, b, c;
}
struct T6
{
S6 s;
int b = 7;
S6* opDot()
{
return &s;
}
}
void test6()
{
T6 t;
t.a = 4;
t.b = 5;
t.c = 6;
assert(t.a == 4);
assert(t.b == 5);
assert(t.c == 6);
assert(t.s.b == 0);
assert(t.sizeof == 4*4);
assert(t.init.sizeof == 4*4);
}
/***************************************************/
struct S7
{
int a, b, c;
}
class C7
{
S7 s;
int b = 7;
S7* opDot()
{
return &s;
}
}
void test7()
{
C7 t = new C7();
t.a = 4;
t.b = 5;
t.c = 6;
assert(t.a == 4);
assert(t.b == 5);
assert(t.c == 6);
assert(t.s.b == 0);
assert(t.sizeof == (void*).sizeof);
assert(t.init is null);
}
/***************************************************/
void foo8(int n1 = __LINE__ + 0, int n2 = __LINE__, string s = __FILE__)
{
assert(n1 < n2);
printf("n1 = %d, n2 = %d, s = %.*s\n", n1, n2, s.length, s.ptr);
}
void test8()
{
foo8();
}
/***************************************************/
void foo9(int n1 = __LINE__ + 0, int n2 = __LINE__, string s = __FILE__)()
{
assert(n1 < n2);
printf("n1 = %d, n2 = %d, s = %.*s\n", n1, n2, s.length, s.ptr);
}
void test9()
{
foo9();
}
/***************************************************/
int foo10(char c) pure nothrow
{
return 1;
}
void test10()
{
int function(char c) fp;
int function(char c) pure nothrow fq;
fp = &foo10;
fq = &foo10;
}
/***************************************************/
class Base11 {}
class Derived11 : Base11 {}
class MoreDerived11 : Derived11 {}
int fun11(Base11) { return 1; }
int fun11(Derived11) { return 2; }
void test11()
{
MoreDerived11 m;
auto i = fun11(m);
assert(i == 2);
}
/***************************************************/
interface ABC {};
interface AB: ABC {};
interface BC: ABC {};
interface AC: ABC {};
interface A: AB, AC {};
interface B: AB, BC {};
interface C: AC, BC {};
int f12(AB ab) { return 1; }
int f12(ABC abc) { return 2; }
void test12()
{
A a;
auto i = f12(a);
assert(i == 1);
}
/***************************************************/
template Foo13(alias x)
{
enum bar = x + 1;
}
static assert(Foo13!(2+1).bar == 4);
template Bar13(alias x)
{
enum bar = x;
}
static assert(Bar13!("abc").bar == "abc");
void test13()
{
}
/***************************************************/
template Foo14(alias a)
{
alias Bar14!(a) Foo14;
}
int Bar14(alias a)()
{
return a.sizeof;
}
void test14()
{
auto i = Foo14!("hello")();
printf("i = %d\n", i);
assert(i == "hello".sizeof);
i = Foo14!(1)();
printf("i = %d\n", i);
assert(i == 4);
}
/***************************************************/
auto foo15()(int x)
{
return 3 + x;
}
void test15()
{
auto bar()(int x)
{
return 5 + x;
}
printf("%d\n", foo15(4));
printf("%d\n", bar(4));
}
/***************************************************/
int foo16(int x) { return 1; }
int foo16(ref int x) { return 2; }
void test16()
{
int y;
auto i = foo16(y);
printf("i == %d\n", i);
assert(i == 2);
i = foo16(3);
assert(i == 1);
}
/***************************************************/
class A17 { }
class B17 : A17 { }
class C17 : B17 { }
int foo17(A17, ref int x) { return 1; }
int foo17(B17, ref int x) { return 2; }
void test17()
{
C17 c;
int y;
auto i = foo17(c, y);
printf("i == %d\n", i);
assert(i == 2);
}
/***************************************************/
class C18
{
void foo(int x) { foo("abc"); }
void foo(string s) { } // this is hidden, but that's ok 'cuz no overlap
void bar()
{
foo("abc");
}
}
class D18 : C18
{
override void foo(int x) { }
}
void test18()
{
D18 d = new D18();
d.bar();
}
/***************************************************/
int foo19(alias int a)() { return a; }
void test19()
{
int y = 7;
auto i = foo19!(y)();
printf("i == %d\n", i);
assert(i == 7);
i = foo19!(4)();
printf("i == %d\n", i);
assert(i == 4);
}
/***************************************************/
template Foo20(int x) if (x & 1)
{
const int Foo20 = 6;
}
template Foo20(int x) if ((x & 1) == 0)
{
const int Foo20 = 7;
}
void test20()
{
int i = Foo20!(3);
printf("%d\n", i);
assert(i == 6);
i = Foo20!(4);
printf("%d\n", i);
assert(i == 7);
}
/***************************************************/
template isArray21(T : U[], U)
{
static const isArray21 = 1;
}
template isArray21(T)
{
static const isArray21 = 0;
}
int foo21(T)(T x) if (isArray21!(T))
{
return 1;
}
int foo21(T)(T x) if (!isArray21!(T))
{
return 2;
}
void test21()
{
auto i = foo21(5);
assert(i == 2);
int[] a;
i = foo21(a);
assert(i == 1);
}
/***************************************************/
void test22()
{
immutable uint x, y;
foreach (i; x .. y) {}
}
/***************************************************/
const bool foo23 = is(typeof(function void() { }));
const bar23 = is(typeof(function void() { }));
void test23()
{
assert(foo23 == true);
assert(bar23 == true);
}
/***************************************************/
ref int foo24(int i)
{
static int x;
x = i;
return x;
}
void test24()
{
int x = foo24(3);
assert(x == 3);
}
/***************************************************/
ref int foo25(int i)
{
static int x;
x = i;
return x;
}
int bar25(ref int x)
{
return x + 1;
}
void test25()
{
int x = bar25(foo25(3));
assert(x == 4);
}
/***************************************************/
static int x26;
ref int foo26(int i)
{
x26 = i;
return x26;
}
void test26()
{
int* p = &foo26(3);
assert(*p == 3);
}
/***************************************************/
static int x27 = 3;
ref int foo27(int i)
{
return x27;
}
void test27()
{
foo27(3) = 4;
assert(x27 == 4);
}
/***************************************************/
ref int foo28(ref int x) { return x; }
void test28()
{
int a;
foo28(a);
}
/***************************************************/
void wyda(int[] a) { printf("aaa\n"); }
void wyda(int[int] a) { printf("bbb\n"); }
struct S29
{
int[] a;
void wyda()
{
a.wyda;
a.wyda();
}
}
void test29()
{
int[] a;
a.wyda;
int[5] b;
b.wyda;
int[int] c;
c.wyda;
S29 s;
s.wyda();
}
/***************************************************/
void foo30(D)(D arg) if (isIntegral!D)
{
}
struct S30(T) { }
struct U30(int T) { }
alias int myint30;
void test30()
{
S30!myint30 u;
S30!int s;
S30!(int) t = s;
// U30!3 v = s;
}
/***************************************************/
class A31
{
void foo(int* p) { }
}
class B31 : A31
{
override void foo(scope int* p) { }
}
void test31()
{
}
/***************************************************/
void bar32() { }
nothrow void foo32(int* p)
{
//try { bar32(); } catch (Object o) { }
try { bar32(); } catch (Throwable o) { }
try { bar32(); } catch (Exception o) { }
}
void test32()
{ int i;
foo32(&i);
}
/***************************************************/
struct Integer
{
this(int i)
{
this.i = i;
}
this(long ii)
{
i = 3;
}
const int i;
}
void test33()
{
}
/***************************************************/
void test34()
{
alias uint Uint;
foreach(Uint u;1..10) {}
for(Uint u=1;u<10;u++) {}
}
/***************************************************/
ref int foo35(bool condition, ref int lhs, ref int rhs)
{
if ( condition ) return lhs;
return rhs;
}
ref int bar35()(bool condition, ref int lhs, ref int rhs)
{
if ( condition ) return lhs;
return rhs;
}
void test35()
{
int a = 10, b = 11;
foo35(a<b, a, b) = 42;
printf("a = %d and b = %d\n", a, b); // a = 42 and b = 11
assert(a == 42 && b == 11);
bar35(a<b, a, b) = 52;
printf("a = %d and b = %d\n", a, b);
assert(a == 42 && b == 52);
}
/***************************************************/
int foo36(T...)(T ts)
if (T.length > 1)
{
return T.length;
}
int foo36(T...)(T ts)
if (T.length <= 1)
{
return T.length * 7;
}
void test36()
{
auto i = foo36!(int,int)(1, 2);
assert(i == 2);
i = foo36(1, 2, 3);
assert(i == 3);
i = foo36(1);
assert(i == 7);
i = foo36();
assert(i == 0);
}
/***************************************************/
void test6685()
{
struct S { int x; };
with({ return S(); }())
{
x++;
}
}
/***************************************************/
struct A37(alias T)
{
}
void foo37(X)(X x) if (is(X Y == A37!(U), alias U))
{
}
void bar37() {}
void test37()
{
A37!(bar37) a2;
foo37(a2);
foo37!(A37!bar37)(a2);
}
/***************************************************/
struct A38
{
this(this)
{
printf("B's copy\n");
}
bool empty() {return false;}
void popFront() {}
int front() { return 1; }
// ref A38 opSlice() { return this; }
}
void test38()
{
A38 a;
int i;
foreach (e; a) { if (++i == 100) break; }
}
/***************************************************/
alias int function() Fun39;
alias ref int function() Gun39;
static assert(!is(Fun39 == Gun39));
void test39()
{
}
/***************************************************/
int x40;
struct Proxy
{
ref int at(int i)() { return x40; }
}
void test40()
{
Proxy p;
auto x = p.at!(1);
}
/***************************************************/
template Foo41(TList...)
{
alias TList Foo41;
}
alias Foo41!(immutable(ubyte)[], ubyte[]) X41;
void test41()
{
}
/***************************************************/
bool endsWith(A1, A2)(A1 longer, A2 shorter)
{
static if (is(typeof(longer[0 .. 0] == shorter)))
{
}
else
{
}
return false;
}
void test42()
{
char[] a;
byte[] b;
endsWith(a, b);
}
/***************************************************/
void f43(S...)(S s) if (S.length > 3)
{
}
void test43()
{
f43(1, 2, 3, 4);
}
/***************************************************/
struct S44(int x = 1){}
void fun()(S44!(1) b) { }
void test44()
{
S44!() s;
fun(s);
}
/***************************************************/
// 2006
void test2006()
{
string [][] aas = [];
assert(aas.length == 0);
aas ~= cast (string []) [];
assert(aas.length == 1);
aas = aas ~ cast (string []) [];
assert(aas.length == 2);
}
/***************************************************/
// 8442
void test8442()
{
enum int[] fooEnum = [];
immutable fooImmutable = fooEnum;
}
/***************************************************/
class A45
{
int x;
int f()
{
printf("A\n");
return 1;
}
}
class B45 : A45
{
override const int f()
{
printf("B\n");
return 2;
}
}
void test45()
{
A45 y = new B45;
int i = y.f;
assert(i == 2);
}
/***************************************************/
void text10682()
{
ulong x = 1;
ulong y = 2 ^^ x;
}
/***************************************************/
struct Test46
{
int foo;
}
void test46()
{
enum Test46 test = {};
enum q = test.foo;
}
/***************************************************/
pure int double_sqr(int x) {
int y = x;
void do_sqr() { y *= y; }
do_sqr();
return y;
}
void test47()
{
assert(double_sqr(10) == 100);
}
/***************************************************/
void sort(alias less)(string[] r)
{
bool pred()
{
return less("a", "a");
}
.sort!(less)(r);
}
void foo48()
{
int[string] freqs;
string[] words;
sort!((a, b) { return freqs[a] > freqs[b]; })(words);
sort!((string a, string b) { return freqs[a] > freqs[b]; })(words);
//sort!(bool (a, b) { return freqs[a] > freqs[b]; })(words);
//sort!(function (a, b) { return freqs[a] > freqs[b]; })(words);
//sort!(function bool(a, b) { return freqs[a] > freqs[b]; })(words);
sort!(delegate bool(string a, string b) { return freqs[a] > freqs[b]; })(words);
}
void test48()
{
}
/***************************************************/
// 6408
static assert(!is(typeof(string[0..1].init)));
static assert(is(typeof(string[].init) == string[]));
static assert(is(typeof(string[][].init) == string[][]));
static assert(is(typeof(string[][][].init) == string[][][]));
static assert(is(typeof(string[1].init) == string[1]));
static assert(is(typeof(string[1][1].init) == string[1][1]));
static assert(is(typeof(string[1][1][1].init) == string[1][1][1]));
static assert(is(typeof(string[string].init) == string[string]));
static assert(is(typeof(string[string][string].init) == string[string][string]));
static assert(is(typeof(string[string][string][string].init) == string[string][string][string]));
template TT6408(T...) { alias T TT6408; }
static assert(is(typeof(TT6408!(int, int)[].init) == TT6408!(int, int)));
static assert(is(typeof(TT6408!(int, int)[0..$].init) == TT6408!(int, int)));
static assert(is(typeof(TT6408!(int, int)[$-1].init) == int));
/***************************************************/
// 9409
template TT9409(T...) { alias T TT9409; }
template idxTypes9409(Prefix...)
{
TT9409!((Prefix[$-1])) idxTypes9409;
}
alias idxTypes9409!(int) Types9409;
/***************************************************/
struct S49
{
static void* p;
this( string name )
{
printf( "(ctor) &%.*s.x = %p\n", name.length, name.ptr, &x );
p = cast(void*)&x;
}
invariant() {}
int x;
}
void test49()
{
auto s = new S49("s2");
printf( "&s2.x = %p\n", &s.x );
assert(cast(void*)&s.x == S49.p);
}
/***************************************************/
auto max50(Ts...)(Ts args)
if (Ts.length >= 2
&& is(typeof(Ts[0].init > Ts[1].init ? Ts[1].init : Ts[0].init)))
{
static if (Ts.length == 2)
return args[1] > args[0] ? args[1] : args[0];
else
return max50(max50(args[0], args[1]), args[2 .. $]);
}
void test50()
{
assert(max50(4, 5) == 5);
assert(max50(2.2, 4.5) == 4.5);
assert(max50("Little", "Big") == "Little");
assert(max50(4, 5.5) == 5.5);
assert(max50(5.5, 4) == 5.5);
}
/***************************************************/
void test51()
{
static immutable int[2] array = [ 42 ];
enum e = array[1];
static immutable int[1] array2 = [ 0: 42 ];
enum e2 = array2[0];
assert(e == 0);
assert(e2 == 42);
}
/***************************************************/
enum ubyte[4] a52 = [5,6,7,8];
void test52()
{
int x=3;
assert(a52[x]==8);
}
/***************************************************/
void test53()
{
size_t func2(immutable(void)[] t)
{
return 0;
}
}
/***************************************************/
void foo54(void delegate(void[]) dg) { }
void test54()
{
void func(void[] t) pure { }
foo54(&func);
// void func2(const(void)[] t) { }
// foo54(&func2);
}
/***************************************************/
class Foo55
{
synchronized void noop1() { }
void noop2() shared { }
}
void test55()
{
auto foo = new shared(Foo55);
foo.noop1();
foo.noop2();
}
/***************************************************/
enum float one56 = 1 * 1;
template X56(float E) { int X56 = 2; }
alias X56!(one56 * one56) Y56;
void test56()
{
assert(Y56 == 2);
}
/***************************************************/
void test57()
{
alias shared(int) T;
assert (is(T == shared));
}
/***************************************************/
struct A58
{
int a,b;
}
void test58()
{
A58[2] rg=[{1,2},{5,6}];
assert(rg[0].a == 1);
assert(rg[0].b == 2);
assert(rg[1].a == 5);
assert(rg[1].b == 6);
}
/***************************************************/
class A59 {
const foo(int i) { return i; }
}
/***************************************************/
void test60()
{
enum real ONE = 1.0;
real x;
for (x=0.0; x<10.0; x+=ONE)
printf("%Lg\n", x);
printf("%Lg\n", x);
assert(x == 10);
}
/***************************************************/
pure immutable(T)[] fooPT(T)(immutable(T)[] x, immutable(T)[] y){
immutable(T)[] fooState;
immutable(T)[] bar(immutable(T)[] x){
fooState = "hello ";
return x ~ y;
}
return fooState ~ bar(x);
}
void test61()
{
writeln(fooPT("p", "c"));
}
/***************************************************/
void test9577()
{
static int function(int)[] foo = [x => x];
foo[0](0);
}
/***************************************************/
int[3] foo62(int[3] a)
{
a[1]++;
return a;
}
void test62()
{
int[3] b;
b[0] = 1;
b[1] = 2;
b[2] = 3;
auto c = foo62(b);
assert(b[0] == 1);
assert(b[1] == 2);
assert(b[2] == 3);
assert(c[0] == 1);
assert(c[1] == 3);
assert(c[2] == 3);
}
/***************************************************/
void test3927()
{
int[] array;
assert(array.length++ == 0);
assert(array.length == 1);
assert(array.length-- == 1);
assert(array.length == 0);
}
/***************************************************/
void test63()
{
int[3] b;
b[0] = 1;
b[1] = 2;
b[2] = 3;
auto c = b;
b[1]++;
assert(b[0] == 1);
assert(b[1] == 3);
assert(b[2] == 3);
assert(c[0] == 1);
assert(c[1] == 2);
assert(c[2] == 3);
}
/***************************************************/
void test64()
{
int[3] b;
b[0] = 1;
b[1] = 2;
b[2] = 3;
int[3] c;
c = b;
b[1]++;
assert(b[0] == 1);
assert(b[1] == 3);
assert(b[2] == 3);
assert(c[0] == 1);
assert(c[1] == 2);
assert(c[2] == 3);
}
/***************************************************/
int[2] foo65(int[2] a)
{
a[1]++;
return a;
}
void test65()
{
int[2] b;
b[0] = 1;
b[1] = 2;
int[2] c = foo65(b);
assert(b[0] == 1);
assert(b[1] == 2);
assert(c[0] == 1);
assert(c[1] == 3);
}
/***************************************************/
int[1] foo66(int[1] a)
{
a[0]++;
return a;
}
void test66()
{
int[1] b;
b[0] = 1;
int[1] c = foo66(b);
assert(b[0] == 1);
assert(c[0] == 2);
}
/***************************************************/
int[2] foo67(out int[2] a)
{
a[0] = 5;
a[1] = 6;
return a;
}
void test67()
{
int[2] b;
b[0] = 1;
b[1] = 2;
int[2] c = foo67(b);
assert(b[0] == 5);
assert(b[1] == 6);
assert(c[0] == 5);
assert(c[1] == 6);
}
/***************************************************/
void test68()
{
digestToString(cast(ubyte[16])x"c3fcd3d76192e4007dfb496cca67e13b");
}
void digestToString(const ubyte[16] digest)
{
assert(digest[0] == 0xc3);
assert(digest[15] == 0x3b);
}
/***************************************************/
void test69()
{
digestToString69(cast(ubyte[16])x"c3fcd3d76192e4007dfb496cca67e13b");
}
void digestToString69(ref const ubyte[16] digest)
{
assert(digest[0] == 0xc3);
assert(digest[15] == 0x3b);
}
/***************************************************/
void test70()
{
digestToString70("1234567890123456");
}
void digestToString70(ref const char[16] digest)
{
assert(digest[0] == '1');
assert(digest[15] == '6');
}
/***************************************************/
void foo71(out shared int o) {}
/***************************************************/
struct foo72
{
int bar() shared { return 1; }
}
void test72()
{
shared foo72 f;
auto x = f.bar;
}
/***************************************************/
class Foo73
{
static if (is(typeof(this) T : shared T))
static assert(0);
static if (is(typeof(this) U == shared U))
static assert(0);
static if (is(typeof(this) U == const U))
static assert(0);
static if (is(typeof(this) U == immutable U))
static assert(0);
static if (is(typeof(this) U == const shared U))
static assert(0);
static assert(!is(int == const));
static assert(!is(int == immutable));
static assert(!is(int == shared));
static assert(is(int == int));
static assert(is(const(int) == const));
static assert(is(immutable(int) == immutable));
static assert(is(shared(int) == shared));
static assert(is(const(shared(int)) == shared));
static assert(is(const(shared(int)) == const));
static assert(!is(const(shared(int)) == immutable));
static assert(!is(const(int) == immutable));
static assert(!is(const(int) == shared));
static assert(!is(shared(int) == const));
static assert(!is(shared(int) == immutable));
static assert(!is(immutable(int) == const));
static assert(!is(immutable(int) == shared));
}
template Bar(T : T)
{
alias T Bar;
}
template Barc(T : const(T))
{
alias T Barc;
}
template Bari(T : immutable(T))
{
alias T Bari;
}
template Bars(T : shared(T))
{
alias T Bars;
}
template Barsc(T : shared(const(T)))
{
alias T Barsc;
}
void test73()
{
auto f = new Foo73;
alias int T;
// 5*5 == 25 combinations, plus 2 for swapping const and shared
static assert(is(Bar!(T) == T));
static assert(is(Bar!(const(T)) == const(T)));
static assert(is(Bar!(immutable(T)) == immutable(T)));
static assert(is(Bar!(shared(T)) == shared(T)));
static assert(is(Bar!(shared(const(T))) == shared(const(T))));
static assert(is(Barc!(const(T)) == T));
static assert(is(Bari!(immutable(T)) == T));
static assert(is(Bars!(shared(T)) == T));
static assert(is(Barsc!(shared(const(T))) == T));
static assert(is(Barc!(T) == T));
static assert(is(Barc!(immutable(T)) == T));
static assert(is(Barc!(const(shared(T))) == shared(T)));
static assert(is(Barsc!(immutable(T)) == T));
static assert(is(Bars!(const(shared(T))) == const(T)));
static assert(is(Barsc!(shared(T)) == T));
Bars!(shared(const(T))) b;
pragma(msg, typeof(b));
static assert(is(Bars!(shared(const(T))) == const(T)));
static assert(is(Barc!(shared(const(T))) == shared(T)));
static assert(!is(Bari!(T)));
static assert(!is(Bari!(const(T))));
static assert(!is(Bari!(shared(T))));
static assert(!is(Bari!(const(shared(T)))));
static assert(is(Barc!(shared(T))));
static assert(!is(Bars!(T)));
static assert(!is(Bars!(const(T))));
static assert(!is(Bars!(immutable(T))));
static assert(!is(Barsc!(T)));
static assert(!is(Barsc!(const(T))));
}
/***************************************************/
pure nothrow {
alias void function(int) A74;
}
alias void function(int) pure nothrow B74;
alias pure nothrow void function(int) C74;
void test74()
{
A74 a = null;
B74 b = null;
C74 c = null;
a = b;
a = c;
}
/***************************************************/
void test9212()
{
int[int] aa;
foreach (const key, const val; aa) {}
foreach (size_t key, size_t val; aa) {}
}
/***************************************************/
class A75
{
pure static void raise(string s)
{
throw new Exception(s);
}
}
void test75()
{ int x = 0;
try
{
A75.raise("a");
} catch (Exception e)
{
x = 1;
}
assert(x == 1);
}
/***************************************************/
void test76()
{
int x, y;
bool which;
(which ? x : y) += 5;
assert(y == 5);
}
/***************************************************/
void test77()
{
auto a = ["hello", "world"];
pragma(msg, typeof(a));
auto b = a;
assert(a is b);
assert(a == b);
b = a.dup;
assert(a == b);
assert(a !is b);
}
/***************************************************/
void test78()
{
auto array = [0, 2, 4, 6, 8, 10];
array = array[0 .. $ - 2]; // Right-shrink by two elements
assert(array == [0, 2, 4, 6]);
array = array[1 .. $]; // Left-shrink by one element
assert(array == [2, 4, 6]);
array = array[1 .. $ - 1]; // Shrink from both sides
assert(array == [4]);
}
/***************************************************/
void test79()
{
auto a = [87, 40, 10];
a ~= 42;
assert(a == [87, 40, 10, 42]);
a ~= [5, 17];
assert(a == [87, 40, 10, 42, 5, 17]);
}
/***************************************************/
void test6317()
{
int b = 12345;
struct nested { int a; int fun() { return b; } }
static assert(!__traits(compiles, { nested x = { 3, null }; }));
nested g = { 7 };
auto h = nested(7);
assert(g.fun() == 12345);
assert(h.fun() == 12345);
}
/***************************************************/
void test80()
{
auto array = new int[10];
array.length += 1000;
assert(array.length == 1010);
array.length /= 10;
assert(array.length == 101);
array.length -= 1;
assert(array.length == 100);
array.length |= 1;
assert(array.length == 101);
array.length ^= 3;
assert(array.length == 102);
array.length &= 2;
assert(array.length == 2);
array.length *= 2;
assert(array.length == 4);
array.length <<= 1;
assert(array.length == 8);
array.length >>= 1;
assert(array.length == 4);
array.length >>>= 1;
assert(array.length == 2);
array.length %= 2;
assert(array.length == 0);
int[]* foo()
{
static int x;
x++;
assert(x == 1);
auto p = &array;
return p;
}
(*foo()).length += 2;
assert(array.length == 2);
}
/***************************************************/
void test81()
{
int[3] a = [1, 2, 3];
int[3] b = a;
a[1] = 42;
assert(b[1] == 2); // b is an independent copy of a
int[3] fun(int[3] x, int[3] y) {
// x and y are copies of the arguments
x[0] = y[0] = 100;
return x;
}
auto c = fun(a, b); // c has type int[3]
assert(c == [100, 42, 3]);
assert(b == [1, 2, 3]); // b is unaffected by fun
}
/***************************************************/
void test82()
{
auto a1 = [ "Jane":10.0, "Jack":20, "Bob":15 ];
auto a2 = a1; // a1 and a2 refer to the same data
a1["Bob"] = 100; // Changing a1
assert(a2["Bob"] == 100); //is same as changing a2
a2["Sam"] = 3.5; //and vice
assert(a2["Sam"] == 3.5); // versa
}
/***************************************************/
void bump(ref int x) { ++x; }
void test83()
{
int x = 1;
bump(x);
assert(x == 2);
}
/***************************************************/
interface Test4174
{
void func(T)() {}
}
/***************************************************/
auto foo84 = [1, 2.4];
void test84()
{
pragma(msg, typeof([1, 2.4]));
static assert(is(typeof([1, 2.4]) == double[]));
pragma(msg, typeof(foo84));
static assert(is(typeof(foo84) == double[]));
}
/***************************************************/
void test85()
{
dstring c = "V\u00E4rld";
c = c ~ '!';
assert(c == "V\u00E4rld!");
c = '@' ~ c;
assert(c == "@V\u00E4rld!");
wstring w = "V\u00E4rld";
w = w ~ '!';
assert(w == "V\u00E4rld!");
w = '@' ~ w;
assert(w == "@V\u00E4rld!");
string s = "V\u00E4rld";
s = s ~ '!';
assert(s == "V\u00E4rld!");
s = '@' ~ s;
assert(s == "@V\u00E4rld!");
}
/***************************************************/
void test86()
{
int[][] a = [ [1], [2,3], [4] ];
int[][] w = [ [1, 2], [3], [4, 5], [] ];
int[][] x = [ [], [1, 2], [3], [4, 5], [] ];
}
/***************************************************/
// Bugzilla 3379
T1[] find(T1, T2)(T1[] longer, T2[] shorter)
if (is(typeof(longer[0 .. 1] == shorter) : bool))
{
while (longer.length >= shorter.length) {
if (longer[0 .. shorter.length] == shorter) break;
longer = longer[1 .. $];
}
return longer;
}
auto max(T...)(T a)
if (T.length == 2
&& is(typeof(a[1] > a[0] ? a[1] : a[0]))
|| T.length > 2
&& is(typeof(max(max(a[0], a[1]), a[2 .. $])))) {
static if (T.length == 2) {
return a[1] > a[0] ? a[1] : a[0];
} else {
return max(max(a[0], a[1]), a[2 .. $]);
}
}
// Cases which would ICE or segfault
struct Bulldog(T){
static void cat(Frog)(Frog f) if (true)
{ }
}
void mouse(){
Bulldog!(int).cat(0);
}
void test87()
{
double[] d1 = [ 6.0, 1.5, 2.4, 3 ];
double[] d2 = [ 1.5, 2.4 ];
assert(find(d1, d2) == d1[1 .. $]);
assert(find(d1, d2) == d1[1 .. $]); // Check for memory corruption
assert(max(4, 5) == 5);
assert(max(3, 4, 5) == 5);
}
/***************************************************/
template test4284(alias v) { enum test4284 = v.length == 0; }
static assert(test4284!(cast(string)null));
static assert(test4284!(cast(string[])null));
/***************************************************/
struct S88
{
void opDispatch(string s, T)(T i)
{
printf("S.opDispatch('%.*s', %d)\n", s.length, s.ptr, i);
}
}
class C88
{
void opDispatch(string s)(int i)
{
printf("C.opDispatch('%.*s', %d)\n", s.length, s.ptr, i);
}
}
struct D88
{
template opDispatch(string s)
{
enum int opDispatch = 8;
}
}
void test88()
{
S88 s;
s.opDispatch!("hello")(7);
s.foo(7);
auto c = new C88();
c.foo(8);
D88 d;
printf("d.foo = %d\n", d.foo);
assert(d.foo == 8);
}
/***************************************************/
void test89() {
static struct X {
int x;
int bar() { return x; }
}
X s;
printf("%d\n", s.sizeof);
assert(s.sizeof == 4);
}
/***************************************************/
struct S90
{
void opDispatch( string name, T... )( T values )
{
assert(values[0] == 3.14);
}
}
void test90( )
{ S90 s;
s.opDispatch!("foo")( 3.14 );
s.foo( 3.14 );
}
/***************************************************/
struct A7439(int r, int c)
{
alias r R;
alias c C;
alias float[R * C] Data;
Data _data;
alias _data this;
this(Data ar){ _data = ar; }
pure ref float opIndex(size_t rr, size_t cc){ return _data[cc + rr * C]; }
}
void test7439()
{
A7439!(2, 2) a = A7439!(2, 2)([8, 3, 2, 9]);
a[0,0] -= a[0,0] * 2.0;
}
/***************************************************/
void foo91(uint line = __LINE__) { printf("%d\n", line); }
void test91()
{
foo91();
printf("%d\n", __LINE__);
}
/***************************************************/
auto ref foo92(ref int x) { return x; }
int bar92(ref int x) { return x; }
void test92()
{
int x = 3;
int i = bar92(foo92(x));
assert(i == 3);
}
/***************************************************/
struct Foo93
{
public int foo() const
{
return 2;
}
}
void test93()
{
const Foo93 bar = Foo93();
enum bla = bar.foo();
assert(bla == 2);
}
/***************************************************/
extern(C++) class C1687
{
void func() {}
}
void test1687()
{
auto c = new C1687();
assert(c.__vptr[0] == (&c.func).funcptr);
}
/***************************************************/
struct Foo94
{
int x, y;
real z;
}
pure nothrow Foo94 makeFoo(const int x, const int y)
{
return Foo94(x, y, 3.0);
}
void test94()
{
auto f = makeFoo(1, 2);
assert(f.x==1);
assert(f.y==2);
assert(f.z==3);
}
/***************************************************/
struct T95
{
@disable this(this)
{
}
}
struct S95
{
T95 t;
}
@disable void foo95() { }
struct T95A
{
@disable this(this);
}
struct S95A
{
T95A t;
}
@disable void foo95A() { }
void test95()
{
S95 s;
S95 t;
static assert(!__traits(compiles, t = s));
static assert(!__traits(compiles, foo95()));
S95A u;
S95A v;
static assert(!__traits(compiles, v = u));
static assert(!__traits(compiles, foo95A()));
}
/***************************************************/
struct S96(alias init)
{
int[] content = init;
}
void test96()
{
S96!([12, 3]) s1;
S96!([1, 23]) s2;
writeln(s1.content);
writeln(s2.content);
assert(!is(typeof(s1) == typeof(s2)));
}
/***************************************************/
struct A97
{
const bool opEquals(ref const A97) { return true; }
ref A97 opUnary(string op)() if (op == "++")
{
return this;
}
}
void test97()
{
A97 a, b;
foreach (e; a .. b) {
}
}
/***************************************************/
void test98()
{
auto a = new int[2];
// the name "length" should not pop up in an index expression
static assert(!is(typeof(a[length - 1])));
}
/***************************************************/
string s99;
void bar99(string i)
{
}
void function(string) foo99(string i)
{
return &bar99;
}
void test99()
{
foo99 (s99 ~= "a") (s99 ~= "b");
assert(s99 == "ab");
}
/***************************************************/
// 5081
void test5081()
{
static pure immutable(int[]) x1()
{
int[] a = new int[](10);
return a;
}
static pure immutable(int[]) x2(int len)
{
int[] a = new int[](len);
return a;
}
static pure immutable(int[]) x3(immutable(int[]) org)
{
int[] a = new int[](org.length);
return a;
}
immutable a1 = x1();
immutable a2 = x2(10);
immutable a3 = x3([1,2]);
static pure int[] y1()
{
return new int[](10);
}
immutable b1 = y1();
}
/***************************************************/
void test100()
{
string s;
/* Testing order of evaluation */
void delegate(string, string) fun(string) {
s ~= "b";
return delegate void(string x, string y) { s ~= "e"; };
}
fun(s ~= "a")(s ~= "c", s ~= "d");
assert(s == "abcde", s);
}
/***************************************************/
void test101()
{
int[] d1 = [ 6, 1, 2 ];
byte[] d2 = [ 6, 1, 2 ];
assert(d1 == d2);
d2 ~= [ 6, 1, 2 ];
assert(d1 != d2);
}
/***************************************************/
void test5403()
{
struct S
{
static int front;
enum back = "yes!";
bool empty;
void popAny() { empty = true; }
alias popAny popFront;
alias popAny popBack;
}
S.front = 7;
foreach(int i; S()) assert(i == 7);
S.front = 2;
foreach(i; S()) assert(i == 2);
foreach_reverse(i; S()) assert(i == "yes!");
}
/***************************************************/
static assert([1,2,3] == [1.0,2,3]);
/***************************************************/
int transmogrify(uint) { return 1; }
int transmogrify(long) { return 2; }
void test103()
{
assert(transmogrify(42) == 1);
}
/***************************************************/
int foo104(int x)
{
int* p = &(x += 1);
return *p;
}
int bar104(int *x)
{
int* p = &(*x += 1);
return *p;
}
void test104()
{
auto i = foo104(1);
assert(i == 2);
i = bar104(&i);
assert(i == 3);
}
/***************************************************/
ref int bump105(ref int x) { return ++x; }
void test105()
{
int x = 1;
bump105(bump105(x)); // two increments
assert(x == 3);
}
/***************************************************/
pure int genFactorials(int n) {
static pure int factorial(int n) {
if (n==2) return 1;
return factorial(2);
}
return factorial(n);
}
/***************************************************/
void test107()
{
int[6] a;
writeln(a);
writeln(a.init);
assert(a.init == [0,0,0,0,0,0]);
}
/***************************************************/
class A109 {}
void test109()
{
immutable(A109) b;
A109 c;
auto z = true ? b : c;
//writeln(typeof(z).stringof);
static assert(is(typeof(z) == const(A109)));
}
/***************************************************/
template Boo(T) {}
struct Foo110(T, alias V = Boo!T)
{
pragma(msg, V.stringof);
static const s = V.stringof;
}
alias Foo110!double B110;
alias Foo110!int A110;
static assert(B110.s == "Boo!double");
static assert(A110.s == "Boo!int");
/***************************************************/
int test11247()
{
static assert(is(byte[typeof(int.init).sizeof] == byte[4]));
static assert(is(byte[typeof(return).sizeof] == byte[4]));
return 0;
}
/***************************************************/
// 3716
void test111()
{
auto k1 = true ? [1,2] : []; // OK
auto k2 = true ? [[1,2]] : [[]];
auto k3 = true ? [] : [[1,2]];
auto k4 = true ? [[[]]] : [[[1,2]]];
auto k5 = true ? [[[1,2]]] : [[[]]];
auto k6 = true ? [] : [[[]]];
static assert(!is(typeof(true ? [[[]]] : [[1,2]]))); // Must fail
}
/***************************************************/
// 658
void test658()
{
struct S { int i; }
class C { int i; }
S s;
S* sp = &s;
with (sp) i = 42;
assert(s.i == 42);
with (&s) i = 43;
assert(s.i == 43);
C c = new C;
C* cp = &c;
with (cp) i = 42;
assert(c.i == 42);
with (&c) i = 43;
assert(c.i == 43);
}
/***************************************************/
void test3069()
{
ubyte id = 0;
void[] v = [id] ~ [id];
}
/***************************************************/
// 4303
template foo112() if (__traits(compiles,undefined))
{
enum foo112 = false;
}
template foo112() if (true)
{
enum foo112 = true;
}
pragma(msg,__traits(compiles,foo112!()));
static assert(__traits(compiles,foo112!()));
const bool bar112 = foo112!();
/***************************************************/
struct File113
{
this(int name) { }
~this() { }
void opAssign(File113 rhs) { }
struct ByLine
{
File113 file;
this(int) { }
}
ByLine byLine()
{
return ByLine(1);
}
}
auto filter113(File113.ByLine rs)
{
struct Filter
{
this(File113.ByLine r) { }
}
return Filter(rs);
}
void test113()
{
auto f = File113(1);
auto rx = f.byLine();
auto file = filter113(rx);
}
/***************************************************/
template foo114(fun...)
{
auto foo114(int[] args)
{
return 1;
}
}
pragma(msg, typeof(foo114!"a + b"([1,2,3])));
/***************************************************/
// Bugzilla 3935
struct Foo115 {
void opBinary(string op)(Foo other) {
pragma(msg, "op: " ~ op);
assert(0);
}
}
void test115()
{
Foo115 f;
f = f;
}
/***************************************************/
// Bugzilla 2477
void foo116(T,)(T t) { T x; }
void test116()
{
int[] data = [1,2,3,]; // OK
data = [ 1,2,3, ]; // fails
auto i = data[1,];
foo116!(int)(3);
foo116!(int,)(3);
foo116!(int,)(3,);
}
/***************************************************/
void test1891()
{
struct C {
char[8] x = "helloabc";
}
int main()
{
C* a = new C;
C*[] b;
b ~= new C;
auto g = a ~ b;
assert(g[0] && g[1] && g[0].x == g[1].x);
return 0;
}
}
/***************************************************/
// Bugzilla 4291
void test117() pure
{
mixin declareVariable;
var = 42;
mixin declareFunction;
readVar();
}
template declareVariable() { int var; }
template declareFunction()
{
int readVar() { return var; }
}
/***************************************************/
// Bugzilla 4177
pure real log118(real x) {
if (__ctfe)
return 0.0;
else
return 1.0;
}
enum x118 = log118(4.0);
void test118() {}
/***************************************************/
void bug4465()
{
const a = 2 ^^ 2;
int b = a;
}
/***************************************************/
pure void foo(int *p)
{
*p = 3;
}
pure void test120()
{
int i;
foo(&i);
assert(i == 3);
}
/***************************************************/
// 4866
immutable int[3] statik = [ 1, 2, 3 ];
enum immutable(int)[] dynamic = statik;
static assert(is(typeof(dynamic) == immutable(int)[]));
static if (! is(typeof(dynamic) == immutable(int)[]))
{
static assert(0); // (7)
}
pragma(msg, "!! ", typeof(dynamic));
/***************************************************/
// 2943
struct Foo2943
{
int a;
int b;
alias b this;
}
void test122()
{
Foo2943 foo, foo2;
foo.a = 1;
foo.b = 2;
foo2.a = 3;
foo2.b = 4;
foo2 = foo;
assert(foo2.a == foo.a);
}
/***************************************************/
// 4641
struct S123 {
int i;
alias i this;
}
void test123() {
S123[int] ss;
ss[0] = S123.init; // This line causes Range Violation.
}
/***************************************************/
// 2451
struct Foo124 {
int z = 3;
void opAssign(Foo124 x) { z= 2;}
}
struct Bar124 {
int z = 3;
this(this){ z = 17; }
}
void test124() {
Foo124[string] stuff;
stuff["foo"] = Foo124.init;
assert(stuff["foo"].z == 3);
stuff["foo"] = Foo124.init;
assert(stuff["foo"].z == 2);
Bar124[string] stuff2;
Bar124 q;
stuff2["dog"] = q;
assert(stuff2["dog"].z == 17);
}
/***************************************************/
void doNothing() {}
void bug5071(short d, ref short c) {
assert(c==0x76);
void closure() {
auto c2 = c;
auto d2 = d;
doNothing();
}
auto useless = &closure;
}
void test125()
{
short c = 0x76;
bug5071(7, c);
}
/***************************************************/
struct Foo126
{
static Foo126 opCall(in Foo126 _f) pure
{
return _f;
}
}
/***************************************************/
void test796()
{
struct S { invariant() { throw new Exception(""); } }
S* s;
try {
assert(s);
} catch (Error) {
}
}
/***************************************************/
void test7077()
{
if(0) mixin("auto x = 2;");
auto x = 1;
}
/***************************************************/
struct Tuple127(S...)
{
S expand;
alias expand this;
}
alias Tuple127!(int, int) Foo127;
void test127()
{
Foo127[] m_array;
Foo127 f;
m_array ~= f;
}
/***************************************************/
struct Bug4434 {}
alias const Bug4434* IceConst4434;
alias shared Bug4434* IceShared4434;
alias shared Bug4434[] IceSharedArray4434;
alias immutable Bug4434* IceImmutable4434;
alias shared const Bug4434* IceSharedConst4434;
alias int MyInt4434;
alias const MyInt4434[3] IceConstInt4434;
alias immutable string[] Bug4830;
/***************************************************/
// 4254
void bub(const inout int other) {}
void test128()
{
bub(1);
}
/***************************************************/
pure nothrow @safe auto bug4915a() { return 0; }
pure nothrow @safe int bug4915b() { return bug4915a(); }
void bug4915c()
{
pure nothrow @safe int d() { return 0; }
int e() pure nothrow @safe { return d(); }
}
/***************************************************/
// 5164
static if (is(int Q == int, Z...)) { }
/***************************************************/
// 5195
alias typeof(foo5195) food5195;
const int * foo5195 = null;
alias typeof(foo5195) good5195;
static assert( is (food5195 == good5195));
/***************************************************/
version (Windows)
{
}
else
{
int[0] var5332;
void test5332() { auto x = var5332; }
}
/***************************************************/
// 5191
struct Foo129
{
void add(T)(T value) nothrow
{
this.value += value;
}
this(int value)
{
this.value = value;
}
int value;
}
void test129()
{
auto foo = Foo129(5);
assert(foo.value == 5);
foo.add(2);
writeln(foo.value);
assert(foo.value == 7);
foo.add(3);
writeln(foo.value);
assert(foo.value == 10);
foo.add(3);
writeln(foo.value);
assert(foo.value == 13);
void delegate (int) nothrow dg = &foo.add!(int);
dg(7);
assert(foo.value == 20);
}
/***************************************************/
// 6169
auto ctfefunc6169() { return ";"; }
enum ctfefptr6169 = &ctfefunc6169;
int ctfefunc6169a() { return 1; }
template x6169(string c) { alias int x6169; }
template TT6169(T...) { alias T TT6169; }
@property ctfeprop6169() { return "g"; }
void test6169() pure @safe
{
enum a = ctfefunc6169();
static b = ctfefunc6169();
x6169!(ctfefunc6169()) tt;
mixin(ctfefunc6169());
static if(ctfefunc6169()) {}
pragma(msg, ctfefunc6169());
enum xx
{
k = 0,
j = ctfefunc6169a()
}
auto g = mixin('"' ~ ctfefunc6169() ~ '"');
//auto h = import("testx.d" ~ false ? ctfefunc() : "");
alias TT6169!(int, int)[ctfefunc6169a()..ctfefunc6169a()] i;
alias TT6169!(int, int)[ctfefunc6169a()] j;
int[ctfefunc6169a()+1] k;
alias int[ctfefunc6169a()] l;
switch(1)
{
//case ctfefunc6169a(): // Can't do this because of case variables
case ctfefunc6169a()+1:
..
case ctfefunc6169a()+2:
default:
break;
}
static assert(ctfefunc6169a());
void fun(int i : ctfefunc6169a() = ctfefunc6169a(), alias j)() if (ctfefunc6169a()) {}
fun!(ctfefunc6169a(), ctfefunc6169())();
enum z = ctfefptr6169();
auto p = mixin(ctfeprop6169);
}
/***************************************************/
// 10506
void impureFunc10506() {}
string join10506(RoR)(RoR ror)
{
impureFunc10506();
return ror[0] ~ ror[1];
}
void test10506() pure
{
void foobar() {}
mixin(["foo", "bar"].join10506()~";");
}
/***************************************************/
const shared class C5107
{
int x;
}
static assert(is(typeof(C5107.x) == const)); // okay
static assert(is(typeof(C5107.x) == shared)); // fails!
/***************************************************/
immutable struct S3598
{
static void funkcja() { }
}
/***************************************************/
// 4211
@safe struct X130
{
void func() { }
}
@safe class Y130
{
void func() { }
}
@safe void test130()
{
X130 x;
x.func();
auto y = new Y130;
y.func();
}
/***************************************************/
template Return(alias fun)
{
static if (is(typeof(fun) R == return)) alias R Return;
}
interface I4217
{
int square(int n);
real square(real n);
}
alias Return!( __traits(getOverloads, I4217, "square")[0] ) R4217;
alias Return!( __traits(getOverloads, I4217, "square")[1] ) S4217;
static assert(! is(R4217 == S4217));
/***************************************************/
// 5094
void test131()
{
S131 s;
int[] conv = s;
}
struct S131
{
@property int[] get() { return [1,2,3]; }
alias get this;
}
/***************************************************/
struct S7545
{
uint id;
alias id this;
}
void test7545()
{
auto id = 0 ? S7545() : -1;
}
/***************************************************/
// 5020
void test132()
{
S132 s;
if (!s) {}
}
struct S132
{
bool cond;
alias cond this;
}
/***************************************************/
// 5343
struct Tuple5343(Specs...)
{
Specs[0] field;
}
struct S5343(E)
{
immutable E x;
}
enum A5343{a,b,c}
alias Tuple5343!(A5343) TA5343;
alias S5343!(A5343) SA5343;
/***************************************************/
// 5365
interface IFactory
{
void foo();
}
class A133
{
protected static class Factory : IFactory
{
void foo()
{
}
}
this()
{
_factory = createFactory();
}
protected IFactory createFactory()
{
return new Factory;
}
private IFactory _factory;
@property final IFactory factory()
{
return _factory;
}
alias factory this;
}
void test133()
{
IFactory f = new A133;
f.foo(); // segfault
}
/***************************************************/
// 5365
class B134
{
}
class A134
{
B134 _b;
this()
{
_b = new B134;
}
B134 b()
{
return _b;
}
alias b this;
}
void test134()
{
auto a = new A134;
B134 b = a; // b is null
assert(a._b is b); // fails
}
/***************************************************/
// 5025
struct S135 {
void delegate() d;
}
void test135()
{
shared S135[] s;
if (0)
s[0] = S135();
}
/***************************************************/
// 5545
bool enforce136(bool value, lazy const(char)[] msg = null) {
if(!value) {
return false;
}
return value;
}
struct Perm {
byte[3] perm;
ubyte i;
this(byte[] input) {
foreach(elem; input) {
enforce136(i < 3);
perm[i++] = elem;
std.stdio.stderr.writeln(i); // Never gets incremented. Stays at 0.
}
}
}
void test136() {
byte[] stuff = [0, 1, 2];
auto perm2 = Perm(stuff);
writeln(perm2.perm); // Prints [2, 0, 0]
assert(perm2.perm[] == [0, 1, 2]);
}
/***************************************************/
// 4097
void foo4097() { }
alias typeof(&foo4097) T4097;
static assert(is(T4097 X : X*) && is(X == function));
static assert(!is(X));
/***************************************************/
// 5798
void assign9(ref int lhs) pure {
lhs = 9;
}
void assign8(ref int rhs) pure {
rhs = 8;
}
int test137(){
int a=1,b=2;
assign8(b),assign9(a);
assert(a == 9);
assert(b == 8); // <-- fail
assign9(b),assign8(a);
assert(a == 8);
assert(b == 9); // <-- fail
return 0;
}
/***************************************************/
// 9366
static assert(!is(typeof((void[]).init ~ cast(void)0)));
static assert(!is(typeof(cast(void)0 ~ (void[]).init)));
/***************************************************/
struct Size138
{
union
{
struct
{
int width;
int height;
}
long size;
}
}
enum Size138 foo138 = {2 ,5};
Size138 bar138 = foo138;
void test138()
{
assert(bar138.width == 2);
assert(bar138.height == 5);
}
/***************************************************/
void test3822()
{
import core.stdc.stdlib;
int i = 0;
void* ptr;
while(i++ != 2)
{
auto p = alloca(2);
assert(p != ptr);
ptr = p;
}
}
/***************************************************/
// 5939, 5940
template map(fun...)
{
auto map(double[] r)
{
struct Result
{
this(double[] input)
{
}
}
return Result(r);
}
}
void test139()
{
double[] x;
alias typeof(map!"a"(x)) T;
T a = void;
auto b = map!"a"(x);
auto c = [map!"a"(x)];
T[3] d = void;
}
/***************************************************/
// 5966
string[] foo5966(string[] a)
{
a[0] = a[0][0..$];
return a;
}
enum var5966 = foo5966([""]);
/***************************************************/
// 5975
int foo5975(wstring replace)
{
wstring value = "";
value ~= replace;
return 1;
}
enum X5975 = foo5975("X"w);
/***************************************************/
// 5965
template mapx(fun...) if (fun.length >= 1)
{
int mapx(Range)(Range r)
{
return 1;
}
}
void test140()
{
int foo(int i) { return i; }
int[] arr;
auto x = mapx!( (int a){return foo(a);} )(arr);
}
/***************************************************/
void bug5976()
{
int[] barr;
int * k;
foreach (ref b; barr)
{
scope(failure)
k = &b;
k = &b;
}
}
/***************************************************/
// 5771
struct S141
{
this(A)(auto ref A a){}
}
void test141()
{
S141 s = S141(10);
}
/***************************************************/
// 3688
struct S142
{
int v;
this(int n) pure { v = n; }
const bool opCast(T:bool)() { return true; }
}
void test142()
{
if (int a = 1)
assert(a == 1);
else assert(0);
if (const int a = 2)
assert(a == 2);
else assert(0);
if (immutable int a = 3)
assert(a == 3);
else assert(0);
if (auto s = S142(10))
assert(s.v == 10);
else assert(0);
if (auto s = const(S142)(20))
assert(s.v == 20);
else assert(0);
if (auto s = immutable(S142)(30))
assert(s.v == 30);
else assert(0);
}
/***************************************************/
// 6072
static assert({
if (int x = 5) {}
return true;
}());
/***************************************************/
// 5959
int n;
void test143()
{
ref int f(){ return n; } // NG
f() = 1;
assert(n == 1);
nothrow ref int f1(){ return n; } // OK
f1() = 2;
assert(n == 2);
auto ref int f2(){ return n; } // OK
f2() = 3;
assert(n == 3);
}
/***************************************************/
// 6119
void startsWith(alias pred) () if (is(typeof(pred('c', 'd')) : bool))
{
}
void startsWith(alias pred) () if (is(typeof(pred('c', "abc")) : bool))
{
}
void test144()
{
startsWith!((a, b) { return a == b; })();
}
/***************************************************/
void test145()
{
import std.c.stdio;
printf("hello world 145\n");
}
void test146()
{
test1();
static import std.c.stdio;
std.c.stdio.printf("hello world 146\n");
}
/***************************************************/
// 5856
struct X147
{
void f() { writeln("X.f mutable"); }
void f() const { writeln("X.f const"); }
void g()() { writeln("X.g mutable"); }
void g()() const { writeln("X.g const"); }
void opOpAssign(string op)(int n) { writeln("X+= mutable"); }
void opOpAssign(string op)(int n) const { writeln("X+= const"); }
}
void test147()
{
X147 xm;
xm.f(); // prints "X.f mutable"
xm.g(); // prints "X.g mutable"
xm += 10; // should print "X+= mutable" (1)
const(X147) xc;
xc.f(); // prints "X.f const"
xc.g(); // prints "X.g const"
xc += 10; // should print "X+= const" (2)
}
/***************************************************/
void test3559()
{
static class A
{
int foo(int a) { return 0; }
int foo(float a) { return 1; }
int bar(float a) { return 1; }
int bar(int a) { return 0; }
}
static class B : A
{
override int foo(float a) { return 2; }
alias A.foo foo;
alias A.bar bar;
override int bar(float a) { return 2; }
}
{
auto x = new A;
auto f1 = cast(int delegate(int))&x.foo;
auto f2 = cast(int delegate(float))&x.foo;
int delegate(int) f3 = &x.foo;
int delegate(float) f4 = &x.foo;
assert(f1(0) == 0);
assert(f2(0) == 1);
assert(f3(0) == 0);
assert(f4(0) == 1);
}
{
auto x = new B;
auto f1 = cast(int delegate(int))&x.foo;
auto f2 = cast(int delegate(float))&x.foo;
int delegate(int) f3 = &x.foo;
int delegate(float) f4 = &x.foo;
assert(f1(0) == 0);
assert(f2(0) == 2);
assert(f3(0) == 0);
assert(f4(0) == 2);
}
{
auto x = new A;
auto f1 = cast(int delegate(int))&x.bar;
auto f2 = cast(int delegate(float))&x.bar;
int delegate(int) f3 = &x.bar;
int delegate(float) f4 = &x.bar;
assert(f1(0) == 0);
assert(f2(0) == 1);
assert(f3(0) == 0);
assert(f4(0) == 1);
}
{
auto x = new B;
auto f1 = cast(int delegate(int))&x.bar;
auto f2 = cast(int delegate(float))&x.bar;
int delegate(int) f3 = &x.bar;
int delegate(float) f4 = &x.bar;
assert(f1(0) == 0);
assert(f2(0) == 2);
assert(f3(0) == 0);
assert(f4(0) == 2);
}
}
/***************************************************/
// 5897
struct A148{ int n; }
struct B148{
int n, m;
this(A148 a){ n = a.n, m = a.n*2; }
}
struct C148{
int n, m;
static C148 opCall(A148 a)
{
C148 b;
b.n = a.n, b.m = a.n*2;
return b;
}
}
void test148()
{
auto a = A148(10);
auto b = cast(B148)a;
assert(b.n == 10 && b.m == 20);
auto c = cast(C148)a;
assert(c.n == 10 && c.m == 20);
}
/***************************************************/
// 4969
class MyException : Exception
{
this()
{
super("An exception!");
}
}
void throwAway()
{
throw new MyException;
}
void cantthrow() nothrow
{
try
throwAway();
catch(MyException me)
assert(0);
catch(Exception e)
assert(0);
}
/***************************************************/
// 2356
void test2356()
{
int[3] x = [1,2,3];
printf("x[] = [%d %d %d]\n", x[0], x[1], x[2]);
assert(x[0] == 1 && x[1] == 2 && x[2] == 3);
struct S
{
static int pblit;
int n;
this(this) { ++pblit; printf("postblit: %d\n", n); }
}
S s2 = S(2);
S[3] s = [S(1), s2, S(3)];
assert(s[0].n == 1 && s[1].n == 2 && s[2].n == 3);
printf("s[].n = [%d %d %d]\n", s[0].n, s[1].n, s[2].n);
assert(S.pblit == 1);
ubyte[1024] v;
v = typeof(v).init;
printf("v[] = [%d %d %d, ..., %d]\n", v[0], v[1], v[2], v[$-1]);
foreach (ref a; v) assert(a == 0);
int n = 5;
int[3] y = [n, n, n];
printf("y[] = [%d %d %d]\n", y[0], y[1], y[2]);
assert(y[0] == 5 && y[1] == 5 && y[2] == 5);
S[3] z = [s2, s2, s2];
assert(z[0].n == 2 && z[1].n == 2 && z[2].n == 2);
printf("z[].n = [%d %d %d]\n", z[0].n, z[1].n, z[2].n);
assert(S.pblit == 1 + 3);
int[0] nsa0 = [];
void[0] vsa0 = [];
void foo(T)(T){}
foo(vsa0);
ref int[0] bar() { static int[1] sa; return *cast(int[0]*)&sa; }
bar() = [];
}
/***************************************************/
// 11238
void test11238()
{
int[2] m;
m[0] = 4,m[1] = 6;
//printf("%d,%d\n", m[0], m[1]);
assert(m[0] == 4 && m[1] == 6);
m = [m[1], m[0]]; // swap
assert(m[0] == 6 && m[1] == 4);
//printf("%d,%d\n", m[0], m[1]);
m = [m[1], m[0]]; // swap
//printf("%d,%d\n", m[0], m[1]);
assert(m[0] == 4 && m[1] == 6);
}
/***************************************************/
class A2540
{
int a;
int foo() { return 0; }
alias int X;
}
class B2540 : A2540
{
int b;
override super.X foo() { return 1; }
alias this athis;
alias this.b thisb;
alias super.a supera;
alias super.foo superfoo;
alias this.foo thisfoo;
}
struct X2540
{
alias this athis;
}
void test2540()
{
auto x = X2540.athis.init;
static assert(is(typeof(x) == X2540));
B2540 b = new B2540();
assert(&b.a == &b.supera);
assert(&b.b == &b.thisb);
assert(b.thisfoo() == 1);
}
/***************************************************/
// 7295
struct S7295
{
int member;
@property ref int refCountedPayload() { return member; }
alias refCountedPayload this;
}
void foo7295(S)(immutable S t, int qq) pure { }
void foo7295(S)(S s) pure { }
void bar7295() pure
{
S7295 b;
foo7295(b);
}
/***************************************************/
// 5659
void test149()
{
import std.traits;
char a;
immutable(char) b;
static assert(is(typeof(true ? a : b) == const(char)));
static assert(is(typeof([a, b][0]) == const(char)));
static assert(is(CommonType!(typeof(a), typeof(b)) == const(char)));
}
/***************************************************/
// 1373
void func1373a(){}
static assert(typeof(func1373a).stringof == "void()");
static assert(typeof(func1373a).mangleof == "FZv");
static assert(!__traits(compiles, typeof(func1373a).alignof));
static assert(!__traits(compiles, typeof(func1373a).init));
static assert(!__traits(compiles, typeof(func1373a).offsetof));
void func1373b(int n){}
static assert(typeof(func1373b).stringof == "void(int n)");
static assert(typeof(func1373b).mangleof == "FiZv");
static assert(!__traits(compiles, typeof(func1373b).alignof));
static assert(!__traits(compiles, typeof(func1373b).init));
static assert(!__traits(compiles, typeof(func1373b).offsetof));
/***************************************************/
void bar150(T)(T n) { }
@safe void test150()
{
bar150(1);
}
/***************************************************/
void test5785()
{
static struct x { static int y; }
assert(x.y !is 1);
assert(x.y !in [1:0]);
}
/***************************************************/
void bar151(T)(T n) { }
nothrow void test151()
{
bar151(1);
}
/***************************************************/
@property int coo() { return 1; }
@property auto doo(int i) { return i; }
@property int eoo() { return 1; }
@property auto ref hoo(int i) { return i; }
// 3359
int goo(int i) pure { return i; }
auto ioo(int i) pure { return i; }
auto ref boo(int i) pure nothrow { return i; }
class A152 {
auto hoo(int i) pure { return i; }
const boo(int i) const { return i; }
auto coo(int i) const { return i; }
auto doo(int i) immutable { return i; }
auto eoo(int i) shared { return i; }
}
// 4706
struct Foo152(T) {
@property auto ref front() {
return T.init;
}
@property void front(T num) {}
}
void test152() {
Foo152!int foo;
auto a = foo.front;
foo.front = 2;
}
/***************************************************/
// 6733
void bug6733(int a, int b) pure nothrow { }
void test6733() {
int z = 1;
bug6733(z++, z++);
assert(z==3);
}
/***************************************************/
// 3799
void test153()
{
void bar()
{
}
static assert(!__traits(isStaticFunction, bar));
}
/***************************************************/
// 3632
void test154() {
float f;
assert(f is float.init);
double d;
assert(d is double.init);
real r;
assert(r is real.init);
assert(float.nan is float.nan);
assert(double.nan is double.nan);
assert(real.nan is real.nan);
}
/***************************************************/
void test6545()
{
static int[] func()
{
auto a = [1, 2, 3];
auto b = [2, 3, 4];
auto c = [3, 4, 5];
a[] = b[] + c[];
return a;
}
auto a = func();
enum b = func();
assert(a == b);
}
/***************************************************/
// 3147
void test155()
{
byte b = 1;
short s;
int i;
long l;
s = b + b;
b = s % b;
s = s >> b;
b = 1;
b = i % b;
b = b >> i;
}
/***************************************************/
// 2486
void test2486()
{
void foo(ref int[] arr) {}
int[] arr = [1,2,3];
foo(arr); //OK
static assert(!__traits(compiles, foo(arr[1..2]))); // should be NG
struct S
{
int[] a;
auto ref opSlice(){ return a[]; } // line 4
}
S s;
s[];
// opSlice should return rvalue
static assert(is(typeof(&S.opSlice) == int[] function()));
static assert(!__traits(compiles, foo(s[]))); // should be NG
}
/***************************************************/
// 2521
immutable int val = 23;
const int val2 = 23;
ref immutable(int) func2521_() {
return val;
}
ref immutable(int) func2521_2() {
return *&val;
}
ref immutable(int) func2521_3() {
return func2521_;
}
ref const(int) func2521_4() {
return val2;
}
ref const(int) func2521_5() {
return val;
}
auto ref func2521_6() {
return val;
}
ref func2521_7() {
return val;
}
/***************************************************/
void test5554()
{
class MA { }
class MB : MA { }
class MC : MB { }
class A { abstract MA foo(); }
interface I { MB foo(); }
class B : A
{
override MC foo() { return null; }
}
class C : B, I
{
override MC foo() { return null; }
}
}
/***************************************************/
// 5962
struct S156
{
auto g()(){ return 1; }
const auto g()(){ return 2; }
}
void test156()
{
auto ms = S156();
assert(ms.g() == 1);
auto cs = const(S156)();
assert(cs.g() == 2);
}
/***************************************************/
void test10724()
{
const(char)* s = "abc"[0..$-1];
assert(s[2] == '\0');
}
/***************************************************/
void test6708(const ref int y)
{
immutable int x;
test6708(x);
}
/***************************************************/
// 4258
struct Vec4258 {
Vec4258 opOpAssign(string Op)(auto ref Vec4258 other) if (Op == "+") {
return this;
}
Vec4258 opBinary(string Op:"+")(Vec4258 other) {
Vec4258 result;
return result += other;
}
}
void test4258() {
Vec4258 v;
v += Vec4258() + Vec4258(); // line 12
}
// regression fix test
struct Foo4258 {
// binary ++/--
int opPostInc()() if (false) { return 0; }
// binary 1st
int opAdd(R)(R rhs) if (false) { return 0; }
int opAdd_r(R)(R rhs) if (false) { return 0; }
// compare
int opCmp(R)(R rhs) if (false) { return 0; }
// binary-op assign
int opAddAssign(R)(R rhs) if (false) { return 0; }
}
struct Bar4258 {
// binary commutive 1
int opAdd_r(R)(R rhs) if (false) { return 0; }
// binary-op assign
int opOpAssign(string op, R)(R rhs) if (false) { return 0; }
}
struct Baz4258 {
// binary commutive 2
int opAdd(R)(R rhs) if (false) { return 0; }
}
static assert(!is(typeof(Foo4258.init++)));
static assert(!is(typeof(Foo4258.init + 1)));
static assert(!is(typeof(1 + Foo4258.init)));
static assert(!is(typeof(Foo4258.init < Foo4258.init)));
static assert(!is(typeof(Foo4258.init += 1)));
static assert(!is(typeof(Bar4258.init + 1)));
static assert(!is(typeof(Bar4258.init += 1)));
static assert(!is(typeof(1 + Baz4258.init)));
/***************************************************/
// 4539
void test4539()
{
static assert(!__traits(compiles, "hello" = "red"));
void foo1(ref string s){}
void foo2(ref const char[10] s){}
void foo3(ref char[5] s){}
void foo4(ref const char[5] s)
{
assert(s[0] == 'h');
assert(s[4] == 'o');
}
void foo5(ref const ubyte[5] s)
{
assert(s[0] == 0xc3);
assert(s[4] == 0x61);
}
static assert(!__traits(compiles, foo1("hello")));
static assert(!__traits(compiles, foo2("hello")));
static assert(!__traits(compiles, foo3("hello")));
// same as test68, 69, 70
foo4("hello");
foo5(cast(ubyte[5])x"c3fcd3d761");
//import std.conv;
//static assert(!__traits(compiles, parse!int("10") == 10));
}
/***************************************************/
// 1471
void test1471()
{
int n;
string bar = "BOOM"[n..$-1];
assert(bar == "BOO");
}
/***************************************************/
deprecated @disable int bug6389;
static assert(!is(typeof(bug6389 = bug6389)));
/***************************************************/
// 4596
class NoGo4596
{
void fun()
{
static assert(!__traits(compiles, this = new NoGo4596));
static assert(!__traits(compiles, (1?this:this) = new NoGo4596));
static assert(!__traits(compiles, super = new Object));
static assert(!__traits(compiles, (1?super:super) = new Object));
}
}
void test4596()
{
auto n = new NoGo4596;
n.fun();
}
/***************************************************/
void test10927()
{
static assert( (1+2i) ^^ 3 == -11 - 2i );
auto a = (1+2i) ^^ 3;
}
/***************************************************/
void test4963()
{
struct Value {
byte a;
};
Value single()
{
return Value();
}
Value[] list;
auto x = single() ~ list;
}
/***************************************************/
pure int test4031()
{
static const int x = 8;
return x;
}
/***************************************************/
// 5437
template EnumMembers5437(E)
{
template TypeTuple(T...){ alias T TypeTuple; }
alias TypeTuple!("A", "B") EnumMembers5437;
}
template IntValue5437()
{
int IntValue5437 = 10;
}
void test5437()
{
enum Foo { A, B }
alias EnumMembers5437!Foo members; // OK
enum n1 = members.length; // OK
enum n2 = (EnumMembers5437!Foo).length; // NG, type -> symbol
enum s1 = IntValue5437!().sizeof; // OK
enum s2 = (IntValue5437!()).sizeof; // NG, type -> expression
}
/***************************************************/
// 1962
void test1962()
{
class C { abstract void x(); }
assert(C.classinfo.create() is null);
}
/***************************************************/
// 6228
void test6228()
{
const(int)* ptr;
const(int) temp;
auto x = (*ptr) ^^ temp;
}
/***************************************************/
int test7544()
{
try { throw new Exception(""); }
catch (Exception e) static assert(1);
return 1;
}
static assert(test7544());
/***************************************************/
struct S6230 {
int p;
int q() const pure {
return p;
}
void r() pure {
p = 231;
}
}
class C6230 {
int p;
int q() const pure {
return p;
}
void r() pure {
p = 552;
}
}
int q6230(ref const S6230 s) pure { // <-- Currently OK
return s.p;
}
int q6230(ref const C6230 c) pure { // <-- Currently OK
return c.p;
}
void r6230(ref S6230 s) pure {
s.p = 244;
}
void r6230(ref C6230 c) pure {
c.p = 156;
}
bool test6230pure() pure {
auto s = S6230(4);
assert(s.p == 4);
assert(q6230(s) == 4);
assert(s.q == 4);
auto c = new C6230;
c.p = 6;
assert(q6230(c) == 6);
assert(c.q == 6);
r6230(s);
assert(s.p == 244);
s.r();
assert(s.p == 231);
r6230(c);
assert(c.p == 156);
c.r();
assert(c.p == 552);
return true;
}
void test6230() {
assert(test6230pure());
}
/***************************************************/
void test6264()
{
struct S { auto opSlice() { return this; } }
int[] a;
S s;
static assert(!is(typeof(a[] = s[])));
int*[] b;
static assert(!is(typeof(b[] = [new immutable(int)])));
char[] c = new char[](5);
c[] = "hello";
}
/***************************************************/
// 5046
void test5046()
{
auto va = S5046!("", int)();
auto vb = makeS5046!("", int)();
}
struct S5046(alias p, T)
{
T s;
T fun() { return s; } // (10)
}
S5046!(p, T) makeS5046(alias p, T)()
{
return typeof(return)();
}
/***************************************************/
// 6335
struct S6335
{
const int value;
this()(int n){ value = n; }
}
void test6335()
{
S6335 s = S6335(10);
}
/***************************************************/
struct S6295(int N) {
int[N] x;
const nothrow pure @safe f() { return x.length; }
}
void test6295() {
auto bar(T: S6295!(N), int N)(T x) {
return x.f();
}
S6295!4 x;
assert(bar(x) == 4);
}
/***************************************************/
template TT4536(T...) { alias T TT4536; }
void test4536()
{
auto x = TT4536!(int, long, [1, 2]).init;
assert(x[0] is int.init);
assert(x[1] is long.init);
assert(x[2] is [1, 2].init);
}
/***************************************************/
struct S6284 {
int a;
}
class C6284 {
int a;
}
pure int bug6284a() {
S6284 s = {4};
auto b = s.a; // ok
with (s) {
b += a; // should be ok.
}
return b;
}
pure int bug6284b() {
auto s = new S6284;
s.a = 4;
auto b = s.a;
with (*s) {
b += a;
}
return b;
}
pure int bug6284c() {
auto s = new C6284;
s.a = 4;
auto b = s.a;
with (s) {
b += a;
}
return b;
}
void test6284() {
assert(bug6284a() == 8);
assert(bug6284b() == 8);
assert(bug6284c() == 8);
}
/***************************************************/
class C6293 {
C6293 token;
}
void f6293(in C6293[] a) pure {
auto x0 = a[0].token;
assert(x0 is a[0].token.token.token);
assert(x0 is (&x0).token);
auto p1 = &x0 + 1;
assert(x0 is (p1 - 1).token);
int c = 0;
assert(x0 is a[c].token);
}
void test6293() {
auto x = new C6293;
x.token = x;
f6293([x]);
}
/***************************************************/
// 2774
int foo2774(int n){ return 0; }
static assert(foo2774.mangleof == "_D7xtest467foo2774FiZi");
class C2774
{
int foo2774(){ return 0; }
}
static assert(C2774.foo2774.mangleof == "_D7xtest465C27747foo2774MFZi");
template TFoo2774(T){}
static assert(TFoo2774!int.mangleof == "7xtest4615__T8TFoo2774TiZ");
void test2774()
{
int foo2774(int n){ return 0; }
static assert(foo2774.mangleof == "_D7xtest468test2774FZv7foo2774MFiZi");
}
/***************************************************/
// 3733
class C3733
{
int foo() { return 1; }
int foo() shared { return 2; }
int bar() { return foo(); }
}
void test3733()
{
auto c = new C3733();
assert(c.bar() == 1);
}
/***************************************************/
// 4392
class C4392
{
int foo() const { return 1; }
int foo() { return 2; }
int bar() const { return foo(); }
}
void test4392()
{
auto c = new C4392();
assert(c.bar() == 1);
}
/***************************************************/
// 6220
void test6220() {
struct Foobar { real x; real y; real z;};
switch("x") {
foreach(i,member; __traits(allMembers, Foobar)) {
case member : break;
}
default : break;
}
}
/***************************************************/
// 5799
void test5799()
{
int a;
int *u = &(a ? a : (a ? a : a));
assert(u == &a);
}
/***************************************************/
// 6529
enum Foo6529 : char { A='a' }
ref const(Foo6529) func6529(const(Foo6529)[] arr){ return arr[0]; }
/***************************************************/
void test783()
{
const arr = [ 1,2,3 ];
const i = 2;
auto jhk = new int[arr[i]]; // "need size of rightmost array, not type arr[i]"
}
/***************************************************/
template X157(alias x)
{
alias x X157;
}
template Parent(alias foo)
{
alias X157!(__traits(parent, foo)) Parent;
}
template ParameterTypeTuple(alias foo)
{
static if (is(typeof(foo) P == function))
alias P ParameterTypeTuple;
else
static assert(0, "argument has no parameters");
}
template Mfp(alias foo)
{
auto Mfp = function(Parent!foo self, ParameterTypeTuple!foo i) { return self.foo(i); };
}
class C157 {
int a = 3;
int foo(int i, int y) { return i + a + y; }
}
void test157()
{
auto c = new C157();
auto mfp = Mfp!(C157.foo);
auto i = mfp(c, 1, 7);
assert(i == 11);
}
/***************************************************/
// 6473
struct Eins6473
{
~this() {}
}
struct Zwei6473
{
void build(Eins6473 devices = Eins6473())
{
}
}
void build(Eins6473 devices = Eins6473())
{}
void test6473()
{
void build(Eins6473 devices = Eins6473())
{}
}
/***************************************************/
uint rol11417(uint n)(in uint x)
{
return x << n | x >> 32 - n;
}
uint ror11417(uint n)(in uint x)
{
return x >> n | x << 32 - n;
}
void test11417()
{
assert(rol11417!1(0x8000_0000) == 0x1);
assert(ror11417!1(0x1) == 0x8000_0000);
}
/***************************************************/
void test6578()
{
static struct Foo
{
this(int x) pure {}
}
auto f1 = new const(Foo)(1);
auto f2 = new immutable(Foo)(1);
auto f3 = new shared(Foo)(1);
auto f4 = const(Foo)(1);
auto f5 = immutable(Foo)(1);
auto f6 = shared(Foo)(1);
static assert(is(typeof(f1) == const(Foo)*));
static assert(is(typeof(f2) == immutable(Foo)*));
static assert(is(typeof(f3) == shared(Foo)*));
static assert(is(typeof(f4) == const(Foo)));
static assert(is(typeof(f5) == immutable(Foo)));
static assert(is(typeof(f6) == shared(Foo)));
static struct Bar
{
this(int x) const pure {}
}
auto g1 = new const(Bar)(1);
auto g2 = new immutable(Bar)(1);
auto g3 = new shared(Bar)(1);
auto g4 = const(Bar)(1);
auto g5 = immutable(Bar)(1);
auto g6 = shared(Bar)(1);
static assert(is(typeof(g1) == const(Bar)*));
static assert(is(typeof(g2) == immutable(Bar)*));
static assert(is(typeof(g3) == shared(Bar)*));
static assert(is(typeof(g4) == const(Bar)));
static assert(is(typeof(g5) == immutable(Bar)));
static assert(is(typeof(g6) == shared(Bar)));
static struct Baz
{
this()(int x) const pure {}
}
auto h1 = new const(Baz)(1);
auto h2 = new immutable(Baz)(1);
auto h3 = new shared(const(Baz))(1);
auto h4 = const(Baz)(1);
auto h5 = immutable(Baz)(1);
auto h6 = shared(const(Baz))(1);
static assert(is(typeof(h1) == const(Baz)*));
static assert(is(typeof(h2) == immutable(Baz)*));
static assert(is(typeof(h3) == shared(const(Baz))*));
static assert(is(typeof(h4) == const(Baz)));
static assert(is(typeof(h5) == immutable(Baz)));
static assert(is(typeof(h6) == shared(const(Baz))));
}
/***************************************************/
// 6630
void test6630()
{
static class B {}
static class A
{
this() { b = new B(); }
B b;
alias b this;
}
void fun(A a)
{
a = null;
assert(a is null);
}
auto a = new A;
assert(a.b !is null);
fun(a);
assert(a !is null);
assert(a.b !is null);
}
/***************************************************/
// 6690
T useLazy6690(T)(lazy T val)
{
return val;
// val is converted to delegate call, but it is typed as int delegate() - not @safe!
}
void test6690() @safe
{
useLazy6690(0);
// Error: safe function 'test6690' cannot call system function 'useLazy6690'
}
/***************************************************/
template Hoge6691()
{
immutable static int[int] dict;
immutable static int value;
static this()
{
dict = [1:1, 2:2];
value = 10;
}
}
alias Hoge6691!() H6691;
/***************************************************/
void test10626()
{
double[2] v, x;
struct Y { double u; }
double z;
Y y;
double[2] r = v[] * x[0];
//double[2] s = v[] * z++;
//double[2] t = v[] * z--;
double[2] a = v[] * ++z;
double[2] b = v[] * --z;
double[2] c = v[] * y.u;
double[2] d = v[] * (x[] = 3, x[0]);
double[2] e = v[] * (v[] ~ z)[0];
}
/***************************************************/
// 2953
template Tuple2953(T...)
{
alias T Tuple2953;
}
template Range2953(int b)
{
alias Tuple2953!(1) Range2953;
}
void foo2953()()
{
Tuple2953!(int, int) args;
foreach( x ; Range2953!(args.length) ){ }
}
void test2953()
{
foo2953!()();
}
/***************************************************/
// 2997
abstract class B2997 { void foo(); }
interface I2997 { void bar(); }
abstract class C2997 : B2997, I2997 {}
//pragma(msg, __traits(allMembers, C).stringof);
void test2997()
{
enum ObjectMembers = ["toString","toHash","opCmp","opEquals","Monitor","factory"];
static assert([__traits(allMembers, C2997)] == ["foo"] ~ ObjectMembers ~ ["bar"]);
}
/***************************************************/
// 6596
extern (C) int function() pfunc6596;
extern (C) int cfunc6596(){ return 0; }
static assert(typeof(pfunc6596).stringof == "extern (C) int function()");
static assert(typeof(cfunc6596).stringof == "extern (C) int()");
/***************************************************/
// 4647
interface Timer
{
final int run() { printf("Timer.run()\n"); fun(); return 1; };
int fun();
}
interface Application
{
final int run() { printf("Application.run()\n"); fun(); return 2; };
int fun();
}
class TimedApp : Timer, Application
{
int funCalls;
override int fun()
{
printf("TimedApp.fun()\n");
funCalls++;
return 2;
}
}
class SubTimedApp : TimedApp
{
int subFunCalls;
override int fun()
{
printf("SubTimedApp.fun()\n");
subFunCalls++;
return 1;
}
}
void test4647()
{
//Test access to TimedApps base interfaces
auto app = new TimedApp();
assert((cast(Application)app).run() == 2);
assert((cast(Timer)app).run() == 1);
assert(app.Timer.run() == 1); // error, no Timer property
assert(app.Application.run() == 2); // error, no Application property
assert(app.run() == 1); // This would call Timer.run() if the two calls
// above were commented out
assert(app.funCalls == 5);
assert(app.TimedApp.fun() == 2);
assert(app.funCalls == 6);
//Test direct access to SubTimedApp interfaces
auto app2 = new SubTimedApp();
assert((cast(Application)app2).run() == 2);
assert((cast(Timer)app2).run() == 1);
assert(app2.Application.run() == 2);
assert(app2.Timer.run() == 1);
assert(app2.funCalls == 0);
assert(app2.subFunCalls == 4);
assert(app2.fun() == 1);
assert(app2.SubTimedApp.fun() == 1);
assert(app2.funCalls == 0);
assert(app2.subFunCalls == 6);
//Test access to SubTimedApp interfaces via TimedApp
auto app3 = new SubTimedApp();
(cast(Timer)cast(TimedApp)app3).run();
app3.TimedApp.Timer.run();
assert((cast(Application)cast(TimedApp)app3).run() == 2);
assert((cast(Timer)cast(TimedApp)app3).run() == 1);
assert(app3.TimedApp.Application.run() == 2);
assert(app3.TimedApp.Timer.run() == 1);
assert(app3.funCalls == 0);
assert(app3.subFunCalls == 6);
}
/***************************************************/
template T1064(E...) { alias E T1064; }
int[] var1064 = [ T1064!(T1064!(T1064!(1, 2), T1064!(), T1064!(3)), T1064!(4, T1064!(T1064!(T1064!(T1064!(5)))), T1064!(T1064!(T1064!(T1064!())))),6) ];
void test1064()
{
assert(var1064 == [1,2,3,4,5,6]);
}
/***************************************************/
// 5696
template Seq5696(T...){ alias T Seq5696; }
template Pred5696(T) { alias T Pred5696; } // TOKtemplate
template Scope5696(int n){ template X(T) { alias T X; } } // TOKimport
T foo5696(T)(T x) { return x; }
void test5696()
{
foreach (pred; Seq5696!(Pred5696, Pred5696))
{
static assert(is(pred!int == int));
}
foreach (scop; Seq5696!(Scope5696!0, Scope5696!1))
{
static assert(is(scop.X!int == int));
}
alias Seq5696!(foo5696, foo5696) funcs;
assert(funcs[0](0) == 0);
assert(funcs[1](1) == 1);
foreach (i, fn; funcs)
{
assert(fn(i) == i);
}
}
/***************************************************/
// 5933
int dummyfunc5933();
alias typeof(dummyfunc5933) FuncType5933;
struct S5933a { auto x() { return 0; } }
static assert(is(typeof(&S5933a.init.x) == int delegate()));
struct S5933b { auto x() { return 0; } }
static assert(is(typeof(S5933b.init.x) == FuncType5933));
struct S5933c { auto x() { return 0; } }
static assert(is(typeof(&S5933c.x) == int function()));
struct S5933d { auto x() { return 0; } }
static assert(is(typeof(S5933d.x) == FuncType5933));
class C5933a { auto x() { return 0; } }
static assert(is(typeof(&(new C5933b()).x) == int delegate()));
class C5933b { auto x() { return 0; } }
static assert(is(typeof((new C5933b()).x) == FuncType5933));
class C5933c { auto x() { return 0; } }
static assert(is(typeof(&C5933c.x) == int function()));
class C5933d { auto x() { return 0; } }
static assert(is(typeof(C5933d.x) == FuncType5933));
/***************************************************/
// 6084
template TypeTuple6084(T...){ alias T TypeTuple6084; }
void test6084()
{
int foo(int x)() { return x; }
foreach(i; TypeTuple6084!(0))
foo!(i);
}
/***************************************************/
// 3133
void test3133()
{
short[2] x = [1,2];
int[1] y = cast(int[1])x;
short[1] z = [1];
static assert(!__traits(compiles, y = cast(int[1])z));
}
/***************************************************/
// 6763
template TypeTuple6763(TList...)
{
alias TList TypeTuple6763;
}
alias TypeTuple6763!(int) T6763;
void f6763( T6763) { } ///
void c6763(const T6763) { } ///T now is (const int)
void r6763(ref T6763) { } ///T now is(ref const int)
void i6763(in T6763) { } ///Uncomment to get an Assertion failure in 'mtype.c'
void o6763(out T6763) { } ///ditto
void test6763()
{
int n;
f6763(0); //With D2: Error: function main.f ((ref const const(int) _param_0)) is not callable using argument types (int)
c6763(0);
r6763(n); static assert(!__traits(compiles, r6763(0)));
i6763(0);
o6763(n); static assert(!__traits(compiles, o6763(0)));
// 6755
static assert(typeof(f6763).stringof == "void(int _param_0)");
static assert(typeof(c6763).stringof == "void(const(int) _param_0)");
static assert(typeof(r6763).stringof == "void(ref int _param_0)");
static assert(typeof(i6763).stringof == "void(const(int) _param_0)");
static assert(typeof(o6763).stringof == "void(out int _param_0)");
}
/***************************************************/
// 6695
struct X6695
{
void mfunc()
{
static assert(is(typeof(this) == X6695));
}
void cfunc() const
{
static assert(is(typeof(this) == const(X6695)));
}
void ifunc() immutable
{
static assert(is(typeof(this) == immutable(X6695)));
}
void sfunc() shared
{
static assert(is(typeof(this) == shared(X6695)));
}
void scfunc() shared const
{
static assert(is(typeof(this) == shared(const(X6695))));
}
void wfunc() inout
{
static assert(is(typeof(this) == inout(X6695)));
}
void swfunc() shared inout
{
static assert(is(typeof(this) == shared(inout(X6695))));
}
static assert(is(typeof(this) == X6695));
}
/***************************************************/
// 6087
template True6087(T)
{
immutable True6087 = true;
}
struct Foo6087
{
static assert( True6087!(typeof(this)) );
}
struct Bar6087
{
static assert( is(typeof(this) == Bar6087) );
}
/***************************************************/
// 6848
class Foo6848 {}
class Bar6848 : Foo6848
{
void func() immutable
{
static assert(is(typeof(this) == immutable(Bar6848))); // immutable(Bar6848)
auto t = this;
static assert(is(typeof(t) == immutable(Bar6848))); // immutable(Bar6848)
static assert(is(typeof(super) == immutable(Foo6848))); // Foo6848 instead of immutable(Foo6848)
auto s = super;
static assert(is(typeof(s) == immutable(Foo6848))); // Foo6848 instead of immutable(Foo6848)
}
}
/***************************************************/
version(none)
{
cent issue785;
ucent issue785;
}
static assert(!is(cent) && !is(ucent));
static assert(!__traits(compiles, { cent x; }));
/***************************************************/
// 6847
template True6847(T)
{
immutable True6847 = true;
}
class Foo6847
{}
class Bar6847 : Foo6847
{
static assert( True6847!(typeof(super)) );
static assert( is(typeof(super) == Foo6847) );
}
/***************************************************/
// http://d.puremagic.com/issues/show_bug.cgi?id=6488
struct TickDuration
{
template to(T) if (__traits(isIntegral,T))
{
const T to()
{
return 1;
}
}
template to(T) if (__traits(isFloating,T))
{
const T to()
{
return 0;
}
}
const long seconds()
{
return to!(long)();
}
}
void test6488()
{
TickDuration d;
d.seconds();
}
/***************************************************/
// 6836
template map6836(fun...) if (fun.length >= 1)
{
auto map6836(Range)(Range r)
{
}
}
void test6836()
{
[1].map6836!"a"();
}
/***************************************************/
void test5448()
{
int[int][] aaa = [[1: 2]];
int[string][] a2 = [["cc":0], ["DD":10]];
}
/***************************************************/
// 6837
struct Ref6837a(T)
{
T storage;
alias storage this;
}
struct Ref6837b(T)
{
T storage;
@property ref T get(){ return storage; }
alias get this;
}
int front6837(int[] arr){ return arr[0]; }
void popFront6837(ref int[] arr){ arr = arr[1..$]; }
void test6837()
{
assert([1,2,3].front6837 == 1);
auto r1 = Ref6837a!(int[])([1,2,3]);
assert(r1.front6837() == 1); // ng
assert(r1.front6837 == 1); // ok
r1.popFront6837(); // ng
r1.storage.popFront6837(); // ok
auto r2 = Ref6837b!(int[])([1,2,3]);
assert(r2.front6837() == 1); // ng
assert(r2.front6837 == 1); // ok
r2.popFront6837(); // ng
r2.get.popFront6837(); // ng
r2.get().popFront6837(); // ok
}
/***************************************************/
// 6927
@property int[] foo6927()
{
return [1, 2];
}
int[] bar6927(int[] a)
{
return a;
}
void test6927()
{
bar6927(foo6927); // OK
foo6927.bar6927(); // line 9, Error
}
/***************************************************/
struct Foo6813(T)
{
Foo6813 Bar()
{
return Foo6813(_indices.abc());
}
T _indices;
}
struct SortedRange(alias pred)
{
SortedRange abc()
{
return SortedRange();
}
}
void test6813() {
auto ind = SortedRange!({ })();
auto a = Foo6813!(typeof(ind))();
}
/***************************************************/
struct Interval6753{ int a,b; }
@safe struct S6753
{
int[] arr;
@trusted @property auto byInterval() const
{
return cast(const(Interval6753)[])arr;
}
}
/***************************************************/
// 6859
class Parent6859
{
public:
bool isHage() const @property;
public:
abstract void fuga()
out
{
assert(isHage);
}
body { }
}
class Child6859 : Parent6859
{
override bool isHage() const @property
{
return true;
}
override void fuga()
{
//nop
}
}
void test6859()
{
auto t = new Child6859;
t.fuga();
printf("done.\n");
}
/***************************************************/
// 6910
template Test6910(alias i, B)
{
void fn()
{
foreach(t; B.Types)
{
switch(i)
{
case 0://IndexOf!(t, B.Types):
{
pragma(msg, __traits(allMembers, t));
pragma(msg, __traits(hasMember, t, "m"));
static assert(__traits(hasMember, t, "m")); // test
break;
}
default: {}
}
}
}
}
void test6910()
{
static struct Bag(S...)
{
alias S Types;
}
static struct A
{
int m;
}
int i;
alias Test6910!(i, Bag!(A)).fn func;
}
/***************************************************/
// 6902
void test6902()
{
static assert(is(typeof({
return int.init; // int, long, real, etc.
})));
int f() pure nothrow { assert(0); }
alias int T() pure nothrow;
static if(is(typeof(&f) DT == delegate))
{
static assert(is(DT* == T*)); // ok
// Error: static assert (is(pure nothrow int() == pure nothrow int())) is false
static assert(is(DT == T));
}
}
/***************************************************/
// 6330
struct S6330
{
void opAssign(S6330 s) @disable
{
assert(0); // This fails.
}
}
void test6330()
{
S6330 s;
S6330 s2;
static assert(!is(typeof({ s2 = s; })));
}
/***************************************************/
// 5311
class C5311
{
private static int globalData;
void breaksPure() pure const
{
static assert(!__traits(compiles, { globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { X.globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { this.globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { int a = this.globalData; }));
}
}
static void breaksPure5311a(C5311 x) pure
{
static assert(!__traits(compiles, { x.globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { int a = x.globalData; }));
}
struct S5311
{
private static int globalData;
void breaksPure() pure const
{
static assert(!__traits(compiles, { globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { X.globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { this.globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { int a = this.globalData; }));
}
}
static void breaksPure5311b(S5311 x) pure
{
static assert(!__traits(compiles, { x.globalData++; })); // SHOULD BE ERROR
static assert(!__traits(compiles, { int a = x.globalData; }));
}
/***************************************************/
// 6868
@property bool empty6868(T)(in T[] a) @safe pure nothrow
{
return !a.length;
}
void test6868()
{
alias int[] Range;
static if (is(char[1 + Range.empty6868])) // Line 9
enum bool isInfinite = true;
char[0] s; // need
}
/***************************************************/
// 2856
struct foo2856 { static void opIndex(int i) { printf("foo\n"); } }
struct bar2856(T) { static void opIndex(int i) { printf("bar\n"); } }
void test2856()
{
foo2856[1];
bar2856!(float)[1]; // Error (# = __LINE__)
alias bar2856!(float) B;
B[1]; // Okay
}
/***************************************************/
// 3091
void test3091(inout int = 0)
{
struct Foo {}
auto pm = new Foo; static assert(is( typeof( pm) == Foo * ));
auto pc = new const Foo; static assert(is( typeof( pc) == const(Foo) * ));
auto pw = new inout Foo; static assert(is( typeof( pw) == inout(Foo) * ));
auto psm = new shared Foo; static assert(is( typeof(psm) == shared(Foo) * ));
auto psc = new shared const Foo; static assert(is( typeof(psc) == shared(const(Foo))* ));
auto psw = new shared inout Foo; static assert(is( typeof(psw) == shared(inout(Foo))* ));
auto pi = new immutable Foo; static assert(is( typeof( pi) == immutable(Foo) * ));
auto m = Foo(); static assert(is( typeof( m) == Foo ));
auto c = const Foo(); static assert(is( typeof( c) == const(Foo) ));
auto w = inout Foo(); static assert(is( typeof( w) == inout(Foo) ));
auto sm = shared Foo(); static assert(is( typeof(sm) == shared(Foo) ));
auto sc = shared const Foo(); static assert(is( typeof(sc) == shared(const(Foo)) ));
auto sw = shared inout Foo(); static assert(is( typeof(sw) == shared(inout(Foo)) ));
auto i = immutable Foo(); static assert(is( typeof( i) == immutable(Foo) ));
}
/***************************************************/
// 6837
template Id6837(T)
{
alias T Id6837;
}
static assert(is(Id6837!(shared const int) == shared const int));
static assert(is(Id6837!(shared inout int) == shared inout int));
/***************************************************/
// 6056 fixup
template ParameterTypeTuple6056(func)
{
static if (is(func Fptr : Fptr*) && is(Fptr P == function))
alias P ParameterTypeTuple6056;
else
static assert(0, "argument has no parameters");
}
extern(C) alias void function() fpw_t;
alias void function(fpw_t fp) cb_t;
void bar6056(ParameterTypeTuple6056!(cb_t) args) {
pragma (msg, "TFunction1: " ~ typeof(args[0]).stringof);
}
extern(C) void foo6056() { }
void test6056()
{
bar6056(&foo6056);
}
/***************************************************/
// 6356
int f6356()(int a)
{
return a*a;
}
alias f6356!() g6356; // comment this out to eliminate the errors
pure nothrow @safe int i6356()
{
return f6356(1);
}
void test6356()
{
assert(i6356() == 1);
}
/***************************************************/
// 7108
static assert(!__traits(hasMember, int, "x"));
static assert( __traits(hasMember, int, "init"));
/***************************************************/
// 7073
void test7073()
{
string f(int[] arr...)
{
return "";
}
}
/***************************************************/
// 7150
struct A7150
{
static int cnt;
this(T)(T thing, int i)
{
this(thing, i > 0); // Error: constructor call must be in a constructor
++cnt;
}
this(T)(T thing, bool b)
{
++cnt;
}
}
void test7150()
{
auto a = A7150(5, 5); // Error: template instance constructtest.A.__ctor!(int) error instantiating
assert(A7150.cnt == 2);
}
/***************************************************/
// 7159
alias void delegate() Void7159;
class HomeController7159 {
Void7159 foo() {
return cast(Void7159)&HomeController7159.displayDefault;
}
auto displayDefault() {
return 1;
}
}
/***************************************************/
// 7160
class HomeController {
static if (false) {
mixin(q{ int a; });
}
void foo() {
foreach (m; __traits(derivedMembers, HomeController)) {
}
}
}
void test7160()
{}
/***************************************************/
// 7168
void test7168()
{
static class X
{
void foo(){}
}
static class Y : X
{
void bar(){}
}
enum ObjectMembers = ["toString","toHash","opCmp","opEquals","Monitor","factory"];
static assert([__traits(allMembers, X)] == ["foo"]~ObjectMembers); // pass
static assert([__traits(allMembers, Y)] == ["bar", "foo"]~ObjectMembers); // fail
static assert([__traits(allMembers, Y)] != ["bar", "foo"]); // fail
}
/***************************************************/
// 7170
T to7170(T)(string x) { return 1; }
void test7170()
{
// auto i = to7170!int("1"); // OK
auto j = "1".to7170!int(); // NG, Internal error: e2ir.c 683
}
/***************************************************/
// 7196
auto foo7196(int x){return x;}
auto foo7196(double x){return x;}
void test7196()
{
auto x = (&foo7196)(1); // ok
auto y = (&foo7196)(1.0); // fail
}
/***************************************************/
// 7285
int[2] spam7285()
{
int[2] ab;
if (true)
return (true) ? ab : [0, 0]; // Error
else
return (true) ? [0, 0] : ab; // OK
}
void test7285()
{
auto sa = spam7285();
}
/***************************************************/
// 7321
void test7321()
{
static assert(is(typeof((){})==void function()pure nothrow @safe)); // ok
static assert(is(typeof((){return;})==void function()pure nothrow @safe)); // fail
}
/***************************************************/
class A158
{
pure void foo1() { }
const void foo2() { }
nothrow void foo3() { }
@safe void foo4() { }
}
class B158 : A158
{
override void foo1() { }
override void foo2() const { }
override void foo3() { }
override void foo4() { }
}
/***************************************************/
// 9231
class B9231 { void foo() inout pure {} }
class D9231 : B9231 { override void foo() inout {} }
/***************************************************/
// 3282
class Base3282
{
string f()
{
return "Base.f()";
}
}
class Derived3282 : Base3282
{
override string f()
{
return "Derived.f()";
}
/*override*/ string f() const
{
return "Derived.f() const";
}
}
void test3282()
{
auto x = new Base3282;
assert(x.f() == "Base.f()");
auto y = new Derived3282;
assert(y.f() == "Derived.f()");// calls "Derived.f() const", but it is expected that be called non-const.
auto z = new const(Derived3282);
assert(z.f() == "Derived.f() const");
}
/***************************************************/
// 7534
class C7534
{
int foo(){ return 1; }
}
class D7534 : C7534
{
override int foo(){ return 2; }
/*override*/ int foo() const { return 3; }
// Error: D.foo multiple overrides of same function
}
void test7534()
{
C7534 mc = new C7534();
assert(mc.foo() == 1);
D7534 md = new D7534();
assert(md.foo() == 2);
mc = md;
assert(mc.foo() == 2);
const(D7534) cd = new const(D7534)();
assert(cd.foo() == 3);
md = cast()cd;
assert(md.foo() == 2);
}
/***************************************************/
// 7534 + return type covariance
class X7534 {}
class Y7534 : X7534
{
int value; this(int n){ value = n; }
}
class V7534
{
X7534 foo(){ return new X7534(); }
}
class W7534 : V7534
{
override Y7534 foo(){ return new Y7534(1); }
/*override*/ Y7534 foo() const { return new Y7534(2); }
}
void test7534cov()
{
auto mv = new V7534();
assert(typeid(mv.foo()) == typeid(X7534));
auto mw = new W7534();
assert(typeid(mw.foo()) == typeid(Y7534));
assert(mw.foo().value == 1);
mv = mw;
assert(typeid(mv.foo()) == typeid(Y7534));
assert((cast(Y7534)mv.foo()).value == 1);
auto cw = new const(W7534)();
assert(typeid(cw.foo()) == typeid(Y7534));
assert(cw.foo().value == 2);
}
/***************************************************/
// 7562
static struct MyInt
{
private int value;
mixin ProxyOf!value;
}
mixin template ProxyOf(alias a)
{
template X1(){}
template X2(){}
template X3(){}
template X4(){}
template X5(){}
template X6(){}
template X7(){}
template X8(){}
template X9(){}
template X10(){}
void test1(this X)(){}
void test2(this Y)(){}
}
/***************************************************/
// 7583
template Tup7583(E...) { alias E Tup7583; }
struct S7583
{
Tup7583!(float, char) field;
alias field this;
this(int x) { }
}
int bug7583() {
S7583[] arr;
arr ~= S7583(0);
return 1;
}
static assert (bug7583());
/***************************************************/
// 7618
void test7618(const int x = 1)
{
int func(ref int x) { return 1; }
static assert(!__traits(compiles, func(x)));
// Error: function test.foo.func (ref int _param_0) is not callable using argument types (const(int))
int delegate(ref int) dg = (ref int x) => 1;
static assert(!__traits(compiles, dg(x)));
// --> no error, bad!
int function(ref int) fp = (ref int x) => 1;
static assert(!__traits(compiles, fp(x)));
// --> no error, bad!
}
/***************************************************/
// 7621
void test7621()
{
enum uint N = 4u;
char[] A = "hello".dup;
uint[immutable char[4u]] dict;
dict[*cast(immutable char[4]*)(A[0 .. N].ptr)] = 0; // OK
dict[*cast(immutable char[N]*)(A[0 .. N].ptr)] = 0; // line 6, error
}
/***************************************************/
// 7682
template ConstOf7682(T)
{
alias const(T) ConstOf7682;
}
bool pointsTo7682(S)(ref const S source) @trusted pure nothrow
{
return true;
}
void test7682()
{
shared(ConstOf7682!(int[])) x; // line A
struct S3 { int[10] a; }
shared(S3) sh3;
shared(int[]) sh3sub = sh3.a[];
assert(pointsTo7682(sh3sub)); // line B
}
/***************************************************/
// 7735
void a7735(void[][] data...)
{
//writeln(data);
assert(data.length == 1);
b7735(data);
}
void b7735(void[][] data...)
{
//writeln(data);
assert(data.length == 1);
c7735(data);
}
void c7735(void[][] data...)
{
//writeln(data);
assert(data.length == 1);
}
void test7735()
{
a7735([]);
a7735([]);
}
/***************************************************/
// 7815
mixin template Helpers() {
static if (is(Flags!Move)) {
Flags!Move flags;
} else {
// DMD will happily instantiate the allegedly
// non-existent Flags!This here. (!)
pragma(msg, __traits(derivedMembers, Flags!Move));
}
}
template Flags(T) {
mixin({
int defs = 1;
foreach (name; __traits(derivedMembers, Move)) {
defs++;
}
if (defs) {
return "struct Flags { bool a; }";
} else {
return "";
}
}());
}
struct Move {
int a;
mixin Helpers!();
}
enum a7815 = Move.init.flags;
/***************************************************/
struct A7823 {
long a;
enum A7823 b = {0};
}
void test7823(A7823 a = A7823.b) { }
/***************************************************/
// 7871
struct Tuple7871
{
string field;
alias field this;
}
//auto findSplitBefore(R1)(R1 haystack)
auto findSplitBefore7871(string haystack)
{
return Tuple7871(haystack);
}
void test7871()
{
string line = `<bookmark href="https://stuff">`;
auto a = findSplitBefore7871(line[0 .. $])[0];
}
/***************************************************/
// 7906
void test7906()
{
static assert(!__traits(compiles, { enum s = [string.min]; }));
}
/***************************************************/
// 7907
template Id7907(E)
{
alias E Id7907;
}
template Id7907(alias E)
{
alias E Id7907;
}
void test7907()
{
static assert(!__traits(compiles, { alias Id7907!([string.min]) X; }));
}
/***************************************************/
// 1175
class A1175
{
class I1 { }
}
class B1175 : A1175
{
class I2 : I1 { }
I1 getI() { return new I2; }
}
/***************************************************/
// 7983
class A7983 {
void f() {
g7983(this);
}
unittest {
}
}
void g7983(T)(T a)
{
foreach (name; __traits(allMembers, T)) {
pragma(msg, name);
static if (__traits(compiles, &__traits(getMember, a, name)))
{
}
}
}
/***************************************************/
// 8004
void test8004()
{
auto n = (int n = 10){ return n; }();
assert(n == 10);
}
/***************************************************/
// 8064
void test8064()
{
uint[5] arry;
ref uint acc(size_t i) {
return arry[i];
}
auto arryacc = &acc;
arryacc(3) = 5; // same error
}
/***************************************************/
// 8220
void foo8220(int){}
static assert(!__traits(compiles, foo8220(typeof(0)))); // fail
/***************************************************/
void func8105(in ref int x) { }
void test8105()
{
}
/***************************************************/
template ParameterTypeTuple159(alias foo)
{
static if (is(typeof(foo) P == __parameters))
alias P ParameterTypeTuple159;
else
static assert(0, "argument has no parameters");
}
int func159(int i, long j = 7) { return 3; }
alias ParameterTypeTuple159!func159 PT;
int bar159(PT) { return 4; }
pragma(msg, typeof(bar159));
pragma(msg, PT[1]);
PT[1] boo159(PT[1..2] a) { return a[0]; }
void test159()
{
assert(bar159(1) == 4);
assert(boo159() == 7);
}
/***************************************************/
// 8283
struct Foo8283 {
this(long) { }
}
struct FooContainer {
Foo8283 value;
}
auto get8283() {
union Buf { FooContainer result; }
Buf buf = {};
return buf.result;
}
void test8283() {
auto a = get8283();
}
/***************************************************/
// 8395
struct S8395
{
int v;
this(T : long)(T x) { v = x * 2; }
}
void test8395()
{
S8395 ms = 6;
assert(ms.v == 12);
const S8395 cs = 7;
assert(cs.v == 14);
}
/***************************************************/
// 8396
void test8396()
{
static int g;
static extern(C) int bar(int a, int b)
{
//printf("a = %d, b = %d\n", a, b);
assert(b - a == 1);
return ++g;
}
static auto getFunc(int n)
{
assert(++g == n);
return &bar;
}
static struct Tuple { int _a, _b; }
static Tuple foo(int n)
{
assert(++g == n);
return Tuple(1, 2);
}
g = 0;
assert(bar(foo(1).tupleof) == 2);
g = 0;
assert(getFunc(1)(foo(2).tupleof) == 3);
}
/***************************************************/
enum E160 : ubyte { jan = 1 }
struct D160
{
short _year = 1;
E160 _month = E160.jan;
ubyte _day = 1;
this(int year, int month, int day) pure
{
_year = cast(short)year;
_month = cast(E160)month;
_day = cast(ubyte)day;
}
}
struct T160
{
ubyte _hour;
ubyte _minute;
ubyte _second;
this(int hour, int minute, int second = 0) pure
{
_hour = cast(ubyte)hour;
_minute = cast(ubyte)minute;
_second = cast(ubyte)second;
}
}
struct DT160
{
D160 _date;
T160 _tod;
this(int year, int month, int day,
int hour = 0, int minute = 0, int second = 0) pure
{
_date = D160(year, month, day);
_tod = T160(hour, minute, second);
}
}
void foo160(DT160 dateTime)
{
printf("test7 year %d, day %d\n", dateTime._date._year, dateTime._date._day);
assert(dateTime._date._year == 1999);
assert(dateTime._date._day == 6);
}
void test160()
{
auto dateTime = DT160(1999, 7, 6, 12, 30, 33);
printf("test5 year %d, day %d\n", dateTime._date._year, dateTime._date._day);
assert(dateTime._date._year == 1999);
assert(dateTime._date._day == 6);
foo160(DT160(1999, 7, 6, 12, 30, 33));
}
/***************************************************/
// 8437
class Cgi8437
{
struct PostParserState {
UploadedFile piece;
}
static struct UploadedFile {
string contentFilename;
}
}
/***************************************************/
// 8665
auto foo8665a(bool val)
{
if (val)
return 42;
else
return 1.5;
}
auto foo8665b(bool val)
{
if (!val)
return 1.5;
else
return 42;
}
void test8665()
{
static assert(is(typeof(foo8665a(true)) == double));
static assert(is(typeof(foo8665b(false)) == double));
assert(foo8665a(true) == 42); // assertion failure
assert(foo8665b(true) == 42); // assertion failure
assert(foo8665a(false) == 1.5);
assert(foo8665b(false) == 1.5);
static assert(foo8665a(true) == 42);
static assert(foo8665b(true) == 42);
static assert(foo8665a(false) == 1.5);
static assert(foo8665b(false) == 1.5);
}
/***************************************************/
int foo8108(int, int);
int foo8108(int a, int b)
{
return a + b;
}
void test8108()
{
foo8108(1,2);
}
/***************************************************/
// 8360
struct Foo8360
{
int value = 0;
int check = 1337;
this(int value)
{
assert(0);
this.value = value;
}
~this()
{
assert(0);
assert(check == 1337);
}
string str()
{
assert(0);
return "Foo";
}
}
Foo8360 makeFoo8360()
{
assert(0);
return Foo8360(2);
}
void test8360()
{
size_t length = 0;
// The message part 'makeFoo().str()' should not be evaluated at all.
assert(length < 5, makeFoo8360().str());
}
/***************************************************/
// 8361
struct Foo8361
{
string bar = "hello";
~this() {}
}
void test8361()
{
assert(true, Foo8361().bar);
}
/***************************************************/
// 6141 + 8526
void test6141()
{
static void takeADelegate(void delegate()) {}
auto items = new int[1];
items[0] = 17;
foreach (ref item; items)
{
// both asserts fail
assert(item == 17);
assert(&item == items.ptr);
takeADelegate({ auto x = &item; });
}
foreach(ref val; [3])
{
auto dg = { int j = val; };
assert(&val != null); // Assertion failure
assert(val == 3);
}
static void f(lazy int) {}
int i = 0;
auto dg = { int j = i; };
foreach(ref val; [3])
{
f(val);
assert(&val != null); // Assertion failure
assert(val == 3);
}
}
void test8526()
{
static void call(void delegate() dg) { dg(); }
foreach (i, j; [0])
{
call({
assert(i == 0); // fails, i is corrupted
});
}
foreach (n; 0..1)
{
call({
assert(n == 0); // fails, n is corrupted
});
}
}
/***************************************************/
template ParameterTuple(alias func)
{
static if(is(typeof(func) P == __parameters))
alias P ParameterTuple;
else
static assert(0);
}
int foo161(ref float y);
void test161()
{
alias PT = ParameterTuple!foo161;
auto x = __traits(identifier, PT);
assert(x == "y");
}
/***************************************************/
// 8819
void test8819()
{
void[0] sa0 = (void[0]).init;
assert(sa0.ptr is null);
void[1] sa1 = (void[1]).init;
assert((cast(ubyte*)sa1.ptr)[0] == 0);
void[4] sa4 = [cast(ubyte)1,cast(ubyte)2,cast(ubyte)3,cast(ubyte)4];
assert((cast(ubyte*)sa4.ptr)[0] == 1);
assert((cast(ubyte*)sa4.ptr)[1] == 2);
assert((cast(ubyte*)sa4.ptr)[2] == 3);
assert((cast(ubyte*)sa4.ptr)[3] == 4);
auto sa22 = (void[2][2]).init;
static assert(sa22.sizeof == ubyte.sizeof * 2 * 2);
ubyte[4]* psa22 = cast(ubyte[4]*)sa22.ptr;
assert((*psa22)[0] == 0);
assert((*psa22)[1] == 0);
assert((*psa22)[2] == 0);
assert((*psa22)[3] == 0);
}
/***************************************************/
// 8897
class C8897
{
static mixin M8897!(int);
static class causesAnError {}
}
template M8897 ( E ) { }
/***************************************************/
// 8917
void test8917()
{
int[3] a;
int[3] a2;
int[3] b = a[] + a2[];
}
/***************************************************/
// 8945
struct S8945 // or `class`, or `union`
{
struct S0(T) { int i; }
struct S1(T) { this(int){} }
}
void test8945()
{
auto cs0a = const S8945.S0!int(); // ok
auto cs0b = const S8945.S0!int(1); // ok
auto cs1 = const S8945.S1!int(1); // ok
auto s0a = S8945.S0!int(); // Error: struct S0 does not overload ()
auto s0b = S8945.S0!int(1); // Error: struct S0 does not overload ()
auto s1 = S8945.S1!int(1); // Error: struct S1 does not overload ()
}
/***************************************************/
struct S162
{
static int generateMethodStubs( Class )()
{
int text;
foreach( m; __traits( allMembers, Class ) )
{
static if( is( typeof( mixin( m ) ) ) && is( typeof( mixin( m ) ) == function ) )
{
pragma(msg, __traits( getOverloads, Class, m ));
}
}
return text;
}
enum int ttt = generateMethodStubs!( S162 )();
float height();
int get( int );
int get( long );
void clear();
void draw( int );
void draw( long );
}
/***************************************************/
void test163() {
static class C { int x; int y; }
immutable C c = new C();
shared C c2 = new C();
shared const C c3 = new C();
class D { int x; int y; }
immutable D d;
assert(!__traits(compiles, d = new D()));
static struct S { int x; int y; }
immutable S* s = new S();
shared S* s2 = new S();
shared const S* s3 = new S();
shared S* s4;
assert(!__traits(compiles, s4 = new immutable(S)()));
struct T { int x; int y; }
immutable T* t;
assert(!__traits(compiles, t = new T()));
immutable int* pi = new int();
immutable void* pv = new int();
immutable int[] ai = new int[1];
immutable void[] av = new int[2];
}
/***************************************************/
struct S9000
{ ubyte i = ubyte.max; }
enum E9000 = S9000.init;
/***************************************************/
mixin template DefineCoreType(string type)
{
struct Faulty
{
static int x;
static void instance()
{
x = 3;
}
X164!() xxx;
}
}
mixin DefineCoreType!("");
mixin template A164()
{
static this()
{
}
}
struct X164()
{
mixin A164!();
}
/***************************************************/
// 9428
void test9428()
{
int[2][] items = [[1, 2]];
int[2] x = [3, 4];
auto r1 = items ~ [x];
assert(r1.length == 2);
assert(r1[0][0] == 1);
assert(r1[0][1] == 2);
assert(r1[1][0] == 3);
assert(r1[1][1] == 4);
auto r2 = items ~ x;
assert(r2.length == 2);
assert(r2[0][0] == 1);
assert(r2[0][1] == 2);
assert(r2[1][0] == 3);
assert(r2[1][1] == 4);
auto r3 = [x] ~ items;
assert(r3.length == 2);
assert(r3[0][0] == 3);
assert(r3[0][1] == 4);
assert(r3[1][0] == 1);
assert(r3[1][1] == 2);
auto r4 = x ~ items;
assert(r4.length == 2);
assert(r4[0][0] == 3);
assert(r4[0][1] == 4);
assert(r4[1][0] == 1);
assert(r4[1][1] == 2);
}
/***************************************************/
// 9477
template Tuple9477(T...) { alias T Tuple9477; }
template Select9477(bool b, T, U) { static if (b) alias T Select9477; else alias U Select9477; }
void test9477()
{
static bool isEq (T1, T2)(T1 s1, T2 s2) { return s1 == s2; }
static bool isNeq(T1, T2)(T1 s1, T2 s2) { return s1 != s2; }
// Must be outside the loop due to http://d.puremagic.com/issues/show_bug.cgi?id=9748
int order;
// Must be outside the loop due to http://d.puremagic.com/issues/show_bug.cgi?id=9756
auto checkOrder(bool dyn, uint expected)()
{
assert(order==expected);
order++;
// Use temporary ("v") to work around http://d.puremagic.com/issues/show_bug.cgi?id=9402
auto v = cast(Select9477!(dyn, string, char[1]))"a";
return v;
}
foreach (b1; Tuple9477!(false, true))
foreach (b2; Tuple9477!(false, true))
{
version (D_PIC) {} else // Work around http://d.puremagic.com/issues/show_bug.cgi?id=9754
{
assert( isEq (cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[0]))"" ));
assert(!isNeq(cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[0]))"" ));
assert(!isEq (cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[1]))"a" ));
assert( isNeq(cast(Select9477!(b1, string, char[0]))"" , cast(Select9477!(b2, string, char[1]))"a" ));
}
assert( isEq (cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"a" ));
assert(!isNeq(cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"a" ));
assert(!isEq (cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"b" ));
assert( isNeq(cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[1]))"b" ));
assert(!isEq (cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[2]))"aa"));
assert( isNeq(cast(Select9477!(b1, string, char[1]))"a", cast(Select9477!(b2, string, char[2]))"aa"));
// Note: order of evaluation was not followed before this patch
// (thus, the test below will fail without the patch).
// Although the specification mentions that as implementation-defined behavior,
// I understand that this isn't by design, but rather an inconvenient aspect of DMD
// that has been moved to the specification.
order = 0;
bool result = checkOrder!(b1, 0)() == checkOrder!(b2, 1)();
assert(result);
assert(order == 2);
}
ubyte[64] a1, a2;
foreach (T; Tuple9477!(void, ubyte, ushort, uint, ulong, char, wchar, dchar, float, double))
{
auto s1 = cast(T[])(a1[]);
auto s2 = cast(T[])(a2[]);
assert(s1 == s2);
a2[$-1]++;
assert(s1 != s2);
assert(s1[0..$-1]==s2[0..$-1]);
a2[$-1]--;
}
}
/***************************************************/
// 9504
struct Bar9504
{
template Abc(T)
{
T y;
}
enum size_t num = 123;
class Def {}
}
template GetSym9504(alias sym) { static assert(__traits(isSame, sym, Bar9504.Abc)); }
template GetExp9504(size_t n) { static assert(n == Bar9504.num); }
template GetTyp9504(T) { static assert(is(T == Bar9504.Def)); }
alias GetSym9504!(typeof(Bar9504.init).Abc) X9504; // NG
alias GetExp9504!(typeof(Bar9504.init).num) Y9504; // NG
alias GetTyp9504!(typeof(Bar9504.init).Def) Z9504;
Bar9504 test9504()
{
alias GetSym9504!(typeof(return).Abc) V9504; // NG
alias GetExp9504!(typeof(return).num) W9504; // NG
alias GetTyp9504!(typeof(return).Def) X9504;
return Bar9504();
}
/***************************************************/
// 9538
void test9538()
{
void*[1] x;
auto ti = typeid(x.ptr);
}
/***************************************************/
// 9539
void test9539()
{
void f(int** ptr)
{
assert(**ptr == 10);
}
int* p = new int;
*p = 10;
int*[1] x = [p];
f(&x[0]);
int*[] arr = [null];
static assert(!__traits(compiles, p = arr)); // bad!
}
/***************************************************/
// 9700
mixin template Proxy9700(alias a)
{
auto ref opOpAssign(string op, V)(V v) { return a += v; } // NG
//auto ref opOpAssign(string op, V)(V v) { a += v; } // OK
}
struct MyInt9700
{
int value;
invariant() { assert(value >= 0); }
mixin Proxy9700!value;
}
void test9700()
{
MyInt9700 a = { 2 };
a *= 3; // object.Error: Access Violation
}
/***************************************************/
// 9834
struct Event9834
{
void delegate() dg;
void set(void delegate() h) pure { dg = h; } // AV occurs
void call() { dg(); }
}
void test9834()
{
Event9834 ev;
auto a = new class
{
Object o;
this()
{
o = new Object;
ev.set((){ o.toString(); });
}
};
ev.call();
}
/***************************************************/
// 9859
void test9859(inout int[] arr)
{
auto dg1 = { foreach (i, e; arr) { } };
dg1();
void foo() { auto v = arr; auto w = arr[0]; }
void bar(inout int i) { auto v = arr[i]; }
auto dg2 =
{
auto dg =
{
void foo(T)()
{
auto dg =
{
auto dg =
{
auto v = arr;
};
};
}
foo!int;
};
};
void qux(T)()
{
auto v = arr;
auto dg1 = { auto v = arr; };
auto dg2 =
{
auto dg =
{
auto v = arr;
};
};
}
qux!int;
}
/***************************************************/
// 9912
template TypeTuple9912(Stuff...)
{
alias Stuff TypeTuple9912;
}
struct S9912
{
int i;
alias TypeTuple9912!i t;
void testA() {
auto x = t;
}
void testB() {
auto x = t;
}
}
/***************************************************/
// 9883
struct S9883
{
@property size_t p9883(T)() { return 0; }
}
@property size_t p9883(T)() { return 0; }
void test9883()
{
S9883 s;
auto n1 = p9883!int; // OK
auto n2 = s.p9883!int; // OK
auto a1 = new int[p9883!int]; // Error: need size of rightmost array, not type p!(int)
auto a2 = new int[s.p9883!int]; // Error: no property 'p!(int)' for type 'S'
}
/***************************************************/
// 10091
struct S10091
{
enum e = "a";
}
void test10091()
{
auto arr = cast(ubyte[1]) S10091.e;
}
/***************************************************/
// 9130
class S9130 { void bar() { } }
import core.stdc.stdio : printf;
struct Function
{
int[] ai = [1,2,3];
}
@property void meta(alias m)()
{
static Function md;
printf("length = %d\n", md.ai.length);
printf("ptr = %p\n", md.ai.ptr);
md.ai[0] = 0;
}
void test9130()
{
meta!(__traits(getOverloads, S9130, "bar")[0]);
meta!(S9130.bar);
}
/***************************************************/
// 10390
class C10390 { this() { this.c = this; } C10390 c; }
const c10390 = new C10390();
pragma(msg, c10390);
/***************************************************/
// 10542
class B10542
{
this() nothrow pure @safe { }
}
class D10542 : B10542
{
}
void test10542() nothrow pure @safe
{
new D10542;
}
/***************************************************/
// 10539
void test10539()
{
int[2][2] a;
int* p1 = a.ptr.ptr; // OK <- error
int* p2 = (*a.ptr).ptr; // OK
assert(p1 is p2);
}
/***************************************************/
struct TimeOfDay
{
ubyte h, m, s;
}
__gshared byte glob;
struct DateTime
{
this(ubyte _d, ubyte _m, ubyte _y, TimeOfDay _tod = TimeOfDay.init)
{
d = _d;
m = _m;
y = _y;
tod = _tod;
}
TimeOfDay tod;
ubyte d, m, y;
}
void test10634()
{
glob = 123;
DateTime date1 = DateTime(0, 0, 0);
DateTime date2;
assert(date1 == date2);
}
/***************************************************/
immutable(char)[4] bar7254(int i) {
if (i)
{
immutable(char)[4] r; return r;
}
else
return "1234";
}
void test7254()
{
assert(bar7254(0) == "1234");
}
/***************************************************/
struct S11075() { int x = undefined_expr; }
class C11075() { int x = undefined_expr; }
interface I11075() { enum int x = undefined_expr; }
void test11075()
{
static assert(!is(typeof(S11075!().x)));
static assert(!is(typeof(S11075!().x)));
static assert(!is(typeof(C11075!().x)));
static assert(!is(typeof(C11075!().x)));
static assert(!is(typeof(I11075!().x)));
static assert(!is(typeof(I11075!().x)));
}
/***************************************************/
// 11317
void test11317()
{
auto ref uint fun()
{
return 0;
}
void test(ref uint x) {}
static assert(!__traits(compiles, test(fun())));
assert(fun() == 0);
}
/***************************************************/
int main()
{
test1();
test2();
test3();
test4();
test5();
test6();
test7();
test8();
test9();
test10();
test11();
test12();
test13();
test14();
test15();
test16();
test17();
test18();
test19();
test20();
test21();
test22();
test23();
test24();
test25();
test26();
test27();
test28();
test29();
test30();
test31();
test32();
test33();
test34();
test35();
test36();
test37();
test38();
test39();
test40();
test41();
test42();
test43();
test44();
test45();
test46();
test47();
test48();
test49();
test796();
test50();
test51();
test52();
test53();
test54();
test55();
test56();
test57();
test58();
test60();
test61();
test62();
test63();
test64();
test65();
test66();
test67();
test68();
test69();
test70();
test5785();
test72();
test73();
test74();
test75();
test76();
test77();
test78();
test79();
test80();
test81();
test82();
test83();
test3559();
test84();
test85();
test2006();
test8442();
test86();
test87();
test2486();
test5554();
test88();
test7545();
test89();
test90();
test91();
test92();
test4536();
test93();
test94();
test95();
test5403();
test96();
test97();
test98();
test99();
test100();
test101();
test103();
test104();
test105();
test3927();
test107();
test109();
test111();
test113();
test115();
test116();
test117();
test3822();
test6545();
test118();
test5081();
test120();
test10724();
test122();
test123();
test124();
test125();
test3133();
test6763();
test127();
test128();
test1891();
test129();
test130();
test1064();
test131();
test132();
test133();
test134();
test135();
test136();
test137();
test138();
test1962();
test139();
test140();
test141();
test6317();
test142();
test143();
test144();
test145();
test146();
test147();
test6685();
test148();
test149();
test2356();
test11238();
test2540();
test150();
test151();
test152();
test153();
test154();
test155();
test156();
test658();
test4258();
test4539();
test4596();
test4963();
test4031();
test5437();
test6230();
test6264();
test6284();
test6295();
test6293();
test5046();
test1471();
test6335();
test1687();
test6228();
test2774();
test3733();
test4392();
test6220();
test5799();
test157();
test6473();
test6630();
test6690();
test2953();
test2997();
test4647();
test5696();
test6084();
test6488();
test6836();
test6837();
test6927();
test6733();
test6813();
test6859();
test6910();
test6902();
test6330();
test6868();
test2856();
test3091();
test6056();
test6356();
test7073();
test7150();
test7160();
test7168();
test7170();
test7196();
test7285();
test7321();
test3282();
test7534();
test7534cov();
test7618();
test7621();
test11417();
test7682();
test7735();
test7823();
test7871();
test7906();
test7907();
test8004();
test8064();
test8105();
test159();
test8283();
test8395();
test8396();
test160();
test8665();
test8108();
test8360();
test9577();
test6141();
test8526();
test161();
test8819();
test8917();
test8945();
test163();
test9428();
test9477();
test9538();
test9700();
test9834();
test9883();
test10091();
test9130();
test10542();
test10539();
test10634();
test7254();
test11075();
test11317();
printf("Success\n");
return 0;
}
| D |
a history of a word
the study of the sources and development of words
| D |
module d.semantic.typepromotion;
import d.semantic.semantic;
import d.ir.symbol;
import d.ir.type;
import d.context.location;
import d.exception;
// Conflict with Interface in object.di
alias Interface = d.ir.symbol.Interface;
Type getPromotedType(SemanticPass pass, Location location, Type t1, Type t2) {
return TypePromoter(pass, location, t1).visit(t2);
}
// XXX: type promotion and finding common type are mixed up in there.
// This need to be splitted.
struct TypePromoter {
// XXX: Used only to get to super class, should probably go away.
private SemanticPass pass;
alias pass this;
private Location location;
Type t1;
this(SemanticPass pass, Location location, Type t1) {
this.pass = pass;
this.location = location;
this.t1 = t1.getCanonical();
}
Type visit(Type t) {
return t.accept(this);
}
Type visit(BuiltinType bt) {
auto t = t1.getCanonicalAndPeelEnum();
if (bt == BuiltinType.Null) {
if (t.kind == TypeKind.Pointer || t.kind == TypeKind.Class) {
return t;
}
if (t.kind == TypeKind.Function && t.asFunctionType().contexts.length == 0) {
return t;
}
}
if (t.kind == TypeKind.Builtin) {
return Type.get(promoteBuiltin(bt, t.builtin));
}
import std.conv;
return getError(
t,
location,
"Can't coerce " ~ bt.to!string() ~ " to " ~ t.toString(context),
).type;
}
Type visitPointerOf(Type t) {
if (t1.kind == TypeKind.Builtin && t1.builtin == BuiltinType.Null) {
return t.getPointer();
}
if (t1.kind != TypeKind.Pointer) {
assert(0, "Not Implemented.");
}
auto e = t1.element;
if (t.getCanonical().unqual() == e.getCanonical().unqual()) {
if (canConvert(e.qualifier, t.qualifier)) {
return t.getPointer();
}
if (canConvert(t.qualifier, e.qualifier)) {
return e.getPointer();
}
}
assert(0, "Not Implemented: use caster.");
}
Type visitSliceOf(Type t) {
assert(0, "Not Implemented.");
}
Type visitArrayOf(uint size, Type t) {
assert(0, "Not Implemented.");
}
Type visit(Struct s) {
if (t1.kind == TypeKind.Struct && t1.dstruct is s) {
return Type.get(s);
}
import d.exception;
throw new CompileException(location, "Incompatible struct type " ~ s.name.toString(context) ~ " and " ~ t1.toString(context));
}
Type visit(Class c) {
if (t1.kind == TypeKind.Builtin && t1.builtin == BuiltinType.Null) {
return Type.get(c);
}
if (t1.kind != TypeKind.Class) {
assert(0, "Not Implemented.");
}
auto r = t1.dclass;
// Find a common superclass.
auto lup = c;
do {
// Avoid allocation when possible.
if (r is lup) {
return t1;
}
auto rup = r.base;
while(rup !is rup.base) {
if(rup is lup) {
return Type.get(rup);
}
rup = rup.base;
}
lup = lup.base;
} while(lup !is lup.base);
// lup must be Object by now.
return Type.get(lup);
}
Type visit(Enum e) {
return visit(e.type);
}
Type visit(TypeAlias a) {
return visit(a.type);
}
Type visit(Interface i) {
assert(0, "Not Implemented.");
}
Type visit(Union u) {
assert(0, "Not Implemented.");
}
Type visit(Function f) {
assert(0, "Not Implemented.");
}
Type visit(Type[] seq) {
assert(0, "Not Implemented.");
}
Type visit(FunctionType f) {
assert(0, "Not Implemented.");
}
Type visit(TypeTemplateParameter p) {
assert(0, "Not implemented.");
}
import d.ir.error;
Type visit(CompileError e) {
return e.type;
}
}
private:
BuiltinType getBuiltinBase(BuiltinType t) {
if (t == BuiltinType.Bool) {
return BuiltinType.Int;
}
if (isChar(t)) {
return integralOfChar(t);
}
return t;
}
BuiltinType promoteBuiltin(BuiltinType t1, BuiltinType t2) {
t1 = getBuiltinBase(t1);
t2 = getBuiltinBase(t2);
if (isIntegral(t1) && isIntegral(t2)) {
import std.algorithm;
return max(t1, t2, BuiltinType.Int);
}
assert(0, "Not implemented.");
}
unittest { with(BuiltinType) {
foreach(t1; [Bool, Char, Wchar, Byte, Ubyte, Short, Ushort, Int]) {
foreach(t2; [Bool, Char, Wchar, Byte, Ubyte, Short, Ushort, Int]) {
assert(promoteBuiltin(t1, t2) == Int);
}
}
foreach(t1; [Bool, Char, Wchar, Dchar, Byte, Ubyte, Short, Ushort, Int, Uint]) {
foreach(t2; [Dchar, Uint]) {
assert(promoteBuiltin(t1, t2) == Uint);
assert(promoteBuiltin(t2, t1) == Uint);
}
}
foreach(t; [Bool, Char, Wchar, Dchar, Byte, Ubyte, Short, Ushort, Int, Uint, Long]) {
assert(promoteBuiltin(t, Long) == Long);
assert(promoteBuiltin(Long, t) == Long);
}
foreach(t; [Bool, Char, Wchar, Dchar, Byte, Ubyte, Short, Ushort, Int, Uint, Long, Ulong]) {
assert(promoteBuiltin(t, Ulong) == Ulong);
assert(promoteBuiltin(Ulong, t) == Ulong);
}
foreach(t; [Bool, Char, Wchar, Dchar, Byte, Ubyte, Short, Ushort, Int, Uint, Long, Ulong, Cent]) {
assert(promoteBuiltin(t, Cent) == Cent);
assert(promoteBuiltin(Cent, t) == Cent);
}
foreach(t; [Bool, Char, Wchar, Dchar, Byte, Ubyte, Short, Ushort, Int, Uint, Long, Ulong, Cent, Ucent]) {
assert(promoteBuiltin(t, Ucent) == Ucent);
assert(promoteBuiltin(Ucent, t) == Ucent);
}
}}
| D |
/*
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module bindbc.newton.types;
private {
import core.stdc.config;
}
extern(C):
alias dLong = long;
alias dFloat32 = float;
alias dFloat64 = double;
version(_NEWTON_USE_DOUBLE) alias dFloat = double;
else alias dFloat = float;
enum NEWTON_MAJOR_VERSION = 3;
enum NEWTON_MINOR_VERSION = 14;
enum NEWTON_BROADPHASE_DEFAULT = 0;
enum NEWTON_BROADPHASE_PERSINTENT = 1;
enum NEWTON_DYNAMIC_BODY = 0;
enum NEWTON_KINEMATIC_BODY = 1;
enum NEWTON_DYNAMIC_ASYMETRIC_BODY = 2;
// enum NEWTON_DEFORMABLE_BODY = 2;
enum SERIALIZE_ID_SPHERE = 0;
enum SERIALIZE_ID_CAPSULE = 1;
enum SERIALIZE_ID_CYLINDER = 2;
enum SERIALIZE_ID_CHAMFERCYLINDER = 3;
enum SERIALIZE_ID_BOX = 4;
enum SERIALIZE_ID_CONE = 5;
enum SERIALIZE_ID_CONVEXHULL = 6;
enum SERIALIZE_ID_NULL = 7;
enum SERIALIZE_ID_COMPOUND = 8;
enum SERIALIZE_ID_TREE = 9;
enum SERIALIZE_ID_HEIGHTFIELD = 10;
enum SERIALIZE_ID_CLOTH_PATCH = 11;
enum SERIALIZE_ID_DEFORMABLE_SOLID = 12;
enum SERIALIZE_ID_USERMESH = 13;
enum SERIALIZE_ID_SCENE = 14;
enum SERIALIZE_ID_FRACTURED_COMPOUND = 15;
struct NewtonMesh {}
struct NewtonBody {}
struct NewtonWorld {}
struct NewtonJoint {}
struct NewtonMaterial {}
struct NewtonCollision {}
struct NewtonDeformableMeshSegment {}
struct NewtonFracturedCompoundMeshPart {}
union NewtonMaterialData
{
void* m_ptr;
dLong m_int;
dFloat m_float;
}
struct NewtonCollisionMaterial
{
dLong m_userId;
NewtonMaterialData m_userData;
NewtonMaterialData[6] m_userParam;
}
struct NewtonBoxParam
{
dFloat m_x;
dFloat m_y;
dFloat m_z;
}
struct NewtonSphereParam
{
dFloat m_radio;
}
struct NewtonCapsuleParam
{
dFloat m_radio0;
dFloat m_radio1;
dFloat m_height;
}
struct NewtonCylinderParam
{
dFloat m_radio0;
dFloat m_radio1;
dFloat m_height;
}
struct NewtonConeParam
{
dFloat m_radio;
dFloat m_height;
}
struct NewtonChamferCylinderParam
{
dFloat m_radio;
dFloat m_height;
}
struct NewtonConvexHullParam
{
int m_vertexCount;
int m_vertexStrideInBytes;
int m_faceCount;
dFloat* m_vertex;
}
struct NewtonCompoundCollisionParam
{
int m_chidrenCount;
}
struct NewtonCollisionTreeParam
{
int m_vertexCount;
int m_indexCount;
}
struct NewtonDeformableMeshParam
{
int m_vertexCount;
int m_triangleCount;
int m_vrtexStrideInBytes;
ushort* m_indexList;
dFloat* m_vertexList;
}
struct NewtonHeightFieldCollisionParam
{
int m_width;
int m_height;
int m_gridsDiagonals;
int m_elevationDataType; // 0 = 32 bit floats, 1 = unsigned 16 bit integers
dFloat m_verticalScale;
dFloat m_horizonalScale_x;
dFloat m_horizonalScale_z;
void* m_vertialElevation;
char* m_atributes;
}
struct NewtonSceneCollisionParam
{
int m_childrenProxyCount;
}
struct NewtonCollisionInfoRecord
{
dFloat[4][4] m_offsetMatrix;
NewtonCollisionMaterial m_collisionMaterial;
int m_collisionType; // tag id to identify the collision primitive
union
{
NewtonBoxParam m_box;
NewtonConeParam m_cone;
NewtonSphereParam m_sphere;
NewtonCapsuleParam m_capsule;
NewtonCylinderParam m_cylinder;
NewtonChamferCylinderParam m_chamferCylinder;
NewtonConvexHullParam m_convexHull;
NewtonDeformableMeshParam m_deformableMesh;
NewtonCompoundCollisionParam m_compoundCollision;
NewtonCollisionTreeParam m_collisionTree;
NewtonHeightFieldCollisionParam m_heightField;
NewtonSceneCollisionParam m_sceneCollision;
dFloat[64] m_paramArray; // user define collision can use this to store information
}
}
struct NewtonJointRecord
{
dFloat[4][4] m_attachmenMatrix_0;
dFloat[4][4] m_attachmenMatrix_1;
dFloat[3] m_minLinearDof;
dFloat[3] m_maxLinearDof;
dFloat[3] m_minAngularDof;
dFloat[3] m_maxAngularDof;
const(NewtonBody)* m_attachBody_0;
const(NewtonBody)* m_attachBody_1;
dFloat[64] m_extraParameters;
int m_bodiesCollisionOn;
char[128] m_descriptionType;
}
struct NewtonUserMeshCollisionCollideDesc
{
dFloat[4] m_boxP0; // lower bounding box of intersection query in local space
dFloat[4] m_boxP1; // upper bounding box of intersection query in local space
dFloat[4] m_boxDistanceTravel; // max distance that box bpxP0 and boxP1 can travel on this timestep, used this for continue collision mode.
int m_threadNumber; // current thread executing this query
int m_faceCount; // the application should set here how many polygons intersect the query box
int m_vertexStrideInBytes; // the application should set here the size of each vertex
dFloat m_skinThickness; // this is the minimum skin separation specified by the material between these two colliding shapes
void* m_userData; // user data passed to the collision geometry at creation time
NewtonBody* m_objBody; // pointer to the colliding body
NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree
NewtonCollision* m_objCollision; // collision shape of the colliding body, (no necessarily the collision of m_objBody)
NewtonCollision* m_polySoupCollision; // collision shape of the collision tree, (no necessarily the collision of m_polySoupBody)
dFloat* m_vertex; // the application should set here the pointer to the global vertex of the mesh.
int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face.
int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face.
// the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A
// I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer
// M is the index to the material sub shape id
// N in the index to the vertex normal relative to m_vertex pointer
// E0, E1, E2, ... are the indices of the the face normal that is shared to that face edge, when the edge does not share a face normal then the edge index is set to index N, which the index to the face normal
// A is and estimate of the largest diagonal of the face, this used internally as a hint to improve floating point accuracy and algorithm performance.
}
struct NewtonWorldConvexCastReturnInfo
{
dFloat[4] m_point; // collision point in global space
dFloat[4] m_normal; // surface normal at collision point in global space
//dFloat m_normalOnHitPoint[4]; // surface normal at the surface of the hit body,
// is the same as the normal calculated by a ray cast hitting the body at the hit point
dLong m_contactID; // collision ID at contact point
const(NewtonBody)* m_hitBody; // body hit at contact point
dFloat m_penetration; // contact penetration at collision point
}
struct NewtonUserMeshCollisionRayHitDesc
{
dFloat[4] m_p0; // ray origin in collision local space
dFloat[4] m_p1; // ray destination in collision local space
dFloat[4] m_normalOut; // copy here the normal at the ray intersection
dLong m_userIdOut; // copy here a user defined id for further feedback
void* m_userData; // user data passed to the collision geometry at creation time
}
struct NewtonHingeSliderUpdateDesc
{
dFloat m_accel;
dFloat m_minFriction;
dFloat m_maxFriction;
dFloat m_timestep;
}
struct NewtonUserContactPoint
{
dFloat[4] m_point;
dFloat[4] m_normal;
dLong m_shapeId0;
dLong m_shapeId1;
dFloat m_penetration;
int[3] m_unused;
}
struct NewtonImmediateModeConstraint
{
dFloat[8][6] m_jacobian01;
dFloat[8][6] m_jacobian10;
dFloat[8] m_minFriction;
dFloat[8] m_maxFriction;
dFloat[8] m_jointAccel;
dFloat[8] m_jointStiffness;
}
// data structure for interfacing with NewtonMesh
struct NewtonMeshDoubleData
{
dFloat64* m_data;
int* m_indexList;
int m_strideInBytes;
}
struct NewtonMeshFloatData
{
dFloat* m_data;
int* m_indexList;
int m_strideInBytes;
}
struct NewtonMeshVertexFormat
{
int m_faceCount;
int* m_faceIndexCount;
int* m_faceMaterial;
NewtonMeshDoubleData m_vertex;
NewtonMeshFloatData m_normal;
NewtonMeshFloatData m_binormal;
NewtonMeshFloatData m_uv0;
NewtonMeshFloatData m_uv1;
NewtonMeshFloatData m_vertexColor;
}
// Newton callback functions
alias NewtonAllocMemory = void* function (int sizeInBytes);
alias NewtonFreeMemory = void function (void* ptr, int sizeInBytes);
alias NewtonWorldDestructorCallback = void function (const NewtonWorld* world);
alias NewtonPostUpdateCallback = void function (const NewtonWorld* world, dFloat timestep);
alias NewtonCreateContactCallback = void function(const NewtonWorld* newtonWorld, NewtonJoint* contact);
alias NewtonDestroyContactCallback = void function(const NewtonWorld* newtonWorld, NewtonJoint* contact);
alias NewtonWorldListenerDebugCallback = void function (const NewtonWorld* world, void* listener, void* debugContext);
alias NewtonWorldListenerBodyDestroyCallback = void function (const NewtonWorld* world, void* listenerUserData, NewtonBody* body_);
alias NewtonWorldUpdateListenerCallback = void function (const NewtonWorld* world, void* listenerUserData, dFloat timestep);
alias NewtonWorldDestroyListenerCallback = void function (const NewtonWorld* world, void* listenerUserData);
alias NewtonGetTimeInMicrosencondsCallback = dLong function ();
alias NewtonSerializeCallback = void function (void* serializeHandle, const void* buffer, int size);
alias NewtonDeserializeCallback = void function (void* serializeHandle, void* buffer, int size);
alias NewtonOnBodySerializationCallback = void function (NewtonBody* body_, void* userData, NewtonSerializeCallback function_, void* serializeHandle);
alias NewtonOnBodyDeserializationCallback = void function (NewtonBody* body_, void* userData, NewtonDeserializeCallback function_, void* serializeHandle);
alias NewtonOnJointSerializationCallback = void function (const NewtonJoint* joint, NewtonSerializeCallback function_, void* serializeHandle);
alias NewtonOnJointDeserializationCallback = void function (NewtonBody* body0, NewtonBody* body1, NewtonDeserializeCallback function_, void* serializeHandle);
alias NewtonOnUserCollisionSerializationCallback = void function (void* userData, NewtonSerializeCallback function_, void* serializeHandle);
// user collision callbacks
alias NewtonUserMeshCollisionDestroyCallback = void function (void* userData);
alias NewtonUserMeshCollisionRayHitCallback = dFloat function (NewtonUserMeshCollisionRayHitDesc* lineDescData);
alias NewtonUserMeshCollisionGetCollisionInfo = void function (void* userData, NewtonCollisionInfoRecord* infoRecord);
alias NewtonUserMeshCollisionAABBTest = int function (void* userData, const dFloat* boxP0, const dFloat* boxP1);
alias NewtonUserMeshCollisionGetFacesInAABB = int function (
void* userData,
const dFloat* p0,
const dFloat* p1,
const dFloat** vertexArray,
int* vertexCount,
int* vertexStrideInBytes,
const int* indexList,
int maxIndexCount,
const int* userDataList);
alias NewtonUserMeshCollisionCollideCallback = void function (NewtonUserMeshCollisionCollideDesc* collideDescData, const void* continueCollisionHandle);
alias NewtonTreeCollisionFaceCallback = int function (void* context, const dFloat* polygon, int strideInBytes, const int* indexArray, int indexCount);
alias NewtonCollisionTreeRayCastCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* treeCollision, dFloat intersection, dFloat* normal, int faceId, void* usedData);
alias NewtonHeightFieldRayCastCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* heightFieldCollision, dFloat intersection, int row, int col, dFloat* normal, int faceId, void* usedData);
alias NewtonCollisionCopyConstructionCallback = void function (const NewtonWorld* newtonWorld, NewtonCollision* collision, const NewtonCollision* sourceCollision);
alias NewtonCollisionDestructorCallback = void function (const NewtonWorld* newtonWorld, const NewtonCollision* collision);
// collision tree call back (obsoleted no recommended)
alias NewtonTreeCollisionCallback = void function (
const NewtonBody* bodyWithTreeCollision,
const NewtonBody* body_,
int faceID,
int vertexCount,
const dFloat* vertex,
int vertexStrideInBytes);
alias NewtonBodyDestructor = void function (const NewtonBody* body_);
alias NewtonApplyForceAndTorque = void function (const NewtonBody* body_, dFloat timestep, int threadIndex);
alias NewtonSetTransform = void function (const NewtonBody* body_, const dFloat* matrix, int threadIndex);
alias NewtonIslandUpdate = int function (const NewtonWorld* newtonWorld, const(void)* islandHandle, int bodyCount);
alias NewtonFractureCompoundCollisionOnEmitCompoundFractured = void function (NewtonBody* fracturedBody);
alias NewtonFractureCompoundCollisionOnEmitChunk = void function (NewtonBody* chunkBody, NewtonFracturedCompoundMeshPart* fracturexChunkMesh, const NewtonCollision* fracturedCompountCollision);
alias NewtonFractureCompoundCollisionReconstructMainMeshCallBack = void function (NewtonBody* body_, NewtonFracturedCompoundMeshPart* mainMesh, const NewtonCollision* fracturedCompountCollision);
alias NewtonWorldRayPrefilterCallback = uint function (const NewtonBody* body_, const NewtonCollision* collision, void* userData);
alias NewtonWorldRayFilterCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* shapeHit, const dFloat* hitContact, const dFloat* hitNormal, long collisionID, void* userData, dFloat intersectParam);
alias NewtonOnAABBOverlap = int function (const NewtonJoint* contact, dFloat timestep, int threadIndex);
alias NewtonContactsProcess = void function (const NewtonJoint* contact, dFloat timestep, int threadIndex);
alias NewtonOnCompoundSubCollisionAABBOverlap = int function (const NewtonJoint* contact, dFloat timestep, const NewtonBody* body0, const void* collisionNode0, const NewtonBody* body1, const void* collisionNode1, int threadIndex);
alias NewtonOnContactGeneration = int function (const NewtonMaterial* material, const NewtonBody* body0, const NewtonCollision* collision0, const NewtonBody* body1, const NewtonCollision* collision1, NewtonUserContactPoint* contactBuffer, int maxCount, int threadIndex);
alias NewtonBodyIterator = int function (const NewtonBody* body_, void* userData);
alias NewtonJointIterator = void function (const NewtonJoint* joint, void* userData);
alias NewtonCollisionIterator = void function (void* userData, int vertexCount, const dFloat* faceArray, int faceId);
alias NewtonBallCallback = void function (const NewtonJoint* ball, dFloat timestep);
alias NewtonHingeCallback = uint function (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc);
alias NewtonSliderCallback = uint function (const NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc);
alias NewtonUniversalCallback = uint function (const NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc);
alias NewtonCorkscrewCallback = uint function (const NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc);
alias NewtonUserBilateralCallback = void function (const NewtonJoint* userJoint, dFloat timestep, int threadIndex);
alias NewtonUserBilateralGetInfoCallback = void function (const NewtonJoint* userJoint, NewtonJointRecord* info);
alias NewtonConstraintDestructor = void function (const NewtonJoint* me);
alias NewtonJobTask = void function (NewtonWorld* world, void* userData, int threadIndex);
alias NewtonReportProgress = int function (dFloat normalizedProgressPercent, void* userData);
| D |
/////////////////////////////////////////////////////////////////////////
// B_InterruptMob
// ==============
// Funktion um die Nsc´s während der Mobbenutzung zwischen-
// durch ein paar Random-Anis abspielen zu lassen
// Aufrufende Funktionen sind in drei Klassen zu unterteilen.
// Erstens: Funktionen, die nur ein Mob benutzen und kein Item benötigen
// ZS_CookForMe, ZS_ReadBook, ZS_ArmorMaker, ZS_RoastScavenger
// Zweitens: Funktionen die Mobs mit items benutzen
// ZS_Schnitzer, ZS_PickOre, ZS_BowMaker, ZS_PotionAlchemy, ZS_RepairHut
// ZS_SawWood, ZS_StoneMason,
// Funktionen wie zwei, nur das in der Mobsibenutzung Items ausgetauscht werden,
// bei diesen wird in der Zustandsloop das Itemhandling übernommen, so daß
// diese Mobsis wie Kategorie eins behandelt werden :
// ZS_Smith_Sharp, ZS_Smith_Anvil, ZS_Smith_Cool, ZS_Smith_Fire, ZS_Cook
////////////////////////////////////////////////////////////////////////////
func void B_InterruptMob ( var string mobsi)
{
PrintDebugNpc (PD_TA_DETAIL, "B_InterruptMob");
B_StopUseMob (self, mobsi);
var int randomize_mob;
randomize_mob = Hlp_Random ( 7);
if (randomize_mob == 1) && !C_NpcIsBoss (self)
{
AI_PlayAni ( self, "T_BORINGKICK");
};
if (randomize_mob == 2)
{
AI_PlayAni ( self, "T_SEARCH");
};
if (randomize_mob == 3)
{
AI_PlayAni ( self, "R_SCRATCHHEAD");
};
if (randomize_mob == 4)
{
AI_PlayAni ( self, "R_LEGSHAKE");
};
if (randomize_mob == 5)
{
AI_PlayAni ( self, "R_SCRATCHRSHOULDER");
};
if (randomize_mob == 6)
{
AI_PlayAni ( self, "R_SCRATCHLSHOULDER");
};
Npc_SetStateTime ( self, 0);
AI_UseMob ( self, mobsi,1);
B_UseMobItems (self,mobsi);
self.aivar[AIV_DONTUSEMOB] = 1;
}; | D |
/home/etudiant/M1/PSTL/projects/check_useless_chaining/target/debug/deps/libsyntex_pos-afb719a4aa0cb5b7.rlib: /home/etudiant/.cargo/registry/src/github.com-1ecc6299db9ec823/syntex_pos-0.58.1/src/lib.rs
/home/etudiant/M1/PSTL/projects/check_useless_chaining/target/debug/deps/syntex_pos-afb719a4aa0cb5b7.d: /home/etudiant/.cargo/registry/src/github.com-1ecc6299db9ec823/syntex_pos-0.58.1/src/lib.rs
/home/etudiant/.cargo/registry/src/github.com-1ecc6299db9ec823/syntex_pos-0.58.1/src/lib.rs:
| D |
instance DIA_Addon_Bloodwyn_EXIT(C_Info)
{
npc = BDT_1085_Addon_Bloodwyn;
nr = 999;
condition = DIA_Addon_Bloodwyn_EXIT_Condition;
information = DIA_Addon_Bloodwyn_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Addon_Bloodwyn_EXIT_Condition()
{
return TRUE;
};
func void DIA_Addon_Bloodwyn_EXIT_Info()
{
AI_StopProcessInfos(self);
};
instance DIA_Addon_Bloodwyn_PICKPOCKET(C_Info)
{
npc = BDT_1085_Addon_Bloodwyn;
nr = 900;
condition = DIA_Addon_Bloodwyn_PICKPOCKET_Condition;
information = DIA_Addon_Bloodwyn_PICKPOCKET_Info;
permanent = TRUE;
description = PICKPOCKET_COMM;
};
func int DIA_Addon_Bloodwyn_PICKPOCKET_Condition()
{
return C_Beklauen(90,250);
};
func void DIA_Addon_Bloodwyn_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Addon_Bloodwyn_PICKPOCKET);
Info_AddChoice(DIA_Addon_Bloodwyn_PICKPOCKET,Dialog_Back,DIA_Addon_Bloodwyn_PICKPOCKET_BACK);
Info_AddChoice(DIA_Addon_Bloodwyn_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Addon_Bloodwyn_PICKPOCKET_DoIt);
};
func void DIA_Addon_Bloodwyn_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Addon_Bloodwyn_PICKPOCKET);
};
func void DIA_Addon_Bloodwyn_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Addon_Bloodwyn_PICKPOCKET);
};
instance DIA_Addon_Bloodwyn_Dead(C_Info)
{
npc = BDT_1085_Addon_Bloodwyn;
nr = 2;
condition = DIA_Addon_Bloodwyn_Dead_Condition;
information = DIA_Addon_Bloodwyn_Dead_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Addon_Bloodwyn_Dead_Condition()
{
if(Npc_GetDistToWP(self,"BL_RAVEN_09") <= 1000)
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Bloodwyn_Dead_Info()
{
AI_Output(self,other,"DIA_Addon_Bloodwyn_Dead_04_00"); //Эй, как ты сюда попал?
AI_Output(other,self,"DIA_Addon_Bloodwyn_Dead_15_01"); //Через вход.
AI_Output(self,other,"DIA_Addon_Bloodwyn_Dead_04_02"); //Смешно... НЕНАВИЖУ шутки.
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
func void Bloodwyn_Choices_1()
{
Info_ClearChoices(DIA_Addon_Bloodwyn_Wait);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,PRINT_ADDON_ENOUGHTALK,DIA_Addon_Bloodwyn_Wait_FIGHT);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,"А я думал, я тебя прикончил.",DIA_Addon_Bloodwyn_Wait_GOOD1);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,"Всему когда-нибудь приходит конец.",DIA_Addon_Bloodwyn_Wait_BAD1);
};
func void Bloodwyn_Choices_2()
{
Info_ClearChoices(DIA_Addon_Bloodwyn_Wait);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,PRINT_ADDON_ENOUGHTALK,DIA_Addon_Bloodwyn_Wait_FIGHT);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,"А кто, по-твоему, разрушил Барьер?",DIA_Addon_Bloodwyn_Wait_GOOD2);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,"Ты и многие другие тоже...",DIA_Addon_Bloodwyn_Wait_BAD2);
};
func void Bloodwyn_Choices_3()
{
Info_ClearChoices(DIA_Addon_Bloodwyn_Wait);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,PRINT_ADDON_ENOUGHTALK,DIA_Addon_Bloodwyn_Wait_FIGHT);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,"Очевидно, у него не было времени разобраться...",DIA_Addon_Bloodwyn_Wait_GOOD3);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,"Да, это была его самая большая ошибка...",DIA_Addon_Bloodwyn_Wait_BAD3);
};
instance DIA_Addon_Bloodwyn_Wait(C_Info)
{
npc = BDT_1085_Addon_Bloodwyn;
nr = 2;
condition = DIA_Addon_Bloodwyn_Wait_Condition;
information = DIA_Addon_Bloodwyn_Wait_Info;
permanent = FALSE;
important = TRUE;
};
func int DIA_Addon_Bloodwyn_Wait_Condition()
{
if(Npc_IsInState(self,ZS_Talk) && (Minecrawler_Killed >= 9))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Bloodwyn_Wait_Info()
{
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wait_04_00"); //Ты убил ползунов? Отлично. Дальше действую я! Проваливай.
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_15_01"); //Подожди минутку...
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wait_04_02"); //Ты еще здесь?
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_15_03"); //Нам нужно кое-что выяснить.
Info_ClearChoices(DIA_Addon_Bloodwyn_Wait);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,PRINT_ADDON_ENOUGHTALK,DIA_Addon_Bloodwyn_Wait_FIGHT);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,"Я ищу Ворона.",DIA_Addon_Bloodwyn_Wait_Raven);
};
func void DIA_Addon_Bloodwyn_Wait_Raven()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_15_00"); //Я ищу Ворона.
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wait_Raven_04_01"); //Так, и почему ты думаешь, что Ворон захочет говорить с тобой... погоди, ты не... Это ТЫ?
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wait_Raven_04_02"); //Ты - тот парень, которого мы ищем все это время. Что ты здесь делаешь?! Ты же давно мертв!
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_15_03"); //Все говорят мне об этом.
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wait_Raven_04_04"); //Эти бараны все проморгали, но от меня ты не уйдешь. На этот раз я прикончу тебя!
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_15_05"); //Как я уже сказал, ты меня не интересуешь, я ищу Ворона.
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wait_Raven_04_06"); //Я убью тебя, я не проиграл еще ни одной схватки!
Bloodwyn_Choices_1();
};
func void DIA_Addon_Bloodwyn_Wait_FIGHT()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_FIGHT_15_00"); //Хватит трепаться. Дерись.
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wait_Raven_FIGHT_04_01"); //(торжествующе) Все равно уже слишком поздно! Ворон уже открывает храм! Ха-ха-ха! Умри, ублюдок!
AI_StopProcessInfos(self);
B_Attack(self,other,AR_NONE,1);
};
func void Bloodwyn_Lach()
{
AI_Output(self,other,"DIA_Addon_Bloodwyn_Lach_04_00"); //ХА-ХА-ХА - я все равно убью тебя!
};
func void Bloodwyn_Wut()
{
AI_Output(self,other,"DIA_Addon_Bloodwyn_Wut_04_00"); //А-АХ! Ты жалкая тварь!
self.attribute[ATR_STRENGTH] = self.attribute[ATR_STRENGTH] - 5;
self.attribute[ATR_HITPOINTS] = self.attribute[ATR_HITPOINTS] - 25;
self.attribute[ATR_HITPOINTS_MAX] = self.attribute[ATR_HITPOINTS_MAX] - 25;
};
func void Bloodwyn_Next_1()
{
AI_Output(self,other,"DIA_Addon_Bloodwyn_SayChoice_2_04_00"); //А я пережил падение Барьера, не получив и царапины!
};
func void Bloodwyn_Next_2()
{
AI_Output(self,other,"DIA_Addon_Bloodwyn_SayChoice_3_04_00"); //Ты не сможешь победить меня, я лучший друг Ворона! Его правая рука!
};
func void DIA_Addon_Bloodwyn_Wait_GOOD1()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_GOOD1_15_00"); //А я думал, я тебя прикончил.
Bloodwyn_Wut();
Bloodwyn_Next_1();
Bloodwyn_Choices_2();
};
func void DIA_Addon_Bloodwyn_Wait_BAD1()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_BAD1_15_00"); //Всему когда-нибудь приходит конец.
Bloodwyn_Lach();
Bloodwyn_Next_1();
Bloodwyn_Choices_2();
};
func void DIA_Addon_Bloodwyn_Wait_GOOD2()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_GOOD2_15_00"); //А кто, по-твоему, разрушил Барьер?
Bloodwyn_Wut();
Bloodwyn_Next_2();
Bloodwyn_Choices_3();
};
func void DIA_Addon_Bloodwyn_Wait_BAD2()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_BAD2_15_00"); //Ты и многие другие тоже...
Bloodwyn_Lach();
Bloodwyn_Next_2();
Bloodwyn_Choices_3();
};
func void DIA_Addon_Bloodwyn_Wait_GOOD3()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_GOOD3_15_00"); //Очевидно, у него не было времени разобраться...
Bloodwyn_Wut();
Info_ClearChoices(DIA_Addon_Bloodwyn_Wait);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,PRINT_ADDON_ENOUGHTALK,DIA_Addon_Bloodwyn_Wait_FIGHT);
};
func void DIA_Addon_Bloodwyn_Wait_BAD3()
{
AI_Output(other,self,"DIA_Addon_Bloodwyn_Wait_Raven_BAD3_15_00"); //Да, это была его самая большая ошибка...
Bloodwyn_Wut();
Info_ClearChoices(DIA_Addon_Bloodwyn_Wait);
Info_AddChoice(DIA_Addon_Bloodwyn_Wait,PRINT_ADDON_ENOUGHTALK,DIA_Addon_Bloodwyn_Wait_FIGHT);
};
| D |
instance NOV_603_AGON(NPC_DEFAULT)
{
name[0] = "Àãîí";
guild = GIL_NOV;
id = 603;
voice = 7;
flags = 0;
npctype = NPCTYPE_MAIN;
b_setattributestochapter(self,1);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,itmw_1h_nov_mace);
b_createambientinv(self);
b_setnpcvisual(self,MALE,"Hum_Head_Bald",FACE_N_NORMAL01,BODYTEX_N,itar_nov_l);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
b_givenpctalents(self);
b_setfightskills(self,30);
daily_routine = rtn_start_603;
};
func void rtn_start_603()
{
ta_rake_fp(8,0,9,0,"NW_MONASTERY_HERB_05");
ta_pray_innos_fp(9,0,10,0,"NW_MONASTERY_CHURCH_03");
ta_rake_fp(10,0,22,10,"NW_MONASTERY_HERB_05");
ta_sleep(22,10,8,0,"NW_MONASTERY_NOVICE03_07");
};
func void rtn_golemlives_603()
{
ta_stand_guarding(8,0,23,10,"NW_TROLLAREA_PATH_02");
ta_stand_guarding(23,10,8,0,"NW_TROLLAREA_PATH_02");
};
func void rtn_golemdead_603()
{
ta_stand_guarding(8,0,23,10,"NW_MAGECAVE_RUNE");
ta_stand_guarding(23,10,8,0,"NW_MAGECAVE_RUNE");
};
func void rtn_stillalive_603()
{
ta_stand_guarding(8,0,23,10,"TAVERN");
ta_stand_guarding(23,10,8,0,"TAVERN");
};
| D |
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.build/Selectable.swift.o : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.build/Selectable~partial.swiftmodule : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIO.build/Selectable~partial.swiftdoc : /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/christian/GitHub/vapor/HelloVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
| D |
/Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ChartsRealm.build/Objects-normal/x86_64/RealmBaseDataSet.o : /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmPieDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBarLineScatterCandleBubbleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBubbleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmCandleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBaseDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineScatterCandleRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmScatterDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Supporting\ Files/RLMSupport.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Products/Debug-iphonesimulator/Charts/Charts.framework/Modules/Charts.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/ChartsRealm/ChartsRealm-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Products/Debug-iphonesimulator/Charts/Charts.framework/Headers/Charts-Swift.h /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxAtomic/RxAtomic.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ChartsRealm.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/module.modulemap /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxSwift/RxSwift.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ChartsRealm.build/Objects-normal/x86_64/RealmBaseDataSet~partial.swiftmodule : /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmPieDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBarLineScatterCandleBubbleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBubbleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmCandleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBaseDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineScatterCandleRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmScatterDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Supporting\ Files/RLMSupport.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Products/Debug-iphonesimulator/Charts/Charts.framework/Modules/Charts.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/ChartsRealm/ChartsRealm-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Products/Debug-iphonesimulator/Charts/Charts.framework/Headers/Charts-Swift.h /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxAtomic/RxAtomic.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ChartsRealm.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/module.modulemap /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxSwift/RxSwift.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ChartsRealm.build/Objects-normal/x86_64/RealmBaseDataSet~partial.swiftdoc : /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmPieDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBarLineScatterCandleBubbleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBubbleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmCandleDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBaseDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmBarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineScatterCandleRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmLineRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmRadarDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Classes/Data/RealmScatterDataSet.swift /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/ChartsRealm/ChartsRealm/Supporting\ Files/RLMSupport.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Products/Debug-iphonesimulator/Charts/Charts.framework/Modules/Charts.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/ChartsRealm/ChartsRealm-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Products/Debug-iphonesimulator/Charts/Charts.framework/Headers/Charts-Swift.h /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxAtomic/RxAtomic.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ChartsRealm.build/unextended-module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Charts.build/module.modulemap /Users/mli/Desktop/Develope/Swift/LBE_Demo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/module.modulemap /Users/mli/Desktop/Develope/VLogVideo/Pods/Headers/Public/RxSwift/RxSwift.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/Users/rick/home/0_Languages/2_Rust/Tutorials/guessing_game/target/debug/deps/libc-d8250790d0ca7ad5.rmeta: /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/lib.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/macros.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fixed_width_ints.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/windows/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/cloudabi/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fuchsia/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/switch.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/vxworks/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/sgx.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/wasi.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/uclibc/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/newlib/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/linux_like/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/compat.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/haiku/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/redox/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/netbsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/freebsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b32.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b64.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/align.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/no_align.rs
/Users/rick/home/0_Languages/2_Rust/Tutorials/guessing_game/target/debug/deps/liblibc-d8250790d0ca7ad5.rlib: /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/lib.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/macros.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fixed_width_ints.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/windows/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/cloudabi/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fuchsia/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/switch.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/vxworks/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/sgx.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/wasi.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/uclibc/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/newlib/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/linux_like/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/compat.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/haiku/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/redox/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/netbsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/freebsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b32.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b64.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/align.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/no_align.rs
/Users/rick/home/0_Languages/2_Rust/Tutorials/guessing_game/target/debug/deps/libc-d8250790d0ca7ad5.d: /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/lib.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/macros.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fixed_width_ints.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/windows/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/cloudabi/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fuchsia/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/switch.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/vxworks/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/sgx.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/wasi.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/uclibc/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/newlib/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/linux_like/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/compat.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/haiku/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/hermit/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/redox/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/netbsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/freebsdlike/mod.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b32.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b64.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/align.rs /Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/no_align.rs
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/lib.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/macros.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fixed_width_ints.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/windows/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/cloudabi/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/fuchsia/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/switch.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/vxworks/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/hermit/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/sgx.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/wasi.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/uclibc/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/newlib/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/linux_like/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/solarish/compat.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/haiku/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/hermit/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/redox/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/netbsdlike/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/freebsdlike/mod.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b32.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/bsd/apple/b64.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/align.rs:
/Users/rick/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/libc-0.2.62/src/unix/no_align.rs:
| D |
instance Thorus_Schwert(C_Item)
{
name = "Thorusův meč";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_SWD;
material = MAT_METAL;
value = 500;
damageTotal = 90;
damagetype = DAM_EDGE;
range = 150;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 75;
owner = GRD_200_Thorus;
visual = "ItMw_2H_Sword_01.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Innos_Zorn(C_Item)
{
name = "Innosův hněv";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_SWD;
material = MAT_METAL;
value = 570;
damageTotal = 110;
damagetype = DAM_EDGE;
range = 160;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 90;
owner = EBR_100_Gomez;
visual = "ItMw_2H_Sword_Heavy_03.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Scars_Schwert(C_Item)
{
name = "Scarův meč";
mainflag = ITEM_KAT_NF;
flags = ITEM_SWD;
material = MAT_METAL;
value = 460;
damageTotal = 85;
damagetype = DAM_EDGE;
range = 130;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 70;
owner = EBR_101_Scar;
visual = "ItMw_1H_Sword_Bastard_04.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
count[5] = value;
};
instance Artos_Schwert(C_Item)
{
name = "Artův meč";
mainflag = ITEM_KAT_NF;
flags = ITEM_SWD;
material = MAT_METAL;
value = 360;
damageTotal = 65;
damagetype = DAM_EDGE;
range = 100;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 50;
owner = EBR_102_Arto;
visual = "ItMw_1H_Sword_Long_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Rabenrecht(C_Item)
{
name = "Ravenovo právo";
mainflag = ITEM_KAT_NF;
flags = ITEM_SWD;
material = MAT_METAL;
value = 400;
damageTotal = 70;
damagetype = DAM_EDGE;
range = 130;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 55;
owner = EBR_105_Raven;
visual = "ItMw_1H_Sword_Broad_04.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Prankenhieb(C_Item)
{
name = "Úder tlapy";
mainflag = ITEM_KAT_NF;
flags = ITEM_SWD;
material = MAT_METAL;
value = 300;
damageTotal = 55;
damagetype = DAM_EDGE;
range = 100;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 40;
owner = EBR_106_Bartholo;
visual = "ItMw_1H_Sword_Long_05.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Diegos_Bogen(C_Item)
{
name = "Diegův luk";
mainflag = ITEM_KAT_FF;
flags = ITEM_BOW;
material = MAT_WOOD;
value = 390;
damageTotal = 70;
damagetype = DAM_POINT;
munition = ItAmArrow;
cond_atr[2] = ATR_DEXTERITY;
cond_value[2] = 45;
owner = PC_Thief;
visual = "ItRwLongbow.mms";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Dex_needed;
count[3] = cond_value[2];
text[5] = NAME_Value;
count[5] = value;
};
instance Whistlers_Schwert(C_Item)
{
name = "Whistlerův meč";
mainflag = ITEM_KAT_NF;
flags = ITEM_SWD;
material = MAT_METAL;
value = 110;
damageTotal = 20;
damagetype = DAM_EDGE;
range = 100;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 15;
visual = "ItMw_1H_Sword_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Stab_des_Lichts(C_Item)
{
name = "Hůl světla";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_AXE;
material = MAT_WOOD;
value = 350;
damageTotal = 65;
damagetype = DAM_BLUNT;
range = 160;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 45;
owner = GUR_1200_YBerion;
visual = "ItMw_2H_Staff_03.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Kaloms_Schwert(C_Item)
{
name = "Kalomův meč";
mainflag = ITEM_KAT_NF;
flags = ITEM_SWD;
material = MAT_METAL;
value = 400;
damageTotal = 70;
damagetype = DAM_EDGE;
range = 100;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 55;
owner = GUR_1201_CorKalom;
visual = "ItMw_1H_Sword_05.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Streitschlichter(C_Item)
{
name = "Lesterův uklidňovač";
mainflag = ITEM_KAT_NF;
flags = ITEM_AXE;
material = MAT_METAL;
value = 340;
damageTotal = 60;
damagetype = DAM_BLUNT;
range = 90;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 40;
owner = PC_Psionic;
visual = "ItMw_1H_Mace_War_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Roter_Wind(C_Item)
{
name = "Rudý vítr";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_SWD;
material = MAT_METAL;
value = 570;
damageTotal = 105;
damagetype = DAM_EDGE;
range = 140;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 80;
owner = GUR_1202_CorAngar;
visual = "ItMw_2H_Sword_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Namibs_Keule(C_Item)
{
name = "Namibův kyj";
mainflag = ITEM_KAT_NF;
flags = ITEM_AXE;
material = MAT_METAL;
value = 300;
damageTotal = 55;
damagetype = DAM_BLUNT;
range = 90;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 40;
owner = GUR_1204_BaalNamib;
visual = "ItMw_1H_Mace_01.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Oruns_Keule(C_Item)
{
name = "Orunův kyj";
mainflag = ITEM_KAT_NF;
flags = ITEM_AXE;
material = MAT_METAL;
value = 330;
damageTotal = 60;
damagetype = DAM_BLUNT;
range = 90;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 50;
owner = GUR_1209_BaalOrun;
visual = "ItMw_1H_Mace_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Fortunos_Keule(C_Item)
{
name = "Fortunův kyj";
mainflag = ITEM_KAT_NF;
flags = ITEM_AXE;
material = MAT_METAL;
value = 110;
damageTotal = 20;
damagetype = DAM_BLUNT;
range = 90;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 15;
owner = NOV_1357_Fortuno;
visual = "ItMw_1H_Mace_03.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Lees_Axt(C_Item)
{
name = "Leeova sekyra";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_AXE;
material = MAT_METAL;
value = 560;
damageTotal = 105;
damagetype = DAM_EDGE;
range = 130;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 95;
owner = Sld_700_Lee;
visual = "ItMw_2H_Axe_Heavy_01.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Oriks_Axt(C_Item)
{
name = "Orikova sekyra";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_AXE;
material = MAT_METAL;
value = 540;
damageTotal = 95;
damagetype = DAM_EDGE;
range = 130;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 90;
owner = SLD_701_Orik;
visual = "ItMw_2H_Axe_Heavy_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Torlofs_Axt(C_Item)
{
name = "Torlofova sekyra";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_AXE;
material = MAT_METAL;
value = 550;
damageTotal = 99;
damagetype = DAM_EDGE;
range = 130;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 85;
owner = SLD_737_Torlof;
visual = "ItMw_2H_Axe_Heavy_03.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Cords_Spalter(C_Item)
{
name = "Cordův rozkol";
mainflag = ITEM_KAT_NF;
flags = ITEM_AXE;
material = MAT_METAL;
value = 310;
damageTotal = 60;
damagetype = DAM_EDGE;
range = 100;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 50;
owner = Sld_709_Cord;
visual = "ItMw_1H_Axe_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Gorns_Rache(C_Item)
{
name = "Gornova pomsta";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_AXE;
material = MAT_METAL;
value = 560;
damageTotal = 100;
damagetype = DAM_EDGE;
range = 130;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 80;
owner = PC_Fighter;
visual = "ItMw_2H_Axe_Heavy_03.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Lares_Axt(C_Item)
{
name = "Laresova sekyra";
mainflag = ITEM_KAT_NF;
flags = ITEM_AXE;
material = MAT_METAL;
value = 340;
damageTotal = 65;
damagetype = DAM_EDGE;
range = 100;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 45;
owner = Org_801_Lares;
visual = "ItMw_1H_Axe_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Wolfs_Bogen(C_Item)
{
name = "Wolfův luk";
mainflag = ITEM_KAT_FF;
flags = ITEM_BOW;
material = MAT_WOOD;
value = 200;
damageTotal = 35;
damagetype = DAM_POINT;
munition = ItAmArrow;
cond_atr[2] = ATR_DEXTERITY;
cond_value[2] = 35;
owner = ORG_855_Wolf;
visual = "ItRwLongbow.mms";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Dex_needed;
count[3] = cond_value[2];
text[5] = NAME_Value;
count[5] = value;
};
instance Silas_Axt(C_Item)
{
name = "Silasova sekyra";
mainflag = ITEM_KAT_NF;
flags = ITEM_AXE;
material = MAT_METAL;
value = 290;
damageTotal = 55;
damagetype = DAM_EDGE;
range = 100;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 40;
owner = ORG_841_Silas;
visual = "ItMw_1H_Axe_03.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_OneHanded;
text[5] = NAME_Value;
count[5] = value;
};
instance Heerscherstab(C_Item)
{
name = "Žezlo";
mainflag = ITEM_KAT_NF;
flags = ITEM_2HD_AXE;
material = MAT_WOOD;
value = 150;
damageTotal = 26;
damagetype = DAM_EDGE;
range = 150;
cond_atr[2] = ATR_STRENGTH;
cond_value[2] = 20;
owner = Bau_900_Ricelord;
visual = "ItMw_2H_Staff_02.3DS";
description = name;
text[2] = NAME_Damage;
count[2] = damageTotal;
text[3] = NAME_Str_needed;
count[3] = cond_value[2];
text[4] = NAME_TwoHanded;
text[5] = NAME_Value;
count[5] = value;
};
| D |
// This file is part of Visual D
//
// Visual D integrates the D programming language into Visual Studio
// Copyright (c) 2010 by Rainer Schuetze, All Rights Reserved
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
module visuald.stringutil;
import visuald.windows;
import visuald.comutil;
import stdext.file;
import core.stdc.stdlib;
//import std.windows.charset;
import std.path;
import std.utf;
import std.string;
import std.ascii;
import std.conv;
import std.array;
import std.algorithm;
string ellipseString(string s, int maxlen)
{
if (s.length > maxlen - 1)
s = s[0 .. maxlen - 4] ~ "...";
return s;
}
void addFileMacros(string path, string base, ref string[string] replacements)
{
replacements[base ~ "PATH"] = path;
replacements[base ~ "DIR"] = dirName(path);
string filename = baseName(path);
string ext = extension(path);
if(ext.startsWith("."))
ext = ext[1..$];
replacements[base ~ "FILENAME"] = filename;
replacements[base ~ "EXT"] = ext;
string name = stripExtension(filename);
replacements[base ~ "NAME"] = name.length == 0 ? filename : name;
}
string getEnvVar(string var)
{
wchar[256] wbuf;
const(wchar)* wvar = toUTF16z(var);
uint cnt = GetEnvironmentVariable(wvar, wbuf.ptr, 256);
if(cnt < 256)
return to_string(wbuf.ptr, cnt);
wchar[] pbuf = new wchar[cnt+1];
cnt = GetEnvironmentVariable(wvar, pbuf.ptr, cnt + 1);
return to_string(pbuf.ptr, cnt);
}
string _replaceMacros(string start, dchar end, string esc)(string s, string[string] replacements)
{
int[string] lastReplacePos;
auto slen = start.length;
for(int i = 0; i + slen < s.length; )
{
if(s[i .. i+esc.length] == esc)
s = s[0 .. i] ~ s[i + 1 .. $];
else if(s[i .. i+slen] == start)
{
int len = indexOf(s[i+slen .. $], end);
if(len < 0)
break;
string id = toUpper(s[i + slen .. i + slen + len]);
string nid;
if(string *ps = id in replacements)
nid = *ps;
else
nid = getEnvVar(id);
int *p = id in lastReplacePos;
if(!p || *p <= i)
{
s = s[0 .. i] ~ nid ~ s[i + slen + 1 + len .. $];
int difflen = nid.length - (len + slen + 1);
foreach(ref int pos; lastReplacePos)
if(pos > i)
pos += difflen;
lastReplacePos[id] = i + nid.length;
continue;
}
}
i++;
}
return s;
}
string replaceMacros(string s, string[string] replacements)
{
return _replaceMacros!("$(", ')', "$$")(s, replacements);
}
string replaceEnvironment(string s, string[string] replacements)
{
return _replaceMacros!("%", '%', "%%")(s, replacements);
}
// ATTENTION: env modified
string[string] expandIniSectionEnvironment(string txt, string[string] env)
{
string[2][] lines = parseIniSectionAssignments(txt);
foreach(ref record; lines)
{
string id = toUpper(record[0]);
string expr = record[1];
string val = replaceEnvironment(expr, env);
env[id] = val;
}
return env;
}
unittest
{
string[string] env = [ "V1" : "x1", "V2" : "x2" ];
string ini = `
i1 = i%v1%
; comment
i2 = %i1%_i2
; comment with =
v2 = %v2%;i2`;
env = expandIniSectionEnvironment(ini, env);
//import std.stdio;
//writeln(env);
assert(env["I1"] == "ix1");
assert(env["I2"] == "ix1_i2");
assert(env["V1"] == "x1");
assert(env["V2"] == "x2;i2");
}
S createPasteString(S)(S s)
{
S t;
bool wasWhite = false;
foreach(dchar ch; s)
{
if(t.length > 30)
return t ~ "...";
bool isw = isWhite(ch);
if(ch == '&')
t ~= "&&";
else if(!isw)
t ~= ch;
else if(!wasWhite)
t ~= ' ';
wasWhite = isw;
}
return t;
}
// special version of std.string.indexOf that considers '.', '/' and '\\' the same
// character for case insensitive searches
ptrdiff_t indexOfPath(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
std.string.CaseSensitive cs = std.string.CaseSensitive.yes)
{
const(Char1)[] balance;
if (cs == std.string.CaseSensitive.yes)
{
balance = std.algorithm.find(s, sub);
}
else
{
static bool isSame(Char1, Char2)(Char1 c1, Char2 c2)
{
if (c1 == '.' || c1 == '/' || c1 == '\\')
return c2 == '.' || c2 == '/' || c2 == '\\';
return std.uni.toLower(c1) == std.uni.toLower(c2);
}
balance = std.algorithm.find!((a, b) => isSame(a, b))(s, sub);
}
return balance.empty ? -1 : balance.ptr - s.ptr;
}
| D |
import std.stdio;
import diet.Parser;
void main()
{
import arsd.dom : Document;
auto doc = new Document(
`<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Dashboard - Brand</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
<link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css">
<link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
<link rel="stylesheet" href="assets/fonts/fontawesome5-overrides.min.css">
</head>
<body id="page-top">
<div id="wrapper">
<nav class="navbar navbar-dark align-items-start sidebar sidebar-dark accordion bg-gradient-primary p-0">
<div class="container-fluid d-flex flex-column p-0"><a class="navbar-brand d-flex justify-content-center align-items-center sidebar-brand m-0" href="#">
<div class="sidebar-brand-icon rotate-n-15"><i class="fas fa-laugh-wink"></i></div>
<div class="sidebar-brand-text mx-3"><span>Brand</span></div>
</a>
<hr class="sidebar-divider my-0">
<ul class="nav navbar-nav text-light" id="accordionSidebar">
<li class="nav-item"><a class="nav-link active" href="index.html"><i class="fas fa-tachometer-alt"></i><span>Dashboard</span></a></li>
</ul>
<div class="text-center d-none d-md-inline"><button class="btn rounded-circle border-0" id="sidebarToggle" type="button"></button></div>
</div>
</nav>
<div class="d-flex flex-column" id="content-wrapper">
<div id="content">
<nav class="navbar navbar-light navbar-expand bg-white shadow mb-4 topbar static-top">
<div class="container-fluid"><button class="btn btn-link d-md-none rounded-circle mr-3" id="sidebarToggleTop" type="button"><i class="fas fa-bars"></i></button>
<form class="form-inline d-none d-sm-inline-block mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search">
<div class="input-group"><input class="bg-light form-control border-0 small" type="text" placeholder="Search for ...">
<div class="input-group-append"><button class="btn btn-primary py-0" type="button"><i class="fas fa-search"></i></button></div>
</div>
</form>
<ul class="nav navbar-nav flex-nowrap ml-auto">
<li class="nav-item dropdown d-sm-none no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><i class="fas fa-search"></i></a>
<div class="dropdown-menu dropdown-menu-right p-3 animated--grow-in" aria-labelledby="searchDropdown">
<form class="form-inline mr-auto navbar-search w-100">
<div class="input-group"><input class="bg-light form-control border-0 small" type="text" placeholder="Search for ...">
<div class="input-group-append"><button class="btn btn-primary py-0" type="button"><i class="fas fa-search"></i></button></div>
</div>
</form>
</div>
</li>
<li class="nav-item dropdown no-arrow mx-1">
<div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><span class="badge badge-danger badge-counter">3+</span><i class="fas fa-bell fa-fw"></i></a>
<div class="dropdown-menu dropdown-menu-right dropdown-list dropdown-menu-right animated--grow-in">
<h6 class="dropdown-header">alerts center</h6><a class="d-flex align-items-center dropdown-item" href="#">
<div class="mr-3">
<div class="bg-primary icon-circle"><i class="fas fa-file-alt text-white"></i></div>
</div>
<div><span class="small text-gray-500">December 12, 2019</span>
<p>A new monthly report is ready to download!</p>
</div>
</a><a class="d-flex align-items-center dropdown-item" href="#">
<div class="mr-3">
<div class="bg-success icon-circle"><i class="fas fa-donate text-white"></i></div>
</div>
<div><span class="small text-gray-500">December 7, 2019</span>
<p>$290.29 has been deposited into your account!</p>
</div>
</a><a class="d-flex align-items-center dropdown-item" href="#">
<div class="mr-3">
<div class="bg-warning icon-circle"><i class="fas fa-exclamation-triangle text-white"></i></div>
</div>
<div><span class="small text-gray-500">December 2, 2019</span>
<p>Spending Alert: We've noticed unusually high spending for your account.</p>
</div>
</a><a class="text-center dropdown-item small text-gray-500" href="#">Show All Alerts</a>
</div>
</div>
</li>
<li class="nav-item dropdown no-arrow mx-1">
<div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><i class="fas fa-envelope fa-fw"></i><span class="badge badge-danger badge-counter">7</span></a>
<div class="dropdown-menu dropdown-menu-right dropdown-list dropdown-menu-right animated--grow-in">
<h6 class="dropdown-header">alerts center</h6><a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar4.jpeg">
<div class="bg-success status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>Hi there! I am wondering if you can help me with a problem I've been having.</span></div>
<p class="small text-gray-500 mb-0">Emily Fowler - 58m</p>
</div>
</a><a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar2.jpeg">
<div class="status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>I have the photos that you ordered last month!</span></div>
<p class="small text-gray-500 mb-0">Jae Chun - 1d</p>
</div>
</a><a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar3.jpeg">
<div class="bg-warning status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>Last month's report looks great, I am very happy with the progress so far, keep up the good work!</span></div>
<p class="small text-gray-500 mb-0">Morgan Alvarez - 2d</p>
</div>
</a><a class="d-flex align-items-center dropdown-item" href="#">
<div class="dropdown-list-image mr-3"><img class="rounded-circle" src="assets/img/avatars/avatar5.jpeg">
<div class="bg-success status-indicator"></div>
</div>
<div class="font-weight-bold">
<div class="text-truncate"><span>Am I a good boy? The reason I ask is because someone told me that people say this to all dogs, even if they aren't good...</span></div>
<p class="small text-gray-500 mb-0">Chicken the Dog · 2w</p>
</div>
</a><a class="text-center dropdown-item small text-gray-500" href="#">Show All Alerts</a>
</div>
</div>
<div class="shadow dropdown-list dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown"></div>
</li>
<div class="d-none d-sm-block topbar-divider"></div>
<li class="nav-item dropdown no-arrow">
<div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link" data-toggle="dropdown" aria-expanded="false" href="#"><span class="d-none d-lg-inline mr-2 text-gray-600 small">Valerie Luna</span><img class="border rounded-circle img-profile" src="assets/img/avatars/avatar1.jpeg"></a>
<div class="dropdown-menu shadow dropdown-menu-right animated--grow-in"><a class="dropdown-item" href="#"><i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> Profile</a><a class="dropdown-item" href="#"><i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i> Settings</a><a class="dropdown-item" href="#"><i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i> Activity log</a>
<div class="dropdown-divider"></div><a class="dropdown-item" href="#"><i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i> Logout</a>
</div>
</div>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
<div class="d-sm-flex justify-content-between align-items-center mb-4">
<h3 class="text-dark mb-0">Dashboard</h3><a class="btn btn-primary btn-sm d-none d-sm-inline-block" role="button" href="#"><i class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
</div>
<div class="row">
<div class="col-md-6 col-xl-3 mb-4">
<div class="card shadow border-left-primary py-2">
<div class="card-body">
<div class="row align-items-center no-gutters">
<div class="col mr-2">
<div class="text-uppercase text-primary font-weight-bold text-xs mb-1"><span>Earnings (monthly)</span></div>
<div class="text-dark font-weight-bold h5 mb-0"><span>$40,000</span></div>
</div>
<div class="col-auto"><i class="fas fa-calendar fa-2x text-gray-300"></i></div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xl-3 mb-4">
<div class="card shadow border-left-success py-2">
<div class="card-body">
<div class="row align-items-center no-gutters">
<div class="col mr-2">
<div class="text-uppercase text-success font-weight-bold text-xs mb-1"><span>Earnings (annual)</span></div>
<div class="text-dark font-weight-bold h5 mb-0"><span>$215,000</span></div>
</div>
<div class="col-auto"><i class="fas fa-dollar-sign fa-2x text-gray-300"></i></div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xl-3 mb-4">
<div class="card shadow border-left-info py-2">
<div class="card-body">
<div class="row align-items-center no-gutters">
<div class="col mr-2">
<div class="text-uppercase text-info font-weight-bold text-xs mb-1"><span>Tasks</span></div>
<div class="row no-gutters align-items-center">
<div class="col-auto">
<div class="text-dark font-weight-bold h5 mb-0 mr-3"><span>50%</span></div>
</div>
<div class="col">
<div class="progress progress-sm">
<div class="progress-bar bg-info" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 50%;"><span class="sr-only">50%</span></div>
</div>
</div>
</div>
</div>
<div class="col-auto"><i class="fas fa-clipboard-list fa-2x text-gray-300"></i></div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xl-3 mb-4">
<div class="card shadow border-left-warning py-2">
<div class="card-body">
<div class="row align-items-center no-gutters">
<div class="col mr-2">
<div class="text-uppercase text-warning font-weight-bold text-xs mb-1"><span>Pending Requests</span></div>
<div class="text-dark font-weight-bold h5 mb-0"><span>18</span></div>
</div>
<div class="col-auto"><i class="fas fa-comments fa-2x text-gray-300"></i></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-7 col-xl-8">
<div class="card shadow mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<h6 class="text-primary font-weight-bold m-0">Earnings Overview</h6>
<div class="dropdown no-arrow"><button class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false" type="button"><i class="fas fa-ellipsis-v text-gray-400"></i></button>
<div class="dropdown-menu shadow dropdown-menu-right animated--fade-in">
<p class="text-center dropdown-header">dropdown header:</p><a class="dropdown-item" href="#"> Action</a><a class="dropdown-item" href="#"> Another action</a>
<div class="dropdown-divider"></div><a class="dropdown-item" href="#"> Something else here</a>
</div>
</div>
</div>
<div class="card-body">
<div class="chart-area"><canvas data-bs-chart="{"type":"line","data":{"labels":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"],"datasets":[{"label":"Earnings","fill":true,"data":["0","10000","5000","15000","10000","20000","15000","25000"],"backgroundColor":"rgba(78, 115, 223, 0.05)","borderColor":"rgba(78, 115, 223, 1)"}]},"options":{"maintainAspectRatio":false,"legend":{"display":false},"title":{},"scales":{"xAxes":[{"gridLines":{"color":"rgb(234, 236, 244)","zeroLineColor":"rgb(234, 236, 244)","drawBorder":false,"drawTicks":false,"borderDash":["2"],"zeroLineBorderDash":["2"],"drawOnChartArea":false},"ticks":{"fontColor":"#858796","padding":20}}],"yAxes":[{"gridLines":{"color":"rgb(234, 236, 244)","zeroLineColor":"rgb(234, 236, 244)","drawBorder":false,"drawTicks":false,"borderDash":["2"],"zeroLineBorderDash":["2"]},"ticks":{"fontColor":"#858796","padding":20}}]}}}"></canvas></div>
</div>
</div>
</div>
<div class="col-lg-5 col-xl-4">
<div class="card shadow mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<h6 class="text-primary font-weight-bold m-0">Revenue Sources</h6>
<div class="dropdown no-arrow"><button class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false" type="button"><i class="fas fa-ellipsis-v text-gray-400"></i></button>
<div class="dropdown-menu shadow dropdown-menu-right animated--fade-in">
<p class="text-center dropdown-header">dropdown header:</p><a class="dropdown-item" href="#"> Action</a><a class="dropdown-item" href="#"> Another action</a>
<div class="dropdown-divider"></div><a class="dropdown-item" href="#"> Something else here</a>
</div>
</div>
</div>
<div class="card-body">
<div class="chart-area"><canvas data-bs-chart="{"type":"doughnut","data":{"labels":["Direct","Social","Referral"],"datasets":[{"label":"","backgroundColor":["#4e73df","#1cc88a","#36b9cc"],"borderColor":["#ffffff","#ffffff","#ffffff"],"data":["50","30","15"]}]},"options":{"maintainAspectRatio":false,"legend":{"display":false},"title":{}}}"></canvas></div>
<div class="text-center small mt-4"><span class="mr-2"><i class="fas fa-circle text-primary"></i> Direct</span><span class="mr-2"><i class="fas fa-circle text-success"></i> Social</span><span class="mr-2"><i class="fas fa-circle text-info"></i> Refferal</span></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 mb-4">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="text-primary font-weight-bold m-0">Projects</h6>
</div>
<div class="card-body">
<h4 class="small font-weight-bold">Server migration<span class="float-right">20%</span></h4>
<div class="progress mb-4">
<div class="progress-bar bg-danger" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%;"><span class="sr-only">20%</span></div>
</div>
<h4 class="small font-weight-bold">Sales tracking<span class="float-right">40%</span></h4>
<div class="progress mb-4">
<div class="progress-bar bg-warning" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%;"><span class="sr-only">40%</span></div>
</div>
<h4 class="small font-weight-bold">Customer Database<span class="float-right">60%</span></h4>
<div class="progress mb-4">
<div class="progress-bar bg-primary" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"><span class="sr-only">60%</span></div>
</div>
<h4 class="small font-weight-bold">Payout Details<span class="float-right">80%</span></h4>
<div class="progress mb-4">
<div class="progress-bar bg-info" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%;"><span class="sr-only">80%</span></div>
</div>
<h4 class="small font-weight-bold">Account setup<span class="float-right">Complete!</span></h4>
<div class="progress mb-4">
<div class="progress-bar bg-success" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;"><span class="sr-only">100%</span></div>
</div>
</div>
</div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="text-primary font-weight-bold m-0">Todo List</h6>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div class="row align-items-center no-gutters">
<div class="col mr-2">
<h6 class="mb-0"><strong>Lunch meeting</strong></h6><span class="text-xs">10:30 AM</span>
</div>
<div class="col-auto">
<div class="custom-control custom-checkbox"><input class="custom-control-input" type="checkbox" id="formCheck-1"><label class="custom-control-label" for="formCheck-1"></label></div>
</div>
</div>
</li>
<li class="list-group-item">
<div class="row align-items-center no-gutters">
<div class="col mr-2">
<h6 class="mb-0"><strong>Lunch meeting</strong></h6><span class="text-xs">11:30 AM</span>
</div>
<div class="col-auto">
<div class="custom-control custom-checkbox"><input class="custom-control-input" type="checkbox" id="formCheck-2"><label class="custom-control-label" for="formCheck-2"></label></div>
</div>
</div>
</li>
<li class="list-group-item">
<div class="row align-items-center no-gutters">
<div class="col mr-2">
<h6 class="mb-0"><strong>Lunch meeting</strong></h6><span class="text-xs">12:30 AM</span>
</div>
<div class="col-auto">
<div class="custom-control custom-checkbox"><input class="custom-control-input" type="checkbox" id="formCheck-3"><label class="custom-control-label" for="formCheck-3"></label></div>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-lg-6 mb-4">
<div class="card text-white bg-primary shadow">
<div class="card-body">
<p class="m-0">Primary</p>
<p class="text-white-50 small m-0">#4e73df</p>
</div>
</div>
</div>
<div class="col-lg-6 mb-4">
<div class="card text-white bg-success shadow">
<div class="card-body">
<p class="m-0">Success</p>
<p class="text-white-50 small m-0">#1cc88a</p>
</div>
</div>
</div>
<div class="col-lg-6 mb-4">
<div class="card text-white bg-info shadow">
<div class="card-body">
<p class="m-0">Info</p>
<p class="text-white-50 small m-0">#36b9cc</p>
</div>
</div>
</div>
<div class="col-lg-6 mb-4">
<div class="card text-white bg-warning shadow">
<div class="card-body">
<p class="m-0">Warning</p>
<p class="text-white-50 small m-0">#f6c23e</p>
</div>
</div>
</div>
<div class="col-lg-6 mb-4">
<div class="card text-white bg-danger shadow">
<div class="card-body">
<p class="m-0">Danger</p>
<p class="text-white-50 small m-0">#e74a3b</p>
</div>
</div>
</div>
<div class="col-lg-6 mb-4">
<div class="card text-white bg-secondary shadow">
<div class="card-body">
<p class="m-0">Secondary</p>
<p class="text-white-50 small m-0">#858796</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="bg-white sticky-footer">
<div class="container my-auto">
<div class="text-center my-auto copyright"><span>Copyright © Brand 2021</span></div>
</div>
</footer>
</div><a class="border rounded d-inline scroll-to-top" href="#page-top"><i class="fas fa-angle-up"></i></a>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/chart.min.js"></script>
<script src="assets/js/bs-init.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js"></script>
<script src="assets/js/theme.js"></script>
</body>
</html>`);
// auto doc = new Document(
// `<i class="fas fa-laugh-wink"></i>`);
// new Parser(doc).parse();
writeln(new Parser(doc).parse());
}
| D |
module artemisd.systems.intervalentitysystem;
import artemisd.aspect;
import artemisd.entitysystem;
import artemisd.utils.type;
public abstract class IntervalEntitySystem : EntitySystem {
mixin TypeDecl;
private float acc;
private float interval;
public this(Aspect aspect,float interval)
{
super(aspect);
this.interval = interval;
}
protected override bool checkProcessing()
{
acc += world.getDelta();
if(acc >= interval)
{
acc -= interval;
return true;
}
return false;
}
}
| D |
the mathematics of triangles and trigonometric functions
neat and smart in appearance
| D |
; Copyright (C) 2008 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
.source T_fill_array_data_1.java
.class public dot.junit.opcodes.fill_array_data.d.T_fill_array_data_1
.super java/lang/Object
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run([I)V
.limit regs 10
fill-array-data v9 I
1
2
3
4
5
fill-array-data-end
return-void
.end method
| D |
/**
* D header file for POSIX.
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Sean Kelly, Alex Rønne Petersen
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
*/
/* Copyright Sean Kelly 2005 - 2009.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module core.sys.posix.sys.mman;
private import core.sys.posix.config;
public import core.sys.posix.sys.types; // for off_t, mode_t
version (OSX)
version = Darwin;
else version (iOS)
version = Darwin;
else version (TVOS)
version = Darwin;
else version (WatchOS)
version = Darwin;
version (ARM) version = ARM_Any;
version (AArch64) version = ARM_Any;
version (HPPA) version = HPPA_Any;
version (HPPA64) version = HPPA_Any;
version (MIPS32) version = MIPS_Any;
version (MIPS64) version = MIPS_Any;
version (PPC) version = PPC_Any;
version (PPC64) version = PPC_Any;
version (RISCV32) version = RISCV_Any;
version (RISCV64) version = RISCV_Any;
version (S390) version = IBMZ_Any;
version (SPARC) version = SPARC_Any;
version (SPARC64) version = SPARC_Any;
version (SystemZ) version = IBMZ_Any;
version (X86) version = X86_Any;
version (X86_64) version = X86_Any;
version (Posix):
extern (C) nothrow @nogc:
//
// Advisory Information (ADV)
//
/*
int posix_madvise(void*, size_t, int);
*/
//
// Advisory Information and either Memory Mapped Files or Shared Memory Objects (MC1)
//
/*
POSIX_MADV_NORMAL
POSIX_MADV_SEQUENTIAL
POSIX_MADV_RANDOM
POSIX_MADV_WILLNEED
POSIX_MADV_DONTNEED
*/
version (CRuntime_Glibc)
{
version (Alpha)
private enum __POSIX_MADV_DONTNEED = 6;
else
private enum __POSIX_MADV_DONTNEED = 4;
static if (__USE_XOPEN2K)
{
enum
{
POSIX_MADV_NORMAL = 0,
POSIX_MADV_RANDOM = 1,
POSIX_MADV_SEQUENTIAL = 2,
POSIX_MADV_WILLNEED = 3,
POSIX_MADV_DONTNEED = __POSIX_MADV_DONTNEED,
}
int posix_madvise(void *__addr, size_t __len, int __advice);
}
}
else version (Darwin)
{
enum POSIX_MADV_NORMAL = 0;
enum POSIX_MADV_RANDOM = 1;
enum POSIX_MADV_SEQUENTIAL = 2;
enum POSIX_MADV_WILLNEED = 3;
enum POSIX_MADV_DONTNEED = 4;
int posix_madvise(void *addr, size_t len, int advice);
}
else version (FreeBSD)
{
enum POSIX_MADV_NORMAL = 0;
enum POSIX_MADV_RANDOM = 1;
enum POSIX_MADV_SEQUENTIAL = 2;
enum POSIX_MADV_WILLNEED = 3;
enum POSIX_MADV_DONTNEED = 4;
int posix_madvise(void *addr, size_t len, int advice);
}
else version (NetBSD)
{
enum POSIX_MADV_NORMAL = 0;
enum POSIX_MADV_RANDOM = 1;
enum POSIX_MADV_SEQUENTIAL = 2;
enum POSIX_MADV_WILLNEED = 3;
enum POSIX_MADV_DONTNEED = 4;
int posix_madvise(void *addr, size_t len, int advice);
}
else version (OpenBSD)
{
enum POSIX_MADV_NORMAL = 0;
enum POSIX_MADV_RANDOM = 1;
enum POSIX_MADV_SEQUENTIAL = 2;
enum POSIX_MADV_WILLNEED = 3;
enum POSIX_MADV_DONTNEED = 4;
int posix_madvise(void *addr, size_t len, int advice);
}
else version (DragonFlyBSD)
{
enum POSIX_MADV_NORMAL = 0;
enum POSIX_MADV_RANDOM = 1;
enum POSIX_MADV_SEQUENTIAL = 2;
enum POSIX_MADV_WILLNEED = 3;
enum POSIX_MADV_DONTNEED = 4;
int posix_madvise(void *addr, size_t len, int advice);
}
else version (Solaris)
{
}
else version (CRuntime_Bionic)
{
}
else version (CRuntime_Musl)
{
enum
{
POSIX_MADV_NORMAL = 0,
POSIX_MADV_RANDOM = 1,
POSIX_MADV_SEQUENTIAL = 2,
POSIX_MADV_WILLNEED = 3,
POSIX_MADV_DONTNEED = 4,
}
int posix_madvise(void *, size_t, int);
}
else version (CRuntime_UClibc)
{
enum
{
POSIX_MADV_NORMAL = 0,
POSIX_MADV_RANDOM = 1,
POSIX_MADV_SEQUENTIAL = 2,
POSIX_MADV_WILLNEED = 3,
POSIX_MADV_DONTNEED = 4,
}
int posix_madvise(void *__addr, size_t __len, int __advice);
}
else
{
static assert(false, "Unsupported platform");
}
//
// Memory Mapped Files, Shared Memory Objects, or Memory Protection (MC2)
//
/*
PROT_READ
PROT_WRITE
PROT_EXEC
PROT_NONE
*/
version (CRuntime_Glibc)
{
enum PROT_NONE = 0x0;
enum PROT_READ = 0x1;
enum PROT_WRITE = 0x2;
enum PROT_EXEC = 0x4;
}
else version (Darwin)
{
enum PROT_NONE = 0x00;
enum PROT_READ = 0x01;
enum PROT_WRITE = 0x02;
enum PROT_EXEC = 0x04;
}
else version (FreeBSD)
{
enum PROT_NONE = 0x00;
enum PROT_READ = 0x01;
enum PROT_WRITE = 0x02;
enum PROT_EXEC = 0x04;
}
else version (NetBSD)
{
enum PROT_NONE = 0x00;
enum PROT_READ = 0x01;
enum PROT_WRITE = 0x02;
enum PROT_EXEC = 0x04;
}
else version (OpenBSD)
{
enum PROT_NONE = 0x00;
enum PROT_READ = 0x01;
enum PROT_WRITE = 0x02;
enum PROT_EXEC = 0x04;
}
else version (DragonFlyBSD)
{
enum PROT_NONE = 0x00;
enum PROT_READ = 0x01;
enum PROT_WRITE = 0x02;
enum PROT_EXEC = 0x04;
}
else version (Solaris)
{
enum PROT_NONE = 0x00;
enum PROT_READ = 0x01;
enum PROT_WRITE = 0x02;
enum PROT_EXEC = 0x04;
}
else version (CRuntime_Bionic)
{
enum PROT_NONE = 0x00;
enum PROT_READ = 0x01;
enum PROT_WRITE = 0x02;
enum PROT_EXEC = 0x04;
}
else version (CRuntime_Musl)
{
enum PROT_NONE = 0x0;
enum PROT_READ = 0x1;
enum PROT_WRITE = 0x2;
enum PROT_EXEC = 0x4;
}
else version (CRuntime_UClibc)
{
enum PROT_NONE = 0x0;
enum PROT_READ = 0x1;
enum PROT_WRITE = 0x2;
enum PROT_EXEC = 0x4;
}
else
{
static assert(false, "Unsupported platform");
}
//
// Memory Mapped Files, Shared Memory Objects, or Typed Memory Objects (MC3)
//
/*
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
*/
version (CRuntime_Glibc)
{
static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t);
static if (__USE_FILE_OFFSET64)
alias mmap = mmap64;
else
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (Darwin)
{
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (FreeBSD)
{
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (NetBSD)
{
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (OpenBSD)
{
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (DragonFlyBSD)
{
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (Solaris)
{
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (CRuntime_Bionic)
{
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (CRuntime_Musl)
{
static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off_t);
static if (__USE_FILE_OFFSET64)
alias mmap = mmap64;
else
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else version (CRuntime_UClibc)
{
static if (__USE_LARGEFILE64) void* mmap64(void*, size_t, int, int, int, off64_t);
static if (__USE_FILE_OFFSET64)
alias mmap = mmap64;
else
void* mmap(void*, size_t, int, int, int, off_t);
int munmap(void*, size_t);
}
else
{
static assert(false, "Unsupported platform");
}
//
// Memory Mapped Files (MF)
//
/*
MAP_SHARED (MF|SHM)
MAP_PRIVATE (MF|SHM)
MAP_FIXED (MF|SHM)
MAP_FAILED (MF|SHM)
MS_ASYNC (MF|SIO)
MS_SYNC (MF|SIO)
MS_INVALIDATE (MF|SIO)
int msync(void*, size_t, int); (MF|SIO)
*/
version (CRuntime_Glibc)
{
enum MAP_SHARED = 0x01;
enum MAP_PRIVATE = 0x02;
enum MAP_FIXED = 0x10;
enum MAP_FAILED = cast(void*) -1;
version (MICROBLAZE)
private enum DEFAULTS = true;
else version (Alpha)
{
private enum DEFAULTS = false;
enum MAP_ANON = 0x10;
enum MS_ASYNC = 1;
enum MS_SYNC = 2;
enum MS_INVALIDATE = 4;
}
else version (SH)
private enum DEFAULTS = true;
else version (ARM_Any)
private enum DEFAULTS = true;
else version (IBMZ_Any)
private enum DEFAULTS = true;
else version (IA64)
private enum DEFAULTS = true;
else version (HPPA_Any)
{
private enum DEFAULTS = false;
enum MAP_ANON = 0x10;
enum MS_SYNC = 1;
enum MS_ASYNC = 2;
enum MS_INVALIDATE = 4;
}
else version (M68K)
private enum DEFAULTS = true;
else version (TILE)
private enum DEFAULTS = true;
else version (X86_Any)
private enum DEFAULTS = true;
else version (MIPS_Any)
{
private enum DEFAULTS = false;
enum MAP_ANON = 0x0800;
enum MS_ASYNC = 1;
enum MS_INVALIDATE = 2;
enum MS_SYNC = 4;
}
else version (RISCV_Any)
private enum DEFAULTS = true;
else version (SPARC_Any)
private enum DEFAULTS = true;
else version (PPC_Any)
private enum DEFAULTS = true;
else
static assert(0, "unimplemented");
static if (DEFAULTS)
{
enum MAP_ANON = 0x20;
enum MS_ASYNC = 1;
enum MS_INVALIDATE = 2;
enum MS_SYNC = 4;
}
int msync(void*, size_t, int);
}
else version (Darwin)
{
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;
enum MAP_ANON = 0x1000;
enum MAP_FAILED = cast(void*)-1;
enum MS_ASYNC = 0x0001;
enum MS_INVALIDATE = 0x0002;
enum MS_SYNC = 0x0010;
int msync(void*, size_t, int);
}
else version (FreeBSD)
{
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;
enum MAP_ANON = 0x1000;
enum MAP_FAILED = cast(void*)-1;
enum MS_SYNC = 0x0000;
enum MS_ASYNC = 0x0001;
enum MS_INVALIDATE = 0x0002;
int msync(void*, size_t, int);
}
else version (NetBSD)
{
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;
enum MAP_ANON = 0x1000;
enum MAP_FAILED = cast(void*)-1;
enum MS_SYNC = 0x0004;
enum MS_ASYNC = 0x0001;
enum MS_INVALIDATE = 0x0002;
int __msync13(void*, size_t, int);
alias msync = __msync13;
}
else version (OpenBSD)
{
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;
enum MAP_ANON = 0x1000;
enum MAP_FAILED = cast(void*)-1;
enum MS_SYNC = 0x0002;
enum MS_ASYNC = 0x0001;
enum MS_INVALIDATE = 0x0004;
int msync(void*, size_t, int);
}
else version (DragonFlyBSD)
{
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;
enum MAP_ANON = 0x1000;
enum MAP_FAILED = cast(void*)-1;
enum MS_SYNC = 0x0000;
enum MS_ASYNC = 0x0001;
enum MS_INVALIDATE = 0x0002;
int msync(void*, size_t, int);
}
else version (Solaris)
{
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;
enum MAP_ANON = 0x0100;
enum MAP_FAILED = cast(void*)-1;
enum MS_SYNC = 0x0004;
enum MS_ASYNC = 0x0001;
enum MS_INVALIDATE = 0x0002;
int msync(void*, size_t, int);
}
else version (CRuntime_Bionic)
{
enum MAP_SHARED = 0x0001;
enum MAP_PRIVATE = 0x0002;
enum MAP_FIXED = 0x0010;
enum MAP_ANON = 0x0020;
enum MAP_FAILED = cast(void*)-1;
enum MS_SYNC = 4;
enum MS_ASYNC = 1;
enum MS_INVALIDATE = 2;
int msync(const scope void*, size_t, int);
}
else version (CRuntime_Musl)
{
enum MAP_SHARED = 0x01;
enum MAP_PRIVATE = 0x02;
enum MAP_FIXED = 0x10;
enum MAP_FAILED = cast(void*) -1;
enum MAP_ANON = 0x20;
enum MS_ASYNC = 1;
enum MS_INVALIDATE = 2;
enum MS_SYNC = 4;
int msync(void*, size_t, int);
}
else version (CRuntime_UClibc)
{
enum MAP_SHARED = 0x01;
enum MAP_PRIVATE = 0x02;
enum MAP_FIXED = 0x10;
enum MAP_FAILED = cast(void*) -1;
version (X86_64)
{
enum MAP_ANON = 0x20;
enum MS_ASYNC = 1;
enum MS_INVALIDATE = 2;
enum MS_SYNC = 4;
}
else version (MIPS32)
{
enum MAP_ANON = 0x0800;
enum MS_ASYNC = 1;
enum MS_INVALIDATE = 2;
enum MS_SYNC = 4;
}
else version (ARM)
{
enum MAP_ANON = 0x020;
enum MS_ASYNC = 1;
enum MS_INVALIDATE = 2;
enum MS_SYNC = 4;
}
else
{
static assert(false, "Architecture not supported.");
}
int msync(void*, size_t, int);
}
else
{
static assert(false, "Unsupported platform");
}
//
// Process Memory Locking (ML)
//
/*
MCL_CURRENT
MCL_FUTURE
int mlockall(int);
int munlockall();
*/
version (CRuntime_Glibc)
{
version (SPARC_Any) enum
{
MCL_CURRENT = 0x2000,
MCL_FUTURE = 0x4000,
}
else version (PPC_Any) enum
{
MCL_CURRENT = 0x2000,
MCL_FUTURE = 0x4000,
}
else version (Alpha) enum
{
MCL_CURRENT = 8192,
MCL_FUTURE = 16384,
}
else enum
{
MCL_CURRENT = 1,
MCL_FUTURE = 2,
}
int mlockall(int);
int munlockall();
}
else version (Darwin)
{
enum MCL_CURRENT = 0x0001;
enum MCL_FUTURE = 0x0002;
int mlockall(int);
int munlockall();
}
else version (FreeBSD)
{
enum MCL_CURRENT = 0x0001;
enum MCL_FUTURE = 0x0002;
int mlockall(int);
int munlockall();
}
else version (NetBSD)
{
enum MCL_CURRENT = 0x0001;
enum MCL_FUTURE = 0x0002;
int mlockall(int);
int munlockall();
}
else version (OpenBSD)
{
enum MCL_CURRENT = 0x0001;
enum MCL_FUTURE = 0x0002;
int mlockall(int);
int munlockall();
}
else version (DragonFlyBSD)
{
enum MCL_CURRENT = 0x0001;
enum MCL_FUTURE = 0x0002;
int mlockall(int);
int munlockall();
}
else version (Solaris)
{
enum MCL_CURRENT = 0x0001;
enum MCL_FUTURE = 0x0002;
int mlockall(int);
int munlockall();
}
else version (CRuntime_Bionic)
{
enum MCL_CURRENT = 1;
enum MCL_FUTURE = 2;
int mlockall(int);
int munlockall();
}
else version (CRuntime_Musl)
{
enum
{
MCL_CURRENT = 1,
MCL_FUTURE = 2,
}
int mlockall(int);
int munlockall();
}
else version (CRuntime_UClibc)
{
enum
{
MCL_CURRENT = 1,
MCL_FUTURE = 2,
}
int mlockall(int);
int munlockall();
}
else
{
static assert(false, "Unsupported platform");
}
//
// Range Memory Locking (MLR)
//
/*
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
*/
version (CRuntime_Glibc)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (Darwin)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (FreeBSD)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (NetBSD)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (OpenBSD)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (DragonFlyBSD)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (Solaris)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (CRuntime_Bionic)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (CRuntime_Musl)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else version (CRuntime_UClibc)
{
int mlock(const scope void*, size_t);
int munlock(const scope void*, size_t);
}
else
{
static assert(false, "Unsupported platform");
}
//
// Memory Protection (MPR)
//
/*
int mprotect(void*, size_t, int);
*/
version (CRuntime_Glibc)
{
int mprotect(void*, size_t, int);
}
else version (Darwin)
{
int mprotect(void*, size_t, int);
}
else version (FreeBSD)
{
int mprotect(void*, size_t, int);
}
else version (NetBSD)
{
int mprotect(void*, size_t, int);
}
else version (OpenBSD)
{
int mprotect(void*, size_t, int);
}
else version (DragonFlyBSD)
{
int mprotect(void*, size_t, int);
}
else version (Solaris)
{
int mprotect(void*, size_t, int);
}
else version (CRuntime_Bionic)
{
int mprotect(const scope void*, size_t, int);
}
else version (CRuntime_Musl)
{
int mprotect(void*, size_t, int);
}
else version (CRuntime_UClibc)
{
int mprotect(void*, size_t, int);
}
else
{
static assert(false, "Unsupported platform");
}
//
// Shared Memory Objects (SHM)
//
/*
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
*/
version (CRuntime_Glibc)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (Darwin)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (FreeBSD)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (NetBSD)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (OpenBSD)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (DragonFlyBSD)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (Solaris)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (CRuntime_Bionic)
{
}
else version (CRuntime_Musl)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else version (CRuntime_UClibc)
{
int shm_open(const scope char*, int, mode_t);
int shm_unlink(const scope char*);
}
else
{
static assert(false, "Unsupported platform");
}
//
// Typed Memory Objects (TYM)
//
/*
POSIX_TYPED_MEM_ALLOCATE
POSIX_TYPED_MEM_ALLOCATE_CONTIG
POSIX_TYPED_MEM_MAP_ALLOCATABLE
struct posix_typed_mem_info
{
size_t posix_tmi_length;
}
int posix_mem_offset(const scope void*, size_t, off_t *, size_t *, int *);
int posix_typed_mem_get_info(int, struct posix_typed_mem_info *);
int posix_typed_mem_open(const scope char*, int, int);
*/
| D |
import vibe.web.rest;
//import vibe.core.log;
import std.stdio;
import std.conv;
import std.string;
import vibe.data.json;
import vibe.web.auth;
import vibe.web.common;
import vibe.http.client;
import core.thread;
import std.datetime.date;
import std.datetime.systime;
import core.time;
struct SigInMessage
{
string statusMessage;
string AuthToken;
}
interface API_Interface {
@anyAuth string getHello();
@safe SigInMessage postSignIn(string username, string password);
@noAuth SigInMessage postSignIn(string username, string password);
}
void do_api_calls(RestInterfaceClient!API_Interface api_client,string username,string password, const bool test_expired_tokens=false)
{
// This function adds the jwt header for the authetithication
// It is a delegate: a local function with context
SigInMessage sigin_response;
void add_jwt_header(HTTPClientRequest req) @safe
{
writeln("Method add_jwt_header called");
req.headers["AuthToken"]= sigin_response.AuthToken;
req.headers["AuthUser"]="username";
}
/* We log in using the api method */
sigin_response = api_client.postSignIn(username,password);
writeln("sign_in_response.statusMessage=" ~ sigin_response.statusMessage);
writeln("sign_in_response.AuthToken=" ~ sigin_response.AuthToken);
api_client.requestFilter= &add_jwt_header;
// If we want to test expired tokens, wait some seconds
if (test_expired_tokens)
{
long currentTime_unix = Clock.currTime().toUnixTime();
writeln("currentTime_unix =" ~ to!string(currentTime_unix));
// wait some seconds
Thread.sleep(5.seconds);
currentTime_unix = Clock.currTime().toUnixTime();
writeln("currentTime_unix =" ~ to!string(currentTime_unix));
}
/* Now we do an API call */
try{
writeln("getHello=",api_client.getHello());
}
catch(RestException e)
{
writeln("status=",e.status());
writeln("result=",e.jsonResult());
}
}
void main()
{
auto api_client = new RestInterfaceClient!API_Interface("http://127.0.0.1:3000/api/");
writeln("api_client created");
writeln("\nWe first try to login with and invalid username & password combination");
do_api_calls(api_client,"Mary","word");
writeln("\nWe now log in with the right username & password but with an expried token");
do_api_calls(api_client,"John","secret",true);
writeln("\nFinally, we now log in with the right username & password, and a valid token");
do_api_calls(api_client,"John","secret");
}
| D |
module UnrealScript.Engine.AmbientSoundMovable;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.Engine.AmbientSound;
extern(C++) interface AmbientSoundMovable : AmbientSound
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.AmbientSoundMovable")); }
private static __gshared AmbientSoundMovable mDefaultProperties;
@property final static AmbientSoundMovable DefaultProperties() { mixin(MGDPC("AmbientSoundMovable", "AmbientSoundMovable Engine.Default__AmbientSoundMovable")); }
}
| D |
/**
* Platform independent parts of the library. Defines common signals
* that safe to catch, utilities for describing daemons and some
* utitility templates for duck typing.
*
* Copyright: © 2013-2014 Anton Gushcha
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module vibe.daemonize.daemon;
import vibe.daemonize.keymap;
import std.traits;
import std.typetuple;
/**
* Native signals that can be hooked. There arn't all
* linux native signals due safety.
*
* Most not listed signals are already binded by druntime (sigusr1 and
* sigusr2 are occupied by garbage collector) and rebinding
* cause a program hanging or ignoring all signal callbacks.
*
* You can define your own signals by $(B customSignal) function.
* These signals are mapped to realtime signals in linux.
*
* Note: Signal enum is based on string to map signals on winapi events.
*/
enum Signal : string
{
// Linux native requests
Abort = "Abort",
Terminate = "Terminate",
Quit = "Quit",
Interrupt = "Interrupt",
HangUp = "HangUp",
// Windows native requests
Stop = "Stop",
Continue = "Continue",
Pause = "Pause",
Shutdown = "Shutdown",
Interrogate = "Interrogate",
NetBindAdd = "NetBindAdd",
NetBindDisable = "NetBindDisable",
NetBindEnable = "NetBindEnable",
NetBindRemove = "NetBindRemove",
ParamChange = "ParamChange",
}
/**
* Creating your own custom signal. Theese signals are binded to
* realtime signals in linux and to winapi events in Windows.
*
* Example:
* --------
* enum LogRotatingSignal = "LogRotate".customSignal;
* --------
*/
@nogc Signal customSignal(string name) @safe pure nothrow
{
return cast(Signal)name;
}
/**
* Signal OR composition.
*
* If you'd like to hook several signals by one handler, you
* can use the template in place of signal in $(B KeyValueList)
* signal map.
*
* In that case the handler should also accept a Signal value
* as it second parameter.
*/
template Composition(Signals...)
{
alias signals = Signals;
template opEqual(T...)
{
static if(T.length > 0 && isComposition!(T[0]))
{
enum opEqual = [signals] == [T[0].signals];
}
else enum opEqual = false;
}
}
/// Checks if $(B T) is a composition of signals
template isComposition(alias T)
{
static if(__traits(compiles, T.signals))
{
private template isSignal(T...)
{
static if(is(T[0]))
{
enum isSignal = is(T[0] : Signal);
}
else
{
enum isSignal = is(typeof(T[0]) : Signal);
}
}
enum isComposition = allSatisfy!(isSignal, T.signals);
}
else enum isComposition = false;
}
/**
* Template for describing daemon in the package.
*
* To describe new daemon you should set unique name
* and signal -> callbacks mapping.
*
* $(B name) is used to name default pid and lock files
* of the daemon and also it is a service name in Windows.
*
* $(B pSignalMap) is a $(B KeyValueList) template where
* keys are $(B Signal) values and values are delegates of type:
* ----------
* bool delegate()
* ----------
* If the delegate returns $(B false), daemon terminates.
*
* Example:
* -----------
* struct MultilingualDict {
string serviceName() { return "Windows daemonize example"; }
string serviceDescription() { return "This service allows us to understand what daemonize does."; }
}
* alias daemon = Daemon!(
* "DaemonizeExample1",
* MultilingualDict,
* KeyValueList!(
* Signal.Terminate, ()
* {
* logger.logInfo("Exiting...");
* return false; // returning false will terminate daemon
* },
* Signal.HangUp, ()
* {
* logger.logInfo("Hello World!");
* return true; // continue execution
* }
* ),
*
* (shouldExit)
* {
* // will stop the daemon in 5 minutes
* auto time = Clock.currSystemTick + cast(TickDuration)5.dur!"minutes";
* bool timeout = false;
* while(!shouldExit() && time > Clock.currSystemTick) { }
*
* logger.logInfo("Exiting main function!");
*
* return 0;
* }
* );
* -----------
*/
template Daemon(
string name,
LANG,
alias pSignalMap,
alias pMainFunc)
{
enum daemonName = name;
LANG lang;
alias signalMap = pSignalMap;
alias mainFunc = pMainFunc;
}
/// Duck typing $(B Daemon) description
template isDaemon(alias T)
{
static if(__traits(compiles, T.daemonName) && __traits(compiles, T.signalMap)
&& __traits(compiles, T.mainFunc))
enum isDaemon = is(typeof(T.daemonName) == string);
else
enum isDaemon = false;
}
/**
* Truncated description of daemon for use with $(B sendSignal) function.
* You need to pass a daemon $(B name) and a list of signals to $(B Signals)
* expression list.
*
* Example:
* --------
* // Full description of daemon
* struct MultilingualDict {
string serviceName() { return "Windows daemonize example"; }
string serviceDescription() { return "This service allows us to understand what daemonize does."; }
}
* alias daemon = Daemon!(
* "DaemonizeExample2",
* MultilingualDict,
* KeyValueList!(
* Signal.Terminate, ()
* {
* logInfo("Exiting...");
* return false;
* },
* Signal.HangUp, ()
* {
* logInfo("Hello World!");
* return true;
* },
* RotateLogSignal, ()
* {
* logInfo("Rotating log!");
* return true;
* },
* DoSomethingSignal, ()
* {
* logInfo("Doing something...");
* return true;
* }
* ),
* (logger, shouldExit)
* {
* // some code
* }
* );
*
* // Truncated description for client
* alias daemon = DaemonClient!(
* "DaemonizeExample2",
* Signal.Terminate,
* Signal.HangUp,
* RotateLogSignal,
* DoSomethingSignal
* );
* ----------------
*/
template DaemonClient(
string name,
LANG,
Signals...)
{
private template isSignal(T...)
{
enum isSignal = is(typeof(T[0]) == Signal) || isComposition!(T[0]);
}
static assert(allSatisfy!(isSignal, Signals), "All values of Signals parameter have to be of Signal type!");
enum daemonName = name;
LANG lang;
alias signals = Signals;
}
/// Duck typing of $(B DaemonClient)
template isDaemonClient(alias T)
{
private template isSignal(T...)
{
enum isSignal = is(typeof(T[0]) == Signal) || isComposition!(T[0]);
}
static if(__traits(compiles, T.daemonName) && __traits(compiles, T.signals))
enum isDaemonClient = is(typeof(T.daemonName) == string) && allSatisfy!(isSignal, T.signals);
else
enum isDaemonClient = false;
}
unittest
{
struct MultilingualDict {
string serviceName() { return "Windows daemonize example"; }
string serviceDescription() { return "This service allows us to understand what daemonize does."; }
}
alias TestClient = DaemonClient!(
"DaemonizeExample2",
MultilingualDict,
Signal.Terminate,
Signal.HangUp);
static assert(isDaemonClient!TestClient);
} | D |
// ******************
// ZS_Zaehmen
// ******************
func void ZS_MM_Rtn_Zaehmen ()
{
Npc_SetPercTime (self, 1);
Npc_PercEnable (self, PERC_ASSESSPLAYER, B_MM_AssessPlayer);
Npc_PercEnable (self, PERC_ASSESSENEMY, B_MM_AssessEnemy);
Npc_PercEnable (self, PERC_ASSESSMAGIC, B_AssessMagic);
Npc_PercEnable (self, PERC_ASSESSDAMAGE, B_MM_AssessDamage);
Npc_PercEnable (self, PERC_ASSESSFIGHTSOUND, B_MM_AssessOthersDamage);
B_SetAttitude (self, ATT_FRIENDLY);
self.aivar[AIV_PARTYMEMBER] = TRUE;
if (self.aivar[AIV_Schwierigkeitsgrad] < Mod_Schwierigkeit)
|| (self.aivar[AIV_Schwierigkeitsgrad] > Mod_Schwierigkeit)
{
B_SetSchwierigkeit();
};
if (LeisenLaufen_Perk == TRUE)
{
if (self.senses_range == PERC_DIST_MONSTER_ACTIVE_MAX)
{
self.senses_range = (7*PERC_DIST_MONSTER_ACTIVE_MAX)/10;
}
else if (self.senses_range == PERC_DIST_ORC_ACTIVE_MAX)
{
self.senses_range = (7*PERC_DIST_ORC_ACTIVE_MAX)/10;
};
};
AI_StandUp (self);
AI_SetWalkmode (self, NPC_RUN);
};
func int ZS_MM_Rtn_Zaehmen_Loop()
{
if (Npc_GetDistToNpc (self, hero) > 500)
{
AI_GotoNpc (self, hero);
};
self.wp = Npc_GetNearestWP (self);
return LOOP_CONTINUE;
};
func void ZS_MM_Rtn_Zaehmen_End()
{
}; | D |
module registry;
import repository;
import std.algorithm : sort;
import vibe.vibe;
/// Settings to configure the package registry.
class DubRegistrySettings {
/// Prefix used to acces the registry.
string pathPrefix;
/// location for the package.json files on the filesystem.
Path metadataPath;
}
private struct DbPackage {
BsonObjectID _id;
BsonObjectID owner;
string name;
Json repository;
DbPackageVersion[] versions;
DbPackageVersion[string] branches;
string[] errors;
}
private struct DbPackageVersion {
BsonDate date;
string version_;
Json info;
}
class DubRegistry {
private {
MongoClient m_db;
MongoCollection m_packages;
DubRegistrySettings m_settings;
}
this(DubRegistrySettings settings)
{
m_db = connectMongoDB("127.0.0.1");
m_settings = settings;
m_packages = m_db.getCollection("vpmreg.packages");
repairVersionOrder();
}
void repairVersionOrder()
{
foreach( bp; m_packages.find() ){
auto p = deserializeBson!DbPackage(bp);
sort!((a, b) => vcmp(a, b))(p.versions);
m_packages.update(["_id": p._id], ["$set": ["versions": p.versions]]);
}
}
@property string[] availablePackages()
{
string[] all;
foreach( p; m_packages.find(Bson.EmptyObject, ["name": 1]) )
all ~= p.name.get!string;
return all;
}
void addPackage(Json repository, BsonObjectID user)
{
auto rep = getRepository(repository);
auto info = rep.getVersionInfo("~master");
checkPackageName(info.info.name.get!string);
foreach( string n, vspec; info.info.dependencies.opt!(Json[string]) )
checkPackageName(n);
enforce(m_packages.findOne(["name": info.info.name], ["_id": true]).isNull(), "A package with the same name is already registered.");
DbPackageVersion vi;
vi.date = BsonDate(info.date);
vi.version_ = info.version_;
vi.info = info.info;
DbPackage pack;
pack._id = BsonObjectID.generate();
pack.owner = user;
pack.name = info.info.name.get!string;
pack.repository = repository;
pack.branches["master"] = vi;
m_packages.insert(pack);
}
void removePackage(string packname, BsonObjectID user)
{
logInfo("Removing package %s of %s", packname, user);
m_packages.remove(["name": Bson(packname), "owner": Bson(user)]);
}
string[] getPackages(BsonObjectID user)
{
string[] ret;
foreach( p; m_packages.find(["owner": user], ["name": 1]) )
ret ~= p.name.get!string;
return ret;
}
Json getPackageInfo(string packname, bool include_errors = false)
{
auto bpack = m_packages.findOne(["name": packname]);
if( bpack.isNull() ) return Json(null);
auto pack = deserializeBson!DbPackage(bpack);
auto rep = getRepository(pack.repository);
Json[] vers;
foreach( string k, v; pack.branches ){
auto nfo = v.info;
nfo["version"] = "~"~k;
nfo.date = v.date.toSysTime().toISOExtString();
nfo.url = rep.getDownloadUrl("~"~k);
nfo.downloadUrl = nfo.url;
vers ~= nfo;
}
foreach( v; pack.versions ){
auto nfo = v.info;
nfo["version"] = v.version_;
nfo.date = v.date.toSysTime().toISOExtString();
nfo.url = rep.getDownloadUrl(v.version_);
nfo.downloadUrl = nfo.url;
vers ~= nfo;
}
Json ret = Json.EmptyObject;
ret.name = packname;
ret.versions = Json(vers);
ret.repository = pack.repository;
if( include_errors ) ret.errors = serializeToJson(pack.errors);
return ret;
}
void checkForNewVersions()
{
import std.encoding;
logInfo("Checking for new versions...");
foreach( packname; this.availablePackages ){
string[] errors;
Json pack;
try pack = getPackageInfo(packname);
catch( Exception e ){
errors ~= format("Error getting package info: %s", e.msg);
logDebug("%s", sanitize(e.toString()));
continue;
}
Repository rep;
try rep = getRepository(pack.repository);
catch( Exception e ){
errors ~= format("Error accessing repository: %s", e.msg);
logDebug("%s", sanitize(e.toString()));
continue;
}
try {
foreach( ver; rep.getVersions().sort!((a, b) => vcmp(a, b))() ){
if( !hasVersion(packname, ver) ){
try {
addVersion(packname, ver, rep.getVersionInfo(ver));
logInfo("Added version %s for %s", ver, packname);
} catch( Exception e ){
logDebug("version %s", sanitize(e.toString()));
errors ~= format("Version %s: %s", ver, e.msg);
// TODO: store error message for web frontend!
}
}
}
foreach( ver; rep.getBranches() ){
if( !hasVersion(packname, ver) ){
try {
addVersion(packname, ver, rep.getVersionInfo(ver));
logInfo("Added branch %s for %s", ver, packname);
} catch( Exception e ){
logDebug("%s", sanitize(e.toString()));
// TODO: store error message for web frontend!
errors ~= format("Branch %s: %s", ver, e.msg);
}
}
}
} catch( Exception e ){
logDebug("%s", sanitize(e.toString()));
// TODO: store error message for web frontend!
errors ~= e.msg;
}
setPackageErrors(packname, errors);
}
}
bool hasVersion(string packname, string ver)
{
auto packbson = Bson(packname);
auto verbson = serializeToBson(["$elemMatch": ["version": ver]]);
auto ret = m_packages.findOne(["name": packbson, "versions" : verbson], ["_id": true]);
return !ret.isNull();
}
protected void addVersion(string packname, string ver, PackageVersionInfo info)
{
enforce(info.info.name == packname, "Package name must match the original package name.");
foreach( string n, vspec; info.info.dependencies.opt!(Json[string]) )
checkPackageName(n);
DbPackageVersion dbver;
dbver.date = BsonDate(info.date);
dbver.version_ = info.version_;
dbver.info = info.info;
if( !ver.startsWith("~") ){
enforce(!hasVersion(packname, info.version_), "Version already exists.");
enforce(info.version_ == ver, "Version in package.json differs from git tag version.");
m_packages.update(["name": packname], ["$push": ["versions": dbver]]);
} else {
m_packages.update(["name": packname], ["$set": ["branches."~ver[1 .. $]: dbver]]);
}
}
protected void setPackageErrors(string pack, string[] error...)
{
m_packages.update(["name": pack], ["$set": ["errors": error]]);
}
}
private void checkPackageName(string n){
enforce(n.length > 0, "Package names may not be empty.");
foreach( ch; n ){
switch(ch){
default:
throw new Exception("Package names may only contain ASCII letters and numbers, as well as '_' and '-'.");
case 'a': .. case 'z':
case 'A': .. case 'Z':
case '0': .. case '9':
case '_', '-':
break;
}
}
}
private int[] linearizeVersion(string ver)
{
import std.conv;
static immutable prefixes = ["alpha", "beta", "rc"];
auto parts = ver.split(".");
int[] ret;
foreach( p; parts ){
ret ~= parse!int(p);
bool gotprefix = false;
foreach( i, prefix; prefixes ){
if( p.startsWith(prefix) ){
p = p[prefix.length .. $];
if( p.length ) ret ~= cast(int)i*10000 + to!int(p);
else ret ~= cast(int)i*10000;
gotprefix = true;
break;
}
}
if( !gotprefix ) ret ~= int.max;
}
return ret;
}
bool vcmp(DbPackageVersion a, DbPackageVersion b)
{
return vcmp(a.version_, b.version_);
}
bool vcmp(string va, string vb)
{
try {
auto aparts = linearizeVersion(va);
auto bparts = linearizeVersion(vb);
foreach( i; 0 .. min(aparts.length, bparts.length) )
if( aparts[i] != bparts[i] )
return aparts[i] < bparts[i];
return aparts.length < bparts.length;
} catch( Exception e ) return false;
}
| D |
/Users/trietnguyen/Documents/Blockchain Development/NEAR OCT/phucngo/near-nft-certificate/near-nft-cert/contract/target/release/build/generic-array-615ec46285b758ad/build_script_build-615ec46285b758ad: /Users/trietnguyen/.cargo/registry/src/github.com-1ecc6299db9ec823/generic-array-0.14.4/build.rs
/Users/trietnguyen/Documents/Blockchain Development/NEAR OCT/phucngo/near-nft-certificate/near-nft-cert/contract/target/release/build/generic-array-615ec46285b758ad/build_script_build-615ec46285b758ad.d: /Users/trietnguyen/.cargo/registry/src/github.com-1ecc6299db9ec823/generic-array-0.14.4/build.rs
/Users/trietnguyen/.cargo/registry/src/github.com-1ecc6299db9ec823/generic-array-0.14.4/build.rs:
| D |
/// Problem 24: 辞書式順列
///
/// 順列とはモノの順番付きの並びのことである。
/// たとえば、3124 は数 1、2、3、4 の一つの順列である。
/// すべての順列を数の大小でまたは辞書式に並べたものを辞書順と呼ぶ。
/// 0 と 1 と 2 の順列を辞書順に並べると 012 021 102 120 201 210 になる。
/// 0、1、2、3、4、5、6、7、8、9 からなる順列を辞書式に並べたときの 100 万番目はいくつか?
module project_euler.problem024;
import system.linq : elementAt, permutations;
dstring problem024(in dstring source, in size_t nth)
{
return permutations(source.dup).elementAt(nth - 1);
}
unittest
{
assert(problem024("012", 1) == "012");
assert(problem024("012", 2) == "021");
assert(problem024("012", 3) == "102");
assert(problem024("012", 4) == "120");
assert(problem024("012", 5) == "201");
assert(problem024("012", 6) == "210");
assert(problem024("0123456789", 100_0000) == "2783915460");
}
| D |
module common;
import xf.dog.Common;
import xf.omg.core.LinearAlgebra;
abstract class Plugin {
void init(GL gl);
void draw(GL gl);
void cleanup(GL gl);
}
| D |
the act or process of producing something
a presentation for the stage or screen or radio or television
an artifact that has been created by someone or some process
(law) the act of exhibiting in a court of law
the quantity of something (as a commodity) that is created (usually within a given period of time
a display that is exaggerated or unduly complicated
(economics) manufacturing or mining or growing something (usually in large quantities) for sale
the creation of value or wealth by producing goods and services
| D |
//dserialize.attributes,dserialize.ct_info,dserialize.exceptions,dserialize.formats.json,dserialize.mixins,dserialize.serialization_bundle,dserialize.serialization_format,dserialize.serialize
//Automatically generated by unit_threaded.gen_ut_main, do not edit by hand.
import unit_threaded;
int main(string[] args)
{
return args.runTests!(
"dserialize.attributes",
"dserialize.ct_info",
"dserialize.exceptions",
"dserialize.formats.json",
"dserialize.mixins",
"dserialize.serialization_bundle",
"dserialize.serialization_format",
"dserialize.serialize"
);
}
| D |
/Users/hare/Mobius/build/MobiusClient.build/Debug-iphonesimulator/MobiusClient.build/Objects-normal/x86_64/Balance.o : /Users/hare/Mobius/MobiusClient/Sources/Utils/md5.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/DataFeed.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusDataFeed.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Balance.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusBalance.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Use.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Token.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusToken.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusTransferInfo.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/URLQueryEncoder.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/HTTPParameter.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusError.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusAddress.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/Result.swift /Users/hare/Mobius/MobiusClient/Sources/MobiusAPIClient.swift /Users/hare/Mobius/MobiusClient/Sources/Models/APIRequest.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/hare/Mobius/MobiusClient/MobiusClient.h /Users/hare/Mobius/build/MobiusClient.build/Debug-iphonesimulator/MobiusClient.build/unextended-module.modulemap
/Users/hare/Mobius/build/MobiusClient.build/Debug-iphonesimulator/MobiusClient.build/Objects-normal/x86_64/Balance~partial.swiftmodule : /Users/hare/Mobius/MobiusClient/Sources/Utils/md5.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/DataFeed.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusDataFeed.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Balance.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusBalance.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Use.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Token.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusToken.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusTransferInfo.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/URLQueryEncoder.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/HTTPParameter.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusError.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusAddress.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/Result.swift /Users/hare/Mobius/MobiusClient/Sources/MobiusAPIClient.swift /Users/hare/Mobius/MobiusClient/Sources/Models/APIRequest.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/hare/Mobius/MobiusClient/MobiusClient.h /Users/hare/Mobius/build/MobiusClient.build/Debug-iphonesimulator/MobiusClient.build/unextended-module.modulemap
/Users/hare/Mobius/build/MobiusClient.build/Debug-iphonesimulator/MobiusClient.build/Objects-normal/x86_64/Balance~partial.swiftdoc : /Users/hare/Mobius/MobiusClient/Sources/Utils/md5.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/DataFeed.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusDataFeed.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Balance.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusBalance.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Use.swift /Users/hare/Mobius/MobiusClient/Sources/Requests/Token.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusToken.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusTransferInfo.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/URLQueryEncoder.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/HTTPParameter.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusError.swift /Users/hare/Mobius/MobiusClient/Sources/Models/MobiusAddress.swift /Users/hare/Mobius/MobiusClient/Sources/Utils/Result.swift /Users/hare/Mobius/MobiusClient/Sources/MobiusAPIClient.swift /Users/hare/Mobius/MobiusClient/Sources/Models/APIRequest.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/hare/Mobius/MobiusClient/MobiusClient.h /Users/hare/Mobius/build/MobiusClient.build/Debug-iphonesimulator/MobiusClient.build/unextended-module.modulemap
| D |
module net.masterthought.dtanks.bot.command;
import net.masterthought.dtanks.heading;
struct Command {
double speed;
Heading heading;
Heading radarHeading;
Heading turretHeading;
int firePower = 0;
public void fire(int power){
firePower = power;
}
}
| D |
module des.stdx.range;
public import std.range;
import std.conv;
import std.algorithm;
import des.stdx.traits;
import des.ts;
private version(unittest)
{
struct VecN(size_t N){ float[N] data; alias data this; }
alias Vec=VecN!3;
static assert( canUseAsArray!Vec );
}
/++ fill output range with result of fn() called per elements
+/
void mapFlat(alias fn,R,V,E...)( ref R output, V val, E tail )
if( is( typeof( output.put( fn( (ElementTypeRec!V).init ) ) ) ) )
{
static if( E.length > 0 )
{
mapFlat!fn( output, val );
mapFlat!fn( output, tail );
}
else
{
static if( isInputRange!V )
foreach( l; val ) mapFlat!fn( output, l );
else static if( canUseAsArray!V )
foreach( i; 0 .. val.length )
mapFlat!fn( output, val[i] );
else static if( is( ElementTypeRec!V == V ) )
output.put( fn( val ) );
else static assert( 0, "V has elements, " ~
"but isn't input range, or not have length" );
}
}
///
unittest
{
import std.array;
auto app = appender!(int[])();
mapFlat!(a=>to!int(a)*2)( app, [1,2], 3,
[[4,5],[6]],
iota(7,9),
[[[9],[10,11]],[[12]]],
Vec([13.3,666,105]) );
assertEq( app.data, [2,4,6,8,10,12,14,16,18,20,22,24,26,1332,210] );
}
///
template ElementTypeRec(T)
{
static if( is( ElementType!T == void ) ) // is not range or array
alias ElementTypeRec = T;
else // if is range or array
alias ElementTypeRec = ElementTypeRec!(ElementType!T);
}
///
unittest
{
static assert( is( ElementTypeRec!int == int ) );
static assert( is( ElementTypeRec!(int[]) == int ) );
static assert( is( ElementTypeRec!(int[2]) == int ) );
static assert( is( ElementTypeRec!(int[][]) == int ) );
static assert( is( ElementTypeRec!(int[3][2]) == int ) );
static assert( is( ElementTypeRec!(typeof(iota(7))) == int ) );
static assert( is( ElementTypeRec!(VecN!10) == float ) );
}
/++ fill output range with flat values
+/
void fillFlat(T,R,V,E...)( ref R output, V val, E tail )
if( isOutputRange!(R,T) )
{ mapFlat!(a=>to!T(a))( output, val, tail ); }
///
unittest
{
import std.array;
auto app = appender!(int[])();
fillFlat!int( app, [1,2], 3,
[[4,5],[6]],
iota(7,9),
[[[9],[10,11]],[[12]]],
Vec([13.3,666,105]) );
assertEq( app.data, [1,2,3,4,5,6,7,8,9,10,11,12,13,666,105] );
}
/++ get flat length of values
+/
size_t getFlatLength(V,E...)( V val, E tail ) @nogc
{
static if( E.length > 0 )
return getFlatLength( val ) + getFlatLength( tail );
else
{
static if( isInfinite!V )
static assert( 0, "not support infinite range" );
else static if( isForwardRange!V )
return val.save().map!(a=>getFlatLength(a)).sum;
else static if( canUseAsArray!V )
{
size_t s = 0;
foreach( i; 0 .. val.length )
s += getFlatLength( val[i] );
return s;
}
else static if( is( ElementType!V == void ) )
return 1;
else static assert( 0, "unsupported type" );
}
}
///
unittest
{
assertEq( getFlatLength( 1,2,3 ), 3 );
assertEq( getFlatLength( [1,2,3] ), 3 );
assertEq( getFlatLength( Vec([1,2,3]) ), 3 );
assertEq( getFlatLength( [1,2], 3, [[[4],[5,6]],[[7,8,9]]], Vec([1,2,3]) ), 12 );
assertEq( getFlatLength( 1, 2, iota(4) ), 6 );
assertEq( getFlatLength( 1, 2, iota(4) ), 6 );
}
/// return output range with reference to array
auto arrayOutputRange(A)( ref A arr )
if( isArray!A || isStaticArray!A )
{
alias T = ElementType!A;
static struct Result
{
T* end, cur;
this( T* start, T* end )
{
this.cur = start;
this.end = end;
}
void put( T val )
{
assert( cur != end );
*(cur++) = val;
}
}
return Result( arr.ptr, arr.ptr + arr.length );
}
///
unittest
{
int[13] arr1;
auto rng1 = arrayOutputRange( arr1 );
fillFlat!int( rng1, [1,2], 3, [[4,5],[6]], iota(7,9), [[[9],[10,11]],[[12]]] );
assertEq( arr1, [1,2,3,4,5,6,7,8,9,10,11,12,0] );
int[] arr2 = new int[]( 13 ) ;
auto rng2 = arrayOutputRange( arr2 );
fillFlat!int( rng2, [1,2], 3, [[4,5],[6]], iota(7,9), [[[9],[10,11]],[[12]]] );
assertEq( arr2, [1,2,3,4,5,6,7,8,9,10,11,12,0] );
}
/// create flat copy of vals
auto flatData(T,E...)( in E vals )
if( E.length > 0 )
{
auto ret = appender!(T[])();
fillFlat!T( ret, vals );
return ret.data;
}
///
unittest
{
assertEq( flatData!float([1.0,2],[[3,4]],5,[6,7]), [1,2,3,4,5,6,7] );
assertEq( flatData!double( VecN!3([1,2,3]) ), [1,2,3] );
assertEq( flatData!double( VecN!1([2]) ), [2] );
}
| D |
extern (C):
// Currently generated file will miss `import core.stdc.limits`
// https://github.com/jacob-carlborg/dstep/issues/123
enum TEST = INT_MAX;
| D |
a detachment assigned to protect the rear of a (retreating) military body
| D |
module hunt.framework.provider.DatabaseServiceProvider;
import hunt.framework.provider.ServiceProvider;
import hunt.framework.config.ApplicationConfig;
import hunt.logging.ConsoleLogger;
import hunt.entity;
import poodinis;
/**
*
*/
class DatabaseServiceProvider : ServiceProvider {
override void register() {
container.register!(EntityManagerFactory)(&buildEntityManagerFactory)
.singleInstance();
}
private EntityManagerFactory buildEntityManagerFactory() {
ApplicationConfig appConfig = container.resolve!ApplicationConfig();
ApplicationConfig.DatabaseConf config = appConfig.database;
if (config.enabled) {
import hunt.entity.EntityOption;
auto option = new EntityOption;
// database options
option.database.driver = config.driver;
option.database.host = config.host;
option.database.username = config.username;
option.database.password = config.password;
option.database.port = config.port;
option.database.database = config.database;
option.database.charset = config.charset;
option.database.prefix = config.prefix;
// database pool options
option.pool.minIdle = config.pool.minIdle;
option.pool.idleTimeout = config.pool.idleTimeout;
option.pool.maxPoolSize = config.pool.maxPoolSize;
option.pool.minPoolSize = config.pool.minPoolSize;
option.pool.maxLifetime = config.pool.maxLifetime;
option.pool.connectionTimeout = config.pool.connectionTimeout;
option.pool.maxConnection = config.pool.maxConnection;
option.pool.minConnection = config.pool.minConnection;
infof("using database: %s", config.driver);
return Persistence.createEntityManagerFactory(option);
} else {
warning("The database is disabled.");
return null;
}
}
override void boot() {
EntityManagerFactory factory = container.resolve!EntityManagerFactory();
}
} | D |
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1984-1998 by Symantec
* Copyright (C) 2000-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/backend/cod1.d, backend/cod1.d)
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/cod1.d
*/
module dmd.backend.cod1;
version (SCPP)
version = COMPILE;
version (MARS)
version = COMPILE;
version (COMPILE)
{
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import dmd.backend.backend;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.codebuilder;
import dmd.backend.mem;
import dmd.backend.el;
import dmd.backend.exh;
import dmd.backend.global;
import dmd.backend.obj;
import dmd.backend.oper;
import dmd.backend.rtlsym;
import dmd.backend.ty;
import dmd.backend.type;
import dmd.backend.xmm;
extern (C++):
nothrow:
int REGSIZE();
extern __gshared CGstate cgstate;
extern __gshared ubyte[FLMAX] segfl;
extern __gshared bool[FLMAX] stackfl;
private extern (D) uint mask(uint m) { return 1 << m; }
private void genorreg(ref CodeBuilder c, uint t, uint f) { genregs(c, 0x09, f, t); }
/* array to convert from index register to r/m field */
/* AX CX DX BX SP BP SI DI */
private __gshared const byte[8] regtorm32 = [ 0, 1, 2, 3,-1, 5, 6, 7 ];
__gshared const byte[8] regtorm = [ -1,-1,-1, 7,-1, 6, 4, 5 ];
targ_size_t paramsize(elem *e, tym_t tyf);
//void funccall(ref CodeBuilder cdb,elem *e,uint numpara,uint numalign,
// regm_t *pretregs,regm_t keepmsk, bool usefuncarg);
/*********************************
* Determine if we should leave parameter `s` in the register it
* came in, or allocate a register it using the register
* allocator.
* Params:
* s = parameter Symbol
* Returns:
* `true` if `s` is a register parameter and leave it in the register it came in
*/
bool regParamInPreg(Symbol* s)
{
//printf("regPAramInPreg %s\n", s.Sident.ptr);
return (s.Sclass == SCfastpar || s.Sclass == SCshadowreg) &&
(!(config.flags4 & CFG4optimized) || !(s.Sflags & GTregcand));
}
/**************************
* Determine if e is a 32 bit scaled index addressing mode.
* Returns:
* 0 not a scaled index addressing mode
* !=0 the value for ss in the SIB byte
*/
int isscaledindex(elem *e)
{
targ_uns ss;
assert(!I16);
while (e.Eoper == OPcomma)
e = e.EV.E2;
if (!(e.Eoper == OPshl && !e.Ecount &&
e.EV.E2.Eoper == OPconst &&
(ss = e.EV.E2.EV.Vuns) <= 3
)
)
ss = 0;
return ss;
}
/*********************************************
* Generate code for which isscaledindex(e) returned a non-zero result.
*/
/*private*/ void cdisscaledindex(ref CodeBuilder cdb,elem *e,regm_t *pidxregs,regm_t keepmsk)
{
// Load index register with result of e.EV.E1
while (e.Eoper == OPcomma)
{
regm_t r = 0;
scodelem(cdb, e.EV.E1, &r, keepmsk, true);
freenode(e);
e = e.EV.E2;
}
assert(e.Eoper == OPshl);
scodelem(cdb, e.EV.E1, pidxregs, keepmsk, true);
freenode(e.EV.E2);
freenode(e);
}
/***********************************
* Determine index if we can do two LEA instructions as a multiply.
* Returns:
* 0 can't do it
*/
enum
{
SSFLnobp = 1, /// can't have EBP in relconst
SSFLnobase1 = 2, /// no base register for first LEA
SSFLnobase = 4, /// no base register
SSFLlea = 8, /// can do it in one LEA
}
struct Ssindex
{
targ_uns product;
ubyte ss1;
ubyte ss2;
ubyte ssflags; /// SSFLxxxx
}
private __gshared const Ssindex[21] ssindex_array =
[
{ 0, 0, 0 }, // [0] is a place holder
{ 3, 1, 0, SSFLnobp | SSFLlea },
{ 5, 2, 0, SSFLnobp | SSFLlea },
{ 9, 3, 0, SSFLnobp | SSFLlea },
{ 6, 1, 1, SSFLnobase },
{ 12, 1, 2, SSFLnobase },
{ 24, 1, 3, SSFLnobase },
{ 10, 2, 1, SSFLnobase },
{ 20, 2, 2, SSFLnobase },
{ 40, 2, 3, SSFLnobase },
{ 18, 3, 1, SSFLnobase },
{ 36, 3, 2, SSFLnobase },
{ 72, 3, 3, SSFLnobase },
{ 15, 2, 1, SSFLnobp },
{ 25, 2, 2, SSFLnobp },
{ 27, 3, 1, SSFLnobp },
{ 45, 3, 2, SSFLnobp },
{ 81, 3, 3, SSFLnobp },
{ 16, 3, 1, SSFLnobase1 | SSFLnobase },
{ 32, 3, 2, SSFLnobase1 | SSFLnobase },
{ 64, 3, 3, SSFLnobase1 | SSFLnobase },
];
int ssindex(OPER op,targ_uns product)
{
if (op == OPshl)
product = 1 << product;
for (size_t i = 1; i < ssindex_array.length; i++)
{
if (ssindex_array[i].product == product)
return cast(int)i;
}
return 0;
}
/***************************************
* Build an EA of the form disp[base][index*scale].
* Input:
* c struct to fill in
* base base register (-1 if none)
* index index register (-1 if none)
* scale scale factor - 1,2,4,8
* disp displacement
*/
void buildEA(code *c,int base,int index,int scale,targ_size_t disp)
{
ubyte rm;
ubyte sib;
ubyte rex = 0;
sib = 0;
if (!I16)
{ uint ss;
assert(index != SP);
switch (scale)
{ case 1: ss = 0; break;
case 2: ss = 1; break;
case 4: ss = 2; break;
case 8: ss = 3; break;
default: assert(0);
}
if (base == -1)
{
if (index == -1)
rm = modregrm(0,0,5);
else
{
rm = modregrm(0,0,4);
sib = modregrm(ss,index & 7,5);
if (index & 8)
rex |= REX_X;
}
}
else if (index == -1)
{
if (base == SP)
{
rm = modregrm(2, 0, 4);
sib = modregrm(0, 4, SP);
}
else
{ rm = modregrm(2, 0, base & 7);
if (base & 8)
{ rex |= REX_B;
if (base == R12)
{
rm = modregrm(2, 0, 4);
sib = modregrm(0, 4, 4);
}
}
}
}
else
{
rm = modregrm(2, 0, 4);
sib = modregrm(ss,index & 7,base & 7);
if (index & 8)
rex |= REX_X;
if (base & 8)
rex |= REX_B;
}
}
else
{
// -1 AX CX DX BX SP BP SI DI
static immutable ubyte[9][9] EA16rm =
[
[ 0x06,0x09,0x09,0x09,0x87,0x09,0x86,0x84,0x85, ], // -1
[ 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, ], // AX
[ 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, ], // CX
[ 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, ], // DX
[ 0x87,0x09,0x09,0x09,0x09,0x09,0x09,0x80,0x81, ], // BX
[ 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, ], // SP
[ 0x86,0x09,0x09,0x09,0x09,0x09,0x09,0x82,0x83, ], // BP
[ 0x84,0x09,0x09,0x09,0x80,0x09,0x82,0x09,0x09, ], // SI
[ 0x85,0x09,0x09,0x09,0x81,0x09,0x83,0x09,0x09, ] // DI
];
assert(scale == 1);
rm = EA16rm[base + 1][index + 1];
assert(rm != 9);
}
c.Irm = rm;
c.Isib = sib;
c.Irex = rex;
c.IFL1 = FLconst;
c.IEV1.Vuns = cast(targ_uns)disp;
}
/*********************************************
* Build REX, modregrm and sib bytes
*/
uint buildModregrm(int mod, int reg, int rm)
{
uint m;
if (I16)
m = modregrm(mod, reg, rm);
else
{
if ((rm & 7) == SP && mod != 3)
m = (modregrm(0,4,SP) << 8) | modregrm(mod,reg & 7,4);
else
m = modregrm(mod,reg & 7,rm & 7);
if (reg & 8)
m |= REX_R << 16;
if (rm & 8)
m |= REX_B << 16;
}
return m;
}
/****************************************
* Generate code for eecontext
*/
void genEEcode()
{
CodeBuilder cdb;
cdb.ctor();
eecontext.EEin++;
regcon.immed.mval = 0;
regm_t retregs = 0; //regmask(eecontext.EEelem.Ety);
assert(EEStack.offset >= REGSIZE);
cod3_stackadj(cdb, cast(int)(EEStack.offset - REGSIZE));
cdb.gen1(0x50 + SI); // PUSH ESI
cdb.genadjesp(cast(int)EEStack.offset);
gencodelem(cdb, eecontext.EEelem, &retregs, false);
code *c = cdb.finish();
assignaddrc(c);
pinholeopt(c,null);
jmpaddr(c);
eecontext.EEcode = gen1(c, 0xCC); // INT 3
eecontext.EEin--;
}
/********************************************
* Gen a save/restore sequence for mask of registers.
* Params:
* regm = mask of registers to save
* cdbsave = save code appended here
* cdbrestore = restore code appended here
* Returns:
* amount of stack consumed
*/
uint gensaverestore(regm_t regm,ref CodeBuilder cdbsave,ref CodeBuilder cdbrestore)
{
//printf("gensaverestore2(%s)\n", regm_str(regm));
regm &= mBP | mES | ALLREGS | XMMREGS | mST0 | mST01;
if (!regm)
return 0;
uint stackused = 0;
code *[regm.sizeof * 8] restore;
reg_t i;
for (i = 0; regm; i++)
{
if (regm & 1)
{
code *cs2;
if (i == ES && I16)
{
stackused += REGSIZE;
cdbsave.gen1(0x06); // PUSH ES
cs2 = gen1(null, 0x07); // POP ES
}
else if (i == ST0 || i == ST01)
{
CodeBuilder cdb;
cdb.ctor();
gensaverestore87(1 << i, cdbsave, cdb);
cs2 = cdb.finish();
}
else if (i >= XMM0 || I64 || cgstate.funcarg.size)
{ uint idx;
regsave.save(cdbsave, i, &idx);
CodeBuilder cdb;
cdb.ctor();
regsave.restore(cdb, i, idx);
cs2 = cdb.finish();
}
else
{
stackused += REGSIZE;
cdbsave.gen1(0x50 + (i & 7)); // PUSH i
cs2 = gen1(null, 0x58 + (i & 7)); // POP i
if (i & 8)
{ code_orrex(cdbsave.last(), REX_B);
code_orrex(cs2, REX_B);
}
}
restore[i] = cs2;
}
else
restore[i] = null;
regm >>= 1;
}
while (i)
{
code *c = restore[--i];
if (c)
{
cdbrestore.append(c);
}
}
return stackused;
}
/****************************************
* Clean parameters off stack.
* Input:
* numpara amount to adjust stack pointer
* keepmsk mask of registers to not destroy
*/
void genstackclean(ref CodeBuilder cdb,uint numpara,regm_t keepmsk)
{
//dbg_printf("genstackclean(numpara = %d, stackclean = %d)\n",numpara,cgstate.stackclean);
if (numpara && (cgstate.stackclean || STACKALIGN >= 16))
{
/+
if (0 && // won't work if operand of scodelem
numpara == stackpush && // if this is all those pushed
needframe && // and there will be a BP
!config.windows &&
!(regcon.mvar & fregsaved) // and no registers will be pushed
)
genregs(cdb,0x89,BP,SP); // MOV SP,BP
else
+/
{
regm_t scratchm = 0;
if (numpara == REGSIZE && config.flags4 & CFG4space)
{
scratchm = ALLREGS & ~keepmsk & regcon.used & ~regcon.mvar;
}
if (scratchm)
{
reg_t r;
allocreg(cdb, &scratchm, &r, TYint);
cdb.gen1(0x58 + r); // POP r
}
else
cod3_stackadj(cdb, -numpara);
}
stackpush -= numpara;
cdb.genadjesp(-numpara);
}
}
/*********************************
* Generate code for a logical expression.
* Input:
* e elem
* jcond
* bit 1 if true then goto jump address if e
* if false then goto jump address if !e
* 2 don't call save87()
* fltarg FLcode or FLblock, flavor of target if e evaluates to jcond
* targ either code or block pointer to destination
*/
void logexp(ref CodeBuilder cdb, elem *e, int jcond, uint fltarg, code *targ)
{
//printf("logexp(e = %p, jcond = %d)\n", e, jcond);
int no87 = (jcond & 2) == 0;
docommas(cdb, &e); // scan down commas
cgstate.stackclean++;
code* c, ce;
if (!OTleaf(e.Eoper) && !e.Ecount) // if operator and not common sub
{
switch (e.Eoper)
{
case OPoror:
{
con_t regconsave;
if (jcond & 1)
{
logexp(cdb, e.EV.E1, jcond, fltarg, targ);
regconsave = regcon;
logexp(cdb, e.EV.E2, jcond, fltarg, targ);
}
else
{
code *cnop = gennop(null);
logexp(cdb, e.EV.E1, jcond | 1, FLcode, cnop);
regconsave = regcon;
logexp(cdb, e.EV.E2, jcond, fltarg, targ);
cdb.append(cnop);
}
andregcon(®consave);
freenode(e);
cgstate.stackclean--;
return;
}
case OPandand:
{
con_t regconsave;
if (jcond & 1)
{
code *cnop = gennop(null); // a dummy target address
logexp(cdb, e.EV.E1, jcond & ~1, FLcode, cnop);
regconsave = regcon;
logexp(cdb, e.EV.E2, jcond, fltarg, targ);
cdb.append(cnop);
}
else
{
logexp(cdb, e.EV.E1, jcond, fltarg, targ);
regconsave = regcon;
logexp(cdb, e.EV.E2, jcond, fltarg, targ);
}
andregcon(®consave);
freenode(e);
cgstate.stackclean--;
return;
}
case OPnot:
jcond ^= 1;
goto case OPbool;
case OPbool:
case OPs8_16:
case OPu8_16:
case OPs16_32:
case OPu16_32:
case OPs32_64:
case OPu32_64:
case OPu32_d:
case OPd_ld:
logexp(cdb, e.EV.E1, jcond, fltarg, targ);
freenode(e);
cgstate.stackclean--;
return;
case OPcond:
{
code *cnop2 = gennop(null); // addresses of start of leaves
code *cnop = gennop(null);
logexp(cdb, e.EV.E1, false, FLcode, cnop2); // eval condition
con_t regconold = regcon;
logexp(cdb, e.EV.E2.EV.E1, jcond, fltarg, targ);
genjmp(cdb, JMP, FLcode, cast(block *) cnop); // skip second leaf
con_t regconsave = regcon;
regcon = regconold;
cdb.append(cnop2);
logexp(cdb, e.EV.E2.EV.E2, jcond, fltarg, targ);
andregcon(®conold);
andregcon(®consave);
freenode(e.EV.E2);
freenode(e);
cdb.append(cnop);
cgstate.stackclean--;
return;
}
default:
break;
}
}
/* Special code for signed long compare.
* Not necessary for I64 until we do cents.
*/
if (OTrel2(e.Eoper) && // if < <= >= >
!e.Ecount &&
( (I16 && tybasic(e.EV.E1.Ety) == TYlong && tybasic(e.EV.E2.Ety) == TYlong) ||
(I32 && tybasic(e.EV.E1.Ety) == TYllong && tybasic(e.EV.E2.Ety) == TYllong))
)
{
longcmp(cdb, e, jcond != 0, fltarg, targ);
cgstate.stackclean--;
return;
}
regm_t retregs = mPSW; // return result in flags
opcode_t op = jmpopcode(e); // get jump opcode
if (!(jcond & 1))
op ^= 0x101; // toggle jump condition(s)
codelem(cdb, e, &retregs, true); // evaluate elem
if (no87)
cse_flush(cdb,no87); // flush CSE's to memory
genjmp(cdb, op, fltarg, cast(block *) targ); // generate jmp instruction
cgstate.stackclean--;
}
/******************************
* Routine to aid in setting things up for gen().
* Look for common subexpression.
* Can handle indirection operators, but not if they're common subs.
* Input:
* e -> elem where we get some of the data from
* cs -> partially filled code to add
* op = opcode
* reg = reg field of (mod reg r/m)
* offset = data to be added to Voffset field
* keepmsk = mask of registers we must not destroy
* desmsk = mask of registers destroyed by executing the instruction
* Returns:
* pointer to code generated
*/
void loadea(ref CodeBuilder cdb,elem *e,code *cs,uint op,uint reg,targ_size_t offset,
regm_t keepmsk,regm_t desmsk)
{
code* c, cg, cd;
debug
if (debugw)
printf("loadea: e=%p cs=%p op=x%x reg=%s offset=%lld keepmsk=%s desmsk=%s\n",
e, cs, op, regstring[reg], cast(ulong)offset, regm_str(keepmsk), regm_str(desmsk));
assert(e);
cs.Iflags = 0;
cs.Irex = 0;
cs.Iop = op;
tym_t tym = e.Ety;
int sz = tysize(tym);
/* Determine if location we want to get is in a register. If so, */
/* substitute the register for the EA. */
/* Note that operators don't go through this. CSE'd operators are */
/* picked up by comsub(). */
if (e.Ecount && /* if cse */
e.Ecount != e.Ecomsub && /* and cse was generated */
op != LEA && op != 0xC4 && /* and not an LEA or LES */
(op != 0xFF || reg != 3) && /* and not CALLF MEM16 */
(op & 0xFFF8) != 0xD8) // and not 8087 opcode
{
assert(OTleaf(e.Eoper)); /* can't handle this */
regm_t rm = regcon.cse.mval & ~regcon.cse.mops & ~regcon.mvar; // possible regs
if (op == 0xFF && reg == 6)
rm &= ~XMMREGS; // can't PUSH an XMM register
if (sz > REGSIZE) // value is in 2 or 4 registers
{
if (I16 && sz == 8) // value is in 4 registers
{
static immutable regm_t[4] rmask = [ mDX,mCX,mBX,mAX ];
rm &= rmask[cast(size_t)(offset >> 1)];
}
else if (offset)
rm &= mMSW; /* only high words */
else
rm &= mLSW; /* only low words */
}
for (uint i = 0; rm; i++)
{
if (mask(i) & rm)
{
if (regcon.cse.value[i] == e && // if register has elem
/* watch out for a CWD destroying DX */
!(i == DX && op == 0xF7 && desmsk & mDX))
{
/* if ES, then it can only be a load */
if (i == ES)
{
if (op != 0x8B)
break; // not a load
cs.Iop = 0x8C; /* MOV reg,ES */
cs.Irm = modregrm(3, 0, reg & 7);
if (reg & 8)
code_orrex(cs, REX_B);
}
else // XXX reg,i
{
cs.Irm = modregrm(3, reg & 7, i & 7);
if (reg & 8)
cs.Irex |= REX_R;
if (i & 8)
cs.Irex |= REX_B;
if (sz == 1 && I64 && (i >= 4 || reg >= 4))
cs.Irex |= REX;
if (I64 && (sz == 8 || sz == 16))
cs.Irex |= REX_W;
}
goto L2;
}
rm &= ~mask(i);
}
}
}
getlvalue(cdb, cs, e, keepmsk);
if (offset == REGSIZE)
getlvalue_msw(cs);
else
cs.IEV1.Voffset += offset;
if (I64)
{
if (reg >= 4 && sz == 1) // if byte register
// Can only address those 8 bit registers if a REX byte is present
cs.Irex |= REX;
if ((op & 0xFFFFFFF8) == 0xD8)
cs.Irex &= ~REX_W; // not needed for x87 ops
if (mask(reg) & XMMREGS &&
(op == LODSD || op == STOSD))
cs.Irex &= ~REX_W; // not needed for xmm ops
}
code_newreg(cs, reg); // OR in reg field
if (!I16)
{
if (reg == 6 && op == 0xFF || /* don't PUSH a word */
op == 0x0FB7 || op == 0x0FBF || /* MOVZX/MOVSX */
(op & 0xFFF8) == 0xD8 || /* 8087 instructions */
op == LEA) /* LEA */
{
cs.Iflags &= ~CFopsize;
if (reg == 6 && op == 0xFF) // if PUSH
cs.Irex &= ~REX_W; // REX is ignored for PUSH anyway
}
}
else if ((op & 0xFFF8) == 0xD8 && ADDFWAIT())
cs.Iflags |= CFwait;
L2:
getregs(cdb, desmsk); // save any regs we destroy
/* KLUDGE! fix up DX for divide instructions */
if (op == 0xF7 && desmsk == (mAX|mDX)) /* if we need to fix DX */
{
if (reg == 7) /* if IDIV */
{
cdb.gen1(0x99); // CWD
if (I64 && sz == 8)
code_orrex(cdb.last(), REX_W);
}
else if (reg == 6) // if DIV
genregs(cdb, 0x33, DX, DX); // XOR DX,DX
}
// Eliminate MOV reg,reg
if ((cs.Iop & ~3) == 0x88 &&
(cs.Irm & 0xC7) == modregrm(3,0,reg & 7))
{
uint r = cs.Irm & 7;
if (cs.Irex & REX_B)
r |= 8;
if (r == reg)
cs.Iop = NOP;
}
// Eliminate MOV xmmreg,xmmreg
if ((cs.Iop & ~(LODSD ^ STOSS)) == LODSD && // detect LODSD, LODSS, STOSD, STOSS
(cs.Irm & 0xC7) == modregrm(3,0,reg & 7))
{
reg_t r = cs.Irm & 7;
if (cs.Irex & REX_B)
r |= 8;
if (r == (reg - XMM0))
cs.Iop = NOP;
}
cdb.gen(cs);
}
/**************************
* Get addressing mode.
*/
uint getaddrmode(regm_t idxregs)
{
uint mode;
if (I16)
{
static ubyte error() { assert(0); }
mode = (idxregs & mBX) ? modregrm(2,0,7) : /* [BX] */
(idxregs & mDI) ? modregrm(2,0,5): /* [DI] */
(idxregs & mSI) ? modregrm(2,0,4): /* [SI] */
error();
}
else
{
const reg = findreg(idxregs & (ALLREGS | mBP));
if (reg == R12)
mode = (REX_B << 16) | (modregrm(0,4,4) << 8) | modregrm(2,0,4);
else
mode = modregrmx(2,0,reg);
}
return mode;
}
void setaddrmode(code *c, regm_t idxregs)
{
uint mode = getaddrmode(idxregs);
c.Irm = mode & 0xFF;
c.Isib = (mode >> 8) & 0xFF;
c.Irex &= ~REX_B;
c.Irex |= mode >> 16;
}
/**********************************************
*/
void getlvalue_msw(code *c)
{
if (c.IFL1 == FLreg)
{
const regmsw = c.IEV1.Vsym.Sregmsw;
c.Irm = (c.Irm & ~7) | (regmsw & 7);
if (regmsw & 8)
c.Irex |= REX_B;
else
c.Irex &= ~REX_B;
}
else
c.IEV1.Voffset += REGSIZE;
}
/**********************************************
*/
void getlvalue_lsw(code *c)
{
if (c.IFL1 == FLreg)
{
const reglsw = c.IEV1.Vsym.Sreglsw;
c.Irm = (c.Irm & ~7) | (reglsw & 7);
if (reglsw & 8)
c.Irex |= REX_B;
else
c.Irex &= ~REX_B;
}
else
c.IEV1.Voffset -= REGSIZE;
}
/******************
* Compute addressing mode.
* Generate & return sequence of code (if any).
* Return in cs the info on it.
* Input:
* pcs -> where to store data about addressing mode
* e -> the lvalue elem
* keepmsk mask of registers we must not destroy or use
* if (keepmsk & RMstore), this will be only a store operation
* into the lvalue
* if (keepmsk & RMload), this will be a read operation only
*/
void getlvalue(ref CodeBuilder cdb,code *pcs,elem *e,regm_t keepmsk)
{
uint fl, f, opsave;
elem* e1, e11, e12;
bool e1isadd, e1free;
reg_t reg;
tym_t e1ty;
Symbol* s;
//printf("getlvalue(e = %p, keepmsk = %s)\n", e, regm_str(keepmsk));
//elem_print(e);
assert(e);
elem_debug(e);
if (e.Eoper == OPvar || e.Eoper == OPrelconst)
{
s = e.EV.Vsym;
fl = s.Sfl;
if (tyfloating(s.ty()))
objmod.fltused();
}
else
fl = FLoper;
pcs.IFL1 = cast(ubyte)fl;
pcs.Iflags = CFoff; /* only want offsets */
pcs.Irex = 0;
pcs.IEV1.Voffset = 0;
tym_t ty = e.Ety;
uint sz = tysize(ty);
if (tyfloating(ty))
objmod.fltused();
if (I64 && (sz == 8 || sz == 16) && !tyvector(ty))
pcs.Irex |= REX_W;
if (!I16 && sz == SHORTSIZE)
pcs.Iflags |= CFopsize;
if (ty & mTYvolatile)
pcs.Iflags |= CFvolatile;
switch (fl)
{
case FLoper:
debug
if (debugw) printf("getlvalue(e = %p, keepmsk = %s)\n", e, regm_str(keepmsk));
switch (e.Eoper)
{
case OPadd: // this way when we want to do LEA
e1 = e;
e1free = false;
e1isadd = true;
break;
case OPind:
case OPpostinc: // when doing (*p++ = ...)
case OPpostdec: // when doing (*p-- = ...)
case OPbt:
case OPbtc:
case OPbtr:
case OPbts:
case OPvecfill:
e1 = e.EV.E1;
e1free = true;
e1isadd = e1.Eoper == OPadd;
break;
default:
printf("function: %s\n", funcsym_p.Sident.ptr);
elem_print(e);
assert(0);
}
e1ty = tybasic(e1.Ety);
if (e1isadd)
{
e12 = e1.EV.E2;
e11 = e1.EV.E1;
}
/* First see if we can replace *(e+&v) with
* MOV idxreg,e
* EA = [ES:] &v+idxreg
*/
f = FLconst;
/* Is address of `s` relative to RIP ?
*/
static bool relativeToRIP(Symbol* s)
{
if (!I64)
return false;
if (config.exe == EX_WIN64)
return true;
if (config.flags3 & CFG3pie)
{
if (s.Sfl == FLtlsdata || s.ty() & mTYthread)
{
if (s.Sclass == SCglobal || s.Sclass == SCstatic || s.Sclass == SClocstat)
return false;
}
return true;
}
else
return (config.flags3 & CFG3pic) != 0;
}
if (e1isadd &&
((e12.Eoper == OPrelconst &&
!relativeToRIP(e12.EV.Vsym) &&
(f = el_fl(e12)) != FLfardata
) ||
(e12.Eoper == OPconst && !I16 && !e1.Ecount && (!I64 || el_signx32(e12)))) &&
e1.Ecount == e1.Ecomsub &&
(!e1.Ecount || (~keepmsk & ALLREGS & mMSW) || (e1ty != TYfptr && e1ty != TYhptr)) &&
tysize(e11.Ety) == REGSIZE
)
{
uint t; /* component of r/m field */
int ss;
int ssi;
if (e12.Eoper == OPrelconst)
f = el_fl(e12);
/*assert(datafl[f]);*/ /* what if addr of func? */
if (!I16)
{ /* Any register can be an index register */
regm_t idxregs = allregs & ~keepmsk;
assert(idxregs);
/* See if e1.EV.E1 can be a scaled index */
ss = isscaledindex(e11);
if (ss)
{
/* Load index register with result of e11.EV.E1 */
cdisscaledindex(cdb, e11, &idxregs, keepmsk);
reg = findreg(idxregs);
{
t = stackfl[f] ? 2 : 0;
pcs.Irm = modregrm(t, 0, 4);
pcs.Isib = modregrm(ss, reg & 7, 5);
if (reg & 8)
pcs.Irex |= REX_X;
}
}
else if ((e11.Eoper == OPmul || e11.Eoper == OPshl) &&
!e11.Ecount &&
e11.EV.E2.Eoper == OPconst &&
(ssi = ssindex(e11.Eoper, e11.EV.E2.EV.Vuns)) != 0
)
{
regm_t scratchm;
char ssflags = ssindex_array[ssi].ssflags;
if (ssflags & SSFLnobp && stackfl[f])
goto L6;
// Load index register with result of e11.EV.E1
scodelem(cdb, e11.EV.E1, &idxregs, keepmsk, true);
reg = findreg(idxregs);
int ss1 = ssindex_array[ssi].ss1;
if (ssflags & SSFLlea)
{
assert(!stackfl[f]);
pcs.Irm = modregrm(2,0,4);
pcs.Isib = modregrm(ss1, reg & 7, reg & 7);
if (reg & 8)
pcs.Irex |= REX_X | REX_B;
}
else
{
int rbase;
reg_t r;
scratchm = ALLREGS & ~keepmsk;
allocreg(cdb, &scratchm, &r, TYint);
if (ssflags & SSFLnobase1)
{
t = 0;
rbase = 5;
}
else
{
t = 0;
rbase = reg;
if (rbase == BP || rbase == R13)
{
static immutable uint[4] imm32 = [1+1,2+1,4+1,8+1];
// IMUL r,BP,imm32
cdb.genc2(0x69, modregxrmx(3, r, rbase), imm32[ss1]);
goto L7;
}
}
cdb.gen2sib(LEA, modregxrm(t, r, 4), modregrm(ss1, reg & 7 ,rbase & 7));
if (reg & 8)
code_orrex(cdb.last(), REX_X);
if (rbase & 8)
code_orrex(cdb.last(), REX_B);
if (I64)
code_orrex(cdb.last(), REX_W);
if (ssflags & SSFLnobase1)
{
cdb.last().IFL1 = FLconst;
cdb.last().IEV1.Vuns = 0;
}
L7:
if (ssflags & SSFLnobase)
{
t = stackfl[f] ? 2 : 0;
rbase = 5;
}
else
{
t = 2;
rbase = r;
assert(rbase != BP);
}
pcs.Irm = modregrm(t, 0, 4);
pcs.Isib = modregrm(ssindex_array[ssi].ss2, r & 7, rbase & 7);
if (r & 8)
pcs.Irex |= REX_X;
if (rbase & 8)
pcs.Irex |= REX_B;
}
freenode(e11.EV.E2);
freenode(e11);
}
else
{
L6:
/* Load index register with result of e11 */
scodelem(cdb, e11, &idxregs, keepmsk, true);
setaddrmode(pcs, idxregs);
if (stackfl[f]) /* if we need [EBP] too */
{
uint idx = pcs.Irm & 7;
if (pcs.Irex & REX_B)
pcs.Irex = (pcs.Irex & ~REX_B) | REX_X;
pcs.Isib = modregrm(0, idx, BP);
pcs.Irm = modregrm(2, 0, 4);
}
}
}
else
{
regm_t idxregs = IDXREGS & ~keepmsk; /* only these can be index regs */
assert(idxregs);
if (stackfl[f]) /* if stack data type */
{
idxregs &= mSI | mDI; /* BX can't index off stack */
if (!idxregs) goto L1; /* index regs aren't avail */
t = 6; /* [BP+SI+disp] */
}
else
t = 0; /* [SI + disp] */
scodelem(cdb, e11, &idxregs, keepmsk, true); // load idx reg
pcs.Irm = cast(ubyte)(getaddrmode(idxregs) ^ t);
}
if (f == FLpara)
refparam = true;
else if (f == FLauto || f == FLbprel || f == FLfltreg || f == FLfast)
reflocal = true;
else if (f == FLcsdata || tybasic(e12.Ety) == TYcptr)
pcs.Iflags |= CFcs;
else
assert(f != FLreg);
pcs.IFL1 = cast(ubyte)f;
if (f != FLconst)
pcs.IEV1.Vsym = e12.EV.Vsym;
pcs.IEV1.Voffset = e12.EV.Voffset; /* += ??? */
/* If e1 is a CSE, we must generate an addressing mode */
/* but also leave EA in registers so others can use it */
if (e1.Ecount)
{
uint flagsave;
regm_t idxregs = IDXREGS & ~keepmsk;
allocreg(cdb, &idxregs, ®, TYoffset);
/* If desired result is a far pointer, we'll have */
/* to load another register with the segment of v */
if (e1ty == TYfptr)
{
reg_t msreg;
idxregs |= mMSW & ALLREGS & ~keepmsk;
allocreg(cdb, &idxregs, &msreg, TYfptr);
msreg = findregmsw(idxregs);
/* MOV msreg,segreg */
genregs(cdb, 0x8C, segfl[f], msreg);
}
opsave = pcs.Iop;
flagsave = pcs.Iflags;
ubyte rexsave = pcs.Irex;
pcs.Iop = LEA;
code_newreg(pcs, reg);
if (!I16)
pcs.Iflags &= ~CFopsize;
if (I64)
pcs.Irex |= REX_W;
cdb.gen(pcs); // LEA idxreg,EA
cssave(e1,idxregs,true);
if (!I16)
{
pcs.Iflags = flagsave;
pcs.Irex = rexsave;
}
if (stackfl[f] && (config.wflags & WFssneds)) // if pointer into stack
pcs.Iflags |= CFss; // add SS: override
pcs.Iop = opsave;
pcs.IFL1 = FLoffset;
pcs.IEV1.Vuns = 0;
setaddrmode(pcs, idxregs);
}
freenode(e12);
if (e1free)
freenode(e1);
goto Lptr;
}
L1:
/* The rest of the cases could be a far pointer */
regm_t idxregs;
idxregs = (I16 ? IDXREGS : allregs) & ~keepmsk; // only these can be index regs
assert(idxregs);
if (!I16 &&
(sz == REGSIZE || (I64 && sz == 4)) &&
keepmsk & RMstore)
idxregs |= regcon.mvar;
switch (e1ty)
{
case TYfptr: /* if far pointer */
case TYhptr:
idxregs = (mES | IDXREGS) & ~keepmsk; // need segment too
assert(idxregs & mES);
pcs.Iflags |= CFes; /* ES segment override */
break;
case TYsptr: /* if pointer to stack */
if (config.wflags & WFssneds) // if SS != DS
pcs.Iflags |= CFss; /* then need SS: override */
break;
case TYfgPtr:
if (I32)
pcs.Iflags |= CFgs;
else if (I64)
pcs.Iflags |= CFfs;
else
assert(0);
break;
case TYcptr: /* if pointer to code */
pcs.Iflags |= CFcs; /* then need CS: override */
break;
default:
break;
}
pcs.IFL1 = FLoffset;
pcs.IEV1.Vuns = 0;
/* see if we can replace *(e+c) with
* MOV idxreg,e
* [MOV ES,segment]
* EA = [ES:]c[idxreg]
*/
if (e1isadd && e12.Eoper == OPconst &&
(!I64 || el_signx32(e12)) &&
(tysize(e12.Ety) == REGSIZE || (I64 && tysize(e12.Ety) == 4)) &&
(!e1.Ecount || !e1free)
)
{
int ss;
pcs.IEV1.Vuns = e12.EV.Vuns;
freenode(e12);
if (e1free) freenode(e1);
if (!I16 && e11.Eoper == OPadd && !e11.Ecount &&
tysize(e11.Ety) == REGSIZE)
{
e12 = e11.EV.E2;
e11 = e11.EV.E1;
e1 = e1.EV.E1;
e1free = true;
goto L4;
}
if (!I16 && (ss = isscaledindex(e11)) != 0)
{ // (v * scale) + const
cdisscaledindex(cdb, e11, &idxregs, keepmsk);
reg = findreg(idxregs);
pcs.Irm = modregrm(0, 0, 4);
pcs.Isib = modregrm(ss, reg & 7, 5);
if (reg & 8)
pcs.Irex |= REX_X;
}
else
{
scodelem(cdb, e11, &idxregs, keepmsk, true); // load index reg
setaddrmode(pcs, idxregs);
}
goto Lptr;
}
/* Look for *(v1 + v2)
* EA = [v1][v2]
*/
if (!I16 && e1isadd && (!e1.Ecount || !e1free) &&
(_tysize[e1ty] == REGSIZE || (I64 && _tysize[e1ty] == 4)))
{
L4:
regm_t idxregs2;
uint base, index;
// Look for *(v1 + v2 << scale)
int ss = isscaledindex(e12);
if (ss)
{
scodelem(cdb, e11, &idxregs, keepmsk, true);
idxregs2 = allregs & ~(idxregs | keepmsk);
cdisscaledindex(cdb, e12, &idxregs2, keepmsk | idxregs);
}
// Look for *(v1 << scale + v2)
else if ((ss = isscaledindex(e11)) != 0)
{
idxregs2 = idxregs;
cdisscaledindex(cdb, e11, &idxregs2, keepmsk);
idxregs = allregs & ~(idxregs2 | keepmsk);
scodelem(cdb, e12, &idxregs, keepmsk | idxregs2, true);
}
// Look for *(((v1 << scale) + c1) + v2)
else if (e11.Eoper == OPadd && !e11.Ecount &&
e11.EV.E2.Eoper == OPconst &&
(ss = isscaledindex(e11.EV.E1)) != 0
)
{
pcs.IEV1.Vuns = e11.EV.E2.EV.Vuns;
idxregs2 = idxregs;
cdisscaledindex(cdb, e11.EV.E1, &idxregs2, keepmsk);
idxregs = allregs & ~(idxregs2 | keepmsk);
scodelem(cdb, e12, &idxregs, keepmsk | idxregs2, true);
freenode(e11.EV.E2);
freenode(e11);
}
else
{
scodelem(cdb, e11, &idxregs, keepmsk, true);
idxregs2 = allregs & ~(idxregs | keepmsk);
scodelem(cdb, e12, &idxregs2, keepmsk | idxregs, true);
}
base = findreg(idxregs);
index = findreg(idxregs2);
pcs.Irm = modregrm(2, 0, 4);
pcs.Isib = modregrm(ss, index & 7, base & 7);
if (index & 8)
pcs.Irex |= REX_X;
if (base & 8)
pcs.Irex |= REX_B;
if (e1free)
freenode(e1);
goto Lptr;
}
/* give up and replace *e1 with
* MOV idxreg,e
* EA = 0[idxreg]
* pinholeopt() will usually correct the 0, we need it in case
* we have a pointer to a long and need an offset to the second
* word.
*/
assert(e1free);
scodelem(cdb, e1, &idxregs, keepmsk, true); // load index register
setaddrmode(pcs, idxregs);
Lptr:
if (config.flags3 & CFG3ptrchk)
cod3_ptrchk(cdb, pcs, keepmsk); // validate pointer code
break;
case FLdatseg:
assert(0);
static if (0)
{
pcs.Irm = modregrm(0, 0, BPRM);
pcs.IEVpointer1 = e.EVpointer;
break;
}
case FLfltreg:
reflocal = true;
pcs.Irm = modregrm(2, 0, BPRM);
pcs.IEV1.Vint = 0;
break;
case FLreg:
goto L2;
case FLpara:
if (s.Sclass == SCshadowreg)
goto case FLfast;
Lpara:
refparam = true;
pcs.Irm = modregrm(2, 0, BPRM);
goto L2;
case FLauto:
case FLfast:
if (regParamInPreg(s))
{
regm_t pregm = s.Spregm();
/* See if the parameter is still hanging about in a register,
* and so can we load from that register instead.
*/
if (regcon.params & pregm /*&& s.Spreg2 == NOREG && !(pregm & XMMREGS)*/)
{
if (keepmsk & RMload && !anyiasm)
{
auto voffset = e.EV.Voffset;
if (sz <= REGSIZE)
{
const reg_t preg = (voffset >= REGSIZE) ? s.Spreg2 : s.Spreg;
if (voffset >= REGSIZE)
voffset -= REGSIZE;
/* preg could be NOREG if it's a variadic function and we're
* in Win64 shadow regs and we're offsetting to get to the start
* of the variadic args.
*/
if (preg != NOREG && regcon.params & mask(preg))
{
//printf("sz %d, preg %s, Voffset %d\n", cast(int)sz, regm_str(mask(preg)), cast(int)voffset);
if (mask(preg) & XMMREGS && sz != REGSIZE)
{
/* The following fails with this from std.math on Linux64:
void main()
{
alias T = float;
T x = T.infinity;
T e = T.infinity;
int eptr;
T v = frexp(x, eptr);
assert(isIdentical(e, v));
}
*/
}
else if (voffset == 0)
{
pcs.Irm = modregrm(3, 0, preg & 7);
if (preg & 8)
pcs.Irex |= REX_B;
if (I64 && sz == 1 && preg >= 4)
pcs.Irex |= REX;
regcon.used |= mask(preg);
break;
}
else if (voffset == 1 && sz == 1 && preg < 4)
{
pcs.Irm = modregrm(3, 0, 4 | preg); // use H register
regcon.used |= mask(preg);
break;
}
}
}
}
else
regcon.params &= ~pregm;
}
}
if (s.Sclass == SCshadowreg)
goto Lpara;
goto case FLbprel;
case FLbprel:
reflocal = true;
pcs.Irm = modregrm(2, 0, BPRM);
goto L2;
case FLextern:
if (s.Sident[0] == '_' && memcmp(s.Sident.ptr + 1,"tls_array".ptr,10) == 0)
{
static if (TARGET_LINUX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
{
assert(0);
}
else static if (TARGET_WINDOS)
{
if (I64)
{ // GS:[88]
pcs.Irm = modregrm(0, 0, 4);
pcs.Isib = modregrm(0, 4, 5); // don't use [RIP] addressing
pcs.IFL1 = FLconst;
pcs.IEV1.Vuns = 88;
pcs.Iflags = CFgs;
pcs.Irex |= REX_W;
break;
}
else
{
pcs.Iflags |= CFfs; // add FS: override
}
}
}
if (s.ty() & mTYcs && cast(bool) LARGECODE)
goto Lfardata;
goto L3;
case FLdata:
case FLudata:
case FLcsdata:
case FLgot:
case FLgotoff:
static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
{
case FLtlsdata:
}
L3:
pcs.Irm = modregrm(0, 0, BPRM);
L2:
if (fl == FLreg)
{
//printf("test: FLreg, %s %d regcon.mvar = %s\n",
// s.Sident.ptr, cast(int)e.EV.Voffset, regm_str(regcon.mvar));
if (!(s.Sregm & regcon.mvar))
symbol_print(s);
assert(s.Sregm & regcon.mvar);
/* Attempting to paint a float as an integer or an integer as a float
* will cause serious problems since the EA is loaded separatedly from
* the opcode. The only way to deal with this is to prevent enregistering
* such variables.
*/
if (tyxmmreg(ty) && !(s.Sregm & XMMREGS) ||
!tyxmmreg(ty) && (s.Sregm & XMMREGS))
cgreg_unregister(s.Sregm);
if (
s.Sclass == SCregpar ||
s.Sclass == SCparameter)
{ refparam = true;
reflocal = true; // kludge to set up prolog
}
pcs.Irm = modregrm(3, 0, s.Sreglsw & 7);
if (s.Sreglsw & 8)
pcs.Irex |= REX_B;
if (e.EV.Voffset == REGSIZE && sz == REGSIZE)
{
pcs.Irm = modregrm(3, 0, s.Sregmsw & 7);
if (s.Sregmsw & 8)
pcs.Irex |= REX_B;
else
pcs.Irex &= ~REX_B;
}
else if (e.EV.Voffset == 1 && sz == 1)
{
assert(s.Sregm & BYTEREGS);
assert(s.Sreglsw < 4);
pcs.Irm |= 4; // use 2nd byte of register
}
else
{
assert(!e.EV.Voffset);
if (I64 && sz == 1 && s.Sreglsw >= 4)
pcs.Irex |= REX;
}
}
else if (s.ty() & mTYcs && !(fl == FLextern && LARGECODE))
{
pcs.Iflags |= CFcs | CFoff;
}
if (config.flags3 & CFG3pic &&
(fl == FLtlsdata || s.ty() & mTYthread))
{
if (I32)
{
if (config.flags3 & CFG3pie)
{
pcs.Iflags |= CFgs;
}
}
else if (I64)
{
if (config.flags3 & CFG3pie &&
(s.Sclass == SCglobal || s.Sclass == SCstatic || s.Sclass == SClocstat))
{
pcs.Iflags |= CFfs;
pcs.Irm = modregrm(0, 0, 4);
pcs.Isib = modregrm(0, 4, 5); // don't use [RIP] addressing
}
else
{
pcs.Iflags |= CFopsize;
pcs.Irex = 0x48;
}
}
}
pcs.IEV1.Vsym = s;
pcs.IEV1.Voffset = e.EV.Voffset;
if (sz == 1)
{ /* Don't use SI or DI for this variable */
s.Sflags |= GTbyte;
if (I64 ? e.EV.Voffset > 0 : e.EV.Voffset > 1)
{
debug if (debugr) printf("'%s' not reg cand due to byte offset\n", s.Sident.ptr);
s.Sflags &= ~GTregcand;
}
}
else if (e.EV.Voffset || sz > tysize(s.Stype.Tty))
{
debug if (debugr) printf("'%s' not reg cand due to offset or size\n", s.Sident.ptr);
s.Sflags &= ~GTregcand;
}
if (config.fpxmmregs && tyfloating(s.ty()) && !tyfloating(ty))
{
debug if (debugr) printf("'%s' not reg cand due to mix float and int\n", s.Sident.ptr);
// Can't successfully mix XMM register variables accessed as integers
s.Sflags &= ~GTregcand;
}
if (!(keepmsk & RMstore)) // if not store only
s.Sflags |= SFLread; // assume we are doing a read
break;
case FLpseudo:
version (MARS)
{
{
getregs(cdb, mask(s.Sreglsw));
pcs.Irm = modregrm(3, 0, s.Sreglsw & 7);
if (s.Sreglsw & 8)
pcs.Irex |= REX_B;
if (e.EV.Voffset == 1 && sz == 1)
{ assert(s.Sregm & BYTEREGS);
assert(s.Sreglsw < 4);
pcs.Irm |= 4; // use 2nd byte of register
}
else
{ assert(!e.EV.Voffset);
if (I64 && sz == 1 && s.Sreglsw >= 4)
pcs.Irex |= REX;
}
break;
}
}
else
{
{
uint u = s.Sreglsw;
getregs(cdb, pseudomask[u]);
pcs.Irm = modregrm(3, 0, pseudoreg[u] & 7);
break;
}
}
case FLfardata:
case FLfunc: /* reading from code seg */
if (config.exe & EX_flat)
goto L3;
Lfardata:
{
regm_t regm = ALLREGS & ~keepmsk; // need scratch register
allocreg(cdb, ®m, ®, TYint);
getregs(cdb,mES);
// MOV mreg,seg of symbol
cdb.gencs(0xB8 + reg, 0, FLextern, s);
cdb.last().Iflags = CFseg;
cdb.gen2(0x8E, modregrmx(3, 0, reg)); // MOV ES,reg
pcs.Iflags |= CFes | CFoff; /* ES segment override */
goto L3;
}
case FLstack:
assert(!I16);
pcs.Irm = modregrm(2, 0, 4);
pcs.Isib = modregrm(0, 4, SP);
pcs.IEV1.Vsym = s;
pcs.IEV1.Voffset = e.EV.Voffset;
break;
default:
WRFL(cast(FL)fl);
symbol_print(s);
assert(0);
}
}
/*****************************
* Given an opcode and EA in cs, generate code
* for each floating register in turn.
* Input:
* tym either TYdouble or TYfloat
*/
void fltregs(ref CodeBuilder cdb, code* pcs, tym_t tym)
{
assert(!I64);
tym = tybasic(tym);
if (I32)
{
getregs(cdb,(tym == TYfloat) ? mAX : mAX | mDX);
if (tym != TYfloat)
{
pcs.IEV1.Voffset += REGSIZE;
NEWREG(pcs.Irm,DX);
cdb.gen(pcs);
pcs.IEV1.Voffset -= REGSIZE;
}
NEWREG(pcs.Irm,AX);
cdb.gen(pcs);
}
else
{
getregs(cdb,(tym == TYfloat) ? FLOATREGS_16 : DOUBLEREGS_16);
pcs.IEV1.Voffset += (tym == TYfloat) ? 2 : 6;
if (tym == TYfloat)
NEWREG(pcs.Irm, DX);
else
NEWREG(pcs.Irm, AX);
cdb.gen(pcs);
pcs.IEV1.Voffset -= 2;
if (tym == TYfloat)
NEWREG(pcs.Irm, AX);
else
NEWREG(pcs.Irm, BX);
cdb.gen(pcs);
if (tym != TYfloat)
{
pcs.IEV1.Voffset -= 2;
NEWREG(pcs.Irm, CX);
cdb.gen(pcs);
pcs.IEV1.Voffset -= 2; /* note that exit is with Voffset unaltered */
NEWREG(pcs.Irm, DX);
cdb.gen(pcs);
}
}
}
/*****************************
* Given a result in registers, test it for true or false.
* Will fail if TYfptr and the reg is ES!
* If saveflag is true, preserve the contents of the
* registers.
*/
void tstresult(ref CodeBuilder cdb, regm_t regm, tym_t tym, uint saveflag)
{
reg_t scrreg; // scratch register
regm_t scrregm;
//if (!(regm & (mBP | ALLREGS)))
//printf("tstresult(regm = %s, tym = x%x, saveflag = %d)\n",
//regm_str(regm),tym,saveflag);
assert(regm & (XMMREGS | mBP | ALLREGS));
tym = tybasic(tym);
reg_t reg = findreg(regm);
uint sz = _tysize[tym];
if (sz == 1)
{
assert(regm & BYTEREGS);
genregs(cdb, 0x84, reg, reg); // TEST regL,regL
if (I64 && reg >= 4)
code_orrex(cdb.last(), REX);
return;
}
if (regm & XMMREGS)
{
reg_t xreg;
regm_t xregs = XMMREGS & ~regm;
allocreg(cdb,&xregs, &xreg, TYdouble);
opcode_t op = 0;
if (tym == TYdouble || tym == TYidouble || tym == TYcdouble)
op = 0x660000;
cdb.gen2(op | 0x0F57, modregrm(3, xreg-XMM0, xreg-XMM0)); // XORPS xreg,xreg
cdb.gen2(op | 0x0F2E, modregrm(3, xreg-XMM0, reg-XMM0)); // UCOMISS xreg,reg
if (tym == TYcfloat || tym == TYcdouble)
{ code *cnop = gennop(null);
genjmp(cdb, JNE, FLcode, cast(block *) cnop); // JNE L1
genjmp(cdb, JP, FLcode, cast(block *) cnop); // JP L1
reg = findreg(regm & ~mask(reg));
cdb.gen2(op | 0x0F2E, modregrm(3, xreg-XMM0, reg-XMM0)); // UCOMISS xreg,reg
cdb.append(cnop);
}
return;
}
if (sz <= REGSIZE)
{
if (!I16)
{
if (tym == TYfloat)
{
if (saveflag)
{
scrregm = allregs & ~regm; // possible scratch regs
allocreg(cdb, &scrregm, &scrreg, TYoffset); // allocate scratch reg
genmovreg(cdb, scrreg, reg); // MOV scrreg,msreg
reg = scrreg;
}
getregs(cdb, mask(reg));
cdb.gen2(0xD1, modregrmx(3, 4, reg)); // SHL reg,1
return;
}
gentstreg(cdb,reg); // TEST reg,reg
if (sz == SHORTSIZE)
cdb.last().Iflags |= CFopsize; // 16 bit operands
else if (sz == 8)
code_orrex(cdb.last(), REX_W);
}
else
gentstreg(cdb, reg); // TEST reg,reg
return;
}
if (saveflag || tyfv(tym))
{
scrregm = ALLREGS & ~regm; // possible scratch regs
allocreg(cdb, &scrregm, &scrreg, TYoffset); // allocate scratch reg
if (I32 || sz == REGSIZE * 2)
{
assert(regm & mMSW && regm & mLSW);
reg = findregmsw(regm);
if (I32)
{
if (tyfv(tym))
genregs(cdb, 0x0FB7, scrreg, reg); // MOVZX scrreg,msreg
else
{
genmovreg(cdb, scrreg, reg); // MOV scrreg,msreg
if (tym == TYdouble || tym == TYdouble_alias)
cdb.gen2(0xD1, modregrm(3, 4, scrreg)); // SHL scrreg,1
}
}
else
{
genmovreg(cdb, scrreg, reg); // MOV scrreg,msreg
if (tym == TYfloat)
cdb.gen2(0xD1, modregrm(3, 4, scrreg)); // SHL scrreg,1
}
reg = findreglsw(regm);
genorreg(cdb, scrreg, reg); // OR scrreg,lsreg
}
else if (sz == 8)
{
// !I32
genmovreg(cdb, scrreg, AX); // MOV scrreg,AX
if (tym == TYdouble || tym == TYdouble_alias)
cdb.gen2(0xD1 ,modregrm(3, 4, scrreg)); // SHL scrreg,1
genorreg(cdb, scrreg, BX); // OR scrreg,BX
genorreg(cdb, scrreg, CX); // OR scrreg,CX
genorreg(cdb, scrreg, DX); // OR scrreg,DX
}
else
assert(0);
}
else
{
if (I32 || sz == REGSIZE * 2)
{
// can't test ES:LSW for 0
assert(regm & mMSW & ALLREGS && regm & (mLSW | mBP));
reg = findregmsw(regm);
getregs(cdb, mask(reg)); // we're going to trash reg
if (tyfloating(tym) && sz == 2 * _tysize[TYint])
cdb.gen2(0xD1, modregrm(3 ,4, reg)); // SHL reg,1
genorreg(cdb, reg, findreglsw(regm)); // OR reg,reg+1
if (I64)
code_orrex(cdb.last(), REX_W);
}
else if (sz == 8)
{ assert(regm == DOUBLEREGS_16);
getregs(cdb,mAX); // allocate AX
if (tym == TYdouble || tym == TYdouble_alias)
cdb.gen2(0xD1, modregrm(3, 4, AX)); // SHL AX,1
genorreg(cdb, AX, BX); // OR AX,BX
genorreg(cdb, AX, CX); // OR AX,CX
genorreg(cdb, AX, DX); // OR AX,DX
}
else
assert(0);
}
code_orflag(cdb.last(),CFpsw);
}
/******************************
* Given the result of an expression is in retregs,
* generate necessary code to return result in *pretregs.
*/
void fixresult(ref CodeBuilder cdb, elem *e, regm_t retregs, regm_t *pretregs)
{
//printf("fixresult(e = %p, retregs = %s, *pretregs = %s)\n",e,regm_str(retregs),regm_str(*pretregs));
if (*pretregs == 0) return; // if don't want result
assert(e && retregs); // need something to work with
regm_t forccs = *pretregs & mPSW;
regm_t forregs = *pretregs & (mST01 | mST0 | mBP | ALLREGS | mES | mSTACK | XMMREGS);
tym_t tym = tybasic(e.Ety);
if (tym == TYstruct)
{
if (e.Eoper == OPpair || e.Eoper == OPrpair)
{
if (I64)
tym = TYucent;
else
tym = TYullong;
}
else
// Hack to support cdstreq()
tym = (forregs & mMSW) ? TYfptr : TYnptr;
}
int sz = _tysize[tym];
if (sz == 1)
{
assert(retregs & BYTEREGS);
const reg = findreg(retregs);
if (e.Eoper == OPvar &&
e.EV.Voffset == 1 &&
e.EV.Vsym.Sfl == FLreg)
{
assert(reg < 4);
if (forccs)
cdb.gen2(0x84, modregrm(3, reg | 4, reg | 4)); // TEST regH,regH
forccs = 0;
}
}
reg_t reg,rreg;
if ((retregs & forregs) == retregs) // if already in right registers
*pretregs = retregs;
else if (forregs) // if return the result in registers
{
if (forregs & (mST01 | mST0))
{
fixresult87(cdb, e, retregs, pretregs);
return;
}
uint opsflag = false;
if (I16 && sz == 8)
{
if (forregs & mSTACK)
{
assert(retregs == DOUBLEREGS_16);
// Push floating regs
cdb.gen1(0x50 + AX);
cdb.gen1(0x50 + BX);
cdb.gen1(0x50 + CX);
cdb.gen1(0x50 + DX);
stackpush += DOUBLESIZE;
}
else if (retregs & mSTACK)
{
assert(forregs == DOUBLEREGS_16);
// Pop floating regs
getregs(cdb,forregs);
cdb.gen1(0x58 + DX);
cdb.gen1(0x58 + CX);
cdb.gen1(0x58 + BX);
cdb.gen1(0x58 + AX);
stackpush -= DOUBLESIZE;
retregs = DOUBLEREGS_16; // for tstresult() below
}
else
{
debug
printf("retregs = %s, forregs = %s\n", regm_str(retregs), regm_str(forregs)),
assert(0);
}
if (!OTleaf(e.Eoper))
opsflag = true;
}
else
{
allocreg(cdb, pretregs, &rreg, tym); // allocate return regs
if (retregs & XMMREGS)
{
reg = findreg(retregs & XMMREGS);
// MOVSD floatreg, XMM?
cdb.genxmmreg(xmmstore(tym), reg, 0, tym);
if (mask(rreg) & XMMREGS)
// MOVSD XMM?, floatreg
cdb.genxmmreg(xmmload(tym), rreg, 0, tym);
else
{
// MOV rreg,floatreg
cdb.genfltreg(0x8B,rreg,0);
if (sz == 8)
{
if (I32)
{
rreg = findregmsw(*pretregs);
cdb.genfltreg(0x8B, rreg,4);
}
else
code_orrex(cdb.last(),REX_W);
}
}
}
else if (forregs & XMMREGS)
{
reg = findreg(retregs & (mBP | ALLREGS));
switch (sz)
{
case 4:
cdb.gen2(LODD, modregxrmx(3, rreg - XMM0, reg)); // MOVD xmm,reg
break;
case 8:
if (I32)
{
cdb.genfltreg(0x89, reg, 0);
reg = findregmsw(retregs);
cdb.genfltreg(0x89, reg, 4);
cdb.genxmmreg(xmmload(tym), rreg, 0, tym); // MOVQ xmm,mem
}
else
{
cdb.gen2(LODD /* [sic!] */, modregxrmx(3, rreg - XMM0, reg));
code_orrex(cdb.last(), REX_W); // MOVQ xmm,reg
}
break;
default:
assert(false);
}
checkSetVex(cdb.last(), tym);
}
else if (sz > REGSIZE)
{
uint msreg = findregmsw(retregs);
uint lsreg = findreglsw(retregs);
uint msrreg = findregmsw(*pretregs);
uint lsrreg = findreglsw(*pretregs);
genmovreg(cdb, msrreg, msreg); // MOV msrreg,msreg
genmovreg(cdb, lsrreg, lsreg); // MOV lsrreg,lsreg
}
else
{
assert(!(retregs & XMMREGS));
assert(!(forregs & XMMREGS));
reg = findreg(retregs & (mBP | ALLREGS));
if (I64 && sz <= 4)
genregs(cdb, 0x89, reg, rreg); // only move 32 bits, and zero the top 32 bits
else
genmovreg(cdb, rreg, reg); // MOV rreg,reg
}
}
cssave(e,retregs | *pretregs,opsflag);
// Commented out due to Bugzilla 8840
//forregs = 0; // don't care about result in reg cuz real result is in rreg
retregs = *pretregs & ~mPSW;
}
if (forccs) // if return result in flags
{
if (retregs & (mST01 | mST0))
fixresult87(cdb, e, retregs, pretregs);
else
tstresult(cdb, retregs, tym, forregs);
}
}
/*******************************
* Extra information about each CLIB runtime library function.
*/
enum
{
INF32 = 1, /// if 32 bit only
INFfloat = 2, /// if this is floating point
INFwkdone = 4, /// if weak extern is already done
INF64 = 8, /// if 64 bit only
INFpushebx = 0x10, /// push EBX before load_localgot()
INFpusheabcdx = 0x20, /// pass EAX/EBX/ECX/EDX on stack, callee does ret 16
}
struct ClibInfo
{
regm_t retregs16; /* registers that 16 bit result is returned in */
regm_t retregs32; /* registers that 32 bit result is returned in */
ubyte pop; // # of bytes popped off of stack upon return
ubyte flags; /// INFxxx
byte push87; // # of pushes onto the 8087 stack
byte pop87; // # of pops off of the 8087 stack
}
__gshared int clib_inited = false; // true if initialized
Symbol* symboly(const(char)* name, regm_t desregs)
{
Symbol *s = symbol_calloc(name);
s.Stype = tsclib;
s.Sclass = SCextern;
s.Sfl = FLfunc;
s.Ssymnum = 0;
s.Sregsaved = ~desregs & (mBP | mES | ALLREGS);
return s;
}
void getClibInfo(uint clib, Symbol** ps, ClibInfo** pinfo)
{
__gshared Symbol*[CLIB.MAX] clibsyms;
__gshared ClibInfo[CLIB.MAX] clibinfo;
if (!clib_inited)
{
for (size_t i = 0; i < CLIB.MAX; ++i)
{
Symbol* s = clibsyms[i];
if (s)
{
s.Sxtrnnum = 0;
s.Stypidx = 0;
clibinfo[i].flags &= ~INFwkdone;
}
}
clib_inited = true;
}
const uint ex_unix = (EX_LINUX | EX_LINUX64 |
EX_OSX | EX_OSX64 |
EX_FREEBSD | EX_FREEBSD64 |
EX_OPENBSD | EX_OPENBSD64 |
EX_DRAGONFLYBSD64 |
EX_SOLARIS | EX_SOLARIS64);
ClibInfo* cinfo = &clibinfo[clib];
Symbol* s = clibsyms[clib];
if (!s)
{
switch (clib)
{
case CLIB.lcmp:
{
const(char)* name = (config.exe & ex_unix) ? "__LCMP__" : "_LCMP@";
s = symboly(name, 0);
}
break;
case CLIB.lmul:
{
const(char)* name = (config.exe & ex_unix) ? "__LMUL__" : "_LMUL@";
s = symboly(name, mAX|mCX|mDX);
cinfo.retregs16 = mDX|mAX;
cinfo.retregs32 = mDX|mAX;
}
break;
case CLIB.ldiv:
cinfo.retregs16 = mDX|mAX;
if (config.exe & (EX_LINUX | EX_FREEBSD))
{
s = symboly("__divdi3", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mDX|mAX;
}
else if (config.exe & (EX_OPENBSD | EX_SOLARIS))
{
s = symboly("__LDIV2__", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mDX|mAX;
}
else if (I32 && config.objfmt == OBJ_MSCOFF)
{
s = symboly("_alldiv", mAX|mBX|mCX|mDX);
cinfo.flags = INFpusheabcdx;
cinfo.retregs32 = mDX|mAX;
}
else
{
const(char)* name = (config.exe & ex_unix) ? "__LDIV__" : "_LDIV@";
s = symboly(name, (config.exe & ex_unix) ? mAX|mBX|mCX|mDX : ALLREGS);
cinfo.retregs32 = mDX|mAX;
}
break;
case CLIB.lmod:
cinfo.retregs16 = mCX|mBX;
if (config.exe & (EX_LINUX | EX_FREEBSD))
{
s = symboly("__moddi3", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mDX|mAX;
}
else if (config.exe & (EX_OPENBSD | EX_SOLARIS))
{
s = symboly("__LDIV2__", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mCX|mBX;
}
else if (I32 && config.objfmt == OBJ_MSCOFF)
{
s = symboly("_allrem", mAX|mBX|mCX|mDX);
cinfo.flags = INFpusheabcdx;
cinfo.retregs32 = mAX|mDX;
}
else
{
const(char)* name = (config.exe & ex_unix) ? "__LDIV__" : "_LDIV@";
s = symboly(name, (config.exe & ex_unix) ? mAX|mBX|mCX|mDX : ALLREGS);
cinfo.retregs32 = mCX|mBX;
}
break;
case CLIB.uldiv:
cinfo.retregs16 = mDX|mAX;
if (config.exe & (EX_LINUX | EX_FREEBSD))
{
s = symboly("__udivdi3", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mDX|mAX;
}
else if (config.exe & (EX_OPENBSD | EX_SOLARIS))
{
s = symboly("__ULDIV2__", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mDX|mAX;
}
else if (I32 && config.objfmt == OBJ_MSCOFF)
{
s = symboly("_aulldiv", mAX|mBX|mCX|mDX);
cinfo.flags = INFpusheabcdx;
cinfo.retregs32 = mDX|mAX;
}
else
{
const(char)* name = (config.exe & ex_unix) ? "__ULDIV__" : "_ULDIV@";
s = symboly(name, (config.exe & ex_unix) ? mAX|mBX|mCX|mDX : ALLREGS);
cinfo.retregs32 = mDX|mAX;
}
break;
case CLIB.ulmod:
cinfo.retregs16 = mCX|mBX;
if (config.exe & (EX_LINUX | EX_FREEBSD))
{
s = symboly("__umoddi3", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mDX|mAX;
}
else if (config.exe & (EX_OPENBSD | EX_SOLARIS))
{
s = symboly("__LDIV2__", mAX|mBX|mCX|mDX);
cinfo.flags = INFpushebx;
cinfo.retregs32 = mCX|mBX;
}
else if (I32 && config.objfmt == OBJ_MSCOFF)
{
s = symboly("_aullrem", mAX|mBX|mCX|mDX);
cinfo.flags = INFpusheabcdx;
cinfo.retregs32 = mAX|mDX;
}
else
{
const(char)* name = (config.exe & ex_unix) ? "__ULDIV__" : "_ULDIV@";
s = symboly(name, (config.exe & ex_unix) ? mAX|mBX|mCX|mDX : ALLREGS);
cinfo.retregs32 = mCX|mBX;
}
break;
// This section is only for Windows and DOS (i.e. machines without the x87 FPU)
case CLIB.dmul:
s = symboly("_DMUL@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.pop = 8;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.ddiv:
s = symboly("_DDIV@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.pop = 8;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.dtst0:
s = symboly("_DTST0@",0);
cinfo.flags = INFfloat;
break;
case CLIB.dtst0exc:
s = symboly("_DTST0EXC@",0);
cinfo.flags = INFfloat;
break;
case CLIB.dcmp:
s = symboly("_DCMP@",0);
cinfo.pop = 8;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.dcmpexc:
s = symboly("_DCMPEXC@",0);
cinfo.pop = 8;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.dneg:
s = symboly("_DNEG@",I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.flags = INFfloat;
break;
case CLIB.dadd:
s = symboly("_DADD@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.pop = 8;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.dsub:
s = symboly("_DSUB@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.pop = 8;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.fmul:
s = symboly("_FMUL@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = FLOATREGS_16;
cinfo.retregs32 = FLOATREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.fdiv:
s = symboly("_FDIV@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = FLOATREGS_16;
cinfo.retregs32 = FLOATREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.ftst0:
s = symboly("_FTST0@",0);
cinfo.flags = INFfloat;
break;
case CLIB.ftst0exc:
s = symboly("_FTST0EXC@",0);
cinfo.flags = INFfloat;
break;
case CLIB.fcmp:
s = symboly("_FCMP@",0);
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.fcmpexc:
s = symboly("_FCMPEXC@",0);
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.fneg:
s = symboly("_FNEG@",I16 ? FLOATREGS_16 : FLOATREGS_32);
cinfo.retregs16 = FLOATREGS_16;
cinfo.retregs32 = FLOATREGS_32;
cinfo.flags = INFfloat;
break;
case CLIB.fadd:
s = symboly("_FADD@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = FLOATREGS_16;
cinfo.retregs32 = FLOATREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.fsub:
s = symboly("_FSUB@",mAX|mBX|mCX|mDX);
cinfo.retregs16 = FLOATREGS_16;
cinfo.retregs32 = FLOATREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
case CLIB.dbllng:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLLNG" : "_DBLLNG@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = mDX | mAX;
cinfo.retregs32 = mAX;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.lngdbl:
{
const(char)* name = (config.exe & ex_unix) ? "__LNGDBL" : "_LNGDBL@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.dblint:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLINT" : "_DBLINT@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = mAX;
cinfo.retregs32 = mAX;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.intdbl:
{
const(char)* name = (config.exe & ex_unix) ? "__INTDBL" : "_INTDBL@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.dbluns:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLUNS" : "_DBLUNS@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = mAX;
cinfo.retregs32 = mAX;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.unsdbl:
// Y(DOUBLEREGS_32,"__UNSDBL"), // CLIB.unsdbl
// Y(DOUBLEREGS_16,"_UNSDBL@"),
// {DOUBLEREGS_16,DOUBLEREGS_32,0,INFfloat,1,1}, // _UNSDBL@ unsdbl
{
const(char)* name = (config.exe & ex_unix) ? "__UNSDBL" : "_UNSDBL@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.dblulng:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLULNG" : "_DBLULNG@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = mDX|mAX;
cinfo.retregs32 = mAX;
cinfo.flags = (config.exe & ex_unix) ? INFfloat | INF32 : INFfloat;
cinfo.push87 = (config.exe & ex_unix) ? 0 : 1;
cinfo.pop87 = 1;
break;
}
case CLIB.ulngdbl:
{
const(char)* name = (config.exe & ex_unix) ? "__ULNGDBL@" : "_ULNGDBL@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.dblflt:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLFLT" : "_DBLFLT@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = FLOATREGS_16;
cinfo.retregs32 = FLOATREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.fltdbl:
{
const(char)* name = (config.exe & ex_unix) ? "__FLTDBL" : "_FLTDBL@";
s = symboly(name, I16 ? ALLREGS : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.dblllng:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLLLNG" : "_DBLLLNG@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = mDX|mAX;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.llngdbl:
{
const(char)* name = (config.exe & ex_unix) ? "__LLNGDBL" : "_LLNGDBL@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = DOUBLEREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
case CLIB.dblullng:
{
if (config.exe == EX_WIN64)
{
s = symboly("__DBLULLNG", DOUBLEREGS_32);
cinfo.retregs32 = mAX;
cinfo.flags = INFfloat;
cinfo.push87 = 2;
cinfo.pop87 = 2;
}
else
{
const(char)* name = (config.exe & ex_unix) ? "__DBLULLNG" : "_DBLULLNG@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = I64 ? mAX : mDX|mAX;
cinfo.flags = INFfloat;
cinfo.push87 = (config.exe & ex_unix) ? 2 : 1;
cinfo.pop87 = (config.exe & ex_unix) ? 2 : 1;
}
break;
}
case CLIB.ullngdbl:
{
if (config.exe == EX_WIN64)
{
s = symboly("__ULLNGDBL", DOUBLEREGS_32);
cinfo.retregs32 = mAX;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
}
else
{
const(char)* name = (config.exe & ex_unix) ? "__ULLNGDBL" : "_ULLNGDBL@";
s = symboly(name, I16 ? DOUBLEREGS_16 : DOUBLEREGS_32);
cinfo.retregs16 = DOUBLEREGS_16;
cinfo.retregs32 = I64 ? mAX : DOUBLEREGS_32;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
}
break;
}
case CLIB.dtst:
{
const(char)* name = (config.exe & ex_unix) ? "__DTST" : "_DTST@";
s = symboly(name, 0);
cinfo.flags = INFfloat;
break;
}
case CLIB.vptrfptr:
{
const(char)* name = (config.exe & ex_unix) ? "__HTOFPTR" : "_HTOFPTR@";
s = symboly(name, mES|mBX);
cinfo.retregs16 = mES|mBX;
cinfo.retregs32 = mES|mBX;
break;
}
case CLIB.cvptrfptr:
{
const(char)* name = (config.exe & ex_unix) ? "__HCTOFPTR" : "_HCTOFPTR@";
s = symboly(name, mES|mBX);
cinfo.retregs16 = mES|mBX;
cinfo.retregs32 = mES|mBX;
break;
}
case CLIB._87topsw:
{
const(char)* name = (config.exe & ex_unix) ? "__87TOPSW" : "_87TOPSW@";
s = symboly(name, 0);
cinfo.flags = INFfloat;
break;
}
case CLIB.fltto87:
{
const(char)* name = (config.exe & ex_unix) ? "__FLTTO87" : "_FLTTO87@";
s = symboly(name, mST0);
cinfo.retregs16 = mST0;
cinfo.retregs32 = mST0;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
break;
}
case CLIB.dblto87:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLTO87" : "_DBLTO87@";
s = symboly(name, mST0);
cinfo.retregs16 = mST0;
cinfo.retregs32 = mST0;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
break;
}
case CLIB.dblint87:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLINT87" : "_DBLINT87@";
s = symboly(name, mST0|mAX);
cinfo.retregs16 = mAX;
cinfo.retregs32 = mAX;
cinfo.flags = INFfloat;
break;
}
case CLIB.dbllng87:
{
const(char)* name = (config.exe & ex_unix) ? "__DBLLNG87" : "_DBLLNG87@";
s = symboly(name, mST0|mAX|mDX);
cinfo.retregs16 = mDX|mAX;
cinfo.retregs32 = mAX;
cinfo.flags = INFfloat;
break;
}
case CLIB.ftst:
{
const(char)* name = (config.exe & ex_unix) ? "__FTST" : "_FTST@";
s = symboly(name, 0);
cinfo.flags = INFfloat;
break;
}
case CLIB.fcompp:
{
const(char)* name = (config.exe & ex_unix) ? "__FCOMPP" : "_FCOMPP@";
s = symboly(name, 0);
cinfo.retregs16 = mPSW;
cinfo.retregs32 = mPSW;
cinfo.flags = INFfloat;
cinfo.pop87 = 2;
break;
}
case CLIB.ftest:
{
const(char)* name = (config.exe & ex_unix) ? "__FTEST" : "_FTEST@";
s = symboly(name, 0);
cinfo.retregs16 = mPSW;
cinfo.retregs32 = mPSW;
cinfo.flags = INFfloat;
break;
}
case CLIB.ftest0:
{
const(char)* name = (config.exe & ex_unix) ? "__FTEST0" : "_FTEST0@";
s = symboly(name, 0);
cinfo.retregs16 = mPSW;
cinfo.retregs32 = mPSW;
cinfo.flags = INFfloat;
break;
}
case CLIB.fdiv87:
{
const(char)* name = (config.exe & ex_unix) ? "__FDIVP" : "_FDIVP";
s = symboly(name, mST0|mAX|mBX|mCX|mDX);
cinfo.retregs16 = mST0;
cinfo.retregs32 = mST0;
cinfo.flags = INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 1;
break;
}
// Complex numbers
case CLIB.cmul:
{
s = symboly("_Cmul", mST0|mST01);
cinfo.retregs16 = mST01;
cinfo.retregs32 = mST01;
cinfo.flags = INF32|INFfloat;
cinfo.push87 = 3;
cinfo.pop87 = 5;
break;
}
case CLIB.cdiv:
{
s = symboly("_Cdiv", mAX|mCX|mDX|mST0|mST01);
cinfo.retregs16 = mST01;
cinfo.retregs32 = mST01;
cinfo.flags = INF32|INFfloat;
cinfo.push87 = 0;
cinfo.pop87 = 2;
break;
}
case CLIB.ccmp:
{
s = symboly("_Ccmp", mAX|mST0|mST01);
cinfo.retregs16 = mPSW;
cinfo.retregs32 = mPSW;
cinfo.flags = INF32|INFfloat;
cinfo.push87 = 0;
cinfo.pop87 = 4;
break;
}
case CLIB.u64_ldbl:
{
const(char)* name = (config.exe & ex_unix) ? "__U64_LDBL" : "_U64_LDBL";
s = symboly(name, mST0);
cinfo.retregs16 = mST0;
cinfo.retregs32 = mST0;
cinfo.flags = INF32|INF64|INFfloat;
cinfo.push87 = 2;
cinfo.pop87 = 1;
break;
}
case CLIB.ld_u64:
{
const(char)* name = (config.exe & ex_unix) ? (config.objfmt == OBJ_ELF ||
config.objfmt == OBJ_MACH ?
"__LDBLULLNG" : "___LDBLULLNG")
: "__LDBLULLNG";
s = symboly(name, mST0|mAX|mDX);
cinfo.retregs16 = 0;
cinfo.retregs32 = mDX|mAX;
cinfo.flags = INF32|INF64|INFfloat;
cinfo.push87 = 1;
cinfo.pop87 = 2;
break;
}
default:
assert(0);
}
clibsyms[clib] = s;
}
*ps = s;
*pinfo = cinfo;
}
/********************************
* Generate code sequence to call C runtime library support routine.
* clib = CLIB.xxxx
* keepmask = mask of registers not to destroy. Currently can
* handle only 1. Should use a temporary rather than
* push/pop for speed.
*/
void callclib(ref CodeBuilder cdb, elem* e, uint clib, regm_t* pretregs, regm_t keepmask)
{
//printf("callclib(e = %p, clib = %d, *pretregs = %s, keepmask = %s\n", e, clib, regm_str(*pretregs), regm_str(keepmask));
//elem_print(e);
Symbol* s;
ClibInfo* cinfo;
getClibInfo(clib, &s, &cinfo);
if (I16)
assert(!(cinfo.flags & (INF32 | INF64)));
getregs(cdb,(~s.Sregsaved & (mES | mBP | ALLREGS)) & ~keepmask); // mask of regs destroyed
keepmask &= ~s.Sregsaved;
int npushed = numbitsset(keepmask);
CodeBuilder cdbpop;
cdbpop.ctor();
gensaverestore(keepmask, cdb, cdbpop);
save87regs(cdb,cinfo.push87);
for (int i = 0; i < cinfo.push87; i++)
push87(cdb);
for (int i = 0; i < cinfo.pop87; i++)
pop87();
if (config.target_cpu >= TARGET_80386 && clib == CLIB.lmul && !I32)
{
static immutable ubyte[23] lmul =
[
0x66,0xc1,0xe1,0x10, // shl ECX,16
0x8b,0xcb, // mov CX,BX ;ECX = CX,BX
0x66,0xc1,0xe0,0x10, // shl EAX,16
0x66,0x0f,0xac,0xd0,0x10, // shrd EAX,EDX,16 ;EAX = DX,AX
0x66,0xf7,0xe1, // mul ECX
0x66,0x0f,0xa4,0xc2,0x10, // shld EDX,EAX,16 ;DX,AX = EAX
];
cdb.genasm(cast(char*)lmul.ptr, lmul.sizeof);
}
else
{
makeitextern(s);
int nalign = 0;
int pushebx = (cinfo.flags & INFpushebx) != 0;
int pushall = (cinfo.flags & INFpusheabcdx) != 0;
if (STACKALIGN >= 16)
{ // Align the stack (assume no args on stack)
int npush = (npushed + pushebx + 4 * pushall) * REGSIZE + stackpush;
if (npush & (STACKALIGN - 1))
{ nalign = STACKALIGN - (npush & (STACKALIGN - 1));
cod3_stackadj(cdb, nalign);
}
}
if (pushebx)
{
if (config.exe & (EX_LINUX | EX_LINUX64 | EX_FREEBSD | EX_FREEBSD64 | EX_DRAGONFLYBSD64))
{
cdb.gen1(0x50 + CX); // PUSH ECX
cdb.gen1(0x50 + BX); // PUSH EBX
cdb.gen1(0x50 + DX); // PUSH EDX
cdb.gen1(0x50 + AX); // PUSH EAX
nalign += 4 * REGSIZE;
}
else
{
cdb.gen1(0x50 + BX); // PUSH EBX
nalign += REGSIZE;
}
}
if (pushall)
{
cdb.gen1(0x50 + CX); // PUSH ECX
cdb.gen1(0x50 + BX); // PUSH EBX
cdb.gen1(0x50 + DX); // PUSH EDX
cdb.gen1(0x50 + AX); // PUSH EAX
}
if (config.exe & (EX_LINUX | EX_FREEBSD | EX_OPENBSD | EX_SOLARIS))
{
// Note: not for OSX
/* Pass EBX on the stack instead, this is because EBX is used
* for shared library function calls
*/
if (config.flags3 & CFG3pic)
{
load_localgot(cdb); // EBX gets set to this value
}
}
cdb.gencs(LARGECODE ? 0x9A : 0xE8,0,FLfunc,s); // CALL s
if (nalign)
cod3_stackadj(cdb, -nalign);
calledafunc = 1;
version (SCPP)
{
if (I16 && // bug in Optlink for weak references
config.flags3 & CFG3wkfloat &&
(cinfo.flags & (INFfloat | INFwkdone)) == INFfloat)
{
cinfo.flags |= INFwkdone;
makeitextern(getRtlsym(RTLSYM_INTONLY));
objmod.wkext(s, getRtlsym(RTLSYM_INTONLY));
}
}
}
if (I16)
stackpush -= cinfo.pop;
regm_t retregs = I16 ? cinfo.retregs16 : cinfo.retregs32;
cdb.append(cdbpop);
fixresult(cdb, e, retregs, pretregs);
}
/*************************************************
* Helper function for converting OPparam's into array of Parameters.
*/
struct Parameter { elem* e; reg_t reg; reg_t reg2; uint numalign; }
//void fillParameters(elem* e, Parameter* parameters, int* pi);
void fillParameters(elem* e, Parameter* parameters, int* pi)
{
if (e.Eoper == OPparam)
{
fillParameters(e.EV.E1, parameters, pi);
fillParameters(e.EV.E2, parameters, pi);
freenode(e);
}
else
{
parameters[*pi].e = e;
(*pi)++;
}
}
/***********************************
* tyf: type of the function
*/
FuncParamRegs FuncParamRegs_create(tym_t tyf)
{
FuncParamRegs result;
result.tyf = tyf;
if (I16)
{
result.numintegerregs = 0;
result.numfloatregs = 0;
}
else if (I32)
{
if (tyf == TYjfunc)
{
static immutable ubyte[1] reglist1 = [ AX ];
result.argregs = ®list1[0];
result.numintegerregs = reglist1.length;
}
else if (tyf == TYmfunc)
{
static immutable ubyte[1] reglist2 = [ CX ];
result.argregs = ®list2[0];
result.numintegerregs = reglist2.length;
}
else
result.numintegerregs = 0;
result.numfloatregs = 0;
}
else if (I64 && config.exe == EX_WIN64)
{
static immutable ubyte[4] reglist3 = [ CX,DX,R8,R9 ];
result.argregs = ®list3[0];
result.numintegerregs = reglist3.length;
static immutable ubyte[4] freglist3 = [ XMM0, XMM1, XMM2, XMM3 ];
result.floatregs = &freglist3[0];
result.numfloatregs = freglist3.length;
}
else if (I64)
{
static immutable ubyte[6] reglist4 = [ DI,SI,DX,CX,R8,R9 ];
result.argregs = ®list4[0];
result.numintegerregs = reglist4.length;
static immutable ubyte[8] freglist4 = [ XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7 ];
result.floatregs = &freglist4[0];
result.numfloatregs = freglist4.length;
}
else
assert(0);
return result;
}
/*****************************************
* Allocate parameter of type t and ty to registers *preg1 and *preg2.
* Params:
* t = type, valid only if ty is TYstruct or TYarray
* Returns:
* false not allocated to any register
* true *preg1, *preg2 set to allocated register pair
*/
//bool type_jparam2(type* t, tym_t ty);
private bool type_jparam2(type* t, tym_t ty)
{
ty = tybasic(ty);
if (tyfloating(ty))
return false;
else if (ty == TYstruct || ty == TYarray)
{
type_debug(t);
targ_size_t sz = type_size(t);
return (sz <= _tysize[TYnptr]) &&
(config.exe == EX_WIN64 || sz == 1 || sz == 2 || sz == 4 || sz == 8);
}
else if (tysize(ty) <= _tysize[TYnptr])
return true;
return false;
}
int FuncParamRegs_alloc(ref FuncParamRegs fpr, type* t, tym_t ty, reg_t* preg1, reg_t* preg2)
{
//printf("FuncParamRegs::alloc(ty: TY%sm t: %p)\n", tystring[tybasic(ty)], t);
//if (t) type_print(t);
*preg1 = NOREG;
*preg2 = NOREG;
type* t2 = null;
tym_t ty2 = TYMAX;
tym_t tyb = tybasic(ty);
// Treat array of 1 the same as its element type
// (Don't put volatile parameters in registers)
if (tyb == TYarray && tybasic(t.Tty) == TYarray && t.Tdim == 1 && !(t.Tty & mTYvolatile))
{
t = t.Tnext;
tyb = tybasic(t.Tty);
}
if (tyb == TYstruct && type_zeroSize(t, fpr.tyf))
return 0; // don't allocate into registers
++fpr.i;
// If struct just wraps another type
if (tyb == TYstruct && tybasic(t.Tty) == TYstruct)
{
if (config.exe == EX_WIN64)
{
/* Structs occupy a general purpose register, regardless of the struct
* size or the number & types of its fields.
*/
t = null;
ty = TYnptr;
}
else
{
type* targ1 = t.Ttag.Sstruct.Sarg1type;
type* targ2 = t.Ttag.Sstruct.Sarg2type;
if (targ1)
{
t = targ1;
ty = t.Tty;
if (targ2)
{
t2 = targ2;
ty2 = t2.Tty;
}
}
else if (I64 && !targ2)
return 0;
}
}
reg_t* preg = preg1;
int regcntsave = fpr.regcnt;
int xmmcntsave = fpr.xmmcnt;
if (config.exe == EX_WIN64)
{
if (tybasic(ty) == TYcfloat)
{
ty = TYnptr; // treat like a struct
}
}
else if (I64)
{
if ((tybasic(ty) == TYcent || tybasic(ty) == TYucent) &&
fpr.numintegerregs - fpr.regcnt >= 2)
{
// Allocate to register pair
*preg1 = fpr.argregs[fpr.regcnt];
*preg2 = fpr.argregs[fpr.regcnt + 1];
fpr.regcnt += 2;
return 1;
}
if (tybasic(ty) == TYcdouble &&
fpr.numfloatregs - fpr.xmmcnt >= 2)
{
// Allocate to register pair
*preg1 = fpr.floatregs[fpr.xmmcnt];
*preg2 = fpr.floatregs[fpr.xmmcnt + 1];
fpr.xmmcnt += 2;
return 1;
}
}
for (int j = 0; j < 2; j++)
{
if (fpr.regcnt < fpr.numintegerregs)
{
if ((I64 || (fpr.i == 1 && (fpr.tyf == TYjfunc || fpr.tyf == TYmfunc))) &&
type_jparam2(t, ty))
{
*preg = fpr.argregs[fpr.regcnt];
++fpr.regcnt;
if (config.exe == EX_WIN64)
++fpr.xmmcnt;
goto Lnext;
}
}
if (fpr.xmmcnt < fpr.numfloatregs)
{
if (tyxmmreg(ty))
{
*preg = fpr.floatregs[fpr.xmmcnt];
if (config.exe == EX_WIN64)
++fpr.regcnt;
++fpr.xmmcnt;
goto Lnext;
}
}
// Failed to allocate to a register
if (j == 1)
{ /* Unwind first preg1 assignment, because it's both or nothing
*/
*preg1 = NOREG;
fpr.regcnt = regcntsave;
fpr.xmmcnt = xmmcntsave;
}
return 0;
Lnext:
if (!t2)
break;
preg = preg2;
t = t2;
ty = ty2;
}
return 1;
}
/*******************************
* Generate code sequence for function call.
*/
void cdfunc(ref CodeBuilder cdb, elem* e, regm_t* pretregs)
{
//printf("cdfunc()\n"); elem_print(e);
assert(e);
uint numpara = 0; // bytes of parameters
uint numalign = 0; // bytes to align stack before pushing parameters
uint stackpushsave = stackpush; // so we can compute # of parameters
cgstate.stackclean++;
regm_t keepmsk = 0;
int xmmcnt = 0;
tym_t tyf = tybasic(e.EV.E1.Ety); // the function type
// Easier to deal with parameters as an array: parameters[0..np]
int np = OTbinary(e.Eoper) ? el_nparams(e.EV.E2) : 0;
Parameter *parameters = cast(Parameter *)alloca(np * Parameter.sizeof);
if (np)
{
int n = 0;
fillParameters(e.EV.E2, parameters, &n);
assert(n == np);
}
Symbol *sf = null; // symbol of the function being called
if (e.EV.E1.Eoper == OPvar)
sf = e.EV.E1.EV.Vsym;
/* Assume called function access statics
*/
if (config.exe & (EX_LINUX | EX_LINUX64 | EX_OSX | EX_FREEBSD | EX_FREEBSD64) &&
config.flags3 & CFG3pic)
cgstate.accessedTLS = true;
/* Special handling for call to __tls_get_addr, we must save registers
* before evaluating the parameter, so that the parameter load and call
* are adjacent.
*/
if (np == 1 && sf)
{
if (sf == tls_get_addr_sym)
getregs(cdb, ~sf.Sregsaved & (mBP | ALLREGS | mES | XMMREGS));
}
uint stackalign = REGSIZE;
if (tyf == TYf16func)
stackalign = 2;
// Figure out which parameters go in registers.
// Compute numpara, the total bytes pushed on the stack
FuncParamRegs fpr = FuncParamRegs_create(tyf);
for (int i = np; --i >= 0;)
{
elem *ep = parameters[i].e;
uint psize = cast(uint)_align(stackalign, paramsize(ep, tyf)); // align on stack boundary
if (config.exe == EX_WIN64)
{
//printf("[%d] size = %u, numpara = %d ep = %p ", i, psize, numpara, ep); WRTYxx(ep.Ety); printf("\n");
debug
if (psize > REGSIZE) elem_print(e);
assert(psize <= REGSIZE);
psize = REGSIZE;
}
//printf("[%d] size = %u, numpara = %d ", i, psize, numpara); WRTYxx(ep.Ety); printf("\n");
if (FuncParamRegs_alloc(fpr, ep.ET, ep.Ety, ¶meters[i].reg, ¶meters[i].reg2))
{
if (config.exe == EX_WIN64)
numpara += REGSIZE; // allocate stack space for it anyway
continue; // goes in register, not stack
}
// Parameter i goes on the stack
parameters[i].reg = NOREG;
uint alignsize = el_alignsize(ep);
parameters[i].numalign = 0;
if (alignsize > stackalign &&
(I64 || (alignsize >= 16 &&
(config.exe & (EX_OSX | EX_LINUX) && (tyaggregate(ep.Ety) || tyvector(ep.Ety))))))
{
if (alignsize > STACKALIGN)
{
STACKALIGN = alignsize;
enforcealign = true;
}
uint newnumpara = (numpara + (alignsize - 1)) & ~(alignsize - 1);
parameters[i].numalign = newnumpara - numpara;
numpara = newnumpara;
assert(config.exe != EX_WIN64);
}
numpara += psize;
}
if (config.exe == EX_WIN64)
{
if (numpara < 4 * REGSIZE)
numpara = 4 * REGSIZE;
}
//printf("numpara = %d, stackpush = %d\n", numpara, stackpush);
assert((numpara & (REGSIZE - 1)) == 0);
assert((stackpush & (REGSIZE - 1)) == 0);
/* Should consider reordering the order of evaluation of the parameters
* so that args that go into registers are evaluated after args that get
* pushed. We can reorder args that are constants or relconst's.
*/
/* Determine if we should use cgstate.funcarg for the parameters or push them
*/
bool usefuncarg = false;
static if (0)
{
printf("test1 %d %d %d %d %d %d %d %d\n", (config.flags4 & CFG4speed)!=0, !Alloca.size,
!(usednteh & (NTEH_try | NTEH_except | NTEHcpp | EHcleanup | EHtry | NTEHpassthru)),
cast(int)numpara, !stackpush,
(cgstate.funcargtos == ~0 || numpara < cgstate.funcargtos),
(!typfunc(tyf) || sf && sf.Sflags & SFLexit), !I16);
}
if (config.flags4 & CFG4speed &&
!Alloca.size &&
/* The cleanup code calls a local function, leaving the return address on
* the top of the stack. If parameters are placed there, the return address
* is stepped on.
* A better solution is turn this off only inside the cleanup code.
*/
!usednteh &&
!calledFinally &&
(numpara || config.exe == EX_WIN64) &&
stackpush == 0 && // cgstate.funcarg needs to be at top of stack
(cgstate.funcargtos == ~0 || numpara < cgstate.funcargtos) &&
(!(typfunc(tyf) || tyf == TYhfunc) || sf && sf.Sflags & SFLexit) &&
!anyiasm && !I16
)
{
for (int i = 0; i < np; i++)
{
elem* ep = parameters[i].e;
int preg = parameters[i].reg;
//printf("parameter[%d] = %d, np = %d\n", i, preg, np);
if (preg == NOREG)
{
switch (ep.Eoper)
{
case OPstrctor:
case OPstrthis:
case OPstrpar:
case OPnp_fp:
goto Lno;
default:
break;
}
}
}
if (numpara > cgstate.funcarg.size)
{ // New high water mark
//printf("increasing size from %d to %d\n", (int)cgstate.funcarg.size, (int)numpara);
cgstate.funcarg.size = numpara;
}
usefuncarg = true;
}
Lno:
/* Adjust start of the stack so after all args are pushed,
* the stack will be aligned.
*/
if (!usefuncarg && STACKALIGN >= 16 && (numpara + stackpush) & (STACKALIGN - 1))
{
numalign = STACKALIGN - ((numpara + stackpush) & (STACKALIGN - 1));
cod3_stackadj(cdb, numalign);
cdb.genadjesp(numalign);
stackpush += numalign;
stackpushsave += numalign;
}
assert(stackpush == stackpushsave);
if (config.exe == EX_WIN64)
{
//printf("np = %d, numpara = %d, stackpush = %d\n", np, numpara, stackpush);
assert(numpara == ((np < 4) ? 4 * REGSIZE : np * REGSIZE));
// Allocate stack space for four entries anyway
// http://msdn.microsoft.com/en-US/library/ew5tede7(v=vs.80)
}
int[XMM7 + 1] regsaved = void;
memset(regsaved.ptr, -1, regsaved.sizeof);
CodeBuilder cdbrestore;
cdbrestore.ctor();
regm_t saved = 0;
targ_size_t funcargtossave = cgstate.funcargtos;
targ_size_t funcargtos = numpara;
//printf("funcargtos1 = %d\n", cast(int)funcargtos);
/* Parameters go into the registers RDI,RSI,RDX,RCX,R8,R9
* float and double parameters go into XMM0..XMM7
* For variadic functions, count of XMM registers used goes in AL
*/
for (int i = 0; i < np; i++)
{
elem* ep = parameters[i].e;
int preg = parameters[i].reg;
//printf("parameter[%d] = %d, np = %d\n", i, preg, np);
if (preg == NOREG)
{
/* Push parameter on stack, but keep track of registers used
* in the process. If they interfere with keepmsk, we'll have
* to save/restore them.
*/
CodeBuilder cdbsave;
cdbsave.ctor();
regm_t overlap = msavereg & keepmsk;
msavereg |= keepmsk;
CodeBuilder cdbparams;
cdbparams.ctor();
if (usefuncarg)
movParams(cdbparams, ep, stackalign, cast(uint)funcargtos, tyf);
else
pushParams(cdbparams,ep,stackalign, tyf);
regm_t tosave = keepmsk & ~msavereg;
msavereg &= ~keepmsk | overlap;
// tosave is the mask to save and restore
for (reg_t j = 0; tosave; j++)
{
regm_t mi = mask(j);
assert(j <= XMM7);
if (mi & tosave)
{
uint idx;
regsave.save(cdbsave, j, &idx);
regsave.restore(cdbrestore, j, idx);
saved |= mi;
keepmsk &= ~mi; // don't need to keep these for rest of params
tosave &= ~mi;
}
}
cdb.append(cdbsave);
cdb.append(cdbparams);
// Alignment for parameter comes after it got pushed
const uint numalignx = parameters[i].numalign;
if (usefuncarg)
{
funcargtos -= _align(stackalign, paramsize(ep, tyf)) + numalignx;
cgstate.funcargtos = funcargtos;
}
else if (numalignx)
{
cod3_stackadj(cdb, numalignx);
cdb.genadjesp(numalignx);
stackpush += numalignx;
}
}
else
{
// Goes in register preg, not stack
regm_t retregs = mask(preg);
if (retregs & XMMREGS)
++xmmcnt;
int preg2 = parameters[i].reg2;
reg_t mreg,lreg;
if (preg2 != NOREG)
{
// BUG: still doesn't handle case of mXMM0|mAX or mAX|mXMM0
assert(ep.Eoper != OPstrthis);
if (mask(preg2) & XMMREGS)
{
++xmmcnt;
lreg = XMM0;
mreg = XMM1;
}
else
{
lreg = mask(preg ) & mLSW ? cast(reg_t)preg : AX;
mreg = mask(preg2) & mMSW ? cast(reg_t)preg2 : DX;
}
retregs = mask(mreg) | mask(lreg);
CodeBuilder cdbsave;
cdbsave.ctor();
if (keepmsk & retregs)
{
regm_t tosave = keepmsk & retregs;
// tosave is the mask to save and restore
for (reg_t j = 0; tosave; j++)
{
regm_t mi = mask(j);
assert(j <= XMM7);
if (mi & tosave)
{
uint idx;
regsave.save(cdbsave, j, &idx);
regsave.restore(cdbrestore, j, idx);
saved |= mi;
keepmsk &= ~mi; // don't need to keep these for rest of params
tosave &= ~mi;
}
}
}
cdb.append(cdbsave);
scodelem(cdb, ep, &retregs, keepmsk, false);
// Move result [mreg,lreg] into parameter registers from [preg2,preg]
retregs = 0;
if (preg != lreg)
retregs |= mask(preg);
if (preg2 != mreg)
retregs |= mask(preg2);
getregs(cdb,retregs);
tym_t ty1 = tybasic(ep.Ety);
tym_t ty2 = ty1;
if (ty1 == TYstruct)
{
type* targ1 = ep.ET.Ttag.Sstruct.Sarg1type;
type* targ2 = ep.ET.Ttag.Sstruct.Sarg2type;
if (targ1)
ty1 = targ1.Tty;
if (targ2)
ty2 = targ2.Tty;
}
else if (tyrelax(ty1) == TYcent)
ty1 = ty2 = TYllong;
else if (tybasic(ty1) == TYcdouble)
ty1 = ty2 = TYdouble;
foreach (v; 0 .. 2)
{
if (v ^ (preg != mreg))
genmovreg(cdb, preg, lreg, ty1);
else
genmovreg(cdb, preg2, mreg, ty2);
}
retregs = mask(preg) | mask(preg2);
}
else if (ep.Eoper == OPstrthis)
{
getregs(cdb,retregs);
// LEA preg,np[RSP]
uint delta = stackpush - ep.EV.Vuns; // stack delta to parameter
cdb.genc1(LEA,
(modregrm(0,4,SP) << 8) | modregxrm(2,preg,4), FLconst,delta);
if (I64)
code_orrex(cdb.last(), REX_W);
}
else if (ep.Eoper == OPstrpar && config.exe == EX_WIN64 && type_size(ep.ET) == 0)
{
}
else
{
scodelem(cdb, ep, &retregs, keepmsk, false);
}
keepmsk |= retregs; // don't change preg when evaluating func address
}
}
if (config.exe == EX_WIN64)
{ // Allocate stack space for four entries anyway
// http://msdn.microsoft.com/en-US/library/ew5tede7(v=vs.80)
{ uint sz = 4 * REGSIZE;
if (usefuncarg)
{
funcargtos -= sz;
cgstate.funcargtos = funcargtos;
}
else
{
cod3_stackadj(cdb, sz);
cdb.genadjesp(sz);
stackpush += sz;
}
}
/* Variadic functions store XMM parameters into their corresponding GP registers
*/
for (int i = 0; i < np; i++)
{
int preg = parameters[i].reg;
regm_t retregs = mask(preg);
if (retregs & XMMREGS)
{
reg_t reg;
switch (preg)
{
case XMM0: reg = CX; break;
case XMM1: reg = DX; break;
case XMM2: reg = R8; break;
case XMM3: reg = R9; break;
default: assert(0);
}
getregs(cdb,mask(reg));
cdb.gen2(STOD,(REX_W << 16) | modregxrmx(3,preg-XMM0,reg)); // MOVD reg,preg
}
}
}
// Restore any register parameters we saved
getregs(cdb,saved);
cdb.append(cdbrestore);
keepmsk |= saved;
// Variadic functions store the number of XMM registers used in AL
if (I64 && config.exe != EX_WIN64 && e.Eflags & EFLAGS_variadic)
{
getregs(cdb,mAX);
movregconst(cdb,AX,xmmcnt,1);
keepmsk |= mAX;
}
//printf("funcargtos2 = %d\n", (int)funcargtos);
assert(!usefuncarg || (funcargtos == 0 && cgstate.funcargtos == 0));
cgstate.stackclean--;
debug
if (!usefuncarg && numpara != stackpush - stackpushsave)
{
printf("function %s\n", funcsym_p.Sident.ptr);
printf("numpara = %d, stackpush = %d, stackpushsave = %d\n", numpara, stackpush, stackpushsave);
elem_print(e);
}
assert(usefuncarg || numpara == stackpush - stackpushsave);
funccall(cdb,e,numpara,numalign,pretregs,keepmsk,usefuncarg);
cgstate.funcargtos = funcargtossave;
}
/***********************************
*/
void cdstrthis(ref CodeBuilder cdb, elem* e, regm_t* pretregs)
{
assert(tysize(e.Ety) == REGSIZE);
const reg = findreg(*pretregs & allregs);
getregs(cdb,mask(reg));
// LEA reg,np[ESP]
uint np = stackpush - e.EV.Vuns; // stack delta to parameter
cdb.genc1(LEA,(modregrm(0,4,SP) << 8) | modregxrm(2,reg,4),FLconst,np);
if (I64)
code_orrex(cdb.last(), REX_W);
fixresult(cdb, e, mask(reg), pretregs);
}
/******************************
* Call function. All parameters have already been pushed onto the stack.
* Params:
* e = function call
* numpara = size in bytes of all the parameters
* numalign = amount the stack was aligned by before the parameters were pushed
* pretregs = where return value goes
* keepmsk = registers to not change when evaluating the function address
* usefuncarg = using cgstate.funcarg, so no need to adjust stack after func return
*/
private void funccall(ref CodeBuilder cdb, elem* e, uint numpara, uint numalign,
regm_t* pretregs,regm_t keepmsk, bool usefuncarg)
{
//printf("%s ", funcsym_p.Sident.ptr);
//printf("funccall(e = %p, *pretregs = %s, numpara = %d, numalign = %d, usefuncarg=%d)\n",e,regm_str(*pretregs),numpara,numalign,usefuncarg);
calledafunc = 1;
// Determine if we need frame for function prolog/epilog
static if (TARGET_WINDOS)
{
if (config.memmodel == Vmodel)
{
if (tyfarfunc(funcsym_p.ty()))
needframe = true;
}
}
code cs;
regm_t retregs;
Symbol* s;
elem* e1 = e.EV.E1;
tym_t tym1 = tybasic(e1.Ety);
char farfunc = tyfarfunc(tym1) || tym1 == TYifunc;
CodeBuilder cdbe;
cdbe.ctor();
if (e1.Eoper == OPvar)
{ // Call function directly
if (!tyfunc(tym1))
WRTYxx(tym1);
assert(tyfunc(tym1));
s = e1.EV.Vsym;
if (s.Sflags & SFLexit)
{ }
else if (s != tls_get_addr_sym)
save87(cdb); // assume 8087 regs are all trashed
// Function calls may throw Errors, unless marked that they don't
if (s == funcsym_p || !s.Sfunc || !(s.Sfunc.Fflags3 & Fnothrow))
funcsym_p.Sfunc.Fflags3 &= ~Fnothrow;
if (s.Sflags & SFLexit)
{
// Function doesn't return, so don't worry about registers
// it may use
}
else if (!tyfunc(s.ty()) || !(config.flags4 & CFG4optimized))
// so we can replace func at runtime
getregs(cdbe,~fregsaved & (mBP | ALLREGS | mES | XMMREGS));
else
getregs(cdbe,~s.Sregsaved & (mBP | ALLREGS | mES | XMMREGS));
if (strcmp(s.Sident.ptr, "alloca") == 0)
{
s = getRtlsym(RTLSYM_ALLOCA);
makeitextern(s);
int areg = CX;
if (config.exe == EX_WIN64)
areg = DX;
getregs(cdbe, mask(areg));
cdbe.genc(LEA, modregrm(2, areg, BPRM), FLallocatmp, 0, 0, 0); // LEA areg,&localsize[BP]
if (I64)
code_orrex(cdbe.last(), REX_W);
Alloca.size = REGSIZE;
}
if (sytab[s.Sclass] & SCSS) // if function is on stack (!)
{
retregs = allregs & ~keepmsk;
s.Sflags &= ~GTregcand;
s.Sflags |= SFLread;
cdrelconst(cdbe,e1,&retregs);
if (farfunc)
{
const reg = findregmsw(retregs);
const lsreg = findreglsw(retregs);
floatreg = true; // use float register
reflocal = true;
cdbe.genc1(0x89, // MOV floatreg+2,reg
modregrm(2, reg, BPRM), FLfltreg, REGSIZE);
cdbe.genc1(0x89, // MOV floatreg,lsreg
modregrm(2, lsreg, BPRM), FLfltreg, 0);
if (tym1 == TYifunc)
cdbe.gen1(0x9C); // PUSHF
cdbe.genc1(0xFF, // CALL [floatreg]
modregrm(2, 3, BPRM), FLfltreg, 0);
}
else
{
const reg = findreg(retregs);
cdbe.gen2(0xFF, modregrmx(3, 2, reg)); // CALL reg
if (I64)
code_orrex(cdbe.last(), REX_W);
}
}
else
{
int fl = FLfunc;
if (!tyfunc(s.ty()))
fl = el_fl(e1);
if (tym1 == TYifunc)
cdbe.gen1(0x9C); // PUSHF
static if (TARGET_LINUX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
{
assert(!farfunc);
if (s != tls_get_addr_sym)
{
//printf("call %s\n", s.Sident.ptr);
load_localgot(cdb);
cdbe.gencs(0xE8, 0, fl, s); // CALL extern
}
else if (I64)
{
/* Prepend 66 66 48 so GNU linker has patch room
*/
assert(!farfunc);
cdbe.gen1(0x66);
cdbe.gen1(0x66);
cdbe.gencs(0xE8, 0, fl, s); // CALL extern
cdbe.last().Irex = REX | REX_W;
}
else
cdbe.gencs(0xE8, 0, fl, s); // CALL extern
}
else
{
cdbe.gencs(farfunc ? 0x9A : 0xE8,0,fl,s); // CALL extern
}
code_orflag(cdbe.last(), farfunc ? (CFseg | CFoff) : (CFselfrel | CFoff));
}
}
else
{ // Call function via pointer
// Function calls may throw Errors
funcsym_p.Sfunc.Fflags3 &= ~Fnothrow;
if (e1.Eoper != OPind) { WRFL(cast(FL)el_fl(e1)); WROP(e1.Eoper); }
save87(cdb); // assume 8087 regs are all trashed
assert(e1.Eoper == OPind);
elem *e11 = e1.EV.E1;
tym_t e11ty = tybasic(e11.Ety);
assert(!I16 || (e11ty == (farfunc ? TYfptr : TYnptr)));
load_localgot(cdb);
static if (TARGET_LINUX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
{
if (config.flags3 & CFG3pic && I32)
keepmsk |= mBX;
}
/* Mask of registers destroyed by the function call
*/
regm_t desmsk = (mBP | ALLREGS | mES | XMMREGS) & ~fregsaved;
// if we can't use loadea()
if ((!OTleaf(e11.Eoper) || e11.Eoper == OPconst) &&
(e11.Eoper != OPind || e11.Ecount))
{
retregs = allregs & ~keepmsk;
cgstate.stackclean++;
scodelem(cdbe,e11,&retregs,keepmsk,true);
cgstate.stackclean--;
// Kill registers destroyed by an arbitrary function call
getregs(cdbe,desmsk);
if (e11ty == TYfptr)
{
const reg = findregmsw(retregs);
const lsreg = findreglsw(retregs);
floatreg = true; // use float register
reflocal = true;
cdbe.genc1(0x89, // MOV floatreg+2,reg
modregrm(2, reg, BPRM), FLfltreg, REGSIZE);
cdbe.genc1(0x89, // MOV floatreg,lsreg
modregrm(2, lsreg, BPRM), FLfltreg, 0);
if (tym1 == TYifunc)
cdbe.gen1(0x9C); // PUSHF
cdbe.genc1(0xFF, // CALL [floatreg]
modregrm(2, 3, BPRM), FLfltreg, 0);
}
else
{
const reg = findreg(retregs);
cdbe.gen2(0xFF, modregrmx(3, 2, reg)); // CALL reg
if (I64)
code_orrex(cdbe.last(), REX_W);
}
}
else
{
if (tym1 == TYifunc)
cdb.gen1(0x9C); // PUSHF
// CALL [function]
cs.Iflags = 0;
cgstate.stackclean++;
loadea(cdbe, e11, &cs, 0xFF, farfunc ? 3 : 2, 0, keepmsk, desmsk);
cgstate.stackclean--;
freenode(e11);
}
s = null;
}
cdb.append(cdbe);
freenode(e1);
/* See if we will need the frame pointer.
Calculate it here so we can possibly use BP to fix the stack.
*/
static if (0)
{
if (!needframe)
{
// If there is a register available for this basic block
if (config.flags4 & CFG4optimized && (ALLREGS & ~regcon.used))
{ }
else
{
for (SYMIDX si = 0; si < globsym.top; si++)
{
Symbol* s = globsym.tab[si];
if (s.Sflags & GTregcand && type_size(s.Stype) != 0)
{
if (config.flags4 & CFG4optimized)
{ // If symbol is live in this basic block and
// isn't already in a register
if (s.Srange && vec_testbit(dfoidx, s.Srange) &&
s.Sfl != FLreg)
{ // Then symbol must be allocated on stack
needframe = true;
break;
}
}
else
{ if (mfuncreg == 0) // if no registers left
{ needframe = true;
break;
}
}
}
}
}
}
}
retregs = regmask(e.Ety, tym1);
if (!usefuncarg)
{
// If stack needs cleanup
if (s && s.Sflags & SFLexit)
{
if (config.fulltypes && TARGET_WINDOS)
{
// the stack walker evaluates the return address, not a byte of the
// call instruction, so ensure there is an instruction byte after
// the call that still has the same line number information
cdb.gen1(config.target_cpu >= TARGET_80286 ? UD2 : INT3);
}
/* Function never returns, so don't need to generate stack
* cleanup code. But still need to log the stack cleanup
* as if it did return.
*/
cdb.genadjesp(-(numpara + numalign));
stackpush -= numpara + numalign;
}
else if ((OTbinary(e.Eoper) || config.exe == EX_WIN64) &&
(!typfunc(tym1) || config.exe == EX_WIN64))
{
if (tym1 == TYhfunc)
{ // Hidden parameter is popped off by the callee
cdb.genadjesp(-REGSIZE);
stackpush -= REGSIZE;
if (numpara + numalign > REGSIZE)
genstackclean(cdb, numpara + numalign - REGSIZE, retregs);
}
else
genstackclean(cdb, numpara + numalign, retregs);
}
else
{
cdb.genadjesp(-numpara); // popped off by the callee's 'RET numpara'
stackpush -= numpara;
if (numalign) // callee doesn't know about alignment adjustment
genstackclean(cdb,numalign,retregs);
}
}
/* Special handling for functions which return a floating point
value in the top of the 8087 stack.
*/
if (retregs & mST0)
{
cdb.genadjfpu(1);
if (*pretregs) // if we want the result
{
//assert(stackused == 0);
push87(cdb); // one item on 8087 stack
fixresult87(cdb,e,retregs,pretregs);
return;
}
else
// Pop unused result off 8087 stack
cdb.gen2(0xDD, modregrm(3, 3, 0)); // FPOP
}
else if (retregs & mST01)
{
cdb.genadjfpu(2);
if (*pretregs) // if we want the result
{
assert(stackused == 0);
push87(cdb);
push87(cdb); // two items on 8087 stack
fixresult_complex87(cdb, e, retregs, pretregs);
return;
}
else
{
// Pop unused result off 8087 stack
cdb.gen2(0xDD, modregrm(3, 3, 0)); // FPOP
cdb.gen2(0xDD, modregrm(3, 3, 0)); // FPOP
}
}
fixresult(cdb, e, retregs, pretregs);
}
/***************************
* Determine size of argument e that will be pushed.
*/
targ_size_t paramsize(elem* e, tym_t tyf)
{
assert(e.Eoper != OPparam);
targ_size_t szb;
tym_t tym = tybasic(e.Ety);
if (tyscalar(tym))
szb = size(tym);
else if (tym == TYstruct || tym == TYarray)
szb = type_parameterSize(e.ET, tyf);
else
{
WRTYxx(tym);
assert(0);
}
return szb;
}
/***************************
* Generate code to move argument e on the stack.
*/
private void movParams(ref CodeBuilder cdb, elem* e, uint stackalign, uint funcargtos, tym_t tyf)
{
//printf("movParams(e = %p, stackalign = %d, funcargtos = %d)\n", e, stackalign, funcargtos);
//printf("movParams()\n"); elem_print(e);
assert(!I16);
assert(e && e.Eoper != OPparam);
tym_t tym = tybasic(e.Ety);
if (tyfloating(tym))
objmod.fltused();
int grex = I64 ? REX_W << 16 : 0;
targ_size_t szb = paramsize(e, tyf); // size before alignment
targ_size_t sz = _align(stackalign, szb); // size after alignment
assert((sz & (stackalign - 1)) == 0); // ensure that alignment worked
assert((sz & (REGSIZE - 1)) == 0);
//printf("szb = %d sz = %d\n", (int)szb, (int)sz);
code cs;
cs.Iflags = 0;
cs.Irex = 0;
switch (e.Eoper)
{
case OPstrctor:
case OPstrthis:
case OPstrpar:
case OPnp_fp:
assert(0);
case OPrelconst:
{
int fl;
if (!evalinregister(e) &&
!(I64 && (config.flags3 & CFG3pic || config.exe == EX_WIN64)) &&
((fl = el_fl(e)) == FLdata || fl == FLudata || fl == FLextern)
)
{
// MOV -stackoffset[EBP],&variable
cs.Iop = 0xC7;
cs.Irm = modregrm(2,0,BPRM);
if (I64 && sz == 8)
cs.Irex |= REX_W;
cs.IFL1 = FLfuncarg;
cs.IEV1.Voffset = funcargtos - REGSIZE;
cs.IEV2.Voffset = e.EV.Voffset;
cs.IFL2 = cast(ubyte)fl;
cs.IEV2.Vsym = e.EV.Vsym;
cs.Iflags |= CFoff;
cdb.gen(&cs);
return;
}
break;
}
case OPconst:
if (!evalinregister(e))
{
cs.Iop = (sz == 1) ? 0xC6 : 0xC7;
cs.Irm = modregrm(2,0,BPRM);
cs.IFL1 = FLfuncarg;
cs.IEV1.Voffset = funcargtos - sz;
cs.IFL2 = FLconst;
targ_size_t *p = cast(targ_size_t *) &(e.EV);
cs.IEV2.Vsize_t = *p;
if (I64 && tym == TYcldouble)
// The alignment of EV.Vcldouble is not the same on the compiler
// as on the target
goto Lbreak;
if (I64 && sz >= 8)
{
int i = cast(int)sz;
do
{
if (*p >= 0x80000000)
{ // Use 64 bit register MOV, as the 32 bit one gets sign extended
// MOV reg,imm64
// MOV EA,reg
goto Lbreak;
}
p = cast(targ_size_t *)(cast(char *) p + REGSIZE);
i -= REGSIZE;
} while (i > 0);
p = cast(targ_size_t *) &(e.EV);
}
int i = cast(int)sz;
do
{ int regsize = REGSIZE;
regm_t retregs = (sz == 1) ? BYTEREGS : allregs;
reg_t reg;
if (reghasvalue(retregs,*p,®))
{
cs.Iop = (cs.Iop & 1) | 0x88;
cs.Irm |= modregrm(0, reg & 7, 0); // MOV EA,reg
if (reg & 8)
cs.Irex |= REX_R;
if (I64 && sz == 1 && reg >= 4)
cs.Irex |= REX;
}
if (I64 && sz >= 8)
cs.Irex |= REX_W;
cdb.gen(&cs); // MOV EA,const
p = cast(targ_size_t *)(cast(char *) p + regsize);
cs.Iop = 0xC7;
cs.Irm &= cast(ubyte)~cast(int)modregrm(0, 7, 0);
cs.Irex &= ~REX_R;
cs.IEV1.Voffset += regsize;
cs.IEV2.Vint = cast(targ_int)*p;
i -= regsize;
} while (i > 0);
return;
}
Lbreak:
break;
default:
break;
}
regm_t retregs = tybyte(tym) ? BYTEREGS : allregs;
if (tyvector(tym))
{
retregs = XMMREGS;
codelem(cdb, e, &retregs, false);
const op = xmmstore(tym);
const r = findreg(retregs);
cdb.genc1(op, modregxrm(2, r - XMM0, BPRM), FLfuncarg, funcargtos - 16); // MOV funcarg[EBP],r
checkSetVex(cdb.last(),tym);
return;
}
else if (tyfloating(tym))
{
if (config.inline8087)
{
retregs = tycomplex(tym) ? mST01 : mST0;
codelem(cdb, e, &retregs, false);
opcode_t op;
uint r;
switch (tym)
{
case TYfloat:
case TYifloat:
case TYcfloat:
op = 0xD9;
r = 3;
break;
case TYdouble:
case TYidouble:
case TYdouble_alias:
case TYcdouble:
op = 0xDD;
r = 3;
break;
case TYldouble:
case TYildouble:
case TYcldouble:
op = 0xDB;
r = 7;
break;
default:
assert(0);
}
if (tycomplex(tym))
{
// FSTP sz/2[ESP]
cdb.genc1(op, modregxrm(2, r, BPRM), FLfuncarg, funcargtos - sz/2);
pop87();
}
pop87();
cdb.genc1(op, modregxrm(2, r, BPRM), FLfuncarg, funcargtos - sz); // FSTP -sz[EBP]
return;
}
}
scodelem(cdb, e, &retregs, 0, true);
if (sz <= REGSIZE)
{
uint r = findreg(retregs);
cdb.genc1(0x89, modregxrm(2, r, BPRM), FLfuncarg, funcargtos - REGSIZE); // MOV -REGSIZE[EBP],r
if (sz == 8)
code_orrex(cdb.last(), REX_W);
}
else if (sz == REGSIZE * 2)
{
uint r = findregmsw(retregs);
cdb.genc1(0x89, grex | modregxrm(2, r, BPRM), FLfuncarg, funcargtos - REGSIZE); // MOV -REGSIZE[EBP],r
r = findreglsw(retregs);
cdb.genc1(0x89, grex | modregxrm(2, r, BPRM), FLfuncarg, funcargtos - REGSIZE * 2); // MOV -2*REGSIZE[EBP],r
}
else
assert(0);
}
/***************************
* Generate code to push argument e on the stack.
* stackpush is incremented by stackalign for each PUSH.
*/
void pushParams(ref CodeBuilder cdb, elem* e, uint stackalign, tym_t tyf)
{
//printf("params(e = %p, stackalign = %d)\n", e, stackalign);
//printf("params()\n"); elem_print(e);
stackchanged = 1;
assert(e && e.Eoper != OPparam);
tym_t tym = tybasic(e.Ety);
if (tyfloating(tym))
objmod.fltused();
int grex = I64 ? REX_W << 16 : 0;
targ_size_t szb = paramsize(e, tyf); // size before alignment
targ_size_t sz = _align(stackalign,szb); // size after alignment
assert((sz & (stackalign - 1)) == 0); // ensure that alignment worked
assert((sz & (REGSIZE - 1)) == 0);
switch (e.Eoper)
{
version (SCPP)
{
case OPstrctor:
{
elem* e1 = e.EV.E1;
docommas(cdb,&e1); // skip over any comma expressions
cod3_stackadj(cdb, sz);
stackpush += sz;
cdb.genadjesp(sz);
// Find OPstrthis and set it to stackpush
exp2_setstrthis(e1, null, stackpush, null);
regm_t retregs = 0;
codelem(cdb, e1, &retregs, true);
freenode(e);
return;
}
case OPstrthis:
// This is the parameter for the 'this' pointer corresponding to
// OPstrctor. We push a pointer to an object that was already
// allocated on the stack by OPstrctor.
{
regm_t retregs = allregs;
reg_t reg;
allocreg(cdb, &retregs, ®, TYoffset);
genregs(cdb, 0x89, SP, reg); // MOV reg,SP
if (I64)
code_orrex(cdb.last(), REX_W);
uint np = stackpush - e.EV.Vuns; // stack delta to parameter
cdb.genc2(0x81, grex | modregrmx(3, 0, reg), np); // ADD reg,np
if (sz > REGSIZE)
{
cdb.gen1(0x16); // PUSH SS
stackpush += REGSIZE;
}
cdb.gen1(0x50 + (reg & 7)); // PUSH reg
if (reg & 8)
code_orrex(cdb.last(), REX_B);
stackpush += REGSIZE;
cdb.genadjesp(sz);
freenode(e);
return;
}
}
case OPstrpar:
{
uint rm;
elem* e1 = e.EV.E1;
if (sz == 0)
{
docommas(cdb, &e1); // skip over any commas
freenode(e);
return;
}
if ((sz & 3) == 0 && (sz / REGSIZE) <= 4 && e1.Eoper == OPvar)
{
freenode(e);
e = e1;
goto L1;
}
docommas(cdb,&e1); // skip over any commas
code_flags_t seg = 0; // assume no seg override
regm_t retregs = sz ? IDXREGS : 0;
bool doneoff = false;
uint pushsize = REGSIZE;
uint op16 = 0;
if (!I16 && sz & 2) // if odd number of words to push
{
pushsize = 2;
op16 = 1;
}
else if (I16 && config.target_cpu >= TARGET_80386 && (sz & 3) == 0)
{
pushsize = 4; // push DWORDs at a time
op16 = 1;
}
uint npushes = cast(uint)(sz / pushsize);
switch (e1.Eoper)
{
case OPind:
if (sz)
{
switch (tybasic(e1.EV.E1.Ety))
{
case TYfptr:
case TYhptr:
seg = CFes;
retregs |= mES;
break;
case TYsptr:
if (config.wflags & WFssneds)
seg = CFss;
break;
case TYfgPtr:
if (I32)
seg = CFgs;
else if (I64)
seg = CFfs;
else
assert(0);
break;
case TYcptr:
seg = CFcs;
break;
default:
break;
}
}
codelem(cdb, e1.EV.E1, &retregs, false);
freenode(e1);
break;
case OPvar:
/* Symbol is no longer a candidate for a register */
e1.EV.Vsym.Sflags &= ~GTregcand;
if (!e1.Ecount && npushes > 4)
{
/* Kludge to point at last word in struct. */
/* Don't screw up CSEs. */
e1.EV.Voffset += sz - pushsize;
doneoff = true;
}
//if (LARGEDATA) /* if default isn't DS */
{
static immutable uint[4] segtocf = [ CFes,CFcs,CFss,0 ];
int fl = el_fl(e1);
if (fl == FLfardata)
{
seg = CFes;
retregs |= mES;
}
else
{
uint s = segfl[fl];
assert(s < 4);
seg = segtocf[s];
if (seg == CFss && !(config.wflags & WFssneds))
seg = 0;
}
}
if (e1.Ety & mTYfar)
{
seg = CFes;
retregs |= mES;
}
cdrelconst(cdb, e1, &retregs);
// Reverse the effect of the previous add
if (doneoff)
e1.EV.Voffset -= sz - pushsize;
freenode(e1);
break;
case OPstreq:
//case OPcond:
if (!(config.exe & EX_flat))
{
seg = CFes;
retregs |= mES;
}
codelem(cdb, e1, &retregs, false);
break;
case OPpair:
case OPrpair:
pushParams(cdb, e1, stackalign, tyf);
freenode(e);
return;
default:
elem_print(e1);
assert(0);
}
reg_t reg = findreglsw(retregs);
rm = I16 ? regtorm[reg] : regtorm32[reg];
if (op16)
seg |= CFopsize; // operand size
if (npushes <= 4)
{
assert(!doneoff);
for (; npushes > 1; --npushes)
{
cdb.genc1(0xFF, buildModregrm(2, 6, rm), FLconst, pushsize * (npushes - 1)); // PUSH [reg]
code_orflag(cdb.last(),seg);
cdb.genadjesp(pushsize);
}
cdb.gen2(0xFF,buildModregrm(0, 6, rm)); // PUSH [reg]
cdb.last().Iflags |= seg;
cdb.genadjesp(pushsize);
}
else if (sz)
{
getregs_imm(cdb, mCX | retregs);
// MOV CX,sz/2
movregconst(cdb, CX, npushes, 0);
if (!doneoff)
{ // This should be done when
// reg is loaded. Fix later
// ADD reg,sz-pushsize
cdb.genc2(0x81, grex | modregrmx(3, 0, reg), sz-pushsize);
}
getregs(cdb,mCX); // the LOOP decrements it
cdb.gen2(0xFF, buildModregrm(0, 6, rm)); // PUSH [reg]
cdb.last().Iflags |= seg | CFtarg2;
code* c3 = cdb.last();
cdb.genc2(0x81,grex | buildModregrm(3, 5,reg), pushsize); // SUB reg,pushsize
if (I16 || config.flags4 & CFG4space)
genjmp(cdb,0xE2,FLcode,cast(block *)c3);// LOOP c3
else
{
if (I64)
cdb.gen2(0xFF, modregrm(3, 1, CX));// DEC CX
else
cdb.gen1(0x48 + CX); // DEC CX
genjmp(cdb, JNE, FLcode, cast(block *)c3); // JNE c3
}
regimmed_set(CX,0);
cdb.genadjesp(cast(int)sz);
}
stackpush += sz;
freenode(e);
return;
}
case OPind:
if (!e.Ecount) /* if *e1 */
{
if (sz <= REGSIZE)
{ // Watch out for single byte quantities being up
// against the end of a segment or in memory-mapped I/O
if (!(config.exe & EX_flat) && szb == 1)
break;
goto L1; // can handle it with loadea()
}
// Avoid PUSH MEM on the Pentium when optimizing for speed
if (config.flags4 & CFG4speed &&
(config.target_cpu >= TARGET_80486 &&
config.target_cpu <= TARGET_PentiumMMX) &&
sz <= 2 * REGSIZE &&
!tyfloating(tym))
break;
if (tym == TYldouble || tym == TYildouble || tycomplex(tym))
break;
code cs;
cs.Iflags = 0;
cs.Irex = 0;
if (I32)
{
assert(sz >= REGSIZE * 2);
loadea(cdb, e, &cs, 0xFF, 6, sz - REGSIZE, 0, 0); // PUSH EA+4
cdb.genadjesp(REGSIZE);
stackpush += REGSIZE;
sz -= REGSIZE;
if (sz > REGSIZE)
{
while (sz)
{
cs.IEV1.Voffset -= REGSIZE;
cdb.gen(&cs); // PUSH EA+...
cdb.genadjesp(REGSIZE);
stackpush += REGSIZE;
sz -= REGSIZE;
}
freenode(e);
return;
}
}
else
{
if (sz == DOUBLESIZE)
{
loadea(cdb, e, &cs, 0xFF, 6, DOUBLESIZE - REGSIZE, 0, 0); // PUSH EA+6
cs.IEV1.Voffset -= REGSIZE;
cdb.gen(&cs); // PUSH EA+4
cdb.genadjesp(REGSIZE);
getlvalue_lsw(&cs);
cdb.gen(&cs); // PUSH EA+2
}
else /* TYlong */
loadea(cdb, e, &cs, 0xFF, 6, REGSIZE, 0, 0); // PUSH EA+2
cdb.genadjesp(REGSIZE);
}
stackpush += sz;
getlvalue_lsw(&cs);
cdb.gen(&cs); // PUSH EA
cdb.genadjesp(REGSIZE);
freenode(e);
return;
}
break;
case OPnp_fp:
if (!e.Ecount) /* if (far *)e1 */
{
elem* e1 = e.EV.E1;
tym_t tym1 = tybasic(e1.Ety);
/* BUG: what about pointers to functions? */
int segreg;
switch (tym1)
{
case TYnptr: segreg = 3<<3; break;
case TYcptr: segreg = 1<<3; break;
default: segreg = 2<<3; break;
}
if (I32 && stackalign == 2)
cdb.gen1(0x66); // push a word
cdb.gen1(0x06 + segreg); // PUSH SEGREG
if (I32 && stackalign == 2)
code_orflag(cdb.last(), CFopsize); // push a word
cdb.genadjesp(stackalign);
stackpush += stackalign;
pushParams(cdb, e1, stackalign, tyf);
freenode(e);
return;
}
break;
case OPrelconst:
static if (TARGET_SEGMENTED)
{
/* Determine if we can just push the segment register */
/* Test size of type rather than TYfptr because of (long)(&v) */
Symbol* s = e.EV.Vsym;
//if (sytab[s.Sclass] & SCSS && !I32) // if variable is on stack
// needframe = true; // then we need stack frame
int fl;
if (_tysize[tym] == tysize(TYfptr) &&
(fl = s.Sfl) != FLfardata &&
/* not a function that CS might not be the segment of */
(!((fl == FLfunc || s.ty() & mTYcs) &&
(s.Sclass == SCcomdat || s.Sclass == SCextern || s.Sclass == SCinline || config.wflags & WFthunk)) ||
(fl == FLfunc && config.exe == EX_DOSX)
)
)
{
stackpush += sz;
cdb.gen1(0x06 + // PUSH SEGREG
(((fl == FLfunc || s.ty() & mTYcs) ? 1 : segfl[fl]) << 3));
cdb.genadjesp(REGSIZE);
if (config.target_cpu >= TARGET_80286 && !e.Ecount)
{
getoffset(cdb, e, STACK);
freenode(e);
return;
}
else
{
regm_t retregs;
offsetinreg(cdb, e, &retregs);
const reg = findreg(retregs);
genpush(cdb,reg); // PUSH reg
cdb.genadjesp(REGSIZE);
}
return;
}
if (config.target_cpu >= TARGET_80286 && !e.Ecount)
{
stackpush += sz;
if (_tysize[tym] == tysize(TYfptr))
{
// PUSH SEG e
cdb.gencs(0x68,0,FLextern,s);
cdb.last().Iflags = CFseg;
cdb.genadjesp(REGSIZE);
}
getoffset(cdb, e, STACK);
freenode(e);
return;
}
}
break; /* else must evaluate expression */
case OPvar:
L1:
if (config.flags4 & CFG4speed &&
(config.target_cpu >= TARGET_80486 &&
config.target_cpu <= TARGET_PentiumMMX) &&
sz <= 2 * REGSIZE &&
!tyfloating(tym))
{ // Avoid PUSH MEM on the Pentium when optimizing for speed
break;
}
else if (movOnly(e) || (tyxmmreg(tym) && config.fpxmmregs) || tyvector(tym))
break; // no PUSH MEM
else
{
int regsize = REGSIZE;
uint flag = 0;
if (I16 && config.target_cpu >= TARGET_80386 && sz > 2 &&
!e.Ecount)
{
regsize = 4;
flag |= CFopsize;
}
code cs;
cs.Iflags = 0;
cs.Irex = 0;
loadea(cdb, e, &cs, 0xFF, 6, sz - regsize, RMload, 0); // PUSH EA+sz-2
code_orflag(cdb.last(), flag);
cdb.genadjesp(REGSIZE);
stackpush += sz;
while (cast(targ_int)(sz -= regsize) > 0)
{
loadea(cdb, e, &cs, 0xFF, 6, sz - regsize, RMload, 0);
code_orflag(cdb.last(), flag);
cdb.genadjesp(REGSIZE);
}
freenode(e);
return;
}
case OPconst:
{
char pushi = 0;
uint flag = 0;
int regsize = REGSIZE;
if (tycomplex(tym))
break;
if (I64 && tyfloating(tym) && sz > 4 && boolres(e))
// Can't push 64 bit non-zero args directly
break;
if (I32 && szb == 10) // special case for long double constants
{
assert(sz == 12);
targ_int value = e.EV.Vushort8[4]; // pick upper 2 bytes of Vldouble
stackpush += sz;
cdb.genadjesp(cast(int)sz);
for (int i = 0; i < 3; ++i)
{
reg_t reg;
if (reghasvalue(allregs, value, ®))
cdb.gen1(0x50 + reg); // PUSH reg
else
cdb.genc2(0x68,0,value); // PUSH value
value = e.EV.Vulong4[i ^ 1]; // treat Vldouble as 2 element array of 32 bit uint
}
freenode(e);
return;
}
assert(I64 || sz <= tysize(TYldouble));
int i = cast(int)sz;
if (!I16 && i == 2)
flag = CFopsize;
if (config.target_cpu >= TARGET_80286)
// && (e.Ecount == 0 || e.Ecount != e.Ecomsub))
{
pushi = 1;
if (I16 && config.target_cpu >= TARGET_80386 && i >= 4)
{
regsize = 4;
flag = CFopsize;
}
}
else if (i == REGSIZE)
break;
stackpush += sz;
cdb.genadjesp(cast(int)sz);
targ_uns* pi = &e.EV.Vuns; // point to start of Vdouble
targ_ushort* ps = cast(targ_ushort *) pi;
targ_ullong* pl = cast(targ_ullong *)pi;
i /= regsize;
do
{
if (i) /* be careful not to go negative */
i--;
targ_size_t value;
switch (regsize)
{
case 2:
value = ps[i];
break;
case 4:
if (tym == TYldouble || tym == TYildouble)
/* The size is 10 bytes, and since we have 2 bytes left over,
* just read those 2 bytes, not 4.
* Otherwise we're reading uninitialized data.
* I.e. read 4 bytes, 4 bytes, then 2 bytes
*/
value = i == 2 ? ps[4] : pi[i]; // 80 bits
else
value = pi[i];
break;
case 8:
value = cast(targ_size_t)pl[i];
break;
default:
assert(0);
}
reg_t reg;
if (pushi)
{
if (I64 && regsize == 8 && value != cast(int)value)
{
regwithvalue(cdb,allregs,value,®,64);
goto Preg; // cannot push imm64 unless it is sign extended 32 bit value
}
if (regsize == REGSIZE && reghasvalue(allregs,value,®))
goto Preg;
cdb.genc2((szb == 1) ? 0x6A : 0x68, 0, value); // PUSH value
}
else
{
regwithvalue(cdb, allregs, value, ®, 0);
Preg:
genpush(cdb,reg); // PUSH reg
}
code_orflag(cdb.last(), flag); // operand size
} while (i);
freenode(e);
return;
}
case OPpair:
{
if (e.Ecount)
break;
const op1 = e.EV.E1.Eoper;
const op2 = e.EV.E2.Eoper;
if ((op1 == OPvar || op1 == OPconst || op1 == OPrelconst) &&
(op2 == OPvar || op2 == OPconst || op2 == OPrelconst))
{
pushParams(cdb, e.EV.E2, stackalign, tyf);
pushParams(cdb, e.EV.E1, stackalign, tyf);
freenode(e);
}
else if (tyfloating(e.EV.E1.Ety) ||
tyfloating(e.EV.E2.Ety))
{
// Need special handling because of order of evaluation of e1 and e2
break;
}
else
{
regm_t regs = allregs;
codelem(cdb, e, ®s, false);
genpush(cdb, findregmsw(regs)); // PUSH msreg
genpush(cdb, findreglsw(regs)); // PUSH lsreg
cdb.genadjesp(cast(int)sz);
stackpush += sz;
}
return;
}
case OPrpair:
{
if (e.Ecount)
break;
const op1 = e.EV.E1.Eoper;
const op2 = e.EV.E2.Eoper;
if ((op1 == OPvar || op1 == OPconst || op1 == OPrelconst) &&
(op2 == OPvar || op2 == OPconst || op2 == OPrelconst))
{
pushParams(cdb, e.EV.E1, stackalign, tyf);
pushParams(cdb, e.EV.E2, stackalign, tyf);
freenode(e);
}
else if (tyfloating(e.EV.E1.Ety) ||
tyfloating(e.EV.E2.Ety))
{
// Need special handling because of order of evaluation of e1 and e2
break;
}
else
{
regm_t regs = allregs;
codelem(cdb, e, ®s, false);
genpush(cdb, findregmsw(regs)); // PUSH msreg
genpush(cdb, findreglsw(regs)); // PUSH lsreg
cdb.genadjesp(cast(int)sz);
stackpush += sz;
}
return;
}
default:
break;
}
regm_t retregs = tybyte(tym) ? BYTEREGS : allregs;
if (tyvector(tym) || (tyxmmreg(tym) && config.fpxmmregs))
{
regm_t retxmm = XMMREGS;
codelem(cdb, e, &retxmm, false);
stackpush += sz;
cdb.genadjesp(cast(int)sz);
cod3_stackadj(cdb, cast(int)sz);
const op = xmmstore(tym);
const r = findreg(retxmm);
cdb.gen2sib(op, modregxrm(0, r - XMM0,4 ), modregrm(0, 4, SP)); // MOV [ESP],r
checkSetVex(cdb.last(),tym);
return;
}
else if (tyfloating(tym))
{
if (config.inline8087)
{
retregs = tycomplex(tym) ? mST01 : mST0;
codelem(cdb, e, &retregs, false);
stackpush += sz;
cdb.genadjesp(cast(int)sz);
cod3_stackadj(cdb, cast(int)sz);
opcode_t op;
uint r;
switch (tym)
{
case TYfloat:
case TYifloat:
case TYcfloat:
op = 0xD9;
r = 3;
break;
case TYdouble:
case TYidouble:
case TYdouble_alias:
case TYcdouble:
op = 0xDD;
r = 3;
break;
case TYldouble:
case TYildouble:
case TYcldouble:
op = 0xDB;
r = 7;
break;
default:
assert(0);
}
if (!I16)
{
if (tycomplex(tym))
{
// FSTP sz/2[ESP]
cdb.genc1(op, (modregrm(0, 4, SP) << 8) | modregxrm(2, r, 4),FLconst, sz/2);
pop87();
}
pop87();
cdb.gen2sib(op, modregrm(0, r, 4),modregrm(0, 4, SP)); // FSTP [ESP]
}
else
{
retregs = IDXREGS; // get an index reg
reg_t reg;
allocreg(cdb, &retregs, ®, TYoffset);
genregs(cdb, 0x89, SP, reg); // MOV reg,SP
pop87();
cdb.gen2(op, modregrm(0, r, regtorm[reg])); // FSTP [reg]
}
if (LARGEDATA)
cdb.last().Iflags |= CFss; // want to store into stack
genfwait(cdb); // FWAIT
return;
}
else if (I16 && (tym == TYdouble || tym == TYdouble_alias))
retregs = mSTACK;
}
else if (I16 && sz == 8) // if long long
retregs = mSTACK;
scodelem(cdb,e,&retregs,0,true);
if (retregs != mSTACK) // if stackpush not already inc'd
stackpush += sz;
if (sz <= REGSIZE)
{
genpush(cdb,findreg(retregs)); // PUSH reg
cdb.genadjesp(cast(int)REGSIZE);
}
else if (sz == REGSIZE * 2)
{
genpush(cdb,findregmsw(retregs)); // PUSH msreg
genpush(cdb,findreglsw(retregs)); // PUSH lsreg
cdb.genadjesp(cast(int)sz);
}
}
/*******************************
* Get offset portion of e, and store it in an index
* register. Return mask of index register in *pretregs.
*/
void offsetinreg(ref CodeBuilder cdb, elem* e, regm_t* pretregs)
{
reg_t reg;
regm_t retregs = mLSW; // want only offset
if (e.Ecount && e.Ecount != e.Ecomsub)
{
regm_t rm = retregs & regcon.cse.mval & ~regcon.cse.mops & ~regcon.mvar; /* possible regs */
for (uint i = 0; rm; i++)
{
if (mask(i) & rm && regcon.cse.value[i] == e)
{
*pretregs = mask(i);
getregs(cdb, *pretregs);
goto L3;
}
rm &= ~mask(i);
}
}
*pretregs = retregs;
allocreg(cdb, pretregs, ®, TYoffset);
getoffset(cdb,e,reg);
L3:
cssave(e, *pretregs,false);
freenode(e);
}
/******************************
* Generate code to load data into registers.
*/
void loaddata(ref CodeBuilder cdb, elem* e, regm_t* pretregs)
{
reg_t reg;
reg_t nreg;
reg_t sreg;
opcode_t op;
tym_t tym;
code cs;
regm_t flags, forregs, regm;
debug
{
// if (debugw)
// printf("loaddata(e = %p,*pretregs = %s)\n",e,regm_str(*pretregs));
// elem_print(e);
}
assert(e);
elem_debug(e);
if (*pretregs == 0)
return;
tym = tybasic(e.Ety);
if (tym == TYstruct)
{
cdrelconst(cdb,e,pretregs);
return;
}
if (tyfloating(tym))
{
objmod.fltused();
if (config.inline8087)
{
if (*pretregs & mST0)
{
load87(cdb, e, 0, pretregs, null, -1);
return;
}
else if (tycomplex(tym))
{
cload87(cdb, e, pretregs);
return;
}
}
}
int sz = _tysize[tym];
cs.Iflags = 0;
cs.Irex = 0;
if (*pretregs == mPSW)
{
Symbol *s;
regm = allregs;
if (e.Eoper == OPconst)
{ /* true: OR SP,SP (SP is never 0) */
/* false: CMP SP,SP (always equal) */
genregs(cdb, (boolres(e)) ? 0x09 : 0x39 , SP, SP);
if (I64)
code_orrex(cdb.last(), REX_W);
}
else if (e.Eoper == OPvar &&
(s = e.EV.Vsym).Sfl == FLreg &&
s.Sregm & XMMREGS &&
(tym == TYfloat || tym == TYifloat || tym == TYdouble || tym ==TYidouble))
{
tstresult(cdb,s.Sregm,e.Ety,true);
}
else if (sz <= REGSIZE)
{
if (!I16 && (tym == TYfloat || tym == TYifloat))
{
allocreg(cdb, ®m, ®, TYoffset); // get a register
loadea(cdb, e, &cs, 0x8B, reg, 0, 0, 0); // MOV reg,data
cdb.gen2(0xD1,modregrmx(3,4,reg)); // SHL reg,1
}
else if (I64 && (tym == TYdouble || tym ==TYidouble))
{
allocreg(cdb, ®m, ®, TYoffset); // get a register
loadea(cdb, e,&cs, 0x8B, reg, 0, 0, 0); // MOV reg,data
// remove sign bit, so that -0.0 == 0.0
cdb.gen2(0xD1, modregrmx(3, 4, reg)); // SHL reg,1
code_orrex(cdb.last(), REX_W);
}
else if (TARGET_OSX && e.Eoper == OPvar && movOnly(e))
{
allocreg(cdb, ®m, ®, TYoffset); // get a register
loadea(cdb, e, &cs, 0x8B, reg, 0, 0, 0); // MOV reg,data
fixresult(cdb, e, regm, pretregs);
}
else
{ cs.IFL2 = FLconst;
cs.IEV2.Vsize_t = 0;
op = (sz == 1) ? 0x80 : 0x81;
loadea(cdb, e, &cs, op, 7, 0, 0, 0); // CMP EA,0
// Convert to TEST instruction if EA is a register
// (to avoid register contention on Pentium)
code *c = cdb.last();
if ((c.Iop & ~1) == 0x38 &&
(c.Irm & modregrm(3, 0, 0)) == modregrm(3, 0, 0)
)
{
c.Iop = (c.Iop & 1) | 0x84;
code_newreg(c, c.Irm & 7);
if (c.Irex & REX_B)
//c.Irex = (c.Irex & ~REX_B) | REX_R;
c.Irex |= REX_R;
}
}
}
else if (sz < 8)
{
allocreg(cdb, ®m, ®, TYoffset); // get a register
if (I32) // it's a 48 bit pointer
loadea(cdb, e, &cs, 0x0FB7, reg, REGSIZE, 0, 0); // MOVZX reg,data+4
else
{
loadea(cdb, e, &cs, 0x8B, reg, REGSIZE, 0, 0); // MOV reg,data+2
if (tym == TYfloat || tym == TYifloat) // dump sign bit
cdb.gen2(0xD1, modregrm(3, 4, reg)); // SHL reg,1
}
loadea(cdb,e,&cs,0x0B,reg,0,regm,0); // OR reg,data
}
else if (sz == 8 || (I64 && sz == 2 * REGSIZE && !tyfloating(tym)))
{
allocreg(cdb, ®m, ®, TYoffset); // get a register
int i = sz - REGSIZE;
loadea(cdb, e, &cs, 0x8B, reg, i, 0, 0); // MOV reg,data+6
if (tyfloating(tym)) // TYdouble or TYdouble_alias
cdb.gen2(0xD1, modregrm(3, 4, reg)); // SHL reg,1
while ((i -= REGSIZE) >= 0)
{
loadea(cdb, e, &cs, 0x0B, reg, i, regm, 0); // OR reg,data+i
code *c = cdb.last();
if (i == 0)
c.Iflags |= CFpsw; // need the flags on last OR
}
}
else if (sz == tysize(TYldouble)) // TYldouble
load87(cdb, e, 0, pretregs, null, -1);
else
{
elem_print(e);
assert(0);
}
return;
}
/* not for flags only */
flags = *pretregs & mPSW; /* save original */
forregs = *pretregs & (mBP | ALLREGS | mES | XMMREGS);
if (*pretregs & mSTACK)
forregs |= DOUBLEREGS;
if (e.Eoper == OPconst)
{
targ_size_t value = e.EV.Vint;
if (sz == 8)
value = cast(targ_size_t)e.EV.Vullong;
if (sz == REGSIZE && reghasvalue(forregs, value, ®))
forregs = mask(reg);
regm_t save = regcon.immed.mval;
allocreg(cdb, &forregs, ®, tym); // allocate registers
regcon.immed.mval = save; // KLUDGE!
if (sz <= REGSIZE)
{
if (sz == 1)
flags |= 1;
else if (!I16 && sz == SHORTSIZE &&
!(mask(reg) & regcon.mvar) &&
!(config.flags4 & CFG4speed)
)
flags |= 2;
if (sz == 8)
flags |= 64;
if (isXMMreg(reg))
{ /* This comes about because 0, 1, pi, etc., constants don't get stored
* in the data segment, because they are x87 opcodes.
* Not so efficient. We should at least do a PXOR for 0.
*/
reg_t r;
targ_size_t unsvalue = e.EV.Vuns;
if (sz == 8)
unsvalue = cast(targ_size_t)e.EV.Vullong;
regwithvalue(cdb,ALLREGS, unsvalue,&r,flags);
flags = 0; // flags are already set
cdb.genfltreg(0x89, r, 0); // MOV floatreg,r
if (sz == 8)
code_orrex(cdb.last(), REX_W);
assert(sz == 4 || sz == 8); // float or double
const opmv = xmmload(tym);
cdb.genxmmreg(opmv, reg, 0, tym); // MOVSS/MOVSD XMMreg,floatreg
}
else
{
movregconst(cdb, reg, value, flags);
flags = 0; // flags are already set
}
}
else if (sz < 8) // far pointers, longs for 16 bit targets
{
targ_int msw = I32 ? e.EV.Vseg
: (e.EV.Vulong >> 16);
targ_int lsw = e.EV.Voff;
regm_t mswflags = 0;
if (forregs & mES)
{
movregconst(cdb, reg, msw, 0); // MOV reg,segment
genregs(cdb, 0x8E, 0, reg); // MOV ES,reg
msw = lsw; // MOV reg,offset
}
else
{
sreg = findreglsw(forregs);
movregconst(cdb, sreg, lsw, 0);
reg = findregmsw(forregs);
/* Decide if we need to set flags when we load msw */
if (flags && (msw && msw|lsw || !(msw|lsw)))
{ mswflags = mPSW;
flags = 0;
}
}
movregconst(cdb, reg, msw, mswflags);
}
else if (sz == 8)
{
if (I32)
{
targ_long *p = cast(targ_long *)cast(void*)&e.EV.Vdouble;
if (isXMMreg(reg))
{ /* This comes about because 0, 1, pi, etc., constants don't get stored
* in the data segment, because they are x87 opcodes.
* Not so efficient. We should at least do a PXOR for 0.
*/
reg_t r;
regm_t rm = ALLREGS;
allocreg(cdb, &rm, &r, TYint); // allocate scratch register
movregconst(cdb, r, p[0], 0);
cdb.genfltreg(0x89, r, 0); // MOV floatreg,r
movregconst(cdb, r, p[1], 0);
cdb.genfltreg(0x89, r, 4); // MOV floatreg+4,r
const opmv = xmmload(tym);
cdb.genxmmreg(opmv, reg, 0, tym); // MOVSS/MOVSD XMMreg,floatreg
}
else
{
movregconst(cdb, findreglsw(forregs) ,p[0], 0);
movregconst(cdb, findregmsw(forregs) ,p[1], 0);
}
}
else
{ targ_short *p = &e.EV.Vshort; // point to start of Vdouble
assert(reg == AX);
movregconst(cdb, AX, p[3], 0); // MOV AX,p[3]
movregconst(cdb, DX, p[0], 0);
movregconst(cdb, CX, p[1], 0);
movregconst(cdb, BX, p[2], 0);
}
}
else if (I64 && sz == 16)
{
movregconst(cdb, findreglsw(forregs), cast(targ_size_t)e.EV.Vcent.lsw, 64);
movregconst(cdb, findregmsw(forregs), cast(targ_size_t)e.EV.Vcent.msw, 64);
}
else
assert(0);
// Flags may already be set
*pretregs &= flags | ~mPSW;
fixresult(cdb, e, forregs, pretregs);
return;
}
else
{
// See if we can use register that parameter was passed in
if (regcon.params &&
regParamInPreg(e.EV.Vsym) &&
!anyiasm && // may have written to the memory for the parameter
(regcon.params & mask(e.EV.Vsym.Spreg) && e.EV.Voffset == 0 ||
regcon.params & mask(e.EV.Vsym.Spreg2) && e.EV.Voffset == REGSIZE) &&
sz <= REGSIZE) // make sure no 'paint' to a larger size happened
{
reg = e.EV.Voffset ? e.EV.Vsym.Spreg2 : e.EV.Vsym.Spreg;
forregs = mask(reg);
if (debugr)
printf("%s.%d is fastpar and using register %s\n",
e.EV.Vsym.Sident.ptr,
cast(int)e.EV.Voffset,
regm_str(forregs));
mfuncreg &= ~forregs;
regcon.used |= forregs;
fixresult(cdb,e,forregs,pretregs);
return;
}
allocreg(cdb, &forregs, ®, tym); // allocate registers
if (sz == 1)
{ regm_t nregm;
debug
if (!(forregs & BYTEREGS))
{ elem_print(e);
printf("forregs = %s\n", regm_str(forregs));
}
opcode_t opmv = 0x8A; // byte MOV
static if (TARGET_OSX)
{
if (movOnly(e))
opmv = 0x8B;
}
assert(forregs & BYTEREGS);
if (!I16)
{
if (config.target_cpu >= TARGET_PentiumPro && config.flags4 & CFG4speed &&
// Workaround for OSX linker bug:
// ld: GOT load reloc does not point to a movq instruction in test42 for x86_64
!(config.exe & EX_OSX64 && !(sytab[e.EV.Vsym.Sclass] & SCSS))
)
{
// opmv = tyuns(tym) ? 0x0FB6 : 0x0FBE; // MOVZX/MOVSX
}
loadea(cdb, e, &cs, opmv, reg, 0, 0, 0); // MOV regL,data
}
else
{
nregm = tyuns(tym) ? BYTEREGS : cast(regm_t) mAX;
if (*pretregs & nregm)
nreg = reg; // already allocated
else
allocreg(cdb, &nregm, &nreg, tym);
loadea(cdb, e, &cs, opmv, nreg, 0, 0, 0); // MOV nregL,data
if (reg != nreg)
{
genmovreg(cdb, reg, nreg); // MOV reg,nreg
cssave(e, mask(nreg), false);
}
}
}
else if (forregs & XMMREGS)
{
// Can't load from registers directly to XMM regs
//e.EV.Vsym.Sflags &= ~GTregcand;
opcode_t opmv = xmmload(tym, xmmIsAligned(e));
if (e.Eoper == OPvar)
{
Symbol *s = e.EV.Vsym;
if (s.Sfl == FLreg && !(mask(s.Sreglsw) & XMMREGS))
{ opmv = LODD; // MOVD/MOVQ
/* getlvalue() will unwind this and unregister s; could use a better solution */
}
}
loadea(cdb, e, &cs, opmv, reg, 0, RMload, 0); // MOVSS/MOVSD reg,data
checkSetVex(cdb.last(),tym);
}
else if (sz <= REGSIZE)
{
opcode_t opmv = 0x8B; // MOV reg,data
if (sz == 2 && !I16 && config.target_cpu >= TARGET_PentiumPro &&
// Workaround for OSX linker bug:
// ld: GOT load reloc does not point to a movq instruction in test42 for x86_64
!(config.exe & EX_OSX64 && !(sytab[e.EV.Vsym.Sclass] & SCSS))
)
{
// opmv = tyuns(tym) ? 0x0FB7 : 0x0FBF; // MOVZX/MOVSX
}
loadea(cdb, e, &cs, opmv, reg, 0, RMload, 0);
}
else if (sz <= 2 * REGSIZE && forregs & mES)
{
loadea(cdb, e, &cs, 0xC4, reg, 0, 0, mES); // LES data
}
else if (sz <= 2 * REGSIZE)
{
if (I32 && sz == 8 &&
(*pretregs & (mSTACK | mPSW)) == mSTACK)
{
assert(0);
/+
/* Note that we allocreg(DOUBLEREGS) needlessly */
stackchanged = 1;
int i = DOUBLESIZE - REGSIZE;
do
{
loadea(cdb,e,&cs,0xFF,6,i,0,0); // PUSH EA+i
cdb.genadjesp(REGSIZE);
stackpush += REGSIZE;
i -= REGSIZE;
}
while (i >= 0);
return;
+/
}
reg = findregmsw(forregs);
loadea(cdb, e, &cs, 0x8B, reg, REGSIZE, forregs, 0); // MOV reg,data+2
if (I32 && sz == REGSIZE + 2)
cdb.last().Iflags |= CFopsize; // seg is 16 bits
reg = findreglsw(forregs);
loadea(cdb, e, &cs, 0x8B, reg, 0, forregs, 0); // MOV reg,data
}
else if (sz >= 8)
{
assert(!I32);
if ((*pretregs & (mSTACK | mPSW)) == mSTACK)
{
// Note that we allocreg(DOUBLEREGS) needlessly
stackchanged = 1;
int i = sz - REGSIZE;
do
{
loadea(cdb,e,&cs,0xFF,6,i,0,0); // PUSH EA+i
cdb.genadjesp(REGSIZE);
stackpush += REGSIZE;
i -= REGSIZE;
}
while (i >= 0);
return;
}
else
{
assert(reg == AX);
loadea(cdb, e, &cs, 0x8B, AX, 6, 0, 0); // MOV AX,data+6
loadea(cdb, e, &cs, 0x8B, BX, 4, mAX, 0); // MOV BX,data+4
loadea(cdb, e, &cs, 0x8B, CX, 2, mAX|mBX, 0); // MOV CX,data+2
loadea(cdb, e, &cs, 0x8B, DX, 0, mAX|mCX|mCX, 0); // MOV DX,data
}
}
else
assert(0);
// Flags may already be set
*pretregs &= flags | ~mPSW;
fixresult(cdb, e, forregs, pretregs);
return;
}
}
}
| D |
instance DIA_Addon_Crimson_EXIT(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 999;
condition = DIA_Addon_Crimson_EXIT_Condition;
information = DIA_Addon_Crimson_EXIT_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int DIA_Addon_Crimson_EXIT_Condition()
{
return TRUE;
};
func void DIA_Addon_Crimson_EXIT_Info()
{
Wld_StopEffect("DEMENTOR_FX");
AI_StopProcessInfos(self);
};
instance DIA_Addon_Crimson_PICKPOCKET(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 900;
condition = DIA_Addon_Crimson_PICKPOCKET_Condition;
information = DIA_Addon_Crimson_PICKPOCKET_Info;
permanent = TRUE;
description = PICKPOCKET_COMM;
};
func int DIA_Addon_Crimson_PICKPOCKET_Condition()
{
return C_Beklauen(66,66);
};
func void DIA_Addon_Crimson_PICKPOCKET_Info()
{
Info_ClearChoices(DIA_Addon_Crimson_PICKPOCKET);
Info_AddChoice(DIA_Addon_Crimson_PICKPOCKET,Dialog_Back,DIA_Addon_Crimson_PICKPOCKET_BACK);
Info_AddChoice(DIA_Addon_Crimson_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Addon_Crimson_PICKPOCKET_DoIt);
};
func void DIA_Addon_Crimson_PICKPOCKET_DoIt()
{
B_Beklauen();
Info_ClearChoices(DIA_Addon_Crimson_PICKPOCKET);
};
func void DIA_Addon_Crimson_PICKPOCKET_BACK()
{
Info_ClearChoices(DIA_Addon_Crimson_PICKPOCKET);
};
instance DIA_Addon_Crimson_Hi(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 2;
condition = DIA_Addon_Crimson_Hi_Condition;
information = DIA_Addon_Crimson_Hi_Info;
permanent = FALSE;
description = "Co to děláš? Tavíš zlato?";
};
func int DIA_Addon_Crimson_Hi_Condition()
{
return TRUE;
};
func void DIA_Addon_Crimson_Hi_Info()
{
AI_Output(other,self,"DIA_Addon_Crimson_Hi_15_00"); //Co to děláš? Tavíš zlato?
AI_Output(self,other,"DIA_Addon_Crimson_Hi_10_01"); //Ne, vařím zeleninu - samozřejmě, že tady tavím zlato a dělám z něj mince.
AI_Output(self,other,"DIA_Addon_Crimson_Hi_10_02"); //Jednoho krásného večera prostě přišel Raven a hodil mi formu na odlévání mincí.
AI_Output(self,other,"DIA_Addon_Crimson_Hi_10_03"); //A teď z jednoho zlatého nugetu udělám kopu mincí - má práce je dobrá, nikdo nepozná rozdíl!
};
instance DIA_Addon_Crimson_How(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 2;
condition = DIA_Addon_Crimson_How_Condition;
information = DIA_Addon_Crimson_How_Info;
permanent = FALSE;
description = "Kolik mincí mi dáš za nuget?";
};
func int DIA_Addon_Crimson_How_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Crimson_Hi))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Crimson_How_Info()
{
AI_Output(other,self,"DIA_Addon_Crimson_How_15_00"); //Kolik mincí mi dáš za nuget?
AI_Output(self,other,"DIA_Addon_Crimson_How_10_01"); //Nevím to jistě, ale víš co, udělám ti přátelskou cenu, dám ti...
AI_Output(self,other,"DIA_Addon_Crimson_How_10_02"); //... Pět zlatých - ne více, ne méně.
AI_Output(other,self,"DIA_Addon_Crimson_How_10_03"); //Jen pět zlatých?!
AI_Output(self,other,"DIA_Addon_Crimson_How_10_04"); //Slyšel jsi mě dobře, podmínky jsou pro všechny stejné.
};
var int CrimsonMoreGold;
instance DIA_Addon_Crimson_Feilsch(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 2;
condition = DIA_Addon_Crimson_Feilsch_Condition;
information = DIA_Addon_Crimson_Feilsch_Info;
permanent = FALSE;
description = "Chci víc zlatých!";
};
func int DIA_Addon_Crimson_Feilsch_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Crimson_How))
{
return TRUE;
};
};
func void DIA_Addon_Crimson_Feilsch_Info()
{
AI_Output(other,self,"DIA_Addon_Crimson_Feilsch_15_00"); //Chci víc zlatých!
if(RhetorikSkillValue[1] >= 40)
{
AI_Output(self,other,"DIA_Addon_Crimson_Feilsch_10_50"); //Hmm... (zavrtí hlavou) Ty víš jak ukecat lidi co?
AI_Output(self,other,"DIA_Addon_Crimson_Feilsch_10_51"); //Dobře dám ti deset zlatých za jeden nuget. Jsi štastný?
AI_Output(other,self,"DIA_Addon_Crimson_Feilsch_10_52"); //Samozřejmě.
CrimsonMoreGold = TRUE;
}
else
{
AI_Output(self,other,"DIA_Addon_Crimson_Feilsch_10_01"); //Hmm... (zamyšleně) NE! To je normální cena, jakou dostane každý.
AI_Output(other,self,"DIA_Addon_Crimson_Feilsch_15_02"); //Myslel jsem, že toto je cena pro přítele.
AI_Output(self,other,"DIA_Addon_Crimson_Feilsch_10_03"); //To je, tady jsme všichni přátelé!
};
};
instance DIA_Addon_Crimson_Gold(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 99;
condition = DIA_Addon_Crimson_Gold_Condition;
information = DIA_Addon_Crimson_Gold_Info;
permanent = TRUE;
description = "Obchodujme...";
};
func int DIA_Addon_Crimson_Gold_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Crimson_How))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Crimson_Gold_Info()
{
AI_Output(other,self,"DIA_Addon_Crimson_Gold_15_00"); //Obchodujme...
Info_ClearChoices(DIA_Addon_Crimson_Gold);
Info_AddChoice(DIA_Addon_Crimson_Gold,Dialog_Back,DIA_Addon_Crimson_Gold_BACK);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 1)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit všechny zlaté nugety)",DIA_Addon_Crimson_Gold_ALLE);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 10)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 10 zlatých nugetů)",dia_addon_crimson_gold_10);
};
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 1 zlatý nuget)",DIA_Addon_Crimson_Gold_1);
}
else
{
AI_Output(self,other,"DIA_Addon_Crimson_Gold_10_01"); //Ale vždyť nemáš žádné nugety.
};
};
func void DIA_Addon_Crimson_Gold_BACK()
{
Info_ClearChoices(DIA_Addon_Crimson_Gold);
};
func void DIA_Addon_Crimson_Gold_ALLE()
{
var int CurrentNuggets;
CurrentNuggets = Npc_HasItems(other,ItMi_Addon_GoldNugget);
B_GiveInvItems(other,self,ItMi_Addon_GoldNugget,CurrentNuggets);
Npc_RemoveInvItems(self,ItMi_Addon_GoldNugget,Npc_HasItems(self,ItMi_Addon_GoldNugget));
if(CrimsonMoreGold == TRUE)
{
B_GiveInvItems(self,other,ItMi_Gold,CurrentNuggets * 10);
}
else
{
B_GiveInvItems(self,other,ItMi_Gold,CurrentNuggets * 8);
};
Info_ClearChoices(DIA_Addon_Crimson_Gold);
Info_AddChoice(DIA_Addon_Crimson_Gold,Dialog_Back,DIA_Addon_Crimson_Gold_BACK);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 1)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit všechny zlaté nugety)",DIA_Addon_Crimson_Gold_ALLE);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 10)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 10 zlatých nugetů)",dia_addon_crimson_gold_10);
};
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 1 zlatý nuget)",DIA_Addon_Crimson_Gold_1);
};
};
func void dia_addon_crimson_gold_10()
{
B_GiveInvItems(other,self,ItMi_Addon_GoldNugget,10);
Npc_RemoveInvItems(self,ItMi_Addon_GoldNugget,Npc_HasItems(self,ItMi_Addon_GoldNugget));
if(CrimsonMoreGold == TRUE)
{
B_GiveInvItems(self,other,ItMi_Gold,100);
}
else
{
B_GiveInvItems(self,other,ItMi_Gold,80);
};
Info_ClearChoices(DIA_Addon_Crimson_Gold);
Info_AddChoice(DIA_Addon_Crimson_Gold,Dialog_Back,DIA_Addon_Crimson_Gold_BACK);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 1)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit všechny zlaté nugety)",DIA_Addon_Crimson_Gold_ALLE);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 10)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 10 zlatých nugetů)",dia_addon_crimson_gold_10);
};
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 1 zlatý nuget)",DIA_Addon_Crimson_Gold_1);
};
};
func void DIA_Addon_Crimson_Gold_1()
{
B_GiveInvItems(other,self,ItMi_Addon_GoldNugget,1);
Npc_RemoveInvItems(self,ItMi_Addon_GoldNugget,Npc_HasItems(self,ItMi_Addon_GoldNugget));
if(CrimsonMoreGold == TRUE)
{
B_GiveInvItems(self,other,ItMi_Gold,10);
}
else
{
B_GiveInvItems(self,other,ItMi_Gold,8);
};
Info_ClearChoices(DIA_Addon_Crimson_Gold);
Info_AddChoice(DIA_Addon_Crimson_Gold,Dialog_Back,DIA_Addon_Crimson_Gold_BACK);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 1)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit všechny zlaté nugety)",DIA_Addon_Crimson_Gold_ALLE);
if(Npc_HasItems(other,ItMi_Addon_GoldNugget) >= 10)
{
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 10 zlatých nugetů)",dia_addon_crimson_gold_10);
};
Info_AddChoice(DIA_Addon_Crimson_Gold,"(vyměnit 1 zlatý nuget)",DIA_Addon_Crimson_Gold_1);
};
};
func void B_Say_CrimsonBeliar()
{
AI_Output(self,other,"DIA_Addon_Crimson_FATAGN_LOS_10_00"); //(pekelně) KHARDIMON FATAGN SCHATAR FATAGN BELIAR.
};
instance DIA_Addon_Crimson_Raven(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 9;
condition = DIA_Addon_Crimson_Raven_Condition;
information = DIA_Addon_Crimson_Raven_Info;
permanent = FALSE;
description = "Co víš o Ravenovi?";
};
func int DIA_Addon_Crimson_Raven_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Crimson_How))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Crimson_Raven_Info()
{
AI_Output(other,self,"DIA_Addon_Crimson_Raven_15_00"); //Co víš o Ravenovi?
AI_Output(self,other,"DIA_Addon_Crimson_Raven_10_01"); //Nebudeš tomu věřit. Byl jsem tam. Viděl jsem co dělal v hrobce!
AI_Output(self,other,"DIA_Addon_Crimson_Raven_10_02"); //(se strachem) Mumlal a říkal jakási divná slova. Znovu a znovu...
B_Say_CrimsonBeliar();
AI_Output(self,other,"DIA_Addon_Crimson_Raven_10_03"); //(hlasitě) A potom jsem uviděl oslepující světlo a slyšel ten strašný výkřik!
AI_Output(self,other,"DIA_Addon_Crimson_Raven_10_04"); //Můj bože, ten zvuk. Bylo to, jako by se hroutil svět!
AI_Output(self,other,"DIA_Addon_Crimson_Raven_10_05"); //Raven s tím mluvil, hovořili spolu - Raven a TEN zvuk!
AI_Output(self,other,"DIA_Addon_Crimson_Raven_10_06"); //Nevzpomínám si, o čem spolu mluvili - vzpomínám si pouze, že jsem se nemohl ještě dlouho pohnout.
};
instance DIA_Addon_Crimson_FATAGN(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 98;
condition = DIA_Addon_Crimson_FATAGN_Condition;
information = DIA_Addon_Crimson_FATAGN_Info;
permanent = TRUE;
description = "Můžeš mi zopakovat Ravenova slova ještě jednou?";
};
func int DIA_Addon_Crimson_FATAGN_Condition()
{
if(Npc_KnowsInfo(other,DIA_Addon_Crimson_Raven) && (Crimson_SayBeliar < 4))
{
return TRUE;
};
return FALSE;
};
func void DIA_Addon_Crimson_FATAGN_Info()
{
Crimson_SayBeliar = Crimson_SayBeliar + 1;
AI_Output(other,self,"DIA_Addon_Crimson_FATAGN_15_00"); //Můžeš mi zopakovat Ravenova slova ještě jednou?
if(Crimson_SayBeliar <= 3)
{
AI_Output(self,other,"DIA_Addon_Crimson_FATAGN_10_01"); //Jistě, můžu.
Info_ClearChoices(DIA_Addon_Crimson_FATAGN);
Info_AddChoice(DIA_Addon_Crimson_FATAGN,"Tak povídej.",DIA_Addon_Crimson_FATAGN_LOS);
}
else
{
AI_Output(self,other,"DIA_Addon_Crimson_FATAGN_10_02"); //Myslím, že bude lepší, když už toho necháme...
};
};
func void DIA_Addon_Crimson_FATAGN_LOS()
{
Snd_Play("Mystery_09");
B_Say_CrimsonBeliar();
if(Crimson_SayBeliar == 3)
{
Wld_PlayEffect("FX_EARTHQUAKE",self,self,0,0,0,FALSE);
//Wld_PlayEffect("DEMENTOR_FX",self,self,0,0,0,FALSE);
};
Info_ClearChoices(DIA_Addon_Crimson_FATAGN);
};
instance DIA_CRIMSON_ARMORCANTEACH(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 5;
condition = dia_crimson_armorcanteach_condition;
information = dia_crimson_armorcanteach_info;
permanent = TRUE;
description = "Můžeš mi vykovat zbroj?";
};
func int dia_crimson_armorcanteach_condition()
{
if((CRIMSON_TEACHARMOR == FALSE) && (SCATTY_CANTRADEARMOR == TRUE))
{
return TRUE;
};
};
func void dia_crimson_armorcanteach_info()
{
AI_Output(other,self,"DIA_Crimson_ArmorCanTeach_01_00"); //Můžeš mi vykovat zbroj?
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_01"); //Můžu, ale co ty s tím, když ti ji nevykovám?
AI_Output(other,self,"DIA_Crimson_ArmorCanTeach_01_02"); //No, myslel jsem, jestli mě to můžeš naučit.
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_03"); //A proč bych tě to měl učit, proč sis MYSLEL, že bych tě to měl učit?
AI_Output(other,self,"DIA_Crimson_ArmorCanTeach_01_06"); //Za tvé lekce bych zaplatil.
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_07"); //Proč jsi to neřekl hned?!
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_08"); //Starej hodnej Crimson ti přece vždy ukáže pár triků.
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_09"); //Ale pro začátek se trochu musíš naučit kovat.
if(Npc_GetTalentSkill(other,NPC_TALENT_SMITH) > 0)
{
AI_Output(other,self,"DIA_Crimson_ArmorCanTeach_01_10"); //Kovat už celkem umím.
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_11"); //No, celkem jo. Aspoň to bude jednodušší.
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_12"); //Naučím tě co umím, ale musíš si zaplatit, nejsem charita!
AI_Output(other,self,"DIA_Crimson_ArmorCanTeach_01_14"); //Jasně. Chápu to.
}
else
{
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_15"); //Ale ty nemáš páru o co tu jde!
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_16"); //První najdi někoho, kdo tě naučí nejaké základy o kovařine a pak přijď.
AI_Output(self,other,"DIA_Crimson_ArmorCanTeach_01_17"); //A budeš muset zaplatit, nejsem charita!
AI_Output(other,self,"DIA_Crimson_ArmorCanTeach_01_18"); //Jasně.
};
CRIMSON_TEACHARMOR = TRUE;
Log_CreateTopic(TOPIC_ARMORTEACHER,LOG_NOTE);
B_LogEntry(TOPIC_ARMORTEACHER,"Crimson mě může naučit, jak vylepšit zbroje stráží.");
};
func void b_crimson_teacharmor_1()
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_1_01_01"); //Dobře. Vezmi nezbytné materiály...
if(!C_BodyStateContains(self,BS_MOBINTERACT_INTERRUPT) && Wld_IsMobAvailable(self,"BSANVIL"))
{
AI_SetWalkMode(self,NPC_WALK);
AI_GotoWP(self,"ADW_MINE_HOEHLE_01");
AI_AlignToWP(self);
AI_UseMob(self,"BSANVIL",5);
AI_Output(self,other,"DIA_Crimson_TeachArmor_1_01_02"); //... Na kovadlině si roztavíš ocel...
AI_Output(self,other,"DIA_Crimson_TeachArmor_1_01_03"); //... Pak jí dáš tvar, který požaduješ...
AI_Output(self,other,"DIA_Crimson_TeachArmor_1_01_04"); //... Asi takhle... (ukazuje)
AI_UseMob(self,"BSANVIL",-1);
B_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Crimson_TeachArmor_1_01_05"); //... To je vše!
AI_Output(self,other,"DIA_Crimson_TeachArmor_1_01_06"); //Teď už víš jak na to.
};
};
func void b_crimson_teacharmor_2()
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_2_01_01"); //Výborně, pamatuj si co ti teď budu ukazovat. Za prvé je nutné mít veškeré materiály pro kování.
if(!C_BodyStateContains(self,BS_MOBINTERACT_INTERRUPT) && Wld_IsMobAvailable(self,"BSANVIL"))
{
AI_SetWalkMode(self,NPC_WALK);
AI_GotoWP(self,"ADW_MINE_HOEHLE_01");
AI_AlignToWP(self);
AI_UseMob(self,"BSANVIL",5);
AI_Output(self,other,"DIA_Crimson_TeachArmor_2_01_02"); //... Vezmeš rozžhavenou ocel a ohneš ji asi takhle...
AI_Output(self,other,"DIA_Crimson_TeachArmor_2_01_03"); //... Tak se správně prolne s dalšími materiály...
AI_Output(self,other,"DIA_Crimson_TeachArmor_2_01_04"); //... A pak dostaneš něco takového... (ukazuje)
AI_UseMob(self,"BSANVIL",-1);
B_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Crimson_TeachArmor_2_01_05"); //... Hotovo!
AI_Output(self,other,"DIA_Crimson_TeachArmor_2_01_06"); //Není to ale zase tak jednoduché, věř mi.
};
};
func void b_crimson_teacharmor_3()
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_3_01_01"); //Dívej se a pamatuj si všechno co ti teď ukážu... ve skutečnosti na tom nic není.
if(!C_BodyStateContains(self,BS_MOBINTERACT_INTERRUPT) && Wld_IsMobAvailable(self,"BSANVIL"))
{
AI_SetWalkMode(self,NPC_WALK);
AI_GotoWP(self,"ADW_MINE_HOEHLE_01");
AI_AlignToWP(self);
AI_UseMob(self,"BSANVIL",5);
AI_Output(self,other,"DIA_Crimson_TeachArmor_3_01_02"); //... Připrav si ocel...
AI_Output(self,other,"DIA_Crimson_TeachArmor_3_01_03"); //... Stejnorodou směs pak smícháš s ostatními částmi...
AI_Output(self,other,"DIA_Crimson_TeachArmor_3_01_04"); //... Tak dosáhneš lepší výdrže a pevnosti... (ukazuje)
AI_UseMob(self,"BSANVIL",-1);
B_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Crimson_TeachArmor_3_01_05"); //... A máš hotovo!
AI_Output(self,other,"DIA_Crimson_TeachArmor_3_01_06"); //Je to jednoduché, jdi si to zkusit.
};
};
func void b_crimson_teacharmor_4()
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_4_01_01"); //Takže začínáme. Ujisti se, že máš všechny materiály po ruce...
if(!C_BodyStateContains(self,BS_MOBINTERACT_INTERRUPT) && Wld_IsMobAvailable(self,"BSANVIL"))
{
AI_SetWalkMode(self,NPC_WALK);
AI_GotoWP(self,"ADW_MINE_HOEHLE_01");
AI_AlignToWP(self);
AI_UseMob(self,"BSANVIL",5);
AI_Output(self,other,"DIA_Crimson_TeachArmor_4_01_02"); //... Na kovadlině ocel zformuj do menšího kousku...
AI_Output(self,other,"DIA_Crimson_TeachArmor_4_01_03"); //... Jakmile do sebe zapadne...
AI_Output(self,other,"DIA_Crimson_TeachArmor_4_01_04"); //... Můžeš ji opatrně přikovat ke zbroji... podívej... (ukazuje)
AI_UseMob(self,"BSANVIL",-1);
B_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Crimson_TeachArmor_4_01_05"); //... Hotovo!
AI_Output(self,other,"DIA_Crimson_TeachArmor_4_01_06"); //To je všechno, co bys měl vědět.
};
};
func void b_crimson_teacharmor_5()
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_5_01_01"); //No tak můžeme začít. K vytvoření této zbroje budeš potřebovat hodně času a usilí - ale veř mi, ta zbroj za to stojí!
if(!C_BodyStateContains(self,BS_MOBINTERACT_INTERRUPT) && Wld_IsMobAvailable(self,"BSANVIL"))
{
AI_SetWalkMode(self,NPC_WALK);
AI_GotoWP(self,"ADW_MINE_HOEHLE_01");
AI_AlignToWP(self);
AI_UseMob(self,"BSANVIL",5);
AI_Output(self,other,"DIA_Crimson_TeachArmor_5_01_02"); //... Vem ocel, roztav ji a pokus se ji rozdělit na zhruba stejné kousky...
AI_Output(self,other,"DIA_Crimson_TeachArmor_5_01_03"); //... Každý kousek opracuj a spoj se spojem, který si vytvoříš na zbroji...
AI_Output(self,other,"DIA_Crimson_TeachArmor_5_01_04"); //... Tímto způsobem na ni lépe připevníš kovové pláty... Asi nějak takhle... (ukazuje)
AI_Output(self,other,"DIA_Crimson_TeachArmor_5_01_05"); //... Teď je tvá zbroj odolnejší vůči střelám, ale stále je může rozrazit šipka, takže musíš udělat dvojitou výstuž...
AI_UseMob(self,"BSANVIL",-1);
B_TurnToNpc(self,other);
AI_Output(self,other,"DIA_Crimson_TeachArmor_5_01_06"); //... A máš to, jen cvič a budeš vše chápat...
AI_Output(self,other,"DIA_Crimson_TeachArmor_5_01_07"); //Jdi si to zkusit.
};
};
func void b_crimsonarmorchoices()
{
Info_ClearChoices(dia_crimson_armorteach);
Info_AddChoice(dia_crimson_armorteach,Dialog_Back,dia_crimson_armorteach_back);
if((PLAYER_TALENT_SMITH[25] == FALSE) && (Npc_HasItems(other,itar_grd_l) > 0))
{
Info_AddChoice(dia_crimson_armorteach,"Lehká zbroj stráže (cena: 750 zlatých)",dia_crimson_armorteach_itar_grd_l_v1);
};
if((PLAYER_TALENT_SMITH[26] == FALSE) && (Npc_HasItems(other,ITAR_Bloodwyn_Addon) > 0))
{
Info_AddChoice(dia_crimson_armorteach,"Zbroj stráže (cena: 1000 zlatých)",dia_crimson_armorteach_itar_bloodwyn_addon_v1);
};
if((PLAYER_TALENT_SMITH[27] == FALSE) && (Npc_HasItems(other,ITAR_Thorus_Addon) > 0))
{
Info_AddChoice(dia_crimson_armorteach,"Těžká zbroj stráže (cena: 1500 zlatých)",dia_crimson_armorteach_itar_thorus_addon_v1);
};
};
instance DIA_CRIMSON_ARMORTEACH(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 5;
condition = dia_crimson_armorteach_condition;
information = dia_crimson_armorteach_info;
permanent = TRUE;
description = "Nauč mě, jak vylepšit zbroj.";
};
func int dia_crimson_armorteach_condition()
{
if((Npc_GetTalentSkill(other,NPC_TALENT_SMITH) > 0) && (CRIMSON_TEACHARMOR == TRUE) && (SCATTY_CANTRADEARMOR == TRUE))
{
if((PLAYER_TALENT_SMITH[23] == FALSE) || (PLAYER_TALENT_SMITH[24] == FALSE) || (PLAYER_TALENT_SMITH[25] == FALSE) || (PLAYER_TALENT_SMITH[26] == FALSE) || (PLAYER_TALENT_SMITH[27] == FALSE))
{
return TRUE;
};
};
};
func void dia_crimson_armorteach_info()
{
AI_Output(other,self,"DIA_Crimson_ArmorTeach_01_00"); //Nauč mě, jak vylepšit zbroj.
AI_Output(self,other,"DIA_Crimson_ArmorTeach_01_01"); //Co chceš vědět?
b_crimsonarmorchoices();
};
func void dia_crimson_armorteach_back()
{
Info_ClearChoices(dia_crimson_armorteach);
};
func void dia_crimson_armorteach_itar_grd_l_v1()
{
if(Npc_HasItems(other,ItMi_Gold) >= 750)
{
ARMORTEACHFLAG = TRUE;
if(B_TeachPlayerTalentSmith_RemakeArmor_NoLP(self,other,WEAPON_ITAR_GRD_L_V1))
{
Npc_RemoveInvItems(other,ItMi_Gold,750);
b_crimson_teacharmor_3();
};
}
else
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_03_00"); //Myslíš, že tě to budu učit zadarmo? Přines zlato, pak si promluvíme.
};
b_crimsonarmorchoices();
};
func void dia_crimson_armorteach_itar_bloodwyn_addon_v1()
{
if(Npc_HasItems(other,ItMi_Gold) >= 1000)
{
ARMORTEACHFLAG = TRUE;
if(B_TeachPlayerTalentSmith_RemakeArmor_NoLP(self,other,WEAPON_ITAR_BLOODWYN_ADDON_V1))
{
Npc_RemoveInvItems(other,ItMi_Gold,1000);
b_crimson_teacharmor_4();
};
}
else
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_04_00"); //Myslíš, že tě to budu učit zadarmo? Přines zlato, pak si promluvíme.
};
b_crimsonarmorchoices();
};
func void dia_crimson_armorteach_itar_thorus_addon_v1()
{
if(Npc_HasItems(other,ItMi_Gold) >= 1500)
{
ARMORTEACHFLAG = TRUE;
if(B_TeachPlayerTalentSmith_RemakeArmor_NoLP(self,other,WEAPON_ITAR_THORUS_ADDON_V1))
{
Npc_RemoveInvItems(other,ItMi_Gold,1500);
b_crimson_teacharmor_5();
};
}
else
{
AI_Output(self,other,"DIA_Crimson_TeachArmor_05_00"); //Myslíš, že tě to budu učit zadarmo? Přines zlato, pak si promluvíme.
};
b_crimsonarmorchoices();
};
instance DIA_Addon_Crimson_GoldStuck(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 2;
condition = DIA_Addon_Crimson_GoldStuck_Condition;
information = DIA_Addon_Crimson_GoldStuck_Info;
permanent = FALSE;
description = "Můžeš mě naučit jak se taví zlato?";
};
func int DIA_Addon_Crimson_GoldStuck_Condition()
{
if(Npc_KnowsInfo(hero,DIA_Addon_Crimson_Hi) == TRUE)
{
return TRUE;
};
};
func void DIA_Addon_Crimson_GoldStuck_Info()
{
AI_Output(other,self,"DIA_Addon_Crimson_GoldStuck_01_00"); //Můžeš mě naučit jak se taví zlato?
AI_Output(self,other,"DIA_Addon_Crimson_GoldStuck_01_01"); //Můžu, ale ne zadarmo.
AI_Output(self,other,"DIA_Addon_Crimson_GoldStuck_01_02"); //Tento proces není nijak těžký, ale trocha praxe neuškodí.
B_LogEntry(TOPIC_STEELDRAW,"Crimson mě může naučit, jak tavit zlato.");
};
instance DIA_Addon_Crimson_DoGoldStuck(C_Info)
{
npc = BDT_1095_Addon_Crimson;
nr = 5;
condition = DIA_Addon_Crimson_DoGoldStuck_condition;
information = DIA_Addon_Crimson_DoGoldStuck_info;
permanent = TRUE;
description = "Nauč mě tavit zlato. (VB: 5, cena: 1500 zlatých)";
};
func int DIA_Addon_Crimson_DoGoldStuck_condition()
{
if((Npc_KnowsInfo(hero,DIA_Addon_Crimson_GoldStuck) == TRUE) && (KNOWHOWTOOREFUSGOLD == FALSE))
{
return TRUE;
};
};
func void DIA_Addon_Crimson_DoGoldStuck_info()
{
var int kosten;
var int money;
AI_Output(other,self,"DIA_Addon_Crimson_DoGoldStuck_01_00"); //Nauč mě roztavit zlato.
kosten = 5;
money = 1500;
if(hero.lp < kosten)
{
AI_Print(PRINT_NotEnoughLearnPoints);
B_Say(self,other,"$NOLEARNNOPOINTS");
AI_StopProcessInfos(self);
}
else if(Npc_HasItems(other,ItMi_Gold) < money)
{
AI_Print(Print_NotEnoughGold);
AI_Output(self,other,"DIA_Addon_Crimson_DoGoldStuck_03_90"); //Vždyť nemáš ani zlato. Přijď až ho budeš mít!
AI_StopProcessInfos(self);
};
if((hero.lp >= kosten) && (Npc_HasItems(other,ItMi_Gold) >= money))
{
AI_Output(self,other,"DIA_Addon_Crimson_DoGoldStuck_01_01"); //Potřebovat budeš samozřejmě zlaté nugety.
AI_Output(self,other,"DIA_Addon_Crimson_DoGoldStuck_01_02"); //Chcete-li získat jeden ingot, potřebujete asi čtvrtinu stovky zlatých nugetů.
AI_Output(self,other,"DIA_Addon_Crimson_DoGoldStuck_01_03"); //Zlato se vloží do pece, přivede na správnou teplotu.
AI_Output(self,other,"DIA_Addon_Crimson_DoGoldStuck_01_04"); //Nakonec jen sléváš do formy přes síto
hero.lp = hero.lp - kosten;
RankPoints = RankPoints + kosten;
Npc_RemoveInvItems(other,ItMi_Gold,money);
AI_Print("Naučeno: Tavení zlata");
KNOWHOWTOOREFUSGOLD = TRUE;
Snd_Play("LevelUP");
B_LogEntry(TOPIC_STEELDRAW,"K přetavení zlatých nugetů na ingot potřebuji výheň a pětadvacet zlatých nugetů.");
};
}; | D |
instance GUR_1204_BaalNamib(Npc_Default)
{
name[0] = "Идол Намиб";
npcType = npctype_main;
guild = GIL_GUR;
level = 29;
flags = NPC_FLAG_IMMORTAL;
voice = 2;
id = 1204;
attribute[ATR_STRENGTH] = 70;
attribute[ATR_DEXTERITY] = 55;
attribute[ATR_MANA_MAX] = 50;
attribute[ATR_MANA] = 50;
attribute[ATR_HITPOINTS_MAX] = 388;
attribute[ATR_HITPOINTS] = 388;
Mdl_SetVisual(self,"HUMANS.MDS");
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
Mdl_SetVisualBody(self,"hum_body_Naked0",1,1,"Hum_Head_Psionic",20,1,gur_armor_m);
B_Scale(self);
Mdl_SetModelFatness(self,-1);
Npc_SetTalentSkill(self,NPC_TALENT_MAGE,6);
CreateInvItem(self,ItArRuneSleep);
EquipItem(self,Namibs_Keule);
daily_routine = Rtn_Start_1204;
fight_tactic = FAI_HUMAN_MAGE;
};
func void Rtn_Start_1204()
{
TA_Smalltalk(8,0,20,0,"PSI_PATH_1");
TA_Smalltalk(20,0,8,0,"PSI_PATH_1");
};
| D |
module sdfs.client.configuration;
import std.path : buildPath;
import appbase.utils;
public import appbase.configuration;
class Config
{
static void initConfiguration()
{
config.load(buildPath(getExePath(), "sdfs.client.conf"));
config.sys.protocol.magic.default_value!ushort = 0;
}
}
| D |
// REQUIRED_ARGS: -c
/*
TEST_OUTPUT:
---
fail_compilation/imports/foo10727b.d(25): Error: undefined identifier Frop
fail_compilation/imports/foo10727b.d(17): Error: template instance foo10727b.CirBuff!(Foo) error instantiating
fail_compilation/imports/foo10727b.d(22): instantiated from here: Bar!(Foo)
fail_compilation/imports/foo10727b.d(22): Error: template instance foo10727b.Bar!(Foo) error instantiating
---
*/
import imports.foo10727b;
| D |
// Copyright Martin Nowak 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 dget;
import std.algorithm, std.exception, std.file, std.range, std.net.curl;
pragma(lib, "curl");
void usage()
{
import std.stdio;
writeln("usage: dget [--clone|-c] [--help|-h] <repo>...");
}
int main(string[] args)
{
if (args.length == 1) return usage(), 1;
import std.getopt;
bool clone, help;
getopt(args,
"clone|c", &clone,
"help|h", &help);
if (help) return usage(), 0;
import std.typetuple;
string user, repo;
foreach(arg; args[1 .. $])
{
TypeTuple!(user, repo) = resolveRepo(arg);
enforce(!repo.exists, fmt("output folder '%s' already exists", repo));
if (clone) cloneRepo(user, repo);
else fetchMaster(user, repo).unzipTo(repo);
}
return 0;
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/// default github users for repo lookup
immutable defaultUsers = ["D-Programming-Deimos", "D-Programming-Language"];
auto resolveRepo(string arg)
{
import std.regex;
enum rule = ctRegex!(r"^(?:([^/:]*)/)?([^/:]*)$");
auto m = match(arg, rule);
enforce(!m.empty, fmt("expected 'user/repo' but found '%s'", arg));
auto user = m.captures[1];
auto repo = m.captures[2];
if (user.empty)
{
auto tail = defaultUsers.find!(u => u.hasRepo(repo))();
enforce(!tail.empty, fmt("repo '%s' was not found among '%(%s, %)'",
repo, defaultUsers));
user = tail.front;
}
import std.typecons;
return tuple(user, repo);
}
bool hasRepo(string user, string repo)
{
return fmt("https://api.github.com/users/%s/repos?type=public", user)
.reqJSON().array.canFind!(a => a.object["name"].str == repo)();
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
void cloneRepo(string user, string repo)
{
import std.process;
enforce(!system(fmt("git clone git://github.com/%s/%s", user, repo)));
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ubyte[] fetchMaster(string user, string repo)
{
auto url = fmt("https://api.github.com/repos/%s/%s/git/refs/heads/master", user, repo);
auto sha = url.reqJSON().object["object"].object["sha"].str;
std.stdio.writefln("fetching %s/%s@%s", user, repo, sha);
return download(fmt("https://github.com/%s/%s/zipball/master", user, repo));
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
auto reqJSON(string url)
{
import std.json;
return parseJSON(get(url));
}
//..............................................................................
ubyte[] download(string url)
{
// doesn't work because it already timeouts after 2 minutes
// return get!(HTTP, ubyte)();
import core.time, std.array, std.conv;
auto buf = appender!(ubyte[])();
size_t contentLength;
auto http = HTTP(url);
http.method = HTTP.Method.get;
http.onReceiveHeader((k, v)
{
if (k == "content-length")
contentLength = to!size_t(v);
});
http.onReceive((data)
{
buf.put(data);
std.stdio.writef("%sk/%sk\r", buf.data.length/1024,
contentLength ? to!string(contentLength/1024) : "?");
std.stdio.stdout.flush();
return data.length;
});
http.dataTimeout = dur!"msecs"(0);
http.perform();
immutable sc = http.statusLine().code;
enforce(sc / 100 == 2 || sc == 302,
fmt("HTTP request returned status code %s", sc));
std.stdio.writeln("done ");
return buf.data;
}
//..............................................................................
void unzipTo(ubyte[] data, string outdir)
{
import std.path, std.string, std.zip;
scope archive = new ZipArchive(data);
std.stdio.writeln("unpacking:");
string prefix;
mkdir(outdir);
foreach(name, _; archive.directory)
{
prefix = name[0 .. $ - name.find("/").length + 1];
break;
}
foreach(name, am; archive.directory)
{
if (!am.expandedSize) continue;
string path = buildPath(outdir, chompPrefix(name, prefix));
std.stdio.writeln(path);
auto dir = dirName(path);
if (!dir.empty && !dir.exists)
mkdirRecurse(dir);
archive.expand(am);
std.file.write(path, am.expandedData);
}
}
//..............................................................................
string fmt(Args...)(string fmt, auto ref Args args)
{
import std.array, std.format;
auto app = appender!string();
formattedWrite(app, fmt, args);
return app.data;
}
| D |
INSTANCE Mod_1546_PIR_Francis_DI (Npc_Default)
{
// ------ NSC ------
name = "Francis";
guild = GIL_out;
id = 1546;
voice = 13;
flags = FALSE;
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 3);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG;
// ------ Equippte Waffen ------
EquipItem (self, ItMw_Schwert1);
// ------ Inventory ------
// ------ visuals ------
B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_N_Cipher_neu, BodyTex_N, ITAR_PIR_M_Addon);
Mdl_SetModelFatness (self, 1);
Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 50);
// ------ TA anmelden ------
daily_routine = Rtn_Start_1546;
};
FUNC VOID Rtn_Start_1546 ()
{
TA_Sit_Bench (05,00,20,00,"WP_DI_FRANCIS_SIT_BENCH");
TA_Sit_Bench (20,00,05,00,"WP_DI_FRANCIS_SIT_BENCH");
};
FUNC VOID Rtn_Stollen_1546 ()
{
TA_Pick_FP (05,00,20,00,"WP_DI_HOEHLE_01_TUNNEL_4");
TA_Pick_FP (20,00,05,00,"WP_DI_HOEHLE_01_TUNNEL_4");
}; | D |
/**
* This module pulls in the types needed for cairo's Windows
* functions. Currently, it pulls in all of win32. At some
* point, someone should pin down exactly *which* modules to
* import :)
*
* Authors: Daniel Keep
* Copyright: 2006, Daniel Keep
* License: BSD v2 (http://www.opensource.org/licenses/bsd-license.php).
*/
/*
* Copyright © 2006 Daniel Keep
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of this software, nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module cairo.win32.cairotypes_win32;
public import cairo.cairotypes;
version( cairo_dfl )
{
public import dfl.internal.winapi : HDC, LOGFONTW;
}
else version( cairo_win32 )
{
public import win32.windows : HDC, LOGFONTW;
}
else
{
public import tango.sys.win32.Types : HDC, LOGFONTW;
}
| D |
module hunt.markdown.internal.ThematicBreakParser;
import hunt.markdown.node.Block;
import hunt.markdown.node.ThematicBreak;
import hunt.markdown.parser.block.AbstractBlockParser;
import hunt.markdown.parser.block.BlockContinue;
import hunt.markdown.parser.block.ParserState;
import hunt.markdown.parser.block.BlockStart;
import hunt.markdown.parser.block.MatchedBlockParser;
import hunt.markdown.parser.block.AbstractBlockParserFactory;
class ThematicBreakParser : AbstractBlockParser {
private ThematicBreak block;
this()
{
block = new ThematicBreak();
}
override public Block getBlock() {
return block;
}
public BlockContinue tryContinue(ParserState state) {
// a horizontal rule can never container > 1 line, so fail to match
return BlockContinue.none();
}
public static class Factory : AbstractBlockParserFactory {
public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) {
if (state.getIndent() >= 4) {
return BlockStart.none();
}
int nextNonSpace = state.getNextNonSpaceIndex();
string line = state.getLine();
if (isThematicBreak(line, nextNonSpace)) {
return BlockStart.of(new ThematicBreakParser()).atIndex(cast(int)(line.length));
} else {
return BlockStart.none();
}
}
}
// spec: A line consisting of 0-3 spaces of indentation, followed by a sequence of three or more matching -, _, or *
// characters, each followed optionally by any number of spaces, forms a thematic break.
private static bool isThematicBreak(string line, int index) {
int dashes = 0;
int underscores = 0;
int asterisks = 0;
int length =cast(int)(line.length);
for (int i = index; i < length; i++) {
switch (line[i]) {
case '-':
dashes++;
break;
case '_':
underscores++;
break;
case '*':
asterisks++;
break;
case ' ':
case '\t':
// Allowed, even between markers
break;
default:
return false;
}
}
return ((dashes >= 3 && underscores == 0 && asterisks == 0) ||
(underscores >= 3 && dashes == 0 && asterisks == 0) ||
(asterisks >= 3 && dashes == 0 && underscores == 0));
}
}
| D |
/home/ankit/pandora/substrate-node-template/target/release/deps/structopt-45a68b6066200b6f.rmeta: /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-0.3.21/src/lib.rs
/home/ankit/pandora/substrate-node-template/target/release/deps/libstructopt-45a68b6066200b6f.rlib: /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-0.3.21/src/lib.rs
/home/ankit/pandora/substrate-node-template/target/release/deps/structopt-45a68b6066200b6f.d: /home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-0.3.21/src/lib.rs
/home/ankit/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-0.3.21/src/lib.rs:
| D |
module raider.math.fixed;
//Fixed-point types.
| D |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.